Skip to content

Instantly share code, notes, and snippets.

View axsk's full-sized avatar

Alexander axsk

  • Zuse Institute Berlin
  • Berlin
View GitHub Profile
@userplot PlotSolutions
@recipe function f(o::PlotSolutions)
samples = o.args[1]
species --> measuredinds
t --> 0:1/3:30
color_palette --> [colorant"steelblue"]
linewidth --> 0.1
label --> ""
seriesalpha --> 0.1
typealias ColVec Vector{Union{Colon,Int}}
immutable SliceIterator{A<:AbstractArray}
a::A
dim::Int
cols::ColVec
end
function SliceIterator(a, dim::Int)
cols = ColVec(length(size(a)))
cols = fill!(cols, :)
@axsk
axsk / make
Created April 17, 2016 12:29
julia make error
fatal: No names found, cannot describe anything.
fatal: bad revision '^'
JULIA usr/lib/julia/inference.ji
essentials.jl
generator.jl
reflection.jl
options.jl
promotion.jl
tuple.jl
range.jl
@axsk
axsk / Make.user
Last active April 17, 2016 12:37
make error
JULIA_CPU_TARGET:=core2
prefix=/datanumerik/bzfsikor/julia/julia-head
@axsk
axsk / cvodes.jl
Created March 27, 2016 00:23
cvodes-autodiff
using Sundials, ForwardDiff
import Sundials: realtype, N_Vector
type FAndP
f::Function
p::Vector{Float64}
end
function unzip(fp::Ptr{Void})
@axsk
axsk / gist:879cb2887290650c3baf
Created March 12, 2016 03:14
Serialize/Deserialize segfault
signal (11): Segmentation fault [66/1088]
unknown function (ip: 0x7fe6892e0fb9)
jl_gc_collect at /nfs/datanumerik/bzfsikor/julia/julia-0.4.3/bin/../lib/julia/libjulia.so (unknown line)
jl_gc_alloc_2w at /nfs/datanumerik/bzfsikor/julia/julia-0.4.3/bin/../lib/julia/libjulia.so (unknown line)
jl_alloc_svec_uninit at /nfs/datanumerik/bzfsikor/julia/julia-0.4.3/bin/../lib/julia/libjulia.so (unknown line)
jl_alloc_svec at /nfs/datanumerik/bzfsikor/julia/julia-0.4.3/bin/../lib/julia/libjulia.so (unknown line)
unknown function (ip: 0x7fe689263015)
unknown function (ip: 0x7fe6892638d1)
unknown function (ip: 0x7fe6892641df)
unknown function (ip: 0x7fe68926835b)
@axsk
axsk / gist:4c32dcd0c7a90a483077
Created February 28, 2016 13:38
mamba.jl: proof of per-chain tune reset
After applying
``` diff
diff --git a/src/model/mcmc.jl b/src/model/mcmc.jl
index 8dc127c..30e3e61 100644
--- a/src/model/mcmc.jl
+++ b/src/model/mcmc.jl
@@ -61,9 +61,12 @@ end
function mcmc_worker!(args::Vector)
m, state, window, burnin, thin, meter = args
findcalls(x::Expr)=mapreduce(findcalls, vcat, ex.head == :call ? x.args[1] : [], filter(arg->isa(arg, Expr), x.args))
@axsk
axsk / extract.jl
Last active October 8, 2015 12:15
not terminating
for method=methods, i=imgs, n=[clusternums[i]-1:clusternums[i]+1], mirrored = [false,true], left = [true,false], kernel=kernels
# print log
println(" image: $i, n: $n, mirrored: $mirrored, left: $left, method: $method, kernel: $kernel ")
# skip already computed data
if hasentry(hdf, i, n, mirrored, left, method, kernel)
println(", skipping...")
p.n = p.n-1
continue

lein deps without phantomjs:

lein deps :tree
 [clj-webdriver "0.7.2"]
   [cheshire "5.5.0"]
     [com.fasterxml.jackson.core/jackson-core "2.5.3"]
     [com.fasterxml.jackson.dataformat/jackson-dataformat-cbor "2.5.3"]
     [com.fasterxml.jackson.dataformat/jackson-dataformat-smile "2.5.3"]
     [tigris "0.1.1"]
   [clj-http "2.0.0"]