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”.


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.

A Conceptual Machine Learning Primer, Part 2

On the second and final part of this conceptual introduction to Machine Learning (ML), I’ll discuss its relationship with other areas (like Data Science) and describe what I perceive as a common theme among many of the ML algorithms. Emphasis on “what I perceive”: don’t take this as the truth.

A Conceptual Machine Learning Primer, Part 1

“Machine Learning” is not just a buzzword — arguably, it is two. Almost everybody seems to be using Machine Learning (ML) in a way or another, and those who aren’t are looking forward to use it. Sounds like a good topic to know about. I did some nice Neural Network stuff with some colleagues in school in the late 90s1. Maybe I could just brag that I have nearly 20 years of experience in the field, but this would not be exactly an honest statement, as I didn’t do much ML since then.

Anyway, this is a fun, useful and increasingly important field, so, I guess it is time to do some ML for real. Here’s the first set of notes about my studies, in which I present some important concepts without getting into specific algorithms.

Open Scene Graph: More State — Lights, Textures and Shaders

I could made this part fit into a single paragraph. Serious, just watch:

Light, textures and shaders are part of the rendering state, so they are handled just as shown in the previous post. Sure, using them requires the use of subclasses of osg::StateAttribute that have not been shown, like osg::Light, osg::Texture2D, and osg::Program, but the idea is the same. So, just spend some time with the Open Scene Graph reference documentation and you are done.

Open Scene Graph: The Basics

Having conceived this text as a practical guide, I was tempted to jump right into action, with an exciting example program displaying some nifty 3D graphics. But, also having conceived this text as something useful for “very beginners”, I resisted this temptation and decided to start with some basic concepts without which the Open Scene Graph (OSG) would not make sense. So, before talking about OSG per se, I’ll start spending a little time with a quite fundamental question.

Lua e XML

Eu sou daqueles que ainda não conseguiram entender o que existe de tão espetacular no tal XML. Até admito que ele possa ser bom para algumas aplicações, e talvez até possa ser a melhor opção para um ou outro caso, mas o fato é que se faz barulho demais sobre isso. Diz-se que “este programa usa arquivos XML” como se isso fosse um recurso do programa, uma vantagem para o usuário.

Undergrad Class Assignments

Undergrad Class Assignments These are some class assignments I did when I was an undergraduate Computer Science student. If nobody find them useful, they’ll at least help me to remember some of the assignments I enjoyed most. The majority of the stuff here (specially the older ones) are in Portuguese. All the software available here is licensed under the Cursing License (which I haven’t written yet — but I will write it someday).

VOX Project

VOX is a speech recognition school project I worked in back in 1998. Here’s a brief description of the project, and most of the artifacts we produced back then.