Archive for General

New place, new time, same great Dojo

Last night, the London Python Dojo were the guests of Mendeley on the Clerkenwell Road. I was pleased to discover while chatting over the pizza and beer that I wasn’t the only one to have wandered round the area a few times before hitting on the right spot. Although I had a map of some sort, I’d forgotten just how cluttered central London is: how many passageways, tucked-away building and unlabelled streets.

But it was worth it. Mendeley have larger offices than our usual host, Fry-IT. And while there were slightly fewer of us than normal (low 20s as opposed to the usual high 20s) it was still great to have a bit of breathing space. Thanks very much to the guys at Mendeley for hosting us (and providing pizza, drinks & snacks).

Jonathan Hartley was making his debut as compere and managed very effectively. Well… fairly effectively. (I shouldn’t laugh: it’s my turn next month). He’d lined up three “lightning” talks to kick off with. First up was Ian — who’d arranged for us to use the place. He explained what Mendeley does (a sort of social network for research students) and how they use Python (mostly as a scripting API) and demo-ed some fairly nifty visualisations and tools which people had built on top of their product. Jonathan himself spoke last to ask for help with a Django concurrency issue. Which he promptly got. In between was Robert Rees who showed-and-told very effectively the recently-added Heroku support for Python. This enlarged into a wider discussion of Heroku itself and of its competitors in the Django/Python world.

Then the Dojo itself. As usual, we had a whiteboard available beforehand for people to propose ideas which were then voted on. The Roman Numeral Calculator remained top of the list of unchosen ideas, but the surprising winner was Robert’s suggestion of an ASCII Art Streetfighter clone. (Chosen only after a second round of voting with a Multiple Transferrable Vote). Once this was settled, it was a simple matter of dividing into teams and hitting the editor.

Or almost. We initially failed to be able to count up to 5 in order to divide into teams. Having finally achieved this intellectual feat, we encountered the opposite problem to the one we normally face at Fry IT. There, the office is so small that you’re squeezing into space. At Mendeley, there’s so much space that you’re wandering around for ages trying to find the best spot. And then you’ve got to find the WiFi (which Ian had considerately explained about). And then you’ve got to manually set your DNS Servers to something (as the DHCP wasn’t handing out DNS). Slightly geekily, the WiFi password is mathematical making it easy to remember but still quite long.

And then, in our case, you had to find the Pygame curses emulation which someone knows exists but can’t quite remember the name of. Having got there (with about 20 minutes left now to do the actual coding) you basically scramble your way through a stunted version of Streetfighter (whatever that is; I have no idea), getting a basic solution on which you layer colour and fonts in the manner of lipstick and pigs :)

Finally, the endgame; and it’s the usual hilarious collection of imaginative approaches, stylishly-designed code, and desperate hackery. We saw: elegant ASCII art; flying bullets; gratuitous use of decorators; and many entertaining attempts to achieve an equilibrium between using classy and best-practice code and actually coming up with a solution within the timeframe!

I don’t know where we’ll be next month, but stay tuned to the python-uk list where stuff is announced.

Python 3: print or print()

There’s a thread over on the Python list which started a week ago as I write and is still running. The OP titled his post the provocative “I strongly dislike Python 3″ but what it really comes down to is “I strongly dislike print()”. Various people have come in on both sides of this well-worn argument.

Now, I don’t really mind futile discussions, and this clearly is one: Python 3 isn’t going to switch back, no matter how many people weigh in on the print-as-statement side. I’m in that camp myself, and when the matter was first up for discussion I had a to-and-fro with Alex Martelli on the subject which I backed away from fairly quickly. I continue to enjoy and benefit from Python regardless; I contribute to its development very slightly and very rarely; and even were I the most prolific contributor on the planet, I don’t believe that would give me any particular right to dictate design decisions of this sort. You take the rough with the smooth.

I think the side of the discussion which irks me the most is from those who are defending the print-as-function decision. Clearly there are cogent and persuasive reasons why print should be / should have been a function. No-one’s pretending that this was a decision taken randomly and for the sake of change. Or even for the sake of a foolish consistency. But if someone’s working practice involves using print a lot — perhaps in the interpreter rather than in a code editor — then the switch to the function version is clearly a burden. It may be more or less of a burden, but it involves having to do something which you didn’t have to do before. Being told that you should have been using logging or pdb or sys.stdout.write — all of which are valid tools to use in the proper place — doesn’t really make your life any easier.

So while Python 3 is now the default interpreter on my shortcut keys and I’m trying to write new code against 3.2, I still find it a pain to overcome the very long habit of, eg, print ad.find_user ().sAMAccountName. Obviously if Python 1.5.2 had had print () as a function originally, I wouldn’t find is so hard now. ;)

(As an aside I did wonder at first whether the American or some other non-UK keyboards had the brackets in some more convenient spot, but it doesn’t appear so…)

Poppy Day again…

It was quite a while before I realised that using Poppies to commemorate Remembrance Sunday (and the fallen of wars in general) wasn’t universal. I don’t know if it’s practised anywhere outside the UK, in fact. But here it’s pretty much the only one of the many collections-for-good-causes which has widespread appeal, partly because it’s a tradition which long precedes pretty much every other save-the-something collection. Partly, I think, because we’re all human and who can argue with collecting money for such a cause?

As it happens I haven’t seen many poppy-sellers around where I work in Camden Town. But I knew that today — Saturday before Remembrance Sunday — the local cadets would be out in force (and in fatigues) around Ealing where I live, armed with Poppies and collecting tins. And they didn’t disappoint. I am, for several reasons, not a great fan of cadets and school OTC outfits. But, at least where I live, this is pretty much the only example of seeing groups of young people on the street doing something for the good of others. The Scout movement has reinvented itself as a training scheme, as far as I can see; and in any case, it’s been years since anyone would have been seen dead on the street in a Scout uniform.

So I bought my poppy from a young man in army outfit who looked a little lonely at the side of the main Shopping Centre square. And I hope you’ll all do the same.

Compare and Contrast

http://news.bbc.co.uk/1/hi/technology/7910110.stm

http://jobs.joelonsoftware.com/default.asp?5319

I’m not an open source bigot, although I do like to use it where I can. But it doesn’t look as though the government’s that interested in pursuing non-commercial solutions, does it?

Disabled badges

I work in Camden Town in the north of London, a mecca for youngsters shopping for the more outlandish kinds of outfit, and one of the most difficult places in the known universe to park in. Jamestown Road, just off the Camden High Street, is a popular spot for parking with a good view of the pay-and-display machine. Of course, if you’re entitled to a disabled person’s badge then you or your driver can park without paying (within certain restrictions). Now there’s obviously nothing to prevent someone who’s disabled in some way from being the owner of a fast and expensive sports car. But when you see three or four of them a day parked along the road, proudly sporting their Blue Badge, you stop and wonder…

… and sure enough, there are periodic newspaper reports of a thriving black market in Blue Badges. Obviously, there are greater threats to humanity, but you do wonder whether the veritable swarm of traffic wardens which Camden Borough appears to employ for no better purpose than to maximise their income from parking revenues might not be employed to better effect by standing by Blue Badged cars and waiting with a video camera for the entirely able-bodied driver to show up!