<?xml version="1.0" encoding="utf-8"?>
<feed xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xml:lang="en-us" xmlns="http://www.w3.org/2005/Atom">
  <title>Musings Of An Idiot</title>
  <link rel="alternate" type="text/html" href="http://www.edcourtenay.co.uk/" />
  <link rel="self" href="http://www.edcourtenay.co.uk/SyndicationService.asmx/GetAtom" />
  <icon>favicon.ico</icon>
  <updated>2009-08-05T10:25:32.3267154+01:00</updated>
  <author>
    <name>ed</name>
  </author>
  <subtitle />
  <id>http://www.edcourtenay.co.uk/</id>
  <generator uri="http://dasblog.info/" version="2.3.9074.18820">DasBlog</generator>
  <entry>
    <title>The Story of Little Suck-a-Thumb</title>
    <link rel="alternate" type="text/html" href="http://www.edcourtenay.co.uk/2009/08/05/TheStoryOfLittleSuckaThumb.aspx" />
    <id>http://www.edcourtenay.co.uk/PermaLink,guid,dd9aa717-1908-4cf1-9a58-e9605120e530.aspx</id>
    <published>2009-08-05T10:25:32.3267154+01:00</published>
    <updated>2009-08-05T10:25:32.3267154+01:00</updated>
    <category term="Personal" label="Personal" scheme="http://www.edcourtenay.co.uk/CategoryView,category,Personal.aspx" />
    <author>
      <name>Ed Courtenay</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
One of the highlights of going to visit my Amma as a small boy used to be reading
the old hardback copy of "<a href="http://www.edcourtenay.co.uk/ct.ashx?id=dd9aa717-1908-4cf1-9a58-e9605120e530&amp;url=http%3a%2f%2fen.wikipedia.org%2fwiki%2fStruwwelpeter" target="_blank">Struwwelpeter:
Merry Tales and Funny Pictures</a>" by Heinrich Hoffman – although it was the
inspiration for several recurring nightmares, there was something grotesquely compelling
about the book that meant I couldn’t stop re-reading it. The idea that any of the
stories could have been described as "Merry Tales" or that this could in
any way be considered a children's book was (and still is) bizarre.
</p>
        <p>
My favourite story was always "The Story Of Little Suck-a-Thumb"; it’s the
completely cold and matter of fact way in which the unfortunate boy’s mother reacts
to her son's mutilation at the hands of the tailor and the freakish illustration of
the "great, long, red-legged scissor-man" himself leaping in through the
open door with his enormous shears that completely captivated me then (and now).
</p>
        <div align="center">
          <h5>
            <a>
            </a>The Story of Little Suck-a-Thumb
</h5>
          <p>
            <img title="The Story of Little Suck-A-Thumb" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="901" alt="The Story of Little Suck-A-Thumb" src="http://www.edcourtenay.co.uk/content/binary/WindowsLiveWriter/TheStoryofLittleSuckaThumb_92C2/017_3.jpg" width="404" border="0" />
          </p>
          <p>
            <em>One day Mamma said "Conrad dear, 
<br />
I must go out and leave you here. 
<br />
But mind now, Conrad, what I say, 
<br />
Don't suck your thumb while I'm away. 
<br />
The great tall tailor always comes 
<br />
To little boys who suck their thumbs; 
<br />
And ere they dream what he's about, 
<br />
He takes his great sharp scissors out, 
<br />
And cuts their thumbs clean off—and then, 
<br />
You know, they never grow again." 
<br />
Mamma had scarcely turned her back, 
<br />
The thumb was in, Alack! Alack!</em>
          </p>
          <p>
            <img title="The great, long, red-legged scissor-man." style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="404" alt="The great, long, red-legged scissor-man." src="http://www.edcourtenay.co.uk/content/binary/WindowsLiveWriter/TheStoryofLittleSuckaThumb_92C2/018-1_3.jpg" width="604" border="0" />
          </p>
          <p>
            <em>The door flew open, in he ran, 
<br />
The great, long, red-legged scissor-man. 
<br />
Oh! children, see! the tailor's come 
<br />
And caught out little Suck-a-Thumb. 
<br />
Snip! Snap! Snip! the scissors go; 
<br />
And Conrad cries out "Oh! Oh! Oh!" 
<br />
Snip! Snap! Snip! They go so fast, 
<br />
That both his thumbs are off at last.</em>
          </p>
          <p>
  
