<?xml version="1.0" encoding="utf-8"?>
<?xml-stylesheet type="text/xsl" href="../assets/xml/rss.xsl" media="all"?><rss xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:dc="http://purl.org/dc/elements/1.1/"><channel><title>The Standard Output (python)</title><link>http://thestandardoutput.com/</link><description></description><atom:link href="http://thestandardoutput.com/tag/python.xml" type="application/rss+xml" rel="self"></atom:link><language>en</language><lastBuildDate>Mon, 12 Oct 2015 07:59:00 GMT</lastBuildDate><generator>https://getnikola.com/</generator><docs>http://blogs.law.harvard.edu/tech/rss</docs><item><title>A note on migrating python virtual environments</title><link>http://thestandardoutput.com/posts/note-on-migrating-python-virtual-environments/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;The engine that builds this blog is called Nikola it's written in Python. I
write the blog and run the Nikola compiler to build the site inside a Python
virtual environment.&lt;/p&gt;
&lt;p&gt;Up until recently I was doing this work on a machine running the latest Arch
Linux and Python 2.7.8, but I have recently rebuilt that machine to run Debian
8, whose default Python interpreter is currently at version 2.7.6 and I copied
my virtual environments to the new OS install.&lt;/p&gt;
&lt;p&gt;This caused me a problem with my virtual environments that manifested itself as
the following error when I tried to run any Python code from within the active
virtual environment:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;pip&lt;/span&gt; &lt;span class="n"&gt;freeze&lt;/span&gt;
&lt;span class="n"&gt;Traceback&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;most&lt;/span&gt; &lt;span class="n"&gt;recent&lt;/span&gt; &lt;span class="n"&gt;call&lt;/span&gt; &lt;span class="n"&gt;last&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
  &lt;span class="n"&gt;File&lt;/span&gt; &lt;span class="s"&gt;"/home/jonasg/.virtualenvs/tso/bin/pip"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="mi"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;pip&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;main&lt;/span&gt;
  &lt;span class="n"&gt;File&lt;/span&gt; &lt;span class="s"&gt;"/home/jonasg/.virtualenvs/tso/local/lib/python2.7/site-packages/pip/__init__.py"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="mi"&gt;11&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;pip.vcs&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;git&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;mercurial&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;subversion&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;bazaar&lt;/span&gt;  &lt;span class="c"&gt;# noqa&lt;/span&gt;
  &lt;span class="n"&gt;File&lt;/span&gt; &lt;span class="s"&gt;"/home/jonasg/.virtualenvs/tso/local/lib/python2.7/site-packages/pip/vcs/mercurial.py"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;pip.download&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;path_to_url&lt;/span&gt;
  &lt;span class="n"&gt;File&lt;/span&gt; &lt;span class="s"&gt;"/home/jonasg/.virtualenvs/tso/local/lib/python2.7/site-packages/pip/download.py"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="mi"&gt;2&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;email.utils&lt;/span&gt;
  &lt;span class="n"&gt;File&lt;/span&gt; &lt;span class="s"&gt;"/usr/lib/python2.7/email/utils.py"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="mi"&gt;32&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;email._parseaddr&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;quote&lt;/span&gt;
  &lt;span class="n"&gt;File&lt;/span&gt; &lt;span class="s"&gt;"/usr/lib/python2.7/email/_parseaddr.py"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="mi"&gt;16&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;time&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nn"&gt;calendar&lt;/span&gt;
  &lt;span class="n"&gt;File&lt;/span&gt; &lt;span class="s"&gt;"/usr/lib/python2.7/calendar.py"&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;line&lt;/span&gt; &lt;span class="mi"&gt;9&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="ow"&gt;in&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="n"&gt;module&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;datetime&lt;/span&gt;
&lt;span class="ne"&gt;ImportError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;No&lt;/span&gt; &lt;span class="n"&gt;module&lt;/span&gt; &lt;span class="n"&gt;named&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;

&lt;span class="err"&gt;$&lt;/span&gt; &lt;span class="n"&gt;nikola&lt;/span&gt; &lt;span class="n"&gt;build&lt;/span&gt;
&lt;span class="o"&gt;...&lt;/span&gt;
&lt;span class="ne"&gt;ImportError&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="n"&gt;No&lt;/span&gt; &lt;span class="n"&gt;module&lt;/span&gt; &lt;span class="n"&gt;named&lt;/span&gt; &lt;span class="n"&gt;datetime&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;This happens because my virtual environments had a different version of
&lt;code&gt;/usr/bin/python2.7&lt;/code&gt; (the one from Arch Linux) that — unlike the new binary —
does not include the &lt;code&gt;datetime&lt;/code&gt; built-in, and therefore generates an error when
it cannot find it on disk anywhere. The new interpreter seems to import it
without any file I/O (try running it under strace to check).&lt;/p&gt;
&lt;p&gt;The fix for this issue is to activate the virtual environment you are having
problems with and run the following:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nv"&gt;$ &lt;/span&gt;cp /usr/bin/python2.7 &lt;span class="k"&gt;$(&lt;/span&gt;which python2.7&lt;span class="k"&gt;)&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;There are other ways to fix this issue, but I like the one above rather than
re-initializing the &lt;code&gt;virtualenv&lt;/code&gt; because I use &lt;code&gt;virtualenvwrapper&lt;/code&gt; which does
NOT gererate the virtual environment within the present directory.&lt;/p&gt;
&lt;p&gt;Hope this helps!&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><category>python</category><guid>http://thestandardoutput.com/posts/note-on-migrating-python-virtual-environments/</guid><pubDate>Wed, 18 Feb 2015 09:13:52 GMT</pubDate></item><item><title>Free GeoIp location web service</title><link>http://thestandardoutput.com/posts/free-geoip-location-web-service/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;This weekend I found a really cool web service at
&lt;a href="http://freegeoip.net/"&gt;FreeGeoIp.net&lt;/a&gt;. Their API is really simple... just send
a HTTP GET request to:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;http://freegeoip.net/{format}/{ip_or_hostname}
&lt;/pre&gt;


