<?xml version="1.0" encoding="UTF-8"?>
<?xml-stylesheet type="text/xsl" media="screen" href="/~d/styles/rss2full.xsl"?><?xml-stylesheet type="text/css" media="screen" href="http://feeds.andrew.io/~d/styles/itemcontent.css"?><rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:wfw="http://wellformedweb.org/CommentAPI/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:sy="http://purl.org/rss/1.0/modules/syndication/" xmlns:slash="http://purl.org/rss/1.0/modules/slash/" xmlns:feedburner="http://rssnamespace.org/feedburner/ext/1.0" version="2.0">

<channel>
	<title>andrew.io/weblog</title>
	
	<link>http://andrew.io/weblog</link>
	<description>andrew watts' weblog</description>
	<lastBuildDate>Sun, 17 Jul 2011 22:03:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
<cloud domain="andrew.io" port="80" path="/weblog/?rsscloud=notify" registerProcedure="" protocol="http-post" />
		<atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="self" type="application/rss+xml" href="http://feeds.andrew.io/andrewio/weblog" /><feedburner:info uri="andrewio/weblog" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://pubsubhubbub.appspot.com/" /><atom10:link xmlns:atom10="http://www.w3.org/2005/Atom" rel="hub" href="http://superfeedr.com/hubbub" /><item>
		<title>How to import a module from just a file path</title>
		<link>http://feeds.andrew.io/~r/andrewio/weblog/~3/aeTuatX_1jY/</link>
		<comments>http://andrew.io/weblog/2011/07/coder-who-says-py-how-to-import-a-module-from-just-a-file-path/#comments</comments>
		<pubDate>Sun, 17 Jul 2011 22:02:34 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>

		<guid isPermaLink="false">http://andrew.io/weblog/?p=235</guid>
		<description><![CDATA[import a module from a file path, either through a stdlib function call or just constructed from scratch via Coder Who Says Py: How to import a module from just a file path.]]></description>
			<content:encoded><![CDATA[<p>import a module from a file path, either through a stdlib function call or just constructed from scratch</p>

<p>via <a href='http://sayspy.blogspot.com/2011/07/how-to-import-module-from-just-file.html'>Coder Who Says Py: How to import a module from just a file path</a>.</p>
<img src="http://feeds.feedburner.com/~r/andrewio/weblog/~4/aeTuatX_1jY" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrew.io/weblog/2011/07/coder-who-says-py-how-to-import-a-module-from-just-a-file-path/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://andrew.io/weblog/2011/07/coder-who-says-py-how-to-import-a-module-from-just-a-file-path/</feedburner:origLink></item>
		<item>
		<title>Some Common Django ORM Pitfalls</title>
		<link>http://feeds.andrew.io/~r/andrewio/weblog/~3/bn-nWG5JGCk/</link>
		<comments>http://andrew.io/weblog/2010/05/some-common-django-orm-pitfalls/#comments</comments>
		<pubDate>Wed, 05 May 2010 04:30:24 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[orm]]></category>

		<guid isPermaLink="false">http://andrew.io/weblog/?p=231</guid>
		<description><![CDATA[David Ziegler has posted a nice list of Common Django ORM Pitfalls.]]></description>
			<content:encoded><![CDATA[<p>David Ziegler has posted a nice list of <a href='http://blog.davidziegler.net/post/548363214/some-common-django-orm-pitfalls'>Common Django ORM Pitfalls</a>.</p>
<img src="http://feeds.feedburner.com/~r/andrewio/weblog/~4/bn-nWG5JGCk" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrew.io/weblog/2010/05/some-common-django-orm-pitfalls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://andrew.io/weblog/2010/05/some-common-django-orm-pitfalls/</feedburner:origLink></item>
		<item>
		<title>Cue</title>
		<link>http://feeds.andrew.io/~r/andrewio/weblog/~3/S0qJphTbfJ0/</link>
		<comments>http://andrew.io/weblog/2010/05/cue/#comments</comments>
		<pubDate>Mon, 03 May 2010 04:21:35 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[Queue]]></category>

		<guid isPermaLink="false">http://andrew.io/weblog/?p=229</guid>
		<description><![CDATA[On Friday, I was thinking about a simple queue for django and what that would look like, and today I came across Charles Leifer&#8217;s post: Idea for a simple task queue, where he introduces cue. I&#8217;ll probably be taking a deeper dive into this post, later in the upcoming week.]]></description>
			<content:encoded><![CDATA[<p>On Friday, I was thinking about a simple queue for django and what that would look like, and today I came across Charles Leifer&#8217;s post: <a href='http://charlesleifer.com/blog/idea-for-simple-task-queue/'>Idea for a simple task queue</a>, where he introduces <a href="http://github.com/coleifer/cue/">cue</a>.  I&#8217;ll probably be taking a deeper dive into this post, later in the upcoming week.</p>
<img src="http://feeds.feedburner.com/~r/andrewio/weblog/~4/S0qJphTbfJ0" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrew.io/weblog/2010/05/cue/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://andrew.io/weblog/2010/05/cue/</feedburner:origLink></item>
		<item>
		<title>SQL to MongoDB</title>
		<link>http://feeds.andrew.io/~r/andrewio/weblog/~3/BTkPFFvWS9w/</link>
		<comments>http://andrew.io/weblog/2010/03/sql-to-mongodb/#comments</comments>
		<pubDate>Tue, 23 Mar 2010 22:37:31 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[mongoDB]]></category>
		<category><![CDATA[mysql]]></category>

		<guid isPermaLink="false">http://andrew.io/weblog/?p=224</guid>
		<description><![CDATA[An example of mapping a MySQL query to a MongoDB mapreduce.]]></description>
			<content:encoded><![CDATA[<p>An <a href='http://rickosborne.org/download/SQL-to-MongoDB.pdf'>example of mapping a MySQL query to a MongoDB mapreduce</a>.</p>
<img src="http://feeds.feedburner.com/~r/andrewio/weblog/~4/BTkPFFvWS9w" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrew.io/weblog/2010/03/sql-to-mongodb/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://andrew.io/weblog/2010/03/sql-to-mongodb/</feedburner:origLink></item>
		<item>
		<title>Finding Anagrams with Python</title>
		<link>http://feeds.andrew.io/~r/andrewio/weblog/~3/PCTENHJrn3M/</link>
		<comments>http://andrew.io/weblog/2010/03/finding-anagrams-with-python/#comments</comments>
		<pubDate>Thu, 11 Mar 2010 04:57:48 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Programming]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[Snippet]]></category>
		<category><![CDATA[anagram]]></category>

		<guid isPermaLink="false">http://andrew.io/weblog/?p=212</guid>
		<description><![CDATA[As a web developer a lot of my development activities really comes down to handling a request, authenticating the request, validating the request, making an sql query, serializing the data for a response, and then handling the response in the web browser and render accordingly. Needless to say, I don&#8217;t spend a lot of time [...]]]></description>
			<content:encoded><![CDATA[<p>As a web developer a lot of my development activities really comes down to handling a request, authenticating the request, validating the request, making an sql query, serializing the data for a response, and then handling the response in the web browser and render accordingly.  Needless to say, I don&#8217;t spend a lot of time working on algorithms and optimization (outside of sql) these days.</p>

<p>And, recently I saw a <a href="http://www.willmcgugan.com/blog/tech/2009/12/21/python-developer-programming-tests/">small programming challenge</a> on the web for determining anagrams in the english dictionary for a given word, and I sat down today and worked out a solution and here it is:</p>

<!-- -more- -->


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
</pre></td><td class="code"><pre class="python" style="font-family:monospace;">    <span style="color: #ff7700;font-weight:bold;">def</span> possible_anagrams<span style="color: black;">&#40;</span>word<span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">''</span><span style="color: #483d8b;">'given a word, return a list of possible anagrams for that word'</span><span style="color: #483d8b;">''</span>
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>word<span style="color: black;">&#41;</span> == <span style="color: #ff4500;">1</span>:
           <span style="color: #ff7700;font-weight:bold;">yield</span> word
&nbsp;
        <span style="color: #ff7700;font-weight:bold;">for</span> i, letter <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">enumerate</span><span style="color: black;">&#40;</span>word<span style="color: black;">&#41;</span>:
            <span style="color: #808080; font-style: italic;"># recursively call with a word whose characters have been rotated</span>
            <span style="color: #ff7700;font-weight:bold;">for</span> s <span style="color: #ff7700;font-weight:bold;">in</span> possible_anagrams<span style="color: black;">&#40;</span>word<span style="color: black;">&#91;</span>i+<span style="color: #ff4500;">1</span>:<span style="color: black;">&#93;</span> + word<span style="color: black;">&#91;</span>:i<span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>:
                <span style="color: #ff7700;font-weight:bold;">yield</span> <span style="color: #483d8b;">'%s%s'</span> <span style="color: #66cc66;">%</span> <span style="color: black;">&#40;</span>letter, s<span style="color: black;">&#41;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> anagrams<span style="color: black;">&#40;</span>word<span style="color: black;">&#41;</span>:
        <span style="color: #483d8b;">''</span><span style="color: #483d8b;">'given a word, return a list of anagrams in an english dictionary'</span><span style="color: #483d8b;">''</span>
&nbsp;
        words = <span style="color: black;">&#91;</span>w.<span style="color: black;">rstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> w <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'WORD.LST'</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: black;">&#91;</span>a <span style="color: #ff7700;font-weight:bold;">for</span> a <span style="color: #ff7700;font-weight:bold;">in</span> possible_anagrams<span style="color: black;">&#40;</span>word<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">if</span> a <span style="color: #ff7700;font-weight:bold;">in</span> words<span style="color: black;">&#93;</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">if</span> __name__ == <span style="color: #483d8b;">&quot;__main__&quot;</span>:
        <span style="color: #ff7700;font-weight:bold;">print</span> anagrams<span style="color: black;">&#40;</span><span style="color: #483d8b;">'python'</span><span style="color: black;">&#41;</span></pre></td></tr></table></div>


<p>Originally I wrote a recursive <code>possible_anagrams</code> function that returned a list, but then modified it to use a generator.  There is room for optimization, but this was my first shot at getting a correct result.</p>

<p>Then, I was looking at the possible solutions and realized, as I typically do in these situations, I had made the problem more complex than it needed to be. Because, you don&#8217;t really need to find the possible anagrams.  You can do something like:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
</pre></td><td class="code"><pre class="python" style="font-family:monospace;">    <span style="color: #ff7700;font-weight:bold;">def</span> anagrams<span style="color: black;">&#40;</span>word<span style="color: black;">&#41;</span>:
        words = <span style="color: black;">&#91;</span>w.<span style="color: black;">rstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> w <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'WORD.LST'</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span>
        sword = <span style="color: #008000;">sorted</span><span style="color: black;">&#40;</span>word<span style="color: black;">&#41;</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> <span style="color: black;">&#91;</span>w <span style="color: #ff7700;font-weight:bold;">for</span> w <span style="color: #ff7700;font-weight:bold;">in</span> words <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">sorted</span><span style="color: black;">&#40;</span>w<span style="color: black;">&#41;</span> == sword<span style="color: black;">&#93;</span></pre></td></tr></table></div>


<p>which compares a sorted list of characters.  The solution is very clean and easy to understand. However, one solution really stood out to me for its use of <code>itertools</code> to find the possible anagrams:</p>


<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
</pre></td><td class="code"><pre class="python" style="font-family:monospace;">&nbsp;
    <span style="color: #ff7700;font-weight:bold;">import</span> <span style="color: #dc143c;">itertools</span>
&nbsp;
    <span style="color: #ff7700;font-weight:bold;">def</span> anagrams<span style="color: black;">&#40;</span>word<span style="color: black;">&#41;</span>:
&nbsp;
        words = <span style="color: black;">&#91;</span>w.<span style="color: black;">rstrip</span><span style="color: black;">&#40;</span><span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> w <span style="color: #ff7700;font-weight:bold;">in</span> <span style="color: #008000;">open</span><span style="color: black;">&#40;</span><span style="color: #483d8b;">'WORD.LST'</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span>
        <span style="color: #808080; font-style: italic;">#Reduce the number of words to compare to </span>
        <span style="color: #808080; font-style: italic;"># just the ones with the same lengths</span>
        <span style="color: #808080; font-style: italic;"># Also make a set to avoid duplicates</span>
        words = <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span> w <span style="color: #ff7700;font-weight:bold;">for</span> w <span style="color: #ff7700;font-weight:bold;">in</span> words <span style="color: #ff7700;font-weight:bold;">if</span> <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>w<span style="color: black;">&#41;</span> == <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>word<span style="color: black;">&#41;</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;">#Find all possible anagrams</span>
        comb = <span style="color: #008000;">set</span><span style="color: black;">&#40;</span><span style="color: black;">&#91;</span> <span style="color: #483d8b;">''</span>.<span style="color: black;">join</span><span style="color: black;">&#40;</span>w<span style="color: black;">&#41;</span> <span style="color: #ff7700;font-weight:bold;">for</span> w <span style="color: #ff7700;font-weight:bold;">in</span>  
                    <span style="color: #dc143c;">itertools</span>.<span style="color: black;">permutations</span><span style="color: black;">&#40;</span>word, <span style="color: #008000;">len</span><span style="color: black;">&#40;</span>word<span style="color: black;">&#41;</span><span style="color: black;">&#41;</span><span style="color: black;">&#93;</span><span style="color: black;">&#41;</span>
&nbsp;
        <span style="color: #808080; font-style: italic;">#Now find the ones that are words intersecting two sets</span>
        <span style="color: #ff7700;font-weight:bold;">return</span> comb.<span style="color: black;">intersection</span><span style="color: black;">&#40;</span>words<span style="color: black;">&#41;</span></pre></td></tr></table></div>


<p>I was previously unaware of the <code>itertools.permutations</code> method.  And, this solution is also easier to read than mine and performed 10-20 ms faster than mine as well.  So, while I did make the problem more complex than needed I now have 3 ways to find an anagram should similar problems ever come up in real life and more importantly, to me, I solved something that didn&#8217;t involve sql.</p>
<img src="http://feeds.feedburner.com/~r/andrewio/weblog/~4/PCTENHJrn3M" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrew.io/weblog/2010/03/finding-anagrams-with-python/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		<feedburner:origLink>http://andrew.io/weblog/2010/03/finding-anagrams-with-python/</feedburner:origLink></item>
		<item>
		<title>Zone mapping chart</title>
		<link>http://feeds.andrew.io/~r/andrewio/weblog/~3/1esOOw66WjQ/</link>
		<comments>http://andrew.io/weblog/2010/03/zone-mapping-chart/#comments</comments>
		<pubDate>Wed, 10 Mar 2010 16:06:04 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[chart]]></category>
		<category><![CDATA[graph]]></category>

		<guid isPermaLink="false">http://andrew.io/weblog/?p=210</guid>
		<description><![CDATA[I like living in the zone of fun and games.]]></description>
			<content:encoded><![CDATA[<p>I like living in the <a href='http://www.darkgreyindustries.com/index.php/site/zone_mapping_chart/'>zone of fun and games</a>.</p>
<img src="http://feeds.feedburner.com/~r/andrewio/weblog/~4/1esOOw66WjQ" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrew.io/weblog/2010/03/zone-mapping-chart/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://andrew.io/weblog/2010/03/zone-mapping-chart/</feedburner:origLink></item>
		<item>
		<title>How and why to use django-mongokit aka. Django to MongoDB – Peterbe.com Peter Bengtsson on Python, Zope, Kung Fu, London and photos</title>
		<link>http://feeds.andrew.io/~r/andrewio/weblog/~3/XDXTRcahRM8/</link>
		<comments>http://andrew.io/weblog/2010/03/how-and-why-to-use-django-mongokit-aka-django-to-mongodb-peterbe-com-peter-bengtsson-on-python-zope-kung-fu-london-and-photos/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 15:32:55 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[Cassandra]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[mongoDB]]></category>

		<guid isPermaLink="false">http://andrew.io/weblog/?p=208</guid>
		<description><![CDATA[How and why to use django-mongokit aka. Django to MongoDB provides a great introduction of how to get started with Django and MongoDB. Although it&#8217;s still not exactly clear when/where/why MongoDB is better than a Relational DB like MySQL. And even less clear how something like MongoDB compares with Cassandra.]]></description>
			<content:encoded><![CDATA[<p><a href='http://www.peterbe.com/plog/how-and-why-to-use-django-mongokit'>How and why to use django-mongokit aka. Django to MongoDB</a> provides a great introduction of how to get started with Django and MongoDB.  Although it&#8217;s still not exactly clear when/where/why MongoDB is better than a Relational DB like MySQL.  And even less clear how something like MongoDB compares with Cassandra.</p>
<img src="http://feeds.feedburner.com/~r/andrewio/weblog/~4/XDXTRcahRM8" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrew.io/weblog/2010/03/how-and-why-to-use-django-mongokit-aka-django-to-mongodb-peterbe-com-peter-bengtsson-on-python-zope-kung-fu-london-and-photos/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://andrew.io/weblog/2010/03/how-and-why-to-use-django-mongokit-aka-django-to-mongodb-peterbe-com-peter-bengtsson-on-python-zope-kung-fu-london-and-photos/</feedburner:origLink></item>
		<item>
		<title>round-robin django setup with nginx</title>
		<link>http://feeds.andrew.io/~r/andrewio/weblog/~3/DfpTNvI_nCU/</link>
		<comments>http://andrew.io/weblog/2010/03/round-robin-django-setup-with-nginx/#comments</comments>
		<pubDate>Sun, 07 Mar 2010 02:17:51 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[Snippet]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[nginx]]></category>

		<guid isPermaLink="false">http://andrew.io/weblog/?p=206</guid>
		<description><![CDATA[A small nginx configuration snippet to round robin a django setup.]]></description>
			<content:encoded><![CDATA[<p>A small nginx configuration snippet to <a href='http://smallpy.posterous.com/round-robin-django-setup-with-nginx'>round robin a django setup</a>.</p>
<img src="http://feeds.feedburner.com/~r/andrewio/weblog/~4/DfpTNvI_nCU" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrew.io/weblog/2010/03/round-robin-django-setup-with-nginx/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://andrew.io/weblog/2010/03/round-robin-django-setup-with-nginx/</feedburner:origLink></item>
		<item>
		<title>Presenting django-devserver, a better runserver.</title>
		<link>http://feeds.andrew.io/~r/andrewio/weblog/~3/7Q84I4LRpz4/</link>
		<comments>http://andrew.io/weblog/2010/03/presenting-django-devserver-a-better-runserver/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 17:17:07 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[sql]]></category>

		<guid isPermaLink="false">http://andrew.io/weblog/?p=204</guid>
		<description><![CDATA[The most annoying thing to me about django&#8217;s runserver is lack of sql output in the terminal. django-devserver provides sql output, and does it nicely with syntax coloring.]]></description>
			<content:encoded><![CDATA[<p>The most annoying thing to me about django&#8217;s runserver is lack of sql output in the terminal.  <a href='http://www.davidcramer.net/code/1174/presenting-django-devserver-a-better-runserver.html'>django-devserver provides sql output</a>, and does it nicely with syntax coloring.</p>
<img src="http://feeds.feedburner.com/~r/andrewio/weblog/~4/7Q84I4LRpz4" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrew.io/weblog/2010/03/presenting-django-devserver-a-better-runserver/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://andrew.io/weblog/2010/03/presenting-django-devserver-a-better-runserver/</feedburner:origLink></item>
		<item>
		<title>Django query set iterator – for really large, querysets</title>
		<link>http://feeds.andrew.io/~r/andrewio/weblog/~3/_h1KWFzNNPo/</link>
		<comments>http://andrew.io/weblog/2010/03/django-query-set-iterator-%e2%80%93-for-really-large-querysets/#comments</comments>
		<pubDate>Sat, 06 Mar 2010 17:07:52 +0000</pubDate>
		<dc:creator>andrew</dc:creator>
				<category><![CDATA[Aside]]></category>
		<category><![CDATA[Python]]></category>
		<category><![CDATA[django]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[postgresql]]></category>
		<category><![CDATA[queryset]]></category>

		<guid isPermaLink="false">http://andrew.io/weblog/?p=202</guid>
		<description><![CDATA[A solution for dealing with very large querysets in django when memory is a limiting constraint, with some nice discussion in the comments about why limit and offset are not friendly to the database.]]></description>
			<content:encoded><![CDATA[<p>A <a href='http://www.mellowmorning.com/2010/03/03/django-query-set-iterator-for-really-large-querysets/'>solution for dealing with very large querysets in django</a> when memory is a limiting constraint, with some nice discussion in the comments about why limit and offset are not friendly to the database.</p>
<img src="http://feeds.feedburner.com/~r/andrewio/weblog/~4/_h1KWFzNNPo" height="1" width="1"/>]]></content:encoded>
			<wfw:commentRss>http://andrew.io/weblog/2010/03/django-query-set-iterator-%e2%80%93-for-really-large-querysets/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		<feedburner:origLink>http://andrew.io/weblog/2010/03/django-query-set-iterator-%e2%80%93-for-really-large-querysets/</feedburner:origLink></item>
	</channel>
</rss><!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->

