Skip to content

Instantly share code, notes, and snippets.

View dettmering's full-sized avatar

Till Dettmering dettmering

View GitHub Profile
@dettmering
dettmering / bahncard-vs-auto.Rmd
Last active September 20, 2015 17:20
Wochenendpendeln mit Bahn + BahnCard 50 oder Auto—was ist billiger?
```{r echo = FALSE, results = 'show'}
library(knitr)
```
# Vergleich Pendeln mit Auto vs. Bahn mit BahnCard 50
```{r}
# Fahrten pro Jahr (Wochenenden pro Jahr abzgl. Urlaub/Feiertage)
n.fahrten <- (52 - 7) * 2 # Fahrten in eine Richtung
@dettmering
dettmering / install-r.sh
Last active August 31, 2015 17:40
Compile R on Raspberry Pi
#!/bin/bash
# This can take a while. Run in a screen environment.
# Modify for the version you want to install.
RVERSION=3.2.2
sudo apt-get install screen gfortran libreadline6-dev libx11-dev libxt-dev
cd ~
@dettmering
dettmering / ml.R
Last active August 29, 2015 14:20
Machine learning template for R
library(caret)
library(doMC)
registerDoMC(cores = 4) # use multiple cores
set.seed(1234)
col.of.interest <- c(
'response', 'A', 'B', 'C'
)
@dettmering
dettmering / imgrename.sh
Created February 14, 2014 13:49
Bash: Renames groups of images (329L_**_000x.tif) with a combined md5 hash of the group (329L_**-bac8dacd79_000x.tif)
#!/bin/bash
# Rename image files with md5 hash
mkdir out
for f in *.tif
do
splt=(${f//_/ })
c=$(cat ${splt[0]}\_${splt[1]}\_* | md5) # 329L_23_*
o=${splt[0]}\_${splt[1]}\-${c:0:10}\_${splt[2]}