This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
int NUM_SLIDES = 50; | |
// Pin 2 has a slide projector connected | |
int PROJECTOR_ADVANCE_PIN = 2; | |
int CAMERA_FOCUS_PIN = 3; | |
int CAMERA_SHUTTER_PIN = 4; | |
int ARDUINO_LED_PIN = 13; | |
// the setup routine runs once when you press reset: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
# Create a new Python 3.3 venv and configure it with pip | |
# Usage: source path/to/mkvenv <path> | |
set -e | |
pyvenv $1 | |
cd $1 | |
source bin/activate | |
curl -O http://python-distribute.org/distribute_setup.py | |
python distribute_setup.py | |
easy_install pip |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import csv | |
with open('faithful.dat', newline='') as csvfile: | |
reader = csv.reader(csvfile, quoting=csv.QUOTE_NONNUMERIC) | |
names = next(reader) | |
columns = zip(*reader) | |
data = {name: column for name, column in zip(names, columns)} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
""" | |
A Python web service client which GETs temperatures over a web service API | |
from an Arduino based server and PUTs the status of LEDs back to the Arduino | |
to provide a visual temperature indication. | |
The intent of this system is to demonstrate how control logic can be moved | |
to remote systems which communicate with the Arduino over the network. | |
Pass the base url of the server e.g. "http://192.168.1.101" as the | |
only command line argument. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# The longest palindromic primes of n-digits | |
# reproducing the first part of an integer | |
# sequence seen in a mural at Oslo Gardermoen | |
# airport | |
from urllib.request import urlopen | |
def main(): | |
with urlopen('https://oeis.org/A002385/b002385.txt') as response: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Diffusion limited aggregation simulation | |
# as an example solution to Sixty North's | |
# Boost.Python workshop. | |
# | |
# Usage: | |
# | |
# python diffusion.py 128 128 4096 diffusion.bmp | |
# | |
# To produce a 128x128 image with 4096 sticky | |
# 'grains' diffused into it. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
acrobat africa alaska albert albino album | |
alcohol alex alpha amadeus amanda amazon | |
america analog animal antenna antonio apollo | |
april aroma artist aspirin athlete atlas | |
banana bandit banjo bikini bingo bonus | |
camera canada carbon casino catalog cinema | |
citizen cobra comet compact complex context | |
credit critic crystal culture david delta | |
dialog diploma doctor domino dragon drama | |
extra fabric final focus forum galaxy |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import operator | |
ABSOLUTE_ZERO = 0 | |
class Temperature: | |
_scale_classes = {} | |
_promotion_rules = {} | |
@classmethod |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// More information: https://danielupshaw.com/openscad-rounded-corners/ | |
// Set to 0.01 for higher definition curves (renders slower) | |
$fs = 0.15; | |
module roundedcube(size = [1, 1, 1], center = false, radius = 0.5, apply_to = "all") { | |
// If single value, convert to [x, y, z] vector | |
size = (size[0] == undef) ? [size, size, size] : size; | |
translate_min = radius; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function FindProxyForURL(url, host) | |
{ | |
if (shExpMatch(url, "*.bbc.co.uk/iplayer*") | |
|| shExpMatch(url, "*.bbc.co.uk/mediaselector*") | |
|| shExpMatch(url, "zaphod-live.bbc.co.uk.edgesuite.net/*") | |
|| shExpMatch(url, "bbcfmhds.vo.llnwd.net/*")) | |
{ | |
return "SOCKS 127.0.0.1:8080"; | |
} | |
else |