Sunday, October 05, 2008

Its all text on Mac OS X

One of the annoying things about keeping up with pace of firefox changes is that add on's break and need to be reinstalled every release.

E.g, I use its all text to allow me edit text areas using an 'external' editor. Unfortunately, configuring it for a Mac is a bit finicky, but this advice explains what to do to get it to work.

Thursday, January 26, 2006

Neat python diagrams

I've just noticed a couple of neat diagrams related to python frameworks.

First, there there is Stefane Fermigier's diagram of the relationships between various python frameworks / meta frameworks. I spotted that while reading this entry from Ronald Jaramillo in which he shows a nice infograph of a request being processed using TurboGears.

Friday, December 23, 2005

'Why Python?' revisited

I've just read this pretty good post by Ben Bangert. It's a welcome respite from all the 'ruby's soooooooo great!!!' posts and books that have kept popping up everywhere recently.

Don't get me wrong - I like Ruby. Its a dynamically typed language and dynamic rulz! ;-) I would much rather use Ruby or Python than Java/C#/C++ for general purpose programming. Its great that Ruby has a framework that has pushed it into the limelight. If you're comparing Rails to programming in the various Java web frameworks or ASP.NET, its a walk-over; you've got a massive productivity win, irrespective of IDE support.

But when using Rails to compare Ruby with Python, its helpful to remember that Python already has pretty good web/internet-based frameworks: e.g., Zope and Twisted are well established; others like TurboGears, Django, and Webware are newer but show the extent to which python has been successfully applied in this domain. Each of these is pretty good, they have a different approach to building web applications, but this diversity is good. Some of these (e.g., Zope, Twisted) are much more than mere web application servers, and attempting to evaluate them on how easy it is to build and deploy a simple db-driven website would be a mistake.

In addition to web frameworks, python has interfaces to useful third-party APIs (e.g., PyGame, wxPython), time/money saving products (e.g., reportlab, trac) and unparalled support amongst dynamic languages IMHO for being used a wrapper over existing C++/C code, thanks to the like of Pyrex, Boost.Python, and SWIG. The latter has both Ruby and Python bindings

As Ben points out, Python is used in lots of places. One of these is Google who 'have used Python right from the beginning' and have just employed the BDFL. Many of these places use Python, not because it lets them write web apps quickly, but because in a large code base, Python's clear syntax leads to enhanced productivity and benefits long-term maintenance. The maxim

" Code is more often read than it is written"

becomes more important. For me, Python just about (!) edges Ruby on that one, although I'm open to being proved wrong.

Wednesday, December 14, 2005

Google Firefox extensions

A new Google labs project has produced a firefox extension that adds Google Suggest functionality to Firefox.

There have been other extensions that have upgraded Gmail functionality in FF e.g., Gmail manager, but AFAIK this is the first time that an official one as been released by Google.


Sunday, December 04, 2005

Why Ruby is an acceptable LISP

This article argues that Ruby has the power of LISP's lamda's and macros and may be a better choice overall due to the availability of developers and quality of its libraries.

This article poses a very interesting idea - the article itself and the comments it attracted are well worth reading - but I doubt that the idea is correct. Still, it is interesting to hear this from an avowed Lisper who has recently become an avowed Rubist.

The main problem with the article is that its starting premise, that 'all there is to Lisp is functional density and macros' is wrong. I would expand a bit more on this, but don't need to - the various commentators (e.g, here) and here) do this very well.


read more | digg story

Continuous Integration with Buildbot

Continous Integration is a software engineering term describing a process that completely rebuilds and tests an application frequently. Cruise control is one of the more popular ones. it is written in java, and boasts tight integration with java tools like Ant. Buildbot by Brian Warner is a continuous integration server built from Python and Twisted.

Funnily, although Buildbot is a mature CI server with unique advanced features, it does not often get mentioned in traditional XP/Agile circles. E.g, this feature matrix at the Damage Control website merely leaves a question mark on most entries for Buildbot. This is likely to be because a lot of the momentum in XP community has been on "Enterprise" application development projects that tend to use Java and C#, so continuous integration servers written in those languages have been more prominent. In this respect, Damage Control itself is another interesting CI server - it is written in Ruby, so is probably worth another post on this blog (Dynamic languages rule!).

Despite the current lack of awareness about BuildBot, nevertheless it is quite popular in the FOSS world. As this google search shows, a lot of FOSS projects use it to continuously integrate their source code. A key distinguishing feature of BuildBot is that is designed from scratch to be a distributed build tool.

Buildbot consists of a single buildmaster and one or more buildslaves, connected in a star topology. The buildmaster makes all decisions about what and when to build. It sends commands to be run on the build slaves, which simply execute the commands and return the results.

This means is that Buildbot can be configured to simultanously perform different builds on completely different machine configurations in response to commits in the source code repository or at user request. This feature makes BuildBot uniquely useful in multi-platform build scenarios.

Another nice feature that I've not seen on other CI servers: BuildBot learns how long each build takes - so that when new builds are triggered, it lets you know how long there is to go before the build completes.

