Saturday, August 21, 2010

Setting the turtle free with Sikuli

Have you played with turtle graphics? I enjoyed Logo ages and ages ago. Nowadays there's a turtle module in Python's standard library, plus several other implementations.

But all the implementations I know of keep the poor little turtle stuck inside a dull little window. Last night I realized that, with Sikuli, I can set the turtle free! It can roam freely beyond one little window and have adventures in the big, wide world. Here it is marching right past the edge of TuxPaint and onto GNU Paint.

Note that this is an invisible turtle. But you can see its effects.

For the new free-range turtle, "penDown" and "penUp" are actually "mouse button down" and "mouse button up". If it's walking across a drawing program with a paintbrush turned on, it will paint a line like a traditional Logo turtle. Otherwise, it will click and drag its way across your desktop and your other applications. This turtle can be mischievous!

What really pleased me was just how easy it was to implement with Sikuli. Here's the code in an .skl bundle - it's a zipfile that Sikuli can use directly.

import math

class Turtle(object):
def __init__(self):
self.heading = 0
self.penDown()
self.loc = Env.getMouseLocation()
def forward(self, distance):
sin = math.sin(math.radians(self.heading))
cos = math.cos(math.radians(self.heading))
endpoint = (int(self.loc.x + cos * distance),
int(self.loc.y + sin * distance))
if self.down:
dragDrop(self.loc, endpoint)
else:
mouseMove(endpoint)
self.loc = Location(*endpoint)
def backward(self, distance):
self.forward(distance * -1)
def right(self, degrees):
self.heading = (self.heading + degrees) % 360
def left(self, degrees):
self.right(-1 * degrees)
def penUp(self):
self.down = False
def penDown(self):
self.down = True
def circle(self, radius, extent=360., steps=20):
circ = 2 * math.pi * radius
fraction = extent / 360.
step_length = (circ * fraction) / steps
for i in range(steps):
self.forward(step_length)
self.left(360. * fraction / steps)

def zigzag(startHeading, size, angle, steps):
t = Turtle()
t.heading = startHeading
t.left(angle * 0.5)
for i in range(steps):
t.forward(size)
t.right(angle)
t.forward(size)
t.left(angle)

Tuesday, August 17, 2010

gmail filter appender with Sikuli

Gmail filters are great, but I've got some filters that apply to a hundred different senders - and I'm always adding new senders to them. I've wished for an automated way to add the sender of the message I'm currently viewing to one of my filters.

I'm sure this could be done in Greasemonkey, Selenium, etc., but Sikuli is my tool of interest for the moment - and, after some fumbling, I'm really happy with it.

A partial screenshot, just to give you the idea:

View the Sikuli code, or download it and run it with /path/to/your/sikuli-ide.sh spammy.skl - except you'll probably want to edit the keywords identifying your filter, and possibly recreate the graphics to match your own Firefox theme. Mostly, it's there as an example to learn from.

I'm learning plenty that will go into my Ohio LinuxFest talk, but the big lesson for today is to rely on keyboard-based and text-based techniques rather than picture-finding whenever they're available. For instance, how should I click a button that might have scrolled off the bottom of the screen? There are lots of ways - I could embed find() in a loop with type(Key.PAGE_DOWN), for example - but it's more reliable to piggyback off Firefox's "Find" to zoom in on the text on (or near) the button and then find it.

Wednesday, August 11, 2010

Sikuli at Ohio LinuxFest

And now, for my next trick, one month from today, I shall demonstrate how to script virtually any program with a GUI... without touching an API! (audience gasps)

If You Can See It, You Can Automate It: Sikuli
Your computer should save you from doing tedious and repetitive tasks yourself, but automation programming has been too difficult for casual uses. MIT's Project Sikuli changes that. It fuses traditional text-base scripts with actual screenshots of targets on your screen, making programming simple, versatile, and useful. If you've ever told a friend, "Go here, now click on this, then on that", you know enough to start using Sikuli. Let Project Sikuli shake up your notions of what programming is like.

I'll be spending most of this month using Sikuli to build a test suite for a complex GUI app at work, recording the pain points as I go. I'd also appreciate your questions and comments about Sikuli - I may be able to work them into my talk (or at least be prepared when they're asked from the audience.)

Ohio Linux Fest, Sep. 10 - 12.

Sunday, August 08, 2010

"Many Eyeballs" - HA!

Oh, yes, I feel I should record this little incident from PyOhio 2010, for the sake of evidence during Nick's trial.

I used PyOhio's Lightning Talks to give away our swag prizes; and, in the spirit of open-source, I put the code on the projector for everyone to see.

import csv
import random

regfile = open('registrations.csv')
reader = csv.DictReader(regfile)
registrants = list(reader)

def pick():
winner = random.choice(registrants)
return '%s %s' % (winner['First Name'],
winner['Last Name'])

Then I realized that I didn't have the Lightning Talk sign-up board, so I went out into the hall to get it. I was gone maybe 60 seconds. When I got back, I called pick() and got... Nick Bastin!

The room giggled. Nick said, "Wow, that's the first time I've written bug-free code on the first try!" I didn't get it, so he said, "Why don't you pick another winner?"

Nick Bastin!

The nice thing is, my code was intact. However, this was lurking in my directory.

$ cat random.py
def choice(foo):
return {"First Name" : "Nick", "Last Name" : "Bastin"}

The lesson here is: Many eyeballs can help protect you from malicious code... unless they're all in on it!

PyOhio 2010 review

My own PyOhio 2010 wrap-up post is highly suspect, because I'm probably not one to deliver an unbiased opinion. So, when I say that

IT WAS AWESOME

you can be forgiven for being a little skeptical. In fact, one of my few regrets is that I didn't collect firm, objective data on just how awesome it was. I don't have accurate numbers on attendance yet - our sign in sheets are, um, somewhere around here. We had 179 pre-registrations; subtract some no-shows, add some walk-ins, and you get... I don't know. But the place was bustling!

The talks were good, and more importantly, they stimulated some excellent informal activity. The Open Space activity was stronger than ever this year; some of them packed our Open Space rooms to the walls. There were a fair number of Python newcomers there - yay! - and I was glad that we had a good Beginners' Track for them. An After-Hours Board helped people coordinate some evening fun together. Overall, it was not at all just "a place to see talks", but a full immersion in the awesomeness of Python people. Of course, the sprints were the big after-hours event, but they deserve their own post (soon to follow).

OSU's new Ohio Union was a great locale. It helps a lot that it has a design and a staff specialized in holding meetings and conferences, and it's just fantastic that the OSU Open Source club was able to provide the space at incredibly good rates. We look forward to using virtually the same space next year, with just some minor tweaks.

And, for everybody who wondered how we put on a great show at no charge... thank our sponsors!
  • Microsoft
  • Intellovations
  • AGInteractive
  • Dayton Microcomputer Association
Anyway, I'm delighted. I had fun and learned a ton. I hope you did, too! Thanks so much to everybody who took part!

Here are a couple other wrap-up posts I've happened across. Let me know about others you find.

Alex Gaynor
William Chambers
Richard Harding

Wednesday, July 28, 2010

PyOhio: photos plz

We have 138 PyOhio registrants so far - that's greater than the total number of attendees last year. I'm excited!

Is there a shutterbug in the house? I'm always envious of the photos taken at some conferences, like this one of Python core sprinters at EuroPython. (Hi, guys! Our contribu-palooza-ers will be joining you soon!) I want to join the fun. Our PyOhio attendees are just as pretty as any of them!

So if you enjoy taking pictures, and you're coming to PyOhio (and who wouldn't?), please don't forget your camera! Get some group shots, and let me know about them afterward. Thanks!

See you Saturday!

Friday, July 16, 2010

PyOhio

PyOhio staff badge
We are 15 days from the third PyOhio, and I am so excited... My first hope for PyOhio was that it would become a little slice of PyCon-ish goodness in our region... we've definitely accomplished that. This year we're adding on some very serious sprinting that, I think, will make PyOhio an important part of the Python scene not just here, but worldwide.
  • The Android Scripting Workshop has the potential to make Python-lovers of a whole new class of people who wouldn't even call themselves programmers (yet)... people who love their powerful Android phones and will love them even more once they learn the power of scripting on them. One question I'd like your advice on: how do we let these people know about the workshop? They're not reading my blog, after all...
  • The Contribu-palooza is a set of linked events (a classic talk, a "Teach Me" talk, and a big fat sprint) designed to make you into a contributor to the Python language, starting from nothing - we supply the motivation, the skills, and then the hands-on practice. I'd like to see this produce both an immediate new set of Python contributors (including me) and a new way of bringing contributors in.

I hope to see you there!

