week 05, 2023

Configuring Emacs for MDX files

I'm an Emacs user and I have been for the last decade. I use emacs for everything from code, to posts on this blog, even down to my daily TODO list with Org Mode. Naturally, I want to also use emacs to edit posts on this blog. The only problem is that the blog uses MDX instead of normal Markdown. There isn't an Emacs major mode for MDX and the ticket for editor support in MDX was closed. This should mean that I'm out of luck and must architect a new major mode for Emacs.

Source: Configuring Emacs for MDX files, an article by Xe Iaso.

To Green Angel Tower, Part 2

The evil minions of the undead Sithi Storm King are beginning their final preparations for the kingdom-shattering culmination of their dark sorceries, drawing King Elias ever deeper into their nightmarish, spell-spun world.

As the Storm King’s power grows and the boundaries of time begin to blur, the loyal allies of Prince Josua struggle to rally their forces at the Stone of Farewell. There, too, Simon and the surviving members of the League of the Scroll have gathered for a desperate attempt to unravel mysteries from the forgotten past.

For if the League can reclaim these age-old secrets of magic long-buried beneath the dusts of time, they may be able to reveal to Josua and his army the only means of striking down the unslayable foe....

In the evening I started in To Green Angel Tower, Part 2, part 2 of book 3 of Memory, Sorrow and Thorn by Tad Williams.

Pebbles Kitty Cat Café

In the early afternoon we took the bus to Schiedam and next the subway to Rotterdam to visit Pebbles Kitty Cat Café which is located a short walk from one of the subway stops. Before we left the house I had made a reservation, which is recommended, and we arrived just a few minutes after our time slot had started.

Esme, Pixel the cat, and Alice
Esme, Pixel the cat, and Alice.

Alice had asked some time ago to vist a cat café and Pebbles was the closest to our house. It was very busy and most of the seven cats where resting in high spots. After we had ordered cheese cake and apple pie with whipped cream we were warned that it might attract the cats and to not feed them.

Adam petting Luna the cat
. Adam petting Luna the cat.

Alice Thai Street Food

After we had done quite some shopping we wanted to have dinner. First we went to a Chinese restaurant we had visited in the past. But it was fully booked. Earlier I had called an Indian restaurant but they were also fully booked. So I looked for a restaurant nearby and we found Alice Thai Street food. And they had room for us.

Thai food dish I ordered
Thai food dish I ordered.

I can't recall the name of the dish I ordered but it was very good.

Haskell is not category theory

If you have hung out in Haskell communities, you might have heard people mentioning concepts from the mathematical field of category theory, perhaps even claiming that Haskell is built upon category-theoretic foundations.

There is some truth to this, but I think it is more accurate to say that certain abstractions in Haskell are inspired by category theory. When learning Haskell, I took this connection too literally and ended up confusing the hell out of myself. This post is aimed at my former self and aims to clear up some confusions I came across while trying to make sense of it all.

Source: Haskell is not category theory, an article by Pema Malling.

tcpdump is amazing

It took me 2 years, but I think now I love tcpdump. Before we go into why – what’s tcpdump?

tcpdump is a tool that will tell you about network traffic on your machine. I was scared of it for a long time and refused to learn how to use it. Now I am wiser and I am here to show you that tcpdump is awesome and there is no need to be scared of it. Let’s go!

Source: tcpdump is amazing, an article by Julia Evans.

JVM Field Guide: Memory

A field guide is a book designed to help identify birds, spiders, or other animals while on a nature walk. Typically, these books are very concise as you don’t want to bring a five volume encyclopaedia to your bushwalk. They only contain the necessary details while leaving out less important information.

This article is the first chapter of an attempt to create such a guide for running and supporting JVM applications. A guide that is concise only contains the necessary information, and can be used to find a solution when encountering a problem in the field. As with animal kingdoms, there are five fundamental resources that can affect JVMs runtime: Memory, CPU, Disk IO, Network, and thread synchronisation.

This article focuses on the first one – memory. Memory is an extensive topic. There could be books written on how JVM applications use memory, and it’s impossible for a single article to cover the whole story. Instead, the guide focuses on the most practical aspects of dealing with JVM applications, primarily server-side ones, and provides plenty of references for those who’d like to dive deeper.

Source: JVM Field Guide: Memory, an article by Sergey Tselovalnikov.

Don’t bother trying to estimate Pandas memory usage

You have a file with data you want to process with Pandas, and you want to make sure you won’t run out of memory. How do you estimate memory usage given the file size?

At times you may see estimates like these:

  • “Have 5 to 10 times as much RAM as the size of your dataset”, or
  • “several times the size of your dataset”, or
  • 2×-3× the size of the dataset.

All of these estimates can both under- and over-estimate memory usage, depending on the situation. In fact, I will go so far as to say that estimating memory usage is just not worth doing.

Source: Don’t bother trying to estimate Pandas memory usage, an article by Itamar Turner-Trauring.

Python’s “Disappointing” Superpowers

In Hillel Wayne’s post “I am disappointed by dynamic typing”, he expresses his sense that the Python ecosystem doesn’t really make the most of the possibilities that Python provides as a dynamically typed language. This is an important subject, since every Python program pays a very substantial set of costs for Python’s highly dynamic nature, such as poor run-time performance, and maintainability issues. Are we we getting anything out of this tradeoff?

Source: Python’s “Disappointing” Superpowers, an article by Luke Plant.

Surprises in the Rust JSON Ecosystem

I knew from experience that serde_json::Value can't store borrowed data. For my use case, I wanted to find a crate that allowed me to borrow data from the JSON I was parsing, rather than needing a lot of tiny allocations for each string. Since every object key in JSON is a string, they add up quickly.

Source: Surprises in the Rust JSON Ecosystem.

100 Days Of More Or Less Modern CSS

It’s time to get me up to speed with modern CSS. There’s so much new in CSS that I know too little about. To change that I’ve started #100DaysOfMoreOrLessModernCSS. Why more or less modern CSS? Because some topics will be about cutting-edge features, while other stuff has been around for quite a while already, but I just have little to no experience with it.

Source: 100 Days Of More Or Less Modern CSS, an article by Manuel Matuzović.

Getting started with GNU screen

Screen is a terminal multiplexer and has a wide feature set. It allows you to split your terminal window into multiple windows (split screen feature), detach sessions to let commands run in the background, connect to a device via serial interface, and many more. Screen sessions keep running even if you disconnect, which is especially great for unreliable connections. There are more advanced use cases, but we will focus on the basics.

Source: Getting started with GNU screen.

Perl Testing in 2023

With my open source work, I’ve historically taken an approach which relies more on integration testing than unit testing, but with some of my newer projects, I’ve tried adopting principles from $paidwork and applying them to my free software.

This is a quick run-down of how I’m structuring my test suite in newer projects. It’s likely that many of my existing projects will never adopt this structure, but some may.

Source: Perl Testing in 2023, an article by Toby Inkster.

Monoids in the Category of...

This is not a monad tutorial. You do not need to read this, especially if you’re new to Haskell. Do something more useful with your time. But if you will not be satisfied until you understand the meme words, let’s proceed. I’ll assume knowledge of categories, functors, and natural transformations.

Source: Monoids in the Category of..., an article by Jack Kelly.