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 »

Addressing concerns over location sharing

May 12th, 2009

I wrote a quick post on Sunday morning about the mobile location sharing hack I wrote at Open Hack London. My post tried to explain the tech behind it, but I wanted to follow it up with a post to explain my thinking around the social innovation in the idea.

Sharing your location with your friends. People have been talking about this for ages, but recently it’s started to hit the mainstream.

More and more mobile phones are coming with GPS. For the ones that don’t, systems like Skyhook and Google Maps for Mobile are getting smarter at using GSM Cell IDs and WiFi access point addresses to work out where you are.

The reaction to this stuff finally arriving for the masses hasn’t all been positive, though. The response to the UK launch of Google Latitude – Google’s mobile application for sharing your location with friends from your Google contact list – is a good example.

A threat to privacy?

Privacy International said that “…Google has created an unnecessary danger to the privacy and security of users…”. They argued that it was too easy for Latitude to be “…enabled by a second party without a user’s knowledge or consent…” and that once enabled it could remain undetected for a long time, with massive potential for abuse.

Liberal Democrat MPs Tom Brake and my local MP Chris Huhne submitted an Early Day Motion to Parliament arguing that Latitude “…could substantially endanger user privacy…” and that “…Google has created an unnecessary danger to user privacy…”.

Tom Brake followed this up with the now widely reported quote that “Google Latitude poses an insidious threat to our hard-won liberties“.

I personally think this was unnecessarily alarmist, but at any rate, it is clear that the model of granting ongoing access to your location (until / unless you revoke it) worries some people.

Read the rest of this entry »

Why I’m giving up on brightkite (for now)

May 11th, 2009

A common simple approach to identifying a user’s location is to give them a text box, and ask them to type in where they are.

It’s not that easy, as I was reminded last night.

I’ve been using brightkite for some time now – a web service for sharing your location.

The mobile site m.brightkite.com lets you update your location from your phone.

I tried updating my location last night from Southampton Airport Parkway train station while waiting for my train home from Open Hack London.

I typed “Southampton Airport Parkway”.

When brightkite isn’t sure where you mean, it offers a list to choose from.

If it thinks it knows where you mean, it shows that one alone.

Brightkite decided that I meant…

Partido Judicial de Pamplona.

In Spain.

Erm… not quite.

Read the rest of this entry »

Fire Eagle Guest Pass

May 10th, 2009

Imagine you are in a town or city. Perhaps one which you are unfamiliar with.

You’ve arranged to meet someone, and want to help them find you.

They’re not a close friend or family member, so you don’t want to sign up with something like Google Latitude which feels like quite a long-term thing for people who want to always be able to see where you are.

You don’t want to have to ask them to sign up for some new service like Fire Eagle just to find you.

Maybe they’re a client coming to meet you for a meeting. You want to help them find you, but you’re not sure that you want them to be able to see where you go after the meeting, or what pub you go to that evening.

This is the sort of thing that “Fire Eagle Guest Pass” – my hack entry for Open Hack London 2009 – was written for.

I’ve put together a few pictures to explain what it does on slideshare. They’re not exactly fine art, but hopefully they explain the idea :-)

Read the rest of this entry »

Pretty CurrentCost graphing from Pachube

April 28th, 2009

Last Saturday was the second HomeCamp. This week has been very busy at work, so I’ve not had the chance to pull together a proper post about it yet, but in the meantime I thought I’d share a little Pachube tip that Usman demonstrated at the event.

I’ve been putting the live readings from my CurrentCost meter into Pachube as an input feed for several months now, but not really had much use for it, other than as an easy way to check my CurrentCost data from my mobile.

Usman showed us an app that lets you get a neat Google chart visualisation of a Pachube feed in just a few clicks:

It’s very simple – go to apps.pachube.com/google_viz, give it the ID of your pachube feed, and it generates the short snippet of code necessary to create the Google chart.

It takes no time at all, and really shows the power of being able to easily pipe together different stuff through pachube.