Archive for Dojo

We survived! A London Python Dojo without @ntoll

[Note to self: blog about things other than the London Dojo…]

Nicholas “@ntoll” Tollervey has been the London Python Dojo’s parent for all its young life. Once it achieved toddler status, he felt confident enough to start letting other people look after his baby, so over the past few Dojos various other people have run things on the day, always with @ntoll in attendance. Yesterday was the first day on which he felt confident enough not to be there, leaving things in the hands of @tomviner (who could be seen consulting a trusty checklist throughout the evening).

As I re-read, I realise that it looks as though I’m accusing @ntoll of being over-possessive, which I most definitely am not. He’s done — and continues to do — a fantastic job at organising the Dojo and making it happen even when he’s not the evening’s MC. We’re just delighted, as Tom said last night, that he doesn’t feel that he needs to attend it every first Thursday for the rest of his life. (A little secret: the day before this month’s Dojo he was still sending mother-like emails to the rest of the organisers: don’t forget to … remember that … have you …?)

Last night’s Dojo was fun as usual: we were doing the famous Game of Life — probably a text book example of a text book example! Uniquely in my experience, every team had a working version to show after just an hour and a half. The team I was in managed to get something working while @john_chandler and I were still chatting in the background. We fiddled about with it a bit, adding a few preset forms to seed the board etc.

An unexpected visitor was @JohnPinner (of PyConUK fame). He was in London for a meeting and timed things so he could come along for the start of the Dojo, altho’ he had to dash after about an hour to catch his train home. He gave a lightning talk at the beginning outlining various Python-related conferences and training sessions which in the offing. Including this year’s PyConUK, once again in Coventry.

@tomviner’s novelty for this Dojo was the favourite-module question on the sign-up form, which was also used as part of the introduction session. Perhaps unsurprisingly, Kenneth Reitz’s requests module was the clear winner (the only one with more than one vote!). Other unsurprising entries included itertools and collections, but there was a variety of others. I was chatting with John Pinner about the line-up for PyConUK this year, and he pointed out that there’s some mileage for simple talks about a particular module, eg logging or itertools. I’m thinking of proposing such a thing for future Dojos…

There’s also been talk on the python-uk mailing list of a second London-based Dojo, or other Python event, on a Sunday. That might suit some people who can’t make a weekday evening in London but who could manage a weekend. And the more Python events in London the better!

Boggle at the London Python Dojo

(Yes, that is a deliberately ambiguous title offering two possible interpretations: as a description of what the programming challenge was at last night’s Dojo; or as an imperative to be awed at the might and wonder that is the London Python Dojo. You choose).

Last night was the first time I’ve actually run the London Dojo. For the two and more years since its inception, Nicholas Tollervey (@ntoll to his Twitter friends & acquaintances) has indefatigably turned up every first Thursday to clear up the Fry-IT offices, order the pizza, buy the beer, put up signs, leave out sticky labels, request free books from O’Reilly and then drum up support, keep everyone happy and actually run the show, finishing off by organising everyone to clear up, move chairs, dump the rubbish outside, and finally catch the last train home to Sticksville, Northants. where his wife and children have long ago fallen asleep over their sheet music, having gone da Capo al Segno one time too many waiting for him to return home.

A few months ago, Nicholas asked for volunteers to help out, and a small group of us got together to share the burden. Since then, Bruce, Jonathan, Tom and finally I have taken a turn at organising. And of course it’s not until you have to do it yourself that you realise how much work is involved… I was fortunate because Gautier (who actually works there) and Nicholas himself were both at Fry-IT for the day and were able to do some of the less proximate preparation, including ordering a dozen pizzas and buying three dozen bottles of beer. I was able to make a small contribution in the shape of a pack of sticky labels.

The Dojo itself was very slightly quieter than usual: just under 20 rather than just under 30. That’s not a bad thing in Fry’s offices which are not huge. There was a bit of an introduce-yourself session (which was made even more primary-school-like by the presence of big sticky labels on everyone’s chest with their names or cognomens). And then we had a lightning talk from Martin who has a sort of cut-down Nagios for app developers. (I hope I haven’t done it an injustice). And then a surprisingly straightforward vote on the evening’s programming challenge which gave us… Boggle. (Word game; 8×8 grid of random letters; form words by moving like a chess king).

Four teams; four solutions, all more or less different. Only one team ended up with a working solution at the end of 90 minutes (and they appeared to be optimising by removing all vertical whitespace; or maybe that was an aesthetic choice - who knows?). Our team had visible activity (which is more than Team 1 managed!) but no solution. It’s up to each team how they want to manage their collaboration. We’d gone for the split-team approach, dividing the problem into its eminently decoupled parts: a mechanism to read in a dictionary of words and provide efficient searchability (using a Trie, in case you’re interested); and a structure to hold the board (a dictionary, keyed on coordinates), generate the letters into the grid, and search for all possible words, relying on the dictionary code to indicate success, failure, partial success, or success with more possibilities.

The tweets were still flying this morning as people tried to tweak their solution (or, indeed, get it to work at all) on the train, on their phone or at home overnight. A friend of mine who’s a C++ coder came along mainly because I’d talked so much about the Dojo. He’s not really into Python - in fact he’s not really a programmer: he does medical image analysis. But he enjoyed the atmosphere and made a few small suggestions before simply sitting back and watching the teams get to work.

Look out for the next Dojo at the beginning of January. It’ll be announced on the python-uk mailing list and we’ll tweet about it when we’ve fixed a date.

