Archive for Dojo

London Python Dojo December 2014

I feel like a sub-editor just struggling really hard to avoid punny headlines like “A Unique Experience” and “5 Unique Solutions” and so on… because last night’s challenge was to recreate the Unix “uniq” command in Python. In fact, this was chosen only after a tie in the first round of voting giving us a top 4 rather than a top 3 and a triple-tie for second place in the second round, although with one clear winner. (Otherwise I was going to have to move onto a Single Transferrable Vote round).

It was nice to see quite a few new faces, 6 or so first-timers and several who haven’t been for a while or who have been only once or twice. Plus, of course, the old familiar faces. Fry IT continue to host us generously, including ordering artisan pizzas with enormous slices. And O’Reilly came across as always with a book for the giveaway at the end.

Most teams went for a fairly straight solution, one of them managing to carry a TDD approach pretty much throughout. One team had grander ambitions for field selection and datatype conversion, but their solution ended up on two different machines with not enough time to merge properly. I was a little surprised that no-one used itertools groupby, which is pretty much advertised as a drop-in for uniq.

You can see a few photos retweeted at the @ldnpydojo account. Back again in January, probably on the second Thursday. But watch the python-uk mailing list and @ldnpydojo for announcements.

London Python Dojo: does it have a keyboard?

Those of you who don’t frequent the London Python Dojo wouldn’t appreciate the in-joke behind the laughter which greeted the selection of “20 Questions” as the challenge for last night’s Dojo. For months Nicholas Tollervey, the main Dojo organiser, has seeded the list of Dojo suggestions with the idea of implementing a simple expert system where the computer maintains a taxonomy of objects and tries to identify an object of your selection within 20 guesses by a process of elimination. It’s become a source of humour that Nicholas has to offer the same explanation every month and that the idea is never selected as the challenge du jour. Well last night it was.

And I admit that it was much more involved than I had thought it would be. I honestly thought we’d be done in 10 minutes and looking for ways to fancy up the interface or whatever. How wrong I was! The teams split between a tree-based structure with nodes holding questions & answers and yes/no pointers; and a matrix of questions which attempted to eliminate possible objects with each question. Getting the exact looping and yes/no pointing right is harder than you might expect, especially when you’re pressed for time and you have a team of five people to consider.

We were hosted, not for the first time, by Mind Candy (of Moshi Monsters fame) in their gorgeously child-friendly offices with Mind Candy local Al Broomhead as MC. And, as always, O’Reilly provided a book for the end-of-evening raffle. I’m consistently impressed by O’Reilly’s readiness to support us: I imagine it doesn’t cost them loads to give away a book a month, but they could so easily turn us down and they continue to provide, month after month.

There have been discussions, on-list and in private, about various aspects of the London Python Dojo and the organisers have various ideas in mind, but we’re not planning to do anything drastic to the current approach. (Although our setup means we can easily experiment with something if we want). Our main idea is to emphasise our status as a beginner-friendly forum where everyone can and should get a chance to code in Python even if they’re a newbie amongst experts. I’m glad to say that, in our team yesterday, everyone got a chance to code, however lightly.

Beforehand, @ntoll gave a talk about the upcoming PyConUK and particularly about the education track, encouraging people who know or are teachers and who know or are children to come along to these special aspects of the conference. I also gave a lightning talk about the socio-political challenges in Python core development — and about how people could and should contribute.

[The title of this post refers to a commonly-asked question shouted out from the audience as the various teams were demo-ing their approaches. Demonstrating necessarily involves going through as a series of “Is it …?” “What question could I ask…?” prompts and this one turned out to be a popular question, especially if the object in mind was a Robotic Catfish!]

Python meets BoA

[tl;dr photos here]

Last night’s London Python Dojo was held, for the first time, at the very spacious Canary Wharf offices of the Bank of America. They’re big users of Python and, as we were told in an brief introductory, were keen to give something back to the Community.

They certainly did it in style. Their main reception is about the same size as Ealing Common. The meet-and-greet bar area where we had Pizza on classy platters & Beer served by bar staff is not much smaller than the whole of the offices of Fry IT, our long-standing default hosts. And the area below where a few of us gathered feels like a swimming pool with a long slide-like flight of stairs leading down. The function room where the main business of the evening was transacted was spacious with large tables (and *lots* of pencils!).

The guys at BoA had really done their prep work: power strips were already in place and every possible laptop-to-screen adapter was available. (For those who haven’t done this kind of thing: there’s *always* some kind of mismatch between a screen which can only take DVI-I and a Mac user who doesn’t have the Mini-HDMI-to-DisplayPort adapter. Or whatever: I use Windows which never has these problems ;) ).

As well as the friendly intro from one of the BoA guys, we had an enthusiastic lightning talk on Bitcoin from Sam Phippen (who comes in from Winchester or Bristol for the Dojos!). With over 30 people present, we had about 15 suggestions for the evening’s challenge, including old favourites (How does 20 Questions work, Nicholas?) and new ideas, some around the theme of banking. After the usual two rounds we settled on Steganography and made use of the generous table space (and pencils) which our hosts had provided.

The results are on Github (or will be, depending on when you’re reading this) as pull requests come in and are honoured. In short, two (three?) teams went for piggybacking on image bits; two teams (including the one I was with) encoded bits in the extraneous whitespace of a text document; and the last team tried to use the Python’s indentation to carry information in some way which I couldn’t quite understand at the time. I think that every team bar the Python-indentation one had a working result[*]; ours even had unittests!

FWIW my first idea for our team was to encode the characters in Morse code (using spaces & tabs as dots & dashes). We finally settled on binary but I still think Morse would have been cooler — and we could have played the message out as a midi file for extra points!

Of course at the end we had a draw for O’Reilly’s usual generous contribution to proceedings along with an added bonus: an historical map of programming languages. Appropriately enough, the book was won by Sal who’d been the driving force behind Bank of America hosting the Dojo this month.

Next month we’ll probably delay by a week to come in after Europython. Not sure where we’ll be yet, but follow @ldnpydojo or look out on python-uk.

And, of course, big thanks to Bank of America for being our hosts this time round.


[*] And they may have got things working after a live “Aha!” moment by Al who was demo-ing. [UPDATE: Al was actually in another team per his comment below; so many teams, so short a memory span…]

Yesterday’s London Python Dojo

Yesterday was the March Python Dojo, hosted as usual by the ever-generous Fry-IT, with a book donated by O’Reilly. We started with a couple of not-so lightning talks from Tom Viner — talking about his team’s solution for last month’s puzzle — and Nicholas Tollervey — talking about bittorrent. An artfully-worded late question had @ntoll on his soapbox for a while on the subject of copyright and payment to artists, until someone spoiled it by suggesting that maybe we ought to write some code in Python!

After the usual, only slightly convoluted, voting experience, we decided to pick up one of last month’s runner-up challenges: creating a compression-decompression algorithm. Naturally most people started from some kind of frequency table, replacing the most common items with the smallest replacement. The approaches ranged from a hybrid Huffman-UTF8 encoding to an attempt to replace common words by a $n placeholder, where the n would increase as the word became less common. The winner for the most optimistic approach was a lossy algorithm which dropped every other word on compression, replacing it on decompression by the most likely from a lookup table. Tested against a corpus of Shakespeare’s works it produced some quite readable poetry.

As an aside, I can assert after a wide-ranging survey that (a) the preferred editor background is dark (black or dark-grey); and (b) in spite of all the tech at their fingertips, programmers still reach for pen and paper when they need to work something out!

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!