Now published at https://programmingisterrible.com/post/696130032656171008/questions-i-have-been-asked-about-photography
... and some answers I have given which may or may not help you.
Practice.
| /** | |
| * Peres extractor as described in http://dx.doi.org/10.1214/aos/1176348543 | |
| * @param {Array} bits - an array of biased bits to debias | |
| * @param {Array} extracted - an array of extracted, unbiased bits | |
| * @returns {Array} - an array of exatracted, unbiased bits | |
| */ | |
| function peres(bits, extracted) { | |
| const u = []; // discarded bits Psi(u1, u2, u3, ...) | |
| const v = []; // discarded bits Psi(v1, v2, v3, ...) | |
| const l = bits.length - (bits.length & 1); // ensure an even length, dropping the last bit if odd |
| import sys | |
| import os | |
| import struct | |
| ram_dump = bytearray() | |
| def dword(byte_array): | |
| return struct.unpack('I',byte_array)[0] | |
| def word(byte_array): |
| #!/usr/bin/env python3 | |
| import argparse | |
| import sys | |
| from tzxlib.convert import convertToBasic | |
| def main(): | |
| parser = argparse.ArgumentParser(description='Convert Sinclair Basic code representation into Text') | |
| parser.add_argument('file', |
| import array | |
| import math | |
| import time | |
| import os | |
| import usb.device | |
| from uac2 import AudioInterface | |
| print("Okay, configuring the audio interface now...") |
| """ | |
| KMK keyboard for Pimoroni Keybow. | |
| WARNING: This doesn't currently function correctly on the Raspberry Pi Zero, | |
| some of the keys are stuck in the 'pressed' position. There's either a bug in | |
| the keypad implementation on the rpi0, or the pin numbers don't match the pins | |
| in linux. | |
| This is a 4x3 macro pad designed to fit the rpi's GPIO connector. Each key is | |
| attached to a single GPIO and has an APA102 LED mounted underneath it. |
Now published at https://programmingisterrible.com/post/696130032656171008/questions-i-have-been-asked-about-photography
... and some answers I have given which may or may not help you.
Practice.
| #!/usr/bin/python3 | |
| import serial | |
| import sys | |
| # DECtalk output over serial with command resetting | |
| ser = serial.Serial('/dev/ttyUSB0',9600,timeout=1) # open serial port with 9600 8N1 defaults | |
| print(ser.name) # check which port was really used | |
| for line in sys.stdin: |
| https://abs.twimg.com/fonts/chirp-regular-web.woff | |
| https://abs.twimg.com/fonts/chirp-bold-web.woff | |
| https://abs.twimg.com/fonts/chirp-heavy-web.woff | |
| https://abs.twimg.com/fonts/chirp-medium-web.woff |
| # If you, like me, have all of your various source-code-like projects in ~/src/ | |
| # this is how to give yourself per-project shell history. | |
| # | |
| # I wish I'd done this years ago. | |
| # | |
| # First, in your .bashrc file, you redefine the cd, pushd and popd builtins to be "do the builtin bit, | |
| # then do one other thing (set_src_history.sh, below) like so: | |
| cd () { |
| int ThermistorPin = A0; | |
| int Vo; | |
| float R1 = 10000; // value of R1 on board | |
| float logR2, R2, T; | |
| float c1 = 0.001129148, c2 = 0.000234125, c3 = 0.0000000876741; //steinhart-hart coeficients for thermistor | |
| void setup() { | |
| Serial.begin(9600); | |
| } |