_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 |
|---|---|---|---|---|---|---|---|---|
fa03bcb425d4c3b258e84bca8a0d166f312ad36c5c444e861a88b4f4a01f634d | idontgetoutmuch/HasBayes | StudentAux.hs | {-# OPTIONS_GHC -Wall #-}
# OPTIONS_GHC -fno - warn - name - shadowing #
# OPTIONS_GHC -fno - warn - type - defaults #
# OPTIONS_GHC -fno - warn - unused - do - bind #
# OPTIONS_GHC -fno - warn - missing - methods #
# OPTIONS_GHC -fno - warn - orphans #
{-# LANGUAGE NoMonomor... | null | https://raw.githubusercontent.com/idontgetoutmuch/HasBayes/43c7d09b8ee839dba5ed8f18e17110135d20b93d/StudentAux.hs | haskell | # OPTIONS_GHC -Wall #
# LANGUAGE NoMonomorphismRestriction #
, m2 = m2 m + x**2
, m3 = m3 m + x**3
, m4 = m4 m + x**4
}) (Moments 0.0 0.0 0.0 0.0) simpleXs
mean = m... | # OPTIONS_GHC -fno - warn - name - shadowing #
# OPTIONS_GHC -fno - warn - type - defaults #
# OPTIONS_GHC -fno - warn - unused - do - bind #
# OPTIONS_GHC -fno - warn - missing - methods #
# OPTIONS_GHC -fno - warn - orphans #
module StudentTest (
main
, Moments (..)
) where
import qua... |
38f10e6b00fbeae3a514eecef8e4ad3fb057c14b15b55aa510d1991918ebfd39 | kazu-yamamoto/bst | fix.hs | module Main where
main :: IO ()
main = do
cs <- getContents
let ls = lines cs
(ps,fl) = break (== "") ls
writeFile "pass.dat" (unlines ps)
writeFile "fail.dat" (unlines (tail fl))
| null | https://raw.githubusercontent.com/kazu-yamamoto/bst/d2c3d277b04d0eb7b97c5e58b709bd40755e0e54/test/fix.hs | haskell | module Main where
main :: IO ()
main = do
cs <- getContents
let ls = lines cs
(ps,fl) = break (== "") ls
writeFile "pass.dat" (unlines ps)
writeFile "fail.dat" (unlines (tail fl))
| |
24496e70ec55242952ea9b77db7cd2369adab5292fb4ecfc66488602afdc3783 | cbaggers/cepl | aref-c.lisp | (in-package :cepl.c-arrays)
;;----------------------------------------------------------------------
;; Q: Why not use mem-aptr?
;; A: That requires looking up the size of the type on every call. Instead
;; we cache that in the c-array and do the math ourselves.
(defn-inline ptr-index-1d ((c-array c-array) (x c-ar... | null | https://raw.githubusercontent.com/cbaggers/cepl/d1a10b6c8f4cedc07493bf06aef3a56c7b6f8d5b/core/c-arrays/aref-c.lisp | lisp | ----------------------------------------------------------------------
Q: Why not use mem-aptr?
A: That requires looking up the size of the type on every call. Instead
we cache that in the c-array and do the math ourselves.
this is safe as all c-arrays will have 0 as the size for missing
dimensions
------------... | (in-package :cepl.c-arrays)
(defn-inline ptr-index-1d ((c-array c-array) (x c-array-index))
cffi-sys:foreign-pointer
#+sbcl(declare (sb-ext:muffle-conditions sb-ext:compiler-note))
(declare (optimize (speed 3) (safety 0) (debug 1))
(profile t))
(the cffi-sys:foreign-pointer
(inc-pointer (c... |
354de8b263eac7c284bbf6e85c6ab580c2fff7937a543d29843d5c4680278c13 | erlang-ls/erlang_ls | els_mock_diagnostics.erl | -module(els_mock_diagnostics).
-export([
setup/0,
teardown/0,
subscribe/0,
wait_until_complete/0
]).
-spec setup() -> ok.
setup() ->
meck:new(els_diagnostics_provider, [passthrough, no_link]).
-spec teardown() -> ok.
teardown() ->
meck:unload(els_diagnostics_provider).
-spec subscribe() -> o... | null | https://raw.githubusercontent.com/erlang-ls/erlang_ls/2dfb48aca3879e5b44f6fd676f8349525262779f/apps/els_lsp/test/els_mock_diagnostics.erl | erlang | -module(els_mock_diagnostics).
-export([
setup/0,
teardown/0,
subscribe/0,
wait_until_complete/0
]).
-spec setup() -> ok.
setup() ->
meck:new(els_diagnostics_provider, [passthrough, no_link]).
-spec teardown() -> ok.
teardown() ->
meck:unload(els_diagnostics_provider).
-spec subscribe() -> o... | |
d4c557e1b8564fc4bab3ed3de33e03737fa112799afef22b3e2305d9137ff789 | typelead/etlas | ResolverPackage.hs | # LANGUAGE TypeFamilies #
# LANGUAGE DeriveGeneric #
module Distribution.Solver.Types.ResolverPackage
( ResolverPackage(..)
, resolverPackageLibDeps
, resolverPackageExeDeps
) where
import Distribution.Solver.Types.InstSolverPackage
import Distribution.Solver.Types.SolverId
import Distribution.Solver.T... | null | https://raw.githubusercontent.com/typelead/etlas/bbd7c558169e1fda086e759e1a6f8c8ca2807583/etlas/Distribution/Solver/Types/ResolverPackage.hs | haskell | | The dependency resolver picks either pre-existing installed packages
or it picks source packages along with package configuration.
Use dependencies for ALL components | # LANGUAGE TypeFamilies #
# LANGUAGE DeriveGeneric #
module Distribution.Solver.Types.ResolverPackage
( ResolverPackage(..)
, resolverPackageLibDeps
, resolverPackageExeDeps
) where
import Distribution.Solver.Types.InstSolverPackage
import Distribution.Solver.Types.SolverId
import Distribution.Solver.T... |
b38fab12d80a16347e21de1907967eeaeb4f5581c5267270e895c3faab76dab9 | yawaramin/bs-webapi | Yawaramin_BsWebapi_HTMLCollection.ml | type 'a element = 'a Yawaramin_BsWebapi_Element.supertype
type t
external item: int -> 'a element Js.nullable = "" [@@bs.send.pipe: t]
external length: t -> int = "" [@@bs.get]
external namedItem: string -> 'a element Js.nullable = "" [@@bs.send.pipe: t]
| null | https://raw.githubusercontent.com/yawaramin/bs-webapi/0c8646ad8096685e175db8e18bee8ea4f364d567/src/Yawaramin_BsWebapi/Yawaramin_BsWebapi_HTMLCollection.ml | ocaml | type 'a element = 'a Yawaramin_BsWebapi_Element.supertype
type t
external item: int -> 'a element Js.nullable = "" [@@bs.send.pipe: t]
external length: t -> int = "" [@@bs.get]
external namedItem: string -> 'a element Js.nullable = "" [@@bs.send.pipe: t]
| |
818fd408b2691597fa5abea2ed4b57e9d4385f40ad6d1337b44f8f1e49093af6 | namenu/advent-of-code | cube.clj | (ns aoc.cube
(:require [aoc.grid :as grid]))
(defn adjacent?
[[x1 y1 z1] [x2 y2 z2]]
(= 1 (+ (abs (- x1 x2))
(abs (- y1 y2))
(abs (- z1 z2)))))
(defn axial-neighbors [[x y z]]
[[(dec x) y z] [(inc x) y z]
[x (dec y) z] [x (inc y) z]
[x y (dec z)] [x y (inc z)]])
bbox
(def boundi... | null | https://raw.githubusercontent.com/namenu/advent-of-code/5dff78ab3026c9d3f61ff1e85d10e36281b0265e/lib/namenu/src/aoc/cube.clj | clojure | (ns aoc.cube
(:require [aoc.grid :as grid]))
(defn adjacent?
[[x1 y1 z1] [x2 y2 z2]]
(= 1 (+ (abs (- x1 x2))
(abs (- y1 y2))
(abs (- z1 z2)))))
(defn axial-neighbors [[x y z]]
[[(dec x) y z] [(inc x) y z]
[x (dec y) z] [x (inc y) z]
[x y (dec z)] [x y (inc z)]])
bbox
(def boundi... | |
2582f9308806c29d4724f186276cb0a278954af953c3cd0dc0020bbb7a10c0bd | mfikes/cljs-bean | transit_test.cljs | (ns cljs-bean.transit-test
(:require
[cljs-bean.core :refer [->clj]]
[cljs-bean.transit]
[clojure.test :refer [deftest is]]
[cognitect.transit :as t]))
(defn roundtrip [x]
(let [w (t/writer :json
{:handlers (cljs-bean.transit/writer-handlers)})
r (t/reader :json)]
(t/read r ... | null | https://raw.githubusercontent.com/mfikes/cljs-bean/348c8296ccd6f592ba46a8ddea989cb7aa2da2e8/test/cljs_bean/transit_test.cljs | clojure | (ns cljs-bean.transit-test
(:require
[cljs-bean.core :refer [->clj]]
[cljs-bean.transit]
[clojure.test :refer [deftest is]]
[cognitect.transit :as t]))
(defn roundtrip [x]
(let [w (t/writer :json
{:handlers (cljs-bean.transit/writer-handlers)})
r (t/reader :json)]
(t/read r ... | |
5dd25d5609a1e5dacd397dc1bcde865f8fb9bd50ea2ac08b50eb78ce7160cbe8 | langston-barrett/CoverTranslator | Core2Agda.hs | | Translating a core abstract syntax , which has gone through
case - abstraction and lambda - lifting already , to Agda abstract syntax .
Authors : , ,
Naming scheme : Function < c>2 < a > translates Core abstract syntax
concept < c > to Agda abstract syntax concept < a >
case-abstraction and lambda-li... | null | https://raw.githubusercontent.com/langston-barrett/CoverTranslator/4172bef9f4eede7e45dc002a70bf8c6dd9a56b5c/src/Core2Agda.hs | haskell | Agda abstract syntax
for debugging
Name of the current module
'mutual': Wrapper for a 'Mutual' Agda definition.
Produces a "Mutual" definition from a list of definitions. If the
list is a singleton, the keyword mutual is not required. If the list
is empty, nothing is returned.
or Value?
Wrong: perhaps correct... | | Translating a core abstract syntax , which has gone through
case - abstraction and lambda - lifting already , to Agda abstract syntax .
Authors : , ,
Naming scheme : Function < c>2 < a > translates Core abstract syntax
concept < c > to Agda abstract syntax concept < a >
case-abstraction and lambda-li... |
7f9d73ac414e38fcd0c61101c666f5f0779bf70d681ad1877bd13162ab0372d1 | erlang/otp | inet_sockopt_SUITE.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 applic... | null | https://raw.githubusercontent.com/erlang/otp/12509834ed59004b2add47e12806aaaaa43834b8/lib/kernel/test/inet_sockopt_SUITE.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 l... | 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(inet_sockopt_SUITE).
-include_lib("common_test/include/ct.hrl").
-include("kernel_test_lib.hrl").
-define(... |
6651d5710c979c85d9e992975c7bec75a62d6a4919c1eee473ee76ebd3fa6ae4 | qmuli/qmuli | Old.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE TypeOperators #-}
module Qi.Program... | null | https://raw.githubusercontent.com/qmuli/qmuli/6ca147f94642b81ab3978d502397efb60a50215b/library/Qi/Program/Lambda/Old.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
# LANGUAGE TypeOperators #
S3
sink
uploadId
source chunk
DDB
StartBotImport
S3
sink
uploadId
source chunk
DDB
Lex
S3
sink
uploadId
source chunk
DDB
Lex
S3
sin... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
module Qi.Program.Lambda.Old where
import Control . . Freer
import Data . Aeson ( FromJSON , ToJSON , Value )
import qualified Data . ... |
20f8cddf588cde6870eee7a32864e9be94eae63978f965991f2f40d962ab1f82 | sgbj/MaximaSharp | dgeev.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy ... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/lapack/lapack/dgeev.lisp | lisp | Compiled by f2cl version:
Using Lisp CMU Common Lisp 20d (20D Unicode)
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy $ "
" f2cl6.l , v 1d5cbacbb... |
cf85232ba4cb9604cbf61582c1da386ed26f7eb3a5a2b22f20d454dbbc50921f | slindley/effect-handlers | Nbe.hs | Normalisation by evaluation for the computational lambda calculus +
sums using handlers .
Based on the paper ' Accumulating bindings ' by :
-sums.pdf
This version uses handlers pervasively , including in the evaluator ,
which presents some interesting issues .
sums using handlers.... | null | https://raw.githubusercontent.com/slindley/effect-handlers/39d0d09582d198dd6210177a0896db55d92529f4/Examples/Nbe.hs | haskell | FOAS
We build up simple types from: abstract base types (A,B,C), the
function type constructor (->), and the sum type constructor (Either).
some abstract base types
syntactic sugar for sums
metalanguage types and object language type representations.
Note that this type class is closed by construction, as the R... | Normalisation by evaluation for the computational lambda calculus +
sums using handlers .
Based on the paper ' Accumulating bindings ' by :
-sums.pdf
This version uses handlers pervasively , including in the evaluator ,
which presents some interesting issues .
sums using handlers.... |
2a38a8c6064f3b2ae669a31c3b8bbe7a2eef97b5c6df8b0c50a071335be9b48e | paurkedal/ocaml-cothrift | thrift_lwt_unix.ml | Copyright ( C ) 2016 < >
*
* This library is free software ; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or ( at your
* option ) any later version , with the ... | null | https://raw.githubusercontent.com/paurkedal/ocaml-cothrift/4410e5123ec6b3769c0d046f1abf4a73e9b56a0f/lib/thrift_lwt_unix.ml | ocaml | TODO: Handle and log protocol errors here. | Copyright ( C ) 2016 < >
*
* This library is free software ; you can redistribute it and/or modify it
* under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or ( at your
* option ) any later version , with the ... |
f2c2c91371a43c171c1f09f83ca3c4f26e7f01fb1dda61438ec73b0f9177a7f6 | xapi-project/xen-api | session_check.ml |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | null | https://raw.githubusercontent.com/xapi-project/xen-api/20b0574fa0f60c72b5a8eeafbc84bb485ebb6c22/ocaml/xapi/session_check.ml | ocaml | Session checking *********************************************************
Allows us to hook in an optional "local session" predicate
First see if this is a "local" session
debug "Session is in the local database"
Assuming we're in master mode
If the session is not a pool login, but this call is only supporte... |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... |
cbeb61c474b1e5c001e9f9862a477092e5551492ad38fe6c8d5950c75c7c03d1 | mbutterick/aoc-racket | 11.rkt | #lang br
(require racket/file rackunit)
(define grid
(for*/hasheqv ([(row ridx) (in-indexed (file->lines "11.rktd"))]
[(col cidx) (in-indexed row)])
(values (make-rectangular cidx ridx) col)))
(define (seat-count grid)
(count (λ (val) (char=? val #\#)) (hash-values grid)))
(define offsets '(... | null | https://raw.githubusercontent.com/mbutterick/aoc-racket/2c6cb2f3ad876a91a82f33ce12844f7758b969d6/2020/11.rkt | racket | #lang br
(require racket/file rackunit)
(define grid
(for*/hasheqv ([(row ridx) (in-indexed (file->lines "11.rktd"))]
[(col cidx) (in-indexed row)])
(values (make-rectangular cidx ridx) col)))
(define (seat-count grid)
(count (λ (val) (char=? val #\#)) (hash-values grid)))
(define offsets '(... | |
a4d6e02ecb907db09d3e64f4452cb90bc1b5832c2a0baf227e123b0b62e70182 | yetanalytics/dave | user.clj | (ns user
(:require [clojure.repl :refer [doc source apropos]]
[clojure.pprint :refer [pprint pp]]
[com.yetanalytics.dave.filter-scratch.json :as j]
[com.yetanalytics.dave.filter-scratch.json.path :as path]
[clojure.java.io :as io]
[clojure.spec.alpha :as s]
... | null | https://raw.githubusercontent.com/yetanalytics/dave/7a71c2017889862b2fb567edc8196b4382d01beb/scratch/filter-scratch/src/dev/user.clj | clojure | no-ops
Try some jolt transforms
no-ops
[a v o]
success timeline
difficult questions
completion rate ;; WRONG | (ns user
(:require [clojure.repl :refer [doc source apropos]]
[clojure.pprint :refer [pprint pp]]
[com.yetanalytics.dave.filter-scratch.json :as j]
[com.yetanalytics.dave.filter-scratch.json.path :as path]
[clojure.java.io :as io]
[clojure.spec.alpha :as s]
... |
2bee7dab680be4731e63a06c049cf6dbd2f22e4a7f4f1ae41b17fb3c683289d0 | Innf107/polaris | main.ml |
let usage_message =
{|Usage: polarislsp [--trace CATEGORY]
Options:
--trace <category> Enable traces for a given category.
Possible values: |} ^ String.concat ", " (Trace.get_categories ())
let fail_usage message =
prerr_endline message;
prerr_newline ();
prerr_endline ... | null | https://raw.githubusercontent.com/Innf107/polaris/5c0be1403e44064393b27088d1ab9b7236201cf7/polarislsp/main.ml | ocaml |
let usage_message =
{|Usage: polarislsp [--trace CATEGORY]
Options:
--trace <category> Enable traces for a given category.
Possible values: |} ^ String.concat ", " (Trace.get_categories ())
let fail_usage message =
prerr_endline message;
prerr_newline ();
prerr_endline ... | |
06a08a5b1a90a340e2d2defcacb16d680b5b7474daac32b6e8801c774d131010 | atdixon/me.untethr.nostr-relay | crypt_test.clj | (ns test.crypt-test
(:require [clojure.test :refer :all]
[clojure.java.io :as io]
[clojure.data.csv :as csv]
[clojure.string :as str]
[me.untethr.nostr.crypt.crypt :as crypt]
[clojure.tools.logging :as log]))
;;
;; #test-vectors-and-reference-code
(deftes... | null | https://raw.githubusercontent.com/atdixon/me.untethr.nostr-relay/724a2af1599b630de413d78555e70bc57073552c/test/test/crypt_test.clj | clojure |
#test-vectors-and-reference-code | (ns test.crypt-test
(:require [clojure.test :refer :all]
[clojure.java.io :as io]
[clojure.data.csv :as csv]
[clojure.string :as str]
[me.untethr.nostr.crypt.crypt :as crypt]
[clojure.tools.logging :as log]))
(deftest verify-test
[]
(with-open [reader
... |
7a017b23ef0547f81a20d4471290739e24c95dc5aa05a3012b07c41aa74b3a7b | metosin/ring-swagger | common.clj | (ns ring.swagger.common
(:require [plumbing.core :as p]
[schema.utils :as su]
[schema.core :as s]))
(defn remove-empty-keys
"Removes empty properties with nil value from a map"
[m]
(into (empty m) (filter (comp not nil? val) m)))
(defn value-of
"Extracts value of for var, symbol or r... | null | https://raw.githubusercontent.com/metosin/ring-swagger/0ef9046174dec0ebd4cbf97d6cc5c6846ef11996/src/ring/swagger/common.clj | clojure | (ns ring.swagger.common
(:require [plumbing.core :as p]
[schema.utils :as su]
[schema.core :as s]))
(defn remove-empty-keys
"Removes empty properties with nil value from a map"
[m]
(into (empty m) (filter (comp not nil? val) m)))
(defn value-of
"Extracts value of for var, symbol or r... | |
88ec1b98d387d9a580d4203da032188da1a9439a6e3bd2290edbfa2f43748bda | nuvla/api-server | evidence_record_test.cljc | (ns sixsq.nuvla.server.resources.spec.evidence-record-test
(:require
[clojure.test :refer [deftest]]
[sixsq.nuvla.server.resources.spec.evidence-record :as evidence-record]
[sixsq.nuvla.server.resources.spec.spec-test-utils :as stu]))
(def valid-acl {:owners ["group/nuvla-admin"]
:view... | null | https://raw.githubusercontent.com/nuvla/api-server/a64a61b227733f1a0a945003edf5abaf5150a15c/code/test/sixsq/nuvla/server/resources/spec/evidence_record_test.cljc | clojure | mandatory keywords
optional keywords | (ns sixsq.nuvla.server.resources.spec.evidence-record-test
(:require
[clojure.test :refer [deftest]]
[sixsq.nuvla.server.resources.spec.evidence-record :as evidence-record]
[sixsq.nuvla.server.resources.spec.spec-test-utils :as stu]))
(def valid-acl {:owners ["group/nuvla-admin"]
:view... |
20334acf7a3f42dc19cd6646e38b51d69ec83b59ba118e09233416693ff76613 | wireless-net/erlang-nommu | erl_tar.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1997 - 2013 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/stdlib/src/erl_tar.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 1997 - 2013 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(erl_tar).
-export([create/2, crea... |
f76c59238e7046901555a934e5ac60a172f75f585da42de91c6d05f3a18118b1 | racket/games | ginrummy.rkt | #lang racket/base
(require racket/gui/base games/cards racket/class racket/unit)
(provide game@)
(define game@ (unit (import) (export)
;; Initial card count
(define DEAL-COUNT 10)
;; Messages
(define YOUR-TURN-MESSAGE "Your turn. (Draw a card or pickup a discard.)")
(define DISCARD-MESSAGE "Drag a card from your ha... | null | https://raw.githubusercontent.com/racket/games/e57376f067be51257ed12cdf3e4509a00ffd533d/ginrummy/ginrummy.rkt | racket | Initial card count
Messages
Area labels
Region layout constants
Set up the table
Get table width & height
Set up the cards
Function for dealing or drawing cards
Draw and discard pile locations
Put the cards on the table
Player region size
Define the regions
Install the visible regions
Deal the initial han... | #lang racket/base
(require racket/gui/base games/cards racket/class racket/unit)
(provide game@)
(define game@ (unit (import) (export)
(define DEAL-COUNT 10)
(define YOUR-TURN-MESSAGE "Your turn. (Draw a card or pickup a discard.)")
(define DISCARD-MESSAGE "Drag a card from your hand to discard.")
(define GAME-OVER... |
6410ab8a2e733eb431eb7240aa6017b2b4272a40d0de13e2e6036dfe384d0349 | rabbitmq/rabbitmq-stomp | Elixir.RabbitMQ.CLI.Ctl.Commands.ListStompConnectionsCommand.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/rabbitmq/rabbitmq-stomp/925d78e2c7152723a68452b38fbc2713d2797b8b/src/Elixir.RabbitMQ.CLI.Ctl.Commands.ListStompConnectionsCommand.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License
at /
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
| The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is GoPivotal , Inc.
Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights re... |
ea6c3b7a949c20a4d05fc6d2d1d25a2c9a8aca4b9069663e981ca298f4adb02c | couchbase/chronicle | chronicle_kv.erl | @author Couchbase < >
2020 Couchbase , Inc.
%%
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, sof... | null | https://raw.githubusercontent.com/couchbase/chronicle/cf94f4d8e1d183d5576a246f973bcb33af81037c/src/chronicle_kv.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 or implied.
See the License for the specific language governing per... | @author Couchbase < >
2020 Couchbase , Inc.
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(chronicle_kv).
-include("chronicle.hrl").
-import(chronicle_utils, [start_timeout/1,
saniti... |
b44e68b12b811b6d7fc0f04570e9c7a9a1bdd89ec81d7dea2a12fbe34b127ed3 | drcode/webfui | core.cljs | (ns webfui.core
(:use [webfui.html :only [html parse-html parsed-html render-attribute-value html-delta]]
[webfui.plugin.core :only [active-plugins Plugin declare-events fix-dom]]
[cljs.reader :only [read-string]]))
This file contains the core engine for webfui . You usually do n't want to load thi... | null | https://raw.githubusercontent.com/drcode/webfui/e8ba6e9224542755e5780488cb43f0c5510827f9/src/webfui/core.cljs | clojure | (ns webfui.core
(:use [webfui.html :only [html parse-html parsed-html render-attribute-value html-delta]]
[webfui.plugin.core :only [active-plugins Plugin declare-events fix-dom]]
[cljs.reader :only [read-string]]))
This file contains the core engine for webfui . You usually do n't want to load thi... | |
df21168fc138ea4eb4023c1709e28145cd69233176c4ca419fb9b70b9751fe05 | gbwey/predicate-typed | DateTime.hs | # LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeApplications #
# LANGUAGE DataKinds #
{-# LANGUAGE GADTs #-}
# LANGUAGE TypeFamilies #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
{-# L... | null | https://raw.githubusercontent.com/gbwey/predicate-typed/51f8d51f662722e1109d2ff35644aea1e0371b42/src/Predicate/Data/DateTime.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes #
# LANGUAGE OverloadedStrings #
# LANGUAGE ConstraintKinds #
# LANGUAGE EmptyDataDeriving #
| promoted date time functions
** format
** constructors
** destructors
$setup
>>> :set -XDataKinds
>>> :set -XTypeApplications
>>> :set -XTypeOperators
>>> :set -XOverloadedStr... | # LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeApplications #
# LANGUAGE DataKinds #
# LANGUAGE TypeFamilies #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
#... |
e23e45cd9840a5af2fff8a2912bd693f8afc8223cb67791ccaa079d9aae08d67 | futurice/haskell-mega-repo | Config.hs | # LANGUAGE DataKinds #
module Futurice.App.OktaProxy.Config where
import Futurice.EnvConfig
import Futurice.Integrations
import Futurice.Prelude
import Prelude ()
import qualified FUM.Types.Login as FUM
data Config = Config
{ cfgMockUser :: !(Maybe FUM.Login)
, cfgIntegrationsCfg :: !(Integratio... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/2647723f12f5435e2edc373f6738386a9668f603/okta-proxy/src/Futurice/App/OktaProxy/Config.hs | haskell | # LANGUAGE DataKinds #
module Futurice.App.OktaProxy.Config where
import Futurice.EnvConfig
import Futurice.Integrations
import Futurice.Prelude
import Prelude ()
import qualified FUM.Types.Login as FUM
data Config = Config
{ cfgMockUser :: !(Maybe FUM.Login)
, cfgIntegrationsCfg :: !(Integratio... | |
529da7cd27e430ff41cbd347edf45eb070c0a77c16fdcea1f392e1d123081669 | juxt/joplin | migrate.clj | (ns migrate
(:require [joplin.alias :refer [*load-config*]]
[clojure.java.io :as io]
[joplin.repl :as repl
:refer [migrate rollback seed reset create pending]]
[ragtime.strategy :as strategy]))
(defn say-hello []
(println "Welcome to Joplin!")
(println "From this ... | null | https://raw.githubusercontent.com/juxt/joplin/d190f883c47b11efafc5154237a80d36af0087d3/example/src/migrate.clj | clojure | Migrate (can also be called without the last database argument)
override conflict strategy
Rollback
Seed (can also be called without the last database argument)
Reset
Create migration
See pending migrations
Load a config file, joplins repl/load-config has support for env variables | (ns migrate
(:require [joplin.alias :refer [*load-config*]]
[clojure.java.io :as io]
[joplin.repl :as repl
:refer [migrate rollback seed reset create pending]]
[ragtime.strategy :as strategy]))
(defn say-hello []
(println "Welcome to Joplin!")
(println "From this ... |
0f041799cb88352d05804b814c7c0f153e03b40873a1b40845b0441a414a0366 | tonyg/racket-abnf | rfc5322.rkt | #lang racket/base
(provide parse-message
parse-message-header
(all-from-out "rfc5322/ast.rkt")
fix-crlfs)
(require racket/match)
(require (only-in racket/string string-trim string-split string-join))
(require (only-in racket/list append-map))
(require abnf)
(require (prefix-in core: abnf/r... | null | https://raw.githubusercontent.com/tonyg/racket-abnf/1079bc5b30a227f52ac00a84dc3fcd539da5f8db/abnf/rfc5322.rkt | racket | TODO: analyze further
Extensions
(local-require racket/trace) (trace f)
undo the "special case" in string-split :-/
RFC 2822 §2.3 CR and LF MUST not appear outside a CRLF combination, but hey | #lang racket/base
(provide parse-message
parse-message-header
(all-from-out "rfc5322/ast.rkt")
fix-crlfs)
(require racket/match)
(require (only-in racket/string string-trim string-split string-join))
(require (only-in racket/list append-map))
(require abnf)
(require (prefix-in core: abnf/r... |
b330aae087fedb83406f1daa6ca953af39c55a537fba53210fb2dad9907aee67 | txkaduo/weixin-mp-sdk | Template.hs | # LANGUAGE DataKinds #
module WeiXin.PublicPlatform.Message.Template where
{ { { 1 imports
import ClassyPrelude hiding (Element)
import Control.Lens hiding ((.=))
import Data.Aeson (ToJSON(..), (.=), object, FromJSON(..), withObject, (.:))
import Data.Aeson.TH (deriveJSON, fie... | null | https://raw.githubusercontent.com/txkaduo/weixin-mp-sdk/4e2f1760f869f6403711e4397ee1be34ac1b9895/WeiXin/PublicPlatform/Message/Template.hs | haskell | | 发送模板消息 | # LANGUAGE DataKinds #
module WeiXin.PublicPlatform.Message.Template where
{ { { 1 imports
import ClassyPrelude hiding (Element)
import Control.Lens hiding ((.=))
import Data.Aeson (ToJSON(..), (.=), object, FromJSON(..), withObject, (.:))
import Data.Aeson.TH (deriveJSON, fie... |
642d4914a89b632ec3a9a399b2e0c19535c7c9bbb8f03464aaf3b6de184ba25b | ptressel/LISPSearch | polygons-test-6.lsp | This is the 8 thingy case sent out in e - mail . Hope I get their points all
; properly in counterclockwise order... Hey, it looks like they're all
; already counterclockwise -- thanks!
(setf *polygons* (list
(list
(list 13 -7)
(list 14 -6)
... | null | https://raw.githubusercontent.com/ptressel/LISPSearch/791c0eb65d6be9d232143795adba2e5b8057f61d/polygons-test-6.lsp | lisp | properly in counterclockwise order... Hey, it looks like they're all
already counterclockwise -- thanks!
Start
Goal | This is the 8 thingy case sent out in e - mail . Hope I get their points all
(setf *polygons* (list
(list
(list 13 -7)
(list 14 -6)
(list 8 4)
(list 7 3)
(list 13 -7)
... |
cb0772c50b700e026d360cce955da4c5e379a0a68916da87335c87f1f99aa50a | tcsprojects/pgsolver | pgsolver.ml | open Basics ;;
open Tcsargs;;
open Tcslist;;
open Arg ;;
open Tcstiming;;
open Paritygame ;;
open Verification ;;
open Univsolve ;;
open Solvers ;;
open Generators ;;
open Whoiswho ;;
open Pgprofiling ; ;
module CommandLine =
struct
type solver = NoSolver
| YesSolver of string * Solverregistry.global... | null | https://raw.githubusercontent.com/tcsprojects/pgsolver/b0c31a8b367c405baed961385ad645d52f648325/src/pgsolver/pgsolver.ml | ocaml | let perform_sanity_check = ref false
(["--disableuselesscycles"; "-dul"], Unit(fun _ -> univsolve_globalopt_remove_useless_self_cycles := false),
"\n disable removing useless cycles [global optimization]") ;
(["--disableusefulcycles"; "-duf"], Unit(fun ... | open Basics ;;
open Tcsargs;;
open Tcslist;;
open Arg ;;
open Tcstiming;;
open Paritygame ;;
open Verification ;;
open Univsolve ;;
open Solvers ;;
open Generators ;;
open Whoiswho ;;
open Pgprofiling ; ;
module CommandLine =
struct
type solver = NoSolver
| YesSolver of string * Solverregistry.global... |
f99ca4420cd867a4a7f6fdd7cdd033637a8311c361cd9898a34c8cd6131f1e89 | learnhaskell-brisbane/learn | week7.hs | module RelationalAlgebra (
Table
, project
, select
, cross
, join
, thetaJoin
, divideBy
, intersect
, union
-- set difference --
, (\\)
, renameTable
, renameSchema
, rename
-- some special cases --
, selectf
, cross2
, cross0
-- some display utilities --
, printTable
, showTable
-- ... | null | https://raw.githubusercontent.com/learnhaskell-brisbane/learn/4b65a2aa8998a4087708aba5cb232c35c15ef6ce/chapter7/week7.hs | haskell | set difference --
some special cases --
some display utilities --
some miscellaneous utilities --
table name
field names
record contents
Pretty print --
projection
select
Rest | module RelationalAlgebra (
Table
, project
, select
, cross
, join
, thetaJoin
, divideBy
, intersect
, union
, (\\)
, renameTable
, renameSchema
, rename
, selectf
, cross2
, cross0
, printTable
, showTable
, assocL1
, assocL2
, oneBasedIndexLookup
, adheresToSchema
, countRecords
)
whe... |
7b25c3791fa2a13fa6895dc3143ff9496f0a4efffd49d5147eff6f1cbeba485e | sinasamavati/leptus | leptus_http_SUITE.erl | Copyright ( c ) 2013 - 2018 Sina Samavati < >
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this software and associated documentation files (the "Software"), to deal
in the Software without restriction , including without limitation the rights
%% to use, copy, modify, me... | null | https://raw.githubusercontent.com/sinasamavati/leptus/e0d9bd2270dfa85bd5922e0a5c2d0289d2dc0ef9/test/leptus_http_SUITE.erl | erlang |
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions:
The above copyright notice ... | Copyright ( c ) 2013 - 2018 Sina Samavati < >
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY ... |
018c4840432d725060ce6cded009ad71b3c4db0763a4e7662ff516a4f967fda9 | yuriy-chumak/ol | vararg.scm |
(define foo (lambda x x))
(print (foo))
(print (foo 1))
(print (foo 1 2))
(define foo (lambda (a . b) (list a b)))
(print (foo 1))
(print (foo 1 2))
(print (foo 1 2 3))
;; operator position, compile time transformation
(print ((lambda (a . b) (list a b)) 11))
(print ((lambda (a . b) (list a b)) 11 22 33))
;; vari... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/83dd03d311339763682eab02cbe0c1321daa25bc/tests/vararg.scm | scheme | operator position, compile time transformation
variable arity continuations
direct variable arity calls coming from receive
( 1 )
1
( 1 )
( 1 2 )
( 1 ( 2 ) )
( 1 2 ( ) )
( 1 2 )
variable arity vs recursion
(define (foo a . b) (if (eq? a 0) b ...)) |
(define foo (lambda x x))
(print (foo))
(print (foo 1))
(print (foo 1 2))
(define foo (lambda (a . b) (list a b)))
(print (foo 1))
(print (foo 1 2))
(print (foo 1 2 3))
(print ((lambda (a . b) (list a b)) 11))
(print ((lambda (a . b) (list a b)) 11 22 33))
(define (foo) (values 11 22))
(define (bar) (values 11 22... |
5d712a7a744372de572bf0e5734b24bee22e7170e6809d2b7a87d17f4092934f | UBTECH-Walker/WalkerSimulationFor2020WAIC | SetFtOffset.lisp | ; Auto-generated. Do not edit!
(cl:in-package servo_ctrl-srv)
// ! \htmlinclude
(cl:defclass <SetFtOffset-request> (roslisp-msg-protocol:ros-message)
((ftId
:reader ftId
:initarg :ftId
:type cl:string
:initform "")
(fx
:reader fx
:initarg :fx
:type cl:integer
:initform 0)
(... | null | https://raw.githubusercontent.com/UBTECH-Walker/WalkerSimulationFor2020WAIC/7cdb21dabb8423994ba3f6021bc7934290d5faa9/walker_WAIC_18.04_v1.2_20200616/walker_install/share/common-lisp/ros/servo_ctrl/srv/SetFtOffset.lisp | lisp | Auto-generated. Do not edit!
//! \htmlinclude SetFtOffset-response.msg.html |
(cl:in-package servo_ctrl-srv)
// ! \htmlinclude
(cl:defclass <SetFtOffset-request> (roslisp-msg-protocol:ros-message)
((ftId
:reader ftId
:initarg :ftId
:type cl:string
:initform "")
(fx
:reader fx
:initarg :fx
:type cl:integer
:initform 0)
(fy
:reader fy
:initarg ... |
fd7099b4dbd0e948392a4af293f43f7204308a76c7576fcfb21d98f07655896f | acw/eve | Constellation.hs | # LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
module EVE.Constellation(
-- * The constellation data structure
Constellation
, constellationId
, constellationName
, constellationRegion
, constellationFaction
-- * Conversion to/from constellation types
... | null | https://raw.githubusercontent.com/acw/eve/95c3a158e181e9708c2f3b5d998512bbc1b06e57/src/EVE/Constellation.hs | haskell | * The constellation data structure
* Conversion to/from constellation types | # LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
module EVE.Constellation(
Constellation
, constellationId
, constellationName
, constellationRegion
, constellationFaction
, toConstellationId
, findConstellationById
, findConstellationByName
)
w... |
62b205bee3ba4e33b049ca09c73eeb4251b3c85db5bacc4a1c998099febb0f16 | haskell-compat/base-compat | Compat.hs | # LANGUAGE CPP , NoImplicitPrelude , PackageImports #
module Data.Functor.Compose.Compat (
module Base
) where
#if MIN_VERSION_base(4,9,0)
import "base-compat" Data.Functor.Compose.Compat as Base
#else
import Data.Functor.Compose as Base
#endif
| null | https://raw.githubusercontent.com/haskell-compat/base-compat/847aa35c4142f529525ffc645cd035ddb23ce8ee/base-compat-batteries/src/Data/Functor/Compose/Compat.hs | haskell | # LANGUAGE CPP , NoImplicitPrelude , PackageImports #
module Data.Functor.Compose.Compat (
module Base
) where
#if MIN_VERSION_base(4,9,0)
import "base-compat" Data.Functor.Compose.Compat as Base
#else
import Data.Functor.Compose as Base
#endif
| |
081ddf9fceaa1ebcd26e84208f968dd3e4014453ceb9387ea39da1416e261f11 | abyala/advent-2021-clojure | day23_test.clj | (ns advent-2021-clojure.day23-test
(:require [clojure.test :refer :all]
[advent-2021-clojure.day23 :refer :all]))
(def test-input [:b :a :c :d :b :c :d :a])
(def puzzle-input [:b :d :b :c :d :a :a :c])
(deftest room-exiting?-test
(let [burrow {:rooms {:a [:a :a] :b [:b :c] :c [] :d [:c :d]}}]
(is ... | null | https://raw.githubusercontent.com/abyala/advent-2021-clojure/94e5a05b144a84077cf6d33dd2f0bba96e490a5e/test/advent_2021_clojure/day23_test.clj | clojure | it takes about 100 minutes to run on the puzzle data set | (ns advent-2021-clojure.day23-test
(:require [clojure.test :refer :all]
[advent-2021-clojure.day23 :refer :all]))
(def test-input [:b :a :c :d :b :c :d :a])
(def puzzle-input [:b :d :b :c :d :a :a :c])
(deftest room-exiting?-test
(let [burrow {:rooms {:a [:a :a] :b [:b :c] :c [] :d [:c :d]}}]
(is ... |
88d1538e15ed665a39f705f93e057e491ca376e4a5db34a6a35a403d23d80fa7 | haskell-tools/haskell-tools | ExtractedFormatting.hs | module Refactor.ExtractBinding.ExtractedFormatting where
stms
= id
. id
| null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/builtin-refactorings/examples/Refactor/ExtractBinding/ExtractedFormatting.hs | haskell | module Refactor.ExtractBinding.ExtractedFormatting where
stms
= id
. id
| |
b17509c93035eee9a4e4384f7c890e690c925fbfa98e103aed49e32b05648018 | theodormoroianu/SecondYearCourses | HaskellChurchMonad_20210415160431.hs | module HaskellChurchMonad where
A boolean is any way to choose between two alternatives
newtype CBool t = CBool {cIf :: t -> t -> t}
toBool :: CBool Bool -> Bool
toBool b = cIf b True False
The boolean constant true always chooses the first alternative
cTrue :: CBool t
cTrue = CBool $ \t f -> t
The boolean consta... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/HaskellChurchMonad_20210415160431.hs | haskell | The boolean negation switches the alternatives
The boolean conjunction can be built as a conditional
The boolean disjunction can be built as a conditional
a pair is a way to compute something based on the values
contained within the pair.
a function to be applied on the values, it will apply it on them.
A natural nu... | module HaskellChurchMonad where
A boolean is any way to choose between two alternatives
newtype CBool t = CBool {cIf :: t -> t -> t}
toBool :: CBool Bool -> Bool
toBool b = cIf b True False
The boolean constant true always chooses the first alternative
cTrue :: CBool t
cTrue = CBool $ \t f -> t
The boolean consta... |
567547f784a2fb8de7c57d1a5c8e99856ed2918f68235458085b70076274db9f | didier-wenzek/ocaml-kafka | integration.ml | open Core
open Async
let main_result host port topic =
let open Deferred.Result.Let_syntax in
let rng = Random.State.make_self_init () in
let make_random_message rng =
let bit = Random.State.int rng Int.max_value in
Printf.sprintf "message %d" bit
in
let producer_options =
[ ("metadata.broker.lis... | null | https://raw.githubusercontent.com/didier-wenzek/ocaml-kafka/2f607bcf4faeb1d080f614f54070a6d9a8cd624d/test_async/integration/integration.ml | ocaml | open Core
open Async
let main_result host port topic =
let open Deferred.Result.Let_syntax in
let rng = Random.State.make_self_init () in
let make_random_message rng =
let bit = Random.State.int rng Int.max_value in
Printf.sprintf "message %d" bit
in
let producer_options =
[ ("metadata.broker.lis... | |
5edff815ba685f3adb8788db86c671d19edcfa2c9709951ab023729e0c32d698 | RileyEv/CircuitFlow | Helper.hs | # LANGUAGE ScopedTypeVariables #
module Pipeline.Network.Helper where
import Pipeline
| Helper function to create a network from the given Circuit
and then input a value and recieve the output
and then input a value and recieve the output
-}
singleInputTest
:: forall a b c d e
. (InitialPip... | null | https://raw.githubusercontent.com/RileyEv/CircuitFlow/8590c495c990811119e82760e901ba71d45aaf74/tests/Pipeline/Network/Helper.hs | haskell | # LANGUAGE ScopedTypeVariables #
module Pipeline.Network.Helper where
import Pipeline
| Helper function to create a network from the given Circuit
and then input a value and recieve the output
and then input a value and recieve the output
-}
singleInputTest
:: forall a b c d e
. (InitialPip... | |
7006cf3335a57724b99f9be2bea4f14b61458d2fa056fb440290f771dfa75726 | willowtreeapps/wombats-api | swagger.clj | (ns wombats.handlers.swagger
(:require [io.pedestal.interceptor.helpers :as interceptor]
[clojure.core.async :refer [chan go >!]]
[cheshire.core :refer [generate-string]]))
(def ^{:private true
:doc "List of handlers to be sources for api documentation"}
handlers
#{"user" "game" "a... | null | https://raw.githubusercontent.com/willowtreeapps/wombats-api/738e4cc8d7011998695ec85e663f650be71f60ae/src/wombats/handlers/swagger.clj | clojure | (ns wombats.handlers.swagger
(:require [io.pedestal.interceptor.helpers :as interceptor]
[clojure.core.async :refer [chan go >!]]
[cheshire.core :refer [generate-string]]))
(def ^{:private true
:doc "List of handlers to be sources for api documentation"}
handlers
#{"user" "game" "a... | |
1f06d008d5e26c21a3219118b92da2339d2675a3c7825158af46b78e2a8413b6 | hverr/lxdfile | String.hs | module System.LXD.LXDFile.Utils.String where
import Data.List (intercalate)
import Data.List.Split (splitOn)
replace :: Eq a => [a] -> [a] -> [a] -> [a]
replace old new = intercalate new . splitOn old
| null | https://raw.githubusercontent.com/hverr/lxdfile/16c371b3ab3aff2ebc4bb1fc7f6a7c45f0b91b01/src/System/LXD/LXDFile/Utils/String.hs | haskell | module System.LXD.LXDFile.Utils.String where
import Data.List (intercalate)
import Data.List.Split (splitOn)
replace :: Eq a => [a] -> [a] -> [a] -> [a]
replace old new = intercalate new . splitOn old
| |
6b3b1710daebd3aa1a5e721967cb79b44e46962ca0c2db808da2a1aa60c30c0e | sharplispers/cl-jpeg | package.lisp | (defpackage #:jpeg
(:use #:common-lisp)
(:nicknames #:cl-jpeg)
(:export #:encode-image
#:encode-image-stream
#:decode-stream
#:decode-image
#:jpeg-error #:jpeg-encoder-error #:jpeg-decoder-error #:unsupported-jpeg-format #:unrecognized-file-format
#:convert-cmyk-to-rgb
#:allo... | null | https://raw.githubusercontent.com/sharplispers/cl-jpeg/bef2c3bb64dd19cb31c26338dcbecbf2542a2619/package.lisp | lisp | (defpackage #:jpeg
(:use #:common-lisp)
(:nicknames #:cl-jpeg)
(:export #:encode-image
#:encode-image-stream
#:decode-stream
#:decode-image
#:jpeg-error #:jpeg-encoder-error #:jpeg-decoder-error #:unsupported-jpeg-format #:unrecognized-file-format
#:convert-cmyk-to-rgb
#:allo... | |
9f2f5c89693f06868155e73dcd2a6fb1e21fcc2fd59fb0f75ced6261d01dca4f | MinaProtocol/mina | best_tip_merger.ml | (* Accumulates the best tip history from mina-best-tip.log files and consolidates it into a rose tree representation*)
open Core
open Async
open Mina_base
module Node = struct
module T = struct
type t =
{ state : Transition_frontier.Extensions.Best_tip_diff.Log_event.t
; peer_ids : String.Set.t
... | null | https://raw.githubusercontent.com/MinaProtocol/mina/3803869b1fb03e60fbfeac31648bbfa80a7bf731/src/app/best_tip_merger/best_tip_merger.ml | ocaml | Accumulates the best tip history from mina-best-tip.log files and consolidates it into a rose tree representation
all_states: hash table of a parent block and a map of its successors
* init_states: blocks for which there are no previous blocks in the log
* peers: set of peers whose logs were processed
* seen_... |
open Core
open Async
open Mina_base
module Node = struct
module T = struct
type t =
{ state : Transition_frontier.Extensions.Best_tip_diff.Log_event.t
; peer_ids : String.Set.t
}
[@@deriving sexp, compare]
end
include T
include Comparable.Make (T)
end
module Input = struct
type t... |
983798a0d2e4bc2151b0ae4c27e95234adb00408c74da97a7d01488fc4466a12 | samply/blaze | tx_log.clj | (ns blaze.db.tx-log
"Protocols for transaction log backend implementations."
(:import
[java.lang AutoCloseable]))
(defprotocol TxLog
"The central transaction log shared between all nodes.
There might be implementations of TxLog only suitable for single node setups."
(-submit [tx-log tx-cmds local-payl... | null | https://raw.githubusercontent.com/samply/blaze/281ca0f35c845ed6e7b7f37fe2d4b9a060b065ca/modules/db-tx-log/src/blaze/db/tx_log.clj | clojure | (ns blaze.db.tx-log
"Protocols for transaction log backend implementations."
(:import
[java.lang AutoCloseable]))
(defprotocol TxLog
"The central transaction log shared between all nodes.
There might be implementations of TxLog only suitable for single node setups."
(-submit [tx-log tx-cmds local-payl... | |
404f2d57072641ec22e1e9fbee4a350558271a10ede305dce4d3284dde3fe031 | zwizwa/staapl | database.rkt | #lang racket/base
;; Database query language with pattern matching as a precursor to
Prolog & resolution .
;; Given a database of facts, construct a sequence of results in the
form of identifier bindings . In first iteration , use only ` ? ' as a
;; wildcard. Later, add bindings.
(require "choice.rkt"
... | null | https://raw.githubusercontent.com/zwizwa/staapl/e30e6ae6ac45de7141b97ad3cebf9b5a51bcda52/machine/database.rkt | racket | Database query language with pattern matching as a precursor to
Given a database of facts, construct a sequence of results in the
wildcard. Later, add bindings.
using `quote' to separate literal symbols from variables
(define-syntax (with-pattern p)
(define-syntax-rule (for-pattern pat . body)
((db-query 'pat... | #lang racket/base
Prolog & resolution .
form of identifier bindings . In first iteration , use only ` ? ' as a
(require "choice.rkt"
"unify.rkt"
"fail.rkt"
"enum.rkt")
( define ( variable ? )
( eq ? # \ ? ( string - ref ( ) 0 ) ) )
(define facts
(list->enum '((raining)
... |
974775e41b29a5a22cf5696ba84a725b23da91069d22496d5db74542ce0fa05d | pfdietz/ansi-test | min.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Mon Aug 4 21:24:45 2003
;;;; Contains: Tests of MIN
(deftest min.error.1
(signals-error (min) program-error)
t)
(deftest min.error.2
(check-type-error #'min #'realp)
nil)
(deftest min.error.3
(check-type-error #'(lambda (x) (min 0 x)) #'realp)
n... | null | https://raw.githubusercontent.com/pfdietz/ansi-test/3f4b9d31c3408114f0467eaeca4fd13b28e2ce31/numbers/min.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of MIN | Author :
Created : Mon Aug 4 21:24:45 2003
(deftest min.error.1
(signals-error (min) program-error)
t)
(deftest min.error.2
(check-type-error #'min #'realp)
nil)
(deftest min.error.3
(check-type-error #'(lambda (x) (min 0 x)) #'realp)
nil)
(deftest min.1
(loop for n in *reals*
... |
c82cddc5243805f3ba42500a47ff01a231d514b0f23408aea4ae9355d0c8cc7f | yallop/ocaml-ctypes | ctypes_coerce.mli |
* Copyright ( c ) 2013 .
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2013 Jeremy Yallop.
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*)
type uncoercible_info
except... | null | https://raw.githubusercontent.com/yallop/ocaml-ctypes/52ff621f47dbc1ee5a90c30af0ae0474549946b4/src/ctypes/ctypes_coerce.mli | ocaml |
* Copyright ( c ) 2013 .
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2013 Jeremy Yallop.
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*)
type uncoercible_info
except... | |
37414eade3557b3a499ef0d2092314e04b51a5ddc76d50576635cd1a9d1247e2 | pa-ba/compdata | Derive.hs | # LANGUAGE TemplateHaskell #
--------------------------------------------------------------------------------
-- |
-- Module : Data.Comp.Multi.Derive
Copyright : ( c ) 2010 - 2011
-- License : BSD3
Maintainer : < >
-- Stability : experimental
Portability : non - portable ( GHC Extens... | null | https://raw.githubusercontent.com/pa-ba/compdata/5783d0e11129097e045cabba61643114b154e3f2/src/Data/Comp/Multi/Derive.hs | haskell | ------------------------------------------------------------------------------
|
Module : Data.Comp.Multi.Derive
License : BSD3
Stability : experimental
This module contains functionality for automatically deriving boilerplate
------------------------------------------------------------------------... | # LANGUAGE TemplateHaskell #
Copyright : ( c ) 2010 - 2011
Maintainer : < >
Portability : non - portable ( GHC Extensions )
code using Template Haskell . Examples include instances of ' HFunctor ' ,
' HFoldable ' , and ' HTraversable ' .
module Data.Comp.Multi.Derive
(
derive,
... |
4f948ef8d4b4a06c9e081565017845c7caee916cae5d14e41da2a3a4a05958a5 | mtesseract/nakadi-client | Test.hs | {-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE TypeSynonymInstances #-}
module Network.Nakadi.MonadicAPI.Test where
import ClassyPrelude
import Control.Lens
import Control.Monad.Logger
import Control.M... | null | https://raw.githubusercontent.com/mtesseract/nakadi-client/f8eef3ac215459081b01b0b48f0b430ae7701f52/tests/Network/Nakadi/MonadicAPI/Test.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeSynonymInstances #
Required for consuming via subscription API is the ability to
We can retrieve the configuration using nakadiAsk:
| This tests the verbose but more general method of seperating
runNakadiBaseT from runNakadiT, changing the monad transformer
'HasNa... | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Network.Nakadi.MonadicAPI.Test where
import ClassyPrelude
import Control.Lens
import Control.Monad.Logger
import Control.Monad.State.Strict
import Control.Monad.Trans.Resource
import ... |
76423285f8e12f6280fc5e4cc6be5488a1617a195bc9696cf6665e8fb3fc45f5 | fare/lisp-interface-library | monad.lisp | ;;; Interface Passing Style : Monad
(defpackage :lil/interface/monad
(:documentation
"This package is the <MONAD> interface.
It contains and exports:
<MONAD>
RESULT
BIND
FAIL
MLET*")
(:use :cl)
(:import-from :lil/core #:define-interface #:with-interface)
(:import-from :lil/interface/base #:<type>)
(:ex... | null | https://raw.githubusercontent.com/fare/lisp-interface-library/ac2e0063dc65feb805f0c57715d52fda28d4dcd8/interface/monad.lisp | lisp | Interface Passing Style : Monad
The LIFT-FUNCTION is required for Interface Passing Style :
(WITH-INTERFACE (<LIST> <LIST>) |
(defpackage :lil/interface/monad
(:documentation
"This package is the <MONAD> interface.
It contains and exports:
<MONAD>
RESULT
BIND
FAIL
MLET*")
(:use :cl)
(:import-from :lil/core #:define-interface #:with-interface)
(:import-from :lil/interface/base #:<type>)
(:export
#:<monad>
#:result
#:b... |
441c235eecb26e44635f037edd8ac47ec0fb1a6d7d3a01af93ef35fd0ed6ef0f | powernoodle/cljc-normalize | project.clj | (defproject com.powernoodle/normalize "8.0.1"
:description "Clojure library that supplies normalize.css via Garden"
:url "-normalize"
:license {:name "Copyright"
:url ""}
:dependencies [[org.clojure/clojure "1.8.0"]
[garden "1.3.2"]]
:main normalize.core)
| null | https://raw.githubusercontent.com/powernoodle/cljc-normalize/c393bd515ed80327fee303ebcfc0ffb946cdb41f/project.clj | clojure | (defproject com.powernoodle/normalize "8.0.1"
:description "Clojure library that supplies normalize.css via Garden"
:url "-normalize"
:license {:name "Copyright"
:url ""}
:dependencies [[org.clojure/clojure "1.8.0"]
[garden "1.3.2"]]
:main normalize.core)
| |
fc2d6f4bf32bdd2f66867e5ed27e254daa43112a4d78ee57cbd62760c7aea3a2 | Chimrod/i3_workspaces | configuration.ml | type t = Inifiles.inifile
(** Regex for extracting the variables parameters in configuration file *)
let param = Str.regexp {|\${.+}|}
let load_or_global conf section field = begin
let local_value = try (conf#getaval section field) with
| Inifiles.Invalid_element _
| Inifiles.Invalid_section _ -> []
and glob... | null | https://raw.githubusercontent.com/Chimrod/i3_workspaces/70ecefd1b469de40c335f20c9b7942b6e6c533b7/src/configuration/configuration.ml | ocaml | * Regex for extracting the variables parameters in configuration file
* Prevent infinite looping
Remove the ${ } around the text
This should occur only in startup
* Load the value from the Configuration
If the key does not exist, look for the global section
* Check the whole configuration to ensure that each v... | type t = Inifiles.inifile
let param = Str.regexp {|\${.+}|}
let load_or_global conf section field = begin
let local_value = try (conf#getaval section field) with
| Inifiles.Invalid_element _
| Inifiles.Invalid_section _ -> []
and global_value = try (conf#getaval "global" field) with
| Inifiles.Invalid_elem... |
2029b2bb613c508e19dba9a1b23217ec96bd3713bf45384d0f8e3eb3275733be | helins/maestro.clj | cp.clj | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns helins.maestro.cp
"Working with the classpath."
{:author "Adam Helinski"}
(:refer-clojure :exclude [print])
(:require [babashka... | null | https://raw.githubusercontent.com/helins/maestro.clj/994efc50744466ad6175ff6a3b4c944375102f4c/project/core/src/main/helins/maestro/cp.clj | clojure | Helpers
Tasks | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns helins.maestro.cp
"Working with the classpath."
{:author "Adam Helinski"}
(:refer-clojure :exclude [print])
(:require [babashka... |
1fa975ba0108eb84168ac25fafa81a9a7f6520e65f69f3deba08d27d64dcec97 | ulfsauer0815/ghmm | Aeson.hs | # OPTIONS_GHC -fno - warn - orphans #
module Servant.Client.Aeson where
import Data.Aeson
import Data.Aeson.Types
import qualified Data.Text as T
import Servant.Client (BaseUrl, parseBaseUrl)
-- ----------------------------------------------
instance FromJSON BaseUrl where
... | null | https://raw.githubusercontent.com/ulfsauer0815/ghmm/fc81948316156c67f6af9fe08a8a49472e9a42b8/src/Servant/Client/Aeson.hs | haskell | ---------------------------------------------- | # OPTIONS_GHC -fno - warn - orphans #
module Servant.Client.Aeson where
import Data.Aeson
import Data.Aeson.Types
import qualified Data.Text as T
import Servant.Client (BaseUrl, parseBaseUrl)
instance FromJSON BaseUrl where
parseJSON (String s) = case parseBaseUrl $ T.unpac... |
122b3bcfafd8d5a4bf255c86e0de87ad167893231171e36594c01b530082f45c | victornicolet/parsynt | SymbExe.ml | open Base
open Fmt
open Lang.AcTerm
open Lang.SolutionDescriptors
open Lang.ResourceModel
open Lang.Term
open Lang.TermPp
open Lang.Typ
open Lang.Unfold
open Solve.SolverForms
open Utils
let allow_nonlinear = ref false
type unfoldings_result = {
state_record_var : VarSet.t;
(* Variable used as record in the unfol... | null | https://raw.githubusercontent.com/victornicolet/parsynt/d3f530923c0c75537b92c2930eb882921f38268c/src/recursion/SymbExe.ml | ocaml | Variable used as record in the unfoldings.
Symbolic vars used as starting state of unfoldings.
The unfoldings ( a list of unfolding)
A solver initialized with all symbols.
Return type of the function, used for projection.
Create finite list of input symbols.
if !verbose then
Log.progress (fu... | open Base
open Fmt
open Lang.AcTerm
open Lang.SolutionDescriptors
open Lang.ResourceModel
open Lang.Term
open Lang.TermPp
open Lang.Typ
open Lang.Unfold
open Solve.SolverForms
open Utils
let allow_nonlinear = ref false
type unfoldings_result = {
state_record_var : VarSet.t;
init_as_resource : resource list;
unf... |
aded80a9d3c8ea82502352882ea6aff97ed302ccd4c141da262e05dd1382f754 | mirage/mirage-console-solo5 | console_solo5.mli |
* Copyright ( c ) 2010 - 2013 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVID... | null | https://raw.githubusercontent.com/mirage/mirage-console-solo5/48e68b7f23176dc534bd693eda10739f2e8a392d/src/console_solo5.mli | ocaml | * Text console input/output operations. |
* Copyright ( c ) 2010 - 2013 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVID... |
e7567b5cf7e3a98a14db42cb8ec6fc833e490b63ffed64c466b4f422e6eec9e1 | jdan/ocaml-data-structures | trie.ml | Trie !
(* NOTE: For now we'll encode strings to 'a, but a good thought exercise
would be to paramterize the type of thing we want to encode *)
type 'a t = Trie of ('a option) * ((char * 'a t) list)
let root = Trie (None, [])
let rec trie_from_char_list s value = match s with
| [] -> Trie (Some value, [])
| ... | null | https://raw.githubusercontent.com/jdan/ocaml-data-structures/b27e0c4fd8997900b5852a110a971f00ce3e922c/src/trie.ml | ocaml | NOTE: For now we'll encode strings to 'a, but a good thought exercise
would be to paramterize the type of thing we want to encode
assoc, but we return the other stuff too
assign our value to the node
Prepend a new trie from our string to the children
Pass the rest of the string to the child, building a new ... | Trie !
type 'a t = Trie of ('a option) * ((char * 'a t) list)
let root = Trie (None, [])
let rec trie_from_char_list s value = match s with
| [] -> Trie (Some value, [])
| ch :: rest -> Trie (None, [(ch, trie_from_char_list rest value)])
let assoc pairs key =
let rec inner pairs acc = match pairs with
|... |
1efd69f01e9715ab380545b3aa50a52e680db6c5d0e54b63c6fc6438e14fa083 | monadbobo/ocaml-core | sound.ml | open Jane.Std
open Async.Std
module Sound = Async_extended.Std.Sound (* so omake isn't confused about a circular dependency *)
let () = upon (Sound.play Sound.default) (fun () -> shutdown 0)
let () = never_returns (Scheduler.go ())
| null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/async/examples/sound.ml | ocaml | so omake isn't confused about a circular dependency | open Jane.Std
open Async.Std
let () = upon (Sound.play Sound.default) (fun () -> shutdown 0)
let () = never_returns (Scheduler.go ())
|
10c2eb9ad4b960e9f301725e83e41f25122a8612bf8463a19b98562b009bce11 | Octachron/codept | approx_parser.mli | * Approximate parser for non - syntactically valid files .
Heuristic : try to detect
- open Module_path
- include Module_path
- Module_path . not module identifier
- module M
and match them to the corresponding toplevel structure item .
As a consequence , the set of bound modules at... | null | https://raw.githubusercontent.com/Octachron/codept/2d2a95fde3f67cdd0f5a1b68d8b8b47aefef9290/lib/approx_parser.mli | ocaml | * parse the lower_bound (* for dependency
* Conver a lower dependencies bound ast to an upper dependencencies bound
by removing binding, and simplyfing open and includes.
* [file filename] yields [module_name × lower bound × upper bound] | * Approximate parser for non - syntactically valid files .
Heuristic : try to detect
- open Module_path
- include Module_path
- Module_path . not module identifier
- module M
and match them to the corresponding toplevel structure item .
As a consequence , the set of bound modules at... |
24497d717c9aa075a99c14b6410b3c3c02eead82404ebf552d567d7c9389540b | acl2/acl2 | function-environments@useless-runes.lsp | (C::FUN-INFOP
(728 56 (:REWRITE OMAP::ALISTP-WHEN-MAPP))
(280 56 (:REWRITE OMAP::MFIX-IMPLIES-MAPP))
(280 56 (:REWRITE OMAP::MAPP-WHEN-NOT-EMPTY))
(270 260 (:REWRITE DEFAULT-CDR))
(238 228 (:REWRITE DEFAULT-CAR))
(224 224 (:TYPE-PRESCRIPTION OMAP::MAPP))
(112 112 (:TYPE-PRESCRIPTION OMAP::MFIX))
(112 112 (:TYPE... | null | https://raw.githubusercontent.com/acl2/acl2/f64742cc6d41c35f9d3f94e154cd5fd409105d34/books/kestrel/c/language/.sys/function-environments%40useless-runes.lsp | lisp | (C::FUN-INFOP
(728 56 (:REWRITE OMAP::ALISTP-WHEN-MAPP))
(280 56 (:REWRITE OMAP::MFIX-IMPLIES-MAPP))
(280 56 (:REWRITE OMAP::MAPP-WHEN-NOT-EMPTY))
(270 260 (:REWRITE DEFAULT-CDR))
(238 228 (:REWRITE DEFAULT-CAR))
(224 224 (:TYPE-PRESCRIPTION OMAP::MAPP))
(112 112 (:TYPE-PRESCRIPTION OMAP::MFIX))
(112 112 (:TYPE... | |
73bd9440d60bbde4eab21097cd62c8bac6b70dc7c4c64e2c6a8cab08022f9caf | MastodonC/kixi.datastore | time.clj | (ns kixi.datastore.metadatastore.time
(:require [clojure.spec.alpha :as s]
[kixi.datastore.schemastore.conformers :as sc]))
(s/def ::from (s/nilable sc/date))
(s/def ::to (s/nilable sc/date))
(s/def ::temporal-coverage
(s/keys :opt [::from ::to]))
| null | https://raw.githubusercontent.com/MastodonC/kixi.datastore/f33bba4b1fdd8c56cc7ac0f559ffe35254c9ca99/src/kixi/datastore/metadatastore/time.clj | clojure | (ns kixi.datastore.metadatastore.time
(:require [clojure.spec.alpha :as s]
[kixi.datastore.schemastore.conformers :as sc]))
(s/def ::from (s/nilable sc/date))
(s/def ::to (s/nilable sc/date))
(s/def ::temporal-coverage
(s/keys :opt [::from ::to]))
| |
93ae425b18d916c4c0bbb3bf6babb703aaba6540b6b4c1c0d68b255d98ec395c | sheepduke/silver-brain | packages.lisp | (defpackage silver-brain-tests.core
(:use #:cl #:rove #:silver-brain.core))
(defpackage silver-brain-tests.server
(:use #:cl #:alexandria #:trivia #:rove #:silver-brain.core)
(:import-from #:drakma
#:http-request))
(defpackage silver-brain-tests.service
(:use #:cl #:alexandria #:trivia #:rove ... | null | https://raw.githubusercontent.com/sheepduke/silver-brain/9d088bcd30948decc174f3569e2ad7bc0b3b50c1/backend/tests/packages.lisp | lisp | (defpackage silver-brain-tests.core
(:use #:cl #:rove #:silver-brain.core))
(defpackage silver-brain-tests.server
(:use #:cl #:alexandria #:trivia #:rove #:silver-brain.core)
(:import-from #:drakma
#:http-request))
(defpackage silver-brain-tests.service
(:use #:cl #:alexandria #:trivia #:rove ... | |
e4d3119db71073add7fe49afac3d47c12bc1c8e116d586e08d9b000442ac8d78 | borkdude/spartan.spec | spec_test.clj | (ns spartan.spec-test
(:require
[clojure.string :as str]
[clojure.test :as t :refer [deftest is testing]]))
(require 'spartan.spec) ;; side effect
(require '[clojure.spec.alpha :as s])
(deftest pred-test
(is (= 1 (s/conform int? 1)))
(is (s/invalid? (s/conform string? 1)))
(is (= "--opts" (s/conform #... | null | https://raw.githubusercontent.com/borkdude/spartan.spec/12947185b4f8b8ff8ee3bc0f19c98dbde54d4c90/test/spartan/spec_test.clj | clojure | side effect | (ns spartan.spec-test
(:require
[clojure.string :as str]
[clojure.test :as t :refer [deftest is testing]]))
(require '[clojure.spec.alpha :as s])
(deftest pred-test
(is (= 1 (s/conform int? 1)))
(is (s/invalid? (s/conform string? 1)))
(is (= "--opts" (s/conform #{"--opts"} "--opts")))
(is (= "\"foo\... |
2c61f3c7f056b15892bfe14011148c38950560b89acab4e24d4d85b95bb52be3 | meta-ex/ignite | samples.clj | (ns meta-ex.sets.samples
(:use [overtone.live]
[meta-ex.kit.mixer]
[meta-ex.kit.sampler]
))
(defonce electro-hiss (freesound 181490))
(defonce snake-hiss (freesound 146963))
(defonce animal-hiss (freesound 154636))
(defonce echo-hiss (freesound 187944))
(defonce tardis-like (freesound 202663))
(defon... | null | https://raw.githubusercontent.com/meta-ex/ignite/b9b1ed7ae2fa01d017c23febabb714a6389a98dd/src/meta_ex/sets/samples.clj | clojure | untested | (ns meta-ex.sets.samples
(:use [overtone.live]
[meta-ex.kit.mixer]
[meta-ex.kit.sampler]
))
(defonce electro-hiss (freesound 181490))
(defonce snake-hiss (freesound 146963))
(defonce animal-hiss (freesound 154636))
(defonce echo-hiss (freesound 187944))
(defonce tardis-like (freesound 202663))
(defon... |
0656f5e2e29f1cf708b0bb4589339e2c930bd03a1d391b6504a215e4ea08fa66 | zippy/anansi | contact.clj | (ns
#^{:author "Eric Harris-Braun"
:doc "Contact receptor"}
anansi.streamscapes.contact
(:use [anansi.ceptr]
[anansi.receptor.scape]
))
(def contact-def (receptor-def "contact" (attributes :name)))
| null | https://raw.githubusercontent.com/zippy/anansi/881aa279e5e7836f3002fc2ef7623f2ee1860c9a/src/anansi/streamscapes/contact.clj | clojure | (ns
#^{:author "Eric Harris-Braun"
:doc "Contact receptor"}
anansi.streamscapes.contact
(:use [anansi.ceptr]
[anansi.receptor.scape]
))
(def contact-def (receptor-def "contact" (attributes :name)))
| |
a6d8b189f31354473a1b1d80c5b1cb3aaafbd2d3360df127bfdce4e56257b517 | footprintanalytics/footprint-web | client_test.clj | (ns metabase.driver.druid.client-test
(:require [clojure.core.async :as a]
[clojure.test :refer :all]
[metabase.driver.druid.client :as druid.client]
[metabase.driver.util :as driver.u]
[metabase.query-processor :as qp]
[metabase.query-processor.context.defa... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/modules/drivers/druid/test/metabase/driver/druid/client_test.clj | clojure | wait for query to start running, then close `out-chan`
we want to use a bogus port here on purpose -
so that locally, it gets a ConnectionRefused, | (ns metabase.driver.druid.client-test
(:require [clojure.core.async :as a]
[clojure.test :refer :all]
[metabase.driver.druid.client :as druid.client]
[metabase.driver.util :as driver.u]
[metabase.query-processor :as qp]
[metabase.query-processor.context.defa... |
a32d9649051199b5093a6d294297096eb1de2f91d23cc8dac25144e64a3ad7c9 | zwizwa/rai | exp.rkt | #lang racket/base
(define (run P0 P1 n #:exp [exp exp])
(let* ((q (exp (/ (- P1 P0) n)))
(p0 (exp P0))
(p1 (for/fold ((p p0))
((i (in-range n)))
(* p q))))
(values p1 (exp P1))))
;; Evaluate approximation error for exp approximation.
(define (error P0 P1 ... | null | https://raw.githubusercontent.com/zwizwa/rai/6bcacb7da4172971816027fd88a0209adbd60e30/exp.rkt | racket | Evaluate approximation error for exp approximation.
exp Taylor series
Test | #lang racket/base
(define (run P0 P1 n #:exp [exp exp])
(let* ((q (exp (/ (- P1 P0) n)))
(p0 (exp P0))
(p1 (for/fold ((p p0))
((i (in-range n)))
(* p q))))
(values p1 (exp P1))))
(define (error P0 P1 n)
(lambda (exp)
(- (expt (exp (/ (- P1 P0) n)) n... |
c4f64a0072c74cc358c2b57ee2f268eec7c160575a6cb361eda86d1260607fac | danielmiladinov/joy-of-clojure | the_dotdot_macro.clj | ;; The .. macro
;; ---------------------------------------------------------------------------------------------------------------------
When working with Java , it 's common practice to chain together a sequence of method calls on the return type of the
;; previous method call:
;; new java.util.Date().toString().en... | null | https://raw.githubusercontent.com/danielmiladinov/joy-of-clojure/cad7d1851e153beb12a2cd536eb467be12cb7a73/src/joy-of-clojure/chapter2/the_dotdot_macro.clj | clojure | The .. macro
---------------------------------------------------------------------------------------------------------------------
previous method call:
new java.util.Date().toString().endsWith("2014")" /* Java code */
=> true
Although correct, the preceding code is difficult to read and will only become more so w... | When working with Java , it 's common practice to chain together a sequence of method calls on the return type of the
Using Clojure 's dot special operator , the following code is equivalent :
Clojure code
( Depending on when you run this code , you may get false as the answer . To fix that , change the strin... |
64022fb2e02ce470920644f61e4a5d22bdc215e6c274cc497089650ea7cc6c19 | craff/pacomb | calc_prio.ml | open Pacomb
This example ( read calc.ml first ) illustrates another way to handle
priorities with parametric grammars .
priorities with parametric grammars. *)
The three levels of priorities
type p = Atom | Prod | Sum
let string_of_prio = function
| Atom -> "A"
| Prod -> "P"
| Su... | null | https://raw.githubusercontent.com/craff/pacomb/3e83f56bc483f6b9c495ae91d773aa9b484eb321/examples/calc_prio.ml | ocaml | for printing, we provide a function to convert priorities to string
all other rule are selected by their priority level
parsing command line arguments, illustrating grammar printing
blanks
initial prompt | open Pacomb
This example ( read calc.ml first ) illustrates another way to handle
priorities with parametric grammars .
priorities with parametric grammars. *)
The three levels of priorities
type p = Atom | Prod | Sum
let string_of_prio = function
| Atom -> "A"
| Prod -> "P"
| Su... |
183c3022d4626010d5e4b0cfb3f8defde39c78667d38c8852dad3650e475bfe6 | OCamlPro/drom | license.ml | (**************************************************************************)
(* *)
Copyright 2020 OCamlPro & Origin Labs
(* *)
(* All rights ... | null | https://raw.githubusercontent.com/OCamlPro/drom/dbbb5f9225df65c589e6f307ac28be4c408b9cae/src/drom_lib/license.ml | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2020 OCamlPro & Origin Labs
GNU Lesser General Public License version 2.1 , with the special
open EzCompat
open Types
open Ez_file.V1
open EzFile.OP
Most used licenses in the opam repository :
117 license : " GPL-3.0 - only "
122 license : " LGPL-2... |
3b0770ca40323fe680bb81fb819d5d7dadd93de1b8ec797961d4ff8078a2f792 | ndmitchell/catch | Draw.hs |
module Graph.Draw(drawGraph) where
import Graph.Type
import Graph.Show
import System
drawGraph :: Graph -> FilePath -> IO ()
drawGraph graph file = do writeFile (file ++ ".dot") (showGraph graph)
system $ "dot " ++ file ++ ".dot -Tsvg -Grankdir=LR -Gdpi=70.0 > " ++ file ++ ".svg"... | null | https://raw.githubusercontent.com/ndmitchell/catch/5d834416a27b4df3f7ce7830c4757d4505aaf96e/src/Graph/Draw.hs | haskell |
module Graph.Draw(drawGraph) where
import Graph.Type
import Graph.Show
import System
drawGraph :: Graph -> FilePath -> IO ()
drawGraph graph file = do writeFile (file ++ ".dot") (showGraph graph)
system $ "dot " ++ file ++ ".dot -Tsvg -Grankdir=LR -Gdpi=70.0 > " ++ file ++ ".svg"... | |
647bb5a51ac7098500eef4c639fc25cda0ad07b8aa8918ae24a5598a0c9fce63 | openvnf/kube-vxlan-controller | kube_vxlan_controller_pod_reg.erl | -module(kube_vxlan_controller_pod_reg).
-behaviour(regine_server).
%% API
-export([start_link/0]).
-export([register/2, unregister/1, lookup/1, set/2, unset/1]).
-export([process_event/3, clear/0, all/0, all/1]).
%% regine_server callbacks
-export([init/1, handle_register/4, handle_unregister/3, handle_pid_remove/3,... | null | https://raw.githubusercontent.com/openvnf/kube-vxlan-controller/1b222f1c872a77aae1adfc6fb0bfc22bfd174223/src/kube_vxlan_controller_pod_reg.erl | erlang | API
regine_server callbacks
--------------------------------------------------------------------
Include files
--------------------------------------------------------------------
===================================================================
API
==============================================================... | -module(kube_vxlan_controller_pod_reg).
-behaviour(regine_server).
-export([start_link/0]).
-export([register/2, unregister/1, lookup/1, set/2, unset/1]).
-export([process_event/3, clear/0, all/0, all/1]).
-export([init/1, handle_register/4, handle_unregister/3, handle_pid_remove/3,
handle_death/3, handle_call/3, ... |
93902de513079c0216f676b22367a3bb5fdff6463b38dd1f7174e336306d5745 | jasonkuhrt-archive/hpfp-answers | ReaderMonad.hs | # LANGUAGE InstanceSigs #
module ReaderMonad where
{-# ANN module "HLint: ignore Avoid lambda" #-}
-- 1 Implement the Reader Monad
newtype Reader a b =
Reader { runReader :: a -> b }
instance Functor (Reader r) where
fmap :: (a -> b) -> Reader r a -> Reader r b
fmap g (Reader f) = Reader (\r -> g (f r))
i... | null | https://raw.githubusercontent.com/jasonkuhrt-archive/hpfp-answers/c03ae936f208cfa3ca1eb0e720a5527cebe4c034/chapter-22-reader/ReaderMonad.hs | haskell | # ANN module "HLint: ignore Avoid lambda" #
1 Implement the Reader Monad | # LANGUAGE InstanceSigs #
module ReaderMonad where
newtype Reader a b =
Reader { runReader :: a -> b }
instance Functor (Reader r) where
fmap :: (a -> b) -> Reader r a -> Reader r b
fmap g (Reader f) = Reader (\r -> g (f r))
instance Applicative (Reader r) where
pure :: a -> Reader r a
pure b = Reader... |
655ba9cef3becbfda8cf0181f278de1d775475b4f15a1e3a4294f1499b0b7f47 | pyr/net | chunk.clj | (ns net.http.chunk
(:require [net.ty.buffer :as buf]
[net.ty.channel :as chan]
[net.http :as http]
[net.ty.future :as f]
[clojure.core.async :as a]
[net.core.async :refer [put! close-draining]])
(:import io.netty.buffer.Unpooled... | null | https://raw.githubusercontent.com/pyr/net/a2120bf61b6fd480707ea6b217545b3d640288d0/src/net/http/chunk.clj | clojure | read from a body.
meaning that a payload can be read from the body channel and sent-out
re-using the same listener for completion. If no chunk could be read
from the body channel, close the channel.
When called with an actual future, apply the same logic, re-using the listener
up to the point where no more chun... | (ns net.http.chunk
(:require [net.ty.buffer :as buf]
[net.ty.channel :as chan]
[net.http :as http]
[net.ty.future :as f]
[clojure.core.async :as a]
[net.core.async :refer [put! close-draining]])
(:import io.netty.buffer.Unpooled... |
60424d1476a77c12d707653d60c695d016e0d89d09c02fc91e0241be7ea7d03d | texodus/forml | Inline.hs |
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
{-# LANGUAGE GADTs #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverlappingInstances #
{-# LANGUAGE Qu... | null | https://raw.githubusercontent.com/texodus/forml/aca10b060face7dcff6fce04909097f3849c104e/src/hs/lib/Forml/Optimize/Inline.hs | haskell | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE GADTs #
# LANGUAGE QuasiQuotes #
# LANGUAGE RankNTypes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeSynonymInstances #
Closure fix - advanced mode nuk... |
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverlappingInstances #
# LANGUAGE RecordWildCards #
# LANGUAGE UndecidableInstances #
module Forml.Optimize.Inline (inline_apply, Inlines, Inline,... |
8073b603707e876c36062d243c148869c7b2e83d69ddb6a5f49a3f8b20070297 | jlouis/etorrent_core | etorrent_tracker.erl | -module(etorrent_tracker).
-behaviour(gen_server).
%% API
-export([start_link/0,
register_torrent/3,
statechange/2,
all/0,
lookup/1,
get_url_tiers/1,
all_torrent_and_tracker_ids/0,
is_trackerless/1]).
-export([init/1, handle_call/3, handle_cast/2, code_ch... | null | https://raw.githubusercontent.com/jlouis/etorrent_core/7db7f4ef36c1d055812504f00df92c6a67c2e4af/src/etorrent_tracker.erl | erlang | API
It will be changed before connection.
It will be changed after success connection.
====================================================================
@doc Start the `gen_server' governor.
@end
@doc Called from tracker communication server per torrent.
@doc Return all torrents, sorted by Id
@end
@doc Req... | -module(etorrent_tracker).
-behaviour(gen_server).
-export([start_link/0,
register_torrent/3,
statechange/2,
all/0,
lookup/1,
get_url_tiers/1,
all_torrent_and_tracker_ids/0,
is_trackerless/1]).
-export([init/1, handle_call/3, handle_cast/2, code_change/3,... |
a0d058587b577c0bb4cd2ae9fa5de4f116ea14ebb5d01274ec30b1f210f5ea4e | racket/racket7 | collection-name.rkt | #lang racket/base
(require rackunit
setup/collection-name)
(check-equal? #t (collection-name-element? "racket"))
(check-equal? #t (collection-name-element? "racket%21"))
(check-equal? #f (collection-name-element? "racket.rkt"))
(check-equal? #f (collection-name-element? "racket!"))
(check-equal? #f (collectio... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/pkgs/racket-test/tests/racket/collection-name.rkt | racket | #lang racket/base
(require rackunit
setup/collection-name)
(check-equal? #t (collection-name-element? "racket"))
(check-equal? #t (collection-name-element? "racket%21"))
(check-equal? #f (collection-name-element? "racket.rkt"))
(check-equal? #f (collection-name-element? "racket!"))
(check-equal? #f (collectio... | |
0eaac630c73468d17b1ac9e83741faf946631c574a64698583ef5a3c9119d142 | haskell/cabal | Component.hs | # LANGUAGE DeriveGeneric #
module Distribution.Types.Component (
Component(..),
foldComponent,
componentBuildInfo,
componentBuildable,
componentName,
partitionComponents,
) where
import Prelude ()
import Distribution.Compat.Prelude
import Distribution.Types.Library
import Distribution.Types.F... | null | https://raw.githubusercontent.com/haskell/cabal/0abbe37187f708e0a5daac8d388167f72ca0db7e/Cabal-syntax/src/Distribution/Types/Component.hs | haskell | | Is a component buildable (i.e., not marked with @buildable: False@)?
See also this note in
"Distribution.Types.ComponentRequestedSpec#buildable_vs_enabled_components".
| # LANGUAGE DeriveGeneric #
module Distribution.Types.Component (
Component(..),
foldComponent,
componentBuildInfo,
componentBuildable,
componentName,
partitionComponents,
) where
import Prelude ()
import Distribution.Compat.Prelude
import Distribution.Types.Library
import Distribution.Types.F... |
bc73198a8fcfc9b962543828668366d43137e9fa09ba3163ac9f0c2fbb2246ed | kadena-io/chainweaver | Impl.hs | # LANGUAGE DataKinds #
# LANGUAGE ExtendedDefaultRules #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecursiveDo #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE NoImplicitPrelude #
This allows us ... | null | https://raw.githubusercontent.com/kadena-io/chainweaver/5d40e91411995e0a9a7e782d6bb2d89ac1c65d52/frontend/src/Frontend/UI/Modal/Impl.hs | haskell | # LANGUAGE OverloadedStrings #
|
License : BSD-style (see the file LICENSE)
* Types
* Show it
* Build it
required for the vertical scrollbar.
Account for the differing widths of scroll bars.
Reset the padding back now that the scrollbar might be back.
We can't use jsaddle to set the stopPropagation hand... | # LANGUAGE DataKinds #
# LANGUAGE ExtendedDefaultRules #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecursiveDo #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE NoImplicitPrelude #
This allows us to more easily use JSaddle without ... |
76f771479c3f99f335647d0e27983ed5f8523757acf5b9767a5f5a0005763a81 | DSLsofMath/DSLsofMath | Signal.hs | -- | A very simple library for manipulating continuous signals.
module Signal
( module SignalImpl
, module Signal
, module Control.Applicative
) where
import Control.Applicative
-- Alternative implementation:
> import Signal . Shallow as SignalImpl
import Signal.Deep as SignalImpl
-- | 'Signal' is an applic... | null | https://raw.githubusercontent.com/DSLsofMath/DSLsofMath/216464afda03c54709fae39e626ca19e8053444e/L/04/DSL/src/Signal.hs | haskell | | A very simple library for manipulating continuous signals.
Alternative implementation:
| 'Signal' is an applicative functor | module Signal
( module SignalImpl
, module Signal
, module Control.Applicative
) where
import Control.Applicative
> import Signal . Shallow as SignalImpl
import Signal.Deep as SignalImpl
instance Functor Signal where
fmap = mapS
instance Applicative Signal where
pure = constS
(<*>) = ($$)
|
6865c637dc2780ffc90130cdfaaf02fd89a33098aaf850a01b0ceda943d8b888 | Smoltbob/Caml-Est-Belle | tf2param.ml | let rec f a b = a + b in ()
| null | https://raw.githubusercontent.com/Smoltbob/Caml-Est-Belle/3d6f53d4e8e01bbae57a0a402b7c0f02f4ed767c/frontend/tests/tf2param.ml | ocaml | let rec f a b = a + b in ()
| |
0e70ca3907d7b4e8cec2cfc3f46ecdccebaab83a9dcf399f0169f37cdb5891ce | obsidiansystems/gargoyle | gargoyle-psql-test.hs | module Main where
import System.Directory
import System.Exit
import System.FilePath
import System.Posix.Temp
import Gargoyle
import Gargoyle.PostgreSQL
main :: IO ()
main = do
let testPostgres = defaultPostgres
{ _gargoyle_exec = "dist/build" </> "gargoyle-postgres-monitor/gargoyle-postgres-monitor"
... | null | https://raw.githubusercontent.com/obsidiansystems/gargoyle/df0068f9572c1371bed7aa416af84d462c3574c0/gargoyle-postgresql/tests/gargoyle-psql-test.hs | haskell | module Main where
import System.Directory
import System.Exit
import System.FilePath
import System.Posix.Temp
import Gargoyle
import Gargoyle.PostgreSQL
main :: IO ()
main = do
let testPostgres = defaultPostgres
{ _gargoyle_exec = "dist/build" </> "gargoyle-postgres-monitor/gargoyle-postgres-monitor"
... | |
82d043579a21fc07e4d6d44aca1105ed577e5b8775f07003b802d21a02eacfa4 | dgiot/dgiot | dgiot_opc_handler.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 DGIOT Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the... | null | https://raw.githubusercontent.com/dgiot/dgiot/407b2c51c9681fe240844d80f89a9665f45483c8/apps/dgiot_opc/src/handler/dgiot_opc_handler.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 DGIOT 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(dgiot_opc_handler).
-author("johnliu").
-behavior(dgiot_rest).
-include_lib("dgiot/include/log... |
0de0adfc6c40055ca32e3eb589572b93ceff5ddcf222cebf9b7ca23a7f880ab3 | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | IssuerFraudRecord.hs | {-# LANGUAGE MultiWayIf #-}
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
| Contains the types generated from the schema IssuerFraudRecord
module StripeAPI.Types.IssuerFraudRecord where
import qua... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/IssuerFraudRecord.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
# SOURCE #
| Defines the object schema located at @components.schemas.issuer_fraud_record@ in the specification.
This resource has been renamed to [Early Fraud
Warning](\#early_fraud_warning_object) and will be removed in a future API
version.
| charge: ID of... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
| Contains the types generated from the schema IssuerFraudRecord
module StripeAPI.Types.IssuerFraudRecord where
import qualified Control.Monad.Fail
import qualified Data.Aeson
import qu... |
da07807f7135911a5539bea6d409547b6a9eb1f6d5e2c7ed4577b41dbdbf8815 | quil/quil | calc.clj | (ns quil.helpers.calc)
(defn mul-add
"Generate a potential lazy sequence of values which is the result of
multiplying each s by mul and then adding add. s mul and add may be
seqs in which case the result will also be seq with the length
being the same as the shortest input seq (similar to the behaviour
o... | null | https://raw.githubusercontent.com/quil/quil/1f214e712d834ede311fdc652eafe9cc0232c96e/src/clj/quil/helpers/calc.clj | clojure | ; infinite seq | (ns quil.helpers.calc)
(defn mul-add
"Generate a potential lazy sequence of values which is the result of
multiplying each s by mul and then adding add. s mul and add may be
seqs in which case the result will also be seq with the length
being the same as the shortest input seq (similar to the behaviour
o... |
fb3dc5227686f4ab4d065f05468b4ec9c0922f70000ba44ec46230281a4b22ef | ocaml-flambda/ocaml-jst | printclambda.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-flambda/ocaml-jst/7e5a626e4b4e12f1e9106564e1baba4d0ef6309a/middle_end/printclambda.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Format
open Clambda
module V = Backend_var
module VP = Backend_var.With_provenance
let mutable_fl... |
71e6a28f8621a014c2583653d5183f05ff9f4b04480843e582dda537c0ba9361 | input-output-hk/cardano-ledger-byron | test.hs | module Main
( main
)
where
import Cardano.Prelude
import Test.Tasty (testGroup)
import Test.Options (ShouldAssertNF(..), mainWithTestScenario, tsGroupToTree)
import qualified Test.Cardano.Chain.Block.CBOR
import qualified Test.Cardano.Chain.Block.Model
import qualified Test.Cardano.Chain.Block.Size
import quali... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger-byron/d309449e6c303a9f0dcc8dcf172df6f0b3195ed5/cardano-ledger/test/test.hs | haskell | module Main
( main
)
where
import Cardano.Prelude
import Test.Tasty (testGroup)
import Test.Options (ShouldAssertNF(..), mainWithTestScenario, tsGroupToTree)
import qualified Test.Cardano.Chain.Block.CBOR
import qualified Test.Cardano.Chain.Block.Model
import qualified Test.Cardano.Chain.Block.Size
import quali... | |
0a36a1073725fff91e78f0ffcd928e0b52e676d9d699d3ba68f77f829e58d3a6 | rajasegar/ccl-demo-raja | vehicles.lisp | (in-package :ccl-demo-raja)
;; Vehicles page
(defun vehicles-page ()
(setq *vehicles* (cl-json:decode-json-from-string
(drakma:http-request "/"
:method :get)))
(demo-page (:title "Vehicles - Star Wars" :active "/vehicles")
(:div :class "grid"
(:div
:class "left-panel"
(search-box (:url... | null | https://raw.githubusercontent.com/rajasegar/ccl-demo-raja/d30e82ba85f8ee4ed25b471f3f8d3f29e483c039/views/vehicles.lisp | lisp | Vehicles page | (in-package :ccl-demo-raja)
(defun vehicles-page ()
(setq *vehicles* (cl-json:decode-json-from-string
(drakma:http-request "/"
:method :get)))
(demo-page (:title "Vehicles - Star Wars" :active "/vehicles")
(:div :class "grid"
(:div
:class "left-panel"
(search-box (:url "/vehicles/searc... |
cfb7b8ba6a6c9ca940a9c8dcaf8f6ce191da6280d72c321ece52ad4b4d81d02c | hallettj/dot-xmonad | Flip.hs | # LANGUAGE FlexibleInstances , MultiParamTypeClasses #
module XMonad.Layout.Flip (Flip(..)) where
import XMonad
import XMonad.StackSet (Workspace(..))
import Control.Arrow ((***), second)
| Flip a layout , compute its 180 degree rotated form .
newtype Flip l a = Flip (l a) deriving (Show, Read)
instance LayoutCla... | null | https://raw.githubusercontent.com/hallettj/dot-xmonad/4a05291b43fd12632264961e51aa93823e22eaeb/home/.xmonad/lib/XMonad/Layout/Flip.hs | haskell | # LANGUAGE FlexibleInstances , MultiParamTypeClasses #
module XMonad.Layout.Flip (Flip(..)) where
import XMonad
import XMonad.StackSet (Workspace(..))
import Control.Arrow ((***), second)
| Flip a layout , compute its 180 degree rotated form .
newtype Flip l a = Flip (l a) deriving (Show, Read)
instance LayoutCla... | |
d41db74bcc89814728a52ad7a24b466f48486b738971f6b53b746163853775a4 | helvm/helma | Evaluator.hs | module HelVM.HelMA.Automata.Cat.Evaluator (
evalParams,
eval
) where
import HelVM.HelMA.Automaton.API.EvalParams
import HelVM.HelMA.Automaton.API.IOTypes
import HelVM.HelMA.Automaton.IO.BusinessIO
evalParams :: BIO m => EvalParams -> m ()
evalParams = eval . source
eval :: BusinessI... | null | https://raw.githubusercontent.com/helvm/helma/ca7f0c7fe08b5d6614875319d8d14110395f038a/hs/src/HelVM/HelMA/Automata/Cat/Evaluator.hs | haskell | module HelVM.HelMA.Automata.Cat.Evaluator (
evalParams,
eval
) where
import HelVM.HelMA.Automaton.API.EvalParams
import HelVM.HelMA.Automaton.API.IOTypes
import HelVM.HelMA.Automaton.IO.BusinessIO
evalParams :: BIO m => EvalParams -> m ()
evalParams = eval . source
eval :: BusinessI... | |
7840725227ac87f56ed4ac1cd318a38da784c1e0275d072affe136097e0f73e7 | morazanm/fsm | main.rkt | #lang racket
(require 2htdp/image
"../inv.rkt"
"../globals.rkt"
"../structs/state.rkt"
"../structs/machine.rkt"
"../../fsm-gviz/interface.rkt")
(provide
scaled-graph
create-gql-png
resize-image)
;; resize-image :: image -> int -> int -> image
;; Scales a image to the gi... | null | https://raw.githubusercontent.com/morazanm/fsm/0a7e96e8d69cda7d22b8496375d5c792cd5d320d/fsm-gui/graphViz/main.rkt | racket | resize-image :: image -> int -> int -> image
Scales a image to the given dimentions. This solution was adapted from
one of the answers found here: -to-smart-resize-a-displayed-image-to-original-aspect-ratio
scale-x
scale-y
scaled-graph :: image -> machine-type -> image
scales a image base on the given machine typ... | #lang racket
(require 2htdp/image
"../inv.rkt"
"../globals.rkt"
"../structs/state.rkt"
"../structs/machine.rkt"
"../../fsm-gviz/interface.rkt")
(provide
scaled-graph
create-gql-png
resize-image)
(define (resize-image img max-width max-height)
(define src-width (image-... |
4b1124c8db18aaabbd4be0e4715fef9f5f4498cee64df74f3f53fb1b8d396c65 | Bogdanp/racket-gui-easy | if.rkt | #lang racket/base
(require (for-syntax racket/base)
racket/class
(prefix-in gui: racket/gui)
syntax/parse/define
"../observable.rkt"
"../renderer.rkt"
"common.rkt"
"container.rkt"
"proxy.rkt"
"view.rkt")
(provide
if-view
cond-view
cas... | null | https://raw.githubusercontent.com/Bogdanp/racket-gui-easy/32fa6e2a1cafdbc9306b56f0d7f9689a7746f30b/gui-easy-lib/gui/easy/private/view/if.rkt | racket | #lang racket/base
(require (for-syntax racket/base)
racket/class
(prefix-in gui: racket/gui)
syntax/parse/define
"../observable.rkt"
"../renderer.rkt"
"common.rkt"
"container.rkt"
"proxy.rkt"
"view.rkt")
(provide
if-view
cond-view
cas... | |
62d874fa1be6f9d7561679b52cf6e935038cebbcf777d85e2725af033369c8d9 | lillo/compiler-course-unipi | global_variables.ml |
Use :
$ ocamlbuild -use - ocamlfind -package
Use:
$ ocamlbuild -use-ocamlfind -package llvm global_variables.byte
*)
(**
[helloworld_string ctx] given a llvm_context [ctx] returns a value reprenseting
the literal string "Hello World\n". Note that the returned string is null-terminated.
To c... | null | https://raw.githubusercontent.com/lillo/compiler-course-unipi/bc423a8e69425cccf9b727e9ef6a91f35b7aeb94/codegen-material/code/global_variables.ml | ocaml | *
[helloworld_string ctx] given a llvm_context [ctx] returns a value reprenseting
the literal string "Hello World\n". Note that the returned string is null-terminated.
To create a string that is not null-terminated use Llvm.const_stringz
* the length of the array
* the type of the element of the array
* the ... |
Use :
$ ocamlbuild -use - ocamlfind -package
Use:
$ ocamlbuild -use-ocamlfind -package llvm global_variables.byte
*)
let helloworld_string ctx = Llvm.const_stringz ctx "Hello World\n"
*
[ integer_constant ctx ] given a llvm_context [ ctx ] returns a value representing
the literal integer ... |
9de4bb88d9e8bd57a7db8b80773125f0e8b8f44e6ffa1280b9ff9797bcf9c8e3 | bhb/expound | alpha_test.cljc | (ns expound.alpha-test
(:require #?@(:clj
;; just to include the specs
[[clojure.core.specs.alpha]
[ring.core.spec]])
for specs that generate specs , which are currently disabled
#_[clojure.test.check.random :as random]
#_[clojure.test.check... | null | https://raw.githubusercontent.com/bhb/expound/3cb45f445dac28f989142529f37f3d22b2693a42/test/expound/alpha_test.cljc | clojure | just to include the specs
override specs and add generators
Not a useful spec, but worth testing
This isn't ideal, but requires a fix from clojure
-2364
We can't inspect the contents of a multi-spec (to figure out
which spec we mean by :i), so this is the best we can do.
FIXME - keys
FIXME - nilable
Note... | (ns expound.alpha-test
(:require #?@(:clj
[[clojure.core.specs.alpha]
[ring.core.spec]])
for specs that generate specs , which are currently disabled
#_[clojure.test.check.random :as random]
#_[clojure.test.check.rose-tree :as rose]
[clojure.se... |
b02638c1e90a243eb6e81fa1210a16eae0cd3ac56f2dbc938227eb7c247c8d51 | static-analysis-engineering/codehawk | bCHFunctionLoops.ml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/c1b3158e0d73cda7cfc10d75f6173f4297991a82/CodeHawk/CHB/bchlibx86/bCHFunctionLoops.ml | ocaml | chutil
bchlib | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.