August 17, 2009

Hono(u)r Alan Turing

Alan Turing was the greatest computer scientist ever born in Britain. He laid the foundations of computing, helped break the Nazi Enigma code and told us how to tell whether a machine could think.

The world might have benefited from his ideas considerably more had the prudish (and, as it turned out, probably hypocritical) authorities at the time not hounded him to an early grave because of his homosexuality.

We should think before we cast the first stone, as we do not know where the universe pivots.

This story has been considerably edited, as I must acknowledge the force of my critics' remarks. The original was intemperate and, well, unoriginal so I decided to remove the call to read and sign a petition and simply make my own statement about how Turing, one of the seminal intellectual leaders of the 20th century, was treated by an unthinking populace allowing the irresponsible authorities to act "in their name". The first paragraph is from the petition.

EveryBlock Acquired by MSNBC

News today from EveryBlock via Adrian Holovaty that the founders have agreed to let MSNBC acquire their company. Happily Adrian is on record already as expecting a completely unchanged relationship with Django and Python, pointing out that MSNBC is only half-owned by Microsoft.

August 15, 2009

Advertising the Competition

Someone asked me why the last two posts had highlighted "competing" classes.

This blog isn't here to sell training. It's a place to learn about training, among other things. Feel free to come here to learn about the competition's classes. It's this blog you're coming to, right?

If I only mentioned Holden Web's classes, and not Enthought's and David Beazley's (and ...), you probably wouldn't consider this blog quite such an impartial source. I don't think it hurts to be on good terms with the competition. It's the Python way, after all.

Python for Systems Hackers

Given by David Beazley, Chicago. 3 days, August 17-19 (next week). Details here.

Python Training for Scientists

[Disclosure: Enthought and Holden Web have discussed joint training plans in the past. No commercial agreements are currently in force.]

If you're a scientist and you want to use computers as more that just calculators then you just might want to learn Python. So you could take the Holden Web Introduction to Python class, or you could take two extra days and go to the Python for Scientists class at Enthought.

August 14, 2009

The Internet is Not the UK

Without the EFF Western society's relentless march towards 1984 would have concluded by now. Many formerly accepted liberties have been eroded in the first decade of the 21st century. Think about joining.

Burning Man Rip-Off?

Bother, and I was starting to think Burning Man might be worth attending. Looks like they need to get this silliness sorted out. Hardly appropriate in the 21st century. If I had a ticket they could even make me change this heading!

Which, since second thoughts are proverbially the best, I have done by adding a question mark; I also prefer "silliness" to the former"stupidity". A potentially offensive word was replaced.

Further edit: from the Burning Man web site:
"Use of Images"
I UNDERSTAND AND ACCEPT THAT NO USE OF IMAGES, FILM, OR VIDEO OBTAINED AT THE EVENT MAY BE MADE WITHOUT PRIOR WRITTEN PERMISSION FROM BURNING MAN, OTHER THAN PERSONAL USE. I understand that I have no rights to make any non-personal use of any image, film, or video footage obtained at the event, and that I cannot sell, transfer, or give the footage or completed film or video to any other party, except for personal use, and I agree to inform anyone to whom I give any footage, film, or video that it can only be used for personal use.

August 13, 2009

PyCon 2010 Call for Papers

From Jesse Noller and his colleagues on the PyCon 2010 Program Committee comes the following message. Please consider submitting one or more presentations. PyCon is the largest Python conference in the world, and delegates have a fabulous time.

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

- Hide quoted text -
We look forward to seeing you in Atlanta!

August 10, 2009

People Using Python

The Python Software Foundation has embarked on a mission to find out more about Python users. We want to know as much about the organizations that use Python as possible. If you want to give us information about any Python usage at all (even organizations other than the one you work for) please fill out this form. We don't even need your details, and we'll filter for duplicates.

So please help us to find out as much as we can about who's using Python, and what for!

Google Sorry

Quite why Google Documents should be giving me this message when Gmail, Blogger, YouTube and various other Google services are all working normally I have no idea. This is particularly frustrating since it's OK for me to look at "documents" and "files", but apparently when it comes to "spreadsheets" I am a botnet and not to be trusted.

Clearly I'm on some sort of blacklist. For how long, who knows? This has been going on for four hours now. And one of the frustrating things about using Google's services is that it's absolutely impossible to get a human being to tell you what the heck is going on, or take some action about it. You can rely too much on automation (but hey, it keeps the margins up).

Going to rethink this one. The document I can't get access to is the PyCon 2010 budget. Google sorry? Google FAIL.

August 4, 2009

Who Put the "Ass" in Associated Press?

The recently-publicized Associated Press approach to copyrighting the news includes such stupidities as
To this stupidity it appears that through the inadequacies of the system they have chosen to use for licensing we can now add
  • Charging people for things that were never said:
This does raise some interesting questions, however. Since I now have a license (purchased for $12.50) from Associated Press to quote these words, are they going to sue me for defamation (against which my defense would be "fair comment") or will they instead fall back on their terms of use, which does not allow me to use licensed material in a way "derogatory to Publisher"?

Given the huge popularity of this blog (not) I suspect this one will sneak under their radar, but if it doesn't (and assuming I am neither subjected to a gag order nor rubbed out by hired gorillas) I shall report back.

UPDATE: About five hours later I received a refund on the grounds that the quoted material was not part of the referenced article:
So it appears that the system isn't quite as asinine as it might at first seem. But Associated Press still need to get a clue, I think.

July 12, 2009

PSF Associate Memberships?

When I spoke about The PSF and Us at EuroPython a couple of weeks ago there were some interesting questions, many of which related to how individuals could help the Python Software Foundation. During the discussion I asked how many people would be prepared to support the Foundation by paying for some kind of (non-voting) associate membership, and I estimate at least half the audience's hands were raised.

It appears, therefore, that Python users want to be associated with the Foundation. So now I would like to ask readers (whom I assume will mostly be Python users) a few questions.

Do you think it would be a good idea for the PSF to broaden its membership base in this way? If you aren't a nominated member, would you like to become an associate? If so, why? What would you like to get from an associate membership? What could the Foundation offer in return for some annual payment? What should that payment be? What could (or should) the Foundation be doing for you and Python that it isn't already?

I am looking for some guidance here from an apparently under-served section of the Python community. Your feedback will be invaluable.

June 27, 2009

Another United Web Screw-Up

So, wanting to answer a question about my flight times for EuroPython I clicked on an email link to "My Itineraries". Thanks, United, this couldn't be clearer.

June 23, 2009

My God, I Have Fans

I've been putting out links on delicious.com for a while now (when I started it was del.icio.us, which I personally still prefer as a domain name, though probably it was too esoteric for the non-geeks). It's a great system, and I have a program that searches my feed for the last seven items I tagged with "python" and makes those the front-page news item on holdenweb.com.

