top | item 44211830 (no title) jegp | 8 months ago Is the code for the "feeling lucky" selection mechanism open? Or, do you know how they select papers at random? discuss order hn newest dginev|8 months ago Sure, the repository is open source (linked from the front page).The selection did not get much thought at all, just a Rust rand shuffle over all ids performed at first page visit and then cached: https://docs.rs/rand/latest/rand/seq/trait.SliceRandom.html#...I had all IDs already computed for the previous/next article navigation feature, so it seemed fun to reuse them.
dginev|8 months ago Sure, the repository is open source (linked from the front page).The selection did not get much thought at all, just a Rust rand shuffle over all ids performed at first page visit and then cached: https://docs.rs/rand/latest/rand/seq/trait.SliceRandom.html#...I had all IDs already computed for the previous/next article navigation feature, so it seemed fun to reuse them.
dginev|8 months ago
The selection did not get much thought at all, just a Rust rand shuffle over all ids performed at first page visit and then cached: https://docs.rs/rand/latest/rand/seq/trait.SliceRandom.html#...
I had all IDs already computed for the previous/next article navigation feature, so it seemed fun to reuse them.