Steve Lee :: Blog :: Archives
Design Patterns are a vital part of modern Object Oriented programming but few resources cover their use in Python. Alex Martelli (author Python in a Nutshell) gave this talk on implementing design patterns in Python at the Google Developer Day . The slides are also available. I've just got the interesting looking Head First Design Patterns (which uses Java) in order to revise a long time previous 'dipping into' the classic Gang-of-Four book. [Update 21 Jun 07] Patterns in Python by Duncan Booth attempts to map some of the GoF patterns to Python and see if Python has it's own Patterns. There's a wise warning of the 'Small Boy with a Patterns Book' syndrome too.
For several years we have subscribed to the Riverford Organic Vegetables Vegbox home delivery scheme and enjoyed fresh, seasonal organic veg and fruit delivered to our door. Most produce is grown at Riverfords farm which is only a few 'food miles' from our home though sometimes produce from other locations or countries is provided. The food is excellent quality and often demonstrates its organic status by sporting lots of not-so-tasty Devonian mud. We just spent a day at Riverford on a farm walk and meal in the field kitchen. The walk was short yet our guide was informative and the glorious and verdant rural Devon farmland was the star. We learnt about responsible management, looked at soft fruit and rhubarb crops, picked and ate strawberries, took a tractor ride to pick bagfuls of fragrant basil in the poly tunnels and then walked back for the most amazing meal. The tractor broke down, apparently that had never happened before, so a little extra walking meant we had a good appetite. Chicken and tarragon with wet garlic, broad beans, water cress and chorizo, carrots and kohlrabi with dill, roast new potatoes, spinach au gratin and two mixed salads meant I had to loosen my belt a notch before the pudding of crumble, tart or pavlova. Riverford are one of the largest such schemes and a fast growing concern, perhaps one of the few areas of British farming that is not collapsing under pressure of supermarkets buying power. They have 400 acres of veg supporting 250 workers and last week sent out 32,000 veg boxes (40 including fruit boxes). The also have some 600 acres of dairy. A co-operative, they also have other farmers growing crops for them. Although they have a very large distribution area they have now started 2 other operation elsewhere in order to reduce the food miles. They even provide organic meals at the local school and have seen increased numbers (last year they won a Jamie Oliver prize and this years winner uses their veg too). On the way home I drifted off and pontificated some rough parallels between organic farming and Open Source. OK its pretty forced really and probably mostly an artefact of overworked digestion but it seem to make some sense at the time. - From the 'conventional' perspective they are the realm of cranks and unworkable, but are inexplicably gaining popularity and may even replace the 'conventional' way (in other words is a disruptive system);
- They're organised as a cooperative around a commons freely sharing resources;
- They work with complexity, embracing it rather than trying to overcome and replace it (e.g Mozilla's embracing it's complex community dynamic);
- They nurture the environment rather than plundering it and do things that do not have direct gain (such as buffer zones, bat boxes) effectively improving the commons;
- They are a return to an older way of doing things after many years of unnatural and unsustainable 'conventional' incumbency;
- Their motivation is not purely commercial and partially ethical;
- They supply something people want and like not just what the supplier wants to supply;
- They offer an attractive alternative to corporate monoculture;
- The offer good value to customers with some unconventional but very important benefits (e.g environmental and health);
- They rely on viral marketting
Don't take that comparison too seriously though. You should however take Open Source and Organinc farming methods very seriously.
Sad news, but perhaps a symptom of the growing global focus on the 'web as the platform'. I leave the details to Peter Peter's email announcement and David Bolter's post (Peter is maintainer of LSR and David is a maintainer of GOK, both Linux a11y projects). As David points out Linux Accessibility is now largely in Sun's capable hands, along with input from the volunteers working on the various projects. It must have been with great sadness that Peter posted his announcement, though he gives little of that away in his clear explanation of the impact of the decision on various projects that IBM have been working on in Linux a11y. Personally the timing is a little disconcerting as I get up to speed on using LSR as the framework for Jambu. I have already benefited from Peter Parent's impressive support in meeting my questions and providing directions. That will now sadly stop as Peter will only be available in his spare time. Along with Scott and others at IBM Peter has put a lot of energy into making LSR a useful framework for creating Assistive Technology. And from what I have used so far it is already good basis for Jambu, providing useful abstractions. Using a framework does require more time to learning the ropes and can possibly constrain design but if the design is good it aids more than hinders and provides a firm basis for speedy and creative design. From my current perspective LSR hits the spot though parts are not directly applicable to Jambu. I have decided to continue using LSR, at least for now as I get a basic OSK working. That may involve performing some maintenance and delving deeper into LSR than may be strictly necessary. However I am not really one to just use a framework without digging below the surface and thinking of other ways of doing things, so I'm comfortable with the possible delay. In any case I've already been exploring much of the architecture. I'm also keen to help see the effort not go to waste. We have discussed keeping LSR alive and ideas to develop it as a framework for assistive technologies other than screen readers. Peter will initially 'brain dump' into documentation as much as possible for prosperity. I wish Peter and the others all the best in their new projects for IBM and hope they can keep invovled with LSR. As Aaron Leventhal said, Mozilla only really took off once the corporate apron strings where severed. It's a case of LSR is dead, long live LSR. Music: Nick Harper: karmegeddon / bloom / knuckedraggers from his new DVD Love is Music
Mitchell accepted the award last week and provides full details. You can see the presentation and Mitchell's speech on the link given in her posting. This is an enormous honor. It is a very significant recognition of the work of the Mozilla project. I want to thank the ITU for selecting Mozilla and congratulate the Mozilla community for making such an impact in people's online lives.
Congratulations to all. The ITU World Information Society Award has been created to honour individuals or institutions that have made a significant personal contribution to promoting, building, or strengthening a people-centred, development-oriented and knowledge-based information Society. Personal achievement may take the form of social accomplishment, mobilization of public opinion, or a key technical innovation.
People love firefox. We'll at least that's what I've been discovering since wearing the Firefox T-Shirt that Frank Hecker presented to me at CSUN for wearing behind the booth. Now that the shiney newness has worn off a little I've taken to wearing it as we go out and about doing our family stuff. Every time I have had favourable reactions from everyday people who recognize the logo. These include the chap behind the desk at the Ridgeway Youth Hostel, a couple of boys on a tractor ride and our guide on a farm tour. Conversations have started, people have said they use Firefox and like it. Someone even asked if I work for Mozilla and I was rather proud to be able to say I'm doing a small contract with them. So the competition idea is this. Buy and wear a T-shirt and let's see who gets the most interesting or unusual acknowledgement and/or conversation from someone who is not a techy and just doing their stuff.
Mozilla are recruiting for the Mozilla Foundation Executive Director now that Frank Hecker has announced his plan to step down. The job/person description make good reading too. As with everything Mozilla does it's completely in the open so anyone is able to get involved in the process. [Update] Mitchell posted a concise summary. Off on a tangent, here's a list of some of the non Firefox activities that MoCo employees get up to.
Issue 1 has landed. - Installing Ubuntu Feisty Fawn
- Howtos: Linux directory structure, MythTV, Scribus, and more
- Interview with Deluge BitTorrent Client developer
- News, reviews, and much more!
A 2 part article in Tech News World: Part1 is general and Part2 covers education
Congratulations to TBL OM for receiving the prestigious award. Previous recipients include Florence Nightingale, Sir Winston Churchill, Bertrand Russell, Graham Greene, Sir Edward Elgar, Mother Teresa and Baroness Thatcher.
Imagine a school that teaches software development -- not computer science, not computer technology, but the art and science of developing software
Then suppose that this school introduces a new course on open source concepts and methodology -- how to become part of an open source community and how to productively contribute to an open source project. Students do check code out of source code repositories, do builds, make patches, go through code reviews, create documentation, build test cases, file bugzilla reports, and chat with core developers on IRC.
Thus Chris Tyler describes CDOT at Seneca College, Toronto, and boy does that sound like somewhere I would have loved to have gone to all those years ago when I was playing with home-made computers as a student (and the official course content was badly taught Z80 assembly language). Seneca have just had an open day showcasing their work as well as forging partnerships and community links. There's info including a video and a photo log (phlog?)of how to build a Freedom Toaster. There's also an interview with ex-student Andrew Smith. Seneca are hosting FSOSS this autumn. Should be one to go to and I'm pleased to see David Bolter (of GOK and now Dojo a11y) is presenting.
We have declined to discuss any agreement with Microsoft under the threat of unspecified patent infringements.
Says Mark Shuttleworth. Good.
Sensible thoughts on how the cost of merging should be low as it is an act of collaboration. We didn't really concider that a priority when I worked on developing VC & CM tools. We just provided a basic 3-way merge and the user had to do all the 'hand holding' checking and correcting.
Post from danc postulating that Product design is the latest era in software development. It's features are cross-disipline colaboration and a user participation. See Mozilla....
I finally feel my creative juices are flowing and I am no longer on a perpetual and constantly interrupted learning curve after the unfortunate false starts ( XUL and LSR). I now have some starting code for Linux (see README in the tarball). It's very primitive and a long way to go to be even a basic GOK, onBoard or SAW being a sampler rather than a usable application. Talk about 'release early'. I do now have a sense of direction and architecture and the ways to grow it into meeting the Jambu goals. I'm fully engaged at last. The new approach, decided with Aaron, of starting from fresh and just coding has paid off. It has removed the blocks and the focus I'm gaining can be used in deciding how to create or use frameworks and platforms. I don't regret the time spent exploring XUL or LSR as both have taught me a lot and I have faith the knowledge will be useful. More importantly I have got to know many of the great developers who are working on the projects. I've started off with SVG as I feel declarative description of the OSKs is important not least as it allows viral style cut-n-paste reuse. You may bemoan the lack of engineering discipline of such thoughtless usage, but such easy leveraging is part of what made the web take-off and evolve so rapidly. A large part of the Jambu vision is to encourage innovation and such rapid prototyping of ideas is going to be important. Using SVG rendering adds several interesting issues, mostly with performance due to the need to parse and render. Having declarative and scaling (as apposed to zooming pixel replication) gives easily modified and attractive UI. Perhaps Inkscape or other design tools can be used to create the UI. We can always add Cairo/Pango support later, perhaps in a similar way to the Firefox canvas rather than embedded in the Python. However that is more a feature for programmers than users so I'll probably put that low down on the priorities unless we hit a show-stopper with SVG. I'm reusing some basic LSR code, taking advantage of the fact it was moved to a BSD license just before IBM pulled the plug. The logging code based on the standard logging module will be invaluable. When working on Real-time mobile data we found that a debug channel with everything logged saved the day on may occasions. I doubt I'll log everything but it's basic debugging infrastructure. My next plan is to use the POR and Adapters to provide an abstraction of the platform a11y apis thus allowing easier portage to windows. They are perhaps rather overkill for my simple needs but should cover any future a11y requirments. Once of the problems I found with using pyGTK and FOSS development in general is the difficulty in quickly getting a grip on best practice. Any amount of Googling and searching Koders etc. throws up many examples that are variations of a few themes with little explanation of the issues and best practices. You need to investigate several layers of docs and source, trying to connect the concepts and apply them to your usage. To some extent this is a natural effect of Open Source which encourages 'release early' and much copying of tutorial examples or choosing the easy option to get something working. Proprietary practices mean you have to (at least attempt to) create good docs. The advantage is that you gain a better understanding at the expense of time and that suits my style in general. It is however very frustrating at times. I should probably use the ever helpful FOSS communities more and get on the right IRC channels. The problem I currently have is that I'm signing off work in order to do the school run just as the developers in the States are waking up. An example I hit is in painting (expose) patterns for X windows and how to render SVG; should you draw on demand in the expose event handler as you do in Windows paint handlers or draw to a server-side pixmap and copy on expose in order to reduce traffic in networked situations? And then there's the configure, size-allocation, realize and map signals to think about at some time soon (after a X refresher). Perhaps it doesn't matter as most users will have clients and servers on the same machine. Anyway I picked the simplest solution in true FOSS/Agile tradition and it's pretty slow on resize. I'll optimise later if at all (a good practice in itself). As Aaron says it's easy to think too hard. Another issue I hit was purely personal. Although I have programmed in Python, I have many,many years of C and C++ so my instincts still lie there. I keep finding I using C idioms which don't fit python, especially at the end of the day when I'm tired and more on auto pilot. For example I wanted to create various constructors to create rectangles from different primitives (e.g. 4 ints or a GDK Rectangle) as you would in C. After a digression into Python theory I scrapped the idea and used a much simpler helper function which is a better approach from several angles. I gained a better understanding of Python and simpler (and faster) code at the expense of time taken to code. I'm slowly re-reflexing myself into the Pythonic way as I enjoy re-immersing myself in deep coding after so much web and SQL stuff. Whilst working on Jambu I've also been looking at Sensory Software's Grid2 communication program and OSK, and boy am I impressed by its maturity and richness of features. It also shows what can be done with the much maligned VB and how to use the OS's native features, services and concepts to great benefit. It's also show how much experience with users requirements that the Sensory team have amassed and poured into the Grid. Lots of inspiration there.
A question posted on /. asking how to takea first step in contributing to Open Source projects got a good discussion going including a post from Dave Humprey at Seneca which rather throws down the gauntlet to teachers as well as providing an offer of help.
Here's how Mozilla do it. That's a lot of channels.
I finally bought a decent home espresso coffee machine after years of putting it off. After seeing the machine and testing the coffee that Barney Hawes of Sensory Software made me with his Solis SL70, Barney was kind enough to take me along to his local coffee roasters, Twoday Coffee Roasters in Bristol. Twoday had one in use in the shop, which I took as a good sign. So I purchased the last machine they had, along with some brazillian and a blend. The friendly and enthusiastic owner gave me lots of friendly advice. The Swiss made Solis crema SL70 has the guts of a real expresso machine in a budget case and at £250 seems good value. The portafilter (the black handle that holds the coffee) is solid and the stem wand seems to be very effective as far as I can tell at this stage. There's a encouraging review at CoffeeGeek and also several positive user reviews (a couple hit problems in a year or so, but who knows if they maintained it correctly). It's a veteran of some 9 years or so and I hope the various tweaks in that time have all improved its performance and reliability.
My first cup of coffee took a while due to my lack of experience but tasted wonderful. Whilst using the steamer my mind turned to one of my favourite Not the Nine O'clock News sketchs with Rowan Atkinson pretending to make an expresso but using instant coffe while making sound effects with his mouth (there are some other examples of NTNOCN on YouTube). Anyway I'm looking forward to installing this machine in my office.
I've been digginging into the W3C SVG spec and some of the good example web-ources for Jambu as I'm using this open standard for flexible and attractive UI. While thinking about various approaches for OSK declaration and operation I've realised that SVG provides an awful lot of functionality beyond my initial expectations. It's apparent from even a nodding aquaintance that SVG has great graphics and text support including gradients and filters. What I had not realised is that it has other features such as structural control (symbol, use), CSS support and basic animation with an overlap with SMIL (animate). Even better, there is a full DOM which combined with scripting and the rich event model alows dynamic interactivity. This means I have the possibility of getting SVG do some of the work I expected to do in the the graphics toolkit (GTK/GDK) though I can't use the interactivity as I'm only rendering and not in a user agent. One sticking point is that way I render SVG to a pixbuf (gtk.gdk.PixbufLoader) is not generating any useful SVG error info. I'll investigate using rsvg directly to fix this. It occured to me that you could proably do a complete OSK in SVG in a browser. That might be of limited use as any OSK (and Jambu) need rich access to device input and control of applications, something that will be difficult in a browser sandbox. However Mozilla and XUL open up the possibilities.
|
|