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 / 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 / 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 / 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)
import random
import launchpad
from pygame import time
def main():
lp = launchpad.LaunchpadPro()
lp.ListAll()
a = lp.Open(0)
lp.LedCtrlRawByCode( 81, 5 )
import random
import launchpad
from pygame import time
def main():
lp = launchpad.LaunchpadPro()
lp.Open(0)
for x in xrange(9):
@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

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 / 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
import random
def num_in_team(ar, team_num):
c = sum(ar[5 * team_num: 5 * team_num + 5])
return c
def good(ss, gs):
ret = True
for t in xrange(6):
if num_in_team(ss, t) < 4: ret = False
Each team blindly (as in, unknown to the enemy team) bans 3 maps for each series. There are 4 possible ways the overlap of banned maps can be:
0 map overlap:
* The only unbanned map is marked as map #1, kniferound for side selection.
* The loser of map #1 bans 1 map of the 6 unplayed maps.
* The winner of map #1 bans 1 map of the 5 unplayed/unbanned maps.
* The loser of map #1 bans 1 map of the 4 unplayed/unbanned maps.
* The winner of map #1 bans 1 map of the 3 unplayed/unbanned maps.
* The loser of map #1 picks map #2 (from the 2 unplayed/unbanned).
* (if a map #3 is required, they play the last unbanned/unpicked map)