Whisky Web

I’ve just been to Whisky Web, a language-agnostic web conference in Edinburgh organised by a group of local tech guys. It’s the first one they’ve run and it just came from the idea they had to get a bunch of web folk together for a fun conference and social gathering.

Held in the heart of the wonderful and beautiful city of Edinburgh, near the castle, it was quite a trek for us in Preston, but the 3.5 hours easily passed with us hopping on Virgin’s ‘First Class’ wifi (we were sitting near First Class) and chatting about tech, code, games, hacking and whatnot with the Magma team. Upon arrival we found our hotel, got our room numbers (401, 403, 404, which we all chuckled at – “room not found”, etc.) and met up with Magma’s competition winner Sean and went for a meal together. And then came the social. We met up with the usual bunch, quite a few from the PHPNW conference and a bunch of new folk. There was beer, then whisky. Most of the Magma team headed off around midnight but Jeremy (MD of Magma, my boss) & I were engaged in conversation with various people so we stayed out till kicking out time.

At about 1am we headed off, got in the lift of our hotel at the ground floor. It went up to first, then second, then first again, and then it stopped. We didn’t let this stop our conversation at first but after about 5 minutes we realised we were stuck in the lift. The display had gone off and none of the buttons did anything. We called the alarm button and heard a phone ringing through the speaker. I don’t know quite what we expected, but someone answered the phone with “Hello?” as if we’d just called a random number. It wasn’t reception, it wasn’t an 999-style emergency service operator, it just seemed to be a guy on a phone in a call centre. We had to tell them we were stuck in a lift, and where it was. I wouldn’t have been able to remember the road our hotel was on and “Travelodge in Edinburgh” may have been a bit vague, but fortunately having been more involved with booking, Jeremy knew which one it was. They said they would call our hotel reception to let them know, and send an “engineer” over to fix the lift.

Long story short, we were in there for 1 hour 40 minues, in which time we had slowly slipped almost to the basement without noticing it moving. When someone finally turned up to get us out, we just heard the sounds of two guys tugging at the cable and shouting to each other, and finally the door prized open and we saw a hand appear, and we got out and walked up the stairs to bed. I must note we never stopped talking the entire time, the lift stopping barely bothered us and we just chatted away like nothing had happened. It got quite hot in there and by the end we were lacking fresh air – to the extent that it was very noticeable when the door opened and fresh air came rushing in, welcomed by us both. A very surreal experience. If you ever want to get to know a person, get stuck in the lift with them. I guarantee you’ll become best friends!

We had arrived on Thursday night, with the conference happening on Friday. The conference kicked off with opening remarks from Joe, the organiser, about how the idea came about and how they got sponsorship and whatnot, followed by a brilliant keynote from Josh Holmes of Microsoft on the topic of (learning from) Failure. I then saw Rowan‘s talk on “Estimation, or “How To Dig Your Own Grave” which I saw at PHPNW11 and watched again on video since, but again took in some new points from his very well delivered talk. After a long lunch (+1 to the organisers for this – a long lunch (1.5 hours) gave plenty of opportunity for chat – much appreciated!), I saw Brian Suda give a talk on data visualisation, which really did blow me away. I’m an enthusiast for making use of datasets and exploring them in new and interesting ways, and he demonstrated some awesome techniques for visualising and showed some really important findings on perception and manipulation. Unfortunately I missed a talk on the other track called The Emperor’s New Clothes which was about the supposed necessity to use new hipster technologies like node.js for the sake of it. An interesting concept which I look forward to seeing on video when they’re released (Magma sponsored the video recording). I saw Bastien Hofmann mash up JavaScript and an Alice & Bob talk on public key cryptography which, although not very advanced, gave a good explanation of the fundamentals. A hilarious closing keynote from David Zulke explaining his desire to buy “awesome stuff” from the internet, involving a remote control shark, led to Joe’s closing remarks thanking sponsors and delegates.

After some quality conference food we were given a presentation by one of the sponsors – Bruichladdich – on Scotch Whisky, which involved each of us tasting four whiskies with a fascinating history story and explanation of the production process and some informative advice as to how to taste whisky:

Join Craig Johnstone (@WhiskyCraig) from Bruichladdich as he guides us through the history of Scotch Whisky from humble beginnings to modernization through the peaks and troughs of the 20th Century ending up in the multi billion pound industry we see today. Learn of Bruichladdich, the one company out there doing things differently and experience first hand the craftsmanship and passion that goes in to building the most exciting and independent of Islay Single Malt Whiskies.

~ from whiskyweb.co.uk

