HCI and Number Entry

I’m working on a new arduino project at the moment and for it to work, I need the arduino to be able to tell the time.

To make this work, I decided to use the Arduino Time Library (specifically the updated Time library). I was going to use the TimeSerial sketch. I expected this would be an easy task, and indeed it did look straight forward, with nice simple functions to call up the hours (hour()), minutes (minute()) and seconds (second()).

However, despite this, I really struggled in working out what the actual time was. And I’m not sure if it was just that it was late at night, and my brain wasn’t functioning at its fullest, but I really could not find an easy guide anywhere. After lots of trial and error I worked it out, and here, for you, is the tutorial of how to flipping get the flipping Time Library to work.

Know the software to use

I didn’t get this, but you will need to use both the Arduino IDE and Processing. For some reason I thought it was the case that you use one or the other. The Arduino IDE talks to the arduino, and Processing is responsible for getting the time.

Know the programs to run

You will need to run two programs: TimeSerial (in Arduino IDE) and SyncArduinoClock (in Processing). Get these both opened in their respective software.

Edit the Processing sketch

Now what’s going to happen, is Processing is kind of going to “jump start” the Arduino and give it the time at a certain time point. The arduino is capable of keeping time (if it has power) once it knows what the time is initially. So you need to get Processing talking on the right port. When I opened it, the line “public static final short portIndex = 0;” was set to 0, which is a bluetooth port. When you run it, it will try and talk to bluetooth, which wasn’t useful to me. But what was useful, was that in the terminal window at the bottom of Processing, it told me what was on each of the ports. Reading this I saw this line “[4] “/dev/tty.usbserial-A600bMH2″” and so changed the line of code to read “public static final short portIndex = 4;” so that it was now talking to the right port.

Start your engines (in the correct order)

This step got me for a while, you need to start your sketches running in the correct order. If you start Processing first then Arduino complains that it can’t get to the port it wants to. So, start the TimeSerial arduino sketch, in Arduino. If you open the Serial viewer, you’ll see a message that says “Waiting for sync message”. This is because it is waiting for a message from Processing.

At this point, start the SyncArduinoClock Processing sketch. A box will hopefully appear that says “Click to send time sync”. Click it.

You should now see in the Arduino serial monitor that there is a lot of weird text appearing. That is because it’s trying to count for itself, and also receiving sync messages from Processing. Go back to Processing, and stop that sketch running. And back to Arduino, and hopefully, you should be getting a nice neat print out of the date, and time every second.

You’ll never be late for anything again.

Hope that helped someone avoid the long hours of struggle trying to understand how to get the stupid thing to work!

I am came across a post on reddit recently (in the wonderful subreddit “mildlyinteresting“, I’d recommend it if you like your internet entertainment mild) in which someone had put some numbers into the Google Translate engine, and got some interesting results. It turns out, that when you write a list of numbers, each with a full stop after them, and tell google you’re translating from Spanish to English, that some odd things happen.

1. translates as 1., but then 2. translates and Two. (the same happens for 3./Three.) but then, and here’s where things get really mildly interesting, 4. translates as April, as do the next four months.

Go home Google Translate, you’re drunk etc. The interesting thing about this is the settings that are required to make this happen. There have to be dots after every number, without them google is boring and translates the numbers to numbers. This tells us something about why google is treating “5.” as May. Google has learnt (through user feedback and various algorithms) that when there’s a dot after a number, it’s likely to be a date. BUT JUST IN SPANISH. When you set the source language to things other than Spanish, google now decides that 4. is 4. Why on earth should this be the case for just Spanish text? I do not know the answer, do you?

Other languages do produce interesting results, translating from Armenian causes semicolons and parentheses to appear all over the place (link here). Then there are those that mix and match when words or digits are used. When translated in Catalan, the first five numbers translate as “First. Two. Three. Four. 5.”. A translation in Romanian will have the first 9 numbers translated as months apart from 3.

A Belarusian translation makes all the numbers ordinal, and rather cryptically translates 3. as “The Third”. (WHAT IS SO SPECIAL ABOUT 3?!) Is this a result of Kings and Queens in Belarusian history? A quick look at the wikipedia article shows there are indeed some people who are “the third” but there are equally some “the seconds” and “the fourths” out there. Mysterious.

