Tool Tip: Create a list of Globally Unique IDs with TurboGUID
I’m proud to announce the launch of a little website called TurboGUID. I put this site together out of frustration having to manually generate unique ids for my work.
TurboGUID - Create a list of Globally Unique IDs
Sometimes I need to create a bunch of GUIDs for my work but generally you can only create one at a time. There are a number of ways to create them, but I normally use the Microsoft utility guidgen.exe - recently I had to create over a hundred GUIDs so I figured I should just spend a little bit of time writing some code to do it for me. Simple code, but definitely a time saver!
This release is only iteration one so if you have any comments or suggestions on extra features then please leave me a message and I’ll add your suggestions to a future iteration.
If you’re asking what a GUID is or what you might use one for, you may want to read the next website:
GUID wiki - Another wiki post that describes more than I care to on my own site
Enjoy!
Code Tip: Formatting the date with DateTime.ToString()
It can be difficult to format dates correctly, especially when formats vary between database, code and UI. Why not format your dates for the UI using the static DateTime.ToString(String) method in C#?
Custom Date and Time Format Strings - Take control of your date formatting
Tool Tip: Windows PowerShell
You’re not still using “cmd” as your command line are you? If you are, shame on you! We all know that using a command line is more powerful and quicker for low level tasks. Don’t rely on your nice shiny Windows user interface because it’ll only slow you down and can’t give you the power that a good command line can.
PowerShell - Helping IT professionals acheive greater productivity
PowerShell gives you much greater access to your operating system by providing a powerful scripting language and a huge number of command line tools that promise to increase your productivity at the command line.
To get you started, here’s a quick reference guide by Bruce Payette that will help you along the way
PowerShell Quick Reference Guide - A reference guide by Bruce Payette
If you miss your Unix based university days, you can always install Cygwin and get some *nix back into your command line diet.
Cygwin - A Linux-like environment for Windows
TDD: Comparing Datasets
I’ve been writing some unit tests today to make sure that my code fetches the correct DataSet from the database. I wanted to test that the DataSet returned by the data layer matches the DataSet that I expect, so I used the following Assert statement:
Assert.AreEqual(expectedDataSet, actualDataSet); |
When I ran this test on two empty DataSets it failed with this helpful message:
NUnit.Framework.AssertionException:
Expected: <system.Data.DataSet>
But was: <system.Data.DataSet>
That suggests that while the structure and data inside two DataSets are the same, there is a fundamental difference in the objects that means you cannot compare them in this way.
It turns out that there is a quick and easy way to compare two DataSets if you want to ensure that they’re identical. Here it is:
Assert.AreEqual(expectedDataSet.GetXml(), actualDataSet.GetXml()); |
By comparing the XML serialised output of both DataSets we can ensure that the structure and data are identical.
Tool Tip: Resharper
I had planned to write about the awesome-ness of Resharper, but found a great collection of posts by Joe White that already covers it. It’s from 2007 so may be a little out of date now, but it’s still worth a read. Enjoy!
Joe White - The 31 days of Resharper.
Tool Tip: Junction for Windows XP
During my years at university I spent majority of my time on a command line, working on unix systems. One of the things I loved about unix was the ability to create symbolic links.
A symbolic link allows you to ghost the location of a file or folder to another location on your file system. This means that you can create a symbolic link from a folder (e.g. /myproject/tools/nant ) which points to another folder on the file system (e.g. /common/tools/nant/). The main benefit of doing this means that you can link to a common file or folder from many projects and maintain just one copy of that file or folder. Reducing duplication is what the DRY principle is all about, so you know its good.
Now that I’m mainly using Windows as my development OS, I don’t have symbolic links anymore. Vista has them under a different name but that won’t help anyone using Windows XP. That’s where Junction comes in handy.
Junction - A symbolic link tool for Windows
After downloading junction, I placed the executable file into C:WINDOWSSystem32 so that it will be available from the command line (i.e. it will exist in the “path” environment variable). The next step is to now create a junction!
Give this a try:
C:>junction.exe c:Test c:WINDOWS |
After completing, you should be able to see the following:
C:>dir Directory of C: 11/11/2008 23:32 0 AUTOEXEC.BAT 11/11/2008 23:32 0 CONFIG.SYS 15/01/2009 06:31 <DIR> Documents and Settings 11/11/2008 23:36 <DIR> Intel 10/03/2009 15:39 <DIR> Program Files 11/11/2008 23:43 173 Setup.log 11/03/2009 13:53 <JUNCTION> Test 09/03/2009 13:44 <DIR> WINDOWS 3 File(s) 173 bytes 5 Dir(s) 136,112,881,664 bytes free |
Notice that Windows recognises the new folder as a Junction, not a Directory. Now have a look inside C:Test
C:>dir Test Directory of C:Test 09/03/2009 13:44 . 09/03/2009 13:44 .. 09/03/2009 13:44 0 0.log 11/11/2008 15:18 <DIR> addins 19/06/2008 23:20 57,344 ALCMTR.EXE 19/06/2008 23:42 2,808,832 ALCWZRD.EXE 11/11/2008 15:22 <DIR> AppPatch 14/04/2008 12:00 1,272 Blue Lace 16.bmp 14/04/2008 12:00 82,944 clock.avi 11/11/2008 23:28 200 cmsetacl.log 14/04/2008 12:00 17,062 Coffee Bean.bmp 15/01/2009 06:35 1,444 COM+.log . . . |
What you should see is all the files contained inside C:WINDOWS. This means that C:Test now points to C:WINDOWS and appears to contain all the same files.
Removing a Junction is simple:
C:>junction.exe -d c:Test |
A WORD OF WARNING: If you delete a file in the Junction folder, it will delete the real file. Be careful not to delete files inside a Junction thinking that it will only affect that Junction.
And that about sums up the simple side of Junctions! I find it really useful to link to a common tools folder in each of my projects, so that I can get to the easily from the project and only store them on disk once. Hopefully you can find a good use for them in your next project.
Tool Tip: Launchy
I’ve grown tired of opening an explorer window and clicking through to the folder that I need. Oh if only there was a quicker way to do this?!
Actually, turns out there are plenty of options. I found an application called Launchy, that not only lets you launch applications quickly and without using the Start menu; it also lets you define custom actions to launch whatever you like!
www.launchy.net - an open source keystroke launcher.
Once I installed it and set it up to open when i hit CTRL-Space, I just added some custom commands to the “Runner” plugin available in the Options menu.
Here’s a great shortcut to open an explorer window at whatever folder you like:
Explorer /e,/root,C:\WINDOWS\system32\drivers\etc\ |
Here’s a screenshot of the ones I have just added for now. No doubt I’ll add even more of these in future. Once you set them up you can just type your keyword into Launchy and it’ll perform the action for you!

Welcome!
I’m finally starting a blog to keep track of all the cool things that I learn as a computer programmer and web developer. No matter how much we learn, there is always a universe of knowledge waiting for us to discover.
I recently read this quote, which I thought I would share:
“The universe is full of magical things, patiently waiting for our wits to grow sharper” Eden Phillpotts
In the past few months I have been busily practising all the things a good programmer should:
- Read - At the moment I’m reading this - Domain Driven Design by Eric Evans
- Practise - Plenty of unit tests, lots of refactoring and adhering to lots of other good coding practices. One I really love is DRY
- Interact - I recently went to a weekly XTC event held in London and plan to attend more often from now on. I recommend going to a local developer’s event where you live. Even if you don’t anticipate learning anything (although you most certainly will), chatting over a beer is always good
Hopefully you’ve already found and read this next website, but if not I would highly recommend visiting the agile manifesto. It was the start of my realisation that I have plenty more to learn about the job I love.
There will be more to come very soon, I’m just getting started!
Oh, and I realise that referencing Wiki pages is probably lame, so if you have a better source for any of the links above please let me know!































