- fühlen
- ändern // to change
- leisten // to afford
- überlegen // to think throughly
- wünschen // to wish
- vorstellen // to introduce / to imagine
This file contains 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
{-# LANGUAGE OverloadedStrings #-} | |
import Network.Wai | |
import Network.Wai.Handler.Warp (run) | |
import Network.HTTP.Types (status200) | |
cedartrunk request = do | |
case referer of | |
Nothing -> return $ ResponseFile status200 [("Content-Type", "text/html")] "index.html" Nothing | |
Just _ -> return $ ResponseFile status200 [] path Nothing | |
where path = tail . tail . init . show . rawPathInfo $ request |
This file contains 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
data Tree a = Nil | Node a (Tree a) (Tree a) deriving (Eq) | |
data Inbalance = Balanced | LL | RR | LR | RL deriving (Show, Eq) | |
(+++) :: (Eq a, Ord a) => Tree a -> a -> Tree a | |
(+++) = insert | |
instance (Show a, Eq a) => Show (Tree a) where | |
show tree = draw tree (height tree) ++ "\n pre: " ++ show (preorder tree) ++ "\n in: " ++ show (inorder tree) | |
where |
This file contains 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
import Control.Monad (mapM_) | |
import System.Random | |
import System.Cmd | |
import System.Environment (getArgs) | |
import Data.List (intercalate, nub) | |
type Size = Int | |
type Constraint = (Variable, Variable) | |
data Variable = Variable Int deriving (Eq) | |
data Map = Map Size Size [Constraint] |
This file contains 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
// | |
// HASKELL FTW | |
// | |
typedef const int Int; | |
typedef const int Bool; | |
// data List a = Cons a (List a) | Nil | |
typedef const enum ListType { Nil, Cons } ListType; | |
typedef const struct List { |
This file contains 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
adapter :: (Ptr CUChar -> CUInt -> Ptr CUChar -> Ptr CUInt -> IO CInt) -> Int -> String -> String | |
adapter function chunkSize content = map cuchar2char $ unsafePerformIO $ do | |
-- allocate buffers | |
inputBuffer <- mallocArray chunkSize | |
outputBuffer <- mallocArray chunkSize | |
outputSize <- mallocBytes 32 | |
-- put it in | |
pokeArray inputBuffer (map char2cuchar content) | |
poke outputSize (fromIntegral chunkSize) |
- avenir
- asap
- oldenburg
- museo slab
- monda
- economica
- lato
- iterstatecondmono
- oxygen
- rambla
This file contains 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
import Data.List | |
import Data.Bits | |
fib :: Int -> Integer | |
fib n = snd . foldl' fib' (1, 0) . dropWhile not $ | |
[testBit n k | k <- let s = bitSize n in [s-1,s-2..0]] | |
where | |
fib' (f, g) p | |
| p = (f*(f+2*g), ss) | |
| otherwise = (ss, g*(2*f-g)) |