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!

Just Testing Mathematics Setting with MathJax


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.
  1. 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.
  2. If you want to put a formula in-line 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
  3. 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.
  4. 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!

Blogging Mathematics

I just wanted to see if I could get some simple mathematics into this blog. Not so much for my own needs, but because my brother (who is a far better mathematician than I am, but rather less adventurous when it comes to using computers) has been wanting to do so for a while, but hasn't been able to find a suitable system.

If you want to write about mathematics you need some way to describe the formulae, as the “mathematical keyboard” does not yet appear to have been invented. The most commonly-used mathematical typesetting system is probably Donald Knuth's TEX, which provides a very versatile language for describing mathematical expressions in relatively plain text. I started my search on the assumption that there has to be some way of integrating TEX with the popular Blogger platform that I and many others use. There are other languages for describing mathematics, including a markup (HTML-like) language called MathML, and this solution can be adapted (by reading applications documentation) to handle some others.

Ideally the author should just be able to type TEX-style input and have wonderful formulae appear automatically. In other words when you want to talk about the probability of getting \(k\) heads when flipping \(n\) coins you should be able to write

\[P(E) = {n \choose k} p^k (1-p)^{n-k}\]

and have it appear as

\[P(E) = {n \choose k} p^k (1-p)^{n-k}\]

(EDIT: Formula corrected Nov 25, 2011)
Note that the \(k\) and \(n\) in the paragraph above the formula, as well as those in this one, are properly represented in mathematical notation, and therefore identifiable as mathematical symbols, because they are so flagged in the body of the text—you can write simple or complex formulae inline as well as in separate expressions like the one above. I achieved this result using the MathJax system, which uses Javascript to render complex mathematics in the browser. The really nice part is that there's nothing to install, because MathJax is downloaded by the reader's browser. I'd welcome similar instructions for other blogging platforms in the comments if readers want to help users of those other platforms.

I realize that these instructions are detailed and therefore somewhat tedious, but I wanted them to be as useful and as simple as possible. Unfortunately the authors of MathJax make a very common mistake of software authors - they assume that their readers know enough to already understand how MathJax is used on the web. The people who really need to know this stuff are working mathematicians, scientists and engineers. While they are often as smart as all get-up they mostly don't have the time to develop great insight into web technologies, and I am hoping this proves they don't need to.

As usual, however, the assumption is that users will be happy to pick up whatever skills they need to get the job done. The MathJax site has examples in it, but nothing that really shows you exactly how to get that mathematics into your pages. I hope to provide those missing steps here. Please note, however, that I know very little about TEX, and cannot help you to find representations for specific formulae. As a working computer scientist I often have to learn enough about a “foreign” system to be able to demonstrate a concept. This blog post is intended to provide no more than a simple proof-of-concept, and I will not be responsible for any limitations of or problems with MathJax, Blogger or these instructions.

The first thing to do is to make sure your post includes a couple of pieces of information. You have to insert configuration data for MathJax (there are various options you can explore once you understand its principles). You must also include a request to load the actual code of MathJax, which is conveniently stored at multiple locations on the internet under a single name—a “content delivery network” determines your closest location and sends the code from there.

There are two different ways to inject this code. The simpler way, which I have used for this post and describe here, inserts these instructions in each individual post. If you want mathematics in every post then you should consider moving the configuration data and code request into your blog template, so you do not need to repeat the insertion for each post. This more advanced method is beyond the scope of this article, but I mention it for those bloggers who know enough to be able to use it.

So, create a new post for your blog, and then switch to the HTML input mode. Copy the text from the area immediately below and paste it in at the start of your HTML input window:



(You might want to follow the final ">" with an x that you use to set the cursor after the code, which should begin the post). Then go back into standard compose mode and, as an example, enter the following text:


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}  \]



Hopefully, if all has gone well, you can now see this when you preview your blog page:

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}  \]

As I believe I mentioned, this is largely a proof-of-concept post. I can't imagine why the MathJax guys haven't published this already. It's possible they already have an application note about about this, but if not then they are free to link to this article to help their users (hello, MathJax users).

So there you have it. This could make it much easier to talk about mathematics on the web. Please let me know if anything isn't clear, and I will try to correct it until it is. Otherwise, just have fun blogging mathematics!

October 10, 2011

Amazing Mozilla Annual Report Video

I've just been looking at the Mozilla 2010 Annual Report. It makes terrific reading. But most of all I really love the video that they have brought out to accompany it. To say it's inspirational to the open source world doesn't do it justice. I have rarely seen so clear an exposition of the ideals that have led me to serve the Python community and the Python Software Foundation for the last few years.

Sure, Mozilla had problems when they inherited the Netscape code base. They have matured as an organization, and are currently clearly demonstrating the meaning of release early, release often with high-quality feature releases at frequent intervals. It makes me wish I could offer such inspiration to the Python community.

October 7, 2011

PyCon Submissions: Less Than a Week to Go!

