logoalt Hacker News

srveale • today at 6:23 PM • 1 reply • view on HN

Not okay:

exploitVulnerability()

Somehow okay?

while (Math.random() < 0.1) exploitVulnerability()


Replies

thepasswordis • today at 7:10 PM

This reminds me of one of the funniest products I've ever seen: https://www.youtube.com/watch?v=NdbkvJznmwU

This is the "kosher switch" - observant Jews customarily do not use light switches on Saturday (their weekly holy day). This light switch represents a workaround where when you flip the switch, it randomly generates an on or off signal and emits this through an optical coupler. When the random number sufficiently causes the state of the light to change, it latches in that direction.

This is a way of turning the lights on and off without violating the tradition.

"I didn't switch the light, the random number did!"

"I didn't exploitVulnerability(), random number did!"

➕ show 5 replies