<?xml version="1.0" encoding="utf-8" standalone="yes" ?>
<feed xmlns="http://www.w3.org/2005/Atom">

	<title>Planet Cixar</title>
	<link rel="self" href="http://cixar.com/atom.xml"/>
	<link href="http://cixar.com/planet"/>
	<id>http://cixar.com/atom.xml</id>
	<updated>2008-10-07T05:17:16+00:00</updated>
	<generator uri="http://www.planetplanet.org/">Planet/2.0 +http://www.planetplanet.org</generator>

	<entry>
		<title type="html">lhc11.jpg 990×640 pixels</title>
		<link href="http://cache.boston.com/universal/site_graphics/blogs/bigpicture/lhc_08_01/lhc11.jpg"/>
		<id>http://cache.boston.com/universal/site_graphics/blogs/bigpicture/lhc_08_01/lhc11.jpg</id>
		<updated>2008-10-06T23:53:57+00:00</updated>
		<content type="html">That&amp;#039;s not an LHC.  It&amp;#039;s a portal to other worlds!</content>
		<author>
			<name>Kris Kowal's Del.icio.us Bookmarks</name>
			<uri>http://delicious.com/kris.kowal</uri>
		</author>
		<source>
			<title type="html">Delicious/kris.kowal</title>
			<subtitle type="html">bookmarks posted by kris.kowal</subtitle>
			<link rel="self" href="http://feeds.delicious.com/rss/kris.kowal"/>
			<id>http://feeds.delicious.com/rss/kris.kowal</id>
			<updated>2008-10-07T01:17:15+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en-us">
		<title type="html">kriskowal: This tweet was made by a Python program.</title>
		<link href="http://twitter.com/kriskowal/statuses/948935523"/>
		<id>http://twitter.com/kriskowal/statuses/948935523</id>
		<updated>2008-10-06T23:33:27+00:00</updated>
		<content type="html">kriskowal: This tweet was made by a Python program.</content>
		<author>
			<name>Kris Kowal's Twitter Status</name>
			<uri>http://twitter.com/kriskowal</uri>
		</author>
		<source>
			<title type="html">Twitter / kriskowal</title>
			<subtitle type="html">Twitter updates from Kris Kowal / kriskowal.</subtitle>
			<link rel="self" href="http://twitter.com/statuses/user_timeline/6585632.rss"/>
			<id>http://twitter.com/statuses/user_timeline/6585632.rss</id>
			<updated>2008-10-07T01:17:17+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">First look: latest Fedora and Ubuntu betas really shine</title>
		<link href="http://arstechnica.com/news.ars/post/20081006-first-look-latest-fedora-and-ubuntu-betas-really-shine.html"/>
		<id>http://arstechnica.com/news.ars/post/20081006-first-look-latest-fedora-and-ubuntu-betas-really-shine.html</id>
		<updated>2008-10-06T07:00:00+00:00</updated>
		<content type="html">Ars takes a look at the latest beta releases of Ubuntu 8.10 and Fedora 10. These betas include impressive new features and reflect the growing maturity of the Linux desktop.</content>
		<author>
			<name>Ryan Paul's Articles</name>
			<uri>http://cixar.com/~segphault/articles</uri>
		</author>
		<source>
			<title type="html">Ryan's Articles</title>
			<subtitle type="html">Ryan's Articles</subtitle>
			<link rel="self" href="http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true"/>
			<id>http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true</id>
			<updated>2008-10-07T05:17:06+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">War of the Worlds 2.0 Update</title>
		<link href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/wotw2-2"/>
		<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/wotw2-2</id>
		<updated>2008-10-06T06:21:00+00:00</updated>
		<content type="html">&lt;p&gt;It turns out I write a lot of words and say very little.  Here's what you need to know about the upcoming alien invasion:&lt;/p&gt;

&lt;ul&gt;
	&lt;li&gt;Follow &lt;a href=&quot;http://twitter.com/wotw2&quot;&gt;@wotw2&lt;/a&gt;&lt;/li&gt;
	&lt;li&gt;On Halloween, tweet in earnest about the unfolding alien invasion.  Make your own story.  Keep in touch with your friends like you would in any other disaster situation.  Try to imagine what you would tweet as the aliens land, emerge, and lay waste to every metropolis around the world.&lt;/li&gt;
	&lt;li&gt;Email &lt;a href=&quot;mailto:wotw2@cixar.com&quot;&gt;wotw2@cixar.com&lt;/a&gt; if you want to help plan the story or provide technical assistance.&lt;/li&gt;
&lt;/ul&gt;</content>
		<author>
			<name>&quot;The Sourcerer&quot;, Kris Kowal's Blog</name>
			<uri>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi</uri>
		</author>
		<source>
			<title type="html">The Sourcerer</title>
			<subtitle type="html">by Kris Kowal</subtitle>
			<link rel="self" href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2"/>
			<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2</id>
			<updated>2008-10-07T05:17:11+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en-us">
		<title type="html">kriskowal: @segphault also bought Anathem.  It's now high on my pile of books to read.</title>
		<link href="http://twitter.com/kriskowal/statuses/947886887"/>
		<id>http://twitter.com/kriskowal/statuses/947886887</id>
		<updated>2008-10-06T05:09:59+00:00</updated>
		<content type="html">kriskowal: @segphault also bought Anathem.  It's now high on my pile of books to read.</content>
		<author>
			<name>Kris Kowal's Twitter Status</name>
			<uri>http://twitter.com/kriskowal</uri>
		</author>
		<source>
			<title type="html">Twitter / kriskowal</title>
			<subtitle type="html">Twitter updates from Kris Kowal / kriskowal.</subtitle>
			<link rel="self" href="http://twitter.com/statuses/user_timeline/6585632.rss"/>
			<id>http://twitter.com/statuses/user_timeline/6585632.rss</id>
			<updated>2008-10-07T01:17:17+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en-us">
		<title type="html">kriskowal: Readers Digest version: follow @wotw2 (*gasp* I said &quot;it&quot;) 
and tweet about your &quot;experiences&quot; as the alien invasion unfolds.</title>
		<link href="http://twitter.com/kriskowal/statuses/947883577"/>
		<id>http://twitter.com/kriskowal/statuses/947883577</id>
		<updated>2008-10-06T05:04:57+00:00</updated>
		<content type="html">kriskowal: Readers Digest version: follow @wotw2 (*gasp* I said &quot;it&quot;) 
and tweet about your &quot;experiences&quot; as the alien invasion unfolds.</content>
		<author>
			<name>Kris Kowal's Twitter Status</name>
			<uri>http://twitter.com/kriskowal</uri>
		</author>
		<source>
			<title type="html">Twitter / kriskowal</title>
			<subtitle type="html">Twitter updates from Kris Kowal / kriskowal.</subtitle>
			<link rel="self" href="http://twitter.com/statuses/user_timeline/6585632.rss"/>
			<id>http://twitter.com/statuses/user_timeline/6585632.rss</id>
			<updated>2008-10-07T01:17:17+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en-us">
		<title type="html">kriskowal: War of the Worlds 2.0: http://tinyurl.com/4zm922 -- Halloween Reenactment on Twitter.  Spread the word.</title>
		<link href="http://twitter.com/kriskowal/statuses/947881141"/>
		<id>http://twitter.com/kriskowal/statuses/947881141</id>
		<updated>2008-10-06T05:01:21+00:00</updated>
		<content type="html">kriskowal: War of the Worlds 2.0: http://tinyurl.com/4zm922 -- Halloween Reenactment on Twitter.  Spread the word.</content>
		<author>
			<name>Kris Kowal's Twitter Status</name>
			<uri>http://twitter.com/kriskowal</uri>
		</author>
		<source>
			<title type="html">Twitter / kriskowal</title>
			<subtitle type="html">Twitter updates from Kris Kowal / kriskowal.</subtitle>
			<link rel="self" href="http://twitter.com/statuses/user_timeline/6585632.rss"/>
			<id>http://twitter.com/statuses/user_timeline/6585632.rss</id>
			<updated>2008-10-07T01:17:17+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Ask a Wizard: War of the Worlds 2.0</title>
		<link href="http://askawizard.blogspot.com/2008/10/war-of-worlds-20.html"/>
		<id>http://askawizard.blogspot.com/2008/10/war-of-worlds-20.html</id>
		<updated>2008-10-06T04:54:30+00:00</updated>
		<content type="html">Let&amp;#039;s reenact War of the Worlds on Twitter, Delicious, and in our Blogs for Halloween.  Here&amp;#039;s the plan.</content>
		<author>
			<name>Kris Kowal's Del.icio.us Bookmarks</name>
			<uri>http://delicious.com/kris.kowal</uri>
		</author>
		<source>
			<title type="html">Delicious/kris.kowal</title>
			<subtitle type="html">bookmarks posted by kris.kowal</subtitle>
			<link rel="self" href="http://feeds.delicious.com/rss/kris.kowal"/>
			<id>http://feeds.delicious.com/rss/kris.kowal</id>
			<updated>2008-10-07T01:17:15+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">War of the Worlds 2.0</title>
		<link href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/wotw2"/>
		<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/wotw2</id>
		<updated>2008-10-06T04:51:38+00:00</updated>
		<content type="html">&lt;p&gt;Last week, &lt;a href=&quot;http://blog.joshlewis.org/&quot;&gt;Josh Lewis&lt;/a&gt;; friend, former Apple coworker, and &lt;a href=&quot;http://www.friendlystegosaurus.com/2007/10/09/052-pastabrain-was-already-taken/&quot;&gt;Lex Luthor hairstyle enthusiast&lt;/a&gt;; got me thinking about &lt;a href=&quot;http://blog.joshlewis.org/&quot;&gt;fiction on Twitter&lt;/a&gt;.  Then, &lt;a href=&quot;http://arstechnica.com/authors.ars/segphault&quot;&gt;Ryan Paul&lt;/a&gt; pointed out that he had written &lt;a href=&quot;http://arstechnica.com/news.ars/post/20080901-byte-sized-stories-twittering-a-tiny-tale.html&quot;&gt;an article about Twitter fiction&lt;/a&gt; already.  Here's the idea.  Let's (and by &quot;us&quot;, I mean everyone) reenact &lt;a href=&quot;http://en.wikipedia.org/wiki/The_War_of_the_Worlds_(radio)&quot;&gt;The War of the Worlds&lt;/a&gt;, on the Internet, for Halloween!&lt;/p&gt;
&lt;p&gt;CBS ran the Orsen Welles War of the Worlds radio program in the tense times leading up to the second World War.  The aforementioned Wikipedia article claims that Adolf Hitler denounced the program as a sign of democratic decadence.  Without commercial breaks and interpolated among real news, the program was broadcast in earnest and public panic ensued.  War of the Worlds was the Ultimate Prank, never to be reproduced.  As an homage, let's take Halloween to tweet, share bookmarks and status messages, and blog in earnest about the alien invasion in progress.  Everyone, tell &lt;i&gt;your&lt;/i&gt; story.&lt;/p&gt;
&lt;p&gt;The War of the Worlds has several phases that I believe have strong analogs in the tense times leading to World Web II (point oh).&lt;/p&gt;

&lt;ol type=&quot;1&quot;&gt;
	&lt;li&gt;a noteworthy astronomer speculates on the possibility of an alien invasion.  This would be a good time to talk about the &lt;a href=&quot;http://en.wikipedia.org/wiki/Drake_equation&quot;&gt;Drake equation&lt;/a&gt; in your blog, especially if astronomy is your hobby.  Send an email to &lt;a href=&quot;mailto:wotw@cixar.com&quot;&gt;wotw@cixar.com&lt;/a&gt; with your blog so we can proliferate it on the &lt;a href=&quot;http://twitter.com/wotw2&quot;&gt;@wotw2&lt;/a&gt; Twitter account.&lt;/li&gt;
	&lt;li&gt;The alien invasion occurs.  Follow &lt;a href=&quot;http://twitter.com/wotw2&quot;&gt;@wotw2&lt;/a&gt; to keep in sync with the progress of the invasion.  This Twitter feed will automatically update, in general terms, the unfolding of the alien invasion like clockwork throughout the world.  Coordinate with Tweeters in your area to tell local stories.&lt;/li&gt;

	&lt;ol type=&quot;1&quot;&gt;
		&lt;li&gt;cylinders fall from the sky.  Tweet about where you are.  Ask your friends where they are.  Form posses.  Skip town or take a closer look.&lt;/li&gt;
		&lt;li&gt;tripods emerge.  Flee, get stuck in traffic, or take refuge and tell us what you see.&lt;/li&gt;
		&lt;li&gt;Martians begin obliterating every Terran metropolitan area with heat rays.  Don't call them heat-rays; that would be a dead giveaway.  Describe what they do and come up with your own name!  Do you work in a public service like hospitals or fire?  What's your job and what do you do?  Do you organize your coworkers and flee?  Do you head for the hills with your go-bag?&lt;/li&gt;
		&lt;li&gt;Military, local militia, and national guard units get organized and attack the alien invaders.  Do you serve in the military?  This is your last chance to tell us where you're headed.  Do you have family in a militia?  Try to keep in touch and let us know how and where they valiantly fought and lost.&lt;/li&gt;
		&lt;li&gt;The invasion spreads from cities to countryside.&lt;/li&gt;
		&lt;li&gt;Tripods begin to shut down an malfunction.  Are you near one?  Do you take a closer look?&lt;/li&gt;
	&lt;/ol&gt;
	&lt;li&gt;After the threat dies down, people begin to blog and speculate about what happened, and every topic near and dear to them.&lt;/li&gt;
	&lt;li&gt;The curtain rises.  Blog, link, and tweet about the experience.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;The &quot;War of the Worlds 2.0&quot; event will be synchronized, on Halloween Friday, with the &lt;a href=&quot;http://twitter.com/wotw2&quot;&gt;http://twitter.com/wotw2&lt;/a&gt; account and we're writing automation with Ryan Paul's &lt;a href=&quot;https://launchpad.net/gwibber&quot;&gt;Gwibber&lt;/a&gt; tool to automatically post Tweets to various services on that day.  If you would like to make additional accounts to synchronize local events, please send an email to &lt;a href=&quot;mailto:wotw2@cixar.com&quot;&gt;wotw2@cixar.com&lt;/a&gt; with a Twitter account name and password and we'll hook you up with edit privileges for the &lt;a href=&quot;http://spreadsheets.google.com/pub?key=peXwPeIqxoPDBGWH-mHNhUw&quot;&gt;tweet plan&lt;/a&gt; on Google Docs.  Tweets (rows) will be deployed for each column (account).&lt;/p&gt;
