Someone's having a firework party just down the road. Not sure why -- I know it's the Fourth of July, but this isn't America! 22 hrs ago

December 2008

27
Dec

Django: ValueError: too many values to unpack

I came across this error this morning on a Django project that I’m working on in my spare time. I was trying to add some custom permissions to one of the models, as outlined in the documentation, only to have it choke with this message when I ran manage.py syncdb.

A bit of Googling got me to this site, but unfortunately it’s in Polish. Never mind, Google Translate managed to give me enough information. Turns out that I had missed out a comma that I didn’t think was necessary:

class Meta:
  permissions = (
    ("can_drive", "Can drive"),
    ("can_vote", "Can vote in elections"),
    ("can_drink", "Can drink alcohol"),   # <== This comma is important!
  )

Hmmm, I always thought that last comma in Python was only an optional extra in case you decided to add an extra item to the end of a tuple and forgot to add it in to the previous line. Seems it does have some obscure but significant semantic importance after all.

22
Dec

Time for a new job

It’s now just under three years since I started working for EurekaStep Ltd, and it’s been a pretty good time. EurekaStep is a small but friendly company and a great place to work, and you get to serve some very interesting clients with some very interesting technology.

However, the time has now come for me to move on, and so in the middle of January I will be taking up full time employment in the Houses of Parliament.

My job title will be Analyst Programmer and my responsibilities will be to take what goes on in the Commons Chamber, the various Select Committees, and so on, turn it into XML, mash it about a bit with copious quantities of XSLT, and spit out web pages and Word documents that then get sent on to news agencies around the world.

This isn’t actually entirely new to me. I’ve spent the past three and a half months in Parliament already on placement from EurekaStep, doing pretty much that anyway. This was intended to be a stop-gap for them while they recruited some new developers, but I ended up applying for one of the jobs myself, and to cut a long story short, I got it. It’s quite an exciting change nonetheless, since I’m working on-site in a team of about ten or so developers, plus a whole raft of project managers, Enterprise Architects, web designers, producers and other key stakeholders. Up until three years ago, I was the only developer on the projects I worked on, and over the past three years, most of the other developers that I’ve had to work with have been based off-site. That works up to a point, but you can get so much more out of the real-time collaboration that comes from being in the same room, bouncing ideas off your fellow developers, and so on.

05
Dec

Do antivirus scans really need to brick your computer?

Pretty much every antivirus software package that I have ever used has a really annoying flaw. Whenever it launches into a full system scan, it slows your computer down so much that it hardly even responds to your keyboard and mouse. Given that a typical PC has up to half a million files knocking around on the hard disk, such a scan takes a good couple of hours at least.

It seems that when they perform a scan, they process the files back to back, which results in a lot of churning of your hard disk as the heads continually seek all over the place to find the next one. The fact that they’re both processor intensive (with fairly complex heuristics and pattern matching algorithms) and hard disk intensive means that during this time, they effectively brick your PC for a good two hours or so.

I’d have thought it would be fairly easy for them to fix this, by introducing a pause between each file (or each chunk of a file, for larger files) to give your computer a chance to respond to user input in a timely fashion. They could go in to a fast mode if you were running a screensaver, but while you’re actually trying to get some work done, you really want them to ease off the gas.

Unfortunately, I’ve not yet come across any antivirus programs that do this. Why not?