<?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; Hacker Challenge</title>
	<atom:link href="http://nerdfortress.com/category/hacker-challenge/feed/" rel="self" type="application/rss+xml" />
	<link>http://nerdfortress.com</link>
	<description>Esoteric How-to&#039;s, Essays, and Rand();</description>
	<lastBuildDate>Mon, 21 May 2012 19:55:22 +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://s2.wp.com/i/buttonw-com.png</url>
		<title>Nerd Fortress &#187; Hacker Challenge</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>Number Crunch Brunch</title>
		<link>http://nerdfortress.com/2009/02/17/number-crunch-brunch/</link>
		<comments>http://nerdfortress.com/2009/02/17/number-crunch-brunch/#comments</comments>
		<pubDate>Tue, 17 Feb 2009 17:07:09 +0000</pubDate>
		<dc:creator>ANSI Pants</dc:creator>
				<category><![CDATA[Hacker Challenge]]></category>

		<guid isPermaLink="false">http://nerdfortress.com/?p=394</guid>
		<description><![CDATA[We now join our hero, Captain Constructor, at Decidability Deli where he is brunching with his arch-nemesis, Doctor Destructor.  (The thoughts and ideas presented herein by Doctor Destructor are expressed in a shade of red, while those of Captain Constructor are blue.)   So you see, my good captain, the number of infinities is itself [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&#038;blog=4772118&#038;post=394&#038;subd=nerdfortress&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>We now join our hero, Captain Constructor, at Decidability Deli where he is brunching with his arch-nemesis, Doctor Destructor.  (The thoughts and ideas presented herein by Doctor Destructor are expressed in a shade of red, while those of Captain Constructor are blue.)</em></p>
<p> </p>
<p><span style="color:#993300;">So you see, my good captain, the number of infinities is itself infinite.</span></p>
<p><strong></strong><span style="color:#3366ff;">Of course.  And the number of finities is finite.  By the way, are you enjoying that Pi?</span></p>
<p><span style="color:#993300;">Yes, yes!  It&#8217;s absolutely irrational!  But back to more serious matters.  I have just discovered a delightful sequence of numbers which is sure to stump you until well after the end of the universe.</span></p>
<p><span style="color:#3366ff;">On second thought, perhaps inviting you to brunch was a sub-good idea.  Must we talk numbers now?</span></p>
<p><span style="color:#993300;">Usually you are quite game, Captain.  There must be something debilitating in that Turing Tart of yours.</span></p>
<p><span style="color:#3366ff;">Sadly, I think you&#8217;re right.  Yet I cannot resist.</span></p>
<p><span style="color:#993300;">Every Achilles has his heel.  Just like every cowboy sings a sad, sad song.</span></p>
<p><span style="color:#3366ff;">Every villain likes to hear himself talk.  On with the number sequence!</span></p>
<p> </p>
<p><em>Dr. Destructor clears his throat and begins&#8230;</em></p>
<p><em><span id="more-394"></span><br />
</em></p>
<p><span style="color:#993300;">If I were to tell you that a certain sequence began with the numbers 0, 1, and 2, what would you guess is the next number?</span></p>
<p><span style="color:#3366ff;">It seems only natural to assume that the next number is 3.  Three is, after all, the next of the natural numbers.</span></p>
<p><span style="color:#993300;">It is indeed, old capt.  However, 3 is </span><em><span style="color:#993300;">not</span></em><span style="color:#993300;"> the next number in this particular sequence.  The next number is actually 2.601218943565795100204903227081e+1746, which is clearly not easy to pronounce.</span></p>
<p><span style="color:#3366ff;">Clearly.  Wouldn&#8217;t it be easier to pronounce it as 720 factorial?</span></p>
<p><span style="color:#993300;">Very astute, Captain Number Crunch.  You were awfully quick to find that reduction.  But can you quickly explain the relationship of 720! to 2, 1, and 0?  Nevermind the quickly.  Can you even explain it at all?  Mua ha ha ha ha!!!</span></p>
<p> </p>
<p><em>Join us next time for the exciting conclusion!</em></p>
<br />Posted in Hacker Challenge  <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nerdfortress.wordpress.com/394/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nerdfortress.wordpress.com/394/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nerdfortress.wordpress.com/394/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nerdfortress.wordpress.com/394/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nerdfortress.wordpress.com/394/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nerdfortress.wordpress.com/394/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nerdfortress.wordpress.com/394/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nerdfortress.wordpress.com/394/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nerdfortress.wordpress.com/394/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nerdfortress.wordpress.com/394/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nerdfortress.wordpress.com/394/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nerdfortress.wordpress.com/394/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nerdfortress.wordpress.com/394/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nerdfortress.wordpress.com/394/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&#038;blog=4772118&#038;post=394&#038;subd=nerdfortress&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nerdfortress.com/2009/02/17/number-crunch-brunch/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9eafe0384840e29458017efa62351c90?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ANSI Pants</media:title>
		</media:content>
	</item>
		<item>
		<title>100 Balls, etc.: The Exciting Conclusion!</title>
		<link>http://nerdfortress.com/2008/05/16/100-balls-etc-the-exciting-conclusion/</link>
		<comments>http://nerdfortress.com/2008/05/16/100-balls-etc-the-exciting-conclusion/#comments</comments>
		<pubDate>Fri, 16 May 2008 15:59:35 +0000</pubDate>
		<dc:creator>ANSI Pants</dc:creator>
				<category><![CDATA[Hacker Challenge]]></category>
		<category><![CDATA[thought puzzles]]></category>

		<guid isPermaLink="false">http://nerdfortress.com/?p=24</guid>
		<description><![CDATA[[When we last visited our intrepid hero, he was engaged in a battle of wits atop the tallest turret of Fallacy Fortress. The fate of the world is again in his hands. We join him now...] Dr. Destructor: Wait till I get going! Where was I? Capt. Constructor: Australia. Oh wait. I mean, you were [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&#038;blog=4772118&#038;post=22&#038;subd=nerdfortress&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>[When we last visited our intrepid hero, <a title="100 Balls, 10 Buckets, 1 Single-Use Scale" href="/2008/04/07/100-balls-10-buckets-1-single-use-scale/" target="_self">he was engaged in a battle of wits</a> atop the tallest turret of Fallacy Fortress. The fate of the world is again in his hands. We join him now...]</em></p>
<p><strong>Dr. Destructor:</strong> Wait till I get going! Where was I?</p>
<p><strong>Capt. Constructor:</strong> Australia. Oh wait. I mean, you were just telling me about spheroids, buckets, and a scale.</p>
<p><strong>Dr. Destructor:</strong> Right! I, like many <a title="Virtual Destructor" href="http://www.google.com/search?q=virtual+destructor" target="_blank">non-virtual Destructors</a> out there, suffer from occasional memory leaks. Don&#8217;t tell me you Constructors are immune. Australia? Ha!</p>
<p><span id="more-22"></span><strong>Capt. Constructor:</strong> <a title="In Search of Memory" href="http://www.nytimes.com/2006/04/09/books/review/09nuland.html" target="_blank">Memory</a> and Australia are both quite entertaining topics. But if you&#8217;ll excuse me, the world is on the verge of collapse and I hear some spheroids calling my name.</p>
<p><strong>Spheroids:</strong> O Captain! my Captain!</p>
<p><em>[Our hero dashes to the Table of Doom whereon are arranged the spheroid-filled buckets and the badly damaged scale. He buries himself in thought for a full 100 milliseconds, which is an eternity to a modern microprocessor.]</em></p>
<p><strong>Capt. Constructor:</strong> Aha! The solution is simple. Given that the buckets are labeled 0 through 9, the following algorithm should suffice:</p>
<pre style="font-size:90%;"><span style="color:#0000ff;"><strong>void</strong></span> transferSpheroids(<span style="color:#0000ff;"><strong>int</strong></span> howMany, Bucket&amp; from, Bucket&amp; to)
{
<span style="color:#008000;"> // The contents of this function are left as an exercise </span><span class="Apple-style-span" style="color:#008000;">for the reader.
<span class="Apple-style-span" style="color:#000000;">}</span></span></pre>
<pre style="font-size:90%;"><strong><span style="color:#0000ff;">const</span></strong> <span style="color:#0000ff;"><strong>int</strong></span> numBuckets = <span style="color:#00ffff;">10</span>;
<span style="color:#0000ff;"><strong>const</strong></span> <span style="color:#0000ff;"><strong>float</strong></span> normalWeight = <strong><span style="color:#00ffff;">1.0f</span></strong>;
<strong><span style="color:#0000ff;">const</span></strong> <strong><span style="color:#0000ff;">float</span></strong> abnormalWeight = <span style="color:#00ffff;">1.01f</span>;
<span style="color:#0000ff;"><strong>const</strong></span> <span style="color:#0000ff;"><strong>float</strong></span> singleWeightDiff = abnormalWeight - normalWeight;
<span style="color:#008000;">
// See <a href="http://en.wikipedia.org/wiki/Arithmetic_progression" target="_blank">http://en.wikipedia.org/wiki/Arithmetic_progression</a> on why this works.</span>
<span style="color:#0000ff;"><strong>const float</strong></span> expectedWeight = numBuckets * (numBuckets - <span style="color:#00ffff;">1</span>) * normalWeight / <span style="color:#00ffff;">2.0f</span>;
<span style="color:#0000ff;"><strong>
int</strong></span> findHeavyBucket(<strong><span style="color:#0000ff;">int</span></strong> buckets[])
{
<span style="color:#0000ff;"><strong> for</strong></span> (<span style="color:#0000ff;"><strong>int</strong></span> whichBucket = <span style="color:#00ffff;">0</span>; whichBucket &lt; numBuckets; whichBucket++)
  {
    transferSpheroids(whichBucket, buckets[whichBucket], <span style="color:#0000ff;">this</span>.EmptyBucket);
  }
<span style="color:#0000ff;"><strong>
 float</strong></span> actualWeight = scale.Weigh(<span style="color:#0000ff;"><strong>this</strong></span>.EmptyBucket);
  <span style="color:#0000ff;"><strong>float</strong></span> totalWeightDiff = actualWeight - expectedWeight;

  return (<span style="color:#0000ff;"><strong>int</strong></span>)(totalWeightDiff / singleWeightDiff);
}

<span style="color:#0000ff;"><strong>int</strong></span> main()
{
<span style="color:#008000;"> // Set up the buckets, etc.
 // ...</span>

  <span style="color:#0000ff;"><strong>int</strong></span> bucketContainingHeavies = findHeavyBucket(buckets);
}</pre>
<p><strong>Capt. Constructor:</strong> Of course there may be a syntax error or two in there. You&#8217;ll forgive me for not bringing my pocket compiler.</p>
<p><strong>Dr. Destructor:</strong> Arg! Foiled again! How were you able to solve it so quickly?</p>
<p><strong>Capt. Constructor:</strong> You made the mistake of labeling each of the buckets 0 through 9. That was just the clue I needed. It otherwise might have taken me 300 milliseconds or more.</p>
<p><strong>Dr. Destructor:</strong> Curses!</p>
<p><strong>Capt. Constructor:</strong> Remember, Destructor, nefariosity does not pay.</p>
<p><strong>Dr. Destructor:</strong> I believe you mean <a title="Nefariosity? Nefarity? Nefariousness!" href="http://answers.yahoo.com/question/index?qid=20080229195707AAGJtQn" target="_blank">nefariousness</a>.</p>
<p><strong>Capt. Constructor</strong>: Whatever.</p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nerdfortress.wordpress.com/22/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nerdfortress.wordpress.com/22/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nerdfortress.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nerdfortress.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nerdfortress.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nerdfortress.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nerdfortress.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nerdfortress.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nerdfortress.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nerdfortress.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nerdfortress.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nerdfortress.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nerdfortress.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nerdfortress.wordpress.com/22/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nerdfortress.wordpress.com/22/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nerdfortress.wordpress.com/22/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&#038;blog=4772118&#038;post=22&#038;subd=nerdfortress&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nerdfortress.com/2008/05/16/100-balls-etc-the-exciting-conclusion/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9eafe0384840e29458017efa62351c90?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ANSI Pants</media:title>
		</media:content>
	</item>
		<item>
		<title>100 Balls, 10 Buckets, 1 Single-Use Scale</title>
		<link>http://nerdfortress.com/2008/04/07/100-balls-10-buckets-1-single-use-scale/</link>
		<comments>http://nerdfortress.com/2008/04/07/100-balls-10-buckets-1-single-use-scale/#comments</comments>
		<pubDate>Tue, 08 Apr 2008 02:46:29 +0000</pubDate>
		<dc:creator>ANSI Pants</dc:creator>
				<category><![CDATA[Hacker Challenge]]></category>
		<category><![CDATA[thought puzzles]]></category>

		<guid isPermaLink="false">http://nerdfortress.com/?p=16</guid>
		<description><![CDATA[[We join our hero, Captain Constructor, atop the tallest turret of Doctor Destructor's hidden hideout: Fallacy Fortress...] Dr. Destructor: You&#8217;re too late, Constructor! Before the next clock cycle, all of those mortals you call friends will be destroyed! And your little dog, too! [Maniacal laughter...] Cptn. Constructor: Close your handle, Destructor. Just tell me how [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&#038;blog=4772118&#038;post=14&#038;subd=nerdfortress&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p><em>[We join our hero, Captain Constructor, atop the tallest turret of Doctor Destructor's hidden hideout: Fallacy Fortress...]</em></p>
<p><em><strong>Dr. Destructor</strong>:</em> You&#8217;re too late, Constructor! Before the next clock cycle, all of those mortals you call friends will be destroyed! And your little dog, too! <em>[Maniacal laughter...]</em></p>
<p><em><strong>Cptn. Constructor</strong>:</em> Close your handle, Destructor. Just tell me how to interrupt the detonation kernel &#8230; er &#8230; process &#8230; sequence &#8230; thing.</p>
<p><em><strong>Dr. Destructor</strong>:</em> The sequence is perfectly synchronized and it cannot be pre-empted! Unless, of course, you are able to correctly identify the set of slightly-heavier-than-the-rest spheroids. But it is a task that is surely intractable to your puny single-core mind.</p>
<p><em><strong>Cptn. Constructor</strong>: </em>YOUR FACE IS SINGLE-CORE! <em>[Our hero clears his throat, embarrassed. He is not generally given to such base language. Quickly he recovers his composure.]</em> Tell me more about these spheroids.</p>
<p><em><strong>Dr. Destructor</strong>: </em>Over here you will find I have sorted 100 spheroids into 10 buckets labeled 0 through 9. Each bucket holds 10 spheroids, as you can plainly see. 90 of these spheroids all weigh 1 gram each. The other 10 weigh 1.01 grams each and they have been placed all together in the same bucket. You should also have noticed by now that all 100 spheroids are visually indistinguishable from one another. Shall I go on? Your stack is beginning to look overflowed.</p>
<p><em><strong>Cptn. Constructor</strong>:</em> I have stack space you could never even dream of. <strong><span style="color:#0000ff;"><code>continue;</code></span></strong></p>
<p><em><strong>Dr. Destructor</strong>:</em> Immediately next to the buckets I have placed a scale. The scale has been badly damaged from overuse. I keep telling that furry PHP elephant he&#8217;s too big! Never mind that, though. I assure you that the scale is still perfectly accurate. However, it only has one good measurement left in it.</p>
<p><em><strong>Cptn. Constructor</strong>: </em>What does all of this have to do with the spheroids?</p>
<p><em><strong>Dr. Destructor</strong>: </em>It should be quite clear that to interrupt the sequence of destruction, you must identify which bucket contains the heavier spheroids. You may take any combination of spheroids you like from these 10 buckets, place your selection in this empty bucket labelled &#8220;this.EmtpyBucket&#8221;, and place &#8220;this.EmptyBucket&#8221; (which at that point will no longer be empty) on the scale. The scale will tell you the weight and you must then tell me which of the 10 buckets contains the heavier spheroids.</p>
<p><em><strong>Cptn. Constructor</strong>: </em>Truly, you have a dizzying intellect.</p>
<p><em><strong>Dr. Destructor</strong>: </em>Wait till I get going! Where was I?</p>
<p><em>[Join us next time for the <a title="100 Balls, etc. - The Exciting Conclusion!" href="/2008/05/16/100-balls-etc-the-exciting-conclusion/" target="_self">exciting conclusion</a>...]</em></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nerdfortress.wordpress.com/14/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nerdfortress.wordpress.com/14/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nerdfortress.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nerdfortress.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nerdfortress.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nerdfortress.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nerdfortress.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nerdfortress.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nerdfortress.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nerdfortress.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nerdfortress.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nerdfortress.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nerdfortress.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nerdfortress.wordpress.com/14/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nerdfortress.wordpress.com/14/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nerdfortress.wordpress.com/14/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&#038;blog=4772118&#038;post=14&#038;subd=nerdfortress&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nerdfortress.com/2008/04/07/100-balls-10-buckets-1-single-use-scale/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9eafe0384840e29458017efa62351c90?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ANSI Pants</media:title>
		</media:content>
	</item>
		<item>
		<title>Programming Challenge: Time Parser</title>
		<link>http://nerdfortress.com/2008/02/14/programming-challenge-time-parser/</link>
		<comments>http://nerdfortress.com/2008/02/14/programming-challenge-time-parser/#comments</comments>
		<pubDate>Thu, 14 Feb 2008 13:38:18 +0000</pubDate>
		<dc:creator>ANSI Pants</dc:creator>
				<category><![CDATA[Hacker Challenge]]></category>
		<category><![CDATA[challenge]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[conversion]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[time]]></category>

		<guid isPermaLink="false">http://nerdfortress.com/?p=5</guid>
		<description><![CDATA[OK, this challenge is shamelessly borrowed from a challenge issued by Sasha on the Provo Linux Users Group mailing list, but I remember enjoying it so I figured I&#8217;d share. Make a solution in any language. The more, the merrier! Post solutions in the comments. Input: A string containing an arithmetic expression consisting of times. [...]<img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&#038;blog=4772118&#038;post=5&#038;subd=nerdfortress&#038;ref=&#038;feed=1" width="1" height="1" />]]></description>
			<content:encoded><![CDATA[<p>OK, this challenge is shamelessly borrowed from a challenge issued by Sasha on the <a title="Provo Linux Users Group page" href="http://plug.org">Provo Linux Users Group</a> mailing list, but I remember enjoying it so I figured I&#8217;d share.  Make a solution in any language.  The more, the merrier!   Post solutions in the comments.</p>
<p>Input: A string containing an arithmetic expression consisting of times.  The times could be in seconds, but they could also be in colon form: 3:12 is 192 seconds, 1:45:03 is 1 hour, 45 minutes, 3 seconds.  There also may be fractions of seconds: 2:28.42 is 2 minutes, 28.42 seconds.</p>
<p>Output: Leave the arithmetic expression intact, but convert all times into seconds.  So:<br />
1:45.2 + 83 &#8211; 2:34 becomes 105.2 + 83 &#8211; 154</p>
<p>Enjoy, and good luck!</p>
<p><em>Guest Submission from The Code Lisperer</em></p>
<br /><img alt="" border="0" src="http://feeds.wordpress.com/1.0/categories/nerdfortress.wordpress.com/5/" /> <img alt="" border="0" src="http://feeds.wordpress.com/1.0/tags/nerdfortress.wordpress.com/5/" /> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gocomments/nerdfortress.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/comments/nerdfortress.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godelicious/nerdfortress.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/delicious/nerdfortress.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gofacebook/nerdfortress.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/facebook/nerdfortress.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gotwitter/nerdfortress.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/twitter/nerdfortress.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/gostumble/nerdfortress.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/stumble/nerdfortress.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/godigg/nerdfortress.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/digg/nerdfortress.wordpress.com/5/" /></a> <a rel="nofollow" href="http://feeds.wordpress.com/1.0/goreddit/nerdfortress.wordpress.com/5/"><img alt="" border="0" src="http://feeds.wordpress.com/1.0/reddit/nerdfortress.wordpress.com/5/" /></a> <img alt="" border="0" src="http://stats.wordpress.com/b.gif?host=nerdfortress.com&#038;blog=4772118&#038;post=5&#038;subd=nerdfortress&#038;ref=&#038;feed=1" width="1" height="1" />]]></content:encoded>
			<wfw:commentRss>http://nerdfortress.com/2008/02/14/programming-challenge-time-parser/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
	
		<media:content url="http://1.gravatar.com/avatar/9eafe0384840e29458017efa62351c90?s=96&#38;d=http%3A%2F%2F1.gravatar.com%2Favatar%2Fad516503a11cd5ca435acc9bb6523536%3Fs%3D96&#38;r=G" medium="image">
			<media:title type="html">ANSI Pants</media:title>
		</media:content>
	</item>
	</channel>
</rss>
