<?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>what about me? &#187; programming</title>
	<atom:link href="http://erbfarm.com/wam/category/programming/feed/" rel="self" type="application/rss+xml" />
	<link>http://erbfarm.com/wam</link>
	<description></description>
	<lastBuildDate>Wed, 07 Apr 2010 19:39:52 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>a better .pythonrc?</title>
		<link>http://erbfarm.com/wam/2009/01/24/a-better-pythonrc/</link>
		<comments>http://erbfarm.com/wam/2009/01/24/a-better-pythonrc/#comments</comments>
		<pubDate>Sat, 24 Jan 2009 17:22:09 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://erbfarm.com/wam/?p=76</guid>
		<description><![CDATA[Over on this blog, I pointed out a bug in some code.  Stupid blogger won&#8217;t let me format a better version, so I&#8217;ll post it here:

try:
    import readline
except ImportError:
    pass
else:
    import rlcompleter
    import os.path
    import atexit

    [...]]]></description>
			<content:encoded><![CDATA[<p>Over on <a href="http://igotgenes.blogspot.com/2009/01/tab-completion-and-history-in-python.html">this blog</a>, I pointed out a bug in some code.  Stupid blogger won&#8217;t let me format a better version, so I&#8217;ll post it here:</p>
<blockquote>
<pre style='color:#000000;background:#ffffff;'><span style='color:#800000; font-weight:bold; '>try</span><span style='color:#808030; '>:</span>
    <span style='color:#800000; font-weight:bold; '>import</span> readline
<span style='color:#800000; font-weight:bold; '>except</span> <span style='color:#e34adc; '>ImportError</span><span style='color:#808030; '>:</span>
    <span style='color:#800000; font-weight:bold; '>pass</span>
<span style='color:#800000; font-weight:bold; '>else</span><span style='color:#808030; '>:</span>
    <span style='color:#800000; font-weight:bold; '>import</span> rlcompleter
    <span style='color:#800000; font-weight:bold; '>import</span> os<span style='color:#808030; '>.</span>path
    <span style='color:#800000; font-weight:bold; '>import</span> atexit

    <span style='color:#800000; font-weight:bold; '>class</span> irlcompleter<span style='color:#808030; '>(</span>rlcompleter<span style='color:#808030; '>.</span>Completer<span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
        <span style='color:#800000; font-weight:bold; '>def</span> complete<span style='color:#808030; '>(</span>self<span style='color:#808030; '>,</span> text<span style='color:#808030; '>,</span> state<span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
            <span style='color:#800000; font-weight:bold; '>if</span> text <span style='color:#808030; '>=</span><span style='color:#808030; '>=</span> <span style='color:#0000e6; '>""</span><span style='color:#808030; '>:</span>
                readline<span style='color:#808030; '>.</span>insert_text<span style='color:#808030; '>(</span><span style='color:#0000e6; '>'\t'</span><span style='color:#808030; '>)</span>
                <span style='color:#800000; font-weight:bold; '>return</span> <span style='color:#e34adc; '>None</span>
            <span style='color:#800000; font-weight:bold; '>else</span><span style='color:#808030; '>:</span>
                <span style='color:#800000; font-weight:bold; '>return</span> rlcompleter<span style='color:#808030; '>.</span>Completer<span style='color:#808030; '>.</span>complete<span style='color:#808030; '>(</span>self<span style='color:#808030; '>,</span>text<span style='color:#808030; '>,</span>state<span style='color:#808030; '>)</span>

    readline<span style='color:#808030; '>.</span>parse_and_bind<span style='color:#808030; '>(</span><span style='color:#0000e6; '>"tab: complete"</span><span style='color:#808030; '>)</span>
    readline<span style='color:#808030; '>.</span>set_completer<span style='color:#808030; '>(</span>irlcompleter<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>.</span>complete<span style='color:#808030; '>)</span>

    <span style='color:#696969; '># Restore our command-line history, and save it when Python exits.</span>
    history_file <span style='color:#808030; '>=</span> os<span style='color:#808030; '>.</span>path<span style='color:#808030; '>.</span>expanduser<span style='color:#808030; '>(</span><span style='color:#0000e6; '>"~/.pyhistory"</span><span style='color:#808030; '>)</span>
    <span style='color:#800000; font-weight:bold; '>if</span> os<span style='color:#808030; '>.</span>path<span style='color:#808030; '>.</span>exists<span style='color:#808030; '>(</span>history_file<span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
        readline<span style='color:#808030; '>.</span>read_history_file<span style='color:#808030; '>(</span>history_file<span style='color:#808030; '>)</span>
        <span style='color:#800000; font-weight:bold; '>def</span> save_hist<span style='color:#808030; '>(</span><span style='color:#808030; '>)</span><span style='color:#808030; '>:</span>
            <span style='color:#800000; font-weight:bold; '>import</span> readline
            readline<span style='color:#808030; '>.</span>write_history_file<span style='color:#808030; '>(</span>history_file<span style='color:#808030; '>)</span>
        atexit<span style='color:#808030; '>.</span>register<span style='color:#808030; '>(</span>save_hist<span style='color:#808030; '>)</span>

    <span style='color:#696969; '># Clean up the namespace.</span>
    <span style='color:#800000; font-weight:bold; '>del</span> readline
    <span style='color:#800000; font-weight:bold; '>del</span> os<span style='color:#808030; '>.</span>path
    <span style='color:#800000; font-weight:bold; '>del</span> atexit
</pre>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://erbfarm.com/wam/2009/01/24/a-better-pythonrc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>would Camus&#8217; code be elegant or absurd?</title>
		<link>http://erbfarm.com/wam/2008/12/12/would-camus-code-be-elegant-or-absurd/</link>
		<comments>http://erbfarm.com/wam/2008/12/12/would-camus-code-be-elegant-or-absurd/#comments</comments>
		<pubDate>Fri, 12 Dec 2008 22:16:14 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[god]]></category>
		<category><![CDATA[programming]]></category>
		<category><![CDATA[religion]]></category>

		<guid isPermaLink="false">http://erbfarm.com/wam/?p=59</guid>
		<description><![CDATA[Or both?
[T]he single biggest predictor of likely aptitude for programming is a deep comfort with meaninglessness.
]]></description>
			<content:encoded><![CDATA[<p>Or both?</p>
<p><a href="http://www.boingboing.net/2008/12/12/comfort-with-meaning.html">[T]he single biggest predictor of likely aptitude for programming is a deep comfort with meaninglessness.</a></p>
]]></content:encoded>
			<wfw:commentRss>http://erbfarm.com/wam/2008/12/12/would-camus-code-be-elegant-or-absurd/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>who&#8217;s a lazy bum?</title>
		<link>http://erbfarm.com/wam/2008/05/25/whos-a-lazy-bum/</link>
		<comments>http://erbfarm.com/wam/2008/05/25/whos-a-lazy-bum/#comments</comments>
		<pubDate>Sun, 25 May 2008 17:45:38 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[OSX]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://erbfarm.com/wam/?p=32</guid>
		<description><![CDATA[I&#8217;ve always been happy to read that laziness in a programmer is a virtue. How much work is it really to open iTunes, make sure the Music library is selected, click File-&#62;Import, navigate to the desktop, select the folder that contains the songs I want to add, pick that folder, wait for the import to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve always been happy to read that <a href="http://c2.com/cgi/wiki?LazinessImpatienceHubris">laziness in a programmer is a virtue</a>. How much work is it <i>really</i> to open iTunes, make sure the Music library is selected, click File-&gt;Import, navigate to the desktop, select the folder that contains the songs I want to add, pick that folder, wait for the import to finish, switch back to the desktop, and finally drag that folder of songs into the trash?</p>
<p>Too much work for me. Just typing it all tires me out.</p>
<p>So here&#8217;s my first <a href="http://docs.info.apple.com/article.html?artnum=304759">Automator</a> workflow, saved as a Finder plugin.</p>
<div align="center"><img style="max-width: 800px;" src="http://erbfarm.com/wam/wp-content/uploads/2008/05/import-into-itunes1.png" />
<div align="left">You can download it <a href="http://erbfarm.com/wam/wp-content/uploads/2008/05/import_into_itunes.tar">here</a>. </p>
<p>Open it, then File-&gt;Save As Plugin&#8230;, name it, &#8216;Import into iTunes&#8217;, and now it&#8217;s just right-click on that folder of songs, then More-&gt;Automator-&amp;gt;Import into iTunes.</p>
<p>Time for a snack.</p>
</div>
</div>
]]></content:encoded>
			<wfw:commentRss>http://erbfarm.com/wam/2008/05/25/whos-a-lazy-bum/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>how many columns is correct?</title>
		<link>http://erbfarm.com/wam/2008/02/28/how-many-columns-is-correct/</link>
		<comments>http://erbfarm.com/wam/2008/02/28/how-many-columns-is-correct/#comments</comments>
		<pubDate>Thu, 28 Feb 2008 21:02:17 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[emacs]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://erbfarm.com/wam/?p=27</guid>
		<description><![CDATA[My first elisp function knows.


(defun eighty-columns ()
  (interactive)
  (set-frame-width (selected-frame) 80))
(global-set-key (kbd "C-c 8") 'eighty-columns)




]]></description>
			<content:encoded><![CDATA[<p>My first elisp function knows.</p>
<blockquote>
<h3>
<pre style='color:#000000;background:#ffffff;'>(<span style='color:#7f0055; font-weight:bold; '>defun</span> eighty-columns ()
  (<span style='color:#7f0055; font-weight:bold; '>interactive</span>)
  (<span style='color:#7f0055; font-weight:bold; '>set-frame-width</span> (<span style='color:#7f0055; font-weight:bold; '>selected-frame</span>) 80))
(<span style='color:#7f0055; font-weight:bold; '>global-set-key</span> (<span style='color:#7f0055; font-weight:bold; '>kbd</span> <span style='color:#2a00ff; '>"C-c 8"</span>) 'eighty-columns)
</pre>
</h3>
<h3></h3>
</blockquote>
]]></content:encoded>
			<wfw:commentRss>http://erbfarm.com/wam/2008/02/28/how-many-columns-is-correct/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>simple descriptions of recursion, monads, and closures</title>
		<link>http://erbfarm.com/wam/2006/12/17/simple-descriptions-of-recursion-monads-and-closures/</link>
		<comments>http://erbfarm.com/wam/2006/12/17/simple-descriptions-of-recursion-monads-and-closures/#comments</comments>
		<pubDate>Mon, 18 Dec 2006 03:05:13 +0000</pubDate>
		<dc:creator>Bob</dc:creator>
				<category><![CDATA[programming]]></category>

		<guid isPermaLink="false">http://erbfarm.com/wam/?p=19</guid>
		<description><![CDATA[Joachim Durcholz gives the simplest descriptions of recursion, monads, and closures that I&#8217;ve run across in a post to comp.lang.scheme:

Don&#8217;t give recursion a name, say &#8220;yes, a function is allowed to call itself &#8211; just make sure that every invocation does some real work&#8221;. 
Don&#8217;t give monadic I/O a name, say &#8220;functions aren&#8217;t allowed to [...]]]></description>
			<content:encoded><![CDATA[<p>Joachim Durcholz gives the simplest descriptions of recursion, monads, and closures that I&#8217;ve run across in a <a href="http://groups.google.com/group/comp.lang.scheme/tree/browse_frm/thread/f3ddc368411c6060/11c60faf5edea9cb?rnum=21&#038;q=scare+word+joachim&#038;_done=%2Fgroup%2Fcomp.lang.scheme%2Fbrowse_frm%2Fthread%2Ff3ddc368411c6060%2F669eaee8ab81e1da%3Ftvc%3D1%26q%3Dscare+word+joachim%26#doc_50c1f7df58cc0a61">post</a> to comp.lang.scheme:</p>
<blockquote><p>
Don&#8217;t give recursion a name, say &#8220;yes, a function is allowed to call itself &#8211; just make sure that every invocation does some real work&#8221;. </p>
<p>Don&#8217;t give monadic I/O a name, say &#8220;functions aren&#8217;t allowed to have side effects, the code just generates a description of the effects&#8221;.</p>
<p>Don&#8217;t give closures a name, say &#8220;you can pass around an unevaluated &#8216;expression with holes&#8217;, just consider that the variables that were defined at the place where the expression is written will be taken from that place, not from the place where the thing will be evaluated&#8221;.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://erbfarm.com/wam/2006/12/17/simple-descriptions-of-recursion-monads-and-closures/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
