# Thursday, August 02, 2007

I have 6 invites to Pownce too. If you want one then leave your e-mail attached to a comment and I'll forward one on.

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Thursday, August 02, 2007 9:21:54 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Wednesday, June 27, 2007

As everyone knows Tony Blair resigned as Prime Minister and member of parliament today.

He'll be moving into his new house soon and turned up to the residents garden party. My sister lives in the same square and the Daily Mail managed catch her in the background when snapping pictures of him.

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Wednesday, June 27, 2007 10:53:13 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Tuesday, June 19, 2007

The results of the previous three tests are interesting. In both IE7 and Firefox all three render correctly (although the PRE tag in the first one causes the text to spill into the right hand bar). When viewing the RSS feed it becomes a whole new story:

  • IE7 doesn't honor PRE tags, single spaces or stylesheets
  • Firefox doesn't honor PRE tags, single spaces or stylesheets as well but at least it cuts out the embedded stylesheet in the last post
  • Google Reader also doesn't honor PRE tags, single spaces or stylesheets and to cap it all anything in a PRE tag just renders to the end of line and stops so it makes things impossible to read

I wonder, is there a standard that feed readers need to adhere to? What is the best way of embedding syntax colored code in blog posts?

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Tuesday, June 19, 2007 5:14:50 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback

I'm trying to get a decent solution to inserting code in blog articles so the next few posts are all about the code. The sample below is a simple line counter tool I use to work out some metrics for code reviews.

using System;
using System.Collections.Generic;
using System.Text;
using System.IO;

namespace LineCount
{
    class Program
    {
        private static int folders;
        private static int files;
        private static int lines;
        private static int code;
        private static int comments;

