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
register file:/home/hadoop/lib/pig/piggybank.jar | |
DEFINE EXTRACT org.apache.pig.piggybank.evaluation.string.EXTRACT; | |
RAW_LOGS = LOAD 's3://apiaxle-logs/*' USING TextLoader as (line:chararray); | |
LOGS_BASE = FOREACH RAW_LOGS GENERATE | |
FLATTEN( | |
EXTRACT(line, '^(\\S+) (\\S+) (\\S+) \\[([\\w:/]+\\s[+\\-]\\d{4})\\] "(.+?) (.+)&api_key=(.+?)(&.+)? (.+?)" (\\S+) (\\S+) "([^"]*)" "([^"]*)"') | |
) | |
as ( | |
remoteAddr: chararray, |
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
REGISTER file:/home/hadoop/lib/pig/piggybank.jar; | |
DEFINE EXTRACT org.apache.pig.piggybank.evaluation.string.EXTRACT(); | |
DEFINE CustomFormatToISO org.apache.pig.piggybank.evaluation.datetime.convert.CustomFormatToISO(); | |
DEFINE ISOToUnix org.apache.pig.piggybank.evaluation.datetime.convert.ISOToUnix(); | |
DEFINE DATE_TIME org.apache.pig.piggybank.evaluation.datetime.DATE_TIME(); | |
DEFINE FORMAT_DT org.apache.pig.piggybank.evaluation.datetime.FORMAT_DT(); | |
DEFINE FORMAT org.apache.pig.piggybank.evaluation.string.FORMAT(); | |
RAW_LOGS = LOAD '$INPUT' as (line:chararray); |
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/perl -w | |
use strict; | |
my $URL = "http://prodapi.openaura.com/info/artists/__ARTID__?id_type=oa%3Aartist_id&api_key=special-key"; | |
my $IDs = "artIdzz"; | |
open(my $ifh, "<", $IDs) or die "DIED!\n"; | |
my $NEWURLS = "URLS_4_BENCH.txt"; | |
open(my $ofh, ">", $NEWURLS) or die "DIED!"; |
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/perl -w | |
use strict; | |
my @urlies; | |
my $URLs = "URLS.txt"; | |
open(my $ufh, "<", $URLs) or die "canne open $URLs!\n"; | |
my $IDs = "artIdz"; | |
open(my $ifh, "<", $IDs) or die "DIED!\n"; |
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
int[] colors = new int[3]; | |
// int numColors = int(pow(2, colors.length)); | |
void setup() { | |
size(1000, 240); | |
background(255); | |
} | |
void draw() { | |
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 ruby | |
@rg = [0,0,0,0] | |
@i = 0 | |
def adder () | |
while @i < 2 ** @rg.length | |
puts "#{@rg}" | |
def add(position) |
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
ls 808\ \(* | while read file; do mv "$file" `echo $file | sed 's/[()]//g' | sed 's/ /_/'` ; done |
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 | |
from __future__ import print_function | |
import csv | |
import datetime | |
import re | |
def qtr(word): | |
word = re.sub('^|$','"', word) | |
return word |
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
// merge calls itself recursively | |
def merge(l1: List[Int], l2: List[Int]): List[Int] = { | |
// termination cases | |
(l1, l2) match { | |
case (Nil, Nil) => Nil | |
case (x, Nil) => x | |
case (Nil, y) => y | |
case (_, _) => l1.head.compare(l2.head) match { | |
case -1 => l1.head :: merge(l1.tail, l2) | |
case _ => l2.head :: merge(l2.tail, l1) |
NewerOlder