&lt;p&gt;Here are some of the implementation details:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;SSL is supported&lt;/li&gt;
&lt;li&gt;Formats are csv, json, and xml&lt;/li&gt;
&lt;li&gt;IP is optional. It defaults to your current IP.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;I quickly implemented a comnmand line client written in Python 3. It uses the
awesome &lt;a href="http://docs.python-requests.org/en/latest/"&gt;requests&lt;/a&gt; library and
ElementTree to parse the resulting XML response. Here's the code...&lt;/p&gt;
&lt;pre class="code literal-block"&gt;def main():
    args = parse_args()

    MYIP_URL = 'http://freegeoip.net/xml/'
    MYIP_HEADERS = {'Accept': 'application/xml'}

    if args.ip is not None:
        MYIP_URL = MYIP_URL + args.ip

    rspn = requests.get(MYIP_URL, headers=MYIP_HEADERS)
    tree = etree.ElementTree(etree.fromstring(rspn.text))
    root = tree.getroot()

    ip = root.find('Ip')
    cntr = root.find('CountryName')
    reg = root.find('RegionName')
    city = root.find('City')

    print('Your Current IP: %s' % ip.text)
    print('You appear to be in %s, %s, %s' % (city.text, reg.text, cntr.text))
&lt;/pre&gt;


&lt;p&gt;Or you can get the
&lt;a href="https://github.com/gorauskas/Hacks/blob/master/python/myip"&gt;whole code&lt;/a&gt; from my
&lt;a href="https://github.com/gorauskas"&gt;github profile&lt;/a&gt;.&lt;/p&gt;&lt;/div&gt;</description><category>linux</category><category>programming</category><category>python</category><guid>http://thestandardoutput.com/posts/free-geoip-location-web-service/</guid><pubDate>Thu, 04 Sep 2014 05:54:04 GMT</pubDate></item><item><title>Quick Ref: Python Virtualenv use</title><link>http://thestandardoutput.com/posts/quick-ref-python-virtualenv-use/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;Supposing you have a clean install of a Debian-based distro such as Debian 7
proper or Xubuntu 14.04, this notes will walk you through setting up a Python
development environment where you can leverage the power of Virtualenv through
Virtualenvwrapper.&lt;/p&gt;
&lt;h3&gt;Why virtualenv?&lt;/h3&gt;
&lt;p&gt;When you code in python you will quickly find out that different projects have
different requirements for the python version you need to use and also the
versions of libraries you need to use. Virtualenv will allow you to
compartmentalize the requirements on a per project basis without making you
install libraries and python versions globally or system-wide.&lt;/p&gt;
&lt;h3&gt;Ok, ok... Here are the goods...&lt;/h3&gt;
&lt;p&gt;You have your new shinny install of Debian which comes with a fairly recent
version of python pre-installed (somewhere above 2.7.3). Now you need to install
a package manager for python and the one I use is pip.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo apt-get install python-pip
&lt;/pre&gt;


&lt;p&gt;Once you have pip installed, you will need to also install virtualenv, like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;sudo pip install virtualenvwrapper
&lt;/pre&gt;


&lt;p&gt;Virtualenvwrapper is a very nice layer on top of virtualenv that makes working
with it much more intuitive and convenient.&lt;/p&gt;
&lt;p&gt;Next, you may want to automate a couple of things like I did. First, create a
&lt;code&gt;~/.virtualenvs&lt;/code&gt; directory. This is where virtualenvwrapper will keep track of
your environments. Then open you &lt;code&gt;.bashrc&lt;/code&gt; file and add a few lines to it:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="x"&gt;export WORKON_HOME=&lt;/span&gt;&lt;span class="p"&gt;$&lt;/span&gt;&lt;span class="nv"&gt;HOME&lt;/span&gt;&lt;span class="x"&gt;/.virtualenvs&lt;/span&gt;
&lt;span class="x"&gt;if [ -f /usr/local/bin/virtualenvwrapper_lazy.sh ]; then&lt;/span&gt;
&lt;span class="x"&gt;    . /usr/local/bin/virtualenvwrapper_lazy.sh&lt;/span&gt;
&lt;span class="x"&gt;fi&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;Now you are ready to start working, so open a new terminal, setup a virtual
environment, and start cranking out some python code. Here's a quick reference
for virtualenvwrapper:&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Start new virtual environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mkvirtualenv [env-name]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Leave the current virtual environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;deactivate&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;List all available virtual environments?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;workon&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;lsvirtualenv -b&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Enter an existing virtual environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;workon [env-name]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;List packages installed in current virtual environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;pip freeze&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Remove a virtual environment?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;rmvirtualenv [env-name]&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;&lt;strong&gt;Start a virtual environment with specific python version?&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;&lt;code&gt;mkvirtualenv [env-name] -p /usr/bin/python3.4&lt;/code&gt;&lt;/p&gt;
&lt;p&gt;Replace &lt;code&gt;[env-name]&lt;/code&gt; above with your actual environment name and enjoy!&lt;/p&gt;&lt;/div&gt;</description><category>debian</category><category>linux</category><category>programming</category><category>python</category><guid>http://thestandardoutput.com/posts/quick-ref-python-virtualenv-use/</guid><pubDate>Fri, 06 Jun 2014 07:55:33 GMT</pubDate></item><item><title>Convert an Integer to a Binary Representation</title><link>http://thestandardoutput.com/posts/convert-an-integer-to-a-binary-representation/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;Here is a quick way to convert any integer &lt;code&gt;n&lt;/code&gt; into a string that represents the
&lt;code&gt;n&lt;/code&gt; integer in binary notation:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;def dec_to_bin(n, bits=32):
    return ''.join([str((n &amp;amp;gt;&amp;amp;gt; y) &amp;amp;amp; 1) for y in range(bits - 1, -1, -1)])