This translation quirk highlights the fact that a single digit can represent a whole range of things, depending on context. It is only because these numbers have been taken out of context that it seems odd to us. In the date today 20.8.13, it’s obvious that 8 stands for August, and that 20 should be read as twentieth (if you’re reading the date in the UK). When we see a digit, we see a whole range of different things. And this, dear readers, is one of the reasons that studying number entry is cool and interesting and a reason to be friends with me.

As you have probably gathered, I am really interested in Number Entry. I’ve been thinking a lot about how we enter numbers – whether we think of them as a series of digits, or as full numbers. This has implications for the way we might ask people to enter numbers on an interface.

I was given an opportunity to test this out recently at the CHI+MED interface hack day. Last Friday (9/8/13) a group from CHI+MED came together at Swansea university to hack some interfaces to investigate novel number entry methods.

I got a chance to play with some Sifteo Cubes. Sifteo Cubes are fun little blocks with screens that are aware of which other blocks they are next to. This allows for some fun physical interaction, with the user picking up and moving the blocks around.

At a previous idea generation session, we came up with the idea that you might want to let a user enter numbers on the sifteo blocks using both a digit and number strategy. The difference between the two meaning that you could either control the number digit-by-digit (that is, incrementing the digit 9 in the number 659 would result in 650) or by controlling the whole number (that is incrementing the digit 9 in 659 would result in 660).

Using one Sifteo block as the “controller” and the other two as the numbers, I created a system to allow the user to enter numbers using any strategy they like. See the video for an example. You can see that they can control each block separately. When the blocks are joined, the entire number can be incremented (by placing the control block to the left or right) or just the digit can be changed (by placing the control block above or below).

Programming the Sifteo blocks was an interesting challenge. You need to program in C++ (a language I haven’t looked at for a few years) and at first, reading the example code was a bit daunting. But after a while I managed to hack it together. The really strange thing about doing this was working with images. Unlike many programs where you can directly write text (or numbers) to the screen, when programming for the Sifteo cubes you are dealing with lots of static images, and swapping them in and out as you need. Meaning in my application in the video, I have 10 different image files, one for each digit.

I enjoyed the experience of hacking and playing with the blocks. I think there are some interesting questions that could be explored using them. We will see!

A few months ago I was contacted by someone from the EPSRC magazine, Pioneer. They were interested in my Bright Club sets and wanted me to write an article about the experience of expressing academic research through the medium of stand-up. I was honoured to be asked and was very glad to agree. I think Bright Club is a truly fantastic idea and I was happy to have the opportunity to talk about it!

The first thing to do was the photo shoot! This was quite amusing for me. I met Mark (the editor and photographer) and we went to the Union bar that I’d picked out for it’s stand-up club-looking-ness. I then went on to pose with a microphone for an hour or so. I kept forgetting how to smile, Mark had to tell me to stop, move my face around, then try again. Any way, after that, we go a shot that would be used in the magazine! I’m pretty pleased with it, it looks proper professional (see below).

Then, once that was done, I came to writing the article. Writing about Bright Club and my experiences can easily, perhaps too easily, I overshot the word count by a bit. But luckily Mark was able to edit it down and finally, this month, the article had its debut in Pioneer edition 10. The article can be seen in the online magazine (see page 36).

It was a really fun experience, both the photo shoot and writing in a new style (it was nice to get away from the academic paper format). I’m thankful to Pioneer magazine for giving me the chance to write the article!

Last year I was lucky enough to receive a bursary from UCL which allowed me to go to Cheltenham and attend the Science Festival for the week. It was an incredible experience, I saw some fantastic talks and debates, and also got a chance to catch some less well executed events. I had a chat to a few of the speakers and had a superb time. I am debating now whether or not to sign up to volunteer this year to ensure I can go again…

Whilst thinking about it, I realised I didn’t share any of the blogs I wrote whilst at the festival. So here they are!

The first: “Thinking about robots thinking” is a piece on the debate about the legal implications of robots becoming ever more intelligent. The debate covered a vast range of topics from robots that are able to kill, to robots that are able to experience pain.

