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
(barkingowl)administrator@anna:~/dev/sql2api/scripts$ fedmsg-config | |
Traceback (most recent call last): | |
File "/home/administrator/.virtualenvs/barkingowl/bin/fedmsg-config", line 4, in <module> | |
fedmsg.commands.config.config() | |
File "/home/administrator/.virtualenvs/barkingowl/local/lib/python2.7/site-packages/fedmsg/commands/config.py", line 26, in config | |
config = fedmsg.config.load_config([], __doc__) | |
File "/home/administrator/.virtualenvs/barkingowl/local/lib/python2.7/site-packages/fedmsg/config.py", line 152, in load_config | |
raise ValueError("No config value 'endpoints' found.") | |
ValueError: No config value 'endpoints' found. | |
(barkingowl)administrator@anna:~/dev/sql2api/scripts$ |
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
def geocodemq(address): | |
key = "Fmjtd%7Cluub2gurll%2C8w%3Do5-9uagq4" | |
vals = {'location': address} | |
qstr = urllib.urlencode(vals) | |
#print "QSTR = '{0}'".format(qstr) | |
reqstr = "http://www.mapquestapi.com/geocoding/v1/address?key={0}&outFormat=json&maxResults=1&{1}".format(key,qstr) | |
#print "Sending: {0}".format(reqstr) | |
_json = simplejson.loads(urllib.urlopen(reqstr).read()) | |
return _json |
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
#include <stdio.h> | |
#define LENGTH 99 | |
#define MISSING_NUMBER 47 | |
int main() | |
{ | |
// vars | |
int numbers[LENGTH]; | |
int missingnumber = -1; |
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
GAddCopyright("m","16594126484873845410",43.0647,-78.0077,43.3035,-77.2187,11,"Google",11,false); | |
GAddCopyright("k","9223630303596154971",43.0647,-78.0077,43.3035,-77.2187,11,"TerraMetrics",11,false); | |
GAddCopyright("k","11955203846863391525",-90.0000,-180.0000,90.0000,180.0000,0,"",19,false); | |
GAddCopyright("k","4565752688697377595",-90.0000,-180.0000,90.0000,180.0000,0,"",9,false); | |
GAddCopyright("k","1430798344457654368",-90.0000,-180.0000,90.0000,180.0000,0,"",8,false); | |
GAddCopyright("k","17565615998743351574",-84.3750,-180.0000,84.3750,180.0000,0,"",14,false); | |
GAddCopyright("k","11350805467989226148",12.0000,-127.0000,47.0000,-57.0000,0,"",14,false); | |
GAddCopyright("k","3035392783884246871",41.3086,-85.6055,48.8672,-67.3242,0,"",16,false); | |
GAddCopyright("k","11657524632733150381",40.3935,-78.1985,45.0777,-71.5930,0,"",17,false); | |
GAddCopyright("k","5922223813155577633",40.3936,-78.1985,45.0776,-71.5931,0,"",17,false); |
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
def geocodemq(address): | |
key = "" | |
vals = {'location': address} | |
qstr = urllib.urlencode(vals) | |
#print "QSTR = '{0}'".format(qstr) | |
reqstr = "http://www.mapquestapi.com/geocoding/v1/address?key={0}&outFormat=json&maxResults=1&{1}".format(key,qstr) | |
#print "Sending: {0}".format(reqstr) | |
_json = simplejson.loads(urllib.urlopen(reqstr).read()) | |
return _json |
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
inputdata = "" | |
with open("dunkindonuts_raw.json","r") as f: | |
json = f.read() | |
json = json.encode("ascii","ignore") | |
inputdata = simplejson.loads(json) |
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
(tapir)administrator@anna:~/dev/tapir/data$ python gendd.py | |
Traceback (most recent call last): | |
File "gendd.py", line 8, in <module> | |
json = json.encode("ascii","ignore") | |
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa9 in position 4783337: ordinal not in range(128) |
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
{"results":[{"locations":[{"latLng":{"lng":-77.715289,"lat":43.02724},"adminArea4":"Monroe County","adminArea5Type":"City","adminArea4Type":"County","adminArea5":"West Henrietta","street":"79 Harrogate Xing","adminArea1":"US","adminArea3":"NY","type":"s","displayLatLng":{"lng":-77.715256,"lat":43.027111},"linkId":0,"postalCode":"14586-9473","sideOfStreet":"R","dragPoint":false,"adminArea1Type":"Country","geocodeQuality":"ADDRESS","geocodeQualityCode":"L1AAA","mapUrl":"http://www.mapquestapi.com/staticmap/v4/getmap?key=Fmjtd|luubn1u2ll,rg=o5-90bl9f&type=map&size=225,160&pois=purple-1,43.02724,-77.715289,0,0|¢er=43.02724,-77.715289&zoom=15&rand=-277786938","adminArea3Type":"State"}],"providedLocation":{"location":"79 Harrogate Crossing,14586"}}],"options":{"ignoreLatLngInput":false,"maxResults":1,"thumbMaps":true},"info":{"copyright":{"text":"© 2013 MapQuest, Inc.","imageUrl":"http://api.mqcdn.com/res/mqlogo.gif","imageAltText":"© 2013 MapQuest, Inc."},"statuscode":0,"messages":[]}} |
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
function plotCrime(coords,crimeID){ | |
var marker = L.marker([coords[0], coords[1]]).addTo(map).on('click',function(){ | |
generateCrimeData(marker.myId,coords); | |
marker.setIcon(highlightedIcon); | |
if(currentlyClicked == null){ | |
currentlyClicked = marker; | |
console.log("The currently clicked marker: " + currentlyClicked); | |
}else{ | |
currentlyClicked.setIcon(markerIcon); | |
console.log("Resetting to the default icon."); |
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
def sendtoelasticsearch(self,targeturl,docurl,pdftext,pdfhash,scrapedatetime): | |
Where: | |
targeturl = "http://henrietta.org/" # the root url that was scraped | |
docurl = "http://henrietta.org/mydoc.pdf" # the url of the pdf document | |
pdftext = <the converted text of the pdf> | |
pdfhash = md5(pdftext) | |
scrapedatetime = the datetime of when the pdf was scraped/downloaded | |
I would like to send the text to elastic search for it to be indexed so I can perform queies on it from a website. |