This file contains 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 ( | |
"crypto/tls" | |
"io" | |
"log" | |
) | |
func main() { | |
conn, err := tls.Dial("tcp", "127.0.0.1:8000", nil) |
This file contains 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 ( | |
"bytes" | |
"exec" | |
"log" | |
"os" | |
) | |
// Pipeline strings together the given exec.Cmd commands in a similar fashion |
This file contains 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 bdr_proto; | |
message request { | |
message blob { | |
required string hash = 1; // the sha256 checksum of the blob | |
required int32 size = 2; // the size of the blob | |
} | |
repeated blob blobs = 1; | |
} |
This file contains 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
func MakeDict(prefix string, strings []string) (dict *Dict, err error) { | |
image_file_size := 0 | |
dict, err = nil, nil | |
for _, s := range strings { | |
// accomodate the string itself, length counter and zero-byte marker | |
// for the reason of backwards debility | |
image_file_size += len(s) + 5 | |
} | |
image_file, err := os.Create(prefix + `.image`) | |
defer image_file.Close() |
This file contains 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
$ time ./client_cpp | |
real 1m48.071s | |
user 0m1.955s | |
sys 1m45.919s | |
# ./trace.d | |
dtrace: script './trace.d' matched 22 probes | |
CPU ID FUNCTION:NAME | |
2 1 :BEGIN Tracing... |