_id stringlengths 64 64 | repository stringlengths 6 84 | name stringlengths 4 110 | content stringlengths 0 248k | license null | download_url stringlengths 89 454 | language stringclasses 7
values | comments stringlengths 0 74.6k | code stringlengths 0 248k |
|---|---|---|---|---|---|---|---|---|
d42c5796946c6c13f5a48be459a78031d96f082bc94ab4002d98899be48bca0b | lehins/Color | HSV.hs | {-# LANGUAGE DeriveTraversable #-}
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE BangPatterns #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PatternSynonyms #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #... | null | https://raw.githubusercontent.com/lehins/Color/d901f169753add6366d5351658dd6152220651a9/Color/src/Graphics/Color/Model/HSV.hs | haskell | # LANGUAGE DeriveTraversable #
# LANGUAGE BangPatterns #
|
License : BSD3
Stability : experimental
Portability : non-portable
---------
- HSV ---
---------
| Hue, Saturation and Value (Brightness) color model.
| Constructor for @HSV@.
# COMPLETE ColorHSV #
| Constructor for @HSV@ with alpha channel.
# COM... | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PatternSynonyms #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #
# LANGUAGE ViewPatterns #
Module : Graphics . Color . Mo... |
b9f4130c7f554f16f807c11efc5995551d33e01905cb655727774fb71d91eb65 | huangjs/cl | graham-old.lisp | The code in this file was mechanically extracted from the TeX
; source files of _Ansi Common Lisp_.
; If you have questions or comments about this code, or you want
; something I didn't include, send mail to .
; *** list ***
(defun compress (x)
(if (consp x)
(compr (car x) 1 (cdr x))
x))
(defun com... | null | https://raw.githubusercontent.com/huangjs/cl/96158b3f82f82a6b7d53ef04b3b29c5c8de2dbf7/lib/other-code/cs325/www.cs.northwestern.edu/academics/courses/325/programs/graham-old.lisp | lisp | source files of _Ansi Common Lisp_.
If you have questions or comments about this code, or you want
something I didn't include, send mail to .
*** list ***
*** dat ***
*** con ***
*** fn ***
*** io ***
*** sym ***
*** num ***
*** mac ***
*** mod ***
*** speed ***
*** web ***
*** inf ***
*** ob ***
*** a... | The code in this file was mechanically extracted from the TeX
(defun compress (x)
(if (consp x)
(compr (car x) 1 (cdr x))
x))
(defun compr (elt n lst)
(if (null lst)
(list (n-elts elt n))
(let ((next (car lst)))
(if (eql next elt)
(compr elt (+ n 1) (cdr lst))
... |
4adb49ada95390fa04fdd18de89b2a46bbf0897df87fcfc28cfb8368bee26367 | SKA-ScienceDataProcessor/RC | Metrics.hs |
module Profiling.CUDA.Metrics
( cuptiMetricsInit
, cuptiMetricsEnable
, cuptiMetricsDisable
, cuptiGetMetrics
) where
import Control.Monad (when, forM)
import Data.List (intercalate)
import Data.Word
import Foreign.C.Types
import Foreign.C.String
import Foreign.Marshal.Alloc
import Foreign.Ptr
i... | null | https://raw.githubusercontent.com/SKA-ScienceDataProcessor/RC/1b5e25baf9204a9f7ef40ed8ee94a86cc6c674af/MS6/dna/cupti/Profiling/CUDA/Metrics.hs | haskell | | Initialises CUPTI metrics with a list of metrics to
calculate. Due to hardware limits and our design, only certain
metrics and metric combinations will work correctly here. Things to
keep in mind:
* Some metrics will cause CUDA to generate instrumentation code.
This will obviously reduce performance. Accor... |
module Profiling.CUDA.Metrics
( cuptiMetricsInit
, cuptiMetricsEnable
, cuptiMetricsDisable
, cuptiGetMetrics
) where
import Control.Monad (when, forM)
import Data.List (intercalate)
import Data.Word
import Foreign.C.Types
import Foreign.C.String
import Foreign.Marshal.Alloc
import Foreign.Ptr
i... |
c1300220a27ec56fb62bf42f9afe718734fc8ed8bf1e34ae8d5b5c3238f92737 | ZHaskell/stdio | UnalignedAccess.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE CPP #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE MagicHash #-}
# LANGUAGE UnboxedTuples #
|
Module : Std . Data . PrimArray . UnalignedAccess
Description : unaligned access for primitive arrays
Copyright : ( c ) , 2017 - 2019
... | null | https://raw.githubusercontent.com/ZHaskell/stdio/7887b9413dc9feb957ddcbea96184f904cf37c12/std-data/Std/Data/PrimArray/UnalignedAccess.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE MagicHash #
toggle these defs to test different implements
#define USE_SHIFT
------------------------------------------------------------------------------
| Primitive types which can be unaligned accessed
| little endianess wrapper
| big endianess wrapper
-----... | # LANGUAGE CPP #
# LANGUAGE FlexibleInstances #
# LANGUAGE UnboxedTuples #
|
Module : Std . Data . PrimArray . UnalignedAccess
Description : unaligned access for primitive arrays
Copyright : ( c ) , 2017 - 2019
License : BSD
Maintainer :
Stability : experimental
... |
6cd6f6fd095dae7e6a93a485373e3942f19365a2b52979f0055e0bf135f4141b | farr/mcmc-ocaml | mcmc.mli | mcmc.mli : MCMC samplers and utilities .
Copyright ( C ) 2011 Will < >
This program is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at ... | null | https://raw.githubusercontent.com/farr/mcmc-ocaml/56e46b8539cb8d6fada2cb09810363adf18f4c60/mcmc.mli | ocaml | * Store probability information unboxed.
* [combine_jump_proposals \[(p1, jump1, log_jump_prob1); ...\]]
combines the given list of jump proposals into a single jump
proposal and jump probability which chooses [jump1] with
probability proportional to [p1], etc. The probabilities need not
be normalized... | mcmc.mli : MCMC samplers and utilities .
Copyright ( C ) 2011 Will < >
This program is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at ... |
77989d48e8b1c9dacd8e3b240c951c2e8d2e60081e4ab82e62ce60f7e9455717 | haskell-numerics/random-fu | RVar.hs | {-# LANGUAGE RankNTypes, FlexibleInstances, MultiParamTypeClasses #-}
module Data.Random.RVar
( RVar, runRVar
, RVarT, runRVarT, runRVarTWith
, RGen(..), uniformRVarT, uniformRangeRVarT
) where
import Data.Random.Lift
import Data.RVar hiding (runRVarT)
import System.Random.Stateful
-- |Like 'runRVarTW... | null | https://raw.githubusercontent.com/haskell-numerics/random-fu/18a6ba6b29c7ca3b3ff34ea6ca0eca910da72726/random-fu/src/Data/Random/RVar.hs | haskell | # LANGUAGE RankNTypes, FlexibleInstances, MultiParamTypeClasses #
|Like 'runRVarTWith', but using an implicit lifting (provided by the
'Lift' class) | module Data.Random.RVar
( RVar, runRVar
, RVarT, runRVarT, runRVarTWith
, RGen(..), uniformRVarT, uniformRangeRVarT
) where
import Data.Random.Lift
import Data.RVar hiding (runRVarT)
import System.Random.Stateful
runRVarT :: (Lift n m, StatefulGen g m) => RVarT n a -> g -> m a
runRVarT = runRVarTWith ... |
4860bb7c71c3e658bbded20e6b889577a763a0623bf0c4fe8d3f4e4013e38866 | disteph/cdsat | sat-solve.ml | (***********************************)
(* Main entry point for CDSAT runs *)
(***********************************)
open General.Sums
open PluginsTh.PluginTh
open Kernel.Top.Messages
module type Fix = sig
include Kernel.Export.API
val solve : WB.DS.Assign.t
-> (Kernel.Top.Messages.unsat WB.t, WB.sa... | null | https://raw.githubusercontent.com/disteph/cdsat/1b569f3eae59802148f4274186746a9ed3e667ed/src/top-level/sat-solve.ml | ocaml | *********************************
Main entry point for CDSAT runs
********************************* |
open General.Sums
open PluginsTh.PluginTh
open Kernel.Top.Messages
module type Fix = sig
include Kernel.Export.API
val solve : WB.DS.Assign.t
-> (Kernel.Top.Messages.unsat WB.t, WB.sat_ans) General.Sums.sum
val clear : unit -> unit
end
let fix : (module Fix) =
let theories =
... |
cf4d22ac1da7aa97b0462484a1ae572a5d5c21cfa20a58459dc49593e9f2a0dd | AccelerateHS/accelerate-llvm | Fold.hs | # LANGUAGE GADTs #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RebindableSyntax #
{-# LANGUAGE RecordWildCards #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
{-# LANGUAGE TypeOperators #-}
# LANGUAGE ViewPatterns #
-- |
-... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate-llvm/57136bfc67f0da8ea0a0aba0172397a2e92d3378/accelerate-llvm-ptx/src/Data/Array/Accelerate/LLVM/PTX/CodeGen/Fold.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeOperators #
|
Module : Data.Array.Accelerate.LLVM.PTX.CodeGen.Fold
License : BSD3
Stability : experimental
Reduce an array along the innermost dimension. The reduction function must be
associative to allow for an e... | # LANGUAGE GADTs #
# LANGUAGE RebindableSyntax #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE ViewPatterns #
Copyright : [ 2016 .. 2020 ] The Accelerate Team
Maintainer : < >
Portability : non - portable ( GHC e... |
3e3eaf8807877834ed2157d0f3d83ec2ff7f198c725933aa72ab4b09d080367e | puzza007/openpoker | db.erl | Copyright ( C ) 2005 Wager Labs , SA
%%%
This file is part of OpenPoker .
%%%
OpenPoker is free software ; you can redistribute it and/or
%%% modify it under the terms of the GNU General Public
License as published by the Free Software Foundation ; either
version 2 of the License , or ( at your option ) any l... | null | https://raw.githubusercontent.com/puzza007/openpoker/bbd7158c81ba869f9f04ac7295c9fb7ea099a9d2/src/db.erl | erlang |
modify it under the terms of the GNU General Public
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public License for more details.
License along with this ... | Copyright ( C ) 2005 Wager Labs , SA
This file is part of OpenPoker .
OpenPoker is free software ; you can redistribute it and/or
License as published by the Free Software Foundation ; either
version 2 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Gene... |
36e8f38bfe318dcbf6e2206cdd3005ee24d0c53882c1cf96b97ce3e86f9d5008 | caiorulli/vega | datahike.clj | (ns caiorulli.vega.datahike
(:require [clojure.java.io :as io]
[clojure.tools.reader.edn :as edn]
[datahike.api :as d]
[integrant.core :as ig]))
(defmethod ig/init-key ::setup [_ opts]
(when-not (d/database-exists? opts)
(d/create-database opts)
(let [conn (d/connect op... | null | https://raw.githubusercontent.com/caiorulli/vega/09a8c73e74c69a36b9b1469af330e4133311541b/src/caiorulli/vega/datahike.clj | clojure | (ns caiorulli.vega.datahike
(:require [clojure.java.io :as io]
[clojure.tools.reader.edn :as edn]
[datahike.api :as d]
[integrant.core :as ig]))
(defmethod ig/init-key ::setup [_ opts]
(when-not (d/database-exists? opts)
(d/create-database opts)
(let [conn (d/connect op... | |
11ebca700a313a240259a7043b007d42e4c7c6f51480db278c34d2e749f0b629 | theodormoroianu/SecondYearCourses | lab4.hs | import Numeric.Natural
produsRec :: [Integer] -> Integer
produsRec = undefined
produsFold :: [Integer] -> Integer
produsFold = undefined
andRec :: [Bool] -> Bool
andRec = undefined
andFold :: [Bool] -> Bool
andFold = undefined
concatRec :: [[a]] -> [a]
concatRec = undefined
concatFold :: [[a]] -> [a]
conca... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/99185b0e97119135e7301c2c7be0f07ae7258006/Haskell/l/lab4/lab4.hs | haskell | import Numeric.Natural
produsRec :: [Integer] -> Integer
produsRec = undefined
produsFold :: [Integer] -> Integer
produsFold = undefined
andRec :: [Bool] -> Bool
andRec = undefined
andFold :: [Bool] -> Bool
andFold = undefined
concatRec :: [[a]] -> [a]
concatRec = undefined
concatFold :: [[a]] -> [a]
conca... | |
d2d4af722058c4f3a1819047bfe4b2cae426b7c1702b8ee7191765d45361bb55 | zero-one-group/geni | cookbook-09.clj | (ns geni.cookbook-09
(:require
[clojure.java.io]
[clojure.java.shell]
[zero-one.geni.core :as g]
[zero-one.geni.ml :as ml]))
(load-file "docs/cookbook/cookbook-util.clj")
Part 9 : Loading Data From SQL Databases
(download-data!
"-content/uploads/2018/03/chinook.zip"
"data/chinook.zip")
(when-not (... | null | https://raw.githubusercontent.com/zero-one-group/geni/4dbabf8315d85cc1526e04bca7e4cb7b75c21ac1/docs/cookbook/cookbook-09.clj | clojure | =>
root
|-- TrackId: integer (nullable = true)
|-- Name: string (nullable = true)
|-- AlbumId: integer (nullable = true)
|-- MediaTypeId: integer (nullable = true)
|-- Composer: string (nullable = true)
|-- Milliseconds: integer (nullable = true)
|-- Bytes: integer (nullable = true) | (ns geni.cookbook-09
(:require
[clojure.java.io]
[clojure.java.shell]
[zero-one.geni.core :as g]
[zero-one.geni.ml :as ml]))
(load-file "docs/cookbook/cookbook-util.clj")
Part 9 : Loading Data From SQL Databases
(download-data!
"-content/uploads/2018/03/chinook.zip"
"data/chinook.zip")
(when-not (... |
0916cb2af4837d6e09c68779e4e07501e10ac53dd67ab954fd2968549cba3ca7 | ghc/packages-Cabal | Foo.hs | main = putStrLn "Hello Foo"
| null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/cabal-testsuite/PackageTests/NewBuild/CmdBench/MultipleBenchmarks/Foo.hs | haskell | main = putStrLn "Hello Foo"
| |
a30961957171caab9f3f40511de179532635cccfa174fcc945b5bddc173a14f4 | drlivingston/kabob | pro_mapping_txtfile_rules.clj |
;; PRO ICE skos:exactMatch [OTHER PROTEIN ID]
`{:name "pro-other-id-exact-mapping-assertion"
:head ((?/proIce skos/exactMatch ?/otherIce))
:body
(;;(_/record kiao/hasTemplate iaopr/prProMappingRecordSchema1)
~@(kabob/rtv _/record
iaopr/ProMappingRecord_mappingTypeDataField1 "exact"
... | null | https://raw.githubusercontent.com/drlivingston/kabob/7038076849744c959da9c8507e8a8ab7215410aa/kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/id_mapping/skos_exact/pro_mapping_txtfile_rules.clj | clojure | PRO ICE skos:exactMatch [OTHER PROTEIN ID]
(_/record kiao/hasTemplate iaopr/prProMappingRecordSchema1)
protein |
`{:name "pro-other-id-exact-mapping-assertion"
:head ((?/proIce skos/exactMatch ?/otherIce))
:body
~@(kabob/rtv _/record
iaopr/ProMappingRecord_mappingTypeDataField1 "exact"
iaopr/ProMappingRecord_proteinOntologyIdDataField1 ?/proIce
iaopr/ProMappingRecord_t... |
dcf7007cf7073b8627283cbf34d6f666d79b970762e2c910f93e67813fe6b2c2 | divipp/x86-64 | Utils.hs | # language NoMonomorphismRestriction #
{-# language ScopedTypeVariables #-}
# language DataKinds #
{-# language ForeignFunctionInterface #-}
# language RecursiveDo #
module CodeGen.X86.Utils where
import Data.Char
import Data.Monoid
import Control.Monad
import Foreign
import ... | null | https://raw.githubusercontent.com/divipp/x86-64/a9e976a63b2946f1e7206866184f3fe6b060ac2d/CodeGen/X86/Utils.hs | haskell | # language ScopedTypeVariables #
# language ForeignFunctionInterface #
------------------------------------------------------------ derived constructs
| execute code unless condition is true
| do while loop construction
| if-then-else
----------------------------------------------------------------------------
----... | # language NoMonomorphismRestriction #
# language DataKinds #
# language RecursiveDo #
module CodeGen.X86.Utils where
import Data.Char
import Data.Monoid
import Control.Monad
import Foreign
import System.Environment
import Debug.Trace
import CodeGe... |
ce5c786c0aab03f449204b29e66e81ccfb005dd106e436a55ca1efedf8fe4f53 | robrix/sequoia | Mu.hs | module Sequoia.Connective.Mu
( -- * Recursion
Mu(..)
, MuF(..)
, mu
, foldMu
, unfoldMu
, refoldMu
) where
import qualified Control.Category as Cat
import Data.Profunctor
import Data.Profunctor.Traversing
import Fresnel.Setter
import Prelude hiding (exp)
import Sequo... | null | https://raw.githubusercontent.com/robrix/sequoia/1895ab90eb2fd7332ffb901fd8d932ad7637a695/src/Sequoia/Connective/Mu.hs | haskell | * Recursion
Recursion | module Sequoia.Connective.Mu
Mu(..)
, MuF(..)
, mu
, foldMu
, unfoldMu
, refoldMu
) where
import qualified Control.Category as Cat
import Data.Profunctor
import Data.Profunctor.Traversing
import Fresnel.Setter
import Prelude hiding (exp)
import Sequoia.Connective.Dow... |
24fa2d9faa96469f3b95e534f057a9f19b334be49876db18bb110bcadc443550 | sshirokov/CLSQL | test-internal.lisp | -*- Mode : LISP ; Syntax : ANSI - Common - Lisp ; Base : 10 -*-
;;;; *************************************************************************
;;;; FILE IDENTIFICATION
;;;;
;;;; Name: test-internal.lisp
Purpose : Tests for internal clsql functions
Author :
Created : May 2004
;;;;
This file , part of C... | null | https://raw.githubusercontent.com/sshirokov/CLSQL/c680432aea0177677ae2ee7b810a7404f7a05cab/tests/test-internal.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 -*-
*************************************************************************
FILE IDENTIFICATION
Name: test-internal.lisp
(), also known as the LLGPL.
************************************************************************* | Purpose : Tests for internal clsql functions
Author :
Created : May 2004
This file , part of CLSQL , is Copyright ( c ) 2004 - 2010 by
CLSQL users are granted the rights to distribute and use this software
as governed by the terms of the Lisp Lesser GNU Public License
(in-package #:clsql-tests)
(s... |
58355748c1a97add1dab8fa07852ffb6c80a4fc8847c295603ca647b59946b69 | manuel-serrano/bigloo | opcode.scm | (module jas_opcode
(import jas_lib jas_classfile)
(export resolve-opcodes) )
;;
;; Resolve cops
;;
;; Direct association between mnemonics and opcode
(define *cop-list* '(
nop aconst_null iconst_m1 iconst_0 iconst_1 ; 0
iconst_2 iconst_3 iconst_4 iconst_5 l... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/comptime/Jas/opcode.scm | scheme |
Resolve cops
Direct association between mnemonics and opcode
0
5
tALOAD tASTORE
tDIV tREM tNEG
bit
conv
cmp tRETURN
tIPUSH
LDC
LOAD_n
all IFs GOTO JSR
LOOKUPSWITCH
[GET|PUT][FIELD|STATIC]
NEW
WIDE
MULTINEWARRAY
LINE
COMMENT
Error
test a slot of a LOOKUPSWITCH
Find a local variable index | (module jas_opcode
(import jas_lib jas_classfile)
(export resolve-opcodes) )
(define *cop-list* '(
10
15
20
25
30
35
40
45
50
55
60
65
70
75
80
85
90
95
100
105
110
115
120
125
130
135
140
145
150
155
160
165
170
175
180
1... |
2c288f876eba7a2cb7dbbb724e00d477fed57d18885a2acacf4ddd361852860a | scrive/haskell-soap | SOAP.hs | -- | A heart of the package, 'invokeWS' assembles and executes requests.
# LANGUAGE BangPatterns , CPP , OverloadedStrings , , FlexibleContexts #
module Network.SOAP
(
-- * Requests
invokeWS, Transport
-- * Response parsing
, runResponseParser
, ResponseParser(..)
, Parser
-- * Excep... | null | https://raw.githubusercontent.com/scrive/haskell-soap/b237ca8c7d5411e9b5fcf239db02c53df9ba41d4/soap/src/Network/SOAP.hs | haskell | | A heart of the package, 'invokeWS' assembles and executes requests.
* Requests
* Response parsing
* Exceptions
| Different parsing modes available to extract reply contents.
^ Streaming parser from Text.XML.Stream.Parse
^ Work with a raw bytestring.
| Prepare data, assemble request and apply a parser to a res... |
# LANGUAGE BangPatterns , CPP , OverloadedStrings , , FlexibleContexts #
module Network.SOAP
(
invokeWS, Transport
, runResponseParser
, ResponseParser(..)
, Parser
, SOAPFault(..), SOAPParsingError(..)
) where
import Network.SOAP.Transport (Transport)
import Network.SOAP.Exception
impo... |
30a9e8b3b46e5532486ac7d69a461491a234701bfe011ef49bbe015a593f40fa | input-output-hk/cardano-ledger | SafeSigner.hs | module Cardano.Crypto.Signing.Safe.SafeSigner (
SafeSigner (..),
noPassSafeSigner,
safeToVerification,
)
where
import Cardano.Crypto.Signing.Safe.PassPhrase (PassPhrase, emptyPassphrase)
import Cardano.Crypto.Signing.SigningKey (SigningKey (..), toVerification)
import Cardano.Crypto.Signing.VerificationKey (Veri... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger/31c0bb1f5e78e40b83adfd1a916e69f47fdc9835/eras/byron/crypto/src/Cardano/Crypto/Signing/Safe/SafeSigner.hs | haskell | module Cardano.Crypto.Signing.Safe.SafeSigner (
SafeSigner (..),
noPassSafeSigner,
safeToVerification,
)
where
import Cardano.Crypto.Signing.Safe.PassPhrase (PassPhrase, emptyPassphrase)
import Cardano.Crypto.Signing.SigningKey (SigningKey (..), toVerification)
import Cardano.Crypto.Signing.VerificationKey (Veri... | |
29559a6f7578d56386887ff079c3ca23a21d38d0be3571cc8ed69e939fec914d | tatut/ripley | collection_test.clj | (ns ripley.live.collection-test
(:require [clojure.test :as t :refer [deftest testing is]]
[ripley.live.context :as context]
[ripley.live.collection :as collection]
[clojure.core.async :as async :refer [alts!!]]
[ripley.html :as h]
[ripley.impl.output :refer... | null | https://raw.githubusercontent.com/tatut/ripley/ffe8ed16634b289d47a9106e415ae1d9bfd60d1c/test/ripley/live/collection_test.clj | clojure | Start the live context
Return handles needed to test the live collection handling
Add item, sends patch to prepend item
prepend and append on same change
remove all | (ns ripley.live.collection-test
(:require [clojure.test :as t :refer [deftest testing is]]
[ripley.live.context :as context]
[ripley.live.collection :as collection]
[clojure.core.async :as async :refer [alts!!]]
[ripley.html :as h]
[ripley.impl.output :refer... |
8648efe6c4009cdd2674a4bc1d326780b94e2767842eaf003ab999eafaa90d76 | passy/coding-puzzles | Main.hs | import Data.Array.Unboxed
import Control.Applicative
main :: IO ()
main = do
n <- readLn :: IO Int
is <- reverse <$> fmap read <$> words <$> getLine :: IO [Int]
-- You asked for arrays, I give you arrays.
let arr = listArray (0, n - 1) is :: UArray Int Int
putStrLn $ unwords $ show <$> elems arr
| null | https://raw.githubusercontent.com/passy/coding-puzzles/686bd0775ee5a98004229d44c913376d033b13de/hackerrank/arrays-dsdfdf/Main.hs | haskell | You asked for arrays, I give you arrays. | import Data.Array.Unboxed
import Control.Applicative
main :: IO ()
main = do
n <- readLn :: IO Int
is <- reverse <$> fmap read <$> words <$> getLine :: IO [Int]
let arr = listArray (0, n - 1) is :: UArray Int Int
putStrLn $ unwords $ show <$> elems arr
|
63a8b7ea5183ee52f0050a7b1ef23476c5a0622cabe0cef00d0c30e5b2323680 | bennn/dissertation | drum.rkt | #lang typed/racket/base
(require require-typed-check
"typed-data.rkt")
(require/typed/check "array-struct.rkt"
[array-size (-> Array Integer)]
[make-array (-> In-Indexes Flonum Array)]
[build-array (-> In-Indexes (-> Indexes Float) Array)]
[unsafe-vector->array (-> Indexes (Vectorof Float) Mutable-Ar... | null | https://raw.githubusercontent.com/bennn/dissertation/779bfe6f8fee19092849b7e2cfc476df33e9357b/dissertation/scrbl/jfp-2019/benchmarks/synth/typed/drum.rkt | racket | Drum "samples" (Arrays of floats)
limited drum machine | #lang typed/racket/base
(require require-typed-check
"typed-data.rkt")
(require/typed/check "array-struct.rkt"
[array-size (-> Array Integer)]
[make-array (-> In-Indexes Flonum Array)]
[build-array (-> In-Indexes (-> Indexes Float) Array)]
[unsafe-vector->array (-> Indexes (Vectorof Float) Mutable-Ar... |
3c3f07bc803260d00efcb3e65bb6be5b936c42ffa8be01bcabbb5127e576fe60 | GaloisInc/daedalus | Logger.hs | # LANGUAGE LambdaCase #
-- | dead simple logging mechanism/convention
module Logger
( logInfo
, logWarn
, logError
, quit
, logWarnS
, logErrorS
, logWarnIfFail
, logErrorIfFail
, logWarnIndent
, logWarnSIndent
)
where
import System.Exit(exitFailure)
import Daedalus.Panic
import Possibly
... | null | https://raw.githubusercontent.com/GaloisInc/daedalus/016da6b2de23747e48642f6ece79c07b436ef5d1/formats/pdf/old/cos/src/Logger.hs | haskell | | dead simple logging mechanism/convention
FIXME[F2] TODO: improve/extend?
- allow control by a verbose flag or the like.
- indenting versions | # LANGUAGE LambdaCase #
module Logger
( logInfo
, logWarn
, logError
, quit
, logWarnS
, logErrorS
, logWarnIfFail
, logErrorIfFail
, logWarnIndent
, logWarnSIndent
)
where
import System.Exit(exitFailure)
import Daedalus.Panic
import Possibly
logInfo :: String -> IO ()
logInfo s = putStr... |
5a637cc9d019ad129ecaff76bf13dd71192b8968452c029076b09dfd8e73a4ae | otakar-smrz/elixir-fm | General.hs | -- |
--
-- Module : FM.Generic.General
Copyright : 2004
-- License : GPL
--
-- Maintainer : otakar-smrz users.sf.net
-- Stability : provisional
-- Portability : portable
--
" ElixirFM " " Encode "
FM.Generic . General -- Excerpt from the Functional Morphology library
Copyright (... | null | https://raw.githubusercontent.com/otakar-smrz/elixir-fm/fae5bab6dd53c15d25c1e147e7787b2c254aabf0/Haskell/ElixirFM/FM/Generic/General.hs | haskell | |
Module : FM.Generic.General
License : GPL
Maintainer : otakar-smrz users.sf.net
Stability : provisional
Portability : portable
Excerpt from the Functional Morphology library
Excerpt from the Functional Morphology library | Copyright : 2004
" ElixirFM " " Encode "
Copyright ( C ) 2004
This program is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at y... |
2c0cbf4303358fc24a723567a09f9ab914b6900af39178212cdb2e89ff02b3a0 | geophf/1HaskellADay | Exercise.hs | module Y2016.M09.D15.Exercise where
the below import is available from the 1HaskellADay git repository
import Data.Matrix
-
Today 's exercise is neither sudoku nor magic squares . We 're just working
with one square , only , and arranging the number 1 through 9 in those squares .
Simple enough .
Oh , th... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2016/M09/D15/Exercise.hs | haskell | }
via joomy @cattheory
}
create a schema for the constraints so that the constraints hold and the | module Y2016.M09.D15.Exercise where
the below import is available from the 1HaskellADay git repository
import Data.Matrix
-
Today 's exercise is neither sudoku nor magic squares . We 're just working
with one square , only , and arranging the number 1 through 9 in those squares .
Simple enough .
Oh , th... |
8968600327fbad9ea600ca1d42db34412efab92fd2182e738c005302ee09ed70 | pa-ba/compdata | EvalI.hs | # LANGUAGE TemplateHaskell , TypeOperators , MultiParamTypeClasses ,
FlexibleInstances , FlexibleContexts , UndecidableInstances , GADTs #
FlexibleInstances, FlexibleContexts, UndecidableInstances, GADTs #-}
--------------------------------------------------------------------------------
-- |
Module : E... | null | https://raw.githubusercontent.com/pa-ba/compdata/5783d0e11129097e045cabba61643114b154e3f2/examples/Examples/Multi/EvalI.hs | haskell | ------------------------------------------------------------------------------
|
License : BSD3
Stability : experimental
Intrinsic, Tag-less Expression Evaluation
The example illustrates how to use generalised compositional data types
to implement a small expression language, and an evaluation functio... | # LANGUAGE TemplateHaskell , TypeOperators , MultiParamTypeClasses ,
FlexibleInstances , FlexibleContexts , UndecidableInstances , GADTs #
FlexibleInstances, FlexibleContexts, UndecidableInstances, GADTs #-}
Module : Examples . Multi . EvalI
Copyright : ( c ) 2011 ,
Maintainer : < >
... |
62f99799b9d493e9e0649a15f0d938f6dc7ca4f9984c3c3c8d502b33231ca7b2 | ndmitchell/tagsoup | Resolve.hs |
module Compiler.Resolve(resolve) where
import Compiler.Lp
import Compiler.Util
primMatch_ = ["eof"]
primRule_ = ["endBy","takeWhileNot"]
data Names = Names {primMatch :: [String]
,primRule :: [String]
,realRule :: [String]
}
deriving Show
... | null | https://raw.githubusercontent.com/ndmitchell/tagsoup/e116d3b965e4f149581bd55e45a05661b1113536/dead/parser/Compiler/Resolve.hs | haskell |
module Compiler.Resolve(resolve) where
import Compiler.Lp
import Compiler.Util
primMatch_ = ["eof"]
primRule_ = ["endBy","takeWhileNot"]
data Names = Names {primMatch :: [String]
,primRule :: [String]
,realRule :: [String]
}
deriving Show
... | |
ad6687c914dde7b21814e73281c59bbe254003b0dd5c15e1e3abdce709830932 | expipiplus1/vulkan | VK_EXT_pipeline_properties.hs | {-# language CPP #-}
-- | = Name
--
-- VK_EXT_pipeline_properties - device extension
--
-- == VK_EXT_pipeline_properties
--
-- [__Name String__]
@VK_EXT_pipeline_properties@
--
-- [__Extension Type__]
-- Device extension
--
-- [__Registered Extension Number__]
373
--
-- [__Revision__]
1
--
-- [__E... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/ebc0dde0bcd9cf251f18538de6524eb4f2ab3e9d/src/Vulkan/Extensions/VK_EXT_pipeline_properties.hs | haskell | # language CPP #
| = Name
VK_EXT_pipeline_properties - device extension
== VK_EXT_pipeline_properties
[__Name String__]
[__Extension Type__]
Device extension
[__Registered Extension Number__]
[__Revision__]
[__Extension and Version Dependencies__]
- Requires @VK_KHR_get_physical_device_prop... | @VK_EXT_pipeline_properties@
373
1
- Requires support for Vulkan 1.0
- Mukund
2022 - 04 - 19
- , NVIDIA
- , NVIDIA
- , Arm
Vulkan SC requires offline compilation of pipelines . In order to support
One method of developing a Vulkan SC applic... |
56a09d7f044863e20b85358ea47fbe0ceb1c95b113e177c58518fb8766812edb | FreeProving/free-compiler | Syntax.hs | | This module exports the original Agda AST to reduce coupling with the
Agda libraries .
module FreeC.Backend.Agda.Syntax
( module Agda.Syntax.Concrete
, module Agda.Syntax.Common
, module Agda.Syntax.Position
-- * Identifiers
, name
, qname
, qname'
-- * Imports
, simpleImport
-- * Decl... | null | https://raw.githubusercontent.com/FreeProving/free-compiler/6931b9ca652a185a92dd824373f092823aea4ea9/src/lib/FreeC/Backend/Agda/Syntax.hs | haskell | * Identifiers
* Imports
* Declarations
* Pattern
* Expressions
* Types
-----------------------------------------------------------------------------
Identifiers --
-----------------------------------------------------------------------------
| Create... | | This module exports the original Agda AST to reduce coupling with the
Agda libraries .
module FreeC.Backend.Agda.Syntax
( module Agda.Syntax.Concrete
, module Agda.Syntax.Common
, module Agda.Syntax.Position
, name
, qname
, qname'
, simpleImport
, moduleDecl
, funcSig
, patternSyn
, funcD... |
43f19e1ad4eb61ee24142599d996e44a0c296dec236f1bb3fbb4919ec1de2d4d | anoma/juvix | Compile.hs | module Commands.Compile where
import Commands.Base
import Commands.Compile.Options
import Data.ByteString qualified as BS
import Data.FileEmbed qualified as FE
import Data.Text.IO qualified as TIO
import Juvix.Compiler.Backend.C.Translation.FromInternal qualified as MiniC
import System.Environment
import System.Proces... | null | https://raw.githubusercontent.com/anoma/juvix/807b3b1770289b8921304e92e7305c55c2e11f8f/app/Commands/Compile.hs | haskell | module Commands.Compile where
import Commands.Base
import Commands.Compile.Options
import Data.ByteString qualified as BS
import Data.FileEmbed qualified as FE
import Data.Text.IO qualified as TIO
import Juvix.Compiler.Backend.C.Translation.FromInternal qualified as MiniC
import System.Environment
import System.Proces... | |
b2361ad478caa37055e9e39e021266994469368f639601fd62e66b7fae5c61be | Deducteam/Dedukti | typing.ml | open Basic
open Format
open Rule
open Term
module SS = Exsubst.ExSubst
let d_typeChecking = Debug.register_flag "TypeChecking"
let d_rule = Debug.register_flag "Rule"
let coc = ref false
let fail_on_unsatisfiable_constraints = ref false
type typ = term
(* ********************** ERROR MESSAGES *)
type typing_erro... | null | https://raw.githubusercontent.com/Deducteam/Dedukti/7124a3edbaecf2d8a9046272cbc4d0d09cc3fad0/kernel/typing.ml | ocaml | ********************** ERROR MESSAGES
********************** CONTEXT
********************** TYPE CHECKING/INFERENCE FOR TERMS
The functions [check'] and [infer'] have an additional argument compared to [check] and [infer]
which is a list of additional equalities, which are useful when checking subject redu... | open Basic
open Format
open Rule
open Term
module SS = Exsubst.ExSubst
let d_typeChecking = Debug.register_flag "TypeChecking"
let d_rule = Debug.register_flag "Rule"
let coc = ref false
let fail_on_unsatisfiable_constraints = ref false
type typ = term
type typing_error =
| KindIsNotTypable
| ConvertibilityE... |
1b7a940bbd16af28aa2b267fb4a9c8214b279880d1301a68ee0d0f83e0e7bdfb | stabilized/clojurescript | tagged_literals.clj | (ns cljs.tagged-literals
(:require [clojure.instant :as inst]))
(defn read-queue
[form]
(when-not (vector? form)
(throw (RuntimeException. "Queue literal expects a vector for its elements.")))
(list 'cljs.core/into 'cljs.core.PersistentQueue.EMPTY form))
(defn read-uuid
[form]
(when-not (string? form)... | null | https://raw.githubusercontent.com/stabilized/clojurescript/f38f141525576b2a89cde190f25f9cf2fc4c418a/src/clj/cljs/tagged_literals.clj | clojure | (ns cljs.tagged-literals
(:require [clojure.instant :as inst]))
(defn read-queue
[form]
(when-not (vector? form)
(throw (RuntimeException. "Queue literal expects a vector for its elements.")))
(list 'cljs.core/into 'cljs.core.PersistentQueue.EMPTY form))
(defn read-uuid
[form]
(when-not (string? form)... | |
d28579be90c1ed2927806b2948efe8f891f83bdadb4e3d220edff78d4ead2ed9 | zcaudate/hara | reader.clj | (ns hara.io.file.reader
(:require [hara.io.file.charset :as charset]
[hara.io.file.path :as path])
(:import (java.io BufferedReader CharArrayReader File FileReader InputStream InputStreamReader LineNumberReader PipedReader PipedWriter PushbackReader Reader StringReader)
(java.nio.file Files))... | null | https://raw.githubusercontent.com/zcaudate/hara/481316c1f5c2aeba5be6e01ae673dffc46a63ec9/src/hara/io/file/reader.clj | clojure | (ns hara.io.file.reader
(:require [hara.io.file.charset :as charset]
[hara.io.file.path :as path])
(:import (java.io BufferedReader CharArrayReader File FileReader InputStream InputStreamReader LineNumberReader PipedReader PipedWriter PushbackReader Reader StringReader)
(java.nio.file Files))... | |
3856ddad8c5d93838abca12840bbcbec2279f5b08075eafe49915e5178746c8d | dhammikamare/Learn-OCaml | complex.ml | Task : Define two record types to represent complex numbers in Cartesian form ( x + iy ) and
* polar form ( r cos theta + ir sin theta ) .
* ( a ) Define a function that returns whether a number in polar form is real ( complex part is zero ) , imaginary ( real part is zero ) , or mixed .
* ( b ) Define a fun... | null | https://raw.githubusercontent.com/dhammikamare/Learn-OCaml/2d4e3da38ee86cd7477964ffb8756a8483260322/lab05%20Records/complex.ml | ocaml | test values | Task : Define two record types to represent complex numbers in Cartesian form ( x + iy ) and
* polar form ( r cos theta + ir sin theta ) .
* ( a ) Define a function that returns whether a number in polar form is real ( complex part is zero ) , imaginary ( real part is zero ) , or mixed .
* ( b ) Define a fun... |
87fb95b46c564ccf8d7094ac719d78c24eb05ef1c81b540a059afa871c979ece | gedge-platform/gedge-platform | recon_trace.erl | @author < >
%%% [/]
%%% @doc
%%% `recon_trace' is a module that handles tracing in a safe manner for single
Erlang nodes , currently for function calls only . Functionality includes :
%%%
%%% <ul>
%%% <li>Nicer to use interface (arguably) than `dbg' or trace BIFs.</li>
%%% <li>Protection against dumb de... | null | https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/recon/src/recon_trace.erl | erlang | [/]
@doc
`recon_trace' is a module that handles tracing in a safe manner for single
<ul>
<li>Nicer to use interface (arguably) than `dbg' or trace BIFs.</li>
<li>Protection against dumb decisions (matching all calls on a node
being traced, for example)</li>
<li>Adding safe guards in terms ... | @author < >
Erlang nodes , currently for function calls only . Functionality includes :
= = Code = =
The Erlang Trace BIFs allow to trace any Erlang code at all . They work in
two parts : pid specifications , and trace patterns .
Pid specifications let you decide which processes to target . They can be... |
c1149613f4e4b2b02b716f7237b5d188e3556a386eedc289d0fa493ed76c5c71 | armedbear/abcl | make-string.lisp | make-string.lisp
;;;
Copyright ( C ) 2003
$ Id$
;;;
;;; This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later version .
;;;
;... | null | https://raw.githubusercontent.com/armedbear/abcl/36a4b5994227d768882ff6458b3df9f79caac664/src/org/armedbear/lisp/make-string.lisp | lisp |
This program is free software; you can redistribute it and/or
either version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details... | make-string.lisp
Copyright ( C ) 2003
$ Id$
modify it under the terms of the GNU General Public License
of the License , or ( at your option ) any later version .
You should have received a copy of the GNU General Public License
Foundation , Inc. , 59 Temple Place - Suite 330 , Boston , MA 02111 - 130... |
5fa4fae75a74aa48bf4f1cf6da389da53b41fd772c55dc28710835edcb6607a5 | lpgauth/shackle | arithmetic_ssl_server.erl | -module(arithmetic_ssl_server).
-include("test.hrl").
-include_lib("eunit/include/eunit.hrl").
-export([
start/0,
stop/0
]).
%% public
-spec start() ->
ok | {error, already_started}.
start() ->
case whereis(?MODULE) of
undefined ->
spawn(fun () -> accept(listen()) end),
... | null | https://raw.githubusercontent.com/lpgauth/shackle/a498ef0fde4808fa71fd5fe1404543475aaf7043/test/arithmetic_ssl_server.erl | erlang | public
private | -module(arithmetic_ssl_server).
-include("test.hrl").
-include_lib("eunit/include/eunit.hrl").
-export([
start/0,
stop/0
]).
-spec start() ->
ok | {error, already_started}.
start() ->
case whereis(?MODULE) of
undefined ->
spawn(fun () -> accept(listen()) end),
ok;
... |
f796ca9077e942a1b6c6c80468ff371509f7e511a182d1ceea2fef53c5fced56 | basho/erlang_js | erlang_js_sup.erl | @author < >
2009 - 2010 Basho Technologies
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to ... | null | https://raw.githubusercontent.com/basho/erlang_js/d3881e8141540058ca80011eacecd76c5dbd42df/src/erlang_js_sup.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
limitations under the License.
the js... | @author < >
2009 - 2010 Basho Technologies
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
See the License for the specific language governing permissions and
@doc Top level supervisor for erlang_js . It... |
1b327fd41d5ebe231e3f32110e6911ff70c09f4654c8b6eeda86c1f37c4544c9 | rbkmoney/fistful-server | ff_withdrawal_session_machine.erl | %%%
%%% Withdrawal session machine
%%%
TODOs
%%%
%%% - The way we ask `fistful` for a machinery backend smells like a circular
%%% dependency injection.
%%% - Dehydrate events upon saving.
%%%
-module(ff_withdrawal_session_machine).
-behaviour(machinery).
-define(NS, 'ff/withdrawal/session_v2').
%% API
-exp... | null | https://raw.githubusercontent.com/rbkmoney/fistful-server/60b964d0e07f911c841903bc61d8d9fb20a32658/apps/ff_transfer/src/ff_withdrawal_session_machine.erl | erlang |
Withdrawal session machine
- The way we ask `fistful` for a machinery backend smells like a circular
dependency injection.
- Dehydrate events upon saving.
API
machinery
Types
Internal types
API
machinery callbacks
Internals
| TODOs
-module(ff_withdrawal_session_machine).
-behaviour(machinery).
-define(NS, 'ff/withdrawal/session_v2').
-export([session/1]).
-export([ctx/1]).
-export([create/3]).
-export([get/1]).
-export([get/2]).
-export([events/2]).
-export([repair/2]).
-export([process_callback/1]).
-export([init/4]).
-export([pr... |
70d850969e74edd044984f067e8fa8095c12370b10180dc9e6db83bf855e333f | Kakadu/fp2022 | Pprintast.ml | * Copyright 2021 - 2022 , Danila Pechenev &
* SPDX - License - Identifier : LGPL-3.0 - or - later
open Ast
open Format
open Base
open Typing
let pp_literal fmt = function
| LInt x -> fprintf fmt "%d" x
| LString x -> fprintf fmt "%s" x
| LChar x -> fprintf fmt "%c" x
| LBool x -> fprintf fmt "%b" x
| LUn... | null | https://raw.githubusercontent.com/Kakadu/fp2022/7f9035ae2d6fb779e2cb075ab1a0c76883f30b00/OCamlWithEffects/lib/Pprintast.ml | ocaml | * Copyright 2021 - 2022 , Danila Pechenev &
* SPDX - License - Identifier : LGPL-3.0 - or - later
open Ast
open Format
open Base
open Typing
let pp_literal fmt = function
| LInt x -> fprintf fmt "%d" x
| LString x -> fprintf fmt "%s" x
| LChar x -> fprintf fmt "%c" x
| LBool x -> fprintf fmt "%b" x
| LUn... | |
0bd7870f9bcfe5ba4b39f71e22c96b2c5f12590f09722ec45e37a4a72464f83b | igorhvr/bedlam | work-queue-code.scm | Code by - this is licensed under GNU GPL v2 .
(define-java-classes <java.util.concurrent.linked-blocking-queue> <java.util.concurrent.array-blocking-queue>)
(define-generic-java-methods put take size peek)
;; Specification:
;; (if capacity (j "new java.util.concurrent.ArrayBlockingQueue(capacity);" `((capaci... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/iasylum/work-queue-code.scm | scheme | Specification:
(if capacity (j "new java.util.concurrent.ArrayBlockingQueue(capacity);" `((capacity ,(->jint capacity)))) (j "new java.util.concurrent.LinkedBlockingQueue();")) | Code by - this is licensed under GNU GPL v2 .
(define-java-classes <java.util.concurrent.linked-blocking-queue> <java.util.concurrent.array-blocking-queue>)
(define-generic-java-methods put take size peek)
(define-syntax get-native-blocking-queue
(syntax-rules ()
((_ capacity)
(if capacity
... |
b2de4e7374eb04afda5e833b300979cef09f61b8296119206ba6256ea5378559 | TyOverby/bonsai_example | rpc_implementations.ml | open! Core
open! Async
open Bonsai_chat_open_source_common
let message_stream global_state =
let bus_read = Bus.read_only global_state.Global_state.message_bus in
let f _user_state () = Async_bus.pipe1_exn bus_read [%here] |> Deferred.Result.return in
Rpc.Pipe_rpc.implement Protocol.Message_stream.t f
;;
let me... | null | https://raw.githubusercontent.com/TyOverby/bonsai_example/5c45bd1abb80299cd544369c8496673283913654/server/src/rpc_implementations.ml | ocaml | open! Core
open! Async
open Bonsai_chat_open_source_common
let message_stream global_state =
let bus_read = Bus.read_only global_state.Global_state.message_bus in
let f _user_state () = Async_bus.pipe1_exn bus_read [%here] |> Deferred.Result.return in
Rpc.Pipe_rpc.implement Protocol.Message_stream.t f
;;
let me... | |
d75b863f8a048750b33ea3f231d0669140ad1b3964400ea02bd6e6d9283cb308 | geoffder/olm-ml | pk_test.ml | open! Core
open! Olm
open! Helpers.ResultInfix
let%test "clear ecryption / decryption" =
begin
Pk.Decryption.create () >>= fun dec ->
Pk.Encryption.create dec.pubkey >>= fun enc ->
Pk.Decryption.clear dec.pk_dec >>= fun _ ->
Pk.Encryption.clear enc.pk_enc
end |> Result.is_ok
let%test "inv... | null | https://raw.githubusercontent.com/geoffder/olm-ml/6ab791c5f4cacb54cf8939d78bd2a6820ec136b3/olm/test/pk_test.ml | ocaml | open! Core
open! Olm
open! Helpers.ResultInfix
let%test "clear ecryption / decryption" =
begin
Pk.Decryption.create () >>= fun dec ->
Pk.Encryption.create dec.pubkey >>= fun enc ->
Pk.Decryption.clear dec.pk_dec >>= fun _ ->
Pk.Encryption.clear enc.pk_enc
end |> Result.is_ok
let%test "inv... | |
08a91c04e646fa0660afa7164622fa6f77096c73d1b48a1cd2288ec96323d168 | Yuppiechef/datomic-schema | project.clj | (defproject example "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[datomic-schema "1.1.0"]
[com.datomic/datomic-free "0.9.4707"]]
:main examp... | null | https://raw.githubusercontent.com/Yuppiechef/datomic-schema/2ca2005daa686859d4a5e4ab2eb3e59b91ad96dc/example/project.clj | clojure | (defproject example "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]
[datomic-schema "1.1.0"]
[com.datomic/datomic-free "0.9.4707"]]
:main examp... | |
45fed86b9a4d09a1ebec4349f99d4d2e62b648235ce1e8e5613d13ea36bb2c6d | neongreen/haskell-ex | Main.hs |
-- # Mergesort
-- Implement a mergesort
Invented by in 1945
-- Reference:
module Main where
-- ## Demo
main :: IO ()
main = do
print unsortedNumbers
putStr "==> MERGESORT ==>\n"
print (mergesort unsortedNumbers) where
unsortedNumbers :: [Int]
unsortedNumbers = [1,12,5,6,21,2,61,126,7,87,23,1,451,... | null | https://raw.githubusercontent.com/neongreen/haskell-ex/345115444fdf370a43390fd942e2851b9b1963ad/week2/mergesort/jasonkuhrt/Main.hs | haskell | # Mergesort
Implement a mergesort
Reference:
## Demo
Do the actual sort-then-merge
Preserve order AKA "stable sort"
## Helpers |
Invented by in 1945
module Main where
main :: IO ()
main = do
print unsortedNumbers
putStr "==> MERGESORT ==>\n"
print (mergesort unsortedNumbers) where
unsortedNumbers :: [Int]
unsortedNumbers = [1,12,5,6,21,2,61,126,7,87,23,1,451,16,46,35]
# # Program
mergesort :: Ord a => [a] -> [a]
merge... |
9df5fe5c14430f872bbaa1de44f81de919f743ef1458d1899561a215ba36a8c4 | deadcode/Learning-CL--David-Touretzky | 8.64.lisp | (defun tree-find-if (func tree)
(cond ((null tree) nil)
((and (atom (first tree))
(funcall func (first tree)))
(first tree))
((atom (first tree)) nil)
((tree-find-if func (car tree)))
((tree-find-if func (cdr tree)))
(t nil)))
(let ((test1 '(tr... | null | https://raw.githubusercontent.com/deadcode/Learning-CL--David-Touretzky/b4557c33f58e382f765369971e6a4747c27ca692/Chapter%208/8.64.lisp | lisp | (defun tree-find-if (func tree)
(cond ((null tree) nil)
((and (atom (first tree))
(funcall func (first tree)))
(first tree))
((atom (first tree)) nil)
((tree-find-if func (car tree)))
((tree-find-if func (cdr tree)))
(t nil)))
(let ((test1 '(tr... | |
be8b20a139be51c2219d6f770571aa4280e9976bcf8b5e4abb8570aee3cf9fcb | ocaml/opam | opamHash.mli | (**************************************************************************)
(* *)
Copyright 2016 - 2017 OCamlPro
(* *)
(* All right... | null | https://raw.githubusercontent.com/ocaml/opam/0ed6582f3925f03fa0b2fe2de2605dadf431264c/src/core/opamHash.mli | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2016 - 2017 OCamlPro
GNU Lesser General Public License version 2.1 , with the special
type kind = [ `MD5 | `SHA256 | `SHA512 ]
type t
val kind: t -> kind
val contents: t -> string
val string_of_kind: kind -> string
val md5: string -> t
val sha256: s... |
5b8e9485dfd6df05309c231e14c54569e41f33c5a101f5fbb847afc2420e70e3 | workframers/artemis | http.cljs | (ns artemis.network-steps.http
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [cljs-http.client :as http]
[artemis.result :as ar]
[artemis.network-steps.protocols :as np]
[cljs.core.async :as async]))
(defn- post-operation [this operation {:keys [interchange-fo... | null | https://raw.githubusercontent.com/workframers/artemis/c67a7891b51b299e974cce6f01f7db9e45dee754/src/artemis/network_steps/http.cljs | clojure | Public API | (ns artemis.network-steps.http
(:require-macros [cljs.core.async.macros :refer [go]])
(:require [cljs-http.client :as http]
[artemis.result :as ar]
[artemis.network-steps.protocols :as np]
[cljs.core.async :as async]))
(defn- post-operation [this operation {:keys [interchange-fo... |
6e828ffaa7aa85051639369ee31d94d6681fc43d7b35eb10addf372dc1b10147 | janestreet/accessor_base | accessor_source_code_position.mli | open! Base
open! Import
include sig
type t =
{ pos_fname : string
; pos_lnum : int
; pos_bol : int
; pos_cnum : int
}
[@@deriving accessors]
end
with type t := Source_code_position.t
| null | https://raw.githubusercontent.com/janestreet/accessor_base/8384c29a37e557168ae8a43b2a5a531f0ffc16e4/src/accessor_source_code_position.mli | ocaml | open! Base
open! Import
include sig
type t =
{ pos_fname : string
; pos_lnum : int
; pos_bol : int
; pos_cnum : int
}
[@@deriving accessors]
end
with type t := Source_code_position.t
| |
0e45a8f6922e8902dfe7a9665e18b5b3fca9416d4f850d7fa147c84f82a6e745 | prestancedesign/inertia-clojure | middleware.clj | (ns inertia.middleware
(:require [clojure.string :as str]
[jsonista.core :as json]
[muuntaja.middleware :as middleware]
[ring.util.response :as rr]))
(defn render
([component]
(render component {}))
([component props]
(rr/response {:component component
:... | null | https://raw.githubusercontent.com/prestancedesign/inertia-clojure/fed9b7007f1643e57ded2ac8a13b6e5d65db0bcd/src/inertia/middleware.clj | clojure | (ns inertia.middleware
(:require [clojure.string :as str]
[jsonista.core :as json]
[muuntaja.middleware :as middleware]
[ring.util.response :as rr]))
(defn render
([component]
(render component {}))
([component props]
(rr/response {:component component
:... | |
8f2ed7c377d251550e6d2825ca7f8abf6abbe3dc4014b2902563c69d4474ca8b | jeffshrager/biobike | go.lisp | Copyright ( c ) 2002 - 2003 by and ; All rights reserved .
;;; This software is made avilable for EDUCATIONAL PURPOSES
;;; ONLY, and WITHOUT ANY WARRANTY, express or implied, of
;;; its merchantability or fitness for a particular purpose.
(defun walk-isas (from)
(loop for (property value) in (cdr (assoc from... | null | https://raw.githubusercontent.com/jeffshrager/biobike/5313ec1fe8e82c21430d645e848ecc0386436f57/BioLisp/OriginalCode/go.lisp | lisp | All rights reserved .
This software is made avilable for EDUCATIONAL PURPOSES
ONLY, and WITHOUT ANY WARRANTY, express or implied, of
its merchantability or fitness for a particular purpose.
Walk through each *GO* entry...
Set up the main association between go ID and the property list.
Now go through each prope... |
(defun walk-isas (from)
(loop for (property value) in (cdr (assoc from *go*))
when (eq 'isa property)
do (walk-isas value)))
(defun walk-isas (from &optional (depth 0))
(let ((entry (cdr (assoc from *go*))))
(loop for space from 1 to (* 2 depth) do (format t " "))
(format t "~a: ~a~%" depth (second (as... |
aac49895680a590ce127389a56001c4f9aba4246b95bdcd55a068bd939534b02 | omnyway-labs/vulcan | cgit.clj | (ns vulcan.semver.git.cgit
(:require
[clojure.string :as str]
[clojure.java.io :as io]
[clojure.java.shell :as sh]
[vulcan.semver.git.core :refer :all]))
(defn git-cmd [cmd & args]
(let [{:keys [exit out err]} (apply sh/sh "git" cmd args)]
(if (= 0 exit)
(str/trim-newline out)
(throw
... | null | https://raw.githubusercontent.com/omnyway-labs/vulcan/9cebe1f666b323080689b5283f313bd2292375fc/src/vulcan/semver/git/cgit.clj | clojure | (ns vulcan.semver.git.cgit
(:require
[clojure.string :as str]
[clojure.java.io :as io]
[clojure.java.shell :as sh]
[vulcan.semver.git.core :refer :all]))
(defn git-cmd [cmd & args]
(let [{:keys [exit out err]} (apply sh/sh "git" cmd args)]
(if (= 0 exit)
(str/trim-newline out)
(throw
... | |
f8d6c1bf8073dd1d1f46595897c3e39c1ae3739cbf8b2e401ac8604fd3c42bd0 | BBVA/ust2dsa | PackageImplSpec.hs | |
Copyright 2020 Banco Bilbao Vizcaya Argentaria , S.A.
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , soft... | null | https://raw.githubusercontent.com/BBVA/ust2dsa/0688651f77ebda312dac76ae6a1901357ab12907/test/Text/UbuntuSecurityTracker/CVE/PackageImplSpec.hs | haskell | TODO: Support multiple versions | |
Copyright 2020 Banco Bilbao Vizcaya Argentaria , S.A.
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , soft... |
74a668d6a6aac65cb1f2952f0615619128e5e98dbdee68cc9ce8129120c39b93 | SchornacklabSLCU/amfinder | imgCursor.mli | AMFinder - img / imgCursor.mli
*
* MIT License
* Copyright ( c ) 2021
*
* Permission is hereby granted , free of charge , to any person obtaining a copy
* of this software and associated documentation files ( the " Software " ) , to
* deal in the Software without restriction , including without... | null | https://raw.githubusercontent.com/SchornacklabSLCU/amfinder/1053045b431b9e9e85a7bcebea2e38cda92a8dcd/amfbrowser/sources/img/imgCursor.mli | ocaml | * Cursor management.
* Returns the current cursor position.
* Indicates whether the cursor is at the given coordinates.
* Hide cursor.
* Show cursor.
* Monitors key press.
* Monitors mouse click.
* Sets the function used to repaint tiles below cursor.
* Sets the function used to paint the cursor.
* Updates cur... | AMFinder - img / imgCursor.mli
*
* MIT License
* Copyright ( c ) 2021
*
* Permission is hereby granted , free of charge , to any person obtaining a copy
* of this software and associated documentation files ( the " Software " ) , to
* deal in the Software without restriction , including without... |
10d77ddf3032de41e65121f992b0c7f40cd3135269105f665b68e221a62bc02c | facebook/duckling | Types.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
HLINT ignore " Use foldr1OrError "
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE N... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/Time/Types.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
# LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings #
needed for intersect
allows specific this+Time
hack to prevent double timezone parsing
| Return a tuple of... | Copyright ( c ) 2016 - present , Facebook , Inc.
HLINT ignore " Use foldr1OrError "
# LANGUAGE DeriveGeneric #
# LANGUAGE NamedFieldPuns #
# LANGUAGE NoRebindableSyntax #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
module Duckling.Time.Types where
import Control.DeepSeq
import Data.Aeson
import Data.... |
e7be8f9e0e4010531d7e859a3fea80b459c4cee55362de69fcdf194829ebdc5f | Carnap/Carnap | Sql.hs | # LANGUAGE TypeApplications #
module Util.Sql where
import Carnap.GHCJS.SharedTypes (ProblemSource (Book))
import ClassyPrelude hiding (on)
import Database.Esqueleto.Experimental
import Model
NOTE : probably should use a newer esqueleto with the type level strings e.g. ps ^. # assignmentId
-- but I don't have time... | null | https://raw.githubusercontent.com/Carnap/Carnap/7abdb1bb7800ebf957b1557f43413df7b19d8c1f/Carnap-Server/Util/Sql.hs | haskell | but I don't have time to port the codebase re other updates
also include problem submissions not attached to an assignment ie book ones | # LANGUAGE TypeApplications #
module Util.Sql where
import Carnap.GHCJS.SharedTypes (ProblemSource (Book))
import ClassyPrelude hiding (on)
import Database.Esqueleto.Experimental
import Model
NOTE : probably should use a newer esqueleto with the type level strings e.g. ps ^. # assignmentId
problemsCompletedByUser... |
ccd6da134f800ea9cfab25457d26af3dd5be06f5e90d5859a580083f3ff04076 | ZHaskell/stdio | BaseSpec.hs | # LANGUAGE TypeApplications #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
module Std.Data.Text.BaseSpec where
import qualified Data.List as List
import Data.Word
import qualified Std.Data.Text.Base as T
import Test.QuickCheck
import Test.Quick... | null | https://raw.githubusercontent.com/ZHaskell/stdio/7887b9413dc9feb957ddcbea96184f904cf37c12/std-data/test/Std/Data/Text/BaseSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TypeApplications #
# LANGUAGE ScopedTypeVariables #
module Std.Data.Text.BaseSpec where
import qualified Data.List as List
import Data.Word
import qualified Std.Data.Text.Base as T
import Test.QuickCheck
import Test.QuickCheck.Function
import Tes... |
b26c92d85c54fceae0ded86e81d0b1601c62e58f1ea4b3c04c95b686d28fc721 | Bigsy/pg-embedded-clj | postgres.clj | (ns pg-embedded-clj.postgres
(:require [integrant.core :as ig]
[clojure.java.io :as io])
(:import io.zonky.test.db.postgres.embedded.EmbeddedPostgres
java.lang.ProcessBuilder$Redirect))
(defn ->pg [port pg-log]
(let [pg (-> (EmbeddedPostgres/builder)
(.setPort port))]
(w... | null | https://raw.githubusercontent.com/Bigsy/pg-embedded-clj/a7dce2df79bef943937a03f7de3cbc8efee47a8b/src/pg_embedded_clj/postgres.clj | clojure | (ns pg-embedded-clj.postgres
(:require [integrant.core :as ig]
[clojure.java.io :as io])
(:import io.zonky.test.db.postgres.embedded.EmbeddedPostgres
java.lang.ProcessBuilder$Redirect))
(defn ->pg [port pg-log]
(let [pg (-> (EmbeddedPostgres/builder)
(.setPort port))]
(w... | |
2f4faaacefa46f728630c772a69c2bee7a5f8626a38a4421cfeb65ed8fc27055 | narkisr-deprecated/core | dnsmasq.clj | (comment
re-core, Copyright 2012 Ronen Narkis, narkisr.com
Licensed under the Apache License,
Version 2.0 (the "License") you may not use this file except in compliance with the License.
You may obtain a copy of the License at -2.0
Unless required by applicable law or agreed to in writing, software
... | null | https://raw.githubusercontent.com/narkisr-deprecated/core/85b4a768ef4b3a4eae86695bce36d270dd51dbae/src/hooks/dnsmasq.clj | clojure | (comment
re-core, Copyright 2012 Ronen Narkis, narkisr.com
Licensed under the Apache License,
Version 2.0 (the "License") you may not use this file except in compliance with the License.
You may obtain a copy of the License at -2.0
Unless required by applicable law or agreed to in writing, software
... | |
9db6391b9f7fe11248671de17da7c15a753a22a1464baaacaeeb3226e5aabc74 | utahstreetlabs/risingtide | ListingActivatedStory.clj | (ns risingtide.serializers.ListingActivatedStory
(:require [risingtide.serializers :refer [write-record read-record]]
[risingtide.model.story :refer [map->ListingActivatedStory]])
(:gen-class
:extends com.esotericsoftware.kryo.Serializer))
(defn -write [this kryo output story]
(write-record output... | null | https://raw.githubusercontent.com/utahstreetlabs/risingtide/bc5b798396679739469b1bd8ee1b03db76178cde/src/risingtide/serializers/ListingActivatedStory.clj | clojure | (ns risingtide.serializers.ListingActivatedStory
(:require [risingtide.serializers :refer [write-record read-record]]
[risingtide.model.story :refer [map->ListingActivatedStory]])
(:gen-class
:extends com.esotericsoftware.kryo.Serializer))
(defn -write [this kryo output story]
(write-record output... | |
e4b22264aefb513b256e11988a48302b61356b9621a79e3811dbb7374443832e | Armael/papiers | preludelib.ml | (******************************************************************************)
Copyright ( c ) 2013 - 2014 Armaël Guéneau .
(* See the file LICENSE for copying permission. *)
(**************************************************************************... | null | https://raw.githubusercontent.com/Armael/papiers/2cfab4759a6aee510a27d5ad4f02d210ced479a4/lib/preludelib.ml | ocaml | ****************************************************************************
See the file LICENSE for copying permission.
****************************************************************************
Return the list of all the files in a given directory, with
their relative path into ... | Copyright ( c ) 2013 - 2014 Armaël Guéneau .
open Batteries
let explore_directory (dir: string) =
let (^/) = Filename.concat in
let root = dir in
let rec aux prefix =
let files = ref [] in
begin try
let content = Sys.readdir (root ^/ prefix) in
Array.i... |
413ced0510daa2a0b3162125a6de3a5832b378497123ebb63e670c215684d536 | backtracking/ocaml-bazaar | nerdle.ml |
*
Quick Nerdle game
Author :
Quick Nerdle game
Cf /
Author: Jean-Christophe Filliâtre
*)
open Format
let width = ref 8 (* number of columns *)
module R = struct (* rational numbers *)
type t = int * int
let rec gcd n m = if m = 0 then n else gcd m (n mod m)
let zero = 0, 1
let si... | null | https://raw.githubusercontent.com/backtracking/ocaml-bazaar/8b64d99262a3c93ef83ccbf139b5dc62acb94835/nerdle.ml | ocaml | number of columns
rational numbers
command line
enumerating all expressions / equations
by length: expr.(len) = hash table value |-> string list
count.(len) = total number of expressions of that length
ceqn.(pos) = number of equations with '=' at that position
constant
operations
position of left... |
*
Quick Nerdle game
Author :
Quick Nerdle game
Cf /
Author: Jean-Christophe Filliâtre
*)
open Format
type t = int * int
let rec gcd n m = if m = 0 then n else gcd m (n mod m)
let zero = 0, 1
let simplify (a, b as r) =
if b = 0 then raise Division_by_zero;
if a = 0 then
... |
02116249a9de95b6e04012964360191bec6c49493faf6d28ec73c401c3c474b6 | testdouble/clojurescript.csv | csv_test.cljs | (ns testdouble.cljs.csv-test
(:require [testdouble.cljs.csv :as csv]
[cljs.test :as t])
(:require-macros [cljs.test :refer [deftest testing is run-tests]]))
(enable-console-print!)
(deftest write-csv-test
(let [data [[1 2 3] [4 5 6]]]
(testing "default separator ','"
(is (= "1,2,3\n4,5,6" ... | null | https://raw.githubusercontent.com/testdouble/clojurescript.csv/dbef79b4b6a9f2740c52cefdb3cdaa8b8210c255/test/testdouble/cljs/csv_test.cljs | clojure | (ns testdouble.cljs.csv-test
(:require [testdouble.cljs.csv :as csv]
[cljs.test :as t])
(:require-macros [cljs.test :refer [deftest testing is run-tests]]))
(enable-console-print!)
(deftest write-csv-test
(let [data [[1 2 3] [4 5 6]]]
(testing "default separator ','"
(is (= "1,2,3\n4,5,6" ... | |
ba5736bd2067a3833c5161049efca52564aabf567e9ce897e30018eea1d42a3c | litxio/ptghci | PtgRequest.hs |
module Language.Haskell.PtGhci.PtgRequest where
import Language.Haskell.PtGhci.Prelude
import GHC.Generics
import Data.Aeson
import Data.Text
data PtgRequest = RequestExecCapture { content :: Text }
| RequestExecStream { content :: Text }
| RequestType { identifier :: Text, show... | null | https://raw.githubusercontent.com/litxio/ptghci/bbb3c5fdf2e73a557864b6b1e26833fffb34fc84/src/Language/Haskell/PtGhci/PtgRequest.hs | haskell |
module Language.Haskell.PtGhci.PtgRequest where
import Language.Haskell.PtGhci.Prelude
import GHC.Generics
import Data.Aeson
import Data.Text
data PtgRequest = RequestExecCapture { content :: Text }
| RequestExecStream { content :: Text }
| RequestType { identifier :: Text, show... | |
bb9cd9376cf34c6f93937444c3789e1c65d8dff15c4e4d017d03067a92c9b33a | soegaard/metapict | save-pdf.rkt | #lang racket
(require "def.rkt" pict racket/draw)
(provide save-pict-as-pdf)
(def a4-width 595) ; in pt
(def a4-height 842) ; in pt
(define (use-a4-paper)
(define setup (new ps-setup%))
(current-ps-setup setup)
(send setup set-paper-name "A4 210 x 297 mm")
; introduce margins such that the result is centere... | null | https://raw.githubusercontent.com/soegaard/metapict/47ae265f73cbb92ff3e7bdd61e49f4af17597fdf/metapict/save-pdf.rkt | racket | in pt
in pt
introduce margins such that the result is centered
(use-a4-paper)
(define dc (new pdf-dc% [interactive #f] [parent #f] [use-paper-bbox #t] [as-eps #f] [output #f]))
important! | #lang racket
(require "def.rkt" pict racket/draw)
(provide save-pict-as-pdf)
(define (use-a4-paper)
(define setup (new ps-setup%))
(current-ps-setup setup)
(send setup set-paper-name "A4 210 x 297 mm")
(def α 0.9)
(send setup set-margin (/ (* (- 1 α) a4-width) 2) (/ (* (- 1 α) a4-height) 2))
(send setup ... |
e508508db0e34b58a8846e02f9e5e00640938897d19cae781e6f69896228b17f | ocaml-batteries-team/batteries-included | mid.ml | let mid1 a b =
if (0 <= a && 0 <= b) || (a < 0 && b < 0) then
if a <= b then a + ((b-a)/2) else b + ((a-b)/2)
else
let s = a + b in
if s >= 0 then s/2 else s - s/2
let mid2 a b = (a+b)/2
let mid3 a b =
if (a >= 0) then
if (b >= 0) then
a + (b - a) / 2
else
(a+b) / 2
else
if... | null | https://raw.githubusercontent.com/ocaml-batteries-team/batteries-included/f143ef5ec583d87d538b8f06f06d046d64555e90/benchsuite/mid.ml | ocaml | let mid1 a b =
if (0 <= a && 0 <= b) || (a < 0 && b < 0) then
if a <= b then a + ((b-a)/2) else b + ((a-b)/2)
else
let s = a + b in
if s >= 0 then s/2 else s - s/2
let mid2 a b = (a+b)/2
let mid3 a b =
if (a >= 0) then
if (b >= 0) then
a + (b - a) / 2
else
(a+b) / 2
else
if... | |
e01468a24e5184957c65de15385c5cd0eee2757400d402ed9e2e260742cc2655 | szymonrw/GUIFTW | swt.clj | (ns guiftw.swt
"Functions for Happy SWT User."
(:require (guiftw [tree :as tree]
[props :as props]))
(:import (org.eclipse.swt SWT)
(org.eclipse.swt.widgets Display MessageBox)))
(defn swt-create
"Instantiates object in SWT-specific manner."
[ctor style parent parent-style]
(apply ctor par... | null | https://raw.githubusercontent.com/szymonrw/GUIFTW/6f08bb0602cb3f4a691a606ebd376e35d15087fd/src/guiftw/swt.clj | clojure | (ns guiftw.swt
"Functions for Happy SWT User."
(:require (guiftw [tree :as tree]
[props :as props]))
(:import (org.eclipse.swt SWT)
(org.eclipse.swt.widgets Display MessageBox)))
(defn swt-create
"Instantiates object in SWT-specific manner."
[ctor style parent parent-style]
(apply ctor par... | |
d5a94b6c61422d8bcae60aad79c8399a50872ce0d364c8a8150e7445dd334388 | benzap/eden | def.cljc | (ns eden.def
(:require
[eden.std.meta :as meta]
[eden.state-machine :as state]
[eden.std.expression :refer [Expression evaluate-expression]]))
(defn set-var!
[eden name value]
(swap! (:*sm eden) state/set-global-var name value)
eden)
| null | https://raw.githubusercontent.com/benzap/eden/dbfa63dc18dbc5ef18a9b2b16dbb7af0e633f6d0/src/eden/def.cljc | clojure | (ns eden.def
(:require
[eden.std.meta :as meta]
[eden.state-machine :as state]
[eden.std.expression :refer [Expression evaluate-expression]]))
(defn set-var!
[eden name value]
(swap! (:*sm eden) state/set-global-var name value)
eden)
| |
cb97d012413f5cf7b99c85a090ec78d590fec3c4b629ec22b5f38b27782edf61 | morgenthum/lambda-heights | Render.hs | module LambdaHeights.Render where
import ComposeEngine.Loop
import ComposeEngine.RenderContext
import ComposeEngine.Types.Loop
import qualified Control.Monad.IO.Class as M
import qualified Control.Monad.Reader as M
import qualified Data.Text as T
import Data.Word
import Foreign.C.Types
import Linear.V2
import Linear.V... | null | https://raw.githubusercontent.com/morgenthum/lambda-heights/0a86ead23e8c223ba2672fa314666a06eb669fe2/lambda-heights/src/LambdaHeights/Render.hs | haskell | module LambdaHeights.Render where
import ComposeEngine.Loop
import ComposeEngine.RenderContext
import ComposeEngine.Types.Loop
import qualified Control.Monad.IO.Class as M
import qualified Control.Monad.Reader as M
import qualified Data.Text as T
import Data.Word
import Foreign.C.Types
import Linear.V2
import Linear.V... | |
6e75bbd040a17e665384d7cea2b01fdec299cba923600b4f7f936e9337fa8ddf | valderman/selda | Config.hs | {-# LANGUAGE OverloadedStrings #-}
module Database.Selda.SQL.Print.Config (PPConfig (..), defPPConfig) where
import Data.Text (Text)
import qualified Data.Text as T
import Database.Selda.SqlType ( SqlTypeRep(..) )
import Database.Selda.Table.Type
( IndexMethod, ColAttr(..), AutoIncType(Weak, Strong) )
-- | Backend... | null | https://raw.githubusercontent.com/valderman/selda/c270f354caaa733d10b79d5c0ba05f98f56fa4b6/selda/src/Database/Selda/SQL/Print/Config.hs | haskell | # LANGUAGE OverloadedStrings #
| Backend-specific configuration for the SQL pretty-printer.
| The SQL type name of the given type.
This function should be used everywhere a type is needed to be printed but in primary
keys position. This is due to the fact that some backends might have a special
representati... | module Database.Selda.SQL.Print.Config (PPConfig (..), defPPConfig) where
import Data.Text (Text)
import qualified Data.Text as T
import Database.Selda.SqlType ( SqlTypeRep(..) )
import Database.Selda.Table.Type
( IndexMethod, ColAttr(..), AutoIncType(Weak, Strong) )
data PPConfig = PPConfig
ppType :: SqlTypeR... |
ce99247fc4fde3858be5f91eb3c612d7ab6e3e2612b73a3f7f3ad44a2974fe45 | oliyh/slacky | google.clj | (ns slacky.google
(:require [clj-http
[client :as http]
[conn-mgr :refer [make-reusable-conn-manager]]]
[cheshire.core :as json]
[clojure.tools.logging :as log]))
(def image-search-url "")
(def connection-pool (make-reusable-conn-manager {:timeout 10 :threads 4 :defa... | null | https://raw.githubusercontent.com/oliyh/slacky/909110e0555b7e443c3cf014c7c34b00b31c1a18/src/clj/slacky/google.clj | clojure | (ns slacky.google
(:require [clj-http
[client :as http]
[conn-mgr :refer [make-reusable-conn-manager]]]
[cheshire.core :as json]
[clojure.tools.logging :as log]))
(def image-search-url "")
(def connection-pool (make-reusable-conn-manager {:timeout 10 :threads 4 :defa... | |
69bdc958ba7938b25783510391d12fbd6909707c294a2d97566cb35a0138d29c | fractalide/fractalide | wcreate.rkt | #lang racket
(provide (contract-out
[struct wcreate ((name string?)
(pwd string?)
(pwd-cfm string?))]))
(struct wcreate (name pwd pwd-cfm) #:prefab #:mutable)
| null | https://raw.githubusercontent.com/fractalide/fractalide/9c54ec2615fcc2a1f3363292d4eed2a0fcb9c3a5/modules/rkt/rkt-fbp/edges/cardano-wallet/wcreate.rkt | racket | #lang racket
(provide (contract-out
[struct wcreate ((name string?)
(pwd string?)
(pwd-cfm string?))]))
(struct wcreate (name pwd pwd-cfm) #:prefab #:mutable)
| |
7158cb8247260c34ccad490e464ec8c50fb6ccb82f04ea76d8a09e888203abc4 | mrosset/nomad | nomad.scm | nomad.scm --- Nomad union module
Copyright ( C ) 2019 Amar Singh< >
This file is part of Nomad .
;; This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or... | null | https://raw.githubusercontent.com/mrosset/nomad/c94a65ede94d86eff039d2ef62d5ef3df609568a/scheme/nomad/nomad.scm | scheme | This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public L... | nomad.scm --- Nomad union module
Copyright ( C ) 2019 Amar Singh< >
This file is part of Nomad .
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
... |
2e54d576173ac4e626f08f8fab9ee9412e5205bbf28b4c7ad6870ddd53753bbd | goblint/analyzer | tracing.ml | TRACING STUFF . A rewrite of 's tracing framework which is too slow for the
* large domains we output . The original code generated the document object
* even when the subsystem is not activated .
* large domains we output. The original code generated the document object
* even when the subsystem is not acti... | null | https://raw.githubusercontent.com/goblint/analyzer/3be08222c7a3cd5605bb35705b85c74a4b41da4b/src/util/tracing.ml | ocaml | Parses a format string to generate a nop-function of the correct type.
trace*
* l: include location
* i: indent after print, optionally activate subsys for sys
* u: outdent after print, deactivate subsys of sys
* c: continue/normal print w/o indent-change
| TRACING STUFF . A rewrite of 's tracing framework which is too slow for the
* large domains we output . The original code generated the document object
* even when the subsystem is not activated .
* large domains we output. The original code generated the document object
* even when the subsystem is not acti... |
aa4a56ebb0a0c1580132e071ba2a0f231646e3212f89bfb18166e8278521678e | pirapira/coq2rust | pptactic.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/pirapira/coq2rust/22e8aaefc723bfb324ca2001b2b8e51fcc923543/printing/pptactic.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* The default pretty-printers produc... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* This module implements pret... |
2f9dfdcd6e80da0a7daeb19665309a6ee2c92e9cd299ae36fb8f26559b3e167d | gadfly361/breaking-point | core.cljs | (ns breaking-point.core
(:require
[re-frame.core :as rf]
[re-frame-fx.dispatch]
))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; PUBLIC API
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(rf/reg-event-fx
::set-breakpoints
(fn [_ [_ {:keys [breakpoints ;; required
debounce-ms ;; optional
]
... | null | https://raw.githubusercontent.com/gadfly361/breaking-point/7e399d1f0f56c27f0683597c285a86b7466c99b3/src/main/breaking_point/core.cljs | clojure |
PUBLIC API
required
optional
Implementation
COFX
Events
Subs | (ns breaking-point.core
(:require
[re-frame.core :as rf]
[re-frame-fx.dispatch]
))
(rf/reg-event-fx
::set-breakpoints
]
:as opts}]]
{::set-breakpoints opts}))
(rf/reg-cofx
::screen-dimensions
(fn [coeffect]
(let [screen-width (or (some-> js/window
... |
ea97e13b699bebe0b67f739b3cf25e87daa98a9c240b686216732d53911ed718 | emqx/emqx | emqx_trie_SUITE.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2017 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/emqx/dbc10c2eed3df314586c7b9ac6292083204f1f68/apps/emqx/test/emqx_trie_SUITE.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2017 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_trie_SUITE).
-compile(export_all).
-compile(nowarn_export_all).
-include_lib("emq... |
4b1a918ee2385b7e9f9c8344a4295f65b9efe16678b29d3518970fec4f9f0a0a | janestreet/hardcaml_circuits | test_cordic_reference.ml | open! Import
open! Float2
let error a b = Float.(abs (a - b))
let test_range ~start ~stop ~steps ~f_cordic ~f =
let delta = (stop -. start) /. Float.of_int steps in
Array.init (steps + 1) ~f:(fun i ->
let arg = start +. (Float.of_int i *. delta) in
arg, error (f_cordic arg) (f arg))
;;
let%expect_test "c... | null | https://raw.githubusercontent.com/janestreet/hardcaml_circuits/a2c2d1ea3e6957c3cda4767d519e94c20f1172b2/test/test_cordic_reference.ml | ocaml | doesn't converge. | open! Import
open! Float2
let error a b = Float.(abs (a - b))
let test_range ~start ~stop ~steps ~f_cordic ~f =
let delta = (stop -. start) /. Float.of_int steps in
Array.init (steps + 1) ~f:(fun i ->
let arg = start +. (Float.of_int i *. delta) in
arg, error (f_cordic arg) (f arg))
;;
let%expect_test "c... |
0759c6761c2efd7794959e6bd1915b05baeac6d2130265db9cb4daf69bd23f7f | jonase/eastwood | third_party_deps_test.clj | (ns eastwood.third-party-deps-test
(:require
[clojure.test :refer [deftest is testing]]
[eastwood.lint]))
(when-not (System/getProperty "eastwood.internal.plugin-profile-active")
(let [p "eastwood.internal.running-test-suite"
v (System/getProperty p)]
(assert (= "true" v)
(format "The... | null | https://raw.githubusercontent.com/jonase/eastwood/ca4a6f94ce4e39754fd78f06cd6560b40fe6c923/test-third-party-deps/eastwood/third_party_deps_test.clj | clojure |
This counterexample is important not only for covering the option itself,
but also for making sure the previous test is logically valid:
Make test more logically robust | (ns eastwood.third-party-deps-test
(:require
[clojure.test :refer [deftest is testing]]
[eastwood.lint]))
(when-not (System/getProperty "eastwood.internal.plugin-profile-active")
(let [p "eastwood.internal.running-test-suite"
v (System/getProperty p)]
(assert (= "true" v)
(format "The... |
f6191832b792ba558bfb32d86f8f1c2efe02c0525b6260a0eb5cc227eeacdc01 | softlab-ntua/bencherl | proposer.erl | 2009 - 2011 Zuse Institute Berlin ,
2010 onScale solutions GmbH
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% -2.0
%
% Unless required by applicable l... | null | https://raw.githubusercontent.com/softlab-ntua/bencherl/317bdbf348def0b2f9ed32cb6621e21083b7e0ca/app/scalaris/src/paxos/proposer.erl | erlang | you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language gov... | 2009 - 2011 Zuse Institute Berlin ,
2010 onScale solutions GmbH
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
@doc Description : Part of generic Paxos - Consensus implementation
@v... |
8b60efd03aa147cae6b89aa545497b56471e707641383f371f54d3f3766f1287 | ds-wizard/engine-backend | ServerConfigDM.hs | module Wizard.Model.Config.ServerConfigDM where
import Shared.Model.Config.Environment
import Shared.Model.Config.ServerConfigDM
import Wizard.Model.Config.ServerConfig
defaultConfig :: ServerConfig
defaultConfig =
ServerConfig
{ general = defaultGeneral
, database = defaultDatabase
, s3 = defaultS3
... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/bcd95eef9e96d5d9d7c737671aa29119692e694c/engine-wizard/src/Wizard/Model/Config/ServerConfigDM.hs | haskell | module Wizard.Model.Config.ServerConfigDM where
import Shared.Model.Config.Environment
import Shared.Model.Config.ServerConfigDM
import Wizard.Model.Config.ServerConfig
defaultConfig :: ServerConfig
defaultConfig =
ServerConfig
{ general = defaultGeneral
, database = defaultDatabase
, s3 = defaultS3
... | |
f5f11b138acb4e4a4857aacc5762c120f10b13e82626ebb8cef543e455048a2d | lexi-lambda/racket-tulip | math.rkt | #lang racket/base
(require racket/math
tulip/base
tulip/private/util/curry)
(provide
abs
round
floor
sqrt
exp
log
random
pi
sqr
sgn
sin asin sinh
cos acos cosh
tan atan tanh
eq gt lt gte lte
(rename-out
[add1 incr]
[sub1 decr]
[ceiling ceil])
(curry-out
[(+ add) 2]
[(... | null | https://raw.githubusercontent.com/lexi-lambda/racket-tulip/1613cfd4d7e8dbc8ceb86cf33479375147f42b2f/tulip-lib/math.rkt | racket | #lang racket/base
(require racket/math
tulip/base
tulip/private/util/curry)
(provide
abs
round
floor
sqrt
exp
log
random
pi
sqr
sgn
sin asin sinh
cos acos cosh
tan atan tanh
eq gt lt gte lte
(rename-out
[add1 incr]
[sub1 decr]
[ceiling ceil])
(curry-out
[(+ add) 2]
[(... | |
d1221556ac1aceea772d0fe645b5ec6f8a2727fac0d6b42f5f9691dfaf75553b | arknode-io/tivan | tivan_tags.erl | %%%-------------------------------------------------------------------
@author
( C ) 2019 ,
%%% @doc
%%%
%%% @end
Created : 2019 - 06 - 20 21:35:56.736576
%%%-------------------------------------------------------------------
-module(tivan_tags).
%% API
-export([create/1
,tag/3
,untag/3
... | null | https://raw.githubusercontent.com/arknode-io/tivan/25ab58959ccc02df509985d216bb96b61df495e6/src/tivan_tags.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
===================================================================
API
=================================================================== | @author
( C ) 2019 ,
Created : 2019 - 06 - 20 21:35:56.736576
-module(tivan_tags).
-export([create/1
,tag/3
,untag/3
,tags/2
,entities/2]).
create(Name) ->
tivan:create(Name, #{columns => [tag_entity, created_on]
,type => ordered_set}).
tag(Name, En... |
41d78e5a739f75ae4d452c46ebe3396902662bc6fc1695d79bf85cde2efaf6ea | rollacaster/sketches | vector.cljc | (ns sketches.vector)
(defn add
([v] v)
([[x1 y1] [x2 y2]]
[(+ x1 x2) (+ y1 y2)])
([v1 v2 & vs]
(apply add (add v1 v2) vs)))
(defn sub [v1 v2]
(vector (- (first v1) (first v2))
(- (second v1) (second v2))))
(defn mult [v1 n] (vector (* (first v1) n) (* (second v1) n)))
(defn div [[x y] n] (if... | null | https://raw.githubusercontent.com/rollacaster/sketches/ba79fccf2a37139de9193ed2ea7a6cc04b63fad0/src/sketches/vector.cljc | clojure | (ns sketches.vector)
(defn add
([v] v)
([[x1 y1] [x2 y2]]
[(+ x1 x2) (+ y1 y2)])
([v1 v2 & vs]
(apply add (add v1 v2) vs)))
(defn sub [v1 v2]
(vector (- (first v1) (first v2))
(- (second v1) (second v2))))
(defn mult [v1 n] (vector (* (first v1) n) (* (second v1) n)))
(defn div [[x y] n] (if... | |
7a7d1c231cfcfcaa5cddbd8ba19179b993f8d11fff8610bd48ae074bb8b01f3a | camllight/camllight | decompr.ml | exception Mauvais_suffixe;;
let enlève_suffixe_cpr chaîne =
let longueur = string_length chaîne in
if longueur < 4 or sub_string chaîne (longueur - 4) 4 <> ".cpr"
then raise Mauvais_suffixe
else sub_string chaîne 0 (longueur - 4);;
#open "sys";;
exception Erreur;;
let erreur = ref false;;
for i = 1 to vect_len... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/examples/compress/decompr.ml | ocaml | exception Mauvais_suffixe;;
let enlève_suffixe_cpr chaîne =
let longueur = string_length chaîne in
if longueur < 4 or sub_string chaîne (longueur - 4) 4 <> ".cpr"
then raise Mauvais_suffixe
else sub_string chaîne 0 (longueur - 4);;
#open "sys";;
exception Erreur;;
let erreur = ref false;;
for i = 1 to vect_len... | |
f26af26c5be3f9a4b9f147d5d2c9d12f5c9f08b5b6066c1b48b1233fe47b4f4d | static-analysis-engineering/codehawk | bCHDisassembleARMInstructionTest.ml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Unit Testing Framework
Author : Adapted from : ( )
------------------------------------------------------------------------------
... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/e8fed9f226abe38578768968279c8242eb21fea9/CodeHawk/CHT/CHB_tests/bchlibarm32_tests/txbchlibarm32/bCHDisassembleARMInstructionTest.ml | ocaml | chutil
bchlib
bchlibarm32
tchlib
bchlib
bchlibarm32
needs to be ANDS
basic arm opcodes
set code extent so checks on absolute code addresses pass | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Unit Testing Framework
Author : Adapted from : ( )
------------------------------------------------------------------------------
... |
4d8f215363ac477e3f9d743ad517ac424821e63c9eedeeb6836e6f1ff62398a4 | SimulaVR/godot-haskell | VisualScript.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.VisualScript
(Godot.Core.VisualScript.sig_node_ports... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/VisualScript.hs | haskell | # NOINLINE bindVisualScript_add_function #
# NOINLINE bindVisualScript_get_function_scroll #
# NOINLINE bindVisualScript_get_variable_default_value #
# NOINLINE bindVisualScript_get_variable_export #
# NOINLINE bindVisualScript_has_sequence_connection #
# NOINLINE bindVisualScript_rename_function # | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.VisualScript
(Godot.Core.VisualScript.sig_node_ports... |
92171a5bbda559b49ee86bf5529d7757083413b13e8b32a391f754cd94d9d8d5 | gregtatcam/imaplet-lwt | lazy_maildir_message.ml |
* Copyright ( c ) 2013 - 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... | null | https://raw.githubusercontent.com/gregtatcam/imaplet-lwt/d7b51253e79cffa97e98ab899ed833cd7cb44bb6/lib/commands/lazy_maildir_message.ml | ocaml | message body without the headers
lazy string returns email message string, lazy email.t returns parsed email
* message
plain content
return email message with headers
return raw message as is
exclude/include headers
lazy string returns message string w/out postmark, lazy message.t returns parsed message... |
* Copyright ( c ) 2013 - 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... |
4749478ee0b26fde0ae78e5e1f4d8aa7ed40b78c723a80fa0d876e6346ab9875 | static-analysis-engineering/codehawk | bCHPEResourceDirectory.mli | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/c1b3158e0d73cda7cfc10d75f6173f4297991a82/CodeHawk/CHB/bchlibpe/bCHPEResourceDirectory.mli | ocaml | bchlibpe | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... |
04c492e0bdc7d8fd9a5ad74512995a16174042a6da181b70a6a44cd962954843 | ditto/ditto | Solve.hs | module Ditto.Solve where
import Ditto.Syntax
import Ditto.Monad
import Ditto.Conv
----------------------------------------------------------------------
solveProbs :: TCM ()
solveProbs = do
xs <- probGNames
mapM_ (flip updateProb workProb) xs
----------------------------------------------------------------------... | null | https://raw.githubusercontent.com/ditto/ditto/f0d35271950216308f3f9bbcf701b176ece5ccd9/src/Ditto/Solve.hs | haskell | --------------------------------------------------------------------
--------------------------------------------------------------------
-------------------------------------------------------------------- | module Ditto.Solve where
import Ditto.Syntax
import Ditto.Monad
import Ditto.Conv
solveProbs :: TCM ()
solveProbs = do
xs <- probGNames
mapM_ (flip updateProb workProb) xs
workProb :: Prob -> TCM MProb
workProb (Prob1 acts ctx a1 a2) = resetCtx acts ctx (convActless a1 a2)
workProb (ProbN p acts ctx as1 as2) = ... |
5cd1a9b42552864122f65d561be2a679ba23e4784424a552fa259206de728774 | Helium4Haskell/helium | Instances.hs | class LegeClass a
instance LegeClass Int
class IdentityClass a where
identiteit :: a -> a
instance IdentityClass Bool where
identiteit a = a
class LegeClass a => MetContext a
instance MetContext Int
class IdentityMetDefault a where
identity :: a -> a
identity b = id b
inst... | null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/typeClassesParse/Instances.hs | haskell | class LegeClass a
instance LegeClass Int
class IdentityClass a where
identiteit :: a -> a
instance IdentityClass Bool where
identiteit a = a
class LegeClass a => MetContext a
instance MetContext Int
class IdentityMetDefault a where
identity :: a -> a
identity b = id b
inst... | |
b1913407db4e13736c381f37efd2d140c95d43250480453aeae8d6a4f1946f64 | SamirTalwar/advent-of-code | AOC_10_1.hs | import qualified Data.Char as Char
main = do
input <- trim <$> getContents
let iterations = iterate lookAndSay input
print $ length $ iterations !! 40
trim :: String -> String
trim = takeWhile (not . Char.isSpace) . dropWhile Char.isSpace
lookAndSay :: String -> String
lookAndSay "" = ""
lookAndSay string@(n :... | null | https://raw.githubusercontent.com/SamirTalwar/advent-of-code/66bd9e31f078c9b81ece0264fb869e48964afa63/2015/AOC_10_1.hs | haskell | import qualified Data.Char as Char
main = do
input <- trim <$> getContents
let iterations = iterate lookAndSay input
print $ length $ iterations !! 40
trim :: String -> String
trim = takeWhile (not . Char.isSpace) . dropWhile Char.isSpace
lookAndSay :: String -> String
lookAndSay "" = ""
lookAndSay string@(n :... | |
643dcc03c712c9e836ebccef545e81b32824c151d3bd08304bec403d49dff874 | processone/ejabberd-contrib | ejabberd_observer_cli_vhosts.erl | -module(ejabberd_observer_cli_vhosts).
%% observer_cli_plugin Callback API
-export([attributes/1, sheet_header/0, sheet_body/1]).
attributes(PrevState) ->
Hosts = length(ejabberd_option:hosts()),
RegisteredUsers =
lists:foldl(
fun(Host, Sum) ->
ejabberd_auth:count_users(Hos... | null | https://raw.githubusercontent.com/processone/ejabberd-contrib/8fd6fabdbbce4757e8e26cfbf5c6b48d7564d871/ejabberd_observer_cli/src/ejabberd_observer_cli_vhosts.erl | erlang | observer_cli_plugin Callback API | -module(ejabberd_observer_cli_vhosts).
-export([attributes/1, sheet_header/0, sheet_body/1]).
attributes(PrevState) ->
Hosts = length(ejabberd_option:hosts()),
RegisteredUsers =
lists:foldl(
fun(Host, Sum) ->
ejabberd_auth:count_users(Host) + Sum
end,
... |
2d0f596b55ec52bbc2aec84daeb4f7d0bea328440bcf082bc01b0f3b95ae6a15 | valderman/haste-compiler | EscapedChars.hs | # LANGUAGE CPP #
module Tests.EscapedChars where
import Data.Char (ord)
# NOINLINE str1 #
str1 = "Tomten klappar \"händerna\""
# NOINLINE str2 #
str2 = " åt:\t5001 apor med backslashar: \\"
# NOINLINE theString #
theString = str1 ++ str2
Standalone SpiderMonkey ca n't handle showing Unicode chars , so we have to
... | null | https://raw.githubusercontent.com/valderman/haste-compiler/47d942521570eb4b8b6828b0aa38e1f6b9c3e8a8/Tests/EscapedChars.hs | haskell | look at the char codes. :( | # LANGUAGE CPP #
module Tests.EscapedChars where
import Data.Char (ord)
# NOINLINE str1 #
str1 = "Tomten klappar \"händerna\""
# NOINLINE str2 #
str2 = " åt:\t5001 apor med backslashar: \\"
# NOINLINE theString #
theString = str1 ++ str2
Standalone SpiderMonkey ca n't handle showing Unicode chars , so we have to
... |
f9003c723b3ab8e10a6506e75fb88c7f7c54723d9a27f8d1057851366202402a | yesodweb/yesod | YesodStaticTest.hs | module YesodStaticTest (specs) where
import Test.Hspec
import Yesod.Static (getFileListPieces)
specs :: Spec
specs = do
describe "get file list" $ do
it "pieces" $ do
getFileListPieces "test/fs" `shouldReturn` [["foo"], ["bar", "baz"]]
| null | https://raw.githubusercontent.com/yesodweb/yesod/c59993ff287b880abbf768f1e3f56ae9b19df51e/yesod-static/test/YesodStaticTest.hs | haskell | module YesodStaticTest (specs) where
import Test.Hspec
import Yesod.Static (getFileListPieces)
specs :: Spec
specs = do
describe "get file list" $ do
it "pieces" $ do
getFileListPieces "test/fs" `shouldReturn` [["foo"], ["bar", "baz"]]
| |
c389a664d3af350d7e53a377eb7a92bb5b04614c0c7139aca2f4ca8acdb24e1d | jubnzv/iec-checker | common.ml | open Core
exception InternalError of string
let ignore v =
let _ = v in ()
let next_id =
let n = ref (-1) in
fun () ->
incr n;
!n
let sublist l low high =
List.filteri l ~f:(fun i _ -> i >= low && i < high)
let rec list_flatten = function
| [] -> []
| [] :: t -> list_flatten t
| (x::y) :: t -... | null | https://raw.githubusercontent.com/jubnzv/iec-checker/ea3c217cda56dfb8a84e85773876d58e358fc499/src/core/common.ml | ocaml | * Tail-recursive append to process large lists.
{{{ Basic routines to work with monads
}}} | open Core
exception InternalError of string
let ignore v =
let _ = v in ()
let next_id =
let n = ref (-1) in
fun () ->
incr n;
!n
let sublist l low high =
List.filteri l ~f:(fun i _ -> i >= low && i < high)
let rec list_flatten = function
| [] -> []
| [] :: t -> list_flatten t
| (x::y) :: t -... |
134b4cda657e8d8afb799b08e69347bf9447ff23f824624d01451c9e3577ffb7 | hammerlab/prohlatype | biology.ml | (** Assorted biological logic centralized. *)
open Util
module Sequence = struct
type type_ =
| GDNA
| CDNA
| Protein
[@@deriving show { with_path = false } ]
let is_nucleotide ?s = function
| 'A' | 'C' | 'G' | 'T' -> true
We 'll parse N as a nucleotide , but why does report this ?
| '... | null | https://raw.githubusercontent.com/hammerlab/prohlatype/3acaf7154f93675fc729971d4c76c2b133e90ce6/src/lib/biology.ml | ocaml | * Assorted biological logic centralized.
Sequence
Ripe for stricter typing
Gene_region
Base |
open Util
module Sequence = struct
type type_ =
| GDNA
| CDNA
| Protein
[@@deriving show { with_path = false } ]
let is_nucleotide ?s = function
| 'A' | 'C' | 'G' | 'T' -> true
We 'll parse N as a nucleotide , but why does report this ?
| 'N' -> Option.iter s ~f:(eprintf "IMGT reports ... |
43110e5d4f304426a7011df5522a094c04c5c4faaaf3fd1606e05771ccd31f06 | glguy/advent2019 | Queue.hs | |
Module : Advent . Queue
Description : Banker 's queue implementation
Copyright : ( c ) , 2018
License : ISC
Maintainer :
Module : Advent.Queue
Description : Banker's queue implementation
Copyright : (c) Eric Mertens, 2018
License : ISC
Maintainer :
-}
{-# Language Pattern... | null | https://raw.githubusercontent.com/glguy/advent2019/13f3be89535c12cbae761a6d4165432a2459ccd5/common/Advent/Queue.hs | haskell | # Language PatternSynonyms, ViewPatterns #
# Options_GHC -Wno-name-shadowing #
| FIFO Queue implementation
# COMPLETE (:<|), Empty #
| Empty queue
fromList ""
| Pattern for 'pop'
('a',fromList "bc")
| Add an element to the end of a queue. See: 'snoc'
>>> fromList "abc" |> 'z'
fromList "abcz"
| Fold over ele... | |
Module : Advent . Queue
Description : Banker 's queue implementation
Copyright : ( c ) , 2018
License : ISC
Maintainer :
Module : Advent.Queue
Description : Banker's queue implementation
Copyright : (c) Eric Mertens, 2018
License : ISC
Maintainer :
-}
module Advent.Queue ... |
5536115a5b27681a9531fc909edc1f9d5dcbe8c7dc816726200292e417d8cb18 | ethercrow/lightstep-haskell | Main.hs | {-# LANGUAGE OverloadedStrings #-}
import Control.Concurrent
import Control.Concurrent.Async
import Control.Monad
import GHC.Stats
import LightStep.Diagnostics
import LightStep.HighLevel.IO
import System.Exit
import Text.Printf
seriousBusinessMain :: IO ()
seriousBusinessMain = concurrently_ frontend backend
where
... | null | https://raw.githubusercontent.com/ethercrow/lightstep-haskell/f447fd37a6c53dcd38c32c53f71a71386f3e425a/stress-test/Main.hs | haskell | # LANGUAGE OverloadedStrings # |
import Control.Concurrent
import Control.Concurrent.Async
import Control.Monad
import GHC.Stats
import LightStep.Diagnostics
import LightStep.HighLevel.IO
import System.Exit
import Text.Printf
seriousBusinessMain :: IO ()
seriousBusinessMain = concurrently_ frontend backend
where
frontend =
withSpanAndTag... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.