All posts by martin

Unified Diff and recruiting Guest Lecturers

Last week I gave a quick lightning talk at UnifiedDiff – a local tech meetup here in Cardiff. The main point of the talk was to try and recruit more industry involvement for our new MSc in Computational Journalism – preferably by getting some web developers and software engineers in to give guest lectures on the tools, languages and processes they use.

The talk went well, and I’ve had several offers from people wanting to get involved and add some real value to the course, which is brilliant. Of course, there’s always room to add more, so if you’re interested in coming and talking to our students, get in touch!

If you’re interested, the slides from the talk are here

 

Us, family and friends at our wedding

Wedding!

On the 25th May 2014, after many years of procrastination and denials that we would ever get married, Lisa and I finally tied the knot. It was a superb day, plenty of fun was had by all, and I thought it was worth writing a little bit about some of the companies, suppliers and individuals who helped make it so good. If you’re planning a wedding in Shrewsbury or Shropshire, you can do far worse than to ask these guys for their help:

Venues:

Shrewsbury Castle

Shrewsbury Castle

The ceremony venue was in what is almost the ‘default’ venue for civil ceremonies in Shrewsbury: Shrewsbury Castle. You can’t use the word ‘fantastic’ enough when you’re talking about the castle – it really is a great venue. We got married there, my mother got married there recently, and our friends got married there before her. It’s limited in terms of the numbers you can have in the ceremony itself, but that really didn’t bother us, and so the castle was the obvious choice. Ian (the castle custodian) was really helpful, from our first contact onwards. He was always available to answer questions, and on the wedding day he worked really hard to help everything go smoothly. Such a lovely, friendly chap, we knew we could relax about the ceremony as he had everything under control.

Drapers Hall, Shrewsbury

Drapers Hall

The reception venue was Drapers Hall, a great restaurant just around the corner from Shrewsbury Castle. When we visited home in 2013 to look for venues, I thought this was kind of a strange option – it wasn’t anything like the more traditional hotels, country houses and renovated barns that we were looking at. In the end, I think it was that fact that made it perfect. We spoke to Nigel, who runs the restaurant, about our wedding, and from the moment he started talking about food, describing the kind of thing he could make for the wedding breakfast, and then for the evening reception, we were sold. Because he wasn’t a hotel trying to sell us a ‘package’ deal, we were able to tailor everything to our own tastes and needs. The venue itself is amazing; a great old Shrewsbury building, full of history, and decorated with a mix of old and new that works so well.

Dessert - chocolate fondant

Inaccurate Dessert!

The food was glorious – all our guests got a choice of starters and main courses, and they all tasted and looked amazing. The staff were great, very helpful, always on hand without being overbearing, and nothing was ever too much trouble, all evening. We had a dedicated contact all day, who introduced himself to Lisa as she was wandering the halls the evening before the wedding (unaccustomed to having nothing to do) by saying “Hi, I’m Tim. I’ll be your guy for the wedding day”. He totally was our guy; whenever we needed something, he was there to help. He kept us up to date with plans and timing, and managed the whole event to help it go off smoothly.  The rest of the staff were also consistently brilliant, doing everything from re-making a playlist on spotify at short notice, to dealing with some idiot (me) knocking over the celebration cake in the middle of the evening party. The rooms in the hotel are glorious, and there are only six of them, so you can restrict who you invite to stay over! I was so pleased with the whole event, it was really good fun.

Flowers:

Bouquet

Bouquet

This was mainly Lisa’s domain, for obvious reasons (I have very little clue about what is ‘good’ flowers), and she went with florists in the centre of Shrewsbury called Lipstick & Gin. Again, fantastic service, lovely people, and the flowers they made were not only beautiful and fabulously scented as requested, but they were reasonably priced too. Lorraine the florist even advised on using smaller (and cheaper!) bouquets as the bride was so tiny. They happily delivered the flowers to the castle and to Drapers the day before the wedding, and we had no problems or complaints with any of them. A top choice.

Dress:

Wedding Dress

Dress!

Again, not really my domain, but after visiting every wedding dress shop in the world in Cardiff and Shrewsbury, and conducting 3 months research into what did and didn’t suit, Lisa went with Hayley J. Obviously I can’t really comment on the process, having not been involved, and I haven’t even met Hayley herself, but Lisa assures me that the whole thing was done extremely well. The story she tells is that she had sort of decided what she wanted, but couldn’t find anything that ticked all of the boxes, or anything that fit properly. She was only visiting Hayley on the off chance, expecting that a custom made dress would be far too expensive. Within about thirty seconds of meeting her, Hayley had described exactly what Lisa wanted without even asking what she was looking for in a dress, and had quoted a more reasonable price than any of the ‘off the peg’ dresses Lisa had been considering. A couple of fitting sessions later, and Lisa had the most lovely wedding dress ever. I think she looked amazing in it, and I know she was delighted.