We all gave him our full attention and everyone seemed to enjoy listening to what he had to say, and of course we enjoyed the whisky. Following this we all proceeded to the pub. A rather loud pub. A few of us (Derick, Rob, MichaelVolker & I) went to a quieter pub for a chat, had a couple of beers followed by a couple of whiskies before heading back to our hotels to rest for the hack day. The hack day involved people a variety of things, whatever they wanted to. Some did development on a project from a list of suggestions, others took the time to do something they didn’t get chance to do at work. At the Magma table some of us did Zend Framework 2 tutorials, Adrian worked on an Instagram clone (trying to make a quick $2 billion) and Farkie & I started work on our own spin of the Ruby Koans, for PHP. We created a couple of test assertions using two underscores as the defined constant ‘FILL ME IN’ and set up one side of the assertEquals to that. Then we ran PHPUnit on the suite and output the result in to a json object in a file, which we then read in and displayed the results back to the user to inform them of their progress through the challenges, like the way the Ruby one does. We made a certain amount of progress at the hack day before heading home on the train. We continued work on the koans on the train back to Manchester and had the framework fully working by the time we got home. I then put the project on github and we intend to plan and implement a full set of tests which will teach the student how the constructs of PHP works. So there you have it – the PHP Koans – watch out for a full release in coming months. We hope to announce/launch it at PHPNW in August in a lightning talk.

Nothing more to be said other than that I had a fantastic time – thanks so much to the organisers Joe, Dale, Paul, Michael and Max – see you again next year if not before!

Oh, and I also learned that there is a difference between whisky and whiskey:

But, there is an important distinction between the two. You see, whisky (plural whiskies) shows that the product was made in either Scotland, Wales, Canada or Japan, whereas whiskey (plural whiskeys) shows that it was made in either Ireland or America.

~ from whiskydistilled.com

Photos can be found at Rob’s flickr and Joe’s flickr

Hack To The Future

The BBC wrote about Hack To The Future on their Research & Development blog, including a short video featuring their coverage of me explaining my nontransitive dice session! Also some screen time with Sam of Manchester Girl Geeks (who gave a brilliant keynote); Tom Crick (Cardiff Metropolitan University); and of course, organiser Alan O’Donahoe.

I had a great time at the event, got to witness a real sensation of excitement for computer science amongst children. It’s really encouraging that we’re finally harnessing that energy and hopefully will be able to give direction to the kids interested in taking up programming.

See the full article – Teaching coding to kids at Hack to the Future – BBC R&D

ASCII Bar Charts for Quick & Easy Visualisation

So you have some data. Let’s say it’s a record of the number of instances of some things. Let’s say it’s the number of movies you own, grouped by the year they were released.

Let’s say you have those data in the form of a dictionary in Python, like so:

years = {2000: 2, 2001: 9, 2002: 10, 2003: 9, 2004: 14, 2005: 11, 2006: 8, 2007: 10, 2008: 14, 2009: 19, 2010: 16, 2011: 17}

The following loop will print out an ASCII bar chart for a quick & easy visualisation of these data:

Which looks like this:

Note I used the ‘pipe’ character in this example. First I used ‘o’, which worked well, but I tried a few others ('O','x','X','*','@',':','/','#','[]','+','-','=','_',':)',…) and liked this the most.

That’s the end of what I wanted the blog post to show, but I may as well throw in how I got my data in this case. I have movies saved in a folder, and by convention I name them with the year in brackets at the end so I used glob to loop through the files in this folder, extract the year, and increment the counter in my years dictionary. I have another blog post in draft about using glob to edit filenames in batch. Coming soon.

Limerick 2011

[This is an extended version of an article I wrote for MSOR Connections magazine – which you can read online]

During the final year of my combined honours degree in Mathematics and Computing at Manchester Metropolitan University (MMU) I received an invitation to a two-day Student Mathematical Modelling Workshop at the University of Limerick in the Republic of Ireland, hosted by the Mathematics Application Consortium for Science and Industry (MACSI). The workshop was followed by the 82nd European Study Group with Industry. The maths course at MMU is highly oriented around real world problem solving involving mathematical modelling, dynamical systems, numerical methods, ODEs & PDEs and contains a strong programming element, so this was something I thought would be good to attend.

My friend Chris and I applied for our places on the workshop and booked our flights. What better way to unwind after completing a maths degree than being put to the test! While packing our shared suitcase for the trip, we weighed the case and realised we were too heavy, so we repacked – some of it crammed in to our backpacks, some we left behind. Arriving at the luggage check-in desk, the suitcase was weighed and we were well under the limit. At this point we realised we had looked at the wrong units on the weighing scales. Typical mathematical modelling error – how apt. We reshuffled the contents of our cram-packed flight bags and put things back in to the suitcase, thinking idiots of ourselves.

Not really knowing how useful we’d be in helping solve problems, nor which type of problems we would like to tackle, we began by sizing up the problems set online while on the plane. I chose a problem on Equity Options & CDS Risk Management because it seemed an interesting situation to work with. The group consisted of both those who had studied financial mathematics and those who hadn’t, so there was a mix of abilities and understanding. The finance people got on with what they have done with similar problems, explaining themselves along the way, and others found useful things to bring to the group. I personally looked at the data we had been given, analysed the trends in the evolution of option prices over time and ran a Monte Carlo simulation in MATLAB to demonstrate the effectiveness of the strategy.