Friday, July 02, 2010

talking with women

A man at a conference I was at a couple months ago approached me to talk about databases.

It was, in all ways, a good and appropriate conversation, and an example of the reason I go to conferences like that in the first place. But he later confessed to me that he'd been very hesitant to speak to me because he was afraid it would come across as cover for some kind of flirtation. It seemed ridiculous, because he was so far from anything inappropriate, but his uncertainty came a hair's breadth from actually diminishing the conference's benefit to both of us.

You see the big fat irony. Avoiding sexualizing a woman's professional environment is an absolutely appropriate and important goal. But sidelining women from a professional community's social aspects is genuinely harmful.

Most men can easily judge for themselves the difference between friendly and creepy, but geekdom is infamous for its high proportion of the awkward.* I'd love it if there were a really clear and well-known rule of thumb that would assure even the most shy and awkward guys about where "the line" is. The hard part is that men differ so widely in their judgements and self-judgements. Some will be critical or suspicious of themselves at virtually anything, and some find excuses for even the most egregious of their own behavior. It's hard to know how to encourage the former but not the latter.

My first thoughts -
  • Imagine that she were a man. Would you still do or say what you're doing or saying now, or would it feel too awkward?**
  • If you're genuinely worried about it, you're probably not a problem guy in the first place.
What are your thoughts?

* - Understand that, when I say this, it's with affection. I love the socially awkward! I find communities where everybody adheres smoothly to a single social standard to be boring and uncreative. I hope geekdom will always be a haven for the awkward.
** - Obviously not a very useful standard for bisexual people.

Thursday, June 10, 2010

Dayton Dynamic Languages User Group

In Dayton, we don't have a dedicated Python user group; instead, we have the Dynamic Languages User Group. I always struggle to explain why I enjoy this group so much, because a quick description doesn't sound that impressive. Each meeting is 5-10 people scattered across the entire dynamic language landscape: Python, Ruby, Perl, JavaScript, PHP... now and then somebody will throw in some LISP or whatnot. There's only occasionally a formal presentation.

Instead, there are people who are very open about sharing both what they know (which is impressive) and what they don't know (which is more important). I've never been in a group where people are more uninhibited about saying, "Wait -- I don't get it." As a result, everything we do gets enriched by some extremely good discussion.

When we don't have a formal presentation, we sometimes walk through a code project somebody's working on, or research a programming topic together (like dependency injection). Recently we've started publishing a simple programming problem and asking the members to bring a solution in their favorite language - reviewing the various solutions is a nice exercise in both language details and programming approaches.

Come see us sometime. We meet the second Wednesday of the month at 7:00 PM at the Dayton Chess Club.

Wednesday, June 09, 2010

On the error message soapbox again

Q. What's wrong with this message?

Database Configuration Assistant: Info - There is an error in creating the following process: /data/ora/oracle/product/11.2.0/dbhome_1/bin/sqlplus -s -N /NOLOG  The error is: /data/ora/oracle/product/11.2.0/dbhome_1/bin/sqlplus: error while loading shared libraries: /data/ora/oracle/product/11.2.0/dbhome_1/lib/libclntsh.so.11.1: cannot restore segment prot after reloc: Permission denied
A. The window that it pops up in doesn't support copy-and-paste (on Fedora 13, at least). If you want to websearch for this message, you have to type it in by hand.

Hey, Oracle - fix it, please? It's the sort of usability problem that I wouldn't nag you about if you were a little FOSS project or a mom-and-pop software shop, but you're a big company with fifty bazillion programmers and entire committees on usability, so I know you can do it.

I'm sure that's the fault of whatever Java GUI library underlies your graphical tools like dbca... so go on and fix the library, and the whole world will benefit!

Also, in keeping with my fixation with good error messages, I implore you to think about error message usability ahead of time. I suspect that error messages get the short end of developer attention because they never appear in sales presentations. Well, actually, they do appear in sales presentations, they're just not supposed to... (although, frankly, watching somebody work through an error is a million times more interesting than watching a polished sales pitch)

Q. What else is wrong?

A. The workaround to this error is to disable SELinux. For the ultimate bestest securest database EVAR, doesn't that seem a little cheesy?

Q. Anything else?

A. Until you actually achieve SELinux compatibility, how about trapping the error with a message that describes the workaround? Failing that, mentioning in the Installation Guide that SELinux should be turned off is a next-best solution... no, come to think of it, forget I said that. "It's on page 732 of the docs" is actually a terrible excuse for leaving a bug unfixed. I don't know how "document it" became an acceptable alternative to "fix it".

Q. Are you finished yet?

A. Almost. After more than 10 years of DBA work, I actually don't know what the proper channel is for making suggestions to Oracle Corp. I end up ranting about it on my blog, approximately the equivalent of wandering into the street and yelling about it. Is that silly or what?

I'm Catherine Devlin, and I approved this message.

Thursday, May 27, 2010

templating engine cookoff updated

Ian wished for loop syntax examples in the Templating Engine Cookoff, so I just added them.

And none of you Django programmers have given me code to include Django templates in the cookoff. You can't throw an exception in this town without hitting a Django programmer, so what's up? C'mon, it's easy - I just need something analogous to this:

The answer to the Ultimate
Question is ${everything['universe'].answer}.

Among our weapons are:
% for weapon in weapons:
${weapon}
% endfor

import mako
import mako.template
class MakoDemo(Demo):
name = 'mako'
version = mako.__version__
def demo(self, vars):
self.template_name = 'mako.txt'
template = mako.template.Template(filename=self.template_name)
return template.render(**vars)


[EDIT: Well done, Django folks! Django is in the cookoff now. Except... hmm... it reacts to missing variables by leaving blanks instead of throwing an exception... so I need a new trick if I want to actually see the Django error stack.]

Tuesday, May 25, 2010

dbapiext.py

Richard Jones alerted me to Martin Blais' dbapiext.py, and I like it very much.

Richard's post focuses on the improvements to bind variable handling. I love dbapiext.py for another reason: it provides query results as namedtuples, a class so perfect for database resultsets that they make me sob with relief.

>>> import cx_Oracle, dbapiext
>>> connection = cx_Oracle.connect('username/password@SID')
>>> results = dbapiext.execute_obj(connection, 'SELECT * FROM crew')
>>> row = results.next()
>>> row
Row(ID=1, NAME='Kaylee Frye', ROLE='Mechanic')
>>> row[1]
'Kaylee Frye'
>>> row.ROLE
'Mechanic'

When memory isn't an issue, I like to transform the result into a list and tack on a simple equality filter method for convenience.

class Filterable(list):
def filter(self, **kw):
for itm in self:
for k in kw:
if not (getattr(itm, k) == kw[k]):
break
else:
yield itm
yield StopIteration


>>> result = Filterable(dbapiext.execute_obj(connection, 'SELECT * FROM crew'))
>>> result.filter(NAME='Jayne Cobb').next()
Row(ID=5, NAME='Jayne Cobb', ROLE='Public Relations')

It is, of course, no SQLAlchemy, and isn't meant to be. It's meant to be a roadmap toward a less awful DB-API for Python. (I still wake up in the middle of the night, gasping, "Five incompatible bind variable formats! It's heresy!") In the meantime, dbapiext.py is a nice lightweight layer for times when SQLAlchemy is too much. For instance, I write lots of database administration tools that poke around in lots of different views of Oracle's data dictionary, and setting up SQLAlchemy mappings for each of them is a pain. dbapiext.py is perfect for that. Thanks, Martin!

Monday, May 03, 2010

Penguicon wrap-up

Thanks to the wonderful audience at my Ren'Py talk. Your patience and your questions got us through the painful time of waiting for the projector to work... bless you all! I hope you have fun with Ren'Py. I've posted my slides and sample game in the Ren'Py forum * here *.

Oh, and I saw a flashbulb during the talk... if you're reading this, could you send me a copy of the photo? I don't have a good recent photo of myself presenting. Unless it sucks, that is. :)

Some of Penguicon's other highlights, from my POV:

Adrian Crenshaw's talk on Mutillidae was delightful. I am so tempted to quit my job and become a security researcher; they have all the fun. He tipped us off to some Firefox extensions for conveniently testing websites for some common vulnerabilities, too.

Matt Arnold's talk on Inform7, which showed me wonderful tools the Inform IDE comes with. It's amazing to see how much work has gone into a language that has such a specialty purpose. I hope I'll find time to put some more work into Inform7 games. I loved this exchange:
Attendee: Is there a limit to how many [options] there can be?
Matt: No! The limit is your sanity!

The dance. I love dancing with nerds. It's so much more fun when the cool kids aren't there. I miss the good old days, though, when we danced to songs, instead of to interminable dance beats. Ah well.

