September 1, 2012

Adafruit Pi Cobbler

Here is a picture of the extension board I built in about ten minutes this evening.

The kit includes a ribbon cable to attach to the Pi, and the little circuit board plugs in to your prototyping board on which you can build the rest of your circuitry.

This will be useful for projects too large for the Proto Plus to accommodate.


Pi With Proto Plus

Now I can blog straight from my phone I thought I'd post this picture of my Raspberry Pi, in its case with the lid removed and with my new Adafruit Proto Plus board in place.

The add-on board is well-designed, allowing you to easily tap the Pi's signals for use on the breadboard (an optional extra I couldn't resist) or for external circuits.

I have also bought a couple of Adafruit's Pi Cobbler kits, which will let me attach the fully-enclosed Pi to a larger breadboard. I am happy to say my soldering skills are returning despite a thirty-year hiatus.



Note: I am not impressed by the way editing a mobile blog post immediately requires me to insert paragraph separators in what until then appeared to be a well-formatted post.

August 23, 2012

Spam Report

Spam still exists.

August 2, 2012

Noller Does It Again

I mentioned in my recent OSCON write-up that I had the privilege of announcing that this year's winner of the Frank Willison Memorial Award was Jesse Noller. The most spectacular contribution to his win was the amazing PyCon that he chaired with record results: over 2,200 delegates and an amazing program opening with dancing robots that, coming only ten years after PyCon took its first faltering steps, hit me quite emotionally.

Jesse is once again PyCon chair, and he has just announced the most amazing addition to next year's PyCon. Delegates will be able to sign up their over-12 kids for a short course, using pygame, to help them understand why their moms and dads are so crazy about Python. Not only will the workshop be free, each registered kid will be given a free Raspberry Pi computer complete with an operating system on an SD card.

I'm so enthusiastic about this I have already approached the organizers, Lynn Root and Katie Cunningham, to offer my services as a classroom assistant. I encourage you to do the same if you enjoy helping kids to learn.

The conference is still eight months away, people. Heaven only knows what other fabulous treats he has in store for us all. Go, Jesse.


August 1, 2012

Question Question

So, if the ladies of PyPy started their own organization would they be the PyPyLadiesLadies?

July 26, 2012

DjangoCon Comes to DC

Last year The Open Bastion asked the Django community where they wanted to hold the next couple of DjangoCons (since this is a community event, we figured that it made sense to ask). The first answer from most people was “this place close to my home town,” and the second one from the Django Software Foundation was “you’ll have to decide.” So much for community consultation.

In fact we did interact with the denizens of the django-users list, and eventually settled on Washington, DC for this year and downtown Chicago for the next. That being the case, the next thing was to recruit the community volunteers. Fortunately this wasn't difficult, since for DC they essentially turned up in my inbox one day basically asking what they could do. So far they have arranged a great sprinting facility, and become involved in the financial assistance of impecunious delegates. It's great to work with an enthusiastic team of volunteers

People sometimes ask why a conference like DjangoCon uses volunteer help, and the answer to that question is complex. First of all, the volunteers can take care of areas we don't have the time or the local knowledge for. Those close to the conference are invaluable in performing on-site actions ahead of time. Secondly, their involvement retains the essential community feel of the conference. Our role is principally to ensure that the venue provides what it should and the logistics of the conference run smoothly (and thereby hangs a tale).

Anyway, with 39 days to go to DjangoCon we are entering the final checklist phase. Apologies to the sponsors, as we have been dilatory getting their details up on the site. We are working on it.

It's going to be interesting being in DC, to which I lived close for almost fifteen years. The hotel, thank heavens, is just around the corner from the airport—one of DC's advantages is that you can be downtown very quickly after clearing the airport. Just make sure you fly into Reagan National (DCA) and not Dulles (IAD) or Baltimore-Washington (BWI) unless you have to.

Now the schedule has been announced Early Bird tickets have been moving briskly, but it looks as though they won't run out before the Early Bird period ends on August 3. The new Supersaver tickets were popular, though not as many students bought them as we anticipated. There is something for everyone in the schedule, and we'll be featuring the keynotes in a separate blog post soon.

We have a code of conduct, not that different from the PyCon code of conduct. The principal value of such codes is in putting people on notice that certain standards of behavior are required.

One of the things I like most about the Python and Django communities is that the individual members of the community largely feel empowered to police such things informally. This means that most issues never flare up into the kind of ugly incident that we are all tired of reading about because such behavior gets nipped in the bud before it has chance to make serious trouble*.

Running these conferences is an effort, but whether or not they make money it's always gratifying to have people thank us for making the effort to run them. Now that I am no longer the chairman of the Python Software Foundation I am finding other ways to serve the community which has been a major part of my life for the last fifteen years. Making the transition for community leader to open source entrepreneur might not be easy (I have already made a couple of expensive mistakes). I hope I have your support.

* I realize there is an element of hubris in such assertions, but nevertheless wanted to underline that harassment is taken seriously.

July 25, 2012

Fun and Games at OSCON

Once again I spent a week in Portland with over 3,000 Open source enthusiasts, developers, business people and community managers at the largest US open source convention. Once again the hallway track was supremely interesting, and there was much of interest in the sessions.

For me there was a little more business than usual, as a new client of The Open Bastion was present and this was an opportunity to learn more about their team, meet people, form impressions, find out how they work and so on. Also the Python language had a stand in the Open Source Pavilion (alongside many other famous open source names), and I took my Raspberry Pi along. It was amazing how many people had heard of the Pi, and very few actually had one. The commonest comment was “I’m still waiting for mine.”

