Skip to content

Instantly share code, notes, and snippets.

View henoc's full-sized avatar
:electron:
_:(´ཀ`」 ∠):

Tomohisa Osada henoc

:electron:
_:(´ཀ`」 ∠):
View GitHub Profile
@henoc
henoc / TypeClassTest.scala
Created September 26, 2017 14:08
ある型クラスを実装する任意クラスのインスタンス列が持てるやつ
import org.scalatest.FunSuite
import simulacrum.typeclass
import scala.language.higherKinds
class TypeClassTest extends FunSuite {
test("box!") {
@henoc
henoc / result.md
Created November 22, 2015 02:18
結果
x E(x)
10 3.5264
20 4.812
30 5.5511
40 6.0917
50 6.558
60 6.8769
70 7.2235
80 7.4595
@henoc
henoc / cw.py
Created November 22, 2015 02:15
最大連勝数の期待値
# モンテカルロ法で最大連勝数の期待値を出す
# x : 試合数
# p : 勝率
# n : モンテカルロを試行する回数
import random
def get_max_continuous_true(lst):
"Boolean List を受け取り, Trueの最大連続数を返す"
cnt = 0
max_cnt = 0