During Mark Ramm's talk about implementing Sourceforge's new TurboGears/MongoDB infrastructure, a questioner invited him to complain about strict schedules for completing a job. Instead, he said that he likes demanding, inflexible deadlines; having flexibility on a project's scope is how you get things done. I thought that was a wondefully wise point of view. A flexible timetable can be an excuse for not triaging a project's scope; a firm deadline helps you make those necessary decisions and actually get something done.

Friday, April 23, 2010

Dayton Oracle meeting

DAY-O, the Dayton Oracle user group, is meeting May 4 - a week from this Tuesday. We've got a full-day meeting planned with lots of great content... see daytonoracle.org for full details.

09:00 AM - 09:30 AM Meeting Registration / Door Prize Raffle Registration
09:30 AM - 10:00 AM Sun / Oracle Merger Update - Gary Hall (Sun / Oracle Corp.)
10:00 AM - 10:30 AM Leading Spaces and Their Diagnosis with Toad for Oracle, A Toad® for Oracle Case Study - Michael Allen (SmartDBA.com)
10:30 AM - 10:45 AM Break
10:45 AM - 11:45 AM Oracle Fusion Middleware 11g Update / Roadmap - Eric Rudie (Oracle Corp.)
11:45 AM - 12:40 PM Lunch - Pizza
12:40 PM - 01:25 PM Exadata 2 Database Machine - Gary Hall (Sun / Oracle Corp.)
01:25 PM - 01:30 PM Break
01:30 PM - 02:30 PM Security and Compliance with Oracle Database 11g Release 2 - Eric Rudie (Oracle Corp.)
02:30 PM - 02:45 PM Announcements / Raffle

Thanks to Matt Morrisey and Vicki Blommel for their organizational work, and to Oracle for being our meeting sponsor!

Thursday, April 22, 2010

Bugfixing at PyOhio

Jesse Noller wants to know what's holding you back from working on Python.

He's looking to make the process of contributing to Python more smooth and self-explanatory, less intimidating. That's a good discussion, and I'm not sure what to tell him right now, but it does bring to mind something I really want to see.

Let's have a Python Bug Fixing Tutorial at PyOhio!


Walk everybody nice and slooooowly through the process of browsing through the Python bug tracker (for bugs in Python itself, in its standard library, etc.), checking out code, fixing and testing, making a diff file, submitting the fix. Don't assume that people are familiar with VCS, diff files, the test suite, etc. - all those tools and jargon that separate veterans from intimidated users. Let's break down that separation.

Our Call for Proposals is open right now (through May 10). What a coincidence! I'm not actually on the program committee, so I can't promise that such a proposal would be accepted, but let's just say that the committee will give it serious consideration if they know what's good for them. :)

I'm asking you to propose this, not me, because I am not crazy enough to think that I can lead such a tutorial while chairing the conference; especially since I've never actually done it before myself. Actually, maybe there's one way I could do it: taking the role of the leader/learner in a "Teach Me Twisted"-style you-teach-me session. In that case, I'd want commitments from... hmm... let me say 3+ experienced bugfixers to talk me through it in front of a live audience.

One way or the other, let's see to it that PyOhio transforms some Python users into contributors!

Pythonic PL/SQL

Pythonic PL/SQL exists!

https://code.launchpad.net/~catherine-devlin/pythonic-plsql/trunk

I imagine it will grow in fits and starts as my job needs dictate, but it shouldn't ever be abandoned, since I'm incorporating it gleefully into my own production code.

So far, format (Python 3-style string formatting) and join are available. I'm not using object-oriented PL/SQL at all (I find it very unsatisfactory), so instead of
','.join(mylist), you use pythonic.join(',', mylist).

I'm very open to contributions from others! There's plenty of room to participate, since implementation has barely begun.

There are Quest Code Tester tests for it, too, but unfortunately that's a closed-source project and I have to check on what the rules are for releasing tests produced with it.

Of course, most hard-core PL/SQL developers will already have written or found code to handle basic, common operations like this. But, by sticking close to names and APIs we're familiar with from another increasingly well-known language, I hope to reduce the amount of brainspace you need to remember how to do it all.

Usage samples::
   
DECLARE
crewlist pythonic.string_list
:= pythonic.string_list ('Wash', 'Kaylee', 'Mal');
crewdictionary pythonic.string_dictionary;
curs SYS_REFCURSOR;
template VARCHAR2 (100);
BEGIN
DBMS_OUTPUT.PUT_LINE (pythonic.join ('; ', crewlist));
-- output: "Wash; Kaylee; Mal"
OPEN curs FOR
SELECT name FROM crew ORDER BY name;
DBMS_OUTPUT.PUT_LINE (pythonic.join (' *** ', curs));
-- output: "Kaylee *** Mal *** Wash"
template := '{2}! {1} says we''d better replace that catalyzer!';
DBMS_OUTPUT.PUT_LINE (pythonic.format (template, NULL, 'Kaylee', 'Captain'));
-- output: "Captain! Kaylee says we'd better replace that catalyzer!"
DBMS_OUTPUT.PUT_LINE (pythonic.format (template, crewlist));
-- output: "Mal! Kaylee says we'd better replace that catalyzer!"
crewdictionary ('First Officer') := 'Zoe';
crewdictionary ('Public Relations') := 'Jayne';
template := '{First Officer}: (to {Public Relations}) "I can hurt you."';
DBMS_OUTPUT.PUT_LINE (pythonic.format (template, crewdictionary));
-- output: Zoe: (to Jayne) "I can hurt you."
END;

Monday, April 19, 2010

P(ythonic)L/SQL?

I'm itching to begin creating a bunch of PL/SQL packages that will emulate certain handy Python features. Before I sink too much time into it, does the LazyWeb have anything to recommend? Or, perhaps, volunteers to help make the dream come true?

I want to start with a package for Pythonic string manipulation:

'The {0} brown fox jumped over the {1} dog'.format('quick','lazy')
.join()
.split()
.splitlines()

... and so forth

I think this package would not just implement the ones that don't exist in SQL or PL/SQL, it will provide Pythonically familiar names and interfaces to the ones that do exist.

Granted, there's only so Pythonic you can get in PL/SQL. A perfect set of packages would be a heroic task. Still, it's easy to imagine helping PL/SQL to suck less...

Sunday, April 18, 2010

templating engine cookoff

There are more Python string templating engines in the world than homemade chili recipes. Which is tastiest? Let's have a cookoff!

We all have different criteria, of course. The only organized comparisons I've seen between them are based mostly on measuring speed of rendering. Huh? I have never said to myself, "Wow, I'm wasting so much time because these templating engines aren't rendering fast enough. If only they would finish in 0.4 seconds each instead of 0.6!"

I have said to myself, "Wow, I'm wasting so much time because there are errors in my templates, and my templating engine isn't helping me find them." Writing templates is tricky. Errors are common. So, for me, clear error messages are the key virtue. My cookoff focuses on recognizing the engines that report the filename and the offending string when a rendering failure occurs. It also displays a typical simple syntax for writing and using each type of template (so it can serve as a cheatsheet as well).

My results? So far, only jinja2 and genshi report both filename and the error-causing string. The jinja2 error stack is more concise overall, so I award it the prize by a nose.

I'm really happy with the framework I wrote for doing the cookoff, too, so I posted it on Launchpad. It is really, really easy to add new engines for comparison - feel free to suggest or submit them! In fact, I hope that others can adapt my cookoff framework to other situations that call for side-by-side package comparisons.

Incidentally, why are comparisons like this usually styled "smackdowns" or "shootouts"? What's up with that? We're not trying to put anybody in the hospital! We're just trying to select our favorite from a banquet of delicious offerings. Eat up!

Monday, April 12, 2010

I'm speaking at Penguicon

Ren'Py: A Visual Novel Engine

Computer gaming, anime/manga, Python programming, fiction writing: Ren'Py is everything you love about Penguicon rolled up into one. It's an open-source visual novel engine that lets you program graphical games and stories with the greatest of ease. Creating basic linear or branched stories is almost as easy as writing them on paper - yet Ren'Py is also a full-fledged Python environment, so there's no limit to what you can program as you learn. This intro will show you everything you need to start creating your own masterpiece. Ikimashou, otaku-san!

May 1, 2010, 12 noon - 1 PM
Detroit Marriott Troy
200 W. Big Beaver Rd.
Detroit MI 48084

YOU: Okay... but will you give the presentation wearing a homemade Elizabethan-era dress?
ME: Yes!
YOU: Cool! Um... why?
ME: Because this is Penguicon!

