This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package chan_test | |
| import ( | |
| "testing" | |
| ) | |
| func BenchmarkStructChan(b *testing.B) { | |
| ch := make(chan struct{}) | |
| go func() { | |
| for { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| // #include <stdlib.h> | |
| // #include "wrapper.c" | |
| import "C" | |
| import "unsafe" | |
| import "fmt" | |
| func read(filename string) string { | |
| f := C.CString(filename) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package bench | |
| import ( | |
| "strconv" | |
| "testing" | |
| ) | |
| var smallStr = "35" | |
| var bigStr = "999999999999999" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package main | |
| // run with: $ go test --bench=. -test.benchmem . | |
| // @see https://twitter.com/karlseguin/status/524452778093977600 | |
| import ( | |
| "math/rand" | |
| "strconv" | |
| "testing" | |
| ) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns explore-overtone.beethoven | |
| (:use [overtone.live])) | |
| ;; Beginning with some of the ideas in Sam Aaron's example[1], | |
| ;; let's see about trying to get rid of the limitation on sequence | |
| ;; length. | |
| ;; | |
| ;; I'd like to create a composition outside the server in "beat space" | |
| ;; (play note N at beat B). This should allow for composing notes via | |
| ;; an abstraction that a library like Leipzig [2] provides. But, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| (ns explore-overtone.leipzig-poly-player | |
| (:use | |
| leipzig.melody | |
| leipzig.scale | |
| leipzig.canon) | |
| (:require [overtone.live :as o] | |
| [overtone.inst.sampled-piano :as p])) | |
| ;; "un-scale" -- the inverse translations to go from raw pitches 60, | |
| ;; 62, etc. to scale indices 0, 1, etc. Then, you can "re-scale" in |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| package pointerTagging | |
| import ( | |
| "unsafe" | |
| "math/rand" | |
| "time" | |
| ) | |
| type vector struct { | |
| x int |