I’ve always found it invaluable to have a clear , complete and omnipresent overview of any text-based resource I’m absorbing. Having a “bird’s eye view” of all available information aleviates
the feeling that I may have missed or skipped over something, and it helps me discern the way a section I’m reading at any given moment relates to the rest of the…
The web and desktop versions of the Spotify client provide two distinct ways of displaying track lists when viewing a resource such as a playlist or an album: 
 
 Compact 
 List 
 
 
 They differ primarily in the amount of padding and spacing between the individual rows representing tracks, with the Compact mode also omitting
the belonging album’s cover thumbnail…
On Linux, threads and processes don’t actually exist. Underneath all the abstractions, the kernel knows only of “tasks” - independent flows of execution, created using the clone(2) 
family of syscalls. The differences between what we call a “thread” and what we call a “process” lie in the flags argument of the clone syscall, which determines many kinds…
Shell redirection allows you to redirect a process’ standard streams to paths other than the controlling terminal. This post will focus on explaining how it is implemented
by shells (such as bash ). If you are unfamiliar with redirection and would like to familiarize yourself with the concept and syntax (as far as bash is concerned), then
 GNU Bash Reference Manual - Redirections is…
I recently wrote bhashmap - a C11 hash table implementation
library. This post will document one of the latest optimizations, which is in hindsight extremely
simple to understand and implement, but which resulted in a ~30% runtime speedup. 
 Background 
 Before talking about the optimization, let’s quickly get up to speed with how things worked before.
I will focus only…
I recently got curious as to how the time.sleep function from Python’s standard library was implemented by CPython - and as it turns out, it’s pretty easy to figure out. 
 All I had to do was strace a minimal example Python program that utlizies the function: 
 1 strace python3 -c 'from time import sleep; sleep(0.5); print('Done!');' 2> out.txt
 And sure enough, near the…
Modern 64-bit processors are capable of storing $2^{64}$ different values within their general-purpose registers. Each one of those possible values is simply a different combination of 64
sequential bits - and each one of those bits can, of course, exist in one of two states at a single point in time. 
 Given any number of bits $ N $, we can always conclude that the maximum number of…
When you normally execute, say man 3 printf , man simply does the job of looking up and fetching the particular manpage. The actual
act of displaying it, is done by a pager . 
 The default pager that man uses, less , is in essence a simple TUI program that allows for easy navigation of a particular text
buffer (scrolling, searching, etc… all using vi-like keybindings). It can…
As of writing, Unicode contains 1,112,064 possible codepoints. 
 
 Actual codepoints range from 0 through 0x10FFFF though a part is reserved for backwards compatibility of other codecs with UTF-16, resulting in 1,112,064 actually available codepoints. 
 
 It’s important to note that not all (in fact most) codepoints are not characters . A common example is the Combining…
Recently I needed a way to infinitely loop over a list in Python. Traditionally, this is extremely easy to do with simple indexing if the size of the list is known in advance. For example, an approach could look something like this: 
 1 l = [ 1 , 2 , 3 ] 
 2 i = 0 
 3 
 4 while True : 
 5 print ( l [ i ]) 
 6 i += 1 
 7 if i == len ( l ): 
 8 i = 0 
 Eventually…
Python is a programming language. It is nothing more but one large document of text and code examples (a standard ) that describes exactly how the language is to behave. You can’t run it, download it, or execute it. That’s it, it’s just text. 
 The latest edition of it is up on the official Python website as the The Python Language Reference . As Python also consists of a…
Scripting with fish is simple. It is readable. You don’t need to have deep experience with it in order to understand the syntax. 
 Compared to bash , it feels intuitive . 
 Everything is a builtin 
 builtins are commands that you call from the shell, but unlike regular commands that execute external binaries and spawn new processes, they are built right into the shell (e.g. echo…
I recently took it upon myself to, at least at the surface level, understand how the ELF (" Executable and Linkable Format ") works.
In order to do that, I set out to create a tiny python3 module for parsing (meta-)data out of ELF files. 
 The result of that is p3elf , during the development of which I familiarized myself with ELF, binary IO in python, as well as setuptools and publishing…
This document serves as a quick reference to how UEFI and GPT work in regards to booting a modern system. 
 
 I will not cover BIOS/MBR in this document. I will acknowledge their existence and will compare them to their modern counterparts, but I feel that it is a waste of time to dig deeper into their inner workings. I will also not cover or mention the compatibility possibilites/issues…

 This is a pretty old document that I wrote for myself back when I was first learning C, but the explanation is pretty good so I published it here for future reference. I hope to soon push a reference document that explains some tricky concepts and things from the C standard that are not so easy to remember off the top of the head (such as type conversion, declarations, storage durations,…