_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 |
|---|---|---|---|---|---|---|---|---|
6640688e9848c99dbf9790ec7814371e9e742f372c7b26a7f61bab3809b90103 | mattdw/caponia | index.clj | (ns caponia.index
(:use
[stemmers.core :only [stems]])
(:require
[clojure.java.io :as io]
[clojure.edn :as edn]
[stemmers.porter]))
(defrecord Index [data stemmer])
(defn make-index
"Create a new (empty) index. Takes an optional stemmer function"
([]
(make-index stemmers.porter/stem))
([ste... | null | https://raw.githubusercontent.com/mattdw/caponia/5a638973c207a664788a9959aeda7feef1998fe8/src/caponia/index.clj | clojure | defaults to weight=1
## Disk persistence
save to previous filename
save to specified filename | (ns caponia.index
(:use
[stemmers.core :only [stems]])
(:require
[clojure.java.io :as io]
[clojure.edn :as edn]
[stemmers.porter]))
(defrecord Index [data stemmer])
(defn make-index
"Create a new (empty) index. Takes an optional stemmer function"
([]
(make-index stemmers.porter/stem))
([ste... |
7bd06519d23e75453d0008c26e1f8404d16a3cbe5cd0fa6ce5c60fea18ea2918 | RunOrg/RunOrg | sqlConnection.ml | (* © 2014 RunOrg *)
open Std
(* A 't' connection keeps a queue of operations to be performed, and runs
them against a 'pgsql' connection which is created on-the-fly. Pooling
is applied to 'pgsql' connections.
All the work is done in the [process] function below, which forwards
appropriate calls to mem... | null | https://raw.githubusercontent.com/RunOrg/RunOrg/b53ee2357f4bcb919ac48577426d632dffc25062/server/sqlConnection.ml | ocaml | © 2014 RunOrg
A 't' connection keeps a queue of operations to be performed, and runs
them against a 'pgsql' connection which is created on-the-fly. Pooling
is applied to 'pgsql' connections.
All the work is done in the [process] function below, which forwards
appropriate calls to members of type [ope... |
open Std
type config = {
host : string ;
port : int ;
database : string ;
user : string ;
password : string ;
pool_size : int ;
}
let disconnect pgsql =
pgsql # finish
exception ConnectionFailed of string
Connect to the database . Does not use the pool .
let connect config =
try
let sql... |
be04b5075667420a0ebac17cf9794c98e0a4656b387b1e73da58960c317b169f | plumatic/hiphip | type_impl_test.clj | ;;; Benchmark code shared between array types.
;; Assumes the appropriate hiphip array type ns has been aliased as 'hiphip',
and the appropriate Java baseline class has been imported as ' Baseline '
(use 'clojure.test 'hiphip.test-utils)
(require '[hiphip.impl.core :as impl])
(def +type+ hiphip/+type+)
(set! *warn... | null | https://raw.githubusercontent.com/plumatic/hiphip/d839359cc1e4c453cd6ffe0b5857de550b3d7489/test/hiphip/type_impl_test.clj | clojure | Benchmark code shared between array types.
Assumes the appropriate hiphip array type ns has been aliased as 'hiphip',
Tests for selection and partitioning
Benchmark/equality tests
failure cases for testing the tests
1.2 (inc (hiphip/alength xs))
0.3 (do (hiphip/aset ys 0 101) (hiphip/alength xs))
helpers for... | and the appropriate Java baseline class has been imported as ' Baseline '
(use 'clojure.test 'hiphip.test-utils)
(require '[hiphip.impl.core :as impl])
(def +type+ hiphip/+type+)
(set! *warn-on-reflection* true)
(defn partitioned? [s pivot]
(let [[smaller more] ((juxt take-while drop-while) #(< % pivot) s)
... |
774fc87535f56e41b3f3ea975f8e6025479380cb94626558d3e8cf9d551e73e5 | cj1128/sicp-review | 3.20.scm | Exercise 3.20
;; Draw environment diagrams to illustrate
;; the evaluation of the sequence of expressions
;; Just ignore
| null | https://raw.githubusercontent.com/cj1128/sicp-review/efaa2f863b7f03c51641c22d701bac97e398a050/chapter-3/3.3/3.20.scm | scheme | Draw environment diagrams to illustrate
the evaluation of the sequence of expressions
Just ignore | Exercise 3.20
|
9085dcaaee206e9da1c1d973ba69ac81e74787aad57bd712e73a1ffee1d47cd0 | ssor/erlangDemos | gen_web_server.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2010 ,
%%% @doc
The main interface for the gen_web_server application
%%% @end
Created : 10 Feb 2010 by < >
%%%-------------------------------------------------------------------
-module(gen_web_server).
%% API
-... | null | https://raw.githubusercontent.com/ssor/erlangDemos/632cd905be2c4f275f1c1ae15238e711d7bb9147/erlware-Erlang-and-OTP-in-Action-Source/chapter_11/old/gen_web_server/src/gen_web_server.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
===================================================================
API
===================================================================
--------------------------... | @author < >
( C ) 2010 ,
The main interface for the gen_web_server application
Created : 10 Feb 2010 by < >
-module(gen_web_server).
-export([start_link/4, start_link/3, http_reply/1, http_reply/3]).
-export([behaviour_info/1]).
-include("eunit.hrl").
behaviour_info(callbacks) ->
[{init,1},
... |
41665ff24671c613b2206f6f65ff6c24365199c13e31b19308f850e1994217fb | eeng/mercurius | in_memory_trade_repository.clj | (ns mercurius.trading.adapters.repositories.in-memory-trade-repository
(:require [mercurius.trading.domain.repositories.trade-repository :refer [TradeRepository add-trade get-trades]]
[mercurius.trading.domain.entities.ticker :refer [available-tickers]]))
(defrecord InMemoryTradeRepository [db]
TradeRe... | null | https://raw.githubusercontent.com/eeng/mercurius/f83778ddde99aa13692e4fe2e70b2e9dc2fd70e9/src/mercurius/trading/adapters/repositories/in_memory_trade_repository.clj | clojure | (ns mercurius.trading.adapters.repositories.in-memory-trade-repository
(:require [mercurius.trading.domain.repositories.trade-repository :refer [TradeRepository add-trade get-trades]]
[mercurius.trading.domain.entities.ticker :refer [available-tickers]]))
(defrecord InMemoryTradeRepository [db]
TradeRe... | |
f9c9b3bddf906f86f1d028c6bf100fc350f0ece0e41863a17a48d340d173c691 | Plutonomicon/plutarch-core | Haskell.hs | module Plutarch.Backends.Haskell (compile) where
import Data.Text (Text)
class PHaskell
newtype Impl
compile' :: forall a m. (Applicative m, IsEType (Impl m) a) => Term (Impl m) a -> m Text
compile' (Term t) = (,) <$> runImpl t SN <*> pure (typeInfo (Proxy @m) (Proxy @a) SN)
compile :: Compile EDSL (SFTerm, SFType... | null | https://raw.githubusercontent.com/Plutonomicon/plutarch-core/c3bebe9621b5ca68fc316756c66f6eb72f677372/Plutarch/Backends/Haskell.hs | haskell | module Plutarch.Backends.Haskell (compile) where
import Data.Text (Text)
class PHaskell
newtype Impl
compile' :: forall a m. (Applicative m, IsEType (Impl m) a) => Term (Impl m) a -> m Text
compile' (Term t) = (,) <$> runImpl t SN <*> pure (typeInfo (Proxy @m) (Proxy @a) SN)
compile :: Compile EDSL (SFTerm, SFType... | |
542d7939a990f05b6691a2ca895734ab6f733592524d19a0f2e23095a6b8650c | pbv/codex | Types.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
Needed to derive Generic
# LANGUAGE GeneralizedNewtypeDeriving #
{-
Types for various entities
-}
module Codex.Types
( -- * types
UserLogin(..),
Password(..),
SubmitId(..),
Language(..),
Code(..),
Page,
-- re-expo... | null | https://raw.githubusercontent.com/pbv/codex/1a5a81965b12f834b436e2165c07120360aded99/src/Codex/Types.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE DeriveDataTypeable #
Types for various entities
* types
re-exports
hiding (Code)
| a user login; should uniquely identify the user
| submission identifier
| conversion to strings
| language identifier
| program code tagged with language identifier
, Read, Show)
| c... | Needed to derive Generic
# LANGUAGE GeneralizedNewtypeDeriving #
module Codex.Types
UserLogin(..),
Password(..),
SubmitId(..),
Language(..),
Code(..),
Page,
Text
) where
import Data.Typeable
import Data.Hashable
import Data.String (IsString(..))
import ... |
69fe8ae587f2c07de4c2f217841be62ec3a26d1bf7c48a900b7c0ff3582ea54d | artyom-poptsov/guile-png | bKGD.scm | ;;; bKGD.scm -- bKGD chunk.
Copyright ( C ) 2022 < >
;;
;; This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
;; (at your option) any later version.
;;
;;... | null | https://raw.githubusercontent.com/artyom-poptsov/guile-png/3b570ee73507a3785cb122c77a5c9556478edd66/modules/png/core/chunk/bKGD.scm | scheme | bKGD.scm -- bKGD chunk.
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
The program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See... |
Copyright ( C ) 2022 < >
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
(define-module (png core chunk bKGD)
#:use-module (srfi srfi-43)
#:... |
9bdaa522c72e0b3e620431d337c0329c221d79e6110248e242de8e13e18957db | rpav/ninja-sphere | build.lisp | build-it.lisp --- script for making SBCL binaries for Linux and
;;; MS Windows using only Free Software (GNU/Linux and
;;; Wine)
( C ) Copyright 2011 - 2016 by < >
( C ) Copyright 2011 - 2016 by < >
;;
;; Permission is hereby granted, free of charge, to any person obtaini... | null | https://raw.githubusercontent.com/rpav/ninja-sphere/f6708d9ab209a831c7e7df3f12d32ecc4afe0426/build.lisp | lisp | MS Windows using only Free Software (GNU/Linux and
Wine)
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
without limitation the rights to use, copy, modify, merge, publish,
the following cond... | build-it.lisp --- script for making SBCL binaries for Linux and
( C ) Copyright 2011 - 2016 by < >
( C ) Copyright 2011 - 2016 by < >
" Software " ) , to deal in the Software without restriction , including
distribute , sublicense , and/or sell copies of the Software , and to
permit persons to whom th... |
2ad8720a90c70ee17f461ba28114a3f4d60e2c97b0511a2c9129bc5e46748afd | Mercerenies/eulers-melting-pot | smgen.lisp |
;; Snowman source generator / "compiler"
;; This "magic" string at the start of the program activates abdf
;;
;; "(@("
(defparameter *letter-operators*
'((decr "NdE" 1 1)
(incr "NiN" 1 1)
(print "sP" 1 0)
(to-string "tS" 1 1)
(nth "aA" 2 1)
(range "nR" 2 1)
(equal? "eQ" 2 1)
(dup "dU" 1... | null | https://raw.githubusercontent.com/Mercerenies/eulers-melting-pot/68bcb9b1d46278c0bab4ab6200bcba09be8e4930/etc/smgen.lisp | lisp | Snowman source generator / "compiler"
This "magic" string at the start of the program activates abdf
"(@("
Duplicates v1 into v2 (leaves v2 as active variable)
(store literal variable)
(move src dest)
(map var array out-var block)
(each var array block)
(if cond true-block false-block)
(while cond var body)
... |
(defparameter *letter-operators*
'((decr "NdE" 1 1)
(incr "NiN" 1 1)
(print "sP" 1 0)
(to-string "tS" 1 1)
(nth "aA" 2 1)
(range "nR" 2 1)
(equal? "eQ" 2 1)
(dup "dU" 1 2)
(div "nD" 2 1)
(mod "NmO" 2 1)
(floor "nF" 1 1)
(ceil "nC" 1 1)
(not "nO" 1 1)
(wrap "wR" 1... |
20bd92f7c9f194c0505ddea101255e5a89ccb75d42b1322ef00459904bd2a6d0 | airbus-seclab/bincat | stubs.ml |
This file is part of BinCAT .
Copyright 2014 - 2021 - Airbus
BinCAT is free software : you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or ( at your
opti... | null | https://raw.githubusercontent.com/airbus-seclab/bincat/7d4a0b90cf950c0f43e252602a348cf9e2f858ba/ocaml/src/fixpoint/stubs.ml | ocaml | little endian only ?
little endian only ?
we ignore taint as the source is a constant
result is tainted if the destination to copy the byte is tainted
value is in memory
%s
%x | %X
%d
state machine for format string parsing
look for %
% found, do we have %% ?
set the number of bytes (excluding th... |
This file is part of BinCAT .
Copyright 2014 - 2021 - Airbus
BinCAT is free software : you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or ( at your
opti... |
84611d7cd0d4bea06b75334db39789d31419bc5663efc284a01b630390441585 | ZHaskell/stdio | Aeson.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import Data.Aeson
import Control.Monad
import Data.Attoparsec.ByteString (IResult(..), parseWith)
import Data.Time.Clock
import System.Environment (getArgs)
import System.IO
import qualified Data.ByteString as B
main :: IO ()
m... | null | https://raw.githubusercontent.com/ZHaskell/stdio/7887b9413dc9feb957ddcbea96184f904cf37c12/bench/json/Aeson.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings # |
module Main (main) where
import Data.Aeson
import Control.Monad
import Data.Attoparsec.ByteString (IResult(..), parseWith)
import Data.Time.Clock
import System.Environment (getArgs)
import System.IO
import qualified Data.ByteString as B
main :: IO ()
main = do
(bs:cnt:args) <- getArgs
let count = read cnt :: Int... |
4a2398ab30ce218872c803efcc16792fbfb037b927bff9bc216eb6eaccc2adb0 | wanishing/sap | yaml.clj | (ns sap.commands.yaml
(:require
[clj-yaml.core :as yaml]
[sap.client :refer [fetch-yaml fetch-fresh-yaml]]))
(defn yaml
[{:keys [id]} {:keys [fresh]}]
(let [yml (if (some? fresh)
(fetch-fresh-yaml id)
(fetch-yaml id))]
(println (yaml/generate-string yml))))
| null | https://raw.githubusercontent.com/wanishing/sap/1d4c9f8c8a648eec9e09cf87b900b854ba483e42/src/sap/commands/yaml.clj | clojure | (ns sap.commands.yaml
(:require
[clj-yaml.core :as yaml]
[sap.client :refer [fetch-yaml fetch-fresh-yaml]]))
(defn yaml
[{:keys [id]} {:keys [fresh]}]
(let [yml (if (some? fresh)
(fetch-fresh-yaml id)
(fetch-yaml id))]
(println (yaml/generate-string yml))))
| |
e7d8955774afd680863dcba798e6295ccb3a523a8a9a8ca33b426442528a47ed | bramford/2d-exploration-game | entity_lib.mli | module type Entity = sig
type t
val symbol : string
val name : string
val fg : t -> Notty.A.color
val to_string : t -> string
val random : int -> t
val draw : t -> Notty.image
end
| null | https://raw.githubusercontent.com/bramford/2d-exploration-game/0660ced6ec4aa39d4548b0ecc1f20f8269bf4c6b/src/entity_lib.mli | ocaml | module type Entity = sig
type t
val symbol : string
val name : string
val fg : t -> Notty.A.color
val to_string : t -> string
val random : int -> t
val draw : t -> Notty.image
end
| |
63e2d2374b376fe02c8a584dc35120afec006e08e3511486e1cb5b14dbb9aeb6 | racket/rhombus-prototype | define-arity.rkt | #lang racket/base
(require (for-syntax racket/base
syntax/parse/pre)
"expression.rkt"
"static-info.rkt"
"function-arity-key.rkt")
(provide define/arity)
(define-syntax (define/arity stx)
(syntax-parse stx
[(_ #:name name (id . args)
(~optional (~seq #:stat... | null | https://raw.githubusercontent.com/racket/rhombus-prototype/60070a3edd2b850bf429298b84b66eee3ea79194/rhombus/private/define-arity.rkt | racket | #lang racket/base
(require (for-syntax racket/base
syntax/parse/pre)
"expression.rkt"
"static-info.rkt"
"function-arity-key.rkt")
(provide define/arity)
(define-syntax (define/arity stx)
(syntax-parse stx
[(_ #:name name (id . args)
(~optional (~seq #:stat... | |
f0f465f66d4956e000bf3b61e70b0708a71de96c36b98e24453ccc0757e50875 | locusmath/locus | cone.clj | (ns locus.set.copresheaf.topoi.copresheaf.cone
(:require [locus.set.logic.core.set :refer :all]
[locus.set.logic.limit.product :refer :all]
[locus.set.mapping.general.core.object :refer :all]
[locus.set.logic.structure.protocols :refer :all]
[locus.set.quiver.structure.... | null | https://raw.githubusercontent.com/locusmath/locus/fb6068bd78977b51fd3c5783545a5f9986e4235c/src/clojure/locus/set/copresheaf/topoi/copresheaf/cone.clj | clojure | Get the index category of a cone in the topos of sets
Create a set product cone
Ontology of set cones | (ns locus.set.copresheaf.topoi.copresheaf.cone
(:require [locus.set.logic.core.set :refer :all]
[locus.set.logic.limit.product :refer :all]
[locus.set.mapping.general.core.object :refer :all]
[locus.set.logic.structure.protocols :refer :all]
[locus.set.quiver.structure.... |
9283fa353d650b3567192341c23fcc5ab418c56d6c2918779cb44b4811c73cc1 | vehicle-lang/vehicle | NoThunks.hs | # LANGUAGE CPP #
module Vehicle.Syntax.AST.Instances.NoThunks where
#if nothunks
import Vehicle.Syntax.AST.Arg
import Vehicle.Syntax.AST.Binder
import Vehicle.Syntax.AST.Builtin
import Vehicle.Syntax.AST.Builtin.Core
import Vehicle.Syntax.AST.Builtin.TypeClass
import Vehicle.Syntax.AST.Decl
import Vehicle.Syntax.AST.... | null | https://raw.githubusercontent.com/vehicle-lang/vehicle/3a3548f9b48c3969212ccb51e954d4d4556ea815/vehicle-syntax/src/Vehicle/Syntax/AST/Instances/NoThunks.hs | haskell | Now Vehicle.Compile.Type.Subsystem.Linearity.Core
Now Vehicle.Compile.Type.Subsystem.Polarity.Core
Vehicle.Syntax.AST.Arg
Vehicle.Syntax.AST.Binder
Vehicle.Syntax.AST.Decl
Vehicle.Syntax.AST.Expr
Vehicle.Syntax.AST.Name
Vehicle.Syntax.AST.Prog
Vehicle.Syntax.AST.Provenance
Vehicle.Syntax.AST.Visibility | # LANGUAGE CPP #
module Vehicle.Syntax.AST.Instances.NoThunks where
#if nothunks
import Vehicle.Syntax.AST.Arg
import Vehicle.Syntax.AST.Binder
import Vehicle.Syntax.AST.Builtin
import Vehicle.Syntax.AST.Builtin.Core
import Vehicle.Syntax.AST.Builtin.TypeClass
import Vehicle.Syntax.AST.Decl
import Vehicle.Syntax.AST.... |
ba8beec4393f872e8309889437d50c0c65dfd52d1b610acdc4dec74deb60eb98 | ocaml-gospel/gospel | char1.mli | val f : char -> unit
(*@ f c
requires c = '\' *)
{ gospel_expected|
[ 125 ] File " char1.mli " , line 3 , characters 17 - 18 :
3 | requires c = ' \ '
[125] File "char1.mli", line 3, characters 17-18:
3 | requires c = '\' *)
^
Error: Ille... | null | https://raw.githubusercontent.com/ocaml-gospel/gospel/79841c510baeb396d9a695ae33b290899188380b/test/negative/char1.mli | ocaml | @ f c
requires c = '\' | val f : char -> unit
{ gospel_expected|
[ 125 ] File " char1.mli " , line 3 , characters 17 - 18 :
3 | requires c = ' \ '
[125] File "char1.mli", line 3, characters 17-18:
3 | requires c = '\' *)
^
Error: Illegal character `''.
|gospel_ex... |
0c8d70e96cfe418b9052b7900e6b816a9f2d01a233e3294ea674e47f83359e4b | PacktWorkshops/The-Clojure-Workshop | core.clj | (ns hello-leiningen.core
(:require [java-time :as time])
(:gen-class))
(defn -main
"Display current local time"
[& args]
(println (time/local-time)))
| null | https://raw.githubusercontent.com/PacktWorkshops/The-Clojure-Workshop/3d309bb0e46a41ce2c93737870433b47ce0ba6a2/Chapter08/tests/Exercise8.12/hello-leiningen/src/hello_leiningen/core.clj | clojure | (ns hello-leiningen.core
(:require [java-time :as time])
(:gen-class))
(defn -main
"Display current local time"
[& args]
(println (time/local-time)))
| |
67f83f5e94a4de321d0a21bb00f93b5c56b13bd8d28c69f8af0a325575d6b458 | TheLortex/mirage-monorepo | mirage_net.ml |
* Copyright ( c ) 2011 - 2015 Anil Madhavapeddy < >
* Copyright ( c ) 2013 - 2015 < >
* Copyright ( c ) 2013 Citrix Systems Inc
* Copyright ( c ) 2018 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted ... | null | https://raw.githubusercontent.com/TheLortex/mirage-monorepo/b557005dfe5a51fc50f0597d82c450291cfe8a2a/duniverse/mirage-net/src/mirage_net.ml | ocaml |
* Copyright ( c ) 2011 - 2015 Anil Madhavapeddy < >
* Copyright ( c ) 2013 - 2015 < >
* Copyright ( c ) 2013 Citrix Systems Inc
* Copyright ( c ) 2018 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted ... | |
05c05b1e84a20b459ddf713b3058755e700db801a0bc9eb91efee212d3b1b481 | deadpendency/deadpendency | QueuePayload.hs | module Common.Effect.QueueEventPublish.Model.QueuePayload
( QueuePayload (..),
)
where
import Data.Aeson
data QueuePayload where
QueuePayload :: (ToJSON a) => a -> QueuePayload
RawQueuePayload :: ByteString -> QueuePayload
| null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/common/src/Common/Effect/QueueEventPublish/Model/QueuePayload.hs | haskell | module Common.Effect.QueueEventPublish.Model.QueuePayload
( QueuePayload (..),
)
where
import Data.Aeson
data QueuePayload where
QueuePayload :: (ToJSON a) => a -> QueuePayload
RawQueuePayload :: ByteString -> QueuePayload
| |
ebafc084a291045f54eff0e249e132d3418e51bd25c64108e6730335cd0c512e | samply/blaze | spec.clj | (ns blaze.handler.fhir.util.spec
(:require
[clojure.spec.alpha :as s]))
(s/def :ring.request.query-params/key
string?)
(s/def :ring.request.query-params/value
(s/or :string string? :strings (s/coll-of string? :min-count 2)))
(s/def :ring.request/query-params
(s/map-of :ring.request.query-params/key :r... | null | https://raw.githubusercontent.com/samply/blaze/948eee38021467fa343c522a644a7fd4b24b6467/modules/rest-util/src/blaze/handler/fhir/util/spec.clj | clojure | (ns blaze.handler.fhir.util.spec
(:require
[clojure.spec.alpha :as s]))
(s/def :ring.request.query-params/key
string?)
(s/def :ring.request.query-params/value
(s/or :string string? :strings (s/coll-of string? :min-count 2)))
(s/def :ring.request/query-params
(s/map-of :ring.request.query-params/key :r... | |
9a1f544a1e1a5d8052b4bdad7e94c8dc825f34fe35e51525c924e502831693fe | hyperfiddle/electric | data.cljc | (ns contrib.data
(:require clojure.math
[clojure.datafy :refer [datafy]] ; todo remove
[hyperfiddle.rcf :refer [tests]])
#?(:cljs (:require-macros [contrib.data :refer [auto-props]])))
(defn qualify
"Qualify a keyword with a namespace. If already qualified, leave kw untouched. Nil-safe.
... | null | https://raw.githubusercontent.com/hyperfiddle/electric/4cb7008615a43e38b60af9dad804892479907b8a/src/contrib/data.cljc | clojure | todo remove
(keyword (name (namespace ::ns)) (name :limit))
fallback to index when key is not present
alternative design is to define nil kf as fallback
should this throw?
"nil kf uses default value (which is likely unintended, should it throw?)"
(index-by nil xs)
(index-by nil nil) := {} ; kf never used -- alterna... | (ns contrib.data
(:require clojure.math
[hyperfiddle.rcf :refer [tests]])
#?(:cljs (:require-macros [contrib.data :refer [auto-props]])))
(defn qualify
"Qualify a keyword with a namespace. If already qualified, leave kw untouched. Nil-safe.
(qualify :db :isComponent) -> :db/isComponent"
[ns ?kw]
... |
ec8836c775ed83dc3c7c0610e4c9067f68e5c34da332bd26538fb2e2c52a6972 | cartazio/tlaps | e_constness.ml |
* expr / constness.ml --- detect constant operators
*
*
* Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation
* expr/constness.ml --- detect constant operators
*
*
* Copyright (C) 2008-2010 INRIA and Microsoft Corporation
*)
Revision.f "$Rev: 34599 $";;
open Ext
open Property
open E_t
... | null | https://raw.githubusercontent.com/cartazio/tlaps/562a34c066b636da7b921ae30fc5eacf83608280/src/expr/e_constness.ml | ocaml | let is_const x = Property.get x isconst
Util.eprintf e
"const (%a) <-- %b@."
TL: we ignore the selection for now |
* expr / constness.ml --- detect constant operators
*
*
* Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation
* expr/constness.ml --- detect constant operators
*
*
* Copyright (C) 2008-2010 INRIA and Microsoft Corporation
*)
Revision.f "$Rev: 34599 $";;
open Ext
open Property
open E_t
... |
cf532ad622e441191e8d7b681f462cf97cd4b26100cefa0e95ee800dee61da63 | fare/lisp-interface-library | sequence.lisp | ;;;;; Read-only interfaces common to pure and stateful collections
(uiop:define-package :lil/interface/sequence
(:use
:closer-common-lisp
:lil/core
:lil/interface/base
:lil/interface/collection)
(:use-reexport
:lil/interface/empty
:lil/interface/size
:lil/interface/fold
:lil/interface/itera... | null | https://raw.githubusercontent.com/fare/lisp-interface-library/ac2e0063dc65feb805f0c57715d52fda28d4dcd8/interface/sequence.lisp | lisp | Read-only interfaces common to pure and stateful collections
to be shadowed by pure and stateful packages.
TODO: create this interface... |
(uiop:define-package :lil/interface/sequence
(:use
:closer-common-lisp
:lil/core
:lil/interface/base
:lil/interface/collection)
(:use-reexport
:lil/interface/empty
:lil/interface/size
:lil/interface/fold
:lil/interface/iterator)
(:export
#:sequence-list #:list-sequence))
(in-package :... |
ecc2fafaf353c4775d1b9d65bb09ffea70345a65c4efd311c2a32fe4ed8170f7 | GNOME/aisleriot | agnes.scm | ; AisleRiot - agnes.scm
Copyright ( C ) 2001 , 2003 < >
;
; This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
; (at your option) any later version.
;
; Thi... | null | https://raw.githubusercontent.com/GNOME/aisleriot/5b04e58ba5f8df8223a3830d2c61325527d52237/games/agnes.scm | scheme | AisleRiot - agnes.scm
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See ... | Copyright ( C ) 2001 , 2003 < >
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
(use-modules (aisleriot interface) (aisleriot api) (ice-9 format))
(defi... |
59549938e3d489ddead711ec436b1eff582dd4cc57e3c5e5235007fcd6071c66 | JPMoresmau/dbIDE | as-browser-integration.hs | module Main where
import Language.Haskell.ASBrowser.Integration.CabalTest
import Test.Tasty
main :: IO()
main = defaultMain tests
tests :: TestTree
tests = testGroup "Tests" [cabalTests]
| null | https://raw.githubusercontent.com/JPMoresmau/dbIDE/dae37edf67fbe55660e7e22c9c5356d0ada47c61/as-browser/integration/as-browser-integration.hs | haskell | module Main where
import Language.Haskell.ASBrowser.Integration.CabalTest
import Test.Tasty
main :: IO()
main = defaultMain tests
tests :: TestTree
tests = testGroup "Tests" [cabalTests]
| |
a5d0f6bfbdc30c74f87512e5ab0fc4f5cd2c166805aa1d5574e225cbd04e412c | malcolmreynolds/GSLL | monte-carlo-structs.lisp | CFFI - Grovel definitions for unix systems .
2009 - 06 - 06 09:32:30EDT monte-carlo-structs.lisp
Time - stamp : < 2009 - 08 - 23 10:19:40EDT monte-carlo-structs.lisp >
(in-package :gsl)
#+linux
(define "_GNU_SOURCE")
When installed through Mac Ports , GSL .h files will be found
;;; in /opt/local/include.
#... | null | https://raw.githubusercontent.com/malcolmreynolds/GSLL/2f722f12f1d08e1b9550a46e2a22adba8e1e52c4/calculus/monte-carlo-structs.lisp | lisp | in /opt/local/include.
grid
uint
these are both counted along the axes
distribution
control variables | CFFI - Grovel definitions for unix systems .
2009 - 06 - 06 09:32:30EDT monte-carlo-structs.lisp
Time - stamp : < 2009 - 08 - 23 10:19:40EDT monte-carlo-structs.lisp >
(in-package :gsl)
#+linux
(define "_GNU_SOURCE")
When installed through Mac Ports , GSL .h files will be found
#+darwin
(cc-flags "-I/opt/l... |
6fb889956dcff521c4839ab4d26c151d49a7aab0337ceff46d7cf08cfbb35fd7 | hammerlab/biokepi | pyensembl.ml | open Biokepi_run_environment
open Common
let pyensembl_env_key = "PYENSEMBL_CACHE_DIR"
let get_cache_dir ~(run_with: Machine.t) =
let open KEDSL in
let cache_dir = Machine.(get_pyensembl_cache_dir run_with) in
match cache_dir with
| Some path -> path
| None -> failwith "Tool depends on PyEnsembl, but th... | null | https://raw.githubusercontent.com/hammerlab/biokepi/d64eb2c891b41bda3444445cd2adf4e3251725d4/src/bfx_tools/pyensembl.ml | ocaml | open Biokepi_run_environment
open Common
let pyensembl_env_key = "PYENSEMBL_CACHE_DIR"
let get_cache_dir ~(run_with: Machine.t) =
let open KEDSL in
let cache_dir = Machine.(get_pyensembl_cache_dir run_with) in
match cache_dir with
| Some path -> path
| None -> failwith "Tool depends on PyEnsembl, but th... | |
88971486e81040e1ca903b936ee71d9f89c06282c2a60f00010a69650a6b65bf | webyrd/mediKanren | CHAMP1_RNA_seq.rkt | #lang racket
(require
"../../../medikanren/pieces-parts/query.rkt"
"../pieces-parts/Thi-useful-functions.rkt")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;*******************************;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;*********GENE... | null | https://raw.githubusercontent.com/webyrd/mediKanren/a2b80ea94f66bcdd4305b9369ad4184c2afe9829/contrib/medikanren/use-cases/CHAMP1_RNA_seq.rkt | racket | *******************************;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
*********GENERAL SEARCH********;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
*** Data Sources:
- RNA was obtained from patients or control
cultured fibroblasts derived from skin biopsies
*** Objective:
*** Please find t... | #lang racket
(require
"../../../medikanren/pieces-parts/query.rkt"
"../pieces-parts/Thi-useful-functions.rkt")
- Processed CHAMP1 RNAseq data from outside of mediKanren
Repurpose drugs for CHAMP1 genetic disorder using RNAseq data from patients - derived skin fibroblasts
First , I 'm doing exploratory search... |
ca800c1a1173c1eb180760730ec0ab5fe68140fba6a405bd093b1c00135352b1 | ku-fpg/hermit | Main.hs | # LANGUAGE CPP #
# LANGUAGE ViewPatterns #
module Main (main) where
import Constants (hiVersion)
import Control.Monad
import Data.Char (isSpace)
import Data.List
import Data.Maybe (listToMaybe)
import GHC.Paths (ghc)
import HERMIT.Driver
import System.Directory
import System.FilePath as F
#if defined(darwin_HOST_O... | null | https://raw.githubusercontent.com/ku-fpg/hermit/3e7be430fae74a9e3860b8b574f36efbf9648dec/tests/Main.hs | haskell | subdirectory names
TODO: re-enable once fixed , ("nub" , "Nub.hs" , "Nub.hss" , [])
all the bindings
| Get the path to the sandbox database if any
used, for some silly reason
line orderings depending on if it's been run once before. As far as I can
tell, this is due to the presence of object (.o)... | # LANGUAGE CPP #
# LANGUAGE ViewPatterns #
module Main (main) where
import Constants (hiVersion)
import Control.Monad
import Data.Char (isSpace)
import Data.List
import Data.Maybe (listToMaybe)
import GHC.Paths (ghc)
import HERMIT.Driver
import System.Directory
import System.FilePath as F
#if defined(darwin_HOST_O... |
120d6f4f097ca29b0bf9c784a6fb6dc99b8fd4fd4c4e052e31c175389aed221b | 2600hz-archive/whistle | conference.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2011 , VoIP , INC
%%% @doc
%%% Its a party and your invite'd...
%%% @end
Created : 27 June 2011 by < >
%%%-------------------------------------------------------------------
-module(conference).
-include_lib("whistle/... | null | https://raw.githubusercontent.com/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/whistle_apps/apps/conference/src/conference.erl | erlang | -------------------------------------------------------------------
@doc
Its a party and your invite'd...
@end
-------------------------------------------------------------------
--------------------------------------------------------------------
@doc
Starts the app for inclusion in a supervisor tree
@end
------... | @author < >
( C ) 2011 , VoIP , INC
Created : 27 June 2011 by < >
-module(conference).
-include_lib("whistle/include/wh_types.hrl").
-export([start/0, start_link/0, stop/0]).
@public
-spec start_link/0 :: () -> startlink_ret().
start_link() ->
start_deps(),
conference_sup:start_link().
@pub... |
fc9213f77281be2db87f002b7a9a1a8c764e34e167e7f6e9aba1c4f390b5c332 | ninenines/gun | gun_tcp_proxy.erl | Copyright ( c ) 2020 - 2023 , < >
%%
%% Permission to use, copy, modify, and/or distribute this software for any
%% purpose with or without fee is hereby granted, provided that the above
%% copyright notice and this permission notice appear in all copies.
%%
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISC... | null | https://raw.githubusercontent.com/ninenines/gun/33223e751267c5f249f3db1277c13904a1801b92/src/gun_tcp_proxy.erl | erlang |
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVE... | Copyright ( c ) 2020 - 2023 , < >
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
-module(gun_tcp_proxy).
-export([name/0]).
-export([... |
86ebcbe6c648157c9196ddf12f2e31dc5fb262da3fb96c2f8b6f03462eaf08c6 | DataHaskell/dh-core | WeighBench.hs | module Main where
import qualified Statistics.Matrix as M
import qualified Statistics.Matrix.Fast as F
import qualified Statistics.Matrix.Fast.Algorithms as FA
import Statistics.Matrix (Matrix (..))
import qualified Statistics.Matrix.Algorithms as A
import qualified Data.Vector.Unboxed as U
import ... | null | https://raw.githubusercontent.com/DataHaskell/dh-core/2beb8740f27fa9683db70eb8d8424ee6c75d3e91/dense-linear-algebra/bench/WeighBench.hs | haskell | module Main where
import qualified Statistics.Matrix as M
import qualified Statistics.Matrix.Fast as F
import qualified Statistics.Matrix.Fast.Algorithms as FA
import Statistics.Matrix (Matrix (..))
import qualified Statistics.Matrix.Algorithms as A
import qualified Data.Vector.Unboxed as U
import ... | |
ad4b236c94d38f009009b655cddb3dd17476fdd7d2a5c36d3a72fe7aeec00df1 | roman/Haskell-Reactive-Extensions | Maybe.hs | # LANGUAGE NoImplicitPrelude #
module Rx.Observable.Maybe where
import Prelude.Compat
import Control.Concurrent.MVar (newEmptyMVar, takeMVar, tryPutMVar)
import Control.Monad (void)
import Rx.Disposable (dispose)
import Rx.Scheduler (A... | null | https://raw.githubusercontent.com/roman/Haskell-Reactive-Extensions/0faddbb671be7f169eeadbe6163e8d0b2be229fb/rx-core/src/Rx/Observable/Maybe.hs | haskell | # LANGUAGE NoImplicitPrelude #
module Rx.Observable.Maybe where
import Prelude.Compat
import Control.Concurrent.MVar (newEmptyMVar, takeMVar, tryPutMVar)
import Control.Monad (void)
import Rx.Disposable (dispose)
import Rx.Scheduler (A... | |
c3b33050f1fd5905808bbb800d4b1d86092bfe8e3fea1df8b64861638ff6fd67 | unisonweb/unison | Var.hs | module U.Core.ABT.Var where
import Data.Set (Set)
-- | A class for avoiding accidental variable capture
--
-- * `Set.notMember (freshIn vs v) vs`:
-- `freshIn` returns a variable not used in the `Set`
class (Ord v) => Var v where
freshIn :: Set v -> v -> v
| null | https://raw.githubusercontent.com/unisonweb/unison/cf278f9fb66ccb9436bf8a2eb4ab03fc7a92021d/codebase2/core/U/Core/ABT/Var.hs | haskell | | A class for avoiding accidental variable capture
* `Set.notMember (freshIn vs v) vs`:
`freshIn` returns a variable not used in the `Set` | module U.Core.ABT.Var where
import Data.Set (Set)
class (Ord v) => Var v where
freshIn :: Set v -> v -> v
|
52ec94eb90603c8743c983a89cb8a8592b44a726ca5658dbbbe418c089462f0a | turtlesoupy/haskakafka | TestMain.hs | # LANGUAGE ScopedTypeVariables #
module Main (main) where
import Haskakafka
import Haskakafka.InternalSetup
import Control.Exception
import Control.Monad
import System.Environment
import Test.Hspec
import Text.Regex.Posix
import qualified Data.Map as Map
import qualified Data.ByteString.Char8 as C8
brokerAddress :: ... | null | https://raw.githubusercontent.com/turtlesoupy/haskakafka/cae3348be1a3934629cf58d433c224d87ff59608/tests/TestMain.hs | haskell | Little delay for operation | # LANGUAGE ScopedTypeVariables #
module Main (main) where
import Haskakafka
import Haskakafka.InternalSetup
import Control.Exception
import Control.Monad
import System.Environment
import Test.Hspec
import Text.Regex.Posix
import qualified Data.Map as Map
import qualified Data.ByteString.Char8 as C8
brokerAddress :: ... |
05af41f587ae0397e291d528d853371351748e3c9b95e969e2cfed982f0ef06c | cpsc411/cpsc411-book | a3-skeleton.rkt | #lang racket
(require
racket/set
"a3-graph-lib.rkt"
"a3-compiler-lib.rkt")
(provide
current-assignable-registers
compiler-a2
compiler-a3
check-values-lang
interp-values-lang
uniquify
select-instructions
check-loc-lang
uncover-locals
assign-homes
assign-registers
conflict-analysis
undead-analysis
assi... | null | https://raw.githubusercontent.com/cpsc411/cpsc411-book/f2199857fe0b894ac5216775c5e6036f5fb0a8f2/build/share/a3-skeleton.rkt | racket | ------------------------------------------------------------------------
New starter code.
------------------------------------------------------------------------
Fill me in ...
------------------------------------------------------------------------ | #lang racket
(require
racket/set
"a3-graph-lib.rkt"
"a3-compiler-lib.rkt")
(provide
current-assignable-registers
compiler-a2
compiler-a3
check-values-lang
interp-values-lang
uniquify
select-instructions
check-loc-lang
uncover-locals
assign-homes
assign-registers
conflict-analysis
undead-analysis
assi... |
2996aafd6f9e7dfda4c4989c75fddb17c95a81371a012d02c943996347414063 | replikativ/hitchhiker-tree | redis_test.clj | (ns hitchhiker.redis-test
(:require [clojure.test.check.clojure-test :refer [defspec]]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop]
[hitchhiker.tree.bootstrap.redis :as redis]
[hitchhiker.tree :as core]
[hitchhiker.tree.ut... | null | https://raw.githubusercontent.com/replikativ/hitchhiker-tree/9279fb75a581717e7b52a9d3f4c5e2e537458372/test/hitchhiker/redis_test.clj | clojure | (ns hitchhiker.redis-test
(:require [clojure.test.check.clojure-test :refer [defspec]]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop]
[hitchhiker.tree.bootstrap.redis :as redis]
[hitchhiker.tree :as core]
[hitchhiker.tree.ut... | |
7b100c30ec8907610fcd88748a3bc1b0548c300531e6c27033c8959e115f52c5 | monadbobo/ocaml-core | extended_result.ml | open Core.Std
module Ok = Result
module Error = struct
module T = struct
type ('a,'b) t = ('b,'a) Result.t
end
include T
include Monad.Make2
(struct
include T
let bind x f = match x with
| Error x -> f x
| Ok _ as x -> x
let return x = Error x
end)
end
module Ex... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/extended/lib/extended_result.ml | ocaml | open Core.Std
module Ok = Result
module Error = struct
module T = struct
type ('a,'b) t = ('b,'a) Result.t
end
include T
include Monad.Make2
(struct
include T
let bind x f = match x with
| Error x -> f x
| Ok _ as x -> x
let return x = Error x
end)
end
module Ex... | |
e1baa411630cc23adcb8343372c340634e56a15094e971b5e79744e0f9fca0ad | input-output-hk/ouroboros-network | Praos.hs | # LANGUAGE BangPatterns #
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleIn... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/17889be3e1b6d9b5ee86022b91729837051e6fbb/ouroboros-consensus-mock/src/Ouroboros/Consensus/Mock/Protocol/Praos.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE UndecidableInstances #
# LANGUAGE UndecidableSuperClasses #
| Proof of concept implementation of Praos
* Tags
* Type instances
consist ... | # LANGUAGE BangPatterns #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables ... |
b67bb3b301067e0ca8abdeba146a8d662c8c9ebc896c317d9fd5b03aa04e400a | camllight/camllight | bubble.ml | #open "animation";;
let sort gc =
let ordered = ref true in
let rec sweep i =
if i+1 >= vect_length gc.array then
if !ordered then
Finished
else begin
ordered := false;
sweep 0
end
else
Pause(fun () ->
if gc.array.(i+1) < gc.array.(i) then begin
... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/examples/showsort/bubble.ml | ocaml | #open "animation";;
let sort gc =
let ordered = ref true in
let rec sweep i =
if i+1 >= vect_length gc.array then
if !ordered then
Finished
else begin
ordered := false;
sweep 0
end
else
Pause(fun () ->
if gc.array.(i+1) < gc.array.(i) then begin
... | |
31a8bef20aed5a7dc48b68a9fe4969b872ee40d1130c1932e6ca996828bb9291 | wilkerlucio/pathom | project.clj | (defproject com.wsscode/pathom "2.4.0"
:description "A Clojure library designed to provide a collection of helper functions to support Clojure(script) graph parsers using\nom.next graph syntax."
:url ""
:license {:name "MIT"
:url ""}
:source-paths ["src"]
:dependencies [[camel-snake-kebab "0.4.... | null | https://raw.githubusercontent.com/wilkerlucio/pathom/4ec25055d3d156241e9174d68ec438c93c971b9b/project.clj | clojure | provided | (defproject com.wsscode/pathom "2.4.0"
:description "A Clojure library designed to provide a collection of helper functions to support Clojure(script) graph parsers using\nom.next graph syntax."
:url ""
:license {:name "MIT"
:url ""}
:source-paths ["src"]
:dependencies [[camel-snake-kebab "0.4.... |
489b1a19c8535339dd43c03246ea1020b57e0e70bf7e37121085429dbb62359f | ocsigen/ojwidgets | ojw_mobile_tools.mli |
(** Various tools for mobiles. *)
(** {3 Enable or disable mobile features} *)
val disable_zoom : unit -> Dom_html.event_listener_id
val hide_navigation_bar : unit -> unit
| null | https://raw.githubusercontent.com/ocsigen/ojwidgets/4be2233980bdd1cae187c749bd27ddbfff389880/src/ojw_mobile_tools.mli | ocaml | * Various tools for mobiles.
* {3 Enable or disable mobile features} |
val disable_zoom : unit -> Dom_html.event_listener_id
val hide_navigation_bar : unit -> unit
|
43b6d0eb563722d4a8fdb118b8100258c66524ec6c4d17185289984d58f5a0fa | jafingerhut/clojure-benchmarks | fasta.clj-8.clj | The Computer Language Benchmarks Game
;; /
contributed by
(ns fasta
(:gen-class))
(set! *warn-on-reflection* true)
;; Handle slight difference in function name between Clojure 1.2.0 and
;; 1.3.0-alpha*.
(defmacro my-unchecked-inc-int [& args]
(if (and (== (*clojure-version* :major) 1)
(== (... | null | https://raw.githubusercontent.com/jafingerhut/clojure-benchmarks/474a8a4823727dd371f1baa9809517f9e0b508d4/fasta/fasta.clj-8.clj | clojure | /
Handle slight difference in function name between Clojure 1.2.0 and
1.3.0-alpha*.
at each possible offset in the string s to be repeated.
Write out the left over part of length n, if any.
In my performance testing, I found linear search to
be a little faster than binary search. The arrays
being searched ar... | The Computer Language Benchmarks Game
contributed by
(ns fasta
(:gen-class))
(set! *warn-on-reflection* true)
(defmacro my-unchecked-inc-int [& args]
(if (and (== (*clojure-version* :major) 1)
(== (*clojure-version* :minor) 2))
`(unchecked-inc ~@args)
`(unchecked-inc-int ~@args)))
(d... |
fc020b664bb0e3c33a6dbd10bd46481e220e6b5c8e30ecbc7f8d436520392060 | abakst/Brisk | spawn00.hs | # LANGUAGE ScopedTypeVariables #
{-# OPTIONS_GHC -fplugin Brisk.Plugin #-}
# OPTIONS_GHC -fplugin - opt Brisk . Plugin : main #
module Scratch where
import Control.Distributed.Process
main :: Process ProcessId
main = do p <- spawnLocal $ do p <- expect
send p (0 :: Int)
send ... | null | https://raw.githubusercontent.com/abakst/Brisk/3e4ce790a742d3e3b786dba45d36f715ea0e61ef/examples/spawn00.hs | haskell | # OPTIONS_GHC -fplugin Brisk.Plugin # | # LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -fplugin - opt Brisk . Plugin : main #
module Scratch where
import Control.Distributed.Process
main :: Process ProcessId
main = do p <- spawnLocal $ do p <- expect
send p (0 :: Int)
send p ()
expect :: Process ProcessId... |
f5bbb338e6af7b31d5daad203dd9234c90f199990d118ecdef3a1f460a5505f4 | derekmcloughlin/pearls | chap13b.hs | import Data.List
import System.Environment (getArgs)
transform :: Ord a => [a] -> ([a], Int)
transform xs = (map last xss, position xs xss)
where
xss = sort (rots xs)
position :: Eq a => a -> [a] -> Int
position xs xss = length (takeWhile (/= xs) xss)
rots :: [a] -> [[a]]
rots xs = take (length xs... | null | https://raw.githubusercontent.com/derekmcloughlin/pearls/42bc6ea0fecc105386a8b75789f563d44e05b772/chap13/chap13b.hs | haskell | call of `recreate` needs to be the length of the transformed string.
| import Data.List
import System.Environment (getArgs)
transform :: Ord a => [a] -> ([a], Int)
transform xs = (map last xss, position xs xss)
where
xss = sort (rots xs)
position :: Eq a => a -> [a] -> Int
position xs xss = length (takeWhile (/= xs) xss)
rots :: [a] -> [[a]]
rots xs = take (length xs... |
b672290aeddbb25d3a45989a85775600f3c104359260f23183051c121831154d | patrikja/AFPcourse | Shallow.hs | module DSL.Shallow where
| : : Double|
| =
, Point -- | = Vec|
| : :
, rot -- | :: Angle -> Point -> Point|
)
empty :: Shape
disc :: Shape -- disc with radius |1| around the origin
square :: Shape -- square between... | null | https://raw.githubusercontent.com/patrikja/AFPcourse/1a079ae80ba2dbb36f3f79f0fc96a502c0f670b6/exam/2012-08/DSL/Shallow.hs | haskell | | = Vec|
| :: Angle -> Point -> Point|
disc with radius |1| around the origin
square between |(0,0)| and |(1,1)|
shift the shape along a vector
magnify the shape by a vector
rotate the shape by an angle (around the origin)
run function: is the point inside the shape?
... | module DSL.Shallow where
| : : Double|
| =
| : :
)
empty :: Shape
union :: Shape -> Shape -> Shape
intersect :: Shape -> Shape -> Shape
difference :: Shape -> Shape -> Shape
newtype Shape = Shape {runShape :: Point -> Bool}
inside = flip runShape
empty ... |
3da60462403788c4614b363e9041b4bbf0f8927042248dc5194fbc911b511f6c | Zulu-Inuoe/winutil | moving-a-window.lisp | (defpackage #:com.inuoe.winutil.examples.moving-a-window
(:use #:cl)
(:import-from #:win32)
(:import-from #:winutil)
(:export
#:main))
(in-package #:com.inuoe.winutil.examples.moving-a-window)
(defclass moving-a-window (winutil:window)
((x-label
:type winutil:hwnd-wrapper
:accessor x-label)
(y... | null | https://raw.githubusercontent.com/Zulu-Inuoe/winutil/85f9b8df95d772a94a07addf5b0f81f7da3df4d5/examples/zetcode/moving-a-window.lisp | lisp | (defpackage #:com.inuoe.winutil.examples.moving-a-window
(:use #:cl)
(:import-from #:win32)
(:import-from #:winutil)
(:export
#:main))
(in-package #:com.inuoe.winutil.examples.moving-a-window)
(defclass moving-a-window (winutil:window)
((x-label
:type winutil:hwnd-wrapper
:accessor x-label)
(y... | |
2488816a77f42d9781b2d5e3bb5aa3b60b1b661c45ecb8a47993b276bbb9700b | juspay/atlas | Fulfillment.hs | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | null | https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/parking-bap/src/Core/OnStatus/Fulfillment.hs | haskell | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | |
7cb924a1240273ebf6d2f74373b925b7d437521f08271dbb973be3278f84bab7 | joelburget/lvca | Repl.ml | open Base
open Brr
open Brr_note
open Lvca_syntax
open Lvca_util
open Note
let buf = "input"
module Evaluation = struct
module Lang =
[%lvca.abstract_syntax_module
{|
string : *
nominal : *
evaluation := Evaluation(string; nominal);
|}
, { string = "Primitive.String"; nominal = "Nominal.Term" }]
inclu... | null | https://raw.githubusercontent.com/joelburget/lvca/dc1a9b2fbaed013c5d57d7fe63dd4a05062c93d5/pages/Repl.ml | ocaml | TODO: generate this
Extract current signal's event | open Base
open Brr
open Brr_note
open Lvca_syntax
open Lvca_util
open Note
let buf = "input"
module Evaluation = struct
module Lang =
[%lvca.abstract_syntax_module
{|
string : *
nominal : *
evaluation := Evaluation(string; nominal);
|}
, { string = "Primitive.String"; nominal = "Nominal.Term" }]
inclu... |
36bbe0ecd985bd866b770a4bb1aeb1fa1bed40ea3295c8cadef9127c7e74460f | openweb-nl/open-bank-mark | project.clj | (defproject nl.openweb/synchronizer "0.1.0-SNAPSHOT"
:plugins [[lein-modules "0.3.11"]]
:dependencies [[clj-http "3.10.0" :exclusions [commons-logging]]
[nl.openweb/topology :version]
[org.clojure/clojure :version]
... | null | https://raw.githubusercontent.com/openweb-nl/open-bank-mark/786c940dafb39c36fdbcae736fe893af9c00ef17/synchronizer/project.clj | clojure | (defproject nl.openweb/synchronizer "0.1.0-SNAPSHOT"
:plugins [[lein-modules "0.3.11"]]
:dependencies [[clj-http "3.10.0" :exclusions [commons-logging]]
[nl.openweb/topology :version]
[org.clojure/clojure :version]
... | |
44aa30b4d974d1366207f61e35fd4cc768bbfd56a22e217c026cf6568cdbfee5 | Bogdanp/racket-gui-extra | status-bar.rkt | #lang racket/base
(require (only-in mred/private/wx/common/event control-event%)
(prefix-in base: racket/base)
racket/class
racket/list
"common.rkt"
"ffi.rkt"
(prefix-in mred: "mred.rkt"))
(provide
status-bar-menu%)
(import-class NSMenu NSMenuItem NSStatusBar)
... | null | https://raw.githubusercontent.com/Bogdanp/racket-gui-extra/6e1d2d154427707424dcc8bbfe2115009e38d3d4/gui-extra-lib/gui/extra/private/cocoa/status-bar.rkt | racket | mred ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
container ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
FIXME: Need keymap support. Called before `set-label`.
HACK: Act as if we are the top-level window in order to support
submenus.
callbacks ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;... | #lang racket/base
(require (only-in mred/private/wx/common/event control-event%)
(prefix-in base: racket/base)
racket/class
racket/list
"common.rkt"
"ffi.rkt"
(prefix-in mred: "mred.rkt"))
(provide
status-bar-menu%)
(import-class NSMenu NSMenuItem NSStatusBar)
... |
19ceae36d78db636a52678b80268edcfd2670431e8555f079cf24f542037bd9b | mfoemmel/erlang-otp | dets.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/stdlib/src/dets.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 1996 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(dets).
-export([all/0,
bchunk/2... |
f2a37c4a254ff8eb780133ca568ae5f4f4dcdee5219982154e6faef749b8327c | byorgey/BlogLiterately | Setup.hs | import Distribution.Simple
main = defaultMain
| null | https://raw.githubusercontent.com/byorgey/BlogLiterately/fbc8dc238c7e5bc570bef4d0c1dd9cf2f92de72a/Setup.hs | haskell | import Distribution.Simple
main = defaultMain
| |
55b5da1d8604b9839e48fd8f0427e79829b9ac0697c3d709d77a39b07c79faa1 | david-broman/modelyze | extArray.ml |
* ExtList - additional and modified functions for lists .
* Copyright ( C ) 2005 ( rich @ annexia.org )
*
* This library 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
... | null | https://raw.githubusercontent.com/david-broman/modelyze/e48c934283e683e268a9dfd0fed49d3c10277298/ext/extlib/extArray.ml | ocaml | Use a bitset to store which elements will be in the final array.
Allocate the final array and copy elements into it.
Use a bitset to store which elements will be in which final array.
Allocate the final arrays and copy elements into them.
This assumes, reasonably, that init traverses the array in order. |
* ExtList - additional and modified functions for lists .
* Copyright ( C ) 2005 ( rich @ annexia.org )
*
* This library 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
... |
64fd823b51e9dee2d817f708cde15d0f330906d978263922d99eaa39717452ad | vaclavsvejcar/headroom | PureScriptSpec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE TypeApplications #
# LANGUAGE NoImplicitPrelude #
module Headroom.FileSupport.PureScriptSpec
( spec
)
where
import Headroom.Config
( makeHeadersConfig
, parseAppConfig
)
import Headroom.Config.Types (AppConfig (..))
import ... | null | https://raw.githubusercontent.com/vaclavsvejcar/headroom/3b20a89568248259d59f83f274f60f6e13d16f93/test/Headroom/FileSupport/PureScriptSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE RecordWildCards #
# LANGUAGE TypeApplications #
# LANGUAGE NoImplicitPrelude #
module Headroom.FileSupport.PureScriptSpec
( spec
)
where
import Headroom.Config
( makeHeadersConfig
, parseAppConfig
)
import Headroom.Config.Types (AppConfig (..))
import Headroom.Embedded (defaultConfig)
i... |
14046e91af006e4c2790872038bd2b5c9d32198d4f5aa118fe5a5df23b348d0e | mattsta/er | er_app.erl | -module(er_app).
-behaviour(application).
%% Application callbacks
-export([start/0, start/2, stop/1]).
%% ===================================================================
%% Application callbacks
%% ===================================================================
start() ->
er_sup:start_link().
start(_St... | null | https://raw.githubusercontent.com/mattsta/er/7ac6dccf4952ddf32d921b6548026980a3db70c7/src/er_app.erl | erlang | Application callbacks
===================================================================
Application callbacks
=================================================================== | -module(er_app).
-behaviour(application).
-export([start/0, start/2, stop/1]).
start() ->
er_sup:start_link().
start(_StartType, _StartArgs) ->
start().
stop(_State) ->
ok.
|
015e09cf993f339b1168001ac33209e05529894fc2a48bde6f98fc6e1957ccdb | AlexCharlton/site-generator | test-server.lisp | (in-package :site-generator)
# # Test server
(export '(run-test-server))
(defvar *quit* nil)
(defvar *acceptor*)
(defun run-test-server (dir &optional (port 4242))
"Pathname &optional Integer -> nil
Start a test server and watch the site for changes."
(set-root-dir dir)
(check-site)
(init-db)
(start-serve... | null | https://raw.githubusercontent.com/AlexCharlton/site-generator/a827cfeccc72527de44ec048f1b9dd703eb6fe8f/src/test-server.lisp | lisp | (in-package :site-generator)
# # Test server
(export '(run-test-server))
(defvar *quit* nil)
(defvar *acceptor*)
(defun run-test-server (dir &optional (port 4242))
"Pathname &optional Integer -> nil
Start a test server and watch the site for changes."
(set-root-dir dir)
(check-site)
(init-db)
(start-serve... | |
ba649121fc16a23d8d253eca5cf504ec887eb50bfc3c41dd9a15ade60fd9f0cf | FlogFr/FlashCard | Template.hs | module Template where
import Protolude
import Data.HashMap.Strict
import Control.Concurrent.STM.TMVar
import Control.Exception
import Text.Mustache
import Text.Blaze.Html
import SharedEnv
import Data.Settings
import HandlerM
data LCException = TemplateParseException
deriving (Show)
instance Exception LCException
... | null | https://raw.githubusercontent.com/FlogFr/FlashCard/17029f9b84f23c43f67702b77bd7418cdf0a9d28/src/Template.hs | haskell | if the key exists in the templateCache', return it
if the template doesnt exists, load and compile the
template with the partials, then save it into the
cache
check the cache
substituteTemplate template context = substitute template (object ["ctx" ~= context]) | module Template where
import Protolude
import Data.HashMap.Strict
import Control.Concurrent.STM.TMVar
import Control.Exception
import Text.Mustache
import Text.Blaze.Html
import SharedEnv
import Data.Settings
import HandlerM
data LCException = TemplateParseException
deriving (Show)
instance Exception LCException
... |
10306c19c0f70cdb635f9640001403788f0273b89ec7c7442bee80dcf246bf9e | clj-commons/rewrite-cljs | keyword.cljs | (ns rewrite-clj.node.keyword
(:require [rewrite-clj.node.protocols :as node]))
;; ## Node
(defrecord KeywordNode [k namespaced?]
node/Node
(tag [_] :token)
(printable-only? [_] false)
(sexpr [_]
(if (and namespaced?
(not (namespace k)))
;; (keyword
;; (name (ns-name *ns*))
;; ... | null | https://raw.githubusercontent.com/clj-commons/rewrite-cljs/5b0fdea43a6748519d0b0ad3d7eaa98aa541de35/src/rewrite_clj/node/keyword.cljs | clojure | ## Node
(keyword
(name (ns-name *ns*))
(name k)) | (ns rewrite-clj.node.keyword
(:require [rewrite-clj.node.protocols :as node]))
(defrecord KeywordNode [k namespaced?]
node/Node
(tag [_] :token)
(printable-only? [_] false)
(sexpr [_]
(if (and namespaced?
(not (namespace k)))
(throw (js/Error. "Namespaced keywords not supported !"))
... |
019f16e92989ce49e402e126d478c967e972674fc352f79743aaa8c293229354 | jellelicht/guix | password-utils.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2015 < >
Copyright © 2015 , 2016 < >
Copyright © 2015
Copyright © 2016 < >
Copyright © 2016 < >
Copyright © 2016 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or mod... | null | https://raw.githubusercontent.com/jellelicht/guix/83cfc9414fca3ab57c949e18c1ceb375a179b59c/gnu/packages/password-utils.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 © 2015 < >
Copyright © 2015 , 2016 < >
Copyright © 2015
Copyright © 2016 < >
Copyright © 2016 < >
Copyright © 2016 < >
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 . ... |
1a362e757e20f119f6cbd673fbcaa52ac37e98b22f70fd6b3d38912ccbd652f8 | input-output-hk/plutus | PubKeyHashes.hs | {-# LANGUAGE PackageImports #-}
# LANGUAGE TemplateHaskell #
module Examples.PubKeyHashes
where
import "cryptonite" Crypto.PubKey.ECC.ECDSA
import Crypto.PubKey.ECC.Generate
import Crypto.PubKey.ECC.Types
import "cryptonite" Crypto.Random
import Data.Map (Map)
import Data.Map qualified as Map
import Data.Set (Set)
... | null | https://raw.githubusercontent.com/input-output-hk/plutus/1af96af28f45030c94e11138a2f13869e9e63b79/doc/notes/model/UTxO.hsproj/Examples/PubKeyHashes.hs | haskell | # LANGUAGE PackageImports #
hence, we have got some defintions here that we want to use in 'Examples.PubKey'.
This is very sad! | # LANGUAGE TemplateHaskell #
module Examples.PubKeyHashes
where
import "cryptonite" Crypto.PubKey.ECC.ECDSA
import Crypto.PubKey.ECC.Generate
import Crypto.PubKey.ECC.Types
import "cryptonite" Crypto.Random
import Data.Map (Map)
import Data.Map qualified as Map
import Data.Set (Set)
import Data.Set qualified as Set
... |
a1e07fb7d179bc29b115787ab118c71aa7dfd274785a0ef034c849f81afa4206 | lehins/primal | MVar.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
module Main where
import qualified Control.Concurrent.MVar as Base
import Primal.Concurrent.MVar
import Primal.Eval
import Primal.Monad
import Criterion.Main
import Data.Coerce
import qualified Data.IORef as Base
import Primal.Ref
impor... | null | https://raw.githubusercontent.com/lehins/primal/c620bfd4f2a6475f1c12183fbe8138cf29ab1dad/primal/bench/MVar.hs | haskell | # LANGUAGE BangPatterns # | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
module Main where
import qualified Control.Concurrent.MVar as Base
import Primal.Concurrent.MVar
import Primal.Eval
import Primal.Monad
import Criterion.Main
import Data.Coerce
import qualified Data.IORef as Base
import Primal.Ref
import qualified UnliftIO.MVar as U... |
4848ad4f7ebb474feeba9540bb1a77083bf4c5a8f48e654a60705b7c63100e40 | onedata/op-worker | monitoring_state.erl | %%%-------------------------------------------------------------------
@author
( C ) 2016 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
%%% Persistent state of monitoring wor... | null | https://raw.githubusercontent.com/onedata/op-worker/b09f05b6928121cec4d6b41ce8037fe056e6b4b3/src/modules/datastore/models/system/monitoring_state.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
Persistent state of monitoring worker.
@end
-------------------------------------------------------------------
API
datastore_model callbacks
==========================... | @author
( C ) 2016 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
-module(monitoring_state).
-author("Michal Wrona").
-include("modules/datastore/datastore_models.hrl").
-include("modules/datastore/datastore_runner.hrl").
-export([save/1, get/1, exists/1, update... |
10b94d29bace1b1aa9dc9d23d10dbd3db73ac9304c16113d6f34cc00d2c51a70 | privet-kitty/cl-competitive | gray-code.lisp | (defpackage :cp/test/gray-code
(:use :cl :fiveam :cp/gray-code)
(:import-from :cp/test/base #:base-suite))
(in-package :cp/test/gray-code)
(in-suite base-suite)
(test gray-code
(is (zerop (gray-to-natural 0)))
(is (zerop (natural-to-gray 0)))
(finishes
(dotimes (x 100)
(assert (= (natural-to-gray (... | null | https://raw.githubusercontent.com/privet-kitty/cl-competitive/4d1c601ff42b10773a5d0c5989b1234da5bb98b6/module/test/gray-code.lisp | lisp | (defpackage :cp/test/gray-code
(:use :cl :fiveam :cp/gray-code)
(:import-from :cp/test/base #:base-suite))
(in-package :cp/test/gray-code)
(in-suite base-suite)
(test gray-code
(is (zerop (gray-to-natural 0)))
(is (zerop (natural-to-gray 0)))
(finishes
(dotimes (x 100)
(assert (= (natural-to-gray (... | |
33d8346f4c56a95689f9da2c3e4f0cccec686328eeeca3b082b9ff4be96a7ff7 | serioga/webapp-clojure-2020 | core.clj | (ns lib.clojure.core
(:refer-clojure :exclude [assert, future])
(:require [lib.clojure.assert]
[lib.clojure.exception]
[lib.clojure.future]
[lib.clojure.lang]
[lib.clojure.print]
[medley.core]
[potemkin :refer [import-vars]]))
(set! *warn-on-r... | null | https://raw.githubusercontent.com/serioga/webapp-clojure-2020/306ea852739eb318b286731c7dbbc6724ee10586/src/lib/clojure/core.clj | clojure | The `declare` is a workaround for name resolution in Cursive.
See -ide/cursive/issues/2411. | (ns lib.clojure.core
(:refer-clojure :exclude [assert, future])
(:require [lib.clojure.assert]
[lib.clojure.exception]
[lib.clojure.future]
[lib.clojure.lang]
[lib.clojure.print]
[medley.core]
[potemkin :refer [import-vars]]))
(set! *warn-on-r... |
efc921d774ef255980396dcb278b16aaf9c9de9d439aa5214977a82a5b00c2fd | janestreet/merlin-jst | typeclass.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/janestreet/merlin-jst/00f0a2c961fbf5a968125b33612d60224a573f40/src/ocaml/typing/typeclass.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Parsetree
open Asttypes
open Path
open Types
open Typecore
open Typetexp
open Format
type 'a class_inf... |
e91bbe55cdaf593ea2763c41c14571beaa764bda9fda3405f04780972192cd75 | troy-west/apache-kafka-number-stations-clj | radio.clj | (ns numbers.radio
(:require [numbers.image :as image]
[numbers.kafka :as kafka])
(:import (org.apache.kafka.clients.producer ProducerRecord KafkaProducer)))
(defn listen
"Nearly three hours of Numbers Station broadcast from 1557125670763 to 1557135278803"
[]
(image/obsfuscate image/source))
(def... | null | https://raw.githubusercontent.com/troy-west/apache-kafka-number-stations-clj/d38b8ef57c38c056b41e1d24a2b8671479113300/src/numbers/radio.clj | clojure | implement me! | (ns numbers.radio
(:require [numbers.image :as image]
[numbers.kafka :as kafka])
(:import (org.apache.kafka.clients.producer ProducerRecord KafkaProducer)))
(defn listen
"Nearly three hours of Numbers Station broadcast from 1557125670763 to 1557135278803"
[]
(image/obsfuscate image/source))
(def... |
1ec48429cb3794521368b9221d228a3174520970771ddc05867bf20e3fa0b77d | janestreet/base | test_uniform_array.ml | open! Import
open Uniform_array
let does_raise = Exn.does_raise
let zero_obj = Stdlib.Obj.repr (0 : int)
(* [create_obj_array] *)
let%test_unit _ =
let t = create_obj_array ~len:0 in
assert (length t = 0)
;;
(* [create] *)
let%test_unit _ =
let str = Stdlib.Obj.repr "foo" in
let t = create ~len:2 str in
as... | null | https://raw.githubusercontent.com/janestreet/base/1462b7d5458e96569275a1c673df968ecbf3342f/test/test_uniform_array.ml | ocaml | [create_obj_array]
[create]
not a double array
[empty]
[singleton]
[get], [unsafe_get], [set], [unsafe_set], [unsafe_set_assuming_currently_int],
[set_with_caml_modify] | open! Import
open Uniform_array
let does_raise = Exn.does_raise
let zero_obj = Stdlib.Obj.repr (0 : int)
let%test_unit _ =
let t = create_obj_array ~len:0 in
assert (length t = 0)
;;
let%test_unit _ =
let str = Stdlib.Obj.repr "foo" in
let t = create ~len:2 str in
assert (phys_equal (get t 0) str);
asser... |
2f36088b03f6dcf129adbc6fbd02e9a65908ee95e00aa502e8a2a4849f98b0b7 | tact-lang/tact-obsolete | codegen_func.ml | open Shared.Disabled
module Config = Shared.DisabledConfig
let%expect_test "simple function generation" =
let source = {|
fn test() -> Integer { return 0; }
|} in
pp_codegen source ~strip_defaults:true ;
[%expect
{|
forall Value1, Value2 -> Value1 tensor2_value1((Value1, Value2) tensor) {
... | null | https://raw.githubusercontent.com/tact-lang/tact-obsolete/35c56ecdc14ab80a86e03312f7812221376eade2/test/codegen_func.ml | ocaml | open Shared.Disabled
module Config = Shared.DisabledConfig
let%expect_test "simple function generation" =
let source = {|
fn test() -> Integer { return 0; }
|} in
pp_codegen source ~strip_defaults:true ;
[%expect
{|
forall Value1, Value2 -> Value1 tensor2_value1((Value1, Value2) tensor) {
... | |
d55b18cdc35648aeeaedbb22767ef349533968b173452dcfcc1c466d6b765a7e | symbiont-io/detsys-testkit | Log.hs | # LANGUAGE DerivingStrategies #
# LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ScopedTypeVariables #
module StuntDouble.Log where
import Control.Monad (forM)
import Data.Aeson
import qualified Data.Aeson.Text as AesonText
import Data.Aeson.Encoding
... | null | https://raw.githubusercontent.com/symbiont-io/detsys-testkit/29a3a0140730420e4c5cc8db23df6fdb03f9302c/src/runtime-prototype/src/StuntDouble/Log.hs | haskell | # LANGUAGE OverloadedStrings #
----------------------------------------------------------------------
XXX : State
XXX : State
XXX : UTCTime
XXX: State
XXX: State
XXX: UTCTime
XXX: Use more efficient data structure to avoid having to reverse.
AdminTransport wants the messages to be `String`, otherwise we coul... | # LANGUAGE DerivingStrategies #
# LANGUAGE DeriveGeneric #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ScopedTypeVariables #
module StuntDouble.Log where
import Control.Monad (forM)
import Data.Aeson
import qualified Data.Aeson.Text as AesonText
import Data.Aeson.Encoding
( encodingToLazyByteString
... |
6edfb353939006e2b69eb3930176054f2ed41d0e875c59b034abb0ff10fb64b8 | rm-hull/inkspot | palette.clj | (ns inkspot.palette
(:require [inkspot.color :as color])
(:import (java.awt Color Graphics2D GraphicsEnvironment RenderingHints)
(java.awt.image BufferedImage)
(java.io StringWriter)
(org.apache.batik.dom GenericDOMImplementation)
(org.apache.batik.svggen SVGGraphics2D)))... | null | https://raw.githubusercontent.com/rm-hull/inkspot/ccb7a452a0930f451bcc6c960024d6029f616cd2/src/inkspot/palette.clj | clojure | (ns inkspot.palette
(:require [inkspot.color :as color])
(:import (java.awt Color Graphics2D GraphicsEnvironment RenderingHints)
(java.awt.image BufferedImage)
(java.io StringWriter)
(org.apache.batik.dom GenericDOMImplementation)
(org.apache.batik.svggen SVGGraphics2D)))... | |
58a11799595f39122964e1860bd10dcd251f5d8ff42c7cebcdff1b415b219c5b | janestreet/core | immediate_option.ml | include Immediate_option_intf
| null | https://raw.githubusercontent.com/janestreet/core/b0be1daa71b662bd38ef2bb406f7b3e70d63d05f/core/src/immediate_option.ml | ocaml | include Immediate_option_intf
| |
4f53df3420f8e37d49fe980398f27ae86e4fb2a6b752b118ee2926ac6d394cb9 | lisp/de.setf.resource | utilities.lisp | -*- Mode : lisp ; Syntax : ansi - common - lisp ; Base : 10 ; Package : de.setf.resource.implementation ; -*-
(in-package :de.setf.resource.implementation)
(:documentation
"This file defines tests for utilities in the `de.setf.resource` Common Lisp library."
(copyright
"Copyright 2010 [james anderson](mailt... | null | https://raw.githubusercontent.com/lisp/de.setf.resource/27bf6dfb3b3ca99cfd5a6feaa5839d99bfb4d29e/test/utilities.lisp | lisp | Syntax : ansi - common - lisp ; Base : 10 ; Package : de.setf.resource.implementation ; -*-
without even the
(test:execute-test :resource.utilities.**) |
(in-package :de.setf.resource.implementation)
(:documentation
"This file defines tests for utilities in the `de.setf.resource` Common Lisp library."
(copyright
"Copyright 2010 [james anderson](mailto:) All Rights Reserved"
"'de.setf.resource' is free software: you can redistribute it and/or modify it under... |
6f2b66d26daefed6e34b9e1ea7c6d44e59ec7c2d3e736256e52fe22326c4f209 | ygmpkk/house | GIFops.hs | From InternetLib by ,
-- /~hallgren/InternetLib/
module GIFops where
import GIF
import Data.Array.Unboxed(listArray)
import Data.Word(Word8)
apRasterData f gif = gif { data_blocks=map db (data_blocks gif) }
where
db = either Left (Right . im)
im image = image { raster_data = f (image_descriptor image) (r... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/kernel/Gadgets/Images/GIFops.hs | haskell | /~hallgren/InternetLib/
map fromIntegral | From InternetLib by ,
module GIFops where
import GIF
import Data.Array.Unboxed(listArray)
import Data.Word(Word8)
apRasterData f gif = gif { data_blocks=map db (data_blocks gif) }
where
db = either Left (Right . im)
im image = image { raster_data = f (image_descriptor image) (raster_data image) }
decomp... |
7123b8fcba6bb75935d4842e42372dfcd885300781457a66906760b63c7503eb | masaeedu/monoidal | Category.hs | module Control.Category.Sub.Category where
import Data.Subtypes (Trivial)
import GHC.Exts (Constraint)
import Control.Category (Category(..))
class Category p => SubCat (p :: k -> k -> *)
where
type Ob p :: k -> Constraint
type Ob p = Trivial
instance SubCat (->)
| null | https://raw.githubusercontent.com/masaeedu/monoidal/c48fa8745a08bad58e6d37041e59a0e88d10805d/src/Control/Category/Sub/Category.hs | haskell | module Control.Category.Sub.Category where
import Data.Subtypes (Trivial)
import GHC.Exts (Constraint)
import Control.Category (Category(..))
class Category p => SubCat (p :: k -> k -> *)
where
type Ob p :: k -> Constraint
type Ob p = Trivial
instance SubCat (->)
| |
a65a21b51180fe0f093c82851e9937172a30639a513a2d00dd181caae2127cb3 | e-wrks/edh | Monad.hs | module Language.Edh.Monad where
-- import Debug.Trace
-- import GHC.Stack
import Control.Applicative
import Control.Concurrent.STM
import Control.Exception
import Control.Monad.State.Strict
import qualified Data.ByteString as B
import Data.Dynamic
import Data.Hashable
import Data.IORef
import Data.Lossless.Decimal (D... | null | https://raw.githubusercontent.com/e-wrks/edh/b791397dbe4c669e6e3b6dc07e3cad67cffdaba1/elr/src/Language/Edh/Monad.hs | haskell | import Debug.Trace
import GHC.Stack
| Scriptability enabling monad
The @Edh@ monad is friendly to scripted concurrency and transactional
Note @Edh@ is rather slow in run speed, as a cost of scriptability.
exception thrown, wherever any 'liftSTM' 'liftEIO' or 'liftIO' is
issued in execution of ... | module Language.Edh.Monad where
import Control.Applicative
import Control.Concurrent.STM
import Control.Exception
import Control.Monad.State.Strict
import qualified Data.ByteString as B
import Data.Dynamic
import Data.Hashable
import Data.IORef
import Data.Lossless.Decimal (Decimal)
import qualified Data.Lossless.Dec... |
09a9879a5c5cd47bd7e95475197835332b574b1e177b43dbb98b4f96528bd11f | jordanthayer/ocaml-search | histogram_dataset.ml | * Histograms show an approximate distribution given a set of
floating point values .
@author jtd7
@since 2010 - 05 - 24
floating point values.
@author jtd7
@since 2010-05-24
*)
open Num_by_num_dataset
open Drawing
open Geometry
let f_compare a b =
let v = a -. b in
if v < 0. t... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/spt/src/num_by_num/histogram_dataset.ml | ocaml | * The length of the line drawn in the legend.
* the index of the bin that should contain [value]. Note that any
value outside the range of representable integers, such as
[infinity], may yield a garbage value, such as 0! If you might
pass such a value, test before calling! (This routine is intended
... | * Histograms show an approximate distribution given a set of
floating point values .
@author jtd7
@since 2010 - 05 - 24
floating point values.
@author jtd7
@since 2010-05-24
*)
open Num_by_num_dataset
open Drawing
open Geometry
let f_compare a b =
let v = a -. b in
if v < 0. t... |
e35fdd008fdfa947c750d77c48cbb5109e62fba8b836f4dac00ce58a7bf06864 | jherrlin/guitar-theory-training | drills.cljs | (ns v2.se.jherrlin.music-theory.webapp.drills)
| null | https://raw.githubusercontent.com/jherrlin/guitar-theory-training/8a5df5749c4a051653eb597936d528d35b54694d/src/v2/se/jherrlin/music_theory/webapp/drills.cljs | clojure | (ns v2.se.jherrlin.music-theory.webapp.drills)
| |
8ff94aad0df2c1d8b7ba261889d3886b71974519a5d75b712353338cd2954848 | sangkilc/ofuzz | misc.mli | (* ofuzz - ocaml fuzzing platform *)
* miscellaneous
@author < sangkil.cha\@gmail.com >
@since 2014 - 03 - 19
@author Sang Kil Cha <sangkil.cha\@gmail.com>
@since 2014-03-19
*)
Copyright ( c ) 2014 ,
All rights reserved .
Redistribution and use in source and binary forms , ... | null | https://raw.githubusercontent.com/sangkilc/ofuzz/ba53cc90cc06512eb90459a7159772d75ebe954f/src/misc.mli | ocaml | ofuzz - ocaml fuzzing platform
* Read lines from a file
* Exit with showing an error message
* Piping
* Get file size
* Obtain an absolute path of a binary by resolving PATH environment
* Unix.time() float to string |
* miscellaneous
@author < sangkil.cha\@gmail.com >
@since 2014 - 03 - 19
@author Sang Kil Cha <sangkil.cha\@gmail.com>
@since 2014-03-19
*)
Copyright ( c ) 2014 ,
All rights reserved .
Redistribution and use in source and binary forms , with or without
modification , are ... |
b81cd391b509a2bc5589b5cdcfdad9d033a76ccd07854d27a9feb4cc2a9fcaf5 | ucsd-progsys/nate | program_loading.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet Cr... | null | https://raw.githubusercontent.com/ucsd-progsys/nate/8b1267cd8b10283d8bc239d16a28c654a4cb8942/eval/sherrloc/easyocaml%2B%2B/debugger/program_loading.mli | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Objective Caml port by and
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 .
... |
7666cc66a6609c056f0b0127f2f4be5a3bfbf4977c3604aa46efccf094bd341c | irfn/clojure-ocr | test.clj | (ns test
(:use clojure.test))
(def tests
[
'test.string-ops
'test.ocr
])
(doseq [test tests] (require test))
(apply run-tests tests)
(shutdown-agents) | null | https://raw.githubusercontent.com/irfn/clojure-ocr/c89da89031379a9c0367c68884caf4fcb40bb2da/test/test.clj | clojure | (ns test
(:use clojure.test))
(def tests
[
'test.string-ops
'test.ocr
])
(doseq [test tests] (require test))
(apply run-tests tests)
(shutdown-agents) | |
a2e774471c91d42572359aeaf5c11786d968b66da020b928bc832851b169f6bd | emqx/esockd | dtls_psk_client.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2019 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the L... | null | https://raw.githubusercontent.com/emqx/esockd/9b959fc11a1c398a589892f335235be6c5b4a454/examples/dtls_psk/dtls_psk_client.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2019 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(dtls_psk_client).
-export([ connect/0
, connect/1
, send/2
, recv/2
... |
171b37b09d90c110cb254b1d8e7492006b1c0d55ae8f441de22267dd6a66117b | tamarin-prover/tamarin-prover | SecretChannels.hs | # LANGUAGE PatternGuards #
-- |
Copyright : ( c ) 2019 < >
-- License : GPL v3 (see LICENSE)
--
Maintainer : < >
Portability : GHC only
--
-- Compute annotations for always-secret channels
--
-- A channel is defined always-secret iff it correspond to a fresh variable
-- only used as a channel ident... | null | https://raw.githubusercontent.com/tamarin-prover/tamarin-prover/b14a9e06f20c36a4811944f9216d8826eaa68eab/lib/sapic/src/Sapic/SecretChannels.hs | haskell | |
License : GPL v3 (see LICENSE)
Compute annotations for always-secret channels
A channel is defined always-secret iff it correspond to a fresh variable
only used as a channel identifier. For these channels, we can use a more
efficient translation, as the adversary can never deduce then, and thus only
a s... | # LANGUAGE PatternGuards #
Copyright : ( c ) 2019 < >
Maintainer : < >
Portability : GHC only
module Sapic.SecretChannels (
annotateSecretChannels
) where
import Data.Set as S
import Data.List as L
import Sapic.Annotation
import Sapic.Basetranslation
impo... |
593bce0d035732626049b89cc7eb9e82c794fe8c5575fac14697315a31d951cf | samply/blaze | routes_test.clj | (ns blaze.rest-api.routes-test
(:require
[blaze.db.impl.search-param]
[blaze.rest-api.routes :as routes]
[blaze.rest-api.routes-spec]
[blaze.test-util :as tu]
[clojure.spec.test.alpha :as st]
[clojure.test :as test :refer [deftest testing]]
[juxt.iota :refer [given]]
[reitit.ring]))
... | null | https://raw.githubusercontent.com/samply/blaze/6441a0a2f988b8784ed555c1d20f634ef2df7e4a/modules/rest-api/test/blaze/rest_api/routes_test.clj | clojure | (ns blaze.rest-api.routes-test
(:require
[blaze.db.impl.search-param]
[blaze.rest-api.routes :as routes]
[blaze.rest-api.routes-spec]
[blaze.test-util :as tu]
[clojure.spec.test.alpha :as st]
[clojure.test :as test :refer [deftest testing]]
[juxt.iota :refer [given]]
[reitit.ring]))
... | |
71c3818acf9bbe8112479f25d2bcf0869af02495c74a7925bfa8ba444f88e99c | acl2/acl2 | full-escape-symbol@useless-runes.lsp | (XDOC::FULL-ESCAPE-SYMBOL)
| null | https://raw.githubusercontent.com/acl2/acl2/f64742cc6d41c35f9d3f94e154cd5fd409105d34/books/xdoc/.sys/full-escape-symbol%40useless-runes.lsp | lisp | (XDOC::FULL-ESCAPE-SYMBOL)
| |
9d6566ed05e69cbfe69d87af8a53e108ecdc350bd1b9faa7ee267f30debf4ab9 | juspay/atlas | SearchRequestForDriver.hs | # LANGUAGE DerivingVia #
# LANGUAGE GeneralizedNewtypeDeriving #
# OPTIONS_GHC -Wno - orphans #
|
Copyright 2022 Juspay Technologies Pvt Ltd
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 L... | null | https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/driver-offer-bpp/src/Domain/Types/SearchRequestForDriver.hs | haskell | # LANGUAGE DerivingVia #
# LANGUAGE GeneralizedNewtypeDeriving #
# OPTIONS_GHC -Wno - orphans #
|
Copyright 2022 Juspay Technologies Pvt Ltd
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 L... | |
549d254827d35c049c61f7110b3b2f7ef61fb9f213dab3b1e95a078362ac9c2d | coco-team/lustrec | c_backend_main.ml | (********************************************************************)
(* *)
The LustreC compiler toolset / The LustreC Development Team
Copyright 2012 - -- ONERA - CNRS - INPT
(* ... | null | https://raw.githubusercontent.com/coco-team/lustrec/b21f9820df97e661633cd4418fdab68a6c6ca67d/src/backends/C/c_backend_main.ml | ocaml | ******************************************************************
LustreC is free software, distributed WITHOUT ANY WARRANTY
under the terms of the GNU Lesser General Public L... | The LustreC compiler toolset / The LustreC Development Team
Copyright 2012 - -- ONERA - CNRS - INPT
version 2.1 .
open Lustre_types
open Machine_code_types
open Corelang
open Machine_code_common
open Format
open C_backend_co... |
f2371d001ddabc576c8099cdea27dcae1bb6adc59993c9074d7226814d053628 | janestreet/bonsai | start.ml | open! Core
open! Async_kernel
open! Import
open Js_of_ocaml
module type Result_spec = sig
type t
type extra
type incoming
val view : t -> Vdom.Node.t
val extra : t -> extra
val incoming : t -> incoming -> unit Vdom.Effect.t
end
module Arrow_deprecated = struct
module Handle = struct
module Injector... | null | https://raw.githubusercontent.com/janestreet/bonsai/782fecd000a1f97b143a3f24b76efec96e36a398/web/start.ml | ocaml | I can't use currying here because of the value restriction. | open! Core
open! Async_kernel
open! Import
open Js_of_ocaml
module type Result_spec = sig
type t
type extra
type incoming
val view : t -> Vdom.Node.t
val extra : t -> extra
val incoming : t -> incoming -> unit Vdom.Effect.t
end
module Arrow_deprecated = struct
module Handle = struct
module Injector... |
ef15cac5b0322469efd8fd85adc7a2455542c2e2df5ab8d52932739aab59164e | TrustInSoft/tis-interpreter | metrics_gui.mli | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of Frama - C.
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/plugins/metrics/metrics_gui.mli | ocaml | ************************************************************************
alternatives)
... | Modified by TrustInSoft
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Softwa... |
e31490da1d00d42e28ba8f553ab012cf9013a2af059ae334f9f471d0a2499119 | fragnix/fragnix | Data.HashPSQ.hs | # LANGUAGE Haskell98 #
# LINE 1 " src / Data / HashPSQ.hs " #
| A ' HashPSQ ' offers very similar performance to ' IntPSQ ' . In case of
-- collisions, it uses an 'OrdPSQ' locally to solve those.
--
This means worst case complexity is usually given by /O(min(n , W ) , log n)/ ,
where /W/ is the number of bits in ... | null | https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/tests/packages/application/Data.HashPSQ.hs | haskell | collisions, it uses an 'OrdPSQ' locally to solve those.
since /log n/ is always smaller than /W/ on current machines.
* Type
* Query
* Construction
* Insertion
* Delete/update
* Lists
* Views
* Traversal
* Validity check | # LANGUAGE Haskell98 #
# LINE 1 " src / Data / HashPSQ.hs " #
| A ' HashPSQ ' offers very similar performance to ' IntPSQ ' . In case of
This means worst case complexity is usually given by /O(min(n , W ) , log n)/ ,
where /W/ is the number of bits in an ' Int ' . This simplifies to /O(min(n , W))/
module Data.Ha... |
5fd0fd90ffb99b174482e1bde71650fdf40227021813642bb809a1197fea8220 | spurious/sagittarius-scheme-mirror | ports.sps | #!r6rs
(import (tests r6rs io ports)
(tests r6rs test)
(rnrs io simple))
(display "Running tests for (rnrs io ports)\n")
(run-io-ports-tests)
(report-test-results)
| null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/test/r6rs-test-suite/tests/r6rs/run/io/ports.sps | scheme | #!r6rs
(import (tests r6rs io ports)
(tests r6rs test)
(rnrs io simple))
(display "Running tests for (rnrs io ports)\n")
(run-io-ports-tests)
(report-test-results)
| |
b87a3dbf4fb9fb43dfa909e5003ecd4d4f0da4dcf8451d388a322fed0cc81277 | mbutterick/brag | internal-support.rkt | #lang racket/base
(require brag/support)
(provide current-source
current-parser-error-handler
current-tokenizer-error-handler)
;; During parsing, we should define the source of the input.
(define current-source (make-parameter 'unknown))
;; When an parse error happens, we call the current-parser-... | null | https://raw.githubusercontent.com/mbutterick/brag/6c161ae31df9b4ae7f55a14f754c0b216b60c9a6/brag-lib/brag/private/internal-support.rkt | racket | During parsing, we should define the source of the input.
When an parse error happens, we call the current-parser-error-handler:
When a tokenization error happens, we call the current-tokenizer-error-handler. | #lang racket/base
(require brag/support)
(provide current-source
current-parser-error-handler
current-tokenizer-error-handler)
(define current-source (make-parameter 'unknown))
(define current-parser-error-handler
(make-parameter
(lambda (tok-name tok-value offset line col span)
(raise ... |
747902da055a4566a5e50ada424ca571a9cb504b67d59df35b6efd59eb347f27 | dharmatech/abstracting | str.scm |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define (str-obj s)
(let ((len (string-length s))
(ref (lambda (i) (string-ref s i)))
(set (lambda (i elt) (string-set! s i elt))))
(let ((first-index 0)
(last-index (- len 1)))
(let ((before-beginning? (lambda (i) (< i first-i... | null | https://raw.githubusercontent.com/dharmatech/abstracting/9dc5d9f45a9de03c6ee379f1928ebb393dfafc52/src/str/str.scm | scheme |
(define (str-obj s)
(let ((len (string-length s))
(ref (lambda (i) (string-ref s i)))
(set (lambda (i elt) (string-set! s i elt))))
(let ((first-index 0)
(last-index (- len 1)))
(let ((before-beginning? (lambda (i) (< i first-index)))
(after-end? (lambda (i) (> i last-index))))
(let ... | |
4a0ad808f1c0b6e209d5fe7b3894c0fa50f72fdadda092ba71836ac33c4d84d0 | ocaml-sf/learn-ocaml-corpus | assured_win_incorrect.ml | open Seq
(* -------------------------------------------------------------------------- *)
(* The size of a tree. *)
let rec size (t : tree) : int =
match t with
| TLeaf _ ->
1
| TNonLeaf offspring ->
1 + size_offspring offspring
and size_offspring (offspring : offspring) : int =
match offspring(... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/alpha_beta/wrong/assured_win_incorrect.ml | ocaml | --------------------------------------------------------------------------
The size of a tree.
--------------------------------------------------------------------------
The height of a tree.
--------------------------------------------------------------------------
Evaluating a tree, with a sense parameter:... | open Seq
let rec size (t : tree) : int =
match t with
| TLeaf _ ->
1
| TNonLeaf offspring ->
1 + size_offspring offspring
and size_offspring (offspring : offspring) : int =
match offspring() with
| Nil ->
0
| Cons ((_move, t), offspring) ->
size t + size_offspring offspring
le... |
774e2a201a85bebf960ada5241e855a2a14ebf57dae5337cb4561bacf7c91cb8 | mirage/ptt | aggregate.ml | let ( <.> ) f g x = f (g x)
module By_domain = Map.Make (struct
type t = [ `host ] Domain_name.t
let compare = Domain_name.compare
end)
module By_ipaddr = Map.Make (Ipaddr)
type unresolved_elt = [ `All | `Postmaster | `Local of Emile.local list ]
type resolved_elt = [ `All | `Local of Emile.local list ]
let po... | null | https://raw.githubusercontent.com/mirage/ptt/b555f7b132850de257d8f8d731cdf2a7723c9ab1/lib/aggregate.ml | ocaml | let ( <.> ) f g x = f (g x)
module By_domain = Map.Make (struct
type t = [ `host ] Domain_name.t
let compare = Domain_name.compare
end)
module By_ipaddr = Map.Make (Ipaddr)
type unresolved_elt = [ `All | `Postmaster | `Local of Emile.local list ]
type resolved_elt = [ `All | `Local of Emile.local list ]
let po... | |
91bb1be5ed7a6e24c6b3ba61e69b1b78092b15c1e504096b06c87d9b1eba2e75 | fulcro-legacy/semantic-ui-wrapper | ui_placeholder_line.cljs | (ns fulcrologic.semantic-ui.elements.placeholder.ui-placeholder-line
(:require
[fulcrologic.semantic-ui.factory-helpers :as h]
["semantic-ui-react/dist/commonjs/elements/Placeholder/PlaceholderLine" :default PlaceholderLine]))
(def ui-placeholder-line
"A placeholder can contain have lines of text.
Pro... | null | https://raw.githubusercontent.com/fulcro-legacy/semantic-ui-wrapper/b0473480ddfff18496df086bf506099ac897f18f/semantic-ui-wrappers-shadow/src/main/fulcrologic/semantic_ui/elements/placeholder/ui_placeholder_line.cljs | clojure | (ns fulcrologic.semantic-ui.elements.placeholder.ui-placeholder-line
(:require
[fulcrologic.semantic-ui.factory-helpers :as h]
["semantic-ui-react/dist/commonjs/elements/Placeholder/PlaceholderLine" :default PlaceholderLine]))
(def ui-placeholder-line
"A placeholder can contain have lines of text.
Pro... | |
993717a32a6ce8cab9c5c3469552b2e8956c63ae4f0bf08710b7c876ad444856 | ivanjovanovic/sicp | e-2.9.scm | Exercise 2.9 .
;
The width of an interval is half of the difference between its upper and lower bounds .
; The width is a measure of the uncertainty of the number specified by the interval.
For some arithmetic operations the width of the result of combining two intervals
; is a function only of the widths of the... | null | https://raw.githubusercontent.com/ivanjovanovic/sicp/a3bfbae0a0bda414b042e16bbb39bf39cd3c38f8/2.1/e-2.9.scm | scheme |
The width is a measure of the uncertainty of the number specified by the interval.
is a function only of the widths of the argument intervals, whereas for others the width
of the combination is not a function of the widths of the argument intervals. Show that
of the intervals being added (or subtracted). Give e... | Exercise 2.9 .
The width of an interval is half of the difference between its upper and lower bounds .
For some arithmetic operations the width of the result of combining two intervals
the width of the sum ( or difference ) of two intervals is a function only of the widths
we can prove that sum - interval a... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.