If you have been thinking about submitting a proposal to PyCon for a talk, tutorial or poster session then delay no longer. Submissions close on October 12, so you have less than a week to make it!

The call for proposals tells you everything you need to know, so go NOW and do something you know you will never regret. It's only through the contributions of so many in the Python community that PyCon continues from strength to strength. The 2012 conference will be the tenth PyCon, and the first on the West coast. I just know it's going to be terrific.

September 4, 2011

Conflict of Interest

Wow, I can't believe how quickly DjangoCon has sneaked up on me. Thought everything was under control, but here I am printing delegate badges early on Sunday morning. Truth to tell, it's a labor of love, and reminds me fondly of the first days of PyCon when a team of volunteers including me as chairman pretty much established the way PyCons would be, setting a determined trend away from full commercial conferences and using more of the ethos of the sci-fi community conferences. We also got an amazing amount of help from the Perl community, who had established the Yet Another Perl Conference (YAPC) format some time before. This initiative was very much aligned with the EuroPython effort, begun almost a year before, which was also a community-run conference. The EuroPython organizers also attended and gave valuable advice.

In one way DjangoCon is the answer to a question I have been thinking quite hard about for quite a long time (viz how to provide sufficient value to open source communities to ensure commercial viability). My relationship (and that of my companies) with the Django Software Foundation is in essence a business one, though I believe that my long experience in open source communities allows me to better predict and cater for the demand for conferences for such audiences, and means that I know more of the people involved.

Unlike PyCon, therefore, DjangoCon is a product of my commercial existence rather than of voluntary service. The rights to the name are owned by the DSF and our Open Bastion subsidiary runs the conference (with the capable assistance of Nancy Asche's team) on the Foundation's behalf, passing back some of the profit. This makes it a somewhat different event for me, as I have to take overall responsibility for everything from the quality of the lunches to the adequacy of the network because people have paid money for the conference. Fortunately most people's expectations are reasonable. I sometimes jokingly tell people that 70% of it is adequate network bandwidth and sufficient supplies of caffeine (as always the devil is in the details).

For PyCon, of course, Jesse Noller (chairman for the next two years) is doing pretty much the same thing for the PSF, as a volunteer. Knowing Jesse's workaholic tendencies I have no doubt he will do an excellent job, but I fear for his sanity all the same (mine doesn't matter, I've been batty for donkey's years). He puts a ferocious energy into his efforts and makes amazing progress, and I know that PyCon will continue to develop and mature under his guidance.

As the conferences side of the business develops there is the likelihood of a conflict of interest. If my companies were to run Python conferences then it could be argued that these might tend to reduce the PSF's PyCon income, which could easily be construed as an abuse of my position as PSF chair. This being the case I am inclined to consider conferences about non-Python topics, but this might turn out to be cutting my nose off to spite my face. It's hard to think of ways to serve the Python community while also making a living from it.

If you have any ideas about how the two might be ethically combined I'd be interested to hear them.

July 1, 2011

Childish Behavior

A member of the PSF wrote to the Board to ask whether we thought the name of a particular package on the Cheese Shop was offensive, and if so whether we felt something should be done about it. This stimulated one of the more interesting recent Board discussions, in which we were even joined by the President (so you know how seriously such matters are taken at the PSF: normally Guido just lets Board business pass by, having many other demands on his time).

The general feeling was that the package name was offensive, but that unless we were faced with a legal request to remove content (as we have, very occasionally, from time to time, and with which we normally comply at some inconvenience to ourselves) we did not feel it was our place to police standards of decency on behalf of PyPi users. Censorship is a slippery slope, and can lead you into liability which transparency might not.

Given that I have done my best to encourage diversity, including gender diversity, among the international Python community, however, and even though I have on occasion been that guy, (as I suspect many of us have), it seems to me that if we truly want more women to feel at home in the open source software industry then we really ought to avoid giving our projects names like pantyshot. I was somewhat surprised by the name (for a piece of software that parses the MarkDown language?) until I saw that the author of that package had implemented the upskirt MarkDown parser. WTF? Perhaps I am missing something here, but when I ask Google what that means, it replies in somewhat unequivocal terms:
Upskirt is a term usually referring to up skirt photography, images of the view up a woman's skirt (as seen from underneath), including shots of a woman's underwear or crotch, or exposing her vulva or buttocks. Alternatively, an "upskirt" may be a video, an illustration, or simply a view... 
If you want to read any more I will leave you to do the research yourself. But the question it raises in my mind is: "What immature hooligan decided it would be a good idea to call a MarkDown parser upskirt?" Is that such an unreasonable question? Is there some rationale so obvious that all but me can see it?

It's coming up to July 4, so I hope that date's association with freedoms is strong enough (in American minds, at least) that the Foundation will be supported in its stance against censorship. But even though we agree so much with free speech that we will fight for your right to call your pissy little parser pantyshot or upskirt, we really would rather you grew up and called it something else. Don't you realize? Not only do you make the open source ecosphere hostile to women, you also show yourselves as hostile to the diversity of the ecosphere. That's not OK with me. Sorry.

