http://ln.hixie.ch/?start=1037910467&count=1
http://ln.hixie.ch/?start=1137740632&count=1
| function getCodePoint(array) { | |
| /*----------------------------------------------------------------------------------------- | |
| [UCS-2 (UCS-4)] [bit pattern] [1st byte] [2nd byte] [3rd byte] [4th byte] | |
| U+ 0000.. U+007F 00000000-0xxxxxxx 0xxxxxxx | |
| U+ 0080.. U+07FF 00000xxx-xxyyyyyy 110xxxxx 10yyyyyy | |
| U+ 0800.. U+FFFF xxxxyyyy-yyzzzzzz 1110xxxx 10yyyyyy 10zzzzzz | |
| U+10000..U+1FFFFF 00000000-000wwwxx 11110www 10xxxxxx 10yyyyyy 10zzzzzz | |
| -xxxxyyyy-yyzzzzzzz | |
| ------------------------------------------------------------------------------------------*/ |
| /* | |
| * Fair License (Fair) | |
| * | |
| * Copyright (c) 2012, IWAMURO Motonori | |
| * | |
| * Usage of the works is permitted provided that this instrument is | |
| * retained with the works, so that any entity that uses the works is | |
| * notified of this instrument. | |
| * | |
| * DISCLAIMER: THE WORKS ARE WITHOUT WARRANTY. |
| // arcfour aka RC4 enc/decrypt function | |
| // see: http://en.wikipedia.org/wiki/RC4 | |
| arcfour = (function () { | |
| "use strict"; | |
| var swap = function (a, i, j) { | |
| var tmp = a[i]; | |
| a[i] = a[j]; | |
| a[j] = tmp; | |
| }; | |
| ;; This example shows how to create a single producer and multiple consumers. | |
| ;; Each consumer will receive the message. I'm not sure if internally it's handled in a round-robin manner, | |
| ;; but when queue does not listen for messages (e.q. it's processing them), it won't receive one. | |
| ;; | |
| ;; In order to run it, use: | |
| ;; | |
| ;; lein2 run --mode consumer | |
| ;; | |
| ;; And in other window: | |
| ;; |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright (C) 2011 Jed Schmidt <http://jed.is> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
| ;(function(ns) | |
| { | |
| var color = {}; | |
| color.reHexTest = /^\s*#[\da-fA-F]{1,6}\s*$/; | |
| color.reRgbTest = /^\s*rgb\s*\(\s*\d{1,3}\s*,\s*\d{1,3}\s*,\s*\d{1,3}\s*\)\s*$/i; | |
| color.reRgbExec = /^\s*rgb\s*\(\s*(\d{1,3})\s*,\s*(\d{1,3})\s*,\s*(\d{1,3})\s*\)\s*$/i; | |
| color.reHexExec = /^\s*#([\da-fA-F]{1,2})([\da-fA-F]{1,2})?([\da-fA-F]{1,2})?\s*$/; |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE | |
| Version 2, December 2004 | |
| Copyright* (C) 2011 Alex Kloss <alexthkloss@web.de> | |
| Everyone is permitted to copy and distribute verbatim or modified | |
| copies of this license document, and changing it is allowed as long | |
| as the name is changed. | |
| DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE |
| for (var i = 0; i < 1024 * 1024; i++) { | |
| process.nextTick(function () { Math.sqrt(i) } ) | |
| } |
Bekanntlich kann CPython Code nicht parallel in Betriebssystem-Threads ausführen. Es gibt den Global Interpreter Lock (GIL), der verhindert, dass dies passiert. Auf einem Computer mit mehr als einer CPU (dem Standard heutzutage), kämpfen alle paar Millisekunden die CPUs um den GIL, was dazu führt, dass die Laufzeit von CPython in diesem Fall deutlich schlechter als das theoretische Maximum ist.
Dieses Python-Programm braucht auf meinem Rechner etwa 9,5s:
def count_down(n):
while n > 0:
n -= 1