&lt;p&gt;Let's tell a story!&lt;/p&gt;</content>
		<author>
			<name>&quot;The Sourcerer&quot;, Kris Kowal's Blog</name>
			<uri>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi</uri>
		</author>
		<source>
			<title type="html">The Sourcerer</title>
			<subtitle type="html">by Kris Kowal</subtitle>
			<link rel="self" href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2"/>
			<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2</id>
			<updated>2008-10-07T05:17:11+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">I started reading Anathem today and I'm really enjoying it so far.</title>
		<link href="http://segphault.jaiku.com/presence/46120262"/>
		<id>tag:jaiku.com,2008-10-06:/presence/46120262</id>
		<updated>2008-10-06T04:36:54+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    I started reading Anathem today and I'm really enjoying it so far.                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     41 minutes ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">Multi-Dimensional Analog Literals in C++</title>
		<link href="http://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml"/>
		<id>http://www.xs4all.nl/~weegen/eelis/analogliterals.xhtml</id>
		<updated>2008-10-05T19:44:46+00:00</updated>
		<content type="html">&amp;quot;Have you ever felt that integer literals like &amp;quot;4&amp;quot; don&amp;#039;t convey the true size of the value they denote? If so, use an analog integer literal instead.&amp;quot;</content>
		<author>
			<name>Kris Kowal's Del.icio.us Bookmarks</name>
			<uri>http://delicious.com/kris.kowal</uri>
		</author>
		<source>
			<title type="html">Delicious/kris.kowal</title>
			<subtitle type="html">bookmarks posted by kris.kowal</subtitle>
			<link rel="self" href="http://feeds.delicious.com/rss/kris.kowal"/>
			<id>http://feeds.delicious.com/rss/kris.kowal</id>
			<updated>2008-10-07T01:17:15+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">JSON Basics</title>
		<link href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/program/json"/>
		<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/program/json</id>
		<updated>2008-10-05T07:38:58+00:00</updated>
		<content type="html">&lt;p&gt;&lt;a href=&quot;http://json.org&quot;&gt;JSON&lt;/a&gt; is a strict subset of JavaScript, particularly a subset of its object-literal notation, discovered and specified by &lt;a href=&quot;http://www.crockford.com/&quot;&gt;Doug Crockford&lt;/a&gt;.  The subset is sufficient to make the creation of parsers and formatters in various languages nearly trivial, while completely trivializing the process of parsing the notation in a web browser.&lt;/p&gt;
&lt;p&gt;Object-literals in JavaScript are very similar to their analogs in many other languages, like Perl, Python, and even AppleScript.  The notation provisions text strings, numbers, booleans, and the literal &lt;tt&gt;null&lt;/tt&gt; for all elemental (scalar) data.  Then the notation provides Arrays for ordered values and Objects for unordered, unique, string-to-anything key-value-pair mappings.  With these types, you can express most hierarchical data easily.&lt;/p&gt;

&lt;pre&gt;
10
3.1415
&quot;a&quot;
true
false
null
[1, 2, 3]
{&quot;a&quot;: 10, &quot;b&quot;: 20}
[{&quot;a&quot;: 10}, {&quot;a&quot;: 20}]&lt;/pre&gt;
&lt;p&gt;JSON makes a couple simplifications even on JavaScript's object literal grammar.  These make it even easier to write parsers and formatters.&lt;/p&gt;

&lt;ol type=&quot;1&quot;&gt;
	&lt;li&gt;a JSON expression contains no new-line characters.&lt;/li&gt;
	&lt;li&gt;all strings, including keys in objects, are enquoted between double quotes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;JSON joins the ranks of many other markup languages that we can use &lt;abbr title=&quot;split infinitives are cool&quot;&gt;to easily transfer&lt;/abbr&gt; data among web servers, but its primary function is as a common data interchange language between web browser clients and web servers hosted in the numerous languages of the web.  JSON is well adapted for this space because it can take advantage, through various channels, of every web browser's fast, built-in JavaScript interpreter.&lt;/p&gt;
&lt;p&gt;There are two flavors of JSON services with subtle differences for both clients and servers.  One is JSON proper, which I will call XHR JSON because it uses an XML HTTP Request.  The other is called JSONP or &quot;JSON with Padding&quot;.  You would use one, the other, or neither based on security and performance concerns.&lt;/p&gt;


&lt;h2&gt;
	XHR JSON
&lt;/h2&gt;
&lt;p&gt;XHR JSON uses a feature that exists in one form or another in all modern web-browsers, called an XML HTTP Request, and a function in JavaScript that lets you evaluate arbitrary text strings as JavaScript programs, called &lt;tt&gt;eval&lt;/tt&gt;.  With an XML HTTP Request, the client can make an HTTP Request to any URL on the same domain as the hosting page.  This constraint is called the &quot;Same Origin Policy&quot;.  Unfortunately, the policy is in many cases not sufficient to isolate vulnerability to paths of a particular domain, nor to prevent cross site scripts from using the data (more on that later).  Whether the security mechanism is effective or not is a longer and later discussion.  The point being that this mechanism is the crux of your choice between XHR JSON and JSONP.&lt;/p&gt;
&lt;p&gt;With an XHR, you request plain text from a URL on the same domain as your page, then you evaluate it as a JavaScript program.  Performing a cross-browser compatible XML HTTP Request isn't trivial in itself, so let's assume that I'm using a library that provides an &lt;tt&gt;xhr&lt;/tt&gt; function that synchronously (blocks) until an HTTP request is complete and returns the content of the HTTP response as a String.  There are other variations on &lt;tt&gt;xhr&lt;/tt&gt; for asynchronous requests and grabbing XML.&lt;/p&gt;

&lt;pre&gt;
var text = xhr(&quot;/some.json&quot;);
var json = eval(text);&lt;/pre&gt;
&lt;p&gt;In this case, the &quot;/some.json&quot; contains unadulterated JSON.  However, because your JSON is likely to be an Object like &lt;tt&gt;{&quot;a&quot;: 10}&lt;/tt&gt;, we need to make a special arrangement.  A JavaScript program that is merely an &lt;tt&gt;Object&lt;/tt&gt; literal would be mis-parsed initially as a code block.  For this reason, we must force the JavaScript parser into expression context instead of statement context.  For this reason, we wrap the JSON string in parentheses or assign it to a variable.&lt;/p&gt;

&lt;pre&gt;
var text = xhr(&quot;/some.json&quot;);
var json = eval(&quot;(&quot; + text + &quot;)&quot;);&lt;/pre&gt;
&lt;p&gt;I prefer parentheses because I haven't, in my fallible memory, encountered a browser that supported XHR but wasn't standards compliant enough for the &lt;tt&gt;eval&lt;/tt&gt; function to return the value of the last evaluated expression.&lt;/p&gt;
&lt;p&gt;When you use an XHR to grab JSON, you are vulnerable to the host, depending on it to not give you an alternate JavaScript program that insidiously evaluates to the same data.  For that reason, a lot of JSON libraries engage in the slower and dubious attempt to validate the JSON before evaluating it with a regular expression.  The bottom line is that you're vulnerable to your server when you use &lt;tt&gt;XHR&lt;/tt&gt; and &lt;tt&gt;eval&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;That being said, it's better to get an exception early than an untraceable error later.  For that reason, attempting to validate JSON is a good idea.  There's another one: variable laundering.  The &lt;tt&gt;eval&lt;/tt&gt; function inherits the calling context's scope chain.  This means that the server can read and alter any variables on your scope chain.  I use an &lt;tt&gt;evalGlobal&lt;/tt&gt; routine to launder my scope chain.  This doesn't give security all by itself, but it could help lead to a secure system down the way and can turn a bunch of silent name resolution errors or data leaks into thrown &lt;tt&gt;NameError&lt;/tt&gt;s.&lt;/p&gt;

&lt;pre&gt;
(function (evalGlobal) {
	var text = xhr(&quot;/some.json&quot;);
	validateJson(text);
	var json = evalGlobal(&quot;(&quot; + text + &quot;)&quot;);
	...
})(function () {
	return eval(arguments[0]);
})&lt;/pre&gt;
&lt;p&gt;I'll give a detailed explanation of &lt;tt&gt;evalGlobal&lt;/tt&gt; in another article.  For now, suffice it to say, this is much more elegant than using a variable to capture the JSON value, although it is possible:&lt;/p&gt;

&lt;pre&gt;
var text = xhr(&quot;/some.json&quot;);
var json;
eval(&quot;json = &quot; + text);&lt;/pre&gt;


&lt;h2&gt;
	JSONP
&lt;/h2&gt;
&lt;p&gt;JSONP is different than XHR JSON in both the way the server hosts the data and in the way that the client consumes it.  On the client side, the user adds a &lt;tt&gt;&amp;lt;script&amp;gt;&lt;/tt&gt; tag to their own page.  The source of the script is the URL of a server side program with the name of a callback function that the client places in global scope sent as a query argument.&lt;/p&gt;

&lt;pre&gt;&amp;lt;script src=&quot;http://other.com/some.jsonp?callback=foo&quot;&amp;gt;&lt;/pre&gt;
&lt;p&gt;The client script arranges to receive parsed and evaluated JSON data asynchronously by adding a &lt;tt&gt;foo&lt;/tt&gt; method to the global scope, the &lt;tt&gt;window&lt;/tt&gt; object.&lt;/p&gt;

&lt;pre&gt;
window.foo = function (json) {
	...
	delete window.foo;
};
var script = document.createElement('script');
script.src = &quot;http://other.com/some.jsonp?callback=foo&quot;;
document.getElementsByTagName('head').appendChild(script);&lt;/pre&gt;
&lt;p&gt;When you add a &lt;tt&gt;script&lt;/tt&gt; tag to your document, browsers are kind enough to notice and automatically send an HTTP request to fetch the request JavaScript program.  In this case, your page trusts the script on &lt;tt&gt;other.com&lt;/tt&gt; to return a JavaScript program that will call your &quot;foo&quot; function and pass it some JSON data.&lt;/p&gt;

&lt;pre&gt;foo({&quot;a&quot;: 10});&lt;/pre&gt;
&lt;p&gt;With JSONP, the client is vulnerable to the remote server because it can opt to write an arbitrary JavaScript program before calling &lt;tt&gt;foo&lt;/tt&gt;, if at all.  So, you should only use JSONP to request data from domains that you trust.&lt;/p&gt;
&lt;p&gt;Also JSONP is slower and less responsive to errors than XHR JSON can be.  The only signal that you receive as to the progress or status of a JSONP request is whether your callback gets called in a timely fashion.  XHR JSON is preferable in all situations where it is possible and it may even make sense to create a proxy to the other domain from your same domain server.  Using a proxy also gives you an opportunity to validate the JSON on the server-side, where computation time is cheap.&lt;/p&gt;


&lt;h2&gt;
	Same Origin XHR JSON
&lt;/h2&gt;
&lt;p&gt;There's another trick with XHR JSON, and I'm not sure what scenarios require it.  Some people can use the JSONP technique to fetch JSON from a foreign domain.  These folks can't send HTTP headers or cookies, and they never get an opportunity to alter the text of the HTTP request before it's evaluated as JavaScript in their browser.  I would think that it would be sufficient to prevent an other domain client from intercepting sensitive data for the server to require an authenticated token in the HTTP request, as can be provided by an XML HTTP Request but not a JSONP request.  However, some crackers can attempt to get data from your service by using JSON data in a cross site script, much like JSONP.  However, instead of using a callback, these crackers arrange to override the &lt;tt&gt;Array&lt;/tt&gt; or &lt;tt&gt;Object&lt;/tt&gt; constructors and thus can monitor and transmit snippets of JSON constructed by simply evaluating JavaScript object literal notation.  This technique can be prevented by padding your XHR JSON service with an infinite loop.&lt;/p&gt;

&lt;pre&gt;
while (1);
{&quot;a&quot;: 10}&lt;/pre&gt;
&lt;p&gt;In this case, your client conspires with the server, and since it does get a chance to intercept and modify the text of the JSON, it strips the known number of characters for the while loop before evaluating it.&lt;/p&gt;

