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
# Stolen from here: http://www.pement.org/sed/sed1line.txt | |
------------------------------------------------------------------------- | |
USEFUL ONE-LINE SCRIPTS FOR SED (Unix stream editor) Dec. 29, 2005 | |
Compiled by Eric Pement - pemente[at]northpark[dot]edu version 5.5 | |
Latest version of this file (in English) is usually at: | |
http://sed.sourceforge.net/sed1line.txt | |
http://www.pement.org/sed/sed1line.txt |
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
# Claas Heuer, November 2015 | |
# install the package | |
install.packages("INLA", repos="http://www.math.ntnu.no/inla/R/stable") | |
# run a test on BGLR data | |
library(INLA) | |
library(BGLR) | |
data(wheat) |
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
# Claas Heuer, November 2015 | |
# | |
# Setup Powerline on Debian and Centos for BASH, VIM and TMUX | |
# source: https://fedoramagazine.org/add-power-terminal-powerline/ | |
# install on debian | |
sudo apt-get install python-pip | |
sudo apt-get install powerline |
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
[//]: # (Claas Heuer, November 2015) | |
[//]: # (Run pandoc like this) | |
[//]: # (pandoc --filter pandoc-crossref -s -S --bibliography references.bib paper_skeleton.txt -o test.docx) | |
[//]: # (pandoc --filter pandoc-crossref -s -S --bibliography references.bib paper_skeleton.txt -o test.pdf) | |
# First Section {#sec:first_section} | |
This is the first section and we are writing an equation that we want to reference to later in | |
the document: |
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 | |
# Claas Heuer, October 2015 | |
# | |
# requires 'littler' - sudo apt-get install littler | |
function fw_to_csv { | |
# first argument is lines to skip if there is some meta data before the actual header | |
local skip_lines=$1 | |
local this_file=$2 |
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
# Claas Heuer, October 2015 | |
insert_sql <- function(conn, # the RJDBC connection | |
table, # the table in the database | |
dat, # an R dataframe | |
cols = NULL, # which columns to insert (non selected will be filled with NULL) | |
start_row = NULL, # from which row in 'dat' to start | |
end_row = NULL, # at which row in 'dat' to stop | |
verbose = TRUE) # print progress to the screen |
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
# Claas Heuer, October 2015 | |
# | |
# first get ffmpeg (http://superuser.com/a/865744) | |
sudo echo deb http://www.deb-multimedia.org stable main non-free >> /etc/apt/sources.list | |
sudo apt-get update | |
sudo apt-get install deb-multimedia-keyring | |
sudo apt-get update | |
sudo apt-get install ffmpeg | |
# go to video directory and extract images (http://unix.stackexchange.com/a/185879) |
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
# Claas Heuer, Oxtober 2015 | |
# | |
# Helpful: | |
# https://docs.docker.com/installation/debian/ | |
# https://hub.docker.com/u/rocker/ | |
# https://hub.docker.com/_/debian/ | |
# https://zeltser.com/docker-application-distribution/ | |
# https://hub.docker.com/ | |
# First install Docker: http://docs.docker.com/linux/step_one/ |
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
# Taken from here: http://stackoverflow.com/a/28044986/2748031 | |
#!/bin/bash | |
# 1. Create ProgressBar function | |
# 1.1 Input is currentState($1) and totalState($2) | |
function ProgressBar { | |
# Process data | |
let _progress=(${1}*100/${2}*100)/100 | |
let _done=(${_progress}*4)/10 | |
let _left=40-$_done |
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
# Claas Heuer, October 2015 | |
# | |
# Maximum A Posteriori Estimation | |
# | |
# Estimate mean and variance of normal iid variables | |
# with a normal prior on the mean | |
# the likelihood function = L(y;.) = y ~ N(mu, sigma) * mu ~ N(0,16) | |
lik <- function(par, y) { |