Binary Search in JavaScript

6 min read January 25, 2018
Binary search is an extremely useful and popular algorithm used for quickly searching in a sorted array. Binary search is even used by people in real…
Algorithms Javascript

Bloom filter in JavaScript

11 min read January 18, 2018
A Bloom filter is a simple yet powerful data structure. It allows you to answer the question have you seen this before? in a very fast and memory efficient way. Unlike a regular set, a Bloom filter only needs to store a few bits per item instead of storing the whole thing.
Algorithms Javascript

Bit Vector in JavaScript

19 min read January 17, 2018
A bit vector (also known as bit set or bit array) is a set data structure which uses only 1 bit per element. It answers the question is X in the set…
Algorithms Javascript

Fibonacci Numbers

8 min read August 08, 2015
We'll take a look at different ways of calculating fibonacci numbers in JavaScript. Starting from simple recursive implementation, followed by dynamic programming and an iterative approach.
Algorithms Javascript


Let's Write a 2D Platformer From Scratch Using HTML5 and JavaScript, Part 1: Game Loop

9 min read January 28, 2018
As far as gamedev and HTML5 goes, there are tons of great game engines already out there. How do we pick the right one? Look at the number of stars on GitHub? The number of contributors? The number of published games? If you've looked at the previous articles on this blog, you probably know where this is heading (or read the title for that matter). We're going to write our own game engine first!
Gamedev Javascript

Parsing CSS with Parsec

11 min read August 10, 2014
This article is a small introduction to Parsec, the Haskell parser combinator library for Haskell. We’ll use it to parse simple CSS file such as the…

Foldable and Traversable

17 min read July 30, 2014
Before we can get into the more advanced topics on Lenses, it is important to really understand both and , which is the motivation behind this…

Building Monad Transformers - Part 1

13 min read July 22, 2014
In this article we'll focus on building our own monad transformers. We'll start out with an example code and improve it by building a simple wrapper over IO (Maybe a). The following example is really simple, but I'm sure you can imagine doing something similar in your own application. The findById method is there just to simulate a database query that might not find a result.

Mutable State in Haskell

16 min read July 20, 2014
Haskell is a purely functional language, which means there are no side-effects and all variables are immutable. But as you probably know this isn’t…

Using Phantom Types for Extra Safety

6 min read July 08, 2014
If you’ve been programming in a dynamic language, you’ve probably heard that type systems can catch more errors before your application even gets run…

Yesod is Fun

3 min read May 15, 2014
I’ve been trying many Haskell web frameworks over the past few weeks. I wrote one small app with Simple, almost wrote another one with Scotty. Then…

Duplication in Tests Is Sometimes Good

3 min read May 04, 2014
Having powerful tools like RSpec gives us so much power, that what was once a nice suite of readable specs becomes a huge bunch of unreadable mess…

Light Table Plugin Tutorial

4 min read January 13, 2014
I’ve been playing around with Light Table since the day its source code was released (even made a tiny Ruby plugin). First of all, Light Table is…

Machine Learning

Bellman Equation

4 min read November 22, 2018
Before we begin, let me just define a few terms: is the state at time . is the action performed at time . is the reward received at time . is the…
Reinforcement learning

Matrix Inversion Lemma

5 min read May 16, 2018
This article is a draft and as such there might be typos and other inaccuracies. In this article we’ll derive the matrix inversion lemma, also known…
Linear algebra

Visualizing TensorFlow Graphs in Jupyter Notebooks

9 min read May 30, 2017
TensorFlow operations form a computation graph. And while for small examples you might be able to look at the code and immediately see what is going on, larger computation graphs might not be so obvious. Visualizing the graph can help both in diagnosing issues with the computation itself, but also in understanding how certain operations in TensorFlow work and how are things put together.
Python Tensorflow Machine learning