Skip to content

Instantly share code, notes, and snippets.

View douglasgoodwin's full-sized avatar

Doug Goodwin douglasgoodwin

View GitHub Profile
# WWF
# WWF
# Read about these projects:
# https://twistedsifter.com/2019/10/populations-of-endangered-species-depicted-by-the-number-of-pixels/
# https://mymodernmet.com/endangered-species-pixelated-photos-jjsmooth44/
# Bonobo: approx 10000 remain
# the squareroot of 10000 is 100
# width is 600, so sample the image every 6 pixels
# EX09 _ textual analysis of Jane Austen's book "Emma"
# questions
# + How many words are in the novel?
# + what's the longest word? the shortest word? the average word length?
# + what are the top 100 words by count?
from collections import Counter
# get the remote file
import urllib.request
@douglasgoodwin
douglasgoodwin / squid3.conf
Last active March 6, 2023 00:06
Config file for Squid 3.5 on internal proxy
########### squid.conf ###########
# assembled from various online resources
# to serve the Metro Design Studio
# This config tunnels HTTPS requests without
# intervention | DG 6/2015
#
# test from a local workstation:
# echo -e -n 'CONNECT www.google.com:443\r\n\r\n' | nc XXXX.metro.net 8118
# expect a:
# HTTP/1.1 200 Connection established
@douglasgoodwin
douglasgoodwin / .block
Created July 2, 2022 06:04 — forked from mbostock/.block
Random Traversal III
license: gpl-3.0
@douglasgoodwin
douglasgoodwin / anselAdams_blackSun_400x299.jpg
Last active February 28, 2022 22:23
A couple of JPEG images
anselAdams_blackSun_400x299.jpg
0.2 1.4 5.1 3.5 Iris-setosa
0.2 1.4 4.9 3 Iris-setosa
0.2 1.3 4.7 3.2 Iris-setosa
0.2 1.5 4.6 3.1 Iris-setosa
0.2 1.4 5 3.6 Iris-setosa
0.4 1.7 5.4 3.9 Iris-setosa
0.3 1.4 4.6 3.4 Iris-setosa
0.2 1.5 5 3.4 Iris-setosa
0.2 1.4 4.4 2.9 Iris-setosa
0.1 1.5 4.9 3.1 Iris-setosa
altimeter type merged file cycle year fraction of year number of observations weighted observations GMSL standard deviation GMSL smoothed GMSL GMS variation 20 year mean standard deviation GMSL smoothed 20 year mean smoothed annual semi-annual signal
0 11 1993 1993.011526 466462 337277 -37.24 92.66 -37.02 -37.24 92.66 -37.02 -37.55
0 12 1993 1993.038692 460889 334037.31 -40.35 95.39 -38.2 -40.34 95.39 -38.19 -38.06
0 13 1993 1993.065858 472123 342416.09 -40.17 92.29 -38.28 -40.16 92.29 -38.27 -37.6
0 14 1993 1993.093025 421377 306050.59 -41.92 96.2 -38.56 -41.89 96.19 -38.54 -37.45
0 15 1993 1993.120191 459548 331094.09 -36.89 94.64 -37.87 -36.85 94.63 -37.83 -36.44
0 16 1993 1993.147357 416480 300344.81 -35.69 93.22 -36.96 -35.65 93.21 -36.93 -35.31
0 17 1993 1993.174523 467980 337061.91 -36.09 91.67 -36.14 -36.05 91.67 -36.09 -34.28
0 18 1993 1993.201689 466075 335414.41 -34.7 91.95 -35.53 -34.65 91.94 -35.48 -33.5
0 19 1993 1993.228855 461207 331521.09 -34.04 91.7 -35.18 -33.98 91.68 -35.12 -32.94

dgoodwin fork for Python3 and Los Angeles downtown.

Transitland Frequency Visualization

Accompanies blog post: Transit dimensions: Transitland Schedule API

The frequency.py script:

  • Fetches all trips on a given date, between a start time and end time, inside of a bounding box
  • Calculates the number of connections between every stop
  • Uses a colormap and line width to show more frequent service
h = 4
A = []
B = []
C = []
for i in range(1,h+1):
A.append(i)
A.reverse()
towers = {"A":A,"B":B,"C":C}
size(400,400)
# white background
background(255)
textAlign(CENTER, CENTER)
i=0
chunk=40
# use range to specify the start, end, and chunk for each loop
# some inspiration from Shiffman
for y in range(0,height,chunk):