Using code coverage to find bugs

Yesterday, I found two bugs whilst looking at a code coverage report. I tend to think that shooting for 100% code coverage adds unnecessary overheard – often the last few percent doesn’t give you much benefit, and takes a disproportionate amount of time to reach, but it’s useful to at least understand why particular lines … [Read more…]

Turtles all the way down

One of the programming lessons I find myself re-learning again and again is this: It’s turtles all the way down. When I first started my current job, just after graduation, I was working in a frontend development rôle. The app I was working on involved storing customer data in a proprietary database system, and from … [Read more…]

Installing PIL on 64-bit Ubuntu

I’ve just got a new laptop, and wanted to avoid messing around with symbolic links in order to install PIL in a virtual environment. I’ve just discovered patch, and thought I should automate my process of installing PIL (a process which previously involved me making a trivial edit to the setup.py file).

Bulk Upgrading Django Sites

A new version of Django was released a couple of days ago. I’m currently at 11 sites using Django, so upgrading them all manually (which I did last time) is a pain. To help me out, I wrote a tiny Fabric script to spin through my sites, check if they’re using the version of Django … [Read more…]

Using a local cache for pip packages

I do a lot of development without an internet connection1, so being able to install packages into a virtual environment without a connection to PyPI is pretty useful.  Mostly on the train to and from work. ↩

Automated Deployment of Django Sites

I tried out Fabric a while ago, but never really got anywhere with it. Time passed, and I forgot it existed, and wrote my simple scripts for automating deployment of my various sites, using Paramiko. It was incredibly tedious, but meant I could deploy my sites from whatever computer I was on, provided I had … [Read more…]

Forays into Responsive Design

A good friend of mine alters cards for Magic: The Gathering for fun and profit. Previously, he posted them on his Twitter feed, along with a brief description, but that doesn’t provide a great way of seeing at a glance the sort of things he does – a place to point people who ask for … [Read more…]

Moving to Ubuntu for mobile development

My web-development office is a fast-moving place. It averages around 50 miles per hour, and I work on a laptop normally squished between two people on the train to and from the office. When I happen to have a spare moment to build websites at home, I tend to use my desktop, which is running … [Read more…]

Avoiding database queries with Haystack

Order(n) is a pretty bad idea. Originally, my SearchIndexes for Haystack looked a bit like this: Then, when someone ran a search, and I wanted to display a result, I’d load up a template (which template I loaded depended on grabbing the model name, as recommended in the docs), and any attributes of the model … [Read more…]