Hack Pompey 2025. My first hackathon
Posted on 2025-04-07 07:09:13
I want to start by saying Hack Pompey was an absolute blast – thank you so much to the Hack Pompey team and Sea Change for putting this together. I'm writing this two weeks later, so I may have forgotten a few minor details, but this is how I won...
I feel like we need some starting context for the state I was in. A few poor decisions were made before the event. Thursday night was an indie night out with some friends (I highly recommend checking out your local indie artists). Friday was Nerdvana (a 24-hour charity event starting from 5 p.m. for committee members). So, of course, the IT Society was there running our CTF and then helping out with the door at midnight. Me being me, I didn't end up leaving until 3 a.m. An hour and a half of sleep (well, more like a nap) later, I was getting ready for the event. I think we arrived at the door at 8:45 with sunglasses on (when you haven't been sleeping, everything is so bright) and ready to code.
Gonna be upfront: there were stakes in this competition. Some mates I live with (an engineer, a marine biologist, and an architect — the humanities student never showed up, SMH) turned up to prove that they could beat us CS students at a programming event. We found out that morning that they had brought three other electrical engineers with them to help out. (Cheating?)
Not wanting to be brutally mocked at dinner for the next week, we had high stakes.
In the first hour, we had a group breakfast, were handed a T-shirt (who needs to buy T-shirts when a tech company exists?), and got to know the other competitors. There were some incredibly interesting people – a surprisingly large number of them were alumni who travelled down for the day. After breakfast, we had a small talk with the organisation sponsoring the event, SEA CHANGE, which stands for Sustainable Energy and Air Quality Improvement for Coastal Harbours (try to say that five times fast). I'd honestly recommend reading the Hack Pompey write-up and the SEA CHANGE site for more information on the theme, but I'll give an explanation a go. We needed to use the dataset and APIs provided in a creative way. This data came from the B4T sensors that SEA CHANGE is using to monitor the air quality around the port. To try and improve the living conditions around Portsmouth and help the environment, the port is putting in massive electrical cables for ferries and ships to plug into, allowing them to stay running in port without burning fuel and pumping out horrible pollutants. The two suggested tasks were predictions or visualisations.
After the presentation, the event started, and we started off strong by putting stickers on our laptops and mocking Sam for bringing his own metre-long mouse pad with him. Our initial idea was to make an LSTM (Long Short-Term Memory), where we were going to train it on the historical CSV data and then predict the CO2 and PM2.5 levels throughout the day while feeding in live data from the API. We started to look through the documentation for the APIs. Sadly, there was no API for the B4T sensors. We did find a second API, but sadly not all the data on the site was returned by the API, and the data that was returned did not always seem reliable, so it was clear we needed a plan B. We ended up deciding to calculate the particles being distributed based on wind speed and wind direction. We got this idea from one of the hosts in the introduction talk, where they mentioned PM10 particles regularly blow over the housing areas of low-income communities. I think it took us about an hour to finally settle on this idea. We started going through the data a bit more closely and noticed an issue with the dataset containing just wind speed and wind direction. There were no units. We went around nearly all the hosts we could find, asking what unit wind direction was in. You see, there was only an 8-something difference between the maximum and minimum value. While Pompey does have a strong southern wind, in two years of data we should expect more of a difference. We were directed to a different, more complete dataset, so we started working, but by that point, we had wasted around three hours. This time, we started pulling the data together. We found that the data we needed was spread over two CSV files, but the times were not the same, so Sam started writing a small script that matched the rows together as long as the data was within two minutes of each other, while I started working on the maths and Aisha started to look at how to layer different images in JS. This kind of kept us busy until lunch, where we had maths that said particles don't spread, a dataset with values missing, and no GUI.
LUNCH TIME
Once again, I'd like to thank the Hack Pompey team for the amazing spread of food. It was so much better than what I would have had in my dorm. I spent a lot of time being told by my housemates about how they were going to win, due to the fact that I had nothing to show, so I kept my mouth shut. Honestly, the banter adds to the event – a bit of friendly rivalry never hurt anyone.
After lunch, I managed to get a Gaussian plume model (thank you, Wikipedia). Here is the formula I ended up using for those who care.
So I copied over that day's data and pressed 'Run', hoping it would work. Yeah, I wasn’t that lucky – it took two hours of tinkering before I had a shape I was happy with. During the task of overlapping the images, it occurred to us that, with 30 minutes left, I could combine the images in the backend, so I ended up using Easy PIL and Matplotlib to get an image working. It was around this time that the data was finally cleaned, and all I can say is thank God for Git – someone on our team accidentally deleted one of the files I was depending on to calculate the plume (SAM). Then, with the final 10 minutes, we cobbled together a basic web Flask GUI and we were done. We agreed to present under the name Ahoy World!
I honestly cannot remember what I said on stage – it was a mix of sleep-deprived, nervous rambles, as I had nearly been up for 34 hours at that point – but people seemed to have liked it. Here's a link to our code (I'm so sorry in advance for the mess you're about to witness), and a link to our hosted project.
I would also like to give a shout-out to PIP (Portsmouth Independent Party) for making the funniest project there. While not technical, their presentation skills alone deserved the Public Choice Award. Another shout-out to Terror of the Seas (AKA my housemates) for getting second in the Public Choice Awards – Lou's game art was honestly amazing. Go check out their amazing blog and Liam was very passionate about their model boat. It was a fun presentation to watch.
After the public choice awards, the award from SEA CHANGE was announced – and it was us. There was no big reaction because, honestly, we were shocked and confused. At lunch, we had accepted our loss, and there were so many amazing entries we didn't think we had a chance. You bet I brought it up at every dinner that week to the housemates. They had spent weeks being so cocky – I felt it was deserved to bring it up.
Another cool thing to mention was the old IT Soc president being there. We had the past, present, and future all in one room. Overall, a great day – thank you all for making it so special, and I will see you all next year.
If you enjoyed the blog, feel free to join Discord or Reddit to get updates and discuss the articles, or follow the RSS feed. If you feel like supporting me feel free to donate a cuppa using the buy me a coffee link in the corner.