Skip to content

Instantly share code, notes, and snippets.

-- initial state of ContactInfo --
actor: root - Joubin - address: 321 Infinity Unloop - email: alphazero@sensesay.net
-- run the parallel tasks --
-- merge beings --
actor: actor-1 - Joubin - address: 321 Infinity Unloop - email: joubin@inch.com
actor: actor-2 - Joubin - address: 123 Main Street - email: alphazero@sensesay.net
-- merge end --
± ./wot master
panic: n:1152066 now:1407851832361738000 t0:1407851832361738425 dt:-425
goroutine 23 [running]:
runtime.panic(0x97380, 0x2081ec020)
/usr/local/go/src/pkg/runtime/panic.c:279 +0xf5
main.func·004()
/Users/alphazero/go/src/lsf/exp/wot.go:38 +0x1fa
created by main.main
[19]--bkts: 524288 108869352 0.814 | prob% (99.9985 0.0015 0.0000 0.0000) max (21 0 0) o/f (n 1644 pgs 6) PIT-pages:256
so 99.9985 primary page, 0.0015% 2nd, etc.
1644 is the total number of keys that missed their primary (out of 524288 * 255).
@alphazero
alphazero / gist:dd1ad2ae7f6c91c06c79
Last active August 29, 2015 14:19
ascii art 04132015.0
0x---1000 0x---2000 # v.mem address space and v.mem page alignments
| 0x---1080 | 0x--------2080 # ~ and allocated [512]uint64 page bucket array
| | r1 r2 | r3|
----|-------------*-- /.../ -*----|-*------
| |
bucket[n] bucket[n+1] # Go d.s. as allocated - word aligned
- swap bucket[n][r1] with bucket[n][r3]
package main
import (
"flag"
)
var option = struct {
knob uint
}{
knob: 4096,
@alphazero
alphazero / gist:218244ace3b167ef1de8
Last active August 29, 2015 14:20
Initial sketch of /.go tool chain meta-data files
# ----------------------------------
# general layout of the land
# ----------------------------------
$GOPATH/src/.go
$GOPATH/src/.go/config
$GOPATH/src/.go/vendors # for all projects
# ----------------------------------
# $GOPATH/.go/vendors sketch
# ----------------------------------
package foo
import (
"fmt"
"testing"
)
const M = 32768
const M0 = M / 8192 // play with this knob ...
@alphazero
alphazero / gist:1684fa102bb545ecb3f7
Last active August 29, 2015 14:21
go test -bench results of distributing random % slotcnt + times
XorShift*
453361 of 524288 slots with ideal cnt of 2
ideal: 141655 (27.019%)
missed: 70927 (13.528%)
less: 142038 (27.092%)
more: 169668 (32.362%)
max hits: 12
STD-LIB
452947 of 524288 slots with ideal cnt of 2
ideal: 141284 (26.948%)
二 // 2
进 // "enter" per google but accounting is most likely meaning
制 // system
二进制 // binary (number system)
十 // 10
进 // "enter" ..
制 // system
/**
* Will read up expected bulkdata bytes from the input stream. Routine will
* also read in the last two bytes and will check that they are indeed CRLF.
*
* @param in the stream to read from.
* @param length expected bulk data length (NOT including the trailing CRLF).
* @return a byte[] of length.
* @throws IOException
* @throws IllegalArgumentException if could not read the bulk data
*/