If I am wrong, and I have overlooked some obvious (or even not-so-obvious) support for gender equality that is hidden in these package names then I would be grateful for the enlightenment. If this is just another juvenile set of geeks sniggering in a router closet somewhere about toilet language then yawn, I guess. I've got better things to do with my time than deal with that kind of stupidity.

DISCLAIMER [added July 2, 2011] This post was not intended as an official statement on behalf of the Python Software Foundation, but rather to give an insight into its decision making process. My personal distate for these particular names is heightened because it appears that the original libupskirt author's acceptance on trust of a foreign-language name for her library has caused her considerable discomfort and possibly harassment [EDIT July 12: apparently the primary issue was the way the development process was used to remove her identity from contributed code]. She apparently no longer wishes to work on open source.

June 29, 2011

Wrong About MySpace ... and What Else?

Now the the Murdoch empire's six-year trip to the shitter has seen MySpace thrown out of the group for chump change (and there's a stockholder lawsuit waiting to be tried, since arguably it has sold a 95% stake in a still very large chunk of Internet traffic) I thought we might look back and see what it was that Murdoch thought made MySpace a good buy in the first place.

At the time News Corporation bought Intermix, a minor media company whose principal property was MySpace, a News Corp. official was reported by the New York Times as saying MySpace generated "healthy" annual profits of "a few million dollars." Sadly the only way I can quote the News Corporation annual report from 2006 is to insert a graphic, since this is a company that still maintains the traditional stance to "copyright" and won't let you copy text lest you abuse some "corporate right" or "digital right" that has to be "managed". Whatever. The report said:
If ever a statement were designed to bring hubris down on the head of an errant corporation, "our company has begun to ... surpass the Internet elite" would be it. It's the corporate equivalent of John Lennon saying the Beatles are bigger than Jesus. Clearly the gods decided there and then that, no matter how wisely it was managed, no matter how exceptional the staff assigned, no matter how crystal clear Fox Interactive Media's Internet vision was, this company was doomed to failure.

The message of doom had not penetrated in 2007, though, when the most significant things said about MySpace in the report were:
Profits, improved infrastructure, broadened offerings. These are all things a growing business likes to be able to report. With increased revenues and profits on the horizon it would be, in Private Eye magazine's timeless phrase, "treble brandies all round" in the boardroom.

In 2008 News Corporation, tiresomely, and in a magnificent display of lack of understanding the Internet medium, turned to Flash for the annual report. The Flash tool was so opaque the only option was to download the PDF again. Only now I had to search it for myself. Arguably, News Corporation ought to know what "publishing" is. This is not it. Mention of MySpace is sprinkled throughout the report, with nary a sign of the coming storm on the horizon. A photo site had been acquired to compliment MySpace, and MySpace had been in partnership with this, that or the other enterprise to produce some Internet media coup or other. All very boring and normal, really.

In 2009 the trail again leaves PDF as the favored viewing option (no way am I going to listen to and watch the ridiculous glitz the Flash "HTML" version imposes on the numbed viewer). The first mention of anything that might be described as disquiet about strategy now appears:
No clue is given as to the identity of these "people" from "within the industry", but since these purport to be the words of Chairman Murdoch, we may safely assume he counts himself among their number. Charging bravely onwards we see MySpace now relegated in reporting to an "Other" section created almost specially for Fox Interactive Media (the only other company reported under that heading is an Eastern European hoarding space sales organization). And what do we read?
MySpace is just one of a number of domains in a tiny little part of a huge empire. These people have bigger fish to fry, right? Since I haven't yet seen a 2010 annual report I will decline to speculate about the level of enthusiasm, but I think even Bertie Wooster would, in MySpace's place, be feeling a certain coldness and considering a return to London's safer climes.

And now, today, comes the announcement that what remains of MySpace is to be unceremoniously sold like, well, like a business that's had all the value pissed out of it by people who don't understand "new media" and think that old media muscle is all that's really needed to weather this technology storm.

The interesting question for me is, if Murdoch could be so wrong about MySpace a scant six years ago, what other losing technology bets has he made? MySpace demonstrates very clearly that value can disappear from a networked enterprise in a surprisingly short time. News Corporation could be in serious trouble if it fails to adapt to the Internet age as Microsoft so nearly did.

March 12, 2011

Lightnings, 17:30 Saturday March 12

Eric Holscher says use ReadTheDocs, they are hosting scads of stuff for some great people. DjangDash gave birth to this fully open source project. Learned chef ass-basckwards. Heading for half a million hits a month, custom themes, tags & branched from Git with PDF generation thanks to Sphinx. Subdomains and project shortcuts will bebrilliant. They support CNAMEs. Chef is awesome. Multiple servers, because it's architected and shit. Think hard about your URLs before they become dumb-assed lame legacy URLs. Promote your project and find a designer. Open source is cool because they've had patches. You don't get arbotrary code execution rights until you are trusted. You now have one less reason for not writing docs.

