February 14, 2007
Are Viacom Threatening You?
Obviously each of these notices would be meticulously researched, which is why some of them were completely unconnected to the corporation or its content. If you received a notice you feel is unfair and you need help you can contact the Electronic Freedom Foundation for help.
It's time that media giants stopped abusing their position. Once they do that we can address the issues raised by their blatant manipulation of the political process in their favor. If they had their way there'd be no fair uses at all for their content other than paying for it before any use at all.
February 11, 2007
Five Years as a Blogger Tomorrow
Why couldn't this wait until tomorrow? Because that'll be my last full day in the UK for some time - we are moving back to Virginia and I very much doubt I'll have the time to be writing blog entries as we have to get the cats to the airport and various other mundane but necessary tasks. I'm not looking forward to the joys of a 5:50 am flight out on Tuesday, but can't help being excited at the prospect of this return.
February 4, 2007
The Purpose of Advertising
"The winners, I think, are the agencies and the pundits and those that would like advertising to be more than it actually is."He makes the point that advertisers are more interested in creating a short little movie that spreads - which if you think about it is exactly what everyone on YouTube is trying to create.
Bloggers are trying to create compelling writing that holds the interest of a (probably quite select) group of readers. Is this the same thing? Not really, in my view. Most bloggers aren't doing it for the money, but to promote their opinions and share their knowledge, but there's still the desire to promote a particular point of view - even if successful promotion doesn't result in the reader buying something.
While there's always a chance that a successful blog will attract enough readership to make advertising a money-earning proposition most blogs aren't going to be popular enough to attract advertisers. Yet still their dedicated authors keep pushing out the material. Just like I do, I suppose.
For some reason a number of posts were stuck in the blog as drafts. This one is from February 2007.
January 27, 2007
So You Want To Help the World?
If you would like to help others less fortunate than yourself PyCon gives you a great opportunity. I have been corresponding with Oouc, who says:
Thank you greatly for your interest. People in the disaster area, especially Nias, have had their old way of life destroyed. Many are now beggars because their type of employment before the tsunami and earthquake 3 months and 2 days later is gone. The March earthquake destroyed 80% of the buildings and killed many of the business leaders because they could afford to live in large heavy concrete houses.The tsunamis have left large communities without visible means of support: lines of communication have been cut, buildings have been destroyed, coastlines have changed (sometimes by over 50m/160 ft) and livings have disappeared. If you would like to help people who have been thrown into turmoil through no fault of their own then consider signing up for the sprint, or getting in touch with Oouc at the conference (as I intend to) and offering your help.
Their primary need is jobs. But before the tsunami/earthquake the great majority were poorly educated tribal language only gatherers in the cocanut and rubber tree plantations. They need practical education in the national or international language if they are going to have a real life after all the results of their old way of life has been destroyed.
The Internet has a wealth of Public Domain materials which could help accomplish this education but it is not accessible to these people. I have an expenses only, no salary, grant to grab these Public Domain materials, put them on a local server and LiveCD's and make them available to Nias and Aceh residents in the original language and in translations to their national and tribal language. Decades ago, I was called "the impossible man" by a translations society because they were repeatedly told by computer scientists that something was impossible but I never failed to do what they wanted. Now most of my time is spent helping others and I cannot even do what I want to do. The sprinting or distant programming help of any Python programmer who can develop almost anything for education would be helpful.
I joined a sprint on a dial-up connection half way around the world last year and was able to benefit much more than my small contribution.
People who want to help should look at http://us.pycon.org/TX2007/EducationalSprint and the two links on that page. If they will give me their name or handle, abilities and interests; then eMail to me or leave their contact info on the wiki then I will plan to use their abilities and turn the sprint more towards their interests.
January 23, 2007
Lots of PyCon Good News
Sponsorship is also on the increase, and I am delighted to have exceeded the target that the co-chairs set me when they put the budget together. This is the first year we have attracted five Platinum-level sponsors. Thanks to everyone who is supporting the conference in this most practical of ways. I hope all my readers will take the time to follow their links at the right-hand side of the PyCon web pages. It's also not too late to sign up as a sponsor - where else could you get your organisation's name on the web next to both Google and Microsoft?! The details are here.
On a personal note the database API tutorial is going ahead. The lower numbers this year should allow time for questions and personal tuition. I'll have to get working on the slides and examples now!
January 18, 2007
Things You Don't Expect
The answer finally came to me after a minute's puzzling: it's the very first Google server error I have ever seen. Given the amount I use Google and the scale of the service they now provide I think that says a huge amount about the quality of their engineering.
Python Everywhere ...
The device in question is 1.62" x 1.24" x 0.14" (41.4 x 31.4 x 3.6 mm if you must) and it runs Python!
The news about Autodek's adoption of Python for Maya now also seems to be getting around - three more news pieces listed in my Google alerts today.
Python 3.0 Alarmism: Pay No Attention
In an earlier thread on the proposed bytes type, I expressed to Guido my feeling that it's important the development of 3.0 doesn't fragment the community in the way suggested by theand asked him whether there were plans to discuss 3.0 with implementation teams from the versions other than CPython.
Yesterday there were some rather alarmist comments by Calvin Spealman, suggesting it's at least possible that the sky is falling and that forks are coming. One quote from Spealman's blog is revealing: "What few ideas I do have towards avoiding the problems are not well thought out, probably are missing vital information, or are simply stupid." You said it, Calvin, and I'm not convinced that your approach was the most helpful one you could have taken. Fortunately our technical blogs don't usually make the front pages of the Washington Times - I have been known to suffer from foot-in-mouth myself.
Now I see that Chas Whitacre has also read Spealman's blog and is looking for advice in whether to adopt IronPython. He says "So what would really help me would be posts demonstrating the respective market shares of the various Python implementations, and resources detailing the differences between them". This is a reasonable request, but I have a nasty feeling that these two blog posts between them will spark alarm, that those with an axe to grind will jump in gleefully, and that a shitstorm will result.
Guido replied off-list, so all I can say is that he has confirmed that the upcoming PyCon represents a great opportunity to address these issues. In fact, though, the situation today is already somewhat fragmented. Jython support appears to lag at least a release-and-a-half behind and IronPython and PyPy are currently (as far as I know) still targeting 2.4. Just the same they are all implementing Python, and that's the important fact to keep in mind.
I believe it's necessary to try to ensure that all implementations are encouraged to stay in step with the reference implementation (which at the moment remains CPython). Even if this proves difficult and they don't all make it to the promised land of 3.0 their users will still be better off running 2.3, or 2.4, or 2.5 than using other, less useful, languages. Microsoft managed to break compatibility on Visual Basic without the world coming to an end, and the user community involved there was enormous, so let's not pretend that this is any more than a storm in a teacup.
Of course the information that Chad Whitacre asked for would be both interesting and useful, so if anyone has information to share (preferably facts rather than opinions, but I suspect few can be discovered) I would love to see it posted, here or elsewhere. One fact I can give you is that Python's popularity continues to grow. As Python is now integrated into most popular Linux/*nix distributions (and indeed scripts many of their installation routines) a much larger percentage of the downloads are for Windows than was the case a year or two ago. H-P now installs Python on their Windows PCs to help script their installs, so the movement towards world domination continues. You can even run Python on the Nokia 700 web tablet. This is a fundamentally healthy situation.
January 15, 2007
Anders Langlands, R&D lead at The Moving Picture Co. (MPC) and Maya 8.5 beta tester, commented: "Having Python support available in Autodesk Maya means we can leverage many of our existing tools directly within Maya, rather than having to write glue code to bind Maya to our pipeline. This allows us to develop new node and command plug-ins in a fraction of the time it would normally take using other solutions."
I already knew that Python was popular with companies like ILM and Pixar, but it seems as though its value in animation is now an open secret.
January 14, 2007
No Database Tutorial?
So, if you were planning to sign up later you should swell the numbers by doing it now. That would be a good idea anyway, as Early Bird registration is still in force for a few more hours - until the end of Monday! In fact, forget the tutorial -- if you want to go to PyCon then register now! It has to be the most cost-effective Python conference on the calendar -- and I'm not just saying that because of my own affiliations with the conference.
January 4, 2007
PyCon Sprints: Hotel Misinformation
To the best of my knowledge the agreement with the hotel is that rooms will be bookable at the conference rate even after the PyCon guaranteed allocation is used up, and indeed as long as rooms continue to be available. So persist, and if necessary call 1-800-228-9290 to demand the room rates that PyCon delegates are entitled to.
Thanks to David Goodger for the appropriate extract from the contract. I wonder if Marriott need some help with their information systems? I bet they aren't written in Python!
January 3, 2007
Questions for Python Developers
Besides the database tutorial I am presenting on the Thursday before the conference proper, I am also acting as moderator for a panel where Python developers will answer questions, some of which will come from the audience. Is there anything you'd like to know about how Python is developed, what the general philosophy is, or what it takes to become a committer? The broader the scope of the discussions, the more interesting this session is likely to be. If you would like to add your own question you can do so on the PyCon web site, and I will be happy to include it.
If you are so technophobic that you aren't comfortable editing a wiki page then you can add a comment on this blog, but since that would involve clerical work on my part I can't guarantee that channel will operate as effectively.
It's interesting to see what an organised conference PyCon has become under Andrew Kuchling and Jeff Rush, this year's joint chairs. I still remember wondering whether the first one would cover its costs after I had casually predicted that the community could run a better conference than the commercial organisers who had run the IPC series before it. So far each PyCon has made positive contributions to the Python Software Foundation's coffers, thanks largely to the generous sponsorships we have attracted.
Since I am responsible for administering the sponsorships, and since there are a number of people whom I need to correspond with quite urgently I had beter get back to that task. If your organisation would like to help by sponsoring the conference, please visit this page or drop me a line.
January 1, 2007
The SuperVillain Test
Happy 2007, everyone!
Oh, no, what a way to start a new year. I am Lex Luthor
| Lex Luthor | 62% |
| Dr. Doom | 57% |
| Kingpin | 55% |
| Green Goblin | 52% |
| Mr. Freeze | 46% |
| The Joker | 39% |
| Apocalypse | 34% |
| Riddler | 33% |
| Poison Ivy | 30% |
| Catwoman | 29% |
| Mystique | 28% |
| Magneto | 27% |
| Venom | 21% |
| Dark Phoenix | 12% |
| Juggernaut | 12% |
| Two-Face | 12% |
| A brilliant businessman on a quest for world domination and the self-proclaimed greatest criminal mind of our time! |
Click here to take the "Which Super Villain are you?" quiz...
Then again, looking at the other options maybe Lex Luthor isn't so bad ... at least the guy has some charisma. Overall I suspect I'm just not really supervillain material.
December 30, 2006
The SuperHero Test
Your results:
You are Iron Man
| Inventor. Businessman. Genius. |
Click here to take the "Which Superhero am I?" quiz...
W'appen?
December 29, 2006
Noteworthy?
Acknowledgements of any sort are encouraging, though. Like the old saying about bad publicity, for a minor blog there's no such thing as unwelcome atttention! So many thanks to whoever at Blogger (Google) put me on that list and to anyone else who happens to read this blog.
Because of the linkage I suspect that a small spike in readership is likely to occur, so let me take this opportunity to wish all fellow-members of the blogosphere (dreadful word) and all Holden Web customers a happy and prosperous new year. 2006 (and especially the latter part of it) has been somewhat traumatic for various reasons, so here's hoping for a smoother 2007.
Finally, while I have your attention, let me point you to Pass IT On, my favourite charity. Martha and Sandy's dedication to their goal of providing computer equipment to the disabled is single-minded, and I wish I could do more to help them. If Santa Claus has brought you a new computer please consider donating your old one. They also need cash support to help them become a free-standing organisation this year, so you can give them money if you don't have a computer to spare. Good luck to all at Pass IT On.
December 18, 2006
ZFS: "Probably more abuse in 20 seconds than you'd see in a lifetime"
Brett was simply happy that Apple announced the inclusion of ZFS into the Leopard (OS X 10.5) distribution. I was interested because Sun developers were taking an interest in advanced filesystems even back when I used to work there - they produced the Translucent File System (TFS), which was a copy-on-write mechanism to allow users to share a common source pool and keep their own changes.
One of the problems with TFS was its need for kernel integration (in those days even the windowing system was integrated into the kernel). Another issue arose when a user base their TFS on another TFS which was based on a third TFS which ... effectively it implemented an copy-on-write inheritance mechanism, but efficiency could drop quite rapidly with multiple layers.
Unlike TFS, ZFS can run in either kernel or user mode, and the nightly testing appears to twist the filesystem in every possible direction simultaneously (hence the title of this blog entry). Here's a list of what goes on in parallel in each nightly test:
? Read, write, create, and delete files and directories
? Create and destroy entire filesystems and storage pools
? Turn compression on and off (while filesystem is active)
? Change checksum algorithm (while filesystem is active)
? Add and remove devices (while pool is active)
? Change I/O caching and scheduling policies (while pool is active)
? Scribble random garbage on one side of live mirror to test self-healing data
? Force violent crashes to simulate power loss, then verify pool integrity
So, it would appear that ZFS is a worthy successor to TFS and much more besides, as you will find out if you too read the slide show. I haven't looked at the license yet, but it does appear that under Johnathan Schwartz's direction Sun might be beginning to find its way in the open source world of the 21st century, despite the amusing graphic that Eric Bangeman produced when Scott McNealy resigned. Maybe I should buy some stock again. Maybe we all should.
December 12, 2006
Lies, Damned Lies and Baggage Claim Call Centres
I flew from Edinburgh to London Heathrow, then onwards to Washington Dulles where I was incorrectly instructed to enter the USA through the transit lounge. Since my flight to New York's La Guardia was on a separate reservation and my bag had only been checked through to Washington this put me in the wrong place to reclaim it, and trriggered what I would call a comedy of errors if there was anything the least bit funny about it. My bag and I were both in Dulles, but United were unable to reunite us. I was initially assured that the bag would join me on the flight to La Guardia but, inevitably, I arrived and it didn't.
So I registered a claim and went to my accommodation. It took forty-eight hours and ten 'phone calls before I was finally able to wear the clothes I had brought with me. For most of that time United's web site was telling me that the bag had been found and that it would be sent to New York on a non-existent flight shortly before I landed at Washington!
Talking to other travellers, the general impression is that baggage "help" lines are uniformly bad. My own experience was certainly terrible: I could easily have believe that there was no computer-based information system at all behind the scenes, as the different people I spoke to gave me completely different and inconsistent stories each time I called. The responses almost seemed calculated to inflame. I was particularly incensed by a conversation with one woman who, when I called back as requested after waiting two hours, insisted that I had only called thirty minutes previously, and that I should wait until next morning before calling again. It's not usually considered good customer service to call the customer a liar. The different stories I was told about my luggage might as well have been chosen at random.
Under these circumstances the airlines would do better to dispense with the call centres completely and replace them with a recording saying "Our staff are working to restore your lost bag. Thank you for your patience". This would be less irritating than the nonsense I had to put up with, would have taken up far less of my time, and would hopefully reduce costs and allow the airlines to invest a bit more in relocating and delivering lost bags.
And now, if you'll excuse me, I have to send a claim for reimbursement to United.
December 1, 2006
Blogger on a Nokia 770
One rather strange feature of the interface seen through the Nokia is the invisibility of the title field. I see in the postings list that I've somehow managed to call it JU, but I really can't see how to change it. Maybe I'll change it later.
I seem to remember that the AJAX functionality used to work, but that's not the case since I upgraded the operating system. Maybe there's some setting that I need to update, but if so it eludes me. Anyway, this has taken quite long enough so I'll save the post as a draft and put the title right before I post it.
Browser Statistics (Hello, Robots)
Here is typical information for the top ten client programs. Unlike previous statistics, Firefox users account for almost a half of the traffic to the site - usually Internet Explorer leads the pack with about 30%, but in November it was relegated to third position.


