<?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: One Handed Dictionary</title>
	<atom:link href="http://toxicsoftware.com/one_handed_dictionary/feed/" rel="self" type="application/rss+xml" />
	<link>http://toxicsoftware.com/one_handed_dictionary/</link>
	<description>RANDOMIZE USR 0</description>
	<lastBuildDate>Thu, 17 Dec 2009 15:12:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: Jonathan Wight</title>
		<link>http://toxicsoftware.com/one_handed_dictionary/comment-page-1/#comment-21995</link>
		<dc:creator>Jonathan Wight</dc:creator>
		<pubDate>Mon, 15 Aug 2005 21:28:56 +0000</pubDate>
		<guid isPermaLink="false">http://toxicsoftware.com/one_handed_dictionary/#comment-21995</guid>
		<description>&lt;p&gt;Python does have regular expressions. They&#039;re not built into the language, but are in the standard Python library.&lt;br&gt;&lt;br&gt;Secondly - only the first version of my code is looping multiple times. The second version with the generator expressions (and don&#039;t forget you need Python 2.4) is really only looping once. For example:&lt;br&gt;&lt;br&gt;&lt;pre&gt;theWords = (theLine.rstrip(&#039;rn&#039;) for theLine in theFile.readlines())&lt;br&gt;### Remove single letters...&lt;br&gt;theWords = (theWord for theWord in theWords if len(theWord) &gt; 1)&lt;br&gt;### Make the words upper case...&lt;br&gt;theWords = (theWord.upper() for theWord in theWord)&lt;br&gt;print theWords&lt;/pre&gt;&lt;br&gt;&lt;br&gt;No loop is occurring until the print statement is reached. The (xxx for xxx) lines are just creating iterator objects which are like stages of a loop.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Python does have regular expressions. They&#39;re not built into the language, but are in the standard Python library.<br /><br />Secondly &#8211; only the first version of my code is looping multiple times. The second version with the generator expressions (and don&#39;t forget you need Python 2.4) is really only looping once. For example:<br /><br />&lt;pre&gt;theWords = (theLine.rstrip(&#39;rn&#39;) for theLine in theFile.readlines())<br />### Remove single letters&#8230;<br />theWords = (theWord for theWord in theWords if len(theWord) &gt; 1)<br />### Make the words upper case&#8230;<br />theWords = (theWord.upper() for theWord in theWord)<br />print theWords&lt;/pre&gt;<br /><br />No loop is occurring until the print statement is reached. The (xxx for xxx) lines are just creating iterator objects which are like stages of a loop.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Wight</title>
		<link>http://toxicsoftware.com/one_handed_dictionary/comment-page-1/#comment-28</link>
		<dc:creator>Jonathan Wight</dc:creator>
		<pubDate>Mon, 15 Aug 2005 20:28:56 +0000</pubDate>
		<guid isPermaLink="false">http://toxicsoftware.com/one_handed_dictionary/#comment-28</guid>
		<description>&lt;p&gt;Python does have regular expressions. They&#039;re not built into the language, but are in the standard Python library.&lt;/p&gt;

