Efficiently generating random numbers in an interval 0-N https://research.kudelskisecurity.com/2020/07/28/the-definitive-guide-to-modulo-bias-and-how-to-avoid-it/
The article demonstrates rejection sampling and bit masking. I've hit this problem a few times in property-based test frameworks, so it's nice to see solution techniques.
miniblog.
Related Posts
Really cute approach to reporting type errors: when there's a type error, show an example of a runtime error that the type check has prevented!
Data-Driven Techniques for Type Error Diagnosis https://escholarship.org/uc/item/59s4h4pv
On how far programming language research has come, and the maturity of tools and techniques that make more ambitious projects viable:
Generated Code Generates Overconfident Coders: https://www.deeplearning.ai/the-batch/issue-180/
A study of programmers found that using a LLM for completion produced buggier code but users were more confident in it.
I wonder if this generalises to other completion techniques?
