Visualizing Statistics in Minecraft

Minecraft screengrap showing cows in fron t of colored boxes representing the government expenditure of the united kingdom.

Data about public sector spending is often hard to understand and compare. Statistics about government is often presented in tables. In this hack I have used open data from Eurostat (the EU statistics agency) about government expenditure for a set of countries and rendered sets of boxes in a Minecraft world. This makes it possible to explore the data by walking (flying) around the world. Continue reading

Integrating Yahoo Search in a Django site in 5 easy steps

I have been experimenting with various search options for the site for a while. Google Custom Search is nice and very fast, but the number of ads appearing in the search result page makes it difficult for users to separate result items from ads. (Update: I am sticking with Google Custom Search until I figure out how to get Yahoo search to present proper excerpts). Continue reading

Improving Django performance with better caching

The Django cache middleware is great, but has one drawback. If you are caching views (which can give a nice performance boost) Django will only use the path segment of the URL to create a cache key. If you are an avid reader of RFC 3986 you may remember that a URI consists of multiple components; path and query being of special interest here. The problem is documented in ticket 4992 (Update: it is not in Django). Continue reading

What’s your history|awk…

Via Bill de hÓra. Run this from the command line:

history|awk '{a[$2]++} END{for(i in a){printf "%5d\t%s ",a[i],i}}'|sort -rn|head

I get:

108 ls
78 cd
53 sudo
29 python
13 cap
9 ruby
8 vim
6 easy_install
3 bzr
1 ex
1 python2.5
1 ln
1 mksir
1 cat
1 cccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccccc

In short:

  • I have trouble with my default python installation.
  • I am trying Django for small project.
  • I was hit by the Leopard keyboard repeat freeze bug.
  • I am poor at spelling simple commands.

Come celebrate Niklas Lindström’s birthday

You may ask yourself “who is that?” or “wtf?!” but the fact is that in the near future he will have a much greater impact on your life than you may think. Here is why you should head over to his blog and post a random comment about Yak shaving and, if possible, create a link containing the words “Yak shaving” pointing to his blog. With a little bit of effort and luck Google will pick it up and Niklas will be the number one result for people from inner Mongolia. Continue reading

Software architects as management deadwood

Two interesting quotes from Dietrich Kappe:

So no, we don’t hire architects. We hire developers. In a small team, there is no room for management deadwood.

I agree completely. My view is that the title “Software architect” is a misnomer for what most architects in the software industry do, or at least what they should be doing.

It is part of the weird trend that career advancement means getting away from actual programming for some reason. Maybe that is part of a bigger problem when the only way to get a higher pay is to become a manager of some sort? A couple of years ago, most programmers I knew aimed for a project management position. Programming was a dirty job that you had to put up with during the first years in consulting.

When my title was “business analyst” I tried to do as much programming I could and I haven’t regretted that for a moment. In fact, I believe that more people from the business side should get involved in programming to get a better understanding of the fundamental principles. For example, it would be great if business people could write their own acceptance tests and with the booming trend of DSL:s you will probably get involved anyway.

If you’ve made the transition from a hierarchical environment to an agile, self-organizing team, you know what I’m saying. You won’t ever want to go back.

Absolutely. It is the same thing as discovering things like Ruby/Python/Rails: it makes you wonder what the hell you were doing earlier. In many ways I feel sorry for young software developers that go straight into Rails or similar frameworks today. They are not as appreciative as the rest of us:-)

Hackety Hack – The Foundation for a Revolution

Why the lucky stiff is a well known name among most Ruby developers. Many have read his Ruby programming tutorials and seen his spectacular performances (or whatever they are) at RailsConf and elsewhere. Personally, I owe him a lot for Hpricot, the liberal HTML parser (at my government agency we use it to run the quarterly test of all public websites in Sweden). Hpricot is also the default parser for the Ruby Accessibility Analysis Kit. Continue reading

First impressions of Mercurial (as an alternative to subversion)

So, I was in the mall the other day where I bumped into Marcus Ahnve. He mentioned that he had been using Mercurial instead of Subversion for his latest project.

Just before I met Marcus I had been coding on a rails project housed in subversion. I was sitting in a cafe without internet access which means that it wasn’t possible to commit changes to subversion. As my son was asleep time was scarce and I wanted to get as much done as possible. So what do you do? Well I continued coding on a different part of the application and in the end I had a fairly large changeset waiting to be committed.

This makes for bad coding practices. A large changeset is more likely to create problems for your colleagues when the do an update from the repository. I really wanted to be able to create several changesets offline and put them back in when my connection was restored.

Trying Mercurial as an alternative to Subversion

This is where Mercurial comes in. With Mercurial it is easy to create changesets when you are offline. These can be pushed to a central repository (of you have one).

Installing Mercurial in a shared hosting account should be easy if you have access to ssh, Python and Apache. Following the step by step instructions by Bill de hÓra it was easy to get Mercurial running on TextDrive.

My initial impression is that mercurial looks very promising:

  • Mercurial commands are very similar to those of subversion and it was easy to set up a new repository.
  • The web interface looks very nice compared to that of subversion.
  • Capistrano can be used with mercurial.
  • It feels marginally snappier than subversion.
  • Mercurial doesn’t litter your folder tree with myriads of folders (just one in the root folder).

The next step is to migrate my subversion repository history using Tailor. If that goes well I may well become a mercurial switcher.

Languages Influence Your Thought Process

When I studied social antropology a couple of years ago I never thought that it would influence my future programming endeavours. At that time we looked at theories on how things in our surroundings influence thought processes. One theory is called the Sapir-Whorf hypothesis. It states:

“…there is a systematic relationship between the grammatical categories of the language a person speaks and how that person both understands the world and behaves in it.”

Recently I have found more information on how other people feel programming languages influence how they think (e.g. Paul Graham, Charlie Savage). Maybe this can put an end to the Ruby vs Python debate? Some people will feel that Ruby relates more to their thought process than Python does. And some will feel that Python is superior.

If you like me believe that programming languages influence your thought process the advice in The Pragmatic Programmer: From Journeyman to Master is very relevant:

“Learn at least one new [programming] language every year. Different languages solve the same problems in different ways. By learning several different approaches, you can help broaden your thinking and avoid getting stuck in a rut.”

Others may disagree.

So, what is your next language?