Skip to content

Instantly share code, notes, and snippets.

View bernoulli-and-and.ino
/* This Arduino Sketch utilize 12 pins of the Arduino Uno to
* create three complex gates which combines a bernoulli gate
* with an and gate, which means:
* When a new trigger arrive at the CLOCK_INPUT pin, a new random
* number is drawn that decides that 5v will be set add the AND_OUTPUT
* or NOT_OUTPUT. PROBS / 160 give the probabilty, that the AND_OUTPUT
* will be choicen. But both the AND and the NOT output will only be set
* to 5v, as long as the SEQ_INPUT also is HIGH (> 3v).
*/
View origami-marker-parser.el
(defun origami-get-positions-eol (content regex open)
"Returns a list of positions where REGEX matches in CONTENT. A
position is a cons cell of the character and the numerical
position in the CONTENT."
(with-temp-buffer
(insert content)
(goto-char (point-min))
(let (acc)
(while (re-search-forward regex nil t)
(let ((match (match-string 0))