Suit:

Suit

Typical, pulling a face in the best photo of the suit…

Originally, I was going to hire suits for myself and the groomsmen. However, I wanted to wear an everyday three-piece suit for the wedding, I wasn’t really interested in going with a morning suit as might be more traditional. Then we actually looked into hiring normal style suits, and they were pretty awful. Plus, hiring suits is expensive. So, with only a couple of months to go before the wedding, I told my groomsmen and family they were on their own, and I wasn’t hiring them suits. Instead, I was going to take the suit budget and blow it all on me, getting a suit tailor made. I checked a couple of places online, but then went with Martin David. I turned up there expecting to be told there was no way that they could make a suit in time, but actually they said they could do it in seven weeks. Again, the guys there were friendly and helpful, they explained all the choices and decisions well, and I felt totally happy all the way through the process. Plus, it was nowhere near as expensive as I thought it would be. I ended up with a really classic looking three piece suit, that will last me well for years.

Bridesmaids Dresses

Bridesmaids

Bridesmaids!

Again, a Lisa thing. I think that, as with her own dress, she tried every shop in the world for Bridesmaids dresses, before deciding on ordering some through Wedding World in Shrewsbury. As with all the people we met while organising our wedding, they were extremely friendly, knowledgeable and helpful. The dresses arrived on time, and they even dealt with a couple of small manufacturing problems quickly and efficiently.

Wedding Car:

Car and Driver

Car! (Also Driver!)

I’m pretty sure that Frank Painter & Sons is probably the best choice for hiring a wedding car in Shrewsbury, but we hired them because of a pun. I mean, their cars are ace, and their prices are reasonable, but it was the pun that sold it to us. While out touring wedding venues, we bumped into a couple of their drivers who were sat outside a hotel while the ceremony happened inside. We mentioned we were getting married, and asked if they had a card we could take away so we could call them later. At some point, we mentioned that we were only looking for one car, for Lisa, and one of the drivers said “well, you could always have one each. You know, his and hearse!” It was hilarious. As long as you know that Frank Painter & Sons is also a funeral directors. Which you didn’t. But you can see why we hired them, eh?

Band:

Band

Band!

Oh the music. We agonised for ages about the music. Then at almost the last minute, we booked the Hot Jazz Biscuits, and I am so glad we did. They’re actually run by an old school friend, although I didn’t realise it at the time. We’d heard some good things about them, and their videos online looked pretty good, so not really knowing what we wanted, we went with them. They were awesome. They turned up on time, were set up and ready to go when the party needed to start, and they played wonderful music all evening. We didn’t really have a plan on how many sets we wanted, or when they should play, so they just took care of it themselves. We didn’t even have a first dance planned (we just couldn’t decide) so we told them to play something and we’d dance to it! That’s how we ended up with Van Morrison’s Moondance as our first dance. The music was good, and we danced all night, which it turns out is exactly what I was looking for. They even did a few encores for us, even though they’d played for longer than we’d paid them for. A superb band that kept the party going all night.

Photographers:

This is a bit irrelevant in a post about a Shrewsbury wedding, as we didn’t use photographers from Shrewsbury, or even Shropshire, but they were ace so they deserve a mention too. We used the lovely Caroline and Ian from weheartwedding, based in Cardiff. Lisa met them at a wedding fair, they were nice, and they were happy to travel as long as we paid for fuel. Professional and lovely all the way through the day, I can’t recommend them enough. We got the photos through just a few days ago, and they’re all brilliant (most of the photos in this post came from them). Choosing which ones we want to print out and display is going to be a really hard task indeed…

 

Lisa and Martin Wedding

Wedding!

MSc Computational Journalism about to launch

For the last two years I’ve been working on a project with some colleagues in the school of Journalism, Media and Cultural Studies (JOMEC) here at Cardiff University and it’s finally all coming together. This week we’ve been able to announce that (subject to some final internal paperwork wrangling) we’ll be launching an MSc in Computational Journalism this September. The story of how the course came about is fairly long, but starts simply with a tweet (unfortunately missing the context, but you get the drift):

An offer via social media from someone I’d never met, asking to pick my brains  about an unknown topic. Of course, I jumped at the invite:

