000 00 : HALT (wait for interrupt)
000 01 : IDT[HIGH] <- R0
000 10 : IDT[LOW] <- R0
000 11 : IENABLE <- R0 // 1 bit for each device, so IENABLE 0
disables interrupts
001 00 : CALL
001 01 : RET
001 10 : TRAP
## this... | |
original_filename = os.path.basename( | |
os.path.splitext(photo.raw_path)[0] | |
) | |
file_ext = os.path.splitext(photo.raw_path)[1] | |
## could be... | |
file_name, file_ext = os.path.splitext(os.path.basename(photo.raw_path)) |
def import_photos(self, path, notify=None, imported=None, | |
copy_photos=True, delete_originals=False): | |
photo_list = self.discover(path) | |
progress = Progress(len(photo_list)) | |
for photo in photo_list: | |
if notify: | |
notify(os.path.basename(photo.raw_path)) |
distros = { | |
'Ubuntu': { | |
'12.04': { | |
'Desktop': { | |
'i386': { | |
'DVD': { | |
'torrent': 'foo', | |
'magnet': 'bar', | |
'direct': 'baz', | |
'project': 'quux' |
======== | |
Core ISA | |
======== | |
000 : Jump MEM[RS] NZP (previous operation) | |
This is a relative jump. | |
0010 : LoadIH R0 <- I (Load 4 bit immediate into R0 lower bits) | |
0011 : LoadIL R0 <- I (Load 4 bit immediate into R0 upper bits) | |
0100: Add RD <- RD + RS |
push INTENABLE | |
icall | |
push DONE | |
ret | |
INTENABLE: | |
iret | |
DONE: |
from math import pi, sqrt | |
# Part labels based on the schematic from | |
# http://www.edn.com/design/analog/4368935/Implement-an-audio-frequency-tilt-equalizer-filter | |
RF = float(input('RF: ')) | |
P1 = float(input('P1: ')) | |
C = float(input('C: ')) | |
R = float(input('R: ')) | |
pivot = sqrt(P1 + 2 * RF) / (2 * pi * C * sqrt(RF - R) * sqrt(P1 * (R + RF) + 2 * R * RF)) |
int pin = 0; // The pin we will read the audio signal from | |
volatile int last = 0; // The time of the last sample | |
volatile int expected = 2272; // Roughly 440Hz | |
volatile int data = 0; // The direction to change the digi-pot | |
void setup() { | |
pinMode(pin, INPUT); | |
last = micros(); | |
attachInterrupt(0, adjust, FALLING); |
use std::io::{Acceptor, Listener}; | |
use std::io::net::tcp::TcpListener; | |
use std::io::net::ip::SocketAddr; | |
use std::from_str::from_str; | |
use std::io::File; | |
use std::io::IoError; | |
use std::io::{BufferedReader, BufferedWriter}; | |
fn read_file(path: Path) -> Result<~str, IoError> { | |
let mut file = match File::open(&path) { |
from datetime import datetime | |
from os import walk | |
import sys | |
from wand.image import Image | |
def get_bucket(filename): | |
date = get_date(get_exif(filename)['DateTimeOriginal']) | |
return (str(date), filename) |