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
function shuffleArray(array) { | |
for (let i = array.length - 1; i > 0; i--) { | |
const j = Math.floor(Math.random() * (i + 1)); | |
[array[i], array[j]] = [array[j], array[i]]; // swap elements | |
} | |
} | |
function getRandomQuestions(questions, num=20) { |
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
Processed 387 Errors 11 | |
Liquid won 258 of the games. | |
Found 47 out of 387 games where Liquid picked Io. | |
Io was banned in {} matches. 239 | |
Wisp lost in 13 of the games. | |
------------Opponents--------------------- | |
Hero Tiny has won 3 out of 3 games against Liquid IO for a win percent of 1.0 (matches [3796359654, 3796268587, 3766915400]) | |
Hero Razor has won 1 out of 1 games against Liquid IO for a win percent of 1.0 (matches [3698342712]) | |
Hero Brewmaster has won 1 out of 1 games against Liquid IO for a win percent of 1.0 (matches [3595326728]) | |
Hero Leshrac has won 1 out of 1 games against Liquid IO for a win percent of 1.0 (matches [3595326728]) |
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
print('------------Opponents---------------------') | |
hero_wins = collections.defaultdict(int) | |
hero_totals = collections.defaultdict(int) | |
hero_matches = collections.defaultdict(list) | |
for match in wisp_matches: | |
for hero in match.opponent_picks: | |
hero_totals[hero] += 1 | |
if not match.liquid_win: | |
hero_wins[hero] += 1 | |
hero_matches[hero].append(match.match) |
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
class Match: | |
def __init__(self, match, liquid_win): | |
self.match = match | |
self.liquid_win=liquid_win | |
self.liquid_picks = [] | |
self.liquid_bans = [] | |
self.opponent_picks = [] | |
self.opponent_bans = [] | |
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
won_matches = list(filter(lambda m : m.liquid_win, processed_matches)) | |
print('Liquid won {} of the games.'.format(len(won_matches))) | |
wisp_banned = list(filter(lambda m: 'Io'in m.opponent_bans, processed_matches)) | |
wisp_matches = list(filter(lambda m: 'Io' in m.liquid_picks, processed_matches)) | |
print('Found {} out of {} games where Liquid picked Io.'.format(len(wisp_matches), len(processed_matches))) | |
print('Io was banned in {} matches.', len(wisp_banned)) |
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
class Match: | |
def __init__(self, match, liquid_win): | |
self.match = match | |
self.liquid_win=liquid_win | |
self.liquid_picks = [] | |
self.liquid_bans = [] | |
self.opponent_picks = [] | |
self.opponent_bans = [] |
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
import json | |
import time | |
import requests | |
input_file = open('liquid_matches.json') | |
matches = json.load(input_file) | |
input_file.close() | |
print('Loading {} matches\n'.format(len(matches))) | |
f = open('liquid_match_data.txt', 'w') |
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
<section> | |
<section id="kubernetes-cli-basics-with-kubectl"> | |
<h2>Google Container Engine (GKE) Basics</h2> | |
<p><a href="http://kubernetes.io/"><img src="https://pbs.twimg.com/profile_images/511909265720614913/21_d3cvM.png" alt="kubernetes" style='width:30%;'></a><br/>with <a href="https://kubernetes.io/docs/user-guide/kubectl/"><code>kubectl</code></a></p> | |
<h4 class='fragment grow'><a href="http://bit.ly/k8s-kubectl"><code>bit.ly/k8s-kubectl</code></a></h4> | |
</section> | |
<section id='presented-by' data-markdown> | |
presented by | |
[![CoreOS Logo](http://i.imgur.com/DRm4KEq.png "")](https://coreos.com) |
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
<section> | |
<section id="a-modular-workshop-series-for-learning-kubernetes"> | |
<h2><code>k8s-workshops</code></h2> | |
<p><a href="http://kubernetes.io/"><img src="https://pbs.twimg.com/profile_images/511909265720614913/21_d3cvM.png" alt="kubernetes" style='width:30%;'></a><br/>a modular workshop series for <a href="http://kubernetes.io/">Kubernetes</a></p> | |
<h3 class='fragment grow'><a href="http://bit.ly/k8s-workshops"><code>bit.ly/k8s-workshops</code></a></h3> | |
</section> | |
<section id='presented-by' data-markdown> | |
presented by | |
[![CoreOS Logo](http://i.imgur.com/DRm4KEq.png "")](https://coreos.com) |
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
CACHES = { | |
‘default’: { | |
‘BACKEND’: ‘redis_cache.RedisCache’, | |
‘LOCATION’: [ | |
‘%s:%s’ % (os.getenv(‘REDIS_MASTER_SERVICE_HOST’, ‘127.0.0.1’), |
NewerOlder