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
| # An R Script to do some scraping | |
| getSearchString <- function(loc,heading,pitch) { | |
| s <- paste('http://maps.googleapis.com/maps/api/streetview?size=640x640', | |
| paste('location=',loc,sep=''), | |
| paste('heading=',heading,sep=''), | |
| paste('pitch=',pitch,sep=''), | |
| 'sensor=false', | |
| sep = '&') | |
| s <- gsub(' ','%20',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
| import re | |
| fname = 'inp.txt' | |
| colors = ['red','green','blue','orange','yellow'] | |
| colorheaders = ['red is for X','green is for y','blue','orange','yellow'] | |
| colorstrings = [] | |
| for c in colors: |
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
| import glob | |
| import re | |
| import csv | |
| ''' | |
| This script will extract the PS-B and PS-E tables from | |
| DOE .sim building files. | |
| This script was tested on DOE 2.1e .sim files. |
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
| import glob | |
| import re | |
| import csv | |
| allfiles = glob.glob('1972_1998_batch/*.sim') | |
| fw = open('psb.csv','w') | |
| dw = csv.DictWriter(fw,["filename","month","electricity","gas"]) | |
| dw.writeheader() | |
| fwt = open('psb_total.csv','w') |
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
| import re | |
| import csv | |
| import glob | |
| fc = open('signers.csv','w') | |
| c = csv.DictWriter(fc,["Name","Chamber","Number","Year Filename"]) | |
| c.writeheader() | |
| # I used the pdftotext utility to convert the pdf documents | |
| # Look here for details: http://www.bluem.net/en/mac/packages/ |
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
| # Use this file by navigating in the terminal to the directory where your file is located and typing: | |
| # python parsexml.py [name of xml file] | |
| # You can parse multiple xml files by using the wildcard operator. | |
| # To process every xml file in a directory, do this: | |
| # python parsexml.py *.xml | |
| from lxml import etree | |
| import re | |
| import csv | |
| import os.path as op |
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
| # This file demonstrates how to... | |
| # 1) Make a new analyzer | |
| # 2) Make a new filter | |
| # 3) Apply an analyzer chain to a string (via a query) | |
| # 4) Include phrases as tokens | |
| from lucene import * | |
| class AnalyzerUtils(object): |
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
| # open the files in the directory, parse them and get the text. | |
| #eg.text_content() | |
| import glob | |
| from lxml import etree | |
| import lxml.html | |
| import csv | |
| import urllib2 |
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
| Universe = vanilla | |
| Executable = /usr/local/bin/matlab | |
| Arguments = -nodisplay -r \"addpath('/nfs/home/A/astorer/Work/dchan'); | |
| test($(Process))\" | |
| when_to_transfer_output = ON_EXIT_OR_EVICT | |
| transfer_output_files = out.$(PROCESS) | |
| input = | |
| output = out.$(Process) | |
| error = error.$(Process) |
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
| num_statements = 5; | |
| num_blocks = 9; | |
| for run = 1:8 | |
| % 150 statements, 50 of each type | |
| physical_order = Shuffle(1:50); | |
| mental_order = Shuffle(1:50); | |
| emotional_order = Shuffle(1:50); | |
| physical_num = 1 |