Navigation Menu

Skip to content

Instantly share code, notes, and snippets.

View adrianseeley's full-sized avatar

Adrian Seeley adrianseeley

View GitHub Profile
@adrianseeley
adrianseeley / calendar.cs
Created July 21, 2017 02:42
calendar.cs
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Drawing;
namespace CalCal
{
class Program
<html>
<head>
<title>Tic Tac Toe</title>
<style>
body {
text-align: center;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
}
ffmpeg -framerate 10 -i ./img/%06d.png -s:v 1280x720 -c:v libx264 -profile:v high -crf 20 -pix_fmt yuv420p ./ani.mp4
@adrianseeley
adrianseeley / dwight.html
Created December 13, 2016 22:17
image GA
<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>
@adrianseeley
adrianseeley / incr.js
Created September 16, 2016 18:21
Incremental stats
var stats = {
q: 0,
count: 0,
min: Infinity,
max: -Infinity,
sum: 0,
mean: 0
};
var variance = stats.q / stats.count;
@adrianseeley
adrianseeley / app.js
Last active November 9, 2017 06:43
Neural Network with Backpropagation, Bootstrapping and Bagging (Uses MSE)
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 = [];
@adrianseeley
adrianseeley / rf.js
Last active October 21, 2015 01:32
Mighty RF
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) {
@adrianseeley
adrianseeley / .js
Created July 30, 2015 20:21
sample
// my suggested pattern
tradeOffers.getOffers(getOffersOpts, function (err, offers) {
if (err) {
return console.error(err);
}
console.log('Offers:', offers);
});
// the original
@adrianseeley
adrianseeley / reforce1.lua
Created May 16, 2015 14:15
Reforce 1, mario laps, exponentially slower to cover new ground
function tablelength(T)
local count = 0
for _ in pairs(T) do
count = count + 1
end
return count
end
@adrianseeley
adrianseeley / pippy.js
Created May 4, 2015 12:25
Pippy.js: Quote Tracker (NodeJS + SQLite3 + Forex)
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];