Home

Hanzi-Color Converter

前段时间偶然看到中国传统色,其中每个颜色都有个不明觉厉的名字。作为一个起名爱好者,我自然就在想有没有别的起名方式。然后我就想到,用 UTF-8 一个汉字三字节,用 RGB 一个颜色也是三字节,如此一来,每个字就可以直接有个对应的颜色了。好耶,搞起来!

Read more

Alias Method

This post introduces the alias method for efficient sampling from a finite discrete probability distribution. After preprocessing, it takes constant time to draw random values. An interactive visualization is provided.

Read more