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
| /* | |
| Reliability and Flow Control Example | |
| From "Networking for Game Programmers" - http://www.gaffer.org/networking-for-game-programmers | |
| Author: Glenn Fiedler <gaffer@gaffer.org> | |
| */ | |
| #include <iostream> | |
| #include <fstream> | |
| #include <string> | |
| #include <vector> |
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
| * { | |
| font-size: 12pt; | |
| font-family: monospace; | |
| font-weight: normal; | |
| font-style: normal; | |
| text-decoration: none; | |
| color: black; | |
| cursor: default; | |
| } |
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" | |
| type hash_function func (uint64, int32) int32 | |
| func main() { | |
| for j := 1; j < 32; j++ { | |
| simulate_rebalance("JumpConsistentHash", 32, int32(32 + j), JumpConsistentHash) | |
| simulate_rebalance("ModConsistentHash", 32, int32(32 + j), ModConsistentHash) |
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 httptimeout | |
| import ( | |
| "net/http" | |
| "time" | |
| "fmt" | |
| ) | |
| type TimeoutTransport struct { | |
| http.Transport |
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
| // The biggest 64bit prime | |
| #define P 0xffffffffffffffc5ull | |
| #define G 5 | |
| #include <stdio.h> | |
| #include <stdint.h> | |
| #include <assert.h> | |
| #include <stdlib.h> | |
| // calc a * b % p , avoid 64bit overflow |
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
| #!/usr/bin/env dash | |
| base64 -d <<__EOH__ | exec gzip -dc | |
| H4sIAK1zzVIAA7VaUXajMAx8+c0V+sMRYCHk5XGUPQP3/900JViWZiTZ6farxa5tzUgjWTAM8ufr | |
| 77jNy3bblnGbxnH/eXATD85Zk3z4ejLW/7cPnT9XdZ5Rn2eyB1wmOTY9xya5v551UytM37s8xm1Z | |
| ytH18w6bTksOO47lvyFe9M7jTtEPjAP2LZqKaqv1mHV//QrHECCd/J1LTefS0/aYElYNcD4z4w3D | |
| 2nPo95k1UcbV4GFfI7MYqc4972LC/Jww7/L/tC8WeyLS5h5+roAZai2NE85d0vTCVtZ6OfwOorXT | |
| emh+bFzOtmPWvD3mMusuf9XKueon3McbA3kn9uZguxaehJcYh2U41QhonDxYIu4dDUhgpCWiflZv | |
| 3Kop1zOJeooeAMj0xAFUoznrPeRsPAOEImHkjhyXJbaCYkXSgWYdydZ9FTd1IDRIwLU4slvdYB2c | |
| 7Rxh+oX4q0YY+CRC/P58cLeIw5OZ8mF6/RqKK4uT9kpBpd/WwkEUC71bt0NpZlwEeBdSBruaAyes |
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 ( | |
| "log" | |
| "os" | |
| "syscall" | |
| ) | |
| func main() { | |
| f, err := os.Open("/tmp/pipe") |
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 httpclient | |
| import ( | |
| "net" | |
| "net/http" | |
| "time" | |
| ) | |
| type Config struct { | |
| ConnectTimeout time.Duration |
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
| #!/usr/bin/env bash | |
| if [[ ! ( # any of the following are not true | |
| # 1st arg is an existing regular file | |
| -f "$1" && | |
| # ...and it has a .ipa extension | |
| "${1##*.}" == "ipa" && | |
| # 2nd arg is an existing regular file | |
| -f "$2" && | |
| # ...and it has an .mobileprovision extension |
NewerOlder