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 gorace // run with go test -race | |
import ( | |
"sync" | |
"testing" | |
"time" | |
) | |
var ( | |
every = 100 * time.Millisecond |
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
// minimax_games implements the Minimax Candorcet with the (non-candorcet) pairwise opposition model. | |
// | |
// See: https://en.wikipedia.org/wiki/Minimax_Condorcet | |
package main | |
import ( | |
"fmt" | |
"os" | |
"sort" | |
"text/tabwriter" |
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
// IPv4 | |
// | |
// Excluded ranges: | |
// 10.0.0.0/8 | |
// 172.16.0.0/12 | |
// 192.168.0.0/16 | |
// 100.64.0.0/10 | |
// 224.0.0.0/4 | |
// 240.0.0.0/4 | |
builder.addRoute("0.0.0.0", 5) |
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 ( | |
"fmt" | |
"io" | |
"log" | |
"net/http" | |
"net/http/httptest" | |
"net/url" | |
"os" |
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
#!/usr/bin/python3 | |
def getProducts(values): | |
""" Return an array where each index is the product of all other values, runs in O(N) time """ | |
left = [] | |
leftProduct = 1 | |
right = [] | |
rightProduct = 1 | |
for i in range(len(values)): | |
left.append(leftProduct) |
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
$ /usr/bin/python3.4 | |
Python 3.4.3 (default, Nov 17 2016, 01:08:31) | |
[GCC 4.8.4] on linux | |
Type "help", "copyright", "credits" or "license" for more information. | |
>>> letters = 'abcdefghijklmnopqrstuvwxyz' | |
>>> shift = lambda s, d: s[d:]+s[:d] | |
>>> trans = lambda d: shift(letters.lower(), d)+shift(letters.upper(), d) | |
>>> encrypt = lambda s, d: s.translate(str.maketrans(trans(0), trans(d))) | |
>>> decrypt = lambda s, d: encrypt(s, -d) | |
>>> encrypt('You cracked the code!', 14) |
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
kyle@vms:/$ ls ?????? | |
13Tbdh 35ZSQF 5dJX5p 7M2c5l 9KnUrh aGDiMc b5fj7V C1EcWM cr3WvL DE_YT9 eJxq5F fp6Bjb GINwCO hcfd_G i3KmrS IqyBV9 JvPOHG LGyykg m8hW6R N1FJ3_ O9muzU paaGyO q58i0G QXxd12 rZmafX sWzMje Ts4qKq uK0rn0 VmmBef WLRUb0 XFgpHO Yc1XPW YstT48 zpc0st | |
15fZ5C 3_6FKJ 5EByEW 7oMtwI 9Mk_38 AhrQKy B6LaRU c31UgP cr88zM DHE0zI EL8T1X fPj0jS gmCcvf HE4wqh i6uRVa iSFDXB jwbxWe lkoJC7 mAtmSe N3qsqv oAEA5I PCipQM Q5z9cg QZ39LR s4JFp8 T5oH3_ TsKWOt UM8zRo VNMA1V wMeDej xfrZoV YCbBXC YT8lMb zps2th | |
1B0vgN 36no1t 5gzhQE 7XiGqa 9MRlGy AHucEO b6xF1Z C3QbmL cRAITG DhOSox eLCjXc ftdh5H _GMMXK HhqpL_ i9iBiu IW6GUw jwhcmB lKQftv MduUfp n9159P OAYO1s PDJX1w q9mC8_ qz5szd S7lpgO tbI847 tUNKyU uMGEl1 vQa0RO Wmj38N Xg_FkD yd1iTX y_URrE ZrFZch | |
1flb1x 382xdp 5llPhq 84Do7G 9o2mVu AIdwbP B7ci7u c5GqWd cS5w_e DI_L2o elwrcm F_uAPk gMRh1A HjwlvE I9kUDL IWI_om jwPkXQ llhaqt mFqN9J N9V4q9 oBIGxg PdtDAi QB8Cqj QZ6N6 |
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 b62 | |
import ( | |
"math" | |
"testing" | |
) | |
const alphabet = "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ" | |
func base62EncodeB(num int) []byte { |
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
id: frontend | |
kind: Service | |
apiVersion: v1beta1 | |
selector: | |
app: frontend | |
labels: | |
app: frontend | |
containerPort: 80 | |
port: 80 | |
publicIPs: |
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
id: ghost | |
kind: Service | |
apiVersion: v1beta1 | |
selector: | |
app: ghost | |
labels: | |
app: ghost | |
containerPort: 2368 | |
port: 2368 |