Skip to content

Instantly share code, notes, and snippets.

View tanmaykm's full-sized avatar

Tanmay Mohapatra tanmaykm

  • Bangalore, India
View GitHub Profile
@tanmaykm
tanmaykm / zmqtest.jl
Created February 15, 2016 09:59
zmq leak test
#const ENDPOINT = "tcp://localhost:9875"
const ENDPOINT = "ipc:///tmp/testZMQ";
const pid = getpid();
const MSG = "abcdefghijklmnopqrstuvwxyz";
vsz() = parse(Int, split(open(readstring,`ps -p $pid -o vsz`),"\n")[2]);
vsz(s) = println(s, vsz())
vsz("Initial VSZ=");
using ZMQ
@tanmaykm
tanmaykm / ufwconfig.sh
Created July 21, 2014 10:11
ufw configuration
sudo ufw status
sudo ufw default deny
sudo ufw logging on
sudo ufw allow 80
sudo ufw allow 22
sudo ufw allow 443
sudo ufw deny out 1:19/tcp
sudo ufw deny out 1:19/udp
@tanmaykm
tanmaykm / compare.md
Last active January 3, 2016 02:13
kmeans & als parallel mode comparisons
@tanmaykm
tanmaykm / hw7.py
Created November 16, 2013 22:02
gene classification
import Orange
train = Orange.data.Table("genestrain")
blind = Orange.data.Table("genesblind")
def create_classifier(cn):
if cn == "nb":
nb = Orange.classification.bayes.NaiveLearner()
nb.name = "nb"
return nb
@tanmaykm
tanmaykm / circuitscape_gc_stats.txt
Created November 13, 2013 09:30
circuitscape gc debugging
*** calling gc at begin
*** collected 168 objects
*** calling gc at after instantiating cs
gc: collecting generation 2...
gc: objects in each generation: 173 0 15626
gc: done, 133 unreachable, 0 uncollectable, 0.0094s elapsed.
*** collected 4 objects
gc: collecting generation 0...
gc: objects in each generation: 648 0 15794
gc: done, 65 unreachable, 0 uncollectable, 0.0001s elapsed.
@tanmaykm
tanmaykm / compare_numpy_gdal.py
Created November 11, 2013 18:42
Compare numpy and gdal for storing data
import numpy as np
import gdal
import time
ra = np.random.random_sample((1000,1000))
tfile = '/tmp/x'
t1 = time.time()
for i in range(1,5):
@tanmaykm
tanmaykm / julia_type_tree.txt
Created March 5, 2013 05:49
Type tree of base Julia modules created by julia_types.jl
+- Any
. +- WeakRef
. +- Colon
. +- GetfieldNode
. +- AbstractArray = AbstractArray{T,2}
. . +- Union(AbstractArray{T,1},AbstractArray{T,2})
. . . +- AbstractVecOrMat = Union(AbstractArray{T,1},AbstractArray{T,2})
. . +- Array = Array{T,2}
. . . +- Union(Array{T,1},SubArray{T,1,A<:Array{T,N},I<:(Union(Range1{Int64},Int64,Range{Int64})...,)})
. . . . +- StridedVector = Union(Array{T,1},SubArray{T,1,A<:Array{T,N},I<:(Union(Range1{Int64},Int64,Range{Int64})...,)})
@tanmaykm
tanmaykm / julia.jl
Last active December 14, 2015 03:59
A Julia program to generate Julia set images. Images are written on to stdout in PGM format. Args: image size (pixels. width and height are equal to this.) value of complex parameter real part value of complex parameter imaginary part Accompanying post at: http://sidekick.windforwings.com/2013/02/julia-sets-using-julia.html
# A Julia program to generate Julia set images.
# Images are written on to stdout in PGM format.
# Args:
# image size (pixels. width and height are equal to this. default 200)
# value of complex parameter real part (default 0)
# value of complex parameter imaginary part (default 0.65)
# Accompanying post at: http://sidekick.windforwings.com/2013/02/julia-sets-using-julia.html
w,h = 200
c = 0 + 0.65im
@tanmaykm
tanmaykm / remap_circle.cpp
Last active December 10, 2015 06:29
OpenCV remap rectangle to circle.
/*
* remap_circle.cpp
*
* Created on: Dec 28, 2012
* Author: tan
* Related blog post at:
* http://sidekick.windforwings.com/2012/12/opencv-fun-with-remap.html
*/
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/imgproc/imgproc.hpp>
@tanmaykm
tanmaykm / perfbreeze.scala
Created October 18, 2015 09:25
scala perf for Julia micro benchmarks
import scala.util._
import java.io._
import breeze.linalg._
import breeze.numerics._
import breeze.stats._
import breeze.math._
object PerfBreeze {
final val NITER = 5