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
+-ifndef( __CPE_PARAMETER_HRL__ ). | |
+-define( __CPE_PARAMETER_HRL__, 1). | |
+ | |
+-define( NOTIFY_NONE , 0 ). | |
+-define( NOTIFY_PASSIVE, 1 ). | |
+-define( NOTIFY_ACTIVE , 2 ). | |
+ | |
+-type notify() :: ?NOTIFY_NONE | ?NOTIFY_PASSIVE | ?NOTIFY_ACTIVE. | |
+ | |
+-define( IS_NOTIFY(N), (N>=?NOTIFY_NONE andalso N=<?NOTIFY_ACTIVE) ). |
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
#!/bin/sh | |
# This scripts control incomming and outcomming bandwight in a linux router box | |
# The linux box only have one eth0 connect to the local network and other to internet | |
# ifb0 is a a special device create only for limit the incomming bandwight in eth0 | |
# It is configured for match a 192.168.1.0/24 network, with 255 hosts | |
# The limit for up/down is 20Mb (20480kbit), divide this bandwight for every host (in this case 80kbit) | |
wanif=eth2.2 |
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(picoparser). | |
-export([ str/0 | |
, str/1 | |
, str_/0 | |
, seq/1 | |
, any/1 | |
, whatever/0 | |
, many/1 | |
, match/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
{-# Language MultiParamTypeClasses, FlexibleInstances, TypeFamilies, GeneralizedNewtypeDeriving #-} | |
module Main where | |
-- Module A -- interface | |
import Control.Monad.State | |
import Data.Conduit | |
import qualified Data.Conduit.List as CL | |
class ISnafu t 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
source :: MonadIO m => Int -> Source m BS.ByteString | |
source n = replicateM_ n $ do | |
n <- liftIO $ liftM (succ.(`mod` 15)) randomIO | |
s <- liftIO $ replicateM n (randomIO :: IO Word8) | |
yield (BS.pack s) | |
putter :: Putter BS.ByteString | |
putter s = 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
{-# Language MultiParamTypeClasses | |
, TypeFamilies | |
, FlexibleContexts | |
, FlexibleInstances #-} | |
module Main where | |
import qualified Data.List as L | |
import qualified Data.Vector as V | |
import qualified Data.Vector.Unboxed as U |
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 CWriter where | |
import Prelude hiding (EQ, GT) | |
import Data.List | |
import Data.Functor.Identity | |
import Control.Monad.Writer | |
import Control.Monad.State | |
import Text.Printf | |
import EncodeVM |
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
line :: Parser () | |
line = do | |
a <- hexadecimal >> char ':' | |
b <- hexadecimal >> char ':' | |
c <- hexadecimal | |
skipSpace | |
s <- A.takeWhile (not.C.isSpace) | |
skipWhile endOfLine | |
return () |
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
ethParser = (try line <|> other) `sepBy` (char '\n') | |
other :: Parser (Maybe EthCode) | |
other = A.skipWhile (/= '\n') >> return Nothing | |
line :: Parser (Maybe EthCode) | |
line = do | |
a <- hexadecimal :: Parser Word8 | |
char ':' | |
b <- hexadecimal :: Parser Word8 |
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
search = parseOnly (manyTill (anyChar *> pure False) (asciiCI "android" *> pure True) *> pure True) s |
OlderNewer