My University Notes, Online

I’ve created a repository to store my notes for this semester of university. I originally thought i would make the repo public to be viewed on GitHub/Lab, but I decided it would be more fun to just make it part of this website. You can view the notes at, hopefully this will make me be slightly more productive than the dumpster fire that was last semester.

Okay bye now.

A New Look

I’ve decided to update the look of the site to something more stylish. This is coinciding with a New-Year’s Resolution aimed at making this place more informational. All the previous blog posts are still readable, just scroll.

Also! The source code for this site is available on my GitHub, something that was missing with my previous site. If you’re wondering how I came to this design, read on:

I started with a fork of GitHub user Poole’s excellent Hyde Theme for the Jekyll static site generator. From there, I tweaked the colours to match the Nord scheme, which is currently my favourite colour scheme. I’ve also switched main paragraph font out from Helvetica Neue to Roboto Slab, which is a much nicer font in my opinion. Code blocks have also been modified to fit the Nord scheme, but also the font has been changed to JetBrains Mono, which you can find more information about here.

Quick Update: I've made a WakaTime

This is just a small post to say that I’ve made a WakaTime page, this lets me show my activity to others, mostly in the hopes of making me more productive, since I’ll know people can see what I’m up to.

UPDATE 2020-08-27: Turns out the graph below doesn’t update? Not sure what the problem is but it seems wholly scuffed. Oh well, it’s close enough to a breakdown of what my coding activity is like

What I've been up to

Been a while, managed to get 3 A Levels in the time since we last spoke. Guess I should let you know what I’ve been doing.

The C# A Level coursework I chose to write was a GUI-based, turn-based fighting game heavily inspired by Pokémon. Looking back, the code is pretty bad (as expected from 2018 me, and I’ve still got a lot to learn).

Luckily I kept practicing and eventually managed to make something using Microsoft’s WPF framework that I might actually consider myself proud of. It was a binary explorer based on AQA’s A Level skeleton program for 2019 students. The project was a text adventures game where the data could be saved and loaded by the program in the form of binary files. My program could open the binary files and change the values, allowing new games to be created using this framework.

It was very simple, but effective stuff and it helped me learn the all important tool for programmers that is version control, opting in to using GitHub for this project (the repository is still public if you’re feeling nosey).

Eventually got accepted into Uni of Leeds with my A*AB, so I quickly had to learn Python, JavaScript, Java and C. It was around this time that I made my GitLab for university projects.

And that brings us up to speed, I think! TL;DR I’m a university student trying to improve their ability to adult, I’ll let you know how it goes!

Writing a terrible program taught me a lot about C

People always tell me that the programs you write in your past will come back to haunt you; you’ll look back and cry with amazement at your stupidity.

Year 11 me thought I could run from this truth, which is why I deleted all of my awful python projects, vouching to never develop a full application with a language that I wasn’t 100% comfortable with. My strategy has failed me.

Firstly, programming is an endless cycle of making mistakes and learning. If you think you finally understand a programming language, you don’t. Something is always there that’s gonna confuse the hell out of you. Something you thought you understood well will shock you with how much you don’t understand. Saying you’re 100% confident with a language is like saying you’re 100% confident you’re immortal.

Secondly, university happened. I’m now being thrown coursework for medium to large programming projects in languages I wouldn’t even have ever wanted to touch. More specifically, the project I just submitted yesterday is the worst of these.

I think I’ve learned more about C in the last two weeks than my whole first year of University

Everything that we had to do in this project, we covered in lectures, we covered in labs. I absorbed the information, stepped out of the lecture hall going “Huh! I get pointers!”. I did not “get” pointers, my cockiness is exactly the thing that proved that I did not “get” pointers in the slightest. The project we were set that day proved this completely:

Write a management system for a library. Use the header file provided as a starting point

Submit a report of how you developed it and what you did to improve over time

Immediately I was on the case, I knew the project would be large and consume a lot of my time so I started day-one. However, my onset was just as immediate as my stupidity.

I am a god, a king of pointers, I wield malloc and free with an iron fist and I never leak memory”, yes it’s an exaggeration of what was going through my mind at this very moment, but looking back, that’s what it felt like.

I began to write memory allocation statements wherever I felt like it, remembering, of course to write a free statement to complement. But it doesn’t work like that; pointers are messy and you can never anticipate what’s going to slip through the cracks of your absolutely dreadful program.

The cracks were forming, but I didn’t notice

I spent the first three weeks writing implementing the header file provided with a linked list system, only to realise that I needed 3 of these linked lists, and it was not generic. I made the same menu for all the modules, but rewrote it each time I needed it. My mind was turning to mush, and I didn’t notice any of these huge flaws in my design.

The nail in the coffin was when I finally finished the first module, after nearly four weeks, with one week to go. I opened a memory checker and ran it through the program:

4352 bytes in 124 blocks leaked

One week left…

The rest of that day was spent fixing the leaks that were there, but I had found nowhere near all of them. It was at this point that it dawned on me that this is what people meant when the programs of yesteryear come back to haunt you.

Pressure driven, coffee driven, I drove on.

The heavens smiled upon us

On the day before the submission date, we received an extension of one week. That one week was what was going to save me. Line after line I wrote, leaving a gory carnage of segmentation faults and memory leaks in my wake, no part of my laptops screaming shell would be safe from my massacre. But the program was progressing.

From segmentation faults to double frees to memory corruption, I shook off the increasingly more concerning warnings and runtime errors, for I would fix them later with all the time I’ll have spare. Spoilers: I had no time spare.

The nail in the coffin

The night before the deadline, I finished my unit tests, they all passed! Time to patch it all together aaaaaand:

It doesn’t work…

You can’t get through more than 6 menus without the program crashing. I stood up, performed the quietest rage I could possibly do at midnight in a COVID-19 quarantine-packed house, zipped up the repository and submitted. The weights on my shoulder were lifted and I went to bed.

I’d completely forgotten that this project had to accompany a report on my development…

Enjoy your C-vomit, professor!

PS. I got 70% somehow!