Skip to content

Instantly share code, notes, and snippets.

@kai-koch
kai-koch / travellingRobot.js
Created December 14, 2012 01:46
This is one solution of the travelling robot problem from http://armelnene.blogspot.co.uk/2012/04/traveling-robot-problem.html Usage: Copy and paste into your browser's JavaScript console, after setting the desired values at the end of the script or use node.js to run the script. This solution sorts the distances a robot can walk by the km/(time…
/**
* @fileOverview This is one solution of the travelling robot problem from
* http://armelnene.blogspot.co.uk/2012/04/traveling-robot-problem.html
*
* Usage: Copy and paste into your browser's JavaScript console, after setting
* the desired values at the end of the script or use node.js to run the script.
*
* This solution sorts the distances a robot can walk by the
* km/(time + cooldown)-ratio descending.
* Higher ratios will be used first. If ratios are equal for some distances the
@kai-koch
kai-koch / Description
Created August 7, 2012 07:10
node-mysql@2.0.0-alpha3: PROTOCOL_ & PARSER_ errors
I get PROTOCOL_ and PARSER_ errors, when selecting from a table with raw messages from Twitter.
Depending on which query I execute, I get different results. In one node does not even exit.
The rows were inserted using connection.escape().
I am using Node.js 0.8.4 on WindowsXP.