General

Posts that cover general aspects of programming.

#! code Logo

A Look Back At My MSc Computer Science Degree Thesis

16th January 2022 - 29 minutes read time

2022 marks 20 years since I started my MSc in computer science degree at the University of Aberystwyth. So, I thought I would take a look back at my thesis for the degree and see how far I have come since then.

The title of my thesis was "Using The Java3D API To Visualise Molecular Compounds". I used a system called Java3D to create ball and stick models of molecules. A second requirement was to allow the application to compare two molecules together.

The course I did was known as a conversion course and was designed to compress the three years of the undergraduate computer science degree into a single year, along with an introduction to Java programming bootcamp the summer before the course started. This was a year of hard work with 12 hour days and weekends of constant study. The drop out rate for the course was about 80%, with most of that being in the first few weeks.

#! code Logo

Managing Website Rescue Projects, From Audit To Onboarding

14th November 2021 - 40 minutes read time

I have been a web developer for quite a few years, and one constant that is an unfortunate story in the industry is the rescue project. This is a web project that has been mismanaged by an agency or developer in some way so that the site is at a critical point. Either, the site is unable to launch or it has already been launched and suffers from serious issues. Projects in this state are caused by a variety of factors, and can be challenging and difficult to turn around.

Some agencies, quite understandably, won't go near rescue projects as they can be extremely tricky to manage. The client will have already invested money in getting the site in the first place, so spending money to fix the site can be a little painful for them. This is especially the case for small business sites, clubs or charities without any extra funds.

#! code Logo

Vissles LP85 Ultra-Slim Optical-Mechanical Keyboard: A Review

4th November 2021 - 9 minutes read time

Vissles recently sent me their new LP85 keyboard to review, and I've spent a few weeks giving the keyboard a go. I have already reviewed the V84 mechanical keyboard from Vissles just a few months ago and that keyboard has been my daily driver ever since. I was therefore very interested in testing out this new product. The LP85 is a low profile keyboard with optical switches that come in a sleek aluminium chassis. Instead of the usual mechanical switches that make a physical connection, optical switches break a beam of infrared light to activate the key press. As there is no physical switch being clicked this means that optical switches last longer than mechanical ones.

#! code Logo

Vissles V84 Wireless Mechanical Keyboard: A Review

16th June 2021 - 13 minutes read time

I recently acquired a Vissles V84 mechanical keyboard and I have spent some time giving it a go. Vissles was founded in 2018 and have a selection of decent looking accessories and devices including wireless chargers, headphones and monitors. The V84 is the second of keyboard that Vissles have created, iterating on the previous design.

The keyboard itself has 84 keys and is a 75% ANSI layout, this is also called tenkeyless as it is a normal keyboard without the keypad. This keyboard moves a few of the keys around in order to fill the entire surface of the board with keys, rather than separate out the arrow and home/end keys. The compact design gives the keyboard a slim look, but it doesn't feel cramped or small to use.

#! code Logo

Failed Web Predictions And How Not To Talk To Web Developers

6th June 2021 - 11 minutes read time

Picture the scene, it's 2010, you're a young web developer working in a satellite office of a fast paced digital agency. The work is interesting, but normally quite stressful as there are tight deadlines and high expectations on delivering good work. There is a lot going on so you tend to finish one website and jump onto the next. The company you work for has a history of firing people and making people redundant, especially in the satellite office you work at. Low morale, a culture of blame, and absolutely zero investment in people means that there is very little enthusiasm for the work from anyone. The economy is still recovering from the collapse of the banking system from a couple of years before. You have a young family at home and so you'll put up with a lot of poor working conditions to ensure a pay cheque every month.

#! code Logo

Keychron K2 Wireless Mechanical Keyboard: A Review

13th July 2020 - 9 minutes read time

I (like a lot of other people) recently started to work at home a lot more, and with a permanent desk setup at home I wanted a decent keyboard to work with. My work machine is a MacBook Pro 2018 and I dislike the keyboard quite a lot. It feels 'poppy', has some interesting key placements (the up and down arrows in particular), has no escape key or function keys at all.

#! code Logo

Wrap Around Increments

21st June 2020 - 6 minutes read time

Something I've been writing long hand for a number of years is wrap around increments. This is essentially adding to a value that has an upper limit, and wrapping back to 0 when that max value is reached. This can be done with an if statement.

#! code Logo

Creating A Chatbot Agent With Dialogflow And Kommunicate

19th April 2020 - 14 minutes read time

Having a chat feature on your website (commonly called 'live chat') is useful when helping your users overcome any difficulties they are having. You can pop up a little chat window in the page and ask if they need any help finding what they need. This can be especially useful on large commerce sites where users might get stuck looking for things.

The addition of a chatbot also allows you to automatically answer some of more common questions. For example, if a user asks where they can find the delivery and returns policy then a chatbot can automatically respond with a response. These rules can get more complicated, but it depends on what you instruct the bot to answer to.

#! code Logo

Adventures In FizzBuzz

29th February 2020 - 10 minutes read time

Tests for programmers in an interview process are not uncommon. For the last couple of years I have asked a quick pre-interview question to junior developers to see what sort of stuff they come up with.

As I don't want to set any developer a task that will take longer than absolutely needed I opted to set a very simple task for them. Commonly known as "FizzBuzz", this task is as follows.

"Write a program that prints the numbers from 1 to 100. But for multiples of three print "Fizz" instead of the number and for the multiples of five print "Buzz". For numbers which are multiples of both three and five print "FizzBuzz"."

The expected output for this would be something like this.

#! code Logo

Image Colorising In PHP

14th January 2019 - 4 minutes read time

Colorising images is fairly simple to accomplish, especially using PHP's GD library. All we need to do is load an image, create a blank image of the same size in a particular color and then merge the two images together.

In fact, we can do this entirely with the imagecopymerge() function, but creating a function to wrap all of this makes sense as well.

The following function takes an image resource (as created by imagecreatefrompng()), the red, green, and blue values of the color, and the percentage to overlay the color on top of the image. The percentage can be set to 0 for no effect and 100 to fully replace the image with the given color.