What's Penguicon? It's an open-source software conference... it's a science fiction fandom conference... it's an awesome hybrid of the two! Super-sharp technical people come for some awesome knowledge sharing, and the SF fans help make the atmosphere even more relaxed and imaginative than at a normal FOSS con. I love both sides of the con and especially the ways they mix together, which is why I wanted to give a talk this time that would really encompass it all. (Costumes are totally optional, by the way. But they sure are fun!)

(Psst - if you install Operator, you'll be able to automatically process the microformatted data in this post and add it to your calendar. Cool, huh?)

See you in Detroit!

PyOhio Call for Proposals

PyOhio's http://www.pyohio.org/CallForProposals is out, due May 10. Let your imagination run wild; PyOhio is what we make it, no more and no less. Help us make this year's PyOhio the best yet!

Friday, April 09, 2010

daytontechevents

daytontechevents.com

A free service aggregating information about tech events in Dayton

There's too much geeky awesomeness going on in town to track with your brain alone. daytontechevents fixes that. If you're in or near Dayton, keep an eye on it so that you don't miss something fantastic! If you know of a group or event around here that isn't yet on daytontechevents, add it!

Thanks to Sarah Dutkiewicz, who got the idea and put the infrastructure in place not just for Dayton, but also for Columbus and her hometown Cleveland. Ohio thanks you, Sarah!

Thursday, April 08, 2010

Pooled nonprofit IT

File this one under "Daydreaming".

There are lots of small, local nonprofit organizations that really can't afford to do their IT well. They can't afford a full-time professional, so they make do with unskilled labor, plus a smattering of donated services and what short-term contractual help they can afford. Each time, the solutions implemented depend on the skills and tastes of the implementor, and rarely build usefully on what has been implemented before.

Imagine the efficiencies if many organizations could share a small, full-time IT staff dedicated to their needs. Most organizations share many of the same needs, and could share the same set of solutions. A full-time pro would become familiar with those needs and could efficiently apply a well-known solution to each group. (S)he would provide continuity, well-informed decisionmaking, and perfectly specialized skills.

Providing this would seem like a natural role for, say, an organization like the United Way; or perhaps for a small meta-charity created for the purpose. I'm sure private firms have attempted to set themselves up in this role, but anything that demands a steady funding outflow from the benefiting agencies is a tough sell, no matter how beneficial it would be in the long run.

I'm just daydreaming, but I'm interested in people's comments. Has anybody heard of something like this being done?

Wednesday, March 24, 2010

Community Service Award

Facundo Batista and I received the 4th-quarter Python Software Foundation Community Service Awards!

I actually heard about it several days ago, and have been tongue-tied (keyboard-tied?) since then. I'm mostly seen in and around Ohio these days, but I grew up thoroughly Minnesotan. If you pay Minnesotans a really extravagant compliment, you'll send them into a kind of blushing panic. All of our ancestors who enjoyed the limelight were found and eaten by bears, you see, so we evolved a genetic terror of having attention called to us.

Anyway, this is one of the most flattering honors I've ever received. THANK you, PSF! I hope I'll always be one of the Python world's many valuable contributors.

Wednesday, March 03, 2010

cmd2 0.6.1

Many thanks to the audience at my PyCon cmd/cmd2 talk for your interest and enthusiasm! It was my first full-scale PyCon presentation and I absolutely loved it.

I need to follow up on three things I claimed in my talk:

1. "My presentation is already online at http://pypi.python.org/pypi/cmd2". FALSE (at the time I said it, and for several days afterward). I actually had posted the docs and edited the PyPI page to point to them, but forgot to update url in setup.py, so it overwrote the link when I registered cmd2's 0.6.0 release.

It's fixed now, though. The cmd2 PyPI page has a link to the cmd2 documentation, which in turn links to my talk slides. You can also watch the talk thanks to the fantastic PyCon video crew!

2. "A more stable version will be out within a couple weeks of PyCon." TRUE. 0.6.1 is not exactly stable stable, but I think I've smoothed out bugs that snuck in while I was pushing to release 0.6.0 for PyCon.

3. "sqlpython will be more presentable in a couple weeks, too." TRUE. The new sqlpython 1.7.1 brings the postgreSQL functionality (thanks Andy!) to pretty near 100% (except for the can't-see-other's-schemas problem, which should be fixed for 1.7.2.) I believe that MySQL should be fully functional, too, but that's very lightly tested because I barely use MySQL and don't know much about how to test it.

Tuesday, February 16, 2010

Computer Engineer Barbie

I'm happy about Computer Engineer Barbie. No doll will save the world, but every little bit helps.

It's annoying, though, that some people only see one more opportunity to trot out this classic:
def belittle(geek):
prejudice = "Well, then, she's not much of a {0}, is she?"
if geek.is_femme:
excuse = 'geek'
else:
excuse = 'woman'
return prejudice.format(excuse)

Wednesday, February 10, 2010

sqlpython 1.7 pre-release

First off: PyCon online registration ends TODAY. Go do it NOW.

I intend to show off sqlpython at PyCon. Version 1.7 works with postgreSQL and MySQL as well as Oracle. (In fact, a single sqlpython session can keep connections to all three types of databases open at once!)

1.7 isn't quite ready for PyPI yet; I've just posted an appeal for sqlpython testing, with instructions for getting the development version, to the sqlpython google group. If you'd like to take the new-and-improved sqlpython for a spin around your databases, I would hugely appreciate it. Anticipate a PyPI release just before PyCon, once the ugliest of the bugs are worked out.

See you in Atlanta!

Tuesday, February 02, 2010

Hey, Oracle!

You're scaring me!

In the last couple months, we've learned that the new Sun will be going forward without Frank Wierzbicki, the Jython project lead, and now without Ted Leung.

The Oracle Technology Network is working hard to foster dynamic language use with Oracle. It's got publications, PyCon sponsorship, resources, and so forth. OTN delights me.

I'm afraid, though, that the larger Oracle corporation doesn't share OTN's interest. Oracle's absorption of Sun is proceeding without any apparent interest in dynamic languages. Oracle is discarding some of the finest talent it could possibly acquire, people who could have helped bring on a real flowering of dynamic language use in Oracle environments.

I, for one, would have loved to see Jython harnessed on Oracle's many Java-based tools and even the JVM in the Oracle database - imagine the wonders Frank and Ted could have worked with that, had Oracle assigned them to! Instead... there will be nothing Oracle-related from them. Meanwhile, Microsoft funds development of several dynamic languages, including IronPython, which integrate to SQL Server through .NET.

I don't know. I just dread the thought that, five years from now, SQL Server will be the proprietary database of choice for any environment where dynamic languages are used... which will soon be most environments. Oracle, you really want to give this market away?

Wednesday, January 20, 2010

How to write a bad abstract

Ironically, the only talk that disappointed me at all at CodeMash was... mine. I thought my delivery was a little rough - pretty much because it's a really bad time of year for me to practice a talk.

I had a (great, attentive, but) smallish audience, too. One of the reasons was simple scheduling - there were some amazing talks opposite me. I was tempted to slip out and watch one myself! The biggest problem, though, was me. I wrote a bad title and abstract for the program guide.
reStructuredText: Plain Text Gets Superpowers
Technology/Platform: Python
Difficulty Level: Beginner

Abstract: Write a document, just once, in plain text. Enjoy all plain text's benefits - speed, simplicity, scriptability, version control. Now, from this single plain text source, automatically generate beautifully-formatted webpages, presentations, .PDFs, auto-indexed documentation trees, and more. It's time to quit slacking on documenting your software. reStructuredText will make you actually enjoy writing docs!
What's wrong with this? It's a nice narrative that fits together and builds to a nice little conclusion... but it's bad for a program guide.

I assumed attendees would read the whole abstract carefully. Then, when I got to CodeMash, what did I do to select sessions I would attend? I quickly scanned over the list of titles, and based on that, hastily read some of the abstracts. I forgot that geeks are pressed for time, especially at conferences!

There were three important messages for attendees to know to decide whether to come:

1. This is a talk about writing documentation
2. It is independent of what programming language you use
3. This talk provides a helpful tool (i.e., it's not just a preachy sermon)

You have to read all the way to the end of my abstract to get messages #1 and #3, and #2 is never communicated clearly at all. So, what would a good title and abstract have looked like?
Your Docs Won't Suck Anymore
Technology/Platform: Other *
Difficulty Level: Beginner

Abstract: No matter what programming language you write in, it's the English language that's killing you - your lack of good documentation is driving potential users away. reStructuredText is a technology and a family of tools that will make writing documentation easy, powerful, and satisfying. We'll introduce reStructuredText and get you started on writing beautiful documentation for any program or language.
* - "platform-independent" would have been the best choice for "Technology", but it wasn't in the dropdown. I worried that choosing "Other" would imply reST was implemented in Scala or something. I should have done it anyway, though, because most CodeMash attendees don't know Python and probably read "Python" as "not for me".

The take-home lesson here: when writing titles and abstracts, be very mindful of the divided and rushed attention of the typical geek. Don't be coy and save the good stuff for the fine print. Get your message across up front.

Monday, January 18, 2010

Fear is not a virtue

I know there have been a million news items like this, but this is the one that puts me over the edge.
SAN DIEGO — Students were evacuated from Millennial Tech Magnet Middle School in the Chollas View neighborhood Friday afternoon after an 11-year-old student brought a personal science project that he had been making at home to school, authorities said.

Maurice Luque, spokesman for the San Diego Fire-Rescue Department, said the student had been making the device in his home garage. A vice principal saw the student showing it to other students at school about 11:40 a.m. Friday and was concerned that it might be harmful, and San Diego police were notified.

The school, which has about 440 students in grades 6 to 8 and emphasizes technology skills, was initially put on lockdown while authorities responded.

Luque said the project was made of an empty half-liter Gatorade bottle with some wires and other electrical components attached. There was no substance inside.
...
Luque said the project was intended to be a type of motion-detector device.
...
Both the student and his parents were "very cooperative" with authorities, Luque said. He said fire officials also went to the student's home and checked the garage to make sure items there were neither harmful nor explosive.

"There was nothing hazardous at the house," Luque said.

The student will not be prosecuted, but authorities were recommending that he and his parents get counseling, the spokesman said. The student violated school policies, but there was no criminal intent, Luque said.

I finally understand Al-Qaeda's master plan, and it's freaking brilliant. Resenting American technological dominance, they have found a way to end it, convincing us to semi-criminalize technical curiosity and thus lobotomize our culture. I'm just surprised that we're choosing to participate in the plan. I thought we were on opposite sides?...

Is there a political movement or group I can join to fight this? Common-sense people grousing about how stupid each incident is is failing to hold back the tide. Something vaguely like the EFF but with a broader scope - because all science and technology is under attack now.

Fear is not patriotic. Fear is not a public service. Fear is not a virtue.

Sunday, January 17, 2010

MongoDB

Gloria Jacobs told me about MongoDB at PyOhio, but I was too busy conference-chairing to see her talk, and time has flown by. Her enthusiasm prompted me to see Mike Dirolf's MongoDB talk at CodeMash, though, and wow. Thanks, Gloria and Mike! I like it, I really like it!

My frustrating experience with BigTable had given me a "Bah, humbug!" attitude toward the NoSQL fad, but it really looks like MongoDB is the cure for that. It surrenders much less query capability than the other NoSQL contenders do. The simplest of those are useful only if you already have the key for your desired record in hand, and BigTable's limitations make it feel only moderately better to me. But MongoDB's query capabilities are really rich, good enough for many (though of course not all) real query needs.

Now, don't get me wrong; there are a *whole lot* of tasks for which an RDMBS is still very much the answer. When you need transactions, or child items that aren't tucked neatly under single parents, or complex queries - and how often do you really *know* that you'll never need complex queries? - it's safer to use an RDMBS.

I think that, when the database is an enduring construct, important in itself - when multiple applications may be written against it, and new applications yet unforeseen may appear in the future - then a good RDBMS is the only way to go. In such cases, it's just impossible to safely predict what you'll need to do with the data one day, so you need database software that can do virtually anything.

But when the database will play a supporting role to a single, well-defined application, and will not outlive the application. then a non-relational database could be very convenient, and MongoDB looks to me like a fantastic choice.

Let's call this Devlin's Doggy Directive of Databases:
If the application is the dog, and the database is the tail, consider a non-relational database.
If the database is the dog, and the application is the tail, stick with a relational database.
If you doubt that I'm qualified to go naming rules of thumb after myself, let me remind you that have ten years of relational database experience, a sparse smattering of non-relational experience along the way, and that my parents owned a boarding kennel when I was young.

CodeMash general recap

Believe the hype. CodeMash is all that. It's people from all over the region and beyond whose enthusiasm and intelligence is too much to stay channelled in one technology. There are consistent preferences - for agile methods, open-source code, etc. - and a majority user community - .NET - but it's full of people who know that cross-pollination and cross-training are where it's at.

The one problem is the same one that all big conferences have: the scheduled talk track is so rich that it's almost impossible to pull yourself away to the Open Spaces. As next year's planning begins, I'll agitate for a schedule that somehow makes some Open Space time that doesn't run parallel to sponsored talks; I actually think Open Spaces on the precompiler day (maybe as the entire content of the precompiler day) would be a great idea. Except that it's probably best to let the regular conference content prime the pump first... hmm...

Saturday, January 16, 2010

reStructuredText talk follow-up

Thanks to everybody who saw my reStructuredText talk at CodeMash 2010! My slides are at the end of catherinedevlin.pythoneers.com. Those who asked questions I couldn't answer - thank you! I'll be researching the ones I remember so that I can post on them; commenting or emailing me reminders of your questions - or new ones - would be much appreciated.

I had a great time at CodeMash; the organizers deserve a huge round of applause. I'll post more extensively with some of what I learned... after catching up on sleep.

Thursday, January 14, 2010

Codemash - day 0 (precompiler) report

A good start to CodeMash. I started with a session on the Ruby Koans, a very nice way of teaching; it tempts me to join the crew building a corresponding set of Python Koans. In fact, it would be really interesting to host Python Koans on Google App Engine... Hmm...

Next I went to Mary Poppendieck's session on leadership in software; alas, for me, it was as much frustrating as inspiring. She described techniques proven to produce good software consistently, and I see very few of them in use in the Air Force. Worse, the Air Force is driving hard to make the problem worse: centralizing, centralizing, centralizing - building up the separation between decisionmakers and IT professionals and IT users with thicker and thicker walls made of miles, layers of management, internal organziational boundaries, and government:contractor barriers. *sigh*

She did, however, make me realize that my employer - a small contractor that sends IT professionals in ones and twos to work on projects as our customers need - can do a lot more to improve skills among our employees. We could get together occasionally from our various customer sites to work together on our skills, or at least have a mailing list for technical chat among our employees.

But here's a question - from a purely selfish point of view, is this the right way to spend my energy? After all, there are already plenty of groups of professionals dedicated to mutual skill improvement. They're called user groups, and the time I spent on internal skill development could just as well be spent deepening my involvement in local user groups; the payoff may be bigger, because I'd be involved with a self-selecting group, with people who already believe it's worth going out of their way to hone their own skills and others'. User group members have an attitude, a hunger and thirst and personal committment to excellence, and trying to create that attitude among my company coworkers may be a lot less fruitful than taking advantage of people who alreay have it.

Your thoughts?

Anyway, today begins CodeMash in earnest, and I'm loving it. Most of all, I like meeting up with old friends and meeting new ones. Geeks - particularly geeks who are active in the user community - are just fun, interesting people to be around!

Tuesday, January 05, 2010

Thursday, December 10, 2009

microfinance gift

Cash is almost always the most practical gift you can get somebody. I have trouble not feeling that it's too crass, though. Here's one possible solution.

Microplace, my favorite microcredit site, recently introduced a Gift feature where you can give an investment to somebody else. You pay the money, it goes to the developing world as a loan, and the interest and eventual repayment go to your gift recipient. Everybody wins!

This makes the most sense when you know somebody will need the money more later than they do now; it's a nice way to put the money "in transit" to them - and it does some good on the way. For instance, my sister is facing a gap in her income for maternity leave this spring; I chose a gift that would mature then. It was a perfect solution! Future students are other obvious recipients. Seasonally employed people... people planning an upcoming major trip... etc.

(Incidentally, another great microfinance site is Kiva, and there's actually a Pythonistas' lending team.)

Wednesday, December 02, 2009

Windows vs. Linux for Oracle

I found myself fielding a "Windows vs. Linux for Oracle" question on StackOverflow, and realized that my answer was detailed enough to deserve a blog entry... my humble contribution to the great war. (I know most experienced Oracle DBAs are chuckling, because "Which OS is best?" is more likely to make them think "Linux or commercial UNIX?")

Note that I'm speaking here of my preference strictly for Oracle-hosting purposes, and that everything I say about "Linux" really applies to all POSIX-based systems (like Solaris, which I started on as a DBA).

I've used Oracle on Windows and Linux for many years, and on Solaris many years ago. I prefer Linux because:

1. Oracle releases patches, new versions, and sometimes security updates for Linux significantly before they are available for Windows - there's usually about a two month lag for Windows (one month for Critical Patch Updates).
2. Our Windows servers have crashed or locked up occasionally, and very frequently require reboots for patch installation. Oracle itself stays up very nicely, but Oracle can't keep running on a machine that is down. This hasn't been a problem for me on Linux.
3. Oracle's interaction with Vista's User Access Control is a nightmare. I'm constantly finding that the dedicated Oracle user account, which was used to install Oracle, nonetheless lacks permission to edit or even see Oracle-generated files - like newly generated logfiles. It could be that I'm making some mistake, but permissions shouldn't be confusing; and on Linux, they aren't. (Most servers don't run Vista, but I'm afraid of what this forebodes for future versions of Windows Server.)
4. Thanks to the Windows Registry, cleanly removing an installation of Oracle from Windows is tricky and tedious. The Oracle Installer has gotten better at this since version 10g, though.
5. Better tools. Linux find is infinitely better than any native Windows search tool. It can take you minutes on Windows to track down what Linux which tells you in an instant. Also, Oracle uses and generates plenty of plain-text files, and Linux comes with better tools for handling text files - good text editors (unlike Notepad), shell commands like head, tail, grep, etc. You can try to catch Windows up by installing Geanie, Cygwin, Google Desktop, etc. on a Windows machine, but it's better not to have to (especially since Cygwin installation is not completely newbie-friendly).

I can only think of two Windows advantages over Linux:

1. In Oracle's command-line tools like sqlplus, rman, etc., you can scroll through and re-run past commands using the up- and down- arrow keys - but only on Windows. You can fix this on Linux by installing rlwrap and always invoking the Oracle tools under rlwrap: rlwrap sqlplus me@myinstance
2. Quest's TOAD is only available for Windows, and it is an infamously useful tool. It doesn't need to be on the database server, though, just on a machine that can connect to the database. Also, Oracle's free sqldeveloper is one among several viable alternatives; it will probably never catch up to TOAD completely, but it's good for the bulk of what most people use TOAD for.

In general, however, I should emphasis that Oracle's ancient boast of running on everything really is true. As a DBA, I prefer Linux for the reasons listed above, but to my database users, it's absolutely irrelevant (downtime aside). I could move my production databases to a different OS overnight, and tomorrow, my users would have no idea that there had been a change.

Sunday, November 22, 2009

Viva Tortuga

Joseph Lisee, author of the upcoming Python submarine robot PyCon talk, left a comment on my last post. I think he was a little shy about me highlighting him.

I'm sorry, Joseph. You really left me no choice.

Completely Unfounded Rumors About "An Underwater Python: Tortuga the Python Powered Robot"

Roll 1d6 for each hour spent in the Atlanta Hyatt bar.
  1. 1. Joseph will announce the release of asimov.py, a pure-Python implementation of the Three Laws of Robotics.
  2. 2. Bring a swimsuit and snorkel. One lucky audience member will be picked to join Tortuga in the hotel pool, where Tortuga will take a fish from their hand.*
  3. 3. Jozeph 'az been practeeseeng 'eez reedeeculous Jacques Cousteau accent for months and weel uze eet to deeleever zee eentire talk.
  4. 4. Several minutes into the presentation, Tortuga will overpower Joseph, throw him from the stage, and announce that humankind is obsolete and has been deprecated.
  5. 5. Attendees will be asked to pour out a libation to Poseidon. Any caffeinated beverage may be used.
  6. 6. There will be a sprint to construct a tall, dapper companion to Tortuga for communication and protocol purposes.
* - No, Tortuga won't be physically present at PyCon. It's not that portable. Believe me, the program committee asked!

P. S. Blogger, don't you know what an <ol> is? You know, like an <ul> with numbers.

Friday, November 20, 2009

PyCon pre-favorites

When I look over the PyCon 2010 talk list, I'd like to be at about half of them (a physical impossibility, until I master self-multiplexing). Still, these are the ones that I'll move heaven and earth to be at. What about you - what are your favorites?
Extending Java Applications with Jython
I'm hopeful that this can really move Jython from my "stuff I think is cool" box to my "stuff I use every day" box.
IronPython Tooling
This is going to cover development environments and tools for debugging and profiling... pretty much a necessity in the .NET world. I also hope to use the video of this talk in the future in talking to the hordes of programmers around here who live and breathe Visual Studio.
Python in the Browser
Silverlight is way too cool to leave to the C# kids.
Think Globally, Hack Locally - Teaching Python in Your Community
As a local group-leader type geek, I'd love to start some of these Hack Nights.
Dude, Where's My Database?
There were so many proposals for descriptions of non-relational databases - but this one really stands out because it looks at the huge picture, classifying databases by their broad category and highlighting what makes each category beneficial for particular purposes.
Sprox: data driven web development
I confess - I've fallen behind the TurboGears world lately. Nobody's demanded a dynamic web app of me for a while, and TG has moved too fast for me to keep track of it. When last I was involved, Sprox was just emerging. I hope this talk will help me catch up.
Revisioned Databases for MultiUser Editing
Revisioned databases are an interesting concept, and seeing how one was actually developed should warm my datageek heart.
Easy command-line applications with cmd and cmd2
Interactive command-line interfaces were good enough for ZORK, and they're good enough for you! cmd and cmd2 make them crazy-easy. (I'll get in trouble if I don't go to this one, since I'm the speaker.)
Dealing with unsightly data in the real world
Gathering data from disparate, chaotic sources is a big part of pretty much everybody's life. I'm eager for any new insights.
An Underwater Python: Tortuga the Python Powered Robot
because, deep down inside, people everywhere are the same; we all want to be loved, and Python-powered robot submarines.

Wednesday, November 18, 2009

Configuring Oracle Data Guard

The official Oracle Data Guard docs are, of course, the most complete and accurate source of information about setting up Data Guard.

They're not very easy to use, though. They don't provide a walk-through of the entire process, for example, instead branching the discussion at every possible decision point.

I just fought my way through the process, with help from Chris Ruel of Perpetual Technologies, and thought I'd record my steps for the benefit of humankind. OK, that's not true - it's actually because the Internet is the only place I can leave myself notes and be certain to find them again later.

It's too bulky for a blog post, so here: Oracle Data Guard Configuration Walk-Through

Thursday, November 05, 2009

pernicious python.org proxy problem

For the past few weeks, I haven't been able to access python.org or any of its pages through a proxy server. My workplace has one standard proxy server, and I also use a personal machine as a SOCKS proxy for an SSH tunnel - and both of them have been getting name resolution errors for all python.org sites. I haven't seen it for any other sites, or when using no proxy.

Does anybody know what's going on? Is there something about python.org that would make name resolution work differently for it?

[EDIT: Friends from the Dayton Dynamic Languages SIG figured this one out. My primary workplace proxy server is blocking DNS lookup on the python.org domain. Trying to use a different proxy through a SOCKS/SSH tunnel produced the same DNS failure, because - to my surprise - by default, Firefox does not make its DNS requests through the SSH tunnel even when all other traffic is tunneled. The network.proxy.socks_remote_dns preference must be set to change this. See "Proxy Firefox through a SSH tunnel".]

Tuesday, November 03, 2009

A PyCon program committee volunteer reflects

The PyCon program committee has finished its work. All submissions have been reviewed, debated, argued on, and voted - often through several cycles. Emails accepting and declining talks have gone out.

I wanted to blog about my impressions as a program committee volunteer. Note that this is totally unofficial, and I'm not speaking on behalf of the committee, PyCon, etc.

It was wonderful

Just reviewing the talks was a great experience. Some of the talks were fun just to visualize; watching them will be even better. I learned lots about what is going on in the Python community. The program committee is a smart and fun crowd to work with, too.

It was horrible

The problem with a programming language that can do pretty much anything is that three days of scheduled talks are nowhere near enough to see everything that's going on. I wish we could have five days of talks, but there are too many people who wouldn't have the time or money for such a conference.

With room to accept fewer than half of our submissions, we had to turn away talks that would have been great. For instance, the one talk I most wanted to see - the proposal I would have walked barefoot to Atlanta for - got declined. What can you do? Often "pretty much everybody was pretty excited about this" talks had to be sacrificed for the sake of "virtually everybody was dying to see this" talks.

But wait, there's more

Fortunately, scheduled talks are only the tip of the PyCon iceberg. We have Lightning Talks, Open Spaces, and (new this year) poster board sessions! I hope all declined speakers will consider taking their material to one or more of those formats!

PyCon is going to be wonderful

I think we have the best crop of presentations we've ever had. If you can look through the list of accepted talks and not start making Atlanta travel plans, then you are already dead.

PyCon is going to be horrible

... because, with five simultaneous tracks packed with the very best of material, I promise you will face multiple can't-miss talks going on at the same time, all day, every day. The painful decisions of the program committee are really only a preview of the difficult decisions every attendee will have to make at the conference itself.

For 2011: increasing your chances

If you want to make your future PyCon proposal more appealing to the committee (making our decisions even harder - thanks a lot), here are some of the things I saw that helped talks make the cut.
  • The basics: a clear talk description, orderly-looking outline, plausible-looking timings. If reviewers ask questions, answer them. Give every impression that you're prepared to put serious effort into your talk.

  • Broad appeal. It's OK to present on specialty topics, of course, but if you can point out ways that even people outside the specialty will also want to see it, it will help.

  • Unusual topic. Every year, there are some hot topics that everybody in the community seems to be talking about... and submitting talks on. Since we're not going to accept a dozen talks on any topic, no matter how hot, these talks need to prevail over a lot of competitors. On the other hand, if you've got a topic that makes the committee say, "HUH? Wow, I'd never heard of anything like that!", it really helps you stand out.

  • We always get more intermediate-level submissions than for beginner or advanced, so the competition was fiercest there.

  • What will attendees get from your talk that they couldn't get simply from reading the docs? Make sure we can tell.

  • Evidence of preparation and skill. Some speakers had established reputations as skillful, engaging presenters; some provided links to their slide decks from earlier versions of their talks given at local groups or regional conferences; a few linked to actual recordings of earlier versions of their talks. Give your talk at a nearby usergroup, then convince one of your group members to volunteer for the program committee. :)

  • Scratch the itch. When committee members say, "Ah, yes, I've been puzzled by that and dying for a proper explanation!" - or, "I personally understand it, but I see misunderstanding of it throughout the community and wish somebody would help clear it up", that is a big plus.

  • Keep the Py in PyCon. If the topic is one of general IT interest - database technology or rich web client programming, for instance - then make sure to emphasize the Python angle of your talk. How do you work the problem from Python specifically? What do Python users need to know about the problem that they won't learn from materials aimed at the IT community overall?
