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 python3 | |
from urllib.request import urlopen | |
from xml.dom.minidom import parseString | |
import os | |
""" | |
Request current weather from Yahoo's public weather API and append to a log | |
""" | |
# Where to put the log file? | |
desired_path = os.getenv("HOME") + '/weather.log' | |
# Temperature unit: c for Celsius, f for Fahrenheit |
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 python3 | |
""" | |
Calculate travel time for an object falling through a tunnel through the | |
earth's core, only driven by gravitation | |
""" | |
from scipy.integrate import odeint, quad | |
from scipy.interpolate import interp1d | |
from numpy import arange, linspace, where, sign, diff | |
import math | |
import matplotlib.pyplot as plt |
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 os | |
import json | |
from itertools import chain | |
tweets_path = 'data/js/tweets/' | |
json_files = [os.path.join(tweets_path, filename) for filename in os.listdir(tweets_path)] | |
def read_json(filename): | |
''' | |
For a given filename read the json and return a list of |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
DEBUG = False | |
max_frames = 135. | |
total_revs = 2 | |
pw = 10 # width | |
pl = 40 # length | |
plus = None | |
def setup(): |
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
DEBUG = True | |
max_frames = 80. | |
grid = 100 | |
offset = 25 | |
cent_width = 25 | |
def setup(): | |
size(400, 400) | |
if DEBUG: |
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
DEBUG = True | |
max_frames = 120. | |
tiles = [] | |
def setup(): | |
size(400, 400, P3D) | |
smooth(8) | |
if DEBUG: | |
frameRate(100 / 3) |
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
DEBUG = True | |
maxFrames = 100. | |
l = 60 # edge length | |
s = 1.1 # spacing | |
lim = None | |
def setup(): | |
size(400, 400) | |
smooth(8) |
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
OlderNewer