
I discovered this coding puzzle in numero 4 of Paged Out, on page 32.
I found it fun and wrote my own solution in Python: paintbrush.py
It reminded me of Project Euler problems.
I recommend to give it a go based on the Paged Out one-page article, without reading Alperen Keles answer or mine! 🙂
A new count-distinct algorithm:
We present a simple, intuitive, sampling-based space-efficient algorithm whose description and the proof are accessible to undergraduates with the knowledge of basic probability theory.
Donald Knuth likes it: https://www-cs-faculty.stanford.edu/~knuth/papers/cvm-note.pdf
Their algorithm is not only interesting, it is extremely simple.
Furthermore, it’s wonderfully suited to teaching students who are learning the basics of computer science.
I’m pretty sure that something like this will eventually become a standard textbook topic.
There is the CWEB implementation he produced: cvm-estimates.w (archive.org)
Source: https://jmason.ie/2024/05/21/165901a.html
Interesting HackerNews comments: https://news.ycombinator.com/item?id=40379175
Have you ever wondered how Shazam works? I asked myself this question a few years ago and I read a research article written by Avery Li-Chun Wang, the confounder of Shazam, to understand the magic behind Shazam. The quick answer is audio fingerprinting, which leads to another question: what is audio fingerprinting?
This article is a summary of the search I did to understand Shazam.
This article aims to describe a tricky situation that can often occur when using Promise.all()
,
and a simple solution to this problem.
The context
The MDN page for Promise.all()
provides the following description of this function:
The
Promise.all()
static method takes an iterable of promises as input …

The other day, while watching La Carte aux trésors at my elderly neighbor's house, I casually played peg solitaire on a board she has.
After many failures at trying to get rid of all pawns but one, I started to wonder about the mathematics & algorithmics behind that game...
Back home …
At work, we needed to retrieve the full list of jobs a given Jenkins instance was hosting.
Our first solution was to use the jenkinsapi Python package:
import xml.etree.ElementTree as XmlElementTree
from jenkinsapi.jenkins import Jenkins
def get_all_jenkins_jobs(server_url):
jenkins = Jenkins(server_url, lazy=True, timeout=30,
username=os …
Yesterday I was crafting some puzzles for my girlfriends, and I was looking for letter-based ones where I a secret word would be revealed once solved.
With this same goal, I had already once worked on an open-source JS word search generator: https://lucas-c.github.io/wordfind/
(pour les francophones …
The founding of the 'algorists', their manifesto, and definition.
Simply put an algorist is anyone who works with algorithms. Historically we have viewed algorists as mathematicians. But it also applies to artists who create art using algorithmic procedures that include their own algorithms. This page presents an account of the adaptation of this term by a group of artists in 1995.