Skip to content

Instantly share code, notes, and snippets.

@mp4096
mp4096 / thesis_kickoff_playbook.md
Last active October 25, 2017 12:45
Thesis kick-off playbook

Thesis kick-off playbook

Preparation

  • Print out:
    • Thesis task description
    • Grading table — not public anymore
    • Safety briefing
    • Relevant papers
  • Code of conduct
@mp4096
mp4096 / rust_on_pi.sh
Created March 31, 2017 12:21
Rust on Raspberry Pi cross-compilation toolchain
# We use ARMv7, so Raspberry Pi >= 2 is required
rustup target add armv7-unknown-linux-gnueabihf
sudo apt-get install gcc-arm-linux-gnueabihf
@mp4096
mp4096 / awesome-toons.md
Last active July 3, 2017 20:10
awesome-toons

Rocko's Modern Life

  • S01E12 Who's for Dinner? / Love Spanked
  • S02E03 The Lounge Singer / She's the Toad
  • S02E05 Boob Tubed / Commuted Sentence
  • S02E07 Hut Sut Raw / Kiss Me, I'm Foreign
  • S02E09 Born to Spawn / Uniform Behavior
  • S02E10 Hair Licked / Gutter Balls
  • S03E03 Sugar Frosted Frights / Ed is Dead: A Thriller!
  • S04E03 Ed Good, Rocko Bad / Teed Off
  • S04E06 S.W.A.K. / Magic Meatball
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
@mp4096
mp4096 / hacking_scipy.sh
Last active October 23, 2016 21:11
Hacking scipy on Linux
# Install dependencies
sudo apt install -y libblas3 gcc gfortran python-dev libblas-dev liblapack-dev cython
# Create a virtualenv and activate it
virtualenv scipy-dev
source ./scipy-dev/bin/activate
# Install Python dependencies
pip install Numpy Nose Cython
@mp4096
mp4096 / latin1_to_utf8.py
Created October 5, 2016 09:04
Convert Latin 1 encoding to UTF-8
from __future__ import print_function
import codecs
import os
import fnmatch
def delete_if_exists(filename):
if os.path.exists(filename):
os.remove(filename)
@mp4096
mp4096 / GenerateHouseholder.m
Created May 29, 2016 21:04
Generate Householder transformation
function P = GenerateHouseholder(a, pad)
alpha = -sign(a(2))*norm(a(2 : end), 2);
r = sqrt(0.5*alpha*(alpha - a(2)));
v = zeros(length(a), 1);
v(2) = 0.5*(a(2) - alpha)/r;
v(3 : end) = 0.5*a(3 : end)/r;
v = [zeros(pad, 1); v];
@mp4096
mp4096 / ppt2pdf.ps1
Created April 28, 2016 10:56
Batch convert PowerPoint files to PDF
# Batch convert all .ppt/.pptx files encountered in folder and all its subfolders
# The produced PDF files are stored in the invocation folder
#
# Adapted from http://stackoverflow.com/questions/16534292/basic-powershell-batch-convert-word-docx-to-pdf
# Thanks to MFT, takabanana, ComFreek
#
# If PowerShell exits with an error, check if unsigned scripts are allowed in your system.
# You can allow them by calling PowerShell as an Administrator and typing
# ```
# Set-ExecutionPolicy Unrestricted
@mp4096
mp4096 / get_campusonline_appointments.py
Last active January 17, 2019 14:28
Batch export of CAMPUSonline appointments from courses matching a regex
from bs4 import BeautifulSoup
import re
import requests
# Global parameters: CAMPUSonline"s base URL and its export URL
CO_BASE_URL = "https://campus.tum.de/tumonline/"
CO_EXPORT_URL = "wbKalender.wbExport?pMode=T"
APPOINTMENTS_PREFIX = "^Termine der LV.*"
@mp4096
mp4096 / AsyncCall.m
Created April 20, 2016 09:16
Asynchronous processes in MATLAB
function AsyncCall(arg1, arg2)
batchFileLocation = 'mybatch.bat';
cmdArgs = sprintf('""%s" "%s" "%s""', batchFileLocation, arg1, arg2);
proc = System.Diagnostics.Process();
proc.StartInfo.FileName = 'cmd.exe';
proc.StartInfo.Arguments = ['/C', cmdArgs];
proc.StartInfo.WindowStyle = System.Diagnostics.ProcessWindowStyle.Hidden;
proc.Start();
end