Skip to content

Instantly share code, notes, and snippets.

View kortschak's full-sized avatar

Dan Kortschak kortschak

View GitHub Profile
@kortschak
kortschak / pprof.svg
Created April 30, 2012 09:53
dlog profile svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@kortschak
kortschak / boom.go
Created June 4, 2012 04:31
start of bam wrapper
// Copyright ©2012 Dan Kortschak <dan.kortschak@adelaide.edu.au>
package boom
// http://samtools.sourceforge.net/samtools/sam/index.html
/*
#cgo LDFLAGS: -L/usr/local/src/samtools_latest -lbam -lz
#include "sam.h"
static int fileType(samfile_t *fp) { return fp->type; }
@kortschak
kortschak / feature.go
Created June 12, 2012 01:50
new feature package start
// Copyright ©2012 Dan Kortschak <dan.kortschak@adelaide.edu.au>
package feat
type Conformationer interface {
Conformation() Conformation
}
type Conformation int8
@kortschak
kortschak / fetch.c
Created June 19, 2012 01:31
bam_fetch example
#include <stdio.h>
#include "sam.h"
// callback for bam_fetch()
static int fetch_func(const bam1_t *b, void *data)
{
printf("%s %d %d %d\n", b->data, b->core.tid, b->core.pos, b->core.l_qseq);
return 0;
}
@kortschak
kortschak / blackswan.go
Created August 29, 2012 00:19
failing case for GoLLRB deletion on non-uniquely inserted tree
package main
import (
"fmt"
"github.com/petar/GoLLRB/llrb"
)
func isBalanced(t *llrb.Tree) bool {
if t == nil {
return true
@kortschak
kortschak / dump_test.diff
Created January 13, 2013 00:05
Tests for go-spew nil pointer issue fix.
diff --git a/spew/dump_test.go b/spew/dump_test.go
index a9504a8..d468886 100644
--- a/spew/dump_test.go
+++ b/spew/dump_test.go
@@ -161,6 +161,13 @@ func addIntTests() {
addDumpTest(v5, "("+v5t+") "+v5s+"\n")
addDumpTest(pv5, "(*"+v5t+")("+v5Addr+")("+v5s+")\n")
addDumpTest(&pv5, "(**"+v5t+")("+pv5Addr+"->"+v5Addr+")("+v5s+")\n")
+
+ // nil int* pointers.
@kortschak
kortschak / blas.go
Last active December 16, 2015 10:59
This is the blas interface description.
// Copyright ©2013 The gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
/*
Package blas provides interfaces for the BLAS linear algebra standard.
All methods perform appropriate parameter checking and may panic
if provided parameters do not conform to the requirements specified
by the BLAS standard.
@kortschak
kortschak / mul.go
Created May 11, 2013 10:20
Example of how a Mul might look.
package matrix
import (
"github.com/gonum/blas"
)
var blasEngine blas.Float64
type Float64 struct {
mat BlasMatrix
@kortschak
kortschak / mode_windows.go
Last active January 2, 2016 04:59
proposal for windows code for ct package
// Copyright ©2014 Dan Kortschak. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
// +build !ansi
package ct
import (
"fmt"
@kortschak
kortschak / blas.go
Created January 7, 2014 22:29
proposed interface split
// Copyright ©2013 The gonum Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
/*
Package blas provides interfaces for the BLAS linear algebra standard.
All methods must perform appropriate parameter checking and panic if
provided parameters that do not conform to the requirements specified
by the BLAS standard.