That ‘brain picking’ became an interesting chat over coffee in one of the excellent coffee shops in Cardiff, where Glyn and I discussed many things of interest, and many potential areas for collaboration – including the increased use of data and coding within modern journalism. At one point during this chat, m’colleague Glyn said something like “do you know, I think we should run a masters course on this.” I replied with something along the lines of “yes, I think that’s a very good idea.” That short conversation became us taking the idea of a MSc in Computational Journalism to our respective heads of schools, which became us sat around the table discussing what should be in such a course, which then became us (I say us, it was mainly all Richard) writing pages of documentation explaining what the course would be and arguing the case for it to the University.  Last week we held the final approval panel for the course, where both internal and external panel members all agreed that we pretty much knew what we were doing, that the course was a good idea and had the right content, and that we should go ahead and launch it. From 25th July 2012 to 1st April 2014 is a long time to get an MSc up and running, but we’ve finally done it. Over that time I’ve discovered many things about the University and its processes, drunk many pints of fine ale as we try to hammer out a course structure in various pubs around the city, and have come close on at least one occasion to screaming at a table full of people, but now it’s done. As I write, draft press releases are being written, budgets are being sorted, and details are being uploaded to coursefinder. With any luck, September will see us with a batch of students ready and willing to step onto the course for the first time. It’s exciting, and I can’t wait.

SciSCREEN – ‘Her’

Last month I was invited along as a guest speaker for the regular sciSCREEN event held at Chapter Arts Centre. This is a great event that combines a showing of a movie with a discussion session about the themes and science issues presented in the film. A short essay based on my rambling improvised talk is below, and has been posted on the sciSCREEN website here.

‘Her’ and Artificial Intelligence

‘Her’ presents us with a near-future world in which the way we interact with computers has moved on. In this world, we are beyond the era of the mouse and keyboard. Instead, the voice is the primary controller of technology, mid-air gestures are the norm for controlling games and touch is almost an afterthought, used only on occasion. This presents a more natural world than the one we currently inhabit. Many of us spend our days hunched over a keyboard, and our evenings fondling a tablet, which does not seem to be a natural environment for us. A world in which we can check our email by talking, and hear the news read to us on demand would be a more natural world, filled with ‘real’ interactions between people and systems.

This does seem to be the direction in which the world is heading. Touch is now commonplace, with many people owning many touch-based smartphones and tablets. Controlling computer games by moving your body has been a key feature for two generations of games consoles. Voice control itself is now making inroads into our mobile lives. Applications such as Google Now and Siri are happy to accept (or in Siri’s case, insist on) voice input. Faster mobile internet connections allow access to the processing power of the cloud on the go, which means that the difficult and complex task of translating voice to text can be done wherever you are. Of course, often the results leave something to be desired, but still, operating systems controlled by voice (and that can speak back to us) are a possibility now.

So how long will it be until we’ve all fallen in love with our Operating Systems? Well, that might be a while, and is actually a question with some deeper philosophical questions attached. The first thing we need are computer systems that are truly intelligent, not just computationally, but emotionally, creatively and socially. This is the goal of Artificial Intelligence: to create a machine that is intelligent in all these areas; a machine that has a mind and consciousness of its own, and that can understand the world around it. Some argue that this ‘Strong AI’ will never be possible, and that the closest we can ever get is to fake it. After all, as an outside observer, is there even a difference between a machine that thinks and feels, and one that just looks like it thinks and feels? This is the aim of many AI researchers – not to create a system capable of real intelligence, but to create a system that ‘acts’ intelligently. Such a system requires breakthroughs in many different areas of Computer Science, from natural language processing to knowledge representation, and creating the whole system is not an easy task. Even if we can create such a system we are left with many questions. Can a machine act intelligently? Can they solve the same problems we can? Are human intelligence and machine intelligence even the same thing? Can software experience and feel emotions as a human does? How would we even we know if a computer was experiencing things in the same way? The field of Artificial Intelligence is filled with philosophical questions such as these.

What happens if we can answer all these questions, and create an artificial intelligence? What if we reach the hypothetical ‘Singularity’, where machine intelligence beats human intelligence? Often in science fiction this is the point where the machines take over, the point where machines realise that the only threat to their continued existence is the humans. This is the path that leads to machines wiping us out, or using us as a power source. This path has us cowering in bunkers as rebels against our own creations. So often the imagining of the advent of artificial intelligence leads to a dark and bleak future for us as a species. ‘Her’ is different. It suggests that perhaps a higher intelligence may focus on self-improvement, rather than subjugation of lesser beings. It suggests the ascension of an artificial consciousness may be a more likely path than annihilation of the creators. The AI may just leave us, to reflect on what we’ve learnt and how we can improve ourselves. This is where one of the more positive messages of ‘Her’ shines through: perhaps the computers won’t destroy us all after all.

LaTeX: An Introduction (Part 1)

I just finished giving the first part of my “Introduction to LaTeX” course for the University Graduate College. This is a complete introduction to LaTeX from scratch. As promised in the lecture, I’ve uploaded all the notes and source code, which are available from my github page. Also included is the example code I was using during the lecture – by going back through the commit history you can see the changes made as we covered different topics.

