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 | |
import ( | |
"encoding/binary" | |
"math/big" | |
"math/rand" | |
"reflect" | |
"testing" | |
"testing/quick" | |
) |
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
rekik86 @rekik86 Jun 22 2016 16:51 | |
Hi David | |
David Taylor @dt Jun 22 2016 16:51 | |
Hey | |
rekik86 @rekik86 Jun 22 2016 16:52 | |
Thanks for offering your help | |
I'm new to RDBM | |
This is just a homework actually |
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
[17:34:59] ~/code/go/src/github.com/cockroachdb/cockroach $ rm -rf cockroach-data | |
[17:35:02] ~/code/go/src/github.com/cockroachdb/cockroach $ ./cockroach start --background | |
CockroachDB node starting at 2017-01-05 17:35:11.062768945 +0000 UTC | |
build: 85fe10a @ 2017/01/05 17:34:36 (go1.7.1) | |
admin: http://localhost:8080 | |
sql: postgresql://root@localhost:26257?sslmode=disable | |
logs: cockroach-data/logs | |
store[0]: path=cockroach-data | |
status: initialized new cluster |
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
[20:33:44] ~/code/go/src/github.com/cockroachdb/cockroach $ glide cc && ./scripts/glide.sh --debug up && g diff && ./scripts/glide.sh --debug up && g diff | |
[INFO] Glide cache has been cleared. | |
[DEBUG] No mirrors.yaml file exists | |
[INFO] Downloading dependencies. Please wait... | |
[DEBUG] Locking https-github.com-cockroachdb-c-protobuf | |
[DEBUG] Locking https-github.com-grpc-ecosystem-grpc-gateway | |
[DEBUG] Locking https-github.com-jteeuwen-go-bindata | |
[DEBUG] Locking https-github.com-cockroachdb-c-jemalloc | |
[DEBUG] Locking https-github.com-cockroachdb-crlfmt | |
[DEBUG] Locking https-github.com-golang-lint |
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
[20:23:31] ~/code/go/src/github.com/cockroachdb/cockroach $ glide cc && ./scripts/glide.sh up && g diff && ./scripts/glide.sh up && g diff | |
[INFO] Glide cache has been cleared. | |
[INFO] Downloading dependencies. Please wait... | |
... | |
[INFO] Keeping google.golang.org/grpc 79b7c349179cdd6efd8bac4a1ce7f01b98c16e9b | |
[INFO] --> Fetching github.com/matttproud/golang_protobuf_extensions. | |
[INFO] --> Setting version for github.com/golang/protobuf to 8d92cf5fc15a4382f8964b08e1f42a75c0591aa3. | |
... | |
[INFO] Project relies on 99 dependencies. | |
diff --git a/glide.lock b/glide.lock |
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
.tab:before { | |
content: "\00bb\00a0"; | |
} | |
/* Languages where tabs are used for indentation -- don't highlight */ | |
.go.line.content .tab:before { | |
content: "\00a0\00a0"; | |
} |
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 | |
import "fmt" | |
import "testing" | |
// go test -bench . -benchmem -count 10 | benchstat | |
// name time/op alloc/op allocs/op | |
// Fmt-8 168ns ± 7% 32.0B ± 0% 2.00 ± 0% | |
func BenchmarkFmt(b *testing.B) { | |
for k := 0; k < b.N; k++ { |
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 | |
import ( | |
"database/sql" | |
"log" | |
"time" | |
_ "github.com/lib/pq" | |
) |
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
david=# CREATE TABLE test1 (t timestamp); | |
david=# SET TIME ZONE -4; INSERT INTO test1 VALUES('2015-05-01 12:00:00'); | |
david=# SET TIME ZONE 0; INSERT INTO test1 VALUES('2015-05-01 12:00:00'); | |
david=# SET TIME ZONE 2; SELECT * FROM test1; | |
2015-05-01 12:00:00 | |
2015-05-01 12:00:00 | |
david=# SET TIME ZONE 0; SELECT * FROM test1; | |
2015-05-01 12:00:00 | |
2015-05-01 12:00:00 |
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 | |
import ( | |
"encoding/hex" | |
"fmt" | |
) | |
func main() { | |
data := []byte("ab") | |
encoded := make([]byte, len(data)*2+1) |