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
/** @see https://stackoverflow.com/questions/6972331/how-can-i-generate-a-set-of-points-evenly-distributed-along-the-perimeter-of-an */ | |
export const ellipsePoints = (count: number, rx: number, ry: number, offset = Math.PI / 2) => { | |
const points: { x: number, y: number }[] = []; | |
// dp(t) calculates the distance from the center of the ellipse | |
// to the point on the ellipse at the given theta plus π/2 | |
const computeDpt = (theta: number) => | |
Math.sqrt( | |
Math.pow(rx * Math.sin(theta + offset), 2) + | |
Math.pow(ry * Math.cos(theta + offset), 2), |
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 pathlib | |
import subprocess | |
import re | |
VIDEO_TYPES = [ | |
'.mp4', | |
'.avi', | |
'.mkv', | |
'.mov', | |
'.webm', |
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 pygame | |
import random | |
class Node: | |
def __init__(self, x, y, air=0.0, wall=False): | |
self.x = x | |
self.y = y | |
self.air = air | |
self.wall = wall |
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 numpy as np | |
# Distance function | |
dist = lambda a, b: np.linalg.norm(a - b) | |
# Load word2vec data file (gl0ve) | |
w2v = {} | |
with open("glove/glove.6B.50d.txt", "r", encoding="utf-8") as w2v_file: | |
for word_enc in w2v_file: | |
word = word_enc[:word_enc.index(" ")] |
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
const demofile = require('demofile'); | |
const fs = require('fs'); | |
const _ = require('lodash'); | |
// Replace with your own demo files | |
const INFERNO_DEMOS = [ | |
'/Users/shoffing/inferno-demos/astralis-vs-liquid-inferno.dem', | |
'/Users/shoffing/inferno-demos/fnatic-vs-complexity-inferno.dem', | |
'/Users/shoffing/inferno-demos/g2-vs-cloud9-inferno.dem', | |
'/Users/shoffing/inferno-demos/g2-vs-mibr-inferno.dem', |
This file has been truncated, but you can view the full file.
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
{"attacks":[{"time":56.8203125,"attacker":{"pos":{"x":2595.98779296875,"y":-120.5957260131836,"z":84.03125},"team":"CT","name":"fer"},"victim":{"pos":{"x":1990.938232421875,"y":146.4513397216797,"z":173.1717071533203},"team":"T","name":"shox"},"amount":19,"weapon":"weapon_usp_silencer"},{"time":57.1796875,"attacker":{"pos":{"x":2595.98779296875,"y":-120.5957260131836,"z":84.03125},"team":"CT","name":"fer"},"victim":{"pos":{"x":1967.9163818359375,"y":175.4272918701172,"z":196.3261260986328},"team":"T","name":"shox"},"amount":15,"weapon":"weapon_usp_silencer"},{"time":57.890625,"attacker":{"pos":{"x":1986.9085693359375,"y":237.31130981445312,"z":160.03125},"team":"T","name":"shox"},"victim":{"pos":{"x":2590.4619140625,"y":-130.273681640625,"z":84.03125},"team":"CT","name":"fer"},"amount":95,"weapon":"weapon_glock"},{"time":60.6875,"attacker":{"pos":{"x":2541.727294921875,"y":-81.61331939697266,"z":84.03125},"team":"CT","name":"fer"},"victim":{"pos":{"x":2033.9188232421875,"y":112.19583129882812,"z":180.52557373 |
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
const fs = require('fs'); | |
const _ = require('lodash'); | |
const D3Node = require('d3-node'); | |
const ATTACKS_FILE = 'inferno.json'; | |
const DAMAGE_ALPHA_SCALE = 0.9; | |
const BORDER = 2048; | |
const data = JSON.parse(fs.readFileSync(ATTACKS_FILE)); | |
const attacks = data.attacks; |
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
const demofile = require('demofile'); | |
const fs = require('fs'); | |
const _ = require('lodash'); | |
const DEMO_FILE = 'astralis-vs-liquid-inferno.dem'; | |
let distance3 = (p1, p2) => { | |
return Math.sqrt( Math.pow(p2.x - p1.x, 2) + Math.pow(p2.y - p1.y, 2) + Math.pow(p2.z - p1.z, 2) ); | |
}; |
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
using System; | |
namespace System.Collections.Generic | |
{ | |
public static class MinMaxBy | |
{ | |
public static T MinBy<T>(this IEnumerable<T> list, Func<T, IComparable> selector) | |
{ | |
IComparable lowest = null; | |
T result = default(T); |
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
NUM SOLS PER GEN,% SELECTION,% CHILDREN,% RANDOM,MUTATION,CROSSOVER BUFFER,PRESERVE,AVERAGE T2S | |
10,0.2,0.8,-2.22E-16,0.05,0,0,0.023999989 | |
10,0.2,0.6,0.2,0.05,0.1,1,0.024999976 | |
10,0.2,0.7,0.1,0.05,0,0,0.024999976 | |
10,0.2,0.8,-2.22E-16,0.05,0.15,1,0.025250137 | |
10,0.3,0.6,0.1,0.05,0.15,2,0.0255 | |
15,0.2,0.8,-2.22E-16,0.05,0.05,2,0.025500059 | |
10,0.2,0.6,0.2,0.05,0.05,1,0.025749981 | |
10,0.2,0.7,0.1,0.05,0.1,0,0.025750041 | |
10,0.2,0.8,-2.22E-16,0.05,0.05,0,0.026250064 |
NewerOlder