Collingwood’s concern in this little book is to clarify the idea of nature as it underlies both natural science and philosophy. Saying that science is “based” on nature does not mean that the idea of nature is worked out first and all further scientific investigation proceeds from it. Rather, the conception of nature is subject to change along with scientific knowledge. Collingwood does not believe that there is one correct view of nature but rather seems to believe with Hegel that “the true is the whole,” that is, that the entire history of the concept and not just the “bottom line” of our modern
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 srfi-1) ; provides filter | |
(define (quicksort elems) | |
(if (null? elems) (list) | |
(let [[middle (car elems)] | |
[others (cdr elems)]] | |
(let [[left (filter (lambda (x) (<= x middle)) others)] | |
[right (filter (lambda (x) (> x middle)) others)]] | |
(append (quicksort left) (cons middle (quicksort right))))))) |
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
# coding=utf-8 | |
import requests | |
from yaml import load as yaml_load | |
from functools import partialmethod | |
from urllib.parse import urlencode, quote | |
class Mapillary(object): | |
def __init__(self, token='token.yaml'): | |
self._base_url = 'https://a.mapillary.com/v2' |
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
MULTIPOLYGON (((4.7567178999999999 52.3778378000000020, 4.7564339000000002 52.3777635000000000, 4.7569860000000004 52.3770463000000030, 4.7575304999999997 52.3761888000000010, 4.7580470000000004 52.3750653000000030, 4.7583805000000003 52.3740153000000030, 4.7585170000000003 52.3732593000000010, 4.7585676000000001 52.3727554000000030, 4.7585964000000001 52.3722175999999990, 4.7585747999999999 52.3715943999999990, 4.7585107999999998 52.3712412000000000, 4.7584413999999997 52.3709575999999970, 4.7579834999999999 52.3692393999999980, 4.7578265000000002 52.3687134999999980, 4.7567178999999999 52.3778378000000020)), ((4.7590846000000004 52.3807575000000010, 4.7590851000000001 52.3807377999999990, 4.7590902000000002 52.3805027000000010, 4.7590915000000003 52.3804415999999970, 4.7590922000000004 52.3804074000000030, 4.7590925999999998 52.3803957000000010, 4.7591020999999998 52.3800388000000010, 4.7591023999999997 52.3800254000000010, 4.7591028000000000 52.3800136999999990, 4.7591124999999996 52.3797112000000030, 4.75 |
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
from bs4 import BeautifulSoup as bs | |
r = !curl -s 'https://example.net' | |
s = bs(''.join(r)) | |
for link in s.findAll('a', {'href': lambda x: x.endswith('pdf')}): | |
loc = link['href'] | |
!curl -O $loc |
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 requests | |
import pandas as pd | |
from xml.dom.minidom import parseString as xml_parse | |
MAP_URL = 'http://sintenpietengilde.nl/Kaart.html' | |
KML_OUT = 'sintenpietengilde_kaart.kml' | |
XLS_OUT = 'sintenpietengilde_kaart.xlsx' |
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 os | |
import json | |
import igraph as ig | |
def ig_to_json(graph, path): | |
assert isinstance(graph, ig.Graph) | |
nodes = [] | |
edges = [] |
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 requests | |
try: | |
from urllib.parse import urlencode | |
except ImportError: | |
from urllib import urlencode | |
def reverse_geocode(lng, lat, zoom=18): | |
OSM_API_URL = 'http://nominatim.openstreetmap.org/reverse?' | |
_headers = {'User-Agent': |
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 requests | |
from functools import partial | |
from collections import OrderedDict | |
from xml.dom.minidom import parseString as xml_parse | |
from shapely.geometry import MultiPolygon, Polygon, Point | |
def osm_getter(element_id, endpoint): | |
assert endpoint in ('node', 'way', 'relation') | |
OSM_API_URL = 'http://www.openstreetmap.org/api/0.6/{}/{}' |
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 beanstalkc | |
from redis import Redis | |
class UniqueQueue(object): | |
'''Stores a persistent set of added jobs in Redis to keep jobs from being | |
added to the Beanstalkd queue more than once.''' | |
def __init__(self, tube_name='default', host='localhost'): | |
self.beanstalk = beanstalkc.Connection(host=host) | |
self.beanstalk.use(tube_name) | |
self.tube = self.beanstalk.using() |