Monday, 27 October 2014

#BrumHack

Hackathons have always been scary to me, I’ve never known what I could make and whether it would be good enough, and as such there’s no point travelling the country if it’s not going to be enjoyable. Unfortunately Hackference in Birmingham fell on (one of my many) busy weekends over summer, which left it down to BrumHack, part of the MLH hack season, to pick up the reigns for my first hackathon. In many ways the perfect introduction, run by friends and at my University, there were few reasons to turn down the opportunity.

That said, it didn’t cure my lack of ideas, and as sponsors were giving their opening speeches the reality of not having an idea was starting to set in. Thankfully neither did a trio of friends who were also in attendance. Tom, Joe, and Matt all had very loose ideas for what to do and almost immediately we decided to form a ‘team’ and banter around ideas. The one that stuck was incredibly simple, but with a fantastic entertainment factor.

The Braintree representative was going to give out a prize for whoever could incorporate images of Cristiano Betta, his colleague, into their hack. Thankfully this was easy, as there’s a website with placeholder images solely of Cristiano – think placekitten, but with a bald Dutch man who enjoys wearing an interesting array of hats. The question was how to incorporate this into a hack with Tom’s Kinect, and it was obvious – superimpose Mr Betta’s face onto your own, so you can become Cristiano Betta.


So we picked an image from the website, and started installing all the necessary programs needed to create such an incredible piece of software. Joe’s Visual Studio took an incredible amount of time to install, almost five hours, but luckily some was more reliable. Finally, in an example face tracking program in the Kinect SDK, we found a method that was drawing a mesh between points it picked up from the face. From there it wasn’t difficult to instead draw our image, taking the Point in the top left and stretching a rectangle to use as a canvas down to the Point in the bottom right.


Job done five hours in.

At this point there was genuinely a potentially finished hack, but with a gutting of a method replaced with six or seven lines of basic C# code, it felt like we should push on. The next iteration was to convert this into an Android application that could amuse family and friends for hours. The ability to make yourself a Betta man on the go appeals to all of us.

Unfortunately this was far less simple. I’ll admit, while Joe and Matt tackled to application code I may have drifted and not being much help. After failing to use the Bloomberg API to collate random information to display next to your head it was tough to refocus – as an aside did you know there was such information as number of pets lost/killed during air travel? There’s some strange, strange reports in this world.

I tried to make my own little app that took a band and formed a simple wordcloud from their lyrics. Using a combination of python to scrape information from azlyrics, and R to run statistical tests. Unfortunately azlyrics didn’t particularly like my sending of hundreds of requests and took to ignoring them, fairly swiftly ending that particular foray – although I now have a folder with lyrics to 30 Ariana Grande songs so it wasn’t a complete waste.

Thankfully other team members were far more productive, and halfway through the hack (ish) we had an Android app that would track, and print over faces. We were finally making real progress on a real hack. That’s when things significantly slowed down again. In order to be in with a chance to win some pretty incredible Lego we had to implement payments using the Braintree API, but without Mr Joe Nash – who had very wisely chosen to sleep instead – it was tricky going. Especially as my GitHub (Windows application) chose this moment to complete conk out, and trying to learn the correct order for commands in cmd is much more complex at 4am.

Having said that the early morning, fifteen or sixteen hours into a hack, is where I feel Rubber Ducking really comes into its own. Your brain is still working, but you’re far too shattered to realise. Almost everything that comes out of your mouth is obvious, but it’s not something you considered before despite staring at the same screen for three hours trying to figure out why nothing works.

Soon even that dried up, and due to my having to be in Oxford the next day I thought it would be best if I tried to get some shuteye. A three-and-a-half hour power-nap between 5 and 8:30 was a dream, but alas it probably caused a few more problems than it solved with the amount of Coca Cola drank over the course of the last day; awaking very tired, and very hungover-esque – all my favourite things in life. At least I had a bed for the night, people back at the labs were literally sleeping under tables. A team from Sussex had cleverly positioned themselves on the sofas, and could be heard snoring as late as 11am the next day.



Back the ‘next day’ and nothing had particularly changed. Both Tom and Joe tried the true hackathon experience – more out of necessity at having nowhere to go than anything else – but I don’t blame them for being a little bit sluggish in their working. Nine to eleven crawled past, and we were wondering how much was possible to present with what was essentially – as someone pointed out – what had been happening automatically in webcams for five or six years. At 11 though, everything kicked into gear. Joe Nash was back, and his ideas to use a hardcoded client token fixed all worries – this was where ‘hacking’ really took on its proper meaning.

It worked! We were able to pay through PayPal, and this let us unlock a new face for the application. Okay, it didn’t quite work in the fact that it unlocked the face beforehand, a face that could never be changed back to the default head, and you could avoid paying simply by exiting the app – but we were close! Allegedly using Braintree had proved challenging for many a group, so to have a payment send – even if it was at the wrong time – was a massive bonus to a team with no prior hackathon experience.

We genuinely got a great reaction from both guys who know Cristiano, and those who hadn’t a clue who he was, although I do accept that it may be a little strange to program such a hack without ever having met him ourselves. There’s a video of our presentation on YouTube (hopefully) which shows the app in all its glory - you can watch below, we're on first around 1:30! We actually managed to win the Braintree prize for use of their API, lots of Lego, being the only team to get it working for a mobile app, which is really cool - I'll definitely be using that as a memento of a great day. We even had a respectable amount of votes for Hackers' hack!


At the end of the day we set out to have a good time programming, and that was all our goal. Some of the teams had incredible applications that could genuinely be expanded upon, but that doesn’t mean that our virtual reality (pushing it now) android app is any less of an achievement. Hackathon no.1 down, time to get involved with the next one.

Also, massive shout out to Jack Wearden, Joel Hoskins, Sian, and MLH for organising; plus the team from Sussex who had to leave at a ridiculous hour in order to make it in time – and travelled in style with an ace Charmander onesie. 

#TurnDownForWhat #WhosBettaWhosBettaWhosBest

No comments:

Post a comment