A freshly molted Acanthoscurria geniculata

In the early evening I noticed that Adam's female Brazilian whiteknee tarantula, scientific name Acanthoscurria geniculata, had molted. Because I don't check daily it might have happened earlier this week but the tarantula looks really fresh so it might have happened today.

Acanthoscurria geniculata freshly molted
Acanthoscurria geniculata freshly molted.

In the above photo you can see the spider in the bottom right corner and her exuviae, the cast-off exoskeleton, in the top left corner. The tarantula is resting on the web mat she made to molt on top of.

JSON object values into CSV with jq

I wanted to grab a CSV version of a JSON representation of an entityset in the Northwind OData service. Here's how I converted the JSON structure into CSV with jq, and along the way, I talk about arrays, objects, iterators, object indices, variables, identity, array construction and format strings.

Source: JSON object values into CSV with jq, an article by DJ Adams.

Python Standard Library changes in recent years

With each major Python release, all the attention goes to the new language features: the walrus operator, dictionary merging, pattern matching. There is also a lot of writing about asyncio and typing modules — they are developing rapidly and are obviously important for the core team.

The rest of the standard library modules receive undeservedly little attention. I want to fix this and tell you about the novelties introduced in versions 3.8–3.10.

Source: Python Standard Library changes in recent years, an article by Anton Zhiyanov.

Monads for Go Programmers

Monads hide some of the repeated logic of composing functions with embellished types, so that you don’t have to feel like Bart Simpson in detention, but rather like Bart Simpson on his skateboard, bowling a cricket ball, while it is his turn to bat.

Source: Monads for Go Programmers, an article by Walter Schulze.

The SwiftUI render loop

Just like UIKit, SwiftUI is implemented on top of an event loop that dispatches messages to your UI code. The UI code in turn may trigger parts of the screen to be re-rendered. The handling of messages and rendering of graphics on screen form the render loop of an application. All UI frameworks are based on a render loop, in SwiftUI it is hidden particularly well. Most of the time, it works under the hood without us needing to know anything about it. It is amazing how we can write UI code without even needing to understand what an event loop is, and without us needing to worry about how often to render screen content. But in some cases, it is useful to know what is happening behind the scenes.

Source: The SwiftUI render loop, an article by Rens Breur.

We ran every test you could think of on the M1 Ultra

We've now tested every version of Apple's M1 processor, from the first M1 chip in the 13-inch Macbook Pro all the way up to the M1 Ultra in the new Mac Studio, and the chip's ability to scale performance is pretty incredible. The M1 Ultra fuses two M1 Max chips together to get you a processor with 20 CPU cores and 64 GPU cores, along with up to 128GB of RAM, and it's one of the fastest processors we've ever tested.

Source: We ran every test you could think of on the M1 Ultra | Engadget, an article by Christopher Schodt.

Golang Diaries: Generics

My coding time this year has been invested in Quamina, an event-filtering library implemented in Go. Just in the last couple of weeks I spotted an opportunity to bring Go’s shiny new generics to bear, and not just anywhere, but for a central data structure. I got good results, but the process was sort of painful; I kept trying things that looked like they ought to work but didn’t. I’m sharing this tour through that experience because I’m a reasonably competent programmer with mainstream tastes and if I hit these bumps in the road others probably will too.

Source: Golang Diaries: Generics, an article by Tim Bray.

sqlite-utils: a nice way to import data into SQLite for analysis

Recently I wanted to do some basic data analysis using data from my Shopify store. So I figured I’d query the Shopify API and import my data into SQLite, and then I could make queries to get the graphs I want.

But this seemed like a lot of boring work, like I’d have to write a schema and write a Python program. So I hunted around for a solution, and I found sqlite-utils, a tool designed to make it easy to import arbitrary data into SQLite to do data analysis on the data.

Source: sqlite-utils: a nice way to import data into SQLite for analysis, an article by Julia Evans.

Dune Messiah

Dune Messiah continues the story of Paul Atreides, better known--and feared--as the man christened Muad'Dib. As Emperor of the known universe, he possesses more power than a single man was ever meant to wield. Worshipped as a religious icon by the fanatical Fremen, Paul faces the enmity of the political houses he displaced when he assumed the throne--and a conspiracy conducted within his own sphere of influence.