Nate Aune says managing servers sucks, nobody likes setting up nginx or Apache, establishing backups, monitoring. Why don't we just have a "DeployNow" button, and that'd what DjangoZoom is supposed to to this. Copy your source code URL from github, paste it into DjangoZoom, and add a new project. Zoom inspects the .py file to make intelligent guesses about what's in there, setting it up to be served from nginx. In less than a minute, here's a django CMS instance running against a publicly-available Internet address. Now there is no reason to admin your servers for deployment, just use DjangoZoom.

Update on the Red Cross donation challenge. So far 45 definites, somewhere between $450 and $800 raised so far. If you haven't donated, please do so. A nuclear reactor in Japan has breached containment. Thngs are pretty dire. Please test REDCROSS to 90999 and then tweet with hashtag #pythoncares.

Oops, this speaker suddenly realizes this isn't the latest version of his stuff. Philikon talks about English, which started out giving us German words, then French, anwadays Finnish, Afrikaans, anything. We can manage to communicate nevertheless, and despite English being a mess the whole world manages to communicate. JavaScript's kinf ont he same. JavAScript, y u not pythonic? It's a mess. But we have all these really great apps, and slowly even replace desktop apps. JavaScript will be moar pythonic, ES5 deprecates all kinds of silly stuff. ES Harmony (much of it already implemented) will do more. Structural (unpacking) assignments, generators (stlen wholesale from Python), iterators, array and generator comprehensions, fewer parentheses, records, all kinds of great stuff. Use these features they are super exciting.

Enrique Bastos is talking about Community Bootstrap. He is deeply involved in building the Python community in Brazil, which is growing really fast, but fortunately community can scale. Why do this? If you don't have a good reason you could falll into traps like chasing an amount opf money rather than what you could experience with it. You need to live an experience to understand it, but don't rush. At first simply get people together to allow interpersonal bonds to form naturally. Don't try and build a group, hold events. People like to join in, they have a lot of events. Your community is the people who turn up at your events. Actively reduce entrance barriers by focusing on newcomers as the most important part of the community. Students are often valuable contributors. Empower people. Rules have side-effects, try to avoid them but discover your principles. Shirts are available with the Brazilian group's ten principles.

Jacob reminds us that daylight savings time begins tomorrow, and that iPhone alarm clocks will not work tomorrow.

Barry Warsaw confirms we all internationalize our applications, right? (of course we do). The flufl.i18n module helps you much more than gettext. Doing stuff with this is pretty difficult. Mailman 3 has some internationalization stuff, which has now been refactored out of the project for standalone us. You can find catalogs using the built-in strategies, or write your own. You can build stacks of languages and query the state of the stack.  Adaptable, it's on PyPI and Launchpad, available now. I think that FLUFL thing has gone to Barry's head.

Aron Grifiths (sp?) wants to tell us he's been through a series of Window managers pretty much like us all. They are either not scriptable or you have to write complex things like C plug-ins. Tomorrow's window manager won't use today's plug-ins. PyWI allows you to program your WM in Python, sand focus in any direction, do all kinds if wonderful stuff. Nice screencast to finish.

Josiah Carlson is talking about Over-Engineering for Dummies. This means either over-building a system or service. RUle 1: write everything yourself. Under no circumstances use convenient modules that do exactly what you want. 2. Start with something completely unsuited to the task; like the professor Josiah knew who build Prolog on top of Scheme, or the guy who added distributed counters to Cassandra. 3. Keep adding features and functionality and so on until no-one can think of anything else to add. 

Grace Law wants to tell you how to get that job you want. Lots of really qualified people don't get the jobs they want, Grace is here to help. Insight into some and interview questions and answers. Employers are looking for hidden remarks. Unintentionally disses QA people to ribald amusement. Be able to talk about learning new things - the more complex a technology you are learning the more impressive that is. Build open source projects and offer to discuss the code. You have initiative, take actions, and undertake complex projects for fun. Poor speed of answers to questions can give a bad impression. Tips on job search, see Grace.

Thanks to all speakers and, of course, Jacob Kaplan Moss.

March 11, 2011

PyCon Lightnings, 17:30 March 11, 2011

Session starts almost 20 minutes late - looked to me like logistical problems with the stage change, but I am so far out of the loop and the people in charge are so competent that the best thing I can do is start the post and wait patiently like everyone else.

I am sitting with Titus Brown and Peter Conerly, who are discussing matters of great technical moment. It's Peter's first PyCon, and the opening announcement is the every lightning slot in the conference is allcoated.

The opening talk is a request for PyCOn to raise $10,000. If 1 in 5 gave $10 each ... Text REDCROSS to 90999, then tweet that you gave with hashtag #pythoncares. End of talks on Sunday we will get a count.

