ror, scala, jetty, erlang, thrift, mongrel, comet server, my-sql, memchached, varnish, kestrel(mq), starling, gizzard, cassandra, hadoop, vertica, munin, nagios, awstats
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
package main | |
import ( | |
"io/ioutil" | |
"log" | |
"net" | |
"net/http" | |
"net/url" | |
"strings" | |
"time" |
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
package main | |
import ( | |
"bytes" | |
"encoding/hex" | |
"flag" | |
"fmt" | |
"io" | |
"log" | |
"net" |
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
// Implementation of a UDP proxy | |
package main | |
import ( | |
"flag" | |
"fmt" | |
"log" | |
"net" | |
"os" |
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.State | |
import Control.Monad.Identity | |
import Data.Char(toUpper) | |
test1 :: State Int (Int,Int) | |
test1 = do | |
a <- get | |
modify (+1) | |
b <- get |
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
keliven@keliven:~/haskell_example$ cat fib_3.hs | |
import System.Environment | |
fib = 0:1:(zipWith (+) fib (tail fib)) | |
main = do | |
args <- getArgs | |
print $ (fib !!) $ read $ args !! 0 |
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
module Main where | |
import Text.Parsec | |
import Text.Parsec.String | |
input_text :: String | |
input_text = "foo123:" | |
main :: IO () | |
main = do |
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
module AVLTree where | |
data BT = L | N Int BT BT deriving (Show, Eq) | |
-- Nice, small and useful functions | |
empty = L | |
-- You could say, depth L == Nothing depth (N v L L) == Just 0, but works for | |
-- me better this way: | |
depth L = 0 | |
depth (N _ t u) = (max (depth t) (depth u)) + 1 |
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.Maybe (isJust) | |
data Tree a = Leaf | Node (Tree a) a (Tree a) | |
replace :: a -> Tree a -> Tree a | |
replace a Leaf = Node Leaf a Leaf | |
replace a (Node l _ r) = Node l a r | |
rotateR :: Tree a -> Tree a | |
rotateR (Node (Node x a y) b z) = Node x a (Node y b z) |
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 GADTs #-} | |
{-# LANGUAGE RankNTypes #-} | |
{-# LANGUAGE StandaloneDeriving #-} | |
module RedBlackTree where | |
data Zero | |
data Succ n | |
type One = Succ Zero | |
data Black |
OlderNewer