<br /><img title="Mamma comes home, there Conrad stands" style="border-top-width: 0px; display: inline; border-left-width: 0px; border-bottom-width: 0px; border-right-width: 0px" height="456" alt="Mamma comes home, there Conrad stands" src="http://www.edcourtenay.co.uk/content/binary/WindowsLiveWriter/TheStoryofLittleSuckaThumb_92C2/018-2_3.jpg" width="351" border="0" /></p>
          <p>
            <em>Mamma comes home: there Conrad stands, 
<br />
And looks quite sad, and shows his hands; 
<br />
"Ah!" said Mamma, "I knew he'd come 
<br />
To naughty little Suck-a-Thumb."</em>
          </p>
        </div>
        <p>
The complete nightmare can be downloaded from <a href="http://www.edcourtenay.co.uk/ct.ashx?id=dd9aa717-1908-4cf1-9a58-e9605120e530&amp;url=http%3a%2f%2fwww.gutenberg.org%2fetext%2f12116" target="_blank">Project
Gutenberg</a></p>
        <img width="0" height="0" src="http://www.edcourtenay.co.uk/aggbug.ashx?id=dd9aa717-1908-4cf1-9a58-e9605120e530" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Custom DS Lite</title>
    <link rel="alternate" type="text/html" href="http://www.edcourtenay.co.uk/2009/07/23/CustomDSLite.aspx" />
    <id>http://www.edcourtenay.co.uk/PermaLink,guid,fc748b68-4974-4793-9c5f-406122e251db.aspx</id>
    <published>2009-07-23T18:22:38.031+01:00</published>
    <updated>2009-07-23T18:22:38.031+01:00</updated>
    <category term="Personal" label="Personal" scheme="http://www.edcourtenay.co.uk/CategoryView,category,Personal.aspx" />
    <author>
      <name>Ed Courtenay</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
The hinge on India’s pink DS lite broke the other day, which left the top screen hanging
on precariously for dear life, so rather than risk the wrath of an eight year old
if the thing did give out I got a replacement case. I opted for a nice purple colour
and armed with a trusty triwing screwdriver, miniature screwdriver set and a couple
of young helpers I replaced the case.
</p>
        <p>
I opted to keep the original pink DS’s buttons, D-pad and screen decals – I think
the end result is quite fetching.
</p>
        <p>
          <a href="http://www.edcourtenay.co.uk/ct.ashx?id=fc748b68-4974-4793-9c5f-406122e251db&amp;url=http%3a%2f%2fwww.edcourtenay.co.uk%2fcontent%2fbinary%2fWindowsLiveWriter%2fCustomDSLite_10272%2f23072009002-edit_2.jpg">
            <img style="border-right-width: 0px; display: block; float: none; border-top-width: 0px; border-bottom-width: 0px; margin-left: auto; border-left-width: 0px; margin-right: auto" title="Pink n' Purple DS" border="0" alt="Pink n' Purple DS" src="http://www.edcourtenay.co.uk/content/binary/WindowsLiveWriter/CustomDSLite_10272/23072009002-edit_thumb.jpg" width="644" height="484" />
          </a>
        </p>
        <img width="0" height="0" src="http://www.edcourtenay.co.uk/aggbug.ashx?id=fc748b68-4974-4793-9c5f-406122e251db" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Amusing Ourselves To Death</title>
    <link rel="alternate" type="text/html" href="http://www.edcourtenay.co.uk/2009/07/17/AmusingOurselvesToDeath.aspx" />
    <id>http://www.edcourtenay.co.uk/PermaLink,guid,7b0d9118-dd3b-4093-ae92-a2e2c093c1a8.aspx</id>
    <published>2009-07-17T20:06:31.773+01:00</published>
    <updated>2009-07-17T20:06:31.773+01:00</updated>
    <author>
      <name>Ed Courtenay</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Just stumbled across this cartoon via B3ta; it makes the case that Aldous Huxley was
