Skip to content

Instantly share code, notes, and snippets.

Tanmay Mohapatra tanmaykm

Block or report user

Report or block tanmaykm

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
@tanmaykm
tanmaykm / stacktrace.md
Created Mar 31, 2017
AMQPClient.jl issue
View stacktrace.md
signal (15): Terminated
while loading /home/tan/.julia/v0.6/AMQPClient/test/test_throughput.jl, in expression starting on line 13
subtype at /data/Work/julia/sources/julia/src/subtype.c:687
exists_subtype at /data/Work/julia/sources/julia/src/subtype.c:867 [inlined]
forall_exists_subtype at /data/Work/julia/sources/julia/src/subtype.c:895
jl_subtype_env at /data/Work/julia/sources/julia/src/subtype.c:948
simple_join at /data/Work/julia/sources/julia/src/subtype.c:261
simple_join at /data/Work/julia/sources/julia/src/subtype.c:247 [inlined]
var_gt at /data/Work/julia/sources/julia/src/subtype.c:396
View JuliaRunPackageBundles.md

Julia packages go through a process called compilation on their first use, where the Julia code is compiled to llvm bytecode. The bytecode is cached, and re-used thus making subsequent use faster. Package bundles are special disk volumes that hold Julia packages. They help prepare packages once and use them uniformly across many many containers. They are pre-compiled by a special PkgBuilder job and are mounted as read only volumes to containers that use them. That ensures that when your code starts to use them they are alerady compiled. They are mounted read-only to ensure that they are not modified inadvertendly by some user code.

Preparing a package bundle involves the exact same steps as installaing and loading a package in the Julia REPL, essentially - Pkg.add(...), Pkg.build(...), and using .... Let's say you wish to build a package bundle with these packages: JSON and Distributions. And you wish to call your package bundle mypkg.

  • Create a volume for it: `~/.julia/v0.5/JuliaRun/scripts/loc
View example_server.jl
# context: http://stackoverflow.com/questions/39448808/julia-tcp-server-and-connection
# Use fn to process messages from sock.
# Loop till sock is open and fn returns true.
function processor(fn, sock)
proc = true
try
while proc && ((nb_available(sock) > 0) || isopen(sock))
proc = fn(sock)
end
View hea.jl
using Base.Dates
const DEFREQ = 250.
const DEFGAIN = 200.
immutable Record
name::AbstractString
nsegments::Int
nsignals::Int
sampfreq::Float64
View zmqtest.jl
#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 / compare.md
Last active Jan 3, 2016
kmeans & als parallel mode comparisons
View compare.md
@tanmaykm
tanmaykm / perfbreeze.scala
Created Oct 18, 2015
scala perf for Julia micro benchmarks
View perfbreeze.scala
import scala.util._
import java.io._
import breeze.linalg._
import breeze.numerics._
import breeze.stats._
import breeze.math._
object PerfBreeze {
final val NITER = 5
@tanmaykm
tanmaykm / small_demo.jl
Last active Oct 6, 2015
Twitter link graph
View small_demo.jl
using Elly
using HadoopBlocks
@everywhere begin
#const INP = "hdfs://root@" * string(getipaddr()) * ":9000/twitter_rv.net"
#const COLSEP = '\t'
const INP = "hdfs://root@" * string(getipaddr()) * ":9000/twitter_small.csv"
# const YARNHOST = string(getipaddr()
#const INP = "hdfs://tan@localhost:9000/twitter_small.csv"
const COLSEP = ','
@tanmaykm
tanmaykm / wshed.jl
Last active Aug 29, 2015
simple watershed
View wshed.jl
using Images, Color, FixedPointNumbers, ImageView
impath = joinpath(Pkg.dir("TestImages"), "images/lena_gray_512.tif")
img = imread(impath);
mask = copy(img);
mask.data[1:end] = 1;
marks = falses(size(img.data));
#view(img)
#view(mask)
View buffon.jl
function buffon_one()
mp = rand()
phi = (rand() * pi) - pi / 2
xrechts = mp + cos(phi)/2
xlinks = mp - cos(phi)/2
xrechts >= 1 || xlinks <= 0
end
function buffon(m)
hit = 0
You can’t perform that action at this time.