<?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>thatmattbone.com</title>
	<atom:link href="http://thatmattbone.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://thatmattbone.com</link>
	<description>let's ride bikes...</description>
	<lastBuildDate>Mon, 19 Jul 2010 03:46:03 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>stupid closure tricks in py3k</title>
		<link>http://thatmattbone.com/2010/07/stupid-closure-tricks-in-py3k/</link>
		<comments>http://thatmattbone.com/2010/07/stupid-closure-tricks-in-py3k/#comments</comments>
		<pubDate>Mon, 19 Jul 2010 03:46:03 +0000</pubDate>
		<dc:creator>Matt Bone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://thatmattbone.com/?p=288</guid>
		<description><![CDATA[This is kind of silly, but I like the nonlocal keyword in Python 3 (well, ok, I like let-bindings in Lisps much much better, but this will do) and how you can get a closure and then poke the insides of the closure to see what it&#8217;s up to.  I&#8217;m sure this isn&#8217;t recommended, but [...]]]></description>
			<content:encoded><![CDATA[<p>This is kind of silly, but I like the nonlocal keyword in Python 3 (well, ok, I like let-bindings in Lisps much much better, but this will do) and how you can get a closure and then poke the insides of the closure to see what it&#8217;s up to.  I&#8217;m sure this isn&#8217;t recommended, but it&#8217;s a fun trick:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">def</span> counter<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
    a = <span style="color: #ff4500;">0</span>
    <span style="color: #ff7700;font-weight:bold;">def</span> inc<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>:
        nonlocal a
        a+=<span style="color: #ff4500;">1</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> a
    <span style="color: #ff7700;font-weight:bold;">return</span> inc
&nbsp;
c = counter<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span><span style="color: black;">&#40;</span>c<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span><span style="color: black;">&#40;</span>c<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
<span style="color: #ff7700;font-weight:bold;">print</span><span style="color: black;">&#40;</span>c<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span><span style="color: black;">&#41;</span>
&nbsp;
<span style="color: #ff7700;font-weight:bold;">print</span><span style="color: black;">&#40;</span>c.__closure__<span style="color: black;">&#91;</span><span style="color: #ff4500;">0</span><span style="color: black;">&#93;</span>.<span style="color: black;">cell_contents</span><span style="color: black;">&#41;</span></pre></div></div>

<p>I&#8217;d guess the locations of cells in the closure tuple are determined at compile time (i.e. they won&#8217;t change between runs), but I haven&#8217;t investigated this.</p>
]]></content:encoded>
			<wfw:commentRss>http://thatmattbone.com/2010/07/stupid-closure-tricks-in-py3k/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>relating to nosql</title>
		<link>http://thatmattbone.com/2010/07/relating-to-nosql/</link>
		<comments>http://thatmattbone.com/2010/07/relating-to-nosql/#comments</comments>
		<pubDate>Tue, 13 Jul 2010 04:45:11 +0000</pubDate>
		<dc:creator>Matt Bone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[databases]]></category>

		<guid isPermaLink="false">http://thatmattbone.com/?p=284</guid>
		<description><![CDATA[About the time the nosql movement started to get legs, I started to get interested in relational databases.  They&#8217;re awesome beasts, and horizontal scalability issues aside, they handle a lot of the very hard problems in the web programming space (i.e. durability and concurrency).  But when data gets large and you can&#8217;t find the 2 million quarters [...]]]></description>
			<content:encoded><![CDATA[<p>About the time the nosql movement started to get legs, I started to get interested in relational databases.  They&#8217;re awesome beasts, and horizontal scalability issues aside, they handle a lot of the very hard problems in the web programming space (i.e. durability and concurrency).  But when data gets large and you can&#8217;t find the 2 million quarters in your sofa for that oracle license (or the 2 million braincells for that oh-so-perfect sharding scheme),  the nosql databases start to show their appeal.</p>
<p>But maybe there&#8217;s another way.  <a href="http://it.toolbox.com/blogs/database-soup/runningwithscissorsdb-39879?rss=1">This article</a> is mostly focussed on relaxing the durability constraints of postgres but also mentions a possible mixing of relational and non-relational systems.  What a cool idea!  Use the somewhat batch-oriented, distributed, and non-relational system as a large backing store, and populate a traditional relational database (almost) on demand by transforming and moving (ETLing) the data there.  With the right transforms, we get all the ad-hoc queries of our beloved star schema data warehouses without the expense of a big-honkin&#8217; database server.  Certainly these &#8216;transforms&#8217; are the tricky part (and slicing the data out of the non-relational store along a particular dimension (probably time) will almost always be necessary), but the gains seems pretty great.  Maybe we&#8217;ll call this approach a &#8220;pattern&#8221; someday.</p>
<p>Isn&#8217;t big data exciting?</p>
]]></content:encoded>
			<wfw:commentRss>http://thatmattbone.com/2010/07/relating-to-nosql/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>simple s-expression parser in python</title>
		<link>http://thatmattbone.com/2010/06/simple-s-expression-parser-in-python/</link>
		<comments>http://thatmattbone.com/2010/06/simple-s-expression-parser-in-python/#comments</comments>
		<pubDate>Tue, 29 Jun 2010 02:43:27 +0000</pubDate>
		<dc:creator>Matt Bone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[lisp]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://thatmattbone.com/?p=272</guid>
		<description><![CDATA[A few weeks back, I boasted in a bar that anyone could write a simple s-expression parser from scratch (no flex, no yacc, no bison, no antler, etc).  Well, I could not boast without doing it myself, so I finally did.  My s-expression lexer/parser weighs in at about 170 lines without tests (450 lines with [...]]]></description>
			<content:encoded><![CDATA[<p>A few weeks back, I boasted in a bar that anyone could write a simple s-expression parser from scratch (no flex, no yacc, no bison, no antler, etc).  Well, I could not boast without doing it myself, so I finally did.  My <a href="http://bitbucket.org/thatmattbone/lisp-adventures/src/tip/in_py/parse_sexp.py">s-expression lexer/parser</a> weighs in at about 170 lines without tests (450 lines with them), and parsers integers and symbols.  I even created a little repl which takes this:</p>

<div class="wp_syntax"><div class="code"><pre class="lisp" style="font-family:monospace;"><span style="color: #66cc66;">&#40;</span>+ <span style="color: #cc66cc;">1</span> <span style="color: #cc66cc;">2</span><span style="color: #66cc66;">&#41;</span></pre></div></div>

<p>And converts it into this:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: black;">&#91;</span>Symbol<span style="color: black;">&#40;</span>+<span style="color: black;">&#41;</span>, Number<span style="color: black;">&#40;</span><span style="color: #ff4500;">1</span><span style="color: black;">&#41;</span>, Number<span style="color: black;">&#40;</span><span style="color: #ff4500;">2</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span></pre></div></div>

<p>A pretty-printed python list consisting of objects representing symbols and numbers. </p>
<p>I think the design is fairly readable if a bit unusual.  There are classes for each token (instances of which are used for fully and partially formed tokens) and we &#8220;add&#8221; these tokens together to form a larger token and ultimately invoke a next_token_exception allowing the lexer to yield the largest, greediest, most fully-formed token possible. </p>
<p>Here&#8217;s an example of the lexer in action:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #66cc66;">&gt;&gt;&gt;</span> symbol_token<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;h&quot;</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&lt;</span>parse_sexp.<span style="color: black;">symbol_token</span> <span style="color: #008000;">object</span> at 0x7fb9e2d253d0<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> _ + symbol_token<span style="color: black;">&#40;</span><span style="color: #483d8b;">&quot;i&quot;</span><span style="color: black;">&#41;</span>
<span style="color: #66cc66;">&lt;</span>parse_sexp.<span style="color: black;">symbol_token</span> <span style="color: #008000;">object</span> at 0x7fb9e2d25710<span style="color: #66cc66;">&gt;</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> formed = _
<span style="color: #66cc66;">&gt;&gt;&gt;</span> formed + <span style="color: #483d8b;">&quot; &quot;</span>
Traceback <span style="color: black;">&#40;</span>most recent call last<span style="color: black;">&#41;</span>:
  File <span style="color: #483d8b;">&quot;&lt;stdin&gt;&quot;</span>, line <span style="color: #ff4500;">1</span>, <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #66cc66;">&lt;</span>module<span style="color: #66cc66;">&gt;</span>
  File <span style="color: #483d8b;">&quot;parse_sexp.py&quot;</span>, line <span style="color: #ff4500;">33</span>, <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #0000cd;">__add__</span>
    <span style="color: #ff7700;font-weight:bold;">raise</span> next_token_exception<span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
parse_sexp.<span style="color: black;">next_token_exception</span>
<span style="color: #66cc66;">&gt;&gt;&gt;</span> formed.<span style="color: black;">value</span>
<span style="color: #483d8b;">'hi'</span></pre></div></div>

<p>After lexing, we&#8217;re left with a stream of fully-formed tokens; it&#8217;s a simple matter to filter out the whitespace tokens and start yielding instances of Symbol() and Number() classes with proper, pythonic types for the data.  </p>
<p>Although I used regexes (quite unnecessarily) and generators, this little thing could probably be ported to C.  It&#8217;d be the fastest, most useless parser/lexer around <img src='http://thatmattbone.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Happy Hacking!</p>
]]></content:encoded>
			<wfw:commentRss>http://thatmattbone.com/2010/06/simple-s-expression-parser-in-python/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>on the road</title>
		<link>http://thatmattbone.com/2010/06/on-the-road/</link>
		<comments>http://thatmattbone.com/2010/06/on-the-road/#comments</comments>
		<pubDate>Sun, 27 Jun 2010 18:41:18 +0000</pubDate>
		<dc:creator>Matt Bone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[bikes]]></category>

		<guid isPermaLink="false">http://thatmattbone.com/?p=249</guid>
		<description><![CDATA[A month ago, I left Chicago on my bicycle, headed to Moline and then south to Saint Louis.  The journey spanned 7 days, 6 nights, and 589 miles. I rode alone with dreams of solving my problems and divining my future in sunbaked introspection.  I carried all my gear (too much of it), camped 4 [...]]]></description>
			<content:encoded><![CDATA[<p>A month ago, I left Chicago on my bicycle, headed to Moline and then south to Saint Louis.  The journey spanned 7 days, 6 nights, and 589 miles.</p>
<p><img class="alignnone" title="Descent" src="http://lh6.ggpht.com/_neCry2Kl16o/TBWr4tc6VPI/AAAAAAAAB1I/QohpvnJvvdw/s400/img_1039.jpg" alt="" width="400" height="300" /></p>
<p>I rode alone with dreams of solving my problems and divining my future in sunbaked introspection.  I carried all my gear (too much of it), camped 4 nights (hotel-camped 2 nights <img src='http://thatmattbone.com/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' /> ) and navigated my poorly planned route with two guide books and my G1.</p>
<p><img class="alignnone" title="Barn" src="http://lh4.ggpht.com/_neCry2Kl16o/TBWdQjJcqfI/AAAAAAAABtI/4HKOii9MEUE/s400/img_0959.jpg" alt="" width="400" height="300" /></p>
<p>Riding alone has its perks.  Plenty of time to think, and plenty of time to think about getting lost.  Fortunately my navigating skills seemed to improve after the second day (I nearly burst into tears that day after the GPS put my location in the middle of a lake, not, as I expected, between the Hennepin and I&amp;M Canals).</p>
<p><img class="alignnone" title="Camp" src="http://lh5.ggpht.com/_neCry2Kl16o/TBWczmyh20I/AAAAAAAABs8/BZjEesVOxtg/s400/img_0957.jpg" alt="" width="400" height="300" /></p>
<p>Camping alone is different.  There are very few perks.  All my nights were fairly restless, and the one night I didn&#8217;t have to hiss at raccoons to shoo them away, a large storm came through at 2:00am.  My tent held out, though, and I can sleep when I&#8217;m dead.  But still, I&#8217;ve no shame now admitting to being afraid of the dark.</p>
<p><img class="alignnone" title="Church" src="http://lh5.ggpht.com/_neCry2Kl16o/TBWpuc9aF9I/AAAAAAAABz4/OKagKqUg9Ng/s400/img_1026.jpg" alt="" width="400" height="300" />`</p>
<p>Being alone in the middle of Illinois is an odd thing.  It&#8217;s possible to ride for hours without seeing another human, but at no point are you truly in the middle of nowhere.  Everything has the imprint of humanity.  The road itself is a man-made scar through the land, but moreover, the land is far from natural.  Almost every inch is cultivated, pruned, or tilled for our use.  I suppose this is the trade-off  of a civilized society (possibly the definition of it), but it still makes me glad there are areas we have set aside for the exclusive non-use by humans.</p>
<p><img class="alignnone" title="Canal" src="http://lh5.ggpht.com/_neCry2Kl16o/TBWmsX8-FBI/AAAAAAAAByQ/kPOSx-m_YXw/s400/img_1009.jpg" alt="" width="400" height="300" /></p>
<p>In general the trip is somewhat hazy.  I probably rode too fast and did not stop at enough towns to really soak everything in.  But still I find myself thinking of very specific things about the ride, whether it be pushing my bike up a giant hill or resting for a bit on a bench.  I will do this again.  Someday I will find the time to ride farther west or maybe even ride the entire American Discovery Trail.</p>
]]></content:encoded>
			<wfw:commentRss>http://thatmattbone.com/2010/06/on-the-road/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>things I have re-learned so far this week</title>
		<link>http://thatmattbone.com/2010/06/things-i-have-re-learned-so-far-this-week/</link>
		<comments>http://thatmattbone.com/2010/06/things-i-have-re-learned-so-far-this-week/#comments</comments>
		<pubDate>Wed, 23 Jun 2010 03:43:32 +0000</pubDate>
		<dc:creator>Matt Bone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://thatmattbone.com/?p=243</guid>
		<description><![CDATA[close your files, flush your files, fsync() your files, sync() if you have to, just don&#8217;t be stupid. don&#8217;t use globals for mutable state. especially when you&#8217;re in a multi-threaded environment. or you&#8217;re interested in correct answers. there&#8217;s a good chance the ORM is writing shitty sql. coffee != sleep more tests!]]></description>
			<content:encoded><![CDATA[<ul>
<li>close your files, flush your files, fsync() your files, sync() if you have to, just don&#8217;t be stupid.</li>
<li>don&#8217;t use globals for mutable state. especially when you&#8217;re in a multi-threaded environment. or you&#8217;re interested in correct answers.</li>
<li>there&#8217;s a good chance the ORM is writing shitty sql.</li>
<li>coffee != sleep</li>
<li>more tests!</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://thatmattbone.com/2010/06/things-i-have-re-learned-so-far-this-week/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>delaying computation: lazy dictionaries in Python</title>
		<link>http://thatmattbone.com/2010/04/delaying-computation-lazy-dictionaries-in-python/</link>
		<comments>http://thatmattbone.com/2010/04/delaying-computation-lazy-dictionaries-in-python/#comments</comments>
		<pubDate>Tue, 20 Apr 2010 13:28:00 +0000</pubDate>
		<dc:creator>Matt Bone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://thatmattbone.com/?p=218</guid>
		<description><![CDATA[Yesterday I had a problem I ended up solving another way, but my first approach required a lazy dictionary.  That is, a dictionary filled with the results of some other function, but also one that only evaluated this computation when the dictionary was first accessed.  Here&#8217;s a silly example use case: class LazyDictionary&#40;object&#41;: &#160; def [...]]]></description>
			<content:encoded><![CDATA[<p>Yesterday I had a problem I ended up solving another way, but my first approach required a lazy dictionary.  That is, a dictionary filled with the results of some other function, but also one that only evaluated this computation when the dictionary was first accessed.  Here&#8217;s a silly example use case:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">class</span> LazyDictionary<span style="color: black;">&#40;</span><span style="color: #008000;">object</span><span style="color: black;">&#41;</span>:
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__init__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, callback=<span style="color: #008000;">dict</span><span style="color: black;">&#41;</span>:
        <span style="color: #008000;">self</span>.<span style="color: black;">data</span> = <span style="color: #008000;">None</span>
        <span style="color: #008000;">self</span>.<span style="color: black;">callback</span> = callback
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> evaluate_callback<span style="color: black;">&#40;</span><span style="color: #008000;">self</span><span style="color: black;">&#41;</span>:
        <span style="color: #008000;">self</span>.<span style="color: black;">data</span> = <span style="color: #008000;">self</span>.<span style="color: black;">callback</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__getitem__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, name<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">data</span> <span style="color: #ff7700;font-weight:bold;">is</span> <span style="color: #008000;">None</span><span style="color: black;">&#41;</span>:
            <span style="color: #008000;">self</span>.<span style="color: black;">evaluate_callback</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">self</span>.<span style="color: black;">data</span>.<span style="color: #0000cd;">__getitem__</span><span style="color: black;">&#40;</span>name<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__setitem__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, name, value<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">data</span> <span style="color: #ff7700;font-weight:bold;">is</span> <span style="color: #008000;">None</span><span style="color: black;">&#41;</span>:
            <span style="color: #008000;">self</span>.<span style="color: black;">evaluate_callback</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">self</span>.<span style="color: black;">data</span>.<span style="color: #0000cd;">__setitem__</span><span style="color: black;">&#40;</span>name, value<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> <span style="color: #0000cd;">__getattr__</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>, name<span style="color: black;">&#41;</span>:
        <span style="color: #ff7700;font-weight:bold;">if</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">data</span> <span style="color: #ff7700;font-weight:bold;">is</span> <span style="color: #008000;">None</span><span style="color: black;">&#41;</span>:
            <span style="color: #008000;">self</span>.<span style="color: black;">evaluate_callback</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: #008000;">getattr</span><span style="color: black;">&#40;</span><span style="color: #008000;">self</span>.<span style="color: black;">data</span>, name<span style="color: black;">&#41;</span></pre></div></div>

<p>The real version I started to use (and then threw out because it was not needed) inherited from a dict instead of using delegation.  At the time I thought this was necessary to get it to play nice with the Django templating system (I may have been wrong about this).  Anyways, I like this version much better, and I view inheritance for the composition of behavior with growing skepticism each day.</p>
<p>I also have unittests for this but they made this post unappealing long (I should really start using that github gist thingie.  Is there a mercurial equivalent? (also I fixed my blog comments)).</p>
]]></content:encoded>
			<wfw:commentRss>http://thatmattbone.com/2010/04/delaying-computation-lazy-dictionaries-in-python/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>python thirty days ago</title>
		<link>http://thatmattbone.com/2010/04/python-thirty-days-ago/</link>
		<comments>http://thatmattbone.com/2010/04/python-thirty-days-ago/#comments</comments>
		<pubDate>Fri, 16 Apr 2010 12:42:53 +0000</pubDate>
		<dc:creator>Matt Bone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://thatmattbone.com/?p=214</guid>
		<description><![CDATA[These tiny things make Python fun and useful: import datetime thirty_days = datetime.timedelta&#40;days=30&#41; thirty_days_ago = datetime.date.today&#40;&#41; - thirty_days]]></description>
			<content:encoded><![CDATA[<p>These tiny things make Python fun and useful:</p>

<div class="wp_syntax"><div class="code"><pre class="python" style="font-family:monospace;"><span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">datetime</span>
thirty_days = <span style="color: #dc143c;">datetime</span>.<span style="color: black;">timedelta</span><span style="color: black;">&#40;</span>days=<span style="color: #ff4500;">30</span><span style="color: black;">&#41;</span>
thirty_days_ago = <span style="color: #dc143c;">datetime</span>.<span style="color: black;">date</span>.<span style="color: black;">today</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> - thirty_days</pre></div></div>

]]></content:encoded>
			<wfw:commentRss>http://thatmattbone.com/2010/04/python-thirty-days-ago/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>plotting the racial makeup of Chicago&#8217;s public schools</title>
		<link>http://thatmattbone.com/2010/04/plotting-the-racial-makeup-of-chicagos-public-schools/</link>
		<comments>http://thatmattbone.com/2010/04/plotting-the-racial-makeup-of-chicagos-public-schools/#comments</comments>
		<pubDate>Tue, 13 Apr 2010 12:24:24 +0000</pubDate>
		<dc:creator>Matt Bone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[data]]></category>
		<category><![CDATA[python]]></category>
		<category><![CDATA[software]]></category>
		<category><![CDATA[transparency]]></category>

		<guid isPermaLink="false">http://thatmattbone.com/?p=201</guid>
		<description><![CDATA[I created this image using matplotlib and the data from my CPS Racial Data Warehouse project.  Circle size represents school population.  The axes are latitude and longitude (as a reference, the loop is the empty rectangle just below the left corner of the legend).  Also I should note the Native American population was excluded from [...]]]></description>
			<content:encoded><![CDATA[<p><img class="alignnone size-full wp-image-202" title="schools" src="http://thatmattbone.com/wp-content/uploads/2010/04/schools.png" alt="schools" width="500" /></p>
<p>I created this image using <a href="http://matplotlib.sourceforge.net/">matplotlib</a> and the data from my <a href="http://cpswarehouse.thatmattbone.com/">CPS Racial Data Warehouse</a> project.  Circle size represents school population.  The axes are latitude and longitude (as a reference, the loop is the empty rectangle just below the left corner of the legend).  Also I should note the Native American population was excluded from this image because of a technical issue.</p>
<p>Full size image <a href="http://thatmattbone.com/wp-content/uploads/2010/04/schools.png">here</a>, more on this project soon (in the meantime, <a href="http://code.google.com/p/cpswarehouse/">the code is here</a>).</p>
]]></content:encoded>
			<wfw:commentRss>http://thatmattbone.com/2010/04/plotting-the-racial-makeup-of-chicagos-public-schools/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>software quality</title>
		<link>http://thatmattbone.com/2010/03/software-quality/</link>
		<comments>http://thatmattbone.com/2010/03/software-quality/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 14:49:02 +0000</pubDate>
		<dc:creator>Matt Bone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[software]]></category>

		<guid isPermaLink="false">http://thatmattbone.com/?p=194</guid>
		<description><![CDATA[I&#8217;ve been thinking a lot about software quality and testing. This is what I&#8217;ve come up with:]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been thinking a lot about software quality and testing.  This is what I&#8217;ve come up with:</p>
<p><img src="http://thatmattbone.com/wp-content/uploads/2010/03/softwarequality.jpg" alt="softwarequality" title="softwarequality" width="281" height="185" class="alignnone size-full wp-image-195" /></p>
]]></content:encoded>
			<wfw:commentRss>http://thatmattbone.com/2010/03/software-quality/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>palindromes on twitter &#8211; rettiwt no semordnilap</title>
		<link>http://thatmattbone.com/2010/01/palindromes-on-twitter-rettiwt-no-semordnilap/</link>
		<comments>http://thatmattbone.com/2010/01/palindromes-on-twitter-rettiwt-no-semordnilap/#comments</comments>
		<pubDate>Sun, 24 Jan 2010 23:35:32 +0000</pubDate>
		<dc:creator>Matt Bone</dc:creator>
				<category><![CDATA[Uncategorized]]></category>
		<category><![CDATA[python]]></category>

		<guid isPermaLink="false">http://thatmattbone.com/?p=177</guid>
		<description><![CDATA[Lately I&#8217;ve been thinking about processing streams of data on the fly. Weirdly enough, I have a fascination with palindromes, so I wrote a very bad hack with Twisted to hookup to the streaming twitter feed and search for these things. Over the course of about a day, I found 259 distinct palindromes where palindromes [...]]]></description>
			<content:encoded><![CDATA[<p>Lately I&#8217;ve been thinking about processing streams of data on the fly.  Weirdly enough, I have a fascination with palindromes, so I wrote <a href="http://bitbucket.org/thatmattbone/twitiwt/">a very bad hack</a> with <a href="http://twistedmatrix.com/trac/">Twisted</a> to hookup to the <a href="http://apiwiki.twitter.com/Streaming-API-Documentation">streaming twitter feed</a> and search for these things.  Over the course of about a day, I found 259 distinct palindromes where palindromes are (very narrowly) defined as:</p>
<ol>
<li>Words without punctuation, numbers or accents (i.e. only a-z in regex).</li>
<li>Longer than four characters.</li>
<li>Consisting of three or more distinct characters.</li>
<li>Not in a set of stop words I decided I was not interested in.</li>
</ol>
<p>The astute reader will notice that these rules actual mean all valid palindromes will be 5 or more characters. Now for the results:</p>
<p style="text-align: center;"><img class="aligncenter size-full wp-image-178" title="Twitter Palindromes" src="http://thatmattbone.com/wp-content/uploads/2010/01/out.png" alt="Twitter Palindromes" width="500" height="600" /></p>
<p>&#8220;Level&#8221; is the clear winner with 662 occurrences. The venerable palindrome &#8220;racecar&#8221; sped into the #30 spot with a mere 8 occurrences.</p>
<p>Unfortunately I did not keep track of how many tweets I scanned, but it appears a very small percentage of tweets contain this type of palindrome.  I would like to convert this to a full-on palindrome tracking twitter bot that will annoyingly tweet at you if you tweet something palindrome-ish, but I am slightly afraid someone would take that code and make streaming-twitter-pesterbot-v1™.  Hunting for palindromic sentences would be fun, too (a palindromic 144 character tweet would be pure genius).  Most importantly, I&#8217;d like to search for sarahpalindromes which I&#8217;ve defined as words that become palindromes with one transposition (sarahpalindrome detection algorithms are much appreciated&#8230;you could probably get a paper out of something like that).</p>
]]></content:encoded>
			<wfw:commentRss>http://thatmattbone.com/2010/01/palindromes-on-twitter-rettiwt-no-semordnilap/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.787 seconds -->
<!-- Cached page served by WP-Cache -->
