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.Array | |
import Data.Maybe | |
import Data.Char | |
import Data.List.Split | |
import Control.Arrow | |
data File = A|B|C|D|E|F|G|H deriving (Enum,Show,Eq,Ord,Ix) | |
type Dist = Int |
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.Arrow | |
import Data.List | |
import Data.Maybe | |
import Data.Ord | |
import qualified Data.Set as S | |
type State = (Integer,Integer) | |
data Vessel = A | B deriving (Show,Eq) |
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
-- MIND YOUR EYES! DIRTY CODE AHEAD. | |
import Control.Monad | |
import qualified Data.Map as M | |
import qualified Data.Set as S | |
import Data.List | |
import System | |
import System.IO | |
import Data.List | |
import Data.Ord |
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.Logic | |
import Data.List | |
foo :: Logic Bool | |
foo = do [c2,c3,c4,c5,c6,c7,cJ,cA] <- sequence . replicate 8 $ return True `mplus` return False | |
guard $ c3 `thinks` sane cA | |
guard $ c4 `thinks` not (not (sane c2) && not (sane c3)) | |
guard $ c5 `thinks` sane cA == sane c4 | |
guard $ c6 `thinks` sane cA && sane c2 | |
guard $ c7 `thinks` not (sane c5) |
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 DeriveDataTypeable #-} | |
import Data.Generics.Zipper | |
import Data.Data | |
-- | our tree def | |
data Tree a = Empty | Fork a (Tree a) (Tree a) | |
deriving (Typeable,Data) |
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
\documentclass{article} | |
\usepackage{tikz} | |
\usetikzlibrary{arrows} | |
\begin{document} | |
\begin{tikzpicture}[scale=2.3] | |
\node (1) at (-0.77,0.5) {$1$}; | |
\node (NL) at (0,1) {$N$}; |
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
use Modern::Perl; | |
while (<>) { | |
# Kill | |
s{<abr>\w+</abr> \s+ <rref>.*wav</rref>}{}xg; | |
s{<rref>.*\.(wav|jpg)</rref>}{}g; | |
# Head | |
s{<k>.*</k>}{}; |
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 ForeignFunctionInterface #-} | |
import System.Environment | |
import qualified Data.Vector as V | |
import Control.Monad (join) | |
import Data.Word | |
import Criterion.Main | |
import Foreign.C | |
import Foreign.Marshal | |
import Foreign.Ptr |
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
#include <stdio.h> | |
int result_c (int max_a0, int *max_len_r, int *longest_r) { | |
int longest = 0, max_len = 0; | |
int a0, len; | |
unsigned long a; | |
for (a0 = 1; a0 <= max_a0; a0++) { | |
a = a0; | |
len = 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
[lelf@dragon ~]$ echo 11111111 > myfile | |
[lelf@dragon ~]$ sync | |
[lelf@dragon ~]$ echo 22222222 >> myfile | |
[lelf@dragon ~]$ sync | |
[lelf@dragon ~]$ hammer history myfile | |
myfile 00000001073a3ee6 clean { | |
00000001073abc60 08-Dec-2013 23:05:34 | |
00000001073abd20 08-Dec-2013 23:05:47 | |
} |
OlderNewer