<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	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/"
		>
<channel>
	<title>Comments on: A Problem</title>
	<atom:link href="http://blag.xkcd.com/2009/04/27/a-problem/feed/" rel="self" type="application/rss+xml" />
	<link>http://blag.xkcd.com/2009/04/27/a-problem/</link>
	<description>The blag of the webcomic</description>
	<lastBuildDate>Sat, 21 Nov 2009 20:33:31 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Sindwiller</title>
		<link>http://blag.xkcd.com/2009/04/27/a-problem/comment-page-2/#comment-32555</link>
		<dc:creator>Sindwiller</dc:creator>
		<pubDate>Tue, 13 Oct 2009 10:52:55 +0000</pubDate>
		<guid isPermaLink="false">http://blag.xkcd.com/?p=189#comment-32555</guid>
		<description>@ Matt Hickford

fsck is just filesystem check :) mtab is metatab, I&#039;d pronounce usr as user, even though it actually means &#039;unix system resources&#039;.</description>
		<content:encoded><![CDATA[<p>@ Matt Hickford</p>
<p>fsck is just filesystem check :) mtab is metatab, I&#8217;d pronounce usr as user, even though it actually means &#8216;unix system resources&#8217;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: jo</title>
		<link>http://blag.xkcd.com/2009/04/27/a-problem/comment-page-2/#comment-31595</link>
		<dc:creator>jo</dc:creator>
		<pubDate>Mon, 14 Sep 2009 15:16:12 +0000</pubDate>
		<guid isPermaLink="false">http://blag.xkcd.com/?p=189#comment-31595</guid>
		<description>Here&#039;s the Ruby way of finding anagrams:

Anagram finder in Ruby

http://snippets.dzone.com/posts/show/5593</description>
		<content:encoded><![CDATA[<p>Here&#8217;s the Ruby way of finding anagrams:</p>
<p>Anagram finder in Ruby</p>
<p><a href="http://snippets.dzone.com/posts/show/5593" rel="nofollow">http://snippets.dzone.com/posts/show/5593</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Gonzalo</title>
		<link>http://blag.xkcd.com/2009/04/27/a-problem/comment-page-2/#comment-30602</link>
		<dc:creator>Gonzalo</dc:creator>
		<pubDate>Wed, 02 Sep 2009 23:34:59 +0000</pubDate>
		<guid isPermaLink="false">http://blag.xkcd.com/?p=189#comment-30602</guid>
		<description>@James:

int no_to_return = (argc == 2 ? 1 : atoi(argv[2]));

A ternary definitely is not faster.</description>
		<content:encoded><![CDATA[<p>@James:</p>
<p>int no_to_return = (argc == 2 ? 1 : atoi(argv[2]));</p>
<p>A ternary definitely is not faster.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Brandon</title>
		<link>http://blag.xkcd.com/2009/04/27/a-problem/comment-page-2/#comment-30281</link>
		<dc:creator>Brandon</dc:creator>
		<pubDate>Wed, 26 Aug 2009 01:46:52 +0000</pubDate>
		<guid isPermaLink="false">http://blag.xkcd.com/?p=189#comment-30281</guid>
		<description>interesting rhetoric on the marios...seems everyone has failed to notice that part.</description>
		<content:encoded><![CDATA[<p>interesting rhetoric on the marios&#8230;seems everyone has failed to notice that part.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Yamthief</title>
		<link>http://blag.xkcd.com/2009/04/27/a-problem/comment-page-2/#comment-30276</link>
		<dc:creator>Yamthief</dc:creator>
		<pubDate>Tue, 25 Aug 2009 10:46:49 +0000</pubDate>
		<guid isPermaLink="false">http://blag.xkcd.com/?p=189#comment-30276</guid>
		<description>Wow. This turned in to a proper &#039;geek-off&#039; really quickly...


...I like it here :)</description>
		<content:encoded><![CDATA[<p>Wow. This turned in to a proper &#8216;geek-off&#8217; really quickly&#8230;</p>
<p>&#8230;I like it here :)</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Porges</title>
		<link>http://blag.xkcd.com/2009/04/27/a-problem/comment-page-2/#comment-29933</link>
		<dc:creator>Porges</dc:creator>
		<pubDate>Tue, 28 Jul 2009 09:56:46 +0000</pubDate>
		<guid isPermaLink="false">http://blag.xkcd.com/?p=189#comment-29933</guid>
		<description>Here&#039;s my variant: getting rid of almost all the Perl and doing the rest with Unixy programs... only thing left that Perl is required for is sorting letters within a string, which I couldn&#039;t figure out how to do simply :)

&lt;code&gt;&lt;/usr/share/dict/words grep -v \&#039; &#124; perl -ne &#039;chomp;print length.&quot;\t$_\t&quot;.(join &quot;&quot;, sort split &quot;&quot;).&quot;\n&quot;&#039; &#124; sort -k 3 &#124; uniq -Df 2 &#124; sort -srnk 1 &#124; head -n 20 &#124; cut -f 2&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Here&#8217;s my variant: getting rid of almost all the Perl and doing the rest with Unixy programs&#8230; only thing left that Perl is required for is sorting letters within a string, which I couldn&#8217;t figure out how to do simply :)</p>
<p><code>&lt;/usr/share/dict/words grep -v \' | perl -ne 'chomp;print length."\t$_\t".(join "", sort split "")."\n"' | sort -k 3 | uniq -Df 2 | sort -srnk 1 | head -n 20 | cut -f 2</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Scott</title>
		<link>http://blag.xkcd.com/2009/04/27/a-problem/comment-page-2/#comment-29925</link>
		<dc:creator>Scott</dc:creator>
		<pubDate>Tue, 28 Jul 2009 04:14:46 +0000</pubDate>
		<guid isPermaLink="false">http://blag.xkcd.com/?p=189#comment-29925</guid>
		<description>oh a couple of weeks late.. oh well:

 perl -l15 -ne &#039;push @{$x{lc join&quot;&quot;,sort split//}},$_;END{map{print join(&quot; &quot;,length,@{$x{$_}}).&quot;\n&quot;}sort{length($a)&lt;=&gt;length($b)}grep{@{$x{$_}}&gt;1}keys%x;}&#039;&lt;/usr/share/dict/words&#124;tail      

 perl -e&#039;print map{@{$x{$_}}&gt;1&amp;&amp;join(&quot; &quot;,length,@{$x{$_}}).&quot;\n&quot;}sort{length($a)&lt;=&gt;length($b)}map{chomp;push@{$x{$k=lc join&quot;&quot;,sort split//}},$_;@{$x{$k}}&lt;2&amp;&amp;$k}&lt;&gt;;&#039;&lt;/usr/share/dict/words&#124;tail</description>
		<content:encoded><![CDATA[<p>oh a couple of weeks late.. oh well:</p>
<p> perl -l15 -ne &#8216;push @{$x{lc join&#8221;",sort split//}},$_;END{map{print join(&#8221; &#8220;,length,@{$x{$_}}).&#8221;\n&#8221;}sort{length($a)&lt;=&gt;length($b)}grep{@{$x{$_}}&gt;1}keys%x;}&#8217;&lt;/usr/share/dict/words|tail      </p>
<p> perl -e&#8217;print map{@{$x{$_}}&gt;1&amp;&amp;join(&#8221; &#8220;,length,@{$x{$_}}).&#8221;\n&#8221;}sort{length($a)&lt;=&gt;length($b)}map{chomp;push@{$x{$k=lc join&#8221;",sort split//}},$_;@{$x{$k}}&lt;2&amp;&amp;$k}&lt;&gt;;&#8217;&lt;/usr/share/dict/words|tail</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: David</title>
		<link>http://blag.xkcd.com/2009/04/27/a-problem/comment-page-2/#comment-29924</link>
		<dc:creator>David</dc:creator>
		<pubDate>Mon, 27 Jul 2009 23:49:33 +0000</pubDate>
		<guid isPermaLink="false">http://blag.xkcd.com/?p=189#comment-29924</guid>
		<description>This should do it in Haskell (composed at the interactive prompt, much easier to play with than Bash), unless I got the problem description wrong:

&lt;code&gt;
import Data.Ord
import Data.List

main = interact (unlines . map show . anagrams . lines)

anagrams = reverse
               . sortBy (comparing (length.head))
               . filter (not.null.tail)
               . groupBy (\a b -&gt; sort a == sort b)
&lt;/code&gt;

Save as anagrams.hs and &lt;code&gt;cat /usr/share/dict/words &#124; runhaskell anagrams.hs</description>
		<content:encoded><![CDATA[<p>This should do it in Haskell (composed at the interactive prompt, much easier to play with than Bash), unless I got the problem description wrong:</p>
<p><code><br />
import Data.Ord<br />
import Data.List</p>
<p>main = interact (unlines . map show . anagrams . lines)</p>
<p>anagrams = reverse<br />
               . sortBy (comparing (length.head))<br />
               . filter (not.null.tail)<br />
               . groupBy (\a b -&gt; sort a == sort b)<br />
</code></p>
<p>Save as anagrams.hs and <code>cat /usr/share/dict/words | runhaskell anagrams.hs</code></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Sweth</title>
		<link>http://blag.xkcd.com/2009/04/27/a-problem/comment-page-2/#comment-29648</link>
		<dc:creator>Sweth</dc:creator>
		<pubDate>Tue, 14 Jul 2009 16:06:16 +0000</pubDate>
		<guid isPermaLink="false">http://blag.xkcd.com/?p=189#comment-29648</guid>
		<description>Many months later, this discussion came up in another discussion, and so I came back to look at it again, and saw Randall&#039;s response to me.  So, belatedly, I clarify: that &quot;47&quot; was actually a &quot;backslash 0 4 7&quot;, which is the pcre octal for the single quote; the &quot;backslash 0&quot; part apparently got eaten.  If you put that back in, it works (I believe) as Randall intended.</description>
		<content:encoded><![CDATA[<p>Many months later, this discussion came up in another discussion, and so I came back to look at it again, and saw Randall&#8217;s response to me.  So, belatedly, I clarify: that &#8220;47&#8243; was actually a &#8220;backslash 0 4 7&#8243;, which is the pcre octal for the single quote; the &#8220;backslash 0&#8243; part apparently got eaten.  If you put that back in, it works (I believe) as Randall intended.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: FoolishOwl</title>
		<link>http://blag.xkcd.com/2009/04/27/a-problem/comment-page-2/#comment-29613</link>
		<dc:creator>FoolishOwl</dc:creator>
		<pubDate>Sun, 12 Jul 2009 22:16:06 +0000</pubDate>
		<guid isPermaLink="false">http://blag.xkcd.com/?p=189#comment-29613</guid>
		<description>Oops.
&lt;code&gt;cowsay &quot;STACK OVERFLOW&quot; &#124; cowsay -n &#124; cowsay -n &#124; cowsay -n&lt;/code&gt;</description>
		<content:encoded><![CDATA[<p>Oops.<br />
<code>cowsay "STACK OVERFLOW" | cowsay -n | cowsay -n | cowsay -n</code></p>
]]></content:encoded>
	</item>
</channel>
</rss>