And even as House Atreides begins to crumble around him from the machinations of his enemies, the true threat to Paul comes to his lover, Chani, and the unborn heir to his family's dynasty...

In the evening I started in the second book of the Dune Chronicles by Frank Herbert: Dune Messiah.

Safer Enums

How to “do” enums is a common problem in Go, given that it doesn’t have “real” enums like other languages.

Source: Safer Enums, an article by Nate Finch.

Improved Process Isolation in Firefox 100

In this article, we would like to dive a bit further into the latest major milestone we have reached: Win32k Lockdown, which greatly reduces the capabilities of the content process when running on Windows. Together with two major earlier efforts (Fission and RLBox) that shipped before, this completes a sequence of large leaps forward that will significantly improve Firefox’s security.

Source: Improved Process Isolation in Firefox 100, an article by Gian-Carlo Pascutto.

Boring Python: dependency management

This is the first in hopefully a series of posts I intend to write about how to build/manage/deploy/etc. Python applications in as boring a way as possible. So before I go any further, I want to be absolutely clear on what I mean by “boring”: I don’t mean “reliable” or “bug-free” or “no incidents”. While there is some overlap, and some of the things I’ll be recommending can help to reduce bugs, I also want to be clear: there will be bugs. There will be incidents where a feature or maybe an entire service is down.

Source: Boring Python: dependency management, an article by James Bennett.

Party Cat

Since yesterday we have been looking after Sheba the Maine Coon, a cat that belongs to Esme's coworker. And because it's Adam's birthday today the cat joined us in the festivities.

Sheba the Maine Coon.

Clear explanation of Rust’s module system

Rust’s module system is surprisingly confusing and causes a lot of frustration for beginners.

In this post, I’ll explain the module system using practical examples so you get a clear understanding of how it works and can immediately start applying this in your projects.

Since Rust’s module system is quite unique, I request the reader to read this post with an open mind and resist comparing it with how modules work in other languages.

Source: Clear explanation of Rust’s module system, an article by Sheshbabu Chinnakonda.

Podman v4.1 has been released!

The new Podman v4.1.0 release is now available. This release is all about new features, with some of the most exciting being improved support for running on Mac and Windows, and adding support for Docker Compose v2.0. These are just the beginning, though, as this release also includes the ability to clone containers, significant improvements to checkpointing, and over 25 bug fixes. Read on for more details!

Source: Podman v4.1.0 Released.

PyScript: Python in the Browser

Are you a data scientist or a developer who mostly uses Python? Are you jealous of developers who write Javascript code and build fancy websites in a browser? How nice would it be if we could write websites in Python? Amazingly, at PyCon US 2022, Anaconda’s CEO Peter Wang announced a shiny new technology called PyScript that allows users to write Python and in fact many languages in the browser.

Source: PyScript: Python in the Browser, an article by Sophia Yang.

Existential optics

Optics make it possible to conveniently access and modify data structures in an immutable, composable way. Thanks to that, they catch lots of attention from the functional programming community. Still, you can have a hard time understanding how they work just by looking at data declarations and type definitions.

In this post, I present a way of encoding optics that is different from usual. This encoding, called existential optics, is easier to understand than the other encodings, since it makes more explicit the structure of each optic. This is not new and is well known in the category theory academic circles. Still, these ideas do not seem to appear in libraries for languages like Haskell, Purescript, or Scala.

The most well-known type of optics are lenses, which were also the first to be analyzed and used. We will use them as our recurring example to compare the several ways we have to encode optics.

Source: Existential optics, an article by Marco Perone.

What is JSON Patch?

JSON Patch is a format for describing changes to a JSON document. It can be used to avoid sending a whole document when only a part has changed. When used in combination with the HTTP PATCH method, it allows partial updates for HTTP APIs in a standards compliant way.

The patch documents are themselves JSON documents.

JSON Patch is specified in RFC 6902 from the IETF.

Source: JSON Patch.

Parsing / Recursive Descent Parser

Recursive Descent Parser is a top-down parser where every non-terminal in the BNF grammar is a subroutine. The parser works by recursively calling each subroutine to construct the parsed output. It’s not the only algorithm to implement a parser, but it’s one of the most simple ones that are very easy to understand and implement.

Source: Parsing/Recursive Descent Parser.

Ordering CSS Declarations