UPDATE Dirk’s added a blog post of his own:
http://elazungu.wordpress.com/2011/12/02/solving-boggle-with-python/

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.

Tears & Laughter at the London Python Dojo

Yesterday’s Dojo was as entertaining as ever. It almost went wrong before it started, as Fry-IT — who continue to provide the venue and the food & drink — had no working projector. Fortunately, my company were willing to lend one for the evening which got over that hurdle.

We started with a couple of lightning(ish) talks. Ravi had been on the StartupBus and he and the team had produced the final winner: TripMedi. Ravi explained the way the thing works and various of the challenges involved. He also explained how YCombinator works — something I’d only been vaguely aware of. [On a personal note, I can’t even imagine the kind of person who’d actually want to make use of what TripMedi provides, but I suppose it takes all sorts…] UPDATE: Ravi has just tweeted that the team has made it through to the next stage of YCombinator. Congratulations!

I then gave a presentation on contributing to Python core development and how you could go about it. Thanks to the efforts of Jesse Noller, Doug Hellmann and others, there is now the Python Insider blog, whose intention is to give greater visibility of some of the wider-reaching discussions taking place on python-dev. And the new core-mentorship mailing list is specifically intended to welcome would-be contributors who aren’t too sure how to go about things, or what the ground rules and policies are.

Once all the talking was done, the trouble started :) Nicholas, the indefatigable organiser of the London Python Code Dojo, has been quite keen on promoting XMPP (aka Jabber) to implement some sort of network-ability for our nascent multi-Dojo game engine. For the previous Dojo, his team had produced a simple XMPP Component which implemented a to-do list: the challenge for that Dojo. This time, Nicholas was keen for everyone to have a go with the same thing. He’d put code on Github, added a readme, and recommended the lua-based Prosody server and SleekXMPP for the Python end.

So we broke up into small groups (as they say), fired up git, pip and whatever, and dove in with about 75 minutes to produce something.

About 45 minutes later, most of us were still diving in, trying to get Prosody to listen to anything and failing to get the component talking to Prosody.

At this point, Mr Tollervey very wisely decided that we should cut our losses. Fortunately, John Chandler was willing to go up front and ask for a code review of the code he had produced. Which turned out to consist of two lines, one of which was “import random”. Being social coders, we were more than willing to advise him on the many ways in which he could make this simple and correct code into an over-engineered mess of obfuscation.

Since we’re in the middle of PyWeek, it seemed apt to have a demo from Daniel Pope of the game he’s developing on the theme of “Nine Times”. Impressive as always. (If you haven’t seen it, check out Bamboo Warrior, one of his previous efforts).

As always, we ended with a raffle of name-stickers for an O’Reilly Book and — this time — an additional donation from Mr Tollervery himself. Ironically Jon “I don’t like XMPP” Ribbens got the O’Reilly book on XMPP.

Watch the python-uk mailing list or follow ntoll on Twitter to know when tickets are available for the next Dojo (it usually takes place on the first Thursday of the month).

London Dojo & Github

I’m fairly new to github; to git, in fact. Truth be told, I wouldn’t even have bothered with it if it weren’t for the fact that ntoll organises the code for the London Python Dojo around it. And that the game engine we had decided to use was hosted there. While I’m all in favour of DVCSes (you just *know* what’s coming when someone says “I’m all in favour…”, don’t you?), the problem is that there’s only one Subversion, but there are at least two if not three — depending on your view on bzr — DVCSes with fairly widespread support, and they’re all subtly or radically different. I more-or-less committed to learning Mercurial, because it’s what Python’s moving to, but that doesn’t help me when other people are using git. Oh well…

Previously on London Dojo: we cloned the crawlr engine from axedcode’s github repo. And found, ironically, a maze of twisty passages all alike. We went north, south, east and west in search of treasure but found only darkness… Fortunately, the man himself spotted that his game engine was flavour of the month and got in touch to ask why, and to offer a newer, better version: axengine2. Which is a lot cleaner, even if there are some questionable design choices…

So we did that. And I spent half an hour at the beginning of last Thursday’s Dojo going over key pygame concepts — rects, surfaces, sprites, and sprite groups — and giving a whistle-stop tour of the codebase which, slightly surprisingly, reimplements the Python class inheritance model in JSON, backed up by Python classes. Sort of. There was half a chance we might even have a live Skype connection to the author at the beginning of the session — before he started work over in the States — but timing didn’t work out so it didn’t come off. Shame.

We set to work again, in teams as usual, each team having a “Dojo Quest” and 90mins to complete it. Naturally, everyone was still frantically coding at the 89-minute mark. (I know we were, having made a critical breakthrough in our attempt to introduce a joystick-controlled second player [*]). We had the usual show-and-tell of: a menu system, some background sound, the two-player mode, hidden treasure, and something else I’ve forgotten. By which time it was getting on for 10.30pm and there was only just time to pull a name out of the hat for the winner of the O’Reilly Book-of-the-Month on XMPP, which we hope to use for the inter-dojo gameplay.

The Dojos are always fun; they’re also nothing like the disciplined Dojos which others favour. Basically, it’s a social coding exercise with a fair bit of laughter and passenger-seat driving. We seem to be nudging the 30 mark every month at the moment, so watch the Python UK mailing list for the announcement that tickets are available and get in there quick.

[*] We delayed ourselves a little by confusing the KEYUP / KEYDOWN constants — which indicate depression and release of keys — with the constants indicating the up and down-arrow keys :(