Python

How to create a WAVE file

29 Jul 2024

Today I set out to learn how to create a WAVE file.

I had recently gone through an article about reading and writing wave files in Python, which whet my appetite to do somewhat the same in Zig.

Continue reading →

Pratt parsing, aka top-down precedence parsing, aka precedence climbing

23 Jul 2024

Since last weekend I’ve been toying around implementing a calculator in Zig.

One of my favorite algorithms I learned in college from my data structures classes were the shunting yard algorithm to parse and evaluate expressions, converting to the reverse Polish notation. Those exercises were clearly an important part of my becoming a programmer, as I’ve implemented those in most major programming languages I’ve learned over the years.

Continue reading →

How to add extra log context with loguru

07 Nov 2023

Loguru is a Python library that provides a neat logging API, and I recently learned how to add extra context to the logs.

Continue reading →

How to avoid BOM issues with CSV files created on Windows

27 Oct 2023

When loading CSV files in Python that were created on Windows, you can get some weird errors because the Microsoft tools usually add a BOM.

Continue reading →