In my personal projects, I’ve never imposed any order on my CSS declarations. Or rather: I’ve ordered my declarations, just not mindfully. To Eric’s point, it’s mostly been: “arbitrarily adding properties everywhere until it looks right in the browser.” That’s me.

After reading Eric’s article, I’m feeling convinced to go alphabetical.

Source: Ordering CSS Declarations, an article by Jim Nielsen.

Scapy: low level packet hacking toolkit for Python

Scapy is a Python module and interactive program for low-level network programming that attempts to make it easier without abstracting away the technical details. This project is fairly prominent in cybersecurity space and used for things like exploit development, data exfiltration, network recon, intrusion detection and analysing captured traffic. Scapy integrates with data visualisation and report generation tooling for presenting the results of your research to bug bounty program or during the meeting with customer or management. The foundational idea for Scapy is proposing a Python-based domain specific language for easy and quick wire format management.

Source: Scapy: low level packet hacking toolkit for Python.

Multiple assignment and tuple unpacking

Whether I’m teaching new Pythonistas or long-time Python programmers, I frequently find that Python programmers underutilize multiple assignment.

Multiple assignment (also known as tuple unpacking or iterable unpacking) allows you to assign multiple variables at the same time in one line of code. This feature often seems simple after you’ve learned about it, but it can be tricky to recall multiple assignment when you need it most.

Source: Multiple assignment and tuple unpacking improve Python code readability, an article by Trey Hunner.

The Emacs Guru Guide to Key Bindings

Emacs shortcuts (known as ‘key bindings’) can seem ridiculous to beginners. Some Emacs users even argue you should change them as soon as you start using Emacs.

They are wrong. In this post, I’ll describe the logic behind the Emacs key bindings. Not only will you be closer to passing the guru test, but you might even find you like some of the defaults!

Source: The Emacs Guru Guide to Key Bindings, an article by Wilfred Hughes.

Converting strings to objects with jq

In preparing some data for another upcoming blog post, I needed to convert a list of fully qualified GitHub repository names into a JSON array of single-property objects (to reflect the style of JSON output from GitHub's gh CLI). I achieved this with a short jq filter. Here's how, recorded here, with my working thoughts, mostly for my outboard memory.

Source: Converting strings to objects with jq, an article by DJ Adams.

Unix command line conventions over time

This blog post documents my understanding of how the conventions for Unix command line syntax have evolved over time. It’s not properly sourced, and may well be quite wrong. I’ve not been using Unix until 1989, so I wasn’t there for the early years. Maybe someone has written a proper essay on this, with citations. I’m too lazy to dig them up.

Source: Unix command line conventions over time, an article by Lars Wirzenius.

RSS Feed Best Practises

These are some technical tips for publishing a blog. These have nothing to do with good content, just how to share that content. The recommendations are roughly in order of importance and have rationale for why they are that important.

Source: RSS Feed Best Practises, an article by Kevin Cox.

Pig (2021)

A truffle hunter who lives alone in the Oregon wilderness must return to his past in Portland in search of his beloved foraging pig after she is kidnapped.

In the evening we watched Pig. The movie was OK and I give it a 6 out of 10.

Rust is hard, yes, but does it matter?

Rust is infamous for having a steep learning curve. The borrow checker is the first boss you must defeat, but with a good mental model of how memory works, how objects move, and the rules that the borrow checker enforces, it becomes second nature rather quickly. These rules may sound complicated, but really, they are about understanding the fundamentals of how a computer works.

Source: Rust is hard, yes, but does it matter?, an article by Julio Merino.

Making type-safe internet bots with Haskell

There are basically two types of client applications on the internet:

  • Clients that use the request-response model. One request will generally result in one response. Some examples would be web browsers and many API clients.
  • Clients that receive a continuous stream of data from a server and may or may not send data back at any time. Examples of this type would include chatbots, automated trading applications and multiplayer video games.

In this article, I will describe a fairly general way to use Haskell for constructing a specific kind of clients of the second type: clients that listen to a single network socket and send replies to that same socket, possibly while maintaining state. This article assumes basic proficiency with Haskell and networking.

Source: Making type-safe internet bots with Haskell, an article by Wander Hillen.

Finch (2021)

On a post-apocalyptic Earth, a robot, built to protect the life of his creator's beloved dog learns about life, love, friendship and what it means to be human.

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