Archive for July, 2008

Revisiting a Windows GUI for CurrentCost

Monday, July 28th, 2008

tweaking the CurrentCost GUII spent a couple of evenings last month knocking together a quick example of a Windows GUI for the data you get from CurrentCost home electricity use monitors. And then promptly put it to one side and kinda forgot about it.

As a quick recap, I created a Windows app which grabbed the history data from the CurrentCost serial output, and drew a few bar graphs from it – to represent the hours, days, and months data. The app also persisted the history data in the user’s “Application Data” folder, so that older data is kept by the GUI even after it is lost by the CurrentCost meter itself.

I’m thinking about picking it up again, so spent a bit of time idea-storming what I could do with the code. These aren’t all my own ideas – they’re a random collection of ideas and notes taken from discussions with others. I’m posting them here for feedback – new ideas are welcome, as are comments on the usefulness of the stuff I’ve suggested.

(more…)

Improving TwitToday – more Today Screen coding

Wednesday, July 23rd, 2008

Twitter client for Windows MobileApart from adding the ability to initiate an internet connection, my Twitter widget for Windows Mobile Today screens is still virtually the same code as I wrote in a few hours overnight at the Over The Air hackday.

Which isn’t great – as I know there have been a bunch of people waiting for me to make some fixes and add some basic features.

Tonight I had a bit of time to spare, so I finally dug out the code to start making a few improvements:

  • Background worker thread
    Today screen widgets are compiled into DLLs. They aren’t a separate executable, and are run by the Today Screen in the Today screen’s (i.e. explorer.exe’s) flow of execution. When the code tries to post to twitter.com, explorer can’t do anything else until that’s finished.

    That might even be tolerable with most websites, but with twitter – which is known to fall over from time to time! – it means TwitToday could effectively hang your phone for ages until the HTTP post timed-out.

    Not good. Now it does all the HTTP work in a background thread, so you can get on with other stuff while it tries to send your tweet.

  • SIP support
    This was asked for a lot. The Today screen doesn’t include the button to show/hide the on-screen stylus/finger keyboard. So if your mobile doesn’t have a keyboard, TwitToday wasn’t much use.

    I’ve added a setting now that lets you programmatically show the SIP keyboard when you tap on the text box.

If you want to try the new version, you can download it from here. If you want to see how I did it, read on.

(more…)

Who can we trust with children?

Sunday, July 20th, 2008

I took Grace to a birthday party yesterday morning for one of her friends. It was at a soft-play centre in Southampton – in many ways, an ideal place to have a birthday party for a group of excited three and four year olds. Except, as we went in, I noticed a sign:

“In the interest of CHILD PROTECTION, photography is NOT PERMITTED”

It’s such a shame – because when it’s your own child’s birthday party, of course you want to get photos of them playing with their friends on their big day. But his parents weren’t allowed to do that. Because of “child protection”.

It’s not to say that I’ve not seen this before – all of the soft-play centres I’ve taken Grace to have the same rules, and we had the same thing at Grace’s birthday party in the Marwell centre. But I noticed it more because it reminded me of a discussion from Thursday night. Thursday night was a training session for a youth mentoring programme that I’m a volunteer with, and someone mentioned something they’d seen discussed in an interview with Esther Rantzen on GMTV. The story goes that a parent was arrested for taking photographs of their own children in a public playground. It sounded pretty shocking – over the last few years, I’ve probably taken hundreds of photos of my girls in our local park, and I wouldn’t think of that as being even suspicious, let alone something warranting arrest!

(more…)

Fun with MQTT

Friday, July 18th, 2008

I’ve been quiet for the past month or so, as I was keeping my head down to finish a project at work. It’s done now, so now is a good time to crawl back out of my cave and share a bit about what I’ve been up to. This was for a customer who outsourced a software development project to us.

Some quick background: MQTT is a publish/subscribe messaging protocol that IBM products like WebSphere Message Broker can speak.

Our customer wanted an MQTT library written for the real-time embedded firmware that runs on their products. This client library needed to provide the API of the MQTT specification, implemented within the constraints of an embedded platform with significant resource constraints, and only a subset of the standard C OS functions (e.g. no multi-threading, no dynamic memory allocation, no malloc/realloc/calloc, etc.).

(more…)