in programming

If you know GCSE Maths, you know functional programming!

It took me an unbelievably long time to grasp functional programming. In the lectures I took, it was described in terms of lambda calculus with lots of weird mathematical symbols that didn’t make sense to me.

However, little did I know that I had already learnt functional programming back in GCSE Maths, without even knowing it!

Read More
in technology

How I stopped my Android phone's screen from turning on in the middle of the night

Screenshot of SnooZy Charger showing a large number of charges in the middle of the night

The Android operating system (as does iOS, I believe) has a rather annoying “feature”. That is, whenever your device starts charging, its screen turns on, presumably to let you know that the device is now charging.

This sort of feedback is usually considered good interaction design. It’s important to inform the user when events occur. However, this must not come at the expense of annoying and inconveniencing the user.

Read More
in technology

The case against HTTPS

I recently read a blog post dispelling arguments against HTTPS. I am certainly of the opinion that 99% of websites should use an encrypted connection. However, I do think critics of HTTPS do have some good points, and there are cases where an unencrypted connection is actually desirable.

Read More
in programming

Constants can change!

A common misconception I’ve noticed amongst fellow programmers is the idea that constants can never be modified. Whilst it is true that a constant’s value may never change during runtime, it may certainly be appropriate for a programmer to modify it in the source code.

Read More
in gaming

Updated: Adding custom amounts to your Steam Wallet

Screenshot showing the process of adding funds to a Steam Wallet

This post was originally written in 2015, but has been revised to reflect changes to the Steam service.

PC game distribution service Steam allows users to purchase funds for their ‘Steam Wallet’ which can then be used to buy games and in-game content.

That can be done on this webpage. It’s great if you want to add £4, £10, £25, £50 or £100 to your account, but what if for some reason you wanted to add an amount that’s not listed? Is this possible?

The answer is, of course, yes! But it requires a little trickery:

Read More
in technology, programming

FizzBuzz in Racket using pattern matching

Today I came across this satirical take on the FizzBuzz programming test (via Hacker News). The FizzBuzz test requires you to write a program that will output the positive integers 1 to n (where usually n=100) with certain substitutions, as in the children’s game. If the number is divisible by 3, the value Fizz is provided. If the number is divisible by 5, the value Buzz is provided. If the number is divisible by both 3 and 5, the value FizzBuzz is provided.

Anyway, it got me thinking about how I would implement FizzBuzz using one of my favourite programming languages – Racket, a descendant of Scheme (itself a dialect of Lisp).

Read More
in books

A look back at the Golden Age of Detective Fiction

I am a big fan of detective fiction and recently discussed the genre with some of my friends. The following is adapted from what I wrote in that discussion, and I am publishing it for posterity.

The 1920s and 1930s are termed the Golden Age of Detective Fiction, during which a great number of works from Agatha Christie and her contemporaries were published.

Read More
Find older posts in the archive