<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:dc="http://purl.org/dc/elements/1.1/" version="2.0"><channel><description>A figure of speech in which apparently contradictory terms appear in conjunction.</description><title>Predictably Random</title><generator>Tumblr (3.0; @aliles)</generator><link>https://aliles.tumblr.com/</link><item><title>My Welcome Non-Committee</title><description>&lt;p&gt;I&amp;rsquo;ve been home from &lt;a href="https://us.pycon.org/2012/"&gt;PyCon US&lt;/a&gt; for three weeks, which has given me plenty of time to reflect on the experience. Now that the Easter break has started, I also have the time to put some of those thoughts into words.&lt;/p&gt;

&lt;p&gt;PyCon US this year was &lt;strong&gt;huge&lt;/strong&gt;, or so I was told. Many of the 2250+ attendees were, like me, making their first appearance. Maybe consequently, there was a strong theme of &amp;lsquo;welcome&amp;rsquo; for the conference. &lt;a href="https://twitter.com/#!/storming"&gt;Stormy Peters&lt;/a&gt; encouraged returning attendees to meet somebody new during her keynote address. People wore funny hats and called themselves the Welcome Un-Committee. And so on.&lt;/p&gt;

&lt;p&gt;As great as these initiatives were, what made a strong difference for me was the group of people who consciously went out of there way to welcome me to PyCon. Sort of my own, personal, Welcome Non-Committee. What I want to do now is publicly acknowledge and thank them for this. It&amp;rsquo;s quite a long list of people, so after a couple of weeks of soul searching I created a list of five names that have made a lasting impression.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://twitter.com/#!/wolever"&gt;David&lt;/a&gt;, without doubt one of the friendliest, engaging persons I have ever met. One day I hope to visit Canada and be able to see one of the modular, futuristic, signage displays you work on. &lt;em&gt;Thank you&lt;/em&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://twitter.com/#!/fijall"&gt;Maciej&lt;/a&gt;, made joining &lt;a href="http://pypy.org/"&gt;PyPy&lt;/a&gt; for sprints the welcoming, entertaining and over all fun experience it was. The enthusiasm you imparted on me leaves me feel guilty for not working on PyPy even while I write this. &lt;em&gt;Thank you&lt;/em&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://twitter.com/#!/jaaaarel"&gt;Taavi&lt;/a&gt;, even after giving his highly rated presentation to PyCon was happy to have a conversation with me on the topic at dinner. I still smile when recalling the steady stream of often hilarious 'WTF&amp;rsquo; on NumPy edge cases you delivered at the sprints. &lt;em&gt;Thank you&lt;/em&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;&lt;a href="https://twitter.com/#!/ojiidotch"&gt;Jonas&lt;/a&gt;, kept me company during the final hours of sprinting and shared some beers supplied by my travel allowance. I enjoyed our gentle jibing over whose fault it is that &lt;a href="https://github.com/ojii/pymaging"&gt;pymaging&lt;/a&gt; runs slower on PyPy.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Andrew, a fellow Australian, government employee, PyCon first time attendee. Being able to share the roller coaster that is PyCon tutorials, conference and sprints while spending a fortnight away from our families made an enormous difference. &lt;em&gt;Thank you&lt;/em&gt;.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Of course, there is a very long other names that I could/should have included.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://twitter.com/#!/hodgestar"&gt;Simon&lt;/a&gt;, I really enjoyed discussing all things radio with you.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/#!/callahad"&gt;Dan&lt;/a&gt;, I&amp;rsquo;m amazed you chose to share a drink with me after the sprints wrapped up.&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/#!/voidspace"&gt;Michael&lt;/a&gt;, o.m.g, I met the guy behind &lt;a href="http://pypi.python.org/pypi/mock"&gt;mock&lt;/a&gt; and &lt;a href="http://pypi.python.org/pypi/unittest2"&gt;unittest&lt;/a&gt;!&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/#!/tavisrudd"&gt;Tavis&lt;/a&gt;, I was relieved to find someone who&amp;rsquo;d attempted a presentation that&amp;rsquo;s a little unusual, although dictating code is so much cooler &amp;hellip;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/#!/jtauber"&gt;James&lt;/a&gt;, o.m.g, I met the &lt;a href="http://eldarion.com/"&gt;Eldarion&lt;/a&gt; guy!&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/#!/yarkot"&gt;Yarko&lt;/a&gt;, such positive enthusiasm is rare and inspirational. That and packing the swag bag was a blast.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;As &lt;a href="https://twitter.com/#!/holdenweb"&gt;Steve Holden&lt;/a&gt; said, &amp;ldquo;people come for the programming language and stay for the community&amp;rdquo;. Each of you, as well as all the persons I was unable to name above, are that community for me. &lt;em&gt;Thank you&lt;/em&gt;. I hope we meet again.&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/20581540597</link><guid>https://aliles.tumblr.com/post/20581540597</guid><pubDate>Fri, 06 Apr 2012 20:16:25 +1000</pubDate><category>python</category><category>pycon</category></item><item><title>This is one sad panda.

