Skip to content

Instantly share code, notes, and snippets.

水越明哉 Akiyah

Block or report user

Report or block Akiyah

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
@Akiyah
Akiyah / function_dsl.r
Last active Oct 26, 2019
slime_equation_edit
View function_dsl.r
# plus
"%+%" <- function(f, g) {
return(paste0("(", f, ") * (", g,")"))
}
# minus
m <- function(f) {
paste0( "-(", f, ")" )
}
@Akiyah
Akiyah / result.txt
Last active May 4, 2019
Solver of RubyKaigi 2019 Cookpad Daily Ruby Puzzles
View result.txt
Example
2019-05-04 02:31:22 +0900
...........................
-----
def foo
"Hello world" if%
false
end
puts foo
View benchmark_-_difference.rb
require 'benchmark'
M = 1000
Benchmark.bm 30 do |r|
[1, 10, 100, 1000].each do |n|
a = (0...(n*100)).to_a
b0 = ((0*n)...(1*n)).to_a
b1 = ((1*n)...(2*n)).to_a
b2 = ((2*n)...(3*n)).to_a
View tensegrity.r
outer_product <- function (a, b) {
c(a[2]*b[3] - a[3]*b[2], a[3]*b[1] - a[1]*b[3], a[1]*b[2] - a[2]*b[1])
}
d <- function(t) {
s <- t/sqrt(3)
h <- sqrt(1 - ((1 + sqrt(3)/2)^2 + (1/2)^2)*s^2)
A <- c(s, 0, 0)
B <- c(-1/2*s, sqrt(3)/2*s, 0)
View tensegrity.r
outer_product <- function (a, b) {
c(a[2]*b[3] - a[3]*b[2], a[3]*b[1] - a[1]*b[3], a[1]*b[2] - a[2]*b[1])
}
d <- function(t) {
s <- t/sqrt(3)
h <- sqrt(1 - ((1 + sqrt(3)/2)^2 + (1/2)^2)*s^2)
A <- c(s, 0, 0)
B <- c(-1/2*s, sqrt(3)/2*s, 0)
View mario_prime_number.r
library(gmp)
library(gtools)
MARIO <- paste0(
" ...",
" ***** ...",
" *********..",
" @@@..@. @@@",
" @.@...@...@@",
" @.@@...@...@",
@Akiyah
Akiyah / README
Last active Nov 19, 2016
Oimo.jsとThree.jsでマウスドラッグ
View README
WebGL必要です
@Akiyah
Akiyah / README
Last active Mar 6, 2016
Raphaelで手描き風の線
View README
参考
https://bramp.github.io/js-sequence-diagrams/
View 12digit_primenumber.r
# http://r-statistics-fan.hatenablog.com/entry/2014/09/22/210455
is.sosu <- function(x){ #素数判定の自作関数作成。(2は判定できない)
sum(x %% 2:sqrt(x) == 0) == 0
}
NUMS <- c(1,3,7,9)
result <- list()
@Akiyah
Akiyah / README
Last active Sep 7, 2015
とけたら天才!分裂する●を追い出せ!
View README
●をクリックすると消えて右と下に分裂する。
左上6マスの白いブロックから●を追い出せ。
参考
バナッハ‐タルスキの密室: 『数学者シャーロック・ホームズ』増補・改題
http://www.amazon.co.jp/dp/4535787409
You can’t perform that action at this time.