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 ( | |
"fmt" | |
"math/rand" | |
"time" | |
) | |
func getUnderside(coin string, upside string) string { | |
if coin == "Fair" && upside == "Heads" { | |
return "Tails" | |
} else { |
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
from __future__ import print_function | |
import sys | |
from pyspark import SparkContext | |
from pyspark.streaming import StreamingContext | |
from pyspark.streaming.kinesis import KinesisUtils, InitialPositionInStream | |
import sys | |
def foo(line): | |
print(line) | |
return line.split(" ") |
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
from subprocess import call | |
with open("tables") as f: | |
tables = f.readlines() | |
for table in tables: | |
command = table.strip().split(".") | |
command.insert(0, "mysqldump") | |
outfile = open("{0}.sql".format(command[2]), "w") | |
print command |
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 | |
import sys | |
import json | |
from subprocess import check_output | |
if len(sys.argv) < 2: | |
print ("Usage: instances.py [tag_name]") | |
else: | |
instances_json = check_output(["aws", "--region", "us-east-1", "ec2", "describe-instances"]) | |
instances = json.loads(instances_json) |
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 au.com.bytecode.opencsv.CSVReader; | |
public class LoadTest { | |
@Test | |
public void testLoad(String row) throws IOException, JobNotFoundException, InterruptedException { | |
CSVReader reader = new CSVReader(new FileReader("/Users/bone/Desktop/foo_data.tab"), '\t'); | |
String[] record; | |
while ((record = reader.readNext()) != null) { | |
for (String value : record) { |
This file has been truncated, but you can view the full file.
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
2013-08-14 17:18:07,813-0400 | ERROR [Thread-25] TweetSplitterFunction.execute(22) | SPLITTING TWEET [RT @UncleTimi: "Bill Gates left education. So did Steve Jobs" | |
And?! Are you planning to create Microsoft or Apple? No, I didn't think so. …] | |
2013-08-14 17:18:07,813-0400 | ERROR [Thread-25] TweetSplitterFunction.execute(22) | SPLITTING TWEET [Is Apple Doomed Without Steve Jobs, as Larry Ellison Predicts? | News & Opinion http://t.co/mrXV1tzldc] | |
2013-08-14 17:18:07,814-0400 | ERROR [Thread-25] TweetSplitterFunction.execute(22) | SPLITTING TWEET [RT @UncleTimi: "Bill Gates left education. So did Steve Jobs" | |
And?! Are you planning to create Microsoft or Apple? No, I didn't think so. …] | |
2013-08-14 17:18:07,814-0400 | ERROR [Thread-25] TweetSplitterFunction.execute(22) | SPLITTING TWEET [RT @UncleTimi: "Bill Gates left education. So did Steve Jobs" | |
And?! Are you planning to create Microsoft or Apple? No, I didn't think so. …] |