&lt;/pre&gt;


&lt;p&gt;What's going on in the above code? This can be better explained if we read the
&lt;code&gt;return&lt;/code&gt; line in the &lt;code&gt;dec_to_bin&lt;/code&gt; function backwards. First we create a list of
integers from 31 to 0 in order to iterate through it. This list is created with
the built-in &lt;code&gt;range&lt;/code&gt; function and it uses the number of bits that we passed into
the function, with a default being 32. Next, we iterate through the list with
each number being represented by &lt;code&gt;y&lt;/code&gt;. Then we take the number parameter &lt;code&gt;n&lt;/code&gt;,
which is the number we want to transform to binary, and we shift its bits to the
right by &lt;code&gt;y&lt;/code&gt; places. Then we apply a bitwise &lt;code&gt;and&lt;/code&gt; operation on the result of
that right shift and the literal value of 1. This &lt;code&gt;and&lt;/code&gt; operation tells us if
the bit at location &lt;code&gt;y&lt;/code&gt; is turned on or off. We then make a string out of the
value and append it to the string that we are building to return to the
user. This is a perfect example of Python's conciseness and the power of list
comprehensions.&lt;/p&gt;
&lt;p&gt;You can use the code above like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&amp;gt;&amp;gt;&amp;gt; print dec_to_bin(255)
00000000000000000000000011111111
&lt;/pre&gt;


&lt;p&gt;Enjoy!&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><category>python</category><guid>http://thestandardoutput.com/posts/convert-an-integer-to-a-binary-representation/</guid><pubDate>Mon, 15 Apr 2013 21:17:49 GMT</pubDate></item><item><title>Delicious to Blogger Python Script</title><link>http://thestandardoutput.com/posts/delicious-to-blogger-python-script/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;Readers of this blog (that means my wife and my mom) will notice that there is a
&lt;a href="http://www.thestandardoutput.com/2010/10/delicious-grep-links-blogger-for-2010-10-09/"&gt;new post&lt;/a&gt;
with a weird title right before this one (in chronological order). What's going
on with that?&lt;/p&gt;
&lt;p&gt;On a weekly basis I save several links to
&lt;a href="http://www.delicious.com/gorauskas"&gt;my Delicious account&lt;/a&gt; and I consider that
to be a pretty good representation of what is going on in mind at the time. The
only problem is that sometimes I link to something and then it gets lost in the
black hole that Delicious can sometimes be. There are situations when I saved a
link and didn't go back to look for it until a year later.&lt;/p&gt;
&lt;p&gt;So I thought that I wanted to group these links together and bring them up front
and center in my radar. I just want to have a little better visibility into what
I am thinking at the time. This is a task that can be easily automated and I
wrote a script in Python to do that for
me. &lt;a href="http://github.com/gorauskas/delicious-greplinks-blogger"&gt;You can look at the code here&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Basically, the script looks at the links posted to Delicious since a certain
date, downloads the information about those links and creates a blog post for my
&lt;a href="https://www.blogger.com/start"&gt;Blogger&lt;/a&gt; account based on the
&lt;a href="http://www.delicious.com/"&gt;Delicious&lt;/a&gt; links.&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><category>python</category><category>quick hacks</category><guid>http://thestandardoutput.com/posts/delicious-to-blogger-python-script/</guid><pubDate>Sat, 09 Oct 2010 21:19:00 GMT</pubDate></item><item><title>Errors with the prepopulate_from SlugField parameter in Django 1.2.1</title><link>http://thestandardoutput.com/posts/errors-with-the-prepopulate_from-slugfield-parameter-in-django-121/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;I recently upgraded to Django version 1.2.1 and I immediatelly noticed that some
of my models were broken with the following error:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="nt"&gt;C&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;&lt;span class="err"&gt;\&lt;/span&gt;&lt;span class="nt"&gt;test&lt;/span&gt;&lt;span class="o"&gt;&amp;amp;&lt;/span&gt;&lt;span class="nt"&gt;gt&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;&lt;span class="nt"&gt;python&lt;/span&gt; &lt;span class="nt"&gt;manage&lt;/span&gt;&lt;span class="nc"&gt;.py&lt;/span&gt; &lt;span class="nt"&gt;syncdb&lt;/span&gt;