Most of my interactions with delicious go through the Firefox add-on, so I was a little surprised today to discover that my delicious network page shows that my feed has 44 fans. This means I now have a bunch of feeds to start looking at. I am going to have to stop sleeping ...

Looking at the network page I was also quite interested to see the top 10 tags list of the things I have tagged most frequently.

python 194
web 96
programming 80
design 71
development 58
tools< 49
politics 46
webdesign 44
marketing 40
open< 40

That gives you a fair idea of my interests. Don't tell Guido about the marketing ...

June 19, 2009

June 18, 2009

Technology for Keeping People Honest?

Simon Willison and his team at the Guardian in the UK have brought a dream a step nearer to becoming true for me with his new Investigate Your MP's Expenses site. After looking at government profligacy in the USA I decided the only thing to do was to open up public accounts to public scrutiny.

Simon's site (quite independently conceived) is a practical demonstration of the idea's feasibility on a large scale. All we need now is a sponsor with deep pockets and an interface to Mechanical Turk. The next election is going to be interesting.

June 17, 2009

Seth Godin Says A Mouthful

You will probably be aware if you are a regular reader that while I'm not wild about marketing generally, I do see value in some things some marketers do and say. Seth Godin had a blog post recently called You Matter that describes quite well the kind of spirit I want to foster in the Python community.

As tummy.com said on their PyCon sticker this year: "Python will save the world! I don't know how, but it will." Isn't it up to us all to help Python do that?

June 11, 2009

Ubuntu 9.04 Wireless on Dell Precision M6300

The best laid plans of mice and men have yet again gone agley. For a couple of years now I have been running Vista on my Precision workstation. In order to move to the Linux platform I bought a 320 GB 2.5" disk (amazing value at $90) and planned to install Ubuntu Jaunty Jackalope on it then migrate the Vista disk to a VirtualBox virtual machine accessing a raw patition which contained a Ghost copy of the original Windows partition.

Alas I couldn't get the virtual to boot, and anyway the Vista load is starting to show signs of instability (hardly surprising in a Windows installation that's been poked and prodded as heavily as mine has), so I have bitten the bullet and am reinstalling Vista from scratch with a virtual filesystem. The partition that was going to host Vista is now an ext4 filsystem which can host whatever I want or need to put on it. I have installed VirtualBox, and Vista loaded up like a champ.

The only (current) fly in the ointment is that for the life of me I can't get wireless networking to work. Unfortunately Command Line Idiot appears to be right when he or she writes:
There are roughly 19 billion tutorials for how to do anything you would ever want to do with Ubuntu. Unfortunately, they are all written by a 12 year old who knows even less than you.
Some of the advice I have seen is so cryptic as to be incomprehensible, some refer to drivers I don't have and don't seem to be able to download, the majority of it its either apparently irrelevant or clearly wrong.

So, crazy fundamentalist or not, I'll be happy to hear from you if you can tell me how to get the wireless networking going.

June 10, 2009

Not My Day with Microsoft

Well, I guess I won't be downloading SharePoint Designer just yet, then ... even the best-run and largest organizations have problems.

