Skip to content

Instantly share code, notes, and snippets.

View chiffa's full-sized avatar
🎓
researching

Andrei Kucharavy chiffa

🎓
researching
View GitHub Profile
### Keybase proof
I hereby claim:
* I am chiffa on github.
* I am chiffa (https://keybase.io/chiffa) on keybase.
* I have a public key ASA5yTyfDE9nGVTg5gJH5DP0UcZ7XUhRxhKgOVf4ITYDPgo
To claim this, I am signing this object:
@chiffa
chiffa / gist:58163205d1cede5efd8d74f7754498a3
Created February 12, 2018 18:36
Otsu threshold debug GIST #2
from skimage import io
from skimage.filters import rank
from skimage.morphology import disk
from time import time
import numpy as np
import pickle
# base_image = pickle.load(open('debug_dump.dmp', 'r'))
# np.save('debug_image.npy', base_image)
base_image = np.load('debug_image.npy')
@chiffa
chiffa / gist:87dbc396d127e73374c80326bd073f39
Created October 17, 2017 13:53
Command line know-how
# Github push a commit to remote as it's master (or any remote branch head):
git push <remotename> <commit SHA>:<remotebranchname>
@chiffa
chiffa / latency.txt
Last active October 12, 2017 00:41 — forked from jboner/latency.txt
Latency Numbers Every Programmer Should Know
Latency Comparison Numbers
--------------------------
4GHz Processor cycle 0.25 ns 250 ms
L1 cache reference 0.5 ns 500 ms
Branch mispredict 5 ns 5 s
L2 cache reference 7 ns 7 s 14x L1 cache
Mutex lock/unlock 25 ns 25 s
Main memory reference 100 ns 1 m 40 s 20x L2 cache, 200x L1 cache
Compress 1K bytes with Zippy 3,000 ns 3 us 50 m 00 s
Send 1K bytes over 1 Gbps network 10,000 ns 10 us 2 h 46 m
@chiffa
chiffa / sample.tex
Created April 13, 2017 22:34
Latex code throwing 1.19.2.1 Pandoc off
\tolerance =10000
\documentclass[11pt]{article}
\usepackage{epsfig}
\renewcommand{\baselinestretch}{1.5}
\makeatletter
\@addtoreset{equation}{section}
\renewcommand{\theequation}{\thesection.\arabic{equation}}
\makeatother
\oddsidemargin=0in
\evensidemargin=0in
@chiffa
chiffa / docker_setup.sh
Created December 31, 2015 20:15
ubuntu in docker set-up for BioFlow run
# create and set-up home directory
cd /home
mkdir ank
cd ank
# install python build dependencies and system python:
apt-get update
apt-get install python
apt-get install build-essential
apt-get install libsuitesparse-dev
import random
from bulbs.neo4jserver import Graph
g = Graph()
random_node_names = ['%030x' % random.randrange(16**30) for _ in range(0, 10000)]
for i, node in enumerate(random_node_names):
print 'inserting: %.2f %%' % (i/100.)
g.vertices.create(name=node)
@chiffa
chiffa / gist:0c3f8b69e250eb5d108f
Created September 8, 2015 21:01
caffe makefile.config
## Refer to http://caffe.berkeleyvision.org/installation.html
# Contributions simplifying and improving our build system are welcome!
# cuDNN acceleration switch (uncomment to build with cuDNN).
# USE_CUDNN := 1
# CPU-only switch (uncomment to build without GPU support).
# CPU_ONLY := 1
# To customize your choice of compiler, uncomment and set the following.