Skip to content

Instantly share code, notes, and snippets.

View kdungs's full-sized avatar
🇦🇶
Nett hier. Aber waren Sie schon mal in Baden-Württemberg?

Kevin Dungs kdungs

🇦🇶
Nett hier. Aber waren Sie schon mal in Baden-Württemberg?
View GitHub Profile
@kdungs
kdungs / bronstein.sh
Created October 30, 2012 20:34
Create local copy of digital Bronstein.
#!/bin/sh
# Only works from within the university's network!
wget --mirror -k -E http://cdroms.digibib.net/bronstein/
@kdungs
kdungs / pw.py
Created August 18, 2012 19:51
Random password generator.
#!/usr/bin/env python
import string as s
from random import randint
from sys import argv
CHARS = s.ascii_letters + s.digits + s.punctuation
def main(argc, argv):
l = 12
@kdungs
kdungs / settings.py
Created August 18, 2012 19:50
Example settings for tippspiel.
# Django settings for bundesliga project.
from django.conf.global_settings import TEMPLATE_CONTEXT_PROCESSORS
from os.path import dirname, join
ROOT = dirname(__file__)
DEBUG = True
TEMPLATE_DEBUG = DEBUG
@kdungs
kdungs / bundesliga_emblems.py
Created August 1, 2012 22:21
If you ever happen to need the emblems of Bundesliga football teams.
#!/usr/bin/env python
from os import mkdir, path
from PIL import Image
from requests import get
from StringIO import StringIO
BASE = "http://www.bundesliga.de/pics/_2012/wappen"
SIZES = (25, 80)
TEAMS = {
@kdungs
kdungs / dl_numerical_analysis.sh
Created July 11, 2012 14:03
Quickly download all assignments and solutions for Numerical analysis in Heidelberg (2011) and Dortmund (2012).
#!/usr/bin/env zsh
for i in {01..14}
do
wget http://numerik.uni-hd.de/\~lehre/SS11/numerik/Docs/Loesungen/loesung_$i.pdf
wget http://numerik.uni-hd.de/\~lehre/SS11/numerik/Docs/Uebungen/uebung_$i.pdf
wget http://www.mathematik.tu-dortmund.de/lsx/cms/media/numphy2012/Blatt$i.pdf
wget http://www.mathematik.tu-dortmund.de/lsx/cms/media/numphy2012/Loesung$i.pdf
done
@kdungs
kdungs / skiplist.cpp
Created May 14, 2012 20:25
I just found this among my backups. I implemented this in year 2008 as a high school student attending a lecture at university. It's an English-German-dictionary implemented through a skiplist. I don't know if this works, but it might have back then...
#include "Skiplist.h"
#include <iostream>
#include <fstream>
using namespace std;
int main(int argc, char ** argv)
{
Dictionary dict;
static char QUIT = 'q';
#include <iostream>
#include <boost/serialization/strong_typedef.hpp>
BOOST_STRONG_TYPEDEF(double, Time)
BOOST_STRONG_TYPEDEF(double, Distance)
BOOST_STRONG_TYPEDEF(double, Velocity)
Velocity calculateVelocity(Distance d, Time t) {
return Velocity{static_cast<double>(d) / static_cast<double>(t)};
}
package main
import (
zmq "github.com/pebbe/zmq4"
//"golang.org/x/net/websocket"
"errors"
"fmt"
"strconv"
"strings"
@kdungs
kdungs / Makefile
Created May 4, 2015 23:18
Code for blog post.
CXX=clang++
CXXFLAGS=-O3 -Werror -Weverything -pedantic -Wno-c++98-compat -std=c++14
all: test_mult
clean:
rm -f test_mult
@kdungs
kdungs / higherorder.cc
Last active August 29, 2015 14:19
Code for my blog post on Higher Order Functions in C++.
#include <cassert>
#include <functional>
//
// Classical Function Definition
//
int add(int x, int y) {
return x + y;
}