You know, I really wish the free software/open source world would come up with something as easy and effective as SharePoint. Maybe it will soon. SharePoint has become as popular as it is (and it's making Microsoft over $1 billion a year now) because, like Office, it's broad enough to meet the majority of most people's needs.

It's complex, but not really complicated, and I know it's not beyond the skills of the free software/open source community. Support, of course, would be something else. Now that would be a company I'd like to start ...

June 5, 2009

Google Wave: A Reason to Learn Java?

I've just (finally!) finished viewing the developer preview video of Google's Wave project from the recent Google I/O gathering. If I had time I would be brushing up my Java right now. I understand that the Java world was somewhat upset that Google App Engine supported only Python as a programming language for so long. Well, Wave is based on the Google Web Toolkit (GWT), a fascinating development platform that allows you to program in Java and deliver AJAX applications automatically translated (on the client side) into JavaScript. So now it's time for us Python guys to stand in line.

Wave is an amazing demonstration of where the web is going, and our lives are going to be richer for it. It's an entirely new approach to personal communication, and clearly demonstrates that open architectures are (pun intended) the wave of the future. Google are actively looking for people to get involved with the project already.

More later. For now I am too blown away to do much more than sit here thinking about the potential. I am also excited that this represents a bundle of opportunities for the open source world to demonstrate technical leadership. Unless other vendors have come up with some competing web-based technology I'm not aware of, and I'd be happy to learn about that too.

Information about the Wave platform (and, of course, the open source code) is on Google Code. The open Wave protocol details are on a separate site. Look for Wave's public arrival later in the year. Nice job, Google.

June 3, 2009

Something Smells

If you were at PyCon you probably noticed that netbooks are becoming more popular. PyCon delegates being geeks, I don't remember seeing a single one that wasn't running some form of Linux, though Microsoft do support the little machines with Windows XP. This in itself is an admission that Vista, their current operating system, is a resource hog. As a Vista user all I am prepared to say is "get me out of here", though the day-to-day experience is made bearable [short pause while all applications lock up for 90 seconds and the disk hammers away madly at I know not what] by the (open source) Cygwin command shell and the (open source) VirtualBox virtual machine that lets me operate virtual Linux hosts.

I don't have a netbook yet (though I have already bought one for my wife), but it's only a matter of time. I currently lug 6.6 pounds of laptop around with me for the large 17" screen that I find useful for development and the 4GB of memory, which was a lot for a laptop a couple of years ago. I may extend the life of the machine by upsizing the drive to 500GB, but I definitely want my next portable machine to be lighter, and lighter means smaller (though nowadays not necessarily much less powerful). In other words, it's the coming trend.

The manufacturers (who are all in the far East, naturally) have detected this trend, and are pushing out new hardware faster than a sow can push piglets. All of this new hardware can run at least three different operating systems: Linux, Windows and Android. Users have been expressing their discontent with the higher price of Windows systems in the desktop market, but didn't have a lot of alternative. However, Microsoft realized that if they charged their usual premium for Windows XP on the netbooks people would just laugh and buy a system with one of the alternatives loaded.

So the bottom line is that Microsoft are almost giving XP away (and why wouldn't they, the money it's already made them) just as a damage-control measure. It's vital to Microsoft that Linux and Android aren't seen as viable alternatives to Windows, particularly since the beta program of Windows 7 is making it seem like an operating system whose principal selling-point is the ability to switch its features off.

Enter the Taiwanese Computex trade show that opened yesterday. Qualcomm were showing a new Asus netbook running the Android operating system, but on the Asus stand there was no sign at all of this startling new development. In fact Asustek's vice chairman John Tsang said, shortly after sharing the stage with Intel and Microsoft representatives, that the Android notebook was not a priority. Android still has a way to go to be totally user-friendly on a netbook, but if Qualcomm could show it, why couldn't Asus? Were they, perhaps, being polite to a major business partner?

The UK PCWorld chain also said it is stopping selling anything but Windows through itsbricks-and-mortar stores, though mail-order buyers still have the Linux option. When I see press releases like that I am always intrigued about whether they are induced purely by market forces or whether some backroom maneuvering isn't involved.

One thing's certain. No matter what they have done for Mac sales, Apple's long-running TV adverts have positioned Windows (synonymous in the public mind with "PC") as an unstable, unreliable, bug-ridden inconvenient platform. Now it's beginning to look as though the hardware industry is becoming more independent of Microsoft for the software necessary to run its devices, which I see as a good thing.

Microsoft stockholders may, of course, disagree. I wouldn't necessarily sell your Microsoft stock right now. Just don't buy too much more.

May 31, 2009

PyCon is Popular!

Regular readers will know that this year's PyCon went extremely well. Not only was it excellent value for money, but we finally got our video recording act together, to the point where most sessions' video was available on blip.tv less than a week after the end of the conference.

I just learned that there have already been over 180,000 views of the material since it was uploaded roughly two months ago, which works out at around 3,000 per day. It just goes to show that there is a lot of demand for material about Python!

May 29, 2009

Where Next for PyCon?

PyCon 2010 will be in Atlanta, as I wrote a few weeks ago. No decision has been made about future venues, but given yesterday's release of the PyCon 2009 delegate questionnaire response data I thought it might be instructive to use Python to try and get a handle on public opinion about future locations. Question 13 asked "Where would you like to see PyCon 2010 or a future PyCon? Enter up to 3 cities or regions."

I copied the data into a spreadsheet for ease of manipulation, and did some munging to standardize presentation. I may have taken a few liberties here (such as replacing "California, Bay Area" with "San Francisco"), but I did so in an honest attempt to make sure that every important datum was counted. If the conference were to go to "San Francisco" the organizers would be very foolish to overlook other potential Bay Area locations, for example.

The Data
You can find the raw data I ended up with at http://holdenweb.com/files/wherenext.txt if you want to play about with them yourself. Here's a small section to give you the flavor:
New Jersey      Palm Springs    "Portland, OR"
New York "Portland, OR" "Portland, OR"
New York "Portland, OR" "Portland, OR"
New York "Portland, OR" San Diego
Northeast "Portland, OR" San Diego
Nowhere specific "Portland, OR" San Francisco
Phoenix Saint Paul San Francisco
"Portland, OR" San Francisco Seattle
It's simple tab-separated data, with gratuitous quote marks from Excel. The presentation makes it look like everyone made first second and third choices that were suspiciously close together in the alphabet, but that's only because I sorted each column independently to make the munging easier. I should probably have used the csv module to read the data, but foolishly chose to do it myself. Just the same, there isn't a lot of code.

The Program
#!/usr/bin/python
#
# Process PyCon feedback about future venues
#
# NOTE: Food for thought only ...
#
pd = {}
f = open("wherenext.txt")
for line in f:
places = [p.strip('"') for p in line.strip().split("\t")]
for rank, where in enumerate(places):
if not where in pd:
pd[where] = [0, 0, 0]
if where:
pd[where][rank] += 1

places = []
for where, [w1, w2, w3] in pd.items():
places.append((3*w1+2*w2+w3, where, [w1, w2, w3]))
for rank, where, scores in sorted(places):
print where, rank, scores
The first for loop simply iterates over the file. Each place's position in the line is the weighting that a voter gave it, so after splitting the line at each tab and removing any leading or trailing quotes I then use enumerate() to generate (rank, placename) pairs for all elements in the line. Some lines have only one or two entries because not everyone made three choices, but the formulation I used copes fine with that.

The placename of each pair is used to index a dict of [first, second, third] counts which counts the number of times a specific place was ranked in each position.

The next for loop is my favorite piece of this little program. It generates a new list of (weighted_score, placename, raw_scores) tuples ready to be sorted. The weightings I used (3 for a first choice, 2 for a second and 1 for a third) were completely arbitrary, so feel freee to change them in an attemto to fudge the results for your favored location.

Why did I like this particular loop so much? Since each item in the dict is a (placename, raw_scores) tuple I unpack the elements right in the for statement. It's such little elegances that endear Python to its fans: you can always do things in a straightforward way if you want, but as long as it doesn't interfere with readability I usually take advantage of such abbreviations.

I felt that a list comprehension would have been just a little bit too difficult to read, but you could easily replace the loop with one, and for further illegibility you could put it directly as the argument to sorted().

Finally I print out the results, with the lowest scoring first. Yes, I could have used a reverse() call to print out the favorite first, but then I'd have had to scroll the window back to know which city had "won". I could have formatted them better, too. Feel free, knock yourself out. I try to avoid over-specifying presentation when it's really the data I am interested in.

The Results
Given that the 2009 conference was held in Chicago I was unsurprised to see a strong vote for it, presumably by locals who might not be able to get to Atlanta, and certainly wouldn't find it as convenient. The only surprise was that it came in second rather than first! Portland, OR made a very strong showing, scoring only two points less, closely followed by Seattle with New York and Washington DC trailing rather further behind, But the clear winner was San Francisco, by coincidence the other location to make a strong bid for 2010 with Atlanta. Here are the results in their entirety.

Please remember that the data is from a self-selected group, and that this program is not binding on the PyCon organizers! Despite my best efforts I must have left a blank line in the data, so the empty string is recorded as having no scores! The if where condition should really have guarded the whole loop body, but it was an afterthought, and serves to remind us that sloppy design will lead to sub-optimal results.

0 [0, 0, 0]
Bay Area, CA 1 [0, 0, 1]
Cleveland 1 [0, 0, 1]
Houston, Texas 1 [0, 0, 1]
Knoxville, TN 1 [0, 0, 1]
Midwest 1 [0, 0, 1]
Oregon 1 [0, 0, 1]
Orlando, FL 1 [0, 0, 1]
Phoenix, Az 1 [0, 0, 1]
Pittsburgh, PA 1 [0, 0, 1]
Portland, ME 1 [0, 0, 1]
Twin Cities, MN 1 [0, 0, 1]
Virgin Islands 1 [0, 0, 1]
West coast 1 [0, 0, 1]
not next to an airport 1 [0, 0, 1]
vancouver 1 [0, 0, 1]
Boston Area 2 [0, 1, 0]
Cleveland, OH 2 [0, 1, 0]
East coast 2 [0, 1, 0]
Fort Collins, CO 2 [0, 1, 0]
Honalulu, HI 2 [0, 1, 0]
Kansas City, MO 2 [0, 1, 0]
Las Vegas, NV 2 [0, 1, 0]
Lawrence, Kansas 2 [0, 1, 0]
Los Angeles, CA 2 [0, 0, 2]
Manhattan 2 [0, 1, 0]
Minnesota 2 [0, 1, 0]
New York, NY 2 [0, 1, 0]
Palm Springs 2 [0, 1, 0]
Saint Paul 2 [0, 1, 0]
San Diego 2 [0, 0, 2]
Seatle 2 [0, 1, 0]
Toronto, ON 2 [0, 1, 0]
Vegas 2 [0, 1, 0]
huntsville, al 2 [0, 1, 0]
new orleans 2 [0, 1, 0]
Detroit, MI 3 [1, 0, 0]
East Coast 3 [1, 0, 0]
Europe 3 [1, 0, 0]
Houston, TX 3 [1, 0, 0]
Huntsville, AL 3 [1, 0, 0]
Kansas City 3 [1, 0, 0]
Madison, WI 3 [1, 0, 0]
Miami 3 [1, 0, 0]
Montreal 3 [1, 0, 0]
New Jersey 3 [1, 0, 0]
Nowhere specific 3 [1, 0, 0]
Phoenix 3 [1, 0, 0]
Raleigh/Durham, NC 3 [1, 0, 0]
Reno, NV 3 [1, 0, 0]
San Diego , CA 3 [1, 0, 0]
San Fransisco 3 [1, 0, 0]
San Jose 3 [1, 0, 0]
St. Louis, MO 3 [1, 0, 0]
Tucson, AZ 3 [1, 0, 0]
london 3 [1, 0, 0]
New Orleans 4 [0, 2, 0]
Colorado 5 [1, 1, 0]
Northeast 5 [1, 1, 0]
Canada 6 [2, 0, 0]
Las Vegas 6 [1, 0, 3]
Somewhere hot 6 [1, 1, 1]
Vancouver 6 [0, 3, 0]
Dallas, TX 7 [1, 2, 0]
Denver 7 [1, 2, 0]
Minneapolis 7 [2, 0, 1]
Toronto 7 [2, 0, 1]
California 9 [3, 0, 0]
Atlanta 10 [2, 2, 0]
Austin, TX 14 [1, 5, 1]
Boston 16 [2, 2, 6]
Washington, DC 16 [4, 2, 0]
New York 19 [3, 4, 2]
Seattle 27 [3, 7, 4]
Portland, OR 35 [5, 5, 10]
Chicago 37 [10, 2, 3]
San Francisco 45 [11, 5, 2]

May 25, 2009

Memorial Day

No matter what you think about the US's current wars (and I think they are an abomination) one can have only the utmost respect for those who choose to serve their country in the armed forces. This post is published as an expression of my admiration for the country's servicemen and women, with sympathy and deepest condolences to all families whose loved ones have been lost in action.

May 22, 2009

EuroPython Booked

So the flights and hotel are booked and it's confirmed: I am going to EuroPython. This will only be my second attendance, and since it's in England this year close to where my one of my sisters lives I expect to feel reasonably at home. It won't be a long trip, but John Pinner tells me he'd like me to give a talk about the PSF and an after-dinner speech, and that "we may like you to join a panel or two, Open Space etc as well if that's OK".

Since the conference is paying my travel and accommodation it would seem ungracious to refuse. So it looks like I'll be busy. I am already looking forward to it!

One of the nice parts of visiting the Midlands will be a chance to sample some British beers. If you have any recommendations or suggestions please be sure to let me know!

May 21, 2009

Trying Again

I believe my typesetting confusion of recent days was due not, as I had feared, to my advancing years and inability to solve technical problems, but rather to a discrepancy between Blogger's preview and the final display of the blog, plus the absence of div tags.

The output of the program in Blogging Python Output: A Challenge should have displayed as
<__main__.MyCls object at 0x024217F0>
Let's see if this survives being saved and published, as so few have before it.

Factory Functions

In the last entry we discussed passing callables (using functions and classes) as arguments to functions, and calling them within the body of the function. This time we'll look at how functions can return more esoteric objects - again including functions and classes.

Beginners sometimes ask how a function can be made to return "more than one object". The strict answer is that it can't. The single object it returns can be a container, though, allowing several values to be extracted from the returned object. If you want a function to return three values the easiest way to arrange this is to have it return a three-element tuple, and then extract the individual values using an unpacking assignment. Here's a simple example.
def powers(a):
return a, a*a, a*a*a

a, square, cube = powers(10)
print(a, square, cube)
This prints 10 100 1000, showing that the three returned values have indeed been assigned to individual variables. Functions can return more complex objects than simple containers, though. A frequent example in the programming literature is a function that returns some newly-created function each time it is called. Typically the function returned will vary according to one or more of the arguments passed to the call that creates it.
def make_fun(power, debug=False):
def pow(x):
result = x ** power
if debug:
print("power(%s, %s) returned" % (x, power), result)
return result
return pow

squarer = make_fun(2)
cuber = make_fun(3, True)

print([f(9) for f in (squarer, cuber)])
A call to make_fun() results in a function being defined as make_fun's function body is being executed. This function (whose local name is pow) contains references to the arguments passed to make_fun, and is returned by the call to make_fun to be assigned and eventually called. The calls to the function are inside a list comprehension just because that's the easiest way to call a set of functions with the same argument(s).

The output from this is
power(9, 3) returned 729
[81, 729]
The debugging output from cuber is seen before the list comprehension because all calls have to return their values before the list comprehension is complete and ready for printing.

You may be familiar with the concept of a mixin class. Such classes are designed to take advantage of Python's multiple inheritance features to add functionality to any chosen classes, by creating a new class which is a subclass of both the mixin and the chosen class. You can see an exellent example of this in the socket library, where a ThreadingMixIn class is defined and can be used to extend the features of the basic UDPServer class like this:
class ThreadingUDPServer(ThreadingMixIn, UDPServer): pass
Note that the newly-declared ThreadingUDPServer class doesn't specify any behavior of its own, it merely inherits - first from the mixin and then from the base class, meaning that methods defined in the mixin take precedence over those defined in the base server class. One problem with this, however, is that it doesn't allow for any variation in the mixin classes - by the time you use them they are already created, and it's too late.

In the same way that we can parameterize functions, however, we can parameterize classes as well. Suppose we want to provide a trivial mixin to print the class's name in either upper- or lower-case. Not very inspiring, but the simplest example I could think of to get the point over, so please bear with me if you can think of simpler ways to do this. One possibility is this.
def mixin(cls, lcase=True):
class Mixin:
def nprint(self):
if lcase:
print(str(cls).lower())
else:
print(str(cls).upper())
class Result(Mixin, cls):
pass
return Result

class FirstClass:
pass

Cl1 = mixin(FirstClass, True)
cl1 = Cl1()
cl1.nprint()

mixin(FirstClass, False)().nprint()

Here the function first defines a mixin class, then creates a new class from the mixin and the base class provided as an argument. The interpreter cares not at all where the class definitions come from - classes are first-class objects just like functions and strings, and can just as easily be passed as function arguments as obtained any other way.

The output from the program, which I am sure you are waiting for with bated breath, is
<class '__main__.firstclass'>
<CLASS '__MAIN__.FIRSTCLASS'>
which shows that the program runs, and that the mixin class's behavior is conditioned by the function's second argument.

Now you might choose to argue that this isn't a very natural example, and I'd be inclined to agree with you. All I have to say besides that is, you try coming up with these examples and see how you like it. If anyone chooses to contribute a more natural example that can be expressed without too much extra code I'll be happy to write about it.

May 20, 2009

Blogging Python Output: A Challenge

I spent half an hour yesterday in a battle with Bogger, trying to get it to render the output of this Python 3 program:
class MyCls:
pass

obj = MyCls()
print(obj)
Unfortunately, despite batting to with HTML entities for less than and the like, and even changing all spaces to non-breaking spaces*, the best I seem to be able to do is:

<__main__.mycls>

It starts out looking OK, but once I preview it, or publish it, Blogger just throws away everything after the first space up to the closing angle. Who can tell me what I am doing wrong? Or is Blogger being unfair.

* don't even think about blogging the actual entity codes: they'll be mangled too.

[The program will run, producing slightly different output, under Python 2. I suspect Blogger will mangle that output too]

Everything's an Object

"Everything's an object" is a truism for truly object-oriented languages, and Python is truly object-oriented. You may meet some purists who try to tell you that only [their favorite language] can really be called object-oriented, because Python doesn't have this feature or that feature, but don't take any notice of them. Religious zealots are everywhere, and their only interest is to convert you to their faith. In the Python world we don't tend to hold with religious zeal, and much prefer irreverent comedy sketches and making fun of things. Particularly religious zealots.

Newcomers to the language are sometimes surprised to find that you can pass all kinds of things as arguments to functions, and use them quite naturally inside the functions. The classic example is functions themselves. Let's write a program containing an innocuous little function that takes a function as its first argument and returns the result of calling the function on its second and third arguments.
def caller(f, a, b):
return f(a, b)

def adder(x, y):
return x+y

print(caller(adder, "abc", "def"))
print(caller(adder, 123, 456))

class MyCls:
def __init__(self, first, second):
self.first = first
self.second = second
def method(self):
return self.first*self.second

obj = caller(MyCls, "=", 10)
print(obj, obj.method())
The adder function adds two arguments, and pass that as the first argument to caller a couple of times. If all has gone to plan the first two lines of output will look like this:
abcdef
579
The first argument to adder isn't constrained to be a function. It just has to be something that can be called.We can take advantage of the fact that a call to a class creates an instance of the class to have caller create the instance for us. The MyCls class has an __init__() method that takes two arguments (as well as the ubiquitous self that the zealots will try and persuade you isn't necessary).

