This file contains hidden or 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 UserDict | |
| class DotDict(UserDict.IterableUserDict): | |
| def __init__(self): | |
| UserDict.IterableUserDict.__init__(self) | |
| def __setitem__(self, key, val): | |
| bits = key.split(".") | |
| if bits[0] not in self.data: |
This file contains hidden or 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
| all: testc testorc | |
| clean: | |
| rm -f testc testorc out.c out.h | |
| testc: out.c test.c | |
| $(CC) -DDISABLE_ORC=1 -o $@ $^ | |
| testorc: out.c test.c | |
| $(CC) -o $@ $^ `pkg-config --cflags --libs orc-0.4` |
This file contains hidden or 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
| [submodule "documents/latex-makefile"] | |
| path = documents/latex-makefile | |
| url = git://gist.github.com/503886.git |
This file contains hidden or 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
| # http://stackoverflow.com/a/10031877 | |
| import numpy | |
| import cairo | |
| import math | |
| from gi.repository import Gtk,Gdk | |
| data = numpy.zeros((200, 200, 4), dtype=numpy.uint8) | |
| surface = cairo.ImageSurface.create_for_data( |
This file contains hidden or 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 numpy as np | |
| def fix(d): | |
| #d = d.copy() | |
| for k,v in d.items(): | |
| if type(v) == dict: | |
| d[k] = fix(v) | |
| elif isinstance(v,np.floating): | |
| d[k] = float(v) | |
| elif isinstance(v,np.integer): |
This file contains hidden or 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 threading | |
| import time | |
| import serial | |
| from gi.repository import Gtk, Gdk, GObject | |
| GObject.threads_init() | |
| Gdk.threads_init() |
This file contains hidden or 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 cv2 | |
| import numpy as np | |
| import scipy.ndimage.measurements | |
| cv2.startWindowThread() | |
| for iname,t in (("img",45),("img2",230), ("img3",230), ("img4",250)): | |
| i = cv2.imread("%s.png" % iname) | |
| cv2.namedWindow(iname) |
This file contains hidden or 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
| gst-launch-0.10 videotestsrc ! video/x-raw-yuv,format=\(fourcc\)I420,width=640,height=480,framerate=25/1 ! x264enc byte-stream=true ! filesink location=foo.mp4 |