This file contains hidden or 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
#!/usr/bin/env ruby | |
# aozora-picker.rb : 青空文庫収録作品のイントロ収集 | |
# by takehikom | |
# usage: | |
# ruby aozora-picker.rb | |
# ruby aozora-picker.rb wa | |
# ruby aozora-picker.rb /path/to/github/aozorabunko/index_pages/sakuhin_wa?.html | |
# see also: | |
# http://www.aozora.gr.jp/ |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# gf_build.rb - How to Build Trigonal Human Pyramids | |
# by takehikom | |
# see also: | |
# https://gist.github.com/takehiko/a32f51e2eabba4f821d8 | |
# http://d.hatena.ne.jp/takehikom/20151020/1445266800 | |
# usage: | |
# ruby gf_build.rb | |
# ruby gf_build.rb -p 11 |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# gfload_est.rb - Load Estimator of Trigonal Human Pyramids | |
# by takehikom | |
# see also: | |
# https://gist.github.com/takehiko/a32f51e2eabba4f821d8 | |
# http://d.hatena.ne.jp/takehikom/20151019/1445266799 | |
# usage: | |
# ruby gfload_est.rb | |
# ruby gfload_est.rb -p 7 -m 0 |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# gfload+.rb : Load Estimation of Trigonal Human Pyramids | |
# by takehikom | |
# see also: | |
# https://gist.github.com/takehiko/a32f51e2eabba4f821d8 | |
# http://d.hatena.ne.jp/takehikom/20151016/1444941800 | |
# http://d.hatena.ne.jp/takehikom/20151018/1445094000 | |
require_relative "gfload.rb" |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# gfload.rb : Load Calculator for Gymnastic Formation | |
# by takehikom | |
require 'optparse' | |
module GFLoad | |
module Helper | |
SEPARATOR = "." |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# kanatrie.rb : ローマ字の綴りをトライ木に(ヘボン式・訓令式・日本式に対応) | |
# by takehikom | |
# required: KAKASI, Graphviz | |
def create_romaji_kana_hash(option = {}) | |
if option[:label] | |
puts "==== #{option[:label]} ====" |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# n-win-m-match.rb : じゃんけんをm回やって,そのうちn回以上勝つ確率 | |
# by takehikom | |
require "rational" | |
class NWinMMatch | |
def initialize(opt = {}) | |
@choose = {} # 2項係数 |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# tatami.rb : A solver of tatami mat arrangement problem | |
# by takehikom | |
module Tatami | |
class Arranger | |
def initialize(w = 4, h = 4, opt = {}) | |
@width = w | |
@height = h |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# assocchecker.rb : associativity checker for well-known logical operations | |
# by takehikom | |
class AssociativityChecker | |
def initialize | |
end | |
def and(*param) |
This file contains hidden or 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
#!/usr/bin/env ruby | |
# isilx.rb : ISIL extractor | |
# by takehikom | |
# see also: http://www.ndl.go.jp/jp/aboutus/standards/opendataset.html | |
require 'rexml/document' | |
class IsilExtractor |