<?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/"
	xmlns:georss="http://www.georss.org/georss" xmlns:geo="http://www.w3.org/2003/01/geo/wgs84_pos#" xmlns:media="http://search.yahoo.com/mrss/"
	>

<channel>
	<title>Nerd Fortress &#187; Codealicious</title>
	<atom:link href="http://nerdfortress.com/category/codealicious/feed/" rel="self" type="application/rss+xml" />
	<link>http://nerdfortress.com</link>
	<description>Esoteric How-to&#039;s, Essays, and Rand();</description>
	<lastBuildDate>Wed, 18 Aug 2010 18:03:07 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.com/</generator>
<cloud domain='nerdfortress.com' port='80' path='/?rsscloud=notify' registerProcedure='' protocol='http-post' />
<image>
		<url>http://0.gravatar.com/blavatar/2a5c8b7c0315fc736ce48e0362d376a3?s=96&#038;d=http://s2.wp.com/i/buttonw-com.png</url>
		<title>Nerd Fortress &#187; Codealicious</title>
		<link>http://nerdfortress.com</link>
	</image>
	<atom:link rel="search" type="application/opensearchdescription+xml" href="http://nerdfortress.com/osd.xml" title="Nerd Fortress" />
	<atom:link rel='hub' href='http://nerdfortress.com/?pushpress=hub'/>
		<item>
		<title>Behind the Scenes of the C++ STL Algorithm Model</title>
		<link>http://nerdfortress.com/2010/08/17/behind-the-scenes-of-the-c-stl-algorithm-model/</link>
		<comments>http://nerdfortress.com/2010/08/17/behind-the-scenes-of-the-c-stl-algorithm-model/#comments</comments>
		<pubDate>Tue, 17 Aug 2010 17:17:17 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Codealicious]]></category>

		<guid isPermaLink="false">http://nerdfortress.com/?p=1217</guid>
		<description><![CDATA[Ever wondered why the C++ STL uses an external, non-member function model for implementing algorithms for containers? The following article sums it up. Although a few of the &#8220;no less efficient&#8221; examples are debatable, the underlying principles definitely have merit. Monoliths &#8220;Unstrung&#8221; One downside to the functional approach outlined in the article&#8211;that I didn&#8217;t see mentioned&#8211;is [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=1217&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Ever wondered why the C++ STL uses an external, non-member function model for implementing algorithms for containers? The following article sums it up. Although a few of the &#8220;no less efficient&#8221; examples are debatable, the underlying principles definitely have merit.</p>
<p><a href="http://www.gotw.ca/gotw/084.htm" target="_blank">Monoliths &#8220;Unstrung&#8221;</a></p>
<p>One downside to the functional approach outlined in the article&#8211;that I didn&#8217;t see mentioned&#8211;is the fact that the interface is actually being split in a few cases, which is actually detrimental to cohesion. This happens when you have multiple overloaded forms of a function, and you keep one &#8220;flexible&#8221; one as a member function, but make the others external functions. Why not keep those as members for the sake of consistency? You can still implement them in terms of the one &#8220;flexible&#8221; member function, thereby continuing to ensure good encapsulation.</p>
<p>A few thoughts on applying the spirit of the law discussed in the article to other languages:</p>
<ul>
<li><strong>C#</strong> &#8211; Use extension methods, but the &#8220;this&#8221; type should be as generic as possible. You still get the benefits of DRY but in a more object-oriented fashion that works well with Intellisense and cohesion. I like the extension  method approach better than the old static-methods approach (e.g., string.Join) because it still enforces good encapsulation, and is less verbose and more cohesive than the alternative.</li>
<li><strong>Ruby</strong> &#8211; Use mix-ins that use duct-type delegation to other methods. These can be automatically mixed into all applicable classes when the mix-in is &#8220;required&#8221;.</li>
<li><strong>Lisp</strong> &#8211; Brilliant! All you <em>have </em>are functions!</li>
</ul>
<p>It&#8217;s also important to note the power you derive from combining this functional approach with lambda functions,  function objects, and covariance.</p>
<p><em>See also: </em><a href="http://www.drdobbs.com/184401197" target="_blank"><em>How Non-Member Functions Improve Encapsulation</em></a></p>
<br />Filed under: <a href='http://nerdfortress.com/category/codealicious/'>Codealicious</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nerdfortress.wordpress.com/1217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nerdfortress.wordpress.com/1217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nerdfortress.wordpress.com/1217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nerdfortress.wordpress.com/1217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nerdfortress.wordpress.com/1217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nerdfortress.wordpress.com/1217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nerdfortress.wordpress.com/1217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nerdfortress.wordpress.com/1217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nerdfortress.wordpress.com/1217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nerdfortress.wordpress.com/1217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nerdfortress.wordpress.com/1217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nerdfortress.wordpress.com/1217/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nerdfortress.wordpress.com/1217/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nerdfortress.wordpress.com/1217/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=1217&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nerdfortress.com/2010/08/17/behind-the-scenes-of-the-c-stl-algorithm-model/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf39bca66411f33a1d7f8c983960a13?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Random</media:title>
		</media:content>
	</item>
		<item>
		<title>WCF Madness: Method Not Allowed on Missing Query Parameter</title>
		<link>http://nerdfortress.com/2010/02/13/wcf-madness-method-not-allowed-on-missing-query-parameter/</link>
		<comments>http://nerdfortress.com/2010/02/13/wcf-madness-method-not-allowed-on-missing-query-parameter/#comments</comments>
		<pubDate>Sat, 13 Feb 2010 16:53:52 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Codealicious]]></category>

		<guid isPermaLink="false">http://nerdfortress.com/?p=1185</guid>
		<description><![CDATA[While testing some web services, I was not-so-pleasantly surprised to find that WCF cannot disambiguate two methods when one is a GET nd the other a POST: [OperationContract] [WebDispatchFormatter] [WebGet(UriTemplate = "/{encodedGameId}?startDate={startDate}&#38;endDate={endDate}&#38;tag={tag}")] Contracts.Out.Statistics GetStatistics(string gameId, string startDate, string endDate, string tag); [OperationContract] [WebInvoke(UriTemplate = "/{encodedGameId}", Method = Verbs.Post)] void AddSample(string gameId, Contracts.Sample newSample); [WebDispatchFormatter] If [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=1185&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><a href="http://nerdfortress.files.wordpress.com/2010/02/curved-yellow-fruit.jpg"><img src="http://nerdfortress.files.wordpress.com/2010/02/curved-yellow-fruit.jpg?w=150&#038;h=105" alt="" title="curved-yellow-fruit" width="150" height="105" class="alignright size-thumbnail wp-image-1191" /></a>While testing some web services, I was not-so-pleasantly surprised to find that WCF cannot disambiguate two methods when one is a GET nd the other a POST:<br />
	<code><br />
        [OperationContract]<br />
	[WebDispatchFormatter]<br />
	[WebGet(UriTemplate = "/{encodedGameId}?startDate={startDate}&amp;endDate={endDate}&amp;tag={tag}")]<br />
	Contracts.Out.Statistics GetStatistics(string gameId, string startDate, string endDate, string tag);</p>
<p>	[OperationContract]<br />
	[WebInvoke(UriTemplate = "/{encodedGameId}", Method = Verbs.Post)]<br />
	void AddSample(string gameId, Contracts.Sample newSample);<br />
	[WebDispatchFormatter]</code></p>
<p>If you leave off any of the query parameters for GetStatistics, WCF cheerfully returns &#8220;Method not allowed&#8221;. I wanted to make the &#8220;tag&#8221; parameter optional, and worried this would be a deal breaker.</p>
<p>Fortunately, I came across this <a href="http://blogs.msdn.com/rjacobs/archive/2009/02/10/ambiguous-uritemplates-query-parameters-and-integration-testing.aspx">WCF post by Ron Jacobs</a>.</p>
<p>The basic idea is to leave off the optional query parameters in the UriTemplate, instead manually pulling them from the current request context. This approach is actually similar to the way you access query parameters in RoR, so I should have thought of doing it like this in the first place.</p>
<p>In fact, if you beef up Ron&#8217;s QueryString class, it can clean help you DRY up your code by taking care of data type conversions on the sly.</p>
<p>The moral of the story is that a framework&#8217;s design can induce sneaky biases that you only discover as they jump out of the shadows to bite you.</p>
<p>Thanks Ron!</p>
<br />Filed under: <a href='http://nerdfortress.com/category/codealicious/'>Codealicious</a>  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nerdfortress.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nerdfortress.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nerdfortress.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nerdfortress.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nerdfortress.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nerdfortress.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nerdfortress.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nerdfortress.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nerdfortress.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nerdfortress.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nerdfortress.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nerdfortress.wordpress.com/1185/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nerdfortress.wordpress.com/1185/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nerdfortress.wordpress.com/1185/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=1185&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nerdfortress.com/2010/02/13/wcf-madness-method-not-allowed-on-missing-query-parameter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf39bca66411f33a1d7f8c983960a13?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Random</media:title>
		</media:content>

		<media:content url="http://nerdfortress.files.wordpress.com/2010/02/curved-yellow-fruit.jpg?w=150" medium="image">
			<media:title type="html">curved-yellow-fruit</media:title>
		</media:content>
	</item>
		<item>
		<title>2D Scripting: Choosing a 2D Engine Scripting Language</title>
		<link>http://nerdfortress.com/2009/09/24/2d-scripting-choosing-a-2d-engine-scripting-language/</link>
		<comments>http://nerdfortress.com/2009/09/24/2d-scripting-choosing-a-2d-engine-scripting-language/#comments</comments>
		<pubDate>Thu, 24 Sep 2009 12:48:41 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Codealicious]]></category>
		<category><![CDATA[Indie Games]]></category>

		<guid isPermaLink="false">http://nerdfortress.com/?p=975</guid>
		<description><![CDATA[What scripting language would you choose for a 2D game engine? Take a couple seconds and vote now (the poll is in the sidebar). I don&#8217;t want to bias anyone, so I will save my discussion of the pros and cons of each language for later. Posted in Codealicious, Indie Games<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=975&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>What scripting language would you choose for a <a href="http://nerdfortress.com/2009/08/26/2d-game-editor-project/" target="_blank">2D game engine</a>? Take a couple seconds and vote now (the poll is in the sidebar). I don&#8217;t want to bias anyone, so I will save my discussion of the pros and cons of each language for later.</p>
<br />Posted in Codealicious, Indie Games  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nerdfortress.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nerdfortress.wordpress.com/975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nerdfortress.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nerdfortress.wordpress.com/975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nerdfortress.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nerdfortress.wordpress.com/975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nerdfortress.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nerdfortress.wordpress.com/975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nerdfortress.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nerdfortress.wordpress.com/975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nerdfortress.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nerdfortress.wordpress.com/975/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nerdfortress.wordpress.com/975/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nerdfortress.wordpress.com/975/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=975&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nerdfortress.com/2009/09/24/2d-scripting-choosing-a-2d-engine-scripting-language/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf39bca66411f33a1d7f8c983960a13?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Random</media:title>
		</media:content>
	</item>
		<item>
		<title>Hex Words: How to Generate Hex Words</title>
		<link>http://nerdfortress.com/2009/04/16/hex-words-how-to-generate-hex-words/</link>
		<comments>http://nerdfortress.com/2009/04/16/hex-words-how-to-generate-hex-words/#comments</comments>
		<pubDate>Fri, 17 Apr 2009 01:02:14 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Codealicious]]></category>

		<guid isPermaLink="false">http://nerdfortress.com/?p=554</guid>
		<description><![CDATA[I always got a kick out of hex words (words that only use hexadecimal characters). If you are similarly deranged, Ned Batchelder has generated an awesome list of hex words for your viewing pleasure: Lots of these words are obscure, and therefore useless. For example, what&#8217;s an abaca? Perfect for making your own T-Shirt. Like, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=554&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>I always got a kick out of hex words (words that only use hexadecimal characters). If you are similarly deranged, Ned Batchelder has generated an awesome <a href="http://nedbatchelder.com/text/hexwords.html" target="_blank">list of hex words</a> for your viewing pleasure:</p>
<blockquote>
<p>Lots of these words are obscure, and therefore useless. For example, what&#8217;s an abaca?</p></blockquote>
<p>Perfect for making your own T-Shirt. Like, you could put <strong>7e55e118</strong> below a <a href="http://en.wikipedia.org/wiki/Polygon_mesh" target="_blank">mesh</a> , and only CG hackers would understand.</p>
<br />Posted in Codealicious  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nerdfortress.wordpress.com/554/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nerdfortress.wordpress.com/554/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nerdfortress.wordpress.com/554/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nerdfortress.wordpress.com/554/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nerdfortress.wordpress.com/554/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nerdfortress.wordpress.com/554/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nerdfortress.wordpress.com/554/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nerdfortress.wordpress.com/554/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nerdfortress.wordpress.com/554/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nerdfortress.wordpress.com/554/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nerdfortress.wordpress.com/554/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nerdfortress.wordpress.com/554/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nerdfortress.wordpress.com/554/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nerdfortress.wordpress.com/554/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=554&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nerdfortress.com/2009/04/16/hex-words-how-to-generate-hex-words/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf39bca66411f33a1d7f8c983960a13?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Random</media:title>
		</media:content>
	</item>
		<item>
		<title>Debugging Windows BSOD Crashes</title>
		<link>http://nerdfortress.com/2009/01/06/debugging-windows-bsod-crashes/</link>
		<comments>http://nerdfortress.com/2009/01/06/debugging-windows-bsod-crashes/#comments</comments>
		<pubDate>Tue, 06 Jan 2009 20:50:28 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Codealicious]]></category>

		<guid isPermaLink="false">http://nerdfortress.com/?p=378</guid>
		<description><![CDATA[What many people don&#8217;t know about Windows BSOD crashes is that almost all of them are caused by third-party drivers. In fact, given the millions of Windows-compatible devices out there, it&#8217;s a miracle of modern (computer) science that the Redmond OS runs at all! No other operating system can match Windows for the number of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=378&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>What many people don&#8217;t know about Windows BSOD crashes is that almost all of them are caused by third-party drivers. In fact, given the millions of Windows-compatible devices out there, it&#8217;s a miracle of modern (computer) science that the Redmond OS runs at all!<span id="more-378"></span></p>
<p>No other operating system can match Windows for the number of devices supported, but it definitely comes with a trade-off. If you have fallen prey to a poorly-written driver, don&#8217;t despair! All you need to do is whip out your trusty copy of WinDbg, and within a few minutes that wimpy driver will cower before your superior kernel ninja skills!</p>
<p><a href="http://www.networkworld.com/news/2005/041105-windows-crash.html?page=1" target="_blank">Learn how to debug Windows BSOD crashes</a>. Also, here is <a href="http://www.debuginfo.com/articles/easywindbg.html" target="_blank">a more general tutorial on WinDbg</a>.</p>
<p>Now, once you&#8217;ve found the culprit, you have three options. Choose wisely:</p>
<ol>
<li>Get the latest driver from Windows Update or the device manufacturer&#8217;s website.</li>
<li>Replace the rogue device with something from a company who actually tests their hardware before shipping it.</li>
<li>Buy a Mac. They never crash, right?</li>
</ol>
<br />Posted in Codealicious  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nerdfortress.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nerdfortress.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nerdfortress.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nerdfortress.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nerdfortress.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nerdfortress.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nerdfortress.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nerdfortress.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nerdfortress.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nerdfortress.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nerdfortress.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nerdfortress.wordpress.com/378/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nerdfortress.wordpress.com/378/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nerdfortress.wordpress.com/378/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=378&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nerdfortress.com/2009/01/06/debugging-windows-bsod-crashes/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf39bca66411f33a1d7f8c983960a13?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Random</media:title>
		</media:content>
	</item>
		<item>
		<title>Linux XFS Does not Support dirent::d_type</title>
		<link>http://nerdfortress.com/2008/09/19/linux-xfs-does-not-support-direntd_type/</link>
		<comments>http://nerdfortress.com/2008/09/19/linux-xfs-does-not-support-direntd_type/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 19:02:41 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Codealicious]]></category>

		<guid isPermaLink="false">http://nerdfortress.wordpress.com/?p=156</guid>
		<description><![CDATA[Recently at work we had a couple customers mention to us that while backing up files on Linux, symlinks and FIFO (names pipe) files were not being skipped. Trying to backup a FIFO is what we call a bad idea. Very, very bad. One customer reported that most of his filesystems were XFS. Sure enough, [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=156&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Recently <a href="http://jungledisk.com/" target="_blank">at work</a> we had a couple customers mention to us that while backing up files on Linux, symlinks and <a href="http://linux.about.com/library/cmd/blcmdl4_fifo.htm" target="_blank">FIFO (names pipe) files</a> were not being skipped. Trying to backup a FIFO is what we call a <em>bad idea</em>. Very, very bad. <span id="more-156"></span>One customer reported that most of his filesystems were XFS. Sure enough, after some digging around and testing, I happened to discover this most <em>useful</em> bit of information:</p>
<p><strong>XFS does not support dirent::d_type</strong></p>
<p>What the?! In other words, a line such as this will always be false:</p>
<pre><strong>de-&gt;d_type == DT_FIFO</strong></pre>
<p>Jungle Disk uses <a href="http://www.kernel.org/doc/man-pages/online/pages/man3/readdir.3.html" target="_blank">readdir_r()</a> to list files and check their types. Uh oh. That means that on XFS partitions, everything looks like a regular file! You can see this for yourself using code like this:</p>
<pre class="brush: cpp;">#include &lt;iostream&gt;
#include &lt;cstdlib&gt;
#include &lt;dirent.h&gt;
#include &lt;sys/stat.h&gt;

using namespace std;

int main(int argc, char *argv[])
{

  dirent holdde;
  dirent *de;
  struct stat st;

  cout &lt;&lt; &quot;DT_BLK = &quot; &lt;&lt; DT_BLK &lt;&lt; endl;
  cout &lt;&lt; &quot;DT_CHR = &quot; &lt;&lt; DT_CHR &lt;&lt; endl;
  cout &lt;&lt; &quot;DT_DIR = &quot; &lt;&lt; DT_DIR &lt;&lt; endl;
  cout &lt;&lt; &quot;DT_FIFO = &quot; &lt;&lt; DT_FIFO &lt;&lt; endl;
  cout &lt;&lt; &quot;DT_LNK = &quot; &lt;&lt; DT_LNK &lt;&lt; endl;
  cout &lt;&lt; &quot;DT_REG = &quot; &lt;&lt; DT_REG &lt;&lt; endl;
  cout &lt;&lt; &quot;DT_SOCK = &quot; &lt;&lt; DT_SOCK &lt;&lt; endl;
  cout &lt;&lt; &quot;DT_UNKNOWN = &quot; &lt;&lt; DT_LNK &lt;&lt; endl;

  DIR *dir = opendir(&quot;/home/vmuser/xfs&quot;);
  while (readdir_r(dir, &amp;holdde, &amp;de) == 0 &amp;&amp; de)
  {
	  cout &lt;&lt; de-&gt;d_name &lt;&lt; &quot; [&quot; &lt;&lt; (int)de-&gt;d_type &lt;&lt; &quot;] &quot; &lt;&lt; endl;
  }
  closedir(dir);

  lstat(&quot;/home/vmuser/xfs/TESTFIFO&quot;, &amp;st);
  if (S_ISFIFO(st.st_mode))
	  cout &lt;&lt; &quot;XFS FIFO detected: &quot; &lt;&lt; st.st_mode &lt;&lt; endl; 

  lstat(&quot;/home/vmuser/ext3/TESTFIFO&quot;, &amp;st);
  if ((st.st_mode &amp; S_IFIFO) != 0)
	  cout &lt;&lt; &quot;EXT3 FIFO detected: &quot; &lt;&lt; st.st_mode &lt;&lt; endl; 

  return EXIT_SUCCESS;
}</pre>
<p>So what&#8217;s the solution? Good old, reliable <a href="http://www.kernel.org/doc/man-pages/online/pages/man2/stat.2.html" target="_blank">stat()</a>. That function <em>does</em> work with XFS on Linux. Unfortunately, this means you will have to make an extra call for each file after listing the dir.</p>
<br />Posted in Codealicious  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nerdfortress.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nerdfortress.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nerdfortress.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nerdfortress.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nerdfortress.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nerdfortress.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nerdfortress.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nerdfortress.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nerdfortress.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nerdfortress.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nerdfortress.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nerdfortress.wordpress.com/156/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nerdfortress.wordpress.com/156/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nerdfortress.wordpress.com/156/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=156&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nerdfortress.com/2008/09/19/linux-xfs-does-not-support-direntd_type/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf39bca66411f33a1d7f8c983960a13?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Random</media:title>
		</media:content>
	</item>
		<item>
		<title>Hacking the Wii: Compiling and Running Wii Code</title>
		<link>http://nerdfortress.com/2008/09/18/hacking-the-wii-compiling-and-running-wii-code/</link>
		<comments>http://nerdfortress.com/2008/09/18/hacking-the-wii-compiling-and-running-wii-code/#comments</comments>
		<pubDate>Thu, 18 Sep 2008 16:10:38 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Codealicious]]></category>
		<category><![CDATA[Indie Games]]></category>

		<guid isPermaLink="false">http://nerdfortress.wordpress.com/?p=152</guid>
		<description><![CDATA[What could be more fun that hacking the Wii? Compiling and running your own Wii games is actually pretty straightforward. The only caveat is that you will need a copy of The Legend of Zelda: Twilight Princess and an SD card. For remote debugging, you will also need the USB Gecko. Many people have already [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=152&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>What could be more fun that hacking the Wii? Compiling and running your own Wii games is actually pretty straightforward. The only caveat is that you will need a copy of <a href="http://www.zelda.com/universe/game/twilightprincess/" target="_blank">The Legend of Zelda: Twilight Princess</a> and an SD card. For remote debugging, you will also need the <a href="http://www.usbgecko.com/" target="_blank">USB Gecko</a>. Many people have already written homebrew apps using the open source <a href="http://wiibrew.org/wiki/DevkitPro" target="_blank">DevkitPro</a> to compile their stuff.</p>
<p>If you are interesting in hacking the Wii, you need to check out <a href="http://wiibrew.org/wiki/Main_Page" target="_blank">WiiBrew</a>. This is the place to go for information about compiling, running, and debugging your own custom Wii apps. For example, WiiBrew is where I found out about the excellent <a href="http://hbc.hackmii.com/" target="_blank">Homebrew Channel</a>.</p>
<p>Dotbatman <a href="http://nerdfortress.wordpress.com/2008/09/17/wii-that-was-a-fun-ride-with-direnth/" target="_blank">is porting</a> the cult classic <a href="http://smw.72dpiarmy.com/" target="_blank">Super Mario War</a> to the Wii. What are <em>you</em> going to do?</p>
<p><em>Update: You no longer need a copy of Zelda to install the Homebrew Channel! <a href="http://wiibrew.org/wiki/Setting_up_your_Wii_for_Homebrew" target="_blank">Check out the latest Bannerbomb hack</a>. </em></p>
<br />Posted in Codealicious, Indie Games  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nerdfortress.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nerdfortress.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nerdfortress.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nerdfortress.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nerdfortress.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nerdfortress.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nerdfortress.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nerdfortress.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nerdfortress.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nerdfortress.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nerdfortress.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nerdfortress.wordpress.com/152/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nerdfortress.wordpress.com/152/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nerdfortress.wordpress.com/152/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=152&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nerdfortress.com/2008/09/18/hacking-the-wii-compiling-and-running-wii-code/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf39bca66411f33a1d7f8c983960a13?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Random</media:title>
		</media:content>
	</item>
		<item>
		<title>Wii! That was a fun ride with dirent.h!</title>
		<link>http://nerdfortress.com/2008/09/17/wii-that-was-a-fun-ride-with-direnth/</link>
		<comments>http://nerdfortress.com/2008/09/17/wii-that-was-a-fun-ride-with-direnth/#comments</comments>
		<pubDate>Wed, 17 Sep 2008 15:58:14 +0000</pubDate>
		<dc:creator>dotbatman</dc:creator>
				<category><![CDATA[Codealicious]]></category>
		<category><![CDATA[Indie Games]]></category>

		<guid isPermaLink="false">http://nerdfortress.wordpress.com/?p=130</guid>
		<description><![CDATA[It&#8217;s been a bumpy road to get there, but I&#8217;ve created a dirent.h for use in hacking the Nintendo Wii. You might ask, &#8220;what the heck did you go and do that for?&#8221; Perhaps it&#8217;s because I&#8217;m a good Samaritan who saw the suffering of my fellow Wii h4x0rd00dz and knew that I could ease [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=130&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>It&#8217;s been a bumpy road to get there, but I&#8217;ve created a dirent.h for use in <a href="http://nerdfortress.com/2008/09/18/hacking-the-wii-compiling-and-running-wii-code/" target="_blank">hacking the Nintendo Wii</a>. You might ask, &#8220;what the heck did you go and do that for?&#8221; Perhaps it&#8217;s because I&#8217;m a good Samaritan who saw the suffering of my fellow Wii h4x0rd00dz and knew that I could ease the pain. Perhaps it&#8217;s because I didn&#8217;t know C at all, and thought I might learn a thing or two. Or perhaps it&#8217;s because when I was trying to compile <a href="http://smw.72dpiarmy.com/" target="_blank">Super Mario War</a> for the Wii, it was one of the things giving compile errors. Regardless of the reason, the beast has been conquered, and the spoils should be put in your libogc/include directory.</p>
<p><span id="more-130"></span></p>
<pre class="brush: cpp;">/*
Copyright (c) 2008, dotbatman (nerdfortress.com)
All rights reserved.

Redistribution and use in source and binary forms, with or without modification,
are permitted provided that the following conditions are met:

	1. Redistributions of source code must retain the above copyright notice,
	this list of conditions and the following disclaimer.

	2. Redistributions in binary form must reproduce the above copyright
	notice, this list of conditions and the following disclaimer in the
	documentation and/or other materials provided with the distribution.

	3. Neither the name of the nerdfortress.com nor the names of its
	contributors may be used to endorse or promote products derived from
	this software without specific prior written permission.

THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS &quot;AS IS&quot;
AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE
FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE
USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/

#ifdef __cplusplus
extern &quot;C&quot; {
#endif

#ifdef DIRENT_H

// This has already been included in the project once, so we only need prototypes
static DIR* opendir (const char *path);
static int closedir (DIR *dir);
static struct dirent* readdir (DIR *dir);
static void rewinddir (DIR *dir);

#else // First inclusion

// We don't want to be redefining these functions over and over again.
#define DIRENT_H 

#include &lt;stdio.h&gt;
#include &lt;stdlib.h&gt;
#include &lt;errno.h&gt;
#include &lt;string.h&gt;
#include &lt;sys/dir.h&gt;
#include &lt;fat.h&gt;

typedef DIR_ITER dir_t; // For libfat

// This structure can hold all the juicy details for our functions,
// and it doesn't need to follow any standard but having d_name in most cases.
typedef struct dirent
{
	DIR_ITER*	dirPointer;
	char		d_name[FILENAME_MAX+1];
} DIR;

static DIR* opendir(const char* path)
{
	DIR* dir;

	// Check the path yourself. This is just to make sure we don't trip over
	// someone elses really bad code (tm).
	if (!path || *path == 0)
	{
		errno = EINVAL;
		return NULL;
	}

	DIR_ITER* dp = diropen(path);
	if(!dp)
		return NULL; // diropen sets errno for us, so just return NULL. 

	// Build our DIR struct
	dir = (DIR*)malloc(sizeof(DIR));
	if(!dir)
	{
		errno = ENOMEM;
		return NULL;
	}

	dir-&gt;dirPointer = dp;

	// Return that DIR for use with other functions.
	return dir;
}

static int closedir(DIR* dir)
{
	int retval;

	if (!dir)
	{
		// Not a good DIR, but thanks for playing... aha ha ha ha.
		errno = EBADF;
		retval = -1;
	} else {
		// Pass the DIR_ITER pointer to libfat and shut 'er down.
		retval = dirclose(dir-&gt;dirPointer);
		free(dir); // Clean up after ourselves
	}

	return retval;
}

static struct dirent* readdir(DIR* dir)
{
	// We'll need to store each entry from the listing
	char entry[FILENAME_MAX+1];

	if (!dir)
	{
		errno = EBADF; // Bad DIR. No biscuit.
		return NULL;
	}

	if(dirnext(dir-&gt;dirPointer, entry, NULL) == 0)
	{
		strncpy(dir-&gt;d_name, entry, FILENAME_MAX);
		return dir;
	}

	// We're all out of files to give you
	return NULL;
}

static void rewinddir(DIR* dir)
{
	if (dir != NULL)
	{
		// If you need documentation on this one, you've got bigger problems.
		dirreset(dir-&gt;dirPointer);
	}
}

#endif // DIRENT_H

#ifdef __cplusplus
}
#endif
</pre>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nerdfortress.wordpress.com/130/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nerdfortress.wordpress.com/130/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nerdfortress.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nerdfortress.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nerdfortress.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nerdfortress.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nerdfortress.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nerdfortress.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nerdfortress.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nerdfortress.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nerdfortress.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nerdfortress.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nerdfortress.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nerdfortress.wordpress.com/130/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nerdfortress.wordpress.com/130/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nerdfortress.wordpress.com/130/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=130&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nerdfortress.com/2008/09/17/wii-that-was-a-fun-ride-with-direnth/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/c77a21d1e5609b512eaca0731de7a7fc?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">dotbatman</media:title>
		</media:content>
	</item>
		<item>
		<title>Visual Studio 2008 Keyboard Shortcuts Cheat Sheet</title>
		<link>http://nerdfortress.com/2008/09/02/visual-studio-2008-cheat-sheet/</link>
		<comments>http://nerdfortress.com/2008/09/02/visual-studio-2008-cheat-sheet/#comments</comments>
		<pubDate>Tue, 02 Sep 2008 19:02:24 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Codealicious]]></category>

		<guid isPermaLink="false">http://nerdfortress.com/?p=57</guid>
		<description><![CDATA[For all you C# fans out there, I came across this excellent keyboard cheat sheet today. But this is just the tip of the iceberg. One of Visual Studio&#8217;s best-kept secrets is its excellent keyboarding support (like one of my favorites, CTRL+ENTER).  To get a full list of keyboard shortcuts in Visual Studio 2008, I [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=37&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>For all you C# fans out there, I came across this excellent <a title="Visual Studio C# Cheat Sheet" href="http://www.microsoft.com/downloads/details.aspx?familyid=e5f902a8-5bb5-4cc6-907e-472809749973&amp;displaylang=en" target="_blank">keyboard cheat sheet</a> today. But this is just the tip of the iceberg. One of Visual Studio&#8217;s best-kept secrets is its excellent keyboarding support (like one of my favorites, CTRL+ENTER).  To get a full list of keyboard shortcuts in Visual Studio 2008, I updated <a title="Visual Studio 2008 Shortcuts" href="http://www.codinghorror.com/blog/archives/000412.html" target="_self">Jeff&#8217;s macro</a>. If you want to do the same, just add a reference to System.Data.dll and System.XML.dll, as well as a imports for EnvDTE90, System.Data, and System.XML. The result? A nice-looking, comprehensive cheat sheet. Excellent!</p>
<p><a title="Visual Studio 2008 Keyboard Shortcuts Cheat Sheet" href="http://nerdfortress.s3.amazonaws.com/visual-studio-2008-keyboard-shortcuts.html">Get the Visual Studio 2008 Keyboard Shortcuts Cheat Sheet</a></p>
<p><em>Bonus! For all you VIM ninjas, get even more keyboard love with <a title="Visual Studio Keyboard Shortcuts" href="http://www.viemu.com/" target="_blank">ViEmu</a> and my favorite <a href="http://worldtimzone.com/res/vi.html">VIM cheatsheet</a>.<br />
</em><em>Bonus #2! Check out these other <a title="programming cheat sheets" href="http://www.addedbytes.com/cheat-sheets/" target="_blank">well-done programming cheat sheets</a>.<br />
</em><em>Bonus #3! Use these <a href="http://stackoverflow.com/questions/100420/hidden-features-of-visual-studio-2005-2008#100457" target="_blank">little-known features of Visual Studio</a> to be more productive.</em></p>
<p><em> </em></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nerdfortress.wordpress.com/37/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nerdfortress.wordpress.com/37/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nerdfortress.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nerdfortress.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nerdfortress.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nerdfortress.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nerdfortress.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nerdfortress.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nerdfortress.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nerdfortress.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nerdfortress.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nerdfortress.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nerdfortress.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nerdfortress.wordpress.com/37/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nerdfortress.wordpress.com/37/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nerdfortress.wordpress.com/37/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=37&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nerdfortress.com/2008/09/02/visual-studio-2008-cheat-sheet/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf39bca66411f33a1d7f8c983960a13?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Random</media:title>
		</media:content>
	</item>
		<item>
		<title>Magic of the Mod</title>
		<link>http://nerdfortress.com/2008/08/27/magic-of-the-mod/</link>
		<comments>http://nerdfortress.com/2008/08/27/magic-of-the-mod/#comments</comments>
		<pubDate>Thu, 28 Aug 2008 03:11:53 +0000</pubDate>
		<dc:creator>Kurt</dc:creator>
				<category><![CDATA[Codealicious]]></category>

		<guid isPermaLink="false">http://nerdfortress.com/?p=56</guid>
		<description><![CDATA[Mathematics is full of weird and wonderful constructs that you can use to leap buildings in a single bound. If you examine even a small string of mathematical symbols, you&#8217;ll discover a complex dance of interrelated algorithms. Even the humble &#8220;plus&#8221; and &#8220;minus&#8221; operators reveal a fair number of mathematical principles and properties. One of [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=36&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>Mathematics is full of weird and wonderful constructs that you can use to leap buildings in a single bound. If you examine even a small string of mathematical symbols, you&#8217;ll discover a complex dance of interrelated algorithms. Even the humble &#8220;plus&#8221; and &#8220;minus&#8221; operators reveal a fair number of mathematical principles and properties.<span id="more-36"></span></p>
<p>One of my favorite operators is <a href="http://en.wikipedia.org/wiki/Modulo_operation" target="_blank">modulo</a>, or simply <em>mod</em>. This thing is pure magic. For example, suppose I needed to keep track of whether I was on an odd or even row in a table. People do this all the time to color alternating rows, making the information more readable. I could write some code like this:</p>
<pre class="brush: ruby;">is_even = false
rows.each do |row|
  if is_even
    color = :even
  else
    color = <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> dd
  end

  is_even = !is_even
end</pre>
<p>Using the magic of the mod, I can simplify my life a little:</p>
<pre class="brush: ruby;">rows.each_with_index do |row, i|
  if (i % 2) == 0
    color = :even
  else
    color = <img src='http://s.wordpress.com/wp-includes/images/smilies/icon_surprised.gif' alt=':o' class='wp-smiley' /> dd
  end
end</pre>
<p>Now, that was OK, but not really all that <em>magical</em>. But lets take this idea one step further. Suppose you were providing a web service and you had a bunch of clients connecting to your servers. In order to distribute the load, you could use some kind of proxy or load balancer. Each client would then connect to one IP address and the proxy would divvy up the requests among your servers. The problem with this is you have a potential bottleneck in your system; you can only respond to requests as fast as your proxy can process the traffic.</p>
<p>One alternative is to harness the magic of the mod. The first thing you need is some kind of unique ID for each client. This could be a username, a GUID, or whatever. The second thing you need is to give each client a list of servers it can connect to.</p>
<p>Now, the client will need to figure out all by itself which server in your cluster is its buddy for life. Its soul mate. The client does this by first taking it&#8217;s ID and hashing it into a number. The hash algorithm should have as even a distribution as possible (i.e., two IDs that are similar should hash to totally different numbers). Can you tell why this is important? Now, once the client has that fancy number in hand, it is time to invoke the <em>magic of the mod</em>. Simply mod the ID hash by the number of servers<em>, </em>and the number you get is the index of the server you should send your requests to.</p>
<p>If you are, well, <em>paranoid</em>, and want to ensure that a rogue piece of software isn&#8217;t sending everything to a single server, regardless of the client ID, you will need some way of looking up the ID for each request and then doing the same hash-lookup procedure on the server side that the client is supposed to do. If the result is kosher (i.e., the server receiving the request is the one the client should be talking to), the server processes the request. Otherwise, the server returns a big fat error. As big and fat as possible.</p>
<p>What is your favorite use for the mod?</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nerdfortress.wordpress.com/36/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nerdfortress.wordpress.com/36/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nerdfortress.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nerdfortress.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nerdfortress.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nerdfortress.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nerdfortress.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nerdfortress.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nerdfortress.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nerdfortress.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nerdfortress.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nerdfortress.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nerdfortress.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nerdfortress.wordpress.com/36/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nerdfortress.wordpress.com/36/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nerdfortress.wordpress.com/36/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&amp;blog=4772118&amp;post=36&amp;subd=nerdfortress&amp;ref=&amp;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nerdfortress.com/2008/08/27/magic-of-the-mod/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://0.gravatar.com/avatar/ccf39bca66411f33a1d7f8c983960a13?s=96&#38;d=http%3A%2F%2F0.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">Random</media:title>
		</media:content>
	</item>
	</channel>
</rss>