<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Code Sleuth's Blog</title>
	<atom:link href="http://blog.codesleuth.co.uk/index.php/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.codesleuth.co.uk</link>
	<description>The .NET Pimp</description>
	<lastBuildDate>Wed, 24 Mar 2010 09:21:09 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>So, you think you know LINQ?</title>
		<link>http://blog.codesleuth.co.uk/index.php/2010/03/24/so-you-think-you-know-linq/</link>
		<comments>http://blog.codesleuth.co.uk/index.php/2010/03/24/so-you-think-you-know-linq/#comments</comments>
		<pubDate>Wed, 24 Mar 2010 09:20:44 +0000</pubDate>
		<dc:creator>Sleuth</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[c#]]></category>
		<category><![CDATA[linq]]></category>

		<guid isPermaLink="false">http://blog.codesleuth.co.uk/?p=249</guid>
		<description><![CDATA[I&#8217;ve just stumbled upon this quiz which is published as part of a &#8220;C# 4.0 In A Nutshell&#8221; book, but provides a great test for your LINQ knowledge: C# 4.0/3.0 in a Nutshell &#8211; LINQ Quiz There are some particularly tricky ones in there. I fell flat on questions 6 and 9. Those are the [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve just stumbled upon this quiz which is published as part of a &#8220;<a title="C# 4.0 In A Nutshell: Amazon.co.uk" href="http://www.amazon.co.uk/4-0-Nutshell-Definitive-Reference-OReilly/dp/0596800959/ref=sr_1_1?ie=UTF8&amp;s=books&amp;qid=1269422256&amp;sr=8-1" target="_blank">C# 4.0 In A Nutshell</a>&#8221; book, but provides a great test for your LINQ knowledge:</p>
<p><img class="alignleft" title="Nutshell Quiz Logo" src="http://www.albahari.com/nutshell/quizq.png" alt="Logo" width="63" height="41" /> <a href="http://www.albahari.com/nutshell/linqquiz.aspx" target="_blank">C# 4.0/3.0 in a Nutshell &#8211; LINQ Quiz</a></p>
<p>There are some particularly tricky ones in there. I fell flat on<strong> questions 6 and 9</strong>. Those are the types of seemingly anomalous bugs I would rant and rave about, then slap my head when I figure out my mistake.</p>
<p>Take your test <strong>today</strong>!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codesleuth.co.uk/index.php/2010/03/24/so-you-think-you-know-linq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Cisco announce the CRS-3, for up to 322 Tbps</title>
		<link>http://blog.codesleuth.co.uk/index.php/2010/03/22/cisco-announce-the-crs-3-for-up-to-322-tbps/</link>
		<comments>http://blog.codesleuth.co.uk/index.php/2010/03/22/cisco-announce-the-crs-3-for-up-to-322-tbps/#comments</comments>
		<pubDate>Mon, 22 Mar 2010 15:20:32 +0000</pubDate>
		<dc:creator>Sleuth</dc:creator>
				<category><![CDATA[Technology]]></category>
		<category><![CDATA[Technology News]]></category>
		<category><![CDATA[cisco crs-3]]></category>
		<category><![CDATA[router]]></category>

		<guid isPermaLink="false">http://blog.codesleuth.co.uk/?p=242</guid>
		<description><![CDATA[Can this get more crazy? One of the key plug-lines of the page: The Cisco CRS-3 triples the capacity of its predecessor, the Cisco CRS-1 Carrier Routing System, with up to 322 Terabits per second, which enables the entire printed collection of the Library of Congress to be downloaded in just over one second; every [...]]]></description>
			<content:encoded><![CDATA[<div id="attachment_243" class="wp-caption aligncenter" style="width: 524px"><a href="http://newsroom.cisco.com/dlls/2010/prod_030910.html"><img class="size-full wp-image-243 " title="Cisco CRS-3 (322 Tbps)" src="http://blog.codesleuth.co.uk/wp-content/uploads/2010/03/CRS-3_322Tbps.png" alt="Screenshot of the Cisco CRS-3 throughput" width="514" height="273" /></a><p class="wp-caption-text">Fast? Superfast!</p></div>
<p><a title="Cisco Introduces Foundation for Next-Generation Internet: The Cisco CRS-3 Carrier Routing System -&gt; Cisco News:" href="http://newsroom.cisco.com/dlls/2010/prod_030910.html" target="_blank">Can this get more crazy</a>? One of the key plug-lines of the page:</p>
<blockquote><p>The  Cisco CRS-3 triples the capacity of its predecessor, the <a onclick="s_objectID=&quot;http://www.cisco.com/en/US/products/ps5763/_1&quot;;return  this.s_oc?this.s_oc(e):true" href="http://www.cisco.com/en/US/products/ps5763/">Cisco  CRS-1 Carrier  Routing System</a>, with <strong>up to 322 Terabits per second</strong>,  which enables  the  entire printed collection of the Library of Congress to be  downloaded in just  over one second; every man, woman and child in China  to make a video call,  simultaneously; and <strong>every motion picture ever  created to be streamed in less  than four minutes</strong>.</p></blockquote>
<div id="attachment_245" class="wp-caption aligncenter" style="width: 310px"><a href="http://blog.codesleuth.co.uk/wp-content/uploads/2010/03/Cisco_CRS-3_Full.jpg"><img class="size-medium wp-image-245" title="Cisco CRS-3 Full" src="http://blog.codesleuth.co.uk/wp-content/uploads/2010/03/Cisco_CRS-3_Full-300x240.jpg" alt="Preview of the Cisco CRS-3" width="300" height="240" /></a><p class="wp-caption-text">Housed in the same components of today&#39;s CRS-1, in-place uninterrupted upgrades can be performed in a production environment.</p></div>
<p>A bit technical-heavy, but eye-opening, the clip below is a good reel of advertising blurb that made me think of the future:</p>
<div align="center"><object classid="clsid:d27cdb6e-ae6d-11cf-96b8-444553540000" width="560" height="340" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,40,0"><param name="allowFullScreen" value="true" /><param name="allowscriptaccess" value="always" /><param name="src" value="http://www.youtube.com/v/tOcAlD8XsSY&amp;hl=en_GB&amp;fs=1&amp;" /><param name="allowfullscreen" value="true" /><embed type="application/x-shockwave-flash" width="560" height="340" src="http://www.youtube.com/v/tOcAlD8XsSY&amp;hl=en_GB&amp;fs=1&amp;" allowscriptaccess="always" allowfullscreen="true"></embed></object></div>
]]></content:encoded>
			<wfw:commentRss>http://blog.codesleuth.co.uk/index.php/2010/03/22/cisco-announce-the-crs-3-for-up-to-322-tbps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Invention of &#8220;CharvaScript&#8221;</title>
		<link>http://blog.codesleuth.co.uk/index.php/2010/01/14/the-invention-of-charvascript/</link>
		<comments>http://blog.codesleuth.co.uk/index.php/2010/01/14/the-invention-of-charvascript/#comments</comments>
		<pubDate>Thu, 14 Jan 2010 16:34:55 +0000</pubDate>
		<dc:creator>Sleuth</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[charvascript]]></category>
		<category><![CDATA[funny]]></category>

		<guid isPermaLink="false">http://blog.codesleuth.co.uk/?p=237</guid>
		<description><![CDATA[James (at work) said to me out of the blue that he thought of a language when at uni to be called &#8220;CharvaScript&#8221;. Apart from making me laugh, it made me think a little. So I thought some more. Then I stopped thinking and picked my nose. Then I thought some more again. I came [...]]]></description>
			<content:encoded><![CDATA[<p>James (at work) said to me out of the blue that he thought of a language when at uni to be called &#8220;CharvaScript&#8221;.</p>
<p>Apart from making me laugh, it made me think a little. So I thought some more. Then I stopped thinking and picked my nose. Then I thought some more again.</p>
<p>I came up with this as the world&#8217;s first (I think) &#8220;CharvaScript&#8221;:</p>
<blockquote>
<pre>alrite mate
  got ciggy mate?
  got a light mate?

  mate, ciggy is "Marlboro"
  mate, light is "Zippo"

  av got ciggy and " " and light for you mate

nawww thanks mate</pre>
</blockquote>
<p>This is a new flavour of the classic &#8220;Hello World.&#8221; It outputs &#8220;Marlboro Zippo&#8221;.</p>
<p>I&#8217;m sure you can work it out by yourself how it&#8217;s interpreting the script into an executable code path.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codesleuth.co.uk/index.php/2010/01/14/the-invention-of-charvascript/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>James Cameron plays World of Warcraft</title>
		<link>http://blog.codesleuth.co.uk/index.php/2010/01/03/james-cameron-plays-world-of-warcraft/</link>
		<comments>http://blog.codesleuth.co.uk/index.php/2010/01/03/james-cameron-plays-world-of-warcraft/#comments</comments>
		<pubDate>Sun, 03 Jan 2010 01:22:43 +0000</pubDate>
		<dc:creator>Sleuth</dc:creator>
				<category><![CDATA[Films]]></category>
		<category><![CDATA[World of Warcraft]]></category>
		<category><![CDATA[avatar]]></category>

		<guid isPermaLink="false">http://blog.codesleuth.co.uk/?p=231</guid>
		<description><![CDATA[I&#8217;ve just read an interesting article detailing 5 similarities between James Cameron&#8217;s Avatar and the World of Warcraft. If you play WoW, I think you&#8217;ll agree he has a point&#8230;]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">
<div class="wp-caption aligncenter" style="width: 510px"><a href="http://gameaxis.com/friday-fives-%E2%80%93-james-cameron-plays-world-of-warcraft/" target="_blank"><img title="Navi avatar" src="http://gameaxis.com/wp-content/uploads/2009/12/NEavatar.jpg" alt="Navi/Night Elf Hunter" width="500" height="281" /></a><p class="wp-caption-text">Na&#39;vi/Night Elf Hunter</p></div>
<p>I&#8217;ve just <a href="http://gameaxis.com/friday-fives-%E2%80%93-james-cameron-plays-world-of-warcraft/" target="_blank">read an interesting article</a> detailing 5 similarities between James Cameron&#8217;s Avatar and the World of Warcraft.</p>
<p>If you play WoW, I think you&#8217;ll agree he has a point&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codesleuth.co.uk/index.php/2010/01/03/james-cameron-plays-world-of-warcraft/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>PS3 Call Of Duty: Modern Warfare 2, Firewall Port(s)</title>
		<link>http://blog.codesleuth.co.uk/index.php/2009/12/15/ps3-modern-warfare-2-ports/</link>
		<comments>http://blog.codesleuth.co.uk/index.php/2009/12/15/ps3-modern-warfare-2-ports/#comments</comments>
		<pubDate>Tue, 15 Dec 2009 11:54:51 +0000</pubDate>
		<dc:creator>Sleuth</dc:creator>
				<category><![CDATA[Games]]></category>
		<category><![CDATA[firewall]]></category>
		<category><![CDATA[ports]]></category>
		<category><![CDATA[ps3]]></category>

		<guid isPermaLink="false">http://blog.codesleuth.co.uk/?p=227</guid>
		<description><![CDATA[Just a quick note to post some information about how to correctly set up port forwarding on your router/gateway for the PS3 (and I believe also the XBOX360) version of Call Of Duty: Modern Warfare 2. Basically, the game requires port 3074 UDP to be forwarded to your router. There is no need for assigning [...]]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;">
<div id="attachment_235" class="wp-caption aligncenter" style="width: 212px"><img class="size-full wp-image-235" title="Modern Warfare 2 Logo Transparent" src="http://blog.codesleuth.co.uk/wp-content/uploads/2009/12/mw2logo_med-1254240860-1254328545.png" alt="Modern Warfare 2 Logo" width="202" height="39" /><p class="wp-caption-text">Modern Warfare 2 Logo</p></div>
<p>Just a quick note to post some information about how to <strong>correctly</strong> set up port forwarding on your router/gateway for the PS3 (and I believe also the XBOX360) version of Call Of Duty: Modern Warfare 2.</p>
<p>Basically, the game requires <strong>port 3074 <span style="text-decoration: underline;">UDP</span></strong> to be forwarded to your router. There is <span style="text-decoration: underline;">no need</span> for assigning it as the <a href="http://en.wikipedia.org/wiki/DMZ_%28computing%29" target="_blank">DMZ</a>, or for forwarding TCP port 80. <strong><span style="text-decoration: underline;">Don&#8217;t do this!</span></strong></p>
<p>The reason for having an incoming port opened for the game is so the game is able to <strong>host</strong> matches. On the PS3, every multiplayer game is hosted by one of the players within the same game. You can tell if it&#8217;s you if you check the score screen and see that you are the one with the highest connection rating (4 green bars). If there are lots of people with 4 bars, then congratulations, you&#8217;re either the host, or at least connected to an excellent one!</p>
<p>Most people will notice the game works fine without any port forwarding. This is either because you have UPnP enabled on your network, or you have no port forwarding configured. The game will use <a href="http://en.wikipedia.org/wiki/Universal_Plug_and_Play" target="_blank">UPnP</a> to automatically set up port forwarding for this port to your PS3, and will appear as &#8220;NAT Type 2&#8243; in a PS3 connection test, or &#8220;Open&#8221; in game. If you are able to check your UPnP ports, you will discover an open 3074 UDP port directed at your PS3 with the name &#8220;<a href="http://en.wikipedia.org/wiki/Demonware" target="_blank"><strong>DemonwarePortMapping</strong></a>&#8220;. This is correct, and you should leave it alone, unless the IP address it shows doesn&#8217;t match your PS3.</p>
<p>If you have a &#8220;NAT Type 3&#8243;, it means you need to manually set up port forwarding for 3074 UDP to your PS3, which will then change the in-game NAT status to &#8220;Open&#8221; and allow you to host games.</p>
<p>Setting up port forwarding varies between different routers, which is why it is best to get your manual out and simply enable UPnP yourself. However, for some people UPnP isn&#8217;t an option, because they are the type of person to open &#8220;sexylady.pif&#8221; in a spam message and not expect to <a href="http://www.itpro.co.uk/109958/upnp-malware-by-end-of-week" target="_blank">get a virus</a>. They&#8217;re stupid, and can&#8217;t be trusted. Some worms and back-doors use UPnP to allow incoming connections without the user&#8217;s knowledge, and hence can be considered a risk.</p>
<p>If you can&#8217;t, or don&#8217;t want to enable UPnP, you will have to sort out port forwarding yourself. Most routers have a web-interface to do this, and is pretty straight-forward once you see it in front of you. Feel free to use <a href="http://portforward.com/ " target="_blank">portforward.com</a> to find out how to configure your router for this task, but the site lists the wrong ports for Modern Warfare 2, so ensure you use just UDP 3074.</p>
<p>If you can&#8217;t find your router, simply click these links and see what happens:</p>
<ul>
<li><a href="http://192.168.0.1" target="_blank">http://192.168.0.1</a></li>
<li><a href="http://192.168.1.1" target="_blank">http://192.168.1.1</a></li>
<li><a href="http://192.168.10.1/" target="_blank">http://192.168.10.1</a></li>
<li><a href="http://192.168.100.1" target="_blank">http://192.168.100.1</a></li>
</ul>
<p>Hopefully one of those will pop up with your router&#8217;s administration site. If not, you need to look into this in more detail, or use whatever configuration tool that is provided by your router&#8217;s manufacturer.</p>
<p>So remember: port 3074 UDP <span style="text-decoration: underline;">only</span>, or use UPnP. Do not use DMZ!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codesleuth.co.uk/index.php/2009/12/15/ps3-modern-warfare-2-ports/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Items for Sale (eBay)</title>
		<link>http://blog.codesleuth.co.uk/index.php/2009/11/30/items-for-sale-ebay/</link>
		<comments>http://blog.codesleuth.co.uk/index.php/2009/11/30/items-for-sale-ebay/#comments</comments>
		<pubDate>Mon, 30 Nov 2009 22:14:59 +0000</pubDate>
		<dc:creator>Sleuth</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[ds]]></category>
		<category><![CDATA[eBay]]></category>
		<category><![CDATA[geforce]]></category>
		<category><![CDATA[leadtek]]></category>
		<category><![CDATA[nds]]></category>
		<category><![CDATA[nintendo]]></category>

		<guid isPermaLink="false">http://blog.codesleuth.co.uk/?p=224</guid>
		<description><![CDATA[It&#8217;s clearly shameless, but I&#8217;m doing it anyway. I posted some listing on eBay to generate a little cash to pay for some gifts for people at Christmas; take a look: Metroid Prime Hunters for Nintendo DS Tony Hawk&#8217;s Downhill Jam for Nintendo DS Leadtek WinFast PX7800 GT TDH Extreme PCI Express Graphics card I [...]]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s clearly shameless, but I&#8217;m doing it anyway.</p>
<p>I posted some listing on eBay to generate a little cash to pay for some gifts for people at Christmas; take a look:</p>
<ul>
<li><a href="http://cgi.ebay.co.uk/METROID-Prime-Hunters-Nintendo-DS-DSi_W0QQitemZ150393525318QQcmdZViewItemQQptZUK_PC_Video_Games_Video_Games_JS?hash=item2304271446" target="_blank">Metroid Prime Hunters</a> for Nintendo DS</li>
<li><a href="http://cgi.ebay.co.uk/Tony-Hawks-DOWNHILL-JAM-Nintendo-DS-DSi_W0QQitemZ150393537538QQcmdZViewItemQQptZUK_PC_Video_Games_Video_Games_JS?hash=item2304274402" target="_blank">Tony Hawk&#8217;s Downhill</a> Jam for Nintendo DS</li>
<li><a href="http://cgi.ebay.co.uk/Leadtek-WinFast-PX7800-GT-TDH-EXTREME-PCI-Express-256mb_W0QQitemZ150393559824QQcmdZViewItemQQptZUK_Computing_Computer_Components_Graphics_Video_TV_Cards_TW?hash=item2304279b10" target="_blank">Leadtek WinFast PX7800 GT TDH Extreme</a> PCI Express Graphics card</li>
</ul>
<p>I feel dirty posting links to my eBay listing on my blog, but fuck it. Clicky please!</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codesleuth.co.uk/index.php/2009/11/30/items-for-sale-ebay/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Weather FAIL</title>
		<link>http://blog.codesleuth.co.uk/index.php/2009/07/23/weather-fail/</link>
		<comments>http://blog.codesleuth.co.uk/index.php/2009/07/23/weather-fail/#comments</comments>
		<pubDate>Thu, 23 Jul 2009 09:04:17 +0000</pubDate>
		<dc:creator>Sleuth</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[fail]]></category>
		<category><![CDATA[weather]]></category>

		<guid isPermaLink="false">http://blog.codesleuth.co.uk/?p=219</guid>
		<description><![CDATA[moar funny pictures Shameless plug to promote voting&#8230; click here. Credits to Sion Edwards for this find]]></description>
			<content:encoded><![CDATA[<p style="text-align: center;"><a href="http://cheezburger.com/view.aspx?ciid=4773922"><img src="http://images.cheezburger.com/completestore/2009/7/23/128928127055176924.jpg" alt="funny pictures" /></a><br />
moar <a href="http://icanhascheezburger.com">funny pictures</a></p>
<p>Shameless plug to promote voting&#8230; <a href="http://cheezburger.com/view.aspx?ciid=4773922">click here</a>.</p>
<p>Credits to <a title="Sion Edwards @ Twitter" href="http://twitter.com/sion_edwards" target="_blank">Sion Edwards</a> for this find <img src='http://blog.codesleuth.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codesleuth.co.uk/index.php/2009/07/23/weather-fail/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>My Twitter Page</title>
		<link>http://blog.codesleuth.co.uk/index.php/2009/06/25/my-twitter-page/</link>
		<comments>http://blog.codesleuth.co.uk/index.php/2009/06/25/my-twitter-page/#comments</comments>
		<pubDate>Wed, 24 Jun 2009 23:20:56 +0000</pubDate>
		<dc:creator>Sleuth</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[twitter]]></category>

		<guid isPermaLink="false">http://blog.codesleuth.co.uk/?p=210</guid>
		<description><![CDATA[So I joined the revolution into the new internet fad Twitter recently, and although I&#8217;m having trouble with some bugs (I think&#8230;) I&#8217;m having fun reading other people&#8217;s profiles. My page is http://twitter.com/Codesleuth &#8211; followers welcome]]></description>
			<content:encoded><![CDATA[<p><img class="aligncenter" title="Twitter Logo" src="http://assets0.twitter.com/images/twitter_logo_header.png" alt="" width="155" height="36" /></p>
<p>So I joined the revolution into the new internet fad <a href="http://twitter.com" target="_blank">Twitter</a> recently, and although I&#8217;m having trouble with some bugs (I think&#8230;) I&#8217;m having fun reading other people&#8217;s profiles.<br />
My page is <a href="http://twitter.com/Codesleuth">http://twitter.com/Codesleuth</a> &#8211; followers welcome <img src='http://blog.codesleuth.co.uk/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codesleuth.co.uk/index.php/2009/06/25/my-twitter-page/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>DataRow[DataColumn] performance enhancements</title>
		<link>http://blog.codesleuth.co.uk/index.php/2009/04/30/datarowdatacolumn-performance-enhancements/</link>
		<comments>http://blog.codesleuth.co.uk/index.php/2009/04/30/datarowdatacolumn-performance-enhancements/#comments</comments>
		<pubDate>Thu, 30 Apr 2009 09:31:48 +0000</pubDate>
		<dc:creator>Sleuth</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[.NET]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://blog.codesleuth.co.uk/?p=206</guid>
		<description><![CDATA[Since the system I work on performs about 1000 DataTable specific manipulations per minute, I&#8217;ve been going through and working out some ways to speed it up that little bit more. Take the following code: DataTable myData = new DataTable(); myData.ReadXml("myxml.xml"); if (myData.Rows[0].IsNull("column1"))     return null; else     return myData.Rows[0]["column1"]; The obvious performance improvement here [...]]]></description>
			<content:encoded><![CDATA[<p>Since the system I work on performs about 1000 DataTable specific manipulations per minute, I&#8217;ve been going through and working out some ways to speed it up that little bit more. Take the following code:</p>
<pre>DataTable myData = new DataTable();
myData.ReadXml("myxml.xml");</pre>
<pre>if (myData.Rows[0].IsNull("column1"))
    return null;
else
    return myData.Rows[0]["column1"];</pre>
<p>The obvious performance improvement here is to first pull out the column index from the DataTable and then also pull out the row you need. You would end up with something like this:</p>
<pre>DataTable myData = new DataTable();
myData.ReadXml("myxml.xml");

DataRow row = myData.Rows[0];
int col = myData.Columns.IndexOf("column1");

if (col == -1)
    throw new Exception("The column 'column1' was not found.");

if (row.IsNull(col))
    return null;
else
    return row[col];</pre>
<p>I first changed my code to work in this way but I was thinking to myself that the DataRow will still have to perform an index pull from its internal collection even when using the verified index for the column. Another way of doing this would be to pull out the DataColumn and use that in the place of the column index, but I had no idea what would be faster. So I fired up Reflector and took a look at the Int32 version of the index lookup:</p>
<pre>public object this[int columnIndex]
{
    get
    {
        DataColumn column = this._columns[columnIndex];
        int defaultRecord = this.GetDefaultRecord();
        return column[defaultRecord];
    }
    set
    {
        DataColumn column = this._columns[columnIndex];
        this[column] = value;
    }
}</pre>
<p>As you can see, internally the lookup finds the DataColumn first anyway, which means it would be faster for us to get the DataColumn in our own code first as we reference it twice. So our new code becomes:</p>
<pre>DataTable myData = new DataTable();
myData.ReadXml("myxml.xml");

DataRow row = myData.Rows[0];
DataColumn col = myData.Columns["column1"];

if (col == null)
    throw new Exception("The column 'column1' was not found.");

if (row.IsNull(col))
    return null;
else
    return row[col];</pre>
<p>This is a very tiny performance improvement, but every little helps when it&#8217;s used many times a second.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codesleuth.co.uk/index.php/2009/04/30/datarowdatacolumn-performance-enhancements/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Snoutbreak 09 Media Pandemic</title>
		<link>http://blog.codesleuth.co.uk/index.php/2009/04/29/snoutbreak-09-media-pandemic/</link>
		<comments>http://blog.codesleuth.co.uk/index.php/2009/04/29/snoutbreak-09-media-pandemic/#comments</comments>
		<pubDate>Wed, 29 Apr 2009 12:48:22 +0000</pubDate>
		<dc:creator>Sleuth</dc:creator>
				<category><![CDATA[Blog]]></category>
		<category><![CDATA[swine flu]]></category>

		<guid isPermaLink="false">http://blog.codesleuth.co.uk/?p=202</guid>
		<description><![CDATA[You&#8217;ve probably caught a glimpse of the &#8216;pandemic&#8217; &#8216;outbreak&#8217; of swine influenza that is doing the rounds in the media at the moment. I thought I would contribute to the (excuse the pun) tripe that we&#8217;re all faced with and raise a point we&#8217;re all thinking: this is media hype. Look at any news network, [...]]]></description>
			<content:encoded><![CDATA[<p>You&#8217;ve probably caught a glimpse of the &#8216;pandemic&#8217; &#8216;outbreak&#8217; of swine influenza that is doing the rounds in the media at the moment.<br />
I thought I would contribute to the (excuse the pun) <em>tripe</em> that we&#8217;re all faced with and raise a point we&#8217;re all thinking: <strong>this is media hype</strong>.</p>
<p>Look at any news network, paper, or blog roll, and you will find comments that show there is no real need for this particular piece of <em>news</em> to be escalated this far.</p>
<p>I loved this Daily Show video, which summarises all that is stupid about the media:</p>
<table style="font-family: arial; font-style: normal; font-variant: normal; font-weight: normal; font-size: 11px; line-height: normal; font-size-adjust: none; font-stretch: normal; color: #333333; background-color: #f5f5f5; height: 353px;" border="0" cellspacing="0" cellpadding="0" width="360">
<tbody>
<tr style="background-color:#e5e5e5" valign="middle">
<td style="padding:2px 1px 0px 5px;"><a style="color:#333; text-decoration:none; font-weight:bold;" href="http://www.thedailyshow.com/" target="_blank">The Daily Show With Jon Stewart</a></td>
<td style="padding:2px 5px 0px 5px; text-align:right; font-weight:bold;">M &#8211; Th 11p / 10c</td>
</tr>
<tr style="height: 14px;" valign="middle">
<td style="padding:2px 1px 0px 5px;" colspan="2"><a style="color:#333; text-decoration:none; font-weight:bold;" href="http://www.thedailyshow.com/video/index.jhtml?videoId=225152&amp;title=snoutbreak-09-the-last-100-days" target="_blank">Snoutbreak &#8217;09 &#8211; The Last 100 Days</a></td>
</tr>
<tr style="height: 14px; background-color: #353535;" valign="middle">
<td style="padding: 2px 5px 0px; overflow: hidden; width: 360px; text-align: right;" colspan="2"><a style="color:#96deff; text-decoration:none; font-weight:bold;" href="http://www.thedailyshow.com/" target="_blank">thedailyshow.com</a></td>
</tr>
<tr valign="middle">
<td style="padding:0px;" colspan="2"><object width="360" height="301" data="http://media.mtvnservices.com/mgid:cms:item:comedycentral.com:225152" type="application/x-shockwave-flash"><param name="bgcolor" value="#000000" /><param name="flashvars" value="autoPlay=false" /><param name="src" value="http://media.mtvnservices.com/mgid:cms:item:comedycentral.com:225152" /><param name="wmode" value="window" /><param name="allowfullscreen" value="true" /></object></td>
</tr>
<tr style="height: 18px;" valign="middle">
<td style="padding:0px;" colspan="2">
<table style="margin: 0px; text-align: center; height: 100%;" border="0" cellspacing="0" cellpadding="0" width="100%">
<tbody>
<tr valign="middle">
<td style="padding: 3px; width: 33%;"><a style="font:10px arial; color:#333; text-decoration:none;" href="http://www.thedailyshow.com/full-episodes/index.jhtml" target="_blank">Daily Show<br />
Full Episodes</a></td>
<td style="padding: 3px; width: 33%;"><a style="font:10px arial; color:#333; text-decoration:none;" href="http://www.thedailyshow.com/tagSearchResults.jhtml?term=Clusterf%23%40k+to+the+Poor+House" target="_blank">Economic Crisis</a></td>
<td style="padding: 3px; width: 33%;"><a style="font:10px arial; color:#333; text-decoration:none;" href="http://www.thedailyshow.com/tagSearchResults.jhtml?term=Barack+Obama" target="_blank">First 100 Days</a></td>
</tr>
</tbody>
</table>
</td>
</tr>
</tbody>
</table>
<p>If you&#8217;re looking for information, go to <a href="http://scienceblogs.com/effectmeasure/">Effect Measure</a>. Otherwise, laugh it off like the rest of us.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.codesleuth.co.uk/index.php/2009/04/29/snoutbreak-09-media-pandemic/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
