Skip to content

Instantly share code, notes, and snippets.

View coocood's full-sized avatar

Evan Zhou coocood

View GitHub Profile
@coocood
coocood / jepsen_analyze.go
Created November 11, 2019 09:17
jepsen analyze
package main
import (
"bufio"
"bytes"
"flag"
"github.com/prometheus/common/log"
"io"
"os"
"strconv"
@coocood
coocood / pessimistic_test.go
Last active June 19, 2019 09:42
pessimistic test
package main
import (
"context"
"database/sql"
"errors"
"flag"
"fmt"
"log"
"math/rand"
@coocood
coocood / rowformat_test.go
Created July 17, 2018 14:09
New row format prototype
package rowformat
import (
"encoding/binary"
"fmt"
"math"
"reflect"
"testing"
"time"
"unsafe"
@coocood
coocood / flatbuf_test.go
Created October 19, 2017 08:41
FlatBuffers test
package chunk
import (
"testing"
flatbuffers "github.com/google/flatbuffers/go"
"github.com/pingcap/tidb/util/types"
"github.com/pingcap/tidb/util/codec"
)
@coocood
coocood / join.go
Last active January 8, 2016 06:23
Join Order calculator
package join
type Table struct {
Name string
Selectivity float64
}
func (t *Table) String() string {
return t.Name
}
@coocood
coocood / doublecodec
Last active August 29, 2015 14:22
Double codec
typedef union {
double dv;
long long unsigned int lv;
} doubleLong;
void memrev64(void *p) {
unsigned char *x = p, t;
t = x[0];
x[0] = x[7];