The call to caller returns an instance of MyCls. When that instance's method() is called it uses the remembered arguments to print out a string of ten equals signs:

==========


The generality that this demonstrates can be difficult to get used to if you haven't come across anything like it before. Once you appreciate it, though, it gives you a flexibility that is hard to match in many other languages. That's one of the reasons why the Python world often talks about "callables": we don't care whether it's a function or a class, we only care that it can be called.

This is one aspect of polymorphism, one of the foundations of object-oriented programming.

[The code will run under Python 2, but the output shown here was produce by Python 3. The output from Python 2 will differ slightly].

May 19, 2009

Who's Up for a Sprint, Then?

It's now a good long time since Need for Speed (three years, I find, rather to my surprise), and I have settled back into a more or less regular routine after my move back to the USA. So I am starting to wonder whether it might not be time for another speed-focused sprint, and this post represents a first attempt to run the idea up the flagpole and see if anyone salutes.

There have been many interesting developments on the VM front in the intervening years, and it seems like there's a distinct possibility that the current speed limits are going to be history in a year's time. That being the case, I would be prepared to put some effort into getting sponsorship and doing the administration and organization.

I was wondering about Amsterdam as a venue. Given the required lead times to recruit sponsors, get sprinters on board and ensure adequate accommodation I am thinking that the best time might betowards the end of the year - say October or November.