&lt;pre&gt;
var text = xhr(&quot;/some.json&quot;);
var json = evalGlobal(&quot;(&quot; + text.substring(&quot;while (1);&quot;.length) + &quot;)&quot;);&lt;/pre&gt;
&lt;p&gt;What baffles me is that, unless you've secured your JSON with an authentication token, any server capable of making HTTP requests and parsing JSON could do the same thing.  Malicious clients are not required to use web browsers.  The only situation where this might occur would be if the cracker had compromised your client already, had your authentication token, and needed your browser to make a cross domain JSONP request on its behalf.  That could not be the case since the server would have no reason to give an XHR JSON authentication token to a client that could only fetch data with JSONP.  That point is even moot since, going back, the cracker has already compromised your client and might as well use XHR JSON with all the same rights as you on even the same origin.&lt;/p&gt;
&lt;p&gt;That being said, I noticed that GMail used this technique, so I assume there's substance to it.  Perhaps someone will clarify in the comments.&lt;/p&gt;</content>
		<author>
			<name>&quot;The Sourcerer&quot;, Kris Kowal's Blog</name>
			<uri>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi</uri>
		</author>
		<source>
			<title type="html">The Sourcerer</title>
			<subtitle type="html">by Kris Kowal</subtitle>
			<link rel="self" href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2"/>
			<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2</id>
			<updated>2008-10-07T05:17:11+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en-us">
		<title type="html">kriskowal: @wynk on cixar.com, &quot;jolly boots of doom&quot; is most frequently sought.</title>
		<link href="http://twitter.com/kriskowal/statuses/946421348"/>
		<id>http://twitter.com/kriskowal/statuses/946421348</id>
		<updated>2008-10-04T19:34:45+00:00</updated>
		<content type="html">kriskowal: @wynk on cixar.com, &quot;jolly boots of doom&quot; is most frequently sought.</content>
		<author>
			<name>Kris Kowal's Twitter Status</name>
			<uri>http://twitter.com/kriskowal</uri>
		</author>
		<source>
			<title type="html">Twitter / kriskowal</title>
			<subtitle type="html">Twitter updates from Kris Kowal / kriskowal.</subtitle>
			<link rel="self" href="http://twitter.com/statuses/user_timeline/6585632.rss"/>
			<id>http://twitter.com/statuses/user_timeline/6585632.rss</id>
			<updated>2008-10-07T01:17:17+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Jonathan Haidt on the moral roots of liberals and conservatives | Video on TED.com</title>
		<link href="http://www.ted.com/index.php/talks/jonathan_haidt_on_the_moral_mind.html"/>
		<id>http://www.ted.com/index.php/talks/jonathan_haidt_on_the_moral_mind.html</id>
		<updated>2008-10-04T01:05:46+00:00</updated>
		<content type="html">A really neat piece on moral psychology, how it polarizes people along the red/blue axis, and how we can become purple.</content>
		<author>
			<name>Kris Kowal's Del.icio.us Bookmarks</name>
			<uri>http://delicious.com/kris.kowal</uri>
		</author>
		<source>
			<title type="html">Delicious/kris.kowal</title>
			<subtitle type="html">bookmarks posted by kris.kowal</subtitle>
			<link rel="self" href="http://feeds.delicious.com/rss/kris.kowal"/>
			<id>http://feeds.delicious.com/rss/kris.kowal</id>
			<updated>2008-10-07T01:17:15+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Presidential Election 2008 FAQ</title>
		<link href="http://norvig.com/election-faq.html"/>
		<id>http://norvig.com/election-faq.html</id>
		<updated>2008-10-03T23:45:56+00:00</updated>
		<content type="html"></content>
		<author>
			<name>Kris Kowal's Del.icio.us Bookmarks</name>
			<uri>http://delicious.com/kris.kowal</uri>
		</author>
		<source>
			<title type="html">Delicious/kris.kowal</title>
			<subtitle type="html">bookmarks posted by kris.kowal</subtitle>
			<link rel="self" href="http://feeds.delicious.com/rss/kris.kowal"/>
			<id>http://feeds.delicious.com/rss/kris.kowal</id>
			<updated>2008-10-07T01:17:15+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Designing Django's Object-Relational-Model - The Python Saga - Part 6</title>
		<link href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/program/python/django-orm-design"/>
		<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/program/python/django-orm-design</id>
		<updated>2008-10-03T22:13:11+00:00</updated>
		<content type="html">&lt;p&gt;Django is a web application framework in the Python language.  One of the advantages that Django has over other libraries is that it was written and designed by Python experts.  That is to say, they knew about variadic arguments, properties, and metaclasses.  Furthermore, they knew how to cleverly use these ideas to sweep a lot of complexity under the hood (or bonnet if you will; some of them appear to be British) so that common developers, or uncommonly good developers who want to think about other things most of the time, can gracefully suspend disbelief that anything complicated is going on when they design their database in pure Python.  This article will illustrate how Django uses metaclasses and properties to present an abstraction layer where you can specify a database schema with Python classes.  For simplicity, the &quot;database&quot; backend will be plain Python primitive objects&amp;mdash;tables will be dictionaries of dictionaries.&lt;/p&gt;
&lt;p&gt;In the end, we want to be able to write code that looks a whole lot like it's using Django's Object-Relational-Model:&lt;/p&gt;

&lt;pre&gt;
class Cow(Model):
	id = PrimaryKey()
	name = ModelProperty()

cow = Cow(id = 0, name = 'Moolius')
cow.save()

cow = Cow.objects.get(0)&lt;/pre&gt;
&lt;p&gt;The easiest part (for the purpose of this exercise) is Django's concept of an &quot;object manager&quot;.  In Django, every model has an object manager that provides a query API and, depending on the backend, might cache instances of Model objects.  Conveniently, a very narrow subset of the object manager API is almost exactly the same as a dictionary.  Conceptually, the object manager boils down to a dictionary proxy for the database where you can use the &lt;tt&gt;get&lt;/tt&gt; function to retrieve records from the database.  For simplicity, our &lt;tt&gt;ObjectManager&lt;/tt&gt; is just going to be a dictionary.&lt;/p&gt;

&lt;pre&gt;
class ObjectManager(dict):
	pass&lt;/pre&gt;
&lt;p&gt;Beyond the scope of this article, the &lt;tt&gt;ObjectManager&lt;/tt&gt; should be handy for grabbing lots of objects from the database at once.  Django provides a very thorough and relatively well-optimized lazy query system with its object managers.  The &lt;tt&gt;ObjectManager&lt;/tt&gt; has &lt;tt&gt;get&lt;/tt&gt;, and &lt;tt&gt;filter&lt;/tt&gt; methods which, instead of simply accepting the primary key, accept keyword arguments that translate to predicate logic rules.  In particular, the &lt;tt&gt;filter&lt;/tt&gt; function is lazy, so you can chain filter commands to construct complex queries and Django only goes to the database once.&lt;/p&gt;
&lt;p&gt;While it would be super-cool to model all of this with native Python, it actually is a lot of code, so that's a topic for maybe later.  We'll just use the built in &lt;tt&gt;dict.get&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;We'll also need all of the code from &lt;a href=&quot;http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/ordered-properties.html&quot;&gt;Part 5&lt;/a&gt; since models will be another application of the ordered property pattern.  This is how Django creates SQL tables with fields in the same order as the Python properties.&lt;/p&gt;

&lt;pre&gt;
from ordered_class import \
	OrderedMetaclass,\
	OrderedClass,\
	OrderedProperty&lt;/pre&gt;
&lt;p&gt;We use the &lt;tt&gt;OrderedMetaclass&lt;/tt&gt; to make a &lt;tt&gt;ModelMetaclass&lt;/tt&gt;.  The model metaclass will have all the same responsibilities as our &lt;tt&gt;StructMetaclass&lt;/tt&gt;, including &quot;dubbing&quot; the properties so that they know their own names.  The model metaclass will also create an &lt;tt&gt;ObjectManager&lt;/tt&gt; for the class.  This isn't the complete &lt;tt&gt;ModelMetaclass&lt;/tt&gt;; we'll come back to it.&lt;/p&gt;

&lt;pre&gt;
class ModelMetaclass(OrderedMetaclass):
	def __init__(self, name, bases, attys):
		super(ModelMetaclass, self).__init__(name, bases, attys)
		if '_abstract' not in attys:
			self.objects = ObjectManager()
			for name, property in self._ordered_properties:
				property.dub(name, self)&lt;/pre&gt;
&lt;p&gt;The next step is to create a &lt;tt&gt;ModelProperty&lt;/tt&gt; base class.  This class will be an &lt;tt&gt;OrderedProperty&lt;/tt&gt; so it's sortable.  It will also need to implement the &lt;tt&gt;dub&lt;/tt&gt; method so it can figure out its name.  Other than that, it'll be just like the &lt;tt&gt;StructProperty&lt;/tt&gt; from the previous section: it will get and set its corresponding item in the given object.&lt;/p&gt;

&lt;pre&gt;
class ModelProperty(OrderedProperty):
	def __get__(self, objekt, klass):
		return objekt[self.item_name]
	def __set__(self, objekt, value):
		objekt[self.item_name] = value
	def dub(self, name):
		self.item_name = name
		return self&lt;/pre&gt;
&lt;p&gt;There is a distinction in the refinement of &lt;tt&gt;ModelProperty&lt;/tt&gt; from &lt;tt&gt;StructProperty&lt;/tt&gt;: &lt;tt&gt;ModelProperty&lt;/tt&gt; objects will eventually need to distinguish the value stored in the dictionary from the value returned when you access an attribute.  In the primitive case, they're the same, but for &lt;tt&gt;ForeignKey&lt;/tt&gt; objects, down the road, you'll store the primary key for the foreign model instead of the actual object.  This is the same as the behavior in an underlying database backend.&lt;/p&gt;

&lt;pre&gt;
class ModelProperty(OrderedProperty):
	def __get__(self, objekt, klass):
		return objekt[self.item_name]
	def __set__(self, objekt, value):
		objekt[self.item_name] = value
	def dub(self, name):
		self.attr_name = name
		self.item_name = name
		return self&lt;/pre&gt;
&lt;p&gt;Let's consider a &lt;tt&gt;PrimaryKey&lt;/tt&gt; &lt;tt&gt;ModelProperty&lt;/tt&gt;.  The purpose of a &lt;tt&gt;PrimaryKey&lt;/tt&gt; is to designate a property of a model that will be used as the index in its object manager dictionary.  In Django, this can be an implicit &lt;tt&gt;id&lt;/tt&gt; field at the beginning of the table.  For simplicity in this exercise, we'll require every model to explicitly declare a &lt;tt&gt;PrimaryKey&lt;/tt&gt;.  The &lt;tt&gt;ModelMetaclass&lt;/tt&gt; will identify which of its ordered properties is &lt;i&gt;the&lt;/i&gt; primary key by observing its type.  Other than their type, a primary key's behavior is the same as a normal &lt;tt&gt;ModelProperty&lt;/tt&gt;, so it's a really easy declaration:&lt;/p&gt;

&lt;pre&gt;
class PrimaryKey(ModelProperty):
	pass&lt;/pre&gt;
&lt;p&gt;Now we can go back to our &lt;tt&gt;ModelMetaclass&lt;/tt&gt; and add the code we need for every class to know the name of its primary key.  I create a list of &lt;tt&gt;PrimaryKey&lt;/tt&gt; objects from my &lt;tt&gt;_ordered_properties&lt;/tt&gt; and pop off the last one, leaving error checking as an exercise for a more rigorous implementation.  There should be only one primary key.&lt;/p&gt;

&lt;pre&gt;
class ModelMetaclass(OrderedMetaclass):
	def __init__(self, name, bases, attys):
		super(ModelMetaclass, self).__init__(name, bases, attys)
		if '_abstract' not in attys:
			self.objects = ObjectManager()
			for name, property in self._ordered_properties:
				property.dub(name)
			self._pk_name = [
				name
				for name, property in self._ordered_properties
				if isinstance(property, PrimaryKey)
			].pop()&lt;/pre&gt;
&lt;p&gt;Now all we need is a &lt;tt&gt;Model&lt;/tt&gt; base class.  The model base class will just be a dictionary with the model metaclass and a note that it's abstract: that is, it does not have properties so the metaclass better not treat it as a normal model.&lt;/p&gt;

&lt;pre&gt;
class Model(OrderedClass, dict):
	__metaclass__ = ModelMetaclass
	_abstract = True&lt;/pre&gt;
&lt;p&gt;The model will also have a special &lt;tt&gt;pk&lt;/tt&gt; attribute for accessing the primary key and a &lt;tt&gt;save&lt;/tt&gt; method for committing a model to the &lt;tt&gt;ObjectManager&lt;/tt&gt;.&lt;/p&gt;

&lt;pre&gt;
class Model(OrderedClass, dict):
	__metaclass__ = ModelMetaclass
	_abstract = True

	def save(self):
		self.objects[self.pk] = self

	@property
	def pk(self):
		return getattr(self, self._pk_name)&lt;/pre&gt;
&lt;p&gt;Now we have all the pieces we need to begin using the API.  Let's look at that cow model.&lt;/p&gt;

&lt;pre&gt;
class Cow(Model):
	id = PrimaryKey()
	name = ModelProperty()

cow = Cow(id = 0, name = 'Moolius')
cow.save()

cow = Cow.objects.get(0)&lt;/pre&gt;
&lt;p&gt;All of this works now.  You make a cow model; that invokes the model metaclass that sets up &lt;tt&gt;Cow._pk_name&lt;/tt&gt; to be &lt;tt&gt;&quot;id&quot;&lt;/tt&gt; and tacks on a &lt;tt&gt;Cow.objects&lt;/tt&gt; object manager.  Then we make a cow and put it in &lt;tt&gt;Cow.objects&lt;/tt&gt; with the save method.  This is analogous to committing it to the database backend.  From that point, we can use the object manager to retrieve it again.&lt;/p&gt;
&lt;p&gt;We can refine the &lt;tt&gt;Model&lt;/tt&gt; base class to take advantage of the fact that it's not just a dictionary anymore: it's an &lt;i&gt;ordered&lt;/i&gt; dictionary.  We create a better &lt;tt&gt;__init__&lt;/tt&gt; method that will let us assign the attributes of our &lt;tt&gt;Cow&lt;/tt&gt; either positionally or with keywords.  That makes our cow more like a hybrid of a list and a dictionary.  Also, since our model instances aren't merely dictionaries, we create a new &lt;tt&gt;__repr__&lt;/tt&gt; method that will note that cows are cows and moose are moooose.  The new &lt;tt&gt;__repr__&lt;/tt&gt; method also takes the liberty to write the items in the order in which their properties were declared.&lt;/p&gt;

