Programming Leftovers
-
Chris Wellons ☛ Two handy GDB breakpoint tricks
Each serves a slightly different purpose but still has the most important property: Immediately halt the program directly on the defect. None have an occasionally useful secondary property: Optionally allow the program to continue through the defect. If the program reaches the body of any of these macros then there is no reliable continuation. Even manually nudging the instruction pointer over the assertion isn’t enough. Compilers assume that the program cannot continue through the condition and generate code accordingly.
-
Matt Keeter ☛ Reverse-engineering the Synacor Challenge
After finishing Advent of Code in December, I found myself hungering for more puzzles. The Synacor Challenge is a previous set of puzzles by the same author; I decided to check it out.
The core of the challenge is simple: you're given a specification for a fictional processor, and a 59 KB file that should be executed.
-
Logikal Solutions ☛ C++ — That Const Thing
Const is what makes C++ great. Const is what makes C++ too horrible to work with.
Developers who read those “Effective” books on C++ really screw the pooch. The developers working on the Qt library who hide everything anyone would want to override inside a “private” class only documented in the source file for the actual class and buried behind a macro passing most everything to it as const make the “screw the pooch” developers seem like they almost know what they are doing.
-
Nicolas Fränkel ☛ Improving upon my OpenTelemetry Tracing demo
The OpenTelemetry agent added a new span when connecting to the database on the JVM and in Python. For the JVM, it’s automatic when one uses the Java agent. One needs to install the relevant package in Python - see next section.
-
Python
-
University of Toronto ☛ Getting the Python LSP server working with venvs the brute force way
Recently I wound up doing some Django work using a Python venv, since this is the easiest way to get a self-contained Python environment that has some version of Django (or other applications) installed. However, one part of the experience was a little bit less than ideal. I normally write Python using GNU Emacs and the Python LSP server, and this environment was complaining about being unable to find Django modules to do code intelligence things with them. A little thought told me why; GNU Emacs was running my regular LSP server, which is installed through pipx into its own venv, and that venv didn't have Django installed (of course).
-