Skip to content

Instantly share code, notes, and snippets.

View Noxville's full-sized avatar
🎮
esports

Ben Steenhuisen Noxville

🎮
esports
View GitHub Profile
@Noxville
Noxville / ck_.sql
Created June 29, 2017 06:42
Courier Kills
nickname | match_id | min | sec
-----------+------------+-----+-----
RAMZES666 | 3193576156 | 50 | 19
No[o]ne- | 3226859073 | 37 | 9
Lil | 3230649585 | 16 | 6
Solo | 3228862847 | 13 | 57
Lil | 3235705862 | 15 | 43
9pasha | 3249004797 | 16 | 27
Solo | 3249548115 | 11 | 35
Solo | 3249497023 | 13 | 59

There are 3 series, and hence 27 possible permutations left (each series has 3 outcomes).

In 18 of these cases (the branches where Vega does not win 2-0), Liquid qualifies along with Imperial. Liquid have 8 points at the moment, Vega can have at most 7 points (remember they can't win 2-0 in this branch) and Imperial has at least 8 points (if Vega doesn't win 2-0, it means Imperial get at least one point from that series).

In the 9 other cases (the branch where Vega wins 2-0), Vega gets 8 points (tying with Liquid), and in every single case Vega does well enough in the tiebreaker to qualify. In 8 of these 9 cases, it's Imperial who qualifies along with vega

This reduces to: 1/27 permutations: Liquid & Vega qualify. 8/27 permutations: Vega & Imperial qualify.

@Noxville
Noxville / notes.md
Last active October 25, 2016 19:02
On region-locking qualifiers

(if you're familiar with Dota over the last few years, skip the first two sections)

Prelude

So Valve is hosting a Major in Boston, MA, USA, with a prize pool of ~$3 million (just in case you hadn't heard).

As with all Valve events post-TI4, some teams are directly invited to the main event ("Direct Invites") and some are invited to the "Regional Qualifiers" (RQ). Every other team in the world (or random collective of 5 casters) can sign up for the "Open Qualifiers".

Open Qualifiers

import random
import launchpad
from pygame import time
def main():
lp = launchpad.LaunchpadPro()
lp.Open(0)
for x in xrange(9):
import random
import launchpad
from pygame import time
def main():
lp = launchpad.LaunchpadPro()
lp.ListAll()
a = lp.Open(0)
lp.LedCtrlRawByCode( 81, 5 )
@Noxville
Noxville / riddler.py
Created September 2, 2016 19:01
Riddler Camel Problem
import math
L = 1000 # Max load of single camel
def solve(bananas_left, distance_left):
if distance_left == 0.0:
return bananas_left
c = math.ceil(bananas_left / L)
if c == 1:
return max(0, bananas_left - distance_left)
@Noxville
Noxville / Runtime
Created July 28, 2016 16:07
Dota Linux Client Crash
noxville@enigma:~/.local/share/Steam/steamapps/common/dota 2 beta/game$ ./dota.sh
Using breakpad crash handler
Setting breakpad minidump AppID = 570
Forcing breakpad minidump interfaces to load
Looking up breakpad interfaces from steamclient
Calling BreakpadMiniDumpSystemInit
Looking up breakpad interfaces from steamclient
Calling BreakpadMiniDumpSystemInit
Steam_SetMinidumpSteamID: Caching Steam ID: 76561197999511289 [API loaded yes]
Steam_SetMinidumpSteamID: Setting Steam ID: 76561197999511289
@Noxville
Noxville / RestFilters.groovy
Created July 24, 2016 22:40
RestFilters.groovy
package twopee
import grails.converters.JSON
import groovy.json.JsonOutput
class RestFilters {
def filters = {
all(controller: "(restRanking|restTeam|restLivegames|restModel|restMatch|restEvent|restView|restElo|restGlicko)", action:"") {
before = { }
@Noxville
Noxville / Glicko2.groovy
Created May 25, 2016 13:01
Glicko 2 Groovy Implementation
static class Glicko2 {
double _MU
double _SIGMA
double _PHI
double _TAU
double _EPSILON
Glicko2(Double mu, Double sigma, Double phi, Double tau, Double epsilon) {
@Noxville
Noxville / riddler.py
Created January 8, 2016 14:07
Salesman Ridder Problem on Five Thirty Eight
#!/usr/bin/python
from itertools import permutations
from math import e, ceil
cutoff = int(ceil(5. / e)) # for verbosity - it's 2
def solve(left, best):
for remaining in left:
if remaining < best:
return remaining