&lt;span class="nt"&gt;Traceback&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;most&lt;/span&gt; &lt;span class="nt"&gt;recent&lt;/span&gt; &lt;span class="nt"&gt;call&lt;/span&gt; &lt;span class="nt"&gt;last&lt;/span&gt;&lt;span class="o"&gt;):&lt;/span&gt;
  &lt;span class="nt"&gt;File&lt;/span&gt; &lt;span class="s2"&gt;"manage.py"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;11&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;module&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;execute_manager&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;settings&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;File&lt;/span&gt; &lt;span class="s2"&gt;"C:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\core\management\__init__.py"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;438&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;execute_manager&lt;/span&gt;
    &lt;span class="nt"&gt;utility&lt;/span&gt;&lt;span class="nc"&gt;.execute&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
  &lt;span class="nt"&gt;File&lt;/span&gt; &lt;span class="s2"&gt;"C:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\core\management\__init__.py"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;379&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;execute&lt;/span&gt;
    &lt;span class="nt"&gt;self&lt;/span&gt;&lt;span class="nc"&gt;.fetch_command&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;subcommand&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nc"&gt;.run_from_argv&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;self&lt;/span&gt;&lt;span class="nc"&gt;.argv&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;File&lt;/span&gt; &lt;span class="s2"&gt;"C:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\core\management\base.py"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;191&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;run_from_argv&lt;/span&gt;
    &lt;span class="nt"&gt;self&lt;/span&gt;&lt;span class="nc"&gt;.execute&lt;/span&gt;&lt;span class="o"&gt;(*&lt;/span&gt;&lt;span class="nt"&gt;args&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="nt"&gt;options&lt;/span&gt;&lt;span class="nc"&gt;.__dict__&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;File&lt;/span&gt; &lt;span class="s2"&gt;"C:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\core\management\base.py"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;217&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;execute&lt;/span&gt;
    &lt;span class="nt"&gt;self&lt;/span&gt;&lt;span class="nc"&gt;.validate&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
  &lt;span class="nt"&gt;File&lt;/span&gt; &lt;span class="s2"&gt;"C:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\core\management\base.py"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;245&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;validate&lt;/span&gt;
    &lt;span class="nt"&gt;num_errors&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;get_validation_errors&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;s&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;app&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;File&lt;/span&gt; &lt;span class="s2"&gt;"C:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\core\management\validation.py"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;28&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;get_validation_errors&lt;/span&gt;
    &lt;span class="nt"&gt;for&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;app_name&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;error&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;get_app_errors&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;&lt;span class="nc"&gt;.items&lt;/span&gt;&lt;span class="o"&gt;():&lt;/span&gt;
  &lt;span class="nt"&gt;File&lt;/span&gt; &lt;span class="s2"&gt;"C:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\db\models\loading.py"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;146&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;get_app_errors&lt;/span&gt;
    &lt;span class="nt"&gt;self&lt;/span&gt;&lt;span class="nc"&gt;._populate&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt;
  &lt;span class="nt"&gt;File&lt;/span&gt; &lt;span class="s2"&gt;"C:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\db\models\loading.py"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;61&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;_populate&lt;/span&gt;
    &lt;span class="nt"&gt;self&lt;/span&gt;&lt;span class="nc"&gt;.load_app&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;app_name&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;True&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;File&lt;/span&gt; &lt;span class="s2"&gt;"C:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\db\models\loading.py"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;78&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;load_app&lt;/span&gt;
    &lt;span class="nt"&gt;models&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;import_module&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="s1"&gt;'.models'&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;app_name&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;File&lt;/span&gt; &lt;span class="s2"&gt;"C:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\utils\importlib.py"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;35&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;import_module&lt;/span&gt;
    &lt;span class="nt"&gt;__import__&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;name&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;File&lt;/span&gt; &lt;span class="s2"&gt;"..\tso\blog\models.py"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;50&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;module&lt;/span&gt;&lt;span class="o"&gt;&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;class&lt;/span&gt; &lt;span class="nt"&gt;Category&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;models&lt;/span&gt;&lt;span class="nc"&gt;.Model&lt;/span&gt;&lt;span class="o"&gt;):&lt;/span&gt;
  &lt;span class="nt"&gt;File&lt;/span&gt; &lt;span class="s2"&gt;"..\tso\blog\models.py"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;53&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;Category&lt;/span&gt;
    &lt;span class="nt"&gt;slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="nt"&gt;models&lt;/span&gt;&lt;span class="nc"&gt;.SlugField&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;unique&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="nt"&gt;True&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;prepopulate_from&lt;/span&gt;&lt;span class="o"&gt;=(&lt;/span&gt;&lt;span class="s1"&gt;'title'&lt;/span&gt;&lt;span class="o"&gt;,),&lt;/span&gt; &lt;span class="nt"&gt;help_text&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'Used in the category URL. Must be unique'&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;File&lt;/span&gt; &lt;span class="s2"&gt;"C:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\db\models\fields\__init__.py"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;988&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;__init__&lt;/span&gt;
    &lt;span class="nt"&gt;super&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;SlugField&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;self&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nc"&gt;.__init__&lt;/span&gt;&lt;span class="o"&gt;(*&lt;/span&gt;&lt;span class="nt"&gt;args&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="nt"&gt;kwargs&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
  &lt;span class="nt"&gt;File&lt;/span&gt; &lt;span class="s2"&gt;"C:\Python26\lib\site-packages\django-1.2.1-py2.6.egg\django\db\models\fields\__init__.py"&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;line&lt;/span&gt; &lt;span class="nt"&gt;542&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;in&lt;/span&gt; &lt;span class="nt"&gt;__init__&lt;/span&gt;
    &lt;span class="nt"&gt;super&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;CharField&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;self&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nc"&gt;.__init__&lt;/span&gt;&lt;span class="o"&gt;(*&lt;/span&gt;&lt;span class="nt"&gt;args&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="o"&gt;**&lt;/span&gt;&lt;span class="nt"&gt;kwargs&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;span class="nt"&gt;TypeError&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="nt"&gt;__init__&lt;/span&gt;&lt;span class="o"&gt;()&lt;/span&gt; &lt;span class="nt"&gt;got&lt;/span&gt; &lt;span class="nt"&gt;an&lt;/span&gt; &lt;span class="nt"&gt;unexpected&lt;/span&gt; &lt;span class="nt"&gt;keyword&lt;/span&gt; &lt;span class="nt"&gt;argument&lt;/span&gt; &lt;span class="s1"&gt;'prepopulate_from'&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;So I did a little bit of research on this problem and I found the following
