StackedBoxes.org

LMB's Web Corner

From Bare Docs to Bare Metal

Many tutorials show how to do bare metal programming on a Raspberry Pi. Some are very good, but they tend to have a certain magic vibe on them. “Trust me, just use the following magic constants and it will work”. I can’t help but ask, hey, where did this magic come from? What if I wanted to figure out all details by myself?

Polar Method

We definitely don’t have a shortage of methods for generating normally-distributed random numbers from a source of uniformly-distributed random numbers. One of such methods is the so called Polar Method, a variation of the Box-Muller Transform, which I already described before. You might want to take a look at it before reading this.

Box-Muller Transform

This algorithm is named after George Edward Pelham Box and Mervin Edgar Muller, who published it on a two-page paper in 1958. The idea was not original, though: it appeared already in the 1934 book Fourier Transforms in the Complex Domain, by Raymond E. A. C. Paley and Norbert Wiener. Stigler’s law strikes again!

Euclidean Algorithm

We don’t know for sure when the Euclidean Algorithm was created nor by whom, but it was made famous around 300 BC by the Elements – the magnum opus of Greek mathematician Euclid. Wikipedia describes it as “one of the oldest algorithms in common use” and Knuth affectionately calls it “the granddaddy of all algorithms”.

DUMP

This is a repository of more or less random programming things, made for my own amusement and edification. I don’t know how this will evolve over time (if at all), but I envision this as a collection of interactive visual explanations of algorithms and data structures.

Trying out GDNative

I’ve been watching and toying a little bit with the Godot game engine for some time now, and it impressed me in several ways. One thing I missed, however, was a satisfying way to write more efficient code in those ever rarer situations in which GDScript1 couldn’t give the speed I wanted. I could write a module in C++, but this involved recompiling the whole engine and, well, programming in C++.

Now, with the upcoming Godot 3.0 (currently in alpha), a much nicer alternative has been introduced: GDNative. I tested it and it mostly worked. Here’s a summary of my experience.