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
| newtype SpecialChar = SC { unSC :: Char } deriving Show | |
| instance Arbitrary SpecialChar where | |
| arbitrary = do | |
| x <- oneof [choose ('\0','\55295'), choose ('\57344','\1114111')] | |
| return (SC x) |
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
| class BuildingBlock | |
| attr_accessor :name, :base | |
| attr_reader :config, :dependencies | |
| def initialize(config, name) | |
| @name = name | |
| @dependencies = [] | |
| @config = config | |
| ALL_BUILDING_BLOCKS[@name] = self | |
| end |
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 = [] |
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
| 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
| 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
| {-# 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
| {-# 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 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
| 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 |
OlderNewer