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
// based on http://msdn.microsoft.com/en-us/magazine/hh335067.aspx | |
// usage example at bottom | |
function pso (number_of_dimensions, function_to_optimize, number_of_particles, number_of_iterations, fitness_threshold, inertia_weight, cognitive_weight, social_weight) { | |
var particles = []; | |
var swarm_best_position = []; | |
var swarm_best_fitness = null; | |
for (var p = 0; p < number_of_particles; p++) { | |
particles.push({ | |
particle_position: [], |
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 cluster = require('cluster'); | |
if (cluster.isWorker) { | |
console.log('Worker ' + process.pid + ' has started.'); | |
// Send message to master process. | |
process.send({msgFromWorker: 'This is from worker ' + process.pid + '.'}) | |
// Receive messages from the master process. |
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
Driver Caps: | |
Driver: "omap3" | |
Card: "omap3/mt9v032//" | |
Bus: "" | |
Version: 0.0 | |
Capabilities: 04000001 | |
Camera Cropping: | |
Bounds: 752x480+0+0 | |
Default: 752x480+0+0 | |
Aspect: 1/1 |