Weekly Shaarli

All links of one week in a single page.

Week 21 (May 22, 2023)

Bind Process to a Network Interface With Namespaces - Linux Nightly

A guide on how to create a network namespace, bind interfaces, set routes, and run programs in it.

Ditherpunk — The article I wish I had about monochrome image dithering — surma.dev

An article on dithering techniques.

Dynamic Mathematics

Nice visualization of dynamic math. Attractors, vector fields, fractal, flocking, and more.

Solving the "floating point precision" problem with... floats? - DEV Community

A really innovative way to store exact floating point numbers:

  1. for "safe numbers" (numbers whose value can be expressed precisely in floating point), store them as is
  2. for non-"safe numbers", store two safe numbers as denominator and nominator.

There is a lot of this method comparing to the other alternatives:

  • BigDecimal: a lot faster than arbitrary precision BigDecimal
  • Rational: denom and nom deoesn't blow up to extremely large numbers

And it is also faster and uses less space.