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
/* Crowd Complete :: a NodeJS Snippit for Ranked Crowd Sourced Auto Complete (Auto Complete Artificial Neural Network) | |
Usage: | |
Requires a running mongo database (db_url) | |
No solutions exist until you build them over time by 'feeding' the database with /fb. | |
/ac?e=getAutocompleteSolutionsFromAcDatabase | |
/fb?e=thisTextIsACompleteUserEntryThatIsBeingFedBackToTheAcDatabase | |
What is this? | |
TL;DR - Google's magic autocomplete bar. |
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
var fs = require("fs"); | |
var db_url = 'lettheghostsin'; | |
var db = require('mongojs').connect(db_url, ['wisdom']); | |
var http = require('http'); | |
var url = require('url'); | |
var html_header = '<!doctype html><html><head><meta charset="UTF-8"><title>Let the Ghosts in</title><link href="http://fonts.googleapis.com/css?family=Abel" rel="stylesheet" type="text/css"><style rel="stylesheet" type="text/css">html {margin: 0; padding: 0 10%;}body {font-family: "Abel", Helvetica, sans-serif; font-size: 18px; text-align: center; background-color: #0B0B0B; color: #FFF;}header {margin-top: 5em;}form { border-bottom: 1px solid #999; padding-bottom: 2em;}input { width: 80%; margin: 3em auto 1em; font-size: 1.2em; padding: 0.5em; display: block; }button {width: 40%; padding: 0.5em; background-color: #575757; border: none; color: #fff; font-size: 1.2em; cursor: pointer; }button:hover { background-color: #969696;}.result { width: 63%; margin: 1em auto; padding: 0.5em 40px; border: 2px solid #262626; border-rad |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.Threading; | |
using System.IO; | |
using System.Reflection; | |
using System.CodeDom; | |
using System.CodeDom.Compiler; |
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
<html> | |
<div align = 'center'> | |
<canvas | |
id = 'c' | |
width = '800' | |
height = '600' | |
style = 'border:1px solid #000000;'> | |
</canvas> | |
<script> |
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
// ygg - OCR solver (swarm friendly, requires mongodb c# driver, and mongod running at the IP specified) | |
// ~(3/96)% wrong at 30k genes in roughly 24 single core (2.2ghz) compute hours | |
// [email protected] | |
// using a cluster at head methodology to control the swarm, read 100 - gen 100 - sync all | |
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.IO; |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
namespace YOUR_NAMESPACE_HERE_BRO | |
{ | |
static class Ease | |
{ | |
public static float LINEAR(float CurrentStep, float TotalSteps, float StartValue, float ValueChange) |
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
// Create a pool: | |
// SoundPool explosion = new SoundPool(Content, "explosion"); - uses explosion.wav from the content folder | |
// Play back the sound: | |
// explosion.Play(); | |
// Play back the sound with some funk: | |
// explosion.Play(Volume: 1.0f, Pan: 0.0f, Pitch 0.0f); | |
// | |
// If you're worried about performance, I promise this is the fastest and cleanest way. | |
// You may run into issues if you try to spam too many sounds on the wrong devices, from MSOFT: | |
// |
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
using System; | |
using System.Collections.Generic; | |
using System.Linq; | |
using System.Text; | |
using System.Threading.Tasks; | |
using System.IO; | |
using System.Threading; | |
using System.Drawing; | |
namespace tsp |
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
/* Output: | |
node test.js | |
Testing: always_pass...passed | |
Testing: always_fail...failed | |
Testing: include_meaningful_results...failed | |
3 Tests Completed! Passed: 1 Failed: 2 | |
Failed Test Output: | |
{"test":"always_fail","passed":false} | |
{"test":"include_meaningful_results","passed":false,"meaningful_data":"This results object will display as a JSON string if this test fails"} | |
*/ |
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
function ngram(string) | |
{ | |
string = string.toString().toLowerCase(); | |
var valid = 'abcdefghijklmnopqrstuvwxyz '; for(var s = 0; s < string.length; s++) if(valid.indexOf(string[s]) == -1) { string = string.slice(0, s) + string.slice(s + 1); s--; } | |
string = string.split(' '); | |
var ngrams = []; | |
var to_gram = ngram_mash(string); | |
to_gram.push(string); | |
for(var g = 0; g < to_gram.length; g++) | |
{ |
OlderNewer