Robert Eisele
Systems Engineer, Architect and DBA

# Cracking Apple Interview Question

I recently came across an interview question from Apple via entrepreneur.com. The question reads like this:

# The log-sum-exp trick in Machine Learning

It is commonly not taught explicitly, but in machine learning you quite often come across problems which contain the following quantity and knowing the trick can help a lot. Let's say we have an $$n$$-dimensional vector and want to calculate the following:

# Importing entire Wikipedia into MySQL

Wikipedia is the greatest encyclopedia which has ever existed, because everyone can contribute to the massive knowledge corpus. Analyzing this data with computers is becoming more and more indispensable, as nobody can survey the information by hand anymore. In order to work with the data, we have to import it into MySQL and here is how it works.

# Calculate the sum of divisors

Let's say you have an arbitrary number $$n\in \mathbb{N}$$. If you want to calculate the sum of it's divisors, you would come up with a loop which is $$O(n)$$. Here is how you can make it much faster.

# Forcing Garbage Collection in node.js and JavaScript

If you have a quite complex project which allocates lots of memory and drops it away quickly, the garbage collector of node.js or better V8 has to tidy up the memory. It became better since the first versions of node, but cleaning large chunks of memory can pause the application for a while. Forcing the GC manually when your application has time for it can make sense.

# NEO6MV2 GPS Module with Raspberry PI

Using the GY-NEO6MV2 module with the Arduino was shown previously. Here is how to make it work with an Raspberry PI, when you don't want to use an USB solution to save some power. A test against a USB receiver is still ongoing.

# NEO6MV2 GPS Module with Arduino

After using USB receivers for GPS, I needed a module to shrink down a project and found the GY-NEO6MV2 module. Here is how to connect it to an Arduino board.

# Rational numbers in JavaScript

fraction.js is a new rational numbers library I published today. Floating point numbers, like double in JavaScript, are a very rough estimate of a real number, which has to deal with rational and irrational numbers the same way. Of course, it has the benefit of feeling very natural in the way you deal with those numbers. You can assign Math.PI, Math.sqrt(2) and 3 / 4 without thinking what the computer actually does.