Alas I again didn't have very much time for the excellent Community Leadership Summit which now traditionally precedes OSCON, though I did manage to take part in one session about conflict resolution, and heard much useful stuff in plenary talks. If you are the leader of any open source community group I would definitely recommend going to this (free) event. It's well worth the cost of an extra couple of night's accommodation. Monday was taken up with clerical work, but on Tuesday I did make it to several sessions of the Business Leadership Day tutorial, and found them sound to excellent.

Tuesday evening Camp OSCON was held—indoors, due to threatened thunder storms which in the end never transpired. This was a traditional O'Reilly party, open bars, many different types of food in all-you-can-eat quantities, airbrushed fake tattoos, the whole bit. I managed to score four party tickets for a friend who came with his wife and two children. They were excited beyond belief, and it was delightful to see how much pleasure a two-minute stop at the registration desk had created.

Among the many activities was a dunking stool, allowing three pitches in return for a $10 donation. My major part in the evening's activities was to be (as I thought) the final target of the event. I took my place, and was duly dunked several times. At one point a guy who looked a lot like Tim O'Reilly took a shot. Good heavens, it was Tim O'Reilly. After failing to unseat me with any of his three pitches he moved closer to the target. Saying “How does this work?” (something I suspect he was not in need of information about) he pressed the target and promptly subjected me to my fifteenth ducking of the evening.

Tim O'Reilly in the dunking tank
Photo from Flickr by aaronparecki
When I emerged from the tank I thought it was all over, but then I saw Tim getting into it. Even though I was still wet I couldn't resist, and promptly made the necessary donation to put me at the front of the line. I am happy to say by the flukiest luck I managed to turn him from dry to wet with my first pitch. Success! My two remaining pitches failed to hit the target, so I went off to the men's room to dry and change. When I emerged I couldn't resist going up to the target, saying “How does this work?” and subjecting him to a second dunking.


I went around back to pack my wet clothes and he insisted on reaching over to shake my hand with a big smile, which reassured me that there were no hard feelings and that the cancellation of my O'Reilly School of Technology classes was not imminent. Tim O'Reilly is a good sport.

Wednesday's keynotes were thought-provoking. I particularly like the fact that the open source world appears to be becoming less shy about the value that it creates in the economy. Tim O'Reilly suggested that successful organizations create more value than they capture, and was very scathing about the short-term thinking and transparent absence of business ethics on Wall Street.

He did some very interesting sums suggesting that open source is a huge net plus to the economy. He likened the situation to that in energy: if we use a clothes dryer to dry our clothes that energy is metered and measured and accounted for. If we dry our clothes on the line using solar power nothing ever gets recorded. Similarly the benefits of open source software have not been sufficiently trumpeted to the world, and so are taken for granted by the commercial enterprises that profit from them because they do not perceive any significant costs. He ended by thanking those of us who have been working in open source for a long time for our forward thinking and our contributions.

Much of the rest of the day I spent talking to people either on the Python stand or in the hallway track. It is always impressive to learn about the range of applications to which open source is being put. The medical faction are much in evidence. The most surprising discovery I made is that at the core of the award-winning open source VistA system is a MUMPS database, technology whose roots must go back over forty years. I sure hope there's a Python API.

Thursday morning's keynotes were more practical in nature, my favorite being the talk from Canonical's Mark Shuttleworth. I'm a sucker for technology, and his explanation of how the juju system lets you build and model complex, scalable systems on the desktop and then easily migrate them to the cloud for testing or production was quite something. The practical demonstration of migrating a service from Amazon to the H-P Cloud service was impressive* (though I was amused to see he did at one point get bitten by a minor gremlin).

There was a frankly disappointing interview with Microsoft's Senior Director for Open Source Communities, Gianugo Rabellino. Not only did it sound as though it might have been scripted by Microsoft's public relations department, it seemed to be mostly "sound and fury, signifying nothing." I am aware that Microsoft** are now a significant contributor to (for example) the Linux kernel and other open source projects, but it's difficult to have a company's representatives talking about open source in "snake oil" terms one year and then see them hold out the olive branch the next.

There is still a substantial mistrust of Microsoft's motivations and purposes among a part of the open source community, as evidenced by a subtle change in the audience's mood. They will have to work hard to prove that they deserve a place in the open source community. This is a pity, because Microsoft employ many smart technical people who fully "get" open source, but it is taking the corporate side a long time to come to terms with it.

The Python stand was very busy again, as were those of the other open source projects. The day went quickly, and I got to listen to a couple of track talks, but again a lot of my time was spent in the hallways. I also spent some time observing the O'Reilly and Convention Center staff, who appeared for the most part to be a model of curtesy and efficiency. In the evening I was invited to the chairmens' party thrown by co-chairs Edd Dumbill and Sarah Novotny. This was, as is often the case, a fairly low-key affair attended by many likable people, and I was surprised to see that it was after midnight when we left. Time does indeed fly in good company.

This meant I had to hustle and get my beauty sleep as I was a small part of Friday's keynotes, announcing a well-deserved Frank Willison Memorial Award for Jesse Noller. Jesse is the classic busy person you should ask to get things done. His work rate is phenomenal, and he held down a full-time job while putting together the most amazing PyCon ever and going through a good deal of personal disturbance. I can't think of anyone who deserves it more, and the PSF Board was in full agreement that Jesse should be the recipient.

It was fascinating to spend a little time backstage and see the technology and the production values that now support OSCON. The show is professional from its head to the tip of its toes. The keynote session was followed by more hallway track and meetings while the sessions continued, then back for the closing plenary session at which Open Source Awards were handed out and the final entertainment was provided by Paul Fenwick, always worth listening to even when his topic is light.

