David Reynolds

Welcome to boredom

DJANGO PONY!

| Comments

If like me, you like the idea of django pony but you’re not so keen on the pink, here are some alternatives:

Django Pony Blue Django Pony Red Django Pony Green

Another Lolcat

| Comments

Yay, we haz iphonez

Just a quick note to mention that I got both of these lolcat images off of random websites whilst searching for ‘happy cat’ or ‘sad cat’, so I don’t own the copyright. If you do and you don’t want me to use them, let me know.

iPhone Impatience...

| Comments

iphone cat want iphone

I think O2 heard me:

Date:   9 July 2008 21:01:45 BST
Subject:   Order Confirmation

W00t! My order is confirmed, so ought to be here by Friday!

Last.fm

| Comments

Having a few spare minutes, I’ve added a template tag to my site that shows the last 10 songs I’ve listened to on last.fm.

1
2
3
4
5
6
7
8
9
10
11
@register.inclusion_tag('blog/lastfm_tracks.html')
def latest_tracks():
    url = 'http://ws.audioscrobbler.com/1.0/user/DReynolds/recenttracks.txt'
    response = urllib2.urlopen(url)
    songs = []
    for line in response.read().split('\n'):
        if not re.match(r"^$", line):
            songdetail = re.split(",", line)[1]
            artist, song = re.split(" \xe2\x80\x93 ",  songdetail)
            songs.append({'artist' : artist, 'song' : song})
    return {'songs' : songs}

Slight Redesign Redux

| Comments

This time along with a completely different design (which isn’t completely finished) I have updated the blog app to work with django trunk, along with adding a delicious template tag. The blog app also now uses markdown - a massive improvement since I was manually entering HTML before which proved quite time consuming. Hopefully these additions may make me update this a bit more often.

Bootcamp Blues

| Comments

I recently bought a new iMac (2.4Ghz Intel Core 2 Duo 1GB RAM 20") and I thought that, since it had an Intel Processor and had Bootcamp preinstalled, I'd give a go installing Windows and make it dual boot between the 2 operating systems. (Also, my boss was keen to know whether it would be quicker to use a dual boot system over running Windows in Parallels).

Bootcamp has quite a clever interface that allows you to resize your partition and then stick in your Windows CD, reboot and install. Also around this early stage it gives you the option to print out a PDF of instructions, to use whilst your new Mac is incapacitated. I foolishly decided not to print out the PDF (or transfer it to another machine - since we don't have our printer at the moment) and so when I got to the 'Which partition do you want to install Windows on' screen, I was unsure of which partition to choose. So, I cracked open my laptop did a quick Google search and found out that I should pick the partition that is labelled "C:". I picked this partition, with vague alarm bells ringing that the partition didn't seem to be the same size as the partition I had created back in Bootcamp (5GB). I pressed on nonetheless. I set it off formatting the partition and was surprised at how long it took to format a 5GB partition. In fact I started it, went out, came back home and it was still going. I began to worry slightly. I decided to abandon the install and reboot to OS X and check that everything was still working. I power-cycled. The machine booted from the CD again. I Googled for how to remove a CD from an iMac when you can't boot into OS X (hold down your mouse button for those not in the know). I then rebooted only to be faced by the horrible screen that told me the iMac couldn't find a partition to boot from.

It turned out that I'd completely wiped the disk of existing partitions. Through luck rather than judgement, just before trying out Bootcamp, I'd decided to try out Time Machine, so I had a lovely shiny backup to recover from.

Hopefully this might serve as some warning to anyone who thinks about trying out Bootcamp - make sure you print out the manual that is offered to you, and if a partition size looks wrong, it probably is!

Slight Redesign

| Comments

I've just taken the opportunity of being quite awake at 11pm (for some reason) to give the site a quick slight redesign. I wanted to feature a photo that I'd taken and thought perhaps I should get rid of the slighty-possibly-offensive picture that was there before.

The picture was taken on holiday in Northern Ireland at the Giants Causeway. It was taken with our Nikon D40X with some settings or other (I would give technical photography details, but I don't really understand them). I then did the LAB Colour trick to enhance the colours a bit.

For anyone who reads this blog through the RSS feed, or via Planet Alug you'll have to visit the site for a change to see the new(ish) design! Please let me know what you think, as I'm not sure whether the orange still works with the new picture.

Django Builtin Serializer Doesn't Work With form.errors

| Comments

Thought I’d right a quick note in case anyone else came across this problem. In trying to serialize the output of form.errors, I come across this error:

1
django.utils.functional.__proxy__ object at 0xb76b520c is not JSON serializable</pre>

After lots of debugging help by FunkyBob, empty pointed out a replacement serializer that seems to work much better.