&lt;p&gt;Secondly - only the first version of my code is looping multiple times. The second version with the generator expressions (and don&#039;t forget you need Python 2.4) is really only looping once. For example:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;theWords = (theLine.rstrip(&#039;\r\n&#039;) for theLine in theFile.readlines())&lt;/p&gt;

&lt;h3&gt;Remove single letters...&lt;/h3&gt;

&lt;p&gt;theWords = (theWord for theWord in theWords if len(theWord) &gt; 1)&lt;/p&gt;

&lt;h3&gt;Make the words upper case...&lt;/h3&gt;

&lt;p&gt;theWords = (theWord.upper() for theWord in theWord)
print theWords&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;No loop is occurring until the print statement is reached. The (xxx for xxx) lines are just creating iterator objects which are like stages of a loop.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Python does have regular expressions. They&#8217;re not built into the language, but are in the standard Python library.</p>

<p>Secondly &#8211; only the first version of my code is looping multiple times. The second version with the generator expressions (and don&#8217;t forget you need Python 2.4) is really only looping once. For example:</p>

<p><pre>theWords = (theLine.rstrip('\r\n') for theLine in theFile.readlines())</pre></p>

<h3>Remove single letters...</h3>

<p>theWords = (theWord for theWord in theWords if len(theWord) > 1)</p>

<h3>Make the words upper case...</h3>

<p>theWords = (theWord.upper() for theWord in theWord)
print theWords</p>

<p>No loop is occurring until the print statement is reached. The (xxx for xxx) lines are just creating iterator objects which are like stages of a loop.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://toxicsoftware.com/one_handed_dictionary/comment-page-1/#comment-21994</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Mon, 15 Aug 2005 02:13:58 +0000</pubDate>
		<guid isPermaLink="false">http://toxicsoftware.com/one_handed_dictionary/#comment-21994</guid>
		<description>&lt;p&gt;Thanks for the kind words!  I have very little experience with python, but am curious about it because many people whose opinions I trust like python better than perl.  Me, I know perl really quite well, so it was the first tool I went to when I realized grep wouldn&#039;t cut it for this test.&lt;br&gt;&lt;br&gt;I&#039;d be curious to see how python would benchmark with a similar algorithm to the one I opted for in my perl version.  I don&#039;t even know whether python has built-in support for regular expressions?  (Yes, I&#039;m &lt;i&gt;that&lt;/i&gt; unfamiliar with python. ; )&lt;br&gt;&lt;br&gt;Even my perl version has some room for improvement, of course; there&#039;s no reason to copy the sorted array back into @words, so might as well just print it directly.  This benchmarks similarly, thoughÂ—I think internally perl is copying the sorted array into temp memory space before passing it to the print() call, so there&#039;s no performance gain.  Just slightly terser code, is all.&lt;br&gt;&lt;br&gt;I tried briefly to adapt the python version into perl, and it&#039;s really interesting to see how python seems to encourage lots of looping in its semantics, whereas everything I might translate it to in perl would do several smaller steps in one pass over the word list (for example, instead of looping over the list taking off newlines, then looping over the list taking out short words, I&#039;d do one loop that accomplished several steps and stored remaining altered values in an array).  I wonder how much of this is just programming style vs. how much is the language we chose imposing its semantic tricks on the procedure chosen.&lt;br&gt;&lt;br&gt;Above all, I reiterate my thanks, both for this great Gedankenexperiment, and for your good will in sharing it.  Quite intriguing.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for the kind words!  I have very little experience with python, but am curious about it because many people whose opinions I trust like python better than perl.  Me, I know perl really quite well, so it was the first tool I went to when I realized grep wouldn&#39;t cut it for this test.<br /><br />I&#39;d be curious to see how python would benchmark with a similar algorithm to the one I opted for in my perl version.  I don&#39;t even know whether python has built-in support for regular expressions?  (Yes, I&#39;m <i>that</i> unfamiliar with python. ; )<br /><br />Even my perl version has some room for improvement, of course; there&#39;s no reason to copy the sorted array back into @words, so might as well just print it directly.  This benchmarks similarly, thoughÂ—I think internally perl is copying the sorted array into temp memory space before passing it to the print() call, so there&#39;s no performance gain.  Just slightly terser code, is all.<br /><br />I tried briefly to adapt the python version into perl, and it&#39;s really interesting to see how python seems to encourage lots of looping in its semantics, whereas everything I might translate it to in perl would do several smaller steps in one pass over the word list (for example, instead of looping over the list taking off newlines, then looping over the list taking out short words, I&#39;d do one loop that accomplished several steps and stored remaining altered values in an array).  I wonder how much of this is just programming style vs. how much is the language we chose imposing its semantic tricks on the procedure chosen.<br /><br />Above all, I reiterate my thanks, both for this great Gedankenexperiment, and for your good will in sharing it.  Quite intriguing.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://toxicsoftware.com/one_handed_dictionary/comment-page-1/#comment-27</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Mon, 15 Aug 2005 01:13:58 +0000</pubDate>
		<guid isPermaLink="false">http://toxicsoftware.com/one_handed_dictionary/#comment-27</guid>
		<description>&lt;p&gt;Thanks for the kind words!  I have very little experience with python, but am curious about it because many people whose opinions I trust like python better than perl.  Me, I know perl really quite well, so it was the first tool I went to when I realized grep wouldn&#039;t cut it for this test.&lt;/p&gt;

&lt;p&gt;I&#039;d be curious to see how python would benchmark with a similar algorithm to the one I opted for in my perl version.  I don&#039;t even know whether python has built-in support for regular expressions?  (Yes, I&#039;m &lt;i&gt;that&lt;/i&gt; unfamiliar with python. ; )&lt;/p&gt;

&lt;p&gt;Even my perl version has some room for improvement, of course; there&#039;s no reason to copy the sorted array back into @words, so might as well just print it directly.  This benchmarks similarly, thoughÂ—I think internally perl is copying the sorted array into temp memory space before passing it to the print() call, so there&#039;s no performance gain.  Just slightly terser code, is all.&lt;/p&gt;

&lt;p&gt;I tried briefly to adapt the python version into perl, and it&#039;s really interesting to see how python seems to encourage lots of looping in its semantics, whereas everything I might translate it to in perl would do several smaller steps in one pass over the word list (for example, instead of looping over the list taking off newlines, then looping over the list taking out short words, I&#039;d do one loop that accomplished several steps and stored remaining altered values in an array).  I wonder how much of this is just programming style vs. how much is the language we chose imposing its semantic tricks on the procedure chosen.&lt;/p&gt;

&lt;p&gt;Above all, I reiterate my thanks, both for this great Gedankenexperiment, and for your good will in sharing it.  Quite intriguing.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Thanks for the kind words!  I have very little experience with python, but am curious about it because many people whose opinions I trust like python better than perl.  Me, I know perl really quite well, so it was the first tool I went to when I realized grep wouldn&#8217;t cut it for this test.</p>

<p>I&#8217;d be curious to see how python would benchmark with a similar algorithm to the one I opted for in my perl version.  I don&#8217;t even know whether python has built-in support for regular expressions?  (Yes, I&#8217;m <i>that</i> unfamiliar with python. ; )</p>

<p>Even my perl version has some room for improvement, of course; there&#8217;s no reason to copy the sorted array back into @words, so might as well just print it directly.  This benchmarks similarly, thoughÂ—I think internally perl is copying the sorted array into temp memory space before passing it to the print() call, so there&#8217;s no performance gain.  Just slightly terser code, is all.</p>

<p>I tried briefly to adapt the python version into perl, and it&#8217;s really interesting to see how python seems to encourage lots of looping in its semantics, whereas everything I might translate it to in perl would do several smaller steps in one pass over the word list (for example, instead of looping over the list taking off newlines, then looping over the list taking out short words, I&#8217;d do one loop that accomplished several steps and stored remaining altered values in an array).  I wonder how much of this is just programming style vs. how much is the language we chose imposing its semantic tricks on the procedure chosen.</p>

<p>Above all, I reiterate my thanks, both for this great Gedankenexperiment, and for your good will in sharing it.  Quite intriguing.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Wight</title>
		<link>http://toxicsoftware.com/one_handed_dictionary/comment-page-1/#comment-21993</link>
		<dc:creator>Jonathan Wight</dc:creator>
		<pubDate>Sun, 14 Aug 2005 22:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://toxicsoftware.com/one_handed_dictionary/#comment-21993</guid>
		<description>&lt;p&gt;I take that back - your perl is SUPER fast:&lt;br&gt;&lt;br&gt;&lt;pre&gt;real    0m0.877s&lt;br&gt;user    0m0.435s&lt;br&gt;sys     0m0.057s&lt;/pre&gt;&lt;br&gt;&lt;br&gt;Congrats.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I take that back &#8211; your perl is SUPER fast:<br /><br />&lt;pre&gt;real    0m0.877s<br />user    0m0.435s<br />sys     0m0.057s&lt;/pre&gt;<br /><br />Congrats.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Wight</title>
		<link>http://toxicsoftware.com/one_handed_dictionary/comment-page-1/#comment-21992</link>
		<dc:creator>Jonathan Wight</dc:creator>
		<pubDate>Sun, 14 Aug 2005 22:25:26 +0000</pubDate>
		<guid isPermaLink="false">http://toxicsoftware.com/one_handed_dictionary/#comment-21992</guid>
		<description>&lt;p&gt;Well - I guess my timing was a little off...&lt;br&gt;&lt;br&gt;I just ran it again:&lt;br&gt;&lt;br&gt;&lt;pre&gt;real    0m8.366s&lt;br&gt;user    0m7.315s&lt;br&gt;sys     0m0.211s&lt;/pre&gt;&lt;br&gt;&lt;br&gt;That&#039;s quite a difference! (This is on the same Powerbook - with the only difference major difference I can think of is that File Vault is turned off now - not that I see how file vault can make much of a difference)&lt;br&gt;&lt;br&gt;I just changed all the list comprehensions to generator expressions and tested it:&lt;br&gt;&lt;br&gt;&lt;pre&gt;real    0m5.095s&lt;br&gt;user    0m2.683s&lt;br&gt;sys     0m0.177s&lt;/pre&gt;&lt;br&gt;&lt;br&gt;With output piped to /dev/null it is a touch faster&lt;br&gt;&lt;br&gt;&lt;pre&gt;real    0m3.057s&lt;br&gt;user    0m2.584s&lt;br&gt;sys     0m0.114s&lt;br&gt;&lt;br&gt;That&#039;s about the same ballpark as your perl script. &lt;br&gt;&lt;br&gt;I was never claiming my code was super efficient or I wasn&#039;t looping too many times... ;-)&lt;/pre&gt;&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Well &#8211; I guess my timing was a little off&#8230;<br /><br />I just ran it again:<br /><br />&lt;pre&gt;real    0m8.366s<br />user    0m7.315s<br />sys     0m0.211s&lt;/pre&gt;<br /><br />That&#39;s quite a difference! (This is on the same Powerbook &#8211; with the only difference major difference I can think of is that File Vault is turned off now &#8211; not that I see how file vault can make much of a difference)<br /><br />I just changed all the list comprehensions to generator expressions and tested it:<br /><br />&lt;pre&gt;real    0m5.095s<br />user    0m2.683s<br />sys     0m0.177s&lt;/pre&gt;<br /><br />With output piped to /dev/null it is a touch faster<br /><br />&lt;pre&gt;real    0m3.057s<br />user    0m2.584s<br />sys     0m0.114s<br /><br />That&#39;s about the same ballpark as your perl script. <br /><br />I was never claiming my code was super efficient or I wasn&#39;t looping too many times&#8230; ;-)&lt;/pre&gt;</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://toxicsoftware.com/one_handed_dictionary/comment-page-1/#comment-21991</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Sun, 14 Aug 2005 21:52:22 +0000</pubDate>
		<guid isPermaLink="false">http://toxicsoftware.com/one_handed_dictionary/#comment-21991</guid>
		<description>&lt;p&gt;) &#123; push( @words, $_ ) if( m/^[abcdefgqrstvwxz]+$/ &#124;&#124; m/^[hijklmnopuy]+$/ ) &#125; @words = sort( &#123; length($a) &lt;=&gt; length($b) &#125; @words ); print @words;&#039; &lt;br&gt;&lt;br&gt;...perhaps I&#039;m missing out on some functionality in your algorithm, but this takes less than 2 seconds on my 1.33GHz Powerbook (the python version takes about 11 seconds under similar conditions).  I&#039;m going to have to try to replicate it using something closer to your algorithm and see if maybe I&#039;m just skipping some functionality (my python&#039;s pretty rusty, though).&lt;br&gt;&lt;br&gt;Ahh, I think I see now; it looks like the python version not only loops over the list more than once (I loop over it once, then do a bubble sort which doesn&#039;t seem present in the python version), but the python version also loops over each letter in each word for uppercasing (I skipped this step), then looping over each letter in each word, and for each letter in each word also looping over each element in the two letter lists.  Lotsa looping!&lt;br&gt;&lt;br&gt;I&#039;m thinking this is just one of those cases where regular expressions turn out to be handier, though I have to confess I was pretty shocked by the vast difference in performance between the two versions.&lt;br&gt;&lt;br&gt;Anyway, thanks for the entry!  Quite a fascinating exercise.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>) &#123; push( @words, $_ ) if( m/^[abcdefgqrstvwxz]+$/ || m/^[hijklmnopuy]+$/ ) &#125; @words = sort( &#123; length($a) &lt;=&gt; length($b) &#125; @words ); print @words;&#39; <br /><br />&#8230;perhaps I&#39;m missing out on some functionality in your algorithm, but this takes less than 2 seconds on my 1.33GHz Powerbook (the python version takes about 11 seconds under similar conditions).  I&#39;m going to have to try to replicate it using something closer to your algorithm and see if maybe I&#39;m just skipping some functionality (my python&#39;s pretty rusty, though).<br /><br />Ahh, I think I see now; it looks like the python version not only loops over the list more than once (I loop over it once, then do a bubble sort which doesn&#39;t seem present in the python version), but the python version also loops over each letter in each word for uppercasing (I skipped this step), then looping over each letter in each word, and for each letter in each word also looping over each element in the two letter lists.  Lotsa looping!<br /><br />I&#39;m thinking this is just one of those cases where regular expressions turn out to be handier, though I have to confess I was pretty shocked by the vast difference in performance between the two versions.<br /><br />Anyway, thanks for the entry!  Quite a fascinating exercise.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Wight</title>
		<link>http://toxicsoftware.com/one_handed_dictionary/comment-page-1/#comment-26</link>
		<dc:creator>Jonathan Wight</dc:creator>
		<pubDate>Sun, 14 Aug 2005 21:28:00 +0000</pubDate>
		<guid isPermaLink="false">http://toxicsoftware.com/one_handed_dictionary/#comment-26</guid>
		<description>&lt;p&gt;I take that back - your perl is SUPER fast:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;real    0m0.877s
