My first experience using BlueVia APIs

October 2nd, 2011

I wrote yesterday about a quick hack I did at Over The Air using the BlueVia API. I thought it was worth a quick post to show just how simple it was.

Read yesterday’s post for background to the idea behind the hack, but in essence, what I wanted was:

  • monitor the location of my mobile phone
  • send an SMS to a different mobile number when my phone goes into a predefined known area

BlueVia provides an API that let me doing this using network operator data. In other words, nothing needs to run on my phone itself as location data is obtained from where O2 thinks my phone is.

This means there is no battery-life impact on the phone for this monitoring.

It also means this will work with any phone – from iPhones and Androids to cheap feature phones.

The whole thing took me less than an hour and needed only 90 lines of Python.

This is how I did it.

Read the rest of this entry »

Over The Air 2011

October 1st, 2011

I’m back from Over The Air 2011 – a mobile tech conference with an overnight hack-a-thon challenge.

This was the fourth year I’ve been to OTA, and I normally submit some random hack.

In fact, this is the first time I didn’t stay up all night, in a 15-hour non-stop coding splurge writing a massive, over-ambitious beast of a mobile app. I must be getting old… this time I wrote a couple of quick hacks, each of which under a couple of hundred lines long, and had eight hours sleep instead. Much more civilised.

This is what I managed to come up with:

hack 1: a crap husband helper

photo of a hack

Sometimes I stop at the shop on the way home from work because I want something. Invariably, I don’t think to check with Amy if we need anything. I get home with a shopping bag, and get something along the lines of “Why didn’t you tell me you were going to the shops? We need nappies.” At which point, I feel like I should dutifully volunteer to go back out to the shop.

Going to a talk on the BlueVia API gave me an idea.

I wrote a bit of Python to run on my home server, that will keep an eye on where my phone is using the BlueVia Location API.

If I go near the shops, it will send a message to my wife using the BlueVia Send SMS API, to say “I’m near <insert shop name here>, do you need me to get you anything?”.

90 lines of Python is all it takes to make me look like a thoughtful and considerate husband. Huzzah.

Read the rest of this entry »

Making a birthday e-card

September 24th, 2011

Today is Amy’s birthday – which means that I’ve been helping the kids with present making.

Grace’s idea for a homemade birthday card was particularly geeky, so I thought it was worth a quick post.

The idea was that she’d design an e-card, and record a variety of voice clips, which would be played when you clicked on various bits of the card. She did after-school French lessons last term, and she hears some Greek from my mum, so she’s kind of interested in the idea of other languages. So we came up with the idea of a card with a Happy Birthday message in lots of different languages.

It turned out that my multi-lingual efforts to assist her were a bit lame, so I convinced her to scale it down from “Happy Birthday” in dozens of languages to “I love you” in nine langauges. We settled on a design with a bunch of flags – clicking on a flag plays Grace’s voice saying “I love you” in that language.

It looked like this, but click through here for the live version.

flagscard

It was pretty simple, but I thought I’d share a few comments about how we did it.

Read the rest of this entry »

Annotating photos with tweets

September 11th, 2011

I have a lot of digital photos.

An insane amount – something like 40,000 photos that go back over a dozen years since I first got a digital camera at University.

I store them based on the date that they were taken, using a folder structure like this:

screenshot of folder structure where I store photos

For a while, I used to drop a readme.txt text file into some of the folders saying where the photos were taken or what I was doing. This was partly so that when I look at the photos ten years later I’ve got something to remind me what is going on, but mainly to make it possible for me to search for photos of something when I can’t remember the date it happened.

But in recent years, I’ve been too lazy to keep that up, and rarely ever add a readme file.

I thought that my tweets might be a good alternative. There is a reasonable chance that if I took a photo of something interesting, that I might have tweeted sometime that day about where I am or what I’m doing.

I wanted to populate each of my folders with a day’s photos in it with a tweets.txt text file containing tweets posted on that day.

Read the rest of this entry »

Counting my key presses

June 3rd, 2011

Overview

Counting and visualising which keyboard keys I press the most often

keypress distribution

Background

the left Ctrl buttonI noticed something yesterday.

The lettering on my left Ctrl button is a lot more faded than the lettering on my right Ctrl button.

I must press the left Ctrl button more often than I do the right one.

That got me looking at the rest of the keys on the keyboard. Some of them are faded, too. Some a little, some a lot.

the right Ctrl buttonI must press some of those keys more than I do others.

I’ve played hangman, so I know that there are some letters that occur more frequently in English words than others. So I could have just said that those are the keys I probably use the most and left it at that.

But… I don’t spend that much time writing documents or large chunks of English.

I’m a code monkey. I’m not sure that distribution would necessarily apply to me.

For example, I probably use the semi-colon key quite a lot – at the end of every line when writing in some languages. That wouldn’t be true for people writing English.

So I wondered how much I use each keyboard key in comparison to each other.

Being an obsessive compulsive geek, I couldn’t leave that as an idle wondering. I had to find out. I had to go and get the data.

Read the rest of this entry »

Where did I meet you?

May 31st, 2011

a vcard importer for AndroidOverview

A bit of Android code to add comments to contacts imported from vCards to remind you how you know the person behind the vCard.

Background

Remember poken? (Actually, “remember” isn’t fair, because they’re still around. I’ve just not seen them in an age.)

If you don’t, they were key-fob-sized gadgets. When you met someone, you tapped your poken against theirs, and it would handle exchanging contact details. They were a geeky way to exchange business cards.

They suffered from a bootstrap problem, in that, finding anyone else with a poken to tap against often proved a challenge. But I digress…

What I loved about them was that it didn’t only store the contact details, but details about when you met.

Read the rest of this entry »

Joining Watson

May 27th, 2011

I’ve gotten into a habit of using this space to record when I change jobs. It’s kind of useful – for example, a quick search here is an easy way for me to check when I left the WebSphere Process Server team.

With that fairly flimsy excuse out of the way, this is a post to say that I’m moving again!

For the last few years, I’ve been working as an Emerging Technologies Specialist. I’ve explained what that means before, but essentially we try out emerging technologies to solve customer problems, as one of the ways to inform the development of future IBM software products. My projects are typically short-term, rapid prototyping.

It’s meant that I’ve got to try out some very cool technologies including some fascinating things from our Research labs. But the most inspiring thing I’ve seen come out of Research for many years has been IBM Watson.

Read the rest of this entry »

Your Google Latitude history as a heatmap

May 8th, 2011

Overview

I made a web tool that draws a heatmap to show where you’ve been if you upload your history file from Google Latitude.

What I made

See a heatmap of where I’ve spent the most time at heatmapforlatitude.appspot.com.

If you like it, you can upload a Latitude history file and make a heatmap of your own.

Read the rest of this entry »