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
import {promises as fs} from 'fs'; | |
import * as tf from '@tensorflow/tfjs-node'; | |
const BEHIND_LEN = 10; | |
const NUM_EPOCHS = 20; | |
const MODEL_SAVE_DIR_URL = 'file://./model'; | |
// 予測の入力文字列をTensorにする | |
function makeTensorForPrediction(str) { | |
// U+0001-U+007F以外の入力は不可 |
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
-1 = CURLOPT_SAFE_UPLOAD | |
3 = CURLOPT_PORT | |
13 = CURLOPT_TIMEOUT | |
14 = CURLOPT_INFILESIZE | |
19 = CURLOPT_LOW_SPEED_LIMIT | |
20 = CURLOPT_LOW_SPEED_TIME | |
21 = CURLOPT_RESUME_FROM | |
27 = CURLOPT_CRLF | |
32 = CURLOPT_SSLVERSION | |
33 = CURLOPT_TIMECONDITION |
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
<?php | |
function myEncrypt($plain, string $purpose, bool $serialize=false) { | |
$plain = base64_encode($serialize ? serialize($plain) : $plain); | |
$purpose = hash_hmac('sha256', $purpose, config('app.key')); | |
$data = json_encode(compact('purpose', 'plain', 'serialize')); | |
return encrypt($data, false); | |
} | |
function myDecrypt(string $encrypted, string $purpose, bool $serialize=false) { |
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 | |
# Dummy identify, mogrify (bash script) | |
# ・Limit number of IM processes by file lock | |
# ・Limit IM's memory and CPU usage by nested cgroup | |
echo 0 > /proc/self/oom_score_adj | |
readonly MAX_PROC=3 | |
readonly MAX_MEM="256M" |