&lt;pre&gt;
class Model(OrderedClass, dict):

	&amp;hellip;

	def __init__(self, *values, **kws):
		super(Model, self).__init__()
		found = set()
		for (name, property), value in zip(
			self._ordered_properties,
			values,
		):
			setattr(self, name, value)
			found.add(name)
		for name, value in kws.items():
			if name in found:
				raise TypeError(&quot;Multiple values for argument %s.&quot; % repr(name))
			setattr(self, name, value)

	&amp;hellip;

	def __repr__(self):
		return '%s %s&gt;' % (
			self.__class__.__name__,
			&quot; &quot;.join(
				&quot;%s:%s&quot; % (
					property.item_name,
					repr(self[property.item_name])
				)
				for name, property in self._ordered_properties
			)
		)&lt;/pre&gt;
&lt;p&gt;Now we can make a cow model with positional and keyword arguments, and print it out nice and fancy-like:&lt;/p&gt;

&lt;pre&gt;
&amp;gt;&amp;gt;&amp;gt; Cow(0, name = 'Moolius')
&amp;lt;Cow id:0 name:&quot;Moolius&quot;&amp;gt;&lt;/pre&gt;
&lt;p&gt;The next step is to introduce &lt;tt&gt;ForeignKey&lt;/tt&gt; model properties.  These are properties that will refer, via a relation on a primary key, to an object in another model.  So, the &lt;tt&gt;ForeignKey&lt;/tt&gt; class will accept a &lt;tt&gt;Model&lt;/tt&gt; for the foreign model.  Its dub method will override the &lt;tt&gt;item_name&lt;/tt&gt; (preserving the &lt;tt&gt;attr_name&lt;/tt&gt;) provided by it's super-class's &lt;tt&gt;dub&lt;/tt&gt; method.  The new &lt;tt&gt;item_name&lt;/tt&gt; with be the &lt;tt&gt;attr_name&lt;/tt&gt; and the name of the primary key from the foreign table, delimited by an underbar.  This will let the foreign key property hide the fact that it does not contain a direct reference to the foreign object; it just keeps the foreign object's primary key.  However, if you access the foreign key property on a model instance, it will go off and diligently fetch the corresponding model instance.  If you assign to the foreign key property, it'll tolerate either a primary key or an actual instance.&lt;/p&gt;

&lt;pre&gt;
class ForeignKey(ModelProperty):
	def __init__(self, model, *args, **kws):
		super(ForeignKey, self).__init__(*args, **kws)
		self.foreign_model = model
	def __get__(self, objekt, klass):
		return self.foreign_model.objects.get(objekt[self.item_name])
	def __set__(self, objekt, value):
		if isinstance(value, self.foreign_model):
			objekt[self.item_name] = value.pk
		else:
			objekt[self.item_name] = value
	def dub(self, name):
		super(ForeignKey, self).dub(name)
		self.item_name = '%s_%s' % (
			name,
			self.foreign_model._pk_name,
		)&lt;/pre&gt;
&lt;p&gt;Now we can write code with more than one model using relationships.  Let's give our cow a bell.&lt;/p&gt;

&lt;pre&gt;
class Bell(Model):
	id = PrimaryKey()

class Cow(Model):
	id = PrimaryKey()
	name = ModelProperty()
	bell = ForeignKey(Bell)

bell = Bell(0)
bell.save()
cow = Cow(0, 'Moolius', bell)
cow.save()&lt;/pre&gt;
&lt;p&gt;Note that you must &lt;tt&gt;save&lt;/tt&gt; the bell so that when you construct the cow, it can fetch the bell from &lt;tt&gt;Bell.objects&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;There's more to Django's ORM, of course.  This article doesn't cover parsing and validation, which are both assisted by the ORM.  Nor does it cover queries, query sets, the &lt;tt&gt;related_name&lt;/tt&gt; for &lt;tt&gt;ForeignKey&lt;/tt&gt; properties on foreign models, Django's ability to use strings for forward references to models that have not yet been declared, or many of the other really neat features.&lt;/p&gt;
&lt;p&gt;What this article does cover though, is that you can create a powerful abstraction of a proxied database with pure-Python in less than 200 lines of code.  This means that you could create a light-weight proxy over HTTP to a Django database that exposes itself with a REST API.  You could also create an abstraction layer that would allow you to pump Django ORM duck-types back into Django to use pure Python objects in addition to or in stead of a database backend.&lt;/p&gt;
&lt;p&gt;But, if this article does nothing else, I hope it communicates that Django is cool.  I have read a whole lot of code from every dark corner of the web and I have liked very little of it; people I've worked with will testify that I've regularly &quot;hated on&quot; every library or framework I've ever seen.  I've never met &lt;a href=&quot;http://simonwillison.net/&quot;&gt;Simon Willson&lt;/a&gt; and the growing developer community around Django.  However, I've read their code and now I can tell you, over the course of several articles, that they're really smart and you should use their &lt;a href=&quot;http://www.djangoproject.com/&quot;&gt;code&lt;/a&gt;.&lt;/p&gt;</content>
		<author>
			<name>&quot;The Sourcerer&quot;, Kris Kowal's Blog</name>
			<uri>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi</uri>
		</author>
		<source>
			<title type="html">The Sourcerer</title>
			<subtitle type="html">by Kris Kowal</subtitle>
			<link rel="self" href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2"/>
			<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2</id>
			<updated>2008-10-07T05:17:11+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">The new user switching applet in Ubuntu 8.10 feels a little bit awkward, but it packs in lots of functionality. I think I like it.</title>
		<link href="http://segphault.jaiku.com/presence/45969295"/>
		<id>tag:jaiku.com,2008-10-03:/presence/45969295</id>
		<updated>2008-10-03T19:29:20+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    The new user switching applet in Ubuntu 8.10 feels a little bit awkward, but it packs in lots of functionality. I think I like it.                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     2 days, 9 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">Everybody seems to think that the Ubuntu Dust theme is awesome, but I'm not really seeing the appeal. I &amp;lt;3 GNOME-Colors: http://is.gd/3u99</title>
		<link href="http://segphault.jaiku.com/presence/45963344"/>
		<id>tag:jaiku.com,2008-10-03:/presence/45963344</id>
		<updated>2008-10-03T17:27:39+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    Everybody seems to think that the Ubuntu Dust theme is awesome, but I'm not really seeing the appeal. I &amp;lt;3 GNOME-Colors: http://is.gd/3u99                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     2 days, 11 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">It looks like AOL's instant messaging servers are messed up right now. If you need to chat, I'm still on GTalk and IRC.</title>
		<link href="http://segphault.jaiku.com/presence/45928962"/>
		<id>tag:jaiku.com,2008-10-03:/presence/45928962</id>
		<updated>2008-10-03T07:17:08+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    It looks like AOL's instant messaging servers are messed up right now. If you need to chat, I'm still on GTalk and IRC.                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     2 days, 22 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">Norwegian standards body implodes over OOXML controversy</title>
		<link href="http://arstechnica.com/news.ars/post/20081003-norwegian-standards-body-implodes-over-ooxml-controversy.html"/>
		<id>http://arstechnica.com/news.ars/post/20081003-norwegian-standards-body-implodes-over-ooxml-controversy.html</id>
		<updated>2008-10-03T07:00:00+00:00</updated>
		<content type="html">Norway's national standards body lost 13 key members last week. The technical committee members resigned in protest of procedural irregularities in the OOXML approval process.</content>
		<author>
			<name>Ryan Paul's Articles</name>
			<uri>http://cixar.com/~segphault/articles</uri>
		</author>
		<source>
			<title type="html">Ryan's Articles</title>
			<subtitle type="html">Ryan's Articles</subtitle>
			<link rel="self" href="http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true"/>
			<id>http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true</id>
			<updated>2008-10-07T05:17:06+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Python language slithers into the future with 2.6 release</title>
		<link href="http://arstechnica.com/news.ars/post/20081003-python-slithers-into-the-future-with-2-6-release.html"/>
		<id>http://arstechnica.com/news.ars/post/20081003-python-slithers-into-the-future-with-2-6-release.html</id>
		<updated>2008-10-03T07:00:00+00:00</updated>
		<content type="html">Developers of the open source Python programming language have announced the official release of version 2.6. This version makes a nice stepping stone, helping third-party developers migrate their code to the upcoming 3.0 release.</content>
		<author>
			<name>Ryan Paul's Articles</name>
			<uri>http://cixar.com/~segphault/articles</uri>
		</author>
		<source>
			<title type="html">Ryan's Articles</title>
			<subtitle type="html">Ryan's Articles</subtitle>
			<link rel="self" href="http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true"/>
			<id>http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true</id>
			<updated>2008-10-07T05:17:06+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">I'm not really enthusiastic about Fedora's new Echo icon theme. I wish that distros would all just conform with the Tango palette and style.</title>
		<link href="http://segphault.jaiku.com/presence/45896952"/>
		<id>tag:jaiku.com,2008-10-02:/presence/45896952</id>
		<updated>2008-10-02T21:23:34+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    I'm not really enthusiastic about Fedora's new Echo icon theme. I wish that distros would all just conform with the Tango palette and style.                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     3 days, 7 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">There are some cool things in Fedora 10. I like Plymouth, the new graphical boot system. Also, glitch-free PulseAudio FTW!</title>
		<link href="http://segphault.jaiku.com/presence/45896942"/>
		<id>tag:jaiku.com,2008-10-02:/presence/45896942</id>
		<updated>2008-10-02T21:22:26+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    There are some cool things in Fedora 10. I like Plymouth, the new graphical boot system. Also, glitch-free PulseAudio FTW!                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     3 days, 7 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">This overview of the iPhone SDK is one of the best technical articles on Ars in recent memory: http://is.gd/3q6k</title>
		<link href="http://segphault.jaiku.com/presence/45892115"/>
		<id>tag:jaiku.com,2008-10-02:/presence/45892115</id>
		<updated>2008-10-02T19:44:29+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    This overview of the iPhone SDK is one of the best technical articles on Ars in recent memory: http://is.gd/3q6k                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     3 days, 9 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">Ugh. This bug really sucks: http://is.gd/3rsl Now I have to install the craptastic VMWare server so I can test Fedora 10. :-(</title>
		<link href="http://segphault.jaiku.com/presence/45891426"/>
		<id>tag:jaiku.com,2008-10-02:/presence/45891426</id>
		<updated>2008-10-02T19:26:27+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    Ugh. This bug really sucks: http://is.gd/3rsl Now I have to install the craptastic VMWare server so I can test Fedora 10. :-(                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     3 days, 9 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">I can't seem to get the Fedora 10 beta to boot in VirtualBox. :-(</title>
		<link href="http://segphault.jaiku.com/presence/45890820"/>
		<id>tag:jaiku.com,2008-10-02:/presence/45890820</id>
		<updated>2008-10-02T19:18:18+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    I can't seem to get the Fedora 10 beta to boot in VirtualBox. :-(                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     3 days, 9 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Ordered Properties - The Python Saga - Part 5</title>
		<link href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/program/python/ordered-properties"/>
		<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/program/python/ordered-properties</id>
		<updated>2008-10-02T03:38:42+00:00</updated>
		<content type="html">&lt;p&gt;In C and SQL, structs and records have properties that appear in a particular order.  In Python, objects use hash-tables to store their attributes, so the order is not deterministic nor relevant.  That's no consolation if you're trying to model C structs or SQL tables in Python though.  Reading though the Django code, I discovered that those wily coders had synthesized a technique that combines the virtues of properties and metaclasses that we can generally model the order in which fields of a struct or SQL table appear.&lt;/p&gt;
&lt;p&gt;The trick is to provide an API that allows your users to write code like:&lt;/p&gt;

&lt;pre&gt;
from time import gmtime
from cstruct import Struct, IntegerProperty

class EpochTime(Struct):
	seconds = IntegerProperty()
	microseconds = IntegerProperty()

epoch_time = EpochTime()
timestruct = gmtime(epoch_time.seconds)&lt;/pre&gt;
&lt;p&gt;In this case, the &lt;tt&gt;Struct&lt;/tt&gt; type cares about the size, order, and disposition of the C structure it models so that it can unpack a byte buffer presumably retrieved from a C-type library.&lt;/p&gt;
&lt;p&gt;There are two components to the general solution.  First, there's an &lt;tt&gt;OrderedProperty&lt;/tt&gt; base type.  Ordered properties track the order in which they were initialized.  For this purpose, ordered properties use a global counter.  The absolute value of a property's creation counter is irrelevant.  The only requirement is that they monotonically increase as each property is declared, and that classes declared concurrently do not interfere.&lt;/p&gt;

&lt;pre&gt;
from itertools import count
next_counter = count().next&lt;/pre&gt;
&lt;p&gt;I learned about &lt;tt&gt;itertools&lt;/tt&gt; from &lt;a href=&quot;http://sayspy.blogspot.com/&quot;&gt;Brett Cannon&lt;/a&gt; who was preparing his thesis defense when I was at &lt;a href=&quot;http://http://www.calpoly.edu/&quot;&gt;Cal Poly&lt;/a&gt;.  In another piece of code, which I would cite if I could recall, I learned the trick of using the &lt;tt&gt;itertools.count&lt;/tt&gt; function to atomize a global counter.  It takes advantage of Python's dubious global interpreter lock.&lt;/p&gt;
&lt;p&gt;Then the &lt;tt&gt;OrderedProperty&lt;/tt&gt; base type just stores a creation counter upon initialization.  Keep in mind that all derived types must trickle their &lt;tt&gt;__init__&lt;/tt&gt; call&amp;mdash;your base types are not always what they seem and there are use cases you can not foresee where you might be required to receive and pass your initialization arguments to an unknown super-type.  That's a side-effect of working in a language with mix-ins, and it's a &quot;good thing&quot;.&lt;/p&gt;

