It’s good to be a consultant

I'm working as a consultant for the first time in my ten year career and I'm loving every minute of it.

In the last couple of months I've worked in three very diverse teams, in three different offices and three different technology areas ranging from VB6 Interop + ASP.NET at Kelloggs, WinForms + EntLib + Oracle + Mainframe integration at Microsoft and now SharePoint (MOSS 2007) at Lend Lease.

The quantity & quality of things that you learn from interacting with such diverse people is mind blowing. For now, I'm going to sit back and enjoy the ride!

Playing the currency game

If like me you frequently send money back to Sri Lanka, it's important to know how to play the game.

You can save yourself some dollars or rupees by knowing if things are going up or down, here's where comes to help.

Pick the two currencies from where your sending and receiving and hey presto you have a graph.


I for one will be waiting a couple more days before my next transfer.

Oh and I nearly forgot, the guys at Ceylinco Fast Cash give a really good service when sending money home. My last transfer went through like a breeze, in less than one hour, I deposited some money in Sydney and my brother withdrew from Colombo. Both of us were SMS'd every step of the way by their automated system.

Plus if you use there service about 6 times they provide a number of free benefits including a "doctor on call and other medical services for your loved ones in Sri Lanka".


tigerwoods "I view my life in a way … I'll explain it to you, OK? The greatest thing about tomorrow is, I will be better than I am today. And that's how I look at my life. I will be better as a golfer, I will be better as a person, I will be better as a father, I will be a better husband, I will be better as a friend. That's the beauty of tomorrow. There is no such thing as a setback. The lessons I learn today I will apply tomorrow, and I will be better."

Tiger Woods

No color coding for Classic ASP in Visual Studio 2008

This seems to be a bummer. Color coding and intellisense for VBScript code in Classic ASP pages have been deprecated in VS 2008.

There is a workaround for making it work for files with the .vbs extension but no solution for .asp pages. Hopefully someone would come up with a hack to get it working again.

Until then Microsoft's answer is for us to use VS 2005 or Visual Web Developer 2005. But don't install VWD if you already have VS 2008 installed since VWD will take over all file associations leaving 2008 broken.

You can let Microsoft know how much this sucks by ranting here:

Moq: Linq to Mock

Daniel Cazzulino just announced the birth of Moq, now this is mocking done right.


// ShouldExpectCallWithArgument
var mock = new Mock<IFoo>();

.Expect(x => x.DoInt(1)).Returns(11);
.Expect(x => x.DoInt(2)).Returns(22);

Assert.AreEqual(11, mock.Instance.DoInt(1));
Assert.AreEqual(22, mock.Instance.DoInt(2));


Lambda is starting to make my mouth water.

The Dangers of Static Events In User Controls

Static events in user controls can lead to all sorts of weird behavior in your application. Especially when they are hosted in forms that are loaded and unloaded during the lifetime of your application.

public partial class FlexiAddress : UserControl
    public static event EventHandler<AddressChangedEventArgs> EventAddressChanged; 

The danger here is that unless you unhook from the static event before your form closes what happens is that although the form is not visible it still hangs around in memory until your application exits.

So if you are showing the form by creating a new instance, every form that is created is loaded into memory and will actually cause a memory leak.

If you want to prove this to yourself the easiest way is to include a Debug.WriteLine in the even handler and then after you've opened and closed the hosting form a couple of times try to do an action that causes the event to be fired. You'll notice that the Output window has one line for each instance of the form that is loaded in memory.

The solution, is to remove the hook to the event handler, the Form_Closing event is probably a good place to include this.

AddressControl.EventAddressChanged -= AddressControl_EventAddressChanged;

The better solution though is to avoid using static events.

VSTS – Multiple tests with ID <guid> found

When you trying to run your tests and you come across this error message "Multiple tests with ID <guid> found", simply hit the Refresh button on the Test Manager window and you should be all set.

Visual Studio 2008 TFS breaking Unit Test Projects

On the next iteration of my current we'll be using Visual Studio 2008 and targeting .NET 3.5.

As usual I jumped the gun and installed it before the rest of the team, so I had to keep VS 2005 running at the same time. Everything was hunky dory until I installed the TFS 2008 client. This somehow caused the unit test projects to be disconnected from the TFS server. You could check out and check in stuff from the Team Explorer but the projects were showing up as disconnected from the Solution Explorer.

To get out of this mess I had to uninstall both 2005 and 2008 Team Explorer and then reinstall Team Explorer 2005.

My First Post…

Wow, it's been more than a month since my last post from Sri Lanka. Life has been quite busy and I've been overwhelmed sometimes, but things are slowly falling into place.

After getting to Australia, my first biggest challenge was to find a place to rent. The renting system in Australia is well organized but its extremely difficult for someone who doesn't have a rental reference to get a place. I was lucky, on of my friend's friend called Priyasha drove us around on our first weekend and we ended up being able to just look at one house. As luck would have it no one else applied for the house and we finally got it.

The second challenge was to buy a car. Since my first assignment is at Microsoft Australia's SDC (Software Development Centre), I had to get a car since the public transport up there was not too good. Again Priyasha came to my rescue and we ended up buying the last car we saw that day. The car although old is in much better condition than the one I sold off in Sri Lanka and it cost me only $2,750.

We moved in the week before last and had to go around buying all the stuff for the house. I ended up getting just the minimal stuff like the fridge, washing machine, microwave. It's quite a blur, considering that I spent over a year buying all the household items and that too after doing a lot of research on each item. But here it took us a couple of hours to pick all of the items from the Good Guys store.

Plus when you move into a new house you need to do whole lot of things like getting a telephone line, electricity line, gas line, but since I could do all that over the phone it was quite pain free. I've applied for a broadband line which should be hooked up by next week.