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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Drawing; | |
namespace CalCal | |
{ | |
class Program |
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
<html> | |
<head> | |
<title>Tic Tac Toe</title> | |
<style> | |
body { | |
text-align: center; | |
-webkit-user-select: none; | |
-moz-user-select: none; | |
-ms-user-select: none; | |
} |
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
ffmpeg -framerate 10 -i ./img/%06d.png -s:v 1280x720 -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p ./ani.mp4 |
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
<html> | |
<body> | |
Max Iterations: <input id="max_iterations" type="text" value="1500"><br> | |
Max Shapes: <input id="max_shapes" type="text" value="100"><br> | |
Annealing Rate: <input id="annealing_rate" type="text" value="0.999"><br> | |
Starting Temperature: <input id="starting_temperature" type="text" value="0.04"><br> | |
<input id="input" type="file" onchange="return load_image();"><br> | |
<canvas id="original"></canvas> | |
<canvas id="rendered"></canvas><br> | |
<span id="status"></span> |
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
var stats = { | |
q: 0, | |
count: 0, | |
min: Infinity, | |
max: -Infinity, | |
sum: 0, | |
mean: 0 | |
}; | |
var variance = stats.q / stats.count; |
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
function mse (errors) { | |
var sum = 0; | |
for (var i = 0; i < errors.length; i++) { | |
sum += Math.pow(errors[i], 2); | |
} | |
return sum / errors.length; | |
}; | |
function zero_array (size) { | |
var ary = []; |
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
var fs = require('fs'); | |
var rl = require('readline'); | |
function read_train (cb) { | |
var train_inputs = []; | |
var train_outputs = []; | |
var headers_read = false; | |
var file = rl.createInterface({input: fs.createReadStream('./train.csv')}); | |
file.on('line', function (line) { | |
if (!headers_read) { |
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
// my suggested pattern | |
tradeOffers.getOffers(getOffersOpts, function (err, offers) { | |
if (err) { | |
return console.error(err); | |
} | |
console.log('Offers:', offers); | |
}); | |
// the original |
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
function tablelength(T) | |
local count = 0 | |
for _ in pairs(T) do | |
count = count + 1 | |
end | |
return count | |
end | |
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
var request = require('request'); | |
var sqlite3 = require('sqlite3').verbose(); | |
var db = new sqlite3.Database('fx.db'); | |
var heartbeat = 10000; | |
function parse_quote (str) { | |
var quote = []; | |
var lines = str.split('\n'); | |
for (var line_idx = 0; line_idx < lines.length; line_idx++) { | |
var line = lines[line_idx]; |