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
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 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
def iterator(value): | |
if value: | |
return 10 | |
else: | |
for i in range(5): | |
yield i | |
print(iterator(True), iterator(False)) |
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
% 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 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 | |
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 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
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 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 | |
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 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
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 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
==4870== Memcheck, a memory error detector | |
==4870== Copyright (C) 2002-2013, and GNU GPL'd, by Julian Seward et al. | |
==4870== Using Valgrind-3.10.0.SVN and LibVEX; rerun with -h for copyright info | |
==4870== Command: python tsne_test.py | |
==4870== | |
==4870== Invalid read of size 4 | |
==4870== at 0x57398A: PyObject_GC_Del (in /usr/bin/python2.7) | |
==4870== by 0x55A056: ??? (in /usr/bin/python2.7) | |
==4870== by 0x4F7BA5: ??? (in /usr/bin/python2.7) | |
==4870== by 0x5B1F2C: ??? (in /usr/bin/python2.7) |
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
# distutils: language = c++ | |
# https://groups.google.com/forum/#!topic/cython-users/Ady-DdWu6rE | |
from cython.parallel import parallel, prange, threadid | |
from libcpp.vector cimport vector | |
from libc.stdlib cimport malloc, free | |
cimport openmp | |
import time | |
print("Threads = ", openmp.omp_get_max_threads()) |
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
# distutils: language = c++ | |
from cython.parallel import parallel, prange | |
from libcpp.vector cimport vector | |
from libc.stdlib cimport malloc, free | |
cdef struct Data: | |
int x | |
int y | |
NewerOlder