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
import multiprocessing, time | |
from multiprocessing import Pool, JoinableQueue, Process | |
SENTINEL = -1 | |
def worker(q,rq, callback): | |
for item in iter(q.get, SENTINEL): | |
callback(rq, item) | |
q.task_done() | |
q.task_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 | |
import csv, json, sys, cStringIO, codecs | |
from operator import itemgetter | |
def fmt(s): | |
if s == None: | |
return '' | |
elif isinstance(s, basestring): | |
return s.encode('utf-8') |
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
filter { | |
grok { | |
match => [ "message", "%{TIMESTAMP_ISO8601:ts} \[%{USERNAME:spider}\] %{LOGLEVEL:level}: Crawled %{NUMBER:pages2:int} pages \(at %{NUMBER:pages_rate2:int%} pages/min\), scraped %{NUMBER:items2:int} items \(at %{NUMBER:items_rate2:int%} items/min\)" ] | |
} | |
} |
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
from twisted.web.iweb import IBodyProducer | |
from twisted.internet import defer | |
from twisted.web.client import Agent | |
from twisted.web.http_headers import Headers | |
from zope.interface import implements | |
import urllib | |
class StringProducer(object): | |
implements(IBodyProducer) |
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
import multiprocessing, sys, os, fileinput | |
p = multiprocessing.Pool(4) | |
p.map(os.system, sys.stdin.readlines()) |
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
{u'Location': {u'TelephoneNumber': {u'FunctionalTypeDescription': u'Main', u'PhoneNumber': u'(708) 731-2702'}, u'Name': u'D145 Dist Ofc', u'LocationMilestones': {u'OpenDate': u'2004-02-01T12:00:00'}, u'TypeCode': u'RGD', u'@locale': u'en-US', u'SubTypeDescription': u'District Office', u'TimeZone': {u'TimeZoneCode': u'CST', u'TimeZoneOffset': {u'OffsetCode': u'UTC', u'OffsetHours': u'-06'}, u'TimeZoneDescription': u'Central Std Time'}, u'AlternateIdentifier': {u'TypeDescription': u'Legal Store Number', u'ID': u'T3912'}, u'Address': {u'City': u'Broadview', u'Subdivision': u'IL', u'Longitude': -87.851863, u'County': u'Cook', u'PostalCode': u'60155-4887', u'FormattedAddress': u'800 Broadview Village Sq, Broadview, IL 60155-4887', u'AddressLine1': u'800 Broadview Village Sq', u'Latitude': 41.853146, u'CountryName': u'United States', u'IntersectionDescription': u'NEQ Calumet Ave & BroadmoorAve'}, u'TypeDescription': u'Rgd (region/group/district office)', u'ID': 3912, u'IsDaylightSavingsTimeRecognized': u'true'}} |
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
{ | |
"type": "Feature", | |
"properties": { | |
"name": "Coors Field", | |
"amenity": "Baseball Stadium", | |
"popupContent": "This is where the Rockies play!" | |
}, | |
"geometry": {"type":"Polygon","coordinates":[[[-74.3660367388635,39.40413],[-74.3661057823687,39.4035883356439],[-74.366310259581,39.4030674831777],[-74.3666423125559,39.4025874593515],[-74.3670891806838,39.4021667122319],[-74.3676336910731,39.4018214120983],[-74.3682549184949,39.4015648298447],[-74.3689289895278,39.4014068268035],[-74.36963,39.4013534756247],[-74.3703310104722,39.4014068268035],[-74.3710050815051,39.4015648298447],[-74.3716263089269,39.4018214120983],[-74.3721708193162,39.4021667122319],[-74.372617687444,39.4025874593515],[-74.372949740419,39.4030674831777],[-74.3731542176313,39.4035883356439],[-74.3732232611365,39.40413],[-74.3731542176313,39.4046716601493],[-74.372949740419,39.4051925006353],[-74.372617687444,39.405672506532],[-74.3721708193162,39.4060932325023],[-74.3716263089269,39.4064385114866],[-74.37100 |
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
pub type Point = [f64;3]; | |
#[derive(Default, Debug, Clone, PartialEq, serde_derive::Serialize, serde_derive::Deserialize)] | |
#[serde(rename_all = "camelCase")] | |
pub struct RouteResponse { | |
pub hints: Hints, | |
pub info: Info, | |
pub paths: Vec<Path>, | |
} |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer