This choropleth encodes unemployment rates from 2008 with a quantize scale ranging from 0 to 15%. A threshold scale is a useful alternative for coloring arbitrary ranges.
This file contains hidden or 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
from __future__ import print_function | |
def run(x): | |
a = [1 for i in xrange(10)] | |
b = None | |
for i in xrange(x - 1): | |
b = [0 for i in xrange(10)] | |
s = sum(a) | |
This file contains hidden or 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
lcl% make | |
./sanitycheck | |
./benchmark | |
#RESULT 10995.858398 | |
fab perform_run:LOCK_TYPE,WORKERS | |
LOCK_TYPE WORKERS VALUE MACHINE | |
----------------------------------------------------- | |
0 1 15,047.32 sh --- | |
0 1 40,903.68 as ---------- |
This file contains hidden or 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
tweets = FlatFile("all_tweets.json") | |
@task(parallel=True) | |
def process(): | |
word_counts = Counters() | |
for tweet in tweets: | |
words = tweet["text"].split() | |
for word in words: |
This file contains hidden or 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
import datetime | |
for image in tiny_image_dataset: | |
image.parse("{image:rgb16x16}") # not line delimited | |
for line in massive_csv_file: | |
line.parse("{x},{y},{z}", skip_first = True) | |
for tweet in twitter_json_dataset: | |
tweet.parse("{tweet:json}") |
This file contains hidden or 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
import byteplay | |
class Iterator(object): | |
def __init__(self, internal): | |
self.internal = internal | |
def iter(self, callback): | |
for i in self.internal: | |
callback(i) |
This file contains hidden or 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
$ cary-cluster add cluster ssh://user@head-node/my-big-cluster.clust | |
$ cary-cluster status | |
symbolize_article: not running | |
generate_adjacencies: not running | |
$ cary-cluster execute | |
compute job started... | |
$ cary-cluster status | |
symbolize_article: running, 0.5232 Mbps -> 0.12 Mbps; 2h 21m remaining | |
generate_adjacencies: blocked | |
$ cary-cluster info |
This file contains hidden or 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
/* | |
* Sample input: | |
* | |
* 1.0 2.0 | |
* 2.0 3.0 | |
* | |
* Sample output: | |
* | |
* Maximum number of jobs: 2 | |
* Maximum wait time: 1.000000 |
This file contains hidden or 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
/* | |
* turtle2ps.c | |
* | |
* I know how structs work- it just seemed simler | |
* to use recursion in this example: | |
* | |
* typedef struct MyStack { | |
* double x, y, t; | |
* struct MyStack * previous; | |
* } MyStack_T; |
This file contains hidden or 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
$ ./processor statistics | |
# Global Counters | |
max_articles: 16777216 | |
total_articles: 13057082 (77.8%) | |
w/title: 13057082 (100.0%) | |
w/id: 13057082 (100.0%) | |
w/incoming: 7366478 (56.4%) | |
w/outgoing: 11985748 (91.8%) | |
# Statistics: |
NewerOlder