explanation for what is going on:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Changed prepopulate_from to be defined in the Admin class, not database
field classes&lt;/strong&gt;&lt;/p&gt;
&lt;p&gt;As of [4446], the prepopulate_from option to database fields no longer
exists. It's been discontinued in favor of the new prepopulated_fields option
on class Admin. The new prepopulated_fields option, if given, should be a
dictionary mapping field names to lists/tuples of field names. This change was
made in an effort to remove admin-specific options from the model
itself. Here's an example comparing old syntax and new syntax:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="c"&gt;# OLD:&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;first_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CharField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;last_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CharField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CharField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;prepopulate_from&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'first_name'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'last_name'&lt;/span&gt;&lt;span class="p"&gt;))&lt;/span&gt;

    &lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Admin&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;
        &lt;span class="k"&gt;pass&lt;/span&gt;

&lt;span class="c"&gt;# NEW:&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyModel&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Model&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;first_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CharField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;last_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CharField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
    &lt;span class="n"&gt;slug&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;models&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;CharField&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;max_length&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;60&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

&lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;django.contrib&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;admin&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;MyModelAdmin&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;admin&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ModelAdmin&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="n"&gt;prepopulated_fields&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;&lt;span class="s"&gt;'slug'&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;'first_name'&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="s"&gt;'last_name'&lt;/span&gt;&lt;span class="p"&gt;)}&lt;/span&gt;

&lt;span class="n"&gt;admin&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;site&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;register&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;MyModel&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MyModelAdmin&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;/pre&gt;


&lt;/blockquote&gt;
&lt;p&gt;The above is taken from the Django wiki page that talks about
&lt;a href="http://code.djangoproject.com/wiki/NewformsAdminBranch"&gt;the newforms-admin branch&lt;/a&gt;&lt;/p&gt;&lt;/div&gt;</description><category>django</category><category>programming</category><category>python</category><guid>http://thestandardoutput.com/posts/errors-with-the-prepopulate_from-slugfield-parameter-in-django-121/</guid><pubDate>Tue, 06 Jul 2010 02:26:00 GMT</pubDate></item><item><title>This is why the command line will never die</title><link>http://thestandardoutput.com/posts/this-is-why-the-command-line-will-never-die/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;A while back I wrote about
&lt;a href="http://thestandardoutput.com/2008/02/the-new-command-line/"&gt;the address line of the browser being the new command line&lt;/a&gt;. It
turns out I was wrong. The command line itself is the newcommand line.&lt;/p&gt;
&lt;p&gt;I ran into &lt;a href="http://code.google.com/p/googlecl/"&gt;this Google Code project&lt;/a&gt; today
via my tweeter feed. GoogleCL allows the nerd in me to interact directly with
several Google services from a shell prompt. It includes interfaces to Blogger,
Picasa, Calendar, Contacts, Docs, and YouTube. You can find several
&lt;a href="http://code.google.com/p/googlecl/wiki/ExampleScripts"&gt;scripting examples&lt;/a&gt;
under the project's Wiki.&lt;/p&gt;
&lt;p&gt;The fact that this is a python script and it's open source is really interesting
to me. I am thinking that I need to integrate all of this into an Emacs
mode.&lt;/p&gt;&lt;/div&gt;</description><category>commentary</category><category>emacs</category><category>programming</category><category>python</category><category>quick hacks</category><category>review</category><guid>http://thestandardoutput.com/posts/this-is-why-the-command-line-will-never-die/</guid><pubDate>Sat, 19 Jun 2010 09:07:00 GMT</pubDate></item><item><title>Generate .NET Assemblies from Iron Python</title><link>http://thestandardoutput.com/posts/generate-net-assemblies-from-iron-python/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;The other day I was talking to a fellow programmer and the question of compiling
Iron Python code into .NET assemblies came up. So what if you have an Iron
Python script that you want to run and then have the &lt;code&gt;ipy&lt;/code&gt; interpreter output an
assembly that you can run on other machines. How do you do that?&lt;/p&gt;
&lt;p&gt;There are several ways to approach the problem. One way is to use an IDE, but
IDE support for Iron Python is still a bit lacking. One IDE that provides Iron
Python great support is
&lt;a href="http://www.icsharpcode.net/opensource/sd/"&gt;SharpDevelop&lt;/a&gt; create a Iron Python
project, write your code as you normally would and then build your project. The
compile assemblies can then be found in the build output folders for that
project.&lt;/p&gt;
&lt;p&gt;The other way to do this is through a tool that ships with IronPython called Pyc
or the Python Command-Line Compiler. If you installed the latest version 2.6 of
IronPython, then &lt;code&gt;pyc.py&lt;/code&gt; will be available at &lt;code&gt;C:\Program Files
(x86)\IronPython 2.6\Tools\Scripts&lt;/code&gt; or wherever you installed IronPython
on your system. If you have earlier versions of IronPython then
&lt;code&gt;pyc.py&lt;/code&gt; will be available as a separate download in the samples
package.&lt;/p&gt;
&lt;p&gt;With &lt;code&gt;pyc.py&lt;/code&gt; you can create console or Windows assemblies from your python
scripts. Basic usage looks like this:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;ipy pyc.py /out:myprogram.exe /main:mainfile.py /target:exe program.py support.py
&lt;/pre&gt;