Anyway, my personal thanks to everyone who submitted, and I really hope to see you all at PyCon!

Wednesday, October 07, 2009

Stop! Drop that field!

For PyOhio registration, we used a nice service called eventbrite. It worked great, but I have one big problem with it: it collected way too much data from registrants. It got us the data we needed, but it also asked for home addresses, gender, job title, company... all data we had no legitimate need for or plans to use, probably just because the fields are in the eventbrite form template. Entering it was pointless nuisance for our attendees, and maybe some were actually put off by the length or intrusiveness of the registration form. (Dave Stanek, if you're reading this, let's see if we can change that for next year.)

We are so not the only offenders in this department. It's everywhere, it's endemic. At website after website, we're asked to provide information of no apparent relevance to the sites' purposes. It's so easy to throw field after field into a data collection form; templates are provided with every conceivable field already in place; and - well, why not? Isn't more data better?

No. No, it's not. Excess data takes time, clutters databases, obscures important data, increases risks of data leakage. In interpersonal interactions, we always have the option of asking "Why do you need to know that?", or just giving people that funny look that tells them they're going out of bounds. On paper forms, we can leave fields blank. Automated forms with field validation cut those safeguards off and open the door to compulsive collection syndrome. The one defense people do have against intrusive electronic forms - lying - ruins data quality, and false data is much worse than no data at all.

