ビット演算を使うと集合の判定が簡単にできる。 ただしjavascriptにおいて型サイズがint32に変換されているためそれを超える場合には使えない(0-31まで)。
const JOB = Object.freeze({
NONE : 0,
FIGHTER : 1,
MAGE : 2,
どんなウォレットを作るか定義する | |
<hdwallet> | |
<enum name="coin_type"> | |
<const name="bitcoin" value="0" /> | |
<const name="testnet" value="1" /> | |
<const name="litecoin" value="2" /> | |
</enum> | |
<enum name="change_type"> | |
<const name="external" value="0" /> |
'use strict' | |
const pipe_initialize = (ctx) => { | |
process.stdin.resume(); | |
process.stdin.setEncoding('utf8'); | |
process.stdin.on('data', function(chunk){ | |
if (chunk == "") { return ;} | |
var lines = chunk.split("\n"); | |
lines[0] = ctx.fragment + lines[0]; | |
ctx.fragment = lines.pop(); |
yum -y install dsniff | |
tcpkill -i eth0 -9 port 50185 | |
FROM centos:7 | |
RUN curl -sL https://rpm.nodesource.com/setup_4.x | bash - | |
RUN yum install -y nodejs gcc-c++ make |
var InsightRestClient = require('insight-cli').RestClient; | |
var task = require('promise-util-task'); | |
var checkTXConfirmState = function(insight, confirmation_count, txid){ | |
var reqtime = new Date() / 1000 | 0; | |
return insight.transaction(txid).then(function(tx){ | |
var state = (tx.confirmations >= confirmation_count) ? 'CONFIRM' : 'UNCONFIRM'; | |
return [tx.txid, tx.time, tx.confirmations, state] | |
}).catch(function(e){ | |
switch(e.statusCode){ |
var x = function(){ | |
try{ | |
for(var i=0;i<100;++i){} | |
}catch(e){ | |
} | |
} | |
var x2 = function(){ | |
for(var i=0;i<100;++i){} | |
} |