"Update blog" has been on my to-do list for the last couple of years.I have had five jobs since starting work in 2018, the first I got through a careers fair at my university, but all of the others - in some way or another - I got through my blog. It has been over two years since I was looking for a new job, and even longer since I interviewed candidates. In that time, I have relentlessly…
I recently discovered that, in PostgreSQL, a row may simultaneously not satisfy is null and is not null, if it contains some null and non-null values.Example:
I've been playing around with CGI (Common Gateway Interface) scripts recently, and reading a bit about Lisp. Having written some Clojure, Racket, and Chicken Scheme, but never any Common Lisp, I thought it would be fun to make a little CGI script in Common Lisp - specifically Steel Bank Common Lisp (SBCL).A CGI script is a program that a web server calls to handle a request. The program takes the…
This blog was built using Cryogen Static Site Generator, which is written in Clojure. Cryogen is extended and configured using Clojure and Clojure's EDN (Extensible Data Notation).Check out Clojure and Cryogen, if you haven't already!
Pairus is a new Matchmaking App founded by Anthony Lacavera and Emily Lyons, with a technical team lead by Govind Mohan. I advised them, as a Software Architecture Consultant, on how to setup the software system in a way that keeps unnecessary complexity low and delivers the product within a reasonable budget and timeframe.
JavaScript methods that use this in reference to the class they belong to will break if the method is assigned to another value or passed into another function as a function object.This is because the value of this is dependent on the object that the method is a member of at the time of calling.
Is your code too clear and simple? Is it too obvious what it does? Did you write it in a way that is too easy to understand?If so, you need to make it Production Ready. If you aren't using Factories, Generic Higher Order Functions, or DependencyInversionDeinverterWrapperBeanSingletonProducers, you really need to up your game.
I find some little programs/scripts/snippets disproportionately satisfying to write/use. The best programs are ones that I never intend to share with anyone else.The following program is one I wrote recently that falls into this category. All it does is convert lines of CSS into React inline styles, and it took only a few minutes to write.
A classic problemAt the interview for my first job, I was asked to write a FizzBuzz. A FizzBuzz is a program that prints a series of numbers, unless a number is divisible by 3, in which case it prints Fizz, or divisible by 5, in which case it prints Buzz. For any numbers divisible by both, it should print FizzBuzz.
Obvious issues can betray the presence of subtler onesRecently, I stayed in an Airbnb. At this Airbnb, the shower's hot and cold were reversed. Initially confusing, but once I realised this I could use the shower with no issues.
This kind of thing should not be used in any serious production application. For a start, there is a risk of shell injection attacks.But I would bet that multiple S&P 500 companies use something like this, somewhere deep in the bowels of their systems.
Over the last week I have been playing with a Forth-like language that I have implemented (separately) in JavaScript and C.I have embedded the JavaScript version below, and both versions are available on Codeberg: https://codeberg.org/DanielRHolland/forth-style-stack-lang.
Almost two years ago now, at a Mycs company party, I was chatting with some other devs when I confessed to having never implemented a "Game of Life". To remedy this, I wrote one in Haskell (iirc I actually started this at the party itself).
This is, in some sense, a part 2 to Software Engineering Books and Resources that I have found interesting. In fact, this list was originally going to be included with that one, but it got too long (especially with the notes), and so I split it out. Some of the notes may get trimmed/edited/fleshed-out at a later date, and I might add more languages.I have intentionally excluded from this list some…
You don't need Java (or C++, or an "OOP" language) to create objects and classes!What are objects and classes?For this post, consider objects to be instances of encapsulated state with associated methods, and classes to be the general definitions of a type of object.
I'm not really sure this is really "blog post" kind of content, as I intend to come back later and amend/add to it. When I have met people looking to get into Software Engineering, or students of Computer Science, I have been asked for recommendations for things to do/read/watch. This post lists some of the things that I have found interesting, and that I have recommended to others. This list is…
If you have a 99% chance of failure, for a given task, then if you attempt it 459 times, your chance of success will be over 99%.It gets better than this - after only 69 attempts, your chance of success is already greater than 50%.
I have been messing about with Chicken Scheme, building a little microblogging-style app, with a twist: users can vote for a purge of the whole site's content! I thought it would be fun to see how far I can get with one file of Scheme and without any JavaScript. I have put a favicon and some css in separate files, but really these could both be embedded in the Scheme file aswell - but that would…
I would rather discuss solving problems than just talk about "Stacks" in isolationIt's great to have favourites, and to be enthusiastic about specific tools - I do too, this is an important part of being a tech-nerd/hacker/programmer. But "Tech Stack" isn't an attribute of the person, it's an attribute of the project.
I wanted to create a QR code from within Chicken Scheme, but I couldn't find an existing Scheme library or chicken Scheme egg online that would let me do this. Fortunately, Chicken Scheme is pretty easy to integrate with existing C code.The first thing I did was I wrote a Hello World in Scheme and another Hello World in C, and checked that I could get both of these to run (using the chicken…
I wrote a little script recently to generate new email addresses using the CloudFlare API.By doing this, I can create loads of email addresses really quickly and set up disposable ones for new services or categories of services. The script either randomly generates an identifier, or will use a value provided as input.
I mainly use fish, and NVM does not work with fish out-of-the-box.Even if I happen to be using zsh/sh/ksh/bash, I don't want to be loading NVM when I start a new shell, when I am only using it on occasion.
While building a simple HTTP Server in Racket, I wanted to automatically restart the server when I changed the source file.To achieve this, I wrote a simple shell script.
Previously, I wrote a simple HTTP server in Racket. The next step I will take with this project is to figure out how to extract the HTTP method and path from the request.The handle method's first argument, in, is an input port, from which the request can be read. We can read the first line from the request using the read-line function:
As I previously mentioned, it is almost always better to use a battle-hardened old favourite for security software, rather than to roll your own.With Nginx, you can add SSL/TLS support in front of your web server, using tried and tested software.
Often, a program will rely on static data - lookup tables, files to serve, initial values for internal data structures, and so on. Template Haskell can be used to load files, and execute code, at compile time.This is a very gentle introduction to the otherwise often intimidating world of Template Haskell. For the sake of simplicity, I am keeping a narrow focus: loading a file, and then…
When I start playing with a new language, I like to have a look at how I could build a simple HTTP server in that language.Racket's racket/tcp library provides us with functions for managing TCP connections. Using this, we can implement a server.
Using Constraint Programming / MiniZinc for Manufacturing OptimisationUsed Declarative Constraint Programming (with MiniZinc) to optimise the assignment of Purchase Orders to Manufacturers, increasing Supply Chain cost-efficiency while also introducing checks and safeguards. Built a RESTful API wrapper in Go to allow the constraint solver to be accessed over the network.
I was reading about Feistel Ciphers, and thought it would be fun to implement a toy one. I have shared it below.Wikipedia Feistel Cipher ArticleGithub Gist: Haskell Feistel Cipher
Development of a New Refunds Processing SystemBuilt a new Refunds Tracking and Processing System for Mycs GmbH, a major European Retailer of Custom Furniture.
Note: Unfortunately, this does not remove absolutely all traces of the software (/malware!). But, it does remove them completely from view, and reduces the amount of disk space they consume. I am not aware of any better solution without rooting the device. If you are aware of a better solution, please get in touch!
The following is taken from a report I wrote for the Service-Centric and Cloud Computing module of my Bachelor's Degree. It describes a system built for the coursework of that module. The system's purpose was to simulate the trading of shares, and to log the shares owned by different users. The software was written to a specification which detailed the purpose of the system, but not specifics of…
The following is a trimmed-down re-edit of the report I wrote for my Final Year Project, completed for my Bachelor's Degree in Computer Science from Nottingham Trent University.
I worked with five other students to develop a storage management system for the NTU stores. First we had to figure out the requirements and specify the system. To better understand the problem, we had a site visit to the stores and carried out field research. This was followed by brainstorming, role playing, and process analysis. We wrote a Requirements Specification. In this we stated the…