Plurrrr

week 26, 2022

The Red Fox

In the afternoon we went to Kijkduin on bike. On our way through the dunes Esme spotted a young red fox. I tried to take a few photos but it was too far away.

Corallina officinalis
Corallina officinalis

On the beach Adam found a piece of seaweed which according to Google lens is called Corallina officinalis.

Adam and the red fox, Vulpes vulpes
Adam and the red fox, Vulpes vulpes.

On the way back we spotted the red fox again, this time on the other side of the road. Adam got of his bike and moved slowly closer and took some photos.

Red fox, Vulpes vulpes. Photo by Adam
Red fox, Vulpes vulpes. Photo by Adam.

Licorice Pizza (2021)

The story of Alana Kane and Gary Valentine growing up, running around and going through the treacherous navigation of first love in the San Fernando Valley, 1973.

In the evening Esme and I watched Licorice Pizza. I liked the movie and give it a 7 out of 10.

Faster routing for Flask & Quart

Flask and Quart both utilise Werkzeug's HTTP router to route request paths to the relevant function. With the upcoming 2.2 release of Werkzeug this router will be significantly faster, with up to a factor of 5 seen in testing. This speedup increases with the size of the routing table and so you are likely to see further increases in your production applications. However, simple routing tables, as seen in micro-benchmarks, are unaffected and are unlikely to show a speedup.

The speedup is achieved by changing the algorithm from the original that matches against a list of regexs. Initially a radix/prefix tree algorithm was tried, but it couldn't support all of Werkzeug's features. Instead a state machine algorithm has been developed to be the new routing algorithm for Werkzeug.

Source: Faster routing for Flask & Quart, an article by Philip Jones.

The Lost City (2022)

A reclusive romance novelist on a book tour with her cover model gets swept up in a kidnapping attempt that lands them both in a cutthroat jungle adventure.

In the evening we watched The Lost City. I liked the movie and give it a 7 out of 10.

Clipboard Goodies For Productivity

Have you ever typed ctrl-c instead of ctrl-v and had to recopy again? Have you ever needed to copy and paste multiple entries at once from a page causing you to switch back and forth? Have you ever needed to copy the output of a program running in the terminal? I did, and got fed up with them almost 5 years ago, I’ll show you how you can eliminate these problems.

Source: Clipboard Goodies For Productivity, an article by Mátyás Budavári.

Retry XMLHttpRequest Carefully

It's rare to see a web app that doesn't use XMLHttpRequest (or fetch, the new API with comparable capability). XMLHttpRequest (which we can call XHR if you're into the whole brevity thing) is as handy as a shirt pocket, but it doesn't do much to encourage robust and resilient programming practices. Any app that runs in the real world will sometimes encounter transient network interruptions and server outages. We should gracefully recover from both by automatically retrying our requests. But, we shouldn't turn a brief server hiccup into a full-on fireworks display by retrying too fast or by having every client retry at the same time.

This good advice gives us three concrete goals:

  • Retry our XHR when we get an error.
  • Pause an appropriate duration before retrying.
  • Randomize the duration of the pause.

Source: Retry XMLHttpRequest Carefully, an article by Aaron D. Parks.

Things I wish everyone knew about Git (Part I)

When I first used Git it drove me almost to tears of rage and frustration. But I did get it under control. I don't love Git, but I use it every day, by choice, and I use it effectively.

The magic key that rescued me was John Wiegley's Git From the Bottom Up

Git From the Bottom Up explains the model. I read it. After that I wept no more. I understood what was going on. I knew how to try things out and how to interpret what I saw. Even when I got a surprise, I had a model to fit it into.

Source: Things I wish everyone knew about Git (Part I), an article by Mark Dominus.

Vim 9.0 released

After many years of gradual improvement Vim now takes a big step with a major release. Besides many small additions the spotlight is on a new incarnation of the Vim script language: Vim9 script.

Source: Vim 9.0.

Throwaway development environments with Nix

Today I’d like to talk about the package manager. Specifically, a lovely gateway into the rest of the ecosystem, nix-shell.

Some people will tell you that the point of Nix is to set up your software so it can be built with Nix, which allows you to tightly control all dependencies and emit something that is as close to reproducible as possible. I am all for this, but if we can tightly control the dependencies without actually building inside a Nix environment, we’ve still improved the reproducibility a lot, and it’s not that hard.

Source: Throwaway development environments with Nix, an article by Samir Talwar.

REPL Python programming and debugging with IPython

When programming in Python, I spend a large amount of time using IPython and its powerful interactive prompt, not just for some one-off calculations, but for significant chunks of actual programming and debugging. I use it especially for exploratory programming where I’m unsure of the APIs available to me, or what the state of the system will be at a particular point in the code.

Source: REPL Python programming and debugging with IPython, an article by Luke Plant.