Optimized Approximative pow() in C / C++

Mostly thanks to this reddit discussion, I have updated my pow() approximation for C / C++. I have now two different versions:

Continue reading “Optimized Approximative pow() in C / C++”

Chunky bacon

Since I blog a mixture of health and programmnig, my old tagline May all your work reduce to O(1) just didn’t cut it any more. Fortunately I have a found a perfect replacement:

Chunky bacon!!

This is the perfect combination of both worlds. Unfortunately, only few readers will get that chunky bacon is actually good for your health. Even fewer readers will get that this is actually a famous programming reference. Even fewer readers will get that it is actually both…

Quickly Solving the “Instagram Engineering Challenge: The Unshredder”

Today I have read about the Instagram Engineering Challenge: The Unshredder, and decided to give it a try. The task is simple to explain: Create a program that can unshred this image (do not try the challenge on this image, try the original PNG source instead!):


I have postet here that I think I can solve it in 2 hours, and got some downvotes for that; so I have decided to really give it a try. Long story short, it took me about 2 hours and 35 minutes.

Before I started developing, I made some quick assumptions to simplify things:

  • I want to code it in Ruby, this is the language where I am most productive.
  • I can assume the size of the stripes is well known, and I have hardcoded this size.
  • The image can be converted to RAW with an external tool, and written into RAW.
While coding I timed myself, and created a little timeline of my trials and errors. Since I wanted to finish as quickly as possible, the code is very ugly: no tests, some hardcoded constants, etc.

Continue reading “Quickly Solving the “Instagram Engineering Challenge: The Unshredder””

Single N-Back

I have just created my first Android app. It is a simple game, called Single N-Back. It has been shown in multiple studies that this game can improve your fluid intelligence.

You can get it here:

Continue reading “Single N-Back”