I hereby claim:
- I am xlab on github.
- I am xlab (https://keybase.io/xlab) on keybase.
- I have a public key whose fingerprint is 8F39 7B4E 96AB 1977 5C15 C3C6 DE3F 4FEA 5B0A DCE5
To claim this, I am signing this object:
| func arrayToSliceInt32(ptr unsafe.Pointer, size int) (ints []int32) { | |
| hdr := reflect.SliceHeader{ | |
| Data: uintptr(ptr), | |
| Len: size, | |
| Cap: size, | |
| } | |
| cints := *(*[]int32)(unsafe.Pointer(&hdr)) | |
| ints = make([]int32, size) | |
| // TODO: bech this | |
| copy(ints, cints) |
| $ go test -bench=BenchmarkUint -run=XXX | |
| PASS | |
| BenchmarkUint32Div7 20000000 126 ns/op | |
| BenchmarkUint32Div37 20000000 126 ns/op | |
| BenchmarkUint32Div123 20000000 126 ns/op | |
| BenchmarkUint32Div763 20000000 126 ns/op | |
| BenchmarkUint32Div1247 20000000 126 ns/op | |
| BenchmarkUint32Div9305 20000000 126 ns/op | |
| BenchmarkUint32Div13307 20000000 126 ns/op | |
| BenchmarkUint32Div52513 20000000 126 ns/op |
| /** Helper functions start **/ | |
| var RiakHelper = function() { | |
| return { | |
| numericSorter: function(first, second) { | |
| return first - second; | |
| } | |
| }; | |
| }(); |
| <snippet> | |
| <content><![CDATA[ | |
| type ${1:type}s []*${1:type} | |
| func (s ${1:type}s) Len() int { return len(s) } | |
| func (s ${1:type}s) Swap(i, j int) { s[i], s[j] = s[j], s[i] } | |
| func (s ${1:type}s) Less(i, j int) bool { return s[i].${2:field} < s[j].${2:field} } | |
| ]]></content> | |
| <tabTrigger>gosort</tabTrigger> | |
| <scope>source.go</scope> |
I hereby claim:
To claim this, I am signing this object:
| FROM progrium/busybox | |
| ADD https://raw.githubusercontent.com/bagder/ca-bundle/master/ca-bundle.crt /etc/ssl/ca-bundle.pem |
| Testcase from https://github.com/skarademir/naturalsort/blob/master/naturalsort_test.go | |
| BenchmarkNaturalSort 50000 28738 ns/op | |
| BenchmarkHandySort 3000000 517 ns/op | |
| A real battle-case from https://github.com/xlab/handysort/blob/master/strings_test.go | |
| (10000 random alphanumeric strings) | |
| BenchmarkStringSort 500 2665145 ns/op | |
| BenchmarkHandyStringSort 100 11817051 ns/op | |
| BenchmarkNaturalStringSort 1 1013808894 ns/op |
| memstats := cmd.Flag.Lookup("memstats").Value.String() | |
| if memstats != "" { | |
| interval := cmd.Flag.Lookup("meminterval").Value.Get().(time.Duration) | |
| context.fileMemStats, err = os.Create(memstats) | |
| if err != nil { | |
| return err | |
| } | |
| context.fileMemStats.WriteString("# Time\tHeapSys\tHeapAlloc\tHeapIdle\tHeapReleased\n") |
| static uint32_t friends_list_save(const Messenger *m, uint8_t *data) | |
| { | |
| uint32_t i; | |
| uint32_t num = 0; | |
| for (i = 0; i < m->numfriends; i++) { | |
| if (m->friendlist[i].status > 0) { | |
| struct SAVED_FRIEND temp; | |
| memset(&temp, 0, sizeof(struct SAVED_FRIEND)); | |
| temp.status = m->friendlist[i].status; |
| // Glow automatically generated OpenGL binding: http://github.com/go-gl/glow | |
| package gl | |
| import ( | |
| "C" | |
| "fmt" | |
| "log" | |
| "reflect" | |
| "strings" |