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
MAX_VAL = 101 | |
REP_CNT = 10**6 | |
sum = 0.0 | |
prng = Random.new(Random.new_seed) | |
(0...REP_CNT).each{|idx| | |
p sum = (sum*idx + prng.rand(MAX_VAL))/(idx+1) | |
} |
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
</body> | |
</article> | |
</html> | |
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
curl -s "https://ip-ranges.amazonaws.com/ip-ranges.json" |jq -r '.prefixes | map(select(.service == "CLOUDFRONT").ip_prefix) | "set_real_ip_from" + " " + .[] + ";"' |
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 'google/apis/vision_v1' | |
class GcvApi | |
def initialize api_key, option={} | |
default = { | |
retry: 5, | |
max_results: 2048, | |
language_hints: 'ja' | |
} | |
@option = default.merge option |
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
const Document = require('./document') | |
const fs = require('fs') | |
const TOKEN_DIR = './tokens' | |
const DOC_DIR = './docs' | |
const DOC_DATA = './docs.json' | |
const docFiles = fs.readdirSync(DOC_DIR).filter(fileName => fileName.match(/.+\.txt$/)) | |
const docs = {} |
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
#!/bin/sh | |
pid_files=("$@") | |
correct_pids=() | |
if [ ${#pid_files[@]} -le 0 ]; then | |
echo "Usage: ./shoryuken_process_clean.sh PID_FILE..." | |
exit 1 | |
fi |