Skip to content

Instantly share code, notes, and snippets.

@Akiyah
Akiyah / README
Last active March 6, 2016 16:52
Raphaelで手描き風の線
参考
https://bramp.github.io/js-sequence-diagrams/
@Akiyah
Akiyah / jsdoit.css
Created January 25, 2014 12:04
2014-01-24 1st
* {
margin: 0;
padding: 0;
border: 0;
}
body {
background: #eee;
font: 30px sans-serif;
overflow: hidden;
@Akiyah
Akiyah / jsdoit.css
Created January 23, 2014 13:38
forked: 素数糸かけ曼荼羅
html {
height:100%;
}
body {
background: white;
width:100%;
height:100%;
overflow : hidden;
}
@Akiyah
Akiyah / jsdoit.css
Created January 19, 2014 16:10
素数糸かけ曼荼羅
body {
background: #ddf;
}
@Akiyah
Akiyah / gist:8488756
Last active January 3, 2016 16:19
スターバックスでトールサイズのタンブラーにショートサイズのホットコーヒーを入れてもらった記録をグラフにしてみた
data <- c(
404,468,449,435,421,438,432,453,400,425,486,410,401,
423,458,422,406,458,397,453,452,395,425,
361,466,368,460,363,509,414,439,
437,
385,442,406,402,371,429,402,453,389,413,412,481,
385,406,402,422,414,484
)
data <- data - 189 # タンブラーの重さを除く
@Akiyah
Akiyah / jsdoit.css
Created December 23, 2013 17:07
forked: 2013-10-07 1st
* {
margin: 0;
padding: 0;
border: 0;
}
body {
background: #ddf;
font: 30px sans-serif;
}
@Akiyah
Akiyah / jsdoit.css
Created December 8, 2013 16:16
forked: jQuery Sticker plugin
body {
background-color: #DDDDDD;
font: 30px sans-serif;
}
canvas {
border: solid thin black;
}
@Akiyah
Akiyah / マクドナルドのポテトSを10個食べて信頼区間を推定した
Created December 5, 2013 16:20
実践ハンバーガー統計学! マクドナルドのポテトSを10個食べて信頼区間を推定した #vgadvent2013
x <- c(53,46,55,53,61,58,40,56,49,42)
var(x) # 不偏分散
# => 47.56667
mean(x) # 平均
# => 51.3
std <- function(x) sd(x)/sqrt(length(x))
std(x) # 標本標準誤差
@Akiyah
Akiyah / gist:7172219
Created October 26, 2013 17:27
分散と不偏分散を調べる
x <- rnorm(mean=0,sd=1,n=10000)
mean(x) # 平均
sd(x) # 標準偏差
var(x) # 分散(varは実は不偏分散)
sum((x - mean(x)) ** 2) / (length(x) - 1) # varはこれと一致する
vx <- sum((x - mean(x)) ** 2) / length(x) # 母分散(不偏分散で無い方の分散)。varとほとんど同じ。
n <- 10 # サンプルサイズ
vy1s <- c()
@Akiyah
Akiyah / dau.r
Last active December 25, 2015 10:49
あるサービスのDAU(Daily Active Users)をHRForecastに登録するサンプル
# install.packages('httpRequest') # 未インストールの場合
require('httpRequest')
dau <- function(date) {
# 本当はデータベースなどから集計してDAUを出すが、ここではサンプルのため乱数にしている
value <- floor(runif(1) * 1000)
}
plot_dau <- function(date) {
value <- dau(date)