A Fire Eagle updater for Windows Mobile

August 13th, 2009

I wrote a Fire Eagle web service at Open Hack London a few months ago – that gave a nice, mobile-friendly way to share your current location, as stored in Fire Eagle.

Last week, I finally got round to updating my Fire Eagle Guest Pass web service to use the newer OAuth 1.0a.

This got me thinking that I haven’t used it very much since writing it in May… because while it let me share where Fire Eagle thinks I am, I didn’t have an easy mobile-friendly way to tell Fire Eagle where I am in the first place! 🙂

So while I had “how to do OAuth” fresh in my mind, I thought I’d start writing a quick mobile Fire Eagle client.

I wrote it in C# for Windows Mobile. There are a few interesting points in the code that deserve their own blog posts, but first I wanted to quickly show what I’ve got working so far.

Read the rest of this entry »

What programme was on Channel 4…?

July 28th, 2009

I posted yesterday about my quick play with the BBC Web API for programme schedules. I wanted to be able to programmatically find out what programme was on a particular channel at a given time.

The problem with the quick code I came up with was that it only gets me BBC channels. What if I want to know what was on a non-BBC channel?

Andrew pointed me at the Radio Times website, which makes programme schedule data available in XMLTV format.

And Dom pointed me at a neat Python library for parsing XMLTV data.

Read the rest of this entry »

What programme was on BBC1 at…?

July 27th, 2009

After my absence, I thought I’d come back with something quick and fun – the result of half an hour’s playing with a new (to me) API.

The problem that I wanted to look into was: What programme was on TV on a given channel at a given time?

And how can I find this out programmatically?

The first thing that I came across was the getProgrammes service in the beta BBC Web API.

As I expect from the forward-thinking BBC, it’s pretty awesome: a simple API that gives you an XML document containing the programmes schedule for the specified time window.

The documentation on the BBC site is pretty self-explanatory. It gives all the information you need to start playing with the API – either using the form on the BBC page, or by sending it a few requests using wget.

Read the rest of this entry »

I’m back!

July 27th, 2009

I’ve been a little quiet on things like twitter recently, and silent on my blog here. Work has been very busy for the past month or so, and everything else kinda got put to one side while I focused on it.

It was an interesting project: an interesting mixture of IBM server products and web development, including following James into the wonderful world of iWidget development.

But – after 8000 lines of JavaScript, 500 lines of Java, 15,200 words of documentation, and 6370 miles of customer travel – it’s all done and delivered.

Woot. I’m back. Normal deranged service will be resumed shortly. 🙂

Improvements to TwitToday

June 10th, 2009

I’ve been doing too much Java at work recently, so in the interest of keeping my hand in with some low-level C++, I picked up the code for my mobile twitter client, TwitToday, again.

I originally wrote it at a hackday, but I’ve since come back to tweak it a couple of times to get it to spawn background worker threads, add SIP on-screen keyboard support, and improve support for sending special and accented characters.

After another evening of tweaking, I’ve added a few new minor features:

Transparent text box

When not in use, the text box is now transparent. When it has focus, it is coloured in white as usual.

A few people commented that a bright white text box could dominate a dark Today screen too much, so this is hopefully a nice aesthetic improvement.

I did this by creating a custom windows procedure for the text box.

The windows procedure needed to handle a couple of events:

Handling WM_PAINT by using SetBkMode to make the text box TRANSPARENT

Handling WM_ERASEBKGND by using TODAYM_DRAWWATERMARK to draw the background over the text control’s rectangle.

Read the rest of this entry »

How to customise the NavigationToolbar2 toolbar in matplotlib

June 6th, 2009

My CurrentCost desktop software is written in Python, and uses the matplotlib library for plotting graphs.

I am a big fan of matplotlib – you can create some very cool graphs with it. It’s not without it’s issues… for example, I’ve still yet to work out how to do realtime graphing with it that isn’t massively inefficient and resource intensive. But that’s for another post 🙂

One of the nice things that you get with it is a toolbar that lets the user switch between different modes that the mouse supports – zooming, panning, and so on.

Adding the toolbar is straightforward – I create an object of the class NavigationToolbar2Wx and add it to a sizer which in turn I add to the graph Plot.

self.toolbar = Toolbar(self.canvas)
self.toolbar.Realize()
sizer = wx.BoxSizer(wx.VERTICAL)
sizer.Add(self.canvas, 1, wx.EXPAND)
sizer.Add(self.toolbar, 0 , wx.LEFT | wx.EXPAND)
self.SetSizer(sizer)

The NavigationToolbar2 toolbar provides a number of features but it doesn’t exactly meet my needs so last night I had a go at customising it.

I wanted to:

  • remove the configure subplots button – as I don’t use subplots in my graphs
  • add a couple of new buttons – for different navigation abilities

I couldn’t find this documented clearly anywhere, so thought it was worth sharing the code that I came up with.

Read the rest of this entry »

HomeCamp 2

May 20th, 2009

Saturday 25th April saw the return of HomeCamp. HomeCamp started last year as the brainchild of Chris Dalby, aiming to bring together a growing community of people interested in “green” hacking and technologies.

I’ve had this post sat in draft for weeks now, meaning to come back and turn them into proper notes. As it’s been a few weeks now and I still haven’t, I thought I might as well post my rough notes as I took them on the day. Apologies that they’re a little sketchy!

Read the rest of this entry »

How old should charity trustees be?

May 19th, 2009

I commented on an interesting blog post about young charity trustees a few weeks ago. By chance, I came across the post again today, and noticed that my comment wasn’t there – presumably swallowed by spam filters as it had quite a few links in it.

I still have it in my cache, so I thought I’d add an intro and re-post it here, so it gets to see the light of day 🙂

The age of charity trustees is a topic which comes up from time to time, particularly amongst those of us who work in youth volunteering charities.

For readers from the corporate world, it’s perhaps worth some quick background about trustees. The best analogy for a charity trustee is company director. As with companies, many charities (including my own) employ full-time staff, whose job and career it is to work for. We also employ a full time manager – in our case, a ‘Chief Officer’, who is responsible for running the organisation. In all operational respects, they are in charge.

Trustees are similar to company directors (except that we don’t get paid!). In the same way that corporate CEOs have to answer to a board of directors, a charity Chief Officer is responsible to a board of trustees. The trustees are responsible for strategy, for long-term planning, for direction. The trustees define where they want the organisation to go in broad terms, while it is the staff under the direction of a manager or Chief Officer who put in the hard work to make it actually happen.

Another analogy from my experience are schools. The headteacher is the boss for the day-to-day running of a school, but they have to answer to a board of governors, who are responsible for framing policy and setting direction.

(In reality, the line between what is operational and what is strategic can often be a little fuzzy, so it’s essential that a manager and the trustees work together in partnership.)

So the question that the original blog post was looking at was about who is suitable for such a role. Someone who can look at the big picture. Someone who can help create a vision for how the organisation could be, and help define the strategy and direction necessary to make that a reality. Someone mature enough to be responsible for the many legal obligations that come with trusteeship, such as responsibility for the finances.

And in particular, how old do you need to be to be suitable for such a position?

Read the rest of this entry »