$ git checkout master
$ for i in {01..10}; do rm -rf ~/.cache/crystal; make clean_crystal crystal stats=1 |& tee master.$i.log; done
$ git checkout fix/recursive-eq-hash
$ for i in {01..10}; do rm -rf ~/.cache/crystal; make clean_crystal crystal stats=1 |& tee recursive.$i.log; done
$ for i in {01..10}; do ruby sum.rb master.$i.log; done | awk '{printf " %02d : %s\n", NR, $1; sum += $1} END {print "AVG :", sum / NR}'
01 : 43.229543131
02 : 43.938624582
03 : 44.16255789
04 : 44.859225665000004
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
function q(s){p= | |
/\/\*([^]+)(@@ |\*\/)/;//@@@ | |
return(s+'@#@#'). match(p)[1].replace(/ |\s+/g,[''][+0]). | |
replace(/\x24/g,'\x20');}eval(s=q(function(){/*s="function$q(s){p=/ | |
\\/\\*([^]+)(@@|\\*\\/)/;//@@@return(s+'@#@#').match(p)[1].replace( | |
/|\\s+/g,[''][+0]).replace(/\\x24/g,'\\x20');}eval(s=q(function(){/ | |
\*"+s.replace(/$/g,'\x24')+"*\/}))";s="x8z0e8|wez04d|wh7l5h|wz0w|wz | |
0w|wz0w|wz0w|wz0v|wz0x|uz0z02|sz0z06|rz0z08|qz0z0a|qiz09i|qfz0ff|q | |
ez0id|qbb4t59b|qb98q79a|r9a8p989|s8a8p989|5w98q79q|05o8b4t59cfb|9k18 | |
r3q93h|36n7r1r8l7|21u8m151m8|z9k5l8|z03az03a|z07ifh|o222iz02|q7lp|u312gu |
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
// http://math.andrej.com/2007/09/28/seemingly-impossible-functional-programs/ | |
package codes.quine.labo | |
package object cantor { | |
type Bit = Boolean | |
val Zero = false | |
val One = true |
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
extern crate image; | |
extern crate itertools_num; | |
use std::ops::{Add, AddAssign, Div, Mul, Sub}; | |
use image::{ImageBuffer, Rgb, RgbImage}; | |
use itertools_num::linspace; | |
static WIDTH: u32 = 1280; | |
static HEIGHT: u32 = 720; |
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
require "benchmark" | |
struct Int | |
DIGITS = | |
"0001020304050607080910111213141516171819" \ | |
"2021222324252627282930313233343536373839" \ | |
"4041424344454647484950515253545556575859" \ | |
"6061626364656667686970717273747576777879" \ | |
"8081828384858687888990919293949596979899" |
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 scala.reflect.runtime.universe.reify | |
object scope { | |
class Int | |
sealed trait List[A] | |
class Nil[A] extends List[A] | |
class Cons[A] extends List[A] | |
class Tree[A] |
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
object catsStateT { | |
import cats._, data._, implicits._ | |
val fa = StateT[Option, Boolean, Boolean] { | |
case true => None | |
case false => Some((true, false)) | |
} | |
val ff = StateT[Option, Boolean, Boolean => Boolean] { | |
case true => Some((true, x => !x)) |
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
object scope { | |
// int | |
class I | |
// list | |
sealed trait L[A] | |
class N[A] extends L[A] | |
class C[A] extends L[A] | |
// tree |
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
object scope { | |
// int | |
class I | |
// list | |
sealed trait L[A] | |
class N[A] extends L[A] | |
class C[A] extends L[A] | |
// tree |
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
def solve | |
hs = [ | |
[5, 3, 1, 2, 4], | |
[2, 5, 1, 4, 3], | |
[0, 0, 0, 0, 0], | |
] | |
queue = [[]] | |
checks = {} | |
checks[hs.map{|h| h.join(',')}.join('|')] = true |