&lt;pre&gt;
class OrderedProperty(object):
	def __init__(self, *args, **kws):
		self._creation_counter = next_counter()
		super(OrderedProperty, self).__init__(*args, **kws)&lt;/pre&gt;
&lt;p&gt;The next part of the puzzle is inspecting your property order.  We use a metaclass to note when new types are created and we give them an &lt;tt&gt;_ordered_properties&lt;/tt&gt; attribute with the ordered-property items in their attributes.  Keep in mind that base types might have properties too.  &lt;tt&gt;__mro__&lt;/tt&gt; is an attribute of all classes that is a linearized list of a classes inheritance hierarchy.  It's effectively the result of a dynamic topological sort algorithm for the closure of your base types.  We traverse it backwards so that if you create a dictionary via &lt;tt&gt;dict(_ordered_properties)&lt;/tt&gt;, name collisions are resolved chronologically.&lt;/p&gt;

&lt;pre&gt;
class OrderedMetaclass(type):
	def __init__(self, name, bases, attys):
		super(OrderedMetaclass, self).__init__(name, bases, attys)
		self._ordered_properties = sorted(
			(
				(name, value)
				for base in reversed(self.__mro__)
				for name, value in base.__dict__.items()
				if isinstance(value, OrderedProperty)
			),
			key = lambda (name, property): property._creation_counter,
		)&lt;/pre&gt;
&lt;p&gt;Then, we create our &lt;tt&gt;OrderedClass&lt;/tt&gt; that we can inherit to get free &lt;tt&gt;_ordered_properties&lt;/tt&gt; attributes.&lt;/p&gt;

&lt;pre&gt;
class OrderedClass(object):
	__metaclass__ = OrderedMetaclass&lt;/pre&gt;
&lt;p&gt;Let's see it in action:&lt;/p&gt;

&lt;pre&gt;
class Foo(OrderedClass):
	bar = OrderedProperty()
	baz = OrderedProperty()
Foo._ordered_properties == [
	('bar', &amp;lt;Ordered Property instance somewhere&amp;gt;),
	('baz', &amp;lt;Ordered Property instance somewhere&amp;gt;),
]&lt;/pre&gt;
&lt;p&gt;With a small modification, we can track ordered inner classes too.&lt;/p&gt;

&lt;pre&gt;
class OrderedMetaclass(type):
	def __init__(self, name, bases, attys):
		super(OrderedMetaclass, self).__init__(name, bases, attys)
		self._creation_counter = next_counter()
		self._ordered_properties = sorted(
			(
				(name, value)
				for base in reversed(self.__mro__)
				for name, value in base.__dict__.items()
				if isinstance(value, OrderedProperty)
				or isinstance(value, OrderedMetaclass)
			),
			key = lambda (name, property): property._creation_counter,
		)&lt;/pre&gt;
&lt;p&gt;So, we put all of those order classes in our generic ordered properties module.  Now we can delve into our particular &lt;tt&gt;Struct&lt;/tt&gt; example.&lt;/p&gt;
&lt;p&gt;First, we need field types.  We will need a base type and derivative types for all of the field types we want to model from C, like &lt;tt&gt;IntegerField&lt;/tt&gt;.  Bear in mind that &lt;tt&gt;OrderedProperty&lt;/tt&gt; is just a mix-in; it doesn't actually define &lt;tt&gt;__get__&lt;/tt&gt; and its ilk because those are all specific to the derivative implementation.  All struct fields are going to store their actual values in a special &lt;tt&gt;_value&lt;/tt&gt; dictionary on their corresponding &lt;tt&gt;Struct&lt;/tt&gt; instance.&lt;/p&gt;

&lt;pre&gt;
class StructProperty(OrderedProperty):
	def __get__(self, objekt, klass):
		return objekt._values[self.name]
	def __set__(self, objekt, value):
		objekt._values[self.name] = value
	def dub(self, name):
		self.name = name
		return self&lt;/pre&gt;
&lt;p&gt;You'll notice that instances of &lt;tt&gt;StructProperty&lt;/tt&gt; need to know their &lt;tt&gt;name&lt;/tt&gt;, the key in their corresponding instance's &lt;tt&gt;_values&lt;/tt&gt; dictionary.  The struct property instances don't get this from their initializer.  Instead, each property will get &quot;dubbed&quot;, given a name, when the &lt;tt&gt;StructMetaclass&lt;/tt&gt; visits its &lt;tt&gt;_ordered_properties&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;Let's just look at an integer.&lt;/p&gt;

&lt;pre&gt;
class IntegerProperty(StructProperty):
	_format = 'i'&lt;/pre&gt;
&lt;p&gt;The only thing special about an integer is that it's format specifier for the &lt;tt&gt;pack&lt;/tt&gt; routine is &quot;i&quot;.&lt;/p&gt;
&lt;p&gt;We're going to want to use a metaclass again, this time inheriting from our &lt;tt&gt;OrderedMetaclass&lt;/tt&gt;.  The purpose of this metaclass will be to analyze the ordered properties, construct an aggregate format specifier for &lt;tt&gt;pack&lt;/tt&gt; and &lt;tt&gt;unpack&lt;/tt&gt; methods, and to &lt;tt&gt;dub&lt;/tt&gt; each of its properties with their name.&lt;/p&gt;

&lt;pre&gt;
class StructMetaclass(OrderedMetaclass):
	def __init__(self, name, bases, attys):
		super(StructMetaclass, self).__init__(name, bases, attys)
		for name, property in self._ordered_properties:
			property.dub(name)
		self._format = &quot;&quot;.join(
			property._format
			for name, property in self._ordered_properties
		)&lt;/pre&gt;
&lt;p&gt;All that remains is to create our API base class, &lt;tt&gt;Struct&lt;/tt&gt;.  This class initializes its values and declares its metaclass.&lt;/p&gt;

&lt;pre&gt;
from struct import unpack

class Struct(OrderedClass):
	__metaclass__ = StructMetaclass

	def __init__(self, *args, **kws):
		super(Struct, self).__init__(*args, **kws)
		self._values = {}

	def unpack(self, value, prefix = None):
		if prefix is None: prefix = &quot;&quot;
		for (name, property), value in zip(
			self._ordered_properties,
			unpack(prefix + self._format, value)
		):
			self._values[name] = value&lt;/pre&gt;
&lt;p&gt;So, now our epoch time example is possible using &lt;tt&gt;Struct&lt;/tt&gt; and &lt;tt&gt;IntegerProperty&lt;/tt&gt;, completely oblivious to the machinations behind the scenes.&lt;/p&gt;

&lt;pre&gt;
from time import gmtime
from datetime import datetime

class EpochTime(Struct):
	seconds = IntegerProperty()
	microseconds = IntegerProperty()
epoch_time = EpochTime()

timestruct = gmtime(epoch_time.seconds)
datestruct = (timestruct[:6] + (epoch_time.microseconds,))
print datetime(*datestruct)&lt;/pre&gt;</content>
		<author>
			<name>&quot;The Sourcerer&quot;, Kris Kowal's Blog</name>
			<uri>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi</uri>
		</author>
		<source>
			<title type="html">The Sourcerer</title>
			<subtitle type="html">by Kris Kowal</subtitle>
			<link rel="self" href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2"/>
			<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2</id>
			<updated>2008-10-07T05:17:11+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Duct tape and paperclips. I'd be totally lost without them.</title>
		<link href="http://segphault.jaiku.com/presence/45836898"/>
		<id>tag:jaiku.com,2008-10-02:/presence/45836898</id>
		<updated>2008-10-02T02:47:37+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    Duct tape and paperclips. I'd be totally lost without them.                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     4 days, 2 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">Wow. My monitor just came back to life. The source button was stuck. I got it loose with a paperclip.</title>
		<link href="http://segphault.jaiku.com/presence/45836546"/>
		<id>tag:jaiku.com,2008-10-02:/presence/45836546</id>
		<updated>2008-10-02T02:40:45+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    Wow. My monitor just came back to life. The source button was stuck. I got it loose with a paperclip.                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     4 days, 2 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">One of my monitors died yesterday. I'm starting to feel a little bit of claustrophobia. I think I need to get a new one.</title>
		<link href="http://segphault.jaiku.com/presence/45831519"/>
		<id>tag:jaiku.com,2008-10-02:/presence/45831519</id>
		<updated>2008-10-02T00:59:41+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    One of my monitors died yesterday. I'm starting to feel a little bit of claustrophobia. I think I need to get a new one.                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     4 days, 4 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">The GNU Netcat -- Official homepage</title>
		<link href="http://netcat.sourceforge.net/"/>
		<id>http://netcat.sourceforge.net/</id>
		<updated>2008-10-01T23:21:54+00:00</updated>
		<content type="html">Netcat has a build flag called -DGAPING_SECURITY_FLAG that permits you to run &amp;quot;nc&amp;quot; with the &amp;quot;-e&amp;quot; arg which permits the first person to connect to your server to run the specified command, albeit a shell.  Anybody else know some bizarrely communicative flags?  I figure that GCC at least should, in addition to &amp;quot;-ansi&amp;quot; and &amp;quot;-pedantic&amp;quot;, accept &amp;quot;-yesimeanit&amp;quot; for particularly strong compliance, like only features that are available in both VisualC++ and G++, that admittedly would make the language completely useless.</content>
		<author>
			<name>Kris Kowal's Del.icio.us Bookmarks</name>
			<uri>http://delicious.com/kris.kowal</uri>
		</author>
		<source>
			<title type="html">Delicious/kris.kowal</title>
			<subtitle type="html">bookmarks posted by kris.kowal</subtitle>
			<link rel="self" href="http://feeds.delicious.com/rss/kris.kowal"/>
			<id>http://feeds.delicious.com/rss/kris.kowal</id>
			<updated>2008-10-07T01:17:15+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">GIMP 2.6 is the first release to include GEGL! Congratulations to the GIMP developers! :-)</title>
		<link href="http://segphault.jaiku.com/presence/45815936"/>
		<id>tag:jaiku.com,2008-10-01:/presence/45815936</id>
		<updated>2008-10-01T20:08:55+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    GIMP 2.6 is the first release to include GEGL! Congratulations to the GIMP developers! :-)                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     4 days, 9 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">GIMP 2.6 released, one step closer to taking on Photoshop</title>
		<link href="http://arstechnica.com/news.ars/post/20081001-gimp-2-6-released-one-step-closer-to-taking-on-photoshop.html"/>
		<id>http://arstechnica.com/news.ars/post/20081001-gimp-2-6-released-one-step-closer-to-taking-on-photoshop.html</id>
		<updated>2008-10-01T07:00:00+00:00</updated>
		<content type="html">GIMP 2.6 has been officially released. The new version is the first to include the Generic Graphics Library, a powerful graph-based image editing framework that enables the GIMP to support higher color depth. This takes the open source graphics program one step closer to being ready for the professional graphics market.</content>
		<author>
			<name>Ryan Paul's Articles</name>
			<uri>http://cixar.com/~segphault/articles</uri>
		</author>
		<source>
			<title type="html">Ryan's Articles</title>
			<subtitle type="html">Ryan's Articles</subtitle>
			<link rel="self" href="http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true"/>
			<id>http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true</id>
			<updated>2008-10-07T05:17:06+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">&quot;Orphan Works&quot; copyright reform fails in wake of bailout bid</title>
		<link href="http://arstechnica.com/news.ars/post/20081001-orphan-works-copyright-reform-fails-in-wake-of-bailout-bid.html"/>
		<id>http://arstechnica.com/news.ars/post/20081001-orphan-works-copyright-reform-fails-in-wake-of-bailout-bid.html</id>
		<updated>2008-10-01T07:00:00+00:00</updated>
		<content type="html">The Orphan Works Act of 2008 was passed by the Senate after &quot;diligent search&quot; was clarified with a handful of specific guidelines. With the controversy over the $700 billion economic bailout package, House failed to act upon it, making its prospects for passage dim this year.</content>
		<author>
			<name>Ryan Paul's Articles</name>
			<uri>http://cixar.com/~segphault/articles</uri>
		</author>
		<source>
			<title type="html">Ryan's Articles</title>
			<subtitle type="html">Ryan's Articles</subtitle>
			<link rel="self" href="http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true"/>
			<id>http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true</id>
			<updated>2008-10-07T05:17:06+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Metaclasses - The Python Saga - Part 4</title>
		<link href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/program/python/metaclasses"/>
		<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/program/python/metaclasses</id>
		<updated>2008-10-01T05:45:45+00:00</updated>
		<content type="html">&lt;p&gt;The original &lt;tt&gt;type&lt;/tt&gt; function, whose behavior is preserved in modern Python 2.5, accepts an object and returns the class, albeit the type, that would emit it.  It's like the &lt;tt&gt;typeof&lt;/tt&gt; operator in JavaScript that returns the String name of the primitive type of an object, or the C++ function that returns a pointer to an object's virtual function table.  They're all sufficient for comparing apples to oranges, but all of them are also insufficient for the more interesting comparison of apples to the idea of a Fiji apple: the question, &quot;Does your type inherit from this?&quot;, that can be accomplished with Python's &lt;tt&gt;isinstance&lt;/tt&gt;, JavaScript's &lt;tt&gt;instanceof&lt;/tt&gt;, or C++'s infernal &lt;tt&gt;dynamic_cast&lt;/tt&gt;.  So, &lt;tt&gt;type&lt;/tt&gt;'s single argument behavior is effectively retired.&lt;/p&gt;
&lt;p&gt;At some transcendental moment, somebody deeply involved in the Python project must have been thinking, &quot;Well, if functions and classes return objects, what returns a class?  Could a class, like a property, be syntactic sugar for some deeply metaphysical latent behavior in pure Python?&quot;.  I figure this is how the &lt;tt&gt;type&lt;/tt&gt; function grew its new wings.&lt;/p&gt;
&lt;p&gt;So consider a class declaration:&lt;/p&gt;

