Skip to content

Instantly share code, notes, and snippets.

Vighnesh Birodkar vighneshbirodkar

Block or report user

Report or block vighneshbirodkar

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
View iterator_with_return.py
def iterator(value):
if value:
return 10
else:
for i in range(5):
yield i
print(iterator(True), iterator(False))
View lecture.pl
% 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
View test_rpca.py
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)
View dust_removal.py
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))
View plot_genes.py
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
View colormap.py
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
View valgrind_tsne_log.txt
==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)
View cython_mpi_lock.pyx
# 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())
View cython_parallel_vectors.pyx
# 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
@vighneshbirodkar
vighneshbirodkar / interests.md
Created May 7, 2015
a Markdown file to hold interests and projects
You can’t perform that action at this time.