Be Prepared

Your machine is dead.  Now what?  I keep these bootable CDs on hand, just in case:

  1. SpinRite.  This program has saved me several times.  Fixes unusable disks that cause systems to hang.  Worth $90 the first time you use it. 
  2. Ultimate Boot CD for Windows.  This will allow you to boot a dead system from a CD and copy all the important stuff to an external hard drive (plug the hard drive in before booting).  There are also a lot of system utilities on the CD to help with repair.  Free but requires a Windows XP license.
  3. Microsoft Diagnostics and Recovery Toolset is similar in concept to Ultimate Boot CD for Windows but is from Microsoft.  Unfortunately, Microsoft restricts distribution to customers who have purchased Software Assurance.
  4. Acronis True Image Home boot disk.  Boot from CD and backup to external hard drive.  Program also performs regular backups from Windows.  $50 list.
  5. Memory testers.  These exercise the system’s memory and report on any problems found.  All free.  Memtest86, memtest86+, Windows Memory Diagnostic.

Round & Round with Enums

Enumerated constants in C# can be represented 3 different ways:

  1. as a C# program constant
  2. as a number (typically int)
  3. as a string spelled identically to the C# constant

Here a sample program demonstrating how to convert between any of these formats.

using System; using System.Collections.Generic; using System.Text; namespace ConsoleApplication2 { public enum Color { red, white, blue } class Program { static void Main(string[] args) { string toString, fromString = "red"; int toInt, fromInt = 1; Color toColor, fromColor = Color.blue; // string to enum toColor = (Color) Enum.Parse(typeof(Color), fromString); // string to int toInt = (int) (Color) Enum.Parse(typeof(Color), fromString); // int to enum toColor = (Color) fromInt; // int to string toString = ((Color) fromInt).ToString(); // enum to string toString = fromColor.ToString(); // enum to int toInt = (int) fromColor; Console.ReadLine(); } } }

Dropbox Does it Right

I sent my kid off to college this fall and it didn’t require a soothsayer to know that she wouldn’t do any backups and at the end of the semester her hard drive would crap out.  After an emergency repair with the magnificent SpinRite, I started looking into personal cloud based backups.  Dropbox was the only solution that did it all just right.  After installing Dropbox you designate a folder to watch (your dropbox).  Then just do your work, saving it in your dropbox.  Every time a changed file is closed it gets backed up to the cloud.  Nice touches include an file icon overlay to indicate backup status and a tray icon that shows overall backup status.  Need your stuff?  Go to the Dropbox web site and download it or use another computer with Dropbox installed.  You can get 2 gigabytes of space for free.  What’s not to like?

Upcoming Speaking Engagements

I’ll be speaking on New Debugging Features of Visual Studio 2010 twice next week.

First will be the New Jersey Microsoft Developer's Group on Thursday, March 4 at 6:00.

On Saturday, March 6, I’ll be one of many speakers at Code Camp NYC 4, speaking time not yet set.

Hope to see you at either event!