the more prophetic author compared to George Orwell, contrasting Brave New World against
1984. It’s true that Orwell may have enriched the English language more than Huxley
(Newspeak, Big Brother, Room 101, Doublethink etc.), but Huxley may well have had
the more accurate vision.
</p>
        <p>
          <a href="http://www.edcourtenay.co.uk/ct.ashx?id=7b0d9118-dd3b-4093-ae92-a2e2c093c1a8&amp;url=http%3a%2f%2ffatpita.net%2f%3fi%3d1952">
            <img src="http://fatpita.net/images/image%20(1952).jpg" width="699" height="5579" />
          </a>
        </p>
        <p>
          <a href="http://www.edcourtenay.co.uk/ct.ashx?id=7b0d9118-dd3b-4093-ae92-a2e2c093c1a8&amp;url=http%3a%2f%2ffatpita.net%2f%3fi%3d1952">http://fatpita.net/?i=1952</a>
        </p>
        <img width="0" height="0" src="http://www.edcourtenay.co.uk/aggbug.ashx?id=7b0d9118-dd3b-4093-ae92-a2e2c093c1a8" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Gig Cancelled</title>
    <link rel="alternate" type="text/html" href="http://www.edcourtenay.co.uk/2009/06/18/GigCancelled.aspx" />
    <id>http://www.edcourtenay.co.uk/PermaLink,guid,f6cd1061-ad3d-4043-a880-c44d09744e9a.aspx</id>
    <published>2009-06-18T13:37:04+01:00</published>
    <updated>2009-06-18T14:05:36.569+01:00</updated>
    <category term="Cryin' Out Loud" label="Cryin' Out Loud" scheme="http://www.edcourtenay.co.uk/CategoryView,category,CryinOutLoud.aspx" />
    <author>
      <name>Ed Courtenay</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">The gig tonight at The Old Ship in Dorcester
is not happening – cock up with booking confirmations!<img width="0" height="0" src="http://www.edcourtenay.co.uk/aggbug.ashx?id=f6cd1061-ad3d-4043-a880-c44d09744e9a" /></div>
    </content>
  </entry>
  <entry>
    <title>Parmageddon - The origin</title>
    <link rel="alternate" type="text/html" href="http://www.edcourtenay.co.uk/2009/04/30/ParmageddonTheOrigin.aspx" />
    <id>http://www.edcourtenay.co.uk/PermaLink,guid,2c02da54-7c4b-4881-b5c3-82d8e1a4967b.aspx</id>
    <published>2009-04-30T21:16:04+01:00</published>
    <updated>2009-04-30T21:17:19.789+01:00</updated>
    <content type="html">

&lt;div class=Section1&gt;
&lt;div&gt;
&lt;p class=MsoNormal&gt;
The source of the aporkalypse has been identified....&lt;o:p&gt;&lt;/o:p&gt;
&lt;/p&gt;
&lt;div&gt;
&lt;p class=MsoNormal&gt;
&lt;o:p&gt;&amp;nbsp;&lt;/o:p&gt;
&lt;/p&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;div class="inlinedMailPictureBox"&gt;&lt;a href="http://www.edcourtenay.co.uk/ct.ashx?id=2c02da54-7c4b-4881-b5c3-82d8e1a4967b&amp;amp;url=http%3a%2f%2fwww.edcourtenay.co.uk%2fcontent%2fbinary%2fswine.jpg"&gt;&lt;img border="0" class="inlinedMailPicture" src="http://www.edcourtenay.co.uk/content/binary/swine-thumb.dasblog.JPG"&gt;&lt;/a&gt;
&lt;br&gt;
&lt;a class="inlinedMailPictureLink" href="http://www.edcourtenay.co.uk/ct.ashx?id=2c02da54-7c4b-4881-b5c3-82d8e1a4967b&amp;amp;url=http%3a%2f%2fwww.edcourtenay.co.uk%2fcontent%2fbinary%2fswine.jpg"&gt;swine.jpg&lt;/a&gt;
&lt;/div&gt;
&lt;p&gt;
&lt;/p&gt;
&lt;img width="0" height="0" src="http://www.edcourtenay.co.uk/aggbug.ashx?id=2c02da54-7c4b-4881-b5c3-82d8e1a4967b" /&gt;</content>
  </entry>
  <entry>
    <title>Shirley Temple Pilots Not Dead Shocker</title>
    <link rel="alternate" type="text/html" href="http://www.edcourtenay.co.uk/2009/04/07/ShirleyTemplePilotsNotDeadShocker.aspx" />
    <id>http://www.edcourtenay.co.uk/PermaLink,guid,0c2e2048-6c13-45b1-ace9-d59d723f04e0.aspx</id>
    <published>2009-04-07T23:12:12+01:00</published>
    <updated>2009-04-07T23:12:47.738+01:00</updated>
    <category term="Shirley Temple Pilots" label="Shirley Temple Pilots" scheme="http://www.edcourtenay.co.uk/CategoryView,category,ShirleyTemplePilots.aspx" />
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">Yes, it's true; the Shirley Temple Pilots
are going to be playing for the first time in ages at Finns in Weymouth on Sat 11th
July. It'll be loud.... ;) <img width="0" height="0" src="http://www.edcourtenay.co.uk/aggbug.ashx?id=0c2e2048-6c13-45b1-ace9-d59d723f04e0" /></div>
    </content>
  </entry>
  <entry>
    <title>ASP.NET MVC 1.0</title>
    <link rel="alternate" type="text/html" href="http://www.edcourtenay.co.uk/2009/04/03/ASPNETMVC10.aspx" />
    <id>http://www.edcourtenay.co.uk/PermaLink,guid,829937e7-808d-4d9d-a2df-78802f9ac1f6.aspx</id>
    <published>2009-04-03T08:11:17.224+01:00</published>
    <updated>2009-04-03T08:11:17.224+01:00</updated>
    <category term=".NET" label=".NET" scheme="http://www.edcourtenay.co.uk/CategoryView,category,NET.aspx" />
    <author>
      <name>Ed Courtenay</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
