Archive for the 'Tools' Category

Mercurial

Friday, May 16th, 2008

In the past, I’ve used Subversion for the one-person software development projects with which I’m often involved. Just recently, however, I thought I’d give Mercurial a spin, having heard good things about it and seen a lot of people start using it.

So far, I’m impressed - particularly by the ease with which you can clone a repository to create a new branch for development, and then merge changes made there back into the original. Another nice feature is the ability to view repository changelogs with a web browser, courtesy of Mercurial’s built-in web server. And then there’s the fact that large parts of it are written in Python… :)

Pygments is cool…

Friday, March 28th, 2008

Pygments has been on my radar for a while, but I hadn’t looked closely at it until the other day, when I had a need to highlight some code fragments in a reST document that I’m writing. Hacking rst2html.py to do the necessary work was easy - just a copy-and-paste from some sample code in the docs. But then I hit a problem; my document includes code fragments written for both Python 2.5 and Python 3.0, and Pygments can handle the former but not the latter.

I delved into the source code with some trepidation, wondering how long it would take to hack a solution of some kind. I needn’t have worried. Pygments has good docs and a very clean design, so it took just a few minutes of study to figure out what was required. Less than fifteen minutes later, I had a Python3Lexer class plugged in and working!

If you want the code, it’s now been merged into Pygments’ Mercurial repository, courtesy of Pygments lead developer, Georg Brandl (Cheers, Georg!) Check it out with

  hg clone http://dev.pocoo.org/hg/pygments-main

Eclipse Europa: evolution or revolution?

Sunday, July 1st, 2007

Eclipse Europa became available to the world on 29 June, and I’ve spent a few happy hours exploring what it can do.

My standard Eclipse set-up consists of the Eclipse SDK, DTP and the Derby plugin for database-related stuff, WTP for web-related stuff, Subversive for version control and PyDev for Python programming. Installation of Europa has upgraded the main SDK to version 3.3, DTP to version 1.5 and WTP to version 2.0.

So, what do I think of it so far? Overall, it looks more like an evolution than a revolution, with a large number of small additions and changes. None of these are particularly dramatic in their impact, but the cumulative effect is rather pleasing. Features I particularly like include

  • Streamlined workspace switching
  • The new minimize/maximize behaviour, which allows more flexible use of screen real estate
  • The ability to toggle display of invisible whitespace (handy for Python code)
  • Grouping of referenced JAR files under a single node in Package Explorer - much tidier!
  • The ability to hide the Console view and have it reappear whenever the program writes to the standard output or standard error streams

I haven’t had much opportunity to examine the changes in WTP yet, but DTP certainly seems to have improved significantly. There is now good support for HSQLDB and PostgreSQL, and query results can be displayed in either tabular or textual formats. One particularly nice new feature is a wizard for creating tables. To be precise, it generates the SQL DDL commands to create a table, and these can then be executed in the normal way, or saved to a file for future use.

I’ve encountered two problems, one minor, the other less so. The minor issue is with the Welcome screen. On my system (Ubuntu ‘Edgy’ Linux, AMD 64), I don’t get the nice graphical version, just this:

Eclipse 3.3 Welcome screen

Perhaps the Welcome screen is constructed using HTML and CSS, and there’s some problem with the CSS? In any case, there doesn’t seem to be any problem with the 32-bit Linux version, which displays the Welcome screen just fine on my PC at work.

The more serious issue (on my home PC, at least) is stability. Eclipse 3.2.2 was rock-solid for me, but 3.3 has locked up a few times already. I’m going to experiment with increasing memory allocation to see if that solves the problem.

Google Calendar: The Saga Continues…

Tuesday, October 31st, 2006

Guess I blogged too soon about the resolution to my problems with Google’s personalised home page calendar gadget. I logged in this morning only to find that all of my November appointments up until 20th of the month had become invisible. They are still there in my calendar, of course — they just aren’t accessible via the calendar gadget on the home page.

If you are listening, Google: I want my November back!

Google strangeness

Saturday, October 14th, 2006

