This file contains hidden or 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
| -- n: the number of identical characters a before index i | |
| -- k: the number of at most two different characters a and b before i | |
| step :: (Eq a, Num t) => a -> (t, t, a, a) -> (t, t, a, a) | |
| step x (n,k,a,b) | |
| | x==a = (n+1,k+1,x,b) | |
| | x==b = (1,k+1,x,a) | |
| | otherwise = (1,n+1,x,a) | |
| useStepBytestring :: B.ByteString -> B.ByteString | |
| useStepBytestring bs |
This file contains hidden or 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
| syntax on | |
| set gfn=Monospace\ 11 | |
| set guioptions-=T "remove toolbar | |
| set lines=100 | |
| set columns=200 | |
| vmap <C-C> "+y | |
| map <A-Left> :tabprevious<CR> | |
| map <A-Right> :tabnext<CR> | |
| " map <C-T> :tabnew<CR> |
This file contains hidden or 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(foldl') | |
| data Operator = Plus | Minus | Div | Mult | None | Id Double deriving(Eq,Show) | |
| operators = [Plus,Minus,Div,Mult,None] | |
| higher :: Operator -> Operator -> Bool | |
| higher None None = False | |
| higher None _ = True | |
| higher Div Plus = True | |
| higher Div Minus = True |
This file contains hidden or 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 #-} | |
| module VoltageFFI | |
| ( | |
| voltageStateC | |
| ,addListenerC | |
| ,normal_voltage | |
| ,voltageChangeC | |
| ,c_timeoutEvent | |
| ,c_tearDown | |
| ) |
This file contains hidden or 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, Arrows #-} | |
| module Main where | |
| import Prelude hiding (id) | |
| import Data.Monoid(mempty) | |
| import qualified Data.Map as M | |
| import Control.Category (id) | |
| import Control.Arrow((&&&),arr,(>>>),(>>^)) | |
| import Hakyll |
This file contains hidden or 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 System.FilePath.FindCompat | |
| import System.FilePath.Posix | |
| import Control.Exception | |
| import qualified Data.ByteString as BS | |
| import qualified Data.Map as M | |
| import Control.Applicative | |
| import qualified Data.ByteString.Char8 as BSC | |
| import Text.Regex | |
| import Data.Maybe(isJust) |
This file contains hidden or 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
| var http = require('http'), | |
| util = require('util'), | |
| formidable = require('formidable'), | |
| server; | |
| global.TEST_PORT = 13532; | |
| server = http.createServer(function(req, res) { | |
| if (req.url == '/') { | |
| res.writeHead(200, {'content-type': 'text/html'}); |
This file contains hidden or 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 LuaIntegration where | |
| import qualified Scripting.Lua as Lua | |
| lua_noerrors = 0 | |
| lua_yield = 1 | |
| lua_errrun = 2 | |
| lua_errsyntax = 3 | |
| lua_errmem = 4 |
This file contains hidden or 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
| -- Echo server program | |
| module Main where | |
| import Control.Monad (unless,when) | |
| import Network.Socket hiding (recv) | |
| import qualified Data.ByteString as S | |
| import Data.Word(Word8) | |
| import Control.Concurrent(threadDelay) | |
| import Data.List | |
| import Numeric |
This file contains hidden or 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
| # # usage | |
| # require 'cxxproject' | |
| # | |
| # cxx_configuration "Test" do | |
| # exe "bla", :source => FileList[*.arxml] | |
| # lib "lib1", :source => "xxx/azzz/" | |
| # end | |
| CxxConfigs = [] |