We need a ethos of restraint in data collection, of always asking, "Why am I collecting this field?" Data collection needs to be seen as something that is not pure good, but something that has a cost to weigh against the benefit. Not collecting data is often the responsible choice, and we need to teach each other that.

Monday, October 05, 2009

PyCon talk review

We've got a record number of volunteers working on PyCon's Program Committee - the group that reviews talk proposals and decides which ones go on the schedule. And it's a good thing, because we've also got a record number of proposals - 179! (For comparison, PyCon 2008 got 118.)

Right now, we're in the fun part - going through the proposed talks and yelling, "Oooh! Ooooh! I want that one!" Just looking through the proposed talks is a great Python education all by itself - you find out about useful packages and techniques you'd never known were out there.

The tough part comes later - when we have to winnow the list down. Without exception, there are talks I want to see that won't make the cut. Accepting all the good talks would be great, but we'd need a week of PyCon, and three days for the core conference are all we figure most attendees can spare. (My proposal for a round-the-clock talk schedule met only chuckles. Then again, with late-night Open Spaces, we already come dangerously close to a round-the-clock schedule...)

Tuesday, September 29, 2009

Ohio LinuxFest

Wooo, Ohio LinuxFest!

My reStructuredText slides are at catherinedevlin.pythoneers.com, down at the bottom of the page. Thanks to everybody who attended and gave great feedback!