Who thinks this could be helpful? Who'd like to join in and sprint? Who would contribute funding to make it happen? All these questions are important, and only you can answer them!

Is It Installed or Not?

[Notes for a while back, as can be seen by the version numbering]

Hmm. What could be the problem here?

sholden@bigboy ~
$ easy_install-2.5 SQLAlchemy
Searching for SQLAlchemy
Best match: sqlalchemy 0.4.2dev-r3811
Processing sqlalchemy-0.4.2dev_r3811-py2.5.egg
sqlalchemy 0.4.2dev-r3811 is already the active version in easy-install.pth

Using c:\python25\lib\site-packages\sqlalchemy-0.4.2dev_r3811-py2.5.egg
Processing dependencies for SQLAlchemy
Finished processing dependencies for SQLAlchemy

sholden@bigboy ~
$ python
Python 2.5.1 (r251:54863, May 18 2007, 16:56:43)
[GCC 3.4.4 (cygming special, gdc 0.12, using dmd 0.125)] on cygwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import sqlalchemy
Traceback (most recent call last):
File "", line 1, in
ImportError: No module named sqlalchemy
>>>
Simple, once realized: the easy_install I was running was based on Python for Windows, so running it under Cygwin still reported the state of the Windows installation! That's one slight down-side to Cygwin picking up so mcuh from the Windows side of things: sometimes it gets holds of things it shouldn't.

May 18, 2009

Simple Object Interactions

Here's a relatively simple piece of code that shows how easy it is to have Python objects interact. It's fairly standard stuff, so it probably won't be interesting to old hands, but if you haven't been using object-oriented programming very long then it might make a point or two.

Note that the code is in Python 3, though it will actually run on earlier versions, the printing will just be slightly different.
#
# Calling all reactive agents (with apologies to William Burroughs)
#
class Simulation:

def __init__(self, howmany):
self.agents = []
for i in range(howmany):
self.agents.append(Agent(self, i))

def showImportant(self, agent):
return "Agent: %d simulation: %d" % (agent.number, id(self))

def listAgents(self):
for a in self.agents:
a.showMe()

class Agent:

def __init__(self, sim, number):
self.sim = sim
self.number = number

def showMe(self):
print("Agent", self.number, "reporting:")
result = self.sim.showImportant(self)
print(result)

s = Simulation(3)
s.listAgents()
So, we start out with a class whose __init__() method is called with one argument, the number of agents to create. It creates a list of that many agents as its agents attribute. Note that when the Agent is created the Simulation instance passes itself as an argument to the Agent creator, and the Agent.__init__() method saves the reference to the Simulation instance as the Agent's sim instance variable.

Colloquially we could say that each Agent "knows" which Simulation it's a part of. So an Agent is able to call the methods of the simulation that it's a part of. This makes it possible to devise agents that call various simulation methods, and to incorporate them in several different simulations which implement those methods differently.

