_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 |
|---|---|---|---|---|---|---|---|---|
183dc11267262c9cb55a23457e0da70289a9f4370dc12f96371a4dac573fe4bc | denisidoro/rosebud | serialization.clj | (ns quark.beta.http.logic.serialization
(:require [cheshire.core :as json]
[clojure.edn :as edn]
[clojure.string :as str]
[clojure.walk :as walk]))
(defn ^:private replace-char
;; Replaces the from character with the to character in s, which can be a String or a Keyword
;; Doe... | null | https://raw.githubusercontent.com/denisidoro/rosebud/90385528d9a75a0e17803df487a4f6cfb87e981c/server/src/quark/beta/http/logic/serialization.clj | clojure | Replaces the from character with the to character in s, which can be a String or a Keyword
Does nothing if s is a keyword that is in the exception set
Will replace dashes with underscores or underscores with dashes for the keywords in a map
Ignores String values in a map (both keys and values) | (ns quark.beta.http.logic.serialization
(:require [cheshire.core :as json]
[clojure.edn :as edn]
[clojure.string :as str]
[clojure.walk :as walk]))
(defn ^:private replace-char
[s from to exceptions]
(if (contains? exceptions s)
s
(keyword (str/replace (name s) from to... |
d9da3f364979f279f24fc0d4f7c21189972c3e533ad49d427238bb8ad93c0375 | MyDataFlow/ttalk-server | mongoose_cleaner.erl | -module(mongoose_cleaner).
-behaviour(gen_server).
%% API
-export([start_link/0]).
%% gen_server callbacks
-export([init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3]).
-include("ejabberd.hrl").
-define(NODE_CLEANUP_LOCK(Node), {node_cleanu... | null | https://raw.githubusercontent.com/MyDataFlow/ttalk-server/07a60d5d74cd86aedd1f19c922d9d3abf2ebf28d/apps/ejabberd/src/mongoose_cleaner.erl | erlang | API
gen_server callbacks
===================================================================
API
===================================================================
===================================================================
gen_server callbacks
==============================================================... | -module(mongoose_cleaner).
-behaviour(gen_server).
-export([start_link/0]).
-export([init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3]).
-include("ejabberd.hrl").
-define(NODE_CLEANUP_LOCK(Node), {node_cleanup_lock, Node}).
-define(SERVER,... |
51df7a912d7b1a619c5a05f1e74810362955ac88f91ab85504b46719cc5c3bc3 | adetokunbo/tmp-proc | WarpSpec.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE GADTs #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Test.System.TmpProc.WarpSpec wher... | null | https://raw.githubusercontent.com/adetokunbo/tmp-proc/9933efd6e6f046da019ff0dbf3332b13cbfe034e/tmp-proc/test/Test/System/TmpProc/WarpSpec.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE OverloadedStrings #
responds to health checks on /health. | # LANGUAGE GADTs #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Test.System.TmpProc.WarpSpec where
import Test.Hspec
import Control.Exception (catch)
import Data.Proxy ... |
078209eda770d0e49d1bb7f22e1029a5f2e9ecb07fb3c4c23fdfc5b4459f3ada | dschrempf/elynx | Codon.hs | # LANGUAGE DeriveGeneric #
-- |
Module : ELynx . Character .
Description : Codons are triplets of nucleotides
Copyright : 2021
License : GPL-3.0 - or - later
--
-- Maintainer :
-- Stability : unstable
-- Portability : portable
--
Creation date : Thu May 16 07:58:50 2019 .
--
-... | null | https://raw.githubusercontent.com/dschrempf/elynx/f73f4474c61c22c6a9e54c56bdc34b37eff09687/elynx-seq/src/ELynx/Character/Codon.hs | haskell | |
Maintainer :
Stability : unstable
Portability : portable
The different universal codes.
-
-
-
| Universal codes.
It is important that the map is lazy, because some keys have errors as values.
Permutation of the triplets PLUS GAPS! I avoid 'Z' because I do not want to
The actual codes.
"FFLLS... | # LANGUAGE DeriveGeneric #
Module : ELynx . Character .
Description : Codons are triplets of nucleotides
Copyright : 2021
License : GPL-3.0 - or - later
Creation date : Thu May 16 07:58:50 2019 .
module ELynx.Character.Codon
( Codon (Codon),
fromVecUnsafe,
UniversalCode (..... |
264272f41ab71c0a04378eb162b5b2576d60177094b315cda8ab91176d91b4ce | lpw25/ocaml-typed-effects | test1.ml | effect E : unit
let () =
Printf.printf "%d\n%!" @@ try 10 with effect E k -> 11
| null | https://raw.githubusercontent.com/lpw25/ocaml-typed-effects/79ea08b285c1fd9caf3f5a4d2aa112877f882bea/testsuite/tests/effects/test1.ml | ocaml | effect E : unit
let () =
Printf.printf "%d\n%!" @@ try 10 with effect E k -> 11
| |
c6d79cb4bd24b18fb5b66c5066e7702ce69936f6d28292aa39a7575c5c4e91b1 | ds-wizard/engine-backend | RequestMapper.hs | module Wizard.Integration.Http.Typehint.RequestMapper (
toRetrieveTypehintsRequest,
) where
import qualified Data.ByteString.Char8 as BS
import qualified Data.Map.Strict as M
import Prelude hiding (lookup)
import Shared.Model.Common.MapEntry
import Shared.Model.KnowledgeModel.KnowledgeModel
import Wizard.Model.Http... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/55649ab4ec866caf8e49a88c21c4753367ebe3c7/engine-wizard/src/Wizard/Integration/Http/Typehint/RequestMapper.hs | haskell | module Wizard.Integration.Http.Typehint.RequestMapper (
toRetrieveTypehintsRequest,
) where
import qualified Data.ByteString.Char8 as BS
import qualified Data.Map.Strict as M
import Prelude hiding (lookup)
import Shared.Model.Common.MapEntry
import Shared.Model.KnowledgeModel.KnowledgeModel
import Wizard.Model.Http... | |
89f158c5d4b87068ac7b9c8425259b5e80ae838459789c1018357d870782603e | sylane/erod | erod_actions.erl | %%% ==========================================================================
Copyright ( c ) 2014 < >
%%%
%%% This file is part of erod.
%%%
%%% Erod 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 , eit... | null | https://raw.githubusercontent.com/sylane/erod/b0c435f8546ea38b1501d3e22614fe7951c61c9a/apps/erod/src/erod_actions.erl | erlang | ==========================================================================
This file is part of erod.
Erod is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the impli... | Copyright ( c ) 2014 < >
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
2014 < >
@author < >
-module(erod_actions).
-author('Sebastien Merle... |
1c0a1e17b6c2159fd9657d0854a875df55ac084cf9c03d49887c204ca0f259b3 | plum-umd/c-strider | ciloptions.mli |
*
* Copyright ( c ) 2001 - 2003 ,
* < >
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
* ... | null | https://raw.githubusercontent.com/plum-umd/c-strider/3d3a3743bc28456eb6d50e01805ce484ab3c04e6/tools/cil-1.3.7/src/ciloptions.mli | ocaml | * The list of file names
* Adds the file to the start of fileNames |
*
* Copyright ( c ) 2001 - 2003 ,
* < >
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
* ... |
3e4a3e958fc6016fe44dbc21b369551b7cd0a5121cc313d2e1117a5366b7e205 | anoma/juvix | Inference.hs | module Juvix.Compiler.Internal.Translation.FromInternal.Analysis.TypeChecking.Data.Inference
( module Juvix.Compiler.Internal.Translation.FromInternal.Analysis.TypeChecking.Data.Inference,
module Juvix.Compiler.Internal.Translation.FromInternal.Analysis.TypeChecking.Data.FunctionsTable,
)
where
import Data.Has... | null | https://raw.githubusercontent.com/anoma/juvix/0f29b3ee936c3498e3e7e22ed27fc0e6a38133e0/src/Juvix/Compiler/Internal/Translation/FromInternal/Analysis/TypeChecking/Data/Inference.hs | haskell | | Type may contain holes
NOTE: we cannot always normalize let expressions because we do not have closures.
We give up
Supports alpha equivalence.
NOTE type is ignored, I think it is ok
| Assumes the given function has been type checked
| NOTE: Registers the function *only* if the result type is Type | module Juvix.Compiler.Internal.Translation.FromInternal.Analysis.TypeChecking.Data.Inference
( module Juvix.Compiler.Internal.Translation.FromInternal.Analysis.TypeChecking.Data.Inference,
module Juvix.Compiler.Internal.Translation.FromInternal.Analysis.TypeChecking.Data.FunctionsTable,
)
where
import Data.Has... |
4beafaaedd456c62e11c2e0c3b2abeb0c714c4115ea5e784e270a01bcef60a64 | zalky/reflet | ui.cljs | (ns reflet.debug.ui
(:require [cljs.pprint :as pprint]
[react-dom :as react-dom]
[reagent.core :as r]
[reagent.dom :as dom]
[reflet.core :as f]
[reflet.css.bundled :as bundled]
[reflet.db :as db]
[reflet.debug :as d]
[refl... | null | https://raw.githubusercontent.com/zalky/reflet/fe88f7fd7d761dfa40af0e8f83d7f390e5a914b6/src/clojure/reflet/debug/ui.cljs | clojure | (ns reflet.debug.ui
(:require [cljs.pprint :as pprint]
[react-dom :as react-dom]
[reagent.core :as r]
[reagent.dom :as dom]
[reflet.core :as f]
[reflet.css.bundled :as bundled]
[reflet.db :as db]
[reflet.debug :as d]
[refl... | |
a360c54f6e3f2cf5b461c6767707f9eb7a97dfee25996b8c94422f88f03f58e6 | terry-xiaoyu/learn-erlang-in-30-mins | route.erl | -module(route).
-export([ensure_db/0,
lookup_server/1,
register_server/2,
unregister_server/1]).
ensure_db() ->
case ets:info(servers) of
undefined ->
spawn(fun() -> ets:new(servers, [named_table, public]), receive after infinity->ok end end);
_ -> ok
end.
lookup_server(Us... | null | https://raw.githubusercontent.com/terry-xiaoyu/learn-erlang-in-30-mins/5bf4a7278ec89c264084c335c11d6f52a68ab76f/chat/route.erl | erlang | -module(route).
-export([ensure_db/0,
lookup_server/1,
register_server/2,
unregister_server/1]).
ensure_db() ->
case ets:info(servers) of
undefined ->
spawn(fun() -> ets:new(servers, [named_table, public]), receive after infinity->ok end end);
_ -> ok
end.
lookup_server(Us... | |
4af7cad5af748910e3b78309e551b0128b45d490cb50eec74db25b6d3bbc0a7a | tonyfloatersu/solution-haskell-craft-of-FP | Chapter_7_my_note.hs | module Chapter_7_my_note where
import Prelude hiding (Word, getLine)
import Data.Char
import Test.QuickCheck
head' :: [a] -> a
head' (x : _) = x
tail' :: [a] -> [a]
tail' (_ : xs) = xs
null' :: [a] -> Bool
null' [] = True
null' (_ : _) = False
digits :: String -> Stri... | null | https://raw.githubusercontent.com/tonyfloatersu/solution-haskell-craft-of-FP/0d4090ef28417c82a7b01e4a764f657641cb83f3/Chapter_7_my_note.hs | haskell | here is a bug and I need to fix
check when the case is "change" "change" | module Chapter_7_my_note where
import Prelude hiding (Word, getLine)
import Data.Char
import Test.QuickCheck
head' :: [a] -> a
head' (x : _) = x
tail' :: [a] -> [a]
tail' (_ : xs) = xs
null' :: [a] -> Bool
null' [] = True
null' (_ : _) = False
digits :: String -> Stri... |
83356746a30f264ddba03df15d3c28319e46be680e8d0833f3d1e43b6e84b157 | helium/erlang-lorawan | lora_core_tests.erl | -module(lora_core_tests).
%% ==================================================================
EUNIT Tests
%% ==================================================================
-ifdef(EUNIT).
-include("lora.hrl").
-include_lib("eunit/include/eunit.hrl").
payload_util_test() ->
ValidHex00 = is_hex_string(<<"a0"... | null | https://raw.githubusercontent.com/helium/erlang-lorawan/e513c524a598728831c499f08e037ad7115636bf/test/lora_core_tests.erl | erlang | ==================================================================
==================================================================
payload_07_test() ->
decode_encode(fun sample_join_request_02/0),
fin.
-packet-decoder-0ta6puiniaut.runkit.sh/?
-packet/issues/35
-parser
sample_join_request_02() ->
% ... | -module(lora_core_tests).
EUNIT Tests
-ifdef(EUNIT).
-include("lora.hrl").
-include_lib("eunit/include/eunit.hrl").
payload_util_test() ->
ValidHex00 = is_hex_string(<<"a0">>),
?assertEqual(true, ValidHex00),
{Pay0, _Key0, _AppKey} = sample_downlink(),
ValidHex0 = is_hex_string(Pay0),
?assertEqu... |
59a26c10ec2617285695e36d705b980f0566b22e40e778d4df336c5014640272 | robert-strandh/SICL | floating-point-constants.lisp | (cl:in-package #:sicl-arithmetic)
(defconstant most-positive-single-float (float-features:bits-single-float #x7f7fffff))
(defconstant least-positive-single-float (float-features:bits-single-float #x00000001))
(defconstant least-positive-normalized-single-float (float-features:bits-single-float #... | null | https://raw.githubusercontent.com/robert-strandh/SICL/517be7288c0d1815a95675435467d6686ab7c185/Code/Arithmetic/floating-point-constants.lisp | lisp | (cl:in-package #:sicl-arithmetic)
(defconstant most-positive-single-float (float-features:bits-single-float #x7f7fffff))
(defconstant least-positive-single-float (float-features:bits-single-float #x00000001))
(defconstant least-positive-normalized-single-float (float-features:bits-single-float #... | |
e0191cac7994c09bff505135c72a8be01aae612fd92d21b7ccbcdc7c11623197 | ygmpkk/house | Arrow.hs | module Arrow (module Control.Arrow) where
import Control.Arrow
| null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/hslibs/lang/Arrow.hs | haskell | module Arrow (module Control.Arrow) where
import Control.Arrow
| |
4db2f3750bfec8e3284432a20c39d49114cae42d18bd6e02a18b6e6e95d5a883 | rkallos/wrek | wrek_true_vert.erl | -module(wrek_true_vert).
-behavior(wrek_vert).
-export([run/2]).
run(_Args, Parent) ->
Pwd = os:cmd("pwd") -- "\n",
{ok, Fun} = wrek_vert:exec(Parent, Pwd, "true"),
ok = Fun(),
{ok, #{}}.
| null | https://raw.githubusercontent.com/rkallos/wrek/3859e9efdf21227e6e8e0ea81095b229eceb6641/test/verts/wrek_true_vert.erl | erlang | -module(wrek_true_vert).
-behavior(wrek_vert).
-export([run/2]).
run(_Args, Parent) ->
Pwd = os:cmd("pwd") -- "\n",
{ok, Fun} = wrek_vert:exec(Parent, Pwd, "true"),
ok = Fun(),
{ok, #{}}.
| |
f764c6b6c1fe2bd282b996767542eb01772d04a52f69a885763a86f7893becc4 | alanz/ghc-exactprint | BundleInternal.hs | # LANGUAGE PatternSynonyms #
module BundleInternal (A(NewA,MkA, NoA)) where
newtype A = NewA (Maybe Int)
pattern MkA n = NewA (Just n)
pattern NoA = NewA Nothing
| null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/ghc80/BundleInternal.hs | haskell | # LANGUAGE PatternSynonyms #
module BundleInternal (A(NewA,MkA, NoA)) where
newtype A = NewA (Maybe Int)
pattern MkA n = NewA (Just n)
pattern NoA = NewA Nothing
| |
08c9e7ac90b021347a2ca05715b2db4dea435fe00767674e1a50fbd2d4b3b1dd | uw-unsat/serval-sosp19 | pmp.rkt | #lang rosette/safe
(require
"base.rkt"
"../lib/core.rkt"
(only-in racket/base for/list)
(only-in racket/list range)
(only-in racket/match match)
)
(provide pmp-privs)
(define PMPCFG_A_OFF 0) ; PMPCFG_A_OFF
(define PMPCFG_A_NAPOT 24) ; PMPCFG_A_NAPOT
(define PMPCFG_A_TOR 8) ; PMPCFG_A_TOR
(define PMPCFG_R 1... | null | https://raw.githubusercontent.com/uw-unsat/serval-sosp19/175c42660fad84b44e4c9f6f723fd3c9450d65d4/serval/serval/riscv/pmp.rkt | racket | PMPCFG_A_OFF
PMPCFG_A_NAPOT
PMPCFG_A_TOR
PMPCFG_R
PMPCFG_W
PMPCFG_RWX | #lang rosette/safe
(require
"base.rkt"
"../lib/core.rkt"
(only-in racket/base for/list)
(only-in racket/list range)
(only-in racket/match match)
)
(provide pmp-privs)
PMPCFG_X
(define (pmp-privs cpu ptr size)
(define pmpcfg0 (csr-ref cpu 'pmpcfg0))
(define pmpcfg2 (csr-ref cpu 'pmpcfg2))
(define ... |
a1f97e170dffff6ac6598d258dbc99787e26ce49fcc21e5ce77023e17799e8d4 | input-output-hk/marlowe-cardano | Server.hs | # LANGUAGE DataKinds #
# LANGUAGE DuplicateRecordFields #
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE StrictData #-}
module Language.Marlowe.Runtime.ChainSync.Server
where
import Control.Concurrent.Component
import Data.Functor (void, (<&>))
import Language.Marlowe.Runtime.ChainSync.Api (ChainPoint, Move, RuntimeChain... | null | https://raw.githubusercontent.com/input-output-hk/marlowe-cardano/bc9a0325f13b886e90ea05196ffb70a46c2ab095/marlowe-chain-sync/libchainsync/Language/Marlowe/Runtime/ChainSync/Server.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE StrictData # | # LANGUAGE DataKinds #
# LANGUAGE DuplicateRecordFields #
module Language.Marlowe.Runtime.ChainSync.Server
where
import Control.Concurrent.Component
import Data.Functor (void, (<&>))
import Language.Marlowe.Runtime.ChainSync.Api (ChainPoint, Move, RuntimeChainSeekServer, WithGenesis(..), moveSchema)
import Language... |
1c51d2d67cd3bcdad5f11531313506d94fc0fb75c30b1d6c478d5675138ba335 | racket/typed-racket | untyped-contract-shallow.rkt | #lang typed/racket/shallow
;; Identifier imported from untyped-contract stuck with refined type
;; in a shallow context.
;; Need to abide by that refined type
(require "untyped-contract-aux/untyped.rkt")
(define (g (z : (U Symbol String))) : Void
;; (f z) = type error
(f (assert z symbol?)))
| null | https://raw.githubusercontent.com/racket/typed-racket/1dde78d165472d67ae682b68622d2b7ee3e15e1e/typed-racket-test/succeed/shallow/untyped-contract-shallow.rkt | racket | Identifier imported from untyped-contract stuck with refined type
in a shallow context.
Need to abide by that refined type
(f z) = type error | #lang typed/racket/shallow
(require "untyped-contract-aux/untyped.rkt")
(define (g (z : (U Symbol String))) : Void
(f (assert z symbol?)))
|
54095be92fbafbb9f4f04b486075d249e61e409f6e104077720ca2927b8b27fd | ocaml-omake/omake | omake_shell_sys.mli |
* Architecture - independent process management .
*
* ----------------------------------------------------------------
*
* @begin[license ]
* Copyright ( C ) 2004 Mojave Group , Caltech
*
* This program is free software ; you can redistribute it and/or
* modify it under the terms of the GNU G... | null | https://raw.githubusercontent.com/ocaml-omake/omake/08b2a83fb558f6eb6847566cbe1a562230da2b14/src/shell/omake_shell_sys.mli | ocaml |
* Set whether we are in interactive mode.
* Defaults to true.
* Set the process group for the current terminal.
* Does nothing if there is no terminal, or the
* session is not interactive.
* Send a signal to a process.
* Set/clear the close on exec flags.
* Wait:
* wait pgrp leader nohang
* ... |
* Architecture - independent process management .
*
* ----------------------------------------------------------------
*
* @begin[license ]
* Copyright ( C ) 2004 Mojave Group , Caltech
*
* This program is free software ; you can redistribute it and/or
* modify it under the terms of the GNU G... |
0a1775da86de044614bc9ac0a87a97a7583779e1d4b3c9806c38db47a9f46d52 | cloojure/tupelo | chars.cljc | 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 th... | null | https://raw.githubusercontent.com/cloojure/tupelo/4105fefbb1c4d1b2f06fa4993f9dd007e5e41e00/test/cljc/tst/tupelo/chars.cljc | clojure | (-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.
----------------------------------------------------... | Copyright ( c ) . All rights reserved .
The use and distribution terms for this software are covered by the Eclipse Public License 1.0
(ns tst.tupelo.chars
(:refer-clojure :exclude [take drop])
#?(:cljs (:require-macros
[tupelo.misc]
[tupelo.testy]
))
(:require
... |
d6262fe55556081f0f8e18aa0bb0f77752aecf25ac7bb1c6912ff4a55e234956 | lvh/caesium | scalar.clj | (ns caesium.crypto.core.ristretto255.scalar
"**DANGER** This namespace consists of low-level details that you
should not use unless you know what you are doing. You probably
want [[caesium.crypto.box]] instead.
Scalar operations on Ristretto255."
(:refer-clojure :exclude [bytes reduce complement])
(:requir... | null | https://raw.githubusercontent.com/lvh/caesium/cb90a4325fa48a2e4fb6cad810f340125a53fc57/src/caesium/crypto/core/ristretto255/scalar.clj | clojure | (ns caesium.crypto.core.ristretto255.scalar
"**DANGER** This namespace consists of low-level details that you
should not use unless you know what you are doing. You probably
want [[caesium.crypto.box]] instead.
Scalar operations on Ristretto255."
(:refer-clojure :exclude [bytes reduce complement])
(:requir... | |
6da8c6d6fcb5553918d9528ac312f0bec9952391fc7c9ce5e54194a7ee90b764 | swaywm/chicken-wlroots | wayland-protocols.build.scm | #! /usr/bin/env -S csi -script
(import (srfi 13)
(chicken io)
(chicken process)
(chicken process-context)
(chicken string))
(define (command->string cmdline)
(call-with-input-pipe cmdline
(lambda (p)
(string-trim-right (read-string #f p)))))
(define wayland-protocols (comm... | null | https://raw.githubusercontent.com/swaywm/chicken-wlroots/649f200126102b1247ba638eb797d14b46bafc0b/wayland-protocols.build.scm | scheme | #! /usr/bin/env -S csi -script
(import (srfi 13)
(chicken io)
(chicken process)
(chicken process-context)
(chicken string))
(define (command->string cmdline)
(call-with-input-pipe cmdline
(lambda (p)
(string-trim-right (read-string #f p)))))
(define wayland-protocols (comm... | |
fbca8f25004bf10be6ac63f13b8d039b505b087e2f967aeb684c90ca3b31ad46 | tisnik/clojure-examples | core_test.clj | (ns dis.core-test
(:require [clojure.test :refer :all]
[dis.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| null | https://raw.githubusercontent.com/tisnik/clojure-examples/984af4a3e20d994b4f4989678ee1330e409fdae3/dis/test/dis/core_test.clj | clojure | (ns dis.core-test
(:require [clojure.test :refer :all]
[dis.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| |
aea98b79e06c4f8e1786efc075e8c5ea7485adbb98530322e9c2f11a799eb387 | adamConnerSax/knit-haskell | Html.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE PolyKinds #-}
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TypeOperators #-}
{-# LANGUAGE ScopedTypeVariables #-}
# OPTIONS_GHC -fwarn - incomplete - patte... | null | https://raw.githubusercontent.com/adamConnerSax/knit-haskell/d931841bca188125de28cbd130b3d2fe22b356ed/src/Knit/Effect/Html.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE PolyKinds #
# LANGUAGE GADTs #
# LANGUAGE TypeOperators #
# LANGUAGE ScopedTypeVariables #
* Lucid
** Effects
** Actions
* Blaze
** Effects
** Actions
** Interpretations
* Re-exports
For ... | # LANGUAGE FlexibleContexts #
# OPTIONS_GHC -fwarn - incomplete - patterns #
|
Module : Knit . Effect . Html
Description : Polysemy writer effects for creating Lucid / Blaze documents
Copyright : ( c ) 2019
License : BSD-3 - Clause
Maintainer :
Stability : experimental ... |
c43cab62037acb956740fe4795520fa754bc977f9d10e84293a9ce7a3deb809f | AshleyYakeley/Truth | None.hs | module Changes.Core.Types.None where
import Changes.Core.Edit
import Changes.Core.Import
import Changes.Core.Read
newtype NoReader (a :: Type) (t :: Type) =
MkNoReader Void
deriving (Eq, Countable, Searchable)
instance TestEquality (NoReader a) where
testEquality = never
instance Finite (NoReader a t) w... | null | https://raw.githubusercontent.com/AshleyYakeley/Truth/b5adc6730ae86f67fb3b5990db3c1d94273a4f1b/Changes/changes-core/lib/Changes/Core/Types/None.hs | haskell | | Can't touch this. | module Changes.Core.Types.None where
import Changes.Core.Edit
import Changes.Core.Import
import Changes.Core.Read
newtype NoReader (a :: Type) (t :: Type) =
MkNoReader Void
deriving (Eq, Countable, Searchable)
instance TestEquality (NoReader a) where
testEquality = never
instance Finite (NoReader a t) w... |
c5e43f3fee0cfbad0fcad08aef5c08525741f54a8f44f679eeaf234f7227756c | fmi-lab/fp-elective-2017 | count-digits.scm | (require rackunit rackunit/text-ui)
(define (count-digits n)
(define (helper counter result)
(if (= counter 0)
result
(helper (quotient counter 10)
(+ result 1))))
(helper n 0))
(define count-digits-tests
(test-suite
"Tests for count-digits"
(check = (count-digits 3) 1... | null | https://raw.githubusercontent.com/fmi-lab/fp-elective-2017/e88d5c0319b6d03c0ecd8a12a2856fb1bf5dcbf3/exercises/02/count-digits.scm | scheme | (require rackunit rackunit/text-ui)
(define (count-digits n)
(define (helper counter result)
(if (= counter 0)
result
(helper (quotient counter 10)
(+ result 1))))
(helper n 0))
(define count-digits-tests
(test-suite
"Tests for count-digits"
(check = (count-digits 3) 1... | |
13f3786c65131bfc23d6d872a2cfcd3644b2386e020f16a649f72983cb94a938 | clojure-interop/java-jdk | ChangedCharSetException.clj | (ns javax.swing.text.ChangedCharSetException
"ChangedCharSetException as the name indicates is an exception
thrown when the charset is changed."
(:refer-clojure :only [require comment defn ->])
(:import [javax.swing.text ChangedCharSetException]))
(defn ->changed-char-set-exception
"Constructor.
char-set-... | null | https://raw.githubusercontent.com/clojure-interop/java-jdk/8d7a223e0f9a0965eb0332fad595cf7649d9d96e/javax.swing/src/javax/swing/text/ChangedCharSetException.clj | clojure | (ns javax.swing.text.ChangedCharSetException
"ChangedCharSetException as the name indicates is an exception
thrown when the charset is changed."
(:refer-clojure :only [require comment defn ->])
(:import [javax.swing.text ChangedCharSetException]))
(defn ->changed-char-set-exception
"Constructor.
char-set-... | |
ea85ce07bd98c4b02a0935394306e72094cf2c10901f4d733704f5e0d2e6c951 | programaker-project/Programaker-Core | automate_bot_engine_thread_runner_sup.erl | %%%-------------------------------------------------------------------
%% @doc automate_bot_engine supervisor for each task being run
%% (also the one that spawns them).
%% @end
%%%-------------------------------------------------------------------
-module(automate_bot_engine_thread_runner_sup).
-behaviour(super... | null | https://raw.githubusercontent.com/programaker-project/Programaker-Core/ef10fc6d2a228b2096b121170c421f5c29f9f270/backend/apps/automate_bot_engine/src/automate_bot_engine_thread_runner_sup.erl | erlang | -------------------------------------------------------------------
@doc automate_bot_engine supervisor for each task being run
(also the one that spawns them).
@end
-------------------------------------------------------------------
API
Supervisor callbacks
===================================================... |
-module(automate_bot_engine_thread_runner_sup).
-behaviour(supervisor).
-export([start_link/0
, start/1
]).
-export([init/1]).
-define(SERVER, ?MODULE).
-include("../../automate_common_types/src/definitions.hrl").
start(ThreadId) ->
R = supervisor:start_child(?SERVER, [ThreadId]),
ok.
sta... |
f419e478bf528cc1a4e1bbc4eaa47ab62602609a9f9d9848f1d2e2e94c44503c | odis-labs/onix | Lock_file.ml | type t = {
repository_urls : OpamUrl.t list;
packages : Lock_pkg.t list;
compiler : OpamPackage.t;
}
let make ~repository_urls ~compiler packages =
(* TODO: Move validation up. *)
List.iter
(fun url ->
if Option.is_none url.OpamUrl.hash then
Fmt.failwith "Repo URI without rev when creating ... | null | https://raw.githubusercontent.com/odis-labs/onix/81cc82953ef062425656ac9bf80474f2ce642f5b/src/onix_core/Lock_file.ml | ocaml | TODO: Move validation up. | type t = {
repository_urls : OpamUrl.t list;
packages : Lock_pkg.t list;
compiler : OpamPackage.t;
}
let make ~repository_urls ~compiler packages =
List.iter
(fun url ->
if Option.is_none url.OpamUrl.hash then
Fmt.failwith "Repo URI without rev when creating a lock file: %a"
Opam_ut... |
b97845f33684c114d29e19ca3d2c2e31fbb4eb6ce8725d2f2ff7fe766f67b22e | technomancy/leiningen | run.clj | (ns leiningen.run
"Run a -main function with optional command-line arguments."
(:require [leiningen.core.eval :as eval]
[leiningen.core.main :as main])
(:import (java.io FileNotFoundException)
(clojure.lang Reflector)))
(defn- normalize-main [given]
(when-not (or (symbol? given)
... | null | https://raw.githubusercontent.com/technomancy/leiningen/24fb93936133bd7fc30c393c127e9e69bb5f2392/src/leiningen/run.clj | clojure | print-dup/print-meta seems overkill
Some complicated error-handling logic here to support main
being either a namespace or a class.
The use case that prompted this complexity is that if we
have a namespace such as:
(ns foo.main
and we do a `lein run -m foo.main`, we will get a
FileNotFoundException, but N... | (ns leiningen.run
"Run a -main function with optional command-line arguments."
(:require [leiningen.core.eval :as eval]
[leiningen.core.main :as main])
(:import (java.io FileNotFoundException)
(clojure.lang Reflector)))
(defn- normalize-main [given]
(when-not (or (symbol? given)
... |
c738e6abda4927188b2d49f2c268d8743b414508d0a1db6f198cf69bd701640a | alexandergunnarson/quantum | javaesque.cljc | (ns quantum.test.compile.transpile.javaesque
(:require [quantum.compile.transpile.javaesque :as ns]))
(defn ^String test:class-str [access ^String class-name & [^String contents]])
#_(:clj
(defn test:emit!
[in-path-vec out-path-vec lang]))
#_(:clj
(defn test:emit-std! []))
| null | https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/test/quantum/test/compile/transpile/javaesque.cljc | clojure | (ns quantum.test.compile.transpile.javaesque
(:require [quantum.compile.transpile.javaesque :as ns]))
(defn ^String test:class-str [access ^String class-name & [^String contents]])
#_(:clj
(defn test:emit!
[in-path-vec out-path-vec lang]))
#_(:clj
(defn test:emit-std! []))
| |
2e78471aea961782dce20918703ab07b7e922cbc2d54726344d5c0ffcadeef7c | ianthehenry/basilica | Sockets.hs | module Sockets
( newServer
, Broadcaster
) where
import ClassyPrelude
import Control.Concurrent.Lifted
import Control.Concurrent.Suspend (sDelay)
import Control.Concurrent.Timer
import Control.Monad.Trans.Maybe (runMaybeT)
import qualified Data.Aeson as Aeson
import ... | null | https://raw.githubusercontent.com/ianthehenry/basilica/da80accd601efa0d90187afee90fe6e77cddbd76/Sockets.hs | haskell | module Sockets
( newServer
, Broadcaster
) where
import ClassyPrelude
import Control.Concurrent.Lifted
import Control.Concurrent.Suspend (sDelay)
import Control.Concurrent.Timer
import Control.Monad.Trans.Maybe (runMaybeT)
import qualified Data.Aeson as Aeson
import ... | |
1423c6d478c80af0cdc1ec990230f94696ca4f56662835f6e9a36bf7ff13518a | bishboria/learnyouahaskell | 9_random_string_3.hs | import System.Random
main = do
gen <- getStdGen
putStrLn $ take 20 $ randomRs ('a','z') gen
gen2 <- newStdGen
putStrLn $ take 20 $ randomRs ('a','z') gen2
| null | https://raw.githubusercontent.com/bishboria/learnyouahaskell/d8c7b41398e9672db18c1b1360372fc4a4adefa8/09/9_random_string_3.hs | haskell | import System.Random
main = do
gen <- getStdGen
putStrLn $ take 20 $ randomRs ('a','z') gen
gen2 <- newStdGen
putStrLn $ take 20 $ randomRs ('a','z') gen2
| |
5aae672bf0a88c299b9bb9becf8fc33493c7e5a64f3a52353d6c09648752858c | jrh13/hol-light | fol_prop.ml | (* ========================================================================= *)
Propositional logic as subsystem of FOL , leading to compactness .
(* ========================================================================= *)
let pholds = new_recursive_definition form_RECURSION
`(pholds v False <=> F) /... | null | https://raw.githubusercontent.com/jrh13/hol-light/538c62f7cdb0df146752c83f85fa672ae3906b03/Logic/fol_prop.ml | ocaml | =========================================================================
=========================================================================
-------------------------------------------------------------------------
Propositional satisfaction.
---------------... | Propositional logic as subsystem of FOL , leading to compactness .
let pholds = new_recursive_definition form_RECURSION
`(pholds v False <=> F) /\
(pholds v (Atom p l) <=> v (Atom p l)) /\
(pholds v (q --> r) <=> pholds v q ==> pholds v r) /\
(pholds v (!!x q) <=> v (!!x q))`;;
let PHOLDS = pro... |
5e1af22267c4f3b5f898f8df68fe63f692920fc09403469243991d97302271ee | l29ah/9ph | test9p.hs | module Main where
import Data.Maybe
import Control.Monad
import qualified Data.ByteString.Lazy.Char8 as C
import Network.Socket hiding (send, recv)
import Network.Socket.ByteString.Lazy
import Data.Int
import Data.Binary.Get
import Data.Binary.Put
import Debug.Trace
import Data.NineP
connector :: IO Socket
connector... | null | https://raw.githubusercontent.com/l29ah/9ph/ed68b6167813ef437489f02616cd0d061450f702/test9p.hs | haskell | module Main where
import Data.Maybe
import Control.Monad
import qualified Data.ByteString.Lazy.Char8 as C
import Network.Socket hiding (send, recv)
import Network.Socket.ByteString.Lazy
import Data.Int
import Data.Binary.Get
import Data.Binary.Put
import Debug.Trace
import Data.NineP
connector :: IO Socket
connector... | |
e5f63bfe9b389a3a23280f79413d59927eed5a8ab84353f632d4d958120e8f32 | mbj/stratosphere | Application.hs | module Stratosphere.M2.Application (
module Exports, Application(..), mkApplication
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.M2.Application.DefinitionProperty as Exports
import Stratosphere.Re... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/m2/gen/Stratosphere/M2/Application.hs | haskell | # SOURCE # | module Stratosphere.M2.Application (
module Exports, Application(..), mkApplication
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Value
data Application
= Application {def... |
697cae15ee1995e4af097c1aae8d48945fd727105751982174a2a4a8d0ca5179 | elastic/eui-cljs | icon_token_tag.cljs | (ns eui.icon-token-tag
(:require ["@elastic/eui/lib/components/icon/assets/tokenTag.js" :as eui]))
(def tokenTag eui/icon)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/icon_token_tag.cljs | clojure | (ns eui.icon-token-tag
(:require ["@elastic/eui/lib/components/icon/assets/tokenTag.js" :as eui]))
(def tokenTag eui/icon)
| |
520d940020bcd53ee2c7c9ab662a59abe5915cbb17490e3f3676f0ad673597f7 | semilin/layoup | jrstai.lisp |
(MAKE-LAYOUT :NAME "jrstai" :MATRIX
(APPLY #'KEY-MATRIX '("jrstbzgmdi" "qwypeufca'" "kvlnxho/,."))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | null | https://raw.githubusercontent.com/semilin/layoup/27ec9ba9a9388cd944ac46206d10424e3ab45499/data/layouts/jrstai.lisp | lisp |
(MAKE-LAYOUT :NAME "jrstai" :MATRIX
(APPLY #'KEY-MATRIX '("jrstbzgmdi" "qwypeufca'" "kvlnxho/,."))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | |
42036ffeb027eb80dad42bb7b0e4e07903e223ef9bf5e1ea79bbda7bfef65985 | Ekatereana/CommonLispWorks | innerjoin.lisp | (defstruct join-statement
sourse1
name-col1
sourse2
name-col2
right-sourse)
(defun read_join (statement)
(let ((parse_head (split (nth 1 statement) #\.))
(parse_back (split (nth 3 statement) #\.)))
(make-join-statement
:sourse1 (car parse_head )
:name-col1 (cdr parse_head )
:sour... | null | https://raw.githubusercontent.com/Ekatereana/CommonLispWorks/13111f7c45ec4d672dfdf3689ba22554d5c60727/innerjoin.lisp | lisp | (defstruct join-statement
sourse1
name-col1
sourse2
name-col2
right-sourse)
(defun read_join (statement)
(let ((parse_head (split (nth 1 statement) #\.))
(parse_back (split (nth 3 statement) #\.)))
(make-join-statement
:sourse1 (car parse_head )
:name-col1 (cdr parse_head )
:sour... | |
611c967719a396b5a5d975ab207cd08a4916324846e2bd6c439cc7c31bcb55d1 | webyrd/n-grams-for-synthesis | letvalues-plt.scm | Reference implementation of SRFI-71 using PLT 208 's modules
, 29 - Apr-2005
(module letvalues-srfi mzscheme
(provide (all-from-except mzscheme let let* letrec))
(provide (rename srfi-let let)
(rename srfi-let* let*)
(rename srfi-letrec letrec))
(provide uncons unlist unvecto... | null | https://raw.githubusercontent.com/webyrd/n-grams-for-synthesis/b53b071e53445337d3fe20db0249363aeb9f3e51/datasets/srfi/srfi-71/letvalues-plt.scm | scheme | --- textual copy of 'letvalues.scm' starts here ---
In order to avoid conflicts with the existing let etc.
the macros defined here are called srfi-let etc.,
and they are defined in terms of r5rs-let etc.
It is up to the actual implementation to save let/*/rec
in r5rs-let/*/rec first and redefine let/*/rec
Ther... | Reference implementation of SRFI-71 using PLT 208 's modules
, 29 - Apr-2005
(module letvalues-srfi mzscheme
(provide (all-from-except mzscheme let let* letrec))
(provide (rename srfi-let let)
(rename srfi-let* let*)
(rename srfi-letrec letrec))
(provide uncons unlist unvecto... |
6119ac67ea3ccf29dcce80e7a4a29a1737f5a7e095f9d078d734bdc630e6cd07 | haroldcarr/learn-haskell-coq-ml-etc | Lib.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
module Lib where
import qualified Data.Text as T
import Numeric.Natural
-- import Data.Validation
import Data.Either.Validation
import Data.Time.Calendar
import Hedgehog
import qualified H... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/451d1fbf7caaf55c6ae9243c4f1d15eb480a59dd/haskell/topic/testing/2019-11-oskar-wickstrom-tt-and-fixing-bugs-with-property-based-testing/src/Lib.hs | haskell | # LANGUAGE OverloadedStrings #
import Data.Validation
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-----------------------... | # LANGUAGE NoImplicitPrelude #
module Lib where
import qualified Data.Text as T
import Numeric.Natural
import Data.Either.Validation
import Data.Time.Calendar
import Hedgehog
import qualified Hedgehog.Gen as HHGen
import qualified Hedgehog.Range ... |
f05ff34daa33a885420b1c684dbbc3aa78f8db209298f766cdc5326a43b76545 | diagrams/diagrams-core | Test.hs | {-# LANGUAGE TypeOperators
, FlexibleInstances
, TypeSynonymInstances
, TypeFamilies #-}
import Test.Tasty
import Test.Tasty.QuickCheck as QC
import Control.Monad
import Data.Monoid
import Control.Applicative
import Data.LinearMap
import Diagrams.Core
import Diagrams.Core.Points
imp... | null | https://raw.githubusercontent.com/diagrams/diagrams-core/91b915b0640e1575d0236f323ffcd13221064094/test/Test.hs | haskell | # LANGUAGE TypeOperators
, FlexibleInstances
, TypeSynonymInstances
, TypeFamilies #
----------------------------------------------------------
Supporting infrastructure -----------------------------
----------------------------------------------------------
Some types for testing.
... |
import Test.Tasty
import Test.Tasty.QuickCheck as QC
import Control.Monad
import Data.Monoid
import Control.Applicative
import Data.LinearMap
import Diagrams.Core
import Diagrams.Core.Points
import Diagrams.Core.Transform
| Use the vector space so we can have exact equality testing .
type Q2 = (Rational, Rati... |
1398d39822e9e54661a2daf87369a53e9ff8fae69e945130047ec8aeba599269 | riemann/riemann | opsgenie_test.clj | (ns riemann.opsgenie-test
(:require [riemann.logging :as logging]
[riemann.opsgenie :refer :all]
[riemann.test-utils :refer [with-mock]]
[cheshire.core :as json]
[clojure.test :refer :all]))
(def service-key (System/getenv "OPSGENIE_SERVICE_KEY"))
(when-not service-ke... | null | https://raw.githubusercontent.com/riemann/riemann/1649687c0bd913c378701ee0b964a9863bde7c7c/test/riemann/opsgenie_test.clj | clojure | (ns riemann.opsgenie-test
(:require [riemann.logging :as logging]
[riemann.opsgenie :refer :all]
[riemann.test-utils :refer [with-mock]]
[cheshire.core :as json]
[clojure.test :refer :all]))
(def service-key (System/getenv "OPSGENIE_SERVICE_KEY"))
(when-not service-ke... | |
0cd97051002af90b74cb20e84030138eb46854c6f5a44206f42b5406f0fcdff7 | mikewin/cspbox-trading | group.clj | (ns cspbox.trading.stats.group
(:require [cspbox.trading.stats.base :refer [epsilon]]
[cspbox.runtime.tools.date :refer [timestamp-difference seconds-per-day]]
[cspbox.runtime.sys.utils.macro :refer[to-map]]))
copy code from wzrdsappr ( translate to clojure ) , just for test
(comment
":type... | null | https://raw.githubusercontent.com/mikewin/cspbox-trading/76f9cfb780d5f36e5fbd6d8cec7c978a0e51cb94/src/cspbox/trading/stats/group.clj | clojure | market
market on open
market on close
limit on open
limit on close
stop
limit
stop-limit
order -> trade -> trade-group (by entry and exist)
todo compare timestamp
store trades in reverse chronological order | (ns cspbox.trading.stats.group
(:require [cspbox.trading.stats.base :refer [epsilon]]
[cspbox.runtime.tools.date :refer [timestamp-difference seconds-per-day]]
[cspbox.runtime.sys.utils.macro :refer[to-map]]))
copy code from wzrdsappr ( translate to clojure ) , just for test
(comment
(defstr... |
5369f54bc416d8271b8a707488c41ad4e9faf62df0b43e4c28024d44135eb8d2 | marianoguerra-atik/riak_core_ring_on_partisans_plumtree | riak_core_ring.erl | %% -------------------------------------------------------------------
%%
%% riak_core: Core Riak Application
%%
Copyright ( c ) 2007 - 2015 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except... | null | https://raw.githubusercontent.com/marianoguerra-atik/riak_core_ring_on_partisans_plumtree/19167b7f111221dc9c4ae127ac9fd3120b17dda1/apps/pring/src/riak_core_ring.erl | erlang | -------------------------------------------------------------------
riak_core: Core Riak Application
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
sp... | Copyright ( c ) 2007 - 2015 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
... |
6c6fc0ca97f2908d4f54d461c86a091f92ad864f7ea4d9f71f5b7059ad3fa0d6 | psholtz/MIT-SICP | exercise2-60.scm | ;;
Exercise 2.60
;;
;; We specified that a set would be represented as a list with no duplicates. Now suppose we
allow duplicates . For instance , the set { 1,2,3 } could be represented as the list ( 2 3 2 1 3 2 2 ) .
;; Design procedures "element-of-set?", "adjoin-set", "union-set", and "intersection-set" that
;... | null | https://raw.githubusercontent.com/psholtz/MIT-SICP/01e9b722ac5008e26f386624849117ca8fa80906/Section-2.3/mit-scheme/exercise2-60.scm | scheme |
We specified that a set would be represented as a list with no duplicates. Now suppose we
Design procedures "element-of-set?", "adjoin-set", "union-set", and "intersection-set" that
operate on this representation. How does the efficiency of each compare with the corresponding
procedure for the non-duplicate rep... | Exercise 2.60
allow duplicates . For instance , the set { 1,2,3 } could be represented as the list ( 2 3 2 1 3 2 2 ) .
(define (element-of-set? x set)
(cond ((null? set) false)
((equal? x (car set)) true)
(else
(element-of-set? x (cdr set)))))
(define (adjoin-set x set)
(cons x set))
(define (intersecti... |
cbf0354968fe6586e73e602fe29002cee20b2bc3f387b7060fb3fdffe506a7a0 | abcdw/rde | aspell.scm | ;;; rde --- Reproducible development environment.
;;;
Copyright © 2022 < >
;;;
;;; This file is part of rde.
;;;
;;; rde is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 3 of the License , ... | null | https://raw.githubusercontent.com/abcdw/rde/5b8605f421d0b8a9569e43cb6f7e651e7a8f7218/src/rde/packages/aspell.scm | scheme | rde --- Reproducible development environment.
This file is part of rde.
rde is free software; you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
rde is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the im... | Copyright © 2022 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
(define-module (rde packages aspell)
#:use-module (guix build-system copy)
#:use-module (guix licenses)
#:use-module (guix packages)
#:use-module (gu... |
13a64727210e2eb04e2e0ae20c5cb5d397412326530ac7a9410377d2c8c85faf | ocaml/ocaml-lsp | doc_to_md.ml | open Import
module Oct = Octavius
let ocaml = "ocaml"
let to_inline_code code = Omd.Code (ocaml, code)
let to_code_block code = Omd.Code_block (ocaml, code)
let space = Omd.Text " "
let new_line = Omd.NL
[ put_in_between elem lst ] inserts [ elem ] between all elements of [ lst ]
let put_in_between elem lst =
... | null | https://raw.githubusercontent.com/ocaml/ocaml-lsp/6a38d66c57930c6ef5ac67d740a51e2d9551f93f/ocaml-lsp-server/src/doc_to_md.ml | ocaml | TODO: implement SK_{center, left, right, superscript, subscript, custom}
using html blocks
TODO: along with cross-references support, add support for labels
TODO: add support for cross-references
TODO: add support for markdown-specific blocks
TODO: add support to reference files and documents
in case ... | open Import
module Oct = Octavius
let ocaml = "ocaml"
let to_inline_code code = Omd.Code (ocaml, code)
let to_code_block code = Omd.Code_block (ocaml, code)
let space = Omd.Text " "
let new_line = Omd.NL
[ put_in_between elem lst ] inserts [ elem ] between all elements of [ lst ]
let put_in_between elem lst =
... |
546fc271e2f4034686ef45d98123424b1859b40c34a5a38f67ada1321557810f | vbmithr/ocaml-ledger-wallet | test_ssh_agent.ml | open Rresult
open Ledgerwallet_ssh_agent
let fail_on_error = function
| None -> Alcotest.fail "Found no ledger."
| Some (Result.Ok ()) -> ()
| Some (Result.Error e) ->
Alcotest.fail
(Format.asprintf "Ledger error: %a" Ledgerwallet.Transport.pp_error e)
let with_connection f =
fail_on_error
(... | null | https://raw.githubusercontent.com/vbmithr/ocaml-ledger-wallet/9a21b74f3066bca48f7aef1a194ed8fe6496db78/test/test_ssh_agent.ml | ocaml | open Rresult
open Ledgerwallet_ssh_agent
let fail_on_error = function
| None -> Alcotest.fail "Found no ledger."
| Some (Result.Ok ()) -> ()
| Some (Result.Error e) ->
Alcotest.fail
(Format.asprintf "Ledger error: %a" Ledgerwallet.Transport.pp_error e)
let with_connection f =
fail_on_error
(... | |
77ca4e0103822253f4d09cc9e4b01dbf44164c93be405f02ab72f7dcf3e3aafd | ejgallego/coq-lsp | rq_lens.ml | (************************************************************************)
(* Coq Language Server Protocol *)
Copyright 2019 MINES ParisTech -- Dual License LGPL 2.1 / GPL3 +
Copyright 2019 - 2023 Inria -- Dual License LGPL 2.1 / GPL3 +
Written by : ... | null | https://raw.githubusercontent.com/ejgallego/coq-lsp/1881796eb3ed77dc16a8dfc97c547480701b454b/controller/rq_lens.ml | ocaml | **********************************************************************
Coq Language Server Protocol
**********************************************************************
Example lens to show goals, seems that args are not working | Copyright 2019 MINES ParisTech -- Dual License LGPL 2.1 / GPL3 +
Copyright 2019 - 2023 Inria -- Dual License LGPL 2.1 / GPL3 +
Written by :
let command ~point =
let arguments = Some [ Lsp.JLang.Point.to_yojson point ] in
Lsp.Core.Command.
{ title = ... |
9063a254e02532ec2d774592eebeefbe78caff959295ecff19bb4f84d22a64f9 | jyh/metaprl | cfol_magic.ml | (*
* Classical reasoning.
*)
extends Fol_not
declare magic{x. 't['x]}
dform magic_df : magic {x. 't} = `"magic"
prim magic :
('t['x] : sequent { <H>; x: "not"{'T} >- "false" }) -->
sequent { <H> >- 'T } =
magic{x. 't['x]}
let magicT = magic
(*
* -*-
* Local Variables:
* Caml-master: "pousse"
* End:
... | null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/fol/cfol_magic.ml | ocaml |
* Classical reasoning.
* -*-
* Local Variables:
* Caml-master: "pousse"
* End:
* -*-
| extends Fol_not
declare magic{x. 't['x]}
dform magic_df : magic {x. 't} = `"magic"
prim magic :
('t['x] : sequent { <H>; x: "not"{'T} >- "false" }) -->
sequent { <H> >- 'T } =
magic{x. 't['x]}
let magicT = magic
|
07f018b493083309a3cb8ff8f305a5f756dc9e112c532157f91152689f24be3b | pyr/warp | app.cljs | (ns warp.client.app
(:require [warp.client.views :as views]
[warp.client.router :refer [set-router! route-dispatcher]]
[warp.client.models :refer [start-sync!]]
[reagent.core :refer [render]]))
(enable-console-print!)
(defn ^:export run
"Our entrypoint, renders the main... | null | https://raw.githubusercontent.com/pyr/warp/c3ee96d90b233a47c1104b4339fed071ec8afe68/src/warp/client/app.cljs | clojure | (ns warp.client.app
(:require [warp.client.views :as views]
[warp.client.router :refer [set-router! route-dispatcher]]
[warp.client.models :refer [start-sync!]]
[reagent.core :refer [render]]))
(enable-console-print!)
(defn ^:export run
"Our entrypoint, renders the main... | |
b0bf69ddb86748d8bf29e7042c636cd89a92a60488343aa53dc0858055cdf72a | tomjridge/imp_fs | v3.ml | module Private = struct
module V3_intf = V3_intf
module V3_level0 = V3_level0
module V3_level1 = V3_level1
module V3_level2 = V3_level2
end
| null | https://raw.githubusercontent.com/tomjridge/imp_fs/dae69505130073747f37ecab845fe3b6c495e66a/src/_v3/v3.ml | ocaml | module Private = struct
module V3_intf = V3_intf
module V3_level0 = V3_level0
module V3_level1 = V3_level1
module V3_level2 = V3_level2
end
| |
8f2da76474f4aaaf41a335e6899c80aadc01500f71e967d87b650d8442f19947 | dgrnbrg/spyscope | core.cljc | (ns spyscope.core
(:require [clojure.string :as str]
#?(:clj [clj-time.core :as time]
:cljs [cljs-time.core :as time])
#?(:clj [clj-time.format :as fmt]
:cljs [cljs-time.format :as fmt])
#?(:clj [puget.printer :as pp]))
#?(:clj (:require [net.cgr... | null | https://raw.githubusercontent.com/dgrnbrg/spyscope/3d9adbbc1dee703f679d0af87ce10c163f258488/src/spyscope/core.cljc | clojure | Are there multiple trace lines?
Indent if it's a multi-line structure | (ns spyscope.core
(:require [clojure.string :as str]
#?(:clj [clj-time.core :as time]
:cljs [cljs-time.core :as time])
#?(:clj [clj-time.format :as fmt]
:cljs [cljs-time.format :as fmt])
#?(:clj [puget.printer :as pp]))
#?(:clj (:require [net.cgr... |
8c7ba9b9a71256a5af9b11bcf4f0e5fb7fca1773331bceef28b07793af3ac12b | emqx/emqx | emqx_coap_SUITE.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/emqx/dbc10c2eed3df314586c7b9ac6292083204f1f68/apps/emqx_gateway/test/emqx_coap_SUITE.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_coap_SUITE).
-compile(export_all).
-compile(nowarn_export_all).
-import(
emqx... |
45c50b7df1587418b78be8e51aa583f157fa7c8a6376c9ca33b7866e56912c87 | buntine/Simply-Scheme-Exercises | 9-8.scm | Suppose we ’re writing a program to play hangman . In this game one player has
to guess a secret word chosen by the other player , one letter at a time . You ’re going
; to write just one small part of this program: a procedure that takes as arguments the
; secret word and the letters guessed so far, returning the ... | null | https://raw.githubusercontent.com/buntine/Simply-Scheme-Exercises/c6cbf0bd60d6385b506b8df94c348ac5edc7f646/09-lambda/9-8.scm | scheme | to write just one small part of this program: a procedure that takes as arguments the
secret word and the letters guessed so far, returning the word in which the guessing
progress is displayed by including all the guessed letters along with underscores for the
not-yet-guessed ones:
> (hang ’potsticker ’etaoi)
_... | Suppose we ’re writing a program to play hangman . In this game one player has
to guess a secret word chosen by the other player , one letter at a time . You ’re going
(define (hang-letter letter guesses)
(if (member? letter guesses)
letter
'_))
(define (hang wd guesses)
(accumulate
word
(ever... |
2c695c70bd8acb3f89f5c2f0f53a8ff7d483fa7976d2d494b9f1fae54bb02ffe | craigl64/clim-ccl | cload-demos.lisp | -*- Mode : Lisp ; Package : clim - user -*-
;; See the file LICENSE for the full license governing this code.
;;
(in-package :clim-user)
(defvar *demo-files*
'(
"test-suite"
"packages"
"demo-driver"
"cad-demo"
"thinkadot"
"graphics-demos"
"address-book"
"listener"... | null | https://raw.githubusercontent.com/craigl64/clim-ccl/301efbd770745b429f2b00b4e8ca6624de9d9ea9/demo/cload-demos.lisp | lisp | Package : clim - user -*-
See the file LICENSE for the full license governing this code.
|
(in-package :clim-user)
(defvar *demo-files*
'(
"test-suite"
"packages"
"demo-driver"
"cad-demo"
"thinkadot"
"graphics-demos"
"address-book"
"listener"
"navfun"
"navdata"
"puzzle"
"plot"
"color-editor"
"graphics-editor"
"bit... |
3727f4b524db182de9faec8895cc9a8796acca3d7126d78cba36e47179dcc263 | statusfailed/cartographer-string-diagrammatic-reasoning | Main.hs | module Main where
import Data.Hypergraph
import Control.Monad.Logic
import Data.List (foldl')
import Data.Time.Clock
import Data.Bimap (Bimap)
import qualified Data.Bimap as Bimap
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
graphSize :: OpenHypergraph sig -> (Int, Int)
graphSize g = (Bimap.... | null | https://raw.githubusercontent.com/statusfailed/cartographer-string-diagrammatic-reasoning/7559db3f6de17dfa2dc13a6bf29f95c9cebcf7c4/cartographer-core/profiling/Main.hs | haskell | -----------------------------
-----------------------------
-----------------------------
small patterns in big graphs
main = tensorProfile | module Main where
import Data.Hypergraph
import Control.Monad.Logic
import Data.List (foldl')
import Data.Time.Clock
import Data.Bimap (Bimap)
import qualified Data.Bimap as Bimap
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as Map
graphSize :: OpenHypergraph sig -> (Int, Int)
graphSize g = (Bimap.... |
21cb22ce89d37e193e58a96bef459fe88f6bfd2b1d7a8573573820dfc183e6b7 | processone/eimp | eimp_limit.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2002 - 2022 ProcessOne , SARL . 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 cop... | null | https://raw.githubusercontent.com/processone/eimp/3caba4c529f6c622f6f6838e8294cbad54ec597c/src/eimp_limit.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 o... | @author < >
( C ) 2002 - 2022 ProcessOne , SARL . 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(eimp_limit).
-behaviour(gen_server).
-export([start_link/0, is_blocked/2]).
-export([i... |
7c610c17a369ee0d94d7d9f7d937cec5c5edb55d734de086ccb9243238291da3 | onedata/op-worker | files_stress_test_base.erl | %%%--------------------------------------------------------------------
@author
( C ) 2015 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%--------------------------------------------------------------------
%%% @doc
This SUITE contains functions used... | null | https://raw.githubusercontent.com/onedata/op-worker/cfd3036d429466496e4a28baec9ba37361f3d924/test_distributed/files_stress_test_base.erl | erlang | --------------------------------------------------------------------
@end
--------------------------------------------------------------------
@doc
for single provider.
@end
--------------------------------------------------------------------
export for ct
==========================================================... | @author
( C ) 2015 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
This SUITE contains functions used during the save stress test
-module(files_stress_test_base).
-author("Michal Wrzeszcz").
-include("global_definitions.hrl").
-include("modules/fslogic/fslogic_c... |
56bf192cbc6757fb25d3e3d2e85c4ea3195ecde49a1f866174e6a8b0e98afa48 | stopachka/bel-clojure | reader_test.clj | (ns bel-clojure.reader-test
(:require
[clojure.test :refer :all]
[bel-clojure.reader :refer :all]))
(defn pretty-parse [x] (bel->pretty (parse x)))
(deftest test-reader
(is (= (pretty-parse "\"str\"") "str"))
(is (= (pretty-parse "\"hello world\"") "hello world"))
(is (= (pretty-parse "(a b c)") '(a b ... | null | https://raw.githubusercontent.com/stopachka/bel-clojure/d1bb33d1cf498c5f7fd7e9a9bfb8d2c57e2fc5b3/test/bel_clojure/reader_test.clj | clojure | (ns bel-clojure.reader-test
(:require
[clojure.test :refer :all]
[bel-clojure.reader :refer :all]))
(defn pretty-parse [x] (bel->pretty (parse x)))
(deftest test-reader
(is (= (pretty-parse "\"str\"") "str"))
(is (= (pretty-parse "\"hello world\"") "hello world"))
(is (= (pretty-parse "(a b c)") '(a b ... | |
bb45a7038388e8ded466806b57aa31e9ddc12fbe3f78ff5c41301e5cfa6499d3 | xhtmlboi/yocaml | my_site.ml | open Yocaml
let destination = "_build"
let css_destination = into destination "css"
let images_destination = into destination "images"
let track_binary_update = Build.watch Sys.argv.(0)
let may_process_markdown file =
let open Build in
if with_extension "md" file
then Yocaml_markdown.content_to_html ()
else a... | null | https://raw.githubusercontent.com/xhtmlboi/yocaml/04a5a868c1db4e325a24fbf59f850cd723829671/examples/05_first_blog_using_jingoo/bin/my_site.ml | ocaml | open Yocaml
let destination = "_build"
let css_destination = into destination "css"
let images_destination = into destination "images"
let track_binary_update = Build.watch Sys.argv.(0)
let may_process_markdown file =
let open Build in
if with_extension "md" file
then Yocaml_markdown.content_to_html ()
else a... | |
7dba26d0477521c85ea16f5e9a09acf50810b98e7eec924c32e85bc693a686d5 | lisp-mirror/clpm | rc.lisp | ;;;; clpm client rc
;;;;
This software is part of CLPM . See README.org for more information . See
;;;; LICENSE for license information.
(uiop:define-package #:clpm-cli/commands/client/rc
(:use #:cl
#:clpm-cli/common-args
#:clpm-cli/commands/client/common
#:clpm-cli/interface-defs
... | null | https://raw.githubusercontent.com/lisp-mirror/clpm/ad9a704fcdd0df5ce30ead106706ab6cc5fb3e5b/cli/commands/client/rc.lisp | lisp | clpm client rc
LICENSE for license information.
on demand and not extra steps need to be taken to turn it on).
Generated by CLPM ${(clpm:clpm-version)}
Do not prompt before attempting to install a missing system.
Accept any diffs without prompting.
If started inside a context (i.e., with `clpm exec` or `clpm b... | This software is part of CLPM . See README.org for more information . See
(uiop:define-package #:clpm-cli/commands/client/rc
(:use #:cl
#:clpm-cli/common-args
#:clpm-cli/commands/client/common
#:clpm-cli/interface-defs
#:named-readtables)
(:import-from #:uiop
... |
ccaa60556b9d6691639f12e67dbd0b15bbb58d5d3c4b5d543803c1a6fb436c88 | tfoldi/cljs-tableau-cnake | ui.cljs | (ns cnake.ui
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [cnake.utils.dom :as dom]
[cnake.utils.canvas :as canvas]
[cnake.game :as game]
[cljs.core.async :as async :refer [chan put! pipe unique merge map< filter< alts!]]
[goog.events :as e... | null | https://raw.githubusercontent.com/tfoldi/cljs-tableau-cnake/a1ecc852bf2d3fa993097a9d90956ec06a9d65f0/src/cnake/ui.cljs | clojure | -------------------------------------------------------------------------------
Height and width of the canvas in pixels depending of the square-size and
the game's board size
-------------------------------------------------------------------------------
-----------------------------------------------------------... | (ns cnake.ui
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [cnake.utils.dom :as dom]
[cnake.utils.canvas :as canvas]
[cnake.game :as game]
[cljs.core.async :as async :refer [chan put! pipe unique merge map< filter< alts!]]
[goog.events :as e... |
affc19c77c73a44b37e7913ef77da482d3ff3f590ad00e84dcef8f48c23401fd | funcool/clojure.jdbc | core.clj | Copyright 2014 - 2016 < >
;;
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 un... | null | https://raw.githubusercontent.com/funcool/clojure.jdbc/0828e9361e867181ddd2199f53ffa4de86904c83/src/jdbc/core.clj | clojure |
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 2014 - 2016 < >
Licensed under the Apache License , Version 2.0 ( the " License " )
distributed under the License is distributed on an " AS IS " BASIS ,
(ns jdbc.core
"Alternative implementation of jdbc wrapper for clojure."
(:require [clojure.string :as str]
[jdbc.types :as types]
... |
b225dda3363650b7521db1f6b53ad262aeb0cbd9a960f15edea3d6e8356f6391 | input-output-hk/ouroboros-network | Client.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE GADTs #
# LANGUAGE LambdaCase #
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RecordWildCards #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
-- | Tests for the chain sync client.... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/959fa23d0a2bf963b109063ad998fb83edce73e4/ouroboros-consensus-test/test-consensus/Test/Consensus/MiniProtocol/ChainSync/Client.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE FlexibleContexts #
# LANGUAGE RankNTypes #
# LANGUAGE RecordWildCards #
| Tests for the chain sync client.
The chain sync client is a stateful component that tracks the chain of an
upstream peer. It validates the headers that it receives from the peer;
va... | # LANGUAGE GADTs #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Test.Consensus.MiniProtocol.ChainSync.Client (tests) where
import Control.Monad.Class.MonadThrow (Handler (..), catches)
import Control.Monad.State.Strict
im... |
d20afd16c74d417b68563921966af774d904b570c1dd18bcdd9c16f5be1c3faa | ryanpbrewster/haskell | lagrange_polynomials.hs | -- lagrange_polynomials.hs
- In numerical analysis , Lagrange polynomials are used for polynomial interpolation . For a given set of distinct points x_j and numbers y_j , the Lagrange polynomial is the polynomial of the least degree that at each point x_j assumes the corresponding value y_j ( i.e. the functions coin... | null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/hello-world/lagrange_polynomials.hs | haskell | lagrange_polynomials.hs |
- In numerical analysis , Lagrange polynomials are used for polynomial interpolation . For a given set of distinct points x_j and numbers y_j , the Lagrange polynomial is the polynomial of the least degree that at each point x_j assumes the corresponding value y_j ( i.e. the functions coincide at each point ) . The ... |
40157aba271192d57180dd75599cd3b4a01928ad1e8e4833059cd968383694d1 | vlaaad/tweet-def | tweet_def.clj | (ns io.github.vlaaad.tweet-def
(:require [clojure.string :as str]
[clojure.data.json :as json]
[clj-http.client :as http])
(:import [org.apache.commons.text StringEscapeUtils]))
(defn- id [tweet-url]
(or (second (re-find #"status/(.+)" tweet-url))
(throw (ex-info "Can't extract twee... | null | https://raw.githubusercontent.com/vlaaad/tweet-def/134a8033b371cbb783ff4011175666388fca6dec/src/io/github/vlaaad/tweet_def.clj | clojure | (ns io.github.vlaaad.tweet-def
(:require [clojure.string :as str]
[clojure.data.json :as json]
[clj-http.client :as http])
(:import [org.apache.commons.text StringEscapeUtils]))
(defn- id [tweet-url]
(or (second (re-find #"status/(.+)" tweet-url))
(throw (ex-info "Can't extract twee... | |
f02102090e54b89e3db7929546efd6005edb72a5a7658e9a70cc3534cd199371 | noprompt/garden | types.cljc | (ns garden.types
"Internal types used by Garden.")
(defrecord CSSUnit [unit magnitude])
(defrecord CSSFunction [f args])
(defrecord CSSAtRule [identifier value])
| null | https://raw.githubusercontent.com/noprompt/garden/025c4d8c6a88fdb58def34122af0459e51e309a9/src/garden/types.cljc | clojure | (ns garden.types
"Internal types used by Garden.")
(defrecord CSSUnit [unit magnitude])
(defrecord CSSFunction [f args])
(defrecord CSSAtRule [identifier value])
| |
cd7d42b6556c3cf36fbb5c3870e0afbd47b04f3265cfe6ec0111dbb601b67369 | paurkedal/iplogic | iplogic_shell.mli | Copyright ( C ) 2012 - -2017 Petter A. Urkedal < >
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later ver... | null | https://raw.githubusercontent.com/paurkedal/iplogic/7c56b5c55c03a681381fafb80220a5c0eba9f212/lib/iplogic_shell.mli | ocaml | * A specialized monoid for expressing a single shell command.
* Quoted command or argument.
* Verbatim command or argument.
* Command and argument list.
* A specialized monoid for expressing a sequence of shell commands.
* A single command.
* A sequence of commands.
* A disjunctive sequence of commands. | Copyright ( C ) 2012 - -2017 Petter A. Urkedal < >
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later ver... |
d84ef0c3ffd5f78d5e6717f263612d2a713f73a0327456d29597da4e89bcfc68 | plclub/lngen | ASTAnalysis.hs | {-# LANGUAGE DeriveDataTypeable, FlexibleContexts #-}
| This module defines functions and data structures that allow one
to analyze ASTs . The results of such analysis might be useful for
generating code for a proof assistant , for example .
For each metavariable and nonterminal root , there is an ... | null | https://raw.githubusercontent.com/plclub/lngen/2c4f591f0c0fe6cb901e117a31d5d113735f8f54/src/ASTAnalysis.hs | haskell | # LANGUAGE DeriveDataTypeable, FlexibleContexts #
* Inductively defined syntax
* AST analysis
* Queries
-----------------------------------------------------------------------
* Inductively defined syntax
debugging purposes. The default definitions are not really
suitable for general purpose printing. Then a... |
| This module defines functions and data structures that allow one
to analyze ASTs . The results of such analysis might be useful for
generating code for a proof assistant , for example .
For each metavariable and nonterminal root , there is an associated
\"canonical\ " root . However , mult... |
422210854d5a93aac8666e6b8e3c8236f304bd375b2b2d4309829e383459c616 | avsm/mirage-duniverse | read.mli | val prettify : ?std:bool -> string -> string
(** Combined parser and pretty-printer.
See [to_string] for the role of the optional [std] argument. *)
val compact : ?std:bool -> string -> string
(** Combined parser and printer.
See [to_string] for the role of the optional [std] argument. *)
* { 2 JSON r... | null | https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/yojson/lib/read.mli | ocaml | * Combined parser and pretty-printer.
See [to_string] for the role of the optional [std] argument.
* Combined parser and printer.
See [to_string] for the role of the optional [std] argument.
* Exception describing a failure in both finalizer and parsing.
* Read a JSON value from a channel.
See [fro... | val prettify : ?std:bool -> string -> string
val compact : ?std:bool -> string -> string
* { 2 JSON readers }
exception Finally of exn * exn
val from_string :
?buf:Bi_outbuf.t ->
?fname:string ->
?lnum:int ->
string -> t
* Read a JSON value from a string .
@param buf use this buffer at will during p... |
94df74e905e16da23d06a66643f0f603429000f0b922eb22febda1df9ff1f1ee | erlang/otp | tls_v1.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2007 - 2023 . 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 License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/erlang/otp/2b397d7e5580480dc32fa9751db95f4b89ff029e/lib/ssl/src/tls_v1.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2007 - 2023 . 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(tls_v1).
-include("ssl_cipher.hrl").
-include("ssl_internal.hrl").
-include("ssl_record.hrl").
-export([m... |
6725357fada74925a6eeb03f742ecf71c76269edadba99a65cb3da5d91d1a624 | futurice/haskell-mega-repo | Report.hs | # LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE OverloadedStrings #-}
module PlanMill.Types.Report (
AllRevenues2,
AllRevenuesPortfolio (..),
EarnedVacations,
EarnedVacationsRow (..),
Report,
Reports,
ReportsCategories,
PersonValueCreations,
PersonValueCreation (..),
... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/240733cf5eb1b4ed297df698190d53faa29bca35/planmill-client/src/PlanMill/Types/Report.hs | haskell | # LANGUAGE OverloadedStrings #
TODO: Think of better type for all these
TODO: is the better type for this?
now our parsing takes this into account and null -> 0 | # LANGUAGE GeneralizedNewtypeDeriving #
module PlanMill.Types.Report (
AllRevenues2,
AllRevenuesPortfolio (..),
EarnedVacations,
EarnedVacationsRow (..),
Report,
Reports,
ReportsCategories,
PersonValueCreations,
PersonValueCreation (..),
TeamsHoursByCategoryRow (..),
TeamsHou... |
5eb8c1b50a2db7d43fef2109e6f8f9dd4b1e893b8b249fc1a652049b4a94ab18 | thierry-martinez/stdcompat | int64.mli | val zero : int64
val one : int64
val minus_one : int64
external neg : int64 -> int64 = "%int64_neg"
external add : int64 -> int64 -> int64 = "%int64_add"
external sub : int64 -> int64 -> int64 = "%int64_sub"
external mul : int64 -> int64 -> int64 = "%int64_mul"
external div : int64 -> int64 -> int64 = "%int64_div"
exte... | null | https://raw.githubusercontent.com/thierry-martinez/stdcompat/83d786cdb17fae0caadf5c342e283c3dcfee2279/interfaces/3.07/int64.mli | ocaml | val zero : int64
val one : int64
val minus_one : int64
external neg : int64 -> int64 = "%int64_neg"
external add : int64 -> int64 -> int64 = "%int64_add"
external sub : int64 -> int64 -> int64 = "%int64_sub"
external mul : int64 -> int64 -> int64 = "%int64_mul"
external div : int64 -> int64 -> int64 = "%int64_div"
exte... | |
d8a9d025ab0d4d7827dc784bc2ae3e0cfa3794b2f7a7c5d5014f31a3743e77d1 | immoh/nsorg-cli | cli.clj | (ns nsorg.cli
(:require [clojure.java.io :as io]
[clojure.stacktrace]
[clojure.tools.cli :as cli]
[nsorg.cli.diff :as diff]
[nsorg.cli.terminal :as terminal]
[nsorg.core :as nsorg])
(:import (java.io File)
(java.nio.file Paths)))
(defn clojure-... | null | https://raw.githubusercontent.com/immoh/nsorg-cli/69d8bea21da125baa1994c4c818bf67a30ae36e8/src/nsorg/cli.clj | clojure | (ns nsorg.cli
(:require [clojure.java.io :as io]
[clojure.stacktrace]
[clojure.tools.cli :as cli]
[nsorg.cli.diff :as diff]
[nsorg.cli.terminal :as terminal]
[nsorg.core :as nsorg])
(:import (java.io File)
(java.nio.file Paths)))
(defn clojure-... | |
935792f480bb8c34bf3fea6ec0ecf90e537ee624de6ce2acbdf0652268c322b5 | nv-vn/TelegraML | helloworld.ml | module MyBot = Telegram.Api.Mk (struct
include Telegram.BotDefaults
let token = [%blob "../bot.token"]
end);;
Lwt_main.run begin
MyBot.send_message ~chat_id:(int_of_string [%blob "../chat.id"])
~text:"Hello, world"
~disable_notification:false
~reply_... | null | https://raw.githubusercontent.com/nv-vn/TelegraML/19524e35887542b6ceb9ba756f3fdbcca7fe6c03/example/helloworld.ml | ocaml | module MyBot = Telegram.Api.Mk (struct
include Telegram.BotDefaults
let token = [%blob "../bot.token"]
end);;
Lwt_main.run begin
MyBot.send_message ~chat_id:(int_of_string [%blob "../chat.id"])
~text:"Hello, world"
~disable_notification:false
~reply_... | |
2a56f5e3315fd1b69cf0c09f7b7a4d4959448b4752f7cc4476f5aa99a24b1df1 | timbertson/vdoml | test_ui.ml | open Vdoml
open Test_util
include Init
open Ui
module Text = struct
type msg = [ `Text of string | `Noop | `Increment ]
type state = int * string
let update (count, text) = function
| `Text msg -> (count, msg)
| `Noop -> (count, text)
| `Increment -> (count+1, text)
let view instance (_, text) =
Html.text ... | null | https://raw.githubusercontent.com/timbertson/vdoml/fcbf81e89df989206bdad4a92327e593078525b2/test/test_ui.ml | ocaml | note: physical equality
.. but they should be structurally equal!
Once render output changes, they should be completely different | open Vdoml
open Test_util
include Init
open Ui
module Text = struct
type msg = [ `Text of string | `Noop | `Increment ]
type state = int * string
let update (count, text) = function
| `Text msg -> (count, msg)
| `Noop -> (count, text)
| `Increment -> (count+1, text)
let view instance (_, text) =
Html.text ... |
dbd4bdc8db2e009913ea9aac9f794a6027d97c6d5af4aa3a6eacfea397ce77dc | marcoheisig/Petalisp | packages.lisp | © 2016 - 2023 - license : GNU AGPLv3 -*- coding : utf-8 -*-
(cl:in-package #:common-lisp-user)
(defpackage #:petalisp.utilities
(:use #:common-lisp)
(:export
documentation.lisp
#:document-compiler-macro
#:document-compiler-macros
#:document-function
#:document-functions
#:document-m... | null | https://raw.githubusercontent.com/marcoheisig/Petalisp/a1c85cf71da445ef9c7913cd9ddb5149373211a7/code/utilities/packages.lisp | lisp | bitfield.lisp
defalias.lisp
queue.lisp
identical.lisp
memoization.lisp
prime-factors.lisp
weak-set.lisp
with-collectors.lisp
number-of-cpus.lisp
topological-sort.lisp
graph-coloring.lisp
karmarkar-karp.lisp
with-pinned-objects.lisp | © 2016 - 2023 - license : GNU AGPLv3 -*- coding : utf-8 -*-
(cl:in-package #:common-lisp-user)
(defpackage #:petalisp.utilities
(:use #:common-lisp)
(:export
documentation.lisp
#:document-compiler-macro
#:document-compiler-macros
#:document-function
#:document-functions
#:document-m... |
59f6c616ad97841af7bb3c4820d769ea103bb4d5f8573d5fb402e63425e51e7f | quickdudley/hfnn | Convolutional.hs | # LANGUAGE DataKinds #
module AI.HFNN.Convolutional (
convolutionalLayer,
consistentFields
) where
import AI.HFNN
import Control.Monad
import Control.Applicative
import Data.Array
import Data.Word
-- | Create a convolutional layer.
convolutionalLayer :: Array (Word,Word) (Layer s) -- ^ Grid of 'Layer's
-> (Wor... | null | https://raw.githubusercontent.com/quickdudley/hfnn/fb12016f0588f48aa67abc81262f283f5c1ff69f/src/AI/HFNN/Convolutional.hs | haskell | | Create a convolutional layer.
^ Grid of 'Layer's
^ Width and height of each receptive field
^ Horizontal and vertical stride length
^ Width and height of each output block
^ Width and height of supplementary border
^ The number of channels in the output
^ the activation function to use | # LANGUAGE DataKinds #
module AI.HFNN.Convolutional (
convolutionalLayer,
consistentFields
) where
import AI.HFNN
import Control.Monad
import Control.Applicative
import Data.Array
import Data.Word
-> NNBuilder d s (Array (Word,Word) (Layer s))
convolutionalLayer ia (fw,fh) (sw,sh) (cw,ch) (bw,bh) c af = do
l... |
d4fd53948bbe374a7e97ce56dd08abe2e6c60722b65daae462bab5de526fbac2 | day8/re-com | info_button.cljs | (ns re-demo.info-button
(:require [re-com.core :refer [at h-box v-box box gap line info-button label input-text hyperlink-href p]]
[re-com.buttons :refer [info-button-parts-desc info-button-args-desc]]
[re-demo.utils :refer [panel-title title2 title3 parts-table args-table github-hyperlink... | null | https://raw.githubusercontent.com/day8/re-com/07451b1d19c59eb185548efe93e2d00b5d3eab89/src/re_demo/info_button.cljs | clojure | (ns re-demo.info-button
(:require [re-com.core :refer [at h-box v-box box gap line info-button label input-text hyperlink-href p]]
[re-com.buttons :refer [info-button-parts-desc info-button-args-desc]]
[re-demo.utils :refer [panel-title title2 title3 parts-table args-table github-hyperlink... | |
4eff29c969d4a3c44f9be47cd35844012c5212a9f3b79601deb409753f2a755b | arcadia-unity/ArcadiaGodot | reducers.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
; ... | null | https://raw.githubusercontent.com/arcadia-unity/ArcadiaGodot/d9881c8132c46f21efde4eb4eb9a534d808cdb20/Clojure/clojure/test_clojure/reducers.clj | clojure | 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 terms of this license.
You must not remove ... | Copyright ( c ) . All rights reserved .
Author :
(ns clojure.test-clojure.reducers
(:require [clojure.core.reducers :as r]
[clojure.test.generative :refer (defspec)]
[clojure.data.generators :as gen])
(:use clojure.test))
(defmacro defequivtest
[name [f r rt] fns]
`(deftest ... |
b3ace26b9eadb571e3f8f1c69ffc97b495b8284ed48c4463595975918741991d | sneeuwballen/benchpress | Test_compare.mli |
* Compare two result files
type filename = string
module Short : sig
type t = {
appeared: int; (* new problems *)
disappeared: int; (* problems that disappeared *)
improved: int;
regressed: int;
mismatch: int;
same: int; (* same result *)
}
val to_printbox : t -> PrintBox.t
val mak... | null | https://raw.githubusercontent.com/sneeuwballen/benchpress/33900b1b369824cf978f1412d8b518c6357e16f7/src/core/Test_compare.mli | ocaml | new problems
problems that disappeared
same result
TODO
module Full : sig
type t = {
appeared: (Problem.t * Res.t) list; (* new problems
problems that disappeared
same result |
* Compare two result files
type filename = string
module Short : sig
type t = {
improved: int;
regressed: int;
mismatch: int;
}
val to_printbox : t -> PrintBox.t
val make : filename -> filename -> (Prover.name * t) list
end
improved: (Problem.t * Res.t * Res.t) list;
regressed: (Proble... |
510431616280762fcb4a635d968960a55bfd15b9c20960dfd81ff5002acd4f98 | hellopatrick/xmas | main.ml | open Containers
let input = IO.(read_lines_l stdin)
module Range = struct
type t = { first : int; last : int }
let parse b = Scanf.bscanf b "%i-%i" (fun first last -> { first; last })
let includes t s = t.first <= s.first && t.last >= s.last
let overlap t s = t.first <= s.last && t.last >= s.first
end
let p... | null | https://raw.githubusercontent.com/hellopatrick/xmas/ff2cbbfb2d569aabd33905e1caece50f88c8c54e/2022/day04/main.ml | ocaml | open Containers
let input = IO.(read_lines_l stdin)
module Range = struct
type t = { first : int; last : int }
let parse b = Scanf.bscanf b "%i-%i" (fun first last -> { first; last })
let includes t s = t.first <= s.first && t.last >= s.last
let overlap t s = t.first <= s.last && t.last >= s.first
end
let p... | |
ff9af4b06978143b8545514c1c709b3658b3a1676e38947709047675435967b0 | canonical/jepsen.dqlite | client.clj | (ns jepsen.dqlite.client
"Helper functions for interacting with the test Dqlite application."
(:require [clojure.tools.logging :refer [info warn]]
[clojure.string :as str]
[clojure.edn :as edn]
[slingshot.slingshot :refer [try+ throw+]]
[clj-http.client :as http]
... | null | https://raw.githubusercontent.com/canonical/jepsen.dqlite/9b47bd826c3c2f78693e96c1d78ed6cc22d73f3c/src/jepsen/dqlite/client.clj | clojure | (throw+ {:type ::no-seriously-timeout})
evals body, turning known errors into :fail | (ns jepsen.dqlite.client
"Helper functions for interacting with the test Dqlite application."
(:require [clojure.tools.logging :refer [info warn]]
[clojure.string :as str]
[clojure.edn :as edn]
[slingshot.slingshot :refer [try+ throw+]]
[clj-http.client :as http]
... |
ca8340556e8571286a2c352e89cff8804669b676e869ca3cc5d6a398ae9a628b | BU-CS320/Fall-2018 | Lang2.hs | module Lang2 where
We will now add a print command to the abstract syntax tree . print takes one expression ,
-- evaluates it, prints the result, and finally evaluates to that result.
data Ast =
AstInt Integer
| Plus Ast Ast
| Separator Ast Ast
| Print Ast
deriving Eq
eval :: Ast -> (Int... | null | https://raw.githubusercontent.com/BU-CS320/Fall-2018/beec3ca88be5c5a62271a45c8053fb1b092e0af1/assignments/week7/hw/src/week5/Lang2.hs | haskell | evaluates it, prints the result, and finally evaluates to that result.
| module Lang2 where
We will now add a print command to the abstract syntax tree . print takes one expression ,
data Ast =
AstInt Integer
| Plus Ast Ast
| Separator Ast Ast
| Print Ast
deriving Eq
eval :: Ast -> (Integer, [Integer])
eval (AstInt i) = (i, [])
eval (Plus l r) ... |
d5f17da46768f5b103a9b4a0edb6b770d0f69027468348fef98aa8811882f063 | hercules-ci/hercules-ci-agent | HerculesCIArgs.hs | {-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DerivingVia #
module Hercules.Agent.NixFile.HerculesCIArgs where
import Data.Aeson (ToJSON)
import Hercules.Agent.NixFile.GitSource (GitSource)
import qualified Hercules.Agent.NixFile.GitSource as GitSource
import Hercules.CNix.Expr (ToRawValue, ViaJSON (ViaJSON))
import Pro... | null | https://raw.githubusercontent.com/hercules-ci/hercules-ci-agent/8a476e9328d197d0d41872b1674638827e18bae0/hercules-ci-agent/src/Hercules/Agent/NixFile/HerculesCIArgs.hs | haskell | # LANGUAGE DeriveAnyClass # | # LANGUAGE DerivingVia #
module Hercules.Agent.NixFile.HerculesCIArgs where
import Data.Aeson (ToJSON)
import Hercules.Agent.NixFile.GitSource (GitSource)
import qualified Hercules.Agent.NixFile.GitSource as GitSource
import Hercules.CNix.Expr (ToRawValue, ViaJSON (ViaJSON))
import Protolude
| Documented in / mod... |
415e62d58e40e9bb59322f0d906f402641a5f36a7b51113696888ce8f512e6e7 | sdiehl/elliptic-curve | Edwards.hs | {-# OPTIONS -fno-warn-orphans #-}
module Data.Curve.Edwards
( module Data.Curve
, Point(..)
* curves
, ECurve(..)
, EPoint
* * affine curves
, EACurve(..)
, EAPoint
* * projective curves
, EPCurve(..)
, EPPoint
) where
import Protolude
import Data.Field.Galois as F (GaloisField, PrimeField... | null | https://raw.githubusercontent.com/sdiehl/elliptic-curve/445e196a550e36e0f25bd4d9d6a38676b4cf2be8/src/Data/Curve/Edwards.hs | haskell | # OPTIONS -fno-warn-orphans #
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
| Edwards curves.
^ Coefficient @A@.
^ Curve cofactor.
^ Curve characteristic.
^ Curve order.
-----------------------------------... |
module Data.Curve.Edwards
( module Data.Curve
, Point(..)
* curves
, ECurve(..)
, EPoint
* * affine curves
, EACurve(..)
, EAPoint
* * projective curves
, EPCurve(..)
, EPPoint
) where
import Protolude
import Data.Field.Galois as F (GaloisField, PrimeField, frob, sr)
import GHC.Natural (Na... |
a67466f0da739f92583ac7a395fbbe1cebcdd437c0790d0bd24e4b3db4b40035 | onyx-platform/onyx | balanced_job_scheduler.clj | (ns onyx.scheduling.balanced-job-scheduler
(:require [onyx.scheduling.common-job-scheduler :as cjs]
[onyx.scheduling.common-task-scheduler :as cts]
[taoensso.timbre :refer [info]]
[onyx.static.util :refer [index-of]]
[onyx.log.commands.common :as common]))
(defmethod c... | null | https://raw.githubusercontent.com/onyx-platform/onyx/74f9ae58cdbcfcb1163464595f1e6ae6444c9782/src/onyx/scheduling/balanced_job_scheduler.clj | clojure | filter out saturated, then sort by is-covered? (yes before no),
then by number of allocated peers
remove all fully allocated jobs
only allocate to jobs that are potentially coverable or already covered
try to assign to uncovered over covered
then assign to the job with the least remaining required
uncovered, low... | (ns onyx.scheduling.balanced-job-scheduler
(:require [onyx.scheduling.common-job-scheduler :as cjs]
[onyx.scheduling.common-task-scheduler :as cts]
[taoensso.timbre :refer [info]]
[onyx.static.util :refer [index-of]]
[onyx.log.commands.common :as common]))
(defmethod c... |
7dde3954fc9ac503f43b893555d56e7ce5f542b05fb6eb7b90495a5fd63dc33b | mhkoji/Senn | class-2-gram.lisp | class 2 - gram model
(defpackage :hachee.kkc.impl.class-2-gram
(:use :cl)
(:shadow :word)
(:export :set-ex-dict
:read-kkc))
(in-package :hachee.kkc.impl.class-2-gram)
(defstruct word
word-id
class-id)
(defstruct class-model
ngram-counts
word-counts
weight-1
weight-2)
(defun count-get (... | null | https://raw.githubusercontent.com/mhkoji/Senn/d6222e526748ceae03915caf474970bd00273b76/hachee/src/kkc/impl/class-2-gram/class-2-gram.lisp | lisp | P(class_curr | class_prev)
P(word_curr | class_curr)
convert
lookup
ex-dict
| class 2 - gram model
(defpackage :hachee.kkc.impl.class-2-gram
(:use :cl)
(:shadow :word)
(:export :set-ex-dict
:read-kkc))
(in-package :hachee.kkc.impl.class-2-gram)
(defstruct word
word-id
class-id)
(defstruct class-model
ngram-counts
word-counts
weight-1
weight-2)
(defun count-get (... |
768eb224bb8b113dbe1773ca44ea56ddb88a57651e5f10dd36c8a37ed5217d40 | ThoughtWorksInc/stonecutter | confirmation.clj | (ns stonecutter.test.db.confirmation
(:require [midje.sweet :refer :all]
[stonecutter.db.storage :as s]
[stonecutter.db.confirmation :as confirmation]
[stonecutter.db.storage :as storage]
[stonecutter.db.mongo :as m]))
(facts "about storage of confirmations"
(le... | null | https://raw.githubusercontent.com/ThoughtWorksInc/stonecutter/37ed22dd276ac652176c4d880e0f1b0c1e27abfe/test/stonecutter/test/db/confirmation.clj | clojure | (ns stonecutter.test.db.confirmation
(:require [midje.sweet :refer :all]
[stonecutter.db.storage :as s]
[stonecutter.db.confirmation :as confirmation]
[stonecutter.db.storage :as storage]
[stonecutter.db.mongo :as m]))
(facts "about storage of confirmations"
(le... | |
62863b38ca2e535e804b66fb494e05e3ed1c879d6a87f07465463dbace37df97 | Octachron/codept | unknown_arg.ml | module F(Unknown_arg:Ext.s) = struct
open Unknown_arg.A
end
| null | https://raw.githubusercontent.com/Octachron/codept/2d2a95fde3f67cdd0f5a1b68d8b8b47aefef9290/tests/cases/unknown_arg.ml | ocaml | module F(Unknown_arg:Ext.s) = struct
open Unknown_arg.A
end
| |
f4bd8a8e45fe95fd330f509c8441d99000f92e9c5f85e9b90af1e313d942ecc7 | mythical-linux/rktfetch | main.rkt | #!/usr/bin/env racket
#lang racket/base
(require
racket/cmdline
racket/promise
(only-in racket/format ~a)
(only-in racket/list make-list)
(only-in racket/os gethostname)
(only-in racket/string string-join)
"private/get.rkt"
)
Return no less 0 VAL from difference between NUM1 and NUM2
(define (>0 num1 num... | null | https://raw.githubusercontent.com/mythical-linux/rktfetch/d233175d5ba67901f0811d15b526868e1615a5e4/rktfetch/main.rkt | racket |
that promise is forced
Gather info
additional CLI parameters
overwrite a detected component
additional CLI switches
create info side (right side)
extend the length of logo side to the length of info side
extend the length of info side to the length of logo side
length of the longest string in the logo,
used ... | #!/usr/bin/env racket
#lang racket/base
(require
racket/cmdline
racket/promise
(only-in racket/format ~a)
(only-in racket/list make-list)
(only-in racket/os gethostname)
(only-in racket/string string-join)
"private/get.rkt"
)
Return no less 0 VAL from difference between NUM1 and NUM2
(define (>0 num1 num... |
7a4ca775b321d8cf43590fc5bab603ec57d85b5ee79cf28ba678fd4f66aa643e | electric-sql/vaxine | meta_data_sender.erl | %% -------------------------------------------------------------------
%%
Copyright < 2013 - 2018 > <
Technische Universität Kaiserslautern , Germany
, France
Universidade NOVA de Lisboa , Portugal
Université catholique de Louvain ( UCL ) , Belgique
, Portugal
%% >
%%
This file is provided... | null | https://raw.githubusercontent.com/electric-sql/vaxine/5f88829a513a076e9928f389995d913ea381ccb6/apps/antidote/src/meta_data_sender.erl | erlang | -------------------------------------------------------------------
>
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either expressed or implied. See the License for the
specific language governing perm... | Copyright < 2013 - 2018 > <
Technische Universität Kaiserslautern , Germany
, France
Universidade NOVA de Lisboa , Portugal
Université catholique de Louvain ( UCL ) , Belgique
, Portugal
This file is provided to you under the Apache License ,
except in compliance with the License . You... |
8fbcacfdae192e7db00bd2d37d9ac063c6e112bf07a6dd62f4e4c50ed2e4dbb8 | hiroshi-unno/coar | enc-rev_accum.ml | let rec rev n m =
if n = 0
then m
else rev (n - 1) (m + 1)
let main n =
assert (rev n 0 >= n)
[@@@assert "typeof(main) <: int -> unit"]
| null | https://raw.githubusercontent.com/hiroshi-unno/coar/90a23a09332c68f380efd4115b3f6fdc825f413d/benchmarks/OCaml/safety/tacas2015/enc-rev_accum.ml | ocaml | let rec rev n m =
if n = 0
then m
else rev (n - 1) (m + 1)
let main n =
assert (rev n 0 >= n)
[@@@assert "typeof(main) <: int -> unit"]
| |
a2400467c088106e968db44cee571c7d134cdc7bec38deeb8cb63a2bceece036 | fetburner/Coq2SML | decl_mode.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2014
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/fetburner/Coq2SML/322d613619edbb62edafa999bff24b1993f37612/coq-8.4pl4/plugins/decl_mode/decl_mode.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
********************************************************************** | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2014
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Term
open Evd... |
68ccb1ad31c551e01ee9ea54bcd659e56d8ad5f508d22670791f9f2714cb242c | lpsmith/postgresql-simple | Notify.hs | module Notify (testNotify) where
import Common
import Control.Applicative
import Control.Concurrent
import Control.Monad
import Data.Function
import Data.List
import Database.PostgreSQL.Simple.Notification
import qualified Data.ByteString as B
TODO : Test with payload , but only for PostgreSQL > = 9.0
-- (when th... | null | https://raw.githubusercontent.com/lpsmith/postgresql-simple/ce9def5019c2a6f8b93d3e3478587f33993bba56/test/Notify.hs | haskell | (when that feature was introduced).
Other sanity checks | module Notify (testNotify) where
import Common
import Control.Applicative
import Control.Concurrent
import Control.Monad
import Data.Function
import Data.List
import Database.PostgreSQL.Simple.Notification
import qualified Data.ByteString as B
TODO : Test with payload , but only for PostgreSQL > = 9.0
testNotify... |
48bbf0a842cc5d9738f3f87f06185eac0de3e4a9d2d47312b0391ad0cf322063 | haskell-compat/base-compat | Compat.hs | # LANGUAGE CPP , NoImplicitPrelude , PackageImports #
module Foreign.Marshal.Compat (
module Base
) where
import "base-compat" Foreign.Marshal.Compat as Base
| null | https://raw.githubusercontent.com/haskell-compat/base-compat/847aa35c4142f529525ffc645cd035ddb23ce8ee/base-compat-batteries/src/Foreign/Marshal/Compat.hs | haskell | # LANGUAGE CPP , NoImplicitPrelude , PackageImports #
module Foreign.Marshal.Compat (
module Base
) where
import "base-compat" Foreign.Marshal.Compat as Base
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.