Next speaker's display isn't working. Awkward pause. Silent audience. I am hoping things soon run more smoothly for Jacob (Kaplan Moss, the evergreen sprint chair who is here for the first time as a gentleman farmer).

Jeff Daily talks about Global Arrays Parallel Programming Toolkit, that added Python bindings to it toolkit in the last year. It gives access to a high performance computing array, giving access to distributed numpy-style ndarrays. Compared with other models, Global Arrays is less general than some techniques, but it scales well to at least 200,000 cores. This finally achieves highly parallel programming with true Python programming ease. Much simpler than message-passing interfaces, the technique is extensible and scalable, but requires that algorithms acknowledge the need for data consistency. If you're at PyCon, see Jeff at Poster #13.

Matt Harrison talks about his geek inferiority complex. He bought a computer at Fry's because computer class at school was too full. For years now people have been declaring "the year of Unix". Linux people run stuff like Gnome and KDE and a tiny set of other window managers. This guy inhabits a pretty specialized point in the Linux desktop fractal space, a rarified atmosphere in which indexing by 1 is awesome. And still we get more specialized. Matt's wrists forced him into this (in)sanity by screaming when he tried to pick the mouse up. Impressive demonstration of driving a window manager from the keyboard ensues, and lo! relevance: the QTile window manager is written in Python and is scriptable: now windows are flashing on and off in four different virtual screen. 2 further users will amount to exponential growth in the user population. Please join him.

Pete Fein wants us to hack for freedom. Video of protesters, under attack by flame throwers, getting pictures out through cellphone. Pete explains how he has helped freedom by getting stuff out on the street in 105 cities in a week. He worked with telecomix.org to help keep sites up and services running. They are leaderless and fanatically devoted to freedom. When the net was up they provided encryption and other services, mirrored censored sites and manually relayed tweets for egyptian users with no network access later. With Anonymous they set up a network to send information by fax, and by injecting information into logs of a few servers they found still up. It can be exhausting working for freedom, but we have the power to help people achieve it.

Next speaker (fumanchu at aminus.org(?)) not using his own laptop, another pause but we are now seeing images. No, gone again. Back again. Go. Logging. Really? Yes, because all the modules in your application can use the logging model independently, but this isn't applicable for things like performance statistics so that independent modules can log performance data and report on it. Solution: log into Python dictionaries, with package names as the top-level namespace. You can define record structures, and (for reporting only) can insert functions into the dict to be used when reports are required (writing the log should be high speed, so no function calls). This allows people to build their own reporting tools, or to user ready-made ones such as the one built into CherryPy. Open Space tomorrow.

More AV glitches as the next speaker arrives, then departs so I have no insight into the problem. Ah, they need a VGA dongle for a mini-display port. Strange, PyCon normally has this stuff buttoned down. I hear someone say "waht are the odds" and don't know whether this is a good sign or a bad one. BVideo at last appears, and Nathan Nichols wants to tell us some lessons he learned writing automated content generation systems using DSLs. Clients send data, they create quality content for it. Journalists are needed but hey they don't know Python. So instead use DSLs. Rules: 1. Keep Parsing Simple, Stupid (PyParsng was overqualified for the job, regexes and YAML serve better); 2. Keep things on rails (no, not Rails - Nathan knows his audience) and remember that while we think Python is awesome journalists don't and would be overwhelmed by its complexity; 3. Tools are super-important, and DSLs allow you to write very specific tools. Good talk.

Another pause, this time to load the next presenter's files ont he same laptop. It's Giles Thomas wants to tell us why Resolver Systems switched from IronPython back to CPython. Resolver are known for their eponymous spreadsheet, which is quite clearly a windows application. They now have a new project, Dirigible, was written for the web to provide similar services. The initial strategy of marketing to financial companies, and Windows was mandated bh the conservative nature of the client base. So Resolver 1 was a full .NET application. For Dirigible, CPython was the natural choice since none of the .NET stuff was required.

The SingPath competition is about to start somewhere close by. More lightnings in the morning. Awesome day 1!

Supporting All Versions of Python All The Time With Tox

This talk actually used the differences between Python 2 and Python 3 as the major version differences, but these are just an extreme example of inter-version differences.

Tox uses a config file that allows you to specify (among other things) which Python versions should be tested, dependencies between tests and so on. But how do we cope with syntax differences, where(for example) Python 2 code will raise syntax errors. The 2to3 utility is a fast and very comprehensive tool, and you can test for Python 3 and run 2to3 automatically in your setup.py.

It is possible to generate a single source file that compiles under both Python 2 and Python 3, but this is not easy. Often it's easier to convert - particularly for tests, where automatic conversion may not work. Tests may be distributes or non-distributed. In both cases converting the tests to Python 3 is likely to be required. Automated conversion is always subject to failure.

It's possible to use different environments (virtualenv) for the different versions, and even with Jython. Although tox can be used from the command line, it was designed for use in continuous integration. It does need to be bootstrapped a little bit: it should be installed locally (probably under a virtualenv!) You can also define a custion PyPI index.