        static void Main(string[] args)
        {
            if (args.Length == 0)
            {
                Console.WriteLine(@"
Usage: linecount <root folder>

e.g. linecount t:\dev\projects\main

NB: Only .cs files are considered
    Review time is hard coded to 200 lines per hour
");
                return;
            }

            CountLines(new DirectoryInfo(args[0]));

            Console.WriteLine("FOLDERS:{0} FILES:{1} LOC:{2} SLOC:{3} COMMENTS:{4}", 
                folders, files, lines, code, comments);
            Console.WriteLine("Code density: {0:p}", 
                (double)code / (double)lines);
            Console.WriteLine("Comment density: {0:p}", 
                (double)comments / (double)lines);
            Console.WriteLine("Comment ratio: {0:p}", 
                (double)comments / (double)code);
            Console.WriteLine("Estimated review time: {0}h", 1+ (code / 200));
        }

        private static void CountLines(DirectoryInfo parent)
        {
            ++folders;

            foreach (DirectoryInfo folder in parent.GetDirectories())
            {
                CountLines(folder);
            }

            foreach (FileInfo file in parent.GetFiles())
            {
                CountLines(file);
            }
        }

        private static void CountLines(FileInfo file)
        {
            switch (file.Extension)
            {
                case ".cs":
                    break;
                default:
                    return;
            }

            ++files;

            using (StreamReader reader = file.OpenText())
            {
                string line = null;
                bool inComment = false;

                while ((line = reader.ReadLine()) != null)
                {
                    ++lines;
                    line = line.Trim();

                    if (line.Length == 0)
                        continue;

                    if (line.StartsWith("//"))
                    {
                        if (line.Replace("//", "").Trim().Length > 0)
                            ++comments;

                        continue;
                    }

                    if (line.StartsWith("/*"))
                        ++comments;
                    else if (!inComment)
                        ++code;

                    if (line.Contains("/*"))
                    {
                        inComment = true;
                    }

                    if (inComment && line.Contains("*/"))
                    {
                        inComment = false;
                    }
                }
            }
        }
    }
}
This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Tuesday, June 19, 2007 3:54:31 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Wednesday, February 28, 2007

Claire and I have been seeing each other for 18 months now and I decided to make things a little more permanent so along with her birthday gifts there was an extra item... Actually I wrapped it in eight consecutive boxes to fool her into thinking it was just another present. When she got to the last one the ring itself wasn't there, only the empty ring box. At which point I said "you have to say yes first" and then she said yes!

So we are engaged and I couldn't be happier. To answer the question everyone has asked so far - we don't have a date yet as it seems these things need a little planning and you can't just rock up to a church. I will keep you posted but for now we are off out to celebrate...

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Wednesday, February 28, 2007 7:42:47 PM (GMT Standard Time, UTC+00:00)  #    Comments [11] Trackback
# Friday, December 23, 2005

But before you force your kids to eat all their Brussels sprouts, just remember that a quarter of the population are supertasters and have genes that cause them to find the taste of such vegetables very bitter. So don't torture your kids this Christmas; why not try broccoli sprouts instead - just as healthy with none of the bitter taste.

(The inspiration for this post came from a real doctor who now feeds me useful information like this - thanks and Merry Christmas Claire...)

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Friday, December 23, 2005 9:47:59 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback
# Saturday, October 22, 2005
This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Saturday, October 22, 2005 3:49:53 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Saturday, October 08, 2005

I am currently trying to get my head around Javascript, AJAX and Internet Explorer but until something useful comes of it here are some links that caught my eye this week:

Actually, Tom knows all about the finer points of Javascript so hopefully some useful entries from him will point the way.

Also, it's my birthday next week and just in case anyone reading from my family doesn't know what to get me then a white iPod nano would be very much appreciated. If that is beyond your budget then some DVD's I haven't got are:

  

[Edit: Added Donnie Darko for Laura.]

[Edit: I now have Star Wars and have seen Hitchhikers and Batman so won't need them.]

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Saturday, October 08, 2005 1:33:05 PM (GMT Daylight Time, UTC+01:00)  #    Comments [2] Trackback
# Friday, September 02, 2005

If you live in the UK and need some more memory for your computer then you can't do better than this item that I'm selling on E-Bay. It's brand new and unopened, I just made the mistake of buying it before checking that my motherboard could handle it. It's just about the fastest memory you can buy, specifications are as follows:

The auction ends on 12th September 2005 10:00 am BST and the full URL for the item is:

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Friday, September 02, 2005 10:15:41 AM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Sunday, April 10, 2005
Goes the the poor person who used MSN search for “help me i need to get my girlfriend back” and was referred through to my home page…
This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Sunday, April 10, 2005 8:37:43 AM (GMT Daylight Time, UTC+01:00)  #    Comments [2] Trackback
# Friday, February 25, 2005

Software and Utilities:

Development Sites:

SQL Server:

Software Life:

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Friday, February 25, 2005 8:30:05 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback
# Thursday, January 27, 2005
Clever, but not magic. How long will it take you to work out how this Mind Reader works?
This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Thursday, January 27, 2005 10:40:18 PM (GMT Standard Time, UTC+00:00)  #    Comments [1] Trackback
# Saturday, January 15, 2005

This one can be expanded to selling anyone on an idea:

The usual set of MSDN articles:

Some notable downloads:

Finally, a couple of excellent articles by Michele Leroux Bustamante (dasblonde)

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Saturday, January 15, 2005 10:48:09 AM (GMT Standard Time, UTC+00:00)  #    Comments [0] Trackback
# Friday, October 08, 2004

So I haven't had time to blog much. There are, however, a number of links on my desktop that I've collected and meant to take a look at. So I can tidy up I'll list them here instead.

Plus some useful articles on MSDN:

(*) The title is based on a quote by Jesse from the Fast Show. Spoken in a West Country accent.

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Friday, October 08, 2004 5:12:28 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Wednesday, September 08, 2004

I was in a customer data centre today. It's quite impressive seeing all the racks of servers they have. The customer in question is one of the UK's leading banks and the physical security of the place is amazing:

  • No company name on the building - you have to know it's the right place
  • Double layer prison style fencing with security cameras
  • Steel gate that opens for your car when buzz and speak to security
  • You have to pass though an outer door (operated by security again) before signing in and picking up your pass
  • To sign in you have to have a prearranged visit organised 72 hours in advance
  • Then an inner door (security personnel operated)
  • You are now in the building but only have access to the canteen and toilets
  • You get collected by a member of staff and go to the data operations gallery to pickup a second pass (green level -> limited access)
  • Finally with this second pass you get access to the room and rack where your servers are

Once inside the server room you understand the reason for all the security. It's full of mainframes and storage systems where the bank keeps their data. Very impressive to see and kind of makes our two 2U servers look a bit small.

This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Wednesday, September 08, 2004 9:02:44 PM (GMT Daylight Time, UTC+01:00)  #    Comments [1] Trackback
# Sunday, June 13, 2004
Its a fantastically nice day (for England) but the football is on... Should I watch it or sit out?
This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Sunday, June 13, 2004 5:28:04 PM (GMT Daylight Time, UTC+01:00)  #    Comments [0] Trackback
# Saturday, June 12, 2004
Hello and welcome. I'm a program manager for a company called Exony where I look after their contact centre reporting system. I don't get to code as much as I used to but when I can it's usually C# or SQL.
This posting is provided "AS IS" with no warranties, and confers no rights.
posted on Saturday, June 12, 2004 1:59:52 PM (GMT Daylight Time, UTC+01:00)  #    Comments [2] Trackback