$ sudo install -o redis -g redis -d /var/lib/redis2
$ sudo cp -p /etc/redis/redis.conf /etc/redis/redis2.conf
/** | |
* Simple linear regression | |
* | |
* @param {Array.<number>} data | |
* @return {Function} | |
*/ | |
function regression(data) { | |
var sum_x = 0, sum_y = 0 | |
, sum_xy = 0, sum_xx = 0 | |
, count = 0 |
const path = require("path"); | |
const fs = require("fs"); | |
const TruffleCompile = require("truffle-compile"); | |
// Promisify truffle-compile | |
const truffleCompile = (...args) => | |
new Promise(resolve => TruffleCompile(...args, (_, data) => resolve(data))); | |
const compile = async filename => { | |
const sourcePath = path.join(__dirname, "../contracts", filename); |