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
#define USE_ROBIN_HOOD_HASH 1 | |
#define USE_SEPARATE_HASH_ARRAY 1 | |
template<class Key, class Value> | |
class hash_table | |
{ | |
static const int INITIAL_SIZE = 256; | |
static const int LOAD_FACTOR_PERCENT = 90; | |
struct elem |
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
// see http://d.hatena.ne.jp/ashigeru/20090113/1231855642 | |
var calc = { | |
add: function (node) { | |
return visit(this, node.l) + visit(this, node.r); | |
}, | |
sub: function (node) { | |
return visit(this, node.l) - visit(this, node.r); | |
}, | |
val: function (node) { |
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 | |
if ARGV.size < 2 | |
$stderr.puts 'usage: monitor <path> <command> [arg1 arg2 ...]' | |
exit 100 | |
end | |
PATH = ARGV[0] | |
COMMAND = ARGV[1] | |
ARGS = ARGV[2..-1] |