Summary: the most important thing is to be able to support Python3. The single source approach requires most discipline. Mozilla is hiring. Had to leave the Q&A to start a meeting. Sorry.

JavaScript for Pythonistas

My first extreme talk, and Ian Bicking is always worth a listen. Because it's extreme, no intro to JavaScript. "It's a small, simple language with some weird things that are totally understandable." Ian wants to focus on what the language does rather than why it does it.

JavaScript is easily accessible to Python programmers, but the data structures can be tricky. Arrays are like Python lists, objects are like Python dicts. Objects can be fairly lightweight, and can be passed around. Keys are always strings, -- subscripted notation and attribute notation are equivalent. Exceptrions work very similarly to Python, but JavaScript programmers don't use them anywhere near as extensively.

Function declarations are fairly intuitive, but unlike in Python an undeclared variable is assumed to be located in some "containing" scope, and the var keyword causes them to be bound locally. Function arguments are always optional, and parameters for which there is no corresponding actual argument will be undefined. Undefined is "falsish", and we have to use typeof(name) == "undefined" to test for this.

Object classes are created by prototype, which is more like Self, or perhaps Ruby, than Python. The new operator is the only way to effectively create new instances. A function call implicitly binds to the variable this, but without new the binding will be to some global object (in a browser typically the document or the window). The inheritance hierarchy is handled similarly to Python except that instance creation calls the prototype function using new. It's not, therefore, as simple to use factory functions and classes interchangeably - though it can be done if you work.

The this object is almost comparable to Python's self, but the way JavaScript figures out what value it takes is, Ian submits, insane. With no equivalent to Python's bound methods, and method calls are determined syntactically. Consequently assigning an object's method to a local variable will cause this to be computed completely differently depending on whether the method is called directly or through the local variable. This is also problematic when closures are used to create private data stores. You can sometimes overcome it my saving this for later use (Ian chose the name self for the local variable he used to do this).

Functions have .call() and .apply() methods, whihc you can use to call them in specific ways.

Monkey patching should be avoided.

Types are one of the aspects of JavaScript makes least sense to people. It has numbers, strings and Booleans. The language also has the same kind of distinction between primitive and boxed values that Java does. There should really be no need to use the classes that wrap the primitive types. This gives rise to strange non-intuitive rules that are applied during comparisons. The "===" operator is similar to Python's is.

Arrays are disappointing to Python users, being a pale shadow of the Python list. There is not iteration protocol, and no test for containment of a value within a list.

Much of JavaScript's applications work on the browser Document Object Model (DOM). C++ is responsible for the DOM's complexity. The language is improving, but the new features are only slowly working their way into implementations. Many newer features have been inspired by, among other languages, Python.

If you like Python, you might want to try using CoffeeScript. It is more whitespace sensitive than Python, and handles arrays better than JavaScript.

Alas, time for only a few questions:

Q: What do you recommend as the closest equivalent in JavaScript to Python's interactive console. A: Firebug and the like.

Q: What does inheritance look like with prototypes?
A: If a prototype has a prototype that is essentially subclassing.

March 1, 2011

Promoting and Supporting Open Source

I was a little surprised today to discover that my Twitter buds mostly hadn't heard I had moved to Portland, and when I thought about it I realized that blog readers had no way to know either, since although I have been talking about the move a lot I have been too busy to write about it. This condition still holds, really, so this is a sketch for now.

In order to engage the Portland business, government and open source communities I organized a reception a couple of weeks ago, which also represented the announcement of a new business, The Open Bastion. As you can see from the web site we are still in well, not exactly stealth mode, but it's early days yet. I am happy to say that the reception appears to have started many conversations abut open source, which I will be following up on as they develop.

Why Portland? Well, I have been feeling the pull of the West coast for some time, and have visited Portland quite a but recently, including running DjangoCon US there last September. So the plan for the new business is to organize and run technical events–conferences, presentations, training sessions. There is also a very active Python user group here, which I attended shortly after my arrival in the city as one of about forty people there that evening. Portland likes to think of itself as the open source capital, but I want it to put its money where its mouth is.

Portland, being a conference city, is marvelously well endowed with venues. I am happy to say that it appears to be a city that values its heritage and it still has many fine original buildings, which makes the place a pleasure to walk around. With excellent public transport (including a fare-free zone in the center to discourage the use of private cars) it's a wonderful place to live and to visit, and I am looking forward to spending time here.

I will be keeping in touch with the East coast, too, by spending roughly a  quarter of my time in New York, where I expect technical events will also be required. We are, of course, equally happy to help you with events in the location of your choice. So if you are thinking about running a technical sales presentation, or a conference, or any other similar sort of event and you would like someone to take the organization off your hands, drop me a line. I am "sholden at theopenbastion dot com".

Community or Fanbois?

