I hereby claim:
- I am mueslo on github.
- I am mueslo (https://keybase.io/mueslo) on keybase.
- I have a public key whose fingerprint is C5CC 9C3D 6BD1 E836 D45C 92E2 14C7 0D20 DDA2 39C2
To claim this, I am signing this object:
from pyparsing import (Word, Literal, Regex, Keyword, CaselessKeyword, Forward, | |
Group, OneOrMore, ZeroOrMore, alphas, nums, Suppress, | |
delimitedList, CharsNotIn, Empty, Optional, Or, | |
restOfLine) | |
IDENTIFIER = Word(alphas + "_", alphas + nums + "_") | |
(LPAREN, RPAREN, LBRACK, RBRACK, LBRACE, RBRACE, | |
SEMI, COMMA, EQUAL, DQUOTE) = map(Suppress, "()[]{};,=\"") |
#!/bin/sh | |
# requires: wget, ca-certificates, grep | |
#rm /tmp/cookies.txt | |
cookiefile="/tmp/cookies.txt" | |
#domain should contain "domain_id-record_id" | |
domain_id=$(echo $domain | tr "-" "\n" | sed -n "1p") | |
record_id=$(echo $domain | tr "-" "\n" | sed -n "2p") |
I hereby claim:
To claim this, I am signing this object:
#!/usr/bin/env python2 | |
import fractions | |
import itertools | |
import operator | |
import numbers | |
import collections | |
class OutcomeProb(object): | |
'''combines probabilistic outcomes with operator.add''' | |
def __init__(self, *args, **kwargs): |
#!/usr/bin/env python2 | |
import numpy as np | |
#ELO basics | |
# Expected result given 2 elo scores: | |
def expected(r1, r2): | |
sigma = 400. | |
return 1./(1.+pow(10., (r2-r1)/sigma)) | |
def chooseallmin(x,f): | |
if len(x)==0: return x | |
vals = map(f, x) | |
minval = min(vals) | |
return [x[i] for i,e in enumerate(vals) if e==minval] |
import numpy as np | |
maxl = 19*19 | |
enemy_cell = maxl+1 | |
friendly_cell = maxl+2 | |
#we need this to retrace our steps | |
def argmax(x): | |
i = np.nanargmax(x) | |
while len(x)>0 and x[i] in [enemy_cell,friendly_cell,np.inf]: | |
x[i] = -np.inf |
import rg | |
import numpy as np | |
class Robot: | |
#desirability of certain number of neighbours: | |
# num 0 1 2 3 4 | |
des_en = [0, 1, -2, -3, -4] #Enemy | |
des_tn = [0, 1, 2, 1, 0] #Team | |
direction = { | |
(1,0) : "right", |