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
rem this is a generic media player | |
rem this prog was made by jordan earls | |
starty: | |
print "type 1 to choose where media is" | |
print "type 2 to pause music" | |
print "type 3 to resume music" | |
print "type 4 to reload music" | |
print "type 5 to change volume" | |
print "type 6 to change speed" | |
start: |
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
""" | |
Taken from my suggestion at: | |
https://groups.google.com/forum/#!msg/tweepy/OSGRxOmkzL4/yaNT9fL9FAIJ | |
Note that this is an incomplete snippet; you'll need to create the API auth object. | |
""" | |
import simplejson as json | |
import tweepy |
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
require 'celluloid' | |
WORKERS_COUNT = (ARGV[0] || 1).to_i | |
class Output | |
include Celluloid | |
def puts(msg) | |
Kernel.puts(msg) | |
end |
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
Latency Comparison Numbers (~2012) | |
---------------------------------- | |
L1 cache reference 0.5 ns | |
Branch mispredict 5 ns | |
L2 cache reference 7 ns 14x L1 cache | |
Mutex lock/unlock 25 ns | |
Main memory reference 100 ns 20x L2 cache, 200x L1 cache | |
Compress 1K bytes with Zippy 3,000 ns 3 us | |
Send 1K bytes over 1 Gbps network 10,000 ns 10 us | |
Read 4K randomly from SSD* 150,000 ns 150 us ~1GB/sec SSD |
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
// derived from http://en.wikipedia.org/wiki/Algorithms_for_calculating_variance#Parallel_algorithm | |
function map() { | |
emit(1, // Or put a GROUP BY key here | |
{sum: this.value, // the field you want stats for | |
min: this.value, | |
max: this.value, | |
count:1, | |
diff: 0, // M2,n: sum((val-mean)^2) | |
}); |
NewerOlder