Arrow in Flight

May 27th, 2008


I’ve had a Flickr account for a couple of years, but haven’t done much with it until now. all that time, I’ve been accumulating more and more digital photos, initially from a small compact camera and, more recently, from a digital SLR (a Canon EOS 400D).

Over the bank holiday weekend, I finally got around to uploading a few pictures - among them the shot that you see here. I also took the opportunity to hook up this blog to my Flickr account; in fact, I’ve posted this blog entry from Flickr!

Mercurial

May 16th, 2008

In the past, I’ve used Subversion for the one-person software development projects with which I’m often involved. Just recently, however, I thought I’d give Mercurial a spin, having heard good things about it and seen a lot of people start using it.

So far, I’m impressed - particularly by the ease with which you can clone a repository to create a new branch for development, and then merge changes made there back into the original. Another nice feature is the ability to view repository changelogs with a web browser, courtesy of Mercurial’s built-in web server. And then there’s the fact that large parts of it are written in Python… :)

Rickrolled!

May 2nd, 2008

I gave my last Secure Computing lecture today - the last ever Secure Computing lecture, as it happens - and my students prepared a little ’surprise’ for me. Halfway into the lecture, “Never Gonna Give You Up” began blaring out from beneath the lectern!

On investigating further, I discovered a notebook computer and miniature speakers, carefully concealed behind a poster. Kudos to Chris Worfolk for making it happen. Now if only he’d hacked my laptop and made that Rick Astley video appear in place of the slides…

Django marches on…

April 28th, 2008

The inexorable rise of Django continues. Packt have now published Learning Website Development with Django, which by my reckoning is the fourth Django book to make it into print - with two more due this summer from James Bennett and Paul Bissex.

Then there’s the inclusion of Django in Google App Engine. Google’s endorsement will surely do a lot to raise Django’s profile. Although many Djangonauts have expressed disappointment that some of Django’s best bits are missing from or unusable in GAE, I think it still has value as a stepping stone to using the full framework.

One of Django’s great strengths is its very active community. In addition to heavily-used newsgroups and IRC channels, there is an excellent weekly round-up podcast, the nineteenth edition of which featured some particularly enlightening stuff on internationalisation. Then there’s a host of apps out there that both demonstrate the framework in action and support its growing band of users; djangopeople.net, djangosites.org, djangofriendly.com, djangosnippets.org, djangoplugables.com are the ones that spring immediately to mind, but I’m sure there are others that I’ve forgotten to mention.

At the heart of it all are some very dedicated, hard-working core developers. It was great to see Malcolm Tredinnick’s queryset-refactor branch merged in trunk, taking us one step closer to another major release of the framework. And Jacob Kaplan-Moss continues to work at refactoring the documentation (which I’m feeling slightly guilty about, since I’d offered to help but haven’t had the time to do so, as it turns out.)

All in all, life is pretty good in Djangoland.

Fun with generators

April 24th, 2008

I’ll admit to being a little scared of Python generators when I first became aware of their existence. I was fairly sure that I didn’t understand them properly, and I failed to see how useful they really are. A few things have opened my eyes in recent months. First, Wesley Chun’s Core Python Programming helped to clarify a couple of issues, and then there was a session at SPA2008 which generated one or two “Aha!” moments, despite ultimately making my head spin.

Most recently, a few folk have blogged about David Beazley’s PyCon ‘08 presentation, Generator Tricks for Systems Programmers. I concur with the person who said it was one of the best introductions he’d come across. I particularly like the approach David’s taken, of avoiding trivial Fibonacci sequence examples and jumping straight into real problems of the kind faced by sysadmins. The performance stats he’s gathered are striking; I hadn’t realised just how competitive writing generator-based scripts for log file analysis can be with non-generator approaches or the more traditional tools used for this purpose, such as awk.

All this has made me more determined to make much better use of generators in my day-to-day Python programming.

New toy

April 12th, 2008

I succumbed to temptation and bought myself an Eee PC - and very nice it is, too. My rationalisation for this is that lugging a bulky Dell Latitude D800 around all the time was giving me backache, but I can’t deny that part of it is the gadget lust of a typical geek!

On teaching programming with Python 3.0

April 8th, 2008

I’ve been doing a lot of thinking lately about Python 3.0 and the impact it might have on our teaching of the language to our first-year students - most of whom have done little or no programming before.

I’ve written a paper about the issues; you might want to check it out if you have an interest in the teaching of programming using Python.

Google App Engine

April 8th, 2008

This is very cool. And Python-based, to boot, with a strong Django flavour to it. Needless to say, I wasn’t quick enough to get a beta testing account. I’m on the waiting list, like countless others, no doubt…

This Week in Django

April 2nd, 2008

Michael Trier & Brian Rosner’s This Week in Django podcast is always worth a listen. I’ve found it to be a very useful way of keeping track of significant changes to trunk or newforms admin. It was good to hear mention of Changeset 7363 (based on my patch :)

Pygments is cool…

March 28th, 2008

Pygments has been on my radar for a while, but I hadn’t looked closely at it until the other day, when I had a need to highlight some code fragments in a reST document that I’m writing. Hacking rst2html.py to do the necessary work was easy - just a copy-and-paste from some sample code in the docs. But then I hit a problem; my document includes code fragments written for both Python 2.5 and Python 3.0, and Pygments can handle the former but not the latter.

I delved into the source code with some trepidation, wondering how long it would take to hack a solution of some kind. I needn’t have worried. Pygments has good docs and a very clean design, so it took just a few minutes of study to figure out what was required. Less than fifteen minutes later, I had a Python3Lexer class plugged in and working!

If you want the code, it’s now been merged into Pygments’ Mercurial repository, courtesy of Pygments lead developer, Georg Brandl (Cheers, Georg!) Check it out with

  hg clone http://dev.pocoo.org/hg/pygments-main