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
# Written by Brendan O'Connor, [email protected], www.anyall.org | |
# * Originally written Aug. 2005 | |
# * Posted to gist.github.com/16173 on Oct. 2008 | |
# Copyright (c) 2003-2006 Open Source Applications Foundation | |
# | |
# 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 | |
# |
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
-- This creates an athena table that can parse ALB logs. | |
-- Advantage of this over others are this works when the log ends with a trailing space | |
-- plus it also breaks the http request into route and params for easier grouping | |
CREATE EXTERNAL TABLE IF NOT EXISTS alb_logs ( | |
type string, | |
timestamp string, | |
elb string, | |
client_ip string, | |
client_port int, |
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
CREATE EXTERNAL TABLE IF NOT EXISTS alb_logs ( | |
type string, | |
timestamp string, | |
elb string, | |
client_ip string, | |
client_port int, | |
target_ip string, | |
target_port int, | |
request_processing_time double, | |
target_processing_time double, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
# read csv file | |
ds <- read.csv('2012-Presidential-Campaign-Finance-Contributors.tsv', sep='\t') | |
# aggregate by candidate | |
res <- aggregate(ds$contb_receipt_amt, by=list(ds$cand_nm), FUN=sum, na.rm=TRUE) | |
X = data.frame(name=res$Group.1, amount=res$x) | |
# make data columns callable without typing X$ everytime | |
attach(X) |
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 | |
# -*- coding : utf-8 -*- | |
""" | |
@author: Diogenes Augusto Fernandes Herminio <[email protected]> | |
""" | |
from abc import ABCMeta | |
#Abstract Factory | |
class StandardFactory(object): |