Regular readers will know that I place a lot of stock in community. I started PyCon, the US Python community conference, which has taken off worldwide. In earlier incarnations I was chairman of the Sun UK User Group and Treasurer of DECUS UK. As chairman of the Python Software Foundation I spend a lot of time thinking about how to engender community spirit and encourage people to contribute to the Python language in any way they can. This is an ongoing battle, but I do think that the Board is showing signs of understanding how to involve people, and also that the Foundation relies on the involvement of third parties in order to achieve most of what supports its mission.

In my own life, I have recently decided to become (even) more involved in open source, hopefully to the extent that I can make a better living at it - the PSF chairmanship is an honorary position and takes time away from business matters. So I have moved to Portland (whose natives frequently refer to it by its PDX airport code), and recently hosted a reception to get PDX open source people together with elected representatives and business people with the intention of starting new conversations about how each can benefit the other. I am hoping that the move will allow me to work in a more sympathetic environment, and one in which the potential of open source is more clearly perceived.

So anyone who cares to look should be able to discern that I am at least fairly serious about Portland and its open source community, and working towards improving things for the open source community (on the theory that a rising tide lifts all boats). I have found in the past that it's generally possible to share plans with open source community members and have them respect the sensitive nature of the information you have shared with them. This is one of the things I like about working in the open source community: generally speaking (and with the occasional unavoidable exception) people are willing to respect your concerns, and are generally much more concerned about producing good software than scooping each other on news of features and the like.

The people I meet in the open source world are generally responsive to new ideas and quite willing to discuss them. Generally speaking people are both willing and able to discuss the work they are doing - after all, it i going to be published, so there is little point in secrecy. Contrast this, however, with the brouhaha that arose today about the latest version of Apple's OS X operating system. It seems that Apple shared a beta version with some developers, who have naughtily (and anonymously) disclosed what purports to be real information about what Apple rather grandiosely term "the world's most advanced operating system". To which  my reply is a snort of derision, since I think that Mac OS X is actually in some ways inferior to Windows.

It turns out that they really don't like it when engineers who are given access to a pre-release (in this case OS X Lion, the forthcoming 10.7 release) copy and then promptly spill the beans to all and sundry. But frankly these look like small beans indeed. It seems as though Apple has tweaked quite a bit, but hasn't introduced any fundamentally new features into the operating system.  It's all very well for Apple to delight in being different, but the radical differences between Apple's GUI and everyone else's just don't seem to actually make using the computer any easier, and leave me wondering whether Apple is really heading in the right direction.

Whatever else they may have going for them they certainly don't seem to have engendered a lot of loyalty in their fan base. Or maybe this was just a few bad apples (so to speak).,

February 2, 2011

Less Than One Week to Become an OSCON Speaker

Remember that the OSCON call for papers closes on February 7. My attempts to add more Python skills to the assessment panel have resulted in three new Python-oriented members (including myself). There really is room for Python to expand this year, so don't be shy.  Submit your talk now!

February 1, 2011

Lanyrd Already Awesome, Likely to Improve

Interesting news today that the company behind lanyrd.com is to receive attention from Paul Graham's Y Combinator. This is excellent news for a company whose product is already awesome (and written in Python, naturally, or why would you be interested).

I really get the feeling that Python is gathering momentum, and can't wait to see how well-attended PyCon is going to be this year (remember: attendance is capped this year).

January 28, 2011

PyCon: No Dead Kittens This Year

What, me, harm an innocent kitten?
Last year I was perhaps a little over-enthusiastic in suggesting that if people didn't sign up for PyCon then kittens might be harmed. After a certain amount of retraining at the hands of the ASPCA (who may be kind to animals but surely know how to chastise a recalcitrant human) I am sadder but wiser, and will be threatening absolutely no more tiny harmless furry animals. People misunderstand one's motivations so easily.

Anyway, the purpose of this post is to bring to your attention the fact that for the first time this year places at PyCon US are limited. There is a boat, and it's sailing, so if you want to be on it make sure you proceed straight to registration. Proceed directly to registration. Do not pass "GO", do not collect $200. Why are you still reading this? Didn't I just tell you to go straight to registration?

It is true that registration will have to increase somewhat (about 30%) over last year for the cap on places to be reached, but PyCon has had a growth spurt like that before, and places are definitely selling earlier than they did last year. And why should this be a surprise? After all, Python is one of the faster-growing programming languages at the moment. I have an idea there might not be many last-minute places available this year.

If you or your employer is looking for greater visibility among the Python community PyCon is by far the best place to achieve it, and there are still sponsorship opportunities available. Go to it!

And yes, I have already booked my place. I got the early bird rate. You'll have to get there earlier next year ...

January 23, 2011

Too Busy Writing About Python to Write About Python

Though the subject line of this post might seem self-contradictory it does in fact reflect why I have blogged relatively little of late, and particularly to the Python channel. I became something of a hermit towards the end of last year to put the third of a series of four Python classes into production with O'Reilly School of Technology.

Given that each class is required to represent the approximate equivalent of forty learning hours, I think we can agree I have been writing about Python. Just not in my blog.