&lt;p&gt;The above will generate an assembly called &lt;code&gt;myprogram.exe&lt;/code&gt; (&lt;code&gt;/out&lt;/code&gt;) which is a
console application (&lt;code&gt;/target&lt;/code&gt;) and will execute the code in &lt;code&gt;mainfile.py&lt;/code&gt; first
(&lt;code&gt;/main&lt;/code&gt;) and will also include code from &lt;code&gt;program.py&lt;/code&gt; and &lt;code&gt;support.py&lt;/code&gt; in the
assembly.&lt;/p&gt;&lt;/div&gt;</description><category>iron python</category><category>programming</category><category>python</category><guid>http://thestandardoutput.com/posts/generate-net-assemblies-from-iron-python/</guid><pubDate>Fri, 26 Mar 2010 14:32:00 GMT</pubDate></item><item><title>Some Notes on Serializing Objects in Python</title><link>http://thestandardoutput.com/posts/some-notes-on-serializing-objects-in-python/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;I was playing with .NET serialization at work the other day and got curious about
how Python does it. Serialization is a little confusing in the .NET world, but
it's not an insurmountable task to grasp it. For one, there is more than a single
implementation of serialization within the .NET base class library, or namely,
&lt;code&gt;System.Xml.Serialization&lt;/code&gt; and &lt;code&gt;System.Runtime.Serialization&lt;/code&gt;, which respectively
implement XML and binary serialization. The techniques used in each
implementation are also disparate, having the binary serialization make heavy use
of class attributes, while the XML implementation uses a method call
to &lt;code&gt;XmlSerializer.Serialize&lt;/code&gt;.&lt;/p&gt;
&lt;p&gt;The Python implementation of serialization is much simpler, concise and easier to
understand. It is implemented as a Standard Library module called Pickle. The
actions to serialize and deserialize classes are implemented as simple function
class and there is no need to put attributes on classes. Let's see how it works.&lt;/p&gt;
&lt;p&gt;First import the pickle module and then declare a class called &lt;em&gt;Person&lt;/em&gt; as in the
code below:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;pickle&lt;/span&gt;

&lt;span class="k"&gt;class&lt;/span&gt; &lt;span class="nc"&gt;Person&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="nb"&gt;object&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
    &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;__init__&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;first_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;last_name&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="bp"&gt;None&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;first_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;first_name&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;last_name&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;last_name&lt;/span&gt;
        &lt;span class="bp"&gt;self&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;age&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;age&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;Now create two instances of the &lt;em&gt;Person&lt;/em&gt; class above and place them in alist.&lt;/p&gt;
&lt;pre class="code literal-block"&gt;p1 = Person('Jane', 'Doe', 26)
p2 = Person('John', 'Hancock', 33)
people = []
people.append(p1)
people.append(p2)
&lt;/pre&gt;


&lt;p&gt;Next serialize the list to a file and then read it back into a new list. First
serialize the list:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;fname = 'peoplelist.dat'
f1 = open(fname, 'wb')
pickle.dump(people, f1)
f1.close()
&lt;/pre&gt;


&lt;p&gt;Finally, read the contents of the serialized file back into a new list and print
out the name and age of each person:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;f2 = open(fname)
new_people = pickle.load(f2)
for person in new_people:
    print '%s %s is %d years old.' % (person.first_name, person.last_name, person.age)
&lt;/pre&gt;


&lt;p&gt;That's it... Serialization in Python is just too easy!&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><category>python</category><guid>http://thestandardoutput.com/posts/some-notes-on-serializing-objects-in-python/</guid><pubDate>Sat, 16 Jan 2010 18:40:00 GMT</pubDate></item><item><title>Some thoughts on Python and Unladen Swallow</title><link>http://thestandardoutput.com/posts/some-thoughts-on-python-and-unladen-swallow/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;Between Twitter and the blogosphere, I have been hearing a lot about
&lt;a href="http://code.google.com/p/unladen-swallow/"&gt;Unladen Swallow&lt;/a&gt; lately. For those
who don't know, Unladen Swallow is an experimental &lt;em&gt;&lt;strong&gt;branch&lt;/strong&gt;&lt;/em&gt; of
Python that aims at improving performance of the language.  In their own words,
Unladen Swallow is &lt;em&gt;"An optimization branch of CPython, intended to be fully
compatible and significantly faster."&lt;/em&gt;&lt;/p&gt;
&lt;p&gt;I wanted to find out more and started reading their
&lt;a href="http://code.google.com/p/unladen-swallow/wiki/ProjectPlan"&gt;Project Plan&lt;/a&gt; page
on Google Code. I think their goals are commendable, as you may see for
yourself, and number 5 below explains why I added bold face the word &lt;em&gt;branch&lt;/em&gt;
above:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;Produce a version of Python at least 5x faster than CPython.&lt;/li&gt;
&lt;li&gt;Python application performance should be stable.&lt;/li&gt;
&lt;li&gt;Maintain source-level compatibility with CPython applications.&lt;/li&gt;
&lt;li&gt;Maintain source-level compatibility with CPython extension modules.&lt;/li&gt;
&lt;li&gt;We do not want to maintain a Python implementation forever; we view our work
    as a branch, not a fork.&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;This is all fine and dandy, and the list above has made the rounds on the
