
Check it and others out at xkcd.com!

If you get an instant message with the following message, don't click on it. If you MUST click on it, don't enter your username and password.
"Did someone delete you from their MSN? Check http://www.messengerstatus.biz it's really good and it works!!!"
The site asks for your Microsoft Messenger username and password, then I believe that it promptly logs onto your messenger account and sends the same message to all of your contacts.
If you HAVE registered. Change the password of your Messenger E-mail account ASAP, and be more careful!
I've gotten a lot of these IM's today from people on my contact list, and figured I'd post a warning...
The Beta 2 release of Visual Studio 2008 has been released and is available for download from the HERE. This release sport the following new features.
Check out Scott's post here for more details...
Upgraded to Vista with IIS7 and started getting an error when trying to run an existing DotNetNuke ASP.Net project I've been working on.
Here's a snippet from the stack trace...
DotNetNuke.Services.Exceptions.PageLoadException: Object reference not set to an instance of an object. ---> System.NullReferenceException: Object reference not set to an instance of an object. at DotNetNuke.Services.Localization.Localization.GetEnabledLocales()
Was able to figure this one out after playing with the IIS7 settings for a while. You need to update your IIS application to use a different application pool than the default. Right click on your application in IIS and select Advanced Settings. Under Behavior change the Application Pool from DefaultAppPool to Classic .NET AppPool.
That should clear up this issue for you.
If you have read my post about iTunes vs Pandora, you'd know that I dig the new online service for streaming tunes at work. The only problem with the service, in my opinion, is that you need to leave a browser window open while listening...
I started to look for a solution to allow you to either minimize your Pandora or play it in your System Tray. I found a cool little app that lets you do just this. You even get a nice context menu from the system tray icon that allows you to issue commands to Pandora without having opening it.
Makes Pandora even better IMO! Check it out.
I just upgraded to Windows Vista this weekend and am trying to get my development box up and running. We us Infragistics in a couple of our ASP.Net projects and I'm finding that it's not quite as straight forward to install it on Vista.
I found a great site with a walk-through of how to setup your Vista and IIS to allows Infragistics to install correctly.
Basically you need to do the following...
That should allow you to get your infragistics installed on Windows Vista Ultimate and IIS 7.0.
I recently took the plunge and installed Vista Ultimate on my Dev box. I'm sure this will have it's ups and downs, but on the bright side... It will most definitely spawn lots of blog posts.
I will be installing Orcas soon and playing around too. I will also be focusing as much as I can on WPF, WCF, and WWF, so I'm sure I will have a lot of fun stuff to blog about for the next few months (after I get back from my Honeymoon that is. Yay for Hawaii...!)
This goes along with my last post. We were trying to use the returning statement to return the value of a newly inserted row when using an OracleDataAdapter and Parameter.Direction = ParameterDirection.ReturnValue. The difference is, we were using a select statement instead of values() as our input parameters.
Here is a simple example...
OracleDataAdapter oda = new OracleDataAdapter();
oda.InsertCommand = RemedyMD.CreateCommand();
oda.InsertCommand.CommandType = CommandType.Text;
oda.InsertCommand.CommandText =
"INSERT INTO users (name, email) (select name, email where firstName = :firstName) returning userID into :out";
oda.InsertCommand.Parameters.Add("firstName", OracleType.VarChar);
oda.InsertCommand.Parameters["firstName"].Value = firstName;
oda.InsertCommand.Parameters.Add("out", OracleType.Number);
oda.InsertCommand.Parameters["out"].Direction = ParameterDirection.ReturnValue;
oda.InsertCommand.ExecuteNonQuery();
I learned how to use an OracleDataAdapter Parameter as an "out parameter" by setting it's direction = ParameterDirection.ReturnValue. Using this with an insert statement is a great way to return the primary key value of the newly inserted row.
Here is a simple example...
OracleDataAdapter oda = new OracleDataAdapter();
oda.InsertCommand = RemedyMD.CreateCommand();
oda.InsertCommand.CommandType = CommandType.Text;
oda.InsertCommand.CommandText =
"INSERT INTO users (name, email) VALUES (:name, :email) " +
"returning userID into :out";
oda.InsertCommand.Parameters.Add("name", OracleType.VarChar);
oda.InsertCommand.Parameters["name"].Value = userName;
oda.InsertCommand.Parameters.Add("email", OracleType.VarChar);
oda.InsertCommand.Parameters["email"].Value = userEmail;
oda.InsertCommand.Parameters.Add("out", OracleType.Number);
oda.InsertCommand.Parameters["out"].Direction = ParameterDirection.ReturnValue;
oda.InsertCommand.ExecuteNonQuery();
int newUserId = -1;
if(int.TryParse(oda .InsertCommand.Parameters["out"].Value.ToString(), out newUserId)){
// Perform additional query that required the newly inserted row's primary key
}
It was fairly hard for me to find (google) this information, so I figured I'd post it in hopes that it would help someone else.
| Character # | Level | Days | Hours |
| 1 | 62 | 8 | 18 |
| 2 | 61 | 8 | 22 |
| 3 | 65 | 8 | 10 |
| 4 | 63 | 14 | 19 |
| 5 | 66 | 17 | 17 |
| 6 | 70 | 24 | 7 |
| 7 | 65 | 30 | 7 |
| 8 | 70 | 24 | 19 |
| 9 | 70 | 38 | 17 |
| 10 | 69 | 19 | 5 |
| 11 | 70 | 62 | 10 |
| Totals | 252 | 151 |
I've been a long-time iTunes user (ever since I stopped using winAmp religiously a few years ago...) I have a ton of MP3s, an iPod, and have been a huge fan of streaming radio feeds while at work or home and not into anything I have in my playlist. There are a ton of stations to choose from, almost any genre, style, country of origin... You name it an you can probably find it on iTunes'...
I heard about Pandora a few months ago and just barely got around to trying it out. I must say, from the second I entered my first artist into Pandora, I've loved it. It started playing one of my favorite songs by that artist immediately and the sound quality was amazing. As I started to fiddle with the site, the power of the idea hit me. Not only play the songs and artists that I suggest to you, but infer what else I might like by my choices... Why didn't they have this years ago...?
If you really like or dislike a new song that comes up, click on the up or down thumb icon and it will update your preferences and modify what comes next... Pandora starts to learn what you like by your interactions with the site. Wether you're adding new songs or artists, or just rating the new stuff they throw at you, you are helping Pandora send you just the types of music you want to hear!
I've only been using the site for one full day now, but I'm already a fan... I've only loaded up iTunes once and that was to update my iPod for a workout. =) We'll have to see if Pandora takes over my streaming audio needs, and even pulls me away from my MP3s. What better way to be introduced to new artists and songs that you might love as much as your preferred artists...
You can even create new Pandora "Stations" which you can customize to a certain type or style of music. I have one for Hard & Fast, Soft & Chill, and Techno so far and can imagine quite a few more that I would want to listen to based on my mood...
If you haven't yet, check it out. =)
I've been participating in a company game of Virtual Stock Exchange (VSE) that we have running at my current employer. We have about 12 people in the game and it's pretty fun to see how everyone invests, and how well it pans out. If nothing else, it's good to get a better understanding of the markets.
The game is somewhat realistic because it's based off the market and only lags a bit behind. Josh and I setup an Open Game of VSE that anyone can join and participate in. If you're interested, come and create an account and invite your friends and family!
Use the information and directions below to join the game.
Game ID: ezcomeezgo
Game Password: ezcomeezgo
Join now, and see if you can win my Open Game competition! The more participants the higher the level of competition.
I have been building some .Net web services lately and created one that was trying to return a generic IDictionary. (IDictionary<int, int>) To my surprise and ultimate disappointment, I was presented with the following Server Error when trying to access my webservice...
It looks like the XmlSerializer is unable to serialize objects that implement IDictionary. How annoying! I use a lot of generic dictionaries and it's a bit of a pain work around this XmlSerializer limitation. I was able to find a solution from this Aaron Skonnard post on the msdn site.
The solution shows you how to write a class that actually wraps your dictionary object. The values of your dictionary are copied to an array of serializable objects which are allowed to be passed through your web service and then deserialized on the other end. Pretty handy and worked really well in our solution.
Aaron warns that the IXmlSerializable interface is undocumented/unsupported feature of the .Net Framework and is subject to change at any time.
The MacBook Pro gets a Face-Life (not that it needed one.) Apple announced that it's MacBook Pro line will be getting a boost with bigger processors, beefier graphics and more space for memory!
The new stats for the three models are...
All versions of the new MacBook Pro can support 4GB of RAM instead of just 2GB like the last generation. The newly available video card is Nvidia's GeForce 8600M GT card. The upgraded processors are Intel's latest version of the Centrino, code-named the "Santa Rosa".
I find that I'm having a really hard time NOT being able to justify buying a MacBook Pro, and this new announcement makes that decision even harder! They are sexy, powerful, and have the ability to run both Windows and Mac operating systems. What's not to love...!?!
public class LanguageDto : IComparable { private String name; public string Name { get { return name; } set { name = value; } } public LanguageDto(string name) { this.name = name; } #region IComparable Members public int CompareTo(object obj) { if (obj is LanguageDto) { LanguageDto language = (LanguageDto)obj; return this.name.CompareTo(language.name); } throw new ArgumentException(string.Format("Cannot compare a LanguageDto to an {0}", obj.GetType().ToString())); } #endregion }
STEP 2
ArrayList.Adapter((IList)languages).Sort();
Note: languages is of type "IList<LanguageDto>"
Languages should then be a sorted list of your type!
And what better way to test it than to post a new blog announcing it! If you're reading this, then it works FINE!
Get your copy HERE!
Ran into an issue today while trying to connect to a Java Web Service from a .Net environment. It looks like this happens when Web Service Security is enabled in the application server of the web service and uses the ActorURI attribute. .Net's Web Services Enhancements feature does not support relative URI's for this attribute and basically FUBAR's on you. Therefore, you must us an absolute URI.
An example of an absolute URI is "http://LoginWebService" while an example of a relative URI would be "LoginWebService"... You must configure your Application Server to using either the Rational Application Developer or the Application Server Toolkit.
Firefox can be a memory hog, but is the browser really to blame...? I am currently waiting for my second gig of memory at my new job, and I've had to do a few tweaks to keep this baby humming along with it's single gig. I've noticed that Firefox has been quite the memory hog lately with an average memory usage around 170 megs. I did a bit of research and found a couple of things that seem to help.
Add-Ons
Not all add-ons are created equal...! I use a few Firefox add-ons every day at work, and never really thought that they might be causing problems. Some add-ons straight up contain memory leaks (cybernetnews) that will eat up your available memory when using them in Firefox. Just having a few add-ons "enabled" in Firefox is enough to bloat your memory usage, even if they are only used every once in a while. You might want to play around with enabling and disabling your favorite (or not so favorite) add-ons to see which might be causing the bulk of your Firefox related memory issues.
Config
I also found a helpful tip (here) that allows you to specify that Firefox should not be loaded into memory when minimized. Just by minimizing firefox, you can clear up a lot of the lost memory (look at firefoxes memory usage before and after a minimize.)
Firefox might maximize a bit slower with this fix because the browser will be moved from memory to your HD but I haven't noticed any difference.
I have a friend that constantly has at least three firefox windows open with about 10million tabs open in each. I'd imagine that a fix like this might help out a bit on his firefox memory usage. =) I'm not nearly that bad, and it's already helped a ton...
<appSettings> <add key="pswd" value="YourGmailPassword"/> <add key="account" value="yourUserName@gmail.com"/> <add key="host" value="smtp.gmail.com" /> </appSettings>
public void SendMail(string host, int port, string userName, string pswd, string fromAddress, string toAddress, string body, string subject, bool sslEnabled) { MailMessage msg = new MailMessage(new MailAddress(fromAddress), new MailAddress(toAddress)); // Create a MailMessage object with a from and to address msg.Subject = subject; // Add your subject msg.SubjectEncoding = System.Text.Encoding.UTF8; msg.Body = body; // Add the body of your message msg.BodyEncoding = System.Text.Encoding.UTF8; msg.IsBodyHtml = false; // Does the body contain html SmtpClient client = new SmtpClient(host, port); // Create an instance of SmtpClient with your smtp host and port client.Credentials = new NetworkCredential(userName, pswd); // Assign your username and password to connect to gmail client.EnableSsl = sslEnabled; // Enable SSL try { client.Send(msg); // Try to send your message ShowMailMessage("Your message was sent successfully.", false); // A method to update a ui element with a message Clear(); } catch (SmtpException ex) { ShowMailMessage(string.Format("There was an error sending you message. {0}", ex.Message), true); } }
public void imgSubmit_Click(object sender, EventArgs e) { string pswd = ConfigurationManager.AppSettings["pswd"]; // Your Password string account = ConfigurationManager.AppSettings["account"]; // Your account name (username@gmail.com) string host = ConfigurationManager.AppSettings["host"]; // Your smtp server name (smtp.gmail.com) int port = 587; // The port used to connect to your host if (string.IsNullOrEmpty(pswd) || string.IsNullOrEmpty(account) || string.IsNullOrEmpty(host)) // Validate App Settings ShowMailMessage("Unable to send your message. Configuration Error.", true); else { SendMail(host, port, account, pswd, txtFrom.Text, account, txtBody.Text, txtSubject.Text, true); } }
I already wrote a post about creating ActiveX controls in Visual Studio 2005. To make life a bit easier, I'm going to tell you how you can debug an ActiveX control that you have built and embedded into your web page.
I deployed my web page to IIS and then bring it up in the browser (http://localhost/ActiveXTest/Default.aspx.) Once you have the page up and can see your ActiveX control, switch to Visual Studio and click on the 'Debug' menu item. Click on 'Attach to Process'.
On the Attach to Process screen, click on 'Select...' next to the Attach to: label. Select Managed Code and click on 'OK'. In the Available Processes section, select 'iexplore.exe' and click on 'Attach'.
That's all there is to it! You should now be able to place break points into your control and debug. (Assuming that there are no issues with your implementation that would prevent you from even getting to the control.)
public interface IComInterface { string Msg { set; } // Exposes the Msg property through the interface }
public partial class MessageBoxControl : UserControl, IComInterface { // Implement IComInterface public string Msg { // Implement the Property set{ MessageBox.Show(value); } // When the property's set is called, show the message box } public MessageBoxControl() { InitializeComponent(); } }
<object id="MessageBoxControl " name="MessageBoxControl " classid="ActiveXControls.dll#ActiveXControls.MessageBoxControl "> </object>
<script type="text/javascript"> function showMessageBox(){ var control = document.getElementById('MessageBoxControl'); control.Msg = document.getElementById('txtMsg').value; } </script>
We recently had a need to handle communication between an existing windows service (Running on client machines) and the current ASP.Net web application that we are working on. We chose to implement this feature using .Net Remoting and an ActiveX Control that would live on one of our aspx pages.
Implementing an ActiveX control in VS2005 using C# isn't difficult, but there are a lot of little issues that a co-worker and I encountered along the way.
I'll try and list the results of my research and a walk-through of creating a sample project. This will probably span several posts.
The steps that I will cover... Check it out HERE!
1. Create a C# Web Application project
2. Create a Windows Control Library project
a. Note: The Windows Control Library DLL file must be located in the same directory as the aspx page and NOT in the bin folder.
3. Add a user control item to the class library project
a. Creating the user control
b. Implement an Interface on your user control that will exposes members, methods, and events of your user control to COM
4. Create an object in your aspx page that embeds your user control
5. Handle communication between your web application and your ActiveX control using JavaScript
6. Expose and raise/handle user control events using javascript
7. A brief overview of configuring the .Net Framework and zone permissions to allow your web application and ActiveX control to communicate
8. Configuration issues with IIS (set to allow scripts only, not scripts and exes)
9. How to view IE7 error messages to get the exact exception that might be causing you problems.
Check it out HERE!
If you get the following error when trying to bring up your IIS hosted web page, you might need to configure IIS to use .Net 2.0 instead of 1.1.
""Unrecognized configuration section 'connectionStrings'" .Net 2.0"
You can do this through the Internet Information Services configuration. (click on RUN from the start menu, type in 'inetmgr' and hit enter.)
Bring up the properties for your web page or virtual directory and click on the ASP.NET tab. Change your ASP.NET version to the appropriate value and try again.
We recently ran into a situation where we were dynamically showing and centering model popup windows in an ajaxified environment. Our initial implementation had one down side.
We were showing and dynamically centering our div/panels via JavaScript. The windows would very briefly show up in its default location before jumping to center. Not a huge problem, but very annoying.
Our initial approach looked something like this. Statically build a hidden div/panel and when the user triggers a pop up dialog, call the CenterPanel method from JavaScript and show the panel. We were calculating the screen height and width and making it available globally.
The JavaScript process looked something like this...
CenterPanel("<%= SendToGeneralQueuePopupPanel.ClientID %>");
function CenterPanel(panelId){
var panel = document.getElementById(panelId);
if (panel) {
panel.style.top = ((screenHeight / 2) - (GetSize(panel.style.height) / 2)) + 'px';
panel.style.left = ((screenWidth /2) - (GetSize(panel.style.width) / 2)) + 'px';
}
}
The result was a panel that would show up, then jump to the center of the screen. (Annoying)
After getting a bit of time to think about the issue, I remembered a much simpler way to center a control with pure CSS rather than dealing with problematic JavaScript at all. I'd used this technique in other projects and it makes things quite a bit more simple and stops the panel from jumping around the screen.
The CSS method...
We define a Panel to use as the pop that applies our modalPopup CssClass. Notice that the panel's Width is 200 and it's Height is 60.
<asp:Panel ID="PanelPopup" runat="server" CssClass="modalPopup" Width="200" Height="60">
<div style="text-align:center;">
Are you sure you wish to continue?</div>
<div style="text-align:center;">
<asp:Button ID="ButtonYes" runat="server" Text="Yes" OnClick="ButtonYes_Click" /><input id="ButtonNo"
type="button" value="No"
onclick="return HidePopupPanel('PanelPopup', '<%= PanelPopup.ClientID %>');" />
</div>
</asp:Panel>
The modalPopup CSS...
.modalPopup{
//Other CSS
left:50%;
margin-left:-100px;
top:50%;
margin-top:-30px;
}
The CSS above sets the left edge of the panel to be aligned with the center of the browser and then adjusts the left margin of the panel by subtracting 100 pixels (which happens to be half of the panel's width.) This centers the panel horizontally. In the same way, the panel is centered vertically by setting the top of the panel to the middle of the screen and then adjusting the top margin by subtracting 30 pixels which is half of the panel's height.
You can do a lot of fun stuff by using this technique. Setting the left, top, right or bottom of a control and then modifying the margins. Play around with it...
Session["UserId"] = user.Id;
int id = (int)Session["UserId"];
Session["FirstName"] = user.FirstName;
string fName = (string)Session["FirstName"];
enum SessionKeys {
UserId = 1,
FirstName = 2
}
Session[SessionKeys.UserId .ToString()] = user.Id;
int id = (int)Session[SessionKeys.UserId .ToString()];
Session[SessionKeys.FirstName .ToString()] = user.FirstName;
string fName = (string)Session[SessionKeys.FirstName .ToString()];
public static class SessionFacade {
public static int UserId {
get {
return (int)Session[SessionKeys.UserId.ToString()];
}
set {
Session[SessionKeys.UserId.ToString()] = value;
}
}
public static string FirstName {
get {
return (string)Session[SessionKeys.FirstName.ToString()];
}
set {
Session[SessionKeys.FirstName.ToString()] = value;
}
}
}
int id = SessionFacade.UserId;
SessionFacade.UserId = user.Id;
string fName = SessionFacade.FirstName;
SessionFacade.FirstName = user.FirstName;