Skip to content

Instantly share code, notes, and snippets.

@idontgetoutmuch
idontgetoutmuch / LV.bi
Created June 13, 2016 13:31
Lotka-Volterra in LibBi
model LV {
const h = 0.02; // time step
const delta_abs = 1.0e-2; // absolute error tolerance
const delta_rel = 1.0e-5; // relative error tolerance
const epsilon = 2.0e-2; // observation error tolerance
dim s(2); // number of species
dim n(2); // number of parameters for each species process
@idontgetoutmuch
idontgetoutmuch / Experiment1.hs
Last active September 1, 2016 13:15
An experiment with data analysis
{-# LANGUAGE OverloadedLabels, TypeOperators, DataKinds, FlexibleContexts #-}
{-# LANGUAGE OverloadedStrings #-}
import Labels
import Labels.Cassava
import Data.Vector ( Vector )
import Data.Text ( Text )
import Data.Text.Lazy.Encoding
import qualified Data.Text.Lazy as LT
import Data.Csv hiding ( decodeByName )
import Data.Csv.Streaming
@idontgetoutmuch
idontgetoutmuch / route.xml
Created November 10, 2016 08:26
Partial Route
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
<gpx xmlns="http://www.topografix.com/GPX/1/1" version="1.1" creator="relation-analyzer">
<trk>
<name>Graph 3</name>
<trkseg>
<trkpt lat="51.45671844482421875" lon="0.195361793041229248046875"/>
<trkpt lat="51.456607818603515625" lon="0.19555039703845977783203125"/>
<trkpt lat="51.4565887451171875" lon="0.1955789029598236083984375"/>
<trkpt lat="51.456512451171875" lon="0.19566370546817779541015625"/>
<trkpt lat="51.4564208984375" lon="0.1957325041294097900390625"/>
~/Dropbox/Private/Stochastic $ /usr/local/bin/perl -I$HOME/perl5/lib/perl5 -Mlocal::lib
/usr/local/bin/perl -I$HOME/perl5/lib/perl5 -Mlocal::lib
Attempting to create directory /Users/dom/perl5
PATH="/Users/dom/perl5/bin${PATH:+:${PATH}}"; export PATH;
PERL5LIB="/Users/dom/perl5/lib/perl5${PERL5LIB:+:${PERL5LIB}}"; export PERL5LIB;
PERL_LOCAL_LIB_ROOT="/Users/dom/perl5${PERL_LOCAL_LIB_ROOT:+:${PERL_LOCAL_LIB_ROOT}}"; export PERL_LOCAL_LIB_ROOT;
PERL_MB_OPT="--install_base \"/Users/dom/perl5\""; export PERL_MB_OPT;
PERL_MM_OPT="INSTALL_BASE=/Users/dom/perl5"; export PERL_MM_OPT;
@idontgetoutmuch
idontgetoutmuch / Main.hs
Created December 2, 2016 10:14
Why NaNs?
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE BangPatterns #-}
module Main where
import Control.Monad.Bayes.LogDomain
import Control.Monad.Bayes.Primitive
import Control.Monad.Bayes.Class
@idontgetoutmuch
idontgetoutmuch / otool.txt
Created January 14, 2017 08:43
otool -l output
~/Dropbox/Private/TestU01-1.2.3/examples/src $ otool -l a.out
a.out:
Load command 0
cmd LC_SEGMENT_64
cmdsize 72
segname __PAGEZERO
vmaddr 0x0000000000000000
vmsize 0x0000000100000000
fileoff 0
filesize 0
ghc-stage1: panic! (the 'impossible' happened)
(GHC version 8.1.20170131 for x86_64-apple-darwin):
applyTypeToArgs
Expression: sizeofArray# @ e ds2_ibOz i#_ibWB
Type: forall a. Array# a -> Int#
Args: [TYPE: e, ds2_ibOz, i#_ibWB]
Call stack:
CallStack (from HasCallStack):
prettyCurrentCallStack, called at compiler/utils/Outputable.hs:1166:58 in ghc:Outputable
callStackDoc, called at compiler/utils/Outputable.hs:1170:37 in ghc:Outputable
@idontgetoutmuch
idontgetoutmuch / label.asm
Created February 7, 2017 10:32
Label not referenced
[1 of 1] Compiling Fbct ( testFabs.hs, testFabs.o )
==================== Asm code ====================
.data
.align 3
.align 0
.globl __stginit_main:Fbct
__stginit_main:Fbct:
@idontgetoutmuch
idontgetoutmuch / panic.txt
Created February 9, 2017 19:55
Stage 1 Panic
ghc-stage1: panic! (the 'impossible' happened)
(GHC version 8.1.20170209 for x86_64-apple-darwin):
Iface Lint failure
In interface for GHC.Float.ConversionUtils
Unfolding of elimZerosInt#
<no location info>: warning:
In the expression: <=# e_a5zk t_a5zt
Argument value doesn't match argument type:
Fun type: Int# -> Int#
Arg type: Double#
cabal build
Building accelerate-llvm-1.0.0.0...
Preprocessing library accelerate-llvm-1.0.0.0...
[24 of 52] Compiling Data.Range.Range ( Data/Range/Range.hs, dist/build/Data/Range/Range.o )
ghc:
lookupSymbol failed in relocateSection (relocate external)
/usr/local/Cellar/llvm/3.9.1/lib/libLLVMLTO.a: unknown symbol `__ZN4llvm15PrintStatisticsEv'
ghc: Could not on-demand load symbol '__ZNSt3__16vectorIPN4llvm8ConstantENS_9allocatorIS3_EEE21__push_back_slow_pathIRKS3_EEvOT_'
GHC runtime linker: fatal error: I found a duplicate definition for symbol