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
don't use poetry, art or music to get into girls' pants. use it to get into their heads. |
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
; emacsen UTF-8 glory | |
(setq locale-coding-system 'utf-8) | |
(set-terminal-coding-system 'utf-8) | |
(set-keyboard-coding-system 'utf-8) | |
(set-selection-coding-system 'utf-8) | |
(prefer-coding-system 'utf-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
# what's the single state in america whose name does not | |
# have any letters in common with george w. bush? | |
states='Alabama | |
Alaska | |
Arizona | |
Arkansas | |
California | |
Colorado | |
Connecticut |
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
import time | |
# decorator that measures execution time of a function. | |
def timing(func): | |
def wrapper(*arg): | |
t0 = time.time() | |
r = func(*arg) | |
elapsed = time.time() - t0 | |
print '%s => %0.3f ms' % (func.func_name, elapsed*1000.00) | |
return r |
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
#!/usr/bin/env python | |
# these here programming codes are licensed under the gnu fearsome dude license. | |
# writes 500k rows to a table, where each row represents a track in an artist's | |
# library for a single day. the play count is stored in the cfq 'unit:scrobbles'. | |
# 1: hbase(main):001:0> create '500k-test', 'unit:' | |
# 2: $> hbase thrift start | |
# 3: $> python testdata-500k.py (~500 seconds on my hackintosh) |
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
#!/bin/bash -xe | |
# from http://gist.github.com/249915 by fairchild | |
if [ -z $1 ]; then | |
echo "usage: $0 INSTANCE_ID" | |
exit | |
fi | |
EBS_DEVICE='/dev/sdh' | |
INSTANCE_ID=$1 |
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
# run like so: | |
# $> ruby normalize.rb --run=local --input data/sizes --output data/normalized_sizes | |
module Normalize | |
class Mapper < Wukong::Streamer::LineStreamer | |
def process(line) | |
fields = line.strip.split("\t") | |
country = fields.reverse!.pop | |
data = fields.map(&:to_i) |
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
#!/usr/bin/env python | |
import networkx as nx | |
# for each node: | |
# + degree centrality | |
# + closeness centrality | |
# + betweenness centrality | |
# + eigenvector centrality | |
# + page rank |
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
diff --git a/cli/parser.py b/cli/parser.py | |
index ec1a435..7d7d48d 100644 | |
--- a/cli/parser.py | |
+++ b/cli/parser.py | |
@@ -12,7 +12,7 @@ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. | |
See the License for the specific language governing permissions and | |
limitations under the License.""" | |
-from graphite.thirdparty.pyparsing import * | |
+from pyparsing import * |
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
#!/usr/bin/python | |
"""Copyright 2008 Orbitz WorldWide | |
Licensed under the Apache License, Version 2.0 (the "License"); | |
you may not use this file except in compliance with the License. | |
You may obtain a copy of the License at | |
http://www.apache.org/licenses/LICENSE-2.0 | |
Unless required by applicable law or agreed to in writing, software |
OlderNewer