Monthly Archives: May 2015

May 13, 2015

Bloom Filter for JavaScript

I wrote a very fast bloom filter implementation in JavaScript called bloomfilter.js. It uses the non-cryptographic Fowler–Noll–Vo hash function for speed. We can get away with using a non-cryptographic hash function as we only care about having a uniform distribution of hashes.

The implementation also uses JavaScript typed arrays if possible, as these are faster when performing low-level bitwise operations.


Format dates and times based on human-friendly examples, not arcane strftime directives.

Such tools should be available for every language under the sun.

May 12, 2015

An oldy but a goody: save the following into a file called It will compile just fine and if you run it, it will print Hello, World! to standard output.


This is because according to the Java Language Specification (JLS 3.2, specifically), Unicode escapes must be translated by the compiler before just about any other operation, including stripping comments.

Here’s what the code looks like prettified and with translated escapes:

public class Hello {
  public static void main(String[] args) {
    System.out.println("Hello, World!");
May 11, 2015
May 8, 2015

Keurig says it was wrong to force users to buy single-serving pods

Last year, Keurig drew the ire of the Internet by incorporating a scheme similar to the Digital Rights Management (DRM) you see on e-books and video games into its Keurig 2.0 coffee maker. The next-generation machine forced users to brew with Keurig-approved coffee pods exclusively, using a digital scanner that looks for an ink marker on authorized K-cups. The company also discontinued its “My K-Cup” reusable pod, which meant that customers could no longer use their own coffee in a Keurig.

Good to see them finally acknowledge what a shitty idea this was.

May 6, 2015


Hound is an extremely fast source code search engine. The core is based on this article (and code) from Russ Cox: Regular Expression Matching with a Trigram Index. Hound itself is a static React frontend that talks to a Go backend. The backend keeps an up-to-date index for each repository and answers searches through a minimal API.

From the engineers at Etsy. To say this kind of tool is useful is a bit of an understatement.