_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 |
|---|---|---|---|---|---|---|---|---|
3922e92339198104072232631d16695431b54a94efb0aa1634d6eeff4504b009 | nomnom-insights/nomnom.duckula | compojure_test.clj | (ns duckula.compojure-test
"Verifies mounting a duckula handler under a Compojure namespace/prefix"
(:require
[cheshire.core :as json]
[clj-http.client :as http.client]
[clojure.test :refer [deftest is testing use-fixtures]]
[compojure.core :as compojure]
[duckula.avro]
[duckula.handler]
[ducku... | null | https://raw.githubusercontent.com/nomnom-insights/nomnom.duckula/a6c8ee965da5717c5909bfbda5745be7a287d2ce/test/duckula/compojure_test.clj | clojure | (ns duckula.compojure-test
"Verifies mounting a duckula handler under a Compojure namespace/prefix"
(:require
[cheshire.core :as json]
[clj-http.client :as http.client]
[clojure.test :refer [deftest is testing use-fixtures]]
[compojure.core :as compojure]
[duckula.avro]
[duckula.handler]
[ducku... | |
aba28365e24d4eb11fa56c9e9081c4cbcd6504d21d2a45c2e441080f0394054e | eashanhatti/peridot | Extras.hs | module Extras where
import Data.Map qualified as Map
import Shower
import Data.Maybe
import Data.Sequence
import Debug.Trace
import Data.Functor.Identity
import Prelude hiding(concatMap, concat, filter, null, length)
import Data.Set qualified as Set
fromRight :: Either () a -> a
fromRight (Right x) = x
(!) :: (Ord k... | null | https://raw.githubusercontent.com/eashanhatti/peridot/09fcde7fe2a2db6ca814ff35602c323388d6b4f9/src/Extras.hs | haskell | module Extras where
import Data.Map qualified as Map
import Shower
import Data.Maybe
import Data.Sequence
import Debug.Trace
import Data.Functor.Identity
import Prelude hiding(concatMap, concat, filter, null, length)
import Data.Set qualified as Set
fromRight :: Either () a -> a
fromRight (Right x) = x
(!) :: (Ord k... | |
4095af94a89be224f1aeeb205f532d3a8af81f239d421f53824f0094afa8bc38 | aimacode/aima-lisp | test-agents.lisp | ;;; File: agents/test.lisp -*- Mode: Lisp; -*-
(deftest agents
"Test agents in the vacuum and wumpus worlds."
"Here is how to run an environment, in this case the vacuum world."
"We specify the maximum number of steps, but that is optional:"
((run-environment (make-vacuum-world :max-steps 10)))
"You can tur... | null | https://raw.githubusercontent.com/aimacode/aima-lisp/fbbe545aa3797c031877e62de49a991faff458ed/agents/test-agents.lisp | lisp | File: agents/test.lisp -*- Mode: Lisp; -*- |
(deftest agents
"Test agents in the vacuum and wumpus worlds."
"Here is how to run an environment, in this case the vacuum world."
"We specify the maximum number of steps, but that is optional:"
((run-environment (make-vacuum-world :max-steps 10)))
"You can turn off the display (with :stream nil), and just ... |
7383c8e56da082da6b3d7119504354a7b764b74e0f48011747826d9ce2558f6f | K2InformaticsGmbH/dderl | dderl_data_sender_sup.erl | -module(dderl_data_sender_sup).
-behaviour(supervisor).
%% API
-export([start_link/0
,start_sender/3
,terminate_sender/1
,list_senders/0]).
%% Supervisor callbacks
-export([init/1]).
%% Helper macro for declaring children of supervisor
-define(CHILD(I), {I, {I, start_link, []}, temporary, 50... | null | https://raw.githubusercontent.com/K2InformaticsGmbH/dderl/84697547fe8009db7964baa4eceb876fd78512a0/src/dderl_data_sender_sup.erl | erlang | API
Supervisor callbacks
Helper macro for declaring children of supervisor
===================================================================
API functions
===================================================================
===================================================================
Supervisor callback... | -module(dderl_data_sender_sup).
-behaviour(supervisor).
-export([start_link/0
,start_sender/3
,terminate_sender/1
,list_senders/0]).
-export([init/1]).
-define(CHILD(I), {I, {I, start_link, []}, temporary, 5000, worker, [I]}).
-spec start_link() -> ignore | {error, term()} | {ok, pid()}.
st... |
65d2e2b9bd5097c9bb05141c8a7efb366ce352e4472dc1dac5c303d01e94b149 | openworkload/swm-core | wm_cert.erl | -module(wm_cert).
-export([create/3, get_uid/1]).
-include_lib("public_key/include/public_key.hrl").
-include_lib("public_key/include/OTP-PUB-KEY.hrl").
-define(OPENSSL, "openssl").
-define(SSH_KEYGEN, "ssh-keygen").
-define(SECUREDIR, "secure").
-define(USERSDIR, "users").
-define(CAGRIDDIR, "grid").
-define(CACLUS... | null | https://raw.githubusercontent.com/openworkload/swm-core/525e7854a0dc7231371cc0c22802c2f872951132/src/lib/wm_cert.erl | erlang | ============================================================================
API functions
============================================================================
============================================================================
Implementation functions
============================================... | -module(wm_cert).
-export([create/3, get_uid/1]).
-include_lib("public_key/include/public_key.hrl").
-include_lib("public_key/include/OTP-PUB-KEY.hrl").
-define(OPENSSL, "openssl").
-define(SSH_KEYGEN, "ssh-keygen").
-define(SECUREDIR, "secure").
-define(USERSDIR, "users").
-define(CAGRIDDIR, "grid").
-define(CACLUS... |
a1c4152db82ada6ff5c170c8b0ff50c1af79232c95971ec1854837c42afb152e | jarvinet/scheme | variable.scm | (define foo 1)
(display foo)
| null | https://raw.githubusercontent.com/jarvinet/scheme/47633d7fc4d82d739a62ceec75c111f6549b1650/bin/compiler/test/variable.scm | scheme | (define foo 1)
(display foo)
| |
6d216ffd5600aabe96531dfef0d33b4be8d613feb98fb538c4227ea615dffaaa | sacerdot/MiniErlangBlockchain | reconstruct_act.erl | -module(reconstruct_act).
-import (chain_tools , [reconstructing/4,checkBlock/1]).
-export([chainRestore/3]).
! behavior a PidB
chainRestore(PidRoot,PidB,Chain) ->
receive
{updateChain, NewChain} ->
aggiorno la visione della catena a seguito di un nuovo blocco minato da me
chainRes... | null | https://raw.githubusercontent.com/sacerdot/MiniErlangBlockchain/46713c579204994a528d2e642c8f7c0670c2a832/CaputoConteducaLazazzera-Node/actors/reconstruct_act.erl | erlang | blocco valido
io:format("Miner killed (~p)~n",[PidM]), | -module(reconstruct_act).
-import (chain_tools , [reconstructing/4,checkBlock/1]).
-export([chainRestore/3]).
! behavior a PidB
chainRestore(PidRoot,PidB,Chain) ->
receive
{updateChain, NewChain} ->
aggiorno la visione della catena a seguito di un nuovo blocco minato da me
chainRes... |
0906a7c6a2dbf95245747662001fd892888a03438b0c33c7f8417f3202f2b8c9 | mivoq/hunpos | vocab.mli | type t
val create : unit -> t
val toindex : t -> string -> int
val toword : t -> int -> string
val ngram_toindex : t-> string list -> int list
val max : t -> int
val fix_old_vocab : t -> t
| null | https://raw.githubusercontent.com/mivoq/hunpos/0f0f775039fa749e67711c07ac681a16c0979349/util/vocab.mli | ocaml | type t
val create : unit -> t
val toindex : t -> string -> int
val toword : t -> int -> string
val ngram_toindex : t-> string list -> int list
val max : t -> int
val fix_old_vocab : t -> t
| |
87c4e4217ce587a6c4e688cd39caa9171c3bbc0acdac4dd803f9f6b893fea513 | Bogdanp/marionette | info.rkt | #lang info
(define license 'BSD-3-Clause)
(define collection 'multi)
(define deps '())
(define build-deps '("base"
"marionette-lib"
"rackunit-lib"))
(define update-implies '("marionette-lib"))
| null | https://raw.githubusercontent.com/Bogdanp/marionette/60e4bb15b7fbd05ac5743e3c0cdaa9fa157dfa94/marionette-test/info.rkt | racket | #lang info
(define license 'BSD-3-Clause)
(define collection 'multi)
(define deps '())
(define build-deps '("base"
"marionette-lib"
"rackunit-lib"))
(define update-implies '("marionette-lib"))
| |
2d9dafc25e6e677473ea299a01dc2836be4a622e7404327237cbcca985dc2275 | CryptoKami/cryptokami-core | Mem.hs | {-# LANGUAGE RankNTypes #-}
-- | Utilities for manipulating in-memory SSC state.
-- TODO: the names for functions are pretty bad
module Pos.Ssc.Mem
(
* ' MonadSscMem '
SscMemTag
, MonadSscMem
, askSscMem
, syncingStateWith
-- * Local state
, SscLocalQuery
,... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/ssc/Pos/Ssc/Mem.hs | haskell | # LANGUAGE RankNTypes #
| Utilities for manipulating in-memory SSC state.
TODO: the names for functions are pretty bad
* Local state
* Global state
--------------------------------------------------------------------------
--------------------------------------------------------------------------
| Applies state c... |
module Pos.Ssc.Mem
(
* ' MonadSscMem '
SscMemTag
, MonadSscMem
, askSscMem
, syncingStateWith
, SscLocalQuery
, SscLocalUpdate
, sscRunLocalQuery
, sscRunLocalSTM
, SscGlobalQuery
, SscGlobalUpdate
, sscRunGlobalQuery
, s... |
18881de6b5152a57728c3b5751bf2d65c5fd469723de54bb1083d6cadf6a06c6 | zyrolasting/racket-vulkan | mandelbrot-raw.rkt | #lang racket
Credit @Erkaman for original under MIT License
;
;
Adapted to Racket to test Vulkan FFI bindings and demonstrate that
hand - porting C++ to Racket is a feasible means to that end .
;
; "The application launches a compute shader that renders the mandelbrot set,
; by rendering it into a storage buffe... | null | https://raw.githubusercontent.com/zyrolasting/racket-vulkan/1e983e921fb41b59994cea0fc0ebd859ec847186/examples/mandelbrot/mandelbrot-raw.rkt | racket |
"The application launches a compute shader that renders the mandelbrot set,
by rendering it into a storage buffer. The storage buffer is then read from
I am changing the comments and program structure as it comes to this module.
Creates the means to interact with a physical device
Now find a family that suppo... | #lang racket
Credit @Erkaman for original under MIT License
Adapted to Racket to test Vulkan FFI bindings and demonstrate that
hand - porting C++ to Racket is a feasible means to that end .
the GPU , and saved as .png . " --
(require racket/runtime-path
ffi/unsafe
ffi/cvector
(only... |
267b087ea03e63205fb27ea747f22e2ad29b9cc1b6ef4996ac620f195f0c6d1c | waddlaw/TAPL | Pretty.hs | module Language.SimpleLambda.Pretty
( prettySimpleText,
)
where
import Data.Text.Prettyprint.Doc
import Data.Text.Prettyprint.Doc.Render.Text
import Language.SimpleLambda.Types
import RIO
prettySimpleText :: Context -> SimpleTypedLambda -> Text
prettySimpleText ctx = renderStrict . layoutCompact . pprSimple ctx
| null | https://raw.githubusercontent.com/waddlaw/TAPL/94576e46821aaf7abce6d1d828fc3ce6d05a40b8/subs/lambda-simple/src/Language/SimpleLambda/Pretty.hs | haskell | module Language.SimpleLambda.Pretty
( prettySimpleText,
)
where
import Data.Text.Prettyprint.Doc
import Data.Text.Prettyprint.Doc.Render.Text
import Language.SimpleLambda.Types
import RIO
prettySimpleText :: Context -> SimpleTypedLambda -> Text
prettySimpleText ctx = renderStrict . layoutCompact . pprSimple ctx
| |
a658a2b882520069a1861facbef5c8a9b75418055ef31dbe222c280b23811908 | gelisam/category-syntax | Syntax.hs | {-# LANGUAGE RecordWildCards, TemplateHaskell #-}
module Control.Category.Syntax (getInput, returnC, syntax, debugSyntax) where
import Language.Haskell.TH
import Control.Category.Syntax.Builtin
import Control.Category.Syntax.Debug
import Control.Category.Syntax.Parse
import Control.Category.Syntax.Print
import Contro... | null | https://raw.githubusercontent.com/gelisam/category-syntax/5f13d8c47c904070888c4c3a68270cebaf6be803/src/Control/Category/Syntax.hs | haskell | # LANGUAGE RecordWildCards, TemplateHaskell # | module Control.Category.Syntax (getInput, returnC, syntax, debugSyntax) where
import Language.Haskell.TH
import Control.Category.Syntax.Builtin
import Control.Category.Syntax.Debug
import Control.Category.Syntax.Parse
import Control.Category.Syntax.Print
import Control.Category.Syntax.Types
import Control.Category.Sy... |
564a7ef8f1da2fca0eddb2fd09b7620884894995e2d54bc35decb87f9b712592 | mistupv/cauder-core | utils_gui.erl | -module(utils_gui).
-export([is_app_loaded/0, is_app_running/0,
option_to_button_label/1, button_to_option/1,
disable_rule_buttons/1, set_button_label_if/2, set_ref_button_if/2,
set_choices/1, disable_all_buttons/0, enable_perm_buttons/0,
clear_texts/0, stop_refs/0, update_status_tex... | null | https://raw.githubusercontent.com/mistupv/cauder-core/b676fccd1bbd629eb63f3cb5259f7a9a8c6da899/src/utils_gui.erl | erlang | added toggle for graphic viewer
Freeze control when inserting text
Put scroll back at the top | -module(utils_gui).
-export([is_app_loaded/0, is_app_running/0,
option_to_button_label/1, button_to_option/1,
disable_rule_buttons/1, set_button_label_if/2, set_ref_button_if/2,
set_choices/1, disable_all_buttons/0, enable_perm_buttons/0,
clear_texts/0, stop_refs/0, update_status_tex... |
7596712ec1cfffe5f09e586faa37761306a01aef701df788ee7ffac143690bf1 | a-vorontsov/aver | parse.ml | open Lexing
let print_error_position lexbuf =
let pos = lexbuf.lex_curr_p in
Printf.sprintf "line:%d column:%d" pos.pos_lnum
(pos.pos_cnum - pos.pos_bol + 1)
let parse lexbuf =
try Parser.prog Lexer.read_token lexbuf with
| Lexer.Error msg ->
Printf.eprintf "Lexing Error at %s: %s\n"
(print_... | null | https://raw.githubusercontent.com/a-vorontsov/aver/366ae0e6332b6811bbe415bd5cf60d4dcfc4a70a/compiler/parse.ml | ocaml | open Lexing
let print_error_position lexbuf =
let pos = lexbuf.lex_curr_p in
Printf.sprintf "line:%d column:%d" pos.pos_lnum
(pos.pos_cnum - pos.pos_bol + 1)
let parse lexbuf =
try Parser.prog Lexer.read_token lexbuf with
| Lexer.Error msg ->
Printf.eprintf "Lexing Error at %s: %s\n"
(print_... | |
f204a01baebd17a448fdbc37dc86a3a911728d56d32b121f00ce19cb5717d292 | icicle-lang/icicle-ambiata | Base.hs | -- | Just some junk for generating arbitrary instances
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - orphans #
module Icicle.Test.Arbitrary.Base where
import Test.QuickCheck
import P
-- | Make a smaller generator
smaller :: Gen a -> Gen a
smaller g
= sized
$ \s -> resize (s `div` ... | null | https://raw.githubusercontent.com/icicle-lang/icicle-ambiata/9b9cc45a75f66603007e4db7e5f3ba908cae2df2/icicle-compiler/test/Icicle/Test/Arbitrary/Base.hs | haskell | | Just some junk for generating arbitrary instances
| Make a smaller generator
| Take list of small generators and list of large generators.
Look at the size of thing we want to create, and use either small or both
| Same as oneof_sized but smalls are just values, not generators
| For when you only want values | # LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - orphans #
module Icicle.Test.Arbitrary.Base where
import Test.QuickCheck
import P
smaller :: Gen a -> Gen a
smaller g
= sized
$ \s -> resize (s `div` 2) g
oneof_sized :: [Gen a] -> [Gen a] -> Gen a
oneof_sized smalls bigs
= sized
$... |
57a90a1b005879398154ffb7efcd79cef4e8658c2f2407e5fd9130a57610ce85 | clojure/clojurescript | json.clj | Copyright ( c ) , 2012 . All rights reserved . The use
and distribution terms for this software are covered by the Eclipse
;; Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this
;; distribution. By using this software in any fashion, you are
;; agreeing to be bound ... | null | https://raw.githubusercontent.com/clojure/clojurescript/e30e26dbd221b5d7c4bbc567d10d0c3c01cf5f98/src/main/clojure/cljs/vendor/clojure/data/json.clj | clojure | Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this
distribution. By using this software in any fashion, you are
agreeing to be bound by the terms of this license. You must not
remove this notice, or any other, from this software.
JSON READER
Expects to be called with ... | Copyright ( c ) , 2012 . All rights reserved . The use
and distribution terms for this software are covered by the Eclipse
(ns ^{:author "Stuart Sierra"
:doc "JavaScript Object Notation (JSON) parser/generator.
See /"}
cljs.vendor.clojure.data.json
(:refer-clojure :exclude (read))
(:require [cloj... |
044548c6dbacca03738258c40c9d21e0868f2fba8e30c02da098ba2bb58427f7 | BitGameEN/bitgamex | id_gen.erl | %%%--------------------------------------
%%% @Module : id_gen
%%% @Description: 唯一id生成(基于CouchBase)
%%%--------------------------------------
-module(id_gen).
-export(
[
start_link/2,
set_start_id/2,
gen_id/1
]
).
-include("common.hrl").
start_link(ConnPoolSize, Host) ->
{ok, Pi... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/lib/id_gen.erl | erlang | --------------------------------------
@Module : id_gen
@Description: 唯一id生成(基于CouchBase)
-------------------------------------- | -module(id_gen).
-export(
[
start_link/2,
set_start_id/2,
gen_id/1
]
).
-include("common.hrl").
start_link(ConnPoolSize, Host) ->
{ok, Pid} = cberl:start_link(?IDGEN, ConnPoolSize, Host, "", "", "id_gen"),
init_start_ids(),
{ok, Pid}.
set_start_id(Type, StartId) when is_a... |
5fd9df71b99cb002a6b3f019468bec68a00083a67ffe5dd5e866ac41336dd37c | vaclavsvejcar/headroom | PHP.hs | # LANGUAGE QuasiQuotes #
# LANGUAGE NoImplicitPrelude #
-- |
Module : Headroom . FileSupport . PHP
Description : Support for /PHP/ source code files
Copyright : ( c ) 2019 - 2022
-- License : BSD-3-Clause
-- Maintainer :
-- Stability : experimental
-- Portability : POSIX
--
Basic support for... | null | https://raw.githubusercontent.com/vaclavsvejcar/headroom/3b20a89568248259d59f83f274f60f6e13d16f93/src/Headroom/FileSupport/PHP.hs | haskell | |
License : BSD-3-Clause
Maintainer :
Stability : experimental
Portability : POSIX
extract any variables or template data.
---------------------------- PUBLIC FUNCTIONS ------------------------------
---------------------------- PRIVATE FUNCTIONS ----------------------------- | # LANGUAGE QuasiQuotes #
# LANGUAGE NoImplicitPrelude #
Module : Headroom . FileSupport . PHP
Description : Support for /PHP/ source code files
Copyright : ( c ) 2019 - 2022
Basic support for /PHP/ source code files . This implementation does n't
module Headroom.FileSupport.PHP
( fileSupport
... |
05c54f0bbfb180f388c38b8fc072a4b0febbf606de8443cbe96509b032e3ad0b | jordanthayer/ocaml-search | float_ref.ml | * floating point references
@author eaburns
@since 2010 - 07 - 25
@author eaburns
@since 2010-07-25
*)
type t = { mutable data : float }
type float_ref = t
let float_ref f = { data = f }
let (<--) r f = r.data <- f
let (!!) r = r.data
let incf t =
t.data <- t.data +. 1.
let addf t v =
... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/wrutils/float_ref.ml | ocaml | * floating point references
@author eaburns
@since 2010 - 07 - 25
@author eaburns
@since 2010-07-25
*)
type t = { mutable data : float }
type float_ref = t
let float_ref f = { data = f }
let (<--) r f = r.data <- f
let (!!) r = r.data
let incf t =
t.data <- t.data +. 1.
let addf t v =
... | |
7f25b6ea72eee77afc4b3455043776dff54ca434d474c0a486f6ac03e6afe80b | ghc/packages-dph | Bool.hs | {-# OPTIONS -Wall -fno-warn-orphans -fno-warn-missing-signatures #-}
# LANGUAGE CPP #
#include "fusion-phases.h"
module Data.Array.Parallel.Unlifted.Distributed.Data.Bool
( orD
, andD)
where
import Data.Array.Parallel.Unlifted.Distributed.Data.Scalar.Base ()
import Data.Array.Parallel.Unlifted.D... | null | https://raw.githubusercontent.com/ghc/packages-dph/64eca669f13f4d216af9024474a3fc73ce101793/dph-prim-par/Data/Array/Parallel/Unlifted/Distributed/Data/Bool.hs | haskell | # OPTIONS -Wall -fno-warn-orphans -fno-warn-missing-signatures #
| OR together all instances of a distributed 'Bool'.
| AND together all instances of a distributed 'Bool'. | # LANGUAGE CPP #
#include "fusion-phases.h"
module Data.Array.Parallel.Unlifted.Distributed.Data.Bool
( orD
, andD)
where
import Data.Array.Parallel.Unlifted.Distributed.Data.Scalar.Base ()
import Data.Array.Parallel.Unlifted.Distributed.Primitive.DPrim
import Data.Array.Parallel.Unlifted.Distri... |
194f9994e8a23a5d103dcbcbfce074bad9aa79d0d2406fd4f5b489e282cd4de1 | jsarracino/spyder | Spyder.hs | module Language.Spyder (
file2Boogie
, file2Boogiefile
, hs
, main
) where
import qualified Language.Spyder.AST.Imp as IST
import Language.Boogie.AST as BST
import qualified Language.Spyder.Translate as Translate
import qualified Language.Spyder.Parser as Parser
import Text . PrettyPrint . ( pretty , hPutDo... | null | https://raw.githubusercontent.com/jsarracino/spyder/926dc7846c5cbdd38f80b8b5c94e140d0602d53a/Language/Spyder.hs | haskell | maybeReader :: (String -> Maybe a) -> ReadM a
maybeReader f = do
arg <- readerAsk
maybe (readerError $ "cannot parse value `" ++ arg ++ "'") return . f $ arg
path to input file
path to output file
spyder_source_size = re.match("\(source: size (\d+)\).*$",spy_contents).group(1)
spyder_invariant_size = re.ma... | module Language.Spyder (
file2Boogie
, file2Boogiefile
, hs
, main
) where
import qualified Language.Spyder.AST.Imp as IST
import Language.Boogie.AST as BST
import qualified Language.Spyder.Translate as Translate
import qualified Language.Spyder.Parser as Parser
import Text . PrettyPrint . ( pretty , hPutDo... |
2438a4c17886d1bc070236d11a74cd1c9d1e4337a6169a4100fd3653708a14b7 | kappamodeler/kappa | session.ml | open Mods2
open Network
open Iso
open Rule
open Data
open Solution
open Printf
let rule_global_id r = None
let agent_global_id ag = None
(*******************Nodes*********************)
(*Log*)
type log = log_entry PortMap.t
entry_t : 0 ( info ) | 1 ( Warning ) | > 1 & & <3 ( Error ) | > 3 ( internal )
and lo... | null | https://raw.githubusercontent.com/kappamodeler/kappa/de63d1857898b1fc3b7f112f1027768b851ce14d/simplx_rep/src/main/session.ml | ocaml | ******************Nodes********************
Log
no message to display
COMPLX TYPES
Story
negative value to have an increasing map
adding weak arrows i-->_w j only if i-->_s j
Simulation
Influence map
obs
rule
**************session*************
I have put a protection to prevent crashes
adding the exception that are ... | open Mods2
open Network
open Iso
open Rule
open Data
open Solution
open Printf
let rule_global_id r = None
let agent_global_id ag = None
type log = log_entry PortMap.t
entry_t : 0 ( info ) | 1 ( Warning ) | > 1 & & <3 ( Error ) | > 3 ( internal )
and log_entry = {entry_t:int; message:string ; line:int option... |
5a8f4c8e3ed3af199452698492ca2ce3855db66f2260506b5401f8aa86afcaa8 | facebook/infer | Predicates.ml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/facebook/infer/a216a42386ab2b5ae3df971a1bc143d7f6c14738/infer/src/biabduction/Predicates.ml | ocaml | * offset for an lvalue
* an atom is a pure atomic formula
* equality
* disequality
* predicate symbol applied to exps
* negated predicate symbol applied to exps
* kind of lseg or dllseg predicates
* True when the value was obtained by doing case analysis on null in a procedure call.
* instrumentation of heap va... |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
08747cdbdba5dd594fd18a66de262dd1f99efebdba760fc99a295d2a4709a075 | nikodemus/SBCL | ir1final.lisp | ;;;; This file implements the IR1 finalize phase, which checks for
;;;; various semantic errors.
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;... | null | https://raw.githubusercontent.com/nikodemus/SBCL/3c11847d1e12db89b24a7887b18a137c45ed4661/src/compiler/ir1final.lisp | lisp | This file implements the IR1 finalize phase, which checks for
various semantic errors.
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
Give the user grief about optimizations that we weren'... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB!C")
(defun note-failed-optimization (node failures)
(declare (type combination node) (list failures))
(u... |
8631829ed4104ddfe84a6f89f909554f8d78337b9d527b5f0b072083532915ce | stumpwm/stumpwm | iresize.lisp | Copyright ( C ) 2003 - 2008
;;
This file is part of stumpwm .
;;
stumpwm is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 , or ( at your option )
;; any later version.
stumpwm is ... | null | https://raw.githubusercontent.com/stumpwm/stumpwm/7fe59c00810b35843139194525db444a2c26aa72/iresize.lisp | lisp |
you can redistribute it and/or modify
either version 2 , or ( at your option )
any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
along with this software; see the file COPY... | Copyright ( C ) 2003 - 2008
This file is part of stumpwm .
it under the terms of the GNU General Public License as published by
stumpwm is distributed in the hope that it will be useful ,
You should have received a copy of the GNU General Public License
(in-package #:stumpwm)
(export '(*resize-increme... |
4c71ab29918efbc20cea845a73997e86d0b89796b25eab1ad5090934ad9ef5c9 | skanev/playground | 29-tests.scm | (require rackunit rackunit/text-ui)
(load "../29.scm")
(define sicp-2.29-tests
(test-suite
"Tests for SICP exercise 2.29"
(check-equal? (left-branch (make-mobile (make-branch 1 2)
(make-branch 3 4)))
(make-branch 1 2))
(check-equal? (right-b... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/02/tests/29-tests.scm | scheme | (require rackunit rackunit/text-ui)
(load "../29.scm")
(define sicp-2.29-tests
(test-suite
"Tests for SICP exercise 2.29"
(check-equal? (left-branch (make-mobile (make-branch 1 2)
(make-branch 3 4)))
(make-branch 1 2))
(check-equal? (right-b... | |
8a05ef4ff7781c779d0049bd59a78a10fc6775d90745a934f2d7317852be2322 | JunSuzukiJapan/cl-reex | reduce-test.lisp | (defpackage reduce-test
(:use :cl
:cl-reex
:cl-reex-test.logger
:prove)
(:shadowing-import-from :cl-reex :skip))
(in-package :reduce-test)
NOTE : To run this test file , execute ` ( asdf : test - system : cl - reex ) ' in your Lisp .
(plan 5)
;; blah blah blah.
(defparameter logger (make-instance ... | null | https://raw.githubusercontent.com/JunSuzukiJapan/cl-reex/94928c7949c235b41902138d9e4a5654b92d67eb/tests/reduce-test.lisp | lisp | blah blah blah. | (defpackage reduce-test
(:use :cl
:cl-reex
:cl-reex-test.logger
:prove)
(:shadowing-import-from :cl-reex :skip))
(in-package :reduce-test)
NOTE : To run this test file , execute ` ( asdf : test - system : cl - reex ) ' in your Lisp .
(plan 5)
(defparameter logger (make-instance 'logger))
(defpara... |
0a7f779eb14a2e18164c0e719591f48068e6e5db6ae6218aebd899117c5840ed | bgusach/exercises-htdp2e | ex-156.rkt | #lang htdp/bsl
(require 2htdp/image)
(require 2htdp/universe)
(require test-engine/racket-tests)
# # # CONSTANTS
(define HEIGHT 400)
(define WIDTH 600)
(define XSHOTS (/ WIDTH 2))
(define YSPEED -5)
(define BACKGROUND (empty-scene WIDTH HEIGHT))
(define SHOT (triangle 5 "solid" "red"))
# # # DATA DEFINITIONS
;... | null | https://raw.githubusercontent.com/bgusach/exercises-htdp2e/c4fd33f28fb0427862a2777a1fde8bf6432a7690/ex-156.rkt | racket | A Shot is a integer Number
- '()
- (cons Shot List-of-shots)
interpretation: list of fired shots
WorldState -> Image
handles the key events
handles the ticking of the world | #lang htdp/bsl
(require 2htdp/image)
(require 2htdp/universe)
(require test-engine/racket-tests)
# # # CONSTANTS
(define HEIGHT 400)
(define WIDTH 600)
(define XSHOTS (/ WIDTH 2))
(define YSPEED -5)
(define BACKGROUND (empty-scene WIDTH HEIGHT))
(define SHOT (triangle 5 "solid" "red"))
# # # DATA DEFINITIONS
... |
c73c9aac003ddb74382f2b096444afff0e463474014a81f9ca1242e6d58ab335 | jwoudenberg/shy | Main.hs | module Main (main) where
import qualified Shy
main :: IO ()
main = Shy.main
| null | https://raw.githubusercontent.com/jwoudenberg/shy/3f4a4ab432fc174ea1af29411462a35bc874e28b/app/Main.hs | haskell | module Main (main) where
import qualified Shy
main :: IO ()
main = Shy.main
| |
c58af715f812b2e9976e147d1814a583cc13bd026c635e5b6ba88635014fcf95 | mbillingr/lisp-in-small-pieces | common-primitives.scm |
(define (defprimitive name value arity)
(case arity
((0) (defprimitive0 name value))
((1) (defprimitive1 name value))
((2) (defprimitive2 name value))
((3) (defprimitive3 name value))
(else static-wrong "Unsupported primitive arity" name arity)))
(define (defprimitive0 name value)
(definitial ... | null | https://raw.githubusercontent.com/mbillingr/lisp-in-small-pieces/b2b158dfa91dc95d75af4bd7d93f8df22219047e/07-compilation/common-primitives.scm | scheme |
(define (defprimitive name value arity)
(case arity
((0) (defprimitive0 name value))
((1) (defprimitive1 name value))
((2) (defprimitive2 name value))
((3) (defprimitive3 name value))
(else static-wrong "Unsupported primitive arity" name arity)))
(define (defprimitive0 name value)
(definitial ... | |
bb8405dc6df4e843afe90ec67a4a05a19694d395dd460c776eeb327952ddc068 | mirage/mirage-tcpip | keepalive.ml |
* Copyright ( c ) 2017 Docker Inc
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND TH... | null | https://raw.githubusercontent.com/mirage/mirage-tcpip/3ab30ab7b43dede75abf7b37838e051e0ddbb23a/src/tcp/keepalive.ml | ocaml | Wait until [time] has gone past
we don't want to send back-to-back probes
* A keep-alive timer |
* Copyright ( c ) 2017 Docker Inc
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND TH... |
79daaadb456ad5f8b31b370d38dc90ce960cb4d4c81cef550820cd54ed01c3f7 | derekmcloughlin/pearls | chap14e.hs | import Data.List
maxtail :: Ord a => [a] -> [a]
maxtail = foldl op []
op :: Ord a => [a] -> a -> [a]
op ys x = maximum [zs ++ [x] | zs <- borders ys]
Borders
borders :: Ord a => [a] -> [[a]]
borders [] = [[]]
borders xs = xs : borders (border xs)
-- Border
after :: Eq a => [a] -> [a] -> [a]
af... | null | https://raw.githubusercontent.com/derekmcloughlin/pearls/42bc6ea0fecc105386a8b75789f563d44e05b772/chap14/chap14e.hs | haskell | Border
Cocktail
| import Data.List
maxtail :: Ord a => [a] -> [a]
maxtail = foldl op []
op :: Ord a => [a] -> a -> [a]
op ys x = maximum [zs ++ [x] | zs <- borders ys]
Borders
borders :: Ord a => [a] -> [[a]]
borders [] = [[]]
borders xs = xs : borders (border xs)
after :: Eq a => [a] -> [a] -> [a]
after [] ys =... |
ba5e0f7fd0e39a60179896b761af6078350c2c50ce36beb683d0f63b390d7252 | facebookarchive/pfff | token_helpers_php.ml |
*
* Copyright ( C ) 2010 Facebook
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file licens... | null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/lang_php/parsing/token_helpers_php.ml | ocaml | ***************************************************************************
Token Helpers
***************************************************************************
***************************************************************************
Visitors
*****************************************************************... |
*
* Copyright ( C ) 2010 Facebook
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file licens... |
aa7c1db2e513c165d62a4b0c28a840af83139df565aa092d21f224ee9c9d209f | argp/bap | cat.ml | * Implementation of a cat - like tool : read each file whose name is
given on the command - line and print the contents to stdout .
Compilation :
ocamlbuild cat.byte
Usage :
./cat.byte * .ml
given on the command-line and print the contents to stdout.
Compilation:
ocaml... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/batteries/examples/tools/cat.ml | ocaml | * Implementation of a cat - like tool : read each file whose name is
given on the command - line and print the contents to stdout .
Compilation :
ocamlbuild cat.byte
Usage :
./cat.byte * .ml
given on the command-line and print the contents to stdout.
Compilation:
ocaml... | |
bfc4ead4fa3dc4657059a84b1833acef0512e0788495adb7956ccf3aaa57f61a | Fresheyeball/Shpadoinkle | Server.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TypeApplicati... | null | https://raw.githubusercontent.com/Fresheyeball/Shpadoinkle/0883d3b136025fdef230e2ec34ead46bd9f054b3/router/Shpadoinkle/Router/Server.hs | haskell | # LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeOperators #
# OPTIONS_GHC -Wno-redundant-constraints #
| Since the single page application URIs are specified with Servant, we can automate much
of the process of serving the application wit... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleInstances #
# LANGUAGE InstanceSigs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
module Shpadoinkle.Router.Ser... |
88dc18e0882744761dbc5c10ebc4d00208785cdfc8a40d280a7ad0e260e861a1 | serokell/avl-plus | Persistence.hs | -- | Operation wrapper on AVL tree that mutates the storage
-- so it only keeps the last version.
module Data.Tree.AVL.Persistence
( -- * Constraint to use
Erases (..)
, Appends (..)
-- * Wrappers
, overwrite
, append
, save
-- * Methods
, currentRoot
, NoRootExists (.... | null | https://raw.githubusercontent.com/serokell/avl-plus/3fb3933f4f11f282e8c498d128c3e5c79518ea9b/src/Data/Tree/AVL/Persistence.hs | haskell | | Operation wrapper on AVL tree that mutates the storage
so it only keeps the last version.
* Constraint to use
* Wrappers
* Methods
| Provides possibility to use impure storage that is rewritten on
the each write.
^ Get current root of the tree
^ Set current root of the tree
^ Remove node with given hash
... | module Data.Tree.AVL.Persistence
Erases (..)
, Appends (..)
, overwrite
, append
, save
, currentRoot
, NoRootExists (..)
, genesis
) where
import Control.Exception (Exception)
import Control.Monad (void, when)
import Control.Monad.Catch (catch)
import Control.Monad.Free (Free... |
fc060d6c4902f934ed4e737a43150be04f574928e858fe7634046b728ff81308 | jaspervdj/blaze-html | GenerateHtmlCombinators.hs | # LANGUAGE CPP #
#define DO_NOT_EDIT (doNotEdit __FILE__ __LINE__)
-- | Generates code for HTML tags.
--
module Util.GenerateHtmlCombinators where
import Control.Arrow ((&&&))
import Data.List (sort, sortBy, intersperse, intercalate)
import Data.Ord (comparing)
import System.Directory (createDirectoryIfMissing)
impo... | null | https://raw.githubusercontent.com/jaspervdj/blaze-html/1c76db3cf02712569fd22b021fb0a367df028eb4/src/Util/GenerateHtmlCombinators.hs | haskell | | Generates code for HTML tags.
| Get the full module name for an HTML variant.
| Get the attribute module name for an HTML variant.
| Check if a given name causes a name clash.
Both an element and an attribute
Already a prelude function
| Write an HTML variant.
Make a directory.
Write the main module.
... | # LANGUAGE CPP #
#define DO_NOT_EDIT (doNotEdit __FILE__ __LINE__)
module Util.GenerateHtmlCombinators where
import Control.Arrow ((&&&))
import Data.List (sort, sortBy, intersperse, intercalate)
import Data.Ord (comparing)
import System.Directory (createDirectoryIfMissing)
import System.FilePath ((</>), (<.>))
impo... |
10678f6417ba6786449ca0cf8d102ee962709e3f9e00c72ac3fd3d4cc2981f78 | 15Galan/asignatura-204 | Trees.hs | module Trees where
import Data.List
--------------------------------------------------
-- Árboles
--------------------------------------------------
data Tree a = Empty | Node a [Tree a] deriving Show
tree1 :: Tree Int
tree1 = Node 1 [ Node 2 [ Node 4 []
, Node 5 []
,... | null | https://raw.githubusercontent.com/15Galan/asignatura-204/894f33ff8e0f52a75d8f9ff15155c656f1a8f771/Recursos/data.structures/haskell/DataStructures/Trees/Trees.hs | haskell | ------------------------------------------------
Árboles
------------------------------------------------
------------------------------------------------
Árboles Binarios
------------------------------------------------ | module Trees where
import Data.List
data Tree a = Empty | Node a [Tree a] deriving Show
tree1 :: Tree Int
tree1 = Node 1 [ Node 2 [ Node 4 []
, Node 5 []
, Node 6 []
]
, Node 3 [ Node 7 []
]
... |
d217ce9cf182139c8aecfd3fee67b62bce320e850519af7b486f570f2885e9da | avsm/eeww | echo_server.ml | open Lwt
open Ex_common
let string_of_unix_err err f p =
Printf.sprintf "Unix_error (%s, %s, %s)"
(Unix.error_message err) f p
let serve_ssl port callback =
let tag = "server" in
X509_lwt.private_of_pems
~cert:server_cert
~priv_key:server_key >>= fun cert ->
let server_s () =
let open Lwt_u... | null | https://raw.githubusercontent.com/avsm/eeww/49cbc7b7250611c1e909d4defde0027a5ef28157/lib/tls/lwt/examples/echo_server.ml | ocaml | open Lwt
open Ex_common
let string_of_unix_err err f p =
Printf.sprintf "Unix_error (%s, %s, %s)"
(Unix.error_message err) f p
let serve_ssl port callback =
let tag = "server" in
X509_lwt.private_of_pems
~cert:server_cert
~priv_key:server_key >>= fun cert ->
let server_s () =
let open Lwt_u... | |
7e2e633d9c2ab026f7c45e665cb2c4e2ee42bd3772758c4ef6b95f94859f1aea | francescoc/scalabilitywitherlangotp | tcp_wrapper_sup.erl | -module(mutex_sup).
-export(start_link/0, init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init(_) ->
{ok, {one_for_one, 5, 3600}, []}.
| null | https://raw.githubusercontent.com/francescoc/scalabilitywitherlangotp/961de968f034e55eba22eea9a368fe9f47c608cc/ch10/tcp_wrapper_sup.erl | erlang | -module(mutex_sup).
-export(start_link/0, init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init(_) ->
{ok, {one_for_one, 5, 3600}, []}.
| |
957b00f818dbce056e932dee019011de4e2c673083454f0da399c0f3858e566a | slagyr/joodo | env.clj | (ns ^{:doc "This namespace holds functions that read the current environment that the application is in (according to the system properties)."}
joodo.env
(:require [clojure.java.io :as io]
[taoensso.timbre :as timbre]))
(defn- joodo-env []
(or (System/getProperty "joodo.env") (System/getenv "JOODO_E... | null | https://raw.githubusercontent.com/slagyr/joodo/e7edbc707a7901d1a1c5465382dd25db368f4596/joodo/src/joodo/env.clj | clojure | (ns ^{:doc "This namespace holds functions that read the current environment that the application is in (according to the system properties)."}
joodo.env
(:require [clojure.java.io :as io]
[taoensso.timbre :as timbre]))
(defn- joodo-env []
(or (System/getProperty "joodo.env") (System/getenv "JOODO_E... | |
e1e0624a87d1d81fba4bc00e0873773a86f43deed4cbc8853efda54e93e2c1f8 | dmitryvk/sbcl-win32-threads | readtable.lisp | ;;;; READTABLEs
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and is
;;;; provided with... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/src/code/readtable.lisp | lisp | READTABLEs
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
constants for readtable character attributes. These are all as in
the manual.
code in CHAR-CLASS{,2,3} in the reader implementat... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB!IMPL")
(sb!xc:deftype attribute-table ()
'(simple-array (unsigned-byte 8) (#.base-char-code-limit)))
FI... |
a6e4ce79b6e240efbca5c3e7d1a54caa974167a30afa8f1c5fbde43e00654ecc | OCamlPro/drom | gsl_types.ml | include Gsl_types_functor.Apply (Gsl_types_stubs)
| null | https://raw.githubusercontent.com/OCamlPro/drom/dbbb5f9225df65c589e6f307ac28be4c408b9cae/src/drom_lib/share/drom/skeletons/packages/ctypes_lib_stubs/bindings/gsl_types.ml | ocaml | include Gsl_types_functor.Apply (Gsl_types_stubs)
| |
34dff64b6b9998d6199fa0e44c100b6166ddd263155e071c7604ff842c94e3d7 | xvw/preface | arrow_zero.ml | module Core_over_category_and_via_arrow_and_fst
(Category : Preface_specs.Category.CORE)
(Req : Preface_specs.Arrow_zero.WITH_ARROW_AND_FST
with type ('a, 'b) t = ('a, 'b) Category.t) =
struct
include Arrow.Core_over_category_and_via_arrow_and_fst (Category) (Req)
let neutral = Req.neutral
end... | null | https://raw.githubusercontent.com/xvw/preface/51892a7ce2ddfef69de963265da3617968cdb7ad/lib/preface_make/arrow_zero.ml | ocaml | module Core_over_category_and_via_arrow_and_fst
(Category : Preface_specs.Category.CORE)
(Req : Preface_specs.Arrow_zero.WITH_ARROW_AND_FST
with type ('a, 'b) t = ('a, 'b) Category.t) =
struct
include Arrow.Core_over_category_and_via_arrow_and_fst (Category) (Req)
let neutral = Req.neutral
end... | |
72dac733cb4b4e4f6839540efa6b60039aabe10c91294354bc84a7958db2bcb9 | mhayashi1120/Gauche-net-twitter | friendship.scm | (define-module net.twitter.friendship
(extend net.twitter.base)
(use net.twitter.core)
(export
show/json
create/json
destroy/json
update/json
friends/ids/json
friends/list/json
followers/ids/json
followers/list/json
friends-outgoing/json
friends-incoming/json
friends-no-retweets/... | null | https://raw.githubusercontent.com/mhayashi1120/Gauche-net-twitter/b9f4be3ca8459fc662f9c79481411aac03b51133/src/net/twitter/friendship.scm | scheme |
JSON api
Returns list of user ids
Returns ids of *all* followers; paging is handled automatically. | (define-module net.twitter.friendship
(extend net.twitter.base)
(use net.twitter.core)
(export
show/json
create/json
destroy/json
update/json
friends/ids/json
friends/list/json
followers/ids/json
followers/list/json
friends-outgoing/json
friends-incoming/json
friends-no-retweets/... |
79b0dc4732de80681d14726ab64f8d79372ba1d3dcccb66427263974058abad4 | clojure-interop/aws-api | AmazonSimpleDBAsync.clj | (ns com.amazonaws.services.simpledb.AmazonSimpleDBAsync
"Interface for accessing Amazon SimpleDB asynchronously. Each asynchronous method will return a Java Future object
overloads which accept an AsyncHandler can be used to receive
notification when an asynchronous operation completes.
Note: Do not directly i... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.simpledb/src/com/amazonaws/services/simpledb/AmazonSimpleDBAsync.clj | clojure | running it multiple times on the same item or attribute | (ns com.amazonaws.services.simpledb.AmazonSimpleDBAsync
"Interface for accessing Amazon SimpleDB asynchronously. Each asynchronous method will return a Java Future object
overloads which accept an AsyncHandler can be used to receive
notification when an asynchronous operation completes.
Note: Do not directly i... |
077d7034e505c9c11484c7bf943ad2cfd2072fb9aae20e537425573a7bb0c6e2 | evrim/core-server | plugin.lisp | (in-package :Core-server)
(defclass+ plugin+ (component+)
())
(defclass+ plugin ()
()
(:metaclass plugin+))
(defmacro defplugin (name supers slots &rest rest)
`(defcomponent ,name (plugin ,@supers)
((,(plugin-instance-slot-name name) :host remote)
,@slots)
,@rest
(:metaclass plugin+)))
... | null | https://raw.githubusercontent.com/evrim/core-server/200ea8151d2f8d81b593d605b183a9cddae1e82d/src/web/coretal/plugin.lisp | lisp | (in-package :Core-server)
(defclass+ plugin+ (component+)
())
(defclass+ plugin ()
()
(:metaclass plugin+))
(defmacro defplugin (name supers slots &rest rest)
`(defcomponent ,name (plugin ,@supers)
((,(plugin-instance-slot-name name) :host remote)
,@slots)
,@rest
(:metaclass plugin+)))
... | |
322e3cf315258c5e02a79072125b24684bac5e9cca4f7eb0248c4e0beb6ca728 | input-output-hk/plutus-pioneer-program | Homework1.hs | # LANGUAGE DataKinds #
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
{-# LANGUAGE TypeFamilies #-}
module Homework1 where
import Plutus.V2.Ledger.Api (BuiltinData, POSIXTime, PubKeyHash,
... | null | https://raw.githubusercontent.com/input-output-hk/plutus-pioneer-program/ca3723a3b5f6a064553beafb7b54afabaed1b23f/code/Week03/homework/Homework1.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE TypeFamilies #
-------------------------------------------------------------------------------------------------
--------------------------------- ON-CHAIN / VALIDATOR ------------------------------------------
# INLINABLE mkVestingValidator #
or if beneficiary2 has signe... | # LANGUAGE DataKinds #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
module Homework1 where
import Plutus.V2.Ledger.Api (BuiltinData, POSIXTime, PubKeyHash,
ScriptContext, Validator,
... |
620b6fa4953cfe0137683933fdf3b1f75d2f9b98b41a8ff851da270793f7963e | phoe/riichi-evaluator | package.lisp | ;;;; test/package.lisp
;;;;
Copyright 2012 - 2019 Kimmo " keko " and " phoe " Herda .
;;;;
;;;; Permission is hereby granted, free of charge, to any person obtaining a
;;;; copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction , including without li... | null | https://raw.githubusercontent.com/phoe/riichi-evaluator/52503213129e82c6e7c9f06a5ccd4a4fc4f6b186/test/package.lisp | lisp | test/package.lisp
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
the rights to use, copy, modify, merge, publish, distribute, sublicense,
Software is furnished to do so, subject to the following conditions:
The ... | Copyright 2012 - 2019 Kimmo " keko " and " phoe " Herda .
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRAN... |
7445eda03e77eeeb873fedc01e87e0167f4cf5ab90eb50b937b3bfc593b6146c | bos/rwh | Nullable.hs | import Prelude hiding (Maybe)
{-- snippet Nullable --}
data Maybe a = Just a
| Nothing
{-- /snippet Nullable --}
{-- snippet wrappedTypes --}
someBool = Just True
someString = Just "something"
{-- /snippet wrappedTypes --}
{-- snippet parens --}
wrapped = Just (Just "wrapped")
{-- /sni... | null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch03/Nullable.hs | haskell | - snippet Nullable -
- /snippet Nullable -
- snippet wrappedTypes -
- /snippet wrappedTypes -
- snippet parens -
- /snippet parens - | import Prelude hiding (Maybe)
data Maybe a = Just a
| Nothing
someBool = Just True
someString = Just "something"
wrapped = Just (Just "wrapped")
|
9b1f825abf094feb0f40b1351026dfe08a2cafa68bf4bbf79d8473d8629520b6 | deadtrickster/cl-emb | packages.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*-
This software is Copyright ( c ) , 2004 .
grants you the rights to distribute
;;; and use this software as governed by the terms
of the Lisp Lesser GNU Public License
;;; (),
;;; known as the LLGPL.
(in-package #:cl-user)
(de... | null | https://raw.githubusercontent.com/deadtrickster/cl-emb/dea7b5a713b5180e7b26d48580b4699fbbc19100/packages.lisp | lisp | Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*-
and use this software as governed by the terms
(),
known as the LLGPL. |
This software is Copyright ( c ) , 2004 .
grants you the rights to distribute
of the Lisp Lesser GNU Public License
(in-package #:cl-user)
(defpackage #:cl-emb
(:nicknames #:emb)
(:use #:cl)
(:export #:execute-emb
#:register-emb
#:pprint-emb-function
#:clear-emb
... |
50906f26a080ab292bd8bd4ebdd505559f88514afd45b637a90486cf19952303 | elkowar/infix-lisp | Lib.hs | module Lib
( )
where
| null | https://raw.githubusercontent.com/elkowar/infix-lisp/6acac9b3a3d4d1eb2e9a3a08aedfdf8d0e567c12/src/Lib.hs | haskell | module Lib
( )
where
| |
7b1a05a9665d4a5b69578fc2558cf033f614410b445b79fb98266b56bb50f5c5 | chris-martin/text-replace | text-replace.hs | import Text.Replace
-- base
import Control.Applicative ((<|>))
import Data.Foldable (asum)
import Data.Function ((&))
import Data.Functor (void)
import System.Exit (die)
import qualified System.IO as IO
-- optparse-applicative
impo... | null | https://raw.githubusercontent.com/chris-martin/text-replace/a81703eca0b5ad68eb022c2b23a0c7ebc721da18/text-replace/app/text-replace.hs | haskell | base
optparse-applicative
parsec
text
mapping and in the contents of --map-file" | import Text.Replace
import Control.Applicative ((<|>))
import Data.Foldable (asum)
import Data.Function ((&))
import Data.Functor (void)
import System.Exit (die)
import qualified System.IO as IO
import qualified Options.Applicative... |
a48db748dfd0a11229ddfa3dced99d579a0892ed025b5199a055d362e91c7cb8 | borkdude/advent-of-cljc | akmiller78.cljc | (ns aoc.y2018.d03.akmiller78
(:refer-clojure :exclude [read-string])
(:require
[aoc.utils :as u :refer [deftest read-string]]
[aoc.y2018.d03.data :refer [input answer-1 answer-2]]
[clojure.test :refer [is testing]]
[clojure.string :as str]))
(defn parse-int [s]
(read-string (re-find #"\d+" s)))
(def... | null | https://raw.githubusercontent.com/borkdude/advent-of-cljc/17c8abb876b95ab01eee418f1da2e402e845c596/src/aoc/y2018/d03/akmiller78.cljc | clojure | (ns aoc.y2018.d03.akmiller78
(:refer-clojure :exclude [read-string])
(:require
[aoc.utils :as u :refer [deftest read-string]]
[aoc.y2018.d03.data :refer [input answer-1 answer-2]]
[clojure.test :refer [is testing]]
[clojure.string :as str]))
(defn parse-int [s]
(read-string (re-find #"\d+" s)))
(def... | |
9192603a8ecc4b52de09c85119def0bb95f6078c945cd92c6efbd082185840a1 | JHU-PL-Lab/jaylang | run_rule_action.ml | open Core
open Dj_common
module U = Unrolls.U_dbmc
let init_list_counter (state : Global_state.t) (term_detail : Term_detail.t) key
=
Hashtbl.update state.smt_lists key ~f:(function
| Some i -> i
| None ->
Global_state.add_phi state term_detail (Riddler.list_head key) ;
0)
let fetch_list... | null | https://raw.githubusercontent.com/JHU-PL-Lab/jaylang/484b3876986a515fb57b11768a1b3b50418cde0c/src/dbmc/dbmc-rule/run_rule_action.ml | ocaml | open Core
open Dj_common
module U = Unrolls.U_dbmc
let init_list_counter (state : Global_state.t) (term_detail : Term_detail.t) key
=
Hashtbl.update state.smt_lists key ~f:(function
| Some i -> i
| None ->
Global_state.add_phi state term_detail (Riddler.list_head key) ;
0)
let fetch_list... | |
e4c0f2b7abc8827fd910ddddc4b7f2cbbe031edcdaef582e50730a94b31dffee | xhtmlboi/yocaml | rss.mli | * A minimalist RSS2 representation .
(** {1 Document Structure} *)
(** {2 Describe an RSS Image} *)
module Image : sig
type t
val make
: ?description:string
-> ?width:int
-> ?height:int
-> title:string
-> link:string
-> url:string
-> unit
-> t
val pp : Format.formatter -> t -... | null | https://raw.githubusercontent.com/xhtmlboi/yocaml/4d207700a94b1b78bf256d11243d7fcab603d7db/lib/yocaml/rss.mli | ocaml | * {1 Document Structure}
* {2 Describe an RSS Image}
* {2 Describe an RSS Cloud service}
* {2 Describe an RSS Channel} | * A minimalist RSS2 representation .
module Image : sig
type t
val make
: ?description:string
-> ?width:int
-> ?height:int
-> title:string
-> link:string
-> url:string
-> unit
-> t
val pp : Format.formatter -> t -> unit
val equal : t -> t -> bool
end
* { 2 Describes an RSS... |
ea0a893bff648f74525b5de00ca3f1142d77ab21176dd1bdeb112c87b24f5e30 | weavery/clarc | compile.mli | (* This is free and unencumbered software released into the public domain. *)
val compile_contract : ?features:(Feature.t list) -> Clarity.program -> EVM.contract
| null | https://raw.githubusercontent.com/weavery/clarc/1fb1c43210f52b4022e7f0ae30b7c7d4a9e7ca01/lib/Clar2EVM/compile.mli | ocaml | This is free and unencumbered software released into the public domain. |
val compile_contract : ?features:(Feature.t list) -> Clarity.program -> EVM.contract
|
100c27f8206124c0b00eec214195b072707e5ade1f531c115fe698c72936c3b7 | tsahyt/clingo-haskell | Theory.hs | # LANGUAGE DeriveGeneric #
module Clingo.Inspection.Theory
(
TheoryAtoms,
AspifLiteral,
Guard (..),
Element (..),
GroundTheoryAtom (..),
GroundTheoryTerm (..),
renderTerm,
termName,
fromTheoryAtoms
)
where
import Control.DeepSeq
import Control.Monad.IO.Class
import Control.Monad.C... | null | https://raw.githubusercontent.com/tsahyt/clingo-haskell/083c84aae63565067644ccaa72223a4c12b33b88/src/Clingo/Inspection/Theory.hs | haskell | # LANGUAGE DeriveGeneric #
module Clingo.Inspection.Theory
(
TheoryAtoms,
AspifLiteral,
Guard (..),
Element (..),
GroundTheoryAtom (..),
GroundTheoryTerm (..),
renderTerm,
termName,
fromTheoryAtoms
)
where
import Control.DeepSeq
import Control.Monad.IO.Class
import Control.Monad.C... | |
b59249602ad031dfbc16c84da778dcd3f913fc3bfe0d35f39ea427370098bc8d | emqxarchive/emqx-delayed-publish | emqx_delayed_publish_app.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 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/emqxarchive/emqx-delayed-publish/a5a4f1325a2643b6ee90454ffa054a5ff17d714b/src/emqx_delayed_publish_app.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 ) 2020 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_delayed_publish_app).
-behaviour(application).
-emqx_plugin(?MODULE).
-export([ start/2... |
352a9c75109adc16ce9402e3dc423a57ffea8f354c2f6d8624ba935af3184306 | orx/ocaml-orx | facing.mli | (** {1 Directions a character can be facing} *)
type t =
| Left
| Right
val to_string : t -> string
(** [to_string facing] is returns a string representation of [facing] suitable
for use with config value. *)
| null | https://raw.githubusercontent.com/orx/ocaml-orx/14003e2014afeaf001168a0b6a9e8fe66def820c/examples/ocaml/top_down_movement/src/facing.mli | ocaml | * {1 Directions a character can be facing}
* [to_string facing] is returns a string representation of [facing] suitable
for use with config value. |
type t =
| Left
| Right
val to_string : t -> string
|
ab752a31ef83a5dba4ba5f985b3aba61957377039fd4392ef30754cbb35a224e | markbastian/tetris | rules.cljc | (ns tetris.rules
(:require [tetris.shapes :refer [shapes]]))
;; Initialization function
(defn initial-state []
{:frame 0
:speed 50
:score 0
:high-score 0
:locked #{}
:shape-pos [(rand-int 7) 0]
:shape ((rand-nth (keys shapes)) shapes)})
;; Utility functions
(defn rotate-ccw [shape]
(apply mapv... | null | https://raw.githubusercontent.com/markbastian/tetris/d457abebe1b269ac0e9bf4f3325194256a0d2c80/src/cljc/tetris/rules.cljc | clojure | Initialization function
Utility functions
| (ns tetris.rules
(:require [tetris.shapes :refer [shapes]]))
(defn initial-state []
{:frame 0
:speed 50
:score 0
:high-score 0
:locked #{}
:shape-pos [(rand-int 7) 0]
:shape ((rand-nth (keys shapes)) shapes)})
(defn rotate-ccw [shape]
(apply mapv vector (map rseq shape)))
(defn rotate-cw [sha... |
5d5ac5ceefae5e64a2a8bd67b823a71395d77bf2a8f8623c89b1095c5b084e22 | wireapp/wire-server | Asset_asset.hs | -- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program 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... | null | https://raw.githubusercontent.com/wireapp/wire-server/e03f7219210019ae5be50739f594dc667e669168/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/Asset_asset.hs | haskell | This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
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 PARTI... | Copyright ( C ) 2022 Wire Swiss GmbH < >
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 option ) any
You should have received a copy of the GNU Affero General Public License along
module Test.Wire.API.Golden.Gene... |
a9d998b529782832989d19f881b214420d14d3c02c6d21e265e6b72d92cf37da | jarmitage/jarmlib | Sequence.hs |
TODO
-- - Add more number sequences
-- + Primes
-- + ...?
-- Reverse
ri a = rev (r a) -- run inverted
-- Odd and even
rodd a = (((r a) + 1) * 2) - 1 -- run of odd numbers
reven a = ((r a) + 1) * 2 -- run of even numbers
roddi a = rev (rodd a) -- run of odd numbers inverted
reveni a = rev (re... | null | https://raw.githubusercontent.com/jarmitage/jarmlib/853f6d18ab32630397be91ea89846d55e59e3d70/tidal/lib/Sequence.hs | haskell | - Add more number sequences
+ Primes
+ ...?
Reverse
run inverted
Odd and even
run of odd numbers
run of even numbers
run of odd numbers inverted
run of even numbers inverted
fibonacci sequence, gives nth term
calculate the series given initial conditions.
output some array of m terms
example use ?
f... |
TODO
Fibonacci functions by / Digital Selves
:{
fib:: (Eq a, Num a, Num p) => a -> p
fib 0 = 0
fib 1 = 1
fib n = fib (n-1)+ fib (n-2)
:}
:{
fibSeries :: Num t => t -> t -> [t]
fibSeries a b = a : (fibSeries b (a+b))
:}
:{
fibs :: Num a => Int -> [a]
fibs m = take m ( fibSeries 0 1)
:}
fibPat = fibs 8
|
ed26e6e493ecfd9b2d2b8ad5484e0ccf9a895ce745cbc992419cc5c911def3d8 | mirage/irmin | cli.ml |
* Copyright ( c ) 2013 - 2022 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... | null | https://raw.githubusercontent.com/mirage/irmin/abeee121a6db7b085b3c68af50ef24a8d8f9ed05/src/irmin-cli/cli.ml | ocaml | Help sections common to all commands
Converters
HTTP
GET
LIST
SET
REMOVE
CLONE
FETCH
MERGE
PULL
PUSH
WATCH
Check if there was a command passed, if not print a simple message to stdout, if there is
a command pass the whole diff
Start new process
Check if process is already running, if... |
* Copyright ( c ) 2013 - 2022 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... |
77d8745a0f8f83386a5a29cff1f1c516de9946ef4bbac0341fad4331e501e7cd | typesafety/aoc2021 | Day07.hs | module Solutions.Day07 where
import CustomPrelude
import Data.Sequence qualified as Seq
import Data.Text qualified as T
* Part 1
solveP1 :: Text -> Int
solveP1 =
T.splitOn ","
>>> fromList
>>> fmap unsafeReadInt
>>> Seq.sort
>>> (&&&) identity (identity &&& (Seq.length >>> flip div 2))
>>> second (un... | null | https://raw.githubusercontent.com/typesafety/aoc2021/7dfea6e37886aaddb87b3fbd2da06dddf6c7fc09/src/Solutions/Day07.hs | haskell | module Solutions.Day07 where
import CustomPrelude
import Data.Sequence qualified as Seq
import Data.Text qualified as T
* Part 1
solveP1 :: Text -> Int
solveP1 =
T.splitOn ","
>>> fromList
>>> fmap unsafeReadInt
>>> Seq.sort
>>> (&&&) identity (identity &&& (Seq.length >>> flip div 2))
>>> second (un... | |
60ffa54e58d44cdb8ec2a231438fc37c43099a78a5336bbf9d1dde765ea37850 | jkrivine/tl_interpreter | address.ml | type t = int * string
let counter = ref 0
let pp fmt (_,s) = F.p fmt "%s" s
let next s =
let ret = (!counter + 1,s) in
incr counter; ret
let admin = next "<admin>"
let show a =
let open Format in
ignore (flush_str_formatter ());
pp str_formatter a;
flush_str_formatter ()
| null | https://raw.githubusercontent.com/jkrivine/tl_interpreter/c967c6578dd4491a6930c9842a0709fbc5939496/lib/address.ml | ocaml | type t = int * string
let counter = ref 0
let pp fmt (_,s) = F.p fmt "%s" s
let next s =
let ret = (!counter + 1,s) in
incr counter; ret
let admin = next "<admin>"
let show a =
let open Format in
ignore (flush_str_formatter ());
pp str_formatter a;
flush_str_formatter ()
| |
eeaaed14bce9b439f801f614c3b715275bfa0b9a57e40774caaa6fb431bf6c52 | apache/dubbo-erlang | dubbo_registry_zookeeper.erl | %%------------------------------------------------------------------------------
Licensed to the Apache Software Foundation ( ASF ) under one or more
%% contributor license agreements. See the NOTICE file distributed with
%% this work for additional information regarding copyright ownership.
The ASF licenses this ... | null | https://raw.githubusercontent.com/apache/dubbo-erlang/24e0c1a9028b50d2e9e05e3fe26f4e3335384acc/src/dubbo_registry_zookeeper.erl | erlang | ------------------------------------------------------------------------------
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES ... | Licensed to the Apache Software Foundation ( ASF ) under one or more
The ASF licenses this file to You 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
distributed under the License is distr... |
bed1f4960f90e8dfa94080efd5e29e1d6e2ec3331b1c9343b7b5fb8a7e792ad6 | pflanze/chj-schemelib | corescheme-to-scheme.scm | Copyright 2016 - 2019 by < >
;;; This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
;;; (at your option) any later version.
(require eas... | null | https://raw.githubusercontent.com/pflanze/chj-schemelib/59ff8476e39f207c2f1d807cfc9670581c8cedd3/corescheme-to-scheme.scm | scheme | This file is free software; you can redistribute it and/or modify
(at your option) any later version.
XXX careful. After optimizations, there might be different
variables with the same name in the same scope, and hence actually
*do* need to be renamed for code gen. Not done yet. (Could be a
processing step,... | Copyright 2016 - 2019 by < >
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
(require easy
corescheme
(corescheme corescheme:flatten<T>)
(failing <failing-on> <failing-off>)
(scheme-m... |
13b332177b896056f0d30cb6221351f69e37a94cbb09d6fa51d9f06d07bedb40 | abyala/advent-2021-clojure | day11.clj | (ns advent-2021-clojure.day11
(:require
[advent-2021-clojure.point :as point]
[advent-2021-clojure.utils :as utils]))
(defn parse-grid [input]
(->> (point/parse-to-char-coords input)
(reduce (fn [acc [p c]] (assoc acc p (utils/char->int c))) {})))
(defn ready-to-flash? [v] (> v 9))
(def flashed? ze... | null | https://raw.githubusercontent.com/abyala/advent-2021-clojure/56d79f152161cc52c4d0f942e5bde68f542451da/src/advent_2021_clojure/day11.clj | clojure | (ns advent-2021-clojure.day11
(:require
[advent-2021-clojure.point :as point]
[advent-2021-clojure.utils :as utils]))
(defn parse-grid [input]
(->> (point/parse-to-char-coords input)
(reduce (fn [acc [p c]] (assoc acc p (utils/char->int c))) {})))
(defn ready-to-flash? [v] (> v 9))
(def flashed? ze... | |
1240c0e366cae8847b35cb6a6470eb0cae8e63b75e1d4b74c5de8ca180c5d3b6 | pdarragh/camlrack | sexp.ml | open Errors
type sexp =
| Integer of int
| Float of float
| String of string
| Symbol of string
| SExp of sexp list
let rec render_string_of_sexp (se : sexp) : string =
match se with
| Integer i -> string_of_int i
| Float f -> string_of_float f
| String s -> "\"" ^ s ^ "\""
| Symbol s -> s
| SEx... | null | https://raw.githubusercontent.com/pdarragh/camlrack/b80f35a973529f029c0715b83ce64c1de4e8467d/camlrack/src/sexp.ml | ocaml | open Errors
type sexp =
| Integer of int
| Float of float
| String of string
| Symbol of string
| SExp of sexp list
let rec render_string_of_sexp (se : sexp) : string =
match se with
| Integer i -> string_of_int i
| Float f -> string_of_float f
| String s -> "\"" ^ s ^ "\""
| Symbol s -> s
| SEx... | |
e1856e83d273e28b4f426cf27448be80cf4f0626169afa7d909b20fb6a157d14 | informatica-unica/lip | main.ml | open Lip22Lib.Types
open Lip22Lib.Prettyprint
open Lip22Lib.Main
(* read file, and output it to a string *)
let read_file filename =
let ch = open_in filename in
let s = really_input_string ch (in_channel_length ch) in
close_in ch; s
(* read line from standard input, and output it to a string *)
let re... | null | https://raw.githubusercontent.com/informatica-unica/lip/1a40f5278884af393f7b89a16cfb3e5f6103bd80/imp/lip22/bin/main.ml | ocaml | read file, and output it to a string
read line from standard input, and output it to a string
print a trace
trace1 / read input from file
wrong usage | open Lip22Lib.Types
open Lip22Lib.Prettyprint
open Lip22Lib.Main
let read_file filename =
let ch = open_in filename in
let s = really_input_string ch (in_channel_length ch) in
close_in ch; s
let read_line () =
try Some(read_line())
with End_of_file -> None
let print_trace vars = function
| Cmd(... |
17998ea267f77ecad7b7efa953a867f12826041cef26e7c73c2301becdf8dd5a | janestreet/memtrace_viewer_with_deps | config.mli | open! Core
open! Async
open! Import
module Client : sig
type t [@@deriving sexp_of]
val create
: ?verify_modes:Verify_mode.t list
-> ?tls_options:Opt.t list
-> ?allowed_ciphers:[ `Secure | `Openssl_default | `Only of string list ]
-> ?crt_file:string
-> ?key_file:string
-> remote_hostnam... | null | https://raw.githubusercontent.com/janestreet/memtrace_viewer_with_deps/5a9e1f927f5f8333e2d71c8d3ca03a45587422c4/vendor/async_ssl/src/config.mli | ocaml | open! Core
open! Async
open! Import
module Client : sig
type t [@@deriving sexp_of]
val create
: ?verify_modes:Verify_mode.t list
-> ?tls_options:Opt.t list
-> ?allowed_ciphers:[ `Secure | `Openssl_default | `Only of string list ]
-> ?crt_file:string
-> ?key_file:string
-> remote_hostnam... | |
d0e1f09806750dd60150202694e28a9b6c41fe8eb6b4c43641aa151f7911800b | andyfinnell/kalerl | kalerl_symbol.erl | @author
2015 .
-module(kalerl_symbol).
%% Public API
-type symbol_type() :: float | {function, integer()}.
-type scopeid() :: integer() | none.
-record(symbol, {name :: atom(),
type :: symbol_type(),
parent_scope :: scopeid(),
defined_scope :: scopeid(),
module :: atom() | none
}).
-type symbol() ... | null | https://raw.githubusercontent.com/andyfinnell/kalerl/ca00d5c6d49a2ca3a738ecf781180ce6b9d82a38/src/kalerl_symbol.erl | erlang | Public API
Implementation | @author
2015 .
-module(kalerl_symbol).
-type symbol_type() :: float | {function, integer()}.
-type scopeid() :: integer() | none.
-record(symbol, {name :: atom(),
type :: symbol_type(),
parent_scope :: scopeid(),
defined_scope :: scopeid(),
module :: atom() | none
}).
-type symbol() :: #symbol{}.
... |
970658c34231b8dccf05956c9ef2441ee94d5de273159c355dc06ca06764341c | darkleaf/publicator | register.clj | (ns publicator.web.forms.user.register
(:require
[publicator.web.routing :as routing]))
(defn description []
{:widget :submit, :name "Зарегистрироваться"
:url (routing/path-for :user.register/process), :method :post, :nested
{:widget :group, :nested
[:login {:widget :input, :label "Логин"}
:full-... | null | https://raw.githubusercontent.com/darkleaf/publicator/e07eee93d8f3d9c07a15d574619d5ea59c00f87d/web/src/publicator/web/forms/user/register.clj | clojure | (ns publicator.web.forms.user.register
(:require
[publicator.web.routing :as routing]))
(defn description []
{:widget :submit, :name "Зарегистрироваться"
:url (routing/path-for :user.register/process), :method :post, :nested
{:widget :group, :nested
[:login {:widget :input, :label "Логин"}
:full-... | |
9484b402866836b284feff3ae453ad471f7d2d10bac2325e966c56b156939114 | input-output-hk/cardano-rt-view | Updater.hs | # LANGUAGE CPP #
{-# LANGUAGE MultiWayIf #-}
#if defined(mingw32_HOST_OS)
#define WINDOWS
#endif
#if defined(linux_HOST_OS)
#define LINUX
#endif
#if defined(darwin_HOST_OS)
#define DARWIN
#endif
module Cardano.RTView.NodeState.Updater
( launchNodeStateUpdater
) where
import Control.Concurrent.STM.T... | null | https://raw.githubusercontent.com/input-output-hk/cardano-rt-view/0ff669a5acc8d81a35aa5a924cbb79978d0999a8/src/Cardano/RTView/NodeState/Updater.hs | haskell | # LANGUAGE MultiWayIf #
| This function is running in a separate thread.
extracts these metrics and updates corresponding values
in the |NodesState|.
| Update NodeState for particular node based on loggerName.
Please note that this function updates only Error-messages (if errors occurred).
It is assumed tha... | # LANGUAGE CPP #
#if defined(mingw32_HOST_OS)
#define WINDOWS
#endif
#if defined(linux_HOST_OS)
#define LINUX
#endif
#if defined(darwin_HOST_OS)
#define DARWIN
#endif
module Cardano.RTView.NodeState.Updater
( launchNodeStateUpdater
) where
import Control.Concurrent.STM.TVar (TVar, modifyTVar', read... |
2cb46f15f555793b251536e42a29952bad0580d35980d695451087fba55ed39f | larcenists/larceny | 144.r6rs.scm | ;;; If (rnrs arithmetic flonums) is unavailable, these definitions are used.
;;; Private.
(define (flop0-or-more name op)
(lambda args
(for-each (lambda (x) (check-flonum! name x)) args)
(flonum (apply op args))))
(define (flop1-or-more name op)
(lambda (x . args)
(for-each (lambda (x) (check-flonum!... | null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/lib/SRFI/srfi/144.r6rs.scm | scheme | If (rnrs arithmetic flonums) is unavailable, these definitions are used.
Private.
Exported.
R6RS 11.7.4.1 says
If z is a complex number object, then (real? z) is true if
are both true.
As explained in R6RS Rationale 11.6.6, some such rule is needed
under operations that would be expected to return... |
(define (flop0-or-more name op)
(lambda args
(for-each (lambda (x) (check-flonum! name x)) args)
(flonum (apply op args))))
(define (flop1-or-more name op)
(lambda (x . args)
(for-each (lambda (x) (check-flonum! name x)) (cons x args))
(flonum (apply op x args))))
(define (flop2-or-more name op)... |
08b2d7657ba6cb5ac919eb8a6c7a460a7aa3eb7228441bc5bc888b9c679ce134 | weavejester/lein-generate | project.clj | (defproject lein-gen/generators "0.2.1"
:description "A basic set of generators for lein-gen"
:url "-gen"
:scm {:dir ".."}
:license {:name "Eclipse Public License"
:url "-v10.html"}
:eval-in-leiningen true
:dependencies [[lein-gen "0.2.1"]]
:profiles {:dev {:plugins [[lein-gen "0.2.1"]]}})
| null | https://raw.githubusercontent.com/weavejester/lein-generate/481a116e5fd652c3d8bcf6b725da97c0129368c8/generators/project.clj | clojure | (defproject lein-gen/generators "0.2.1"
:description "A basic set of generators for lein-gen"
:url "-gen"
:scm {:dir ".."}
:license {:name "Eclipse Public License"
:url "-v10.html"}
:eval-in-leiningen true
:dependencies [[lein-gen "0.2.1"]]
:profiles {:dev {:plugins [[lein-gen "0.2.1"]]}})
| |
29d5aa5d73b7ada2bae892db4fb1f71339da2ee6a5dadd40e9022d4167fc13d8 | helq/tensorflow-haskell-deptyped | Output.hs | Copyright 2017 .
--
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
distributed under the ... | null | https://raw.githubusercontent.com/helq/tensorflow-haskell-deptyped/2a8cc7f86e6ab7da2cb7b7324b1bf693f14acb22/library/TensorFlow/DepTyped/Output.hs | haskell |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 2017 .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
# LANGUAGE KindSignatures #
module TensorFlow.DepTyped.Output (
ControlNode(ControlNode, unControlNode)
) where
import qualified TensorFlow.Output as T... |
3c8439fefbe3e5f21a666314de869f7d80fb7b720ee5b0dd1c08afde75ad3c29 | lisp/de.setf.xml | namespace.lisp | -*- Mode : lisp ; Syntax : ansi - common - lisp ; Base : 10 ; Package : xml - query - data - model ; -*-
(in-package :xml-query-data-model)
(setq xml-query-data-model:*namespace*
(xml-query-data-model:defnamespace "#"
(:use)
(:ni... | null | https://raw.githubusercontent.com/lisp/de.setf.xml/827681c969342096c3b95735d84b447befa69fa6/namespaces/trust-mindswap-org/ont/trust-owl/namespace.lisp | lisp | Syntax : ansi - common - lisp ; Base : 10 ; Package : xml - query - data - model ; -*-
(xqdm:find-namespace "#" :if-does-not-exist :load) |
(in-package :xml-query-data-model)
(setq xml-query-data-model:*namespace*
(xml-query-data-model:defnamespace "#"
(:use)
(:nicknames)
(:export "TopicalTrust")
... |
5c302a3fe67eebe37f78e479da9638d64e59fa3688102f87765a85053be149c0 | softwarelanguageslab/maf | R5RS_scp1_square-and-rectangle-2.scm | ; Changes:
* removed : 0
* added : 2
* swaps : 0
* negated predicates : 1
; * swapped branches: 0
* calls to i d fun : 1
(letrec ((maak-rechthoek (lambda (l b)
(letrec ((oppervlakte (lambda ()
(* l b)))
... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_scp1_square-and-rectangle-2.scm | scheme | Changes:
* swapped branches: 0 | * removed : 0
* added : 2
* swaps : 0
* negated predicates : 1
* calls to i d fun : 1
(letrec ((maak-rechthoek (lambda (l b)
(letrec ((oppervlakte (lambda ()
(* l b)))
(omtrek (lambda ()
... |
72c3411ada255806f4507033fbb285265e91c2310421db404f1fcbdb71bfa136 | darrenldl/ocaml-SeqBox | conv_utils.ml | open Stdint
type date_time_mode = [ `UTC | `Local ]
type case = [ `Upper | `Lower ]
let uint64_to_string (v:uint64) : string =
let buf = Bytes.create 8 in
Uint64.to_bytes_big_endian v buf 0;
Bytes.to_string buf
;;
let uint32_to_string (v:uint32) : string =
let buf = Bytes.create 4 in
Uint32.to_bytes_big_e... | null | https://raw.githubusercontent.com/darrenldl/ocaml-SeqBox/658c623db8745ae1d804c75880b29fb53435860f/src/conv_utils.ml | ocaml | open Stdint
type date_time_mode = [ `UTC | `Local ]
type case = [ `Upper | `Lower ]
let uint64_to_string (v:uint64) : string =
let buf = Bytes.create 8 in
Uint64.to_bytes_big_endian v buf 0;
Bytes.to_string buf
;;
let uint32_to_string (v:uint32) : string =
let buf = Bytes.create 4 in
Uint32.to_bytes_big_e... | |
b2127fd0348222ae96a4e53226cd1d31dea876eeb7d441a2bca108f11663f862 | jordanthayer/ocaml-search | model_verifier.ml | * Tracks histograms estimated from the model and during the actual
search . This can be used to see if a model is predicting things
properly .
@author eaburns
@since 2010 - 03 - 12
search. This can be used to see if a model is predicting things
properly.
@author eaburns
@s... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/search/iterative/model_verifier.ml | ocaml | * [see_actual v get_t get_d get_f bound depth node successors] see an
actual node during search.
* [recs_at_depth ary depth] gets the records at the given depth in
the array.
* [next_iteration t] go to the next iteration. | * Tracks histograms estimated from the model and during the actual
search . This can be used to see if a model is predicting things
properly .
@author eaburns
@since 2010 - 03 - 12
search. This can be used to see if a model is predicting things
properly.
@author eaburns
@s... |
c84324dd9fd9332ae5c5d28e20ad89f1b6bb61ca359b44ec6d759c115a71fcea | ocsigen/eliom | eliommod_timeouts.mli | Ocsigen
*
* Copyright ( C ) 2007
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at your ... | null | https://raw.githubusercontent.com/ocsigen/eliom/c3e0eea5bef02e0af3942b6d27585add95d01d6c/src/lib/server/eliommod_timeouts.mli | ocaml | Ocsigen
*
* Copyright ( C ) 2007
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at your ... | |
04e629355d6d5190f52c5cba82a4897ae7c21687aa8c8343013d5143afdd4e40 | yakaz/yamerl | no_such_file.erl | -module('no_such_file').
-include_lib("eunit/include/eunit.hrl").
-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").
single_test_() ->
?_assertThrow(
{yamerl_exception,
[
{yamerl_parsing_error,error,
_,
undefined,undefined,file_open_failure,undefined,[{erro... | null | https://raw.githubusercontent.com/yakaz/yamerl/0032607a7b27fa2b548fc9a02d7ae6b53469c0c5/test/parsing/no_such_file.erl | erlang | -module('no_such_file').
-include_lib("eunit/include/eunit.hrl").
-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").
single_test_() ->
?_assertThrow(
{yamerl_exception,
[
{yamerl_parsing_error,error,
_,
undefined,undefined,file_open_failure,undefined,[{erro... | |
c1601854e33ad54690a663ab2e02666ba8852ba3ea773d75b91272ed49be453a | sqd/araneaSS | shell.hs | {-# LANGUAGE OverloadedStrings #-}
import Data.Conduit
import Data.Conduit.Network
import Control.Monad.Trans
import Control.Concurrent.Async
import Data.Streaming.Network.Internal (HostPreference(Host))
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BS8
import Data.List.Split
im... | null | https://raw.githubusercontent.com/sqd/araneaSS/f573a27a94b48587456d0622b27e2e53589b8217/shell.hs | haskell | # LANGUAGE OverloadedStrings # |
import Data.Conduit
import Data.Conduit.Network
import Control.Monad.Trans
import Control.Concurrent.Async
import Data.Streaming.Network.Internal (HostPreference(Host))
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BS8
import Data.List.Split
import System.Environment
import Cry... |
4adfc5afcc08a60aa65553512108ff0dba27dc55afa313c17b6bce4ad4a6926a | ghc/testsuite | TH_spliceE1.hs | module Main where
my_id :: a -> a
my_id x = $( [| x |] )
main = print (my_id "hello")
| null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/th/TH_spliceE1.hs | haskell | module Main where
my_id :: a -> a
my_id x = $( [| x |] )
main = print (my_id "hello")
| |
a4bdfc136449a0b4aa021b72aa5b7d83da85d8c0e807b295f33f0790ad7fba2c | theodormoroianu/SecondYearCourses | HaskellChurch_20210415103046.hs | {-# LANGUAGE RankNTypes #-}
module HaskellChurch where
| null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/HaskellChurch_20210415103046.hs | haskell | # LANGUAGE RankNTypes # | module HaskellChurch where
|
64a09a93f9adc35cb3dc7f3adf06bbc82d4afa40093fdda110c13b506cdf3963 | kmicinski/program-analysis-examples | create-input-tables.rkt | A tool to create input tables for use by 0cfa-flow.dl . Source
;; language is direct-style lambda calculus.
#lang racket
;; Tables
(define source-lambda (make-hash))
(define source-var-ref (make-hash))
(define source-application (make-hash))
;; Ids
(define var->id (make-hash))
(define/contract (lookup-or-new var)
... | null | https://raw.githubusercontent.com/kmicinski/program-analysis-examples/140e5a3039ba9ddba70dc53fd3c09f3d590997a9/create-input-tables.rkt | racket | language is direct-style lambda calculus.
Tables
Ids
Populate tables for a term
(make-tables `((lambda (x) x) (lambda (y) y))) | A tool to create input tables for use by 0cfa-flow.dl . Source
#lang racket
(define source-lambda (make-hash))
(define source-var-ref (make-hash))
(define source-application (make-hash))
(define var->id (make-hash))
(define/contract (lookup-or-new var)
(any/c . -> . number?)
(if (hash-has-key? var->id var)
... |
102b6042a3d7dc9d3d4e575fd7c9298cff1baae2fe5dc38800078ed2bf6e3b40 | mariari/Misc-Lisp-Scripts | trait-table.lisp | (in-package :slex-test)
(defparameter *table-test* (trait:make-table))
(trait:insert *table-test*
'yuki
'(:cold :intrinsic)
'(:bare-handed :ok))
| null | https://raw.githubusercontent.com/mariari/Misc-Lisp-Scripts/99863683705f10c5f798e8aecd1a2965681c3604/scripts/slex-choice/test/trait-table.lisp | lisp | (in-package :slex-test)
(defparameter *table-test* (trait:make-table))
(trait:insert *table-test*
'yuki
'(:cold :intrinsic)
'(:bare-handed :ok))
| |
0ebaa293b5a480001e8bc759053e533cc5ba4d771c8d1836d1db82937859f959 | ndmitchell/catch | ParseUtils.hs | -- #hide
-----------------------------------------------------------------------------
-- |
-- Module : Language.Haskell.ParseUtils
Copyright : ( c ) The GHC Team , 1997 - 2000
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Stability : experimental
-- Portabi... | null | https://raw.githubusercontent.com/ndmitchell/catch/5d834416a27b4df3f7ce7830c4757d4505aaf96e/src/Haskell/ParseUtils.hs | haskell | #hide
---------------------------------------------------------------------------
|
Module : Language.Haskell.ParseUtils
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : portable
---------------------------------------------------... | Copyright : ( c ) The GHC Team , 1997 - 2000
Utilities for the parser .
module Haskell.ParseUtils (
HsType - > P ( HsName,[HsType ] )
HsExp - > [ HsFieldUpdate ] - > P HsExp
HsQualType - > P ( HsContext , HsName,[HsName ] )
HsQualType - > P ( HsContext , HsName,[HsName ] )
HsQualType - > P ( HsCont... |
f7b97566b6e98f1b661faaf3a15458fab6d6a8fc3b50a3214f745becb2f437e0 | clojure/clojurescript | browser.clj | Copyright ( c ) . All rights reserved .
;; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( -1.0.php )
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;; the t... | null | https://raw.githubusercontent.com/clojure/clojurescript/46838c29651069509993ee3139eee23e01bb8848/src/main/clojure/cljs/repl/browser.clj | clojure | The use and distribution terms for this software are covered by the
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice, or any other, from this software.
ma... | Copyright ( c ) . All rights reserved .
Eclipse Public License 1.0 ( -1.0.php )
(ns cljs.repl.browser
(:refer-clojure :exclude [loaded-libs])
(:require [clojure.java.io :as io]
[clojure.java.browse :as browse]
[clojure.string :as string]
[clojure.edn :as edn]
[... |
3d0f1323cf3b9c99819ea55fa91960c60ba8029c304baa12b9c6d4cb5bb4215d | runtimeverification/haskell-backend | DebugRewriteTrace.hs | # LANGUAGE NoStrict #
# LANGUAGE NoStrictData #
|
Copyright : ( c ) Runtime Verification , 2022
License : BSD-3 - Clause
Copyright : (c) Runtime Verification, 2022
License : BSD-3-Clause
-}
module Kore.Log.DebugRewriteTrace (
DebugInitialClaim (..),
DebugInitialPattern (..),
DebugFina... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/9491e547a1e0d46f7ff2a8867c09322106c261c6/kore/src/Kore/Log/DebugRewriteTrace.hs | haskell | # LANGUAGE NoStrict #
# LANGUAGE NoStrictData #
|
Copyright : ( c ) Runtime Verification , 2022
License : BSD-3 - Clause
Copyright : (c) Runtime Verification, 2022
License : BSD-3-Clause
-}
module Kore.Log.DebugRewriteTrace (
DebugInitialClaim (..),
DebugInitialPattern (..),
DebugFina... | |
bbfa8c24e87a874b6c822a543de94fe0727824a484222b189d8fd4b9e4a31931 | luqui/experiments | infset.hs | # LANGUAGE LambdaCase #
import Prelude hiding (null)
import qualified Data.Searchable as S
import Data.Function (fix)
data Set
= Empty
| Nonempty (S.Set Set)
member :: Set -> Set -> Bool
x `member` Empty = False
x `member` Nonempty a = x `S.member` a
forevery :: Set -> (Set -> Bool) -> Bool
forevery Empty ... | null | https://raw.githubusercontent.com/luqui/experiments/c0b9153c41507afbfdeb2b32bfc65fd1ac83fb26/infset.hs | haskell | # LANGUAGE LambdaCase #
import Prelude hiding (null)
import qualified Data.Searchable as S
import Data.Function (fix)
data Set
= Empty
| Nonempty (S.Set Set)
member :: Set -> Set -> Bool
x `member` Empty = False
x `member` Nonempty a = x `S.member` a
forevery :: Set -> (Set -> Bool) -> Bool
forevery Empty ... | |
28a4e8b5effdfd91a71af3bcdd9cfc4ec9f53bcda2f5e92fb388ed6e7462da0a | AbstractMachinesLab/caramel | mpipeline.mli | type t
val make : Mconfig.t -> Msource.t -> t
val with_pipeline : t -> (unit -> 'a) -> 'a
val for_completion : Msource.position -> t -> t
val raw_source : t -> Msource.t
val input_config : t -> Mconfig.t
val input_source : t -> Msource.t
val get_lexing_pos : t -> [< Msource.position] -> Lexing.position
val reader_co... | null | https://raw.githubusercontent.com/AbstractMachinesLab/caramel/7d4e505d6032e22a630d2e3bd7085b77d0efbb0c/vendor/ocaml-lsp-1.4.0/ocaml-lsp-server/vendor/merlin/src/kernel/mpipeline.mli | ocaml | type t
val make : Mconfig.t -> Msource.t -> t
val with_pipeline : t -> (unit -> 'a) -> 'a
val for_completion : Msource.position -> t -> t
val raw_source : t -> Msource.t
val input_config : t -> Mconfig.t
val input_source : t -> Msource.t
val get_lexing_pos : t -> [< Msource.position] -> Lexing.position
val reader_co... | |
258ebb99e5232a53d86e55a40a3f10d3dd2ec9769ca10b7c7bd74b746e6783a8 | trentmaetzold/cs61as | hw0-3-tests.rkt | #lang racket
(require racket/sandbox)
(provide (all-defined-out))
(define (create-tests e questions)
(define all-names '())
(define-syntax-rule
(define/test name code ...)
(when (or (null? questions) (member (symbol->string 'name) questions))
(set! all-names (append all-names (list (symbol->strin... | null | https://raw.githubusercontent.com/trentmaetzold/cs61as/6e4830786e2c28a26203a4f2046776405af2c10e/homework/tests/hw0-3-tests.rkt | racket | (define/test
count-ums-tests
(check-equal?
(count-ums
3)
(define/test
countdown-tests
(define/test
numbers-tests
(check-equal? (numbers '(but there are none)) '())
(check-equal? | #lang racket
(require racket/sandbox)
(provide (all-defined-out))
(define (create-tests e questions)
(define all-names '())
(define-syntax-rule
(define/test name code ...)
(when (or (null? questions) (member (symbol->string 'name) questions))
(set! all-names (append all-names (list (symbol->strin... |
1212571ee542250b2eb6ddb651a520de7e20114b71568668f3fdd775ab4d4524 | open-company/open-company-storage | activity.clj | (ns oc.storage.api.activity
"Liberator API for entry collection resources."
(:require [if-let.core :refer (if-let*)]
[defun.core :refer (defun)]
[compojure.core :as compojure :refer (OPTIONS GET)]
[liberator.core :refer (defresource by-method)]
[oc.lib.slugify :as slu... | null | https://raw.githubusercontent.com/open-company/open-company-storage/9f084d8de3d889372a11c418d25206c8d55e768c/src/oc/storage/api/activity.clj | clojure | ---- Boards list -----
---- Helpers for request parameters ----
---- Activity lists assemble ----
Give each activity its board name
Give each activity its board name
Give each activity its board name
Give each activity its board name
Give each activity its board name
---- Responses -----
default is before
In... | (ns oc.storage.api.activity
"Liberator API for entry collection resources."
(:require [if-let.core :refer (if-let*)]
[defun.core :refer (defun)]
[compojure.core :as compojure :refer (OPTIONS GET)]
[liberator.core :refer (defresource by-method)]
[oc.lib.slugify :as slu... |
c0472adb835c0d179897d16bd1c58451f7079ceffb7847d50dab7c636a99ebb0 | aaronallen8455/jq-bindings | Spec.hs | {-# LANGUAGE OverloadedStrings #-}
import qualified Control.Functor.Linear as FL
import qualified Data.ByteString.Char8 as BS8
import Data.Coerce (coerce)
import Data.Functor.Contravariant
import qualified Data.Text as T
import GHC.Generics (Generic)
import qualified Jq.Decode as Dec
impor... | null | https://raw.githubusercontent.com/aaronallen8455/jq-bindings/441548ed11e6e2509a2bb23750d1ccf0f83d4cf1/jq-codec/test/Spec.hs | haskell | # LANGUAGE OverloadedStrings # | import qualified Control.Functor.Linear as FL
import qualified Data.ByteString.Char8 as BS8
import Data.Coerce (coerce)
import Data.Functor.Contravariant
import qualified Data.Text as T
import GHC.Generics (Generic)
import qualified Jq.Decode as Dec
import qualified Jq.Encode as Enc
import... |
07cd5813416090912c41ec83dd41680668b75ea8bfcd4da4fbac8a8e16170ebf | erlang-nix/rebar3_nix | rebar3_nix_jsone_decode_vendored.erl | %%% @doc JSON decoding module
@private
%%% @end
%%%
Copyright ( c ) 2013 - 2016 , < >
%%%
%%% The MIT License
%%%
%%% Permission is hereby granted, free of charge, to any person obtaining a copy
%%% of this software and associated documentation files (the "Software"), to deal
in the Software without restrictio... | null | https://raw.githubusercontent.com/erlang-nix/rebar3_nix/8348ece2f205501c90744d1004ebe0c4c7030714/src/rebar3_nix_jsone_decode_vendored.erl | erlang | @doc JSON decoding module
@end
The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the... | @private
Copyright ( c ) 2013 - 2016 , < >
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY... |
ae6da7b590118c4853c1df15213cdaf10d57c756f9ec3f2307080f1911235f95 | qfpl/leaderboard | Match.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
{-# LANGUAGE TypeOperators #-}
module Leaderboard.API.Match where
import Control.Monad.Except (MonadError, throwError)
import Control.... | null | https://raw.githubusercontent.com/qfpl/leaderboard/2ada34ec31b197e44a9d17153b9397cdc3c83038/src/Leaderboard/API/Match.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators # | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
module Leaderboard.API.Match where
import Control.Monad.Except (MonadError, throwError)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Log (MonadLog)
import qualified Control.Monad.L... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.