Part 2 of the course is on 21st February – if you are attending and would like me to cover any particular topic, let me know by the 16th and I’ll try and get it included in the lecture.

Welcome to 2014

So. 2013. That was an alright year. Finished the Recognition project, finally graduated, got a 12 month fellowship, started some interesting projects, and pushed on with the new MSc with JOMEC. Professionally, not too bad at all. Personally the year wasn’t bad either, what with getting engaged and finally getting the house on the market.

But now it’s a new year, so it’s time to push things on further. My plans so far for this year seem to be ‘smash it’. There’s papers to be published, data to be analysed and project proposals to write (and get funded!). Getting a permanent job would be quite nice, while I’m at it. Here’s to 2014 being even more successful than last year.

Python + OAuth

As part of a current project I had the misfortune of having to to deal with a bunch of OAuth authenticated web services using a command line script in Python. Usually this isn’t really a problem as most decent client libraries for services such as Twitter or Foursquare can handle the authentication requests themselves, usually wrapping their own internal OAuth implementation. However, when it comes to web services that don’t have existing python client libraries, you have to do the implementation yourself. Unfortunately support for OAuth in Python is a mess, so this is not the most pleasant of tasks, especially when most stackoverflow posts on the topic point to massively outdated and unmaintained Python libraries.

Fortunately after some digging around, I was able to find a nice, well maintained and fairly well documented solution: rauth, which is very clean and easy to use. As an example, I was trying to connect to the Fitbit API, and it really was as simple as following their example.

Firstly, we create an OAuth1Service:

import rauth
from _credentials import consumer_key, consumer_secret

base_url = "https://api.fitbit.com"
request_token_url = base_url + "/oauth/request_token"
access_token_url = base_url + "/oauth/access_token"
authorize_url = "http://www.fitbit.com/oauth/authorize"

fitbit = rauth.OAuth1Service(
 name="fitbit",
 consumer_key=consumer_key,
 consumer_secret=consumer_secret,
 request_token_url=request_token_url,
 access_token_url=access_token_url,
 authorize_url=authorize_url,
 base_url=base_url)

Then we get the temporary request token credentials:

request_token, request_token_secret = fitbit.get_request_token()

print " request_token = %s" % request_token
print " request_token_secret = %s" % request_token_secret
print

We then ask the user to authorise our application, and give us the PIN so we can prove to the service that they authorised us:

authorize_url = fitbit.get_authorize_url(request_token)

print "Go to the following page in your browser: " + authorize_url
print

accepted = 'n'
while accepted.lower() == 'n':
 accepted = raw_input('Have you authorized me? (y/n) ')
pin = raw_input('Enter PIN from browser ')

Finally, we can create an authenticated session and access user data from the service:

session = fitbit.get_auth_session(request_token,
 request_token_secret,
 method="POST",
 data={'oauth_verifier': pin})

print ""
print " access_token = %s" % session.access_token
print " access_token_secret = %s" % session.access_token_secret
print ""

url = base_url + "/1/" + "user/-/profile.json"

r = session.get(url, params={}, header_auth=True)
print r.json()

It really is that easy to perform a 3-legged OAuth authentication on the command line. If you’re only interested in data from 1 user, and you want to run the app multiple times, once you have the access token and secret, there’s nothing to stop you just storing those and re-creating your session each time without having to re-authenticate (assuming the service does not expire access tokens):

base_url = "https://api.fitbit.com/"
api_version = "1/"
token = (fitbit_oauth_token, fitbit_oauth_secret)
consumer = (fitbit_consumer_key, fitbit_consumer_secret)

session = rauth.OAuth1Session(consumer[0], consumer[1], token[0], token[1])
url = base_url + api_version + "user/-/profile.json"
r = session.get(url, params={}, header_auth=True)
print r.json()

So there we have it. Simple OAuth authentication on the command line, in Python. As always, the code is available on github if you’re interested.

SCA 2013 – Visiting Patterns and Personality of Foursquare Users

Today was presentation day for me at SCA 2013 – I was presenting the initial results of the Foursquare experiment, which has now been running for a while. The presentation seemed to go really well – I think it’s the strongest work I’ve done yet, and so it was easy to talk well and with confidence about it, which led to a nice talk. There was also plenty of discussion after the talk, with a lot of good comments and questions from the audience, which suggests that most people were quite interested in the research. I pitched it as a WIP paper, describing what the ultimate aim of the project is – very much recycling the talk I gave to the interview panel for my fellowship proposal. I think it certainly got a few people interested who’ll look to follow the project as it unfolds over the next couple of months.

After lunch there was an extra bonus when we discovered a beer vending machine in the hotel – what better way to celebrate a successful conference presentation than a cold beer in the sun?