Internet Explorer 7.0 currently accounts for 2% of traffic, the first time it's appeared in the stats. The thing I found most surprising was the fact that more Firefox users were using the recently-released 2.0 version than anything else. 2% of users still use Firefox 1.0.
Rather less delightful is the fact that 20% of site traffic is spidering (though how come Yahoo has to crawl so much more aggressively than anybody else is beyond me). Perhaps the real message is that I need to put some more compelling content on the site!
A Tip o' the Hat to Ron Stephens
Database API Tutorial at PyCon TX 2007
This doesn't guarantee that any tutorial will run: there have to be enough sign-ups for that to happen. This year there is also a tutorial on SQLAlchemy, and it looks as though the schedule will allow people wnating to understand how to use databases in Python to go through the DB API in the morning and then learn SQL Alchemy in the afternoon. I'll be conferring with Jonathan Ellis to make sure that I cover any necessary background for those who want to attend both.
I'm hoping that my tutorial will be well-received — last year's filled the room, and helped me fund my attendance at PyCon. It's always good to have guidance from students in advance telling me what their "hot-button" items are. If you're thinking of attending you can use this page to provide guidance on the content you'd like to see.
November 24, 2006
A False Sense of Security?
One of my sources of occasional reading is Seth Godin, author of several books including All Marketers are Liars. He also runs a personal blog, and in the wake of the Thanksgiving rush he wrote this TSA-inspired post about the stupidity of the air transport security rules and the insensitive way in which they are administered. This really rang bells with me.
Godin courageously risks being thought a whiner by ridiculing the rules that allow a full three-ounce container of gel through the screening but disallow a five-ounce container with only one ounce in it. I've spent a lot of time in US airport security lines, and people aren't generally welcoming of critical remarks. Unfortunately many of the "security" activities that we have to go through are what Bruce Schneier calls security theatre.
At the same time as the TSA are forcing even the airline staff to submit to security screenings there are airports where construction staff are allowed airside simply by swiping an identification card. So the terrorists will be targeting the construction workers, not trying to smuggle six ounces of gel through the passenger channels.
Now I know I'm not the only person to suggest that the US government's initial response to the events of 9/11 was off-target. Benjamin Franklin was spot on in saying "Those who sacrifice freedom for security deserve neither". It seems that the majority of American citizens appear to believe that the government has duty to protect them from all risk from the cradle to the grave.
Said citizens, of course, are oblivious to the fact that it is impossible to eliminate risk completely: the aim of security is to raise the cost of a breach to a level that makes the breach uneconomic. But enough is enough. Dulles International has got to the stage where "going through security" can add over an hour to the passenger processing time, and I'm sure others are as bad if not worse. If things go on the way they are, people will stop flying because of the security measures.
What percentage of the American population use the air transport system? How much is being spent every day on airport security theatre, and how many lives is it saving? How much should we be prepared to spend to save a single life? How quickly could we have fresh drinking water available for all of humanity if we spent the money towards that goal instead? How many lives would that save? Which expenditure would make the USA more secure? Isn't it perhaps time for a reassessment of priorities?
November 20, 2006
Movie Moguls Need Control
Don't even get me started on software patents.
Corporate governance always makes such a huge fuss about how corporations are really responsible to their stockholders. Who are the stockholders of the MPAA members, and why aren't they telling their managements to start respecting the customers who earn them their living?
November 19, 2006
Thunderbird QA Not Slipping!
The error that originally caused me to update to the latest version is even worse in 3.0a1. Message contents are now being mangled on a regular basis. I have no idea whether they can be recovered correctly or not, and I am beginniing to lose confidence in what has until now been a reasonably reliable piece of software. It's ironic that I am suffering this problem even worse than I was because I wanted to help the project by making an accurate bug report.
If many other users are suffering the same problems I am then this issue needs to be addressed before it starts to give open source a bad name.
November 8, 2006
Thunderbird: Can't Help for Hurting
Now I've reported bugs in the past, and been told that they were duplicates of existing reports. So this time I decided I'd do the right thing and follow the reporting protocol. After all the guys who put Thunderbird together deserve some consideration, and I'm sure many users are cluelessly inconsiderate of the fact they are one amongst milliions and that they haven't paid a cent for some pretty high-quality software. I can't tell whether there is any description of such a bug in Bugzilla -- it might be bug 239665 or it might not.
It turns out that one if the things you are supposed to do is install the latest nightly download in a blank folder with a new profile and see if the same error occurs. This is not a prospect I relish as it will involve a certain amount of setup, but I do the download (nothing much else to do in my hotel room) and start the install. Unfortunately it turns out there's an error in the install, and I see a dialog box showing
Microsoft Visual C++ Runtime Library error R6034: An application has made an attempt to load the C rutime library incorrectly. Please contact the application's support teamfor more information.Lucky me: I thought I had one problem, but now I have two. I feel duty bound to report this new error under the "Installer" category. Fortunately the installer completes, and I can run the new Thunderbird to confirm the same error occurs (though I stupidlu omit to bring my RSS feeds forward into my new version). So now I can go ahead and add to the bug report for the original problem, since unfortunately it hasn't gone away. My motivation is severely diminished, however, so this may not actually happen. At least I reported the installer problem.
One step forward, at least only one step back.
November 3, 2006
Stackless Python Continues to Amaze
Stackless allows you to organise your work into tasklets (which as far as I understand it have replaced the original microthreads as the unit for scheduling: this is all pretty new to me, so apologies if it's incorrect). An interesting thing about tasklets is that you can pickle them, pass the pickle to another computer, unpickle them and resume the tasklet in the new environment.
My attention was grabbed by one recent thread in which a user explains that he was trying to perform such interactions across a heterogeneous environment with Power PC, SPARC and Intel-based CPUs and found that it worked between SPARC and PPC, but the Intel architecture appeared to be failing -- presumably due to the different endianness.
After a couple of messages surmising that this was hardly surprising, Christian came into the thread to explain that there was no architecture-dependent code in the pickled thread resumption functionality. Lo and behold, the original poster came back explaining:
I must apologize, it turns out my problem was due to the fact that I was using a different version of stackless on the intel machine. In case anyone is curious, resuming pickled tasklets across architectures is easy. Thank you for your replies!Let me repeat that, just in case you missed it: resuming pickled tasklets across architectures is easy. As far as I can see this gives Python an amazing capability to produce applications with highly-distributed architectures. It's going to be interesting to see where Stackless goes with this, but it should be shouted from the rooftops. This is an advanced feature that represents a real advantage for (Stackless) Python in a world where everyone is wondering how they can accommodate the new multicore processors.
With Stackless, your CPUs don't even need to have the same architecture, but the feature will work just as well in the homogeneous environment that multi-processor computers provide.
October 24, 2006
What, Me, Unique?
| HowManyOfMe.com | ||
|
- Fathered my son (hi, Simon!)
- Chaired three PyCons
- Written a book about Python
- Taught almost 3,500 students about networking and security topics
- Helped comp.lang.python readers to use Python
Oh well, that's enough cheerful for today.
September 30, 2006
Thunderbird Politically Incorrect?
Nice to be back on the blog. I've been working my ass off lately.
July 3, 2006
Moin Moin - Introduction for Developers (Thomas Waldmann, Alexander Schremmer)
For the rest of this presentation you should see the published slides, which unfortunately not only accurately represent the content of the talk but also encapsulate its presentation. I suspect (though I do not know them) that the speakers were perhaps nervous, and not therefore confident enough to talk ad lib in a foreign language to what must sometimes seem like an intimidating audience.
I found this a little frustrating since the few departures from reading the slides that the presenters allowed themselves made it clear that they both had an excellent grasp of a very popular Python web application. With more time at the conference I know I would have liked to talk to them both about possible applications and developments.
Literate Testing with Doctest (Marius Gedminas)
He then pointed out DocTestSuite and DocFileSuite for externalising the tests, and considered how to handle complicated setup. One way is to define setup and teardown functions, and you can also put code in test.globs, but these methods should be limited for ease of comprehension.
The advantage of doctest is in encouraging simlicity and interspersed narrative to explain the tests. Another option is to define a test module. The advice is to avoid mixing long tests and regular code in the same file.
In real life, of course, some features of doctest are difficult to use when data is not reliably repeatable (such as the addresses of objects in repr()-style representations). Also problematic are ellipsis-elided outputs, which are to be ignored, and ordering issues. Web testing is even more difficult, as responses are frequently state-dependent. marcus showed some examples of testbrowser, a simple system allowing web testing.
Doctest disadvantages include the disability to step through tests. Documentation (docstrings, README files) should be separated from unit and functional tests.
Questioning revealed that Zope uses a slightly different version of doctest from the Python 2.4 distribution, although "in theory" they offer the same functionality. Jim Fulton asked whether the speaker had looked at Fit (and apprently PyFit is available) but although Jim would like to see Fit and doctest integrated there was no experience with the packages in the room.
The only slightly problematic aspect of this presentation was a couple of times when the speaker made inaudible responses to inaudible questions from the chair. This would have been less troublesome if I had not been at the back of the room, or if the PA system had allowed audibility. Otherwise I got a lot of information in a very short time, well presented.
Working Together on the Web (Kevin Dangoor)
Using simple_app was the easiest, but Kevin also showed us how to do it by defining our own class. He then considered the problem of maintaining session state (though Kevin says he prefers not to use state).
WSGI is also helpful in such situations: its concept of middleware (which talks to the web server on one side and a web application on the other) can help. The example here was of a "Latinator" that translated into pig Latin. Kevin showed us how to define a class with a method that can be passed to the WSGI framework as the start_response argument. WSGI is good because there have been many contributions to the PyPI index.
Kevin next introduced us the the Paste system designed by Ian Bicking. This contains a confusing number of packages and modules, which makes it hard to describe and hard to climb the learning curve and start using it. He suggested this demonstrated that even in the Open Source world we are faced with the "build vs. buy" choice, even though "buy" is really an investment in learning someone else's package and build, as usual, is learning and understanding the base technologies you want to implement, and writing your own implementation.
In TurboGears Kevin made the choice to use as much existing technology as was practicable.
The fictitious web package author might decide to package up other dependencies, but this can cause problems for people with other versions of the components she chooses to bundle. This is the classic version dependency. The setuptools system has defined a cross-platform format for installation of Python packages, the .egg format. This can also be used to install packages with binary components, and is proving to be very usable.
The .egg format allows other systems to read the metadata about the package, which is useful in many environments where plugins are used, even in non-Python environments such as Eclipse. The discussion about how entry points were defined to plugins didn't seem terribly easy to understand to me - maybe I was just distracted by the extraneous materials, but I didn't really see the point.
Kevin closed by talking about Beaker, starting by showing us theat it depended on the MyghtyUtils package and defined two paste entry points. The examples at this stage started to leave me wishing I had attended the AJAX session instead, but this could just be me: others might have found the material relevant to their interests.
This presentation relied for contrast on rather too much use of "humourous" slides: a picture of an egg when talking about eggs, a picture of an RJ45 plug in a socket when talking about plugins. I have no objection to such devices, but they should either enhance understanding or be shown for a very short time to give everyone a quick smile before moving on.
Kevin knows his stuff and is always an engaging speaker. A tour de force, though, should really be allocated an hour, and I suspect this session should have covered more ground in less detail or vice versa.
June 19, 2006
Front Page News
For a while now I've wanted to finish the www.holdenweb.com front page news feature so I could get on to newer AJAX-based work. The solution, of course, was staring me in the face when I looked for it: instead of holding up AJAX to finish off a pre-AJAX project I could actually use AJAX to speed up its completion. This strategy has worked well.
The original news feed was based on a programmed search of O'Reilly's Meerkat stream aggregator, but Meerkat went away and anyway the mechanism was cumbersome and error prone. I was looking for something lightweight that the mythical "average web user" would be able to use in a fairly foolproof way. I am happy to say that the first prototype is working exceptionally well, and the holdenweb.com front page can now be as up to date as I am!
At the moment the holdenweb.org site is still being generated the old-fashioned way, but I predict the retrofit to this parallel site will be easy.
June 15, 2006
Sitting with Nellie
Apprenticeships may no longer be appropriate, but it's also undeniable that sitting with Nellie had certain advantages over formal training. From a personal standpoint the major advantage was the ability to soak up what I might grandly call the prevailing culture and ethos - to learn how the place worked by talking to people who had been around much longer. I well remember having some of my more naiive assumptions and suppositions being questioned hard by cynics whose cynicism was borne of experience (and sometimes occasioning much good-humoured amusement).
Interestingly, Jon Udell has recently observed that the open source world could use similar techniques to educate people about what was involved in developing software, and specifically the techniques and tools used by the open source world. This approach to an extent generalises (because the open source world is very diverse and so the tools of one project may not be appropriate for another), but the idea has a lot of merit. Ted Leung has further observed that children really don't have any effective way of finding out what they'd like to do, and that a "sitting with Nellie" approach could be helpful in this respect too. This rings true with my own experience. Google's Summer of Code project allows open source projects to offer some experience to students for a liimted period, but there's a lot more we could do.
Le plus ça change, le plus c'est la même chose, as they say in France. We need to realise that change isn't always a good thing and, even if a change once were good, it needn't necessarily be permanent. Perhaps when apprenticeships were discarded an important baby was thrown out with the bathwater of restrictive work practices. Let's see if we can't arrange to have would-be programmers spending some time sitting with Nellie.
May 27, 2006
Need for Speed Wrap-Up
Thanks for the Memories
This has been a very busy week, and it's not yet been possible to thank everyone for the roles they have played in putting it together. First of all I must thank all the participants for their efforts. Everyone has worked amazingly hard this week. The declared hours of the sprint (along the lines of extreme programming) were 9:00 am to 6:00 pm, but it wasn't unusual to see people busily working away after 11:00 pm.
I have so enjoyed working with this awesome group, and the teamwork has been great. See the participants list to find out who they are, and see pictures on flickr and on jafo's journal (permanent links on the summary page). Favourite picture of the week has to be from the Blue Lagoon (that's me, with my hand out of the water at the back).
Other web references include these blog entries from Richard Jones and occasional remarks from the effbot, as well as Sean Reifchneider's blog. Jack Diederich has also mentioned the sprint in both his general and his geek blogs.
It's been a pleasure, and I am sure that as the result of working together this week we will all be more open to future collaborations. I sincerely hope that we can find other sponsors to support this work as generously as EWT have.
Thanks for the Support
The Python community as a whole has been awesomely behind us in this effort. Particular mention should go to Neal Norwitz, Andrew Kuchling, Marc-Andre Lemburg and Brett Cannon. They have all helped to flesh out ideas, picked up code nits before they became troublesome and cleared up typos in both code and documentation. Not to mention holding us up by pointing out unfortunate misconceptions which would have led to errors if not squashed. Many others have also pitched in, showing the true Python community spirit by reviewing patches and offering advice, and the sprint's success is theirs as well.
We should not forget the magnificent hospitality of CCP Games, a recently-elected sponsor member of the Python Software Foundation. Not only have they entertained us magnificently all week, they have also had three of their staff at the sprint and have provided local knowledge that has made everyone's week more enjoyable. It's never easy being thousands of miles away from home, and this all helped enormously. Special thanks to Kristján V. Jónsson for giving up so much of his time in a week that included a public holiday.
Thanks for the Sponsorship
We should thank EWT, LLC for the most practical support of all. They have funded the air fares and hotel expenses for fourteen sprint members as well as providing the trip to the Blue Lagoon, coffee throughout the week (sprints run on caffiene) and a close-out dinner at the hotel. They have also sent three of their staff from their Beverly Hills head offices to take part in the sprint, even though that meant they missed their Memorial Day weekend. The fourth-floor sprint room is an extremely refreshing contrast with most places I have sprinted before: access to daylight is quite a novelty (though 24-hour daylight took a little getting used to).
EWT's CEO, David Salomon, addressed the sprint in a teleconference on Wednesday, and explained something about his company's ethos and general approach. EWT's support of the sprint, and more generally of Python, is motivated by business considerations, but David's talk made it evident that he sees EWT's role in a larger context. He also announced EWT's intention to make a donation to the Python Software Foundation and to institute a scholar-in-residence program targeted at supporting individuals making open source contributions.
We also each received a Nokia 770 as a gift from EWT. This amazing little device runs Debian Linux, and Richard Jones had his device running pygame by Wednesday morning.
This is also a good place to record my personal thanks to David for hiring Holden Web to undertake the organization of this event. When I made my first hesitant posting to the conferences-discuss list and ended up as chairman of PyCon DC 2003 I little realised where it would lead.
So, What Have We Achieved?
The formal record of our successes is on this wiki page (and a link is best simply because even as I write this entry there are hackers all around me striving to get even more speed into Python, so we are by no means finished yet). Sean Reifschneider reviewed the outstanding patches and came up with a list of potential speedups, which we have been reviewing and chipping away at as a part of our fairly comprehensive task list. The next release of Python isn't due out until August, so there is plenty of chance to build on the work that's been done.
Although not directly speed-related, we have also put quite a lot of work in on the pybench module, as a result of which its accuracy and repeatability should be improved. Not only that but this work may also lead to the introduction of another benchmark with even better repeatability. Lots of tests have been written this week ...
Until all the new tests are incorporated into formal benchmarks it might not be easy to detect the speedup; it's evident to everyone here, though, that many of the speedups are in areas that the average user will perceive. The improvements to string and unicode handling will probably be welcome to most users. I hope readers will feel free to post comments to let the other sprinters know how much their efforts are appreciated.
And Next?
It is the earnest of hope all the sprinters that this event will demonstrate to the software and related industries that they can engage sections of the open source community in a way that assists both sides. Sprinters have been quite willing to address specific performance issues raised by the sponsors, although there was no compulsion on them to do so, and there has been a general appreciation that both sides will benefit from the sprint.
We live in strange times, and the computing industry is having to come to terms with an infrastructure that is increasingly developed and maintained by people not under their direct control. This is scary to the average commercial manager: David Salomon deserves credit for his perception that those who engage the open source community most whole-heartedly will benefit most.
I fly out of Keflavik at 7:20 tomorrow morning. By coincidence I shall be on the same aeroplane as four American friends who change flights in Iceland. So, I have a week's holiday to look forward to, including visits to Loch Ness and a Guiness brewery. Rest and relaxation will be the order of the day. After that it's back to work, and being a director of the Python Software Foundation.
This has been one terrific week, though tiring, and has built a cohesion among the team which will remain even after the sprint. I hope it leads other organizations to consider supporting the open source community instead of just being passive consumers of the output without putting much back. With luck, much may hinge on this little project.
May 21, 2006
Let the Games Begin
I've been monitoring the flight arrivals from my hotel room in Reykjavik, and as I write the flights of the first five arrivals have all been reported as having landed on time. So if all has gone well, and thanks to the assistance of our Icelandic hosts, they should find a driver waiting for them when they clear customs and immigration, getting them to the hotel in around a half an hour.
This is exciting!
April 28, 2006
Tutorials from PyCon
When I finally made time to visit comp.lang.python for the first time in two or three weeks I found a post that said
So of course I had to make sure that the material was available on the web. As a result you con now download my tutorials in either PDF or Open Office Impress format (yes, for once I eschewed using the obvious Microsoft products, and found that the Open Office component was a more-than-acceptable clone).I would like to know if anybody can point me to the site, where it is possible to find the tutorial "Using Databases in Python" which is mentioned by Steve Holden here: http://tinyurl.com/ectj8
Using Databases in Python: Impress PDF
An Introduction to wxPython: Impress PDF
These materials are available under a Creative Commons license. Thank Guido van Rossum for inspiring me with the liberal terms of the Python license.
April 24, 2006
Squidoo: Just Another Web Phenomenon?
So take a look at
April 20, 2006
Shameless Self-Promotion
An Amazon review of Python Web Pogramming reminds me that the book wasn't written just to explain Python ... thanks, Sheila!
20 of 21 people found the following review helpful:
| Reviewer: | Sheila King "desk-worker mom who needs to exercise" (L.A. County, California) - See all my reviews |
The book starts with a brief overview of the Python language. The author's intention is that someone with a fairly extensive programming background in other languages would be able to pick up enough Python from this overview to be able to do the rest of the programming in the book. Perhaps so. I already know Python, but did find the summary in the front informative.
I really like the fact that nearly every page has a code snippet on it. Examples are brief and to the point. The author explains each line of code and has a very direct and clear way of explaining things. I found the explanations easy to read and understand.
After the brief Python Language overview, comes an overview of sockets and socket programming. I've been trying to learn a bit about the whole topic of sockets by searching the web and nothing I found on the web explained it as clearly as this book. I now appreciate the difference between TCP and UDP protocols and have an idea of the situations in which I would want to use each. If you want to learn low-level sockets, or how to write your own socket protocols, this is not the book you are looking for. This book basically assumes you will go with either TCP or UDP (and ignores the other types of sockets available in the Python socket library). However, these will probably suit most people's needs.
The author then walks you through each of the Internet data-handling libraries in Python, such as the telnetlib, ftplib, poplib, smtplib and so on. He gives examples of working code for each library, showing first how to implement clients, and later on how to implement servers. If you want to work with these libraries, these explanations should be very helpful.
Later in the book, Holden addresses using databases in Internet programming, using XML and writing your own web-application framework. I haven't yet had a chance to go through these chapters in detail (I've skimmed them only). But there is a LOT of stuff there. One thing the author does at the beginning of each new section, is give an overview of the topic (such as an overview of why you might want to use a database, how databases work, or why you might want to work with a web framework). For me, I really appreciate this type of overview. It helps give me a context for the new information, and helps me to make better sense of it. I read through some of the database chapters where he explains how the SQL query language works, and again, I have to say it is one of the best explanations I've read. (Most explanations I've read about SQL have just convinced me I wanted to steer clear of it.)
Another nice thing, is how he sort of "works you up to" SQL. He starts out with regular Python code, and shows how parts of it are similar to working with an SQL database, and then eventually transitions into the full SQL language. He also addresses database design and efficiency.
Overall, I'd say if you want a good overview of the topics mentioned here, want to understand the reasoning behind their use, and want to be able to understand good design and efficiency, then this book should really help you out.April 16, 2006
End of Internet Prematurely Flagged
"anybody who's going to have a blog has one by now, after two years as a journalist you get stale, lots of bloggers are going back to real life"and graphs the "daily reach" of memeorandum.com, thereby confirming that for him it's all about the eyeballs. When I look back at my own blogging history I see that there are frequently months when I have written nothing at all in my blog, and hey, here I am still blogging.
If blogging is just "look at me, Ma!" then the sooner it stops the better. Blogging works best not when it's a publicity channel but when it's a reasonably consistent, selective window onto the world of the blogger. Like journalism, much blog content is ephemeral, and the blogging world needs to remember that. If it's not on page one of my del.icio.us then it's history. If you want the history it's sometimes there, but remember it could be a revisionist history as blog posts can be changed at any time.
April 15, 2006
Test-Driven Development
The idea was to write the tests first, though it will be no surprise to those who've done this before that the nature of the tests changed as errors came to light during development. The problem was as follows:
Given a directory structure of arbitrary shape, locate all JPEG images and copy them into a named destination directory. [Not specified but implied: the files should continue to exist in their original positions]It turned out that the level was fairly well chosen. None of the students managed to complete the task, but they all had a fairly clear sense of where they were going by the end of the exercise, giving them something to work on independently after I'd gone. Of course I had to provide them with a "model solution", which I'm happy to say I just managed to create in the time allotted.
Here is the test harness for the jpegcopy requirement:
import jpegcopy
import unittest
import os
BASEDIR = '/c/Steve/Projects/BrightonHove'
BASEDIR = 'c:/Steve/Projects/BrightonHove'
INDIR = os.path.join(BASEDIR, "input")
OUTDIR1 = os.path.join(BASEDIR, "output1")
OUTDIR2 = os.path.join(BASEDIR, "output2")
EXPECTED = ['%s.jpg' % s for s in "f1 f2 f3 f4 f5 f6".split()]
class TestJpegCopy(unittest.TestCase):
def setUp(self):
"""Ensure both output directories are empty."""
for d in OUTDIR1, OUTDIR2:
fl = os.listdir(d)
if fl:
try:
for f in fl:
os.unlink(os.path.join(d, f))
except:
raise ValueError, "Cannot empty directory %s" % d
def testEmpty(self):
n0 = jpegcopy.main(OUTDIR1, OUTDIR1)
self.assertEquals(n0, 0)
def testDir1(self):
n1 = jpegcopy.main(INDIR, OUTDIR1)
self.assertEquals(n1, 6)
self.assertEquals(os.listdir(OUTDIR1), EXPECTED)
def testDir2(self):
n2 = jpegcopy.main(INDIR, OUTDIR2)
self.assertEquals(n2, 6)
self.assertEquals(os.listdir(OUTDIR2), EXPECTED)
def tearDown(self):
for d in OUTDIR1, OUTDIR2:
for f in os.listdir(d):
os.unlink(os.path.join(d, f))
if __name__ == "__main__":
unittest.main()Nothing too fancy here. The tests are parameterised. We set them up by clearing both the output directories. Then we test that they are indeed empty. Then we test to make sure that we can put the JPEGs into two different directories and verifying that each time we see six files copied. Finally we check that both output directories contain the same thing. We tear down the test by deleting the contents of both directories.This will probably show my ignorance, highlighting the fact that test-driven methods don't yet come naturally to me. I'll be happy to integrate suggestions for improving test coverage. My solution follows.
"""Copy jpegs from a recursive to a flat directory structure."""
import os
import shutil
def main(indir, outdir, debug=0):
count = 0
for f in os.listdir(indir):
if os.path.isdir(os.path.join(indir, f)):
count += main(os.path.join(indir, f), outdir, debug=debug)
else:
if f.endswith(".jpg"):
count += 1
shutil.copyfile(os.path.join(indir, f),
os.path.join(outdir, f))
if debug:
print "Returning %d for %s" % (count, indir)
return count
if __name__ == "__main__":
main("input", "output1", debug=1)As you can see I have put a simple test inline; this script is not intended to be run as a main program, but the debug output was useful sometimes when tests failed for obscure reasons.Again, if readers can suggest improvements I'll incorporate them as I have time. You should be able to copy the code from your browser window and paste it into an editor. Thanks to the MoinMoin developers for colorize.py.
April 6, 2006
Do We Need Speed?
Commercial organisations are free to use the output from open source projects without putting anything back (vide Industrial Light and Miserliness), and by and large this is expected -- open source licensing terms are fairly explicit, and few are even as "draconian" as the GPL (which currently says in essence that if you distribute GPL-derived products you have to make the source available). By the same token, of course, there's nothing to stop people from supporting open source projects if they want to.
Hopefully this little gap in the curtain will help to trigger a realisation among commercial software developers that they can make a huge difference to open source projects from which they might benefit (or from which they already have benefited) by the application of what are, in strictly commercial terms, relatively modest funds. The various Foundations controlling some of the better-known open source projects do make their own efforts, but without significant external funding (such as that achieved by the PyPy project) and management expertise (extremely variable) it can be difficult to make progress. Heck, even management training might be a useful contribution from the world of pointy hair (I'm sorry, I'll wash my mouth out with soap later).
Of course we'll have to wait and see. It could be that I am completely wrong, that hardly any of the invited developers will bother to come, and that the sprint will really show that open source people don't want to play in the commercial playground at all. In which case I guess I'll have egg on my face.
If I'm right, though, it will show that there are benefits to be had on both sides of the equation and that, although open source developers don't do it primarily for the money, they don't necessarily object to working with commercial developers when there is a sufficient alignment of goals. I feel incredibly fortunate to have been given the chance to put this belief to the test, and I can't wait to see how this effort goes.
March 25, 2006
Settle Up with Sony
EFF is a body well worth knowing about and supporting. They prosecuted a class action suit against Sony BMG, and if you want to get in on the settlement now is the time.
Find out how to get your share.