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
""" | |
Using matplotlib for manually creating animations. Works similar to FuncAnimation. Manual animation is a bit simpler than using the animations API in general since it is still capable of handling some events (like window resizing) automatically. | |
""" | |
import matplotlib.pyplot as plt | |
import numpy as np | |
# Create a figure and axis for plotting on |
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
# Example usage | |
# f = lambda x: 3*(x**2)+4*x+ 5 | |
# xhat = findmin(f,-3,2) | |
from scipy.constants import golden | |
def goldensearch(f,a,b,tol=1e-6): | |
xl = b - (b-a)/golden | |
xu = a + (b-a)/golden |
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
# download the opencv-2.4.10 for unix | |
# unzip the library to some temporary folder; let's say it's ~/opencv | |
# see http://hvrl.ics.keio.ac.jp/kimura/opencv/opencv-2.4.10.html | |
# for build patch | |
#build ffmpeg | |
$ cd /tmp/ | |
$ tar xvjf ffmpeg-2.5.3.tar.bz2 | |
$ cd ffmpeg-2.5.3/ | |
$ ./configure --disable-yasm --disable-iconv |
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
{ | |
"cells": [ | |
{ | |
"cell_type": "markdown", | |
"metadata": {}, | |
"source": [ | |
"# A short tutorial on pandas MultiIndexing with DataFrames" | |
] | |
}, | |
{ |
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
# Modified version of libusb1.spec from libusb1-1.0.9-0.6.rc1.el6.rpm | |
# to create an RPM package for libusb-1.0.20 | |
Summary: A library which allows userspace access to USB devices | |
Name: libusb1 | |
Version: 1.0.20 | |
Release: 0 | |
Source0: libusb-1.0.20.tar.bz2 | |
#Source0: http://downloads.sourceforge.net/libusb/libusb-%{version}.tar.bz2 | |
License: LGPLv2+ |
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 | |
from string import Formatter | |
_fspecre = ("((?P<fill>{fill})?(?P<align>{align}))?" | |
"(?P<sign>{sign})?" | |
"(?P<prefix>#)?" | |
"(?P<zeropad>0)?" | |
"(?P<width>{width})?" | |
"(?P<thousands>,)?" | |
"(?:\.(?P<precision>{precision}))?" |
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
diff --git a/setup.py b/setup.py | |
index cccebeb..1472d06 100755 | |
--- a/setup.py | |
+++ b/setup.py | |
@@ -79,7 +79,9 @@ if not STATIC_LINKING: | |
else: | |
include_dirs = [os.path.join(portaudio_path, 'include/')] | |
extra_link_args = [ | |
- os.path.join(portaudio_path, 'lib/.libs/libportaudio.a') | |
+ os.path.join(portaudio_path, 'portaudio_static_x64.lib') |
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
""" | |
Example of keeping a simulated IO callback thread fed using separate master and daemon (I/O) processes. | |
""" | |
import multiprocessing, threading, Queue | |
import time | |
import sys | |
import urllib2 | |
IOBLOCKSZ = 4096 # made up IO block size | |
IPCBLOCKSZ = 8192 # a size that is guaranteed to be larger than BLOCK_SZ |
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
""" | |
Example of keeping a simulated IO callback thread fed using separate master and daemon (I/O) processes. | |
Builds off of mpex.py: https://gist.github.com/tgarc/7120c00eb3eb5f736be93c70ade1d68a | |
""" | |
import multiprocessing, threading, Queue | |
import time | |
import sys | |
import urllib2 |
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
#!/usr/bin/env python2 | |
""" | |
Daemon for full duplex streaming with PyAudio | |
Note that recordings are always delayed by some amount and are therefore longer than the input file | |
Builds off of mpex.py: https://gist.github.com/tgarc/7120c00eb3eb5f736be93c70ade1d68a | |
""" | |
import multiprocessing, threading, Queue | |
import time |
OlderNewer