This file contains hidden or 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 twopee | |
| import grails.transaction.Transactional | |
| @Transactional | |
| class HeadToHeadService { | |
| def eloService | |
| List<Double> headToHead(Team team1, Team team2) { |
This file contains hidden or 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 itertools | |
| import operator | |
| def evaluateDps(items): | |
| bat = 1.45 | |
| ias = min(4.00, 0.35 + sum(c.ias for c in items)) # ias is capped at 400, AC gives 35% IAS | |
| dmg = 33 + 60 + sum(c.damage for c in items) # 33 is the mean base damage, 60 damage from desolator | |
| aps = (1. + ias) / bat | |
| return dmg * aps |
This file contains hidden or 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
| def longestStreak() { | |
| Integer best = 0 | |
| Map<String, Integer> currentStreaks = new HashMap<>() | |
| Map<String, Date> startStreaks = new HashMap<>() | |
| Mtch.list().sort { it.matchId }.each { Mtch m -> | |
| def winner = m.winner.trim().toLowerCase() == "radiant" ? m.radiantTeam : m.direTeam | |
| def loser = m.winner.trim().toLowerCase() == "radiant" ? m.direTeam : m.radiantTeam |
This file contains hidden or 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 datetime | |
| import operator | |
| f = file("notail_wisp.csv", 'r') | |
| m = [e.strip() for e in f.readlines()] | |
| class MonthSummary: | |
| def __init__(self, key, order): | |
| self.key = key | |
| self.order = order |
This file contains hidden or 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 twopee | |
| import grails.transaction.Transactional | |
| import javax.annotation.PostConstruct | |
| @Transactional | |
| class HeroService { | |
| Map<String, String> lookupMap |
This file contains hidden or 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
| SELECT m.winner as winner, count(*) as cnt | |
| from mtch m | |
| JOIN elo_team_data_point radiant_elo | |
| ON (m.radiant_team = radiant_elo.team and DATE(m.date) = radiant_elo.elo_date) | |
| JOIN elo_team_data_point dire_elo | |
| ON (m.dire_team = dire_elo.team and DATE(m.date) = dire_elo.elo_date) | |
| WHERE | |
| (radiant_elo.rating > 1200) and | |
| (dire_elo.rating > 1200) and | |
| (m.match_id >= 1098011255) and |
This file contains hidden or 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 twopee | |
| import grails.transaction.Transactional | |
| import org.hibernate.Session | |
| import javax.annotation.PostConstruct | |
| import java.text.DateFormat | |
| import java.text.DecimalFormat | |
| import java.text.SimpleDateFormat |
This file contains hidden or 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
| SELECT | |
| CASE | |
| WHEN radiant_team < dire_team | |
| THEN radiant_team | |
| ELSE dire_team | |
| END as lhs, | |
| CASE | |
| WHEN radiant_team > dire_team | |
| THEN radiant_team | |
| ELSE dire_team |
This file contains hidden or 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 streams | |
| import org.codehaus.jackson.JsonNode | |
| class HitboxStream implements Stream { | |
| String getName() { | |
| 'Hitbox' | |
| } |
This file contains hidden or 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
| 1970-01-01 00:00:00,1,0.0,0.49329889739590865 | |
| 1970-01-01 00:00:00,1,500.0,0.6286283334174981 | |
| 1970-01-01 00:00:00,1,1000.0,0.7462400571692649 | |
| 1970-01-01 00:00:00,1,1500.0,0.8159095057788456 | |
| 1970-01-01 00:00:00,1,2000.0,0.8467042056272068 | |
| 1970-01-01 00:00:00,1,2500.0,0.8552794447316951 | |
| 1970-01-01 00:00:00,1,3000.0,0.9174904652047625 | |
| 1970-01-01 00:00:00,1,3500.0,0.9569027662675057 | |
| 1970-01-01 00:00:00,1,4000.0,0.974462882425239 | |
| 1970-01-01 00:00:00,1,4500.0,0.9910090740879556 |
OlderNewer