user    0m0.435s
sys     0m0.057s&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;Congrats.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>I take that back &#8211; your perl is SUPER fast:</p>

<p><pre>real    0m0.877s
user    0m0.435s
sys     0m0.057s</pre></p>

<p>Congrats.</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Jonathan Wight</title>
		<link>http://toxicsoftware.com/one_handed_dictionary/comment-page-1/#comment-25</link>
		<dc:creator>Jonathan Wight</dc:creator>
		<pubDate>Sun, 14 Aug 2005 21:25:26 +0000</pubDate>
		<guid isPermaLink="false">http://toxicsoftware.com/one_handed_dictionary/#comment-25</guid>
		<description>&lt;p&gt;Well - I guess my timing was a little off...&lt;/p&gt;

&lt;p&gt;I just ran it again:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;real    0m8.366s
user    0m7.315s
sys     0m0.211s&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;That&#039;s quite a difference! (This is on the same Powerbook - with the only difference major difference I can think of is that File Vault is turned off now - not that I see how file vault can make much of a difference)&lt;/p&gt;

&lt;p&gt;I just changed all the list comprehensions to generator expressions and tested it:&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;real    0m5.095s
user    0m2.683s
sys     0m0.177s&lt;/pre&gt;&lt;/p&gt;

&lt;p&gt;With output piped to /dev/null it is a touch faster&lt;/p&gt;

