View sun_flight_map.R
# sun_flight_map.R | |
# | |
# Plot sun elevations along a flight path. | |
# | |
# Airport information can be sourced from http://openflights.org/data.html. | |
# Note that the time zone offsets provided in their airports.dat never count | |
# daylight savings time. | |
# | |
# This code is for fun only, so it comes with no guarantee of accuracy and | |
# is not to be used for any serious purpose including making any decisions |
View collect_weather.py
import sqlite3 | |
import json | |
import urllib | |
import datetime | |
import calendar | |
WEATHER_DATA_URL = 'http://api.openweathermap.org/data/2.5/weather?q=Berlin,de&units=metric' | |
DB_PATH = '' | |
def get_data(): |
View pysml.py
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
pysml.py | |
Created by Christian Stade-Schuldt on 2014-10-25. | |
""" | |
import sys | |
import os | |
import datetime |
View codebase_munin.py
#!/usr/bin/env python | |
""" | |
codebase_munin - A munin plugin for Linux to monitor Codebase ticket progress | |
Copyright (C) 2015 Christian Stade-Schuldt | |
Author: Christian Stade-Schuldt | |
Like Munin, this plugin is licensed under the GNU GPL v2 license | |
http://www.opensource.org/licenses/GPL-2.0 | |
Add the following section to your munin-node's plugin configuration: | |
[codebase_*] |
View fitbit_stride_regression.R
runs <- read.csv("myrunninglog.csv", header=T, sep=",") | |
#convert date | |
runs$Date <- strptime(as.character(runs$Date), format="%Y-%m-%d") | |
#convert distance from km to meters | |
runs$Distance <- 1000 * runs$Distance | |
ggplotRegression <- function (fit) { | |
View berlin_marathon_2014_participants.R
Distribution of Birth Year and Top 10 Participating Nations in Berlin Marathon 2014 | |
setwd("~/") | |
bm <- read.csv("BerlinMarathon2014.csv", header=T) | |
library(ggplot2) | |
p <- ggplot(bm, aes(birth_date, ..density..)) | |
p <- p + geom_histogram(binwidth=1, colour = "black", fill = "lightblue") + geom_density() | |
p + ggtitle("Distribution of Birth Year for the Berlin Marathon 2014") + xlab("Year of Birth") + ylab("Density") | |
# get the top 10 particpating nations |
View activity_extractor.py
#!/usr/local/bin/python | |
# encoding: utf-8 | |
""" | |
activity_extractor.py | |
Created by Christian Stade-Schuldt on 2013-10-29. | |
""" | |
import os | |
from lxml import etree as et | |
from datetime import timedelta, datetime |
View goeuro_test.py
#!/usr/bin/env python | |
# encoding: utf-8 | |
""" | |
Created by Christian Stade-Schuldt on 2013-11-12. | |
""" | |
import sys | |
import os | |
import csv | |
import json |
View rouletty.py
#!/usr/local/bin/python | |
# encoding: utf-8 | |
import random | |
import time | |
import matplotlib.pyplot as plt | |
import numpy as np | |
#simulates the martingale roulette system | |
def simulation(): | |
View AtlanticCity10Miler.r
data <- read.csv(file = "2008TenMiler.csv", header = TRUE, sep=",") | |
summary(data) | |
data <- na.omit(data) | |
#convert time to minutes | |
data$Nettime <- as.character(data$Nettime) | |
data$Nettime <- sapply(strsplit(data$Nettime, ":"), | |
function(x) { | |
x <- as.numeric(x) | |
x[1]*60 + x[2] + x[3]/60 |
OlderNewer