This file contains hidden or 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 [dip, p_value, xlow,xup]=HartigansDipSignifTest(xpdf,nboot) | |
% function [dip,p_value,xlow,xup]=HartigansDipSignifTest(xpdf,nboot) | |
% | |
% calculates Hartigan's DIP statistic and its significance for the empirical p.d.f XPDF (vector of sample values) | |
% This routine calls the matlab routine 'HartigansDipTest' that actually calculates the DIP | |
% NBOOT is the user-supplied sample size of boot-strap | |
% Code by F. Mechler (27 August 2002) |
This file contains hidden or 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
# a simple list of UNIX / shell commands to download the Shakespeare play "King | |
# Richard III" in text format and do a quick demo of text commands. | |
# | |
# it uses the command curl to download and grep, tr, wc sort, unique etc. | |
# | |
# make a temporary directory somewhere | |
cd ~ | |
mkdir grepdemo | |
cd ~/grepdemo |
This file contains hidden or 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
# assuming you are on OSX / similar and have pandoc installed | |
if [[ -z `which pandoc` ]]; then | |
echo "uhoh.."; | |
echo "consider running: brew install pandoc"; | |
exit 1; | |
fi | |
# given a markdown document "notes.md" that you want to convert to PDF | |
# -f FROM |
This file contains hidden or 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
# example julia code to explain a few important concepts | |
# - originally run in a jupyter notebook | |
using PyPlot | |
using Distributions | |
# if you get an error with these first two, you might have to | |
# Pkg.add("PyPlot") | |
# Pkg.add("Distributions") |
This file contains hidden or 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
% example of how to automate / "mail merge" some | |
% | |
% e.g. create a multipage PDF document in which only specific things are | |
% changed on each page (certificates, thank you notes, etc) | |
% | |
% to split PDFs, can use a Terminal command (pdftk) or similar | |
% | |
% ds 2016-02-20 | |
\documentclass[12pt]{article} |
This file contains hidden or 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 R | |
# | |
# textmine shakespeare's richard iii - turn it into a wordcloud with R | |
# | |
# 2016/12/24 - ds | |
# make sure you have necessary packages | |
# packages = c("tm", "wordcould") | |
library(wordcloud) |
This file contains hidden or 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
# so you can use bash shell niceties when running R. | |
R CMD BATCH theRScriptYouWantToRun.R |
This file contains hidden or 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
# when downloading from moodle, filenames (incl. zip files) have annoying white spaces in them | |
# | |
# ds 201701 | |
#filetype, e.g. | |
ending=.zip | |
# loop through | |
for i in *${ending}; do | |
# make a new filename without blanks |
This file contains hidden or 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
# using pdfjam to turn smaller files into 2-up, A4. | |
# | |
# as seen on: http://superuser.com/questions/366490/how-to-merge-multiple-pdf-files-onto-one-page-with-pdftk | |
# | |
# brew install homebrew/tex/pdfjam | |
# the 2017-2-ta.tex file uses the \foreach construct from \usepackage{tikz} | |
# which allows | |
# \def\mylist{info/something else/a third thing, | |
# info/something else/yet another thing} |
This file contains hidden or 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
%% introduction to gramm | |
% | |
% ds 20170309 | |
% | |
% the following is adapted from the website for GRAMM | |
% https://github.com/piermorel/gramm | |
clear all | |
close all |