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
" プラグインのロード | |
filetype off | |
call pathogen#runtime_append_all_bundles() | |
call pathogen#helptags() | |
set helpfile=$VIMRUNTIME/doc/help.txt | |
filetype plugin on | |
" 行番号を表示 | |
set number |
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
package msgpack; | |
import java.io.IOException; | |
import java.util.Collection; | |
import java.util.Set; | |
import javax.tools.DiagnosticCollector; | |
import javax.tools.JavaCompiler; | |
import javax.tools.JavaFileManager; | |
import javax.tools.JavaFileObject; |
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
class RowParser | |
PATTERN = /^\s*([0-9]+)(\s*)(.*)\(cr=(\d+) r=(\d+) w=(\d+) time=(\d+)/ | |
KEYS = [ :ROW, :INDENT, :OPERATION, :CR, :R, :W, :TIME ] | |
def parse(line) | |
tokens = line.scan(PATTERN)[0] | |
format(Hash[*([ KEYS, tokens ].transpose).flatten]) unless tokens.nil? | |
end |
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
package hobby; | |
/** | |
* 疑似 Option 型です。 | |
* | |
* @author monzou | |
* @param <T> 要素の型 | |
*/ | |
public interface Option<T> { |
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
/** | |
* | |
*/ | |
package sandbox.atomic; | |
import java.util.List; | |
import java.util.Set; | |
import java.util.concurrent.Callable; | |
import java.util.concurrent.CyclicBarrier; | |
import java.util.concurrent.ExecutorService; |
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
package sandbox.wait; | |
import java.util.concurrent.BrokenBarrierException; | |
import java.util.concurrent.ConcurrentMap; | |
import java.util.concurrent.CyclicBarrier; | |
import java.util.concurrent.ExecutionException; | |
import java.util.concurrent.ExecutorService; | |
import java.util.concurrent.Executors; | |
import java.util.concurrent.Future; |
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
package sandbox; | |
/** | |
* 与えられた数値を 2 倍にして返す関数です。 | |
* | |
* @author monzou | |
*/ | |
public enum DoubleFunction implements Function<Number, Number>, Predicate<Number> { | |
/** Integer 型を倍にする関数 */ |
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
class Parser | |
def initialize(text) | |
@tokens = text.scan(/\(|\)|[\w\.\*]+/) | |
end | |
def next_token | |
@tokens.shift | |
end |
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
class SimpleWriter | |
def write(text) | |
puts text | |
end | |
end | |
module TimeStampingWriter |
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
class VirtualAccountProxy | |
def initialize(&block) | |
@block = block | |
end | |
def deposit(amount) | |
return subject.deposit(amount) | |
end |