VSMDI Normalizer

February 11th, 2010

Have you noticed that your Visual Studio test lists always seem to get re-ordered? Make sense of this randomness with the VSMDI Normalizer.

It works by sorting your test lists and tests by name, creating a consistent ordering, allowing better merging and comparison of test lists. It’s a command line tool so it can integrate with automated processes really well.

It works in two modes:

  1. Target Mode: Specify the VSMDI file as the first argument and the target output file as the second. If the target exists it will be overwritten. This is ideal if not everyone is using VSMDI Normalizer. Some file comparison tools accept external converter tools (such as Beyond Compare).
  2. In Place Mode: The VSMDI file will be normalized in place. This would be a good operation to run prior to check in. Just specify the VSMDI file as the first and only argument at the command line.

Download VSMDI Normalizer Now (~13K)

For support, visit http://www.i-think22.net/support/

VSMDI Normalizer is free for personal and commercial use. It comes with no warranty, explicit or implicit.

To use VSMDI Normalizer with Beyond Compare:

  1. Open Beyond Compare
  2. Select Tools > File Formats
  3. Click New
  4. Enter *.vsmdi as the mask
  5. In the Conversion Tab, select “External program (Unicode filenames)”.
  6. Browse for the VSMDI Normalizer tool (for the Loading field).
  7. Append the following to the Loading path: ” %s %t” (without the quotes).
  8. Check Disable editing
  9. Click Save and Close

Windows Easy Transfer: Easy when you know how

October 6th, 2009

I recently installed Windows 7 RTM on my laptop. Knowing that Asus didn’t supply 64-bit drivers for my laptop I installed the 32-bit version. After all, I only had 2GiB of RAM anyway.

Working from home the last few weeks has put more stress on my laptop than it has previously and I was constantly hitting my 2GiB limit leaving my hard drive thrashing as Windows struggled to swap pages in and out of memory.

I was surprised when I installed Windows 7 that I didn’t need to download any drivers from my manufacturer (Asus). My graphics drivers were installed through Windows Update and everything else worked out of the box. ((Unfortunately this didn’t include my Bluetooth drivers, but as I am now using the Microsoft Explorer Mouse this doesn’t seem like such a loss.))

So, after some encouragement from a friend on twitter I decided to try installing the 64-bit version of Windows 7 and if it worked, move up to 4GiB of RAM.

I already had the 64-bit image ready to go on Windows Deployment Services, but I had just recently finished setting up my machine perfectly. I was particularly worried about having to reconfigure Outlook and set up new PST file. Now I could have tried copying my user profile and transferring that way, but instead I figured that I’d give Windows Easy Transfer a try. Once I passed the initial welcome screen I was confronted with the following options:

An Easy Transfer cable

I guess this is a good idea for people who don’t have a wired home network. I didn’t have one of these cables (and I don’t think looping it back to the same computer would work right) so I moved to the next option.

A network

Surely this was the option I wanted. After all, I wanted to copy the files to my network server. Unfortunately, no. This option migrates directly to the new computer. This wasn’t right either.

RemovableDiskTransfer

An external hard disk or USB flash drive? That sounds very specific. Fortunately this includes network drives too. In fact, it just brings up a standard file dialog so you could likely store the migration file anywhere you want.

Then it was just a case of following the on-screen directions. It not only backed up the Documents folder, but it grabbed other folders on the disk and on different partitions. Unfortunately it doesn’t grab the settings for all applications, but it covered enough for my needs.

Once you’ve migrated back you get this handy migration report which you can use as a guide to see what applications you still have to install:

Previously Installed Applications

LINQ to SQL and tables with no Primary Key

July 24th, 2009

I ran into an interesting issue with LINQ to SQL yesterday. I had to update a table with no Primary Key. As I expected, LINQ to SQL wasn’t too happy with this scenario. Unfortunately LINQ to SQL will only throw an exception when you try to Insert or Delete a record with no primary key. Updates fail silently.

It’s actually quite obvious when you look into what is happening. To do an update you would usually do something like this:

var update = (from v in db.SimpleRecords
              where v.identifier == 12
              select v).First();
update.value = "new value";
db.SubmitChanges();

Of course, nothing happens. Here’s the code (slightly edited for readability) that is generated by the LINQ to SQL classes:

[Table(Name="dbo.SimpleRecord")]
public partial class SimpleRecord
{
   private int _identifier;

   private string _value;

      public SimpleTable()
      {
      }

      [Column(Storage="_identifier", AutoSync=AutoSync.Always,
         DbType="Int NOT NULL IDENTITY", IsDbGenerated=true)]
      public int identifier
      {
         get
         {
            return this._identifier;
         }
         set
         {
            if (this._identifier != value)
            {
               this._identifier = value;
            }
         }
      }

      [Column(Storage="_value", DbType="VarChar(50)")]
      public string value
      {
         get
         {
            return this._value;
         }
         set
         {
            if (this._value != value)
            {
               this._value = value;
            }
         }
      }
}

Without a primary key the two following interfaces aren’t emitted: INotifyPropertyChanging and INotifyPropertyChanged

Therefore LINQ to SQL doesn’t know that your record has changed (so can’t warn you that it can’t update).

Now that you understand the problem the solution is simple: Define a primary key in your table.

Workplace Instant Messaging Etiquette

July 4th, 2009

I’ve been getting progressively more and more annoyed at the use of Instant Messaging in the workplace. Don’t get me wrong, I think it is a fantastic way to get quick messages across to people and for communicating across boundaries (such as across the other side of the building), but I feel that there are a few rules that should be followed if Instant Messaging is going to be an effective form of communication.

1. If you want something or are asking a question put it in your first message.

Every time I am interrupted by an instant message that just says “Hi” or “Rhys” I scream a little inside. This “handshaking protocol” has broken my concentration and I am now trying to work out what the person wants. I can even see that they are feverously trying to type their actual message. Why waste my previous cycles by forcing me to process a single useless “header” and wait for the actual body. Send the header and the body at the same time!! As an example:

Hi Rhys, do you have time for a quick test review?

This message is concise, expresses the point and can easily be responded to, like so:

I’m busy. Go away.

Ok, in reality it would probably be more like this:

Sure

Or if I really am busy:

Can it wait? I am in the middle of something and should be ready in about 20 minutes.

2. Send complete messages

The last example leads us into the next rule, send complete messages. Don’t leave the recipient of your message guessing. Sure, you can’t answer all possible questions at once, but at least answer the most obvious ones. Empower the person you are communicating with  by giving them the information they need to make a decision so that the conversation can end quickly.

3. Don’t let conversations drag on

If an Instant Messaging conversation is going on too long it is a good indication that the process has broken down. If possible it may be time to get up and speak to the person the old fashioned way. You’ll be able to get more information processed more quickly. If you can’t speak in person, use a telephone or if there is just a lot of information that you need to pass, write an email.

Final words

I’m sure there are more rules that could be applied, but I know that if everyone could follow the first rule I’d be much much happier.

LINQ Talk from Queensland MSDN User Group

May 7th, 2009

Last month I did a talk on LINQ at the Queensland MSDN User Group. For your viewing pleasure the talk is available on Live Meeting. Check it out here:

LINQ: Powerful Stuff (QMSDNUG)

You may need to skip the first 5 minutes.

Slides are available here: http://linq.i-think22.net/LinqApril2009.pdf

Demos will be available soon.