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
// Adapted from http://www.swharden.com/blog/2008-11-17-linear-data-smoothing-in-python/ | |
var smooth = function (list, degree) { | |
var win = degree*2-1; | |
weight = _.range(0, win).map(function (x) { return 1.0; }); | |
weightGauss = []; | |
for (i in _.range(0, win)) { | |
i = i-degree+1; | |
frac = i/win; | |
gauss = 1 / Math.exp((4*(frac))*(4*(frac))); | |
weightGauss.push(gauss); |
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
loadTemplate = (filename) -> | |
jQuery.ajax({ | |
url: filename, | |
async: false, | |
}).responseText |
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
aaronbycoffe@us150633:~$ curl -I newtgingrich.com | |
HTTP/1.1 200 OK | |
Content-Length: 873 | |
Content-Type: text/html | |
Content-Location: http://newtgingrich.com/redirect.htm | |
Last-Modified: Wed, 21 Dec 2011 02:02:42 GMT | |
Accept-Ranges: bytes | |
ETag: "c6f3b09f84bfcc1:314" | |
Server: Microsoft-IIS/6.0 | |
X-Powered-By: ASP.NET |
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
aaronbycoffe@us150633:~$ curl -I newtgingrich.com | |
HTTP/1.1 200 OK | |
Content-Length: 1037 | |
Content-Type: text/html | |
Content-Location: http://newtgingrich.com/redirect.htm | |
Last-Modified: Wed, 21 Dec 2011 19:35:56 GMT | |
Accept-Ranges: bytes | |
ETag: W/"c819afc217c0cc1:31c" | |
Server: Microsoft-IIS/6.0 | |
X-Powered-By: ASP.NET |
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
require 'fech' | |
require 'google_spreadsheet' | |
module Fech | |
class Filing | |
# Create a Google Spreadsheet from a filing. | |
# Note that for large filings, this will fail because of the limit | |
# Google Spreadsheets places on the number of cells. | |
def upload_to_google_spreadsheet(email, password, title=nil) |
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
require 'fech' | |
require 'spreadsheet' | |
module Fech | |
class Filing | |
# Create an XLS spreadsheet from a filing. | |
def as_xls(filename=nil) | |
spreadsheet = Spreadsheet::Workbook.new | |
bold = Spreadsheet::Format.new :weight => :bold |
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
filing = Fech::Filing.new(766953) | |
filing.download | |
fields = [:contributor_first_name, | |
:contributor_last_name, | |
:contributor_organization_name, | |
:contribution_amount] | |
rows = filing.rows_like(/sa/, :include => fields) |
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
original = Fech::Filing.new(764200) | |
original.download | |
amendment = Fech::Filing.new(764828) | |
amendment.download | |
comparison = Fech::Comparison.new(amendment, original) | |
p comparison.summary | |
# {:date_signed=>"20120207"} |
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
["TEXT", "SA11ai", nil, "Regarding negative receipts listed on line 11(a)(i) with the description of 'ACH Return', these are interbank clearing of electronic payments processed by the Automated Clearing House (ACH) network of participating banks and the Federal Reserve. These are returns of contributions by individuals which have been deducted from our credit card merchant account or bank account by the credit card company or bank."] | |
["TEXT", "SA15", nil, "\"Regarding 'Asset Sales' reported on Schedule A supporting Line 15 of our report", " occasionally the RNC has used office equipment that we need to dispose of. This equipment may be sold in bulk to a commercial liquidation business or piece by piece to individuals. When this is done", " these items are reported as 'asset sale' and the price charged is such that they in no way constitute a political contribution. The used assets liquidated by sale to individuals or business are reported as 'Asset Sale' and are priced at fair market value. These items s |
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
{:rec_type=>"TEXT", :filer_committee_id_number=>"SA11ai", :back_reference_tran_id_number=>nil, :text=>"Regarding negative receipts listed on line 11(a)(i) with the description of 'ACH Return', these are interbank clearing of electronic payments processed by the Automated Clearing House (ACH) network of participating banks and the Federal Reserve. These are returns of contributions by individuals which have been deducted from our credit card merchant account or bank account by the credit card company or bank."} |