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
#!/bin/bash | |
# read and evaluate SML output received from EMH eHZ | |
# set serial device | |
INPUT_DEV="/dev/ttyUSB0" | |
#set $INPUT_DEV to 9600 8N1 | |
stty -F $INPUT_DEV 1:0:8bd:0:3:1c:7f:15:4:5:1:0:11:13:1a:0:12:f:17:16:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0:0 | |
SML_START_SEQUENCE="1B1B1B1B0101010176" |
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
sleep <- read.csv(file="sleepdata.csv", header=T, sep=";") | |
#split end time | |
sleep$End <- as.character(sleep$End) | |
#get the date | |
sleep$Date <- sapply(strsplit(sleep$End, " "),"[[",1) | |
sleep$Date <- strptime(sleep$Date, format="%Y-%m-%d") | |
#fix sleep quality |
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
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 |
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
#!/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
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
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) { | |
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 | |
""" | |
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_*] |
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 | |
""" | |
pysml.py | |
Created by Christian Stade-Schuldt on 2014-10-25. | |
""" | |
import sys | |
import os | |
import 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
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(): |