_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 |
|---|---|---|---|---|---|---|---|---|
cf57f1eecc3e612f4f43b6f430b8614739c9efe34213707dfe8ba020ce3c2c61 | easyuc/EasyUC | ecCommands.ml | A modification of src / ecCommands.ml of the EasyCrypt distribution
See " UC DSL " for changes
See "UC DSL" for changes
*)
(* -------------------------------------------------------------------- *)
open EcUtils
open EcLocation
open EcParsetree
module Sid = EcIdent.Sid
module Mx = EcPath.Mx
(* ------... | null | https://raw.githubusercontent.com/easyuc/EasyUC/0ee14ef8b024a8e7acde1035d06afecbdcaec990/uc-dsl/ucdsl-proj/src/ecCommands.ml | ocaml | --------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
true => display goal after each command
true => display all open goals
-----------------------------... | A modification of src / ecCommands.ml of the EasyCrypt distribution
See " UC DSL " for changes
See "UC DSL" for changes
*)
open EcUtils
open EcLocation
open EcParsetree
module Sid = EcIdent.Sid
module Mx = EcPath.Mx
exception Restart
type pragma = {
pm_g_prpo : EcPrinting.prpo_display;
pm_chec... |
75a5795a37816cbbfdbca1869434b00d8bd7fae61f77770e36f5066c819b0b2a | Racket-Cookbooks/Plot-cookbook | cosandderiv.rkt | #lang racket ; draw a graph of cos
and deriv^3(cos )
(define ((deriv f) x)
(/ (- (f x) (f (- x 0.001))) 0.001))
(define (thrice f) (lambda (x) (f (f (f x)))))
(plot (list (function ((thrice deriv) sin) -5 5)
(function cos -5 5 #:color 'blue))) | null | https://raw.githubusercontent.com/Racket-Cookbooks/Plot-cookbook/dfe8a81a6c7a3ae7296ad4e15bf5be9a99f04b6a/examples/cosandderiv/cosandderiv.rkt | racket | draw a graph of cos | and deriv^3(cos )
(define ((deriv f) x)
(/ (- (f x) (f (- x 0.001))) 0.001))
(define (thrice f) (lambda (x) (f (f (f x)))))
(plot (list (function ((thrice deriv) sin) -5 5)
(function cos -5 5 #:color 'blue))) |
e2efb4800b2e6fe38c7791221ebc7dadd286fc7afb2080f3ba93d79e7634abcd | LaurentMazare/ocaml-matplotlib | pyplot.mli | val xlim : left:float -> right:float -> unit
val ylim : bottom:float -> top:float -> unit
val xlabel : string -> unit
val ylabel : string -> unit
val grid : bool -> unit
val title : string -> unit
val plot
: ?label:string
-> ?color:Mpl.Color.t
-> ?linewidth:float
-> ?linestyle:Mpl.Linestyle.t
-> ?xs:float a... | null | https://raw.githubusercontent.com/LaurentMazare/ocaml-matplotlib/d9d47ff63794c56c3ff1022bba7246344f2ec326/src/matplotlib/pyplot.mli | ocaml | Possible markers:
'o', 'v', '^', '<', '>', '8', 's', 'p', '*', 'h', 'H', 'D', 'd', 'P', 'X'
| val xlim : left:float -> right:float -> unit
val ylim : bottom:float -> top:float -> unit
val xlabel : string -> unit
val ylabel : string -> unit
val grid : bool -> unit
val title : string -> unit
val plot
: ?label:string
-> ?color:Mpl.Color.t
-> ?linewidth:float
-> ?linestyle:Mpl.Linestyle.t
-> ?xs:float a... |
d6df15f7a268e7e409e0a1f819e0eb4fd379b788657a7e8efc25d84506cda8ab | zwizwa/erl_tools | gdb.erl | ( c ) 2018 -- see LICENSE file
-module(gdb).
Start GDB through TCP GDB RSP , providing a Port handler
Start GDB attaching to host Pid
Start GDB , upload file , exit
,cmd_sink/3 %% Send command, forwared responses to sink.
,cmd/3 %% Send command, return formatted response.
... | null | https://raw.githubusercontent.com/zwizwa/erl_tools/affd4060ab5b963e0cc8fcfd4a1ca5023aa518d3/src/gdb.erl | erlang | Send command, forwared responses to sink.
Send command, return formatted response.
Set a variable or struct member
For blocking interaction
Hack, gathers all bindings
Proper parser
Low level
with -i=mi argument.
Ask connected dev node to push image here.
Assumes host name is set up correctly so dev node ca... | ( c ) 2018 -- see LICENSE file
-module(gdb).
Start GDB through TCP GDB RSP , providing a Port handler
Start GDB attaching to host Pid
Start GDB , upload file , exit
Retreive values from status messages ( ad - hoc )
]).
GDB Machine Interface ( MI ) .
Interact with GDB from erlang .
... |
21b339e171ce47cfd4d206c29484e6d341b6349a80ae6939f6c37e1d08ffedde | arttuka/reagent-material-ui | curtains_closed.cljs | (ns reagent-mui.icons.curtains-closed
"Imports @mui/icons-material/CurtainsClosed as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def curtains-closed (create-sv... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/c7cd0d7c661ab9df5b0aed0213a6653a9a3f28ea/src/icons/reagent_mui/icons/curtains_closed.cljs | clojure | (ns reagent-mui.icons.curtains-closed
"Imports @mui/icons-material/CurtainsClosed as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def curtains-closed (create-sv... | |
fa2278f779f42827989c7025044ce082efb324b776398b6893494b8ad42ff003 | tommaisey/aeon | le.help.scm | ;; (le a b)
;; See gt
| null | https://raw.githubusercontent.com/tommaisey/aeon/80744a7235425c47a061ec8324d923c53ebedf15/libs/third-party/sc3/rsc3/help/ugen/binary-ops/le.help.scm | scheme | (le a b)
See gt | |
ca454f4e061acc1c62b7c0e9662d45b42b4c58103213f87a16ef608efaa3e7ef | google/ormolu | sig-pattern-out.hs | f = do
x :: a <- g
f = do
(x, y)
:: (a, b) <-
g
| null | https://raw.githubusercontent.com/google/ormolu/ffdf145bbdf917d54a3ef4951fc2655e35847ff0/data/examples/declaration/value/function/pattern/sig-pattern-out.hs | haskell | f = do
x :: a <- g
f = do
(x, y)
:: (a, b) <-
g
| |
a9e9e4357ad7404ab7785fd92b3091697d861017049cd624b83ada1e99211046 | JacquesCarette/Drasil | AST.hs | -- | Defines a Makefile abstract syntax tree.
module Build.Drasil.Make.AST where
import Build.Drasil.Make.MakeString (MakeString)
-- * Types
-- | A Makefile is made up of Makefile rules.
newtype Makefile = M [Rule]
-- | A Makefile Rule needs a target, dependencies, type, and commands.
data Rule = R Target Dependenci... | null | https://raw.githubusercontent.com/JacquesCarette/Drasil/92dddf7a545ba5029f99ad5c5eddcd8dad56a2d8/code/drasil-build/lib/Build/Drasil/Make/AST.hs | haskell | | Defines a Makefile abstract syntax tree.
* Types
| A Makefile is made up of Makefile rules.
| A Makefile Rule needs a target, dependencies, type, and commands.
| Ignore the return code from the system.
| Type of rule, either abstract or file-oriented.
* Constructors
| Creates a Rule which results in a file be... | module Build.Drasil.Make.AST where
import Build.Drasil.Make.MakeString (MakeString)
newtype Makefile = M [Rule]
data Rule = R Target Dependencies Type [Command]
| A command is made up of ' MakeString 's and command operators .
data Command = C MakeString [CommandOpts]
data CommandOpts =
IgnoreReturnCode derivi... |
9668a097aac4365362c3ee5ddfd3ed209d582f06a2af39587d3d93d8effb04ce | clj-commons/rewrite-clj | stringz.cljc | (ns ^:no-doc rewrite-clj.node.stringz
(:require [clojure.string :as string]
[clojure.tools.reader.edn :as edn]
[rewrite-clj.node.protocols :as node] ))
#?(:clj (set! *warn-on-reflection* true))
;; ## Node
(defn- wrap-string [s]
(str "\"" s "\""))
(defn- join-lines [lines]
(string/join ... | null | https://raw.githubusercontent.com/clj-commons/rewrite-clj/621fd5dbc0861807da9ff854bfc3df541f79446f/src/rewrite_clj/node/stringz.cljc | clojure | ## Node
=> \"\\\"hello\\\"\"
=> \"\\\"line1\\n\\nline3\\\"\"
=> \"\\\"hey \\\\\\\" man\\\"\" | (ns ^:no-doc rewrite-clj.node.stringz
(:require [clojure.string :as string]
[clojure.tools.reader.edn :as edn]
[rewrite-clj.node.protocols :as node] ))
#?(:clj (set! *warn-on-reflection* true))
(defn- wrap-string [s]
(str "\"" s "\""))
(defn- join-lines [lines]
(string/join "\n" lines)... |
08f2ca530d8a731341e1a068f27080c457d88f03908d4278bbe137d3016fa22b | startalkIM/ejabberd | mod_carboncopy_mnesia.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2016 ,
%%% @doc
%%%
%%% @end
Created : 15 Apr 2016 by < >
%%%-------------------------------------------------------------------
-module(mod_carboncopy_mnesia).
-behaviour(mod_carboncopy).
%% API
-export([init/2, e... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/src/mod_carboncopy_mnesia.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
===================================================================
API
===================================================================
recreate..
probably tab... | @author < >
( C ) 2016 ,
Created : 15 Apr 2016 by < >
-module(mod_carboncopy_mnesia).
-behaviour(mod_carboncopy).
-export([init/2, enable/4, disable/3, list/2]).
-include("mod_carboncopy.hrl").
init(_Host, _Opts) ->
Fields = record_info(fields, carboncopy),
try mnesia:table_info(carboncopy, a... |
470bdef8ad374f6c25427faaac3da347c007c981c4d65176070a9def9cdc9d7f | DSiSc/why3 | Macrogen_printing.ml |
open Format
open Macrogen_decls
open Macrogen_params
module rec X : module type of Macrogen_printing_sig = X
include X
module Helper = functor (P:Parameters) -> struct
open P
let (<|) f x y = f y x
let (<<) f x = f x
let indent = pp_open_box <| indent
let string_printer s = fprintf <| "%s" <| s
let p... | null | https://raw.githubusercontent.com/DSiSc/why3/8ba9c2287224b53075adc51544bc377bc8ea5c75/examples/prover/macro_generator/Macrogen_printing.ml | ocaml |
open Format
open Macrogen_decls
open Macrogen_params
module rec X : module type of Macrogen_printing_sig = X
include X
module Helper = functor (P:Parameters) -> struct
open P
let (<|) f x y = f y x
let (<<) f x = f x
let indent = pp_open_box <| indent
let string_printer s = fprintf <| "%s" <| s
let p... | |
e4a4af9d65cdd40dc1135a77d6a2190ff36908db5e644a9d6a2fa370de12bd21 | Eduap-com/WordMat | bernstein.lisp | Author
University of Nebraska at Kearney
;; Copyright (C) 2011,2021 Barton Willis
;; This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
;; ... | null | https://raw.githubusercontent.com/Eduap-com/WordMat/83c9336770067f54431cc42c7147dc6ed640a339/Windows/ExternalPrograms/maxima-5.45.1/share/maxima/5.45.1/share/bernstein/bernstein.lisp | lisp | Copyright (C) 2011,2021 Barton Willis
This program is free software; you can redistribute it and/or modify
either version 2 of the License , or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied ... | Author
University of Nebraska at Kearney
it under the terms of the GNU General Public License as published by
(in-package :maxima)
($load "bernstein_utilities.mac")
(defmvar $bernstein_explicit nil)
numerical ( complex rational , float , or big float ) evaluation of polynomial... |
b1148eb22c268e600c96a59d40b7f47acd89b24510f867a5418c07d57b4f5731 | barrucadu/hledger-scripts | hledger-to-influxdb.hs | #!/usr/bin/env stack
stack script
--nix --no - nix - pure --nix - packages zlib
--resolver lts-16.16
--package containers , Decimal , , influxdb , text , time
--nix --no-nix-pure --nix-packages zlib
--resolver lts-16.16
--package containers,Decimal,hledger-lib,influxdb,text,time
-}
# OPTIONS_G... | null | https://raw.githubusercontent.com/barrucadu/hledger-scripts/7a9084d60071355436eb6c3b3a2622153c35a88e/hledger-to-influxdb.hs | haskell | nix --no - nix - pure --nix - packages zlib
resolver lts-16.16
package containers , Decimal , , influxdb , text , time
nix --no-nix-pure --nix-packages zlib
resolver lts-16.16
package containers,Decimal,hledger-lib,influxdb,text,time
# LANGUAGE OverloadedStrings #
picked by trial and error, needs shrinking occas... | #!/usr/bin/env stack
stack script
-}
# OPTIONS_GHC -Wall #
module Main (main) where
import Control.Arrow ((***), second)
import Data.Decimal (Decimal)
import Data.Foldable (for_)
import Data.Function (on)
import Data.List (foldl', i... |
b73d6f063e60cda2335ab12a31638d8b85db9213b776dc6e0240b6df4defddcd | joinr/clclojure | evaltest.lisp | ;;quick test to see if we get compiler support for our
;;eval hack...
(ql:quickload :cl-package-locks)
(load "eval.lisp")
(defstruct blah (x))
(defparameter b (make-blah :x 2))
(defmethod clclojure.eval:custom-eval
((obj blah))
(list :this-is-custom (blah-x obj)))
(clclojure.eval:enable-custom-eval)
(defparam... | null | https://raw.githubusercontent.com/joinr/clclojure/8b51214891c4da6dfbec393dffac70846ee1d0c5/tests/evaltest.lisp | lisp | quick test to see if we get compiler support for our
eval hack...
(:THIS-IS-CUSTOM 2) | (ql:quickload :cl-package-locks)
(load "eval.lisp")
(defstruct blah (x))
(defparameter b (make-blah :x 2))
(defmethod clclojure.eval:custom-eval
((obj blah))
(list :this-is-custom (blah-x obj)))
(clclojure.eval:enable-custom-eval)
(defparameter custom (eval b))
(clclojure.eval:disable-custom-eval)
(defparame... |
bb4fb72501a82d3541399145d673057bef1a173c93c673f0562fbc3c6ed5ff56 | olsner/sedition | RedundantBranches.hs | # LANGUAGE FlexibleInstances , GADTs , TypeFamilies , StandaloneDeriving , CPP , ScopedTypeVariables , FlexibleContexts #
module RedundantBranches (redundantBranchesPass) where
import Compiler.Hoopl as H
-- import Debug.Trace
import IR
type RBFact = WithTopAndBot (Insn O C)
lattice :: DataflowLattice RBFact
lattic... | null | https://raw.githubusercontent.com/olsner/sedition/483e283289a84764eec71c39dd66b017b8b00bf8/RedundantBranches.hs | haskell | import Debug.Trace
C O
O O
O C
Do just one change at a time so that optimization fuel applies.
Branch to an if with the same condition, so we can | # LANGUAGE FlexibleInstances , GADTs , TypeFamilies , StandaloneDeriving , CPP , ScopedTypeVariables , FlexibleContexts #
module RedundantBranches (redundantBranchesPass) where
import Compiler.Hoopl as H
import IR
type RBFact = WithTopAndBot (Insn O C)
lattice :: DataflowLattice RBFact
lattice = addPoints "Redunda... |
ad37ba1fae8bab6fd6e8295e9f03e9f780fcc4e69ca22bf4f6c5a22675803787 | jepsen-io/jepsen | project.clj | (defproject jepsen "0.3.2-SNAPSHOT"
:description "Distributed systems testing framework."
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.11.1"]
[org.clojure/data.fressian "1.0.0"]
[org.clojure/tools... | null | https://raw.githubusercontent.com/jepsen-io/jepsen/cfd1421a0ee2a7e6095b1f3cab8a6dbd844f696f/jepsen/project.clj | clojure | experimenting with faster startup
:aot [jepsen.core] | (defproject jepsen "0.3.2-SNAPSHOT"
:description "Distributed systems testing framework."
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.11.1"]
[org.clojure/data.fressian "1.0.0"]
[org.clojure/tools... |
e8372f8e4a8f2675c14eabae91e8cbd2e573db33e8cdcec68bc0e626a951a3c1 | project-oak/hafnium-verification | infer.mli |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/infer.mli | ocaml | * Top-level driver that orchestrates build system integration, frontends, and backend |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
137e7beb923fef9c3c27f469479f004936c856c03168d005efe23c3f85c1b43a | csicar/pskt | CLI.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
module CLI where
import Version
import Prelude hiding (print)
import Control.Monad (when)
import qualified Control.Monad.Parallel as Par
import Data.Aeson
import Data.Aeson.Types hiding (Parser)
import Data.Char
import Data.Foldable (for_)
import Data.Trav... | null | https://raw.githubusercontent.com/csicar/pskt/aa0d5df52e9579abd38061c6ab891489ebf295c4/src/CLI.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
Adding program help text to the parser
automatically choose number of threads
pPrint moduleKt | module CLI where
import Version
import Prelude hiding (print)
import Control.Monad (when)
import qualified Control.Monad.Parallel as Par
import Data.Aeson
import Data.Aeson.Types hiding (Parser)
import Data.Char
import Data.Foldable (for_)
import Data.Traversable (forM)
import Data.FileEmbed (embedFile)
import Data.Li... |
056647267e27c5fb7572595cacb15580b25d9220013e4360e11286c1ef622c9f | gogins/csound-extended-nudruz | whirl.lisp | ;;;; N U D R U Z C S O U N D F F I E X A M P L E S
August 2018
#|
Contrary to CM documentation, the events function does not return a usable seq object.
The generated score is placed into the seq that is passed to events.
|#
(require :asdf)
(require :fomus)
(require :nudruz)
(load "example-csd.lisp")
(in-... | null | https://raw.githubusercontent.com/gogins/csound-extended-nudruz/4551d54890f4adbadc5db8f46cc24af8e92fb9e9/examples/whirl.lisp | lisp | N U D R U Z C S O U N D F F I E X A M P L E S
Contrary to CM documentation, the events function does not return a usable seq object.
The generated score is placed into the seq that is passed to events.
|
August 2018
(require :asdf)
(require :fomus)
(require :nudruz)
(load "example-csd.lisp")
(in-package :cm)
(defparameter csound-seq (new seq :name "csound-test"))
(events (whirl 10 .1 .5 20 10 50 harms) csound-seq)
(defparameter *piano-part*
(new fomus:part
:name "Xing"
:partid 0
:instr '(:piano :s... |
a620816f7d9019ec654f6a9ecc28d0fd2294db82b3c2fb27ef2bea12fc964170 | diku-dk/futhark | GraphRep.hs | | A graph representation of a sequence of statements
-- (i.e. a 'Body'), built to handle fusion. Could perhaps be made
-- more general. An important property is that it does not handle
-- "nested bodies" (e.g. 'Match'); these are represented as single
-- nodes.
--
-- This is all implemented on top of the graph rep... | null | https://raw.githubusercontent.com/diku-dk/futhark/c0eccff27fd804390c8968954342bf9b23479bfc/src/Futhark/Optimise/Fusion/GraphRep.hs | haskell | (i.e. a 'Body'), built to handle fusion. Could perhaps be made
more general. An important property is that it does not handle
"nested bodies" (e.g. 'Match'); these are represented as single
nodes.
This is all implemented on top of the graph representation provided
by the @fgl@ package ("Data.Graph.Inductive").... | | A graph representation of a sequence of statements
" labels " . It is these labels ( ' EdgeT ' , ' NodeT ' ) that we use to
contain - specific information . An edge goes * from * uses of
module Futhark.Optimise.Fusion.GraphRep
EdgeT (..),
NodeT (..),
DepContext,
DepGraphAug,
DepGraph (... |
60a1bf7bd15f5d009e9c4ee348ceae521f8980180ad6b3faa6f923d1bcc17840 | mindreframer/clojure-stuff | core_test.clj | (ns yesql.core-test
(:require [clojure.java.jdbc :as jdbc]
[expectations :refer :all]
[yesql.core :refer :all]))
(def derby-db {:subprotocol "derby"
:subname (gensym "memory:")
:create true})
(defquery current-time-query "yesql/sample_files/current_time.sql")
(d... | null | https://raw.githubusercontent.com/mindreframer/clojure-stuff/1e761b2dacbbfbeec6f20530f136767e788e0fe3/github.com/krisajenkins/yesql/test/yesql/core_test.clj | clojure | Check we can start up the test DB.
Test querying.
Running a query in a transaction and using the result outside of it should work as expected.
Check defqueries returns the list of defined vars. | (ns yesql.core-test
(:require [clojure.java.jdbc :as jdbc]
[expectations :refer :all]
[yesql.core :refer :all]))
(def derby-db {:subprotocol "derby"
:subname (gensym "memory:")
:create true})
(defquery current-time-query "yesql/sample_files/current_time.sql")
(d... |
ae9bbb488660d9f6ea7fee5b2d9e44bd5116432ce8f6bfb9db4a0c0659a7508c | tobbebex/GPipe-Core | PrimitiveArray.hs | # LANGUAGE CPP #
# LANGUAGE TypeSynonymInstances , FlexibleInstances , ScopedTypeVariables , EmptyDataDecls , TypeFamilies , GADTs #
module Graphics.GPipe.Internal.PrimitiveArray where
import Graphics.GPipe.Internal.Buffer
import Graphics.GPipe.Internal.Shader
#if __GLASGOW_HASKELL__ < 804
import Data.Semigroup
#endif... | null | https://raw.githubusercontent.com/tobbebex/GPipe-Core/4607e2c31d5beec30f2a918ab8ad48472ca236b7/GPipe-Core/src/Graphics/GPipe/Internal/PrimitiveArray.hs | haskell | | A vertex array is the basic building block for a primitive array. It is created from the contents of a 'Buffer', but unlike a 'Buffer',
it may be truncated, zipped with other vertex arrays, and even morphed into arrays of a different type with the provided 'Functor' instance.
A @VertexArray t a@ has elements o... | # LANGUAGE CPP #
# LANGUAGE TypeSynonymInstances , FlexibleInstances , ScopedTypeVariables , EmptyDataDecls , TypeFamilies , GADTs #
module Graphics.GPipe.Internal.PrimitiveArray where
import Graphics.GPipe.Internal.Buffer
import Graphics.GPipe.Internal.Shader
#if __GLASGOW_HASKELL__ < 804
import Data.Semigroup
#endif... |
55298cb42fe990af24151067ecee7717f109f478385eed8cd277dd08ade74c12 | Octachron/codept | bundle.mli | val versioned_stdlib: int * int -> Module.named list
val stdlib : Module.dict
val bigarray : Module.dict
val num : Module.dict
val threads : Module.dict
val graphics : Module.dict
val dynlink : Module.dict
val unix : Module.dict
| null | https://raw.githubusercontent.com/Octachron/codept/5346aee9337f4bef6a2e5bb7db91625217ca499e/bundled/bundle.mli | ocaml | val versioned_stdlib: int * int -> Module.named list
val stdlib : Module.dict
val bigarray : Module.dict
val num : Module.dict
val threads : Module.dict
val graphics : Module.dict
val dynlink : Module.dict
val unix : Module.dict
| |
658e3fd8224c8fbe63911ad2b0d80874aafd1ddd8b7d9e6e8d92ac0c7f1214de | EveryTian/Haskell-Codewars | calculate-fibonacci-return-count-of-digit-occurrences.hs | -- -fibonacci-return-count-of-digit-occurrences
module Kata (fibDigits) where
import Data.List (sortBy)
fibDigits :: Integer -> [(Integer, Integer)]
fibDigits = sortBy (flip compare) . filter ((/= 0) . fst) . (`zip` [0..9]) . count . show . (fibs !!) . fromIntegral
where
count = count' $ replicate 10 0
w... | null | https://raw.githubusercontent.com/EveryTian/Haskell-Codewars/dc48d95c676ce1a59f697d07672acb6d4722893b/5kyu/calculate-fibonacci-return-count-of-digit-occurrences.hs | haskell | -fibonacci-return-count-of-digit-occurrences |
module Kata (fibDigits) where
import Data.List (sortBy)
fibDigits :: Integer -> [(Integer, Integer)]
fibDigits = sortBy (flip compare) . filter ((/= 0) . fst) . (`zip` [0..9]) . count . show . (fibs !!) . fromIntegral
where
count = count' $ replicate 10 0
where
count' result [] = result
c... |
65fc9d95cb4e8db1f6669892db8396a51882d2d4878259494c4ff1e9717116f7 | jfischoff/tmp-postgres | Main.hs | module Main where
import Control.DeepSeq
import Control.Exception
import Control.Monad
import Criterion.Main hiding (defaultConfig)
import Data.String
import Database.Postgres.Temp.Internal
import Database.Postgres.Temp.Internal.Core
import Database.Postgres.Temp.Internal.Config
import qualified Database.PostgreSQL.Sim... | null | https://raw.githubusercontent.com/jfischoff/tmp-postgres/593e3ebcb7643afd6095f6269de3552d01c7ff40/benchmark/Main.hs | haskell | module Main where
import Control.DeepSeq
import Control.Exception
import Control.Monad
import Criterion.Main hiding (defaultConfig)
import Data.String
import Database.Postgres.Temp.Internal
import Database.Postgres.Temp.Internal.Core
import Database.Postgres.Temp.Internal.Config
import qualified Database.PostgreSQL.Sim... | |
59297abcb07fd6c03fe4f3aa9853ccba4f620323431e9af41034e2efddf7f469 | emaphis/HtDP2e-solutions | 08_Designing_with_Structures.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 08_Designing_with_Structures) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructo... | null | https://raw.githubusercontent.com/emaphis/HtDP2e-solutions/ecb60b9a7bbf9b8999c0122b6ea152a3301f0a68/1-Fixed-Size-Data/05-Adding-Structure/08_Designing_with_Structures.rkt | racket | about the language level of this file in a form that our tools can easily process.
The design recipe including structures:
Sample Problem:
space to the origin.
pieces of data that go to gether belong in a structure
A R3 is a structure:
(make-r3 Number Number Number)
R3 -> ???
template for R3
R3 -> Numbers
... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname 08_Designing_with_Structures) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
HtDP 2e - 5 Adding Structure
5.2 Design... |
9d55a4e425a0b70c033e1824986da4abec61c91f57cf57893a200071fa6ed253 | ndmitchell/uniplate | Timer.hs |
module Uniplate.Timer(getTime, timer, dp2) where
import Data.Time.Clock.POSIX(getPOSIXTime)
import Numeric
getTime :: IO Double
getTime = (fromRational . toRational) `fmap` getPOSIXTime
timer :: IO a -> IO Double
timer x = do
start <- getTime
x
stop <- getTime
return $ stop - start
dp2 x = showFFl... | null | https://raw.githubusercontent.com/ndmitchell/uniplate/7d3039606d7a083f6d77f9f960c919668788de91/Uniplate/Timer.hs | haskell |
module Uniplate.Timer(getTime, timer, dp2) where
import Data.Time.Clock.POSIX(getPOSIXTime)
import Numeric
getTime :: IO Double
getTime = (fromRational . toRational) `fmap` getPOSIXTime
timer :: IO a -> IO Double
timer x = do
start <- getTime
x
stop <- getTime
return $ stop - start
dp2 x = showFFl... | |
8e074c98e57b458c3ce4a9da6eb25f93ddc619205f620ede1b2aa5e51d583cf0 | ygrek/mldonkey | mp3tagui.mli | (**************************************************************************)
Copyright 2003 , 2002 b8_bavard , , , b52_simon INRIA
(* *)
(* This file is part of mldonkey. *)
(* ... | null | https://raw.githubusercontent.com/ygrek/mldonkey/333868a12bb6cd25fed49391dd2c3a767741cb51/src/utils/mp3tagui/mp3tagui.mli | ocaml | ************************************************************************
This file is part of mldonkey.
or (at your option) any ... | Copyright 2003 , 2002 b8_bavard , , , b52_simon INRIA
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 ,
is distributed in the hope ... |
78a891792ceb90509c86f0829253a7248512ddaeb2a43b5ff31661956dfebae2 | serokell/qtah | QGraphicsView.hs | This file is part of Qtah .
--
Copyright 2015 - 2018 The Qtah Authors .
--
-- 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 , either version 3 of the License , or
-- (at your option) ... | null | https://raw.githubusercontent.com/serokell/qtah/abb4932248c82dc5c662a20d8f177acbc7cfa722/qtah-generator/src/Graphics/UI/Qtah/Generator/Interface/Widgets/QGraphicsView.hs | haskell |
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
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MER... | This file is part of Qtah .
Copyright 2015 - 2018 The Qtah Authors .
the Free Software Foundation , either version 3 of the License , or
GNU Lesser General Public License for more details .
You should have received a copy of the GNU Lesser General Public License
module Graphics.UI.Qtah.Generator.Interface.Wi... |
408ef76b25111e974a03bc408a5a2c1cbb89932f7a2073b52adad83b2ea98adb | imdea-software/leap | Core.ml |
(***********************************************************************)
(* *)
LEAP
(* *)
, IMDEA ... | null | https://raw.githubusercontent.com/imdea-software/leap/5f946163c0f80ff9162db605a75b7ce2e27926ef/src/Core.ml | ocaml | *********************************************************************
... |
LEAP
, IMDEA Software Institute
Copyright 2011 IMDEA Software Institute
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compl... |
49b9d20260e41bbe3a4c4a984f9490070e4ea5c324cb429d1f4b13fed50d4312 | avsm/mirage-duniverse | test_deadlock.ml | open Lwt.Infix
let mtu = 4000
let server_log = Logs.Src.create "test_deadlock_server" ~doc:"tcp deadlock tests: server"
module Server_log = (val Logs.src_log server_log : Logs.LOG)
let client_log = Logs.Src.create "test_deadlock_client" ~doc:"tcp deadlock tests: client"
module Client_log = (val Logs.src_log client_l... | null | https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/tcpip/test/test_deadlock.ml | ocaml | open Lwt.Infix
let mtu = 4000
let server_log = Logs.Src.create "test_deadlock_server" ~doc:"tcp deadlock tests: server"
module Server_log = (val Logs.src_log server_log : Logs.LOG)
let client_log = Logs.Src.create "test_deadlock_client" ~doc:"tcp deadlock tests: client"
module Client_log = (val Logs.src_log client_l... | |
e2cdc98c01d25d2749dcddd8585927984d87dfd32af569c76722d27299b69b6d | rm-hull/jasentaa | combinators_test.cljc | (ns jasentaa.parser.combinators-test
(:require
#?(:clj [clojure.test :refer :all]
:cljs [cljs.test :refer-macros [deftest is testing]])
[jasentaa.monad :as m]
[jasentaa.test-helpers :as th]
[jasentaa.parser.basic :as pb]
[jasentaa.parser.combinators :as pc]))
(deftest check-and-then
(let [par... | null | https://raw.githubusercontent.com/rm-hull/jasentaa/aeb0738d05db6ad536ee67253c6716c7a0b1c586/test/jasentaa/parser/combinators_test.cljc | clojure | (ns jasentaa.parser.combinators-test
(:require
#?(:clj [clojure.test :refer :all]
:cljs [cljs.test :refer-macros [deftest is testing]])
[jasentaa.monad :as m]
[jasentaa.test-helpers :as th]
[jasentaa.parser.basic :as pb]
[jasentaa.parser.combinators :as pc]))
(deftest check-and-then
(let [par... | |
f1b8b0bb8288f7f718a0f293a047346355b6edca930cae2295ad2188fad7a623 | robrix/starlight | Length.hs | {-# LANGUAGE DeriveTraversable #-}
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
module Unit.Length
( Length
, Metres(..)
, fromAUs
, module Unit
, modu... | null | https://raw.githubusercontent.com/robrix/starlight/ad80ab74dc2eedbb52a75ac8ce507661d32f488e/src/Unit/Length.hs | haskell | # LANGUAGE DeriveTraversable # | # LANGUAGE DerivingVia #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
module Unit.Length
( Length
, Metres(..)
, fromAUs
, module Unit
, module Unit.Algebra
, module Unit.Multi... |
7dea0d4c35788c7be2eef21f7392fb9a0787fb3f30eabf9b7740a4f693079de9 | aeternity/aeternity | aemon_sup.erl | -module(aemon_sup).
-behaviour(supervisor).
%% API
-export([start_link/0]).
%% supervisor callbacks
-export([init/1]).
-define(SERVER, ?MODULE).
-define(CHILD(Mod,N,Type), {Mod,{Mod,start_link,[]},permanent,N,Type,[Mod]}).
%% ==================================================================
%% API
start_link() -... | null | https://raw.githubusercontent.com/aeternity/aeternity/b7ce6ae15dab7fa22287c2da3d4405c29bb4edd7/apps/aemon/src/aemon_sup.erl | erlang | API
supervisor callbacks
==================================================================
API
==================================================================
supervisor callbacks
==================================================================
internal functions | -module(aemon_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(SERVER, ?MODULE).
-define(CHILD(Mod,N,Type), {Mod,{Mod,start_link,[]},permanent,N,Type,[Mod]}).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init(_) ->
ChildSpecs = child_specs(aemon_... |
6d751cc9555d35a850f9e7b55eec9ac3d69f3e49b2a12128e0cf0bb36a8e0d91 | haskell-suite/haskell-tc | Naming5.hs | module Naming5 where
outer b = b
where
inner :: a -> a
inner a = const b a
const _ b = b
| null | https://raw.githubusercontent.com/haskell-suite/haskell-tc/abf5e3cc624e0095cae14c3c1c695b76ea8ffcb9/tests/Naming5.hs | haskell | module Naming5 where
outer b = b
where
inner :: a -> a
inner a = const b a
const _ b = b
| |
a7ca6306b3b236ae9f0a4a3a2e112ef9c69af63d8190b7cbc61bcbca09dc4bab | Frozenlock/bacure | remote_device.clj | (ns bacure.test.remote-device
(:use clojure.test)
(:require [bacure.local-device :as ld]
[bacure.read-properties :as rp]
[bacure.remote-device :as rd]
[bacure.test.foreign-device :as fd]
[bacure.services :as services]
[bacure.network :as net]))
(defn init... | null | https://raw.githubusercontent.com/Frozenlock/bacure/2d743492f7865d8c61313f4d73818c3d1ee462de/test/bacure/test/remote_device.clj | clojure | Make devices aware of each other
current local device
all the other devices
initially we shouldn't have this data
now try to retrieve it
first we create the local devices
Get the extended information (mostly to know if we can use
readPropertyMultiple)."
we try a few reads
<--- with array index
Reading indivi... | (ns bacure.test.remote-device
(:use clojure.test)
(:require [bacure.local-device :as ld]
[bacure.read-properties :as rp]
[bacure.remote-device :as rd]
[bacure.test.foreign-device :as fd]
[bacure.services :as services]
[bacure.network :as net]))
(defn init... |
907f949b74f4c705f3690ab3d69e762c9f3b150a450d47fcbd9d980bd276f1ee | caiorss/Functional-Programming | toupper-imp.hs |
-- file: ch07/toupper-imp.hs
import System.IO
import Data.Char(toUpper)
main :: IO ()
main = do
inh <- openFile "/etc/issue" ReadMode
outh <- openFile "/tmp/issue.out" WriteMode
mainloop inh outh
hClose inh
hClose outh
mainloop :: Handle -> Handle -> IO ()
mainloop inh outh =
do ineof <- hIsEOF inh
... | null | https://raw.githubusercontent.com/caiorss/Functional-Programming/ef3526898e3014e9c99bf495033ff36a4530503d/haskell/rwh/ch07/toupper-imp.hs | haskell | file: ch07/toupper-imp.hs |
import System.IO
import Data.Char(toUpper)
main :: IO ()
main = do
inh <- openFile "/etc/issue" ReadMode
outh <- openFile "/tmp/issue.out" WriteMode
mainloop inh outh
hClose inh
hClose outh
mainloop :: Handle -> Handle -> IO ()
mainloop inh outh =
do ineof <- hIsEOF inh
if ineof
then return (... |
59ce52c45d65a87b256786610dfcd6788332ed6913d8f9297fb8fb9c89e446b0 | zenspider/schemers | exercise.4.41.scm | #!/usr/bin/env csi -s
(require rackunit)
Exercise 4.41
;; Write an ordinary Scheme program to solve the multiple dwelling
;; puzzle.
;; no | null | https://raw.githubusercontent.com/zenspider/schemers/2939ca553ac79013a4c3aaaec812c1bad3933b16/sicp/ch_4/exercise.4.41.scm | scheme | Write an ordinary Scheme program to solve the multiple dwelling
puzzle.
no | #!/usr/bin/env csi -s
(require rackunit)
Exercise 4.41
|
0b20c376f219b3929b643a5d295fe6026fbd883ed19af9d5e828b40f4d49229d | goblint/analyzer | violation.ml | module type ViolationArg =
sig
include MyARG.S with module Edge = MyARG.InlineEdge
val prev: Node.t -> (Edge.t * Node.t) list
val violations: Node.t list
end
let find_sinks (type node) (module Arg:ViolationArg with type Node.t = node) =
let module NHT = BatHashtbl.Make (Arg.Node) in
let non_sinks = NHT.cre... | null | https://raw.githubusercontent.com/goblint/analyzer/35d5ac7c41f178776424330ddba5472976754239/src/witness/violation.ml | ocaml | DFS
TODO: avoid copying this to every Feasibility?
ignore (Pretty.printf "PATH: %s\n" (Arg.Node.to_string node2)); | module type ViolationArg =
sig
include MyARG.S with module Edge = MyARG.InlineEdge
val prev: Node.t -> (Edge.t * Node.t) list
val violations: Node.t list
end
let find_sinks (type node) (module Arg:ViolationArg with type Node.t = node) =
let module NHT = BatHashtbl.Make (Arg.Node) in
let non_sinks = NHT.cre... |
61178a8038fd5503d3eb759c30b9f2c5cc013adb02c17e951f39dc252ed55060 | evrim/core-server | tab.lisp | (in-package :core-server)
;; -------------------------------------------------------------------------
;; Tab Widget
;; -------------------------------------------------------------------------
(defcomponent <widget:tab (<core:tab <widget:simple)
())
| null | https://raw.githubusercontent.com/evrim/core-server/200ea8151d2f8d81b593d605b183a9cddae1e82d/src/web/widgets/tab.lisp | lisp | -------------------------------------------------------------------------
Tab Widget
------------------------------------------------------------------------- | (in-package :core-server)
(defcomponent <widget:tab (<core:tab <widget:simple)
())
|
e02c45fb847a3cce6c2883ccfbcc751e5a614aa81b3f879ac7fd18c82382138a | DanielG/ghc-mod | DynFlags.hs | # LANGUAGE TemplateHaskell #
# LANGUAGE StandaloneDeriving #
# LANGUAGE CPP #
module GhcMod.DynFlags where
import Control.Applicative
import Control.Monad
import GHC
import qualified GHC as G
import GHC.Paths (libdir)
import qualified GhcMod.Gap as Gap
import GhcMod.Types
import GhcMod.DebugLogger
import GhcMod.DynFl... | null | https://raw.githubusercontent.com/DanielG/ghc-mod/391e187a5dfef4421aab2508fa6ff7875cc8259d/core/GhcMod/DynFlags.hs | haskell | For orphans
* Fast
* Friendly to foreign export
* Not friendly to -XTemplateHaskell and -XPatternSynonyms
* Uses little memory
* Slow
* Not friendly to foreign export
* Friendly to -XTemplateHaskell and -XPatternSynonyms
* Uses lots of memory
--------------------------------------------------------------
-----... | # LANGUAGE TemplateHaskell #
# LANGUAGE StandaloneDeriving #
# LANGUAGE CPP #
module GhcMod.DynFlags where
import Control.Applicative
import Control.Monad
import GHC
import qualified GHC as G
import GHC.Paths (libdir)
import qualified GhcMod.Gap as Gap
import GhcMod.Types
import GhcMod.DebugLogger
import GhcMod.DynFl... |
bde39d81d7bc7ede8652b2e8a88e39998ffe138a3812ad9eb8be7f2d74ddc38f | tek/ribosome | RegisterType.hs | |Codec data type for Neovim register types .
module Ribosome.Data.RegisterType where
import Prettyprinter (Pretty (pretty))
import Ribosome.Host.Class.Msgpack.Decode (MsgpackDecode (..))
import Ribosome.Host.Class.Msgpack.Encode (MsgpackEncode (..))
import Ribosome.Host.Class.Msgpack.Util (decodeString)
|The typ... | null | https://raw.githubusercontent.com/tek/ribosome/4eb38f599b72450c93cac4a7b474247e478be1a8/packages/ribosome/lib/Ribosome/Data/RegisterType.hs | haskell | |Codec data type for Neovim register types .
module Ribosome.Data.RegisterType where
import Prettyprinter (Pretty (pretty))
import Ribosome.Host.Class.Msgpack.Decode (MsgpackDecode (..))
import Ribosome.Host.Class.Msgpack.Encode (MsgpackEncode (..))
import Ribosome.Host.Class.Msgpack.Util (decodeString)
|The typ... | |
e410c9c7a939078c6722ce9e34dbefac346572394763a0ee0f4dcaef7f4bd026 | timbertson/opam2nix | test_vars.ml | open OUnit2
open Opam2nix
module Name = OpamPackage.Name
let print_var = function
| Some v -> OpamVariable.string_of_variable_contents v
| None -> "None"
let test_path ocaml_version prefix name ?scope expected =
name >:: (fun _ ->
let scope = scope |> Option.map Name.of_string in
assert_equal ~printer:print_va... | null | https://raw.githubusercontent.com/timbertson/opam2nix/dee96eb1c706edc61e38df35240e0f707cfb800e/test_src/test_vars.ml | ocaml | open OUnit2
open Opam2nix
module Name = OpamPackage.Name
let print_var = function
| Some v -> OpamVariable.string_of_variable_contents v
| None -> "None"
let test_path ocaml_version prefix name ?scope expected =
name >:: (fun _ ->
let scope = scope |> Option.map Name.of_string in
assert_equal ~printer:print_va... | |
e177d6428316f4d047d6f0a260bec66ed206ba820307382ca5a9d131530ba2c8 | leopiney/tensor-safe | LSTM.hs | # LANGUAGE DataKinds #
{-# LANGUAGE GADTs #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
| This module declares the classing LSTM layer data type .
module TensorSafe.Layers.LSTM where
import Data.Kind (Type)
import Data.Map (fromList)
import Data.Proxy (Proxy (..))
import GHC.TypeLits (KnownNat, Nat... | null | https://raw.githubusercontent.com/leopiney/tensor-safe/cdf611dbbe68f6f6cb0b44fe31d86b28a547a3f2/src/TensorSafe/Layers/LSTM.hs | haskell | # LANGUAGE GADTs #
| A LSTM layer with a number of units and a option to return the original sequences. | # LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
| This module declares the classing LSTM layer data type .
module TensorSafe.Layers.LSTM where
import Data.Kind (Type)
import Data.Map (fromList)
import Data.Proxy (Proxy (..))
import GHC.TypeLits (KnownNat, Nat, natVal)
import Tensor... |
6c1d5e89f6f2593cac9bfbbbe48635dde503cfc816843eb14bb2302176a6ff30 | ocaml-ppx/ppx_tools_versioned | standalone.ml | open Migrate_parsetree
(* To run as a standalone binary, run the registered drivers *)
let () = Driver.run_main ()
| null | https://raw.githubusercontent.com/ocaml-ppx/ppx_tools_versioned/00a0150cdabfa7f0dad2c5e0e6b32230d22295ca/example/ppx_once/standalone.ml | ocaml | To run as a standalone binary, run the registered drivers | open Migrate_parsetree
let () = Driver.run_main ()
|
28f316b9fa1596fed43071c3ce649d4e3d24e0d00545c3c59ebc26ebed64609d | erlydtl/erlydtl | erlydtl_contrib_humanize.erl | -module(erlydtl_contrib_humanize).
-export([intcomma/1]).
intcomma(Value) when is_integer(Value) ->
intcomma(integer_to_list(Value));
intcomma(Value) ->
ValueBin = iolist_to_binary(Value),
intcomma(ValueBin, size(ValueBin) rem 3, <<>>).
intcomma(<<>>, _, Acc) ->
Acc;
intcomma(<< C, Rest/bits >>, 0, <... | null | https://raw.githubusercontent.com/erlydtl/erlydtl/c1f3df8379b09894d333de4e9a3ca2f3e260cba3/src/erlydtl_contrib_humanize.erl | erlang | -module(erlydtl_contrib_humanize).
-export([intcomma/1]).
intcomma(Value) when is_integer(Value) ->
intcomma(integer_to_list(Value));
intcomma(Value) ->
ValueBin = iolist_to_binary(Value),
intcomma(ValueBin, size(ValueBin) rem 3, <<>>).
intcomma(<<>>, _, Acc) ->
Acc;
intcomma(<< C, Rest/bits >>, 0, <... | |
795b114c59fddf40b0bdb596524949125b8cd741f8d9761d9084acb6fc1bf71d | plumatic/grab-bag | hash.clj | (ns plumbing.hash
(:import
[plumbing MurmurHash]))
This is OK for hash functions but bad for collisions -- 31 is too small .
IE 2 char strings on average collide with 8 others .
(defn hash64 ^long [s]
(loop [h 1125899906842597
s (seq (name s))]
(if s
(recur (unchecked-add (unchecked-multi... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/plumbing/src/plumbing/hash.clj | clojure | About the same speed, it seems, and many fewer collisions. | (ns plumbing.hash
(:import
[plumbing MurmurHash]))
This is OK for hash functions but bad for collisions -- 31 is too small .
IE 2 char strings on average collide with 8 others .
(defn hash64 ^long [s]
(loop [h 1125899906842597
s (seq (name s))]
(if s
(recur (unchecked-add (unchecked-multi... |
18f74c55cac64125b10de327675f0f09ebb28b532ba34f57251d11624a5a4eec | instedd/planwise | dashboard.cljs | (ns planwise.client.projects2.components.dashboard
(:require [reagent.core :as r]
[re-frame.core :refer [subscribe dispatch] :as rf]
[re-com.core :as rc]
[clojure.string :refer [blank? capitalize]]
[planwise.client.asdf :as asdf]
[planwise.client.components.... | null | https://raw.githubusercontent.com/instedd/planwise/21d28bf55216df3986e4f1b6cbb5fa86bb9f30ad/client/src/planwise/client/projects2/components/dashboard.cljs | clojure | Column 'Without coverage' displays `demand-source - population-under-coverage` | (ns planwise.client.projects2.components.dashboard
(:require [reagent.core :as r]
[re-frame.core :refer [subscribe dispatch] :as rf]
[re-com.core :as rc]
[clojure.string :refer [blank? capitalize]]
[planwise.client.asdf :as asdf]
[planwise.client.components.... |
c9029856fc0357f77c90832b27680dd90ba0d42ed46b58cf9d7be1a18f9999b4 | silky/quipper | Arith.hs | This file is part of Quipper . Copyright ( C ) 2011 - 2016 . Please see the
-- file COPYRIGHT for a list of authors, copyright holders, licensing,
-- and other details. All rights reserved.
--
-- ======================================================================
import Quipper
import QuipperLib.Arith
main :: I... | null | https://raw.githubusercontent.com/silky/quipper/1ef6d031984923d8b7ded1c14f05db0995791633/tests/Arith.hs | haskell | file COPYRIGHT for a list of authors, copyright holders, licensing,
and other details. All rights reserved.
====================================================================== | This file is part of Quipper . Copyright ( C ) 2011 - 2016 . Please see the
import Quipper
import QuipperLib.Arith
main :: IO ()
main = print_generic Preview labelled_add (qdint_shape 3) (qdint_shape 3)
labelled_add :: QDInt -> QDInt -> Circ (QDInt, QDInt,QDInt)
labelled_add x y = do
label (x,y) ("x","y")
xy ... |
854ed9dfaab44002ce2f50ec49aa944471ab09a0de118f103f1f9e2122583149 | antono/guix-debian | nano.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2012 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU 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 Lice... | null | https://raw.githubusercontent.com/antono/guix-debian/85ef443788f0788a62010a942973d4f7714d10b4/gnu/packages/nano.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2012 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages nano)
#:use-module (guix licenses)
#:use-module (gnu packages gettext)
#:use-mo... |
9fe57138ecd0501893baa526b9b219231ebe2b17eeb9582020e419196f43be68 | kupl/FixML | sub5.ml | type crazy2 = NIL | ZERO of crazy2 | ONE of crazy2 | MONE of crazy2
exception E
let rec crazy2add (a, b) =
let rec add (a, b) =
match (a, b) with
(ZERO c, ZERO d) -> ZERO(crazy2add(c, d))
|(ONE c, MONE d) -> ZERO(crazy2add(c, d))
|(MONE c, ONE d) -> ZERO(crazy2add(c, d))
| (ZERO c, ONE d) ->ONE(crazy2add(c,... | null | https://raw.githubusercontent.com/kupl/FixML/0a032a733d68cd8ccc8b1034d2908cd43b241fce/benchmarks/crazy2add/crazy2add/submissions/sub5.ml | ocaml | type crazy2 = NIL | ZERO of crazy2 | ONE of crazy2 | MONE of crazy2
exception E
let rec crazy2add (a, b) =
let rec add (a, b) =
match (a, b) with
(ZERO c, ZERO d) -> ZERO(crazy2add(c, d))
|(ONE c, MONE d) -> ZERO(crazy2add(c, d))
|(MONE c, ONE d) -> ZERO(crazy2add(c, d))
| (ZERO c, ONE d) ->ONE(crazy2add(c,... | |
90d65c88e5206a0a28920b38f1c73e6b263fb6ff906bb45a162b0570cb4b0614 | alanz/ghc-exactprint | SemicolonIf.hs | module Bar where
import Data.Text as Text
replace :: Text -> Text
replace = Text.map (\c -> if c == '_' then '.'; else c)
replace1 :: Text -> Text
replace1 = Text.map (\c -> if c == '_' ; then '.' else c)
replace2 :: Text -> Text
replace2 = Text.map (\c -> if c == '_'; then '.'; else c)
replace4 :: Text -> Text
re... | null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc80/SemicolonIf.hs | haskell | module Bar where
import Data.Text as Text
replace :: Text -> Text
replace = Text.map (\c -> if c == '_' then '.'; else c)
replace1 :: Text -> Text
replace1 = Text.map (\c -> if c == '_' ; then '.' else c)
replace2 :: Text -> Text
replace2 = Text.map (\c -> if c == '_'; then '.'; else c)
replace4 :: Text -> Text
re... | |
c188b9841fe7b2abc22764e8984821c0b1620057bb7ba381b99cdd918944c933 | graninas/Hydra | Interpreters.hs | module Hydra.Core.Interpreters
( module X
) where
import Hydra.Core.ControlFlow.Interpreter as X
import Hydra.Core.Lang.Interpreter as X
import Hydra . Core . Logger . Interpreter as X
import Hydra.Core.Process.Interpreter as X
import Hydra.Core... | null | https://raw.githubusercontent.com/graninas/Hydra/60d591b1300528f5ffd93efa205012eebdd0286c/lib/hydra-church-free/src/Hydra/Core/Interpreters.hs | haskell | module Hydra.Core.Interpreters
( module X
) where
import Hydra.Core.ControlFlow.Interpreter as X
import Hydra.Core.Lang.Interpreter as X
import Hydra . Core . Logger . Interpreter as X
import Hydra.Core.Process.Interpreter as X
import Hydra.Core... | |
8c6fa4cb72a187c937be266eab06f75e7e4bb6e056c3f3f12df47c548d5869ec | jwiegley/notes | Simple.hs | sourceGenerator :: Monad m
=> (forall s. ((Generator s -> Source m (Generatee s)) -> m a))
-> m a
sourceGenerator f = f $ \gen -> source (go gen)
where
go start z yield = loop start z
where
loop gen r =
let (gen', g) = generate gen
in yield r g... | null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/gists/6e2665b62008f020b881/Simple.hs | haskell | sourceGenerator :: Monad m
=> (forall s. ((Generator s -> Source m (Generatee s)) -> m a))
-> m a
sourceGenerator f = f $ \gen -> source (go gen)
where
go start z yield = loop start z
where
loop gen r =
let (gen', g) = generate gen
in yield r g... | |
f2783edb1e707f935a36e4b9baa9f4fff78653c24924a8aa005fe8874a0b6263 | odis-labs/helix | Html.mli | (** Build HTML content. *)
open Stdweb
type node = Dom.Node.t
type html
(** The type for HTML elements or character data. *)
* { 1 : attr Attributes }
See the { { : -US/docs/Web/HTML/Attributes } MDN
HTML attribute reference } .
See the {{:-US/docs/Web/HTML/Attributes} MDN
HTML attribute refer... | null | https://raw.githubusercontent.com/odis-labs/helix/365259b9d20a391fe94c7adffbd158fdec4d7f0c/src/html/Html.mli | ocaml | * Build HTML content.
* The type for HTML elements or character data.
* The type for attributes and their values.
* [attr name v] is an attribute [name] with value [v].
* See {{:-US/docs/Web/HTML/Attributes/accept}
accept}.
* See
{{:-US/docs/Web/HTML/Global_attributes/accesskey}
accesskey}.
* See
... |
open Stdweb
type node = Dom.Node.t
type html
* { 1 : attr Attributes }
See the { { : -US/docs/Web/HTML/Attributes } MDN
HTML attribute reference } .
See the {{:-US/docs/Web/HTML/Attributes} MDN
HTML attribute reference}. *)
type attr
val attr : string -> string -> attr
val accept : string -... |
d3516c7fd8bc28a28e4b9b213e481f72920c161e20f504288483ee8560dfad6f | endobson/racket-grpc | status.rkt | #lang racket/base
(provide
ok-status
status-code
status-message
status?)
(struct status (code message) #:transparent)
(define ok-status (status 'ok ""))
| null | https://raw.githubusercontent.com/endobson/racket-grpc/7f3cca4b66f71490236c8db40f0011595f890fa0/status.rkt | racket | #lang racket/base
(provide
ok-status
status-code
status-message
status?)
(struct status (code message) #:transparent)
(define ok-status (status 'ok ""))
| |
ba1ef4539af021b90a34d44673651bf8003eadaed02dab22f2f47cc8d18c79c9 | racket/rhombus-prototype | syntax-meta-value.rkt | #lang racket/base
(require (for-syntax racket/base
syntax/parse/pre))
(provide (for-syntax Syntax.meta_value))
(begin-for-syntax
(define Syntax.meta_value
(case-lambda
[(id/op)
(define id (extract-operator id/op))
(unless id
(raise-argument-error 'syntax_meta_va... | null | https://raw.githubusercontent.com/racket/rhombus-prototype/dcf7fb9b002c0957fc0adbf9bd3475c26a8b2c01/rhombus/private/syntax-meta-value.rkt | racket | #lang racket/base
(require (for-syntax racket/base
syntax/parse/pre))
(provide (for-syntax Syntax.meta_value))
(begin-for-syntax
(define Syntax.meta_value
(case-lambda
[(id/op)
(define id (extract-operator id/op))
(unless id
(raise-argument-error 'syntax_meta_va... | |
25ea512af3fc69fd549db714b178d3319550e35e2d03b4cc6fba916bf599b444 | GaloisInc/pate | PairGraph.hs | # LANGUAGE DataKinds #
{-# LANGUAGE GADTs #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeApplications #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
# LANGUA... | null | https://raw.githubusercontent.com/GaloisInc/pate/a48c447156d95686c308a6d5ec696464120e0970/src/Pate/Verification/PairGraph.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE MultiWayIf #
# LANGUAGE RankNTypes #
| Gas is used to ensure that our fixpoint computation terminates
we widen an abstract domain along a control flow path
from some particular slice. It is intended to only
be used along loops or recursive cycles. Right now,
under the assump... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeApplications #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
# LANGUAGE PatternSynonyms #
module Pate.Verification.PairGraph
( Gas(..)
, initi... |
7dbff36de3656a0c15652e11da2eb888d49143421c7b983acf004ccaf4652972 | morphismtech/squeal | Exception.hs | |
Module : Squeal . PostgreSQL.Session . Exception
Description : exceptions
Copyright : ( c ) , 2019
Maintainer :
Stability : experimental
exceptions
Module: Squeal.PostgreSQL.Session.Exception
Description: exceptions
Copyright: (c) Eitan Chatav, 2019
Maintainer:
Stability: experimental
exceptions
-... | null | https://raw.githubusercontent.com/morphismtech/squeal/a639fea5e48a1d3cecc9e0f296e97c1c82f16e97/squeal-postgresql/src/Squeal/PostgreSQL/Session/Exception.hs | haskell | $setup
>>> import Squeal.PostgreSQL
^ -appendix.html
| `Exception`s that can be thrown by Squeal.
^ SQL exception state
^ `Database.PostgreSQL.LibPQ` function connection exception
^ decoding exception function and error message
^ unexpected number of columns
^ too few rows, expected at least and actual number ... | |
Module : Squeal . PostgreSQL.Session . Exception
Description : exceptions
Copyright : ( c ) , 2019
Maintainer :
Stability : experimental
exceptions
Module: Squeal.PostgreSQL.Session.Exception
Description: exceptions
Copyright: (c) Eitan Chatav, 2019
Maintainer:
Stability: experimental
exceptions
-... |
5e1bfcf4ce603567669db7828726ae3083aac7d6a678c67526bcec0eb30f18c6 | webyrd/n-grams-for-synthesis | teaselp_demo_expert_ordering.scm | (define *output-table-file-name* "tmp/variant-expert-ordering-with-application-and-lookup-optimizations-table.scm")
(define allow-incomplete-search? #f)
(define lookup-optimization? #t)
(load "mk-vicare.scm")
(load "mk.scm")
(load "test-check.scm")
(load "interp-app-optimization.scm")
(load "construct-ordering.scm")... | null | https://raw.githubusercontent.com/webyrd/n-grams-for-synthesis/b53b071e53445337d3fe20db0249363aeb9f3e51/teaselp_demo_expert_ordering.scm | scheme | (define *output-table-file-name* "tmp/variant-expert-ordering-with-application-and-lookup-optimizations-table.scm")
(define allow-incomplete-search? #f)
(define lookup-optimization? #t)
(load "mk-vicare.scm")
(load "mk.scm")
(load "test-check.scm")
(load "interp-app-optimization.scm")
(load "construct-ordering.scm")... | |
2b1f78b7477e0e81c7bd727f91e63ed3ce9dca23d88ee1608792b8f94e1608dc | Plutonomicon/plutarch-plutus | TypeFamily.hs | # LANGUAGE UndecidableInstances #
module Plutarch.Internal.TypeFamily (ToPType, ToPType2, UnTerm, Snd) where
import Data.Kind (Type)
import GHC.TypeLits (ErrorMessage (Text), TypeError)
import Plutarch.Internal (PType, Term)
-- | Convert a list of `Term s a` to a list of `a`.
type ToPType :: [Type] -> [PType]
type f... | null | https://raw.githubusercontent.com/Plutonomicon/plutarch-plutus/d3df05ce67d8b5a3d2ca851a6e5a1b8ff8cb358f/Plutarch/Internal/TypeFamily.hs | haskell | | Convert a list of `Term s a` to a list of `a`. | # LANGUAGE UndecidableInstances #
module Plutarch.Internal.TypeFamily (ToPType, ToPType2, UnTerm, Snd) where
import Data.Kind (Type)
import GHC.TypeLits (ErrorMessage (Text), TypeError)
import Plutarch.Internal (PType, Term)
type ToPType :: [Type] -> [PType]
type family ToPType as where
ToPType '[] = '[]
ToPType... |
e538e64016f7919b3bb6b1f35b75be671525b6b4ea6715bf96e214d8769f27d6 | zcaudate/hara | seq.clj | (ns hara.data.base.seq)
(defn positions
"find positions of elements matching the predicate
(positions even? [5 5 4 4 3 3 2 2])
=> [2 3 6 7]"
{:added "3.0"}
[pred coll]
(keep-indexed (fn [idx x]
(when (pred x)
idx))
coll))
(defn remove-index
"remo... | null | https://raw.githubusercontent.com/zcaudate/hara/481316c1f5c2aeba5be6e01ae673dffc46a63ec9/src/hara/data/base/seq.clj | clojure | (ns hara.data.base.seq)
(defn positions
"find positions of elements matching the predicate
(positions even? [5 5 4 4 3 3 2 2])
=> [2 3 6 7]"
{:added "3.0"}
[pred coll]
(keep-indexed (fn [idx x]
(when (pred x)
idx))
coll))
(defn remove-index
"remo... | |
9d02a5cec10c7dc944f1a22bee8c13e6bcc9347280e763025e7bfd7f4bc50de0 | cedlemo/OCaml-libmpdclient | mpd_lwt_client_idle_loop.ml |
* Copyright 2017 ,
* This file is part of .
*
* OCaml - libmpdclient 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
* h : noh::j
* any lat... | null | https://raw.githubusercontent.com/cedlemo/OCaml-libmpdclient/49922f4fa0c1471324c613301675ffc06ff3147c/samples/mpd_lwt_client_idle_loop.ml | ocaml | Simple client that connects to a mpd server with the "idle" command and get
* all the events of the mpd server.
* Leave with Crtl+C |
* Copyright 2017 ,
* This file is part of .
*
* OCaml - libmpdclient 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
* h : noh::j
* any lat... |
0e7eb0e54ce9c0ad76b5692a4679cbbdf64ef7d423f758454f69f7708e203693 | 8c6794b6/haskell-sc-scratch | Server3.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE DeriveDataTypeable #-}
|
Module : $ Header$
CopyRight : ( c ) 8c6794b6
License : :
Stability : unstable
Portability : non - portable ( GHC concurrency , DeriveDataTypeable )
Server to manage patterns , take 3 .
Using TVar instead of MVar ,... | null | https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/hsc3-lepton/src/lib/Sound/SC3/Lepton/Pattern/Server3.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE DeriveDataTypeable #
----------------------------------------------------------------------------
* Types
----------------------------------------------------------------------------
* Guts
XXX: Why not ReaderT IO?
I thought wrapping with monad transformer makes the code slow.
... | |
Module : $ Header$
CopyRight : ( c ) 8c6794b6
License : :
Stability : unstable
Portability : non - portable ( GHC concurrency , DeriveDataTypeable )
Server to manage patterns , take 3 .
Using TVar instead of MVar , not using ReaderMonad .
Module : $Header$
CopyRight : (... |
75acd96827c78d7437a61cf4df25d5032d124c7bfa07de8463fc9e1444351b55 | openbadgefactory/salava | async.clj | (ns salava.social.async
(:require [salava.social.db :as db]
[salava.core.util :refer [publish]]))
(defn subscribe [ctx]
{:event (fn [data] (db/insert-social-event! ctx data))})
| null | https://raw.githubusercontent.com/openbadgefactory/salava/97f05992406e4dcbe3c4bff75c04378d19606b61/src/clj/salava/social/async.clj | clojure | (ns salava.social.async
(:require [salava.social.db :as db]
[salava.core.util :refer [publish]]))
(defn subscribe [ctx]
{:event (fn [data] (db/insert-social-event! ctx data))})
| |
7d8414e615d5ca57a4ddee981cc7981064f831818fce2e43695c63912801fa4a | joinr/clclojure | keywordfunc.lisp | ;;This is a legacy implementation of keywords-as-functions.
;;We'll probably revisit this.
(defpackage :clclojure.keywordfunc
(:use :common-lisp ;:clclojure.base
:common-utils)
(:export :keyfn? :key-accessor :->keyaccess :keyaccess-func :keyaccess-key :with-keyfn))
(in-package :clclojure.keywordfunc)
(d... | null | https://raw.githubusercontent.com/joinr/clclojure/8b51214891c4da6dfbec393dffac70846ee1d0c5/keywordfunc.lisp | lisp | This is a legacy implementation of keywords-as-functions.
We'll probably revisit this.
:clclojure.base
this is the general template for implementing
keyword access...
new-value))
for localized keyaccess, i.e. inside
lets and friends....
keyaccessors print like keywords.
now, to get the last step of "real" keyw... | (defpackage :clclojure.keywordfunc
:common-utils)
(:export :keyfn? :key-accessor :->keyaccess :keyaccess-func :keyaccess-key :with-keyfn))
(in-package :clclojure.keywordfunc)
(defparameter keyfns (make-hash-table))
(defun keyfn? (k)
(gethash k keyfns))
( defun : a ( m ) ( gethash : a m ) )
( defu... |
175f6538c9fafcbef31b748e38901512dd5b5d7102ab3da8b91e2bba75bef1ba | microsoftarchive/clj-bugsnag | core.clj | (ns clj-bugsnag.core
(:require [clj-stacktrace.core :refer [parse-exception]]
[clj-stacktrace.repl :refer [method-str]]
[clojure.java.shell :refer [sh]]
[clj-http.client :as http]
[environ.core :refer [env]]
[clojure.data.json :as json]
[clojure.... | null | https://raw.githubusercontent.com/microsoftarchive/clj-bugsnag/28aa693d548720fb36e1adfd968e413639be30e8/src/clj_bugsnag/core.clj | clojure | (ns clj-bugsnag.core
(:require [clj-stacktrace.core :refer [parse-exception]]
[clj-stacktrace.repl :refer [method-str]]
[clojure.java.shell :refer [sh]]
[clj-http.client :as http]
[environ.core :refer [env]]
[clojure.data.json :as json]
[clojure.... | |
adb7cbc2c72f3a12fea1c521d16789daf65e4f5785b87a92569a75123fbd6f00 | kupl/LearnML | patch.ml | type formula =
| True
| False
| Not of formula
| AndAlso of (formula * formula)
| OrElse of (formula * formula)
| Imply of (formula * formula)
| Equal of (exp * exp)
and exp = Num of int | Plus of (exp * exp) | Minus of (exp * exp)
let rec eval_op (op : exp) : int =
match op with
| Num a -> a
| Mi... | null | https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/formula/sub50/patch.ml | ocaml | type formula =
| True
| False
| Not of formula
| AndAlso of (formula * formula)
| OrElse of (formula * formula)
| Imply of (formula * formula)
| Equal of (exp * exp)
and exp = Num of int | Plus of (exp * exp) | Minus of (exp * exp)
let rec eval_op (op : exp) : int =
match op with
| Num a -> a
| Mi... | |
31da0369bfd8b4b2cde310db2dd80691c68151c7a2ec0220a83f1cb55381542d | skinkade/uniformity | rsa.cljs | (ns uniformity.internals.js.rsa
(:require [uniformity.internals.js.node-browser-compat :refer [crypto-type crypto]]
[cljs.core.async :refer [go chan <! put!]]
[cljs.core.async.interop :refer [p->c]]
[async-error.core :refer-macros [go-try <?]]))
(def subtle (.-subtle crypto))
(de... | null | https://raw.githubusercontent.com/skinkade/uniformity/e9d007a7be833e70b4358c02700fd81866de775a/src/uniformity/internals/js/rsa.cljs | clojure | (ns uniformity.internals.js.rsa
(:require [uniformity.internals.js.node-browser-compat :refer [crypto-type crypto]]
[cljs.core.async :refer [go chan <! put!]]
[cljs.core.async.interop :refer [p->c]]
[async-error.core :refer-macros [go-try <?]]))
(def subtle (.-subtle crypto))
(de... | |
a4b9baefd4f586c09eba63b49914aa3d1b5c9666ab8efdafb70827a169eb4529 | AccelerateHS/accelerate | Stats.hs | # LANGUAGE CPP #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - unused - binds #
# OPTIONS_GHC -fno - warn - unused - imports #
-- |
-- Module : Data.Array.Accelerate.Debug.Internal.Stats
Copyright : [ 2008 .. 2020 ] The Accelerate Team
-- Lice... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate/80a9d9aa13609f895540d4859c0a8691cff6d2e3/src/Data/Array/Accelerate/Debug/Internal/Stats.hs | haskell | # LANGUAGE OverloadedStrings #
|
Module : Data.Array.Accelerate.Debug.Internal.Stats
License : BSD3
Stability : experimental
Tick-count statistics collection of the compiler passes, for debugging
purposes.
Recording statistics
--------------------
Add an entry to the statistics counters
Add an ... | # LANGUAGE CPP #
# LANGUAGE LambdaCase #
# OPTIONS_GHC -fno - warn - unused - binds #
# OPTIONS_GHC -fno - warn - unused - imports #
Copyright : [ 2008 .. 2020 ] The Accelerate Team
Maintainer : < >
Portability : non - portable ( GHC extensions )
module Data.Array.Accelerate.De... |
fb06458001cf931afa9d5d73feeb4d75b84f7484854ed3178cf139f7d643482e | mzp/coq-ruby | gset.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/lib/gset.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
Sets using the generic comparison f... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$ I d : gset.ml 5920 2004... |
7363e3736ae3b01bb23ad0d86ae89923773f703d522decc730988dbc384e63f1 | mjambon/atdgen | test_atdgen_type_conv.ml | open Sexplib.Std
let my_record = Test_type_conv_t.({ fst=123; snd="testing" })
let cmrs : (float Test_type_conv_t.contains_my_record) list =
let open Test_type_conv_t in
[ `C1 123
; `C2 123.0
; `C3 my_record ]
let sexps =
[my_record |> Test_type_conv_t.sexp_of_my_record] @
(List.map (Test_type_conv_t.sex... | null | https://raw.githubusercontent.com/mjambon/atdgen/9b031da2f182a1fa60bc76ff3a3228ff7b45a8a3/test/test_atdgen_type_conv.ml | ocaml | open Sexplib.Std
let my_record = Test_type_conv_t.({ fst=123; snd="testing" })
let cmrs : (float Test_type_conv_t.contains_my_record) list =
let open Test_type_conv_t in
[ `C1 123
; `C2 123.0
; `C3 my_record ]
let sexps =
[my_record |> Test_type_conv_t.sexp_of_my_record] @
(List.map (Test_type_conv_t.sex... | |
46744790493b32a61a1b88dcf7954b1adf7657cdac444ae58c145504fc727113 | ThoughtWorksInc/stonecutter | user_list.clj | (ns stonecutter.view.user-list
(:require [net.cgrand.enlive-html :as html]
[stonecutter.view.view-helpers :as vh]
[stonecutter.routes :as r]
[stonecutter.config :as config]))
(def library-m (vh/load-template "public/library.html"))
(def empty-user-list-item (first (html/select li... | null | https://raw.githubusercontent.com/ThoughtWorksInc/stonecutter/37ed22dd276ac652176c4d880e0f1b0c1e27abfe/src/stonecutter/view/user_list.clj | clojure | (ns stonecutter.view.user-list
(:require [net.cgrand.enlive-html :as html]
[stonecutter.view.view-helpers :as vh]
[stonecutter.routes :as r]
[stonecutter.config :as config]))
(def library-m (vh/load-template "public/library.html"))
(def empty-user-list-item (first (html/select li... | |
0e10767c12cd76224083a03a21320010a0afd6dc08be263ca38a14d47acbe8ab | jaredly/reason-language-server | runtimedef.ml | let builtin_exceptions = [|
"Out_of_memory";
"Sys_error";
"Failure";
"Invalid_argument";
"End_of_file";
"Division_by_zero";
"Not_found";
"Match_failure";
"Stack_overflow";
"Sys_blocked_io";
"Assert_failure";
"Undefined_recursive_module";
|]
let builtin_primitives = [|
"caml_abs_float";
"caml... | null | https://raw.githubusercontent.com/jaredly/reason-language-server/ce1b3f8ddb554b6498c2a83ea9c53a6bdf0b6081/ocaml_typing/407/runtimedef.ml | ocaml | let builtin_exceptions = [|
"Out_of_memory";
"Sys_error";
"Failure";
"Invalid_argument";
"End_of_file";
"Division_by_zero";
"Not_found";
"Match_failure";
"Stack_overflow";
"Sys_blocked_io";
"Assert_failure";
"Undefined_recursive_module";
|]
let builtin_primitives = [|
"caml_abs_float";
"caml... | |
98064a51e74620a5a7f34993f686b997594ffcf2d6a4f968981d403c2f446e57 | spawnfest/eep49ers | xmerl_sax_stream_SUITE.erl | %%-*-erlang-*-
%%----------------------------------------------------------------------
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2017 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may ... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/xmerl/test/xmerl_sax_stream_SUITE.erl | erlang | -*-erlang-*-
----------------------------------------------------------------------
%CopyrightBegin%
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 CON... | Copyright Ericsson AB 2017 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(xmerl_sax_stream_SUITE).
-compile(export_all).
-include_lib("common_test/include/ct.hrl").
-include_lib("kernel/inc... |
3107186d94945ec8188d2bf75e2e0ff3a79d36a235354ccfa9bf58308142eba0 | EasyCrypt/easycrypt | ecAlgTactic.mli | (* -------------------------------------------------------------------- *)
open EcSymbols
open EcTypes
open EcDecl
open EcFol
open EcAlgebra
open EcCoreGoal
(* -------------------------------------------------------------------- *)
val is_module_loaded : EcEnv.env -> bool
(* ------------------------------------------... | null | https://raw.githubusercontent.com/EasyCrypt/easycrypt/f87695472e70c313ef2966e20979b1afcc2e543e/src/ecAlgTactic.mli | ocaml | --------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
-----------------------------------... | open EcSymbols
open EcTypes
open EcDecl
open EcFol
open EcAlgebra
open EcCoreGoal
val is_module_loaded : EcEnv.env -> bool
val ring_symbols : EcEnv.env -> EcDecl.rkind -> ty -> (symbol * (bool * ty)) list
val field_symbols : EcEnv.env -> ty -> (symbol * (bool * ty)) list
val ring_axioms : EcEnv.env -> ring -> (sy... |
e5d775dac0a83dbb7fed6cd7fed72f4104bdf934e4d90c1c6be486d8c6f97965 | derui/okeyfum | environment_test.ml | open Okeyfum
let tests =
[
( "OKeyfum environment can change state of lock",
`Quick,
fun () ->
let module E = Okeyfum_environment in
let e = E.make Okeyfum_config.Config.empty in
let e = E.lock_state_lock ~env:e ~name:"foo" in
Alcotest.(check @@ list string) "state" [ ... | null | https://raw.githubusercontent.com/derui/okeyfum/bc47c0bea35c00d720dcde0200256a3f2e1312bd/test/environment_test.ml | ocaml | open Okeyfum
let tests =
[
( "OKeyfum environment can change state of lock",
`Quick,
fun () ->
let module E = Okeyfum_environment in
let e = E.make Okeyfum_config.Config.empty in
let e = E.lock_state_lock ~env:e ~name:"foo" in
Alcotest.(check @@ list string) "state" [ ... | |
97ccd19f508d321599d26e854cee75aac829d5563f9967ad22b113e5856d4aeb | tomjridge/imp_fs | v2_main.ml | * Run the v2 example , using a ( somewhat hairy ) combination of
and Lwt
and Lwt *)
open Tjr_monad.With_lwt
open Shared_ctxt
let argv = Sys.argv |> Array.to_list |> List.tl
FIXME move to config
let fn = "./tmp/v2.store"
(* debug line reached *)
let line s = Printf.printf "Reached %s\n%!" s
(** Create t... | null | https://raw.githubusercontent.com/tomjridge/imp_fs/ba86e8e9204c59b18f041bf21332a2a4846ae20b/bin/v2_main.ml | ocaml | debug line reached
* Create the filesystem
Block device
Test_blk_dev.make () |> fun bd ->
* Restore, but don't mount
Block device
Test_blk_dev.restore () |> fun bd ->
an lwt thread that just keeps going...
run lwt in another thread
* NOTE main thread deals with fuse
* Initialize filesystem operations... | * Run the v2 example , using a ( somewhat hairy ) combination of
and Lwt
and Lwt *)
open Tjr_monad.With_lwt
open Shared_ctxt
let argv = Sys.argv |> Array.to_list |> List.tl
FIXME move to config
let fn = "./tmp/v2.store"
let line s = Printf.printf "Reached %s\n%!" s
module Create() = struct
let m =... |
5460b1b660d73a5cb187de2a299eac33110e3a6290a8c8df6d43f56479faf0f4 | loguntsov/reliable_udp | gen_rudp.erl | -module(gen_rudp).
-author("Sergey Loguntsov <>").
%% API
-export([
start_listener/2, start_listener/1,
stop_listener/1,
connect/4, connect/5,
close/1,
accept/2, accept/1,
is_alive/1, is_connected/1,
controlling_process/2,
async_send_binary/2, sync_send_binary/3,
send_udp/2
]).
-include("listener.hr... | null | https://raw.githubusercontent.com/loguntsov/reliable_udp/6544c08a551397182f33ca89ce2ff1db470a0daa/src/gen_rudp.erl | erlang | API
-define(WORKERS, rudp_app:env(workers_for_each_port)). | -module(gen_rudp).
-author("Sergey Loguntsov <>").
-export([
start_listener/2, start_listener/1,
stop_listener/1,
connect/4, connect/5,
close/1,
accept/2, accept/1,
is_alive/1, is_connected/1,
controlling_process/2,
async_send_binary/2, sync_send_binary/3,
send_udp/2
]).
-include("listener.hrl").
-i... |
6b6163006f763b8ed246cf546a3f47dbe806d4189238ad748249df8d2a00407a | biocom-uib/vpf-tools | VirusClass.hs | # options_ghc -Wno - partial - type - signatures #
# language ApplicativeDo #
# language BlockArguments #
# language DeriveGeneric #
{-# language DerivingVia #-}
{-# language PartialTypeSignatures #-}
# language OverloadedLabels #
# language StaticPointers #
{-# language Strict #-}
module VPF.Model.VirusClass where
im... | null | https://raw.githubusercontent.com/biocom-uib/vpf-tools/11abf5645f0b155e20d13a398fb74f2e75f4b4a9/src/VPF/Model/VirusClass.hs | haskell | # language DerivingVia #
# language PartialTypeSignatures #
# language Strict #
asynchronous versions
we don't want concurrent writes
stopping/resuming from checkpoints
run the whole process | # options_ghc -Wno - partial - type - signatures #
# language ApplicativeDo #
# language BlockArguments #
# language DeriveGeneric #
# language OverloadedLabels #
# language StaticPointers #
module VPF.Model.VirusClass where
import GHC.Generics (Generic)
import Control.Carrier.Error.Excepts (ExceptsT, runExceptsT, Er... |
0aa4210fffc124bbef5b08182f0c38ba54e9b0365a72adb650a031e44ad7cf00 | haskell/cabal | TH.hs | # LANGUAGE TemplateHaskell #
module TH where
import Language.Haskell.TH (ExpQ)
splice :: ExpQ
splice = [| () |]
| null | https://raw.githubusercontent.com/haskell/cabal/00a2351789a460700a2567eb5ecc42cca0af913f/cabal-testsuite/PackageTests/TemplateHaskell/vanilla/TH.hs | haskell | # LANGUAGE TemplateHaskell #
module TH where
import Language.Haskell.TH (ExpQ)
splice :: ExpQ
splice = [| () |]
| |
9af154f3102ac80c8ac411cf656f19143cd06400a2aa966ac65d86bc60f460cd | jeromesimeon/Galax | cs_code_typing_top.ml | (***********************************************************************)
(* *)
(* GALAX *)
(* XQuery Engine *)
(* ... | null | https://raw.githubusercontent.com/jeromesimeon/Galax/bc565acf782c140291911d08c1c784c9ac09b432/code_selection/cs_code_typing_top.ml | ocaml | *********************************************************************
GALAX
XQuery Engine
... | Copyright 2001 - 2007 .
$ I d : , v 1.47 2007/10/16 01:25:34
open Code_selection_context
open Code_typing_context
open Xquery_algebra_ast
open Xquery_algebra_ast_util
open Xquery_physical_type_ast
open Xquery_physical_type_ast_util
open Xquery_physical_algebra... |
989e15fbf2742216e7a9ab08a6f14bc841de1db200be3e17f961a2fc19b5f227 | metosin/jsonista | tagged_test.clj | (ns jsonista.tagged-test
(:require [clojure.test :refer [deftest is testing]]
[jsonista.core :as j]
[jsonista.tagged :as jt])
(:import (clojure.lang Keyword PersistentHashSet)))
(deftest tagged-value-test
(let [mapper (j/object-mapper {:modules [(jt/module
... | null | https://raw.githubusercontent.com/metosin/jsonista/2a17eeb78ed1d10b037494da41a15a21a1a026d6/test/jsonista/tagged_test.clj | clojure | (ns jsonista.tagged-test
(:require [clojure.test :refer [deftest is testing]]
[jsonista.core :as j]
[jsonista.tagged :as jt])
(:import (clojure.lang Keyword PersistentHashSet)))
(deftest tagged-value-test
(let [mapper (j/object-mapper {:modules [(jt/module
... | |
cf204b4e39d14b62751a5b420cdc2dafc87078163e385b356a9ccf8c5eab13a9 | binsec/binsec | kernel_options.mli | (**************************************************************************)
This file is part of BINSEC .
(* *)
Copyright ( C ) 2016 - 2022
CEA ( Co... | null | https://raw.githubusercontent.com/binsec/binsec/8ed9991d36451a3ae7487b966c4b38acca21a5b3/src/kernel/kernel_options.mli | ocaml | ************************************************************************
alternatives)
you can redistribute it an... | This file is part of BINSEC .
Copyright ( C ) 2016 - 2022
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , ve... |
6232284841416accfcd5e9ae97fa6eddc452a4835e63630ebb32684039fb8433 | processone/ejabberd | ejabberd_logger.erl | %%%-------------------------------------------------------------------
%%% File : ejabberd_logger.erl
Author : < >
%%% Purpose : ejabberd logger wrapper
Created : 12 May 2013 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2013 - 2023 ProcessOne
%%%
%%% This program is free software; you can redistribute ... | null | https://raw.githubusercontent.com/processone/ejabberd/c103182bc7e5b8a8ab123ce02d1959a54e939480/src/ejabberd_logger.erl | erlang | -------------------------------------------------------------------
File : ejabberd_logger.erl
Purpose : ejabberd logger wrapper
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but ... | Author : < >
Created : 12 May 2013 by < >
ejabberd , Copyright ( C ) 2013 - 2023 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
... |
952c39067382e06e0d5abfe9c38c73a59b2418047c4454a12ad315670b91b5e0 | rizo/snowflake-os | liveness.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/plugins/ocamlopt.opt/asmcomp/liveness.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ Id$
Liveness analysis .
Ann... |
0500d4ea267c6e9703ac88859ffe96017c93369d7fe4e68296a021080bbeca29 | Clozure/ccl | constants.lisp | ;;;
;;; Copyright 2016 Clozure Associates
;;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;;; you may not use this file except in compliance with the License.
;;; You may obtain a copy of the License at
;;;
;;; -2.0
;;;
;;; Unless required by applicable law or agreed to in writing, softw... | null | https://raw.githubusercontent.com/Clozure/ccl/6c1a9458f7a5437b73ec227e989aa5b825f32fd3/cocoa-ide/constants.lisp | lisp |
Copyright 2016 Clozure Associates
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for... | distributed under the License is distributed on an " AS IS " BASIS ,
(in-package "GUI")
(defconstant $inspect-item-tag 0)
(defconstant $source-item-tag 1)
|
079c3998a3e5e155234b8c2638344367d91677ad3a23f2d71f7fb90e4f8fede5 | erlang/rebar3 | rebar_state.erl | -module(rebar_state).
-export([new/0, new/1, new/2, new/3,
get/2, get/3, set/3,
format_error/1,
has_all_artifacts/1,
code_paths/2, code_paths/3, update_code_paths/3,
opts/1, opts/2,
default/1, default/2,
escript_path/1, escript_path/2,
lock... | null | https://raw.githubusercontent.com/erlang/rebar3/048412ed4593e19097f4fa91747593aac6706afb/apps/rebar/src/rebar_state.erl | erlang | Load terms from rebar.config, if it exists
This ensures deterministic overrides for configs.
Head of list global profile is special, only for use by rebar3
It does not clash if a user does `rebar3 as global...` but when
it is the head we must make sure not to prepend `default`
init didn't return a resource
must ... | -module(rebar_state).
-export([new/0, new/1, new/2, new/3,
get/2, get/3, set/3,
format_error/1,
has_all_artifacts/1,
code_paths/2, code_paths/3, update_code_paths/3,
opts/1, opts/2,
default/1, default/2,
escript_path/1, escript_path/2,
lock... |
5f06108b9e9daf4ba0e98e902b1d723d239138df5442336fe06faa7fcd057e0c | scrive/hpqtypes | Class.hs | module Database.PostgreSQL.PQTypes.SQL.Class (
SomeSQL(..)
, IsSQL(..)
, unsafeSQL
) where
import Data.String
import Foreign.C.String
import Foreign.Ptr
import Database.PostgreSQL.PQTypes.Internal.C.Types
import Database.PostgreSQL.PQTypes.ToSQL
-- | Container for SQL-like type storage.
data SomeSQL = fora... | null | https://raw.githubusercontent.com/scrive/hpqtypes/5b652645d5fdebbec8dbd1a68583fbcb8dfe5d93/src/Database/PostgreSQL/PQTypes/SQL/Class.hs | haskell | | Container for SQL-like type storage.
| Class representing \"SQLness\" of a given type.
| Convert 'sql' to libpqtypes representation and pass
it to supplied continuation (usually for execution).
^ 'PGparam' allocator.
^ Continuation which takes 'sql'
converted to libpqtypes specific representation, ie. 'PGparam... | module Database.PostgreSQL.PQTypes.SQL.Class (
SomeSQL(..)
, IsSQL(..)
, unsafeSQL
) where
import Data.String
import Foreign.C.String
import Foreign.Ptr
import Database.PostgreSQL.PQTypes.Internal.C.Types
import Database.PostgreSQL.PQTypes.ToSQL
data SomeSQL = forall sql. IsSQL sql => SomeSQL sql
class Sh... |
f479b4062244511f2abdeaaa535670e7da9f857ec60a86f58e01cd19c78174cb | xvw/planet | hakyll.ml | open Bedrock
open Util
type metadata_key = string
type metadata = string
let render key f value = Format.asprintf "%s: %s\n" key (f value)
let render_string key value = render key id value
let may_render_with key f default = function
| None -> render_string key default
| Some value -> render key f value
;;
let ... | null | https://raw.githubusercontent.com/xvw/planet/c2a77ea66f61cc76df78b9c2ad06d114795f3053/src/glue/hakyll.ml | ocaml | open Bedrock
open Util
type metadata_key = string
type metadata = string
let render key f value = Format.asprintf "%s: %s\n" key (f value)
let render_string key value = render key id value
let may_render_with key f default = function
| None -> render_string key default
| Some value -> render key f value
;;
let ... | |
9b0bdd5163a08d51f2b9e5f9b8df55f4a710379fc6f11eec1629c8cc1c147661 | camsaul/toucan2 | model_test.clj | (ns toucan2.model-test
(:require
[clojure.test :refer :all]
[methodical.core :as m]
[toucan2.map-backend.honeysql2 :as map.honeysql]
[toucan2.model :as model]
[toucan2.pipeline :as pipeline]
[toucan2.select :as select]
[toucan2.test :as test]
[toucan2.tools.compile :as tools.compile]))
(set! ... | null | https://raw.githubusercontent.com/camsaul/toucan2/8827187a2211edae13c0f7e654ad135d8a920591/test/toucan2/model_test.clj | clojure | [[model/default-connectable]] gets tested basically everywhere, because we define it for the models in
[[toucan2.test]] and use it in almost every test namespace | (ns toucan2.model-test
(:require
[clojure.test :refer :all]
[methodical.core :as m]
[toucan2.map-backend.honeysql2 :as map.honeysql]
[toucan2.model :as model]
[toucan2.pipeline :as pipeline]
[toucan2.select :as select]
[toucan2.test :as test]
[toucan2.tools.compile :as tools.compile]))
(set! ... |
74c60881ca9c3b2ef8f83ffce111d9fc3c3b30cf459f8dd96afef1b6f07d5c73 | marijnh/Postmodern | connect.lisp | -*- Mode : LISP ; Syntax : Ansi - Common - Lisp ; Base : 10 ; Package : POSTMODERN ; -*-
(in-package :postmodern)
(defvar *connection-pools* (make-hash-table :test 'equal)
"Maps pool specifiers to lists of pooled connections.")
(defparameter *database* nil
"Special holding the current database. Most functions a... | null | https://raw.githubusercontent.com/marijnh/Postmodern/d54e494000e1915a7046e8d825cb635555957e85/postmodern/connect.lisp | lisp | Syntax : Ansi - Common - Lisp ; Base : 10 ; Package : POSTMODERN ; -*- | (in-package :postmodern)
(defvar *connection-pools* (make-hash-table :test 'equal)
"Maps pool specifiers to lists of pooled connections.")
(defparameter *database* nil
"Special holding the current database. Most functions and macros operating
on a database assume this contains a connected database.")
(defclass p... |
eb467ca369bea7161380d69528f741f35975a9a8a209d4084e3490e880f511d6 | awakesecurity/grpc-mqtt | Fixture.hs | # LANGUAGE DerivingVia #
# LANGUAGE GeneralizedNewtypeDeriving #
module Test.Suite.Fixture
( Fixture (Fixture, unFixture),
testFixture,
)
where
--------------------------------------------------------------------------------
import Test.Tasty (TestName, TestTree)
import Test.Tasty.HUnit (Assertion, testCase)... | null | https://raw.githubusercontent.com/awakesecurity/grpc-mqtt/fbde6f3fe90e82260469bab922c5ebb9f0b40e95/test/Test/Suite/Fixture.hs | haskell | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------ | # LANGUAGE DerivingVia #
# LANGUAGE GeneralizedNewtypeDeriving #
module Test.Suite.Fixture
( Fixture (Fixture, unFixture),
testFixture,
)
where
import Test.Tasty (TestName, TestTree)
import Test.Tasty.HUnit (Assertion, testCase)
import Relude
import Test.Suite.Config (TestConfig, withTestConfig)
newtyp... |
bea3cc555c4d4232074c2e3ca620573267c4db2657b2d6ee88af5414acc5330c | synduce/Synduce | RootCauseAnalysis.ml | open Base
open Common
open Env
open Lang
open ProblemDefs
open Term
open Utils
module Sub = Configuration.Subconf
module G = ConfGraph
module CO = Config.Optims
let find_arg_with_subterm ~(fvar : variable) ~(sub : term) (t : term) =
let case _ t =
match t.tkind with
| TApp ({ tkind = TVar v; _ }, args) when ... | null | https://raw.githubusercontent.com/synduce/Synduce/42d970faa863365f10531b19945cbb5cfb70f134/src/confsearch/RootCauseAnalysis.ml | ocaml | * Looks for a set of applicable rules in prules to rewrite (f fargs) and return
the result of applying the possible rules.
If there is no rule that is applicable, then return an empty list.
Find where to obtain sub from
Add the variable to obtain sub from in memory.
We have a pattern, try to match it.
P... | open Base
open Common
open Env
open Lang
open ProblemDefs
open Term
open Utils
module Sub = Configuration.Subconf
module G = ConfGraph
module CO = Config.Optims
let find_arg_with_subterm ~(fvar : variable) ~(sub : term) (t : term) =
let case _ t =
match t.tkind with
| TApp ({ tkind = TVar v; _ }, args) when ... |
b0766cd56d7dd611949f7e3c06c20480228554fb98e2de018571132a4aa9ad87 | ezyang/reflex-backpack | Basics.hs | # LANGUAGE CPP #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
{-# LANGUAGE GADTs #-}
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE RoleAnnotations #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFami... | null | https://raw.githubusercontent.com/ezyang/reflex-backpack/247898fde872d8909392ebe2539f4623c7449067/host/Reflex/Host/Basics.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes #
# OPTIONS_GHC -fplugin=Reflex.Optimizer #
should only be necessary if you're writing a binding or some other library
that provides a core event loop.
| Monad in which Events can be 'subscribed'. This forces all underlying
event sources to be initialized, so that the event... | # LANGUAGE CPP #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RoleAnnotations #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
#ifdef USE... |
278ad23b2b252143240512672c351f20247ab20c0da8796aaf3015e146eb6ad4 | evilmartians/foundry | gen_vectors.ml | let _ =
let input_file = ref "" in
Arg.parse (Arg.align [
"-input", Arg.Set_string input_file, "Input file"
])
(fun arg -> prerr_endline ("Extraneous argument " ^ arg))
("Usage: " ^ Sys.argv.(0) ^ " [options]");
let vectors =
let chan = open_in !input_file in
let rec read_all vectors =
... | null | https://raw.githubusercontent.com/evilmartians/foundry/ce947c7dcca79ab7a7ce25870e9fc0eb15e9c2bd/src/tools/gen_vectors.ml | ocaml | let _ =
let input_file = ref "" in
Arg.parse (Arg.align [
"-input", Arg.Set_string input_file, "Input file"
])
(fun arg -> prerr_endline ("Extraneous argument " ^ arg))
("Usage: " ^ Sys.argv.(0) ^ " [options]");
let vectors =
let chan = open_in !input_file in
let rec read_all vectors =
... | |
76ad9a8479ad1271d028cf0d67a930565bcc7c062bad5c34dd951a1b5d349750 | ocastalabs/CouchDB-Facebook-Authentication | couch_db.erl | -module(couch_db).
-compile(export_all).
-include("couch_db.hrl").
open_int(<<"_some_db">>, []) ->
{ok, #db{}}.
% Fixtures for various user cases
open_doc_int({db,[]},<<"org.couchdb.user:123456_non_existing_user">>,[]) ->
something_not_ok;
open_doc_int({db,[]},<<"org.couchdb.user:888888_existing_user">>,[]) ... | null | https://raw.githubusercontent.com/ocastalabs/CouchDB-Facebook-Authentication/b20ce4ce17796c3d7ce07e224eb3ae16a71c5e6f/mocks/couch_db.erl | erlang | Fixtures for various user cases
The expected document update for the fixture cases | -module(couch_db).
-compile(export_all).
-include("couch_db.hrl").
open_int(<<"_some_db">>, []) ->
{ok, #db{}}.
open_doc_int({db,[]},<<"org.couchdb.user:123456_non_existing_user">>,[]) ->
something_not_ok;
open_doc_int({db,[]},<<"org.couchdb.user:888888_existing_user">>,[]) ->
{ok, #doc{
deleted=... |
18ead9392128bcec0fe85210c6df42a4ef2da6ab4dc92aa5ef2e4cd7cb37973c | sgbj/MaximaSharp | dsbmv.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy ... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/lapack/blas/dsbmv.lisp | lisp | Compiled by f2cl version:
Using Lisp CMU Common Lisp 20d (20D Unicode)
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy $ "
" f2cl6.l , v 1d5cbacbb... |
5da7cc6dc67e1aa0e67f705fa078eb9f0f70f4988d03904d76c862e323893c5e | wgnet/fox | fox_pub_pool_tests.erl | -module(fox_pub_pool_tests).
-include_lib("eunit/include/eunit.hrl").
-include("fox.hrl").
setup() ->
application:ensure_all_started(fox),
fox_utils:map_to_params_network(#{host => "localhost",
port => 5672,
virtual_host => <<"/">>,
username => <<"guest">>,
password => <<"gue... | null | https://raw.githubusercontent.com/wgnet/fox/030cc35d5828db959d19e67c90456d24a2c77c8e/test/fox_pub_pool_tests.erl | erlang | -module(fox_pub_pool_tests).
-include_lib("eunit/include/eunit.hrl").
-include("fox.hrl").
setup() ->
application:ensure_all_started(fox),
fox_utils:map_to_params_network(#{host => "localhost",
port => 5672,
virtual_host => <<"/">>,
username => <<"guest">>,
password => <<"gue... | |
bcaa14bd5b273a1dac184585087bbec99b4457f838e5affe80d301c942daea16 | lathe/punctaffy-for-racket | monoid.rkt | #lang parendown racket/base
; monoid.rkt
;
; A dictionary-passing implementation of the monoid type class for
; Racket, using Racket's generic methods so that it's more
; straightforward to define dictiaonries that are comparable by
; `equal?`.
Copyright 2017 - 2018 , 2022 The Lathe Authors
;
Licensed under t... | null | https://raw.githubusercontent.com/lathe/punctaffy-for-racket/47cf41144735645428818ba0f99711f10816c059/punctaffy-lib/private/experimental/monoid.rkt | racket | monoid.rkt
A dictionary-passing implementation of the monoid type class for
Racket, using Racket's generic methods so that it's more
straightforward to define dictiaonries that are comparable by
`equal?`.
you may not use this file except in compliance with the License.
You may obtain a copy of the License... | #lang parendown racket/base
Copyright 2017 - 2018 , 2022 The Lathe Authors
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND ,
(require #/only-in racket/contract/base -> any any/c)
(require #/only-in racket/generic define-generics)... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.