I’ve decided to try googlizing my life a little more by experimenting with a personalized Google home page. Some of the gadgets are quite handy; currently, I have feeds from various Python and Java-related blogs and news sites delivered straight to my home page, along with a list of the last five things that I’ve bookmarked with del.icio.us, the local weather forecast and a Google Calendar widget.

The latter is causing problems, however. I began playing with Google Calendar yesterday, prompted by the sudden failure of an old and decrepit iPAQ PDA and the loss of my entire diary. (No, I didn’t keep it regularly sync-ed with a PC, largely because I’ve not been able to make this work for Linux — but that doesn’t really make me any less of an idiot!) Anyway, the idea of a centralised, shareable diary, accessible from anything with Internet access, now has some appeal. Only trouble is, it doesn’t work properly — or, at least, the Calendar gadget doesn’t work properly.

Basically, I’ve discovered two issues. First, the gadget won’t pick up my calendar data when I sign in to Google via google.co.uk, but will work if I sign in via google.com. Gmail works via either domain, so why should Calendar be any different? The second problem is more worrying. I added two calendar entries for 31st October via the normal Google Calendar page, but the calendar gadget on my home page thinks that these events are taking place on 1st November!

I’ve fired off emails to Google and to the creator of the Calendar gadget, and await their responses with interest…

An Eclipse buglet

Thursday, October 5th, 2006

Filed an Eclipse bug today. Nothing show-stopping - just an annoying little problem with how the Javadoc view displays the doc comment for a class. It’s Bug 159775 in Bugzilla :)

Anticipated releases, past and present

Wednesday, August 23rd, 2006

This summer, I’ve been able to cross off Eclipse 3.2 and Django 0.95 from my “hotly anticipated releases” list. Actually, the latter wasn’t a big deal, given that I’ve been keeping my installation up to date using subversion - but I think formal releases have an important role to play in signalling to the community at large that a project is healthy.

The Eclipse Callisto release was a big deal, given that it included not just the basic SDK but also a host of other stuff like the Web Tools Platform and Data Tools Platform. I’ve been spending some time playing with a set-up that includes these features, plus the Apache Derby plug-in and Subversive subversion plug-in. I’m hoping that this particular set-up will prove to be a great environment for our students, particularly when it comes to project work in their final year.

Two things left on my “hotly anticipated” list are Python 2.5 (currently at rc1 status) and IronPython 1.0 (currently at rc2). I haven’t downloaded any of the earlier 2.5 releases, so I’m looking forward to playing with absolute imports, the ‘with’ statement and the new hashlib module from the standard library. IronPython I have toyed with before, albeit a very early version with many rough edges; it will be interesting to see how polished the final product has become.

I’m just an editor whore…

Sunday, August 20th, 2006

I was scanning Planet Python and found Juri Pakaste advising that “When everything else fails, try Emacs”. Like Juri, I’ve been pretty much seduced by Eclipse for much of my Java development, but for simple, throw-away Java code, or for my Python work, I generally use a regular programmer’s text editor. I have to admit, however, that I haven’t stuck faithfully to one favourite tool over the years.

During my PhD, a long, long time ago, I cut my teeth on MicroEmacs, graduating from there to the ‘real’ Emacs and then, for reasons now long forgotten, switching to Vim. Eventually, like Juri, I “fled back to the tender loving embrace of Emacs”. I was doing a lot of document preparation using LaTeX, and I think the lure of Emacs + AucTeX as a LaTeX development environment back then was just too great.

Just lately, though, the magic has gone from the relationship. I’ve begun to realise how important it is to me to have an editor that is easy on the eyes, given the amount of time one spends staring at it. And, frankly, Emacs fonts just don’t cut it. I guess I could have got myself some anti-aliased fonts by grabbing the very latest, Xft-enabled Emacs source from CVS; instead, I ended up giving Vim another try, and I’m happy with my decision. Vim looks great, I find I’m remembering the key presses for a surprising number of commands, and I’ve even discovered a neat plug-in for LaTeX development, called LaTeX-Suite. Goodbye Emacs, until the next time… :)

I wonder, am I just weird, or do others suffer from a similarly deplorable lack of loyalty to their text editor?