Pádraig Kitterick

Automatic key generation with App Engine

Posted in Code, Python, Tech, Web, appengine by Pádraig on June 21st, 2008

After playing Google App Engine for a few days, I’ve realised the power that even the basic framework provided by Google, webapp, provides. Working with Python adds a level of flexibility that I never had when working with PHP many years ago (although this was before OO had really infected PHP).

While working on my first real application for app engine I soon came across the problem of creating sensible key names for objects. If you aren’t familiar with the data object models in app engine, each object has a unique key, generated automatically when the object is created, and a key name (property: key_name) which can be specified by the user. The key name can be very useful if you need object identifiers which are human-readable, such as when you use them as part of your apps URLs.

(more…)

asioWavPlay for Matlab released

Posted in Code, Music by Pádraig on September 5th, 2007

If you use Matlab for audio research / development, you’ll be familiar with the pretty poor native support for audio playback. As part of my research, I wanted to play multichannel (>2) files at a variety of sampling rates and bit depths. In addition, I also wanted to use a low-latency audio layer, such as ASIO, to take direct  advantange of my audio hardware.

So, with a bit of coding I managed to put together a Matlab extension which allows for the playback of multichannel sound files using any soundcard with an ASIO driver. The plugin uses ASIO, PortAudio, and libsndfile. Samples are read from the audio file as needed, so playback start time is not dependant on the length of the file - useful in time-critical applications. Memory usage is also low because the whole file doesn’t need to be loaded into memory, only enough to fill the audio buffer.

You can download it over at the Matlab file exchange and the source is included under the GPL. Comments and suggestions welcome!

Python 2.5 Released

Posted in Code, Python by Pádraig on October 5th, 2006

Okay, I’m a few weeks late catching up with this but Python 2.5 has been released. I’ve been putting off checking it out for a while becuase there are lots of new features to explore (some content free hype about the release if you like that sort of thing). The introduction of a new with statement and a new one-line conditional syntax are particularly welcome.

Windows + Django +svn = Ugh!

Posted in Code, Python, Web by Pádraig on March 19th, 2006

After reinstalling windows recently I once again had to battle with the process of installing Django on Windows XP. All I remember about the last time was several hours of googling (if that isn’t a word ti aught to be) and cursing at the *nix-centric installation notes on the django website. So this time I decided to take notes so that I could put together a semi-coherent guide to installing Django on windows for development purposes. Here goes… (more…)

Authentication in Django templates

Posted in Code, Python, Web by Pádraig on December 5th, 2005

I recently came across a problem when adding user accounts to a Django application I’m currently working on: I wanted to access information about the current user, e.g. whether they were anonymous or logged in, so that I could display a login message or a link to their homepage respectively. This sounds like a relatively simple thing to accomplish but the problem was that I didn’t want to have to look up the current user’s information in every view method and pass it to the template. Luckily Django provides a way of dealing with this very situation by providing a special template ‘context’. (more…)