レトリバという会社に転職しました。転職したばかりなのでまだ何してるって上手く言えない。> <
今のところ、Kubernetesとか弄って環境つくったりしています。
新しいプロジェクトでElixer使いそうな予感
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
<!DOCTYPE html> | |
<html lang="ja"> | |
<head> | |
<meta charset="utf-8"/> | |
<title>FizzBuzz</title> | |
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js"></script> | |
<link href='http://fonts.googleapis.com/css?family=Peralta' rel='stylesheet' type='text/css'> | |
<style> | |
body { | |
background-color: #000; |
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
なまえ: よう | |
しょくぎょう: ぷろぐらま | |
Rails: つぼみ | |
Git: つぼみ |
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
# 「プログラマの数学」(結城 浩) P76 恋人探しをプログラムで求める | |
# | |
# 読書会で書いたやつを捨てるのもったいないので貼っとく | |
# | |
graph = {a: [:b, :e, :d], b: [:a, :c, :f], c: [:b, :d, :g], d: [:a, :c, :h], | |
e: [:f, :h, :a], f: [:e, :g, :b], g: [:f, :h, :c], h: [:e, :g, :d]} | |
c = {a: 0, b: 0, c: 0, d: 0, e: 0, f: 0, g: 1, h: 0} | |
12.times do |i| | |
cc = {a:0, b:0, c:0, d:0, e:0, f:0, g:0, h:0} |
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
class LlnocCipherParser | |
rule | |
addr : period_sep | |
{ | |
return 3 unless val[0].length == 4 | |
val[0].each do |v| | |
return 3 unless v[0] == :DEC | |
return 3 if v[1][0] == '0' | |
return 3 unless (0..255).include?(v[1].to_i) | |
end |
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 'sinatra' | |
set :port, 8000 | |
post '/mml' do | |
File.open('mml.txt', "w") do |f| | |
f.write("#mml\n"); | |
f.write(params[:mml]); | |
end | |
params[:mml] |
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
# Benchmark for compare Kernel#proc vs block argument (and vs using yield) | |
require 'benchmark' | |
def receiver | |
yield | |
end | |
def send_using_proc | |
receiver &proc if block_given? |
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
eval$s=%w( | |
s=%(eval$s=%w(#{$s})*""); | |
d = | |
"BAhbJCIfAAAAAAAAPwAAAAAAAAAAAAAAAAAHwAAAAfAiHwf/wAAAAD8AAAAAAABQB+AfwAAAD8AAAAPwIh8H//AAAAA/AAAAAAAB8AfgP4AAAA/AAAAD8CIfB//4AAAAPwAAAAAAA/AH4P8AAAAPwAAAA/AiHwf//AAAACoAAAAAAAPwD+H+AAAACgAAAAHAIh8P6/wAAAAAAAAAAAAD8A/D+AAAAAAAAAAAACIfD8D8AP4AfgB/AAH+H/+Px/AB/4AfgD4/B+AiHw/A/AP/gH4B/8AH/x//j8/gB//gH4D/vwfgIh8PwPwP/8B+B//gH/+f/4//wAf/8B8B//4H4CIfD8H4H//gfA//8D//P/8f/4AH7/AfA//+B8AiHx+D+D+H4Pwfg/B/gwfgH/4ABAPwHwfx/g/AIh8f//A/A+B8H4HwfgAH4B/+AAAB+D8P4P4HwCIfH//AfgPw/D8B+PwAB8Af+AAB//A/D8D+D8AiHx//gH//4Pw///D8AA/AH/4AB//4Pw/AfA/AIh8f/8D//+D4f//w/AAPwB/+AB//8D4PgHwPgCIfP4/g///g+H//8fgAD8A/fwAfx/A+H4D8D4AiHz8H4P5qofh/mpH4AA/APz+APwPwfh+A/B+AIh8/A/B8AAH4fgAB+AAPgD8fwD4D8H4fgPwfgCIfPwPw/ABB+H4AAfwAD4B/D+B+B/B+H4H8HwAiH38D8H4BgfB/AeD+BB/APwfwPw/gfA/j+B+AIh9+Afh//4HwP//A//wP/H4D8D//4HwP//gfACIffgH4P/+D8B//wH/8D/x+A/g//+D8D//4PwAiH34B+B//g/AP/8A/+A/8fgH8H/fg/Af9+D8AIh9+AfgH/APwA/4AD/AD+H4A/geHwPwB8fA/ACIfAAAAAAAD4AAAAAAAAAAAAAAAAAAAAAPwAAAiHwAAAAAAB+AAAAAAAAAAAAAAAAAAAAAD8AAA |
名前 | カテゴリ | 説明 |
---|---|---|
nop | nop | nop |
getlocal | variable | level, idx で指定されたローカル変数の値をスタックに置く。 |
setlocal | variable | level, idx で指定されたローカル変数の値を val にする。 |
getblockparam | variable | ブロックパラメータを取得する。 |
setblockparam | variable | ブロックパラメータを設定する。 |
getspecial | variable | 特殊なローカル変数($~, $_, ...)の値を得る。 |
setspecial | variable | 特別なローカル変数($~, $_, ...)の値を設定する。 |
getinstancevariable | variable | self のインスタンス変数 id の値を得る。 |
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
class CkySolver | |
def initialize(&init_proc) | |
@init_proc = init_proc | |
end | |
def solve(n, &callback) | |
a = Array.new(n * n) | |
n.times {|i| a[i*n + i] = @init_proc.call(i) } | |
(n - 1).times do |d| |
OlderNewer