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
function computeSunrise(day, sunrise) { | |
/*Sunrise/Sunset Algorithm taken from | |
http://williams.best.vwh.net/sunrise_sunset_algorithm.htm | |
inputs: | |
day = day of the year | |
sunrise = true for sunrise, false for sunset | |
output: | |
time of sunrise/sunset in hours */ |
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 | |
# encoding: utf-8 | |
""" | |
berlin_marathon_participants_2014.py | |
Created by Christian Stade-Schuldt on 2013-11-12. | |
""" | |
import urllib | |
import json |
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
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 |
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 bash | |
rrdtool xport -s now-3h -e now --step 300 \ | |
DEF:a=/home/pi/weather/temperatures.rrd:temps1:AVERAGE \ | |
DEF:b=/home/pi/weather/temperatures.rrd:temps2:AVERAGE \ | |
DEF:c=/home/pi/weather/temperatures.rrd:temps3:AVERAGE \ | |
DEF:d=/home/pi/weather/temperatures.rrd:temps4:AVERAGE \ | |
DEF:e=/home/pi/weather/temperatures.rrd:temps5:AVERAGE \ | |
DEF:f=/home/pi/weather/temperatures.rrd:temps6:AVERAGE \ | |
XPORT:a:"Livingroom" \ |
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 bash | |
rrdtool create temperatures.rrd \ | |
--start N \ | |
--step 300 \ | |
DS:temps1:GAUGE:1200:-40:50 \ | |
DS:temps2:GAUGE:1200:-40:50 \ | |
DS:temps3:GAUGE:1200:-40:50 \ | |
DS:temps4:GAUGE:1200:-40:50 \ | |
DS:temps5:GAUGE:1200:-40:50 \ |
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 bash | |
# Receive weather data from remote USB WDE1 and store it into database | |
# Loop forever to read data from USB WDE1 | |
socat / dev/ttyUSB0, B9600 STDOUT | \ | |
while read line | |
do | |
if [["$ {line%% *}" == '$ 1']] then | |
# Format data | |
"{? line # 1, 1,} $" tmp = `echo | tr ',' ','`. |
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
$.ajax({ | |
type: "GET", | |
url: "data/temperature24h.xml", | |
dataType: "xml", | |
success: function(xml) { | |
var series = [] | |
//define series | |
$(xml).find("entry").each(function() { | |
var seriesOptions = { |
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/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 |
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 | |
# encoding: utf-8 | |
""" | |
Created by Christian Stade-Schuldt on 2013-11-12. | |
""" | |
import sys | |
import os | |
import csv | |
import json |
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 numpy as np | |
def rmsle(h, y): | |
""" | |
Compute the Root Mean Squared Log Error for hypthesis h and targets y | |
Args: | |
h - numpy array containing predictions with shape (n_samples, n_targets) | |
y - numpy array containing targets with shape (n_samples, n_targets) | |
""" |
OlderNewer