If these are not enough to whet the appetite, BuildBot has a feature that allows developers to see what would happen with if they checked in their source trees prior to commiting them. What use is that? If full pre-commit builds take a long time on single developer machine, as is often the case if one has extensive unit/functional test suites or needs to test these on multiple deployment configurations, they can be delegated to a cluster of build slaves!

Find out more from http://buildbot.sourceforge.net

Run Python Scripts on Your Nokia Smartphone

While Java and Symbian C++ are powerful programming languages, their learning curves are too steep for most smartphone users. Most users do not need a full-blown programming platform to develop small hacks for their phone, here is a good example of that.

read more | digg story

TurboGears RAD web framework, written in Python with AJAX

TurboGears is an amalgam of four powerful web packages: MochiKit for Javascript, Kid for templating (like TAM crossed with XSLT without the complexity), CherryPy for app logic, and SQLObject (an ORM library) for easy database access. The creator has put together a nice video tutorial where he creates a wiki application in 20 minutes.

read more | digg story

Sunday, October 09, 2005

A Python Sidebar for Mozilla

I was taking look at trac , the SCM and project management tool written in Python, and came across the Python sidebar for Mozilla. This is a brilliant Mozilla add-on - its instantly useful, one of those things that once installed you think "I wish I had this ages ago", or "why didn't I think of this?". I'm pleased to have found it...
trac looks pretty good too - I'll say more about that later.

Sunday, July 24, 2005

IPython: the enhanced python shell

IPython is an Enhanced Interactive Python shell. It has additional 'magic' commands to allow access to things like shell history and the underlying system shell. It caches command outputs, and you can view these using the history mechanism as well.

While installing it on windows, I was pleasantly surprised when the post-install screen pointed me to here - a python readline module for windows. I did not realise one existed! It depends on ctypes and PyWin32, which need to be installed as well.

Three things I immediately liked about IPython:
  • history - makes the interpreter-to-editor-to-interpreter loop so much easier to manage
  • system shell access and output capture - its feels like you're using a real shell
  • colouring (comes with readline) - it looks nice!
This article by Jeremy Jones takes the reader through a nice tour of its main features.

Saturday, July 23, 2005

Great Python unit/acceptance testing links

I've recently noticed a series of posts that discuss the various unit testing options available in Python.
Well done Grig for this excellent summary. Its good to see all this information in one place. I've used unittest in the past - when I next get an opportunity, I'm keen to check out pytest.

Grig has also posted a series of articles about how to use the FitNesse acceptance testing framework using Python.

Tuesday, December 07, 2004

Javascript on the march

JavaScript is thoroughly underrated as a 'proper' programming languge. I've worked on projects where developers hate the task of implementing client-side functionality in JavaScript. They see it as a 'toy' language. Perhaps this is because of its association with performing little hacks on webpages, or maybe it's because of the difficulty in getting scripts to work correctly on multiple browsers. I'm sure everyone's first introduction to JavaScript is the image rollover trick, or perhaps having to writing ugly branching code that checked for the presence of document.all to determine which browser is being used.

In fact, JavaScript is a fully-fledged prototype-based object-oriented language. There are other prototype-based languages of note, including
  • self, which 'combines a pure, prototype-based object model with uniform access to state and behavior'
  • Io, which 'is a small prototype-based programming language'
Part of the beauty of these languages is the ease by which the language and code written them is understood. This explains why JavaScript became so popular - the fact that is was easy for people without a computing background to produce useful, correct, embedded programs quickly.

Others have long noticed JavaScript's utility. It is a key component of the Mozilla and Firefox applications. In those, it is used to script the various XPCOM components and services that these applications use, but it is also used to define the behaviour linking the various XUL components together in these products' user interface.

Mozilla are not the only people using JavaScript to deliver a 'rich' client experience. Bindows does this, but the applications are deployed entirely in your browser. Their component framework seems very impressive, although so far, I've only run their demo applications.

Perhaps its time that we stopped thinking about web applications as having most of the functionality defined on the server-side in Servlets or JSP or ASP or PHP or any-one-of-those. We probably don't even need the next big server-side things being promised by the usual suspects (cf. XAML, JavaServerFaces).

In the future, we can start to restructure web applications so that they consist of CSS and JavaScript for most of their behaviour. The server would only be invoked at points when behaviour that actually needs to reside on a server is required.

Maybe the wise have started doing this all ready, and I'm thinking about sites like Gmail and Blogger

Wednesday, December 01, 2004

First Ever Blog

This is my first ever blog entry. I've just started a job at a software engineering consultancy where everyone seems to blog. I've always thought the blogging concept to be pretty cool, but have never had to the impetus to start one myself.

Well, as they say, there's no time like the present! This blog will mainly be about dynamic languages, as I'm quite keen on them, and I'm more likely to keep this going if its about something I find interesting.

Blogger have made it amazingly simple to start this blog up. And as a dynamic language (in this case Javascript) fan who's done a bit of DHTML, I can really appreciate the editing interface that Blogger provides. I know this type of widget is becoming more common thanks to Frederico Caldeira Knabben and the FCKEditor team, but it has not always been - someone's done a really good job.