Skip to content

Instantly share code, notes, and snippets.

View kortschak's full-sized avatar

Dan Kortschak kortschak

View GitHub Profile
@kortschak
kortschak / race.txt
Created August 16, 2014 22:44
race condition in REPL crash fix
WARNING: DATA RACE
Write by goroutine 12:
github.com/google/cayley/query/gremlin.func·011()
/home/daniel/Development/src/github.com/google/cayley/query/gremlin/session.go:143 +0x1d1
Previous read by ****
id : /en/aries_spears
goroutine 11:
github.com/google/cayley/query/gremlin.runIteratorOnSession()
/home/daniel/Development/src/github.com/google/cayley/query/gremlin/finals.go:256 +0x1fa
@kortschak
kortschak / materialize failure
Created August 12, 2014 01:04
out put of b74cb142f02bc7a0079cf080de1bd4c112b2acab failing backported test from https://github.com/kortschak/cayley/tree/issue114
--- FAIL: TestQueries (25.37 seconds)
cayley_test.go:357: Unexpected results for Net and Speed:
cayley_test.go:359:
got:[]interface {}{map[string]string{"movie1":"The Net", "movie2":"/film/film", "id":"Sandra Bullock"}}
expect:[]interface {}{map[string]string{"id":"Sandra Bullock", "movie1":"The Net", "movie2":"Speed"}}
cayley_test.go:357: Unexpected results for Keanu with other in The Net:
cayley_test.go:359:
got:[]interface {}{map[string]string{"costar1_movie":"/film/film", "id":"Sandra Bullock", "movie1":"The Net"}}
expect:[]interface {}{map[string]string{"id":"Sandra Bullock", "movie1":"The Net", "costar1_movie":"Speed"}}
cayley_test.go:359:
@kortschak
kortschak / biogo-llrb_test.go
Created August 9, 2014 22:02
biogo llrb benchmark code
package biogollrb_test
import (
"testing"
"code.google.com/p/biogo.store/llrb"
"github.com/tv42/benchmark-ordered-map/fixture"
)
type llrbItemUnique fixture.Item
// ranker is a helper type for the rank function.
type ranker struct {
f []float64 // Data to be ranked.
r []int // A list of indexes into f that reflects rank order after sorting.
}
// ranker satisfies the sort.Interface without mutating the reference slice, f.
func (r ranker) Len() int { return len(r.f) }
func (r ranker) Less(i, j int) bool { return r.f[r.r[i]] < r.f[r.r[j]] }
func (r ranker) Swap(i, j int) { r.r[i], r.r[j] = r.r[j], r.r[i] }
// Copyright ©2014 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 concrete
import (
"github.com/gonum/graph"
)
@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.
@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 / 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 / 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 / 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.