Skip to content

Instantly share code, notes, and snippets.

Pjotr Prins pjotrp

Block or report user

Report or block pjotrp

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
@pjotrp
pjotrp / gist:53c4ab2cdfb95b1466955d1b9d790f25
Created Jan 2, 2019
Output of a CWL workflow run from a GNU Guix container
View gist:53c4ab2cdfb95b1466955d1b9d790f25
/gnu/store/ik2j18y8gd370ndinna725c2ikldyh0r-cwltool-1.0.20181012180214/bin/.cwltool-real 1.0
Resolved 'Workflows/test-workflow.cwl' to 'file:///gnu/export/local/home/wrk/izip/git/opensource/cwl/hacchy1983-CWL-workflows/Workflows/test-workflow.cwl'
[workflow ] start
[workflow ] starting step trimPE
[step trimPE] start
[job trimPE] /tmp/ypu930v1$ java \
-jar \
/gnu/store/f09s746mp061ric48gdb1xaav9ki0b7q-trimmomatic-jar-0.38/lib/share/jar/trimmomatic-0.38.jar \
PE \
/tmp/tmpt5_80dad/stg2b137de8-6a7f-4ff7-882b-69a5f0ab4d61/small.ERR034597_1.fastq \
@pjotrp
pjotrp / mruby.scm
Created Dec 13, 2018
GNU Guix package for mruby
View mruby.scm
(define-public mruby
(package
(name "mruby")
(version "2.0.0")
(source (origin
(method url-fetch)
(uri (string-append "https://github.com/mruby/mruby/archive/" version ".zip"))
(sha256
(base32
@pjotrp
pjotrp / latency.txt
Created May 31, 2012 — forked from jboner/latency.txt
Latency numbers every programmer should know
View latency.txt
L1 cache reference 0.5 ns
Branch mispredict 5 ns
L2 cache reference 7 ns
Mutex lock/unlock 25 ns
Main memory reference 100 ns
Compress 1K bytes with Zippy 3,000 ns
Send 2K bytes over 1 Gbps network 20,000 ns
Read 1 MB sequentially from memory 250,000 ns
Round trip within same datacenter 500,000 ns
Disk seek 10,000,000 ns
@pjotrp
pjotrp / gist:2282927
Created Apr 2, 2012
Calling into R (Rlib.so/Rlib.dylib) from the D programming language
View gist:2282927
/**
A minimal example to use the random number generator of R (calling into Rlib.so from D)
dmd test_rlib.d ; ./test_rlib
It is a copy of the C code I wrote for BioLib
Pjotr Prins, 2012
@pjotrp
pjotrp / gist:2282903
Created Apr 2, 2012
Using BLAS/LAPACK/LINPACK from the D language
View gist:2282903
/**
The following example uses this function to calculate the matrix-vector product using
a blas/lapack routine:
/ 3 1 3 \ / -1 \
| 1 5 9 | * | -1 |.
\ 2 6 5 / \ 1 /
D2 version based on the C version at http://www.seehuhn.de/pages/linear
@pjotrp
pjotrp / convert.rb
Created Sep 30, 2011
Ruby snippet to convert Foxpro file to SQLite or MySQL
View convert.rb
# Ruby script to convert Foxpro file to SQLite or MySQL
#
USE_SQLITE3 = false
require 'rubygems'
require 'dbf'
require 'active_record'
if USE_SQLITE3
View split7.scala
case class Symbol()
case object Gap extends Symbol
case class Nucleotide() extends Symbol
case object GapN extends Nucleotide
case object A extends Nucleotide
case object G extends Nucleotide
case object C extends Nucleotide
case object T extends Nucleotide
View split6.scala
case class Symbol()
case object Gap extends Symbol
case class Nucleotide() extends Symbol
case object GapN extends Nucleotide
case object A extends Nucleotide
case object G extends Nucleotide
case object C extends Nucleotide
case object T extends Nucleotide
case object AnyGap
def splitSimplePass6[T >: Symbol](seq: List[T]): List[List[T]] = {
View split5.scala
case class Symbol() {
def isGap() = false
}
case object Gap extends Symbol {
override def isGap() = true
}
case class Nucleotide() extends Symbol
case object GapN extends Nucleotide {
override def isGap() = true
}
View split4.scala
case class Symbol()
case object Gap extends Symbol
case class Nucleotide() extends Symbol
case object GapN extends Nucleotide
case object A extends Nucleotide
case object G extends Nucleotide
case object C extends Nucleotide
case object T extends Nucleotide
def splitSimplePass4(seq: List[Symbol]): List[List[Symbol]] = {
val gap = GapN
You can’t perform that action at this time.