Elektrine lite

← Feed

@sanityinc@hachyderm.io

Post #1470058

2025-11-18 18:08 UTC

Programmers! Did you know you can fairly choose a random item from a list in a single pass, without knowing the total number of items in advance, and in constant, minimal space? This delightful method has lived rent-free in my head since I learned it from the Perl gods in the 90s: https://csg.sph.umich.edu/chen/Perl/cookbook/ch08_07.htm

Replies (0)

No replies.