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 Automata where | |
import Prelude hiding (map, head, foldl, take) | |
import qualified Prelude as P | |
import qualified Data.ByteString as BS | |
import qualified Data.ByteString.Char8 as C | |
import Data.ByteString.Internal (c2w) | |
import qualified Data.Map as M | |
import Data.List (sort) | |
import Data.Tuple |
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
{- | |
One process starts the master process | |
Other start do-nothing process | |
master distributes the work among the other processes | |
-} | |
module Main where | |
import Remote | |
import Control.Monad |
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
from eventlet.pools import Pool | |
from eventlet.timeout import Timeout | |
class SocketPool(Pool): | |
"""A pool of sockets connected to a component | |
If a socket times out in use, simply close if before handing it back to the | |
pool and it will be discarded and a replacement inserted into the pool.""" | |
def __init__(self, address, **kwargs): |
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 NoMonomorphismRestriction #-} | |
module Data.Pcap.Source ( | |
sourcePcap | |
, parsePcap | |
) where | |
import Control.Monad.IO.Class | |
import qualified Data.ByteString as BS | |
import Data.Conduit | |
import qualified Data.Conduit.List as CL | |
import Data.DateTime |
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
-- Arrow definitions | |
arr = arrC | |
first = firstC | |
second = secondC | |
(<<<) :: Coroutine b o -> Coroutine i b -> Coroutine i o | |
cof <<< cog = Coroutine $ \i -> | |
let (x, cog') = runC cog i | |
(y, cof') = runC cof x | |
in (y, cof' <<< cog') |
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
from pyramid.view import view_config | |
from sqlalchemy.ext.associationproxy import AssociationProxy | |
from sqlalchemy.ext.declarative import declarative_base | |
from sqlalchemy.orm import scoped_session, sessionmaker, object_mapper, ColumnProperty, SynonymProperty | |
Session = scoped_session(sessionmaker()) | |
class _PrettyPrintBase(object): | |
"""Base mixin for all of our declarative tables |
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
alias gbr='for k in `git branch|sed "s/^..//"`;do echo -e `git log -1 --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" "$k"`\\t\\t"$k";done | sort -r | sed -e "s/\(^.*\):[0-9]\{2\} +\?[0-9]\{4\} /\1 /" -e "s/minutes/mins/"' | |
alias gbra='for k in `git branch -a|sed "s/^..//"`;do echo -e `git log -1 --pretty=format:"%Cgreen%ci %Cblue%cr%Creset" "$k"`\\t\\t"$k";done | sort -r | sed -e "s/\(^.*\):[0-9]\{2\} +\?[0-9]\{4\} /\1 /" -e "s/minutes/mins/"' |
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
$ nix-shell -I . --pure --show-trace | |
error: while evaluating the attribute `nativeBuildInputs' of the derivation `client' at /home/ben/dev/ghcjs/oHm/examples/ohm-chat-client/default.nix:9:3: | |
cannot coerce a set to a string, at /home/ben/dev/ghcjs/oHm/examples/ohm-chat-client/default.nix:9:3 |
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
./dev-shell | |
[nix-shell:~/dev/hydra]$ ./configure $configureFlags --prefix=/opt/hydra | |
bash: ./configure: No such file or directory | |
[nix-shell:~/dev/hydra]$ ls | |
bootstrap configure.ac COPYING dev-shell doc hydra-module.nix INSTALL Makefile.am README.md release.nix src tests version | |
[nix-shell:~/dev/hydra]$ ./bootstrap | |
autoreconf: Entering directory `.' |
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
insert | |
:: (KnownSymbol k, Typeable i, ChannelType k api ~ i) | |
=> Proxy api -> Proxy k -> f i -> RouteMap f routes -> RouteMap f ((k :> i) ': routes) | |
insert _ pKey i = Routes . Map.insert k (I i) . unRoutes | |
where | |
k = (symbolVal pKey) ^. packed | |
type family Chan (chan :: *) :: * where | |
Chan (chan :> a) = a |