After the formal end of the conference I had a couple of business meetings and went home (using public transport, because I live in Portland, hooray!) for a well-earned nap. Feeling much better-rested the next day I was happy to host the inaugural OSCON Survivors' Brunch at the Tabor Hill Cafe, a local place I make sure to patronize while I am at home. This was kind of an ad hoc event, attended by about a dozen of my favorite open source people, and I will repeat it in a more organized way next year.

OSCON always leaves you with plenty of food for thought, and this year I was much more encouraged about the prospects of open source entering (or even, dare I suggest, becoming) the mainstream. Mark Shuttleworth revealed OEM connections this year and claimed that next year 5% of all computers will ship with Ubuntu pre-loaded. I'd recommend buying your ticket for next year's OSCON as soon as they come on sale.

* H-P were a major OSCON sponsor this year; this was a shrewd move
** Microsoft also sponsored OSCON


[Disclosure: Steve Holden's business runs technical events and conferences,
and Steve profits from the sale of O'Reilly School Python classes]

July 14, 2012

Back in the USSA

My return to the USA after four weeks in Europe is to remarkably pleasant weather, which bodes fair for OSCON next week. It is something of a blow to be back in harness, but made more bearable by the thought of seeing so many friends again at OSCON, and so many more at DjangoCon—in Washington, DC for the first time this year. So at least I am working towards sympathetic ends.

During the trip I spent a week on vacation in a small town in Southern Spain. After an intensive week of packing and wrapping in London I then flew to Florence for EuroPython. I was charmed by EuroPython, and delighted (having been unable to attend last year) by Florence.

This was my first visit to Florence. Arriving from London's City airport wasn't terribly pleasant, as the city's fairly small airport is under renovation and the line for the passport check didn't even enter the terminal building for about thirty minutes. Fortunately I had not checked any baggage, so I was soon in a taxi once I left the terminal building. [Since I don't want to end on a sour note I will mention now that the outbound experience was also troubled by long albeit air conditioned lines, apparently due to computer systems issues; I wrote this down to teething troubles].

A €20 fixed cab fare took me to the Grand Hotel Mediterraneo, where the conference was already heating up—literally: the temperature was around 35°C (100°F) on that first day, and the weather was baking all week. The Italian organizers had worked hard to ensure a smooth flow to the conference, although the two-floor nature of the event inevitably meant that the staircase traffic was heavy at times. The air conditioning found it hard to keep up when rooms were full, and I sympathise with the venue—it is difficult to deal with such extreme temperatures.

My delayed arrival meant that I had missed Guido's “Not the State of Python” talk, at which I later heard he claimed he had used the same slides as a previous presentation but said completely different things. The BDFL was certainly relaxed and entertaining as he later answered questions from the community relayed by Harald Armin Massa. When accosted later in person he appeared to be in fine form, and although he is traveling a little less (the lucky man) he was due to go on to Zurich on business after the conference.

The program, primarily in English with one Italian track, was at all times worthwhile and often entertaining and stimulating. It was a pleasure to spend time with acquaintances old and new, and find out some of the amazing things that the Python community has been up to. The lightning talks were again chaired by Harald Armin Massa, now billing himself as “Lightning Talk Man” and I should have liked to see more than I did.

The Python Software Foundation was among the conference's sponsors, and ran a stand with the PSF's new conference kit on display for the first time. I spent some time on there with Marc-André Lemburg, Pat Campbell (the PSF's administrator) and Ewa Jodlowska (its Conference Coordinator), Quite a few people expressed an interest in the new associate member scheme,  and we had new stickers to pass out to those who signed up. The ever-popular Python stickers also disappeared fast, and we handled inquiries about advertising in the new Python brochure whose production Marc-André has been leading.

This was a very special conference for me in many ways, as I ease back into community member status. I was able to spend some relatively relaxed time with old friends whom I rarely see. The food in Florentine restaurants is excellent, and each night was a different feast. At least one Italian admired my restraint in leaving a part of my secondi, the entrée dish. Little did he know that I was already at bursting point. Beware, portions tend to be generous, and the food so good that it is an effort to stop eating. After that, I approached conference meals with rather less gusto.

Henrique Bastos face
Henrique Bastos from Brazil
Over the weekend I was joined by a friend from the UK and with Henrique Bastos and his wife we took the open-topped bus tour of the city. A walk through the Boboli Gardens to the old town, across the Ponte Vecchio and past the Uffizi Palace saw us ensconced in a typical Florentine café/bar with a bunch of young guys who were happy to advise on food and drink. A taxi back to the hotel seemed advisable after a most diverting (though somewhat tiring) day.

On the Sunday, before returning to the UK we took the open-topped bus out of town and winding through the hills to Fiesole, a place to which I shall return to enjoy at greater leisure in future, I hope.
Fiesole, Florence, from above [courtesy of Google Maps]
Oh, and during it all people from (I'm guessing) over twenty nations got together and shared a huge amount of knowledge about Python, thereby helping to grow the Python community and bond it together through the forge of shared experience. What could be better than that?

Bravo to the organizing team for keeping everything running so smoothly. Those guys will be a hard act to follow, but fortunately nobody is going to have to try just yet. Yes, EuroPython will run in Florence for an unprecedented third year. My advice would be to book early.

May 19, 2012

Twelve Years a Blogger

Some years were busier than others, but I am still here, and still finding the time to blog occasionally. I try not to be put off by (or unduly stimulated by) thoughts such as “It's been too long since I put something out” or “it's been so long now it would look lame to post something.”

If I have something I think is worth posting and (the kicker) the time to do it then I will by all means write something down. Just been a bit busy this lifetime is all ...

“Life’s what happens to you while you’re busy making other plans”—John Lennon

May 18, 2012

Open Django Central Now Open to Sponsors


The Open Bastion, the subsidiary that runs events and conferences, has announced that its Open Django Central event, new to the calendar this year, is now (yes, we know) finally open to sponsors. Sponsorship is very reasonably priced, and the more money that comes in sponsorship the better we can make the event for the local Django community.

This represents a rare opportunity to connect with a diverse group of “djangstas” from the greater
Chicago and surrounding areas. The conference is targeted not just at technologists but also at
others wishing to engage with the open source world and find out what these technologies can do.

We hope that by adding your name to the roster of those supporting Open Django Central you will
indicate your enthusiastic support of and interest in open source technologies, in particular Django and Python. It's easy to ask about becoming a sponsor.

We are also still looking for speakers, so please let us know of anyone (you included, dear reader) who might be interested in giving a (technical, not marketing) talk at the conference. Slots are from 30-90 minutes.

And please act now, as time is (yes, we know) getting short!

May 17, 2012

Refactor All the Laws

In the Python world we try to keep things simple. There are very good reasons for this. Brian Kernighan, a well-known programmer responsible for parts of the design of UNIX™*, once famously observed that
Debugging is twice as hard as writing code in the first place. Therefore, if you write the code as cleverly as possible you are, by definition, not smart enough to debug it.

This principle is not observed by programming beginners, who know enough to get themselves in trouble, but often not enough to get out of it. Anyone who has been coding a long time (and believe me, I have been coding a long time) knows not to get too smart lest they write code they cannot debug. It's slightly different when you are struggling to establish an architecture (are we a library or a framework?), but once the production environment is established you really want to be able to crank it out without having to rethink each corner case.

I even once went so far as to write a pre-processor for BASIC PLUS that operated on BASIC lines (which had to be numbered, whereas the input to the pre-processor did not) much as an assembler did to lines of symbolic machine code. In other words, I made BASIC code relocatable and made library sharing between projects much simpler. Because it was really more like a linking loader than an assembler (though it had features in common with both), I called it Blink. But that was thirty-odd years ago, when I was writing accounting systems. It certainly let us crank the code out. Happy days.

Of course Blink no longer exists. I am not one of those programmers who keeps every line of code they have ever written, regarding most of it as ephemeral: built to perform a task, and no longer relevant once the task is complete. I do not envy the curators of computer museums, who must decide what is worth keeping, and what can be kept running. You can do that with hardware, just about, but with software the profusion makes it impossible to track what's going on. Perhaps soon the open source world will find fixes for this bug—certainly the appearance of public DVCS systems will help. Some software, however, seemingly goes on for ever and ever.

It was very pleasing earlier this year to see a bunch of BBC Micros of ancient vintage still doing what they were designed for thirty years later. I wonder whether we'll ever see a 30-year-old iPhone anywhere but a museum? (To be fair, you don't see many BBC Micros nowadays). There are relatively few engineers building control systems and the like for a lifetime much longer than that.

Of course most systems of any age have been modified somewhat from their original purpose. You build a billing system, then the sales department come along and say "we could double our revenues if we could bill more flexibly," and the dance begins. You fix your programs to handle new requirements, they come along with even newer requirements, you add more fixes, and so on. Unless you are very, very disciplined, and are working with well-designed well-written code (e.g. if someone else wrote the program badly you may be screwed) you can end up finding that the change you make, while it meets the new requirements, no longer meets earlier requirements because of unintended consequences from your change. In simple terms, your program has become so complex that fixing it in one place breaks it in another.

In the software world we can use regression tests to alleviate the worst pain from this kind of activity (in addition to the unit tests we use to establish basic functions operate correctly). Whenever you find an error in the program, you write a test that fails with the problematic release but should pass when the system is fixed. This has the advantage that if your changes cause unanticipated failure then there should be a high probability that at least one existing test should fail. The presence of such regression tests sets a sort of “high water mark” for software performance. It has to be at least good enough to pass all the tests, or something is broken. In the presence of the tests we can refactor our code (reorganize and re-structure it)

Imagine now, if you can, a computer program two hundred years old**. Yes, I know, that pre-dates even Charles Babbage's analytical engine by more than a century. Never mind that. Just suppose that by some freak of probability some primitive computing technology had been developed by an unsung genius, and that its output is so valuable that it must be kept running†. The order of society itself depends on this program running, and yet it has never had a single test written for it. Don't blame the authors, when the constitution was written there was no such thing as test-driven development.

And yes, I am talking about the law of the land as something in need of refactoring. In just the same way as software engineering has benefited from test-driven development, so the law would, in my immodest contention, benefit from principle-driven development. By this I mean to suggest that the lawyers, when proposing a law, should list some desirable outcomes (tests) which somehow engender the law's purpose. If we could at least get agreement on what such principles might be, and the fact that they are desirable, then we might establish benchmarks for the operation of a law and be able to reject amendments that violate the principles (break the tests, in coding terms).

Just as sometimes we get our tests wrong, and have to rewrite them, sometimes legislators will occasionally get the principles wrong and need to rewrite those. But a discussion of principle would be a matter for all-out debate, whereas it seems to me that modifications of the law would be less contentious as long as none of the underlying principles were violated (in other words, as long as the law introduces no regression errors).

The present laws are full of special cases, introduced because of the lobbying of those with special interests or to suit one particular constituency. It's time we stopped placing so much emphasis on passing new laws and decided instead to add principles to the existing law so that we could start to detect more easily when the law started to diverge from society’s desires about the way it operates. In time the law could be cleaned up in much the same way as a crufty old program can be re-engineered to bring it in line with more modern requirements.

At present the law is a bug ugly ball of string, and there are many professionals making a good living finding and exploiting loopholes that operate to the advantage of their clients. We need more foresight, and we need a legal system that effectively says “this law cannot be amended, and is not intended to operate, to provide tax benefits to those who do not require them” or “this law cannot be used to the benefit of anyone with above-average income.” While this isn't a perfect proposal, it would perhaps serve to focus people's interest on those who are specifically intended to benefit from the passage of particular laws, and the principles might over time become an accepted set of goals for new legislation.

When I think of how crufty code gets after just a few years I shudder to think what the law must look like from the inside. It's certainly obvious that the legislature has not been operating “by the people, for the people and of the people.” It's time we changed that. Since I have no vote I'd appreciate it if my voter friends could execute this change at the first available opportunity.

* Merely one in a very long list of achievements, as any Internet search will reveal
** Or, perhaps, 236 years old
† Believe it or not, at the time of the "year 2k" panic some banks discovered they were running (in compatibility mode) some programs originally written in 1400-series autocode for which they no longer had the source. This would have been more surprising back in the days when banks were regarded as reliable and responsible. Happy days.

May 6, 2012

Swan Song

Well, I don't really know where to begin. Finally, and somewhat unexpectedly, there is an end to the tunnel entitled “Chairman of the Python Software Foundation.” When I stood for election to the board this year my manifesto included a declaration that by the same time next year I would no longer  be chairman. The board at my request asked for nominations for a Vice Chairman to prepare to take over from me at a planned point in the future.

As the inauguration of the new board coincides with the unfortunate necessity of consulting orthopedic surgeons I am availing myself of the non-profit equivalent of the "get out of jail free" card, and handing over to the new chairman Van Lindberg (currently Vice Chairman, and the careful steward of PyCon in 2010 and 2011), somewhat earlier than originally anticipated. This will allow me time to rest and discover what comes next. Fortunately I don't anticipate any real problems, but it is good to have a Chairman waiting in the wings, supported by a Board that will continue to take capable care of business while I pay attention to other things. I know that the whole Python community will be behind them.

To those who wish to email me about PSF matters, please continue to do so if you don't know who else to contact (hint: our administrator and secretary Pat Campbell stands ready to help at all times). I will continue to try and ensure that all mail reaches an appropriate (i.e. not /dev/null) destination. Please do all you can to help the new chairman and board to help you. I am sure that the Foundation will under their leadership continue to move from strength to strength, reinforcing its mission of promoting the Python language and encouraging the growth of the international Python community. I remain on the board for the remainder of my elected term, and look forward to helping the new team strengthen the ties we have forged with the widest possible Python community.

Thank you for the opportunity to serve you. Good luck, Van, and over to you.

March 6, 2012

To My Followers

Wow. Didn't even know I had any. Sorry about that. Been busy. Should get a few posts out during PyCon.

January 3, 2012

Help Wanted

If you are here because you think this post might be advertising a job, please accept my apologies. If, on the other hand, you are looking for work, this might be the very place for you. If you don’t see the difference between “a job” and “work” then there might be something to learn here.

“Hold hard,” I hear you say (I have a very vivid and somewhat eighteenth-century imagination). “Surely that is a contradiction in terms?” (My New Year’s resolution to be less pedantic stops me from pointing out that you have ended a non-interrogative sentence with a question mark)(and my pedantry neatly negates the resolution). I take instead the consultant's approach of arguing that it depends what you mean by ‘job’ and ‘work’.

If you take your definitions from the market economy then a job and work are often pretty strictly equated. This point of view would not cut much ice with many of the people I know, though. I am delightedly sharing the company of many of them at PyCon this week* who work in open source, though. In their case the work they do on behalf of the Python community, and other open source communities too in many cases, is often done outside of their working lives. Admittedly many of the have the smarts to make a halfway decent living by exercising the same or related skills professionally, but that isn't necessarily a bad thing..

If you don't really understand how the open source ‘ecosystem’ works you might be fascinated to learn that huge swathes of the technology that is used every nanosecond to process unthinkable volumes of information across the Internet was created by people with the necessary skills who also happened to believe that it was more important to create the new technologies than it was to organize profitable industries around proprietary solutions that were the sole responsibility of single organizations. Those people, the kind of people who put their effort where their mouth is, are people I will support. And have, most recently as chairman of the Python Software Foundation.

Open source devotees generally seem to me to try and avoid organizational issues or involvement. This is perhaps understandable: why would people who value logic and reason highly want to involve themselves in environments where decisions are frequently made on irrational grounds? “To make the decisions more rational” is one answer. But if that was the only advantage of involvement it would asymmetrically benefit the irrational, and why should the rational waste their time? (Idiocracy, anyone?) Most open source programmers would rather code than consider strategy and tactics for a non-profit, even if the non-profit is supporting their principal programming language. That's human nature, and we should be grateful for it: coders gotta code, and the rest of us benefit from that. But it can leave a gap if we don't want open source to simply become the plaything of market forces.

The point is, some of the things business does, and some of the ways business organizes, are sensible for any enterprise of moderate size. Allegedly, corporations are legally people (and the band played “Believe it if you like”). Most businesses currently pay far too little attention to their social responsibilities. If people went around behaving like corporations do then they would soon get what in London used to be referred to as “a swift punch up the bracket”. One of the strengths of a market economy is supposed to be that the market can be changed by mass behaviors. There doesn't seem to be much sign of that in the banking industry at present, despite public confidence in them being at an all-time low. And who can be surprised about the lack of confidence from a populace whose equity has just been looted by rapacious bastards who see bonuses in the billions as their right?

At the moment there is an uneasy tension between commercial organizations and open source, although that has not stopped both sides from profiting by its adoption. I would like to think that while the non-profit side can learn from commerce it can also teach commerce a few things about how to manage technical resources. We can, at least, try leading the horse to water. If it won't drink then I say let the damned thing die of dehydration. The signs are very clear that the present order can only be maintained by increasing levels of brutality (“the floggings will continue until morale improves”). Adapting to change was never the forté of the dinosaurs.

On the principle of “if you can't beat them, join them,” I think it's time for the open source movement to admit a few things. Such as: not everything can be done with software; foundations need skills that aren't readily available from the geek population (whether through lack of ability or inclination is hardly material). The Foundation I chair is likely, from existing evidence, to be receiving a fair amount of support as the economy recovers—and no, I do not claim to know when that will be. This will mean that more things need to be done, which in turn means more administration and accounting—two things I am as bad at as many of my acquaintance are. The inevitable impact of scaling up the organization is to require more of the kind of services that geeks (for want of a better or more descriptive term) are ill suited to providing. So either things will get clogged up or we will have to somehow involve more people who can provide the necessary “non-geek” skills.

Some time ago the Foundation hired an Administrator, who is now employed full-time, in acknowledgment of the need for such a skills base. I am happy to say that our Adminstrator and Secretary Pat Campbell has become an indispensable part of the Foundation. She continues to prove her merit by making things happen with no geek input! We cannot necessarily add staff at will, however, because we don't want to be one of those non-profits that exists to pay exorbitant salaries to its management for very little reason. Contributions should primarily go towards  funding the mission.

There are many other areas in which we are stretched, and perhaps surprisingly many of those roles do not require much in the way of geek skills. Our Treasurer, dealing valiantly with increasing volumes of financial data as our operations grow, could certainly use assistance. We need help with marketing, to encourage people to join and pay subscriptions for the privilege of being associate members of the Foundation. When the updated web site technology is deployed (still some way off, but definitely more than a gleam in the chairman's eye thanks to the efforts of Jesse Noller) we will also need people who can manage the large and growing volume of content.

All this is exceptionally good news for anyone in the "open source industry," and people with Python skills in particular. Python is so hot now it's difficult to believe. Major companies have stood inline to join up as PyCon sponsors, and the money this has brought in helps us to keep the cost down. People are looking for Python training at many different levels, and need help establishing programming best practices and the like if training is not your métier.

The Python community as a whole is such an incredible resource that it's difficult to imagine a skill we might need that someone doesn't possess in at least some measure. But maybe it's time to admit that in reality in job X we could probably only deliver 79% of the performance we would like to, and that has to address specific functions. If we can find a volunteer for Job X we release a developer to program; if the volunteer only happens to do an 80% job that's still a win.

* No, none at all, sorry. PyCon has been turning people away for weeks now.


This post has been in draft for some time, hence the screwy dateline. Don't ask me why Blogger does this.



December 16, 2011

Nothing Stranger Than This?

I’ve just been reading Stack Overflow’s Strangest Language Feature thread, where I discover that (at the time of writing) the highest-voted Python complaint is actually about Java, but the complainant claims that JavaScript and Python are the same. So after I've got this off my chest I'll perhaps go back and look for the top complaint specifically about Python. In Java the complained-of code looks like this:

    try {
        return true;
    } finally {
        return false;
    }



This naturally translates into

    try:
       return True
    finally:
       return False


which, under every recent CPython I've tried (2.{6,7}.X and 3.X), returns False. What I can’t understand is why anyone would expect anything different. If the finally suite contains a return then it’s pretty apparent that the programmer of that function wanted the function to always return a specific value. If there had been code following the return statement would the complainers have expected that to be executed? I'm not sure I see the reason for the complaint at all. What would the complainers have this function return? What is the return statement supposed to do?

This gave rise to a further thought: does a return in a finally clause suppress any active exception? This is only one of a number of exception-handling issues I've been thinking about lately, kind of noodling around the corner cases. More later.

December 4, 2011

Competition: Working to Keep You Enslaved?

The Digital Millenium Copyright Act was never my favorite legislation. It was the first of a number of moves that threatens the freedom of the end users of intellectual property (by which under many circumstances I refer to those who have paid good money for their real or virtual goods or services) to freely enjoy that which they have purchased. Since the Python world generally prefers not to place onerous licenses on users this isn't generally an issue in my working life, but it affects other aspects of it. Those other aspects are shared with the other millions on the planet who use a smartphone.

For all the brouhaha there's been about occupations this year (and I for one regard them as a welcome sign that Americans have realized that the future of democracy is up to them) the most insidious occupation I can think of is the one organized by wireless telephone carriers against their customers. With the aid of an application called “Carrier IQ” many handsets, supplied with software packages approved by their respective carriers, have been equipped with the provision to spy on the holder.

This issue was brought to mind by the news that the Software Freedom Law Center have filed paperwork with the Library of Congress seeking an exemption to the DMCA allowing smartphone users the full legal right to run any damned software they choose on their handsets, with or without the approval of the carrier (who is naturally in most cases the supplier of the handset).

I’ve not yet heard of any case where Carrier IQ has been deployed to the detriment of the phone’s owner, but I haven't done extensive research in that area. As someone who teaches security I know that a capability, once created, is highly likely to eventually be used, and often for unintended purposes—if only by those whose approach to moral and ethical questions is one of expediency. Thank heavens so few such people exist.*

This raised for me the broader question of why, in a society that lauds the value of competition, are wireless carriers allowed to sell ’phones that are locked to their networks? If the argument is that doing so allows them to use the profits from the handset to subsidize the contract, my answer is thanks very much, I will pay for a handset that I can take to another supplier if they offer better services, and you can reduce the price of my contract since you do not have to subsidize my handset purchase, thank you very much. And I want the best possible price on the ’phone, please, or I'll buy it from Mr. SmallerProfits round the corner.

By all means let the corporate giants carry on doing business as they are, but also please require them to supply unlocked handsets on request. That way I don't have to suffer weeks in Europe where I am forced to use an international roaming plan that charges me a minimum $100 a month on top of my regular service charge for a parsimonious 70 MB of data and something ridiculous for each few measly bits after that. Haven't they heard we live in the information age? Colleagues from other countries simply re-SIM their telephones locally and pay $30 for a card that gives them 2GB of data and 2 calling hours, topped up electronically by credit card.

It causes me to smile sometimes when I hear Americans blindly praising their country for properties it does not possess, or for being best in the world at activities in which they are in fact well down the league table (mathematics and science education being among those activities). To my mind, America is quite admirable enough in reality without the support of false information. I chose to live here, after all. But when I discover that Israel of all countries (and no, we won’t get into that here, thank you) has made it illegal to sell locked handsets, I have to wonder how much that particular legislative concession would cost the cellular companies in the USA and why the move hasn't been emulated here. I am sure the lobbying costs expended against such a change would be formidable. Times are good in the boardrooms right now. As the UK magazine Private Eye says, “treble brandies all round”.

So although I was delighted to see Verizon** issue a categorical statement that none of their devices have ever had Carrier IQ installed, their roaming plan sucks at least as badly as any I have come across. The fact that the charges are so much higher than those of the native carriers smells of anti-competitive practice to me. If competition is so good, why don't they all use handsets that aren't crippled?

So rise up, sisters and brothers, and occupy your handsets. You have nothing to lose but your roaming plans.

* For American readers, this is an irony alert. Or am I being sardonic? The real point is that some people just cannot be trusted. You know who you are.
** The current carrier for both my voice and data cellular services

December 3, 2011

Make It Easy to Help

Strange things happen, and yaks get shaved in the process. I was idly exercising the PyPI JSON interface when I happened across a package called monk. I had no specific interest in this package, but I know something about MongoDB, and monk is an attempt to build a lightweight schema mechanism for it, with record specifications giving default values and validation rules, for example.

I was browsing the API and I noticed a function called monk.manipulation.merged(spec, data). It struck me (since the code deals with MongoDB records) that that function could become a method of the specification object called spec.merge_with(data), or something similar, and that this might be an appropriate topic about which to raise an issue.

Sadly the code repository, which is on BitBucket, won't give me access to the issue tracker, and I can't find an email address for the author, or indeed any other way to contact him. So it’s open source, just not quite as open as I'd like. And it's really not worth checking out a copy and updating the code and making a pull request—I was just reading the documentation, for Pete's sake, and wanted to help. Apparently not this time.

Installing ReportLab's Open Source Package on a Mac

I'm setting up to do some development, and this has meant installation work–never my favorite task, but  man's got to do what a man's go to do.

I mostly (i.e. when it there's a recipe for it) use homebrew to install functionality on my Mac. This isn't a religion, just my own particular choice, and by and large I'm comfortable with it. The current homebrew recipe for Python offers an easy update to 2.7 (while retaining 2.6 as the “system” Python) and includes the distribute package. This means you can immediately run

    easy_install virtualenvwrapper

and fixed up your shell initialization per the installation instructions you are ready to go. Once I'd done that I created a virtual environment with

    workon test1

and installed the recent PIL fork–which I felt would be a good compatibility test–with

    pip install pillow

The virtual environments you create with virtualenvwrapper already have pip installed, which is neat. Next I thought I'd see whether I could just do a vanilla install of the reportlab package, which is admirably good at writing PDF files. With some delight I observed

    pip install reportlab

appeared to go out to the Internet for the package, download and correctly install it. Except there was this annoying message about how it hadn't been built with freetype2 support.


    # installing without freetype no ttf, sorry!
    # You need to install a static library version of the freetype2 software


Hmm, no problem, uninstall it again (thank you pip) and install freetype2. Except that

    brew install freetype2

shows me that there's no brew formula for the dratted package, and there's (what seems to be) a perfectly good freetype2 library in /usr/X11. This is kind of annoying (there must be hundreds of Mac users of ReportLab's stuff, surely?) but I downloaded the source and tweaked around with it to see if I can get it to “see” the X11 library (all the time wondering whether that's some X-dependent stuff I don't really want to tangle with). Eventually I realized it didn't matter. Without writing a brew recipe for reportlab (which is what really seems to be required—that would allow patching of setup.py—but how could we persuade Python users not to user easy_install?) I needed a freetype2 that the standard pip install could see.

So I just had to go out in the hopeful spirit of yak-shavers everywhere and download and install freetype2 from source. Exactly what I was hoping to avoid, but I don't remember it being that difficult. I also remember blessing the author for including an “uninstall” target to try and remove it, which seems to work pretty effectively. Maybe I'll see if I can write a brew formula and submit it. Anyway, I now had a second copy of freetype2 happily occupying its own little corner of /usr/local, and that was all that was required since the standard reportlab build appears to look there for libraries.

Which meant that pip installed the package beautifully, complete with freetype2 (and therefore TrueType font) support. Hooray!

November 27, 2011

Harking Back


After my recent spate of “you can do mathematics in your blog” posts (I am no mathematician, but I do know computers) I remembered that some time ago I did a post about Euler's identity, and at the time the best I could do was a graphic with the equation in it. I reproduce the graphic in large format below, to demonstrate how clearly unsatisfactory the graphic truly was at higher resolution (you may notice that at this size the pixellation of the font has become clearly visible, though some browsers make valiant efforts to disguise it):



Of course I could have taken more care, and produced a higher-resolution graphic, but the fact remains that ultimately this representation cannot be copied and pasted as part of another expression, because the bitmap representation is completely unrelated to the structure of the equation. And eventually, no matter how high the resolution at which you generate, someone will come up with an application that demands more resolution. More of everything cheaper is kind of a clarion call in the computing world, and by and large the engineers have done their best to deliver.

Now, though, with the magic of TeX at my blogging fingertips, I can display the same equation (or at least the same identity: most people seem to prefer the zero identity as the canonical form, but I am persisting in my original bloody-minded mistake for backwards compatibility reasons) with ease using the TeX formula

\(e^{\pi i} = -1\)

which renders (using standard font sizes) as:
\[
e^{\pi i} = -1
\]
Thanks to MathJax, when I blow the TeX formula up it renders without the unpleasant pixellation effects of my previous attempt:
\[
e^{\pi i} = -1
\]

To me this is clearly an improvement over my original method (though I must confess that I cannot remember at this distance how I produced the graphic for the original blog entry).

Access to TeX Source

If you hover the cursor over the MathJax equation you will get a context menu from it (Windows and Ubuntu users use your right mouse button, recent Mac users use a two-finger click) and ask to see the equation source code using the Show Source option:
The first time I used this feature it was in TeX mode, and what I saw was the TeX code I used to create the expression.  On my Mac that window looked like this:
So now your mathematics can be copied by others, for example to paste into their own blogs or other papers. People can now copy and paste mathematics freely. I think that's exciting news! Of course you can also repay the favor by copying TeX source from other blogs (as well as the many excellent TeX web papers and articles) into your own blogs.

MathML Too

If, like me, you are an inveterate tinkerer then you might wonder whether it's worth learning MathML. If you already know TeX then it would appear that the answer is “no,” because MathJax can translate between TeX and MathML format for you. If you want to see the mathML equivalent you first have to change MathJax's display format. This is again just a matter of using the MathJax context menu:

If you repeat your request to see the equation source you will now see the MathML equivalent to the TeX source I wrote in the first place. This neatly gives you the answer to your question “is mathML representation much more long-winded than TeX markup,” to which the answer is “yes, and then some” but you don't need to worry about that. Just be happy that MathJax can take care of them both:

I know it is equally possible to author for MathJax in MathML, so I would assume (but have not verified) that translation to TeX would similarly be possible. You'll have to switch back to TeX mode to start seeing TeX sources again, by the way.

Experiment

Someone wanted to know if superscripts can have superscripts. The answer, naturally, is yes. You can use the context menu to examine the source.

\(e^{{\pi i}^{\pi i}}\)

How did that work for you? Welcome to the world of copy and paste mathematics!

November 25, 2011

Source for “Testing Mathematics” Piece

So to complete a fast trilogy of mathematical typesetting here, I realized that while the last post might have looked very pretty it might be frustrating to readers who wanted to see the TeX source for the examples.

So here is a pasted copy of the contents of the compose edit window, to give you access to the TeX. Note that even this does not reveal quite all the secrets, since certain quotings and the scalable fonts are implemented in the HTML editor window. But it will at least help to explain why the post looks the way it does.


I decided it would be a good idea to test out the instructions from my last post, where I explain how to put mathematics in your blog. This is fast becoming addictive, so I am going to have to sit on my hands for a while after this post.

A Cross Product Formula

\[\mathbf{V}_1 \times \mathbf{V}_2 = \begin{vmatrix}
\mathbf{i} & \mathbf{j} & \mathbf{k} \\
\frac{\partial X}{\partial u} & \frac{\partial Y}{\partial u} & 0 \\
\frac{\partial X}{\partial v} & \frac{\partial Y}{\partial v} & 0
\end{vmatrix} \]
That seemed to work, but I did notice a couple of glitches. So here are a few hints.
After you paste in the HTML, consider typing a couple of characters ("xx" or similar) as a placemarker so that you can be sure where your blog text is being inserted in relation to the script calls (the scripts should be right at the start). It's usually a good idea to lay down a marker like this when switching between “compose” and “HTML” editing modes.
If you want to put a formue just write it with a dollar sign before and after. So
and therefore $x^2$ cannot be zero
will come out as:
and therefore $x^2$ cannot be zero
When TeX inputs are copied from the web, to avoid formatting confusion it is often better to either paste into the HTML edit mode, or paste into a text window and re-copy to lose the formatting before pasting into the compose edit mode.
If at first you don't succeed, look for help among the TeX community. It is large, and many of its members are professional educators.
Just to test the application a little more throughly here are a few random examples lifted from the web. Did I mention I love the web?

Simple equations
\begin{equation}\label{eq1}
\sum_{i=0}^{i=10} \phi_i(3)
\end{equation}

\begin{equation}\label{eq2}
\int_{0}^{10} \phi_i(x)dx = 3
\end{equation}

\[
z \left( 1 \ +\ \sqrt{\omega_{i+1} + \zeta -\frac{x+1}{\Theta +1} y + 1}
\ \right)
\ \ \ =\ \ \ 1
\]

Multi-line equation

\[
\begin{align}
(a+b)^3 &= (a+b)^2(a+b)\\
&=(a^2+2ab+b^2)(a+b)\\
&=(a^3+2a^2b+ab^2) + (a^2b+2ab^2+b^3)\\
&=a^3+3a^2b+3ab^2+b^3
\end{align}
\]

The derivative is defined as

\begin{equation}
\frac{dy}{dx} = \lim_{\Delta x \to 0} \frac{\Delta y}
{\Delta x}
\end{equation}
\begin{equation}
f(x) \to y \quad \mbox{as} \quad x \to
x_{0}
\end{equation}
\begin{equation}
f(x) \mathop {\longrightarrow}
\limits_{x \to x_0} y
\end{equation}

Math with font-size set to 250%
\[
g\frac{d^2u}{dx^2} + L\sin u = 0
\]

While my testing can hardly be called exhaustive, I think I have provided as good a start as anyone could expect in the world of mathematical blogging. Good luck with yours!