When building large data structures with this kind of pattern, by the way, it's important to note that the references are circular (simulations refer to agents, and agents refer to simulations). The garbage collector in older versions of Python would have real difficulties with structures such as the ones created in the code above. In essence it would say to itself "Well, I can't delete the simulation until I have deleted all the agents it refers to." Then it would look at all the agents, and for each one it would say to itself "I can't delete this until I have deleted the simulation it refers to". An unintelligent garbage collection might get stuck in an infinite loop here, but Python's garbage collector has never been that stupid.

Nowadays, I am happy to say, in Python 2 or 3 the collector is able to recognize these cyclic references and, as long as there are no references to such a structure from the outside, will (eventually) reclaim the space.

Next time we'll consider how a simulation might use several types of agents, still providing common behavior for them all.

May 17, 2009

Python is So Versatile

Even though I use Python all the time, and I am well-connected in the Python world, so much is happening that it's difficult to stay in touch with everything Python. Taking a look at the Python Package Index, in just the last 24 hours there have been over 40 submissions. Not all of them will be new releases, but it's instructive to take a look at what's come in to PyPI as an indication of the breadth of applications in which Python is used. Rather than list all 40 submissions available from the RSS feed, let's just take a look at some of the more interesting items.

You could use the new release of Dumbo to write programs in Hadoop, the language for specifying massively parallel map-reduce computations. With AMFast you could create rich Internet applications using Flash remoting. If you wanted to write a Unix daemon in Python you could use the python-daemon library that implements PEP 3143. You could write a network time client with ntplib.

If you wanted to add automated image processing to your Django web application you could do it with django-imagekit, or you could add AJAX with Dajax. To make it useful to a broader audience you could add django-bidi-utils to handle bi-directional text.

You might want to analyze some PDF files, in which case you could use pdfminer. If you are more interested in structural bioinformatics research then Biskit might be more your cup of tea. With all this complex software flying around you might need a program to handle a structured to-do list, and Task Coach would be ready and waiting for you.

There's also a slew of Zope and Plone components to add to these already very capable systems. Python is just so versatile!

May 16, 2009

Python Booth at OSCON

For the first time this year Python will have a booth at OSCON, thanks to the good offices of Aahz. If you'd like to keep the Python banner flying over the exhibition hall I am sure he could do with some help.

What's the point? Well, certainly it will help to raise awareness of the language, which can only be a good thing. Having a booth puts a human face on Python and gives people a chance to get first-hand information rather than being filtered through other people's prejudices. OSCON is probably the largest open source conference in the world, so it's a good place to advertise the best open source language in the world.

The Python Software Foundation will be funding a large banner, and whatever else is required. I am sure Aahz will be happy to have suggestions and (most especially) offers of assistance. I've spent time in the past manning exhibition stands, and while it's interesting to meet a wide range of people it can be surprisingly tiring, so a one-man effort won't be enough. You can subscribe to the Python OSCON mailing list if you are interested in helping with either or both of the planning and execution.

May 14, 2009

Help Files Should Help, Right?

Microsoft Documentation Sucks
God knows I've had my complaints about Microsoft documentation in the past. Often about manuals consisting mostly of descriptions of the following nature:
Threep Nardling
To nardle threeps, select the Threep tab and check the Nardling checkbox.
Frankly this kind of documentation is worse than useless - it elevates statement of the bleeding obvious to new heights, and frustrates all users with at least one eye and half a brain. If you don't know what a threep is, or when it might usefully be nardled, the implication is that you are in the wrong place (though quite where else you would be expected to go for this information escapes me).

Ubuntu/Gnome Documentation Sucks
That said, I hope I am setting myself up for a fall here. I've just installed a number of Ubuntu 8.04 virtuals (because I want to be compatible with a client environment, since you ask), and I have been having problems getting the network interfaces to behave. So I go to the help file for the GUI-based networking tool so kindly provided, and the main portion is filled with this sort of idiocy:

The really annoying piece is that I went to the help file to try and get an understanding of the roaming mode, only to discover that this steaming pile of placemarkers* masquerading as documentation contains zero mention of the one interface feature I needed to know about. They could at least have had a section saying "Check this box to put the interface into roaming mode".

I am really hoping that this documentation has improved a lot in the two versions of Ubuntu that have been released since 8.04. If not, then it's time somebody (either at the Gnome Foundation or at Canonical) started to give some serious attention to documentation. Help files that don't help are a major source of end-user frustration.

Somebody, please put me out of my misery and tell me that this nonsense is gone in more recent releases. Otherwise I might just have to go home and bang my head against the wall.

The Real Problem
All of this is merely subsidiary to the real issue, which is how to I get a VirtualBox Ubuntu guest running under a Windows Vista host to track changes in the Vista internet connectivity. It seems like every time I change locations I have to spend time tweaking settings on the virtuals, rebooting uselessly and generally poking things until I get them to work without any clear idea of the eventually successful strategy.

So, dear lazyweb, please help me. If there's a manual that explains this I'd be happy to make a donation to its author. The open source world should, in my less than humbe opinion, value good documentation as much as (or more than) good code. Once you get past the obvious, the docs help you more than the code.

* Admit it, you though I was going to write "dung" there, didn't you? I am trying to eschew the obvious.

May 10, 2009

SCO's Inevitable End Moves Closer

A recent development in SCO's Chapter 11 bankruptcy takes the company still closer to its inevitable final demise. Groklaw reports that the US trustee has filed a motion to convert the bankruptcy proceedings from Chapter 11 (reorganization under protection from creditors) to Chapter 7 (liquidation of the business).

Darl McBride, somewhat predictably, is quoted as saying he was surprised by the decision, and that the company will fight it. This doesn't hide the fact that a bankrupt strategy will lead to a bankrupt company. The current stock price of $0.15 capitalizes the company at just over $3 million. How are the mighty fallen.

April 30, 2009

Another Award for Python

With the month of May comes notification from Linux Journal that Python has won their 2009 Readers' Choice Award for Favorite Programming Language, narrowly beating C++ and Java. The favorite scripting language was bash.

Last year there were some fairly obscure rules about what constituted a programming language and a scripting language. This year the readers themselves decided, and Python also did quite well in the second category.

“In an industry conceived, created and driven by peers, an accolade from the community is the highest compliment you can get,” said Linux Journal publisher Carlie Fairchild. She's right, and it's nice to know that Python's mindshare continues to increase.

April 28, 2009

God Bless, Mum

You may remember that last year I entered (walked) the Race for Hope, a charity even in support of the attempt to find a cure for brain tumors. It was particularly appropriate as a family friend had recently been diagnosed with a brain tumor, and we didn't at that time know what her prognosis was. Happily it looks as though she will survive, albeit with some attendant problems.

I am entering the walk again, but this year I will be making a personal contribution as I have another charity in mind for a more public appeal. Some readers may know that my mother died recently (on Saturday March 28, in fact, the middle day of PyCon). She'd been in failing health, so her death didn't come as a surprise, but if you'd been wondering why I wasn't my usual bubbly self at PyCon that was the reason why.