The second blog is about a topic very dear to my heart: bees. The title of the blog is very witty and intelligent, “Who knew honey could BEE so interesting. Get it? Get it?“. This blog recounts the brilliant interactive talk about the Science of Honey (and features an illustration drawn specially by Matteo Farinella of neurocomic). It was a fantastic event, combining information about the chemical composition of honey, with the maths of honeycomb creation, to the history of human’s relationship with bees. It was absolutely fascinating.

In a move that will only cause me to get abuse from my colleagues, I’m about to tell you about a super fun little maths problem I’ve been working on this evening. To make it even more likely that I will be called a nerd/geek, this problem was inspired by a photo of a number pad I took a few days ago. Here is the photo, and here is the story.

This photo was taken in a bank. It was also taken with a lot of espionage skill. It’s the number pad on the back of the cashpoint. This is inside the bank, and will be used when the cash in the machine needs to be stocked. If you wanted to steal the money from the machine by going in this way, you’d need to know the PIN. Which makes the security of that PIN pretty important.

Now, I know the photo is blurry (I didn’t have time to take a decent photo else they’d have thought I was casing the joint) but you can see that some of the keys are brighter than others. This is an example of a Desire Path (which is a post I still need to write about). A desire path shows you how people really truly want to use an object. The cleaner keys show you that these are the ones getting regular use, the dirty keys are not getting pressed as much. The reason this is interesting is that I now know which numbers are used in the PIN of this entry system. Awesome.

Now this made me started thinking about the security of such a system. If you, for whatever reason, can’t avoid giving away which numbers you’ve pressed on one of these key pads, how can you make sure you’re choosing the most secure set of numbers? Just choose any four numbers and hope that the fact the person trying to crack it can’t tell which order you typed them in? Well, as it turns out, no that’s not the best strategy.

If you know that my PIN involves the numbers 1, 2, 3 and 4 then that tells you my PIN is one of 24 possible different combinations, because the order you use those numbers matters. My PIN might be 1234 or 4321 or 1243 or 2314 and so on. So choosing 4 different numbers for the PIN for this machine in the picture means a potential thief would have to guess up to 24 different combinations. Which actually, isn’t that secure.

This is where the maths comes in, what happens when the PIN involves a repeated number? In this case, only 3 of the keys on the number pad would be clean, rather than 4, as one key would be pressed twice. For instance, if the PIN was 1233, only the number 1, 2 and 3 would be clean. It may seem counter intuitive, but this approach actually increases the security of the PIN in this situation, even though it uses fewer numbers. The reason is it adds an element of uncertainty to the mix, there are now three different sets of four numbers that coud be used in the PIN. If 1, 2 and 3 are clean, the numbers in the PIN could be 1233, or 1223 or 1123. Even though there are fewer ways to arrange these numbers, because there are three is actually means that knowing the three numbers used in a four digit PIN means the thief would have to try up to 36 different combinations of numbers.

So my advice to the bank, after doing this maths is that they should pick a PIN with only three different numbers in it, not one with four. Or they should just clean the number pad, it looks kind of gross.

(The maths in the post was a series of permutation calculations, I’ve saved you from having to read them but if you’re interested I can share. Maths is cool.)

A few weeks ago I had the opprtunity to perform another comedy set at Bright Club. It was a brilliant night, everyone on the bill was fantastic. I learnt about treatment windows for antibiotics, stressed shapes and using physics to treat cancer. It was equal parts fascinating and funny.

The set that I wrote was about errors. The video, as with my other attempts at stand up, can be found on my youtube channel. Or here.

Today’s xkcd comic made me oh so happy. Mainly because Randal Munroe (the comic’s creator) and I are clearly incredibly cool people who are fun to talk to at parties.

As someone who never sets their alarm to a number ending in 0 or 5 (I woke up at 06:56 this morning) I can sympathise with the character in the comic. But more importantly, this is an example of number frequency information being used for humour! Yes!

It reminded me of the one other time I have seen this done. In the TV series Nathan Barley the title character extolls the virtues of his Wasp T12 Speechtool phone. Aside from built in decks and anti-shark technology, “It’s got a massive number 5 because thats the most common number.”*

Now I’m not saying that this phone is the entire reason for my most recent research. But. Well. Maybe it is*?

*Almost definitely not true but hard to prove. Also look at this asterisk efficiency.