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 { WholeHistoryRating } = require('whr') | |
const AllData = require("./alldata") | |
const whr = new WholeHistoryRating({w2: 4}); | |
const firstDate = new Date(1953, 9, 19); | |
const names = {}; | |
const beginTime = new Date(); | |
console.error(`${AllData.length} records`); | |
AllData.forEach((e, i) => { | |
const dateArr = e.date.split('-').map(e=>parseInt(e)); |
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 math | |
import argparse | |
def calc_win_rate(a,b): | |
return (1.0 / (math.pow(10,(a-b) / -400) + 1)) | |
def calc_win_rate_final(a,b): | |
p = calc_win_rate(a,b) | |
return p * p * p + 3 * p * p * (1-p) |
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
{ | |
"company_name": "company_name", | |
"modified_at": "YYYY-MM-DDThh:mm:ss+09:00", | |
"project": { | |
"name": "project_name", | |
"id": "", | |
"members": [ | |
"name1", | |
"name2", | |
], |
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
/* | |
* ゲーム内の方向を表すコードの一部 | |
*/ | |
enum Direction { | |
kRight, | |
kUp, | |
kLeft, | |
kDown, | |
kDirectionCount |
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
#include<algorithm> | |
#include<iostream> | |
#include<cstdio> | |
#include<vector> | |
using namespace std; | |
int main(){ | |
vector<int>kazu; | |
vector<int>kouhan; | |
int end=0; |
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
#include <cstdio> | |
using namespace std; | |
int main(){ | |
printf("n e\n"); | |
printf("- -----------\n"); | |
printf("0 1.000000000\n"); | |
printf("1 2.000000000\n"); | |
printf("2 2.500000000\n"); |
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
cards = [[1,2,3,4],[1,5,6,7],[1,8,9,10],[1,11,12,13],[2,5,8,11],[2,6,9,12],[2,7,10,13],[3,5,9,13],[3,6,10,11],[3,7,8,12],[4,5,10,12],[4,6,8,13],[4,7,9,11]] | |
num = [1..13].map((a) -> [a,Math.random()]).sort((a,b) -> a[1]-b[1]).map((a) -> a[0]) | |
cards[index] = card.map((a) -> num[a-1]).map((a) -> [a,Math.random()]).sort((a,b) -> a[1]-b[1]).map((a) -> a[0]) for card,index in cards | |
cards = cards.map((a) -> [a,Math.random()]).sort((a,b) -> a[1]-b[1]).map((a) -> a[0]) | |
console.log card for card in cards |
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
problem = "For theNumber in 0 to 100, if theNumber is divisible by 3 and theNumber is divisible by 5 then print 'FizzBuzz' else if theNumber is divisible by 3 then print 'Fizz' else if theNumber is divisible by 5 then print 'Buzz' else print theNumber."; | |
eval(problem.replace(/\./g,'').replace(/For (.*) in (\d+) to (\d+),/g,'for($1=$2;$1<=$3;$1++)').replace(/if (.+?) then/g,'if ($1)').replace(/print ([\w']+)/g,'console.log($1);').replace(/and/g,'&&').replace(/is divisible by (\d+)/g,'%$1==0')); | |