&lt;p&gt;&lt;pre&gt;real    0m3.057s
user    0m2.584s
sys     0m0.114s&lt;/ore&gt;&lt;/p&gt;

&lt;p&gt;That&#039;s about the same ballpark as your perl script.&lt;/p&gt;

&lt;p&gt;I was never claiming my code was super efficient or I wasn&#039;t looping too many times... ;-)&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Well &#8211; I guess my timing was a little off&#8230;</p>

<p>I just ran it again:</p>

<p><pre>real    0m8.366s
user    0m7.315s
sys     0m0.211s</pre></p>

<p>That&#8217;s quite a difference! (This is on the same Powerbook &#8211; with the only difference major difference I can think of is that File Vault is turned off now &#8211; not that I see how file vault can make much of a difference)</p>

<p>I just changed all the list comprehensions to generator expressions and tested it:</p>

<p><pre>real    0m5.095s
user    0m2.683s
sys     0m0.177s</pre></p>

<p>With output piped to /dev/null it is a touch faster</p>

<p><pre>real    0m3.057s
user    0m2.584s
sys     0m0.114s</pre></p>

<p>That's about the same ballpark as your perl script.</p>

<p>I was never claiming my code was super efficient or I wasn't looping too many times... ;-)</p>]]></content:encoded>
	</item>
	<item>
		<title>By: Eric</title>
		<link>http://toxicsoftware.com/one_handed_dictionary/comment-page-1/#comment-24</link>
		<dc:creator>Eric</dc:creator>
		<pubDate>Sun, 14 Aug 2005 20:52:22 +0000</pubDate>
		<guid isPermaLink="false">http://toxicsoftware.com/one_handed_dictionary/#comment-24</guid>
		<description>&lt;p&gt;Hey neat, I found this entry looking for a definition for &quot;tesseradecade&quot;, but then was intrigued by your commentary about a 1.5GHz Powerbook taking 11 seconds to produce results using python.  I used a perl one-liner to achieve similar results, only it looks like your version doesn&#039;t do sorting?&lt;/p&gt;

