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 | |
from collections import Counter | |
speed(60) | |
width = 400 | |
size(width, width) | |
SAMPLE = True | |
class RingBuffer(object): | |
""" |
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
from struct import unpack | |
import time | |
import serial | |
v = serial.Serial('COM14', parity=serial.PARITY_NONE, baudrate=9600) | |
sax, say, saz, count = 0, 0, 0, 0 | |
cax, cay, caz = 198, -129, 16974 | |
c = 0 |
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 time | |
import sys | |
import curses | |
import serial | |
from collections import defaultdict | |
from pickle import dump, load | |
from xbee import ZigBee as XBee | |
XBEES = { # series 1 |
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
from cmath import exp, sin, cos, pi | |
N = 512 | |
PADDING = 16 | |
global old_x, old_y | |
old_x, old_y = 0, N | |
def circle(x, y, r): | |
hr = r / 2 | |
oval(x - hr, y - hr, r, r) |
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 re | |
import sys | |
re_v = re.compile('(\s+)(reg|wire)(\s+)(\w+)\s*(\[\d+:0\]);') | |
for line in sys.stdin: | |
line = line[:-1] # to remove new line | |
result = re_v.search(line) | |
if result: | |
g = result.groups() |
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
GRID = (24, 16) | |
BUS_STRIPE = 3 | |
class Wave(object): | |
@classmethod | |
def clk(cls, num): | |
ret = [] | |
for i in range(num): | |
ret.append((i + 1) % 2) | |
return ret |
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
GRID = (40, 40) | |
BUS_STRIPE = 10 | |
class Wave(object): | |
@classmethod | |
def clk(cls, num): | |
ret = [] | |
for i in range(num): | |
ret.append((i + 1) % 2) | |
return ret |
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
""" | |
classes for vertex, rectangle | |
""" | |
class Vertex(object): | |
def __init__(self, x, y, z): | |
self.x = x | |
self.y = y | |
self.z = z | |
def __add__(self, other): |
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
""" | |
classes for vertex, rectangle | |
""" | |
class Vertex(object): | |
def __init__(self, x, y, z): | |
self.x = x | |
self.y = y | |
self.z = z | |
def __add__(self, other): |
NewerOlder