NERF and other projectile weapons (toy...</title><description>&lt;img src="https://64.media.tumblr.com/tumblr_lrx8fpKPOb1qmo0pno1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;This is one sad panda.&lt;/p&gt;

&lt;p&gt;NERF and other projectile weapons (toy or otherwise) have been banned in the office. I guess this is the final cease fire for &lt;a href="http://youtu.be/Clwhm1dRu6c"&gt;The Great Office War&lt;/a&gt;.&lt;/p&gt;

&lt;p&gt;Viva Le Resistance!&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/10515773687</link><guid>https://aliles.tumblr.com/post/10515773687</guid><pubDate>Thu, 22 Sep 2011 21:11:49 +1000</pubDate><category>nerf</category></item><item><title>Missing the basics</title><description>&lt;p&gt;If asked what you would miss from your modern life style, how would you answer? The internet? Your mobile phone? Perhaps electricity? Would you have considered answering with &lt;a href="http://en.wikipedia.org/wiki/Tap_water"&gt;running water&lt;/a&gt;?&lt;/p&gt;

&lt;p&gt;Yesterday we arrived home from a long weekend away to discover a leaking pipe. Fortunately it was a small leak and (we believe) fairly recent. Unfortunately it was inside the brick exterior wall. As we discovered it at the end of the day, we had to wait till the next day for a plumber to come and repair it. And so the mains tap was turned off.&lt;/p&gt;

&lt;p&gt;In the hours that followed turning off the main water supply I realised just how much I take running water for granted. Simple practices such as washing hands and cleaning teeth became vastly more inconvenient. I was grateful to have done a load of washing almost as soon as we got home.&lt;/p&gt;

&lt;p&gt;The pipe is repaired now, the baby is bathed and life has quickly returned to a comfortable existence. Hopefully in the future though I will better appreciate what those less fortunate than us don&amp;rsquo;t have with regard to clean, running and drinkable water.&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/10440525184</link><guid>https://aliles.tumblr.com/post/10440525184</guid><pubDate>Tue, 20 Sep 2011 22:45:16 +1000</pubDate><category>water</category></item><item><title>Hidden Features</title><description>&lt;p&gt;How do you wind down after a weekend whirl wind interstate visit? By perusing the &lt;a href="http://stackoverflow.com/questions/101268/hidden-features-of-python/1024693"&gt;Hidden features of Python&lt;/a&gt; thread on &lt;a href="http://stackoverflow.com/"&gt;Stack Overflow&lt;/a&gt; of course!&lt;/p&gt;

&lt;p&gt;Ok, so strictly speaking it wasn&amp;rsquo;t for winding down, more that the farm has incredibly limited wireless internet. That and I was unable to fit my laptop in amongst the other 47kg of luggage that comprises the family Iles travelling road show.&lt;/p&gt;

&lt;p&gt;Seriously though, the thread has some impressive answers. I&amp;rsquo;m surprised it hasn&amp;rsquo;t made it onto &lt;a href="https://twitter.com/#!/jessenoller"&gt;Jesse Noller&lt;/a&gt;&amp;rsquo;s &lt;a href="http://jessenoller.com/good-to-great-python-reads/"&gt;Good to Great Python Reads&lt;/a&gt; yet.&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/10400284829</link><guid>https://aliles.tumblr.com/post/10400284829</guid><pubDate>Mon, 19 Sep 2011 21:40:16 +1000</pubDate><category>python</category></item><item><title>"Never mistake motion for action."</title><description>“Never mistake motion for action.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://www.brainyquote.com/quotes/quotes/e/ernesthemi103727.html"&gt;http://www.brainyquote.com/quotes/quotes/e/ernesthemi103727.html&lt;/a&gt;&lt;/em&gt;</description><link>https://aliles.tumblr.com/post/10198413385</link><guid>https://aliles.tumblr.com/post/10198413385</guid><pubDate>Wed, 14 Sep 2011 20:31:05 +1000</pubDate></item><item><title>Wikipedia book creator</title><description>&lt;p&gt;I stumbled upon a most welcome new feature on &lt;a href="http://www.wikipedia.org/"&gt;Wikipedia&lt;/a&gt; the other night. The Wikipedia &lt;a href="http://en.wikipedia.org/wiki/Help:Books"&gt;Book Creator&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Wikipedia now enables users to create their own books from a compilation of wikipedia articles. Books can be downloaded as PDFs or printed through &lt;a href="http://pediapress.com/"&gt;Pedia Press&lt;/a&gt;. 10% of the sales of printed copies goes to the Wikimedia Foundation.&lt;/p&gt;
&lt;p&gt;Here&amp;rsquo;s my first book; &lt;a href="http://dl.dropbox.com/u/5319494/String%20Algorithms.pdf"&gt;String Algorithms&lt;/a&gt;, a collection of string searching and matching algorithms. I strongly recommend checking out the &lt;a href="http://en.wikipedia.org/wiki/Aho%E2%80%93Corasick_string_matching_algorithm"&gt;Aho-Corasick&lt;/a&gt; method.&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/10160534937</link><guid>https://aliles.tumblr.com/post/10160534937</guid><pubDate>Tue, 13 Sep 2011 20:31:05 +1000</pubDate></item><item><title>Where does heapq belong now?</title><description>&lt;p&gt;Two of my favorite featues in Python&amp;rsquo;s standard library are &lt;a href="http://docs.python.org/library/collections.html#collections.namedtuple"&gt;namedtuple&lt;/a&gt; and &lt;a href="http://docs.python.org/library/heapq.html"&gt;heapq&lt;/a&gt;. Namedtuple resides in the collections module, while heapq is a module in its own right.&lt;/p&gt;
&lt;p&gt;While heapq predates collections. The standard library has never been considered a fossilized structure. &lt;a href="http://www.python.org/dev/peps/pep-3108/"&gt;Reorganisation has&lt;/a&gt; (and will) take place when necessary.&lt;/p&gt;
&lt;p&gt;So, is it time to relocate heapq to a logical home in collections?&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/10122105709</link><guid>https://aliles.tumblr.com/post/10122105709</guid><pubDate>Mon, 12 Sep 2011 20:32:05 +1000</pubDate><category>python</category></item><item><title>"My grandfather once told me that there were two kinds of people: those who do the work and those who..."</title><description>“My grandfather once told me that there were two kinds of people: those who do the work and those who take the credit. He told me to try to be in the first group; there was much less competition.”&lt;br/&gt;&lt;br/&gt; - &lt;em&gt;&lt;a href="http://www.brainyquote.com/quotes/quotes/i/indiragand136134.html"&gt;http://www.brainyquote.com/quotes/quotes/i/indiragand136134.html&lt;/a&gt;&lt;/em&gt;</description><link>https://aliles.tumblr.com/post/10030778713</link><guid>https://aliles.tumblr.com/post/10030778713</guid><pubDate>Sat, 10 Sep 2011 20:30:06 +1000</pubDate></item><item><title>Why I do the things I do.</title><description>&lt;img src="https://64.media.tumblr.com/tumblr_lr5mhgZaH81qmo0pno1_500.png"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Why I do the things I do.&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/9991023973</link><guid>https://aliles.tumblr.com/post/9991023973</guid><pubDate>Fri, 09 Sep 2011 20:31:06 +1000</pubDate><category>family</category></item><item><title>No convergence for Chrome</title><description>&lt;a href="http://www.imperialviolet.org/2011/09/07/convergence.html"&gt;No convergence for Chrome&lt;/a&gt;: &lt;p&gt;Looks like Chrome wont be getting native &lt;a href="http://convergence.io/"&gt;Convergence&lt;/a&gt; support, which is not really surprising. More interesting though, Chrome could get an API for “controlling certificate decisions”. This would make it possible to add support for Convergence, &lt;a href="http://perspectives-project.org/"&gt;Perspectives&lt;/a&gt; or maybe even bittorrent based &lt;a href="http://aliles.tumblr.com/post/9876342200/fixing-ssl-flaws"&gt;peer-to-peer notarisation&lt;/a&gt; as a Chrome extension. It will be interesting to see if someone steps up and provides a patch to add this API.&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/9954574665</link><guid>https://aliles.tumblr.com/post/9954574665</guid><pubDate>Thu, 08 Sep 2011 22:03:28 +1000</pubDate><category>ssl</category><category>tls</category><category>chrome</category></item><item><title>Chrome, why dont you?</title><description>&lt;p&gt;Following &lt;a href="http://aliles.tumblr.com/post/9876342200/fixing-ssl-flaws"&gt;yesterday&amp;rsquo;s post&lt;/a&gt; on flaws in the trust model of SSL certificate authorities; today I had a conversation in the break out area with &lt;a href="https://twitter.com/#!/italip"&gt;Indra&lt;/a&gt; on how browsers manage certificates. Indra reminded me how &lt;a href="https://blog.torproject.org/blogs/phobos"&gt;Phobos&lt;/a&gt;, one of the Tor developers, &lt;a href="https://blog.torproject.org/blog/life-without-ca"&gt;removes all certificate authorities&lt;/a&gt; from his/her Firefox setup. Phobos instead adds certificates individually to Firefox as he/she gains trust in a site.&lt;/p&gt;
&lt;p&gt;That&amp;rsquo;s impressive, but extreme. The amount of effort, knowledge and technical skill required to achieve an outcome is beyond of most browser users.&lt;/p&gt;
&lt;p&gt;My browser of choice is Google&amp;rsquo;s Chrome. Chrome already has some additional &lt;a href="http://blog.chromium.org/2011/06/new-chromium-security-features-june.html"&gt;security features&lt;/a&gt; for SSL certificates and secured domains, such as &lt;a href="http://www.imperialviolet.org/2011/05/04/pinning.html"&gt;certificate pinning&lt;/a&gt;. But Chrome doesn&amp;rsquo;t give me any tools to even partially emulate Phobo&amp;rsquo;s approach. Which left me to lament to Indra:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;Why aren&amp;rsquo;t certificates for my important domains (e.g. internet banking) already pinned?&lt;/li&gt;
&lt;li&gt;Why can&amp;rsquo;t I manually pin the certificate for select domains?&lt;/li&gt;
&lt;li&gt;Why can&amp;rsquo;t I declare some (or all) SSL protected domains to be sensitive?&lt;/li&gt;
&lt;li&gt;Why doesn&amp;rsquo;t Chrome remember the last certificate presented by sensitive domains?&lt;/li&gt;
&lt;li&gt;Why doesn&amp;rsquo;t Chrom warn me when the certificate for a sensitive domain changes?&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;So Google Chrome, why don&amp;rsquo;t you?&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/9915098001</link><guid>https://aliles.tumblr.com/post/9915098001</guid><pubDate>Wed, 07 Sep 2011 21:51:54 +1000</pubDate><category>ssl</category><category>tls</category><category>chrome</category></item><item><title>Fixing SSL flaws</title><description>&lt;p&gt;Just in case you missed it; a very serious security breach occurred recently at &lt;a href="http://en.wikipedia.org/wiki/DigiNotar"&gt;DigiNotar&lt;/a&gt;, a dutch certificate authority. At least &lt;a href="https://blog.torproject.org/blog/diginotar-damage-disclosure"&gt;531 fraudulent certificates&lt;/a&gt; were issued by the attacker for a wide variety of SSL/TLS secured sites including Gmail, Facebook and the Tor project. Some of those certificates have been used in &lt;a href="https://blog.torproject.org/blog/diginotar-debacle-and-what-you-should-do-about-it"&gt;man-in-the-middle&lt;/a&gt; (MITM) attack on Iranian citizens.&lt;/p&gt;
&lt;p&gt;One of the effects of this event, and the earlier &lt;a href="https://www.eff.org/deeplinks/2011/03/iranian-hackers-obtain-fraudulent-https"&gt;Comodo breach&lt;/a&gt;, has been a renewed discussion on &amp;ldquo;fixing&amp;rdquo; SSL because it&amp;rsquo;s broken. Ignoring the argument of whether SSL is &amp;ldquo;broken&amp;rdquo; or just flawed, so far I seen two basic themes to the proposals.&lt;/p&gt;
&lt;p&gt;The first is decentralise the trust relationship. Solutions like &lt;a href="http://perspectives-project.org/"&gt;Perspectives&lt;/a&gt; and &lt;a href="http://convergence.io/"&gt;Convergence&lt;/a&gt; introduce the concept of &amp;ldquo;notaries&amp;rdquo;. Notaries monitor the use of certificates on sites over time. A user chooses which notary or notaries they trust; when accessing a SSL secured site, the notary is contacted to verify the server certificate presented to the browser.&lt;/p&gt;
&lt;p&gt;Which makes we wonder why not do away with the notaries altogether. The recent &lt;a href="http://blog.bittorrent.com/2011/06/30/uchat-we-just-need-each-other/"&gt;implementation of uChat&lt;/a&gt;, a peer-to-peer chat application built on &lt;a href="http://www.bittorrent.com/"&gt;bittorrent&lt;/a&gt;. Using &lt;a href="http://www.ghacks.net/2010/06/05/what-is-a-magnet-link-and-how-does-it-differ-from-torrents/"&gt;magnet links&lt;/a&gt; for each site, swarms could assemble to clients distributed around the world to compare the certificates being presented to each. All this could be built directly into the browser.&lt;/p&gt;
&lt;p&gt;The second is to increase the cost of attacks against certificate authorities by have &lt;a href="https://grepular.com/Solving_the_SSL_CA_Debacle_Using_Multi-Signed_Certs"&gt;multiple independent certificate authorities&lt;/a&gt; sign a certificate. This would require an attacker to compromise multiple certificate authorities simultaneously to issue a fraudulent certificate.&lt;/p&gt;
&lt;p&gt;Avoiding any discussion on the relative security of the two models for the moment. I contend it&amp;rsquo;s the second approach that will prevail. Why? Performance.&lt;/p&gt;
&lt;p&gt;A lot of work has been going of recently to &lt;a href="http://www.imperialviolet.org/2010/06/25/overclocking-ssl.html"&gt;reduce the latency&lt;/a&gt; of creating new secured connections. Technologies like &lt;a href="http://tools.ietf.org/html/rfc5077"&gt;session resumption&lt;/a&gt;, &lt;a href="https://tools.ietf.org/html/draft-bmoeller-tls-falsestart-00"&gt;FalseStart&lt;/a&gt;, &lt;a href="http://tools.ietf.org/html/draft-agl-tls-snapstart-00"&gt;SnapStart&lt;/a&gt;, and &lt;a href="http://en.wikipedia.org/wiki/OCSP_stapling"&gt;OSCP stapling&lt;/a&gt; are all designed to reduce the number of round trips to create a connection. Decentralising the trust relationship doesn&amp;rsquo;t just introduce many more rounds trips than were required in the past, it introduces round trips to multiple new locations.&lt;/p&gt;
&lt;p&gt;Compounding the problem of a poor user experience, I also contend that a distributed trust model is more vulnerable to state level censorship. When the communication required to establish a new secured session is restricted to that between the client and the server (baring fraudulent certificates) a state level actor is contained to denial of service.&lt;/p&gt;
&lt;p&gt;However, in a distributed model the state level actor has the possibility of allowing access to the service but denying access to any notaries or peers outside the censored region. Thus the client, and ultimately the user, is afforded the option of accessing the service but without any guarantees as to the security of the site. We all know how well users pay attention to warning messages today.&lt;/p&gt;
&lt;p&gt;I believe this to be a significant weakness of the distributed trust model. A denial of service attack on the SSL validation infrastructure is potentially far more damaging than a denial of service attack on a service its self.&lt;/p&gt;
&lt;p&gt;It will be interesting to watch dialogue in this space develop. There are a lot of talented security professionals I&amp;rsquo;ve yet to see comment such as &lt;a href="http://www.schneier.com/"&gt;Bruch Schneier&lt;/a&gt; and &lt;a href="http://www.imperialviolet.org/"&gt;Adam Langley&lt;/a&gt;. Let&amp;rsquo;s hope as few people as possible get hurt until a solution is found.&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/9876342200</link><guid>https://aliles.tumblr.com/post/9876342200</guid><pubDate>Tue, 06 Sep 2011 23:28:20 +1000</pubDate><category>ssl</category><category>tls</category></item><item><title>Why metaclass?</title><description>&lt;p&gt;I was asked an excellent question today:&lt;/p&gt;
&lt;blockquote&gt;
&lt;p&gt;So those metaclasses you&amp;rsquo;ve ben writing about, when would you use them?&lt;/p&gt;
&lt;/blockquote&gt;
&lt;p&gt;I thought this question was great because, if you&amp;rsquo;ve been following &lt;a href="http://aliles.tumblr.com/post/9205886103/replacing-exec-with-metaclass-for-namedtuple"&gt;my&lt;/a&gt; &lt;a href="http://aliles.tumblr.com/post/8907131456/more-sugar-for-pythons-init"&gt;previous&lt;/a&gt; &lt;a href="http://aliles.tumblr.com/post/8821821665/sugar-for-pythons-init"&gt;posts&lt;/a&gt; on using metaclasses, you may have noticed I never stopped to describe some scenarios when metaclasses are useful.&lt;/p&gt;
&lt;p&gt;A good place to start is this &lt;a href="http://www.vrplumber.com/programming/metaclasses-pycon.pdf"&gt;2002 quote&lt;/a&gt; from Tim Peters, the Tim behind &lt;a href="http://en.wikipedia.org/wiki/Timsort"&gt;timsort&lt;/a&gt;.&lt;/p&gt;
&lt;blockquote&gt;
&lt;p class="p1"&gt;[Metaclasses] are deeper magic than 99% of users should ever worry about.  If you wonder whether you need them, you don&amp;rsquo;t (the people who actually need themknow with certainty that they need them,and don&amp;rsquo;t need an explanation about why).&lt;/p&gt;

&lt;/blockquote&gt;
&lt;p class="p1"&gt;While not exactly answering the question at hand, it&amp;rsquo;s a pertinent reminder that just because we have a hammer it doesn&amp;rsquo;t mean we need to treat every problem like a nail.&lt;/p&gt;
&lt;p class="p1"&gt;So when might you know you need them? Metaclasses are the &lt;a href="http://www.voidspace.org.uk/python/articles/metaclasses.shtml"&gt;class of classes&lt;/a&gt;, so they&amp;rsquo;re capable of  making systematic changes to class definitions or class instances as they are created. When multiple classes need to adhere to common interface, that logic can be abstracted out into a metaclass.&lt;/p&gt;
&lt;p class="p1"&gt;That&amp;rsquo;s very abstract, so here&amp;rsquo;s a short list to real world examples:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;A &lt;a href="http://www.voidspace.org.uk/python/weblog/arch_d7_2007_02_10.shtml#e632"&gt;properties metaclass&lt;/a&gt; to create properties from getter and setter methods.&lt;/li&gt;
&lt;li&gt;A &lt;a href="http://www.voidspace.org.uk/python/weblog/arch_d7_2006_12_16.shtml#e583"&gt;selfless metaclass&lt;/a&gt; to automatically add &amp;lsquo;self&amp;rsquo; to all method definitions.&lt;/li&gt;
&lt;li&gt;A &lt;a href="http://code.activestate.com/recipes/102187-singleton-as-a-metaclass/"&gt;singleton metaclass&lt;/a&gt; to create singleton objects.&lt;/li&gt;
&lt;li&gt;Self &lt;a href="http://effbot.org/zone/metaclass-plugins.htm"&gt;registering&lt;/a&gt; subclasses in a plugin system.&lt;/li&gt;
&lt;li&gt;Declarative programming as used by &lt;a href="http://code.google.com/apis/protocolbuffers/docs/pythontutorial.html"&gt;Protocol&lt;/a&gt;&lt;a href="http://code.google.com/apis/protocolbuffers/docs/pythontutorial.html"&gt; Buffers&lt;/a&gt; and &lt;a href="http://www.sqlalchemy.org/docs/orm/extensions/declarative.html#api-reference"&gt;SQLAlchemy&lt;/a&gt; to dynamically generate class definitions.&lt;/li&gt;
&lt;li&gt;And my &lt;a href="http://aliles.tumblr.com/post/9205886103/replacing-exec-with-metaclass-for-namedtuple"&gt;namedtuple metaclass&lt;/a&gt; and &lt;a href="http://aliles.tumblr.com/post/8907131456/more-sugar-for-pythons-init"&gt;constructor metaclass&lt;/a&gt;.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;What all these examples have in common is the application of a common transform to class definition or instance creation. That transform could add new methods or properties, modify existing methods or properties, or communicate with an external framework.&lt;/p&gt;
&lt;p&gt;Metaclasses are a specialised tool. While invaluable for framework authors, it&amp;rsquo;s rare to use them in standard application code. If in doubt, refer to the &lt;a href="http://www.python.org/dev/peps/pep-0020/"&gt;Zen of Python&lt;/a&gt; and ask yourself; 'Is using a metaclass making my code clearer, more concise and more maintainable?&amp;rsquo;.&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/9832143091</link><guid>https://aliles.tumblr.com/post/9832143091</guid><pubDate>Mon, 05 Sep 2011 23:12:58 +1000</pubDate><category>python</category></item><item><title>Boo Ya, Cats</title><description>&lt;p&gt;Tonight I had a plan. That plan was to clean up &lt;a href="https://github.com/aliles/filemagic"&gt;filemagic&lt;/a&gt; and release it on &lt;a href="http://pypi.python.org/pypi"&gt;PyPi&lt;/a&gt;. That plan went out the window courtesy of the &lt;a href="http://www.gfc.com.au/"&gt;Geelong&lt;/a&gt; versus &lt;a href="http://www.collingwoodfc.com.au/Default.aspx"&gt;Collingwood&lt;/a&gt; tonight.&lt;/p&gt;
&lt;p&gt;For those who don&amp;rsquo;t follow &lt;a href="http://en.wikipedia.org/wiki/Australian_Football_League"&gt;AFL&lt;/a&gt;; this is the final round before finals in the AFL. Collingwood and Geelong are the first and second placed teams respectively. Should be a epic clash, Collingwood are the favourites to win.&lt;/p&gt;
&lt;p&gt;However, the &lt;a href="http://www.afl.com.au/tabid/16931/Default.aspx#fixtureid=5662&amp;amp;tab=Recap"&gt;final score&lt;/a&gt; stands by its self.&lt;/p&gt;
&lt;p&gt;&lt;a href="http://youtu.be/TaMOnUg6fKQ"&gt;&lt;img alt="Click Me" height="218" width="200" src="http://upload.wikimedia.org/wikipedia/en/thumb/9/90/Geelong2008Logo.svg/200px-Geelong2008Logo.svg.png" align="middle"/&gt;&lt;/a&gt;&lt;/p&gt;
&lt;p&gt;Perhaps I should limit myself to to a hearty &amp;rsquo;&lt;strong&gt;Go Cats!&lt;/strong&gt;&amp;rsquo; &amp;hellip; but I can&amp;rsquo;t. Please click through the Geelong emblem above for a little celebratory video.&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/9704385724</link><guid>https://aliles.tumblr.com/post/9704385724</guid><pubDate>Fri, 02 Sep 2011 23:13:26 +1000</pubDate><category>afl</category></item><item><title>QR code buddy icon</title><description>&lt;p&gt;Every few months I get bored and change my profile picture on horde of sites I have accounts on. This time around I got geeky and used a &lt;a href="http://en.wikipedia.org/wiki/QR_code"&gt;Quick Response (QR) code&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;&lt;figure data-orig-height="125" data-orig-width="125"&gt;&lt;img align="middle" src="https://64.media.tumblr.com/3f2b6bcc9932247c9fe3b6a53cf35738/83ae478b9d640c72-9a/s540x810/b85ddd437e017a470e9fad247118e2f469757c2a.png" data-orig-height="125" data-orig-width="125"/&gt;&lt;/figure&gt;&lt;/p&gt;
&lt;p&gt;QR codes have been around for nearly 20 years now. While popular in Japan they are only just beginning to become common here in Australia. I was inspired to use one as my profile picture when I found &lt;a href="http://itunes.apple.com/au/app/qrencoder/id452695239?mt=12"&gt;QREncoder&lt;/a&gt; on the Mac App Store. Although I confess I stole the idea from &lt;a href="https://twitter.com/#!/mickeyc"&gt;Mike Cardwell&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Generating QR codes is very easy. In addition to desktop applications there are &lt;a href="http://www.qrstuff.com/"&gt;multiple &lt;/a&gt;&lt;a href="http://code.google.com/apis/chart/infographics/docs/qr_codes.html"&gt;websites&lt;/a&gt; including &lt;a href="http://code.google.com/apis/chart/infographics/docs/qr_codes.html"&gt;Google charts&lt;/a&gt; that will generate charts for you. A Google &lt;a href="http://goo.gl/apDEk"&gt;search&lt;/a&gt; will give you an extensive list of options.&lt;/p&gt;
&lt;p&gt;An interesting property of QR codes is the use of &lt;a href="http://en.wikipedia.org/wiki/Reed%E2%80%93Solomon_error_correction"&gt;Reed-Soloman&lt;/a&gt; error correction to make scanning more reliable. This allows errors to be introduced to &lt;a href="http://mashable.com/2011/04/18/qr-code-design-tips/"&gt;customise&lt;/a&gt; the design, make them more visually appealing or embed corporate logos. Clearly this will have some impact on how reliably readers will scan your code. (Thanks for &lt;a href="https://twitter.com/#!/italip"&gt;Indra&lt;/a&gt; for &lt;a href="https://twitter.com/#!/italip/status/109191431549227009"&gt;passing&lt;/a&gt; me that last link.)&lt;/p&gt;
&lt;p&gt;Now, if I can figure out how to drive &lt;a href="http://itunes.apple.com/au/app/pixelmator/id407963104?mt=12"&gt;Pixelmator&lt;/a&gt;, my next profile picture might look a little more &lt;a href="http://qr1337.files.wordpress.com/2011/05/obama2.png"&gt;spectacular&lt;/a&gt;.&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/9664057069</link><guid>https://aliles.tumblr.com/post/9664057069</guid><pubDate>Thu, 01 Sep 2011 22:20:24 +1000</pubDate></item><item><title>Starting 'The List'</title><description>&lt;p&gt;Over the past few weeks I&amp;rsquo;ve managed to start a number of interesting projects, but failed to bring many of them to a close. Or even to a stable state.&lt;/p&gt;
&lt;p&gt;I&amp;rsquo;m not sure how others maintain focus. As a start I thought I&amp;rsquo;d write down the major pieces of work I&amp;rsquo;ve started recently.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="http://github.com/aliles/main"&gt;main&lt;/a&gt;; I write a lot of small applications with limited use and longevity. This package is to provide convenience functionality to reduce the amount of Python boiler plate.&lt;/li&gt;
&lt;li&gt;&lt;a href="http://github.com/aliles/filemagic"&gt;filemagic&lt;/a&gt;; exposes the magic of libmagic to Python.&lt;/li&gt;
&lt;li&gt;jitterbug; a framework for profiling the behaviour of PyPy&amp;rsquo;s JIT compiler.&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;Of these &amp;lsquo;filemagic&amp;rsquo; is the &lt;a href="http://aliles.tumblr.com/post/7842694115/file-magic-from-python"&gt;closest to complete&lt;/a&gt;. It&amp;rsquo;s mostly just lacking in decent tests, save a couple of minor features.&lt;/p&gt;
&lt;p&gt;The 'main&amp;rsquo; package has &lt;a href="http://aliles.tumblr.com/post/7686579735/more-sugar-for-pythons-main"&gt;progressed the furthest&lt;/a&gt; and is the most usable. Before I could consider it stable I want to add some common application functionality such as unix daemons and logging along with default option sets for them.&lt;/p&gt;
&lt;p&gt;Lastly is jitterbug. I am still most enthusiastic about &lt;a href="http://aliles.tumblr.com/post/8038640710/pypy-jit-visualisation-methodology"&gt;understanding the PyPy JIT&amp;rsquo;s behaviour&lt;/a&gt;. But am finding it difficult to find the blocks of time I need to concentrate on the topic at length.&lt;/p&gt;
&lt;p&gt;Now all I have to do is convince &lt;a href="http://twitter.com/#!/stevenseguna"&gt;the boss&lt;/a&gt; there&amp;rsquo;s value in letting me progress some of these during work time.&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/9500120819</link><guid>https://aliles.tumblr.com/post/9500120819</guid><pubDate>Sun, 28 Aug 2011 23:40:17 +1000</pubDate></item><item><title>The when of Python scoping</title><description>&lt;p&gt;Here&amp;rsquo;s a fun bit of Python trivia I learned a yesterday. The decision to determine the scope of a Python variable is made at compile time not run time by the Python interpreter.&lt;/p&gt;
&lt;p&gt;Compile time for Python you ask? Why yes. When Python code is first read by the interpreter it is translated into &lt;a href="http://docs.python.org/glossary.html#term-bytecode"&gt;byte code&lt;/a&gt; that includes representations for the classes and functions in the code. It&amp;rsquo;s during this first read that Python determines a variables scope. As an aside, Python includes support for &lt;a href="http://docs.python.org/library/dis.html?highlight=dis#module-dis"&gt;dissembling&lt;/a&gt; the bytecode which can be useful to &lt;a href="http://blog.doughellmann.com/2009/08/pymotw-dis-python-bytecode-disassembler.html"&gt;performance analysis and debugging&lt;/a&gt;.&lt;/p&gt;
&lt;p&gt;Normally this is not something you need to worry about. However, it is possible to introduce interesting bugs as a side effect of when scoping rules are applied. Consider this short piece of code:&lt;/p&gt;
&lt;pre&gt;from __future__ import print_function

def outer(name):
    def inner():
        name = name.capitalize()
        return 'Hello {0:s}'.format(name)
    return inner()
print(outer('world'))

&lt;/pre&gt;
&lt;p&gt;This code will raise an &lt;a href="http://docs.python.org/library/exceptions.html#exceptions.UnboundLocalError"&gt;UnboundLocalError&lt;/a&gt; for name. That&amp;rsquo;s because Python will determine when first reading the code that name is local to the inner function because there is an assignment to name. Even though name is available to to inner from outer&amp;rsquo;s scope.&lt;/p&gt;
&lt;p&gt;Scoping rules are more than just interesting trivia. It goes to the heart of how &lt;a href="http://en.wikipedia.org/wiki/Closure_(computer_science)"&gt;closures&lt;/a&gt; work in Python. But that&amp;rsquo;s a post for another night.&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/9412558124</link><guid>https://aliles.tumblr.com/post/9412558124</guid><pubDate>Fri, 26 Aug 2011 22:16:45 +1000</pubDate><category>python</category></item><item><title>This is my tomorrow.</title><description>&lt;img src="https://64.media.tumblr.com/tumblr_lqflttza6P1qmo0pno1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;This is my tomorrow.&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/9331569483</link><guid>https://aliles.tumblr.com/post/9331569483</guid><pubDate>Wed, 24 Aug 2011 22:10:40 +1000</pubDate></item><item><title>Seriously, you can trust me!</title><description>&lt;img src="https://64.media.tumblr.com/tumblr_lpghwiZjp81qmo0pno1_500.jpg"/&gt;&lt;br/&gt;&lt;br/&gt;&lt;p&gt;Seriously, you can trust me!&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/9290243776</link><guid>https://aliles.tumblr.com/post/9290243776</guid><pubDate>Tue, 23 Aug 2011 22:10:07 +1000</pubDate></item><item><title>Keeping up with Python</title><description>&lt;p&gt;It&amp;rsquo;s hard keeping up to date with the &amp;ldquo;happenings&amp;rdquo; in an open source community as large and diverse as Python. I make no claims of knowing where the vanguard of Python news is. Though if it helps you, here&amp;rsquo;s how I stay up to date with developments in the community.&lt;/p&gt;
&lt;p&gt;Most important to me is &lt;a href="http://twitter.com/"&gt;Twitter&lt;/a&gt;. The Python community is diverse, active and vibrant on Twitter. I&amp;rsquo;ve been acquiring new people to follow for well over a year now, so to help you get started I&amp;rsquo;ve started curating two Python related Twitter lists for you to follow:&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="http://twitter.com/#!/aliles/python"&gt;@aliles/python&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="http://twitter.com/#!/aliles/pypy"&gt;@aliles/pypy&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The first list is of general members of the Python community I find interesting. The second list is of people predominately related to the &lt;a href="http://pypy.org/"&gt;PyPy&lt;/a&gt; project.&lt;/p&gt;
&lt;p&gt;After Twitter I use &lt;a href="http://www.google.com/reader/view/"&gt;Google Reader&lt;/a&gt; to follow Python related blogs and news feeds. To date I&amp;rsquo;ve acquired 47 Python related feeds. Again to make it easy for you I&amp;rsquo;ve collated these feeds into a single Google Reader bungle.&lt;/p&gt;
&lt;ul&gt;&lt;li&gt;&lt;a href="https://www.google.com/reader/bundle/user%2F11984764655868576811%2Fbundle%2FPython"&gt;&amp;ldquo;Python&amp;rdquo; bundle created by Aaron&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;&lt;p&gt;The bundle page includes an &lt;a href="http://www.google.com/reader/public/atom/user%2F11984764655868576811%2Fbundle%2FPython"&gt;Atom&lt;/a&gt; link so you can follow along with your preferred news reader.&lt;/p&gt;
&lt;p&gt;That should be enough to get you started following along with the Python community. If there are other interesting people and feeds you follow, please share them in the comments below.&lt;/p&gt;</description><link>https://aliles.tumblr.com/post/9249032018</link><guid>https://aliles.tumblr.com/post/9249032018</guid><pubDate>Mon, 22 Aug 2011 22:26:03 +1000</pubDate><category>python</category></item></channel></rss>
