Full Width [alt+shift+f] Shortcuts [alt+shift+k]
Sign Up [alt+shift+s] Log In [alt+shift+l]

samwho.dev

samwho.dev
A Commitment to Art and Dogs .dog-line { display: flex; flex-wrap: nowrap; flex-direction: row; width: 100%; height:...
8 months ago
81
8 months ago
.dog-line { display: flex; flex-wrap: nowrap; flex-direction: row; width: 100%; height: 10rem; margin-top: 2rem; margin-bottom: 2rem; } .dog-line img { flex-grow: 1; height: auto; margin: 0; padding: 0; object-fit: contain; } .dog-grid { display:...
samwho.dev
Turing Machines body { text-wrap: pretty; } @media (prefers-reduced-motion: reduce) { * { ...
2 months ago
68
2 months ago
body { text-wrap: pretty; } @media (prefers-reduced-motion: reduce) { * { transition: none; animation: none; } } turing-machine { width: 100%; display: block; position: relative; padding-bottom: 1em; } turing-machine...
samwho.dev
Load Balancing .simulation { width: 100%; display: flex; justify-content: center; align-items:...
a year ago
46
a year ago
.simulation { width: 100%; display: flex; justify-content: center; align-items: center; margin-bottom: 2.5em; } .load-balancer { color: black; font-weight: bold; } .request { color: #04BF8A; font-weight: bold; } .server { color:...
samwho.dev
Bloom Filters .bf { width: 100%; height: 150px; } @media only screen and (min-width: 320px) and (max-width:...
a year ago
39
a year ago
.bf { width: 100%; height: 150px; } @media only screen and (min-width: 320px) and (max-width: 479px) { .bf { height: 200px; } } @media only screen and (min-width: 480px) and (max-width: 676px) { .bf { height: 200px; } } @media only screen and (min-width:...
samwho.dev
Memory Allocation .memory { width: 100%; margin-bottom: 1.5em; margin-top:...
a year ago
33
a year ago
.memory { width: 100%; margin-bottom: 1.5em; margin-top: 0.5em; } input[type=range]:focus { outline: none; } a[simulation] { cursor: pointer; } .size { color: #0072B2 !important; font-weight: bold; } .free { color: #009E73 !important; font-weight:...
samwho.dev
Practical Problems with Auto-Increment In this post I'm going to demonstrate 2 reasons I will be avoiding auto-increment fields in Postgres...
a year ago
28
a year ago
In this post I'm going to demonstrate 2 reasons I will be avoiding auto-increment fields in Postgres and MySQL in future. I'm going to prefer using UUID fields unless I have a very good reason not to. › MySQL <8.0 auto-increment ID re-use If you're running an older version of...
samwho.dev
Simple Complex Easy Hard You might have noticed the last time you were doing chores or tackling a tricky problem at work,...
over a year ago
27
over a year ago
You might have noticed the last time you were doing chores or tackling a tricky problem at work, that when something is hard it's not always hard in the same way. The hard you experience when doing chores, that mindnumbing , I-can't-be-bothered hard, is different to the hard you...
samwho.dev
The dos and don'ts of large, online communities One of the ways I spend my spare time is moderating the Programming Discussions Discord server. It's...
over a year ago
26
over a year ago
One of the ways I spend my spare time is moderating the Programming Discussions Discord server. It's an online community of almost 20,000 people, focussed around helping people with their programming problems through real-time chat. A frequent mistake I see people make in the...
samwho.dev
Getting an Autism Diagnosis On the 3rd of March 2022, we received a letter informing us that our eldest son, Max, has Autism...
a year ago
26
a year ago
On the 3rd of March 2022, we received a letter informing us that our eldest son, Max, has Autism Spectrum Disorder. The letter was the end result of a long process. I’m going to talk about that process from start to finish, in as much detail as I can. This post would not have...
samwho.dev
Hashing form { padding-top: 0.5em; padding-left: 0.5em; padding-right: 0.5em; display:...
a year ago
25
a year ago
form { padding-top: 0.5em; padding-left: 0.5em; padding-right: 0.5em; display: flex; justify-content: center; gap: 0.3em; } form input[type=text] { flex: 4 1 auto; min-width: 0; border-radius: 0.3em; border: 1px solid #aaaaaa; ...
samwho.dev
Scale is Poison It's March 9th 2021 and Google Calendar still doesn't have a dark mode. The iOS app update notes for...
over a year ago
24
over a year ago
It's March 9th 2021 and Google Calendar still doesn't have a dark mode. The iOS app update notes for the Just Eat app are still boasting about the app now supporting contact-free delivery, and have done for all 25 releases in the last 11 months that I can see on the App Store....
samwho.dev
Fun With Rust's Traits Rust's trait system is wonderful. Everyone I know that has used it agrees with this statement. It's...
over a year ago
24
over a year ago
Rust's trait system is wonderful. Everyone I know that has used it agrees with this statement. It's a great way to encode shared behaviour between data types, and create flexible APIs. It's also great for writing nonsense like this: use std::f64::consts::PI; use...
samwho.dev
Move Your Bugs to the Left We all want to ship bug-free software. No-one wants to be the person that introduced a show-stopping...
over a year ago
23
over a year ago
We all want to ship bug-free software. No-one wants to be the person that introduced a show-stopping bug the week before release. To help with this, I’ve come up with a simple way to visualise the points in the development process that you can find bugs. The further to the left...
samwho.dev
API Design: Optional Parameters When we write functions, it's common to want to give the user options to suit a range of use-cases....
over a year ago
23
over a year ago
When we write functions, it's common to want to give the user options to suit a range of use-cases. There are good ways and bad ways of doing it, and this post is going to explore them. › Guiding principles API design is hard. A good API needs to be: Easy to change without...
samwho.dev
Adventures in Homelab: Part 1 If you work in tech, and you use the cloud in any way, you've probably heard of Kubernetes. It's...
over a year ago
23
over a year ago
If you work in tech, and you use the cloud in any way, you've probably heard of Kubernetes. It's inescapable now, and there's no shortage of takes on it. I've worked in a few companies that have used Kubernetes, but never been close to it. I've used in-house tools that...
samwho.dev
Life Skills Learned Playing World of Warcraft Between the ages of 14 and 17 I had an addiction to an online game called World of Warcraft...
over a year ago
22
over a year ago
Between the ages of 14 and 17 I had an addiction to an online game called World of Warcraft (WoW). In the first half of this post I'm going to explain the game and how I played it. In the second half I'll talk about the skills I learned and how they've helped me. If you played a...
samwho.dev
I finally figured out how to take notes! I’ve never been good at taking notes. I’ve tried. Oh boy, have I tried. Name a piece of note taking...
over a year ago
22
over a year ago
I’ve never been good at taking notes. I’ve tried. Oh boy, have I tried. Name a piece of note taking software, odds are I’ve tried it. I’ve even tried going old school with pen and paper. Nothing sticks. Until recently. Some time ago, I learned about Apple’s Shortcuts app. It’s...
samwho.dev
Having a Baby During the pregnancy of our first child, I kept a journal. I don’t keep journals. I don’t feel like...
over a year ago
22
over a year ago
During the pregnancy of our first child, I kept a journal. I don’t keep journals. I don’t feel like I have much to say in them. This was different. The whole experience was new, and there was a lot to learn. This post is a cleaning up and stitching together of that journal. It...
samwho.dev
API Design: In The Wild We've explored some guiding principles in previous posts, but we're yet to use our new-found skills....
over a year ago
22
over a year ago
We've explored some guiding principles in previous posts, but we're yet to use our new-found skills. Let's take a break and look at some examples from real-world code you can find in use today, and how we might improve them. › Go's math/big package Most languages have a library...
samwho.dev
API Design: Errors Errors are one of the easiest things to overlook when creating an API. Your users will have problems...
over a year ago
21
over a year ago
Errors are one of the easiest things to overlook when creating an API. Your users will have problems from time to time, and an error is the first thing they're going to see when they do. It's worth spending time on them to make using your API a more pleasant experience. › Guiding...
samwho.dev
Dude, where's my main?
over a year ago
samwho.dev
Language Interoperability From the Ground Up How does a function in Ruby call a function in C? How does a function in Kotlin call a function in...
over a year ago
20
over a year ago
How does a function in Ruby call a function in C? How does a function in Kotlin call a function in Java? It's no secret that you can call functions in one programming language from another. Not only is it possible, it can be done in multiple ways. But how does it actually...
samwho.dev
API Design: In The Wild (part 2) In a previous post we looked at some real-world APIs, highlighting the good and the bad, and in this...
over a year ago
20
over a year ago
In a previous post we looked at some real-world APIs, highlighting the good and the bad, and in this post we’re going to do the same! › Python’s datetime.datetime Most experienced Pythonistas have written something like this at some point in their career: import datetime now =...
samwho.dev
A Logical Way to Split Long Lines Splitting long lines is something we do every day as programmers, but rarely do I hear discussion...
over a year ago
19
over a year ago
Splitting long lines is something we do every day as programmers, but rarely do I hear discussion about how best to do it. Considering our industry-wide obsession with “best practices,” line breaks have managed to stay relatively free from scrutiny. A few years ago, I learned a...