I arrived Friday morning this time and spent a good chunk of the day at the Hackathon, working with Mark Borgerding on his idea for a new educational game for Childsplay. We made some good progress, especially since we were both 100% newbies to pygame! I enjoyed myself and learned a thing or two. Hopefully we'll be able to finish the game up remotely over the next several weeks.

Next came an impromptu lightning talk session (I looooove lightning talks) where I gave an extremely badly-organized (but well-received) glimpse at sqlpython.

I helped Todd Trichler from Oracle Technology Network with his demonstration of Oracle's free offerings. We had a good group, and the next morning Todd gave away his ENORMOUS box of Oracle software in about an hour.

The hallway track was, as usual, excellent. William McVey and Eric Floehr used the PyOhio table to stir up interest in CincyPy and Central Ohio Pythonistas, and Monday's inaugural COPy meeting had 27 attendees! Score! I enjoyed talking with people so much that I found myself on the verge of going hoarse just 90 minutes before my talk. Eek!

I had a great time. Congratulations and thank you to the OLF organizers and sponsors. Once a year, you make Ohio feel like anything but a technology backwater!

Sunday was the Diversity in Open Source workshop, which deserves its own post. To be continued...

Thursday, September 24, 2009

Python at Ohio LinuxFest

The Ohio LinuxFest fun starts tomorrow! Here are the Python-related activities there that I know of.

Of the Friday hackathon projects, I believe that schoolsplay and sendoff are Python-based.
http://www.ohiolinux.org/hackathon.html

Zenoss Community day on Friday (Zenoss is a Python product):
http://www.ohiolinux.org/zenoss.html

Python for Linux System Administration - Vern Ceder
10 AM Saturday
http://www.ohiolinux.org/talks.html#PYTHON

reStructuredText - Plain Text gets Superpowers - me
5 PM Saturday
http://www.ohiolinux.org/talks.html#TEXT

PyOhio booth - all day Saturday (though not always staffed). All Python groups should take advantage of it shamelessly - bring your literature! - and anybody who wants to hang around there and have Python-related conversations with people, that's fantastic.

And, of course, don't forget Oracle's event at OLF.

See you there!

Thursday, September 17, 2009

easy_install no longer easy on Vista

Since my Windows machine was upgraded from XP to Vista, managing Python packages has become absolutely horrible. Here's what I've puzzled out so far, with much wailing and gnashing of teeth:

1. No matter what rights your primary account has, you need to run easy_install from a Run as Administrator window - otherwise, easy_install runs in a separate window which pops up, flashes some feedback at you for a microsecond or so, then disappears, leaving you with absolutely no record of whether the install works and why. There doesn't seem to be any way to log the results to a file.

2. After installing any module that is deployed as an .egg into site-packages, you need to go and edit its permissions manually to give your account read privileges on the egg. (Giving your account privileges on the whole site-packages directory does not help.) Until you do, import newmodule will fail with ImportError: no module named newmodule on your account - but will succeed when run from a Run as Administrator window.

This is bad news. I fought my way through because I'm a dedicated Pythonista; how many Vista-using Py-curious are going to give up on Python because module installation now requires such hacks?

