<?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>Oliver Steele &#187; Amusements</title>
	<atom:link href="http://osteele.com/archives/category/amusements/feed" rel="self" type="application/rss+xml" />
	<link>http://osteele.com</link>
	<description>Languages of the real and artificial.</description>
	<lastBuildDate>Thu, 10 Feb 2011 06:40:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0.5</generator>
		<item>
		<title>FizzBuzz Station</title>
		<link>http://osteele.com/archives/2008/02/fizzbuzz-station</link>
		<comments>http://osteele.com/archives/2008/02/fizzbuzz-station#comments</comments>
		<pubDate>Thu, 28 Feb 2008 22:59:08 +0000</pubDate>
		<dc:creator>Oliver</dc:creator>
				<category><![CDATA[Amusements]]></category>
		<category><![CDATA[Illustrations]]></category>
		<category><![CDATA[Ruby]]></category>

		<guid isPermaLink="false">http://osteele.com/2008/02/28/fizzbuzz-station</guid>
		<description><![CDATA[Uh oh!  I "overthought fizzbuzz":http://weblog.raganwald.com/2007/01/dont-overthink-fizzbuzz.html:

!/images/2008/fizzbuzz-station.png!

]]></description>
			<content:encoded><![CDATA[<p>Uh oh!  I <a href="http://weblog.raganwald.com/2007/01/dont-overthink-fizzbuzz.html">overthought fizzbuzz</a>:</p>

<p><img src="/images/2008/fizzbuzz-station.png" alt="" height="539" width="558" /></p>

<p><span id="more-267"></span></p>

<p><hr />The following Ruby snippets aren&#8217;t quite the same as the automaton above (<a href="http://reddit.com/r/programming/info/10d7w/comments/c10g19">this Haskell version</a> is actually closest to that), but here&#8217;s a couple of Regexp solutions in a style that I haven&#8217;t seen before.  They have a kind of Turing-tape flavor to them.</p>



<pre language="ruby">
puts (1..100).map { |n| '1'*n+&quot;:#{n}\n&quot; }.join.
  gsub(/^(1{5})*:/,'\0Buzz').gsub(/^(1{3})*:/,'Fizz').gsub(/.*:|(z)\d+/,'\1')
</pre>





<pre language="ruby">
puts (1..100).map { |n| 'x'*n+&quot;#{n}\n&quot; }.join.
  gsub(/^(xxx)*\d/,'Fizz').gsub(/[05]$/,'Buzz').gsub(/^x*|\d*(.+?)\d*/,'\1')
</pre>



<p>I&#8217;m not much of a golfer, so please let me know in the comments if you tighten them up any.</p>]]></content:encoded>
			<wfw:commentRss>http://osteele.com/archives/2008/02/fizzbuzz-station/feed</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>What Every Programmer Needs to Know About Category Theory</title>
		<link>http://osteele.com/archives/2008/01/what-every-programmer-needs-to-know-about-category-theory</link>
		<comments>http://osteele.com/archives/2008/01/what-every-programmer-needs-to-know-about-category-theory#comments</comments>
		<pubDate>Fri, 18 Jan 2008 01:05:23 +0000</pubDate>
		<dc:creator>Oliver</dc:creator>
				<category><![CDATA[Amusements]]></category>

		<guid isPermaLink="false">http://osteele.com/2008/01/17/what-every-programmer-needs-to-know-about-category-theory</guid>
		<description><![CDATA[<div style="height:300px"> </div>]]></description>
			<content:encoded><![CDATA[<div style="height:300px"> </div>]]></content:encoded>
			<wfw:commentRss>http://osteele.com/archives/2008/01/what-every-programmer-needs-to-know-about-category-theory/feed</wfw:commentRss>
		<slash:comments>13</slash:comments>
		</item>
		<item>
		<title>Wide URLs with WideURL.com</title>
		<link>http://osteele.com/archives/2006/04/wideurl</link>
		<comments>http://osteele.com/archives/2006/04/wideurl#comments</comments>
		<pubDate>Sat, 01 Apr 2006 14:36:50 +0000</pubDate>
		<dc:creator>Oliver</dc:creator>
				<category><![CDATA[Amusements]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://osteele.com/2006/04/01/wide-urls-with-wideurlcom</guid>
		<description><![CDATA[For years now, I've been a great fan of "TinyURL.com":http://tinyurl.com.  That web site allows you to create a short representation of a longer URL, for use in email.

One of the problems with those URLs, though, and with URLs in general, is that they're misleadingly short.  A particular web page may have a lot of significance, but if it doesn't take up much of your message, there's just no way for the recipient to see this at a glance.

"WideURL.com":http://wideurl.com fixes this.  It creates an URL with more visual impact.

For example, here's the WideURL for this post: <tt><a href="http://wideurl.com/aitch-tee-tee-pea-colon-double-slash-oh-ess-tee-double-ee-ell-ee-dot-see-oh-em-slash-aye-are-see-aitch-eye-vee-ee-ess-slash-two-double-zero-six-slash-zero-four-slash-doubleyou-eye-dee-ee-you-are-ell">http://wideurl.com/aitch-tee-tee-pea-colon-double-slash-oh-ess-tee-double-ee-ell-ee-dot-see-oh-em-slash-aye-are-see-aitch-eye-vee-ee-ess-slash-two-double-zero-six-slash-zero-four-slash-doubleyou-eye-dee-ee-you-are-ell</a></tt>.]]></description>
			<content:encoded><![CDATA[<p>For years now, I&#8217;ve been a great fan of <a href="http://tinyurl.com">TinyURL.com</a>.  That web site allows you to create a short representation of a longer <span class="caps">URL, </span>for use in email.</p>

<p>One of the problems with those <span class="caps">URL</span>s, though, and with <span class="caps">URL</span>s in general, is that they&#8217;re misleadingly short.  A particular web page may have a lot of significance, but if it doesn&#8217;t take up much of your message, there&#8217;s just no way for the recipient to see this at a glance.</p>

<p><a href="http://wideurl.com">WideURL.com</a> fixes this.  It creates an <span class="caps">URL </span>with more visual impact.</p>

<p>For example, here&#8217;s the WideURL for this post: <tt><a href="http://wideurl.com/aitch-tee-tee-pea-colon-double-slash-oh-ess-tee-double-ee-ell-ee-dot-see-oh-em-slash-aye-are-see-aitch-eye-vee-ee-ess-slash-two-double-zero-six-slash-zero-four-slash-doubleyou-eye-dee-ee-you-are-ell">http://wideurl.com/aitch-tee-tee-pea-colon-double-slash-oh-ess-tee-double-ee-ell-ee-dot-see-oh-em-slash-aye-are-see-aitch-eye-vee-ee-ess-slash-two-double-zero-six-slash-zero-four-slash-doubleyou-eye-dee-ee-you-are-ell</a></tt>.  That&#8217;s much more significant-looking than simply <a href="http://osteele.com/archives/2006/04/wideurl"><tt>http://osteele.com/archives/2006/04/wideurl</tt></a>, I think you can agree.</p>]]></content:encoded>
			<wfw:commentRss>http://osteele.com/archives/2006/04/wideurl/feed</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>A Functional Diversion</title>
		<link>http://osteele.com/archives/2006/03/foldr</link>
		<comments>http://osteele.com/archives/2006/03/foldr#comments</comments>
		<pubDate>Fri, 24 Mar 2006 00:36:11 +0000</pubDate>
		<dc:creator>Oliver</dc:creator>
				<category><![CDATA[Amusements]]></category>
		<category><![CDATA[Projects]]></category>

		<guid isPermaLink="false">http://osteele.com/2006/03/23/a-functional-diversion</guid>
		<description><![CDATA[Even my friends who aren't into functional programming find something curously relaxing about "this":http://foldr.com.  (And the companion site "here":http://foldl.com.)

I bought foldr.com a year ago when I thought I might do something like Flickr for other types of information.  I didn't realize until last week what I was sitting on. :-)

<b>Update:</b> The use of the infinity symbol sparked a lively <a href="http://lambda-the-ultimate.org/node/1395">discussion on LtU<a>.]]></description>
			<content:encoded><![CDATA[<p>Even my friends who aren&#8217;t into functional programming find something curously relaxing about <a href="http://foldr.com">this</a>.  (And the companion site <a href="http://foldl.com">here</a>.)</p>

<p>I bought foldr.com a year ago when I thought I might do something like Flickr for other types of information.  I didn&#8217;t realize until last week what I was sitting on. <img src='http://osteele.com/wp/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>

<p><b>Update:</b> The use of the infinity symbol sparked a lively <a href="http://lambda-the-ultimate.org/node/1395">discussion on LtU<a>.</p>]]></content:encoded>
			<wfw:commentRss>http://osteele.com/archives/2006/03/foldr/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Fortunately</title>
		<link>http://osteele.com/archives/2006/01/fortunately</link>
		<comments>http://osteele.com/archives/2006/01/fortunately#comments</comments>
		<pubDate>Tue, 31 Jan 2006 19:45:21 +0000</pubDate>
		<dc:creator>Oliver</dc:creator>
				<category><![CDATA[Amusements]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Words]]></category>

		<guid isPermaLink="false">http://osteele.com/2006/01/31/fortunately</guid>
		<description><![CDATA[<a href="/words/fortunately"  style="float:right"><img src="/projects/images/charlip.jpg"/></a>

Jim Grandy wrote:

<blockquote>
From:   jgrandy<br/>
Subject: stupid Google game<br/>
Date: January 7, 2006 6:17:58 PM EST<br/>

Google for &#34;unfortunately, *yournamehere*&#34;:<br/>

Lots of fun hits for &#34;unfortunately, jim&#34;:<br/>

* unfortunately Jim's orange dry suit made him look like a carrot<br/>
* Unfortunately Jim is no longer with us as he died of a brain tumor in 1993.<br/>
* Unfortunately, Jim did not respond. He disbelieved that it was an angel.<br/>
* Unfortunately, Jim is only one person with a limited amount of time available to]]></description>
			<content:encoded><![CDATA[<p><a href="/words/fortunately"  style="float:right"><img src="/projects/images/charlip.jpg"/></a></p>

<p>Jim Grandy wrote:</p>

<blockquote>
From:   jgrandy<br/><br />
Subject: stupid Google game<br/><br />
Date: January 7, 2006 6:17:58 PM <span class="caps">EST</span><br/>

<p>Google for &#34;unfortunately, <strong>yournamehere</strong>&#34;:<br/></p>

<p>Lots of fun hits for &#34;unfortunately, jim&#34;:<br/></p>


<ul>
<li>unfortunately Jim&#8217;s orange dry suit made him look like a carrot<br/></li>
<li>Unfortunately Jim is no longer with us as he died of a brain tumor in 1993.<br/></li>
<li>Unfortunately, Jim did not respond. He disbelieved that it was an angel.<br/></li>
<li>Unfortunately, Jim is only one person with a limited amount of time available to<br />
help Jane find answers to her questions.<br />
</blockquote></li>
</ul>



<p>I&#8217;ve turned this into a web page <a href="/words/fortunately">here</a>.</p>

<p>I prototyped it with a screen scraper for Google, but I didn&#8217;t want to deploy a screen scraper.</p>

<p>Fortunately, Google has a Search <span class="caps">API.</span></p>

<p>Unfortunately, Google&#8217;s <span class="caps">API </span>uses <span class="caps">SOAP.</span></p>

<p>Fortunately, Ruby has a <span class="caps">SOAP </span>library.</p>

<p>Unfortunately, the Ruby <span class="caps">SOAP </span>library doesn&#8217;t work on Dreamhost.</p>

<p>Fortunately, the Yahoo Web Search <span class="caps">API </span>uses <span class="caps">REST.</span></p>

<p>Unfortunately, Yahoo&#8217;s summaries don&#8217;t include enough right-hand context, so it&#8217;s harder to extract decent sentences from them.</p>

<p>Maybe I&#8217;ll go back to screen-scraping after all.</p>

<p><strong>Update:</strong> Jim tells me he got the idea from Jorg Brown at Google.</p>]]></content:encoded>
			<wfw:commentRss>http://osteele.com/archives/2006/01/fortunately/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Aargh!</title>
		<link>http://osteele.com/archives/2005/12/aargh</link>
		<comments>http://osteele.com/archives/2005/12/aargh#comments</comments>
		<pubDate>Sat, 24 Dec 2005 22:13:39 +0000</pubDate>
		<dc:creator>Oliver</dc:creator>
				<category><![CDATA[Amusements]]></category>
		<category><![CDATA[Projects]]></category>
		<category><![CDATA[Visualizations]]></category>
		<category><![CDATA[Words]]></category>

		<guid isPermaLink="false">http://osteele.com/2005/12/24/aargh</guid>
		<description><![CDATA["Aargh!"  But how do you spell it?

!/images/2005/aargh-table-small.jpg!:http://osteele.com/words/aargh
!/images/2005/aargh-viz-small.jpg!:http://osteele.com/words/aargh

("Click here":http://osteele.com/words/aargh to skip straight to the visualization.)

In the late nineties, I tried using internet search as a spelling corrector.  (I think I was using AltaVista at the time.  It was the latest and greatest search engine, supplanting --- was it Lycos?)

At the time, for the words I tried, there were about two orders of magnitude between a misspelling and the correct word.  A spelling variant, such as "color" and "colour", were typically less than one order of magnitude.]]></description>
			<content:encoded><![CDATA[<p>&#8220;Aargh!&#8221;  But how do you spell it?</p>

<p><a href="http://osteele.com/words/aargh"><img src="/images/2005/aargh-table-small.jpg" alt="" height="169" width="300" /></a>
<a href="http://osteele.com/words/aargh"><img src="/images/2005/aargh-viz-small.jpg" alt="" height="199" width="200" /></a></p>

<p>(<a href="http://osteele.com/words/aargh">Click here</a> to skip straight to the visualization.)</p>

<p>In the late nineties, I tried using internet search as a spelling corrector.  (I think I was using AltaVista at the time.  It was the latest and greatest search engine, supplanting &#8212; was it Lycos?)</p>

<p>At the time, for the words I tried, there were about two orders of magnitude between a misspelling and the correct word.  A spelling variant, such as &#8220;color&#8221; and &#8220;colour&#8221;, were typically less than one order of magnitude.</p>

<p>In 2002 I used Google to figure out the most common spelling for &#8220;closable&#8221;, for use in the <a href="http://openlaszlo.org">OpenLaszlo</a> <span class="caps">API. </span> It had been &#8220;closeable&#8221;; why use a spelling that most people would guess wrong the first time, I figured.  [Update: This paragraph originally said the word was "resizeable", which is a straightforward misspelling.]</p>

<p>Here&#8217;s what this looks like today.  First, a common misspelling:</p>

<table><tr><td><strong>compatible</strong></td><td align="right">170M</td></tr><tr><td>compatable</td><td align="right">2M</td><td>1.3%</td></tr></table>

<p>And a couple of spelling variants:</p>

<table><tr><td><strong>closable</strong></td><td align="right">137K</td></tr><tr><td>closeable</td><td align="right">101K</td><td align="right">73%</td></tr></table>

<table><tr><td><strong>sizable</strong></td><td align="right">8.3M</td></tr><tr><td>sizeable</td><td align="right">6.8M</td><td>81%</td></tr></table>

<p>(The percentage is the ratio of the page count to the page count of the most common variant, which is the form in bold above it.)</p>

<p>Some other misspellings:</p>

<table><tr><td><strong>commit</strong></td><td align="right">73.9M</td></tr><tr><td>comit</td><td align="right">0.8M</td><td>1%</td></tr></table>

<table><tr><td><strong>resizable</strong></td><td align="right">1.74M</td></tr><tr><td>resizeable</td><td align="right">0.18M</td><td>10%</td></tr></table>

<table><tr><td><strong>misspell</strong></td><td align="right">466K</td></tr><tr><td>mispell</td><td align="right">55K</td><td>12%</td></tr></table>

<p>And some other acceptable variants:</p>

<table><tr><td><strong>color</strong></td><td align="right">434M</td></tr><tr><td>colour</td><td align="right">63.0M</td><td>16%</td></tr></table>

<table><tr><td><strong>gray</strong></td><td align="right">125M</td></tr><tr><td>grey</td><td align="right">73M</td><td>59%</td></tr></table>

<table><tr><td><strong>judgment</strong></td><td align="right">77M</td></tr><tr><td>judgement</td><td align="right">24M</td><td>32%</td></tr></table>

<p>(What&#8217;s the difference between an acceptable variant, and a misspelling?  An interesting topic for another posting.  Maybe.)</p>

<p>What got me thinking about this again, was, of all things, thinking about how to spell &#8220;aargh!&#8221;  One &#8216;a&#8217;, two, three&#8230;?  And how many &#8216;r&#8217;s?</p>

<p>This is an interesting problem, first, because so many repetition counts are attested.  There&#8217;s not just &#8220;mispelling&#8221; (1s) and &#8220;misspelling&#8221; (2s), but &#8220;argh&#8221;, &#8220;aargh&#8221;, &#8220;aaargh&#8221;, etc.  And second, because the space is two-dimensional:  not just &#8220;argh&#8221;, &#8220;aargh&#8221;, &#8220;aaargh&#8221;, &#8230;, but also &#8220;argh&#8221;, &#8220;arrgh&#8221;, &#8220;arrrgh&#8221;, &#8230; &#8212; and the product, with &#8220;aarrgh&#8221;, &#8220;aaarrrgh&#8221;, etc.</p>

<p>It&#8217;s clear that a wide range of spellings are <em>acceptable</em>.  What&#8217;s the most <em>common</em>?</p>

<p>Without further ado, I created <a href="http://osteele.com/words/aargh">this page</a> to help me find the answer.</p>]]></content:encoded>
			<wfw:commentRss>http://osteele.com/archives/2005/12/aargh/feed</wfw:commentRss>
		<slash:comments>29</slash:comments>
		</item>
		<item>
		<title>Multitiered Turkey Consumption</title>
		<link>http://osteele.com/archives/2004/11/multitiered-turkey</link>
		<comments>http://osteele.com/archives/2004/11/multitiered-turkey#comments</comments>
		<pubDate>Thu, 25 Nov 2004 23:59:38 +0000</pubDate>
		<dc:creator>Oliver</dc:creator>
				<category><![CDATA[Amusements]]></category>

		<guid isPermaLink="false">http://osteele.com/2004/11/25/multitiered-turkey-consumption</guid>
		<description><![CDATA[If everyone in America makes an extra-large Thanksgiving dinner so that they can feed guests the next day, isn't this a pyramid scheme?

!/images/2004/turkeys.png!]]></description>
			<content:encoded><![CDATA[<p>If everyone in America makes an extra-large Thanksgiving dinner so that they can feed guests the next day, isn&#8217;t this a pyramid scheme?</p>

<p><img src="/images/2004/turkeys.png" alt="" height="72" width="194" /></p>]]></content:encoded>
			<wfw:commentRss>http://osteele.com/archives/2004/11/multitiered-turkey/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The Novell Virus</title>
		<link>http://osteele.com/archives/2004/09/novell-virus</link>
		<comments>http://osteele.com/archives/2004/09/novell-virus#comments</comments>
		<pubDate>Sun, 12 Sep 2004 20:42:05 +0000</pubDate>
		<dc:creator>Oliver</dc:creator>
				<category><![CDATA[Amusements]]></category>
		<category><![CDATA[Family]]></category>

		<guid isPermaLink="false">http://osteele.com/2004/09/12/the-novell-virus</guid>
		<description><![CDATA[Miles told me about the computers at his elementary school:

bq. They're running anti-virus software, but they've _installed_ a virus!  It's called Novell.  It makes the computer boot slowly, it does a lot of stuff while it's booting, and then you can't log on.]]></description>
			<content:encoded><![CDATA[<p>Miles told me about the computers at his elementary school:</p>

<blockquote><p>They&#8217;re running anti-virus software, but they&#8217;ve <em>installed</em> a virus!  It&#8217;s called Novell.  It makes the computer boot slowly, it does a lot of stuff while it&#8217;s booting, and then you can&#8217;t log on.</p></blockquote>]]></content:encoded>
			<wfw:commentRss>http://osteele.com/archives/2004/09/novell-virus/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

