Many Pies

Many Pies

Wednesday, February 26, 2014

Google Now, Berg and our washing machine

Google Now is the thing on the Google mobile app which displays "cards" containing hopefully helpful information, like how long it will take you to get to work. I liked the idea, but as my journey to and from work usually takes the same amount of time, it was never really much use. I was going to blog about the sorts of cards I'd like to see them do, but I could only think of one thing: tell me how long is left on the washing machine.

However, now those clever people at Berg have done something even more useful - made a washing machine tell you when it's finished.
Here's the short version of the news. Here's the long technical explanation with lots of juicy detail. The Guardian have picked up on it too.

Update (later the same day): our washing machine must have read this blog post and got worried because its gone on strike. :-(

Monday, February 10, 2014

Happy (slightly belated) Birthday Mac!

My first encounter with the Apple Mac was on a project I worked on for what was then Powergen when I worked at Logica. The computers we were developing on were mini-computers, which were about the size of a two drawer filing cabinet. Well kids, I expect you find it strange to hear something so big described as a "mini" computer, but that shows how big the normal computers were. The Macs weren't up to running the software for managing electricity operations, but they were good at drawing the Yourdon diagrams we used to design the software. The software to do that was pretty good. One of my memories of those days was, following a project meal where a lot of alcohol was consumed, someone came in looking rather worse for wear. He took one of the Macs under his arm and headed home again, presumably to do some design diagrams in a darkened room. In time PCs replaced them as the tools for doing the graphical stuff we needed to do, but for a while they just fitted the job.

Stephen Fry has a really good blog post about the Mac, including a bit about something I wasn't aware of - when Steve Jobs nearly met Tim Berners-Lee, but not quite.

Wednesday, February 05, 2014

Should I cycle to work or not?

With the @wycombeweather twitter bot and the UK Weather Little Printer publication that I've created you may detect that I have an interest in the weather. Now because I'm a wimpy cyclist I've created something that will tell me whether the weather is suitable for cycling.

It scrapes the BBC weather page looking for the weather conditions and temperature at two times of day (going to work and coming back) and sees if they fit my wimpy criteria for weather that I will cycle in. It then tells me whether to cycle or not. The idea is that I somehow get this information when I get up in the morning and use it to decide what to dress in. Maybe I could get a Raspberry Pi to turn on an LED based on what it tells me. In practise I'm probably going to look at the whole forecast for the day, as it it's been showery, even if the prediction at 5pm is that it isn't going to rain, there's a chance that it will and so I won't cycle. Still, it's fun to create it.

"It" at the moment is currently one web page which is in partial debug mode in that it tells me the conditions at the two times so I can see what the decision is for each of those conditions.

It's not just for me though - you can use it! By supplying query parameters to the URL you can specify your own postcode (UK only), times of day, min and max temperatures and the acceptable types of weather that you're prepared to cycle in. Here are the names of the parameters:

  • postcode - just the first bit, e.g. HP14
  • mintemp - a number
  • maxtemp - a number
  • firsthour - a number, e.g. 6 for 6am, 17 for 5pm
  • secondhour - as firsthour
  • goodweather - a comma separated list of words with %20 instead of space
For those words, as I had the @wycombeweather twitterbot running for a number of years I could mine the archives and get a definitive list of words the BBC have used for the weather. When I started work on this though I discovered that sometimes words were used for an hour slot that weren't used for a summary of a day. So this is all the words I know about:
  • clear sky
  • cloudy
  • drizzle
  • fog
  • foggy
  • grey cloud
  • heavy rain
  • heavy rain shower
  • heavy showers
  • heavy snow
  • light cloud
  • light rain
  • light rain shower
  • light showers
  • light snow
  • light snow shower
  • light snow showers
  • mist
  • misty
  • partly cloudy
  • sleet
  • sleet showers
  • sunny
  • sunny intervals
  • thick cloud
  • thunder storm
  • thundery shower
  • white cloud
So for example, if you live in Birmingham and you'll only cycle when it's sunny and warm you could use this URL:,sunny%20intervals
If you run this after 9am you'll get a "(not found)" for the first hour slot.

All the code for this is on github. You can see the work I've yet to do on the readme there. At the time of writing the next thing is to make it easier to specify your own preferences without creating a big URL, and then to store those in a cookie.