Thursday, January 22, 2009
Look Who's [not] Talking at PyCon
The familiar names include Brett Cannon (cpython), Jim Baker, (jython), and Michael Foord (ironpython). There is a host of names that might be missing or might not - I can't recall if they do talks every year - but there is no Norwitz, Warsaw, Holden, or Martelli. Noticeably absent is Raymond Hettinger who has given several talks per con at several cons a year. Noticeably present is EVE Online in the form of Richard Tew and Krisjan; with the Icelandic Krona where it is I don't know how they can afford a taxi let alone air fare.
On the new list is Bill Gribble. Bill Gribble gets a free beer for having one of the best names ever (if his Mother shows up she can collect for her work, instead). I bet none of his friends ever start a story "I was having lunch with my friend Bill..." But instead always "I was having lunch with my friend Bill Gribble..." I don't know Gribble from a hole in the wall but I'll make a point of changing that.
[update] Talked to Raymond and he'll be attending, at least (barring life's usual caveats).
[updateder] As Brett and Ivan mention in the comments there is now a tier of invited talks that includes many of the "missing" conference regulars. Glad to have em, the "hall track" is my favorite and many on the invited speakers list make it so.
Sunday, January 18, 2009
Post's Machine
This version replaces the two custom containers with python dicts and moves all the complicated code to the pretty printer. A collections.defaultdict might be a slightly better choice for the 'infinite tape' that starts as all zeros. A nice thing about defaultdicts is that you can min() and max() even empty dicts.
I also did a python3.0 version which was nearly identical except for a 'with' on the file open and print-as-fucntion. Disappointingly I thought the advanced tuple unpack syntax would help in the case where a too-short tuple is padded and then the padding discarded.
# args might be a two or three tuple
a, b, c = (args + [0])[:3]
# python3 syntax
a, b, c, *ignore = args + [0]
The *ignore argument demands to be read as opposed to the [:3] trimmer on the end which keeps the low profile it deserves.
Here's the code for my Post Machine
def parse(lines):
program = {}
for line in lines:
pos, action, jump = [p.strip() for p in line.split(',') + ['0']][:3]
program[pos] = action, jump
return program
def execute(program):
tape = {}
tape_pos = 0
action = None
action_pos = '0'
while action != 'exit':
action, action_pos = program[action_pos]
pretty_tape(tape, tape_pos)
if action == '<':
tape_pos -= 1
elif action == '>':
tape_pos += 1
elif action == 'mark':
tape[tape_pos] = 1
elif action == 'unmark':
tape[tape_pos] = 0
return tape, tape_pos
def pretty_tape(tape, tape_pos):
if not tape:
tape = {0:0}
min_pos = min(tape_pos, min(tape), 0)
max_pos = max(tape_pos, max(tape), 4)
parts = []
for pos in range(min_pos, max_pos + 1):
val = tape.get(pos, 0)
if pos == tape_pos:
parts.append('[%d]' % val)
else:
parts.append('%d' % val)
print '.....', ', '.join(parts), '.....'
if __name__ == '__main__':
program = parse(open('post.txt'))
execute(program)
Tuesday, December 16, 2008
PyCon Talk Accepted
The email included the anonymous reviews of the proposal. Most were +1 but I'll keep in mind the +0 and -1s when preparing the new version of the talk. They were mostly concerned that the PyCon UK version of the slides was too code heavy. There is even more material now that decorators are in use "in the wild" so I may shunt those into a separate tutorial-like paper or maybe just include them as slides after the end so people who download the .pdf will see them.
I'll definitely have to prep and practice the new talk well in advance of PyCon. Lots of possibilities there; The Colorado Python group get together to practice all their member's talks every year - we could get the Boston PIG to do something similar. And I could make a show-me-do thing. And I'll definitely give it to the pythoners at my old company as a trial run.
Don't forget to register early for PyCon. We maxed out the hotel some nights last year and this year should be even bigger.
Wednesday, November 12, 2008
PyCon 2009 Plans
Tuesday, September 16, 2008
Post PyCon UK
Unfortunately adding in a drink count immediately injects a social (and thus very hard to model) component to the game. The mechanical rules say you drink if you are skipped or if you pass. But the social rules say you can be made to drink for any reason by someone higher than you in the chain. People being people those optional drinks are subject to retribution and those kinds of things are very hard to model. I expect tit-for-tat to work well in simulated play but that completely ignores the human propensity which is to engage in cooperative play.
Sunday, September 14, 2008
PyCon UK: Class Decorators, Radically Simple
Two thirds of the slides are new. There is much more front end emphasis on what decorators are and simple function decorators examples. The examples of class decorators and metaclasses have also changed.
Post Con
I changed the slide that used the old 3rd party decorator module to use the standard lib functools equivalent.
Speakers thoughts: The details of this talk were substantially different than the EuroPython version. I had more slides but there was less talky-talk involved with each one so it ended up the same at about twenty minutes. I intend to rejigger it again and submit it to PyCon as a mix of the two talks. The more concrete slides at PyCon UK went over well but most of the metaclass banter fell off and all the esoteric stuff (which will probably stay dead). The topical slide about getting my passport was skipped during the presentation - I did it as a lightning talk instead.
I wasn't nervous for the talk itself, there were maybe 75 people in the audience. I was nervous for my 5 minute lightning talk immediately afterward "How to get a new US passport same-day while committing the minimum number of felonies." I don't know why - I've spoken in front of larger crowds before and the idea of lightning talks is that they aren't expected to be polished (I had no slides and just spoke extemporaneously). The lightning talk went well and might have tied for the highest number of laugh-lines with the other humorous talk "Why I love Zeppelins."
Next time I intend to cheat and take some Beta Blockers before any speech. For those who don't know: beta blockers repress the physical symptoms of the fight-or-flight reflex only and don't change your brain. So they will suppress a quiver in your voice or hands but don't help with "umms" or "aahs." The only way to suppress the um/ah reflex is to practice before hand - a mirror works fine; just have enough canned variations on the topic that you can pick and choose the most suitable one at runtime which is more fluid than you think.
I only had one question during the talk and one question afterward. I'll have to think of ways to introduce more uncertainly into the talk for my next version. The first version At EuroPython elicited two or three questions during the talk and two or three after. Based on that feedback I answered those in this version but I'd like to generate some new ones next time.
Wednesday, September 10, 2008
PyCon UK Flight Plans
- I could work on my presentation. This would be OK but not ideal since I don't have internet conectivity to look stuff up.
- I could work on my lightning talk: "PyAsshole: Simulating a partial information non trump card drinking game in Python." I'll do some of that but I only have five hours of batteries. [if you aren't familiar see here for one set of rules]
- I could bring Neal Stephenson's Anathem but I could fit two or three other books in my bag instead of that door stop; I'll do that because if I can't get into his book I'm stuck with it.
I'll likely do a mix of PyAsshole and books with at least one of those being Heinlein's The Moon is a Harsh Mistress which is frequently cited but which I've never read.