home
text

Pipe Logic

Delightfully useless epiphany: Suppose the null-byte is an electron. Then, /dev/zero provides an infinite supply of electrons and /dev/null has an infinite appetite for them. Let’s call these devices Vss and Vdd, respectively.

In this model, a UNIX pipe acts like a wire, that is, a conductor with parasitic capacitance. If the pipe is connected to Vss, its pipe buffer in kernel space quickly fills up with null-bytes, and the pipe acts like a negatively charged metal plate. If it is connected to Vdd, the pipe buffer is drained, and the pipe acts like a positively charged metal plate.

Pipes may thus carry logic signals: A pipe that is filled with null-bytes corresponds to a logic zero, and a pipe that is completely empty corresponds to a logic one. A pipe that contains some null-bytes, but is neither full nor empty, corresponds to a voltage in the undefined range, and will act as a one or a zero depending on how we measure it.

[Source]

1 month ago

January 21, 2012
photo More

6 months ago

August 11, 2011
quote
The “#pragma” command is specified in the ANSI standard to have an arbitrary implementation-defined effect. In the GNU C preprocessor, “#pragma” first attempts to run the game “rogue”; if that fails, it tries to run the game “hack”; if that fails, it tries to run GNU Emacs displaying the Tower of Hanoi; if that fails, it reports a fatal error. In any case, preprocessing does not continue.
— Manual for version 1.34 of the GNU C compiler

7 months ago

July 25, 2011
video

Awesome !!!

1 year ago

August 13, 2010
video

How to create SuperMacro lens

1 year ago

June 19, 2010