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
;; zone-pgm-rainbow | |
(defun decimal->hex (n) | |
(format "%02X" n)) | |
(defun hsv->rgb (h s v) | |
(let ((h (max 0 (min 360 h))) | |
(s (/ (max 0 (min 100 s)) 100.0)) | |
(v (/ (max 0 (min 100 v)) 100.0))) | |
(if (= 0 s) |
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
// Want to learn more about Immediately Invoked Function Expressions? Read | |
// this article first: | |
// | |
// http://benalman.com/news/2010/11/immediately-invoked-function-expression/ | |
// Parens are used to tell the parser that it's a function expression, | |
// not a function declaration. If you don't explicitly tell the parser to | |
// expect an expression, it will throw a SyntaxError exception because it | |
// sees a function declaration without a name specified. |
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 UTF8_ACCEPT = 0; | |
var UTF8D = [ | |
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |
0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, 0,0,0,0,0,0,0,0,0,0,0,0,0,0,0,0, | |
1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1, 9,9,9,9,9,9,9,9,9,9,9,9,9,9,9,9, | |
7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7, | |
8,8,2,2,2,2,2,2,2,2,2,2,2,2,2,2, 2,2,2,2,2,2,2,2,2,2,2,2,2,2,2,2, | |
10,3,3,3,3,3,3,3,3,3,3,3,3,4,3,3, 11,6,6,6,5,8,8,8,8,8,8,8,8,8,8,8, |
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
// | |
// Calculating prime factors in polynomial time using node.js process.prevTick() | |
// | |
// see: http://en.wikipedia.org/wiki/Prime_factor | |
// see: http://en.wikipedia.org/wiki/Novikov_self-consistency_principle | |
// | |
// Authors: | |
// http://jesusabdullah.net/ | |
// http://marak.com | |
// |
NewerOlder