(Don't forget - Ohio LinuxFest registration ends tomorrow at noon! Move, move, move! You'll hurt my feelings if you don't go.)

Friday, August 28, 2009

Enthought's reStructuredText editor

Enthought has produced a wonderful tool for getting into reStructuredText: a side-by-side WYSIWYG rST editor.

Screenshot of editor session
Getting it installed, however, just about killed me. Here are the steps I finally puzzled out for Ubuntu 9.04. Miss any steps - or even change the order - and you'll get error messages that don't help even slightly.
sudo apt-get update
sudo apt-get install python-setuptools python-vtk
sudo easy_install -U numpy
sudo easy_install -U docutils sphinx TraitsBackendQt[nonets] AppTools[nonets]

[EDIT] If you're not on 9.04, or you just want to be on the safe side, it doesn't hurt to sudo apt-get install python-dev python-qt4 at the beginning of the whole process.

The other odd thing is that this lovely editor apparently has no name, and certainly no handy start script or presence in any menu. Mine got installed at /usr/local/lib/python2.6/dist-packages/AppTools-3.3.0-py2.6.egg/enthought/rst/app.py; your best bet to find yours is probably sudo updatedb; locate -r rst/app.py$

Then, set up a bash script to make it usable. I'm calling it "rsted". sudo nano /usr/local/bin/rsted and fill it with:

#!/bin/bash
python /usr/local/lib/python2.6/dist-packages/AppTools-3.3.0-py2.6.egg/enthought/rst/app.py $*

... sudo chmod +x /usr/local/bin/rsted, and live happily ever after.

(The $* in /usr/local/bin/rsted doesn't actually do anything - the editor doesn't seem to accept arguments like a filename - but I'm being hopeful for the future.)

Friday, August 14, 2009

PyCon 2010: Call for Proposals

In the opinion of most attendees I talked to, PyCon 2009 was the best one yet. If you need an excuse to come to PyCon 2010... well, what better excuse could there be than, "I'm speaking"?



Call for proposals — PyCon 2010 — http://us.pycon.org/2010/

Due date: October 1st, 2009

Want to showcase your skills as a Python Hacker? Want to have hundreds of people see your talk on the subject of your choice? Have some hot button issue you think the community needs to address, or have some package, code or project you simply love talking about? Want to launch your master plan to take over the world with python?

PyCon is your platform for getting the word out and teaching something new to hundreds of people, face to face.

Previous PyCon conferences have had a broad range of presentations, from reports on academic and commercial projects, tutorials on a broad range of subjects and case studies. All conference speakers are volunteers and come from a myriad of backgrounds. Some are new speakers, some are old speakers. Everyone is welcome so bring your passion and your code! We’re looking to you to help us top the previous years of success PyCon has had.

PyCon 2010 is looking for proposals to fill the formal presentation tracks. The PyCon conference days will be February 19-22, 2010 in Atlanta, Georgia, preceded by the tutorial days (February 17-18), and followed by four days of development sprints (February 22-25).

Online proposal submission is open now! Proposals will be accepted through October 1st, with acceptance notifications coming out on November 15th. For the detailed call for proposals, please see:

http://us.pycon.org/2010/conference/proposals/

For videos of talks from previous years – check out:

http://pycon.blip.tv

We look forward to seeing you in Atlanta!

Tuesday, August 11, 2009

BLOBs in sqlpython

Obviously, you can't query BLOBs in a command-line SQL tool.

Unless, of course, that tool is sqlpython. Bwa ha ha ha.

reStructuredText talk at OLF

It's official - I'm on the schedule!



reStructuredText: Plain Text Gets Superpowers
September 26, 2009, 5 - 6pm
at Ohio LinuxFest

Greater Columbus Convention Center
400 North High Street
Columbus, OH 43215 USA

Introduction to reStructuredText, a simple single-source format that can generate documents in HTML, PDF, .odt, and many other formats.

I also see tasty-looking talks on "Python for Linux System Administration", a "Sysadmins' Rosetta Stone" talk that should help me port my Ubuntu skills to Red Hat, and gobs more - plus the Diversity in Open Source workshop. This will be a great year!

Spend Like a Pirate Day

Why do we Americans continue to carry around drab $1 bills, struggling to cram mushy, wrinkled paper into vending machine readers, when we could carry gleaming, clinking, golden doubloons?

Admire the gleam and the weight. This is the proper sensory experience for money!

I just found out you can buy boxes of 250 coins directly from the mint. Granted, there's $5 shipping, so you're paying $255 to get $250, but your credit card kickback should cover that. Then you can eschew that lame ATM for months! Let's face it, you only use cash for little purchases these days anyway. Make every cash transaction enjoyable!

When you receive your coins, feel free to run your hands through them several times, purring, "Arrrrrr! Thar's treasure for ye, me mateys!" Do NOT, however, bury them in a sturdy wooden chest and draw a map with a dotted line and an X. I know it's tempting! I want to do it, too! But the point is to get more of these beauties into circulation.

Arrrrrr!

Monday, August 10, 2009

workaround: easy_install windows vanish

My employer-mandated Vista machine has gone almost unused for months because of an infuriating quirk in Vista's command-prompt operation. I've come as close to completely forgetting how to use Windows as I've ever been. Giles Thomas (of Resolver Systems) saved me.

The problem: Vista runs programs like easy_install in a new cmd window, separate from the one they were invoked in. The instant the program terminates, the new window is closed, and any messages it returned - like error messages - are lost. No, redirecting the messages with > and 2> does not work. "Why would you want to see error messages, anyway? They're so geeky and depressing!" *gum snap*

Thus, I was unable to install cx_Oracle, and had to turn to my trusty Ubuntu machine for absolutely every pyOraGeekish task.

Giles blogged a lifesaver workaround. If you can run the cmd window as Administrator in the first place, you are entrusted with the awesome power and responsibility of being allowed to view your own error messages.

So, now I can blow the dust off my Vista machine. Wow, controlling the font size of a cmd window is absolutely as primitive as it was in Windows 3.1. Giles, got a workaround for this, too?

Tuesday, August 04, 2009

Oracle at Ohio LinuxFest

I'm going to Ohio LinuxFest 2009
It's not official yet - so you can't find it at the Ohio LinuxFest website - but it looks like Oracle will be a sponsor and exhibitor this year. They're planning to do an Oracle-on-Linux installfest. If you'd like to get your first taste of Oracle on Linux, sign up for LinuxFest (it's free) and prepare to have a blast.

If you're already pretty good at Oracle-on-Linux and would like to help others get started, send me email! I hope to gather a small group of volunteers to help out at the installfest.

bug reports from the public

From "Dr. Kronkheit and His Only Living Patient":
SMITH: Doctor, it hurts when I do this.
DALE: Don't do that.
Dear Enterprise Rent-A-Car,

That was called a "bug report". It was not actually a request for a condescending message about how I can still rent a car by navigating the website in a different way. I knew that.

I took the time to write up detailed instructions for reproducing the bug as a professional courtesy to your developers. Unfortunately, they will never see my message, since your customer service is managed strictly from a "deal with nuisance customers" point of view. Looks like I wasted a couple seconds of your time as well as several minutes of my own.

RESOLVED: If I ever work on a project large enough to have a customer service department separate from development, I will insist upon bridging this gap. I will make sure customer service has the access, knowledge, and encouragement to communicate constantly with me. I will regard customer service as a valuable conduit for end-user feedback rather than a distant, uninteresting group of non-colleagues.

logging is ugly

Instrumenting your code - whether with a PL/SQL package like Quest Error Manager as Steven Feuerstein suggests, Python's logging module, or whatever - is an important part of writing good code.

I don't. Not very often, anyway. When I do, I often delete the logging calls as soon as the code is more or less working. The biggest reason is the ugliness.

def days_ago (ndays):
logging.info('days_ago called with arg %s' % str(ndays))
logging.info('arg type %s' % type(ndays))
try:
ndays = int(ndays)
logging.info('argument converted to integer %d' % ndays)
current_date = datetime.datetime.now()
logging.info('current date is %s' % str(current_date))
result = current_date - datetime.timedelta(ndays)
except ValueError, e:
logging.error('Error converting ndays to integer:')
logging.error(str(e))
result = None
logging.info('returning from days_ago: %s' % str(result))
return result

EWWWWWW! That is ugly! It completely disrupts the comfortable reading of the code. It buries the actual purpose and actions of the function under a steaming heap of chatter. It offends everything that I value in beauty and readability. What to do?

One solution might be a code editor that would toggle the visibility of all logging calls in a program. You could leave them invisible most of the time, and only look at the logging statements when you have a specific reason to. I can see two problems with that, though.
  • The logging calls themselves could get out of synch with the functioning code. This could be partially addressed by having logging calls become visible automatically whenever code adjacent to them is changed.
  • This would create code which is readable and beautiful in my editor, but ugly when somebody else tries to read it. Perhaps if we cooked up a convention whereby a header comment could define the suggested hiding of logging calls for each program, and most editors could be trained to recognize and respect these suggestions?
I don't have the answer for this. I'd love to hear ideas.

EDIT: Gary Bernhardt tweets, "Anything that you want your editor to to be able to hide (comments, setters/getters, logging) shouldn't exist".

An interesting idea... how to eliminate logging? A good logging decorator could log arguments, return values, and error messages to any decorated function - and that level of information could suffice, if the functions are very fine-grained. Having to write fine-grained functions is the sort of constraint that might improve programming style, too, much the way unit testing demands well-defined functions. I think I'll try this philosophy and see if I can make it work.

It's not much help for the PL/SQL side of things, though. I'm trying to imagine if there's some way to make an analog to Python's decorators in PL/SQL.