_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 |
|---|---|---|---|---|---|---|---|---|
47023b4b2f1d6cdc431abbcf3e9eb7267150f34c8de819de3219433a3bd81118 | GaloisInc/semmc | UF.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE PolyKinds #
# LANGUAGE UndecidableInstances #
# LANGUAGE TypeFamilies #
modul... | null | https://raw.githubusercontent.com/GaloisInc/semmc/4dc4439720b3b0de8812a68f8156dc89da76da57/semmc-ppc/src/SemMC/Architecture/PPC/UF.hs | haskell | # LANGUAGE GADTs #
| The basic type of indices into the array
| The type of the memory array | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE PolyKinds #
# LANGUAGE UndecidableInstances #
# LANGUAGE TypeFamilies #
module SemMC.Architecture.PP... |
0a4626e2dbfa70522ff8b0258d253ae50298e47a2b40888215b10c363278c44a | hrvolapeter/security-log | Incident.hs | {-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
module Data.Incident
( Incident(..)
) where
import Control.Parallel.Strategies (NFData)
import Data.Log
import Data.Text (Text)
import GHC.Generics (Generic)
data Incident = In... | null | https://raw.githubusercontent.com/hrvolapeter/security-log/3434c18934ac3698a90f90c20b6fd3ba4761ebeb/src/Data/Incident.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveGeneric # |
module Data.Incident
( Incident(..)
) where
import Control.Parallel.Strategies (NFData)
import Data.Log
import Data.Text (Text)
import GHC.Generics (Generic)
data Incident = Incident
{ reason :: Text
, log :: Log
} deriving (Eq, Ge... |
20edeb050ad66a949c6eaf73a818851c0585b3afaacfa0d105287b58502b6970 | jiesoul/soul-talk | project.clj | 服务商配置文件 使用
(defproject soul-talk-api "0.2"
:description "self site api"
:url "-talk/api"
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/spec.alpha "0.2.187"]
[org.clojure/tools.cli "0.3.1"]
[org.clojure/tools.namespace "0.3.1"]
... | null | https://raw.githubusercontent.com/jiesoul/soul-talk/630de08c6549b206d59023764d5f2576d97d1030/api/project.clj | clojure | 日志
web api
database
DI
formats clojure.spec error messages
other | 服务商配置文件 使用
(defproject soul-talk-api "0.2"
:description "self site api"
:url "-talk/api"
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/spec.alpha "0.2.187"]
[org.clojure/tools.cli "0.3.1"]
[org.clojure/tools.namespace "0.3.1"]
... |
0cf98add1a14f9d2f6b383e6fff1076c3ae150c3d32da5a1db47f8ec9415a0a7 | MichaelXavier/cron | Schedule.hs | module System.Test.Cron.Internal.Schedule
( tests,
)
where
-------------------------------------------------------------------------------
import Hedgehog
-------------------------------------------------------------------------------
import SpecHelper
import System.Cron.Internal.Schedule
------------------------... | null | https://raw.githubusercontent.com/MichaelXavier/cron/4e0db74b626ba10279c1761834cfa9814642e595/test/System/Test/Cron/Internal/Schedule.hs | haskell | -----------------------------------------------------------------------------
-----------------------------------------------------------------------------
----------------------------------------------------------------------------- | module System.Test.Cron.Internal.Schedule
( tests,
)
where
import Hedgehog
import SpecHelper
import System.Cron.Internal.Schedule
tests :: TestTree
tests =
testGroup
"System.Cron.Schedule"
[ describeFindNextMinuteDelay'
]
describeFindNextMinuteDelay' :: TestTree
describeFindNextMinuteDelay' =
te... |
c9b97ae3ee6c4433d477cfe10e2902081bc1ddb5572d7d08253f523e19328ec1 | nikita-volkov/rerebase | List1.hs | module Data.List1
(
module Rebase.Data.List1
)
where
import Rebase.Data.List1
| null | https://raw.githubusercontent.com/nikita-volkov/rerebase/25895e6d8b0c515c912c509ad8dd8868780a74b6/library/Data/List1.hs | haskell | module Data.List1
(
module Rebase.Data.List1
)
where
import Rebase.Data.List1
| |
465068309862d099591d6e8843c52b14c2d555865e0a4fcf1b251ee391b18509 | ddssff/refact-global-hse | CleanImports.hs | -- Example:
runhaskell scripts / Clean.hs --top = tests --top=. --top = scripts --mod = scripts / Tests.hs --unsafe
# LANGUAGE DeriveGeneric , RankNTypes , TemplateHaskell , TupleSections #
module CleanImports
( Params(..)
, ghcOpts, findDirs, toClean, unsafe
, options
, go
, finalParams
) w... | null | https://raw.githubusercontent.com/ddssff/refact-global-hse/519a017009cae8aa1a3db1b46eb560d76bd9895d/scripts/CleanImports.hs | haskell | Example:
top = tests --top=. --top = scripts --mod = scripts / Tests.hs --unsafe
^ Directories to search (non-recursively) for
moduverse modules.
^ The modules we want to clean. The Maybe FilePath
is the hs-source-dirs path below which the module is
located.
^ If True operations can proceed even if there are
u... |
# LANGUAGE DeriveGeneric , RankNTypes , TemplateHaskell , TupleSections #
module CleanImports
( Params(..)
, ghcOpts, findDirs, toClean, unsafe
, options
, go
, finalParams
) where
import Control.Lens (_2, makeLenses, over, set, view)
import Data.Default (Default(def))
import Data.Monoid ((<>... |
3c208b94d37f2c75d3eacf23f63bfadacf7417047cce25615c78cd89a8db3376 | eryx67/vk-api-example | IncrementalInput.hs | {-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE TypeFamilies #-}
-- |
module VK.App.Widgets.IncrementalInput(incrementalInput
, incrementalInput_
... | null | https://raw.githubusercontent.com/eryx67/vk-api-example/4ce634e2f72cf0ab6ef3b80387ad489de9d8c0ee/src/VK/App/Widgets/IncrementalInput.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeFamilies #
| | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
# LANGUAGE RecordWildCards #
module VK.App.Widgets.IncrementalInput(incrementalInput
, incrementalInput_
, IncrementalInputArgs(..)
) where... |
a30daa2175965c8f3511c104a0c885cf7523cd8bd36ab671fcf031a435ae5a4d | Decentralized-Pictures/T4L3NT | enumerate.ml | open Hidapi
let () =
init () ;
let devs = Hidapi.enumerate () in
ListLabels.iter devs ~f:begin fun { path; vendor_id; product_id;
serial_number; release_number;
manufacturer_string; product_string;
i... | null | https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/vendors/ocaml-hidapi/test/enumerate.ml | ocaml | open Hidapi
let () =
init () ;
let devs = Hidapi.enumerate () in
ListLabels.iter devs ~f:begin fun { path; vendor_id; product_id;
serial_number; release_number;
manufacturer_string; product_string;
i... | |
cdb368089b19d8f1ea519ce94c51a74e6fa5c2448e549accafed3fb3638fe7e1 | c-cube/qcheck | test_primitives.ml | open QCheck2
open Helpers
* { 1 . Test primitives derivation }
* { 2 . Tests }
type int' = int [@@deriving qcheck2]
let test_int () =
test_compare ~msg:"Gen.int <=> deriving int" ~eq:Alcotest.int Gen.int gen_int'
type unit' = unit [@@deriving qcheck2]
(* Pretty useless though, but, meh *)
let test_unit () =
t... | null | https://raw.githubusercontent.com/c-cube/qcheck/063c1d74795a24eb77fa661d218c4715382df566/test/ppx_deriving_qcheck/deriver/qcheck2/test_primitives.ml | ocaml | Pretty useless though, but, meh | open QCheck2
open Helpers
* { 1 . Test primitives derivation }
* { 2 . Tests }
type int' = int [@@deriving qcheck2]
let test_int () =
test_compare ~msg:"Gen.int <=> deriving int" ~eq:Alcotest.int Gen.int gen_int'
type unit' = unit [@@deriving qcheck2]
let test_unit () =
test_compare ~msg:"Gen.unit <=> derivin... |
90173897b21848b1aecf7b9d324c71d053ac108572683d37e4b068bc415d8a6a | CUTE-Lang/miniCUTE | ParserTest.hs | HLINT ignore " Redundant do "
# OPTIONS_GHC -fno - warn - type - defaults #
# LANGUAGE DataKinds #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
-- |
Copyright : ( c ) 2018 - present
-- License: BSD 3-Clause
module Minicute.Parser.Minicute.ParserTest
( spec_mainProgramMC_parser
) where
import ... | null | https://raw.githubusercontent.com/CUTE-Lang/miniCUTE/b6c8a48b10e2af0786a50175d57b5339be7be2de/main-packages/minicute-syntax/test/Minicute/Parser/Minicute/ParserTest.hs | haskell | # LANGUAGE OverloadedStrings #
|
License: BSD 3-Clause | HLINT ignore " Redundant do "
# OPTIONS_GHC -fno - warn - type - defaults #
# LANGUAGE DataKinds #
# LANGUAGE QuasiQuotes #
Copyright : ( c ) 2018 - present
module Minicute.Parser.Minicute.ParserTest
( spec_mainProgramMC_parser
) where
import Test.Hspec.Megaparsec
import Test.Tasty.Hspec
import Control.Mon... |
e465b473e5b28d5f4806ca57dbbc82abb4c5feef92722c8dd119a9f42af9ffa6 | ptol/oczor | State.hs | # LANGUAGE TemplateHaskell #
module Oczor.Infer.State (Infer(..), freshVar, addSubst, applySubst, emptySubst, letters, renameVarsInType, instantiate, runInfer, fresh) where
import Oczor.Syntax.Syntax
import Oczor.Utl
import Control.Monad.Except
import Control.Monad.Reader
import Control.Monad.State.Strict
import Class... | null | https://raw.githubusercontent.com/ptol/oczor/77255e3c1b3decb956d53754cd3f2ac0ae746c67/src/Oczor/Infer/State.hs | haskell | # LANGUAGE TemplateHaskell #
module Oczor.Infer.State (Infer(..), freshVar, addSubst, applySubst, emptySubst, letters, renameVarsInType, instantiate, runInfer, fresh) where
import Oczor.Syntax.Syntax
import Oczor.Utl
import Control.Monad.Except
import Control.Monad.Reader
import Control.Monad.State.Strict
import Class... | |
402a27b52d03c29fc038a8c83d5db350749f807b0741a9391049b199df3d0056 | inhabitedtype/ocaml-aws | rebootDBInstance.ml | open Types
open Aws
type input = RebootDBInstanceMessage.t
type output = RebootDBInstanceResult.t
type error = Errors_internal.t
let service = "rds"
let signature_version = Request.V4
let to_http service region req =
let uri =
Uri.add_query_params
(Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_... | null | https://raw.githubusercontent.com/inhabitedtype/ocaml-aws/b6d5554c5d201202b5de8d0b0253871f7b66dab6/libraries/rds/lib/rebootDBInstance.ml | ocaml | open Types
open Aws
type input = RebootDBInstanceMessage.t
type output = RebootDBInstanceResult.t
type error = Errors_internal.t
let service = "rds"
let signature_version = Request.V4
let to_http service region req =
let uri =
Uri.add_query_params
(Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_... | |
ff69c55ec27ccf62924eabb1447d862829e27529b6e241e20400f9ba980f91e8 | workframers/artemis | result.cljs | (ns artemis.result)
(defn with-errors
"Decorates a result with a sequence of error maps."
{:added "0.1.0"}
[result errors]
(if (empty? errors)
result
(update result :errors concat errors)))
(defn result->message
"Takes a result and returns a map containing at least a `:data`."
{:added "0.1.0"}
[... | null | https://raw.githubusercontent.com/workframers/artemis/c67a7891b51b299e974cce6f01f7db9e45dee754/src/artemis/result.cljs | clojure | (ns artemis.result)
(defn with-errors
"Decorates a result with a sequence of error maps."
{:added "0.1.0"}
[result errors]
(if (empty? errors)
result
(update result :errors concat errors)))
(defn result->message
"Takes a result and returns a map containing at least a `:data`."
{:added "0.1.0"}
[... | |
9b359fade95013d82815d4b7a25f0d4fdccdde3b71012946b490200c06ed7f58 | 6502/JSLisp | asteroids.lisp | (import * from gui)
(import * from graphics)
(defobject shape (x y angle xv yv anglev geometry))
(defobject missile (x y angle xv yv anglev geometry count))
(defobject asteroid (x y angle xv yv anglev geometry area r2))
(defvar *screen*)
(defvar *canvas*)
(defvar *ship-geometry* '((-5 5) (0 2) (5 5) (0 -10)))
(defva... | null | https://raw.githubusercontent.com/6502/JSLisp/9a4aa1a9116f0cfc598ec9f3f30b59d99810a728/examples/asteroids.lisp | lisp | (import * from gui)
(import * from graphics)
(defobject shape (x y angle xv yv anglev geometry))
(defobject missile (x y angle xv yv anglev geometry count))
(defobject asteroid (x y angle xv yv anglev geometry area r2))
(defvar *screen*)
(defvar *canvas*)
(defvar *ship-geometry* '((-5 5) (0 2) (5 5) (0 -10)))
(defva... | |
acc50dba7f840e1711a0301ac6f9b51e85c9f44177ad2d9487cf76557e0abd4e | Octachron/codept | with.ml | module type S = sig include Ext.S end
module type s = sig module Inner:sig end end
module E = struct end
module M: s with module Inner = E = struct
module Inner = struct end
end
let () =
let open M.Inner in
()
| null | https://raw.githubusercontent.com/Octachron/codept/2d2a95fde3f67cdd0f5a1b68d8b8b47aefef9290/tests/cases/with.ml | ocaml | module type S = sig include Ext.S end
module type s = sig module Inner:sig end end
module E = struct end
module M: s with module Inner = E = struct
module Inner = struct end
end
let () =
let open M.Inner in
()
| |
9986d31e755b08d6ad6d0efd58893e174d8894b54bb187bbb76ee0d1b3c83b12 | wdebeaum/DeepSemLex | voltmeter.lisp | ;;;;
;;;; w::voltmeter
;;;;
(define-words :pos w::N
:words (
;; Various measuring devices
(w::voltmeter
(senses((LF-parent ONT::Device)
(templ count-pred-templ)
(meta-data :origin bee :entry-date 20040407 :change-date 20040621 :comments (test-s portability-followup))
))
)
))
| null | https://raw.githubusercontent.com/wdebeaum/DeepSemLex/ce0e7523dd2b1ebd42b9e88ffbcfdb0fd339aaee/trips/src/LexiconManager/Data/new/voltmeter.lisp | lisp |
w::voltmeter
Various measuring devices |
(define-words :pos w::N
:words (
(w::voltmeter
(senses((LF-parent ONT::Device)
(templ count-pred-templ)
(meta-data :origin bee :entry-date 20040407 :change-date 20040621 :comments (test-s portability-followup))
))
)
))
|
4e04aaa673c54c4fe0d83121cade8407963f965fbe7a49126a0d096b3fd123e3 | higepon/mcbench | memcached.erl | Copyright ( c ) 2009 ) < >
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions
%% are met:
%%
1 . Redistributions of source code must retain the above copyright
%% notice, this list of conditions and... | null | https://raw.githubusercontent.com/higepon/mcbench/72a58cfeaef846d1d26dd8f311ff5ed5ed23382b/src/memcached.erl | erlang |
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the following disclaimer in the
documentati... | Copyright ( c ) 2009 ) < >
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
3 . Neither the name of the authors nor the names of its contributors
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUD... |
db60af9480a33c6718214243acbd1e2594f051081dda3c93ef27b3acc44f2ee8 | facebook/duckling | Corpus.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.
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Volume.AR.Corpus
( corpus ) where
import Data.String
... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/Volume/AR/Corpus.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 OverloadedStrings # | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.Volume.AR.Corpus
( corpus ) where
import Data.String
import Prelude
import Duckling.Testing.Types
import Duckling.Locale
import Duckling.Resolve
import Duckling.Volume.Types
corpus :: Corpus
corpus = (testContext {locale = makeLocale AR Nothing}... |
fefb701a5e164c125f9ea3525391b47bacc096b8d42bb3da2d855613f3a69778 | argonaut-io/argonaut-hs | EncodeDecodeSpec.hs | # LANGUAGE OverloadedStrings , TemplateHaskell #
module Data.Argonaut.EncodeDecodeSpec where
import Data.Argonaut
import Data.Argonaut.Printer()
import Data.Argonaut.TestTemplates
import Data.Argonaut.TestInstances()
import Data.Scientific (Scientific)
import Test.Hspec
spec :: Spec
spec = parallel $ do
$(buildEnc... | null | https://raw.githubusercontent.com/argonaut-io/argonaut-hs/41bfd798fce9178951abff1536ca290dee23a2cc/test/Data/Argonaut/EncodeDecodeSpec.hs | haskell | # LANGUAGE OverloadedStrings , TemplateHaskell #
module Data.Argonaut.EncodeDecodeSpec where
import Data.Argonaut
import Data.Argonaut.Printer()
import Data.Argonaut.TestTemplates
import Data.Argonaut.TestInstances()
import Data.Scientific (Scientific)
import Test.Hspec
spec :: Spec
spec = parallel $ do
$(buildEnc... | |
4edd4cfb8fb68915bada7339fc56abc4e844faa2e1cd8bfeb3775c2a785abe9c | JamesLavin/ElixirZone | pushbutton.erl | -module(pushbutton).
-behaviour(gen_statem).
-export([start/0,push/0,get_count/0,stop/0]).
-export([terminate/3,code_change/4,init/1,callback_mode/0]).
-export([on/3,off/3]).
name() -> pushbutton_statem. % The registered server name
%% API. This example uses a registered name name()
%% and does not link to the call... | null | https://raw.githubusercontent.com/JamesLavin/ElixirZone/c4f7ef9a21762462e5bd2a95c6d9df6cf5f671d4/Erlang_Fundamentals/Erlang103/pushbutton.erl | erlang | The registered server name
API. This example uses a registered name name()
and does not link to the caller.
Mandatory callback functions
Go to 'on', increment count and reply
that the resulting status is 'on'
Go to 'off' and reply that the resulting status is 'off'
Handle events common to all states
Reply wit... | -module(pushbutton).
-behaviour(gen_statem).
-export([start/0,push/0,get_count/0,stop/0]).
-export([terminate/3,code_change/4,init/1,callback_mode/0]).
-export([on/3,off/3]).
start() ->
gen_statem:start({local,name()}, ?MODULE, [], []).
push() ->
gen_statem:call(name(), push).
get_count() ->
gen_statem:c... |
a102122cfcbb814e46c89ea07ff9f031ae63fe1023ab2eb9793b0ef241698853 | jafingerhut/clojure-benchmarks | mandelbrot.clj-9-par.clj | The Computer Language Benchmarks Game
;; /
contributed by
;; The function 'dot' is based on suggestions and improvements made by
these people posting to the Clojure Google group in April , 2009 :
dmitri.sotnikov , , , michael.messinides
,
change by
reduced code size by removing functio... | null | https://raw.githubusercontent.com/jafingerhut/clojure-benchmarks/474a8a4823727dd371f1baa9809517f9e0b508d4/mandelbrot/mandelbrot.clj-9-par.clj | clojure | /
The function 'dot' is based on suggestions and improvements made by
few inner loops. This is a parallel version, identical to the
sequential version except using pmap in compute-rows.
else | The Computer Language Benchmarks Game
contributed by
these people posting to the Clojure Google group in April , 2009 :
dmitri.sotnikov , , , michael.messinides
,
change by
reduced code size by removing functions already present in Clojure
change by
Use Java primitive double array... |
c5f64b9cce97512c6eef19bb813ddcbe1f707ad5ed63935f831dc12947360a21 | haskell/haskell-language-server | Parallel.hs | -- | Parallel versions of 'filter' and 'simpleFilter'
module Text.Fuzzy.Parallel
( filter,
simpleFilter,
match,
Scored(..)
) where
import Control.Parallel.Strategies (evalList, parList, rseq, using)
import Data.Bits ((.|.))
import Data.Maybe ... | null | https://raw.githubusercontent.com/haskell/haskell-language-server/d7690c500f204ff3804b1ec7af70a6194c4a9908/ghcide/src/Text/Fuzzy/Parallel.hs | haskell | | Parallel versions of 'filter' and 'simpleFilter'
| Returns the rendered output and the
matching score for a pattern and a text.
^ The text to search in.
^ The score
If pattern has been matched in full
If there is not enough left to match the rest of the pattern, equivalent to
This is slightly broken for no... |
module Text.Fuzzy.Parallel
( filter,
simpleFilter,
match,
Scored(..)
) where
import Control.Parallel.Strategies (evalList, parList, rseq, using)
import Data.Bits ((.|.))
import Data.Maybe (fromMaybe, mapMaybe)
import qualified Data.Text ... |
282ab79be13c38e8729ee4b16e5dc164858b7ddfa8fbdf0d6f7860a6079f0913 | janestreet/core | core.ml | * Core greatly expands the functionality available in Base while still remaining
platform - agnostic . Core changes more frequently ( i.e. , is less stable ) than Base .
Some modules are mere extensions of their counterparts in Base , usually adding generic
functionality by including functors that ... | null | https://raw.githubusercontent.com/janestreet/core/f382131ccdcb4a8cd21ebf9a49fa42dcf8183de6/core/src/core.ml | ocaml | * @open | * Core greatly expands the functionality available in Base while still remaining
platform - agnostic . Core changes more frequently ( i.e. , is less stable ) than Base .
Some modules are mere extensions of their counterparts in Base , usually adding generic
functionality by including functors that ... |
3946243cf6a7109ce95faf990050905ff0c7856cf71cd4f4ce5e584b6f9668c2 | SimulaVR/godot-haskell | VisualShaderNodeTransformMult.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.VisualShaderNodeTransformMult
(Godot.Core.VisualShad... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/VisualShaderNodeTransformMult.hs | haskell | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.VisualShaderNodeTransformMult
(Godot.Core.VisualShad... | |
c492ffa2f9b23a22a3b6ed4b3ace10580af7dd6a79f446b7f213be53e33ace9a | FlowForwarding/LINC-Switch | linc_us4_routing.erl | %%------------------------------------------------------------------------------
Copyright 2012 FlowForwarding.org
%%
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
%%... | null | https://raw.githubusercontent.com/FlowForwarding/LINC-Switch/9c28e7c8677c03440a62023292dd700fef0c3420/apps/linc_us4/src/linc_us4_routing.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, eithe... | Copyright 2012 FlowForwarding.org
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author Erlang Solutions Ltd. < >
2012 FlowForwarding.org
-module(linc_us4_routing).
-export([maybe_spawn_route/1,
spawn_rou... |
e7a42627a6aed6cda72c0d64c193737d0f2ec55c2ab8df2a3eb571ef8ffaac52 | clojure-expectations/expectations | success_examples.cljc | (ns success.nested.success-examples
#?(:cljs (:require-macros [expectations :refer [expect]]))
(:require #?(:clj [expectations :refer :all]
:cljs [expectations :refer [in]])))
;; number equality
(expect 1 (do 1))
;; string equality
(expect "foo" (identity "foo"))
; map equality
(expect {:foo 1 :ba... | null | https://raw.githubusercontent.com/clojure-expectations/expectations/e58c84efb35a54f3a8c3cef53eee8f782b106e6e/test/cljc/success/nested/success_examples.cljc | clojure | number equality
string equality
map equality
is the regex in the string
does the form throw an expeted exception
verify the type of the result
k/v pair in map. matches subset
key in set
val in list
expect boolean | (ns success.nested.success-examples
#?(:cljs (:require-macros [expectations :refer [expect]]))
(:require #?(:clj [expectations :refer :all]
:cljs [expectations :refer [in]])))
(expect 1 (do 1))
(expect "foo" (identity "foo"))
(expect {:foo 1 :bar 2 :car 4} (assoc {} :foo 1 :bar 2 :car 4))
(expect... |
67fc77be15a9bccba526bc85d091fe0e9336abdedd14971c18fcd185db122021 | mstksg/advent-of-code-2019 | intcode.hs | # LANGUAGE TypeApplications #
import AOC.Common.Intcode
import System.Environment
main :: IO ()
main = do
x:_ <- getArgs
Just mem <- parseMem <$> readFile x
interactVM mem
| null | https://raw.githubusercontent.com/mstksg/advent-of-code-2019/df2b1c76ad26ad20306f705e923a09b14d538374/app/intcode.hs | haskell | # LANGUAGE TypeApplications #
import AOC.Common.Intcode
import System.Environment
main :: IO ()
main = do
x:_ <- getArgs
Just mem <- parseMem <$> readFile x
interactVM mem
| |
bfbc9b475f8c9344b3a37fa88f8ff002e04adab7754b85cd31fc0f8554c39c77 | threatgrid/clj-momo | format.cljc | (ns clj-momo.lib.clj-time.format
#?(:cljs (:require-macros [clj-momo.lib.clj-time.macros :refer [immigrate]]))
(:require #?(:clj [clj-time.format :as format-delegate]
:cljs [cljs-time.format :as format-delegate])
#?(:clj [clj-momo.lib.clj-time.macros :refer [immigrate]])))
(immigrate fo... | null | https://raw.githubusercontent.com/threatgrid/clj-momo/7bc0a411593eee4a939b6a3d0f628413518e09e2/src/clj_momo/lib/clj_time/format.cljc | clojure | (ns clj-momo.lib.clj-time.format
#?(:cljs (:require-macros [clj-momo.lib.clj-time.macros :refer [immigrate]]))
(:require #?(:clj [clj-time.format :as format-delegate]
:cljs [cljs-time.format :as format-delegate])
#?(:clj [clj-momo.lib.clj-time.macros :refer [immigrate]])))
(immigrate fo... | |
f6c4f0bff562515f51a35a7cdd79f5596238636ef7855fab7d85978f3fb01014 | GaloisInc/saw-script | TypedAST.hs | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
|
Module : Verifier . SAW.TypedAST
Copyright : Galois , Inc. 2012 - 2015
License : :
Stability : experimental
Portability : non - portable ( language extensions )
Module : Verifier.SAW.Type... | null | https://raw.githubusercontent.com/GaloisInc/saw-script/c8edab39ec734d9b1dbceebaf037ab8f4a5d949b/saw-core/src/Verifier/SAW/TypedAST.hs | haskell | * Module operations.
* Data types and definitions.
* Terms and associated operations.
* Primitive types.
* Utility functions
| Returns the number of nested pi expressions.
| @instantiateVars f l t@ substitutes each dangling bound variable
binders surrounding @LocalVar j t@.
assume rhs is a closed term, so leav... | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE CPP #
# LANGUAGE ScopedTypeVariables #
|
Module : Verifier . SAW.TypedAST
Copyright : Galois , Inc. 2012 - 2015
License : :
Stability : experimental
Portability : non - portable ( language extensions )
Module : Verifier.SAW.Type... |
dfa82dcf2475c82f1dd8943c5c73fa68409ea59713e3d318f62244066ad4bb42 | tfausak/patrol | AesonSpec.hs | # LANGUAGE QuasiQuotes #
module Patrol.Extra.AesonSpec where
import qualified Data.Aeson as Aeson
import qualified Data.Aeson.Key as Key
import qualified Data.Aeson.QQ.Simple as Aeson
import qualified Data.Map as Map
import qualified Patrol.Extra.Aeson as Extra
import qualified Test.Hspec as Hspec
spec :: Hspec.Spec... | null | https://raw.githubusercontent.com/tfausak/patrol/1cae55b3840b328cda7de85ea424333fcab434cb/source/test-suite/Patrol/Extra/AesonSpec.hs | haskell | # LANGUAGE QuasiQuotes #
module Patrol.Extra.AesonSpec where
import qualified Data.Aeson as Aeson
import qualified Data.Aeson.Key as Key
import qualified Data.Aeson.QQ.Simple as Aeson
import qualified Data.Map as Map
import qualified Patrol.Extra.Aeson as Extra
import qualified Test.Hspec as Hspec
spec :: Hspec.Spec... | |
a52e8e57033c0753d1e45491d709963d6cb4ed58852223a064a4c9177ba08aa3 | bobzhang/ocaml-book | myocamlbuild.ml |
open Ocamlbuild_plugin;;
open Command;;
let pdflatex = ref (A"pdflatex");;
let ocamlweb = ref (A"ocamlweb");;
dispatch begin function
| Before_options ->
Options.ocaml_cflags := ["-w";"A"]
| After_options ->
(*c This avoids the creation of symbolic links to the build directory. *)
Opti... | null | https://raw.githubusercontent.com/bobzhang/ocaml-book/09a575b0d1fedfce565ecb9a0ae9cf0df37fdc75/toolchain/code/ocamlbuild/myocamlbuild.ml | ocaml | c This avoids the creation of symbolic links to the build directory.
c [env] is a conversion function that substitutes `\%'
occurrences according to the targets to which the rule
applies. [_build] can be called to build new things
(dynamic dependencies).
c Here we make an extensio... |
open Ocamlbuild_plugin;;
open Command;;
let pdflatex = ref (A"pdflatex");;
let ocamlweb = ref (A"ocamlweb");;
dispatch begin function
| Before_options ->
Options.ocaml_cflags := ["-w";"A"]
| After_options ->
Options.make_links := false
| After_rules ->
rule "LaTeX to PDF conversion r... |
a4594856ed41ae90c2bf8453c57e9c6799dbc779d8de8521865b65d64991c881 | typedbyte/effet | Cont.hs | -- | Examples of the continuation effect.
module Example.Cont where
hspec
import Test.Hspec (Spec, it, shouldBe)
-- effet
import Control.Effect.Cont
import Control.Effect.Identity
import Example.Logger
--- Example Programs -----------------------------------------------------------
fiveTimesCont :: (Cont m, Logg... | null | https://raw.githubusercontent.com/typedbyte/effet/b1e0e2188ae59f0c079b83be6d59f016c5e4baf5/examples/Example/Cont.hs | haskell | | Examples of the continuation effect.
effet
- Example Programs -----------------------------------------------------------
- Test Cases -----------------------------------------------------------------
result: ((), [String])
effects: Logger
effects: Cont, Logger | module Example.Cont where
hspec
import Test.Hspec (Spec, it, shouldBe)
import Control.Effect.Cont
import Control.Effect.Identity
import Example.Logger
fiveTimesCont :: (Cont m, Logger m) => m ()
fiveTimesCont = do
logStr "x"
(k, num) <- callCC $ \k -> let f x = k (f, x)
in ... |
cbae7acdb7fd0f447f670695af3c69cd026abd637ab969273494b6165dc51261 | ericclack/overtone-loops | alter1.clj | (ns overtone-loops.music.alter1
(:use [overtone.live]
[overtone-loops.loops]
[overtone-loops.samples]))
(set-up)
;; 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 &
(def hats
(loop-player 1/2 cymbal-closed [_ 5 _ 5 _ 5 _ 5 _ _ _ _ 5 9 5 9 ]))
(def crashes
(loop-player 1/2 cymbal-... | null | https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/src/overtone_loops/music/alter1.clj | clojure | 1 & 2 & 3 & 4 & 5 & 6 & 7 & 8 &
---------------------------------------------
all play for only a few phrases
Play these with Ctrl-X Ctrl-E
(stop) | (ns overtone-loops.music.alter1
(:use [overtone.live]
[overtone-loops.loops]
[overtone-loops.samples]))
(set-up)
(def hats
(loop-player 1/2 cymbal-closed [_ 5 _ 5 _ 5 _ 5 _ _ _ _ 5 9 5 9 ]))
(def crashes
(loop-player 1/2 cymbal-open [_ _ _ _ 4 _ _ _ _ _ _ _ _ _ _ _ ]))
(def claps
(loop-pla... |
bd2968a3bd322caab9e5af4593fc4209e4ddf0160e2511731a470aa726e464d0 | semperos/rankle | plot.clj | (ns com.semperos.rankle.plot)
(defn- calc-stem
([number] (calc-stem 10 number))
([by number]
(int (Math/floor (/ number by)))))
(defn- calc-leaf
([number] (calc-leaf 10 number))
([by number]
(mod number by)))
(defn- new-plant
"Returns a leafless plant, with `size` empty branches,
i.e. a hash-map wi... | null | https://raw.githubusercontent.com/semperos/rankle/d898c144e33056d743848620f17564d88d87e874/src/com/semperos/rankle/plot.clj | clojure | (ns com.semperos.rankle.plot)
(defn- calc-stem
([number] (calc-stem 10 number))
([by number]
(int (Math/floor (/ number by)))))
(defn- calc-leaf
([number] (calc-leaf 10 number))
([by number]
(mod number by)))
(defn- new-plant
"Returns a leafless plant, with `size` empty branches,
i.e. a hash-map wi... | |
842dbf3a39ca57b9724d01598daa9fb8cc1a5533a73cf223c36a28eeb00e247f | OCamlPro/digodoc | utils.ml | (**************************************************************************)
(* *)
Copyright ( c ) 2021 OCamlPro SAS & Origin Labs SAS
(* *)
(* All right... | null | https://raw.githubusercontent.com/OCamlPro/digodoc/22cc141021d3d18197724dbc5604837a9ad3465b/src/digodoc_common/utils.ml | ocaml | ************************************************************************
All rights reserved.
This file is distributed u... | Copyright ( c ) 2021 OCamlPro SAS & Origin Labs SAS
Public License version 2.1 , with the special exception on linking
open Ez_file
open Ez_file.FileString.OP
let file_content filename =
match Sys.getenv "DIGODOC_CONFIG" with
| dir when FileString.exists (dir // filename) ->
F... |
cc6bf7b5c3807721350d1d36aac08a8e4b85f0051e9f7aac280547dd3ec76405 | atlas-engineer/nyxt | composite-sequence.lisp | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
;; Given the following sequence:
;; 1 2 3 4 5
;;
;; We would record the following sequences/outcomes.
;;
Chain length of 1 :
1 - > 2
2 - > 3
3 - > 4
4 - > 5
;;
Chain length of 2 :
1 2 - > 3
2 3 - > 4
3 4 - ... | null | https://raw.githubusercontent.com/atlas-engineer/nyxt/54664b66471b71bb3a1a1e492d180b419f9f1f71/libraries/analysis/composite-sequence.lisp | lisp | Given the following sequence:
1 2 3 4 5
We would record the following sequences/outcomes.
As can be seen above, the amount of subsequences within a given sequence is
equal to (- (length sequence) chain length). | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
Chain length of 1 :
1 - > 2
2 - > 3
3 - > 4
4 - > 5
Chain length of 2 :
1 2 - > 3
2 3 - > 4
3 4 - > 5
Chain length of 3 :
1 2 3 - > 4
2 3 4 - > 5
(in-package :analysis)
(export-always 'sequence-mode... |
1cd298493a7b66e0b455cb8a4a9715863b713e2aa0cd16f35ce7112e051e3079 | input-output-hk/project-icarus-importer | UserSecret.hs | # LANGUAGE CPP #
-- | Secret key file storage and management functions based on file
-- locking.
#if !defined(mingw32_HOST_OS)
#define POSIX
#endif
module Pos.Util.UserSecret
( WalletUserSecret (..)
, wusRootKey
, wusWalletName
, wusAccounts
, wusAddrs
, accountGenesisIndex
... | null | https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/lib/src/Pos/Util/UserSecret.hs | haskell | | Secret key file storage and management functions based on file
locking.
Because of the Formatting import
| Describes HD wallets keyfile content
^ root key of wallet set
^ name of wallet
^ accounts coordinates and names
^ addresses coordinates
| User secret data. Includes secret keys only for now (not
| Path... | # LANGUAGE CPP #
#if !defined(mingw32_HOST_OS)
#define POSIX
#endif
module Pos.Util.UserSecret
( WalletUserSecret (..)
, wusRootKey
, wusWalletName
, wusAccounts
, wusAddrs
, accountGenesisIndex
, wAddressGenesisIndex
, mkGenesisWalletUserSecret
, UserS... |
b1ae511f16437802dbd5037ce46f2ae4d0d01e83072f7ad6f7348d1f1e482feb | jbracker/supermonad | MainSet.hs |
-- Requires for instances
# LANGUAGE MultiParamTypeClasses #
-- Use the supermonad plugin.
# LANGUAGE RebindableSyntax #
{-# OPTIONS_GHC -fplugin Control.Supermonad.Plugin #-}
-- Remove this so compilation creates a proper executable.
module ( main ) where
import Control.Supermonad.Constrained.Prelude
import qual... | null | https://raw.githubusercontent.com/jbracker/supermonad/2595396a225a65b1dce6ed9a1ce59960f392a55b/examples/monad/constrained/MainSet.hs | haskell | Requires for instances
Use the supermonad plugin.
# OPTIONS_GHC -fplugin Control.Supermonad.Plugin #
Remove this so compilation creates a proper executable. |
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RebindableSyntax #
module ( main ) where
import Control.Supermonad.Constrained.Prelude
import qualified Data.Set as S
main :: IO ()
main = do
putStrLn $ show $ do
let s = S.fromList ['a', 'b', 'c']
a <- s
b <- s
c <- fmap (const 'd') s
return [a... |
2c4fb1c0b637b52d1853b32ad767366482ade1f4e9c598fe258ac71eb0fd116c | zclj/replication-packages | schema_utils.clj | (ns gql.schema-utils
(:require [clojure.string :as s]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; GraphQL utils
(defn find-type
[schema type-name]
(first (filter #(= (:name %) type-name) (:types schema))))
(defn filter-meta-types
[schema]
(filter (fn [s] (not (s/starts-with? (:name s) "__"))) schema))
(... | null | https://raw.githubusercontent.com/zclj/replication-packages/8a5cb02e4fdda74107b5dcc34cbfa5cb5ae34dcf/GraphQL/implementation/src/gql/schema_utils.clj | clojure |
GraphQL utils
Specification -> GraphQL String
empty fields means node should not be included
value can be vector
vector fields could be empty if only object wo fields
not vector | (ns gql.schema-utils
(:require [clojure.string :as s]))
(defn find-type
[schema type-name]
(first (filter #(= (:name %) type-name) (:types schema))))
(defn filter-meta-types
[schema]
(filter (fn [s] (not (s/starts-with? (:name s) "__"))) schema))
(defn find-enums
[schema]
(filter (fn [s] (= "ENUM" (:k... |
57eeede7aa45ed745a9aef7c7934257cfa67e67be44747559e11075466be3d67 | Engil/Goodboy | args.ml | open Cmdliner
let breakpoints =
let doc = "will break when pc reach this address, can be a comma separated list" in
Arg.(value & opt (list ~sep:',' (pair ~sep:':' int int)) [] & info ["breakpoints"; "b"] ~docv:"BREAKPOINTS" ~doc)
let cartridge =
let doc = "cartridge to load in emulator" in
Arg.(required & pos... | null | https://raw.githubusercontent.com/Engil/Goodboy/2e9abc243b929d8bdfb7c5d4874ddb8a07c55fac/debugger/args.ml | ocaml | open Cmdliner
let breakpoints =
let doc = "will break when pc reach this address, can be a comma separated list" in
Arg.(value & opt (list ~sep:',' (pair ~sep:':' int int)) [] & info ["breakpoints"; "b"] ~docv:"BREAKPOINTS" ~doc)
let cartridge =
let doc = "cartridge to load in emulator" in
Arg.(required & pos... | |
f58f317b48d377942730852daab2eb51fa459042ee24af16222d476c62d12749 | arohner/spectrum | repl.clj | (ns spectrum.repl
(:require [clojure.math.combinatorics :as combo]
[clojure.spec.alpha :as s]
[clojure.spec.test.alpha :as stest]
[clojure.tools.analyzer.jvm :as ana.jvm]
[clojure.test.check.generators :as gen]
[spectrum.compiler :as c]
[spectrum... | null | https://raw.githubusercontent.com/arohner/spectrum/aee05ba6c3633843286698d57385375a2a412970/src/spectrum/repl.clj | clojure | (c/load-data-readers)
(s/check-asserts true)
(in-ns 'clojure.core)
(defmacro inspect [expr]
`(do
(let [in# (quote ~expr)
resp# (do ~expr)]
(printf "%s is %s\n" in# (with-out-str (print resp#)))
resp#))) | (ns spectrum.repl
(:require [clojure.math.combinatorics :as combo]
[clojure.spec.alpha :as s]
[clojure.spec.test.alpha :as stest]
[clojure.tools.analyzer.jvm :as ana.jvm]
[clojure.test.check.generators :as gen]
[spectrum.compiler :as c]
[spectrum... |
3c8bc3a4b8ce4c944c17a5f7fac6645e5f27c0f433e942c60febf9e0933452ec | vinted/kafka-elasticsearch-tool | kafka_to_ndjson.clj | (ns ops.kafka-to-ndjson
(:require [core.json :as json]
[sink :as sink]
[source :as source]))
(def default-kafka-ndjson-config
{:max_docs 1
:source {:implementation :kafka
:bootstrap.servers "127.0.0.1:9092"
:topic nil
:decode-val... | null | https://raw.githubusercontent.com/vinted/kafka-elasticsearch-tool/281de24d51cbd2a7ad78e3c1d13a4619b786210d/src/ops/kafka_to_ndjson.clj | clojure | (ns ops.kafka-to-ndjson
(:require [core.json :as json]
[sink :as sink]
[source :as source]))
(def default-kafka-ndjson-config
{:max_docs 1
:source {:implementation :kafka
:bootstrap.servers "127.0.0.1:9092"
:topic nil
:decode-val... | |
93c008783d04a26d1c467c38e422edc8e3d507ce3c39f9ba5a21adaa225b314f | qkrgud55/ocamlmulti | test_nats.ml | open Test;;
open Nat;;
Can compare nats less than 2**32
let equal_nat n1 n2 =
eq_nat n1 0 (num_digits_nat n1 0 1)
n2 0 (num_digits_nat n2 0 1);;
testing_function "num_digits_nat";;
test (-1) eq (false,not true);;
test 0 eq (true,not false);;
test 1
eq_int
(let r = make_nat 2 in
set_digit_nat r 1 1;
n... | null | https://raw.githubusercontent.com/qkrgud55/ocamlmulti/74fe84df0ce7be5ee03fb4ac0520fb3e9f4b6d1f/testsuite/tests/lib-num/test_nats.ml | ocaml | open Test;;
open Nat;;
Can compare nats less than 2**32
let equal_nat n1 n2 =
eq_nat n1 0 (num_digits_nat n1 0 1)
n2 0 (num_digits_nat n2 0 1);;
testing_function "num_digits_nat";;
test (-1) eq (false,not true);;
test 0 eq (true,not false);;
test 1
eq_int
(let r = make_nat 2 in
set_digit_nat r 1 1;
n... | |
9710f08927d1da90d27152d1976da69eb9d6a22fca0123263a3ffd73a0044ed3 | spell-music/amsterdam | White.hs | | additional parameters : none
This instrument generates 4 seconds of white noise .
This instrument generates 4 seconds of white noise.
-}
module White where
import Csound
instr :: D -> SE Sig
instr amp = rand (linen (sig amp) rise idur dec)
where rise = 0.4
dec = 0.4
res = sco instr $ 4 *| ... | null | https://raw.githubusercontent.com/spell-music/amsterdam/ab491022c7826c74eab557ecd11794268f5a5ae0/10-random/White.hs | haskell | | additional parameters : none
This instrument generates 4 seconds of white noise .
This instrument generates 4 seconds of white noise.
-}
module White where
import Csound
instr :: D -> SE Sig
instr amp = rand (linen (sig amp) rise idur dec)
where rise = 0.4
dec = 0.4
res = sco instr $ 4 *| ... | |
e2f4bb1a65f329387306cbe253ef4f03afea50aa931e072c8cc3fd8c8aab15ae | ygrek/mldonkey | guiEncoding.ml | Copyright 2001 , 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey 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
... | null | https://raw.githubusercontent.com/ygrek/mldonkey/333868a12bb6cd25fed49391dd2c3a767741cb51/src/daemon/common/guiEncoding.ml | ocaml | **************
Encoding of messages basic data types
***************
this else block already destroys backwards compatibility
charset conversion could generate longer strings
TODO: figure out country# of this hostname
File Paused
last, so that it can be safely discarded in partial implementations:
T... | Copyright 2001 , 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey 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
... |
f26a49463c7415295ebdab60258455e85ee2ac1ae416c4a916c0b347edf711fa | hunt-framework/hunt | Read.hs | {-# LANGUAGE RankNTypes #-}
module Hunt.IO.Read where
import Data.Bits
import Data.ByteString (ByteString)
import qualified Data.ByteString.Internal as ByteString
import Data.Word
import Foreign.Ptr
import Foreign.Storable
data Decoder a = D !Int (forall r. (... | null | https://raw.githubusercontent.com/hunt-framework/hunt/d692aae756b7bdfb4c99f5a3951aec12893649a8/hunt-searchengine/src/Hunt/IO/Read.hs | haskell | # LANGUAGE RankNTypes #
# INLINE pairD #
# INLINE (>*<) # | module Hunt.IO.Read where
import Data.Bits
import Data.ByteString (ByteString)
import qualified Data.ByteString.Internal as ByteString
import Data.Word
import Foreign.Ptr
import Foreign.Storable
data Decoder a = D !Int (forall r. (a -> Ptr Word8 -> IO r) -> P... |
13a2722ed6d6603e96b8678fa4571605ba8dd26ed00ef530a8349c9d45eb0fc8 | nd/sicp | 3.48.scm | (define (serialized-exchange account1 account2)
(let ((ser1 (account1 'serializer))
(ser2 (account2 'serializer))
(id1 (account1 'id))
(id2 (account2 'id)))
(if (< id1 id2)
((ser1 (ser2 (exchange))) account1 account2)
((ser2 (ser1 (exchange))) account1 account2)))) | null | https://raw.githubusercontent.com/nd/sicp/d8587a0403d95af7c7bcf59b812f98c4f8550afd/ch03/3.48.scm | scheme | (define (serialized-exchange account1 account2)
(let ((ser1 (account1 'serializer))
(ser2 (account2 'serializer))
(id1 (account1 'id))
(id2 (account2 'id)))
(if (< id1 id2)
((ser1 (ser2 (exchange))) account1 account2)
((ser2 (ser1 (exchange))) account1 account2)))) | |
cfeb871cf9502ad5310de844c023988f5e173c8a954eb0f49240389068871446 | number571/Haskell | foldr1.hs | module Main where
foldl1' :: (a -> a -> a) -> [a] -> a
foldl1' _ [] = undefined
foldl1' _ [x] = x
foldl1' f (x:xs) = f x (foldl1' f xs)
main :: IO()
main = print $ foldl1' (+) [1..5]
| null | https://raw.githubusercontent.com/number571/Haskell/7da2676c2604706d43791dc89c0ca8c9842aea48/Templates/foldr1.hs | haskell | module Main where
foldl1' :: (a -> a -> a) -> [a] -> a
foldl1' _ [] = undefined
foldl1' _ [x] = x
foldl1' f (x:xs) = f x (foldl1' f xs)
main :: IO()
main = print $ foldl1' (+) [1..5]
| |
10e16dabfe0bca1b1042c24b926a2f56d26e32bfc9fe688d42e3128318480e0b | artemkin/git-lfs-server | copy_test.ml |
open Core.Std
open Async.Std
let run () =
let input = Filename.concat "." Sys.argv.(1) in
let output = Filename.concat "." Sys.argv.(2) in
Reader.with_file input ~f:(fun r ->
Writer.with_file output ~f:(fun w ->
Pipe.transfer (Reader.pipe r) (Writer.pipe w) ~f:(fun s ->
eprintf "Transfered... | null | https://raw.githubusercontent.com/artemkin/git-lfs-server/e31ff1c2e4c4c9474d64f7af71abc2dc40a1a561/attic/copy_test.ml | ocaml |
open Core.Std
open Async.Std
let run () =
let input = Filename.concat "." Sys.argv.(1) in
let output = Filename.concat "." Sys.argv.(2) in
Reader.with_file input ~f:(fun r ->
Writer.with_file output ~f:(fun w ->
Pipe.transfer (Reader.pipe r) (Writer.pipe w) ~f:(fun s ->
eprintf "Transfered... | |
fdce211bdc246b675deab136e0a924a2f79ab13dd6c45518b8c65e2568464f58 | 2049foundation/clickhouse-haskell | Column.hs | -------------------------------------------------------------------------
# LANGUAGE BlockArguments #
# LANGUAGE CPP #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE BangPatterns #-}
-- | This module contains the implementations of
serialization and deseria... | null | https://raw.githubusercontent.com/2049foundation/clickhouse-haskell/065e2637af7d1588eec73a603265d1b09c2e769b/src/Database/ClickHouseDriver/Column.hs | haskell | -----------------------------------------------------------------------
# LANGUAGE OverloadedStrings #
# LANGUAGE BangPatterns #
| This module contains the implementations of
Auxiliary
Debug
import Debug.Trace
Notice: Codes in this file might be difficult to read.
----------------------------------------------------... | # LANGUAGE BlockArguments #
# LANGUAGE CPP #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
serialization and deserialization of Clickhouse data types .
module Database.ClickHouseDriver.Column where
import Database.ClickHouseDriver.Types (ClickhouseType (..), Context (..), ServerInfo (..))
import Databa... |
5948e8ce0d334c68c0de369798f1c02ca330ba3e9872775f6c083edd6ace91df | cyverse-archive/DiscoveryEnvironmentBackend | c193_2014103101.clj | (ns facepalm.c193-2014103101
(:use [korma.core]))
(def ^:private version
"The destination database version."
"1.9.3:20141031.01")
(defn- add-condor-id-column
[]
(println "\t* updating condor_id column in the jobs table")
(exec-raw "ALTER TABLE jobs ADD COLUMN condor_id varchar(32) not null"))
(defn conve... | null | https://raw.githubusercontent.com/cyverse-archive/DiscoveryEnvironmentBackend/7f6177078c1a1cb6d11e62f12cfe2e22d669635b/databases/jex-db/src/main/conversions/c193_2014103101.clj | clojure | (ns facepalm.c193-2014103101
(:use [korma.core]))
(def ^:private version
"The destination database version."
"1.9.3:20141031.01")
(defn- add-condor-id-column
[]
(println "\t* updating condor_id column in the jobs table")
(exec-raw "ALTER TABLE jobs ADD COLUMN condor_id varchar(32) not null"))
(defn conve... | |
b8ec8fa51130a906c259d81e8198eb27331ccd64af8853def8e17e9043199be6 | mflatt/shrubbery-rhombus-0 | typeset-doc.rkt | #lang racket/base
(require (for-syntax racket/base
syntax/parse
(prefix-in typeset-meta: "typeset_meta.rhm")
shrubbery/property)
"typeset-help.rkt"
shrubbery/print
racket/list
(only-in (submod rhombus/private/import for-m... | null | https://raw.githubusercontent.com/mflatt/shrubbery-rhombus-0/086a52632b67a52680c16f1cf7f4388d04e88680/scribble/private/typeset-doc.rkt | racket | #lang racket/base
(require (for-syntax racket/base
syntax/parse
(prefix-in typeset-meta: "typeset_meta.rhm")
shrubbery/property)
"typeset-help.rkt"
shrubbery/print
racket/list
(only-in (submod rhombus/private/import for-m... | |
0e688ccf3a520144f6cf41d8b9f7694ff633bc2be04ce09b899dc7eea909835e | heroku/ectr | ectr_report.erl | Geoff Ca nt
@author nt < >
%% @version {@vsn}, {@date} {@time}
%% @doc ECTR Report execution library
%% @end
-module(ectr_report).
-include("ectr_log.hrl").
-type report() :: ectr_fold_report:report() |
ectr_each_report:report().
-export_type([report/0]).
-export([start_link/4]).
%% proc_... | null | https://raw.githubusercontent.com/heroku/ectr/242fba748c530a4fdf8c30cfab128314025297ad/src/ectr_report.erl | erlang | @version {@vsn}, {@date} {@time}
@doc ECTR Report execution library
@end
proc_lib callback | Geoff Ca nt
@author nt < >
-module(ectr_report).
-include("ectr_log.hrl").
-type report() :: ectr_fold_report:report() |
ectr_each_report:report().
-export_type([report/0]).
-export([start_link/4]).
-export([report_init/4]).
-spec start_link(report(), erlang:timestamp(), ets:tab(), ectr_... |
f8480f7edf1b1d0be8e1e806d56ddfb237d71756439663839bd17383d9fc247d | eerohele/tab | user.clj | (ns user)
#_{:clj-kondo/ignore [:unresolved-namespace]}
(comment
(do
((requiring-resolve 'tab.log/set-level!) :fine)
(def tab
((requiring-resolve 'tab.api/run)
:port 8080
:browse? false
:print-level 2
:print-length 8)))
((requiring-resolve 'tab.api/halt) tab)
(tap> (h... | null | https://raw.githubusercontent.com/eerohele/tab/b03b0405c42ac794e897a98addc733ac1138905a/dev/src/user.clj | clojure | Atom
This takes a while... | (ns user)
#_{:clj-kondo/ignore [:unresolved-namespace]}
(comment
(do
((requiring-resolve 'tab.log/set-level!) :fine)
(def tab
((requiring-resolve 'tab.api/run)
:port 8080
:browse? false
:print-level 2
:print-length 8)))
((requiring-resolve 'tab.api/halt) tab)
(tap> (h... |
bebcc2031e3ed49d098b39f18f45b1ca29a8aad59ac585ffe3f7a5ebb68a67b7 | outergod/cl-m4 | cffi-regex-grovel.lisp | ;;;; cl-m4 - cffi-regex-grovel.lisp
Copyright ( C ) 2010 < >
This file is part of cl - m4 .
;;;; cl-m4 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 yo... | null | https://raw.githubusercontent.com/outergod/cl-m4/9f6518b5a173a1234ae39ef45758927d329ded4a/src/cffi-regex/cffi-regex-grovel.lisp | lisp | cl-m4 - cffi-regex-grovel.lisp
cl-m4 is free software; you can redistribute it and/or modify
either version 3 of the License , or
(at your option) any later version.
cl-m4 is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS... | Copyright ( C ) 2010 < >
This file is part of cl - m4 .
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
(in-package :cffi-regex)
_ _ USE_GNU to undef unless _ has been defined , hence features.h is
(define "_GNU_SO... |
582d79b1956bfcb96a682c5e027cf3e5ef0e5f8f676c5fb2d8bc132007b24ec4 | cram-code/cram_core | random.lisp | Copyright ( c ) 2012 , < >
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions are met:
;;;
;;; * Redistributions of source code must retain the above copyright
;;; notice, this list o... | null | https://raw.githubusercontent.com/cram-code/cram_core/984046abe2ec9e25b63e52007ed3b857c3d9a13c/cram_math/src/random.lisp | lisp | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Red... | Copyright ( c ) 2012 , < >
* Neither the name of the Intelligent Autonomous Systems Group/
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR ... |
fbfdc304f314438e3074f1c0c398f4a93453d9d56d8401c4c3565b979f4b1aeb | abevoelker/haskellbook-solutions | print3.hs | module Print3 where
myGreeting :: String
myGreeting = "hello" ++ " world!"
hello :: String
hello = "hello"
world :: String
world = "world!"
main :: IO ()
main = do
putStrLn myGreeting
putStrLn secondGreeting
where secondGreeting = concat [hello, " ", world]
| null | https://raw.githubusercontent.com/abevoelker/haskellbook-solutions/9e2804940b3b45bdc1b04cfa5d536097629c9498/ch3/print3.hs | haskell | module Print3 where
myGreeting :: String
myGreeting = "hello" ++ " world!"
hello :: String
hello = "hello"
world :: String
world = "world!"
main :: IO ()
main = do
putStrLn myGreeting
putStrLn secondGreeting
where secondGreeting = concat [hello, " ", world]
| |
809acaac41e4523c41727a3ba1cf05e0a4c207d66abccb0a070a0984801ba494 | skrah/minicaml | ParseTree.mli |
* Copyright ( c ) 2015 . All rights reserved .
*
* This file is distributed under the terms of the Q Public License
* version 1.0 .
* Copyright (c) 2015 Stefan Krah. All rights reserved.
*
* This file is distributed under the terms of the Q Public License
* version 1.0.
*)
val mk_loc : Lexing.pos... | null | https://raw.githubusercontent.com/skrah/minicaml/e5f5cad7fdbcfc11561f717042fae73fa743823f/ParseTree.mli | ocaml |
* Copyright ( c ) 2015 . All rights reserved .
*
* This file is distributed under the terms of the Q Public License
* version 1.0 .
* Copyright (c) 2015 Stefan Krah. All rights reserved.
*
* This file is distributed under the terms of the Q Public License
* version 1.0.
*)
val mk_loc : Lexing.pos... | |
913f043e234fad72004f754f6d72c081cb63b2f6792aa64f235613c60f284c5d | rnons/shadowsocks-haskell | local.hs | {-# LANGUAGE OverloadedStrings #-}
import Conduit (ConduitT, await, connect, leftover,
liftIO, yield, ($$+), ($$++), ($$+-),
(.|))
import Control.Concurrent.Async (race_)
import Data.Byt... | null | https://raw.githubusercontent.com/rnons/shadowsocks-haskell/5d73db35e0a9f186b74a9e746ad9c9c6b41fb94d/app/local.hs | haskell | # LANGUAGE OverloadedStrings # |
import Conduit (ConduitT, await, connect, leftover,
liftIO, yield, ($$+), ($$++), ($$+-),
(.|))
import Control.Concurrent.Async (race_)
import Data.ByteString (ByteString)
impor... |
5b868c86766e7115f22d9e153a17fa2db8ea115a9a8a5644e0ceddafd7c27a2a | deadpendency/deadpendency | SimpleResult.hs | module Common.Effect.PublishSimpleResult.Model.SimpleResult
( SimpleResult (..),
)
where
import Data.Aeson (ToJSON)
import GHC.Show qualified as S
data SimpleResult p where
SimpleResult :: (ToJSON p) => p -> SimpleResult p
instance (Eq p) => Eq (SimpleResult p) where
(==) (SimpleResult p) (SimpleResult p') =... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/common/src/Common/Effect/PublishSimpleResult/Model/SimpleResult.hs | haskell | module Common.Effect.PublishSimpleResult.Model.SimpleResult
( SimpleResult (..),
)
where
import Data.Aeson (ToJSON)
import GHC.Show qualified as S
data SimpleResult p where
SimpleResult :: (ToJSON p) => p -> SimpleResult p
instance (Eq p) => Eq (SimpleResult p) where
(==) (SimpleResult p) (SimpleResult p') =... | |
eb50b5d4ab5ef424e09f0ba50343c82d68b1625e216cacc076ff60224378fc69 | facebook/duckling | Tests.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.
module Duckling.Ordinal.HU.Tests
( tests
) where
import Data.String
import Prelude
import Test.Tasty
i... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/tests/Duckling/Ordinal/HU/Tests.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. | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.Ordinal.HU.Tests
( tests
) where
import Data.String
import Prelude
import Test.Tasty
import Duckling.Dimensions.Types
import Duckling.Ordinal.HU.Corpus
import Duckling.Testing.Asserts
tests :: TestTree
tests = testGroup "HU Tests"
[ makeCorpu... |
02a6c29e96c88bb186067a522f267b64f7e50d7563d4e4694afa9e62b0f1cdeb | sig-gis/gridfire | config_validation_test.clj | (ns gridfire.config-validation-test
(:require [gridfire.spec.config :as spec]
[gridfire.crown-fire :refer [m->ft]]
[clojure.spec.alpha :as s]
[clojure.test :refer [deftest is testing]]))
;;-----------------------------------------------------------------------------
;; Config
;;--... | null | https://raw.githubusercontent.com/sig-gis/gridfire/44aeaf56fceb01f61b21db6220d2cb562a92570b/test/gridfire/config_validation_test.clj | clojure | -----------------------------------------------------------------------------
Config
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
... | (ns gridfire.config-validation-test
(:require [gridfire.spec.config :as spec]
[gridfire.crown-fire :refer [m->ft]]
[clojure.spec.alpha :as s]
[clojure.test :refer [deftest is testing]]))
(def resources-path "test/gridfire/resources/")
Utils
(defn in-file-path [filename]
(st... |
ff516fd831106c76796ae3f974fc87b2af7f489c624c96c218634e5f55c497fb | Clozure/ccl-tests | fill-pointer.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Tue Jan 21 22:14:23 2003
;;;; Contains: Tests of FILL-POINTER
(in-package :cl-test)
;;; More tests are in make-array.lsp
(deftest fill-pointer.1
(fill-pointer (make-array '(10) :fill-pointer 5))
5)
(deftest fill-pointer.2
(fill-pointer (make-array '(10) :f... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/fill-pointer.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of FILL-POINTER
More tests are in make-array.lsp
Error tests | Author :
Created : Tue Jan 21 22:14:23 2003
(in-package :cl-test)
(deftest fill-pointer.1
(fill-pointer (make-array '(10) :fill-pointer 5))
5)
(deftest fill-pointer.2
(fill-pointer (make-array '(10) :fill-pointer t))
10)
(deftest fill-pointer.3
(let ((a (make-array '(10) :fill-pointer 5
... |
4f166b7cd9703645da1b6072e28c832c71b9f4c1f36ab10ca621eef5b98d1d31 | bsaleil/lc | perm9.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
; File: perm9.sch
Description : memory system benchmark using Zaks 's permutation generator
Author : , , and
; Created: 18-Mar-94
; Language: Scheme
; Status: Public Domain
;;;;;;;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/bsaleil/lc/ee7867fd2bdbbe88924300e10b14ea717ee6434b/unit-tests/benchmarks/perm9.scm | scheme |
File: perm9.sch
Created: 18-Mar-94
Language: Scheme
Status: Public Domain
improved - benchmark .
970531 / wdc Cleaned up for public release.
bytes), all of which goes into the generated list. (That is, the
perm9 benchmark generates absolutely no garbage.) This represents
an unshared... | Description : memory system benchmark using Zaks 's permutation generator
Author : , , and
940720 / lth Added some more benchmarks for the thesis paper .
981116 / wdc Simplified to fit in with Feeley 's benchmark suite .
The perm9 benchmark generates a list of all 362880 permutations of
the... |
98ac3ec6dd37cfc746e09f9cadebdce07eedf782b8164337f50ebfe7c480d87f | NoRedInk/haskell-libraries | Main.hs | module Main (main) where
import qualified Conduit
import qualified Control.Concurrent.MVar as MVar
import qualified Control.Exception.Safe as Exception
import qualified Data.ByteString.Lazy
import qualified Data.List
import qualified Debug
import qualified Expect
import qualified Http
import qualified Http.Mock
import... | null | https://raw.githubusercontent.com/NoRedInk/haskell-libraries/1d34eca53b70e8b51fb4315ee3d446f901fdadbc/nri-http/test/Main.hs | haskell | # Wai applications to test against
WAI NOT?
| A web application that returns the same response to every request.
| Run a temporary web application to send requests to.
| Run a temporary web application to send requests to.
| Run a temporary web application that handles a single request, and then
immediately retu... | module Main (main) where
import qualified Conduit
import qualified Control.Concurrent.MVar as MVar
import qualified Control.Exception.Safe as Exception
import qualified Data.ByteString.Lazy
import qualified Data.List
import qualified Debug
import qualified Expect
import qualified Http
import qualified Http.Mock
import... |
71c7c1ab38f6e0ad991b252ae57e840d23631ce17ab7d42ab399ae2762f0d0c0 | jafingerhut/clojure-benchmarks | thread-ring.clj | (ns clj.benchmark.threadring (:gen-class))
(defn relay [state hops]
(let [hops (dec (int hops)), nxt (:next state)]
(if (neg? hops)
(do (prn (:id state)) (shutdown-agents) state)
(do (send nxt relay hops) state))))
(defn agent-ring [n]
(let [tl (agent {:next nil :id n})
hd (reduce (fn [n... | null | https://raw.githubusercontent.com/jafingerhut/clojure-benchmarks/474a8a4823727dd371f1baa9809517f9e0b508d4/thread-ring/thread-ring.clj | clojure | hook up head and tail | (ns clj.benchmark.threadring (:gen-class))
(defn relay [state hops]
(let [hops (dec (int hops)), nxt (:next state)]
(if (neg? hops)
(do (prn (:id state)) (shutdown-agents) state)
(do (send nxt relay hops) state))))
(defn agent-ring [n]
(let [tl (agent {:next nil :id n})
hd (reduce (fn [n... |
7ea77558afdd8490f89d4e6c7ebdfe25d78a480649b5056b71d18e2f5ab537b1 | pmundkur/flowcaml | solver.ml | (**************************************************************************)
(* *)
(* *)
, Projet C... | null | https://raw.githubusercontent.com/pmundkur/flowcaml/ddfa8a37e1cb60f42650bed8030036ac313e048a/src-flowcaml/types/solver.ml | ocaml | ************************************************************************
et en Automatique. All ri... |
, Projet Cristal , INRIA Rocquencourt
Copyright 2002 , 2003 Institut National de Recherche en Informatique
under the terms of the Q Public License version 1.0 .
$ I d : , v 1.12 2003/09/23 14:46:40 s... |
3ff3e5f2046841e8e5c43432f700f8ceb0a6112d4ceb1259dd234399f0189323 | scheme-live/live | shim.scm | (define-library (live json shim)
(export directory-list file-regular? arithmetic-shift)
(import (scheme base)
(scheme file))
(import (srfi srfi-60))
(begin
(define file-regular?
(lambda (x)
(guard (ex (else #f))
(call-with-input-file x
(lambda _ #t)... | null | https://raw.githubusercontent.com/scheme-live/live/ebe18ae54e88b6c12a4afeb5c25f58959d1ee438/live/json/shim.scm | scheme | (define-library (live json shim)
(export directory-list file-regular? arithmetic-shift)
(import (scheme base)
(scheme file))
(import (srfi srfi-60))
(begin
(define file-regular?
(lambda (x)
(guard (ex (else #f))
(call-with-input-file x
(lambda _ #t)... | |
0ba103f25093e1655d98094c7d5641f8de98719c566f2a904345fdd4438f4812 | Enecuum/Node | Signature.hs | # LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
{-# LANGUAGE TypeSynonymInstances #-}
# OPTIONS_GHC -fno - warn - orphans #
module Enecuum.Core.Crypto.Signature (sign) where
import "cryptonite" Crypto.Hash.Algorithms (SH... | null | https://raw.githubusercontent.com/Enecuum/Node/3dfbc6a39c84bd45dd5f4b881e067044dde0153a/src/Enecuum/Core/Crypto/Signature.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE PackageImports #
# LANGUAGE TypeSynonymInstances # | # LANGUAGE GeneralizedNewtypeDeriving #
# OPTIONS_GHC -fno - warn - orphans #
module Enecuum.Core.Crypto.Signature (sign) where
import "cryptonite" Crypto.Hash.Algorithms (SHA3_256 (..))
import qualified "cryptonite" Crypto.PubKey.ECC.ECDSA as ECDSA
import "cryptonite" Crypto.Random ... |
84579d3ab2224be926535deb7072c43c4968e563023717cf83f6537d405f61c7 | semaj/hask-raft | Utils.hs | module Utils where
import Message
import qualified Data.HashMap.Strict as HM
import Data.Time.Clock
import Data.Hashable
import Debug.Trace
majority :: Int
because 1 is always implied ( 1 + 2 )
timeoutRange :: (Int, Int)
timeoutRange = (900, 1200) -- ms
sendCooldown = 0.006
heartbeatRate :: Int
hear... | null | https://raw.githubusercontent.com/semaj/hask-raft/c5bd63e30d504db757fccdc0e586ca1a843cac2b/Utils.hs | haskell | ms
ms
| lastLogIndex < myLastLogIndex = trace ("upToDate fail: myLLI: " ++ (show myLastLogIndex) ++ ", theirLLI: " ++ (show lastLogIndex)) False | module Utils where
import Message
import qualified Data.HashMap.Strict as HM
import Data.Time.Clock
import Data.Hashable
import Debug.Trace
majority :: Int
because 1 is always implied ( 1 + 2 )
timeoutRange :: (Int, Int)
sendCooldown = 0.006
heartbeatRate :: Int
commandCap = 18
cooledOff :: UTCTim... |
2b7a88caa081d324c1a20228c70aa8e6e3ef9df129c95289ea7b405d2e79f300 | lisp/de.setf.amqp | test.lisp | ;;; -*- Package: de.setf.amqp.implementation; -*-
(in-package :de.setf.amqp.implementation)
(:documentation "This file defines codec tests for 0.8r0 components of the 'de.setf.amqp' library."
(copyright
"Copyright 2010 [james anderson](mailto:)"
"'de.setf.amqp' is free software: you can redistribute it and/or mo... | null | https://raw.githubusercontent.com/lisp/de.setf.amqp/03181135ddf15cb3866fbf4285c8b6d3eeeb660e/test/amqp-1-1-0-8-0/test.lisp | lisp | -*- Package: de.setf.amqp.implementation; -*-
without even the
test elementary class/method instantiation, classes w/ initargs,
direct encode/decode, and request/response loop-back |
(in-package :de.setf.amqp.implementation)
(:documentation "This file defines codec tests for 0.8r0 components of the 'de.setf.amqp' library."
(copyright
"Copyright 2010 [james anderson](mailto:)"
"'de.setf.amqp' is free software: you can redistribute it and/or modify it under the terms of version 3
of the GNU ... |
33415d0d30f1cde0a851ac1088427bbae5e9221b555627534416f8cca41d572a | Odie/gd-edit | shrine.clj | (ns gd-edit.commands.shrine
(:require [gd-edit.globals :as globals]
[gd-edit.db-utils :as dbu]
[gd-edit.utils :as u]
[jansi-clj.core :refer [red green yellow bold black]]
[gd-edit.printer :as printer]
[clojure.string :as str]
[com.rpl.specter :as... | null | https://raw.githubusercontent.com/Odie/gd-edit/651d3367dc083f0d678dffe9608c9b5cc12038ad/src/gd_edit/commands/shrine.clj | clojure | (ns gd-edit.commands.shrine
(:require [gd-edit.globals :as globals]
[gd-edit.db-utils :as dbu]
[gd-edit.utils :as u]
[jansi-clj.core :refer [red green yellow bold black]]
[gd-edit.printer :as printer]
[clojure.string :as str]
[com.rpl.specter :as... | |
52f99fd54b9044a25488b3deb97bd75b4f5c19ba063e3087d7ef95f73217033d | gojek/ziggurat | executor_service_test.clj | (ns ziggurat.kafka-consumer.executor-service-test
(:require [clojure.test :refer :all]
[ziggurat.config :refer [ziggurat-config] :as config]
[ziggurat.kafka-consumer.executor-service :refer :all]
[ziggurat.fixtures :as fix]
[mount.core :as mount])
(:import (java.util.... | null | https://raw.githubusercontent.com/gojek/ziggurat/f5e0822af8410ea79b7734ef2f41bc98fad3c17f/test/ziggurat/kafka_consumer/executor_service_test.clj | clojure | (ns ziggurat.kafka-consumer.executor-service-test
(:require [clojure.test :refer :all]
[ziggurat.config :refer [ziggurat-config] :as config]
[ziggurat.kafka-consumer.executor-service :refer :all]
[ziggurat.fixtures :as fix]
[mount.core :as mount])
(:import (java.util.... | |
36a058d796e0bd4e2474100cfd8a79b15e728f7436eccd6224cdfe08fc30173e | links-lang/links | links_lens.ml | module Debug = Debug
module Column = Column
module Sort = Sort
module Fun_dep = Fun_dep
module Alias = Alias
module Phrase = struct
include Phrase
module Sugar = Phrase_sugar
module Type = Phrase_type
module Typesugar = Phrase_typesugar
end
module Operators = Operators
module Type = Type
module Value = Value
... | null | https://raw.githubusercontent.com/links-lang/links/2923893c80677b67cacc6747a25b5bcd65c4c2b6/lens/links_lens.ml | ocaml | module Debug = Debug
module Column = Column
module Sort = Sort
module Fun_dep = Fun_dep
module Alias = Alias
module Phrase = struct
include Phrase
module Sugar = Phrase_sugar
module Type = Phrase_type
module Typesugar = Phrase_typesugar
end
module Operators = Operators
module Type = Type
module Value = Value
... | |
0fcc295146dbb201ba17e5b1c5c162b92e527515c6d116a2338b4627bf0f2efc | footprintanalytics/footprint-web | cache_test.clj | (ns metabase.models.setting.cache-test
(:require [clojure.test :refer :all]
[honeysql.core :as hsql]
[metabase.db :as mdb]
[metabase.models.setting :refer [Setting]]
[metabase.models.setting-test :as setting-test]
[metabase.models.setting.cache :as setting.c... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/test/metabase/models/setting/cache_test.clj | clojure | --------------------------------------------- Cache Synchronization ----------------------------------------------
to see if things update below
now have another instance change the value
...and when it comes time to check our cache for updating (when calling `restore-cache-if-needed!`, it should get
be invalidate... | (ns metabase.models.setting.cache-test
(:require [clojure.test :refer :all]
[honeysql.core :as hsql]
[metabase.db :as mdb]
[metabase.models.setting :refer [Setting]]
[metabase.models.setting-test :as setting-test]
[metabase.models.setting.cache :as setting.c... |
39867084b129d16c4b87022c6d64cf982bb50e9d3d96260ecbfc5fcda253b743 | awslabs/s2n-bignum | word_negmodinv.ml |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
(* =================================================================... | null | https://raw.githubusercontent.com/awslabs/s2n-bignum/824c15f908d7a343af1b2f378cfedd36e880bdde/x86/proofs/word_negmodinv.ml | ocaml | =========================================================================
Word-level negated modular inverse.
=========================================================================
*** print_literal_from_elf "x86/generic/word_negmodinv.o";;
***
SUB (% rax) (% rcx)
ADD ... |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
let word_negmodinv_mc = define_assert_from_elf "word_negmodinv_mc"... |
f42f3010184805f2ad157db51b5976b5e8b3a5c5d91985ad46ed3c3f226e1811 | finkel-lang/finkel | let.hs | let a :: Int -- Haskell
b, c :: Int
a = 10
b = 4
c = 2
in print [a, b, c]
| null | https://raw.githubusercontent.com/finkel-lang/finkel/c3c7729d5228bd7e0cf76e8ff05fe2f79a0ec0a2/doc/include/language-syntax/expr/let.hs | haskell | Haskell | b, c :: Int
a = 10
b = 4
c = 2
in print [a, b, c]
|
1f2838d9a050564efd65bcd32b780f02c9711818b020fc51b6113452388ef375 | fulcrologic/fulcro-rad-tutorial | invoice_forms.cljc | (ns com.example.ui.invoice-forms
(:require
[com.fulcrologic.fulcro.components :as comp :refer [defsc]]
[com.fulcrologic.fulcro.algorithms.tempid :as tempid]
[com.fulcrologic.rad.picker-options :as picker-options]
[com.fulcrologic.rad.type-support.decimal :as math]
[com.example.model :as model]
... | null | https://raw.githubusercontent.com/fulcrologic/fulcro-rad-tutorial/809b8f8833363be7dc0c9a66307b1fa164da4d70/src/main/com/example/ui/invoice_forms.cljc | clojure | So, a special (attr/derived-value key type style) would be useful for form logic display
::form/read-only? true
No control layout...we don't actually let the user control it | (ns com.example.ui.invoice-forms
(:require
[com.fulcrologic.fulcro.components :as comp :refer [defsc]]
[com.fulcrologic.fulcro.algorithms.tempid :as tempid]
[com.fulcrologic.rad.picker-options :as picker-options]
[com.fulcrologic.rad.type-support.decimal :as math]
[com.example.model :as model]
... |
3eb24509f39a05f5416b2b13c6114dd598e05b70a20dfbfcfff70a03206e72d3 | Bwooce/open-cgf | test_tcp.erl | %%%-------------------------------------------------------------------
%%% File : test_tcp.erl
%%% Author :
%%% Description :
%%%
Created : 18 May 2008 by root < >
%%%-------------------------------------------------------------------
-module(test_tcp).
-include("open-cgf.hrl").
-export([simple_test/2,test/0]... | null | https://raw.githubusercontent.com/Bwooce/open-cgf/929f7e280493ca4bc47be05bb931044ee1321594/test/test_tcp.erl | erlang | -------------------------------------------------------------------
File : test_tcp.erl
Author :
Description :
-------------------------------------------------------------------
requires some refinement...
even if the test fails
let's test rollover while we are here
----- old stuff | Created : 18 May 2008 by root < >
-module(test_tcp).
-include("open-cgf.hrl").
-export([simple_test/2,test/0]).
-define(TIMEOUT, 60*1000).
-define(MAXATTEMPTS, 3).
simple_test(Origin, Dest) ->
common_setup(tcp, Origin),
test_client:auto_respond(true),
test_client:open(Dest),
test_client:expect('_... |
1beec8939742c819369b0be5d6624940ae5accacfa17e3f4375d9d1106cb2c94 | jeffshrager/biobike | basic-webpages.lisp | ;;; -*- mode: Lisp; Syntax: Common-Lisp; Package: wb; -*-
(in-package :frames)
;;; +=========================================================================+
| Copyright ( c ) 2002 , 2003 , 2004 JP , , |
;;; | |
;;; | Permission is he... | null | https://raw.githubusercontent.com/jeffshrager/biobike/5313ec1fe8e82c21430d645e848ecc0386436f57/BioLisp/Webdefs/basic-webpages.lisp | lisp | -*- mode: Lisp; Syntax: Common-Lisp; Package: wb; -*-
+=========================================================================+
| |
| Permission is hereby granted, free of charge, to any person obtaining |
| a copy of this software and ass... |
(in-package :frames)
| Copyright ( c ) 2002 , 2003 , 2004 JP , , |
| " Software " ) , to deal in the Software without restriction , including |
| distribute , sublicense , and/or sell copies of the Software , and to |
| permit persons to whom the Software is furnished to do so , subject to... |
b01eec6d8343220941f0109510c27fdcb4fa39af0c8a2d0c0a21a961856f4a7b | janegca/htdp2e | 0306-SP-DesigningAWorldProgram.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname 0306-SP-DesigningAWorldProgram) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2... | null | https://raw.githubusercontent.com/janegca/htdp2e/2d50378135edc2b8b1816204021f8763f8b2707b/01-FixedSizeData/0306-SP-DesigningAWorldProgram.rkt | racket | about the language level of this file in a form that our tools can easily process.
Sample Problem:
Design a program that moves a car across the world canvas, from left to
Physical Constants (general attributes of objects in the world)
Graphical Constants (images of objects in the world)
interpretation: the num... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname 0306-SP-DesigningAWorldProgram) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp") (lib "batch-io.rkt" "teachpack" "2htdp... |
0235d9c835eaa58bbd1994ae256f1ebe481316188d3a85810c75778f8880b864 | aiya000/haskell-examples | Main.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators #
import Control.Eff (Eff, Member, run, (:>))
import Control.Eff.Reader.Lazy (Reader, ask, runReader)
import Control.Eff.State.Lazy (State, get, put, runState)
import Control.Eff.Writer.Lazy (Writer, tell, runWriter, runMonoidWriter)
type Logs = [String]
f :: M... | null | https://raw.githubusercontent.com/aiya000/haskell-examples/a337ba0e86be8bb1333e7eea852ba5fa1d177d8a/Control/Eff/Main.hs | haskell | The type specification is important in extensible-effects (eff often cannot inference)
`run` finishes chains of runFoo.
vvv output vvv
["f"]
["g"]
["h"]
["f"]
(["k"],["k"])
([],(["k"],["k"])) | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators #
import Control.Eff (Eff, Member, run, (:>))
import Control.Eff.Reader.Lazy (Reader, ask, runReader)
import Control.Eff.State.Lazy (State, get, put, runState)
import Control.Eff.Writer.Lazy (Writer, tell, runWriter, runMonoidWriter)
type Logs = [String]
f :: M... |
bda2b32c033cb33ff2a48133d06a14ccca352d129cde92bfcd6751aa26130206 | iambrj/imin | interp-poly.rkt | #lang racket
(require "utilities.rkt")
(require "interp-Rwhile.rkt")
(provide interp-poly interp-poly-class)
(define interp-poly-class
(class interp-Rwhile-class
(super-new)
(define/override ((interp-exp env) e)
(define recur (interp-exp env))
(verbose "poly/interp-exp" e)
(match e
... | null | https://raw.githubusercontent.com/iambrj/imin/baf9e829c2aa85b69a2e86bfba320969ddf05f95/interp-poly.rkt | racket | #lang racket
(require "utilities.rkt")
(require "interp-Rwhile.rkt")
(provide interp-poly interp-poly-class)
(define interp-poly-class
(class interp-Rwhile-class
(super-new)
(define/override ((interp-exp env) e)
(define recur (interp-exp env))
(verbose "poly/interp-exp" e)
(match e
... | |
aea339ce519f298eecde6eaaf53e2bd0fb34201acf368295a976a39e2146d4ef | brendanhay/gogol | Add.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-searchconsole/gen/Gogol/SearchConsole/Webmasters/Sites/Add.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
* Resource
** Constructing a Request
'WebmastersSitesAdd' request conforms to.
/See:/ 'newWebmastersSitesAdd' smart constructor.
| V1 error format.
| OAuth access token.
| The URL of the site to add.
| Upload protocol for... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
8c0a2158795ebcf558c4606e67689baa89bb3c8133c313ce0d636230b7eba1c4 | inaka/rpsls | rpsls_invalid_player.erl | %%% @doc Returns invalid results
-module(rpsls_invalid_player).
-dialyzer([{nowarn_function, play/2}]).
-behaviour(rpsls_player).
-export([init/0, play/2]).
init() -> {}.
play(_History, {}) -> {invalid, {}}.
| null | https://raw.githubusercontent.com/inaka/rpsls/85f6621cfa55a803edf9c2a9fd43901415b9ba80/test/rpsls_invalid_player.erl | erlang | @doc Returns invalid results | -module(rpsls_invalid_player).
-dialyzer([{nowarn_function, play/2}]).
-behaviour(rpsls_player).
-export([init/0, play/2]).
init() -> {}.
play(_History, {}) -> {invalid, {}}.
|
319e0aac8319247887fd327346a73942aa1a2758aba0f3515feeaed62184a8cd | oakes/Paravim | start.clj | (ns paravim.start
(:require [paravim.core :as c]
[paravim.repl :as repl]
[paravim.vim :as vim]
[paravim.session :as session]
[paravim.constants :as constants]
[libvim-clj.core :as v]
[play-cljc.gl.core :as pc]
[clojure.core.async :as ... | null | https://raw.githubusercontent.com/oakes/Paravim/2951737345dc194f91c85eca68051ff75e22487a/src/paravim/start.clj | clojure | -_Tutorial_%28Part_2%29
fire rules will make the mouse hover rules run,
so the `get-mouse` call will have the correct data
pressing enter in the repl
all ctrl shortcuts
else
all other input
this could be momentarily nil while hot code reloading
load init file | (ns paravim.start
(:require [paravim.core :as c]
[paravim.repl :as repl]
[paravim.vim :as vim]
[paravim.session :as session]
[paravim.constants :as constants]
[libvim-clj.core :as v]
[play-cljc.gl.core :as pc]
[clojure.core.async :as ... |
557c83c7a17822890448e04ac37a7ffe74a7f7aefd52db91f2a9744494accae6 | josephwilk/image-resizer | util.clj | (ns image-resizer.util
(:import
[java.io InputStream File Serializable]
[java.net URL]
[javax.imageio ImageIO]
[javax.imageio.stream ImageInputStream]
[java.awt.image BufferedImage]))
(defn ^BufferedImage buffered-image [image]
(condp instance? image
BufferedImage image
File (ImageIO/read ^Fil... | null | https://raw.githubusercontent.com/josephwilk/image-resizer/d699fa73ec9bf98168edde7aa098a5acfea938d2/src/image_resizer/util.clj | clojure | (ns image-resizer.util
(:import
[java.io InputStream File Serializable]
[java.net URL]
[javax.imageio ImageIO]
[javax.imageio.stream ImageInputStream]
[java.awt.image BufferedImage]))
(defn ^BufferedImage buffered-image [image]
(condp instance? image
BufferedImage image
File (ImageIO/read ^Fil... | |
45ec6fea76a1fa4a00f9dbf314df1ade9a75f33d897e7d28107a4dc6d4e074d4 | yuriy-chumak/ol | a+b.scm | (import (scheme read))
; simplest
(print (+ (read) (read)))
; safe
(let ((a (read))
(b (read)))
(if (not (number? a))
(runtime-error "a is not a number! got:" a))
(if (not (number? b))
(runtime-error "b is not a number! got:" b))
(print a " + " b " = " (+ a b)))
| null | https://raw.githubusercontent.com/yuriy-chumak/ol/d13a402446c091ab677035c560e7beb477fcee6c/tests/rosettacode/a%2Bb.scm | scheme | simplest
safe | (import (scheme read))
(print (+ (read) (read)))
(let ((a (read))
(b (read)))
(if (not (number? a))
(runtime-error "a is not a number! got:" a))
(if (not (number? b))
(runtime-error "b is not a number! got:" b))
(print a " + " b " = " (+ a b)))
|
85016677707579d470af149b2f9f7f38e2ad5e508f9c1ceb4b1ab384e7e0b151 | karetsu/xmonad-aloysius | One.hs | -- | XMonad-Aloysius One theme
-- -dark-ui
module Theme.One where
basebg = "#282c34"
basefg = "#bbc2cf"
base00 = "#2823c4" -- darks
base01 = "#21242b"
base02 = "#1c1f24"
base03 = "#202328"
base04 = "#dfdfdf" -- whites
base05 = "#dfdfdf"
base06 = "#bbc2cf"
base07 = "#51afef" -- blues
base08 = "#51afef"
base09 = "#4db5... | null | https://raw.githubusercontent.com/karetsu/xmonad-aloysius/9910c8db4bb75600fc9af51b9e64ab5704e8126c/app/Theme/One.hs | haskell | | XMonad-Aloysius One theme
-dark-ui
darks
whites
blues
red
orange
yellow
green
purple |
module Theme.One where
basebg = "#282c34"
basefg = "#bbc2cf"
base01 = "#21242b"
base02 = "#1c1f24"
base03 = "#202328"
base05 = "#dfdfdf"
base06 = "#bbc2cf"
base08 = "#51afef"
base09 = "#4db5bd"
base10 = "#4db5bd"
fontsize :: String
fontsize = "12"
sansserif :: String
sansserif = "xft:Fira Sans:size=" ++ fontsize
s... |
d04d7ac186de83d57547e624d69262e7fec5a154b157794a75c4c900607f0d1b | wandersoncferreira/mamulengo | config.cljc | (ns mamulengo.specs.config
(:require [clojure.spec.alpha :as s]))
(s/def ::durable-storage #{:h2 :postgresql :local-storage})
(s/def ::durable-layer #{:on :off})
(s/def ::dbtype string?)
(s/def ::dbname string?)
(s/def ::durable-conf (s/keys :req-un [::dbname
::dbtype]))
(s/... | null | https://raw.githubusercontent.com/wandersoncferreira/mamulengo/0c175e9b068b1dfbf3a544776db7bbe3e2af96a7/src/mamulengo/specs/config.cljc | clojure | (ns mamulengo.specs.config
(:require [clojure.spec.alpha :as s]))
(s/def ::durable-storage #{:h2 :postgresql :local-storage})
(s/def ::durable-layer #{:on :off})
(s/def ::dbtype string?)
(s/def ::dbname string?)
(s/def ::durable-conf (s/keys :req-un [::dbname
::dbtype]))
(s/... | |
94f040e57ae5ac87ecd7d2e98a09bebfdf17106142be5db21b690f02e215d1f0 | theurere/berkeley_cs61a_spring-2011_archive | twenty-one.scm |
(define (twenty-one strategy)
(define (play-dealer customer-hand dealer-hand-so-far rest-of-deck)
(cond ((> (best-total dealer-hand-so-far) 21) 1)
((< (best-total dealer-hand-so-far) 17)
(play-dealer customer-hand
(se dealer-hand-so-far (first rest-of-deck))
(bf rest-of-deck)))
((< (best-total c... | null | https://raw.githubusercontent.com/theurere/berkeley_cs61a_spring-2011_archive/1d90036a0a76c62933753ad71f8dcccbbbd37ae4/code/projects/project_1_twenty-one/twenty-one.scm | scheme |
(define (twenty-one strategy)
(define (play-dealer customer-hand dealer-hand-so-far rest-of-deck)
(cond ((> (best-total dealer-hand-so-far) 21) 1)
((< (best-total dealer-hand-so-far) 17)
(play-dealer customer-hand
(se dealer-hand-so-far (first rest-of-deck))
(bf rest-of-deck)))
((< (best-total c... | |
aa9f6bb420ef05b0d6828085157fdd2a4e6b48a32fca5782c5baf639778a85a4 | juhp/fbrnch | Update.hs | module Cmd.Update
( updateCmd
)
where
import Branches
import Common
import Common.System
import Git
import InterleaveOutput (cmdSilent')
import Krb
import Package
import Prompt (prompt_)
import Data.RPM.VerCmp
-- FIXME don't bump release if already bumped
FIXME check EVR increased
-- FIXME if multiple sources ... | null | https://raw.githubusercontent.com/juhp/fbrnch/521d268e90801366f1fefba995257f18e125a10c/src/Cmd/Update.hs | haskell | FIXME don't bump release if already bumped
FIXME if multiple sources might need to bump release
FIXME Haskell subpackages require release bump even with version bump
FIXME forM_
should be impossible
dist <- branchDist br
workaround dist with bootstrap
hostdist <- cmd "rpm" ["--eval", "%{dist}"] | module Cmd.Update
( updateCmd
)
where
import Branches
import Common
import Common.System
import Git
import InterleaveOutput (cmdSilent')
import Krb
import Package
import Prompt (prompt_)
import Data.RPM.VerCmp
FIXME check EVR increased
updateCmd :: Bool -> Bool -> Bool -> (Maybe Branch,[String]) -> IO ()
updat... |
57f89f13e034d4a805c9a8e727cd5b19df372d559ff54d86657c67a554047b88 | lambdaisland/metabase-datomic | repl.clj | (ns user.repl
(:require clojure.tools.namespace.repl
datomic.api
metabase.driver.datomic
metabase.query-processor
[toucan.db :as db]
[metabase.models.database :refer [Database]]
[datomic.api :as d]
[clojure.string :as str]))
(def mbr... | null | https://raw.githubusercontent.com/lambdaisland/metabase-datomic/7506e67bb5fe2ba0a2ff744ec17ccdeb573e869e/dev/user/repl.clj | clojure | (d/delete-database "datomic:mem:test-data")
(clean-up-in-mem-dbs) | (ns user.repl
(:require clojure.tools.namespace.repl
datomic.api
metabase.driver.datomic
metabase.query-processor
[toucan.db :as db]
[metabase.models.database :refer [Database]]
[datomic.api :as d]
[clojure.string :as str]))
(def mbr... |
b333e6b40b7420c619b3031f75367624b712e2612d2a7c37a1f326190a5cafc9 | mikeizbicki/HLearn | TestFunctions.hs | module HLearn.Optimization.TestFunctions
where
import SubHask
import SubHask.Category.Trans.Derivative
import HLearn.History
import HLearn.Optimization.Multivariate
import HLearn.Optimization.Univariate
-------------------------------------------------------------------------------
import SubHask . Compatibi... | null | https://raw.githubusercontent.com/mikeizbicki/HLearn/c6c0f5e7593be3867f20c56c79b998e7d7ded9fc/src/HLearn/Optimization/TestFunctions.hs | haskell | -----------------------------------------------------------------------------
beale '' : : ( v , TensorAlgebra , v ) = > v - > Outer v
beale '' v = mkMatrix 2 2
[ 2*(-1+y)*(-1+y)**2 + 2*(-1+y**2)*(- 1 + y**2)**2 + 2*(-1+y**3)*(-1 + y**3)**2
, 2*(-1+y)*(1.5 - x+x*y)**2
+ 2*(-1+y)*(1.5 - x+x*y)*... | module HLearn.Optimization.TestFunctions
where
import SubHask
import SubHask.Category.Trans.Derivative
import HLearn.History
import HLearn.Optimization.Multivariate
import HLearn.Optimization.Univariate
import SubHask . Compatibility . Vector
import SubHask . Compatibility . HMatrix
import qualified Data... |
ac49c60c020bb8b3e4a6ae3776df7ea4b02df6a7d87a00d9dd0592b6e6b380c0 | simmsb/calamity | Eff.hs | # LANGUAGE TemplateHaskell #
-- | Effect for handling the cache
module Calamity.Cache.Eff (
CacheEff (..),
setBotUser,
updateBotUser,
getBotUser,
setGuild,
updateGuild,
getGuild,
getGuildChannel,
getGuilds,
delGuild,
setDM,
updateDM,
getDM,
getDMs,
delDM,
-- , setGuildChannel
-- , get... | null | https://raw.githubusercontent.com/simmsb/calamity/be310255b446e87e7432673de1fbc67ef46de3ae/calamity/Calamity/Cache/Eff.hs | haskell | | Effect for handling the cache
, setGuildChannel
, getGuildChannel
| Set the 'User' representing the bot itself
| Get the 'User' representing the bot itself
| Set or Update a 'Guild' in the cache
| Get a 'Guild' from the cache
| Get a 'GuildChannel' from the cache
| Delete a 'Guild' from the cache
-- | Set o... | # LANGUAGE TemplateHaskell #
module Calamity.Cache.Eff (
CacheEff (..),
setBotUser,
updateBotUser,
getBotUser,
setGuild,
updateGuild,
getGuild,
getGuildChannel,
getGuilds,
delGuild,
setDM,
updateDM,
getDM,
getDMs,
delDM,
,
setUser,
updateUser,
getUser,
getUsers,
delUser,
se... |
681348b04a355551ed4baefb40cb7f4b3047e68aae1ffce24318928fb59cb2e5 | amperity/ken | context_test.clj | (ns ken.context-test
(:require
[clojure.test :refer [deftest testing is use-fixtures]]
[ken.context :as ctx]
[ken.core :as ken]))
(use-fixtures
:each
(fn [test-case]
(ctx/clear!)
(test-case)))
(deftest collector-lifecycle
(testing "clearing"
(is (nil? (ctx/clear!)))
(is (empty? (... | null | https://raw.githubusercontent.com/amperity/ken/d254ab93777d2aeb2626c658850cc55732bfe9cd/test/ken/context_test.clj | clojure | (ns ken.context-test
(:require
[clojure.test :refer [deftest testing is use-fixtures]]
[ken.context :as ctx]
[ken.core :as ken]))
(use-fixtures
:each
(fn [test-case]
(ctx/clear!)
(test-case)))
(deftest collector-lifecycle
(testing "clearing"
(is (nil? (ctx/clear!)))
(is (empty? (... | |
dcabfba9f4d860f71fa8a6e3965ded766f0c07504807b8810035fea6525b492b | joelburget/lvca | Scope_viewer.ml | open Base
open Brr
open Brr_note
open Lvca_provenance
open Note
open Prelude
let buf = "input"
let initial_input = "fun(x. app(fun(x. app(f; x)); x))"
module Model = struct
type t = string * Ranges.t
let initial_model = initial_input, []
let ( = ) (str1, ranges1) (str2, ranges2) =
String.(str1 = str2) && ... | null | https://raw.githubusercontent.com/joelburget/lvca/f8a3b8e294f564d1fc9836af63e6169b26ca0234/pages/Scope_viewer.ml | ocaml | open Base
open Brr
open Brr_note
open Lvca_provenance
open Note
open Prelude
let buf = "input"
let initial_input = "fun(x. app(fun(x. app(f; x)); x))"
module Model = struct
type t = string * Ranges.t
let initial_model = initial_input, []
let ( = ) (str1, ranges1) (str2, ranges2) =
String.(str1 = str2) && ... | |
4d4e47923694d43f012c5c980accbf87e3c59e7e7ec215906267fbfdc6a02a5a | xapi-project/xen-api-libs | opt.ml |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | null | https://raw.githubusercontent.com/xapi-project/xen-api-libs/d603ee2b8456bc2aac99b0a4955f083e22f4f314/stdext/opt.ml | ocaml |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | |
03093fa1af8d42296b2722f80d14099ff3f868cd17df9c98c6715d2dfb2cec81 | jrm-code-project/LISP-Machine | coma.lisp | Some simple ZWEI command functions . -*- Mode : LISP ; Package : ZWEI ; Base:8 ; : T -*-
* * ( c ) Copyright 1980 Massachusetts Institute of Technology * *
;;; DEFS contains a list of all free variables used by these commands.
;;; Any editor that wishes to use these commands must bind all of them.
;;; When... | null | https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/zwei/coma.lisp | lisp | Package : ZWEI ; Base:8 ; : T -*-
DEFS contains a list of all free variables used by these commands.
Any editor that wishes to use these commands must bind all of them.
When adding any to this file, or to primitives called by functions
The caller of these functions should also provide a function
to interac... | * * ( c ) Copyright 1980 Massachusetts Institute of Technology * *
in this file , update the list in DEFS .
called BARF , to report errors . It should take arguments like
the & REST to FORMAT .
Commands in this file also use the PROMPT and lines
Do formatted output to the prompt line... |
4bb988b931879b62e44a5eacd6f3632bfcfa0da772882f88014ddeb51cb13fc1 | jordanthayer/ocaml-search | dpq.ml | $ I d : dpq.ml , v 1.3 2005/12/10 23:25:37 ruml Exp ruml $
destructive priority queues
destructive priority queues
*)
type 'a t = {
(* fill pointer - index of next item *)
mutable fp : int;
mutable heap : 'a array;
mutable pred : 'a -> 'a -> bool;
update : 'a -> int -> unit;
(* check_val: 'a ... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/structs/dpq.ml | ocaml | fill pointer - index of next item
check_val: 'a -> int -> unit;
************ basics ************
check_val = get
* [copy q] makes a copy.
* [copy q] makes a copy.
let from_array pred update init_a init_e =
let q = { fp = Array.length init_a;
heap = init_a;
pred = pred;
update = update;
... | $ I d : dpq.ml , v 1.3 2005/12/10 23:25:37 ruml Exp ruml $
destructive priority queues
destructive priority queues
*)
type 'a t = {
mutable fp : int;
mutable heap : 'a array;
mutable pred : 'a -> 'a -> bool;
update : 'a -> int -> unit;
}
let no_position = -1
let create pred update approx_n ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.