A few observations on the bikesharing systems in China
Mindblowing Twitter thread. The variety of systems, most of which are barely impinging on our systems over here in Ireland!
(tags: china bikesharing cycling bikes transit public-transit commuting)
Fibonacci Hashing: The Optimization that the World Forgot (or: a Better Alternative to Integer Modulo)
Turns out I was wrong. This is a big one. And everyone should be using it. Hash tables should not be prime number sized and they should not use an integer modulo to map hashes into slots. Fibonacci hashing is just better. Yet somehow nobody is using it and lots of big hash tables (including all the big implementations of std::unordered_map) are much slower than they should be because they don’t use Fibonacci Hashing.Apparently this is binary multiplicative hashing, and Google’s brotli, webp, and Snappy libs all use a constant derived heuristically from a compression test corpus along the same lines (see comments). (Via Michael Fogleman)
(tags: algorithms hashing hash fibonacci golden-ratio coding hacks brotli webp snappy hash-tables hashmaps load-distribution)
In statistics, Halton sequences are sequences used to generate points in space for numerical methods such as Monte Carlo simulations. Although these sequences are deterministic, they are of low discrepancy, that is, appear to be random for many purposes. They were first introduced in 1960 and are an example of a quasi-random number sequence.
(tags: algorithms graphics random randomness coding monte-carlo-simulation number-sequences)