Skip to content

Instantly share code, notes, and snippets.

@idontgetoutmuch
idontgetoutmuch / Cairo
Created July 15, 2013 13:22
SVG produced by diagrams-cairo and diagrams-svg.
<?xml version="1.0" encoding="UTF-8"?>
<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" width="600pt" height="480.926968pt" viewBox="0 0 600 480.926968" version="1.1">
<g id="surface1">
<path style="fill:none;stroke-width:0.01;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-miterlimit:10;" d="M 0.000007925 -0.0000142285 C -2.000005 -0.0000142285 -0.999998 2.999972 1.000014 -1.000021 C 2.000021 -3.000033 3.000027 -1.000021 4 -0.0000142285 " transform="matrix(117.874257,0,0,117.874257,128.502972,353.622771)"/>
<path style="fill:none;stroke-width:0.01;stroke-linecap:butt;stroke-linejoin:miter;stroke:rgb(0%,0%,0%);stroke-opacity:1;stroke-dasharray:0.1,0.1;stroke-miterlimit:10;" d="M 1.000014 -0.999987 L 2.000021 -3 " transform="matrix(117.874257,0,0,117.874257,128.502972,353.622771)"/>
<path style=" stroke:none;fill-rule:nonzero;fill:rgb(100%,0%,0%);fill-opacity:1;" d="M 252.269531 235.75 C 252.269531 232.496094 249.628906 229.855469 246.375
@idontgetoutmuch
idontgetoutmuch / RepaOnly.hs
Last active December 20, 2015 23:08
Repa implementation of Euler symplectic
{-# OPTIONS_GHC -Wall #-}
{-# OPTIONS_GHC -fno-warn-name-shadowing #-}
{-# OPTIONS_GHC -fno-warn-type-defaults #-}
{-# LANGUAGE NoMonomorphismRestriction #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE GeneralizedNewtypeDeriving #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE BangPatterns #-}
;; 10.112.148.185 8080
;; (defun dired-vlc-test ()
;; (interactive)
;; (let* ((buf (process-buffer dired-vlc-telnet-proc))
;; (old-max (with-current-buffer buf
;; (point-max))))
@idontgetoutmuch
idontgetoutmuch / gist:ff5961a115951924866b
Created July 10, 2014 18:05
veclibfort fails to build on 10.9.4
~ $ brew install veclibfort
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Downloading https://github.com/mcg1969/vecLibFort/archive/0.3.0.tar.gz
Already downloaded: /Library/Caches/Homebrew/veclibfort-0.3.0.tar.gz
==> make all
==> make check
"__gfortran_transfer_real_write", referenced from:
_MAIN__ in ccpjeFvr.o
ld: symbol(s) not found for architecture x86_64
[("Project name","The Glorious Glasgow Haskell Compilation System")
,("GCC extra via C opts"," -fwrapv")
,("C compiler command","/usr/bin/gcc")
,("C compiler flags"," -m64 -fno-stack-protector")
,("C compiler link flags"," -m64")
,("Haskell CPP command","/usr/bin/gcc")
,("Haskell CPP flags","-E -undef -traditional -Wno-invalid-pp-token -Wno-unicode -Wno-trigraphs")
,("ld command","/usr/bin/ld")
,("ld flags"," -arch x86_64")
,("ld supports compact unwind","YES")
@idontgetoutmuch
idontgetoutmuch / gist:d7784180f3f13d2db51e
Created March 21, 2015 15:27
brew install -v --HEAD julia
brew install -v --HEAD julia
==> Installing julia from staticfloat/homebrew-julia
==> Using Homebrew-provided fortran compiler.
This may be changed by setting the FC environment variable.
==> Building with an alternative Fortran compiler
This is unsupported.
==> Building with an alternative Fortran compiler
This is unsupported.
==> Cloning https://github.com/JuliaLang/julia.git
git --git-dir /Library/Caches/Homebrew/julia--git/.git status -s
functions {
real[] pendulum(real t,
real[] y,
real[] theta,
real[] x_r,
int[] x_i) {
real dydt[2];
dydt[1] <- y[2];
dydt[2] <- - theta[1] * sin(y[1]);
return dydt;
library(rstan)
library(mvtnorm)
qc1 = 0.0001
deltaT = 0.01
nSamples = 100
m0 = c(1.08, 0)
g = 9.81
bigQ = matrix(c(qc1 * deltaT^3 / 3, qc1 * deltaT^2 / 2,
@idontgetoutmuch
idontgetoutmuch / MwcFFI.hs
Created March 14, 2016 14:27
MWC Via FFI
{-# OPTIONS_GHC -Wall #-}
{-# LANGUAGE ForeignFunctionInterface #-}
module TestPcgViaR where
import Foreign
import Foreign.C.Types
import qualified Data.Vector as V
@idontgetoutmuch
idontgetoutmuch / lv.data.R
Created April 21, 2016 16:09
Lotka-Volterra
T <- 20
t0 <- 1900
y <-
structure(c(47.2, 70.2, 77.4, 36.3, 20.6, 18.1, 21.4, 22, 25.4, 27.1, 40.3, 57,
76.6, 52.3, 19.5, 11.2, 7.6, 14.6, 16.2, 24.7, 6.1, 9.8, 35.2, 59.4, 41.7, 19,
13, 8.3, 9.1, 7.4, 8, 12.3, 19.5, 45.7, 51.1, 29.7, 15.8, 9.7, 10.1, 8.6),
.Dim = c(20, 2))
ts <-
c(1901, 1902, 1903, 1904, 1905, 1906, 1907, 1908, 1909, 1910, 1911, 1912,
1913, 1914, 1915, 1916, 1917, 1918, 1919, 1920)