Skip to content

Instantly share code, notes, and snippets.

View clausecker's full-sized avatar

Robert Clausecker clausecker

View GitHub Profile
module Main where
main = print "Fibonaccis:\n" >> p
f@(_:x)=0:1:zipWith(+)f x
p=i 0 where
i 10=IO()
i n=print ((show (f!!n))++"\n")>>i (n+1)
diff --git a/po/de.po b/po/de.po
index 99d2ed1..b45283a 100644
--- a/po/de.po
+++ b/po/de.po
@@ -9,7 +9,7 @@ msgid ""
msgstr ""
"Project-Id-Version: de\n"
"Report-Msgid-Bugs-To: [email protected]\n"
-"PO-Revision-Date: 2010-07-29 13:44+0100\n"
+"PO-Revision-Date: 2010-08-11 23:08+0800\n"
[core]
repositoryformatversion = 0
filemode = true
bare = false
logallrefupdates = true
autocrlf = false
[svn-remote "svn"]
url = svn+ssh://[email protected]/svn/wormux
fetch = trunk:refs/remotes/trunk
branches = branches/*:refs/remotes/*
\documentclass{article}
\usepackage{fancyvrb}
\usepackage{color}
\usepackage[utf8]{inputenc}
\makeatletter
\def\PY@reset{\let\PY@it=\relax \let\PY@bf=\relax%
\let\PY@ul=\relax \let\PY@tc=\relax%
#This program was created by Georg Brandl
#<[email protected]> (!)
#This program was raised into public domain by its owner.
#You can use it everywhere whithout permission, but please
#provide this information.
#
#How to use:
#lhs_highlighter.py file.lhs > file.tex
#
#The program converts Haskell snippets in literate sourcecode
@clausecker
clausecker / leaky.hs
Created May 12, 2011 19:27
Leaky program
{-# Language TupleSections #-}
import System.Random
import Data.Map (fromListWith,Map)
import Control.Arrow
randomStream 0 g = ([],g)
randomStream n g = (a:as,g'') where
(a,g') = randomR (0,100) g
(as,g'') = randomStream (n-1) g'
@clausecker
clausecker / pretty_print.c
Created November 7, 2011 20:47
Pretty printer for MMIX opcodes
#include <stdio.h>
#include <inttypes.h>
#include "pretty_print.h"
const char *opcodes[256] = {
"trap","fcmp","fun","feql","fadd","fix","fsub","fixu", /* 0x0# */
"flot","flot","flotu","flotu","sflot","sflot","sflotu","sflotu",
"fmul","fcmpe","fune","feqle","fdiv","fsqrt","frem","fint", /* 0x1# */
"mul","mul","mulu","mulu","div","div","divu","divu",
@clausecker
clausecker / tcc.c
Created August 18, 2012 20:48 — forked from anonymous/blocks.c
Simple block-based intra-frame-coding using a ring-buffer
#include <stdio.h>
#include <stdlib.h>
#include <stdint.h>
#include <string.h>
#include <stdbool.h>
#include "image.h"
#include "ppm.h"
#include "databuffer.h"
#include "rangecode.h"
@clausecker
clausecker / image.c
Created August 22, 2012 18:43
Predictors patched to predict only based on x channel
/*
* QTC: image.c (c) 2011, 2012 50m30n3
*
* This file is part of QTC.
*
* QTC is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
@clausecker
clausecker / paeth.c
Created August 24, 2012 15:04
Improved Paeth-transformation
#include <stdlib.h>
int naive_paeth(int a, int b, int c) {
int
p = a + b - c,
pa = abs(p - a),
pb = abs(p - b),
pc = abs(p - c);
if (pa <= pb && pa <= pc) return a;