Anyway, this leaves the fourth class, which will complete the basic certificate series. So now I have a somewhat different problem: in this last class I want to focus on making sure that successful students have all the fundamentals in their grasp as they set off to earn their livings or indulge their hobbies hacking in Python. I need to wrap the language up--encapsulate it, if you will--in a way that gives students confidence that they understand the whole thing.

In the past, various denizens of comp.lang.python (python-list at python dot org) have offered to help by reviewing existing materials, but I haven't yet cleared that with O'Reilly. Since I suffered some data loss around Christmas time those addresses aren't currently available to me, but I am hoping if I post a link to this article those who are still interested will make themselves known by commenting here.

If you have anything to add, dear reader, kindly do not hesitate to comment yourself. What bits or bits of Python could you absolutely not bear to be without? Techniques, patterns, representations, algorithms and documentation are all grist to the mill. Favorite pieces of code, and even descriptions of warts (but remember, this is a Python 3 class). Tell your friends, invite the gang around, wire in, have a party.

It would serve students well to have as many external links in the last class's lessons as possible, I think, as well as to offer rules of thumb and handy hints. All contributions making it into classes will be appropriately acknowledged.

Once the series is complete I then have to think about what other topics I might tackle. Or should I take a rest and blog a bit more?

Disclosure: the author of this blog will benefit financially from sales of the courses mentioned above.

January 21, 2011

Serious Python Conference Information

Just in case the world needed reminding how active the Python conference world is, I did a search for Python conferences on the lanyrd.com site. At time of writing the query returned 84 conferences in the last couple of years. This is gratifying, but I am pretty sure it's only the beginning.

Answering My Own Question

If I had paused a little longer, or perhaps even taken a slightly fuller screen shot, I would have realized that my original capture was not of Twitter's @holdenweb home page (which is actually shown above, complete with tweet input widget—though it will link to your Twitter home page, as I don't know how to send you to mine; I don't know what you will see if you don't have a Twitter account, but most likely a sign-up page). In fact the previous post shows the @holdenweb profile page.

Never too old to learn, and never (apparently) too old not to need to. Thank you for reading. I now return you to your normal programming.

Wossup, Twitter?

A screen shot of today's @holdenweb Twitter home page
Maybe I am such an old fart that something is staring me in the face and I can't see it, but the "new Twitter" interface in its current manifestation is giving me plenty of reasons to consider usng a third-party application. Where do I enter my tweets?

January 18, 2011

Python at OSCON 2011

The OSCON organizers have asked me to help them recruit more Python talks there this year. It seems that maybe PyCon is the principal venue for those who are already using Python, but there is a vast audience of people who are interested in open source but not necessarily yet committed to Python, and such people are much more likely to attend OSCON, which runs July 25-29, to stay in touch with a range of open source technologies rather than ust Python alone.

Unlike PyCon OSCON is a full commercial conference. Tutorial speakers get help with their travel as well as an honorarium for talking, regular speakers get a free regstration. Both times I have attended I have managed to cover the majority of my costs. And, of course, OSCON is back in the wonderful city of Portland for the second year after a brief flirtation with California. It's a great place to visit, and by the time the conference comes around I hope to be living there.

If you are interested in going one further and would like to join the team that puts the Python syllabus together then drop me a line or simply make a comment here. That's another way to pay your way to OSCON!

The Future Has Arrived

So, after a very nice lunch I am sitting here typing this blog post on my MacBook Air (a device well beyond the limits of the imaginations of most of the science fiction writers of my youth) using a device which I invented three years ago, as I imagine did many other switched-on technologists.

Fortunately unlike most of us Novatel wireless went a bit further and actually built what Verizon are marketing as the "MiFi". It's a device about the size of a credit card and maybe just over a quarter of an inch thick incorporating a cellular broadband wireless router and an 802.11b/g wireless interface.

So to get Internet-connected all I have to do is switch it on (the only control is an on/off switch) and my laptop associates with it and is immediately connected to the 'Net. Not only that but the connection can be shared by up to five wireless devices, so my lucky pals will also be able to take advantage of the connectivity.

As far as I can see the MiFi is a sensible little device that is destined to become the preferred way of accessing the Internet. I hope that coupled with solar chargers it might also help African and other less-developed nations to build a viable Internet infrastructure (not that this will necessarily be their most urgent need).

Quite where this leaves the plans to enforce an Internet ban on copyright offenders in the various jurisdictions of the world I have no real idea. Technology sometimes makes fools of those who would control it, and it is only a matter of time before the MiFi or something similar is available as a "pay as you go" service to all comers.

Equal-opportunity (network neutrality) is an excellent ideal. The problem is with those who would abuse their power to change the laws unfairly to their own advantage, and those who stand idly by as their rights are eroded. The Electronic Frontier Foundation is celebrating its 20th anniversary in 2011. Celebrate the new year by joining the EFF or at least making a donation!