blogs. But what does it all mean?  What follows is my impressions of the most
important points that the Unladen Swallow branch is addressing.  &lt;/p&gt;&lt;h5&gt;A New
Virtual Machine&lt;/h5&gt; The goal is to eventually replace the Python 2.6.1 virtual
machine with a just-in-time compiler built for the &lt;a href="http://llvm.org/"&gt;LLVM&lt;/a&gt;. The
rest of the Python runtime would be left untouched. The key benefits of this
approach are that is a register-based machine and those perform better than
stack machines, which is what the current Python VM is implemented as.
&lt;p&gt;The internals of the implementation will assume at the outset that the machine
has multiple cores. For instance, very aggressive optimization of code is
assigned to a secondary cores while compilation occurs on other cores. The
garbage collector for Unladen Swallow will also be implemented to utilize
multiple cores.&lt;/p&gt;
&lt;h3&gt;The Global Interpreter Lock&lt;/h3&gt;
&lt;p&gt;While Python has had threading for a while, it is not a true multi-threading
implementation. This is because of the existence of the GIL.
&lt;a href="http://www.dabeaz.com/"&gt;Dave Beazley&lt;/a&gt; has written about the
&lt;a href="http://www.dabeaz.com/python/GIL.pdf"&gt;GIL and how it works&lt;/a&gt; several times and
you should read his
&lt;em&gt;&lt;a href="http://www.dabeaz.com/blog/2010/01/python-gil-visualized.html"&gt;"The Python GIL Visualized"&lt;/a&gt;&lt;/em&gt;
article to find out more about why the GIL keeps Python from having a real
multi-threaded runtime.&lt;/p&gt;
&lt;p&gt;I bring up the GIL here because the folks working on Unladen Swallow plan on
removing the GIL from Python, although they are not very optimistic about
it. And even if they are not able to remove the GIL completely there may be
other optimizations in the garbage collector reference counting mechanism that
may yield some improvements in the threading area.&lt;/p&gt;
&lt;p&gt;Anyway, these are the two major points I take away from the Unladen Swallow plan
of record. These changes seem pretty big to me and a major risk of doing this
kind of work is that your changes are rejected by the community. However, the
Unladen Swallow team is sponsored by Google who also employs Guido, so I'm sure
that those guys are talking amongst themselves.&lt;/p&gt;
&lt;p&gt;Thanks for reading this, go read the
&lt;a href="http://code.google.com/p/unladen-swallow/wiki/ProjectPlan"&gt;project plan&lt;/a&gt; and
let me know what you think.&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><category>python</category><guid>http://thestandardoutput.com/posts/some-thoughts-on-python-and-unladen-swallow/</guid><pubDate>Sat, 16 Jan 2010 09:16:00 GMT</pubDate></item><item><title>Iron Python: How to talk to the .NET Framework</title><link>http://thestandardoutput.com/posts/iron-python-how-to-talk-to-the-net-framework/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;&lt;a href="http://www.codeplex.com/Wiki/View.aspx?ProjectName=IronPython"&gt;Iron Python&lt;/a&gt; is
an implementation of the &lt;a href="http://www.python.org/"&gt;Python&lt;/a&gt; programming language
that runs on the
&lt;a href="http://en.wikipedia.org/wiki/Common_Language_Runtime"&gt;Common Language Runtime&lt;/a&gt;
and can use the classes of the
&lt;a href="http://en.wikipedia.org/wiki/.NET_Framework"&gt;.NET Framework&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Here are some quick notes on how to interface with the framework from Iron
Python:&lt;/p&gt;
&lt;ol&gt;
&lt;li&gt;Open the Iron Python REPL.&lt;/li&gt;
&lt;li&gt;Import the &lt;code&gt;clr&lt;/code&gt; module.&lt;/li&gt;
&lt;li&gt;Add a reference to the .NET Namespaces you want to interact with.&lt;/li&gt;
&lt;li&gt;Start using the .NET classes as if they were Python classes.&lt;/li&gt;
&lt;/ol&gt;
&lt;p&gt;Below I transcribed a little code snippet for you to use as an example. I also
provide a screen capture of the sample and the outcome of running it.&lt;/p&gt;
&lt;pre class="code literal-block"&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="nn"&gt;clr&lt;/span&gt;
 &lt;span class="n"&gt;clr&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;AddReference&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"System.Windows.Forms"&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
 &lt;span class="kn"&gt;from&lt;/span&gt; &lt;span class="nn"&gt;System.Windows.Forms&lt;/span&gt; &lt;span class="kn"&gt;import&lt;/span&gt; &lt;span class="n"&gt;Application&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;MessageBox&lt;/span&gt;

 &lt;span class="n"&gt;f&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Form&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
 &lt;span class="n"&gt;b&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;Button&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;

 &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Hello World!"&lt;/span&gt;
 &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Text&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="s"&gt;"Click Me!"&lt;/span&gt;

 &lt;span class="k"&gt;def&lt;/span&gt; &lt;span class="nf"&gt;clicked&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;sender&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="n"&gt;args&lt;/span&gt;&lt;span class="p"&gt;):&lt;/span&gt;
     &lt;span class="n"&gt;MessageBox&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Show&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="s"&gt;"Hello, Again..."&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;

 &lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Click&lt;/span&gt; &lt;span class="o"&gt;+=&lt;/span&gt; &lt;span class="n"&gt;clicked&lt;/span&gt;
 &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Controls&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Add&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;b&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
 &lt;span class="n"&gt;f&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="n"&gt;ShowDialog&lt;/span&gt;&lt;span class="p"&gt;()&lt;/span&gt;
&lt;/pre&gt;


&lt;p&gt;&lt;a href="http://www.flickr.com/photos/gorauskas/3565205389/"&gt;&lt;img alt="Iron Python" src="http://farm4.static.flickr.com/3327/3565205389_ccd811cf67.jpg"&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Enjoy!&lt;/p&gt;&lt;/div&gt;</description><category>iron python</category><category>programming</category><category>python</category><guid>http://thestandardoutput.com/posts/iron-python-how-to-talk-to-the-net-framework/</guid><pubDate>Tue, 26 May 2009 06:00:00 GMT</pubDate></item><item><title>Ternary Operator in Python</title><link>http://thestandardoutput.com/posts/ternary-operator-in-python/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;C-like languages such as C# have a ternary operator which uses the symbols: &lt;code&gt;?&lt;/code&gt;
and &lt;code&gt;:&lt;/code&gt;, while the actual syntax looks something like this:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;string s = myBoolValue ? 'True' : 'False';
&lt;/pre&gt;


