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 | |
# Demonstrates how to create a headless display using xvfb. | |
# Create the display: | |
Xvfb :100 -ac & | |
PID1=$! | |
export DISPLAY=:100.0 | |
# Run the application that needs the display: |
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 python | |
""" | |
Demonstrate how to replace tick labels for a displayed image. | |
""" | |
import numpy as np | |
import pylab as pl | |
im = np.random.rand(100, 200) |
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 python | |
""" | |
Compare performance of using host-registered pinned and unpinned host memory. | |
""" | |
import numpy as np | |
import pycuda.autoinit | |
import pycuda.driver as drv |
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 python | |
""" | |
Compare performance of using pinned and unpinned host memory. | |
""" | |
import numpy as np | |
import pycuda.autoinit | |
import pycuda.driver as drv |
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
// Simple example of a MEX function. Save this as mexfunc.cpp and compile with | |
// mex; it can then be called as mexfunc(something) from MATLAB. | |
#include <math.h> | |
#include <matrix.h> | |
#include <mex.h> | |
void mexFunction(int nlhs, mxArray *plhs[], int nrhs, const mxArray *prhs[]) { | |
mxArray *a_in, *b_out; | |
const mwSize *dims; |
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 python | |
""" | |
Demo of how to find the order of several entries in a row of numerical data. | |
""" | |
import numpy as np | |
import pandas | |
df = pandas.DataFrame(np.random.rand(5, 3), columns=['a', 'b', 'c']) |
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 python | |
""" | |
Frequency shift a signal using SSB modulation. | |
""" | |
import numpy as np | |
import scipy as sp | |
import scipy.signal | |
import matplotlib.pyplot as plt |
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 python | |
""" | |
Farm out processing to multiple processes via zmq. | |
""" | |
import re, pickle, time, threading | |
import multiprocessing as mp | |
import zmq | |
from zmq.eventloop.ioloop import IOLoop |
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 python | |
""" | |
Plot data received over a ZeroMQ port in real time using matplotlib. | |
Notes | |
----- | |
This appears to segfault when run using the WxAgg backend. | |
""" |
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 python | |
""" | |
Extract SONAME of a shared library. | |
""" | |
import sys | |
if len(sys.argv) < 2: | |
print 'usage: get_elf_soname.py <library path>' |