Skip to content

Instantly share code, notes, and snippets.

View Feh's full-sized avatar

Julius Plenz Feh

View GitHub Profile
@Feh
Feh / Labyrinth.java
Created June 15, 2011 09:58
Labyrinth
/**
* Assignment 9, exercise 3
* Class representing a labyrinth
* Two constructors are already implemented, also a method to print out the labyrinth and its solution
*
* @author Lisa Julia Nebel Julius Plenz
*/
// TODO Take a look how this class works.
// TODO Look at the docstrings, document your own functions
@Feh
Feh / fgrep.go
Created October 26, 2012 21:18
When the disk cache is full, grep(1) is single-threaded and CPU-bound. I tried implementing a simple "fgrep -IR" in Go using channels and one goroutine per file, but the program is an order of magnitude slower. Why?
package main
import (
"fmt"
"os"
"io"
"bufio"
"strings"
"flag"
"bytes"
@Feh
Feh / Radixsort.java
Created June 23, 2011 19:55
Radixsort
import java.util.Queue;
import java.util.LinkedList;
import java.io.File;
import java.io.FileWriter;
import java.io.BufferedWriter;
import java.io.IOException;
public class R {
public static void main(String[] args) {
int len = 10;
@Feh
Feh / git-ff-track
Created October 24, 2010 13:12 — forked from esc/git-ff-track
#!/bin/bash
# fast-forward local tracking branch if you get something like (on git checkout):
# Your branch is behind 'origin/master' by 1 commit, and can be fast-forwarded.
# Author: Valentin Haenel <valentin.haenel@gmx.de>
# Licence: wtfpl <http://sam.zoy.org/wtfpl/>
BRANCH=$( git branch | grep ^* | cut -f1 -d' ' --complement )
if [[ -z $BRANCH ]] ; then
# not a git repository
exit 1
zsh> ./kamusi -qs president
noun: urais; mkuu; mrajis; rais
zsh> ./kamusi -qsd sw rais
verb: play the hypocrite
noun: chairman; chairman; president