&lt;p&gt;cat /usr/share/dict/words &#124; perl -e &#039;while(&lt;&gt;) &#123; push( @words, $_ ) if( m/^[abcdefgqrstvwxz]+$/ &#124;&#124; m/^[hijklmnopuy]+$/ ) &#125; @words = sort( &#123; length($a) &lt;=&gt; length($b) &#125; @words ); print @words;&#039;&lt;/p&gt;

&lt;p&gt;...perhaps I&#039;m missing out on some functionality in your algorithm, but this takes less than 2 seconds on my 1.33GHz Powerbook (the python version takes about 11 seconds under similar conditions).  I&#039;m going to have to try to replicate it using something closer to your algorithm and see if maybe I&#039;m just skipping some functionality (my python&#039;s pretty rusty, though).&lt;/p&gt;

&lt;p&gt;Ahh, I think I see now; it looks like the python version not only loops over the list more than once (I loop over it once, then do a bubble sort which doesn&#039;t seem present in the python version), but the python version also loops over each letter in each word for uppercasing (I skipped this step), then looping over each letter in each word, and for each letter in each word also looping over each element in the two letter lists.  Lotsa looping!&lt;/p&gt;

&lt;p&gt;I&#039;m thinking this is just one of those cases where regular expressions turn out to be handier, though I have to confess I was pretty shocked by the vast difference in performance between the two versions.&lt;/p&gt;

&lt;p&gt;Anyway, thanks for the entry!  Quite a fascinating exercise.&lt;/p&gt;
</description>
		<content:encoded><![CDATA[<p>Hey neat, I found this entry looking for a definition for &#8220;tesseradecade&#8221;, but then was intrigued by your commentary about a 1.5GHz Powerbook taking 11 seconds to produce results using python.  I used a perl one-liner to achieve similar results, only it looks like your version doesn&#8217;t do sorting?</p>

<p>cat /usr/share/dict/words | perl -e &#8216;while(&lt;>) &#123; push( @words, $_ ) if( m/^[abcdefgqrstvwxz]+$/ || m/^[hijklmnopuy]+$/ ) &#125; @words = sort( &#123; length($a) &lt;=> length($b) &#125; @words ); print @words;&#8217;</p>

<p>&#8230;perhaps I&#8217;m missing out on some functionality in your algorithm, but this takes less than 2 seconds on my 1.33GHz Powerbook (the python version takes about 11 seconds under similar conditions).  I&#8217;m going to have to try to replicate it using something closer to your algorithm and see if maybe I&#8217;m just skipping some functionality (my python&#8217;s pretty rusty, though).</p>

<p>Ahh, I think I see now; it looks like the python version not only loops over the list more than once (I loop over it once, then do a bubble sort which doesn&#8217;t seem present in the python version), but the python version also loops over each letter in each word for uppercasing (I skipped this step), then looping over each letter in each word, and for each letter in each word also looping over each element in the two letter lists.  Lotsa looping!</p>

<p>I&#8217;m thinking this is just one of those cases where regular expressions turn out to be handier, though I have to confess I was pretty shocked by the vast difference in performance between the two versions.</p>

<p>Anyway, thanks for the entry!  Quite a fascinating exercise.</p>]]></content:encoded>
	</item>
</channel>
</rss>
