Imagine, just for a moment, you and your friends decide to travel in time. In order to make sure you can authenticate your communications with each other, you set up a shared Time-based One Time Password (TOTP). The TOTP algorithm uses a Hash-based Message Authentication Code (HMAC). The hash is calculated from a shared key and a time-based component. The key is a short string of characters. The time-based component is calculated as the number of seconds between now and the Unix Epoch. When…
Continue reading →
I've been thinking about programming languages and their design. In her book about the divergence of the English and American languages, Lynne Murphy asks this question: wouldn’t it be great if language were logical and maximally efficient? If sentences had only as many syllables as strictly needed? If each word had a single, unique meaning? If there were no homophones, so we’d not be able to mix up dear and deer or two and too? That got me thinking about the creativity which can be exp…
Continue reading →
This isn't an original idea, but I needed to get it out of my brain. There are many different definitions of what "Open Source". We can have a lovely argument over a pint as to whether GPLv3 is too open or if a licence which hasn't been validated by the OSI counts. But, more fundamentally, I think Open Source roughly falls into seven levels. These aren't in any particular order of importance. And feel free to argue in the comments if you think I've radically misunderstood something. 1. Look…
Continue reading →
(This is, I think, a silly idea. But sometimes the silliest things lead to unexpected results.) The text of Shakespeare's Romeo and Juliet is about 146,000 characters long. Thanks to the English language, each character can be represented by a single byte. So a plain Unicode text file of the play is about 142KB. In Adventures With Compression, JamesG discusses a competition to compress text and poses an interesting thought: Encoding the text as an image and compressing the image. I would …
Continue reading →
I have a screenshot of my phone's screen. It shows an app's user interface and a photo in the middle. Something like this: If I set the compression to be lossy - the photo looks good but the UI looks bad. If I set the compression to be lossless - the UI looks good but the filesize is huge. Is there a way to selectively compress different parts of an image? I know WebP and AVIF are pretty magical but, as I understand it, the whole image is compressed with the same algorithm and the same…
Continue reading →
I recently read a wonderful paper by Mar Hicks called "Hacking the Cis-tem" which is about database design in the 1960s and the nascent digital state's approach to transgender individuals. It's a short and readable paper with some jaw-dropping anecdotes. Like the man who immediately got a pay rise after his transition, despite working in exactly the same job as before; women were on a lower pay scale... At a basic level you can see why, when computer memory was measured in tens of kilobytes,…
Continue reading →
A superb book! It traces the origins of 26 facets of modern life so that you can understand the code which underpins them. There's only a smattering of actual code you need to read - most of it is constrained to gorgeous hand-drawn illustrations. Although I got a bit of a shock in the 2nd essay when I was confronted by ξ3 < exp(ΔE/τ)! Thankfully the rest of the chapter does a good job of explaining it and why it is important. There are some amazing confessionals from people who, arguably, ma…
Continue reading →
This is a retropost. It was written in 2022, but published later. Well, that was the most bizarre day. A few days ago, Amanda Brock - the CEO of OpenUK - asked if I'd be on a podcast. I agreed, and offered up my office's media studio for the recording. Then she asked if it was OK if Bruce Perens came to record an episode. Errr... OMG, yes! So I got to spend 10 minutes showing Bruce around the GDS office, gushing about how much open source stuff we did - then got to watch him record a…
Continue reading →
Computing is a comparatively young industry. We don't have hundreds of years of history, or secret societies jealously guarding our knowledge, or much love for hierarchy. This makes it difficult to progress in a world which values strict demarcations between people. There's an obvious and well documented path from Army Private to Sergeant. If you're an architect (the kind that designs buildings) there are various qualifications and bodies to assess your knowledge and seniority. But…
Continue reading →
(This is a rant because I'm exhausted after debugging something. If you've made RegEx your whole personality, I'm sorry.) The other day I had to fix a multi-line Regular Expression (RegEx). After a few hours of peering at it with a variety of tools, I finally understood the problem. Getting that deep into the esoteric mysteries made me feel like a powerful wizard with complete mastery of my domain. And I think that's dangerous. I'm sure we've all read a story about a witch or wizard who…
Continue reading →
Punch was a satirical magazine first published in Victorian London. It had a long and noble history of poking fun at... well, just about every fashionable idea of the day. Anyone who pricked the public's conscious probably found themselves lampooned within its pages. Charles Babbage - inventor of the first mechanical computer - found himself starring in a few articles. Here's a scan of one from 1844 (extracted text follows) Returning to the new Houses of Parliament, we must again…
Continue reading →
A few notes to myself. Let's consider a set of 1 dimensional data. For example, the alphabet: ABCDEFGHIJKLMNOPQRSTUVWXYZ What do we mean by "1 dimensional"? Consider the element "B". From there you can go left to "A" or right to "C". Left and right are the only directions you can move. You cannot go up or down from "B". There's no way to go in or out. You're trapped in a single dimension. What if we want to write the data onto a 2 dimensional space - like a bit of paper or a website. …
Continue reading →