Play and experiment with your favorite distributed algorithms! Everything visualized.
[Read More]

## Type of `flip id`

What is the type of flip id?
[Read More]

## Amortized LRU Cache (Now WITHOUT Linked List!)

As you probably know LRU cache is a common interview question. Just for the record, I know that the canonical...
[Read More]

## Covering a Boolean Matrix with Minimum Number of Rectangles

The problem (by @rubyleehs): Suppose we have a boolean matrix. How do we use the fewest (maybe overlapping) rectangles to...
[Read More]

## Nested Chairman Tree (Functional Segment Tree), and Beyond

Recently I ran into one (of the millions of variations of) sequence maintainence problem (BZOJ3065). We need to support insertion/deletion,...
[Read More]

## Notes on GHC (1) - The Core Language

Introduction I have been working on ES.hs for a month or two. ES.hs is a compiler that compiles Haskell to...
[Read More]

## What does Haskell RankNTypes do? (1) - Semantics

Consider this function: tuple2Int :: (x -> Int) -> (a, b) -> (Int, Int) tuple2Int f (a, b) = (f...
[Read More]

## Be Careful of Direct-Indexing and Modifying C++ Containers Simultaneously

There was this weird C++ bug I encountered, minimally reproducible by
```cpp
#include
#include
[Read More]

## Yet Another Method to Generate Permutations

There are tons of methods to generate every permutation of some elements. And here’s another intuitive and efficient (beats 98.00%...
[Read More]