Are Microsoft really starting to turn a page when it comes to Open Source? Let’s hope
so; they’ve just released the source code to the (excellent) <a href="http://www.edcourtenay.co.uk/ct.ashx?id=829937e7-808d-4d9d-a2df-78802f9ac1f6&amp;url=http%3a%2f%2fwww.microsoft.com%2fdownloads%2fdetails.aspx%3fFamilyID%3d53289097-73ce-43bf-b6a6-35e00103cb4b%26displaylang%3den">ASP.NET
MVC</a> framework under the <a href="http://www.edcourtenay.co.uk/ct.ashx?id=829937e7-808d-4d9d-a2df-78802f9ac1f6&amp;url=http%3a%2f%2fwww.opensource.org%2flicenses%2fms-pl.html">OSI-approved
MS-PL license</a>. There's more <a href="http://www.edcourtenay.co.uk/ct.ashx?id=829937e7-808d-4d9d-a2df-78802f9ac1f6&amp;url=http%3a%2f%2fweblogs.asp.net%2fscottgu%2farchive%2f2009%2f04%2f01%2fasp-net-mvc-1-0.aspx">information
over at Scott Guthrie’s blog</a> – I’d particularly recommend reading his <a href="http://www.edcourtenay.co.uk/ct.ashx?id=829937e7-808d-4d9d-a2df-78802f9ac1f6&amp;url=http%3a%2f%2fweblogs.asp.net%2fscottgu%2farchive%2f2009%2f03%2f10%2ffree-asp-net-mvc-ebook-tutorial.aspx">ASP.NET
MVC PDF tutorial</a> as it gives an excellent overview of ASP.NET MVC itself.
</p>
        <img width="0" height="0" src="http://www.edcourtenay.co.uk/aggbug.ashx?id=829937e7-808d-4d9d-a2df-78802f9ac1f6" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Fake Java enums using C# extension methods</title>
    <link rel="alternate" type="text/html" href="http://www.edcourtenay.co.uk/2009/03/25/FakeJavaEnumsUsingCExtensionMethods.aspx" />
    <id>http://www.edcourtenay.co.uk/PermaLink,guid,c60e6b91-d25f-4119-ae20-a87fb483dd38.aspx</id>
    <published>2009-03-25T10:23:36.9949862+00:00</published>
    <updated>2009-03-25T10:23:36.9949862+00:00</updated>
    <category term=".NET" label=".NET" scheme="http://www.edcourtenay.co.uk/CategoryView,category,NET.aspx" />
    <author>
      <name>Ed Courtenay</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
One of the nice features introduced into Java 1.5 that is missing in C# is enum types.
In C#, enums are nothing more than a defined set of values with labels, whereas in
Java enums can contain methods. I've seen a few attempts to mimic Java enums in C#,
but most solutions seem to rely on Attributes to decorate the enum which is fine except
that in relative terms, reflection operations are expensive.
</p>
        <p>