The second week was the study group so the lecture theatre was filled out with academics as well as the students who had stayed on. I chose to work on a problem in Electricity Prices and Demand Side Management, looking at estimating usage for a company called Crystal Energy in Ireland who offer electricity to companies at variable tariffs based on consumption. I worked with other members of my group on analysing the company’s data in MATLAB and Mathematica. We were able to produce useful information for the group, including isolating volatile periods in the day (e.g. between 12-2am) and in the year (e.g. mid-late December) by looking at the absolute difference (error) between corresponding timeslots and plotting contour maps. A report explaining our findings has been submitted for publication. As the study group fell after our final exams, it gave us a great insight in to the usefulness of what we had learned at university, indicated gaps in our knowledge and inspired us to attempt to solve problems that arise, small and simple or bigger and more complex problems alike. It gave us both the courage to realise that this is something we could do with our lives, applying our skills in such a real and meaningful way which could lead to significant results in personal, small or large scale industry problems.

A couple of times during the trip, I arranged Skype calls with Peter Rowlett, where he interviewed by about the study group and conference for his Math/Maths podcast, along with his American co-host Samuel Hansen. You can listen to these here: Episode 53, Episode 55

We had a fantastic time staying on the beautiful campus of the University of Limerick. We enjoyed the food, drink and surroundings, but most of all, the company – everyone there was really interesting, and it was great to share conversation with such an intelligent group of like-minded mathematicians. Although the daytime was spent working on maths problems, the trip was very social – we would move from a classroom or lecture theatre straight to the pub with the other students and staff and carry on discussions from the problems of the day, and our approaches to solving them. Also, during the second week, I received the results of our degrees – and I’d passed with second class honours.

We also took the weekend at the end of the trip to travel to Dublin, where we stayed with the family of one of the conference delegates we met. Dublin is a fantastic city, and we really enjoyed the weekend. We visited the campus of University College Dublin and its Maths Society‘s room. I was shocked to see their Maths Society was so well established that it had its own designated area of the Maths Department building! Last year I founded the Maths Society at MMU and we had nothing at all. We hung out in the Maths Society room for a while, looked at some books from their library and played on their N64! We also took a walk through the Maths Department’s own library, deep down in the basement of the building – where we walked through about five big rooms full of books – and when we reached the end, I picked up a magazine I saw on top of a box, turned it over to look at the back page, and spotted a review of a book written by my lecturer Stephen LynchDynamical Systems with Applications using MATLAB. Quite a coincidence!

Unfortunately I had some sad news on the night we left – a friend called to say one of my friends from the university canoe club, Dave Evans, had died in a climbing accident on Mont Blanc. This was devastating, and I found the news very difficult to take in. A hard thing to deal with – losing a friend so young. Dave was just 24 and had been out of university less than a year. RIP.

Midnight Ice Climb Up Helvellyn

Some friends & I decided to make the most of the snow by heading to the Lake District for a midnight mission up Helvellyn one Friday evening in mid-January.

I was due to return to Manchester from spending the Christmas holidays at home, and as the mountain passes over the peak district from Sheffield were closed due to snow, I was forced to get the train. This meant I was restricted in what I could take with me, knowing it would be at least a week before I could get the rest back. As I had planned to do the Helvellyn trek that evening, most of the stuff I took was kit for the climb! I had two large rucksacks mostly full of kit & gear, and my laptop bag with me on the train. I got off the train at Manchester and went straight to Gordon’s flat to sort out kit. We checked through what we had with us, trying to share kit evenly between the group, making sure everyone would be sufficiently warm & safe. We nipped to a local outdoor shop to stock up of a few bits & pieces and at about 8pm set off for Blackpool, which is where Gordon’s brother Alex lives.

We arrived at Alex’s house, checked through kit, stocked up on food and ran over the routine in the garden by practising the rope systems we might have been needing on the hills. After a couple of hours of kitting up and getting ready for the ascent, we headed to the Lakes in the cars. Setting off later than planned (around 11:30pm) meant we were starting the climb early Saturday morning. We had a bit of an epic getting up one of the mountain passes to the place we were starting from, as the snow was so deep on the road that our cars got stuck. We had to get the ice axes out early and smash up the thick snow and shovel it to the sides for us to pass.

We parked up and began the trek. We started with only a few layers on, with several more packed away in our bags as we would get hot & sweaty on the way up but knew as soon as we stopped higher up, we would get very cold very quickly.

The night sky was clearer than I’ve ever seen it. You could make out several constellations and see the North Star. The trek up was very hard to endure for our calves, and trekking through deep snow made things difficult. We had two home contacts Gordon was keeping in touch with to let them know we were on track – the situation was that we would text or call them at each checkpoint and if we were more than an hour and a half behind schedule (which had been adjusted at our later-than-planned start) and unreachable they were to call mountain rescue and give all the information they had about our position and where we were headed.

Anyway, they say a picture is worth a thousand words so here’s the rest of the story in several thousand words’ worth of photographs:

P.S. Just so you know, we got home safely, although exhausted, with a touch of frostbite on Gordon’s part. Tip: never be the one everyone asks to open their food because you’re only wearing one pair of gloves at the top of a mountain.