&lt;pre&gt;
class Foo(object):
	bar = 10
	def __init__(self, bar = None):
		if bar is not None:
			self.bar = bar&lt;/pre&gt;
&lt;p&gt;This is what is actually happening behind the curtains:&lt;/p&gt;

&lt;pre&gt;
name = 'Foo'
bases = (object,)
def __init__(self, bar = None):
	if bar is not None:
		self.bar = bar
attys = {'bar': bar, '__init__': __init__}
Foo = type(name, bases, attys)&lt;/pre&gt;
&lt;p&gt;That is to say, there is no magic in the syntax.  Ultimately all of the magic happens when you call &lt;tt&gt;type&lt;/tt&gt;.  By &quot;magic&quot; I mean functionality that cannot be replicated in pure Python without the interpreter's intervention.&lt;/p&gt;
&lt;p&gt;The &lt;tt&gt;type&lt;/tt&gt; function returns a type: a function that returns new instances.  It's also called a &quot;metaclass&quot;.  &lt;tt&gt;type&lt;/tt&gt; just happens to also be the implied metaclass of &lt;tt&gt;object&lt;/tt&gt;.  That is to say, you can create your own metaclasses.&lt;/p&gt;
&lt;p&gt;The big question about metaclasses is, &quot;Why on earth would you want to define a metaclass?&quot;.  David Mertz from IBM wrote that you would simply know when you needed them.  Since I read that article, I've wracked my mind for a reason to use metaclasses to no avail.  At some point, I was reading Django's ORM code and it occurred to me that the reason you would want to define a metaclass is to provide a class in your API that, when subclassed by unsuspecting users, would invoke certain preparations without their knowledge or consent.  Here's how:&lt;/p&gt;
&lt;p&gt;Define a metaclass.  The best way to define a metaclass is to inherit &lt;tt&gt;type&lt;/tt&gt; and override its &lt;tt&gt;__init__&lt;/tt&gt; method.&lt;/p&gt;

&lt;pre&gt;
class FooType(type):
	def __init__(self, name, bases, attys):
		super(FooType, self).__init__(name, bases, attys)
		print '%s was declared!' % name&lt;/pre&gt;
&lt;p&gt;Define a base class for your API.  The trick here is that you can override its metaclass.  Let's look at this one in an interactive interpreter:&lt;/p&gt;

&lt;pre&gt;
&amp;gt;&amp;gt;&amp;gt; class Foo(object):
...     __metaclass__ = FooType
...
Foo was declared!
&amp;gt;&amp;gt;&amp;gt;&lt;/pre&gt;
&lt;p&gt;Whoa!  You didn't call anything.  Not true.  Here's what actually happened:&lt;/p&gt;

&lt;pre&gt;
name = 'Foo'
bases = (object,)
attys = {}
attys['__metaclass__'] = FooType
Foo = attys.get('__metaclass__', type)(name, bases, attys)&lt;/pre&gt;
&lt;p&gt;Python checks your attributes for a metaclass before defaulting to &lt;tt&gt;type&lt;/tt&gt;.&lt;/p&gt;
&lt;p&gt;That means that your &lt;tt&gt;FooType.__init__&lt;/tt&gt; got called.  Hot damn.  I wonder what happens if you create a subclass.&lt;/p&gt;

&lt;pre&gt;
&amp;gt;&amp;gt;&amp;gt; class Bar(Foo):
...     pass
...
Bar was declared!
&amp;gt;&amp;gt;&amp;gt;&lt;/pre&gt;
&lt;p&gt;Whoa!  I totally inherited a metaclass.&lt;/p&gt;
&lt;p&gt;So, the reason for writing a metaclass is that metaclasses give you an opportunity to get and manipulate your derived class objects before anyone instantiates them.  You get to do this once, right after the class dictionary is fully populated.  You can take this opportunity to monitor class declarations, to prepare additional attributes, or to interpolate additional base types.&lt;/p&gt;


&lt;hr /&gt;
&lt;p&gt;Keep in mind that metaclasses are jealous.  If you create a metaclass for a type that inherits from base classes in someone else's API, your metaclass must inherit from their metaclass.  I suspect that it's best not to assume that your base types use a particular metaclass.  Thankfully, you can use an expression for your base type.&lt;/p&gt;

&lt;pre&gt;
class FooType(getattr(Bar, '__metaclass__', type)):
	pass
class Foo(Bar):
	__metaclass__ = FooType&lt;/pre&gt;
&lt;p&gt;This takes advantage of the Python idiom of accessor methods like &lt;tt&gt;dict.get&lt;/tt&gt; and &lt;tt&gt;getattr&lt;/tt&gt; that accept a default-if-none-exists argument.  Unfortunately, Python's &lt;tt&gt;object&lt;/tt&gt; doesn't explicitly state that &lt;tt&gt;type&lt;/tt&gt; is its metaclass.  Otherwise, you could safely say:&lt;/p&gt;

&lt;pre&gt;
class FooType(Bar.__metaclass__):
	pass&lt;/pre&gt;
&lt;p&gt;Such things are to be looked for in Python 3.  I find that the Python developers have either, after considerable review and debate, already accepted or rejected most of my ideas before I even consider them, so I'm not even going to check for a PEP on this one.&lt;/p&gt;</content>
		<author>
			<name>&quot;The Sourcerer&quot;, Kris Kowal's Blog</name>
			<uri>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi</uri>
		</author>
		<source>
			<title type="html">The Sourcerer</title>
			<subtitle type="html">by Kris Kowal</subtitle>
			<link rel="self" href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2"/>
			<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2</id>
			<updated>2008-10-07T05:17:11+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">HELLO, I’M FAMOUS STARRING JOHN HODGMAN: GQ Features on men.style.com</title>
		<link href="http://men.style.com/gq/features/landing?id=content_7464"/>
		<id>http://men.style.com/gq/features/landing?id=content_7464</id>
		<updated>2008-10-01T05:04:31+00:00</updated>
		<content type="html">This article made me LLOL a couple times (*literally* laughed out loud.  I was alone, so I know it was sincere).  It also made me want to cry a little, and made me wish that I could be John Hodgman&amp;#039;s long-time-friend who could always tell him when he made mistakes or looked stupid.  But then I remembered that he had Johnathan Coulton for that, so I didn&amp;#039;t feel bad anymore.</content>
		<author>
			<name>Kris Kowal's Del.icio.us Bookmarks</name>
			<uri>http://delicious.com/kris.kowal</uri>
		</author>
		<source>
			<title type="html">Delicious/kris.kowal</title>
			<subtitle type="html">bookmarks posted by kris.kowal</subtitle>
			<link rel="self" href="http://feeds.delicious.com/rss/kris.kowal"/>
			<id>http://feeds.delicious.com/rss/kris.kowal</id>
			<updated>2008-10-07T01:17:15+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">I appreciate the feedback. Thanks for the responses!</title>
		<link href="http://segphault.jaiku.com/presence/45755426"/>
		<id>tag:jaiku.com,2008-10-01:/presence/45755426</id>
		<updated>2008-10-01T01:24:20+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    I appreciate the feedback. Thanks for the responses!                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     5 days, 3 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">My technical Linux coverage at Ars has mostly been for app developers who want platform insight, particularly in mobile. Is that good?</title>
		<link href="http://segphault.jaiku.com/presence/45754791"/>
		<id>tag:jaiku.com,2008-10-01:/presence/45754791</id>
		<updated>2008-10-01T01:10:28+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    My technical Linux coverage at Ars has mostly been for app developers who want platform insight, particularly in mobile. Is that good?                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     5 days, 4 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">A quick Twitter poll: how many Ars readers out there want to see more kernel coverage rather than higher-level coverage for Linux stuff?</title>
		<link href="http://segphault.jaiku.com/presence/45754782"/>
		<id>tag:jaiku.com,2008-10-01:/presence/45754782</id>
		<updated>2008-10-01T01:08:56+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    A quick Twitter poll: how many Ars readers out there want to see more kernel coverage rather than higher-level coverage for Linux stuff?                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     5 days, 4 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">Thanks everyone, for the positive comments about my cloud computing article! :-)</title>
		<link href="http://segphault.jaiku.com/presence/45733500"/>
		<id>tag:jaiku.com,2008-09-30:/presence/45733500</id>
		<updated>2008-09-30T18:39:03+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    Thanks everyone, for the positive comments about my cloud computing article! :-)                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     5 days, 10 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">Check out this awesome Qt demo with custom SVG/CSS widgets designed for touchscreen interaction: http://is.gd/3l75</title>
		<link href="http://segphault.jaiku.com/presence/45733112"/>
		<id>tag:jaiku.com,2008-09-30:/presence/45733112</id>
		<updated>2008-09-30T18:25:30+00:00</updated>
		<content type="html">&lt;div&gt;
                &lt;p&gt;
                    
                    Check out this awesome Qt demo with custom SVG/CSS widgets designed for touchscreen interaction: http://is.gd/3l75                &lt;/p&gt;
                &lt;p&gt;
            	                	        By &lt;a href=&quot;http://segphault.jaiku.com&quot; class=&quot;url&quot;&gt;segphault&lt;/a&gt;
            	                		     5 days, 10 hours ago.
                &lt;/p&gt;
            &lt;/div&gt;</content>
		<author>
			<name>Ryan Paul</name>
			<uri>http://segphault.jaiku.com</uri>
		</author>
		<source>
			<title type="html">Jaiku | Latest from segphault</title>
			<subtitle type="html">&lt;div id=&quot;header&quot;&gt;    
        &lt;a href=&quot;http://www.jaiku.com/&quot; id=&quot;logo&quot;&gt;
            &lt;img src=&quot;http://www.jaiku.com/static/logo.gif&quot; alt=&quot;Jaiku&quot; /&gt;
        &lt;/a&gt;
    &lt;/div&gt;
    &lt;div id=&quot;content&quot;&gt;
        &lt;h1&gt;
          Setting up our nest in a new datacenter, after finding an issue with
          a server on Friday. Sorry for the inconvenience. We're working to get
          back online soon.
        &lt;/h1&gt;
    &lt;/div&gt;</subtitle>
			<link rel="self" href="http://segphault.jaiku.com/feed/atom"/>
			<id>tag:jaiku.com,2008-10-06:/</id>
			<updated>2008-10-06T06:17:13+00:00</updated>
			<rights type="html">Copyright 2006 Jaiku</rights>
		</source>
	</entry>

	<entry>
		<title type="html">Commentary: Bankruptcy, not bailout, is the right answer - CNN.com</title>
		<link href="http://www.cnn.com/2008/POLITICS/09/29/miron.bailout/index.html"/>
		<id>http://www.cnn.com/2008/POLITICS/09/29/miron.bailout/index.html</id>
		<updated>2008-09-30T10:36:18+00:00</updated>
		<content type="html">Jeff Miron on the bailout plan.</content>
		<author>
			<name>Ryan Witt's Del.ico.us Bookmarks</name>
			<uri>http://delicious.com/ryan.witt</uri>
		</author>
		<source>
			<title type="html">Delicious/ryan.witt</title>
			<subtitle type="html">bookmarks posted by ryan.witt</subtitle>
			<link rel="self" href="http://feeds.delicious.com/rss/ryan.witt"/>
			<id>http://feeds.delicious.com/rss/ryan.witt</id>
			<updated>2008-09-30T12:17:34+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Nokia launches Linux-based Qt Extended mobile platform</title>
		<link href="http://arstechnica.com/news.ars/post/20080930-nokia-launches-linux-based-qt-extended-mobile-platform.html"/>
		<id>http://arstechnica.com/news.ars/post/20080930-nokia-launches-linux-based-qt-extended-mobile-platform.html</id>
		<updated>2008-09-30T07:00:00+00:00</updated>
		<content type="html">Nokia has launched Qt Extended 4.4, a Linux-based mobile platform that leverages the Qt toolkit. Ars takes a look at some of the components of the platform and what it offers third-party application developers.</content>
		<author>
			<name>Ryan Paul's Articles</name>
			<uri>http://cixar.com/~segphault/articles</uri>
		</author>
		<source>
			<title type="html">Ryan's Articles</title>
			<subtitle type="html">Ryan's Articles</subtitle>
			<link rel="self" href="http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true"/>
			<id>http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true</id>
			<updated>2008-10-07T05:17:06+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Why Stallman is wrong when he calls cloud computing stupid</title>
		<link href="http://arstechnica.com/news.ars/post/20080930-why-stallman-is-wrong-when-he-calls-cloud-computing-stupid.html"/>
		<id>http://arstechnica.com/news.ars/post/20080930-why-stallman-is-wrong-when-he-calls-cloud-computing-stupid.html</id>
		<updated>2008-09-30T07:00:00+00:00</updated>
		<content type="html">Richard Stallman, one of the fathers of the software freedom movement, has declared that cloud computing is stupid in calling for users to reject web applications. Ars tells Stallman why we think he is wrong and takes a close look at emerging initiatives that aim to bring software freedom to the web.</content>
		<author>
			<name>Ryan Paul's Articles</name>
			<uri>http://cixar.com/~segphault/articles</uri>
		</author>
		<source>
			<title type="html">Ryan's Articles</title>
			<subtitle type="html">Ryan's Articles</subtitle>
			<link rel="self" href="http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true"/>
			<id>http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true</id>
			<updated>2008-10-07T05:17:06+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Properties - The Python Saga - Part 3</title>
		<link href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/program/python/properties"/>
		<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/program/python/properties</id>
		<updated>2008-09-30T06:34:40+00:00</updated>
		<content type="html">&lt;p&gt;Properties come out of a tired programming language genesis.  In the beginning, there were structs.  The trouble with structs was that an opaque data structure could not programmatically monitor or intercept access and mutation of its member data.&lt;/p&gt;