C# 3.0 introduced the concept of <a href="http://www.edcourtenay.co.uk/ct.ashx?id=c60e6b91-d25f-4119-ae20-a87fb483dd38&amp;url=http%3a%2f%2fmsdn.microsoft.com%2fen-us%2flibrary%2fbb383977.aspx">extension
methods</a> which enable you to "add" methods to existing types without creating a
new derived type, recompiling, or otherwise modifying the original type. As is my
wont, I was thinking about this in the shower this morning when I had a eureka moment
- surely it should be possible to fake Java enums using C# extension methods?
</p>
        <p>
Using the <a href="http://www.edcourtenay.co.uk/ct.ashx?id=c60e6b91-d25f-4119-ae20-a87fb483dd38&amp;url=http%3a%2f%2fjava.sun.com%2fj2se%2f1.5.0%2fdocs%2fguide%2flanguage%2fenums.html">Java
planets example</a>, it didn't take long to whip up the following:
</p>
        <pre>
          <span style="FONT-SIZE: 11px; COLOR: black; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">
            <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">using</span> System.Collections.Generic; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">namespace</span> ScratchPad
{ <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">internal</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> Program
{ <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> Main(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">string</span>[]
args) { var p <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> Program();
p.Run(); } <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">void</span> Run()
{ <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">double</span> earthWeight <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> 175; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">double</span> mass <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> earthWeight <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span> Planet.Earth.SurfaceGravity(); <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">foreach</span> (Planet
planet <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">in</span> Enum.GetValues(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">typeof</span>(Planet)))
{ Console.WriteLine(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Your
weight on {0} is {1}"</span>, planet, planet.SurfaceWeight(mass)); } } } <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">enum</span> Planet
{ Mercury, Venus, Earth, Mars, Jupiter, Saturn, Uranus, Neptune } <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> PlanetExtensions
{ <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">readonly</span> Dictionary&lt;Planet,
PlanetData&gt; planetMap <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> Dictionary&lt;Planet,
PlanetData&gt; { {Planet.Mercury, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> PlanetData(3.303e+23,
2.4397e6)}, {Planet.Venus, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> PlanetData(4.869e+24,
6.0518e6)}, {Planet.Earth, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> PlanetData(5.976e+24,
6.37814e6)}, {Planet.Mars, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> PlanetData(6.421e+23,
3.3972e6)}, {Planet.Jupiter, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> PlanetData(1.9e+27,
7.1492e7)}, {Planet.Saturn, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> PlanetData(5.688e+26,
6.0268e7)}, {Planet.Uranus, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> PlanetData(8.686e+25,
2.5559e7)}, {Planet.Neptune, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> PlanetData(1.024e+26,
2.4746e7)} }; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">const</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">double</span> G <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> 6.67300E-11; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">double</span> Mass(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span> Planet
planet) { <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> GetPlanetData(planet).Mass;
} <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">double</span> Radius(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span> Planet
planet) { <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> GetPlanetData(planet).Radius;
} <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">double</span> SurfaceGravity(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span> Planet
planet) { PlanetData planetData <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> GetPlanetData(planet); <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> G <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">*</span> planetData.Mass <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">/</span> (planetData.Radius <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">*</span> planetData.Radius);
} <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">double</span> SurfaceWeight(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">this</span> Planet
planet, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">double</span> mass)
{ <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> mass <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">*</span> SurfaceGravity(planet);
} <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">static</span> PlanetData
GetPlanetData(Planet planet) { <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">if</span> (!planetMap.ContainsKey(planet)) <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">throw</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">new</span> ArgumentOutOfRangeException(<span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"planet"</span>, <span style="FONT-SIZE: 11px; COLOR: #666666; FONT-FAMILY: Courier New; BACKGROUND-COLOR: #e4e4e4">"Unknown
Planet"</span>); <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">return</span> planetMap[planet];
} <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">#region</span> Nested
type: PlanetData <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">class</span> PlanetData
{ <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span> PlanetData(<span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">double</span> mass, <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">double</span> radius)
{ Mass <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> mass;
Radius <span style="FONT-SIZE: 11px; COLOR: red; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">=</span> radius;
} <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">double</span> Mass
{ get; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span> set;
} <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">public</span><span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">double</span> Radius
{ get; <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">private</span> set;
} } <span style="FONT-SIZE: 11px; COLOR: blue; FONT-FAMILY: Courier New; BACKGROUND-COLOR: transparent">#endregion</span> }
}</span>
        </pre>
        <p>
It's all very simple; the only drawback is that you must remember to match any changes
to your enum in the associated extension class. Overall, I think this is a pattern
I might start to use more often.
</p>
        <img width="0" height="0" src="http://www.edcourtenay.co.uk/aggbug.ashx?id=c60e6b91-d25f-4119-ae20-a87fb483dd38" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Missing</title>
    <link rel="alternate" type="text/html" href="http://www.edcourtenay.co.uk/2009/03/13/Missing.aspx" />
    <id>http://www.edcourtenay.co.uk/PermaLink,guid,3e5a2744-d966-460f-96f2-9d18ef674feb.aspx</id>
    <published>2009-03-13T12:20:24.1352869+00:00</published>
    <updated>2009-03-13T12:20:24.1352869+00:00</updated>
    <category term="Personal" label="Personal" scheme="http://www.edcourtenay.co.uk/CategoryView,category,Personal.aspx" />
    <author>
      <name>Ed Courtenay</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <p>
It’s funny how little things can really get under your skin and annoy you; at work,
I use a combination of Windows XP and Windows 2003 Server for development and day
to day work which is fine, but as I use Vista at home I find that I miss the UI enhancements
more and more.
</p>
        <p>
Unlike a lot of people, I seem to have had a rosy experience with Vista; maybe because
I didn’t have unrealistic expectations about the OS (I wouldn’t dream of running it
on some of the older machines I’ve seen it shoehorned into), and I’ve had some reasonably
up to date hardware to run it on. The only real issues that I had with the OS were
very early in its life, when some of the third-party drivers for my hardware devices
were less than stable – my Hauppauge TV capture card was a prime example. Nowadays
though I struggle to find any such issues, even though I’m running the x64 version
of Vista.
</p>
        <p>
My particular bugbear at the moment is the XP (and Windows 2003) Start Menu; I’ve
got so used to the convenience of the Search function in Vista that not having it
available is like having an arm tied behind my back. The amount of times I find myself
instinctively pressing the Windows key and then typing “Visual” to find Visual Studio
on my development box is ridiculous.
</p>
        <p>
What’s even more annoying is that my work laptop was originally purchased with Vista,
which was when downgraded to XP by the IT department...
</p>
        <img width="0" height="0" src="http://www.edcourtenay.co.uk/aggbug.ashx?id=3e5a2744-d966-460f-96f2-9d18ef674feb" />
      </div>
    </content>
  </entry>
  <entry>
    <title>Tree Power</title>
    <link rel="alternate" type="text/html" href="http://www.edcourtenay.co.uk/2009/02/22/TreePower.aspx" />
    <id>http://www.edcourtenay.co.uk/PermaLink,guid,514f4582-12a1-4017-b511-111685ef32dc.aspx</id>
    <published>2009-02-22T15:50:36.6736135+00:00</published>
    <updated>2009-02-22T15:50:36.6736135+00:00</updated>
    <category term="Personal" label="Personal" scheme="http://www.edcourtenay.co.uk/CategoryView,category,Personal.aspx" />
    <author>
      <name>Ed Courtenay</name>
    </author>
    <content type="xhtml">
      <div xmlns="http://www.w3.org/1999/xhtml">
        <div align="center">
          <object width="425" height="344">
            <param name="movie" value="http://www.youtube.com/v/65Chy5kPQ-Y&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;feature=player_embedded&amp;fs=1" />
            <param name="allowFullScreen" value="true" />
            <embed src="http://www.youtube.com/v/65Chy5kPQ-Y&amp;color1=0xb1b1b1&amp;color2=0xcfcfcf&amp;feature=player_embedded&amp;fs=1" type="application/x-shockwave-flash" allowfullscreen="true" width="425" height="344">
            </embed>
          </object>
        </div>
        <p>
Came across this video via <a href="http://www.edcourtenay.co.uk/ct.ashx?id=514f4582-12a1-4017-b511-111685ef32dc&amp;url=http%3a%2f%2fwww.b3ta.com">B3ta</a> –
very clever.
</p>
        <img width="0" height="0" src="http://www.edcourtenay.co.uk/aggbug.ashx?id=514f4582-12a1-4017-b511-111685ef32dc" />
      </div>
    </content>
  </entry>
</feed>