For future reference:
Requires the gdal package, or you can download FWTools, which includes it.
If you have the following project layout:
/src
/module
class1.py
class2.py
/tests
test1.py
test2.py
/module2
class1.py
class2.py
/tests
test1.py
test2.py
tests.py
Putting this script into src/tests.py will let you bootstrap your tests.
Note: To import modules from your test classes, use relative import statements. For example:
This means, of course, that you need to compartment your tests so they only test things in their parent package. This isn’t a bad thing, as unit tests should be focusing on per-module functionality anyway.
Add this function to your .bashrc
Produces:

Usage: rtail [FILE] [PERL_REGEX]
I recently read a post on Hacker News about Bluetile, a branch of XMonad that was designed to be more accessible to new users. I’ve been reading about tiling window managers like XMonad for a while, but have never found the time to dive in and try one out. Bluetile was the perfect excuse.
However, getting it set up on Ubuntu 9.10 turned out to be a bit of a hassle, so I’ve documented the steps taken here for future use.
First, lets install all dependencies:
We can then pull down and install Cabal, a package manager for Haskell. This is what we’ll use to install Bluetile.
And repeat these steps to install the cabal installer:
Then create a symlink to cabal:
We can now update cabal, and finally install Bluetile:
Run bluetile from a terminal, and we have our first basic tiling window manager! Bluetile will take over from metacity, and give you some quick guidance on how to use the WM. Some important shortcuts are documented on the bluetile site.
The great benefit of tiling window managers is how easy it is to set up workspaces and desktops for a specific task, workflow, or mood. A comment on Hacker News sums it up:
It takes about a week or two to adapt, but it’s a great productivity enhancement. Its really a kind of desktop construction kit: I find myself making layouts that suit my work, mood, and hardware.From this comment by kevbin on news.ycombinator.com.
For example, my original setup for python development in bluetile, which blew away my old one (namely, dragging windows into position, losing focus to browsers, losing my editor etc):
The tiling means I can spend less time worrying about my windows, and more time getting stuff done. Which is reason enough on its own to try Bluetile. Give it a go, even if you’ve never thought about tiling window managers before.

Front covers

“My Greatest Physics Adventure”

The tentacles in question

This made my day.
A cool thing about the game was how the copy protection worked. I’ll let the manual explain:

You then have to match up one of these images (two at the bottom of every page) with the beakers shown mid-game, or else you can’t continue. A bit archaic, but I love things like this.

So that’s my small trip down gaming memory lane. I used to love this game to bits, but sadly the manuals are all I have left. It has, however, prompted me to try and find a copy of the full game again, as it really was brilliant.
I finally bit the bullet this weekend, and puchased a T-Mobile G2 Touch. I wanted the phone for the Android OS, and it hasn’t disappointed. One of the biggest draws for me is the Android Scripting Environment, which lets you write small apps in Python, Lua, Perl, Ruby and Bash, using an embedded editor and terminal. I can’t describe how cool it is to be able to code on the train, without my laptop. So far, I’ve played around with the Python API, and it really is fantastic - dirt simple to use, and easy enough to extend with external modules. Beautiful Soup comes pre-packaged, but you can recompile the python interpreter with any pure python modules.
The ASE also comes with bindings for a couple of external libraries - Barcode Scanning from ZXing, and text-to-speech using eyes-free. You can also launch ASE scripts from Locale
My first foray into scripting for Android is an attempt to make my music purchasing habits more independent, and avoid RIAA-affiliated artists at all costs. Using RIAA Radar and Amazon Web Services, you can scan a CD barcode and find out whether the album is affiliated with the RIAA.

App on home screen

Scanning a barcode


Looking up ASIN codes from Amazon, and cross-checking against RIAA Radar


Result! You get a notification straight away, and an entry in your notifications in case you want to check several items.
You can download the source for this app here. It requires ASE installed, as well as BarcodeScanner. You will also need an AWS account.
The code itself is pretty simple. The main body of the script is this:
However, the Android barcode scanner returns an EAN-13 barcode, while the RIAA Radar search only uses ASINs. To convert between the two, we use the AWS Product Search API to find an identification number for the product. The algorithm is defined by Amazon, and is a bit lengthy - you can read about it here. The code is below (put together with a lot of help from this post):
The script took me about a day of on-and-off work, and was great fun to write - I’m seriously considering trying some “real” Android dev work. Hopefully this will be of use to some people, and maybe of interest to a lot.
Not mine originally, but I liked it so much I had to post it:
This sums up what I feel about Linux and the whingers that moan how hard it is to install/use.
Everyone brings one piece of the plane along when they come to the airport. They all go out on the runway and put the plane together piece by piece, arguing non-stop about what kind of plane they are supposed to be building.
Everybody pushes the airplane until it glides, then they jump on and let the plane coast until it hits the ground again. Then they push again, jump on again, and so on…
All the stewards, captains, baggage handlers, and ticket agents look and act exactly the same. Every time you ask questions about details, you are gently but firmly told that you don’t need to know, don’t want to know, and everything will be done for you without your ever having to know, so just shut up.
The terminal is pretty and colorful, with friendly stewards, easy baggage check and boarding, and a smooth take-off. After about 10 minutes in the air, the plane explodes with no warning whatsoever.
Just like Windows Air, but costs more, uses much bigger planes, and takes out all the other aircraft within a 40-mile radius when it explodes.
Disgruntled employees of all the other OS airlines decide to start their own airline. They build the planes, ticket counters, and pave the runways themselves. They charge a small fee to cover the cost of printing the ticket, but you can also download and print the ticket yourself.
When you board the plane, you are given a seat, four bolts, a wrench and a copy of the seat-HOWTO.html. Once settled, the fully adjustable seat is very comfortable, the plane leaves and arrives on time without a single problem, the in-flight meal is wonderful. You try to tell customers of the other airlines about the great trip, but all they can say is, “You had to do what with the seat?”
Credit goes to Lee, UK, from here
I’ve just activated a new Virgin Media Broadband account for a new flat, and came accross this idiocy:
If you’re running anything except the officially sanctioned Windows or Mac OS, you can see this here: http://act2.virginmedia.com/Activation/runComputerTest.do
Not only is this test utterly brain-dead (it’s just broadband for christ’s sake), it’s crap. I got around it using the User Agent Switcher for Firefox. So the setup doesn’t actually need Windows or Mac, it’s a completely arbitary decision by some pointy-haired manager at Virgin. The £1/min support line for people with “unsupported OSs” has nothing to do with this decision, of course.
Posting this just in case it appears in google and helps another person struggling with this issue.
There’s a problem with my Sasmsung R700, in that the backlight is at maximum brightness when booting up, and when in the BIOS menu, but at some point during boot it drops down to a near unusable level. The brightness adjustment keys also didn’t work, so I was stuck with a horrible display. The fix is to blacklist the video driver causing the problem:
echo blacklist video | sudo tee -a /etc/modprobe.d/local
Running this then rebooting fixed the problem. Hope this helps someone!
Wow, this week is becoming a great day for new software. I count 4 great releases already this week:
Monday:
Tuesday:
Firefox 3.5 (being released today, no official link as of yet, but the RC can be downloaded from here)
Add to this the relase of python 3.1 last week, and it’s a great time to be using free software.