Rather than have people send flowers to the funeral the family decided we would look for a deserving charity, and ask people to make contributions to that instead. Mum was a midwife, with a healthy interest in the third world—she even took Urdu lessons at one point, and so the charity we chose was Safe Hands for Mothers. I hope that readers will support them through this page (for US donors the CAF link is easiest if you want to give money, just remember to click the "I don't live in the UK" button before entering your address).They are trying to help communities like those in sub-Saharan Africa, where mothers face a 1 in 16 chance of dying during pregnancy and childbirth.

Their web site doesn't have any way to record donations against a particular name, so I'd appreciate it if you would add a comment here should you decide to make a donation. We have so much in the way of material wealth in the United States and the rest of the Western world, and our gifts can make a huge difference to less fortunate individuals. Over 1,400 mothers die every day, many of them from avoidable complications. Please try and help them if you can. Thanks.

April 20, 2009

Sun to Become Part of Oracle

I'm not a great one for handing out stock tips, but when I said a month ago that Sun Microsystems was worth buying at $8 it looked like I was wrong when the IBM acquisition talks fell through. Just the same I held on, and now it looks like I'll be able to take a $1.50 profit when Oracle buy the company in the summer. Of course buying after the talks failed made even more sense, as Alex Martelli wisely pointed out in a comment. Thanks, Alex!

April 10, 2009

Django Hangovers

I think my spell checker is trying to tell me something!

April 9, 2009

Django Dash

Fancy you and a buddy writing the spiffiest Django application of all in 48 hours? Sounds like a great way to spend the weekend. Well, geek, Django Dash might just be for you. Teams of three (or less, but this is supposed to be fun) compete to do just that.

April 6, 2009

WTF, StumbleUpon?

StumbleUpon is a web service I use for occasional amusement - you register your "interests" and it shows you pseudo-random allegedly-related web pages. There's even a toolbar, which I was silly enough to install for those long evenings when there's nothing on the television and the clients aren't screaming loud enough to get my attention.

Unfortunately it just stopped being funny. I wanted to search my browser history for a specific page, and suddenly I see hundreds of entries, which I am absolutely sure are not a part of my browsing history (I would know if I had seen this page before), listed as "refer.php" whose content reads (typically) "One of our members added your page to the Humor topic on StumbleUpon." Here's a typical example.

So until I get an explanation telling me that either it's a Firefox bug (and we all know how rare those are) or StumbleUpon publicly grovel to get me back they are out, and the toolbar is history, and I won't be going back.

Twitter is currently down for unscheduled maintenance

Talk about being a victim of your own success. Twitter has become my social networking tool of choice, but I wish the service were more reliable. It's just flaked for what seems like the tenth time in the last month, and now only displays the above message when you try and access it. You might regard that as the "this page intentionally left blank" of the web 2.0 world.

Of course the original design inevitably meant that the service is faced with scalability problems, but Twitter hasn't helped matters by providing tools for "weblebrities" like auto-follow (automatically following someone who follows you). Us regular no-hopers, of course, wonder exactly what the point is: if you have 10,000+ followers on Twitter it's self evident that you couldn't give a bugger what any of them are tweeting, which makes the whole thing a rather vacuous exercise to those of us who prefer two-way communications to broadcasts.

I've actually been a member of the open source identi.ca site since OSCON, and while I think it's great that there's an alternative I haven't yet found it compelling enough to be more than an occasional visitor.

Like email spam it's becoming obvious that whenever a new phenomenon arises in the technical world, once it becomes public knowledge the traditional spoilers (marketdroids, celebrities and the like) will climb aboard and screw it up for everyone else. They just haven't realised yet that the rest of the world is just one short step away from telling them to get the hell out. There are a lot of dinosaurs walking around right now, wondering why they are feeling so warm.

April 2, 2009

PyCon Video: Even More Amazing!

I just learned from the PyCon Blog that all the video for the conference is expected to be available on-line at blip.tv by the end of Friday April 3, less than a week after the conference ended. This is indeed an awesome process, and the two videos already available via the PyCon web site shows that the quality problem that existed last year has been solved.

As I was one of the skeptics who thought we should maybe move to a professional video team I'd like to publicly take my hat off as chairman of the PSF to the dedicated team of volunteers under Carl Karsten who have made this possible.

Yet again I am compelled to say that PyCon rocks!

March 30, 2009

PyCon Proves Its Worth

Here's a great quote from Catherine Devlin's blog post Five Minutes at PyCon Changes Everything reporting the unexpected recruitment of a high-powered development team after giving a lightning talk:
If I'd had $1 million of startup funding to hire a staff to work on sqlpython, I couldn't have gotten a team that large or that talented. I figure that gives me better than a 1000-to-1 return on my PyCon investment. :)
It's also been extremely gratifying to discover that the dip in numbers (initial assessment says we were maybe 10% down on 2009) represents an amazing result. Apparently many conferences have seen attendance at 50% of last year's numbers, and some have simply canceled because the cancellation fees were a smaller that their expected loss.

This really vindicates the low-cost community-based approach that PyCon has always used. Several people told me that they booked to attend the conference without knowing whether they could get company approval, because they knew the conference was great value and they could afford to attend on their own dime. PyCon is a very special conference indeed, and the Python community makes remarkable things happen there every year.

PyCon 2010: Hyatt Regency Atlanta

I would like to thank everybody who came to this year's conference. In discussions with the banqueting and other staff it's become clear that as far as conferences go PyCon is a delight to cater for! We aren't too demanding, we don't mess the place up too badly and we have brought a large chunk of much-needed business to the local hotel industry.

With that said, and before the sprints are more than just starting, I thought I would try to whet your appetite for next year's conference, which will be at the Hyatt Regency Atlanta. In October of last year I added an extra day to the beginning of a business trip to Atlanta to meet Ewa Jadlowska of CTE (the conference organizers who help the PyCon organizers to organize) in Atlanta and inspect four possible venues. I sent in a report to David Goodger, and CTE continued to negotiate with the venues. Ultimately the Hyatt bid was successful, and so I thought these snapshots I took at the time of my visit might be of interest to those who like to see where they are going in advance.

The 22-story lobby greets you at ground level and draws you in. The general flavor is somewhat similar to that in the Hyatt Regency O'Hare we just occupied, but the extra height and larger area makes it even more impressive, though the elevators don't have fancy colored lights underneath them. The view of this space from about halfway up gives you an impression of its size.

There's a purpose-built registration office that should come in useful, and the audio-visual guys will be interested to hear that the main ballroom area has a balcony (from whence I shot this picture) for their use so that they can view the session without intruding on it. The height of the ballroom leaves nobody feeling claustrophobic.

