tomxtobin comments on Have no heroes, and no villains - Less Wrong

88 Post author: PhilGoetz 07 November 2010 09:15PM

You are viewing a comment permalink. View the original post to see all comments and the full post content.

Comments (73)

You are viewing a single comment's thread.

Comment author: [deleted] 08 November 2010 07:54:09PM *  6 points [-]

Computer geeks have a term for this: "flipping the bozo bit".

Comment author: Strange7 09 November 2010 05:09:19AM 3 points [-]

Maybe the solution is not to avoid flipping that particular bit at all, but rather, to have it reset periodically. Always give someone another chance, even if you have to wait a year first.

Comment author: Relsqui 10 November 2010 04:54:42AM 2 points [-]

Or, as as David pointed out, treat it as a bozo byte.

Comment author: kpreid 14 November 2010 07:51:55PM *  1 point [-]

I'm reminded by the mention of byte-instead-of-bit and resetting after time of an algorithm for switch debouncing I heard about:

Keep a state of some number of bits (the word size of the microcontroller you're implementing it on, say), which are regular samples of the state of the switch (that is, state ← (state << 1) | (current_input ? 1 : 0)). Then consider the switch to be logically pressed if any of the bits are 1 (that is, the entire state is not zero) or perhaps if all of them are (whatever fits the application better). This produces a minimum pulse width of sample rate × number of state bits; it's just a nicely simple way of filtering the digital signal using CPU primitives.