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
ffmpeg -loop 1 -i /path/to/image.png -i /paht/to/audio.mp3 -c:v libx264 -tune stillimage\ | |
-vf "crop=trunc(iw/2)*2:trunc(ih/2)*2" -c:a aac -b:a 192k -pix_fmt yuv420p\ | |
-shortest /path/to/output.mp4 |
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
def iterator(value): | |
if value: | |
return 10 | |
else: | |
for i in range(5): | |
yield i | |
print(iterator(True), iterator(False)) |
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
% The sum and subset sum functions were taken from | |
% Borrowed from https://github.com/jdan/code/blob/master/prolog/subset_sum.pl | |
% Atoms | |
good. | |
bad. | |
% Writing output | |
% write(...) Does not work in user mode |
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 numpy as np | |
from sklearn.decomposition.rpca import rpca | |
from numpy.linalg import matrix_rank | |
def gen_synthetic(n, sparseness, rank): | |
r = rank # Rank | |
X = np.random.normal(0, 1/float(n), size=(n, r)) | |
Y = np.random.normal(0, 1/float(n), size=(n, r)) | |
L = np.dot(X, Y.T) |
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 skimage import io, color | |
from skimage.filters.rank import median | |
from skimage.feature import blob_dog, blob_log, blob_doh | |
from skimage.morphology import disk | |
from matplotlib import pyplot as plt | |
img = io.imread('RawImage.tif') | |
img_gray = color.rgb2gray(img) | |
img_filtered = median(img_gray, disk(10)) |
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 numpy as np | |
from matplotlib import pyplot as plt | |
col_map = {} | |
concentrations = ['0.5', '2', '5', '10', '20', '40'] | |
kinds = ['R1', 'R2', 'R3', 'S1', 'S2', 'S3'] | |
gene_names = [] | |
gene_index = 125 |
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 skimage import data, color, util, measure, segmentation | |
from matplotlib import pyplot as plt | |
from skimage.future import graph | |
from matplotlib import colors | |
from matplotlib import cm | |
from skimage.util.colormap import viridis | |
import numpy as np | |
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 ..Base import Display | |
from ..Base.Display import DisplayBase | |
from tornado.web import Application | |
import tornado | |
from IPython.core.display import Javascript as JS | |
from IPython.core.display import display | |
import os | |
import threading | |
import tempfile |
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 SimpleCV import * | |
import time | |
cam = Camera(threaded = True) | |
c = 0 | |
time.sleep(1) | |
while True: | |
cam.getImage().show() | |
print c | |
c +=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
l = [1,2,3,4] | |
for x in l: | |
x = 10 | |
print l |
NewerOlder