The room I stayed in (which might have been rather up-market because I wasn't a secret shopper and they wanted to impress me) was large, clean and comfortable. Rather than show that I photographed a regular room, which is likely to give you a better idea of how comfortable you will be.

All in all I think PyCon will have a great time in Atlanta, and I am already looking forward to it. See you there?

March 28, 2009

PyCon 2009 Day 1

Way too much stuff going on to fully describe it. I should already be in bed, as tomorrow I want to be up early enough to see Jesse Noller's lightning talk: he had me do some graphics for him (so for Heaven's sake don't expect anything classy - we haz gimp but do not really know how to use it :)

Finally got to read Kirby Urner's instantaneous blog of my tutorial session yesterday. Great verisimilitude, lends an authentic flavor to his description.

PSF Members' meeting at lunchtime gave very good results: all members and sponsor members elected/ratified, board now expanded to 10, new bylaws adopted (thanks, Stephan Deibel) and motion to discard logo trademark protection defeated.

My presentation The State of the Python Community: Leading the Python Tribe took too long to present as I didn't have time to shorten the slide presentation, so I only had ten minutes to exchange ideas, but discussions afterwards made it obvious that some people with valuable information are intimidated by the level of research and/or determination it takes to get through to someone who can update the web site. Also there is a lot of enthusiasm to help the PSF. Apparently Jacob Kaplan-Moss is at least toying with the idea of stepping up to help the PSF volunteer web team. That would rock.

Brief hiatus followed by a short Board meeting. I am chairman for another year, and we decided on a couple of Python Community Awards. I was stunned (in the most pleasant way) to be able to view a recording of my session in the Green Room two hours after I had started presenting it! Way to go, audio-visual guys. When this stuff hits the met it will make tech news. They really *are* good.

On to dinner with my Board colleagues plus Allison Randal of the Parrot Foundation, Liew Beng Keat from the Singapore user group and Luciano Ramahlo of Brazil. The Board's only chance to socialize through the face, so an important occasion even if the table was a little long and narrow to allow round-table communication.

Then back to the hotel for a quick drink, a look at today's tweets and a bout of email responding before finally capsizing into bed after finishing this post. Always busy at PyCon. Time flies when you are enjoying yourself. More tomorrow ...

March 27, 2009

Chairman's Challenge for PyCon Delegates

I was originally hoping to offer an enormous prize for the best delegate video of PyCon, so I could put it up on python.tv, (sorry about the currently-parked domain status - I am at a conference!) but I didn't get my stuff together despite good advice from Leslie Hawthorn. The better the advice the worse it's wasted, I guess. Sorry, Leslie.

Anyway, absent any clear probability of video appearing (and if video does appear then I will judge it and award a prize) I have decided to issue a challenge to those delegates with electronics knowledge and a practical bent. I have brought to the conference a (working) Arduino duemilanove board, an assembled but untested motor driver board, a prototyping breadboard, two power supplies, a butane powered soldering iron with solder and a shitload of electronic components.

I will award whichever delegate who (in my sole opinion) produces the best gadget by noon on Sunday a gift certificate for Elegant Stitches, the vendor who produces wearable Python regalia.

The first person to find me or the stash of components should find a corner of an Open Space room somewhere that can be used by anyone wishing to take up the challenge. Extra points for proving the motor driver board as either good or bad (but convincing evidence will be required).

Delegates working in teams will be given extra credit and will receive more generous consideration in the event of a win. Entries to me in person or via the registration desk team.

Even if you don't want to seek a prize, feel free to play with the bits and pieces if you have any electronics knowledge. The Arduino is an interesting little device, and it would be great to have Python support for it.

PyCon Tutorial Slides

My PyCon tutorial attendance was closed at 60 students, but there were a few spare seats still due to dropouts and such. Next year some way of allowing wait-listed students the flexibility of a last-minute change would be a small improvement.

Extremely happy that this is the most negative thing I can imagine saying about the way Greg Lindstrom and his team ran the tutorials. As a presenter I have nothing but praise for the way the organization supported me: all I had to do was follow the line of least resistance. That always makes it easy for a presenter.

Please post any questions or corrections about the slides as comments.

Thanks to everyone who supported PyCon by coming to the tutorial. What should I do next year (when I think I will limit myself to one)?

March 19, 2009

Sun Microsystems in Play

For a couple of days now Sun's stock has been the subject of speculation due to IBM's wish to acquire the company. Strangely enough the company would have been worth more a month ago, since IBM's interest is unlikely to be in Sun's hardware range (which IBM would be well advised to spin off as no longer a part of their core competency).

No. IBM's interest in Sun is its software, which in turn means its people. So the price would have been higher before Sun's recent round of layoffs. If the deal goes ahead it's an unfortunate fact that many remaining Sun employees will lose their jobs because there will be duplication of administrative functions. I doubt, though, that many of those with higher-level technical skills will find themselves redundant, as they are the basis of the $7bn valuation of Sun.

I should have bought Sun stock at $4 a year ago (but didn't, for reasons I won't bother to go into here). But I think even at $8 I'll manage to make a modest profit on them.

March 18, 2009

PyCon Web Registration Closes Today

If you are planning to register for PyCon before you arrive at the venue, save yourself some money and do it on the web before web registration closes.

March 14, 2009

New Training Policy

OK, from now on every public Holden Web Python class is going to have at least two free places available for open source programmers. We are running a quarterly schedule right now. The next Introduction to Python class runs on yet-to-be-announced dates in September: the June class was canceled due to bereavement.

If you know someone who might benefit, please ask them to contact me to get themselves on the waiting list.

March 12, 2009

United Gets Lost Luggage Right

Earlier this week I flew back to Washington Dulles from Memphis via Chicago. Familiar story: short change, airplanes right next to each other, luggage transferred via central routing came on a later 'plane. The courteous assistant looked up my baggage details and led me to an entry terminal. He asked me to select the "OK to deliver by overnight service", which I did.

9:30 I get a call asking if it's OK to leave it tonight. I say "sure" and attach a signed note to the door asking the delivery service to leave the bag on the stoop.

Next morning I wake up and the bag is on the stoop. I've complained in the past when they've got it wrong.

So, this time, United, well done.

March 11, 2009

Lest We Doubt ...

You know your software is popular when people send you bacon in the mail. Jacob Kaplan Moss of the Django team certainly knew, because the people from bacn.com built a web business and said they "couldn't have done it without Django" in a note to Jacob ... with bacon enclosed.

Jacob captioned the image on Flickr "Do you have any idea how awesome it is receiving unsolicited bacon in the mail!?", which certainly winds up top of my list of questions most likely to receive the answer 'No'. He tweeted:
jacobian [...]! Just got BACON IN THE MAIL from the amazing people at bacn.com!
So, through those long dark nights as you try to stay awake long enough to compile your extension module, instead of wondering why you work on open source softwar, comfort yourself with the thought that someone may, one day, send ... bacon.