&lt;p&gt;So that's not a big deal; we could solve the problem with classes.  The best practice to avoid programming yourself into a corner was to &lt;i&gt;never&lt;/i&gt; expose a datum; you would write accessor and mutator functions, whether you needed them at the moment or not.  Thus, as your design grew, you &lt;i&gt;could&lt;/i&gt; eventually do nice things like validation, observation, or proxying.  The trouble with this approach was that you had to write six times as much code on the off chance you'd need to extend it some day.  But it was worth it.&lt;/p&gt;
&lt;p&gt;The idea of managed properties came along eventually in various languages (Python, C#, some implementations of JavaScript, and recent versions of [C]).  The notion is that you would initially write all of your classes like structs with member data camped in public view.  You would encourage your API consumers to interact with those members directly.  Then, as need arose, you would subvert the member variables with property objects.  These objects would intercept accesses and mutations with functions that you could write at any time of your design process.&lt;/p&gt;
&lt;p&gt;Lets observe this design shift in Python.  Here's a class with unmanaged data:&lt;/p&gt;

&lt;pre&gt;
class Foo(object):
	def __init__(self);
		self.bar = 10&lt;/pre&gt;
&lt;p&gt;Here's some other fellow's code that uses your class:&lt;/p&gt;

&lt;pre&gt;
foo = Foo()
foo.bar = 20
print foo.bar
del foo.bar&lt;/pre&gt;
&lt;p&gt;So there you have it.  Just to keep on the same page, the idea at this point is to add a feature to Python that permits both of those code samples to work and, in-fact, be perfectly cromulent.  However, we also want to eventually add features to &lt;tt&gt;Foo&lt;/tt&gt; such that its &lt;tt&gt;bar&lt;/tt&gt; attribute can be managed, validated, proxied, secured, or outright lied about.  Enter &lt;tt&gt;property&lt;/tt&gt;.  &lt;tt&gt;property&lt;/tt&gt; is a function that accepts an accessor function and optional mutator and deleter functions.  The property must be a class attribute to work.  Here's how you would use a property:&lt;/p&gt;

&lt;pre&gt;
class Foo(object):
	def __init__(self):
		self.bar = 10
	def get_bar(self, objekt, klass):
		return self.baz / 2
	def set_bar(self, objekt, value):
		self.baz = value * 2
	def del_bar(self, objekt):
		del self.baz
	bar = property(get_bar, set_bar, del_bar)&lt;/pre&gt;
&lt;p&gt;Now we have a Foo class that transparently maintains the invariant that &quot;bar&quot; will always be half of &quot;baz&quot;.&lt;/p&gt;
&lt;p&gt;Sometimes you don't need to have a setter for a property, and you almost never need a deleter.  For the common case, you can use the &lt;tt&gt;property&lt;/tt&gt; function as a decorator.&lt;/p&gt;

&lt;pre&gt;
class Foo(object):
	def __init__(self):
		self.baz = 20
	@property
	def bar(self):
		return self.baz / 2&lt;/pre&gt;


&lt;h2&gt;
	Creating the &lt;tt&gt;property&lt;/tt&gt; function.
&lt;/h2&gt;
&lt;p&gt;So, it's easy to assume that the &lt;tt&gt;property&lt;/tt&gt; function does all the magic behind the scenes, setting up traps in your class's accessor and mutator paths.  There's actually another layer of code that can be done entirely in Python.  That is, we can implement the &lt;tt&gt;property&lt;/tt&gt; function in pure Python.  The trick is that the &lt;tt&gt;property&lt;/tt&gt; function is actually a type or factory method (who cares which) that returns a Python duck-type: a property object.  A property object is any object that implements &lt;tt&gt;__get__&lt;/tt&gt;, &lt;tt&gt;__set__&lt;/tt&gt;, or &lt;tt&gt;__del__&lt;/tt&gt;.  These are special magic Python functions that intercept access, mutation, and deletion on members.  All you have to do is install an object on a class with one of methods defined, with the name of the member you want to manage.  The &lt;tt&gt;property&lt;/tt&gt; function just handles the common cases.  Let's redefine the property function in Python, as the &lt;tt&gt;Property&lt;/tt&gt; class.&lt;/p&gt;

&lt;pre&gt;
class Property(object):
	def __init__(self, fget):
		self.fget = fget
	def __get__(self, objekt, klass):
		return self.fget(objekt)&lt;/pre&gt;
&lt;p&gt;This defines enough of the &lt;tt&gt;Property&lt;/tt&gt; object to decorate an accessor function.&lt;/p&gt;

&lt;pre&gt;
class Foo(object):
	def __init__(self):
		self.baz = 20
	@Property
	def bar(self):
		return self.baz / 2&lt;/pre&gt;
&lt;p&gt;Here's a full implementation of &lt;tt&gt;Property&lt;/tt&gt;.  You will note that, in order to exactly emulate the &lt;tt&gt;property&lt;/tt&gt; object, the &lt;tt&gt;__init__&lt;/tt&gt; method has the same argument names as the internal &lt;tt&gt;property&lt;/tt&gt; so that code that uses keyword arguments will function in perfect ambivalence.&lt;/p&gt;

&lt;pre&gt;
class Property(object):
	def __init__(
		self,
		fget,
		fset = None,
		fdel = None,
		doc = None,
	):
		self.fget = fget
		self.fset = fset
		self.fdel = fdel
		self.__doc__ = doc
	def __get__(self, objekt, klass):
		return self.fget(objekt)
	def __set__(self, objekt, value):
		self.fset(objekt, value)
	def __del__(self, objekt):
		self.fdel(objekt)&lt;/pre&gt;</content>
		<author>
			<name>&quot;The Sourcerer&quot;, Kris Kowal's Blog</name>
			<uri>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi</uri>
		</author>
		<source>
			<title type="html">The Sourcerer</title>
			<subtitle type="html">by Kris Kowal</subtitle>
			<link rel="self" href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2"/>
			<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2</id>
			<updated>2008-10-07T05:17:11+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">YouTube - Peter Schiff - (Former Ron Paul Economic Advisor) Versus Art Laffer (Former Ronald McReagan Economic Advisor) - August 28, 2006 - Peter Schiff [Pimp]</title>
		<link href="http://www.youtube.com/watch?v=IU6PamCQ6zw"/>
		<id>http://www.youtube.com/watch?v=IU6PamCQ6zw</id>
		<updated>2008-09-30T03:53:45+00:00</updated>
		<content type="html">Want to see something scary?  If I were a betting man…</content>
		<author>
			<name>Kris Kowal's Del.icio.us Bookmarks</name>
			<uri>http://delicious.com/kris.kowal</uri>
		</author>
		<source>
			<title type="html">Delicious/kris.kowal</title>
			<subtitle type="html">bookmarks posted by kris.kowal</subtitle>
			<link rel="self" href="http://feeds.delicious.com/rss/kris.kowal"/>
			<id>http://feeds.delicious.com/rss/kris.kowal</id>
			<updated>2008-10-07T01:17:15+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Ask a Wizard</title>
		<link href="http://askawizard.blogspot.com/"/>
		<id>http://askawizard.blogspot.com/</id>
		<updated>2008-09-29T22:53:18+00:00</updated>
		<content type="html">My blog&amp;#039;s new home.  The Python Saga continues for the rest of the week.</content>
		<author>
			<name>Kris Kowal's Del.icio.us Bookmarks</name>
			<uri>http://delicious.com/kris.kowal</uri>
		</author>
		<source>
			<title type="html">Delicious/kris.kowal</title>
			<subtitle type="html">bookmarks posted by kris.kowal</subtitle>
			<link rel="self" href="http://feeds.delicious.com/rss/kris.kowal"/>
			<id>http://feeds.delicious.com/rss/kris.kowal</id>
			<updated>2008-10-07T01:17:15+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en-us">
		<title type="html">kriskowal: I've moved my blog to http://askawizard.blogspot.com/ so you can comment and I can track.  Still uses SWL though :-)</title>
		<link href="http://twitter.com/kriskowal/statuses/939846821"/>
		<id>http://twitter.com/kriskowal/statuses/939846821</id>
		<updated>2008-09-29T22:48:37+00:00</updated>
		<content type="html">kriskowal: I've moved my blog to http://askawizard.blogspot.com/ so you can comment and I can track.  Still uses SWL though :-)</content>
		<author>
			<name>Kris Kowal's Twitter Status</name>
			<uri>http://twitter.com/kriskowal</uri>
		</author>
		<source>
			<title type="html">Twitter / kriskowal</title>
			<subtitle type="html">Twitter updates from Kris Kowal / kriskowal.</subtitle>
			<link rel="self" href="http://twitter.com/statuses/user_timeline/6585632.rss"/>
			<id>http://twitter.com/statuses/user_timeline/6585632.rss</id>
			<updated>2008-10-07T01:17:17+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Migrating to Blogger</title>
		<link href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/blogger"/>
		<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/blogger</id>
		<updated>2008-09-29T19:01:26+00:00</updated>
		<content type="html">&lt;p&gt;Heij, folks.  I'm migrating my blog from my homegrown PyBlosxom solution to Blogger.  I will continue cross posting here, but if you would like to make comments, please visit my new location, &lt;a href=&quot;http://askawizard.blogspot.com/&quot;&gt;http://askawizard.blogspot.com/&lt;/a&gt;.&lt;/p&gt;</content>
		<author>
			<name>&quot;The Sourcerer&quot;, Kris Kowal's Blog</name>
			<uri>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi</uri>
		</author>
		<source>
			<title type="html">The Sourcerer</title>
			<subtitle type="html">by Kris Kowal</subtitle>
			<link rel="self" href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2"/>
			<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2</id>
			<updated>2008-10-07T05:17:11+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en-us">
		<title type="html">kriskowal: Want: umbrella scabard.</title>
		<link href="http://twitter.com/kriskowal/statuses/939547253"/>
		<id>http://twitter.com/kriskowal/statuses/939547253</id>
		<updated>2008-09-29T18:33:13+00:00</updated>
		<content type="html">kriskowal: Want: umbrella scabard.</content>
		<author>
			<name>Kris Kowal's Twitter Status</name>
			<uri>http://twitter.com/kriskowal</uri>
		</author>
		<source>
			<title type="html">Twitter / kriskowal</title>
			<subtitle type="html">Twitter updates from Kris Kowal / kriskowal.</subtitle>
			<link rel="self" href="http://twitter.com/statuses/user_timeline/6585632.rss"/>
			<id>http://twitter.com/statuses/user_timeline/6585632.rss</id>
			<updated>2008-10-07T01:17:17+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Incomprehensible Vacuum: Penny-wise, Pound-foolish</title>
		<link href="http://aarmono.blogspot.com/2008/09/penny-wise-pound-foolish.html"/>
		<id>http://aarmono.blogspot.com/2008/09/penny-wise-pound-foolish.html</id>
		<updated>2008-09-29T08:48:30+00:00</updated>
		<content type="html">Friend from college, Aaron Stearatte, proposes that the federal budget is like an optimization problem.  Frankly, I think that 3m$ a fine price for studying bear DNA.</content>
		<author>
			<name>Kris Kowal's Del.icio.us Bookmarks</name>
			<uri>http://delicious.com/kris.kowal</uri>
		</author>
		<source>
			<title type="html">Delicious/kris.kowal</title>
			<subtitle type="html">bookmarks posted by kris.kowal</subtitle>
			<link rel="self" href="http://feeds.delicious.com/rss/kris.kowal"/>
			<id>http://feeds.delicious.com/rss/kris.kowal</id>
			<updated>2008-10-07T01:17:15+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Classmate PC gets a boost with million-unit Venezuelan order</title>
		<link href="http://arstechnica.com/news.ars/post/20080929-classmate-pc-gets-a-boost-with-million-unit-venezuelan-order.html"/>
		<id>http://arstechnica.com/news.ars/post/20080929-classmate-pc-gets-a-boost-with-million-unit-venezuelan-order.html</id>
		<updated>2008-09-29T07:00:00+00:00</updated>
		<content type="html">The government of Venezuela has ordered one million low-cost Classmate PC laptops to be shipped to students with Linux preinstalled.</content>
		<author>
			<name>Ryan Paul's Articles</name>
			<uri>http://cixar.com/~segphault/articles</uri>
		</author>
		<source>
			<title type="html">Ryan's Articles</title>
			<subtitle type="html">Ryan's Articles</subtitle>
			<link rel="self" href="http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true"/>
			<id>http://www.cixar.com/~segphault/cgi-bin/articles.cgi?rss=true</id>
			<updated>2008-10-07T05:17:06+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Mandriva developer talks about Linux boot optimization</title>
		<link href="http://arstechnica.com/journals/linux.ars/2008/09/30/mandriva-developer-talks-about-linux-boot-optimization"/>
		<id>http://arstechnica.com/journals/linux.ars/2008/09/30/mandriva-developer-talks-about-linux-boot-optimization</id>
		<updated>2008-09-29T07:00:00+00:00</updated>
		<content type="html">A developer explains some of the optimization techniques that are used to improve boot performance in the upcoming version of the Mandriva Linux distribution.</content>
		<author>
			<name>Ryan Paul's Journal Posts</name>
			<uri>http://cixar.com/~segphault/articles</uri>
		</author>
		<source>
			<title type="html">Ryan's Journal Posts</title>
			<subtitle type="html">Ryan's Journal Posts</subtitle>
			<link rel="self" href="http://www.cixar.com/~segphault/cgi-bin/journal.cgi?rss=true"/>
			<id>http://www.cixar.com/~segphault/cgi-bin/journal.cgi?rss=true</id>
			<updated>2008-10-07T05:17:08+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Decorators - The Python Saga - Part 2</title>
		<link href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/program/python/decorators"/>
		<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/program/python/decorators</id>
		<updated>2008-09-29T04:42:06+00:00</updated>
		<content type="html">&lt;p&gt;Python introduced a short-hand for the adapter pattern on functions.  You can &quot;decorate&quot; a function with another function.  This is a neat tool you can use to factor out some common code from a bunch of functions.  You can fiddle with the arguments, return values, or intercept exceptions thrown by any function you decorate.&lt;/p&gt;
&lt;p&gt;The canonical example is a memoize decorator.  The idea is to generalize the notion of memoization so you can simply subscribe to it in any function you want to memoize.&lt;/p&gt;

&lt;pre&gt;
def factorial(n):
	if n == 1: return 1
	return n * factorial(n - 1)
factorial = memoize(factorial)&lt;/pre&gt;
&lt;p&gt;You accomplish this by writing the &lt;tt&gt;memoize&lt;/tt&gt; decorator.  A decorator is a function that accepts a function and returns another.  Python virtuously provides a shorthand for taking the function, decorating it, and assigning it to a variable with the same name.&lt;/p&gt;

&lt;pre&gt;
@memoize
def factorial(n):
	if n == 1: return 1
	return n * factorial(n - 1)&lt;/pre&gt;
&lt;p&gt;In the imagined normal case of decorators, the returned function accepts the same arguments and returns the same kinds of values as the accepted function.  However, a decorator does have the liberty of extending or restricting that interface, like accepting additional arguments or raising an exception if the arguments are of the wrong type.  It might also perform some common computation on the original arguments and pass the result to the original function as an additional argument.  In any case, you can use some closures to create a decorator:&lt;/p&gt;

&lt;pre&gt;
def memoize(function):
	cache = {}
	def decorated(*args):
		if args not in cache:
			cache[args] = function(*args)
		return cache[args]
	return decorated&lt;/pre&gt;
&lt;p&gt;Of course, that's too simple.  A lot of things you put after the &quot;@&quot; symbol are just functions that return decorators so that they can be configured with arguments.  For example, you probably want to make a &lt;tt&gt;memoize&lt;/tt&gt; decorator that lets you specify your own &lt;tt&gt;cache&lt;/tt&gt; object.  So, you need another layer of deference.&lt;/p&gt;

&lt;pre&gt;
def memoize(cache = None):
	if cache is None: cache = {}
	def decorator(function):
		def decorated(*args):
			if args not in cache:
				cache[args] = function(*args)
			return cache[args]
		return decorated
	return decorator

@memoize({})
def factorial(n):
	if n == 1: return 1
	return n * factorial(n - 1)&lt;/pre&gt;
&lt;p&gt;Since, in Python, functions, objects, and types are indistinguishable to the casual observer, you can do the exact same thing with a class, although I shudder to think that you might want to forgo the simplicity and elegance of closures.  After the transform, the previous code might look like this:&lt;/p&gt;

&lt;pre&gt;
class memoize(object):
	def __init__(self, cache = None):
		self.cache = cache
	def __call__(self, function):
		return Memoized(function, self.cache)

class Memoized(object):
	def __init__(self, function, cache = None):
		if cache is None: cache = {}
		self.function = function
		self.cache = cache
	def __call__(self, *args):
		if args not in self.cache:
			self.cache[args] = self.function(*args)
		return self.cache[args]

@memoize()
def factorial(n):
	if n == 1: return 1
	return n * factorial(n - 1)&lt;/pre&gt;
&lt;p&gt;So now you can use a Least Recently Used Cache, assuming it is a dictionary-like-object (a duck-dict, if you will):&lt;/p&gt;

&lt;pre&gt;
from lru_cache import LruCache
@memoize(LruCache(max_size = 100, cull = .25))
def factorial(n):
	if n == 1: return 1
	return n * factorial(n - 1)&lt;/pre&gt;
&lt;p&gt;Download &lt;a href=&quot;http://cixar.com/~kris.kowal/bdoc/program/python/decorators.zip&quot;&gt;decorators.zip&lt;/a&gt;.&lt;/p&gt;</content>
		<author>
			<name>&quot;The Sourcerer&quot;, Kris Kowal's Blog</name>
			<uri>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi</uri>
		</author>
		<source>
			<title type="html">The Sourcerer</title>
			<subtitle type="html">by Kris Kowal</subtitle>
			<link rel="self" href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2"/>
			<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2</id>
			<updated>2008-10-07T05:17:11+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en-us">
		<title type="html">kriskowal: …you know, as opposed to, &quot;promote international innovation in clean energy.&quot;</title>
		<link href="http://twitter.com/kriskowal/statuses/938713148"/>
		<id>http://twitter.com/kriskowal/statuses/938713148</id>
		<updated>2008-09-29T02:23:35+00:00</updated>
		<content type="html">kriskowal: …you know, as opposed to, &quot;promote international innovation in clean energy.&quot;</content>
		<author>
			<name>Kris Kowal's Twitter Status</name>
			<uri>http://twitter.com/kriskowal</uri>
		</author>
		<source>
			<title type="html">Twitter / kriskowal</title>
			<subtitle type="html">Twitter updates from Kris Kowal / kriskowal.</subtitle>
			<link rel="self" href="http://twitter.com/statuses/user_timeline/6585632.rss"/>
			<id>http://twitter.com/statuses/user_timeline/6585632.rss</id>
			<updated>2008-10-07T01:17:17+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en-us">
		<title type="html">kriskowal: When McCain said, &quot;eliminate our dependence on foreign oil&quot;, I heard, &quot;give my buddie$ permi$$ion to rape America'$ natural re$ource$.&quot;</title>
		<link href="http://twitter.com/kriskowal/statuses/938712585"/>
		<id>http://twitter.com/kriskowal/statuses/938712585</id>
		<updated>2008-09-29T02:22:56+00:00</updated>
		<content type="html">kriskowal: When McCain said, &quot;eliminate our dependence on foreign oil&quot;, I heard, &quot;give my buddie$ permi$$ion to rape America'$ natural re$ource$.&quot;</content>
		<author>
			<name>Kris Kowal's Twitter Status</name>
			<uri>http://twitter.com/kriskowal</uri>
		</author>
		<source>
			<title type="html">Twitter / kriskowal</title>
			<subtitle type="html">Twitter updates from Kris Kowal / kriskowal.</subtitle>
			<link rel="self" href="http://twitter.com/statuses/user_timeline/6585632.rss"/>
			<id>http://twitter.com/statuses/user_timeline/6585632.rss</id>
			<updated>2008-10-07T01:17:17+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en-us">
		<title type="html">kriskowal: There was a great fireworks show over CalTech last night.  Occasion?</title>
		<link href="http://twitter.com/kriskowal/statuses/938309389"/>
		<id>http://twitter.com/kriskowal/statuses/938309389</id>
		<updated>2008-09-28T18:08:36+00:00</updated>
		<content type="html">kriskowal: There was a great fireworks show over CalTech last night.  Occasion?</content>
		<author>
			<name>Kris Kowal's Twitter Status</name>
			<uri>http://twitter.com/kriskowal</uri>
		</author>
		<source>
			<title type="html">Twitter / kriskowal</title>
			<subtitle type="html">Twitter updates from Kris Kowal / kriskowal.</subtitle>
			<link rel="self" href="http://twitter.com/statuses/user_timeline/6585632.rss"/>
			<id>http://twitter.com/statuses/user_timeline/6585632.rss</id>
			<updated>2008-10-07T01:17:17+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">The Sourcerer - Variadic Positional and Keyword Arguments - The Python Saga - Part 1</title>
		<link href="http://cixar.com/~kris/blog/program/python/variadic.html"/>
		<id>http://cixar.com/~kris/blog/program/python/variadic.html</id>
		<updated>2008-09-28T08:46:45+00:00</updated>
		<content type="html">Shameless plug: I&amp;#039;m preparing a series of blog articles on Python topics that I think are important.  Stay tuned for more as the week progresses.</content>
		<author>
			<name>Kris Kowal's Del.icio.us Bookmarks</name>
			<uri>http://delicious.com/kris.kowal</uri>
		</author>
		<source>
			<title type="html">Delicious/kris.kowal</title>
			<subtitle type="html">bookmarks posted by kris.kowal</subtitle>
			<link rel="self" href="http://feeds.delicious.com/rss/kris.kowal"/>
			<id>http://feeds.delicious.com/rss/kris.kowal</id>
			<updated>2008-10-07T01:17:15+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en-us">
		<title type="html">kriskowal: I'm preparing a series of blogs on some of Python's most important features.  Stay tuned: http://cixar.com/~kris.kowal/blog</title>
		<link href="http://twitter.com/kriskowal/statuses/937924603"/>
		<id>http://twitter.com/kriskowal/statuses/937924603</id>
		<updated>2008-09-28T08:17:21+00:00</updated>
		<content type="html">kriskowal: I'm preparing a series of blogs on some of Python's most important features.  Stay tuned: http://cixar.com/~kris.kowal/blog</content>
		<author>
			<name>Kris Kowal's Twitter Status</name>
			<uri>http://twitter.com/kriskowal</uri>
		</author>
		<source>
			<title type="html">Twitter / kriskowal</title>
			<subtitle type="html">Twitter updates from Kris Kowal / kriskowal.</subtitle>
			<link rel="self" href="http://twitter.com/statuses/user_timeline/6585632.rss"/>
			<id>http://twitter.com/statuses/user_timeline/6585632.rss</id>
			<updated>2008-10-07T01:17:17+00:00</updated>
		</source>
	</entry>

	<entry xml:lang="en">
		<title type="html">Variadic Positional and Keyword Arguments - The Python Saga - Part 1</title>
		<link href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/program/python/variadic"/>
		<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/program/python/variadic</id>
		<updated>2008-09-28T07:09:21+00:00</updated>
		<content type="html">&lt;p&gt;Python supports &quot;variadic&quot; arguments.  Variadic arguments are the man behind the curtain for C's &lt;tt&gt;printf&lt;/tt&gt; function.  The idea is that a function can accept a variable number of positional arguments, the values to put in your format string.  In C this is accomplished with an ellipsis, &lt;tt&gt;...&lt;/tt&gt;, and some &lt;tt&gt;VA&lt;/tt&gt; macro-linked-list-stuff that I always have to look up.  Python goes a couple steps further with variadic arguments and the results are stunning, orthogonal, and &lt;i&gt;actually useful&lt;/i&gt; almost every day.  With Python, you get both &quot;positional&quot; arguments, like C, and keyword arguments: those arguments that conceptually map, in any order, to the names of the arguments in your function's declaration.  The magic symbols are &quot;*&quot; and &quot;**&quot; for positional and keyword arguments respectively.  With one &quot;*&quot;, you can declare a function that accepts any number of arguments as the declared list object:&lt;/p&gt;

&lt;pre&gt;
def foo(*args):
	return args
assert foo(1, 2, 3) == [1, 2, 3]&lt;/pre&gt;
&lt;p&gt;You can also pass an array of positional arguments to a function with very similar syntax:&lt;/p&gt;

&lt;pre&gt;
def foo(a, b, c):
	return [a, b, c]
assert foo(*[1, 2, 3]) == [1, 2, 3]&lt;/pre&gt;
&lt;p&gt;And you can do the same thing with keyword arguments except you use dictionaries:&lt;/p&gt;

&lt;pre&gt;
def foo(**kwargs):
	return kwargs
assert foo(a = 10, b = 20, c = 30) == {'a': 10, 'b': 20, 'c': 30}&lt;/pre&gt;
&lt;p&gt;Likewise, you can pass keyword arguments:&lt;/p&gt;

&lt;pre&gt;
def foo(a, b, c):
	return [a, b, c]
assert foo(**{'a': 10, 'b': 20, 'c': 30}) == [10, 20, 30]&lt;/pre&gt;
&lt;p&gt;You can use them in combination, along with default arguments to provide beautiful, orthogonal, reusable abstractions:&lt;/p&gt;

&lt;pre&gt;
def foo(a, b = None, c = None, d = None):
	return [a, b, c, d]
assert foo(*[1, 2], **{'c': 3}) == [1, 2, 3, None]
def bar(a, b, c, *args, **kws):
	return [a, b, c], args, kws
assert bar(1, 2, 3, 4, 5, f = 6) == ([1, 2, 3], [4], {'f': 5})&lt;/pre&gt;</content>
		<author>
			<name>&quot;The Sourcerer&quot;, Kris Kowal's Blog</name>
			<uri>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi</uri>
		</author>
		<source>
			<title type="html">The Sourcerer</title>
			<subtitle type="html">by Kris Kowal</subtitle>
			<link rel="self" href="http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2"/>
			<id>http://cixar.com/~kris.kowal/cgi-bin/pyblosxom.cgi/index.rss2</id>
			<updated>2008-10-07T05:17:11+00:00</updated>
		</source>
	</entry>

	<entry>
		<title type="html">Hands on: SkyFire browser brings Gecko to Windows Mobile</title>
		<link href="http://arstechnica.com/news.ars/post/20080928-hands-on-skyfire-browser-brings-gecko-on-windows-mobile.html"/>
		<id>http://arstechnica.com/news.ars/post/20080928-hands-on-skyfire-browser-brings-gecko-on-windows-mobile.html</id>
		<updated>2008-09-28T07:00:00+00:00</updated>
		<content type="html">The new SkyFire web browser uses server-side prerendering with Firefox's Gecko engine to bring a desktop-like web experience to mobile devices. Ars puts SkyFire to the test and discusses some of the underlying technology with the company's senior director of product management.</content>
		<author>
			<name>Ryan Paul's Articles</name>
			<uri>http://cixar.com/~segphault/articles</uri>
		</author>
		<source>
			<title type="html">Ryan's Articles</title>
			<subtitle type="html">Ryan's Articles</subtitle>
			<link rel="self"