All posts by Stephen Darlington

Make Something Wonderful

Make Something Wonderful,” a collection of Steve Jobs writing and photos is… well, it’s a good thing that I write these notes for myself. You’ll already know if you’re interested.

I’m not sure there’s much new and undiscovered here, but it’s nicely collated and fascinating reading.

One highlight is the script from his Stanford commencement speech. But what I enjoyed most were the notes. The speech was almost perfect, but the notes allow you to see the process that led there. The common perception of the lone genius having a eureka moment is a lie. Jobs worked and practiced and iterated and sought feedback. Much of his work he attempted to make everything look simple and obvious, but the reality is that “effortless” takes a lot of hard preparatory work. Some might argue that this detracts from his achievements, but I’d say that the exact opposite is true.

His words are punctuated with brief explanations, but otherwise his words are left to speak for themselves.

The book is free, so if you’re even slightly interested it’s worth downloading.

The Romantic

William Boyd is one of my favourite authors. He specialises in doorstop novels that document the entire life of an interesting individual. His most famous is probably “Any Human Heart” and “The Romantic” [affiliate link] follows in its footsteps.

The story crosses the globe, starting in Ireland, moving to England, Belgium, the US, Africa, India, Sri Lanka, Italy, Austrian and others I’m probably forgetting. And it begins in 1899, so covers an interesting time in history. (I did some quick Wikipedia fact checking and it stands up!)

What makes these books work is that his characters feel real. They’re flawed. Heros sometimes, but with relatable failings that anchor them in reality.

It’s not Boyd’s best, but it’s thoroughly enjoyable and beautifully written.

Reading 2023

In a turn of events that surprised even me, I managed to exceed my reading target of twelve books this year.

I managed a decent mix of fiction and non-fiction. More politics than usual, but even that was mostly on the lighter side.

Highlights would be “Jeremy Hardy Speaks Volumes” and “How Westminster Works.” I don’t think any of the books were bad so I’m not going to share a “worst of.” You can see from the notes which ones I enjoyed the most.

I’m going to keep with the twelve book target for next year.

Depraved New World

It’s difficult to come up with a better explanation for what this book is like than the description on the back: Depraved New World (affiliate link) is a worryingly funny collection, which captures British politics at its most absurd. 

It’s a collection of John Crace’s political sketches, originally published in the Guardian, covering October 2021 to June 2023. A pretty eventful time in British politics.

Reading it now, in late 2023, is probably the perfect time. Much earlier and you can’t tell the “good” sketches or consequential events from the average ones. Much later and you’ll have forgotten some of the important details that are being written about. They’re sketches, not analysis of the events or a history. Between the chapters are occasional colour about what was going on, but, broadly, you’re on your own. Political geeks only! Some parts I’d forgotten, but smiled when I recalled. If you’d come across Braverman stepping on a guide dog’s tail on The Thick of It, you’d dismiss it as too unlikely and contrived.

If there’s a trend for the books I’ve read this year, it’s “entertaining but not a classic.” I would put “Depraved New World” in the same category.

The Last White Man

This book (affiliate link) was being promoted by my local council as part of a reading campaign. I’m not sure I would have picked it up otherwise, which, despite my misgivings, would have been a shame.

The story is about the world population spontaneously turning black, and the consequence and effects of that. It focuses on a few characters (Anders and Oona) and how it affects their lives.

The writing is unusual. I hesitate to say bad, because it’s very deliberate, but grating maybe? Each paragraph is effectively one long, run on sentence. I didn’t have the audio book, but I am curious how you’d read it without an inhuman pair of lungs.

This isn’t even the complete sentence.

… and he said it suits you too, and she said, really, and he said, really, and he added, you looked too hungry before, and she asked, and now I don’t, and he said, and now you don’t, and she smiled, and then she smiled again, her smile bigger and bigger.

The dialogue is quite convincing and some of the descriptions are beautiful, but I had a hard time seeing past the structure.

I was unconvinced by certain aspects of world changing. Not the idea of changing, which you obviously have to suspend your disbelief of, but the effects. The characters all assumed that the looks they received and the ways that they were perceived were entirely down to the fact they were no longer white. Is that fair? If you dramatically and overnight changed your appearance, would people not react?

For a short book, it took me a while to read but I’m glad I made it to the end.

Unsociable Christmas Tree (Part 2)

Back in 2020 I talked about my Raspberry Pi powered Christmas Tree. Today’s blog delves into what I’ve done this year.