&lt;p&gt;Python doesn’t feature a ternary operator as in the C-like languages, but the
underlying behavior is supported. You can achieve this in one of two ways:&lt;/p&gt;
&lt;ul&gt;
&lt;li&gt;&lt;code&gt;s = 'True' if myBoolValue else 'False'&lt;/code&gt;&lt;/li&gt;
&lt;li&gt;&lt;code&gt;s = myBoolValue and 'True' or 'False'&lt;/code&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;p&gt;The &lt;code&gt;if&lt;/code&gt; form in number 1 above was introduced in Python 2.5 to address feature
requests for a ternary conditional form (see
&lt;a href="http://www.python.org/dev/peps/pep-0308/"&gt;PEP 308&lt;/a&gt;).&lt;/p&gt;
&lt;p&gt;The form in number 2 above is a clever way to achieve the same effect using
short circuiting. The conditional form in number 1 is the preferred form as the
technique in number 2 is error-prone.&lt;/p&gt;
&lt;h3&gt;Update: 2009-09-25&lt;/h3&gt;
&lt;p&gt;With the ternary example number 2 above there is a small caveat that didn't
occur to me until today. Consider the following code:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;(a,b) = ('abc','xyz')
print True and a or b
print False and a or b
&lt;/pre&gt;


&lt;p&gt;The above code is fine and behaves as expected. But what if the value of &lt;code&gt;a&lt;/code&gt;
turned out to be equal to a Python False?  That would give us a wrong
result... Consider the following code:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&amp;gt;&amp;gt;&amp;gt; (a,b) = ('', 'xyz')
&amp;gt;&amp;gt;&amp;gt; print True and a or b
xyz
&amp;gt;&amp;gt;&amp;gt; print False and a or b
xyz
&lt;/pre&gt;


&lt;p&gt;See the conundrum? The real trick is to make sure that the value of &lt;code&gt;a&lt;/code&gt; is never
false. One way to fix this is to turn &lt;code&gt;a&lt;/code&gt; and &lt;code&gt;b&lt;/code&gt; into lists and the whole
expression into a tuple and then read out the first element returned, like so:&lt;/p&gt;
&lt;pre class="code literal-block"&gt;&amp;gt;&amp;gt;&amp;gt; (a,b) = ('', 'xyz')
&amp;gt;&amp;gt;&amp;gt; print (True and [a] or [b])[0]

&amp;gt;&amp;gt;&amp;gt; print (False and [a] or [b])[0]
xyz
&lt;/pre&gt;


&lt;p&gt;The first print statement now returns an empty string as expected.&lt;/p&gt;&lt;/div&gt;</description><category>programming</category><category>python</category><guid>http://thestandardoutput.com/posts/ternary-operator-in-python/</guid><pubDate>Thu, 16 Apr 2009 00:13:00 GMT</pubDate></item><item><title>XO: First Impressions</title><link>http://thestandardoutput.com/posts/xo-first-impressions/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;div&gt;&lt;p&gt;I had the &lt;a href="http://laptop.org/laptop/"&gt;XO&lt;/a&gt; for a few days now and I had the
opportunity to play with it a little bit. The device is small; smaller than I
expected. And, yet, it packs a lot of punch for the size and the components
inside. It's definitely slower than your top-of-the-line two core machine, but
you are not left twiddling your thumbs while waiting for things to load.&lt;/p&gt;
&lt;p&gt;The screen presents great sharpness of image and is big enough for 99% of the
tasks that I will ever perform with it. I'm not going to use the XO for
extensive programming tasks, for instance. But the XO is great to take on trips
with the family just to check on email and surf the web.&lt;/p&gt;
&lt;p&gt;I have large hands, so the keyboard is unusable for me. Thankfully, I can easily
plug my &lt;a href="http://www.pfusystems.com/hhkeyboard/hhkeyboard.html"&gt;HHKB&lt;/a&gt; into one of
the three USB ports and use it instead.&lt;/p&gt;
&lt;p&gt;It comes with a built-in wireless network card that connects right up to my
wireless network at home. I also read a little about the mesh networking
capabilities of the XO, but haven't had the chance to actually play with it
first-hand yet. Mesh networking is a fascinating technology, though.&lt;/p&gt;
&lt;p&gt;A little perk that comes attached to the XO version that I have is the free year
of T-Mobile HotSpot access. I activated mine today and it works like a charm.&lt;/p&gt;
&lt;p&gt;The OS is a modified version of Fedora Linux, so I'm sure it is highly
customizable. This weekend and the next few days I will be doing a lot of
reading at the &lt;a href="http://wiki.laptop.org/go/Home"&gt;Laptop wiki&lt;/a&gt; site. They have an
amazing amount of really great information about the machine itself, as well as
projects and lessons to do with the kids. I also found some very useful posts by
&lt;a href="http://bc.tech.coop/blog/080128.html"&gt;Bill Clementson&lt;/a&gt; about his experiences
with his XO.&lt;/p&gt;
&lt;p&gt;Anyway, I will keep you posted.&lt;/p&gt;&lt;/div&gt;</description><category>cool stuff</category><category>hardware</category><category>linux</category><category>philosophy</category><category>python</category><category>review</category><guid>http://thestandardoutput.com/posts/xo-first-impressions/</guid><pubDate>Sun, 09 Mar 2008 07:12:00 GMT</pubDate></item><item><title>It's the Python</title><link>http://thestandardoutput.com/posts/its-the-python/</link><dc:creator>Jonas Gorauskas</dc:creator><description>&lt;p&gt;This is how I really feel about python: &lt;a href="http://xkcd.com/353/"&gt;http://xkcd.com/353/&lt;/a&gt;&lt;/p&gt;</description><category>philosophy</category><category>programming</category><category>python</category><guid>http://thestandardoutput.com/posts/its-the-python/</guid><pubDate>Fri, 04 Jan 2008 06:24:00 GMT</pubDate></item></channel></rss>