week 41, 2022

30 days on a Raspberry Pi

Earlier last month, however, I decided to give again the Pi a spin. Just to blow the dust from the top and see how it was doing, nothing really serious. Fast forward to now, and I have just completed a streak of over 4 weeks of using nothing but my Raspberry Pi as my personal computer. That is: 4 weeks of using it for everything including full browsing, messaging, and even work-related stuff - and I have absolutely no intentions to stop using it!

Source: 30 days on a Raspberry Pi, an article by Klaus Zimmermann.

Make Atomic Git Commits

We’ve all been there: You worked on lots of changes at once, some of which didn’t have anything in common. For the sake of convenience, you decided to lump all of these changes into a single commit and call it a day. But while this may seem tempting, it could actually cause more problems down the line. Bigger commits can:

  1. Obfuscate the source of bugs or regressions in the future.
  2. Make it difficult to revert undesired changes without also reverting desired ones.
  3. Make larger tickets more overwhelming and difficult to manage.

I’ve recently developed a habit of making atomic commits to keep my work more manageable; I recommend that you give this a try to see if it works for you.

Source: Make Atomic Git Commits, an article by Aleksandr Hovhannisyan.

We're moving away from swap partitions on our Linux servers

We have a reasonable number of Linux servers, almost all of them running various versions of Ubuntu. Like pretty much everyone configuring Linux servers, we give them some swap space; the Linux kernel traditionally is much happier if it has a bit of swap space (cf), although you don't want too much. For a long time we used a separate disk partition for this (or a mirrored pair of them in a separate software RAID mirror device), although Linux distributions themselves were increasingly moving to using swap files located in the root filesystem (sometimes rather excessively large ones; the Ubuntu 20.04 and 22.04 installers use 4 GB even for machines with only 4 GB of RAM). We didn't have any particularly strong reasons for using a swap partition instead of a swap file; it was just what we'd started out with and what we were used to.

Source: We're moving away from swap partitions on our Linux servers, an article by Chris Siebenmann.

Avoiding Featurism

The major issue with getting sucked into a black-hole of “featurism” is there is no single person to blame. It probably seems easy to place all the responsibility on PMs or team leaders, but even if they are the ones adding excessive complexity to a given project, it is the role of developers and designers to speak up. It requires a team effort. Therefore, the whole team needs to be on-guard to avoid it.

Source: Avoiding Featurism, an article by Bradley Taunt.

Evolution of HTTP

HTTP (HyperText Transfer Protocol) is the underlying protocol of the World Wide Web. Developed by Tim Berners-Lee and his team between 1989-1991, HTTP has gone through many changes that have helped maintain its simplicity while shaping its flexibility. Keep reading to learn how HTTP evolved from a protocol designed to exchange files in a semitrusted laboratory environment into a modern internet maze that carries images and videos in high resolution and 3D.

Source: Evolution of HTTP.

PostgreSQL 15 Released!

The PostgreSQL Global Development Group today announced the release of PostgreSQL 15, the latest version of the world’s most advanced open source database.

PostgreSQL 15 builds on the performance improvements of recent releases with noticeable gains for managing workloads in both local and distributed deployments, including improved sorting. This release improves the developer experience with the addition of the popular MERGE command, and adds more capabilities for observing the state of the database.

Source: PostgreSQL 15 Released!.

Layout Breakouts with CSS Grid

What I'm documenting here is an extension of the full-bleed CSS Grid layout. In the last version of my site, selected elements – images, code blocks, quotes – were made wider than the page content area using negative margins. It worked well! For this next iteration, I explored applying these breakout offsets using CSS grid and named grid lines.

Source: Layout Breakouts with CSS Grid, an article by Ryan Mulligan.

Rewriting the Modern Web in Rust

Earlier this year I rewrote my website with Next.js, React, tsx, and mdx. Having tried full-stack rust in the past, I didn’t think its developer experience was on par with the Next.js stack. Well times have changed, and I wanted to see just how far I could push rust to feel like Next.js. So I did what any developer would do and rewrote my personal site… again.