Previously, I decided that setting up a web server on which family members could change the light patterns on the tree was too boring. At the time, I was thinking of extending the sample Python code – much as I did with the OpenCV frontend – with a simple Python-based web server.

There are a few problems with this approach. Firstly, while I’ve never set up a Python web server, I don’t necessarily feel that it would be a challenge. More of a challenge would be my web development skills, which are, for the most part, stuck in about 1997. If you want formatting using tables rather CSS, I’m your man.

I found a way to solve both problems, while also using a Raspberry Pi Zero W for something outside its intended purpose.

I decided to use the Vaadin Java framework for the user interface. With Vaadin you don’t need to worry about HTML and formatting, you say, for example, I want a block with a group of radio buttons and a text box, and it generates your HTML, JavaScript and backend code. You can kind of think of it as SwiftUI for the web.

I wrapped it all in Spring Boot, because using an enterprise-grade UI library on a slow, single-core, 32-bit ARM CPU with 512Mb of memory isn’t ridiculous enough.

Jumping ahead for a second – spoiler alert – the application takes about two minutes to start on the Pi Zero W. It performs reasonably well once it’s started, but I think it’s fair to say that few corporations are going to be using Pi Zeros as part of their infrastructure.

It sounds bad, but the other way of looking at it is that it runs! A computer that costs £15 is able to run 47Mb of modern Java 17 code1. It’s not practical, but it is pretty amazing.

Before figuring out the user interface, the first thing I needed to work on was how to get Java to talk to the LED Christmas Tree. The sample Python code uses some library code that reads and writes to the Pi’s GPIO pins. Can you even do that in Java?

It didn’t take a lot of searching around to find Pi4j, a Java library to do exactly that.

It took a lot of experimentation to get it working. The defaults didn’t work – no errors, it just didn’t light up the LEDs. The Pi Zero isn’t an ideal Java development platform, so I did the coding on my MacBook, which also isn’t an ideal Java development environment. I was lazy, in a bad way, and didn’t properly build a test environment, instead building a JAR file on my laptop, manually copying over to the Pi and running it. I also found that Visual Studio Code isn’t as good as IntelliJ for writing Java programs.

Through a process of experimentation, I realised that I needed to use the pigpio backend provider2. The downside of using pipgio is that it requires super-user access. The alternative LinuxFS plugin does not need to be run as root, but it does not currently support access to the GPIO pins3.

Having proved that it was possible to flash the Christmas Tree’s lights in Java, I set out to port the Python library that came with it. The basics were pretty straight-forward. The sample code, however, uses sleep statements between the various lighting patterns, something that I didn’t want to do. I overestimated how complicated this would be and ended up simplifying my code. This is rare; I normally start super-simple and iterate.

Finally, I connected the two parts together, et voila, a working, Java-based program driving the Christmas Tree lights with a web interface for configuration.

Computer JVM Startup time
Pi Zero W openjdk version “17.0.8” 111
MacBook openjdk version “21.0.1” 4.2
Pi 4 openjdk version “17.0.9” 15
Pi 5 openjdk version “17.0.9 5.6

Interestingly, the Pi Zero and the Pi 4 both start the JVM in “client” mode, while the MacBook and the Pi 5 use “server” mode4. The Pi Zero also runs in 32-bit mode. I suspect, but didn’t verify, that the difference between the 4 and 5 is at least partly down to the newer instruction set in the 5, which supports native “atomic” operations5.

Software is never completed, only abandoned. And in that spirit, there are a number of things that it would be nice to improve.

The most important aspect is that it’s currently running as root (well, my user with sudo). One perk is this is that it can trivially run on port 80. The risks of running as root on my home network are pretty low, but it’s still not a good idea. I’ll need to update the Pi library so it can access the GPIO pins as a non-privileged user. I’ll then need to figure out a clean way to have the server accessible on port 80 (a web proxy?).

Since we’re not aiming for practical, another option would be to go for the micro services approach. One service to manage the LEDs and another for the UI.

Who knows if I’ll get time for all that. Next year, maybe.


  1. I’m sure it used to cost less than this. The Pi Zero 2 W is now available for about the same price, but has a quad-core, 64-bit CPU. ↩︎
  2. “Pig-pio” is how I always think of it. ↩︎
  3. As I write this, I see that there’s a new release of the Pi4j library which does support accessing the GPIO pins with LinuxFS. I’ll update the code when I get a chance. ↩︎
  4. Switching the Pi 5 to client mode didn’t make a huge difference. ↩︎
  5. At work, we benchmarked Apache Ignite on an ARM-based server, and found that it performed relatively poorly because it lacked the Large System Extensions. ↩︎