Skip to content

Instantly share code, notes, and snippets.

type Header []byte
type Hit struct {
subject Header
gi int
qfrom, qto, sfrom, sto int
bitsc float32
}
func parseLine (line Line) *Hit {
@emepyc
emepyc / gist:1322637
Created October 28, 2011 16:05
goroutines filling a channel in the order they are fired
package main
import (
"fmt"
"runtime"
"time"
)
func init() {
runtime.GOMAXPROCS(4)
package main
import (
"time"
"runtime"
"fmt"
)
var (
qstate = make(chan int, 8)
package main
import (
"time"
"runtime"
"fmt"
)
var (
closeRead = make(chan bool)
@emepyc
emepyc / index.html
Created November 29, 2012 15:01
Pie chart updates in D3.js
<!DOCTYPE html>
<html>
<head>
<script type="text/javascript" src="http://code.jquery.com/jquery.js"></script>
    <script type="text/javascript" src="http://d3js.org/d3.v2.js"></script>
<script type="text/javascript" src="donut.js"></script>
</head>
<body>
<script type="text/javascript">
var innerRadius = 120;
@emepyc
emepyc / _.md
Created November 29, 2012 16:43
Horizontal bar charts with update
@emepyc
emepyc / _.md
Created December 17, 2012 17:00
Horizontal stacked bar with update