Source: Rewriting the Modern Web in Rust, an article by Kevin King.

Seven Sins of Numerical Linear Algebra

In numerical linear algebra we are concerned with solving linear algebra problems accurately and efficiently and understanding the sensitivity of the problems to perturbations. We describe seven sins, whereby accuracy or efficiency is lost or misleading information about sensitivity is obtained.

Source: Seven Sins of Numerical Linear Algebra, an article by Nick Higham.

Type annotation via automated refactoring

Carta made the mypy type checker an option for individual teams in 2018, but the burdensome manual work of adding missing type annotations meant that few adopted it. Mypy would have generated an unmanageable number of errors if we had required it universally.

Carta’s infrastructure team saw this as an opportunity to improve the quality of life for our engineers and enhance our overall code quality and ownership. We built an automated refactoring framework to add those missing types, particularly useful for repaying tech debt in a large codebase. We estimate that it has saved over four years of manual work and greatly helped engineers focus on product development.

Source: Type annotation via automated refactoring, an article by Jimmy Lai.

Swift was always going to be part of the OS

Recently on the Swift Forums, someone complained that putting Swift in the OS has only made things worse for developers. My immediate reaction is a snarky “welcome to the world of libraries shipped with the OS”, but that’s not helpful and also doesn’t refute their point. So here’s a blog post that talks about how we got where we did, covering time when I worked on Swift at Apple. But I’m going to have to start a lot earlier to explain the problem…

Source: Swift was always going to be part of the OS, an article by Jordan Rose.

When SUPER Isn't

At runtime, the SUPER:: method redispatch looks at the package into which Perl 5 compiled the current method, then looks in its list of parent classes to figure out which method to call next.

You can see the problem. This behavior is, I believe, largely an artifact of a particular implementation -- likely the intersection of several sensible design decisions which combined to produce an unfortunate corner case.

Source: When SUPER Isn't, an article by chromatic.

12 Factor App Revisited

The Twelve-Factor App methodology is a methodology for building software-as-a-service applications by Adam Wiggins. We cover how they have since evolved, and what we can learn from them today and how they changed the status quo of yesteryear.

Source: 12 Factor App Revisited, an article by Mahdi Yusuf.

Worry-free NixOS refactors

As a NixOS configuration grows in complexity, it may eventually become clear that it’s not optimally organized. Maybe the entire configuration is in a single unwieldy file and needs to be broken up. Maybe there are bits repeated for every machine which should really be placed in a common module. This can become a problem in any codebase, but there is a trick for NixOS configurations that makes the process a whole lot less stressful.

Source: Worry-free NixOS refactors, an article by Taeer Bar-Yam.

Locklands: Very Good

In the afternoon I finished Locklands, book 3 in The Founders Trilogy by Robert Jackson Bennett. I liked the final book in the trilogy a lot, a real page turner and a great conclusion; recommended.

Static HTML comments

If you have a static HTML website, but you want to include comments, here’s an interesting way to do it using PostgreSQL’s NOTIFY and LISTEN.

The big idea is to write the comments as static HTML, only when comments change, instead of doing a database query to display them every time. This prevents the “hug of death” if you get a burst of traffic.

Source: Static HTML comments, an article by Derek Sivers.

Righteous Prey

“We’re going to murder people who need to be murdered.”

So begins a press release from a mysterious group known only as “The Five,” shortly after a vicious predator is murdered in San Francisco. The Five is made up of vigilante killers who are very bored…and very rich. They target the worst of society—rapists, murderers, and thieves—and then use their unlimited resources to offset the damage done by those who they’ve killed, donating untraceable Bitcoin to charities and victims via the dark net. The Five soon become popular figures in the media …though their motives may not be entirely pure.

After The Five strike again in the Twin Cities, Virgil Flowers and Lucas Davenport are sent in to investigate. And they soon have their hands full--the killings are smart and carefully choreographed, and with no apparent direct connection to the victims, the killers are virtually untraceable. But if anyone can destroy this group, it will be the dynamic team of Davenport and Flowers.

In the evening I started in Righteous Prey by John Sandford.