_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
eac969160daf7b7ff0c5066c35ffba6498e14c7d6b26194fd968c83f8b67c05b
johnwhitington/ocamli
example07.ml
let entry_of_channel ch = let number = input_line ch in let name = input_line ch in (int_of_string number, name) let rec dictionary_of_channel ch = try let e = entry_of_channel ch in e :: dictionary_of_channel ch with End_of_file -> [] let dictionary_of_file filename = let...
null
https://raw.githubusercontent.com/johnwhitington/ocamli/28da5d87478a51583a6cb792bf3a8ee44b990e9f/OCaml%20from%20the%20Very%20Beginning/Chapter%2012/example07.ml
ocaml
let entry_of_channel ch = let number = input_line ch in let name = input_line ch in (int_of_string number, name) let rec dictionary_of_channel ch = try let e = entry_of_channel ch in e :: dictionary_of_channel ch with End_of_file -> [] let dictionary_of_file filename = let...
b3295991e4baa207cf71c2632fe9a66140deabd5e01a73d21e5060f5f5ef1c98
vseloved/prj-algo3
graphs.lisp
(ql:quickload :cl-dot) (ql:quickload :rutilsx) (use-package :rutilsx) (defstruct (edge (:conc-name nil)) src dst label) (defstruct (node (:conc-name nil) (:print-object (lambda (node stream) (format stream "#~A{~{~A~^ ~}}" (name no...
null
https://raw.githubusercontent.com/vseloved/prj-algo3/ed485ca730e42cd1bba757fd3f409b51ddb43c03/scripts/graphs.lisp
lisp
(display (make-array (list (1+ node-count) (1+ node-count))))) (maphash (lambda (name node) (aref display (1+ (id node)) 0) name) (label edge))))) (nodes g)) (print display) drawing a graph topological sort
(ql:quickload :cl-dot) (ql:quickload :rutilsx) (use-package :rutilsx) (defstruct (edge (:conc-name nil)) src dst label) (defstruct (node (:conc-name nil) (:print-object (lambda (node stream) (format stream "#~A{~{~A~^ ~}}" (name no...
805ed126fd945184e870563b1d4b42751250e79a0cafdd15548b951f83eb0de4
flipstone/haskell-for-beginners
6_functional_application_with_dollar.hs
-- Use $ to cut down on the parentheses in -- the following definitions first10Squares = take 10 $ map (^2) [1..] someMultiplesOfThree = take 5 $ filter (>100) $ map (*3) [1..] largestBuzzUnder100 = maximum $ filter (multipleOf 5) $ filter (multipleOf 3) [1..99] where multipleOf n x = x `mod` n == 0 -- Define a fun...
null
https://raw.githubusercontent.com/flipstone/haskell-for-beginners/e586a1f3ef08f21d5181171fe7a7b27057391f0b/answers/chapter_06/6_functional_application_with_dollar.hs
haskell
Use $ to cut down on the parentheses in the following definitions Define a function that applies a list of functions and so forth.
first10Squares = take 10 $ map (^2) [1..] someMultiplesOfThree = take 5 $ filter (>100) $ map (*3) [1..] largestBuzzUnder100 = maximum $ filter (multipleOf 5) $ filter (multipleOf 3) [1..99] where multipleOf n x = x `mod` n == 0 to a list of values , applying the first function to the first value , the second f...
376c7533e58965a71f24fa28487156f3aca18fa4d97774c184012e86fb13c3a4
openmusic-project/openmusic
gkant.lisp
;========================================================================= OpenMusic : Visual Programming Language for Music Composition ; Copyright ( c ) 1997- ... IRCAM - Centre , Paris , France . ; This file is part of the OpenMusic environment sources ; OpenMusic is free software : you can redist...
null
https://raw.githubusercontent.com/openmusic-project/openmusic/405909a62553a90b32291491123d2a9b5b040c23/OPENMUSIC/code/projects/musicproject/functions/gkant.lisp
lisp
========================================================================= (at your option) any later version. but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. ==...
OpenMusic : Visual Programming Language for Music Composition Copyright ( c ) 1997- ... IRCAM - Centre , Paris , France . This file is part of the OpenMusic environment sources OpenMusic is free software : you can redistribute it and/or modify it under the terms of the GNU General Public License ...
530cbbce5106be965cad258172ff99fdec2901d509e142595fa51d6cdd17504a
nasa/Common-Metadata-Repository
util.clj
(ns cmr.common.test.util (:require [clj-time.core :as t] [clojure.set :as set] [clojure.string :as str] [clojure.test :refer :all] [clojure.test.check.generators :as gen] [clojure.test.check.properties :refer [for-all]] ; [clojure.test.check.clojure-test :refer [defspec]] ;; Temporarily includ...
null
https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/b49b6457d5a8f37fc87554f5a536da773fd2c511/common-lib/test/cmr/common/test/util.clj
clojure
[clojure.test.check.clojure-test :refer [defspec]] Temporarily included to use the fixed defspec. Remove once issue is fixed. remove-nil-keys will not go down to the enclosed maps It should return true before it checks everything. The symbol at the end will trigger an exception Verifies map-n is equivalent to part...
(ns cmr.common.test.util (:require [clj-time.core :as t] [clojure.set :as set] [clojure.string :as str] [clojure.test :refer :all] [clojure.test.check.generators :as gen] [clojure.test.check.properties :refer [for-all]] [cmr.common.test.test-check-ext :as gen-ext :refer [defspec]] [cmr.common....
583f7f6b3cda87b3938f33a418e11646439141bd4815c1b405e123e23b911bdb
codereport/plr
imgs.cljs
(ns plr.imgs) (def logo-map {"Ada" "ada.png" "APL" "apl_logo.png" "Assembly" "assembly_logo.png" "Shell" "bash_logo.png" "BQN" "bqn_logo.svg" "C" "c_logo.png" "C++" "cpp_logo.p...
null
https://raw.githubusercontent.com/codereport/plr/4496371fd5dab64686fd9fa2c0f0697e75b47e50/src/plr/imgs.cljs
clojure
(ns plr.imgs) (def logo-map {"Ada" "ada.png" "APL" "apl_logo.png" "Assembly" "assembly_logo.png" "Shell" "bash_logo.png" "BQN" "bqn_logo.svg" "C" "c_logo.png" "C++" "cpp_logo.p...
5ad36b03579b683eaede8b01a4f87e35024e952350a650103e0f1890ec0de567
returntocorp/semgrep
Comment.ml
Strip comments and the like as a preprocessing phase . Strip comments and the like as a preprocessing phase. *) open Printf type comment_syntax = End_of_line of string | Multiline of string * string type style = comment_syntax list let shell_style = [ End_of_line "#" ] let c_style = [ Multiline ("/*", "*/"...
null
https://raw.githubusercontent.com/returntocorp/semgrep/6e182e59a3d7cb8d3c837032dd2fc51091098c10/libs/spacegrep/src/lib/Comment.ml
ocaml
Apply comment filters from left to right ************************************************************************ ************************************************************************
Strip comments and the like as a preprocessing phase . Strip comments and the like as a preprocessing phase. *) open Printf type comment_syntax = End_of_line of string | Multiline of string * string type style = comment_syntax list let shell_style = [ End_of_line "#" ] let c_style = [ Multiline ("/*", "*/"...
240aa75379776f9ebbf88a530bbe57748de951013795c21fb6e532cc33b819c2
Hexstream/definitions-systems
package.lisp
(cl:defpackage #:definitions-systems (:nicknames #:defsys) (:use #:cl) (:shadowing-import-from #:enhanced-defclass #:defclass) (:shadowing-import-from #:enhanced-find-class #:find-class) (:shadow #:boundp #:map #:count) (:export #:definition #:name-mixin #:name ...
null
https://raw.githubusercontent.com/Hexstream/definitions-systems/03ef8090479f65f96017319a65fb2d7afe031de5/package.lisp
lisp
(cl:defpackage #:definitions-systems (:nicknames #:defsys) (:use #:cl) (:shadowing-import-from #:enhanced-defclass #:defclass) (:shadowing-import-from #:enhanced-find-class #:find-class) (:shadow #:boundp #:map #:count) (:export #:definition #:name-mixin #:name ...
de68b933f754ddfc617a86a20f7a712312d5869c63924ae983399a07a64d3366
grin-compiler/grin
TypeEnv.hs
# LANGUAGE LambdaCase , OverloadedStrings # module Grin.Parse.TypeEnv ( typeAnnot , parseTypeEnv , parseMarkedTypeEnv , parseMarkedTypeEnv' ) where import Data.Map (Map) import Data.Set (Set) import Data.Vector (Vector) import qualified Data.Map as Map import qualified Data.Set as Set import qualified ...
null
https://raw.githubusercontent.com/grin-compiler/grin/44ac2958810ecee969c8028d2d2a082d47fba51b/grin/src/Grin/Parse/TypeEnv.hs
haskell
parses a type environment (without code) parses type marked type annotations (even interleaved with code)
# LANGUAGE LambdaCase , OverloadedStrings # module Grin.Parse.TypeEnv ( typeAnnot , parseTypeEnv , parseMarkedTypeEnv , parseMarkedTypeEnv' ) where import Data.Map (Map) import Data.Set (Set) import Data.Vector (Vector) import qualified Data.Map as Map import qualified Data.Set as Set import qualified ...
b383057934be77dd8c4019795cc00638455ea7231b953d7e95957daf0689d813
Frama-C/Frama-C-snapshot
register_gui.mli
(**************************************************************************) (* *) This file is part of Frama - C. (* *) Copyright ...
null
https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/value/gui_files/register_gui.mli
ocaml
************************************************************************ alternatives) ...
This file is part of Frama - C. Copyright ( C ) 2007 - 2019 CEA ( Commissariat à l'énergie atomique et aux énergies Lesser General Public License as published by the Free Software Foundation , v...
2d9947d08c8c375b0cd5c484f3b5f238eed1ab0f40f2a8c12edcffea62ac70b0
erszcz/learning
mad_SUITE.erl
-module(mad_SUITE). -compile([export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). -define(eq(E, A), ?assertEqual(E, A)). all() -> [sanity_check, generate_subnet_addrs, parse_addr_or_subnet]. %% %% Tests %% sanity_check(_) -> ok. generate_subnet_addr...
null
https://raw.githubusercontent.com/erszcz/learning/b21c58a09598e2aa5fa8a6909a80c81dc6be1601/erlang-port-scanner/test/mad_SUITE.erl
erlang
Tests
-module(mad_SUITE). -compile([export_all]). -include_lib("common_test/include/ct.hrl"). -include_lib("eunit/include/eunit.hrl"). -define(eq(E, A), ?assertEqual(E, A)). all() -> [sanity_check, generate_subnet_addrs, parse_addr_or_subnet]. sanity_check(_) -> ok. generate_subnet_addrs(_) -> M =...
855f62a48cb76832fa77bf9fc12073d6981613475cca1d5ed290872ae6e68536
dradtke/Lisp-Text-Editor
gtk.size-group.lisp
(in-package :gtk) (defcfun (size-group-add-widget "gtk_size_group_add_widget") :void (size-group g-object) (widget g-object)) (export 'size-group-add-widget) (defcfun (size-group-remove-widget "gtk_size_group_remove_widget") :void (size-group g-object) (widget g-object)) (export 'size-group-remove-widget) ...
null
https://raw.githubusercontent.com/dradtke/Lisp-Text-Editor/b0947828eda82d7edd0df8ec2595e7491a633580/cl-gtk2/gtk/gtk.size-group.lisp
lisp
(in-package :gtk) (defcfun (size-group-add-widget "gtk_size_group_add_widget") :void (size-group g-object) (widget g-object)) (export 'size-group-add-widget) (defcfun (size-group-remove-widget "gtk_size_group_remove_widget") :void (size-group g-object) (widget g-object)) (export 'size-group-remove-widget) ...
73d449e2ed759cd1bad79f149577fe8dc6b61cd8f8d446781c385eaa9b713bc7
TerrorJack/ghc-alter
IO.hs
# LANGUAGE Unsafe # # LANGUAGE NoImplicitPrelude , BangPatterns , RankNTypes , MagicHash , ScopedTypeVariables , UnboxedTuples # , BangPatterns , RankNTypes , MagicHash , ScopedTypeVariables , Unb...
null
https://raw.githubusercontent.com/TerrorJack/ghc-alter/db736f34095eef416b7e077f9b26fc03aa78c311/ghc-alter/boot-lib/base/GHC/IO.hs
haskell
# OPTIONS_GHC -funbox-strict-fields # # OPTIONS_HADDOCK hide # --------------------------------------------------------------------------- | License : see libraries/base/LICENSE Maintainer : Stability : internal Definitions for the 'IO' monad and its friends. -----------------------------------------...
# LANGUAGE Unsafe # # LANGUAGE NoImplicitPrelude , BangPatterns , RankNTypes , MagicHash , ScopedTypeVariables , UnboxedTuples # , BangPatterns , RankNTypes , MagicHash , ScopedTypeVariables , Unb...
5f214613de54a8b6fff6c8e961010e2f3d7bcdd1ee24299611c6d54dd708c1fd
input-output-hk/ouroboros-network
TraceSize.hs
{-# LANGUAGE BangPatterns #-} # LANGUAGE ScopedTypeVariables # module Ouroboros.Consensus.Util.TraceSize ( -- * Generic traceSize * specific , LedgerDbSize (..) , traceLedgerDbSize ) where import Cardano.Prelude (CountFailure, computeHeapSize) import Control.Monad (when) i...
null
https://raw.githubusercontent.com/input-output-hk/ouroboros-network/358880057f1d6d86cc385e8475813ace3b9ebef6/ouroboros-consensus/src/Ouroboros/Consensus/Util/TraceSize.hs
haskell
# LANGUAGE BangPatterns # * Generic ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- -----------------------------------------------------------------------------} | Generic helper to trace a value and its...
# LANGUAGE ScopedTypeVariables # module Ouroboros.Consensus.Util.TraceSize ( traceSize * specific , LedgerDbSize (..) , traceLedgerDbSize ) where import Cardano.Prelude (CountFailure, computeHeapSize) import Control.Monad (when) import Control.Monad.IO.Class import ...
977066efccd6a0e4fc662bd4f09f9d9f547e436fc205e3f547d9b610fe77bac1
janestreet/toplevel_expect_test
main.ml
open Ppxlib open Compiler_modules open Core open Poly open Expect_test_common open Expect_test_matcher open Mlt_parser [%%if host_is_i386] [@@@ocaml.alert "-deprecated"] [%%endif] module Clflags = Ocaml_common.Clflags module Compmisc = Ocaml_common.Compmisc module Printast = Ocaml_common.Printast module Warnings =...
null
https://raw.githubusercontent.com/janestreet/toplevel_expect_test/04439123bd14918ee267580f18c1afdce7730ba1/src/main.ml
ocaml
So that [%expect_exact] nodes look nice So that [%expect_exact] nodes look nice Take a part of a file, trimming spaces at the beginning as well as ';;' Captures the working directory before running the user code, which might change it Same as what run-tests.py does, to get repeatable output
open Ppxlib open Compiler_modules open Core open Poly open Expect_test_common open Expect_test_matcher open Mlt_parser [%%if host_is_i386] [@@@ocaml.alert "-deprecated"] [%%endif] module Clflags = Ocaml_common.Clflags module Compmisc = Ocaml_common.Compmisc module Printast = Ocaml_common.Printast module Warnings =...
5c6110612d86419d1bdb156b23b6adf4e747424ed57ee673df89196124e84106
brendanhay/amazonka
ListAccessControlRules.hs
# LANGUAGE DeriveGeneric # # LANGUAGE DuplicateRecordFields # # LANGUAGE NamedFieldPuns # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE RecordWildCards # {-# LANGUAGE StrictData #-} # LANGUAGE TypeFamilies # # LANGUAGE NoImplicitPrelude # # OPTIONS_GHC -fno - warn - unused - binds # # OPTIONS_GHC -fno - warn - unused -...
null
https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-workmail/gen/Amazonka/WorkMail/ListAccessControlRules.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE StrictData # | Stability : auto-generated Lists the access control rules for the specified organization. * Creating a Request * Request Lenses * Destructuring the Response * Response Lenses | The identifier for the organization. | Create a value of 'ListAccessContr...
# LANGUAGE DeriveGeneric # # LANGUAGE DuplicateRecordFields # # LANGUAGE NamedFieldPuns # # LANGUAGE RecordWildCards # # LANGUAGE TypeFamilies # # LANGUAGE NoImplicitPrelude # # OPTIONS_GHC -fno - warn - unused - binds # # OPTIONS_GHC -fno - warn - unused - imports # # OPTIONS_GHC -fno - warn - unused - matches # De...
d560135353ecde78dc7961d6a3ccb9edc5112cca52cfe0e4aa6a92f582e86455
alavrik/piqi-erlang
test.erl
-module(test). -compile([export_all, nowarn_export_all]). main() -> run(1, 'undefined'). main([NParallel]) -> Factor = list_to_integer(NParallel), run(Factor, 'undefined'); main([NParallel, NCycles]) -> Factor = list_to_integer(NParallel), Count = list_to_integer(NCycles), run(Factor, Count)...
null
https://raw.githubusercontent.com/alavrik/piqi-erlang/063ecc4f8fd54543acf01953b0a63b2b7ebf17a9/tests/perf/test.erl
erlang
write the object into desired test input format io:format("input: ~p~n", [Input]), sleep for 1 millisecond
-module(test). -compile([export_all, nowarn_export_all]). main() -> run(1, 'undefined'). main([NParallel]) -> Factor = list_to_integer(NParallel), run(Factor, 'undefined'); main([NParallel, NCycles]) -> Factor = list_to_integer(NParallel), Count = list_to_integer(NCycles), run(Factor, Count)...
ca8c7ac47adce455a3f3893eb492c38353d68d565f637e3f0dbd2cbdaab9ff44
siraben/zkeme80
build.scm
(add-to-load-path "src") (load (%search-load-path "zkeme80.scm")) (make-rom "zkeme80.rom")
null
https://raw.githubusercontent.com/siraben/zkeme80/ab49d496cac6797e6e3264ee027f96040eaf0492/build.scm
scheme
(add-to-load-path "src") (load (%search-load-path "zkeme80.scm")) (make-rom "zkeme80.rom")
4dc06af2e3e709d89ba1fc7972d9615b728895e289890e933ed752f06d0be651
walmartlabs/lacinia
roots_test.clj
Copyright ( c ) 2017 - present Walmart , 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, software dist...
null
https://raw.githubusercontent.com/walmartlabs/lacinia/88bf46f197bfed645d7767fcfe2bfa39e8b00b27/test/com/walmartlabs/lacinia/roots_test.clj
clojure
you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing perm...
Copyright ( c ) 2017 - present Walmart , Inc. Licensed under the Apache License , Version 2.0 ( the " License " ) distributed under the License is distributed on an " AS IS " BASIS , (ns com.walmartlabs.lacinia.roots-test "Tests related to specifying operation root object names." (:require [clojure.test...
a79c0bd9f80504e0576c4d5886336b4ec5ed1fff6a63750087027b9f7e4794df
launchdarkly/erlang-server-sdk
ldclient_stream_SUITE.erl
-module(ldclient_stream_SUITE). -include_lib("common_test/include/ct.hrl"). %% ct functions -export([all/0]). -export([init_per_suite/1]). -export([end_per_suite/1]). -export([init_per_testcase/2]). -export([end_per_testcase/2]). %% Tests -export([ server_process_event_put_patch/1, server_process_event_put_p...
null
https://raw.githubusercontent.com/launchdarkly/erlang-server-sdk/60947283f7b1853cbd5ef25be56536d772320c74/test/ldclient_stream_SUITE.erl
erlang
ct functions Tests ==================================================================== ct functions ==================================================================== ==================================================================== Helpers ==================================================================== ...
-module(ldclient_stream_SUITE). -include_lib("common_test/include/ct.hrl"). -export([all/0]). -export([init_per_suite/1]). -export([end_per_suite/1]). -export([init_per_testcase/2]). -export([end_per_testcase/2]). -export([ server_process_event_put_patch/1, server_process_event_put_patch_flag_with_extra_prop...
acb8c6f9de3e8e7185d05d013fdb078fdc873ec1c991c24d1bc1d9cdb052374a
janestreet/core
no_polymorphic_compare.mli
(** Open this in modules where you don't want to accidentally use polymorphic comparison. Then, use [Poly.(<)], for example, where needed. *) open! Import type compare = [ `no_polymorphic_compare ] -> [ `no_polymorphic_compare ] -> [ `no_polymorphic_compare ] val compare : compare val ( < ) : compare val (...
null
https://raw.githubusercontent.com/janestreet/core/b0be1daa71b662bd38ef2bb406f7b3e70d63d05f/core/src/no_polymorphic_compare.mli
ocaml
* Open this in modules where you don't want to accidentally use polymorphic comparison. Then, use [Poly.(<)], for example, where needed.
open! Import type compare = [ `no_polymorphic_compare ] -> [ `no_polymorphic_compare ] -> [ `no_polymorphic_compare ] val compare : compare val ( < ) : compare val ( <= ) : compare val ( > ) : compare val ( >= ) : compare val ( = ) : compare val ( <> ) : compare val equal : compare val min : compare val max : ...
8e054ac614caee9616eb20db140b576f2edf6bdc6151488231720a7270a50361
Ericson2314/lighthouse
HpcCombine.hs
--------------------------------------------------------- The main program for the hpc - add tool , part of HPC . , Oct 2006 --------------------------------------------------------- module HpcCombine (sum_plugin,combine_plugin,map_plugin) where import Trace.Hpc.Tix import Trace.Hpc.Util import HpcFlags impo...
null
https://raw.githubusercontent.com/Ericson2314/lighthouse/210078b846ebd6c43b89b5f0f735362a01a9af02/ghc-6.8.2/utils/hpc/HpcCombine.hs
haskell
------------------------------------------------------- ------------------------------------------------------- ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- could allow different numbering on the module info, ...
The main program for the hpc - add tool , part of HPC . , Oct 2006 module HpcCombine (sum_plugin,combine_plugin,map_plugin) where import Trace.Hpc.Tix import Trace.Hpc.Util import HpcFlags import Control.Monad import qualified HpcSet as Set import qualified HpcMap as Map import System.Environment sum_option...
5101f30954afb265418798089b2582f58edb39df51aa92044648fcb5a4a2f342
yogeshsajanikar/hspark
Spark.hs
module Spark ( module Spark.Context, module Spark.RDD, module Spark.MapRDD, module Spark.MapRDDIO, module Spark.ReduceRDD, module Spark.SeedRDD, module Spark.Executor, remoteTable ) where import Spark.Context import Spark.RDD import Spark.MapRDD hiding (__remoteTable) import Spark.MapRDDIO hiding (__remoteTab...
null
https://raw.githubusercontent.com/yogeshsajanikar/hspark/43e150ec38a62be3d14a7072787d1a8992f1841e/src/Spark.hs
haskell
module Spark ( module Spark.Context, module Spark.RDD, module Spark.MapRDD, module Spark.MapRDDIO, module Spark.ReduceRDD, module Spark.SeedRDD, module Spark.Executor, remoteTable ) where import Spark.Context import Spark.RDD import Spark.MapRDD hiding (__remoteTable) import Spark.MapRDDIO hiding (__remoteTab...
8dbae805f2dc6dab411cb0c65cf0e26ea32ea9d81050a1d00e5fe2d5e41ad54e
cj1128/sicp-review
2.62.scm
; A Θ(n) implementation (define (union-set set1 set2) (let ((x1 (car set1)) (x2 (car set2))) (cond ((null? set1) set2) ((null? set2) set1) ((= x1 x2) (cons x1 (union-set (cdr set1) (cdr set2)))) ((< x1 x2) (cons x1 (union-set (cdr set1) set2))) ((< x2 x1) (cons x...
null
https://raw.githubusercontent.com/cj1128/sicp-review/efaa2f863b7f03c51641c22d701bac97e398a050/chapter-2/2.3/2.62.scm
scheme
A Θ(n) implementation
(define (union-set set1 set2) (let ((x1 (car set1)) (x2 (car set2))) (cond ((null? set1) set2) ((null? set2) set1) ((= x1 x2) (cons x1 (union-set (cdr set1) (cdr set2)))) ((< x1 x2) (cons x1 (union-set (cdr set1) set2))) ((< x2 x1) (cons x2 (union-set set1 (cdr s...
51b0e168d7f80b0f41003eb9272a09d0485cdb6192761f79df139824e5d9e1a9
NicklasBoto/funQ
QOps.hs
{-# LANGUAGE ScopedTypeVariables #-} {-# LANGUAGE LiberalTypeSynonyms #-} # LANGUAGE StandaloneDeriving # # LANGUAGE NoImplicitPrelude # # LANGUAGE FlexibleInstances # {-# LANGUAGE ...
null
https://raw.githubusercontent.com/NicklasBoto/funQ/9444da05273be215a66044b976d031229d8832fc/legacy/QOps.hs
haskell
# LANGUAGE ScopedTypeVariables # # LANGUAGE LiberalTypeSynonyms # # LANGUAGE OverloadedLists # # LANGUAGE ConstraintKinds # # LANGUAGE BlockArguments # # LANGUAGE TypeFamilies...
# LANGUAGE StandaloneDeriving # # LANGUAGE NoImplicitPrelude # # LANGUAGE FlexibleInstances # # LANGUAGE TypeOperators # # OPTIONS_GHC -fplugin GHC.TypeLits . KnownNat . Solver # # OPTIONS_HADDOCK...
f19ddc5cfe67d85f8ed11fe75b4c82f854ab82b0ea043b48f1d36913aadc2c06
Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library
Radar_ValueList.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 Radar_ValueList module StripeAPI.Types.Radar_ValueList where import qualifi...
null
https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/Radar_ValueList.hs
haskell
# LANGUAGE MultiWayIf # # LANGUAGE OverloadedStrings # # SOURCE # | Defines the object schema located at @components.schemas.radar.value_list@ in the specification. Value lists allow you to group values together which can then be referenced in rules. Related guide: [Default Stripe Lists](https:\/\/stripe.com\/docs...
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 Radar_ValueList module StripeAPI.Types.Radar_ValueList where import qualified Control.Monad.Fail import qualified Data.Aeson import qualif...
253280bf292a1375ecba8405c7a733a04077c3196bdd3951a5f002c11b6a9554
jjl/thyroid
thyroid_test.clj
(ns irresponsible.thyroid-test (:require [clojure.test :as t :refer [deftest testing is]] [irresponsible.domiscuity.dom :as dom] [irresponsible.domiscuity.parser :as dom-parser] [irresponsible.thyroid :as thyroid]) (:import [clojure.lang ExceptionInfo] [org.thymeleaf.d...
null
https://raw.githubusercontent.com/jjl/thyroid/f80165b182470f843ea3bd0c45804913e1f1dba0/test/irresponsible/thyroid_test.clj
clojure
(ns irresponsible.thyroid-test (:require [clojure.test :as t :refer [deftest testing is]] [irresponsible.domiscuity.dom :as dom] [irresponsible.domiscuity.parser :as dom-parser] [irresponsible.thyroid :as thyroid]) (:import [clojure.lang ExceptionInfo] [org.thymeleaf.d...
51682653a03283f779eac0053a32f9b2d190054dfe9bd241747857eca8988bd2
coccinelle/coccinelle
printf.mli
val fprintf : out_channel -> ('a, out_channel, unit) format -> 'a val printf : ('a, out_channel, unit) format -> 'a val eprintf : ('a, out_channel, unit) format -> 'a val sprintf : ('a, unit, string) format -> 'a val bprintf : Buffer.t -> ('a, Buffer.t, unit) format -> 'a val ifprintf : 'b -> ('a, 'b, 'c, unit) format4...
null
https://raw.githubusercontent.com/coccinelle/coccinelle/5448bb2bd03491ffec356bf7bd6ddcdbf4d36bc9/bundles/stdcompat/stdcompat-current/interfaces/4.09/printf.mli
ocaml
val fprintf : out_channel -> ('a, out_channel, unit) format -> 'a val printf : ('a, out_channel, unit) format -> 'a val eprintf : ('a, out_channel, unit) format -> 'a val sprintf : ('a, unit, string) format -> 'a val bprintf : Buffer.t -> ('a, Buffer.t, unit) format -> 'a val ifprintf : 'b -> ('a, 'b, 'c, unit) format4...
520be1cfe521ba0eeabed0fe5b9caf396f601e1b62bcca92b5b4dbc8d2e677cd
jumarko/clojure-experiments
interleave_two_seqs.clj
(ns four-clojure.interleave-two-seqs) Interleave Two Seqs : ;;; Write a function which takes two sequences and returns the first item from each , then the second item from each , then the third , etc . ;;; ;;; Special Restrictions: interleave (defn my-interleave [s1 s2] (mapcat #(vector %1 %2) s1 s2)) (= (m...
null
https://raw.githubusercontent.com/jumarko/clojure-experiments/f0f9c091959e7f54c3fb13d0585a793ebb09e4f9/src/clojure_experiments/four_clojure/interleave_two_seqs.clj
clojure
Special Restrictions: interleave Other solutions:
(ns four-clojure.interleave-two-seqs) Interleave Two Seqs : Write a function which takes two sequences and returns the first item from each , then the second item from each , then the third , etc . (defn my-interleave [s1 s2] (mapcat #(vector %1 %2) s1 s2)) (= (my-interleave [1 2 3] [:a :b :c]) '(1 :a 2 :b ...
e84abce889e0e0edd90df34ccde919b5aac79865f4363d57dd42195f62175776
phoityne/haskell-debug-adapter
Initialize.hs
# LANGUAGE MultiParamTypeClasses # # OPTIONS_GHC -fno - warn - orphans # module Haskell.Debug.Adapter.State.Init.Initialize where import Control.Monad.IO.Class import qualified System.Log.Logger as L import qualified Haskell.DAP as DAP import Haskell.Debug.Adapter.Type import Haskell.Debug.Adapter.Constant import qu...
null
https://raw.githubusercontent.com/phoityne/haskell-debug-adapter/e3084996cd170e0096d4017f398c35493e5c6c32/src/Haskell/Debug/Adapter/State/Init/Initialize.hs
haskell
| Any errors should be critical. don't catch anything here. |
# LANGUAGE MultiParamTypeClasses # # OPTIONS_GHC -fno - warn - orphans # module Haskell.Debug.Adapter.State.Init.Initialize where import Control.Monad.IO.Class import qualified System.Log.Logger as L import qualified Haskell.DAP as DAP import Haskell.Debug.Adapter.Type import Haskell.Debug.Adapter.Constant import qu...
702998213f041d97ca73d093048e06f206d4fc1f01068c8db80a87c674976d1e
project-oak/hafnium-verification
fragmentRetainsViewChecker.ml
* Copyright ( c ) Facebook , Inc. and its affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the ...
null
https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/checkers/fragmentRetainsViewChecker.ml
ocaml
TODO: complain if onDestroyView is not defined, yet the Fragment has View fields TODO: handle fields nullified in callees in the same file is [fldname] a View type declared by [class_typename]? report if a field is declared by C, but not nulled out in C.onDestroyView
* Copyright ( c ) Facebook , Inc. and its affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the ...
fe427ba8d437030f1bfd3a295d24878f57a333fae2efee2ef880568021ed9fa0
sweet-tooth-clojure/endpoint
utils.cljc
(ns sweet-tooth.endpoint.utils) TODO move this to sweet-tooth.core (defn update-vals "Takes a map to be updated, x, and a map of {[k1 k2 k3] update-fn-1 [k4 k5 k6] update-fn-2} such that such that k1, k2, k3 are updated using update-fn-1 and k4, k5, k6 are updated using update-fn-2" [x update-map] (re...
null
https://raw.githubusercontent.com/sweet-tooth-clojure/endpoint/bafe8448b26aefa4b44d2bf7fe2f9c565cfad414/src/sweet_tooth/endpoint/utils.cljc
clojure
------------------------- Organize response records for easy frontend consumption ------------------------- allow for both `->` and `->>`
(ns sweet-tooth.endpoint.utils) TODO move this to sweet-tooth.core (defn update-vals "Takes a map to be updated, x, and a map of {[k1 k2 k3] update-fn-1 [k4 k5 k6] update-fn-2} such that such that k1, k2, k3 are updated using update-fn-1 and k4, k5, k6 are updated using update-fn-2" [x update-map] (re...
e9434fb83a7246fe8b0383773c709140cabb2bb816f7931dc08be59c0130fde8
ashic/actually-using-haskell
Lib.hs
{-# LANGUAGE OverloadedStrings #-} module Lib ( someFunc ) where import Model someFunc :: IO () someFunc = putStrLn $ show $ toDo ("something", "description of something")
null
https://raw.githubusercontent.com/ashic/actually-using-haskell/077e93f5ad5291542a2f52efc416db44b0d6a7bf/src/auh/src/Lib.hs
haskell
# LANGUAGE OverloadedStrings #
module Lib ( someFunc ) where import Model someFunc :: IO () someFunc = putStrLn $ show $ toDo ("something", "description of something")
32b5b476f815035dfcf802766d5b397436c087d3aac3813fcc38dd6e0b0fac6b
inaka/lasse
shutdown_handler.erl
-module(shutdown_handler). -behavior(lasse_handler). -dialyzer(no_behaviours). -export([ init/3 , handle_info/2 , handle_notify/2 , handle_error/3 , terminate/3 ]). -spec init(term(), term(), cowboy_req:req()) -> {shutdown, 404, cowboy:http_headers(), binary(), cowboy_req:re...
null
https://raw.githubusercontent.com/inaka/lasse/19c9e00c7666f210d0935589936bd2252a333e95/test/shutdown_handler.erl
erlang
-module(shutdown_handler). -behavior(lasse_handler). -dialyzer(no_behaviours). -export([ init/3 , handle_info/2 , handle_notify/2 , handle_error/3 , terminate/3 ]). -spec init(term(), term(), cowboy_req:req()) -> {shutdown, 404, cowboy:http_headers(), binary(), cowboy_req:re...
dc86873cdb79e7e354b3d428d52aaffea9c2e0ca0e25d820cef34064948031c5
5HT/ant
Counter.ml
open Runtime; open Unicode; open Logging; (* counters *) type counter = { number : mutable int; (* value of the counter *) reset : mutable (list counter) (* counters which arer reset everytime this counter changes *) }; value make val = { number = val; reset = [] }; value rec set ctr val = do...
null
https://raw.githubusercontent.com/5HT/ant/6acf51f4c4ebcc06c52c595776e0293cfa2f1da4/Markup/Counter.ml
ocaml
counters value of the counter counters which arer reset everytime this counter changes counter table
open Runtime; open Unicode; open Logging; type counter = { }; value make val = { number = val; reset = [] }; value rec set ctr val = do { ctr.number := val; List.iter reset ctr.reset } and reset ctr = set ctr 0; value add_reset ctr sub_ctr = do { if List.memq sub_ctr ctr.reset then () else c...
a51f358ea78529e97448cb7ddb4c471ae70f152a26da9cec31082b16847fc8b0
DerekCuevas/interview-cake-clj
project.clj
(defproject rectangular-love "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "" :license {:name "Eclipse Public License" :url "-v10.html"} :dependencies [[org.clojure/clojure "1.8.0"]] :main ^:skip-aot rectangular-love.core :target-path "target/%s" :profiles {:uberjar {:aot :all}...
null
https://raw.githubusercontent.com/DerekCuevas/interview-cake-clj/f17d3239bb30bcc17ced473f055a9859f9d1fb8d/rectangular-love/project.clj
clojure
(defproject rectangular-love "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "" :license {:name "Eclipse Public License" :url "-v10.html"} :dependencies [[org.clojure/clojure "1.8.0"]] :main ^:skip-aot rectangular-love.core :target-path "target/%s" :profiles {:uberjar {:aot :all}...
5e02765c3feae92110cdfc3af7c9cc686d93e6ca81028363a425759d9b65b7e7
xapix-io/axel-f
json_test.cljc
(ns axel-f.json-test (:require #?(:clj [clojure.test :as t] :cljs [cljs.test :as t :include-macros true]) [axel-f.excel :as af] [axel-f.excel.json :as sut])) (t/deftest json (t/testing "Encode object" (t/is (= "{\"foo\":1}" (sut/encode {:foo 1})))) (t/testing "Deco...
null
https://raw.githubusercontent.com/xapix-io/axel-f/ec8fca880033e0ae78a8d9f42538d4a71fba29bd/test/axel_f/json_test.cljc
clojure
(ns axel-f.json-test (:require #?(:clj [clojure.test :as t] :cljs [cljs.test :as t :include-macros true]) [axel-f.excel :as af] [axel-f.excel.json :as sut])) (t/deftest json (t/testing "Encode object" (t/is (= "{\"foo\":1}" (sut/encode {:foo 1})))) (t/testing "Deco...
75036b00ee63384549d07d4f04ed3cdce2ea763fd9eb234ae12b1937bcc78d47
Ashe/HSRogue
Types.hs
# LANGUAGE ExistentialQuantification # # LANGUAGE TypeFamilies # # LANGUAGE FlexibleInstances # module Types ( State(..) , GameMode(..) , InterfaceMode(..) , MessageBit(..) , MBit(..) , FPS , TexResource , TextureMap , FontResource , FontMap , Direction(..) ) where import SDL hiding (Vector, Renderer) import qualifie...
null
https://raw.githubusercontent.com/Ashe/HSRogue/ced7b7631a3dd4f0e6919ae98bda1c4316c8be38/src/Types.hs
haskell
Data for managing flow of the game Manage the game Manage menus Class for managing text within the game Easy FPS Types for creating textures Types for creating fonts Types for Directions
# LANGUAGE ExistentialQuantification # # LANGUAGE TypeFamilies # # LANGUAGE FlexibleInstances # module Types ( State(..) , GameMode(..) , InterfaceMode(..) , MessageBit(..) , MBit(..) , FPS , TexResource , TextureMap , FontResource , FontMap , Direction(..) ) where import SDL hiding (Vector, Renderer) import qualifie...
e2f7eece0ef7e759f1296b91b0a55bee1e782570a7694bd4a85256994bc23f69
finnishtransportagency/harja
kohteiden_luonti_test.cljs
(ns harja.tiedot.kanavat.hallinta.kohteiden-luonti-test (:require [harja.tiedot.kanavat.hallinta.kohteiden-luonti :as tiedot] [clojure.test :refer-macros [deftest is testing]] [harja.testutils.tuck-apurit :refer-macros [vaadi-async-kutsut] :refer [e!]] [harja.domain.kanavat.kohdek...
null
https://raw.githubusercontent.com/finnishtransportagency/harja/488b1e096f0611e175221d74ba4f2ffed6bea8f1/test/cljs/harja/tiedot/kanavat/hallinta/kohteiden_luonti_test.cljs
clojure
(ns harja.tiedot.kanavat.hallinta.kohteiden-luonti-test (:require [harja.tiedot.kanavat.hallinta.kohteiden-luonti :as tiedot] [clojure.test :refer-macros [deftest is testing]] [harja.testutils.tuck-apurit :refer-macros [vaadi-async-kutsut] :refer [e!]] [harja.domain.kanavat.kohdek...
a08c32aec1be91b126421bd9f62948f0210a238cea2dbc8ec170e6bdb3e84c9c
lambdacube3d/lambdacube-edsl
LC_T_DSLType.hs
module LC_T_DSLType where import Data.Int import Data.Word import Data.Typeable import LCType import LC_APIType data Sampler dim layerCount t ar -- IsScalar means here that the related type is not a tuple, but a GPU primitive type class GPU a => IsScalar a where toValue :: a -> Value toSingleType ...
null
https://raw.githubusercontent.com/lambdacube3d/lambdacube-edsl/4347bb0ed344e71c0333136cf2e162aec5941df7/lambdacube-core/tmp/sandbox/LC_T_DSLType.hs
haskell
IsScalar means here that the related type is not a tuple, but a GPU primitive type toType :: a -> Type stream type restriction, these types can be used in vertex shader input uniform type restriction |Conversion between surface n-tuples and our tuple representation. our language uses nested tuple representation ...
module LC_T_DSLType where import Data.Int import Data.Word import Data.Typeable import LCType import LC_APIType data Sampler dim layerCount t ar class GPU a => IsScalar a where toValue :: a -> Value toSingleType :: a -> InputType singletonScalarType : : IsScalar a = > a - > TupleType ( ( ) , a...
c49ffe946d7c56ce8c4a29a20bcc1338e23aedb8ebca0e050d915859b922c9e3
thiagozg/GitHubJobs-Clojure-Service
datomic.clj
(ns github-jobs.di.datomic (:require [com.stuartsierra.component :as component] [github-jobs.data.schemas :as db-schemas] [datomic.api :as d] [config.core :refer [env]])) (defrecord Datomic [db-uri] component/Lifecycle (start [this] (d/create-database db-uri) (let [c...
null
https://raw.githubusercontent.com/thiagozg/GitHubJobs-Clojure-Service/9b17da56ebe773f6aed96337ac516307d91a1403/src/github_jobs/di/datomic.clj
clojure
(ns github-jobs.di.datomic (:require [com.stuartsierra.component :as component] [github-jobs.data.schemas :as db-schemas] [datomic.api :as d] [config.core :refer [env]])) (defrecord Datomic [db-uri] component/Lifecycle (start [this] (d/create-database db-uri) (let [c...
039b28cb8060f3b86a9fd3d818bd2a03c388d6e75f6bbca8b35e55a0cbd3119b
evilbinary/scheme-lib
color.scm
;;; "color.scm" color data-type Copyright 2001 , 2002 ; ;Permission to copy this software, to modify it, to redistribute it, ;to distribute modified versions, and to use it for any purpose is ;granted, subject to the following restrictions and understandings. ; 1 . Any copy made of this software must include this c...
null
https://raw.githubusercontent.com/evilbinary/scheme-lib/6df491c1f616929caa4e6569fa44e04df7a356a7/packages/slib/color.scm
scheme
"color.scm" color data-type Permission to copy this software, to modify it, to redistribute it, to distribute modified versions, and to use it for any purpose is granted, subject to the following restrictions and understandings. in full. this software will be error-free, and I am under no obligation to provide any ...
Copyright 2001 , 2002 1 . Any copy made of this software must include this copyright notice 2 . I have made no warranty or representation that the operation of 3 . In conjunction with products arising from the use of this (require 'record) (require 'color-space) (require 'scanf) (require 'printf) (require 'str...
cc7117eb4e538bc7b5af0abf89b28a562365ffa8cd066089a67f565db4316487
footprintanalytics/footprint-web
resolve_joined_fields.clj
(ns metabase.query-processor.middleware.resolve-joined-fields "Middleware that adds `:join-alias` info to `:field` clauses where needed." (:require [clojure.data :as data] [clojure.tools.logging :as log] [metabase.mbql.schema :as mbql.s] [metabase.mbql.util :as mbql.u] ...
null
https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/src/metabase/query_processor/middleware/resolve_joined_fields.clj
clojure
if there are no candidates, try looking for one in the source query if we have a source query. Otherwise we can't do anything, so return field as-is if there are multiple candidates, try ignoring the implicit ones presence of `:fk-field-id` indicates that the join was implicit, as the result of an `fk->` form don'...
(ns metabase.query-processor.middleware.resolve-joined-fields "Middleware that adds `:join-alias` info to `:field` clauses where needed." (:require [clojure.data :as data] [clojure.tools.logging :as log] [metabase.mbql.schema :as mbql.s] [metabase.mbql.util :as mbql.u] ...
fca2066532542151eddcca4dadf53e325b3a22e48aef2f1a94cd443887a6769a
jeffreyrosenbluth/static-canvas
Rectangle.hs
{-# LANGUAGE OverloadedStrings #-} module Main where import Graphics.Static rectangle :: CanvasFree () rectangle = do beginPath rect 188 50 200 100 fillStyle (ColorStyle (Hex ("#FFD700"))) fill lineWidth 7 strokeStyle (ColorStyle (Hex ("#8B008B"))) stroke main :: IO () main = writeCanvasDoc "Rectangle...
null
https://raw.githubusercontent.com/jeffreyrosenbluth/static-canvas/1aad0f192828ded72dced14e42ac4e6baa6dab6f/examples/Rectangle.hs
haskell
# LANGUAGE OverloadedStrings #
module Main where import Graphics.Static rectangle :: CanvasFree () rectangle = do beginPath rect 188 50 200 100 fillStyle (ColorStyle (Hex ("#FFD700"))) fill lineWidth 7 strokeStyle (ColorStyle (Hex ("#8B008B"))) stroke main :: IO () main = writeCanvasDoc "Rectangle.html" 400 400 rectangle
a0155dc7694191b936109c6bb8532f30d29e595e8931e7a416d3d84b57cf2578
janestreet/async_js
main.ml
open Core open Async_kernel open Async_js open Js_of_ocaml let output = ref [] let get_output () = Stdlib.flush_all (); let res = String.concat ~sep:"" (List.rev !output) in output := []; res ;; let promise_of_deferred d = let promise = Js.Unsafe.global##._Promise in new%js promise (Js.wrap_callback ...
null
https://raw.githubusercontent.com/janestreet/async_js/2d290b3af2efaa9ee3415c7da539dda592e36526/test/client/main.ml
ocaml
We export a javascript callback that will then be triggered from the server side. Wait a bit so that the connection is not immediately closed The server side will wait for the text 'Ready' to appear and only then start the testing.
open Core open Async_kernel open Async_js open Js_of_ocaml let output = ref [] let get_output () = Stdlib.flush_all (); let res = String.concat ~sep:"" (List.rev !output) in output := []; res ;; let promise_of_deferred d = let promise = Js.Unsafe.global##._Promise in new%js promise (Js.wrap_callback ...
c5251a05246e2a26983ff7112cf8bfe383d58498fade38dda58e735a5741fb45
garrigue/lablgl
glMap.mli
$ I d : glMap.mli , v 1.3 2000 - 04 - 12 07:40:24 garrigue Exp $ type target = [ `vertex_3 | `vertex_4 | `index | `color_4 | `normal | `texture_coord_1 | `texture_coord_2 | `texture_coord_3 | `texture_coord_4 ] val map1 : target:target -> float * float -> order:int -> [`double] Raw.t -> unit [ ...
null
https://raw.githubusercontent.com/garrigue/lablgl/d76e4ac834b6d803e7a6c07c3b71bff0e534614f/src/glMap.mli
ocaml
Evaluate the maps at given coordinates Evaluate meshes at given coordinates
$ I d : glMap.mli , v 1.3 2000 - 04 - 12 07:40:24 garrigue Exp $ type target = [ `vertex_3 | `vertex_4 | `index | `color_4 | `normal | `texture_coord_1 | `texture_coord_2 | `texture_coord_3 | `texture_coord_4 ] val map1 : target:target -> float * float -> order:int -> [`double] Raw.t -> unit [ ...
48671b7c84bbe6b98bbc50a554910b23b490365421e6696f6656fb7e4bda9e18
janestreet/base
float.ml
open! Import open! Printf module Bytes = Bytes0 include Float0 let raise_s = Error.raise_s module T = struct type t = float [@@deriving_inline hash, globalize, sexp, sexp_grammar] let (hash_fold_t : Ppx_hash_lib.Std.Hash.state -> t -> Ppx_hash_lib.Std.Hash.state) = hash_fold_float and (hash : t -> Ppx_has...
null
https://raw.githubusercontent.com/janestreet/base/1462b7d5458e96569275a1c673df968ecbf3342f/src/float.ml
ocaml
Open replace_polymorphic_compare after including functor instantiations so they do not shadow its definitions. This is here so that efficient versions of the comparison functions are available within this module. Stolen from [pervasives.ml]. Adds a "." at the end if needed. It is in [pervasives.mli], but ...
open! Import open! Printf module Bytes = Bytes0 include Float0 let raise_s = Error.raise_s module T = struct type t = float [@@deriving_inline hash, globalize, sexp, sexp_grammar] let (hash_fold_t : Ppx_hash_lib.Std.Hash.state -> t -> Ppx_hash_lib.Std.Hash.state) = hash_fold_float and (hash : t -> Ppx_has...
53573a57f1c00c7fe08e2a68d802445416ec891d03e101407e792793b73ed3e8
aptmcl/rosetta
coord.rkt
#lang typed/racket/base (require racket/math math/matrix) (require "utils.rkt") (provide Cs Loc Vec Locs Vecs LocOrZ VecOrZ world-loc world-transformation world-cs world-cs? current-cs translated-cs sca...
null
https://raw.githubusercontent.com/aptmcl/rosetta/38aeafd730f93edaec7474106e84dae6d8bc1261/base/coord.rkt
racket
find better name? The circle system Matrix operations This should be useful to optimize code. Think about combining it with syntax/parse. Vector Location in Cartesian Coordinates Perhaps a Cs id would be good Let's speedup a little by using syntax instead of a function Convert points to world Convert points to othe...
#lang typed/racket/base (require racket/math math/matrix) (require "utils.rkt") (provide Cs Loc Vec Locs Vecs LocOrZ VecOrZ world-loc world-transformation world-cs world-cs? current-cs translated-cs sca...
fa244758262cfc7229c25e822a7b0556cad07ce62cb0300bf107190a1a826cbe
mirkov/gnuplot-interface
gnuplot-interface.lisp
Time - stamp : < 2014 - 10 - 11 12:10:15Eastern Daylight Time gnuplot-interface.lisp > ;; Copyright 2011 Distributed under the terms of the GNU General Public License ;; ;; This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as publis...
null
https://raw.githubusercontent.com/mirkov/gnuplot-interface/090dcbf73965f90547d89c32dc703e51a632d2c5/gnuplot-interface.lisp
lisp
This program is free software: you can redistribute it and/or modify (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Pu...
Time - stamp : < 2014 - 10 - 11 12:10:15Eastern Daylight Time gnuplot-interface.lisp > Copyright 2011 Distributed under the terms of the GNU General Public License it under the terms of the GNU General Public License as published by the Free Software Foundation , either version 3 of the License , or Y...
7e4172c336d7a3c6cb4df220f109ea7e46ecbbc7bcbb5fba0b5f2143e6fcb8fa
psholtz/MIT-SICP
exercise2-08.scm
;; Exercise 2.8 ;; Using reasoning similar to 's , describe how the difference of two intervals ;; may be computed. Define a corresponding subtraction procedure, called "sub-interval". ;; ;; First , for the sake of completeness , let 's import our constructor procedures from the ;; previous exercise, as well a...
null
https://raw.githubusercontent.com/psholtz/MIT-SICP/01e9b722ac5008e26f386624849117ca8fa80906/Section-2.1/mit-scheme/exercise2-08.scm
scheme
may be computed. Define a corresponding subtraction procedure, called "sub-interval". previous exercise, as well as the other interval arithmetic operations defined in the text. Arithmetical Procedures: Now let us construct the substraction procedure. inverse for a given interval. Then we will add thi...
Exercise 2.8 Using reasoning similar to 's , describe how the difference of two intervals First , for the sake of completeness , let 's import our constructor procedures from the Constructors and Selectors (define (make-interval a b) (cons a b)) (define (lower-bound x) (car x)) (define (upper-bound x) (cdr x...
4ab34ac3d2bb30b56c885e9d5313c349799fd80fcde115f24cd11aed50716318
input-output-hk/cardano-sl
Metrics.hs
-- | 'StateLockMetrics' for txp. module Pos.DB.Txp.MemState.Metrics ( recordTxpMetrics ) where import Universum import Data.Aeson.Types (ToJSON (..)) import Formatting (sformat, shown, (%)) import qualified System.Metrics as Metrics import qualified System.Metrics.Gauge as Metri...
null
https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/db/src/Pos/DB/Txp/MemState/Metrics.hs
haskell
| 'StateLockMetrics' for txp. An exponential moving average is used for the time gauges (wait and modify durations). The parameter alpha is chosen somewhat arbitrarily. estimator. mempool lock, when the mempool lock has been granted, and when that lock has been released. It updates EKG metrics and also logs eac...
module Pos.DB.Txp.MemState.Metrics ( recordTxpMetrics ) where import Universum import Data.Aeson.Types (ToJSON (..)) import Formatting (sformat, shown, (%)) import qualified System.Metrics as Metrics import qualified System.Metrics.Gauge as Metrics.Gauge import Pos.Ch...
8d1f602dea9f10c8cc91178f1ee7784424755f6d2a7aabd40f3c8d3adb4ca222
paypal/seazme-sources
hbase2es.clj
(ns seazme.sources.hbase2es (:require [clojure.tools.logging :as log] [seazme.common.es :as ces]) (:use seazme.sources.common seazme.common.common seazme.common.datahub seazme.common.notif)) (defn- update-datasources[conn session] (let [session-tsx (-> session :self :meta :tsx...
null
https://raw.githubusercontent.com/paypal/seazme-sources/57e5b7579f5e475a908b2318a00549dd131f7745/src/main/clojure/seazme/sources/hbase2es.clj
clojure
TODO throw&exit if no conversion TODO add ES cluster, prefix, machine hosting batch etc ..
(ns seazme.sources.hbase2es (:require [clojure.tools.logging :as log] [seazme.common.es :as ces]) (:use seazme.sources.common seazme.common.common seazme.common.datahub seazme.common.notif)) (defn- update-datasources[conn session] (let [session-tsx (-> session :self :meta :tsx...
9f21b864e33558a75d9a2b95c459513bea8cd29622b40f1c15f3f829ad92ae36
tachukao/ilqr
pendulum.ml
let () = Printexc.record_backtrace true open Owl module AD = Algodiff.D let dir = Cmdargs.(get_string "-d" |> force ~usage:"-d [dir]") let in_dir = Printf.sprintf "%s/%s" dir module P = struct let n = 2 let m = 1 let n_steps = 2000 let dt = AD.F 1E-3 let g = AD.F 9.8 let mu = AD.F 0.01 let dyn ~u ~x = ...
null
https://raw.githubusercontent.com/tachukao/ilqr/923a65bb8a1f12801d8eaf5adef04799c1c68ba1/examples/pendulum.ml
ocaml
let () = Printexc.record_backtrace true open Owl module AD = Algodiff.D let dir = Cmdargs.(get_string "-d" |> force ~usage:"-d [dir]") let in_dir = Printf.sprintf "%s/%s" dir module P = struct let n = 2 let m = 1 let n_steps = 2000 let dt = AD.F 1E-3 let g = AD.F 9.8 let mu = AD.F 0.01 let dyn ~u ~x = ...
dd9040a783d639a72e9c2d2e0ee9d1199efef96164e7d1d32dc9a6c6aaa2fc4b
BinaryAnalysisPlatform/bap
bap_sema_ssa.mli
open Bap_ir open Bap_knowledge val sub : sub term -> sub term val is_transformed : sub term -> bool module KB : sig val sub : sub term -> sub term knowledge end
null
https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/da02e32e4ec420a444c42b2583d7b039c9899049/lib/bap_sema/bap_sema_ssa.mli
ocaml
open Bap_ir open Bap_knowledge val sub : sub term -> sub term val is_transformed : sub term -> bool module KB : sig val sub : sub term -> sub term knowledge end
9e57c1940e9a348bbe7c5948a5e71be1a032d95aa2aec97265ebf108167d3c97
simmone/racket-simple-xlsx
legend-test.rkt
#lang racket (require simple-xml) (require rackunit/text-ui rackunit) (require "../../../../xlsx/xlsx.rkt") (require "../../../../sheet/sheet.rkt") (require "../../../../lib/lib.rkt") (require"../../../../xl/charts/lib.rkt") (require racket/runtime-path) (define-runtime-path legend_file "legend.xml") (define test...
null
https://raw.githubusercontent.com/simmone/racket-simple-xlsx/e0ac3190b6700b0ee1dd80ed91a8f4318533d012/simple-xlsx/tests/xl/charts/lib/legend-test.rkt
racket
#lang racket (require simple-xml) (require rackunit/text-ui rackunit) (require "../../../../xlsx/xlsx.rkt") (require "../../../../sheet/sheet.rkt") (require "../../../../lib/lib.rkt") (require"../../../../xl/charts/lib.rkt") (require racket/runtime-path) (define-runtime-path legend_file "legend.xml") (define test...
6d347db176a24d3975d02ae3aeb72829faff9f30e42e2bf9760b1dfcfdcddb22
komadori/HsQML
SimpleTest.hs
{-# LANGUAGE DeriveDataTypeable, FlexibleInstances #-} module Graphics.QML.Test.SimpleTest where import Graphics.QML.Objects import Graphics.QML.Test.Framework import Graphics.QML.Test.MayGen import Graphics.QML.Test.TestObject import Graphics.QML.Test.ScriptDSL (Expr, Prog) import qualified Graphics.QML.Test.ScriptD...
null
https://raw.githubusercontent.com/komadori/HsQML/f57cffe4e3595bdf743bdbe6f44bf45a4001d35f/test/Graphics/QML/Test/SimpleTest.hs
haskell
# LANGUAGE DeriveDataTypeable, FlexibleInstances # There are seperate properties for testing accessors and mutators
module Graphics.QML.Test.SimpleTest where import Graphics.QML.Objects import Graphics.QML.Test.Framework import Graphics.QML.Test.MayGen import Graphics.QML.Test.TestObject import Graphics.QML.Test.ScriptDSL (Expr, Prog) import qualified Graphics.QML.Test.ScriptDSL as S import Test.QuickCheck.Arbitrary import Contro...
df8c7cbbc6695ae1d5ab446acd49d673d87272267cd62a681c3ac425cfb21839
ml4tp/tcoq
richpp.mli
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/ml4tp/tcoq/7a78c31df480fba721648f277ab0783229c8bece/lib/richpp.mli
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** * This module offers semi-structured...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * type 'annotation located = {...
af78d12fd0448db0d2be95d5cea5e42c13938c7b7fcb1a41aa01c96f5368cb5a
exercism/common-lisp
matching-brackets.lisp
(defpackage :matching-brackets (:use :cl) (:export :pairedp)) (in-package :matching-brackets) (defun pairedp (value))
null
https://raw.githubusercontent.com/exercism/common-lisp/1cc6aa661054b0797ffe05689a68656aa1e343f7/exercises/practice/matching-brackets/matching-brackets.lisp
lisp
(defpackage :matching-brackets (:use :cl) (:export :pairedp)) (in-package :matching-brackets) (defun pairedp (value))
9ee038f36d83f8c2da7c1f101e7d3cbbdefcf176c8b4bd480958e816e33045e6
tzemanovic/haskell-yesod-realworld-example-app
User.hs
# LANGUAGE DataKinds # # LANGUAGE NoImplicitPrelude # {-# LANGUAGE OverloadedLabels #-} {-# LANGUAGE OverloadedStrings #-} # LANGUAGE RecordWildCards # module Handler.User ( postUsersLoginR , postUsersRegisterR , getUserR , putUserR ) where import Control.Monad.Except (ExceptT, t...
null
https://raw.githubusercontent.com/tzemanovic/haskell-yesod-realworld-example-app/d9f5191a909fa3c0087c5f28fcaae7ad1eca8b9a/app/src/Handler/User.hs
haskell
# LANGUAGE OverloadedLabels # # LANGUAGE OverloadedStrings # ------------------------------------------------------------------------------ User login ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Get curr...
# LANGUAGE DataKinds # # LANGUAGE NoImplicitPrelude # # LANGUAGE RecordWildCards # module Handler.User ( postUsersLoginR , postUsersRegisterR , getUserR , putUserR ) where import Control.Monad.Except (ExceptT, throwError) import Data.Aeson (object) import ...
ae22edef6c23610a8f00011a70c6a4bc3273f3717a2c75253ef72796539e71e9
augustss/djinn
LJTFormula.hs
-- Copyright ( c ) 2005 -- See LICENSE for licensing details. -- module LJTFormula(Symbol(..), Formula(..), (<->), (&), (|:), fnot, false, true, ConsDesc(..), Term(..), applys, freeVars ) where import Data.List(union, (\\)) infixr 2 :-> infix 2 <-> infixl 3 |: infixl 4 & newtype Symbol = ...
null
https://raw.githubusercontent.com/augustss/djinn/c2c2e9413593d953c9ce45886cb086b4f97659de/src/LJTFormula.hs
haskell
See LICENSE for licensing details. name and arity ----------------------------
Copyright ( c ) 2005 module LJTFormula(Symbol(..), Formula(..), (<->), (&), (|:), fnot, false, true, ConsDesc(..), Term(..), applys, freeVars ) where import Data.List(union, (\\)) infixr 2 :-> infix 2 <-> infixl 3 |: infixl 4 & newtype Symbol = Symbol String deriving (Eq, Ord) insta...
32597f2dac4ef98a8192c094c98ebb7456f918521c21fbeadbc2264999a21e1b
MinaProtocol/mina
hash_prefixes.ml
let length_in_bytes = 20 module T : sig type t = private string val create : string -> t end = struct type t = string let padding_char = '*' let create s : t = let string_length = String.length s in assert (string_length <= length_in_bytes) ; let diff = length_in_bytes - string_length in l...
null
https://raw.githubusercontent.com/MinaProtocol/mina/9c59ae9d8f627459d26e40d7018b9d4c38d2159a/src/lib/hash_prefixes/hash_prefixes.ml
ocaml
length is limited, so we drop some characters here for Zkapp_precondition.Account.t for Account_update.Account_precondition.t
let length_in_bytes = 20 module T : sig type t = private string val create : string -> t end = struct type t = string let padding_char = '*' let create s : t = let string_length = String.length s in assert (string_length <= length_in_bytes) ; let diff = length_in_bytes - string_length in l...
30a3db68e9d68f7d7c603eadccbfa2cbc98625e3a88a4b29096f2063ad0c3020
moonlightdrive/ocaml-ec2
custom_kernel.ml
This program will register an Amazon Machine Image given an image such as ` mirage.img ` . The commented function at the end of this file will register an AMI and launch it . If you are in need of a script to convert unikernels to images , see The commented function at the end of this file will register ...
null
https://raw.githubusercontent.com/moonlightdrive/ocaml-ec2/06df35a4a29f1b51416013ddf126eeb43587dc11/examples/custom_kernel.ml
ocaml
let _ = let running = Lwt_main.run @@ Monad.run @@ launch_instance image my_key my_cert my_bucket in running.instances |> List.map (fun i -> print_endline @@ Printf.sprintf "Launched instance %s" i.Running_instance.id)
This program will register an Amazon Machine Image given an image such as ` mirage.img ` . The commented function at the end of this file will register an AMI and launch it . If you are in need of a script to convert unikernels to images , see The commented function at the end of this file will register ...
cd9af0e69340d50859180d00cb783b56f12e6a8f35234dbe6b39db0b90e978db
coq/coq
classes.mli
(************************************************************************) (* * The Coq Proof Assistant / The Coq Development Team *) v * Copyright INRIA , CNRS and contributors < O _ _ _ , , * ( see version control and CREDITS file for authors & dates ) \VV/ * * *...
null
https://raw.githubusercontent.com/coq/coq/d398824aa2e52b83de63961d690405ae556e39c9/vernac/classes.mli
ocaml
********************************************************************** * The Coq Proof Assistant / The Coq Development Team // * This file is distributed under the terms of the * (see LICENSE file for the text of the license) ************************************...
v * Copyright INRIA , CNRS and contributors < O _ _ _ , , * ( see version control and CREDITS file for authors & dates ) \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * GNU Lesser Gener...
4dc22f04f09992495b929fc26ba00ebc30ee954aa37131f1cb985837ff142a38
DHSProgram/DHS-Indicators-SPSS
PH_SANI.sps
* Encoding: UTF-8. ********************************************************************* program: PH_SANI.sps Purpose: creates variable for binary improved sanitation according to JSTOR standard Data inputs: hr or pr file Data outputs: none Author of do file: 03/15/2018 Courtney Allen and translated to SPSS ...
null
https://raw.githubusercontent.com/DHSProgram/DHS-Indicators-SPSS/5de4f2b032646a99fe144a1adeaf09a82d8026a6/Chap02_PH/PH_SANI.sps
scheme
* Encoding: UTF-8. ********************************************************************* program: PH_SANI.sps Purpose: creates variable for binary improved sanitation according to JSTOR standard Data inputs: hr or pr file Data outputs: none Author of do file: 03/15/2018 Courtney Allen and translated to SPSS ...
e585bb0df211cd75e166dae68af848c94dad7d7907213864368a5688bcb60de4
arrayfire/arrayfire-haskell
DeviceSpec.hs
# LANGUAGE TypeApplications # module ArrayFire.DeviceSpec where import qualified ArrayFire as A import Foreign.C.Types import Test.Hspec spec :: Spec spec = describe "Algorithm tests" $ do it "Should show device info" $ do A.info `shouldReturn` () it "Should show device init"...
null
https://raw.githubusercontent.com/arrayfire/arrayfire-haskell/5d621602bb925ce5122a66011003498cbe638e2b/test/ArrayFire/DeviceSpec.hs
haskell
# LANGUAGE TypeApplications # module ArrayFire.DeviceSpec where import qualified ArrayFire as A import Foreign.C.Types import Test.Hspec spec :: Spec spec = describe "Algorithm tests" $ do it "Should show device info" $ do A.info `shouldReturn` () it "Should show device init"...
4bdfd41a399fce3ac199a4370b555a06e4428cf10edfe7c8d2e6ead122aee9f5
ragkousism/Guix-on-Hurd
gettext.scm
;;; GNU Guix --- Functional package management for GNU Copyright © 2012 < > Copyright © 2014 < > Copyright © 2015 < > Copyright © 2016 < > Copyright © 2016 < > ;;; ;;; This file is part of GNU Guix. ;;; GNU is free software ; you can redistribute it and/or modify it under the terms of the...
null
https://raw.githubusercontent.com/ragkousism/Guix-on-Hurd/e951bb2c0c4961dc6ac2bda8f331b9c4cee0da95/gnu/packages/gettext.scm
scheme
GNU Guix --- Functional package management for GNU This file is part of GNU Guix. you can redistribute it and/or modify it either version 3 of the License , or ( at your option) any later version. GNU Guix is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied wa...
Copyright © 2012 < > Copyright © 2014 < > Copyright © 2015 < > Copyright © 2016 < > Copyright © 2016 < > under the terms of the GNU General Public License as published by You should have received a copy of the GNU General Public License along with GNU . If not , see < / > . (define-m...
ba9a3fd13e1518f0d83fef200b6beef102a5572e92a8de08a313aa2cf21201a1
ml4tp/tcoq
nativeconv.mli
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/ml4tp/tcoq/7a78c31df480fba721648f277ab0783229c8bece/kernel/nativeconv.mli
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** * This module implements the convers...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * open Term open Reduction open ...
7e9fc2520339bcf9414e9b7acebff10dcf0739c5c3627e48333fdcd8d455814a
Clojure2D/clojure2d-examples
interval.clj
(ns rt4.the-next-week.ch09.interval (:refer-clojure :exclude [empty size]) (:require [fastmath.core :as m])) (set! *warn-on-reflection* true) (set! *unchecked-math* :warn-on-boxed) (m/use-primitive-operators) (defprotocol IntervalProto (contains [interval x]) ;; a <= x <= b ;; introduced due to the bug in the...
null
https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/9d294e9073cfb8680b7f82ce40a661ef2feff384/src/rt4/the_next_week/ch09/interval.clj
clojure
a <= x <= b introduced due to the bug in the book (in the time of writing this code), a < x <= b can't name it size
(ns rt4.the-next-week.ch09.interval (:refer-clojure :exclude [empty size]) (:require [fastmath.core :as m])) (set! *warn-on-reflection* true) (set! *unchecked-math* :warn-on-boxed) (m/use-primitive-operators) (defprotocol IntervalProto (contains- [interval x]) (clamp [interval x]) (expand [interval delta]) ...
7044c2c622cc522a6bf979dfe2c6d75cecd538e225deccb23392ded3bfede4bc
skanev/playground
44-tests.scm
(require rackunit rackunit/text-ui) (load-relative "../../support/eopl.scm") (load-relative "../44.scm") (load-relative "helpers/nameless.scm") (define (eval* code env) (let* ((expr (scan&parse code)) (expr (translation-of expr (empty-senv) (empty-kenv))) (result (value-of expr env))) (expval->...
null
https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/eopl/03/tests/44-tests.scm
scheme
(require rackunit rackunit/text-ui) (load-relative "../../support/eopl.scm") (load-relative "../44.scm") (load-relative "helpers/nameless.scm") (define (eval* code env) (let* ((expr (scan&parse code)) (expr (translation-of expr (empty-senv) (empty-kenv))) (result (value-of expr env))) (expval->...
57122e8ad9285d6c81792a9a24bfa962bede7daa48fad949462fd0b9047805be
brendanhay/gogol
Patch.hs
# LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE DerivingStrategies # # LANGUAGE DuplicateRecordFields # # LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE LambdaCase # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE PatternSynonyms # # LANGUAGE RecordWildCards # {-# LANGUAGE St...
null
https://raw.githubusercontent.com/brendanhay/gogol/77394c4e0f5bd729e6fe27119701c45f9d5e1e9a/lib/services/gogol-logging/gen/Gogol/Logging/BillingAccounts/Exclusions/Patch.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE StrictData # | Stability : auto-generated /See:/ </ Cloud Logging API Reference> for @logging.billingAccounts.exclusions.patch@. * Resource ** Constructing a Request | A resource alias for @logging.billingAccounts.exclusions.patch@ method which the 'LoggingBillingAcc...
# LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE DerivingStrategies # # LANGUAGE DuplicateRecordFields # # LANGUAGE FlexibleInstances # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE LambdaCase # # LANGUAGE PatternSynonyms # # LANGUAGE RecordWildCards # # LANGUAGE TypeFamilies # # LANGUAGE TypeOperators...
7be0b498d5a514400a30496c89f9e1664b6eb2732857fc0275562083752a3dd3
askonomm/clarktown
atx_heading_block_test.clj
(ns clarktown.correctors.atx-heading-block-test (:require [clojure.test :refer [deftest testing is]] [clarktown.correctors.atx-heading-block :as corrector])) (deftest atx-heading-block-corrector-test (testing "Empty line above" (let [line "# Hello" lines ["Some text goes here" line] ...
null
https://raw.githubusercontent.com/askonomm/clarktown/2ff0da12f58d17b6c1ab3736a41595073b3a534e/test/clarktown/correctors/atx_heading_block_test.clj
clojure
(ns clarktown.correctors.atx-heading-block-test (:require [clojure.test :refer [deftest testing is]] [clarktown.correctors.atx-heading-block :as corrector])) (deftest atx-heading-block-corrector-test (testing "Empty line above" (let [line "# Hello" lines ["Some text goes here" line] ...
8bceecdab5b11211315a1b6fb42795e2932db717728c4ab6727d00bc2d445024
barrucadu/dejafu
TQueue.hs
-- | -- Module : Control.Concurrent.Classy.STM.TQueue Copyright : ( c ) 2016 License : MIT Maintainer : < > -- Stability : stable -- Portability : portable -- A ' TQueue ' is like a ' TChan ' , with two important differences : -- * it has faster throughput than both ' TChan ' and ' ' (...
null
https://raw.githubusercontent.com/barrucadu/dejafu/f805783398e2be60ebabb56fce9f23506b9d1879/concurrency/Control/Concurrent/Classy/STM/TQueue.hs
haskell
| Module : Control.Concurrent.Classy.STM.TQueue Stability : stable Portability : portable the costs are amortised, so the cost of individual operations can vary a lot). 'cloneTChan' operations. The implementation is based on the traditional purely-functional enqueue and dequeue operations. ...
Copyright : ( c ) 2016 License : MIT Maintainer : < > A ' TQueue ' is like a ' TChan ' , with two important differences : * it has faster throughput than both ' TChan ' and ' ' ( although * it does /not/ provide equivalents of the ' dupTChan ' and queue representation that uses two lists...
1a5b4bf92b6e681944556675cca19991645e7052505a2e479fcb4f1f1e939e6d
softlab-ntua/bencherl
churn_SUITE.erl
2008 - 2011 Zuse Institute Berlin Licensed under the Apache License , Version 2.0 ( the " License " ) ; % you may not use this file except in compliance with the License. % You may obtain a copy of the License at % % -2.0 % % Unless required by applicable law or agreed to in writing, software di...
null
https://raw.githubusercontent.com/softlab-ntua/bencherl/317bdbf348def0b2f9ed32cb6621e21083b7e0ca/app/scalaris/test/churn_SUITE.erl
erlang
you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language gov...
2008 - 2011 Zuse Institute Berlin Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , @author < > @author < > @author < > -module(churn_SUITE). -author(''). -vsn('$Id: churn_SUITE.erl 2184 2011-09-06 10:22...
4c417dc941706fb6652fba280fc2edd77fc9f365f42c6706a89a2d26e7d50edf
tezos/tezos-mirror
state_transitions.ml
(*****************************************************************************) (* *) (* Open Source License *) Copyright ( c ) 2021 Nomadic Labs < > (* ...
null
https://raw.githubusercontent.com/tezos/tezos-mirror/f0fac81ca8d49f180e663316b2566780ddc1517e/src/proto_016_PtMumbai/lib_delegate/state_transitions.ml
ocaml
*************************************************************************** Open Source License Permission is h...
Copyright ( c ) 2021 Nomadic Labs < > to deal in the Software without restriction , including without limitation and/or sell copies of the Software , and to permit persons to whom the THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR LIABILITY , WHETHER IN AN...
e05aa54777ba6061262d7ef8a2c5bf2ebcdd29f9be42f131afa7398c6556c197
kaos/ecapnp
ecapnp_vat.erl
%% Copyright 2014 , < > %% Licensed under the Apache License , Version 2.0 ( the " License " ) ; %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% -2.0 %% %% Unless required by applicable law or agreed to in writing, software dis...
null
https://raw.githubusercontent.com/kaos/ecapnp/f351c07730ba134b41b137dd6a6b93069a0908fc/src/ecapnp_vat.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 gov...
Copyright 2014 , < > Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , @copyright 2014 , @author < > One VAT server per connection . -module(ecapnp_vat). -author("Andreas Stenius <>"). -behaviour(gen_serv...
313ef9943baf4c4cb60ac8b70526d91ba8460bed2e0f8f8a655637de785b0576
Daniel-Diaz/HaTeX
TikZ.hs
| Ti / k / Z ist /kein/ Zeichenprogramm . -- Ti / k / Z is a frontend for PGF ( Portable Graphics Format ) , a package for creating graphics using scripts embedded in a LaTeX document . -- Using this library you will be able to generate Ti / k / Z scripts using functions . -- The interface given here is pre...
null
https://raw.githubusercontent.com/Daniel-Diaz/HaTeX/aae193763157378500ebedc733c913e74f53b060/Text/LaTeX/Packages/TikZ.hs
haskell
work with it. However, if you want to use both of them, you will have to use qualified imports or you will get name clashes. an interface to create paths (see 'TPath') using monads. document. | Import the 'tikz' package to use the functions exported by this module. For example, adding this line to your ...
| Ti / k / Z ist /kein/ Zeichenprogramm . Ti / k / Z is a frontend for PGF ( Portable Graphics Format ) , a package for creating graphics using scripts embedded in a LaTeX document . Using this library you will be able to generate Ti / k / Z scripts using functions . The interface given here is pretty close...
7de4f040ab3d23b932ea6554c3c53024c579fba52fe0f5ad70a7fa0fe3005f8a
dnadales/sandbox
EchoSpec.hs
{-# LANGUAGE DeriveAnyClass #-} # LANGUAGE DeriveGeneric # # LANGUAGE FlexibleInstances # {-# LANGUAGE KindSignatures #-} # LANGUAGE PolyKinds # # LANGUAGE StandaloneDeriving # -- | Spec for echo. module EchoSpec (spec) where import GHC.Generics (Generic, Generic1)...
null
https://raw.githubusercontent.com/dnadales/sandbox/401c4f0fac5f8044fb6e2e443bacddce6f135b4b/qcsm-echo/test/EchoSpec.hs
haskell
# LANGUAGE DeriveAnyClass # # LANGUAGE KindSignatures # | Spec for echo. ^ At the beginning of time nothing was received. TODO: qcsm will match the case below. However we don't expect this to happen! mTransitions (Buf str) (In _) _ = Buf str -- Dummy response error "This shouldn't happen: input transitio...
# LANGUAGE DeriveGeneric # # LANGUAGE FlexibleInstances # # LANGUAGE PolyKinds # # LANGUAGE StandaloneDeriving # module EchoSpec (spec) where import GHC.Generics (Generic, Generic1) import Data.TreeDiff (ToExpr) import Test.Hspec ...
e73a2b665d282005c33c76862490fa4efff68d8e0150c4164a1c1c04ac9da34a
Rydgel/flappy-haskell
Audio.hs
{-# LANGUAGE OverloadedStrings #-} module Audio (Music(..), Audio(..), initAudio, loadAudio, destroyAudio, loadMusic, playMusic, playFile, stopMusic, musicPlaying) where import Control.Concurrent import Control.Monad import qualified SDL.Mixer impor...
null
https://raw.githubusercontent.com/Rydgel/flappy-haskell/4790c34978e47b048af1550f6d3af8604d9c8a89/src/Audio.hs
haskell
# LANGUAGE OverloadedStrings # | Initialize the audio subsystem. | Load a music file, returning a 'Music' if loaded successfully. | Free memory | Stop playing music | Is music playing? | Load an audio file. | Play an audio file for the given number of seconds. This function spawns a new OS thread. Remember to...
module Audio (Music(..), Audio(..), initAudio, loadAudio, destroyAudio, loadMusic, playMusic, playFile, stopMusic, musicPlaying) where import Control.Concurrent import Control.Monad import qualified SDL.Mixer import qualified SDL.Raw.Mixer as RawMix...
0fe3eead753777401228d2324129b038f231f90b126eeef9224152fe5280c700
jedimahdi/soltan
Users.hs
module Hokm.Api.Network.Anatomy.Api.Users ( CreateResponse , GetAllResponse , Routes (..) ) where import Data.Generics.Labels () import qualified Hokm.Api.Data.User as User import Hokm.Api.Network.Anatomy.Prelude import qualified Hokm.Api.Servant.Response ...
null
https://raw.githubusercontent.com/jedimahdi/soltan/bc2f9c040854420b8964ad011205d6a251872fe0/backend/hokm-api/src/Hokm/Api/Network/Anatomy/Api/Users.hs
haskell
module Hokm.Api.Network.Anatomy.Api.Users ( CreateResponse , GetAllResponse , Routes (..) ) where import Data.Generics.Labels () import qualified Hokm.Api.Data.User as User import Hokm.Api.Network.Anatomy.Prelude import qualified Hokm.Api.Servant.Response ...
1fe01ab86aeb63fec6eb4c6fbfb09bb8d885305401a7b586268bd9d8dcaf608f
clojure-interop/aws-api
SystemDefaultDnsResolver.clj
(ns com.amazonaws.SystemDefaultDnsResolver "Default dns resolver that uses InetAddress.getAllByName(String) to resolve hosts to ip addresses" (:refer-clojure :only [require comment defn ->]) (:import [com.amazonaws SystemDefaultDnsResolver])) (defn ->system-default-dns-resolver "Constructor." (^SystemDefau...
null
https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws/src/com/amazonaws/SystemDefaultDnsResolver.clj
clojure
(ns com.amazonaws.SystemDefaultDnsResolver "Default dns resolver that uses InetAddress.getAllByName(String) to resolve hosts to ip addresses" (:refer-clojure :only [require comment defn ->]) (:import [com.amazonaws SystemDefaultDnsResolver])) (defn ->system-default-dns-resolver "Constructor." (^SystemDefau...
18d31c121b05d3a47c5731db9f91cbee0e662aa9c19c4bbddaa70eb0aab41b7b
kadena-io/pact
Table.hs
{-# LANGUAGE OverloadedStrings #-} # LANGUAGE LambdaCase # {-# LANGUAGE BangPatterns #-} # LANGUAGE MagicHash # # LANGUAGE TypeApplications # # LANGUAGE CPP # module Pact.Gas.Table where import Data.Ratio import Data.Map (Map) import qualified Data.Map as Map import Data.Text (Text) import qualified Data.Text as T #if...
null
https://raw.githubusercontent.com/kadena-io/pact/5f5aa8ee7e0a88fead9c8ac5b8cf047ef456a1e4/src/Pact/Gas/Table.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE BangPatterns # typically we want to account for those costs when the terms become evaluated, but there may be some cases where the ability to inspect the argument list is helpful, so I'll leave this in for now. up-front cost per column in a select operation cost per column ...
# LANGUAGE LambdaCase # # LANGUAGE MagicHash # # LANGUAGE TypeApplications # # LANGUAGE CPP # module Pact.Gas.Table where import Data.Ratio import Data.Map (Map) import qualified Data.Map as Map import Data.Text (Text) import qualified Data.Text as T #if !defined(ghcjs_HOST_OS) import qualified GHC.Integer.Logarithms ...
b2be7f259fcfbbb35bed43a63d6fda51c1c0a6cb8bb8f31dc9a82d5386257801
well-typed-lightbulbs/ocaml-esp32
extensions.ml
(* TEST * expect *) Ignore = b to be reproducible Printexc.record_backtrace false;; [%%expect {| - : unit = () |}] type foo = .. ;; [%%expect {| type foo = .. |}] type foo += A | B of int ;; [%%expect {| type foo += A | B of int |}] let is_a x = match x with A -> true | _ -> false ;; [%%expect {...
null
https://raw.githubusercontent.com/well-typed-lightbulbs/ocaml-esp32/c24fcbfbee0e3aa6bb71c9b467c60c6bac326cc7/testsuite/tests/typing-extensions/extensions.ml
ocaml
TEST * expect The type must be open to create extension The type must be public to create extension The type parameters must match In a signature the type can be private But it must still be extensible Signatures can change the grouping of extensions Extensions must obey constraints Signatures can m...
Ignore = b to be reproducible Printexc.record_backtrace false;; [%%expect {| - : unit = () |}] type foo = .. ;; [%%expect {| type foo = .. |}] type foo += A | B of int ;; [%%expect {| type foo += A | B of int |}] let is_a x = match x with A -> true | _ -> false ;; [%%expect {| val is_a : foo -> boo...
b446cd0efbf3147432b9ccaa5904bf8a6e9fb48a520ee943a7ef4fbc78b7ba70
Beluga-lang/Beluga
command.mli
(** * Registers a new bespoke command *) val register : string -> (Format.formatter -> string list -> unit) -> string -> unit * * Decides whether an input string is some code ( constructor * ` Input ) or an interactive mode command to run ( constructor ) . * Decides whether an input string is some Belug...
null
https://raw.githubusercontent.com/Beluga-lang/Beluga/1d39095c99dc255d972a339d447dc04286d8c13f/src/core/command.mli
ocaml
* * Registers a new bespoke command * Given a formatter for command output, parses the given string as a * command and runs it.
val register : string -> (Format.formatter -> string list -> unit) -> string -> unit * * Decides whether an input string is some code ( constructor * ` Input ) or an interactive mode command to run ( constructor ) . * Decides whether an input string is some Beluga code (constructor * `Input) or an intera...
7a4f7ba39cb6741566f13a5be1c74d25aa68ea5bf405537725619291d8a0685c
silverbullettt/SICP
2.83.rkt
(define (raise x) (if (eq? (tag x) 'complex) #f (apply-generic 'raise x))) ; integer (define (install-integer-package) ; ... (define (integer-raise x) (make-rational x 1)) ;... (put 'raise 'integer integer-raise) 'done) ; rational (define (install-rational-package) ; ... (define (rational-...
null
https://raw.githubusercontent.com/silverbullettt/SICP/e773a8071ae2fae768846a2b295b5ed96b019f8d/2.83.rkt
racket
integer ... ... rational ... ... real ... ...
(define (raise x) (if (eq? (tag x) 'complex) #f (apply-generic 'raise x))) (define (install-integer-package) (define (integer-raise x) (make-rational x 1)) (put 'raise 'integer integer-raise) 'done) (define (install-rational-package) (define (rational-raise x) (make-real (/ (numer x) (denom...
967039953b72c90f6de8b41de9f39f7f14a899f708e568c6238f55e94a6f6dad
aeden/learn-you-some-erlang
event_server.erl
-module(event_server). -compile(export_all). -record(state, {events, clients}). -record(event, {name="", description="", pid, timeout={{1970,1,1},{0,0,0}}}). start() -> register(?MODULE, Pid=spawn(?MODULE, init, [])), Pid. start_link() -> register(?MODULE, Pid=spawn_link(?MODULE, init, [])), Pid. terminate()...
null
https://raw.githubusercontent.com/aeden/learn-you-some-erlang/b72efc8617de7ec129cc31e5d504aa0bac7964ea/event_app/src/event_server.erl
erlang
Internal API This may happen if we cancel an event and it fires at the same time Loading events from a static file could be done here.
-module(event_server). -compile(export_all). -record(state, {events, clients}). -record(event, {name="", description="", pid, timeout={{1970,1,1},{0,0,0}}}). start() -> register(?MODULE, Pid=spawn(?MODULE, init, [])), Pid. start_link() -> register(?MODULE, Pid=spawn_link(?MODULE, init, [])), Pid. terminate()...
c4aeabed8ef1b26daf1eac01bfca137c1a62aa3c46d788df2ddaf85ad6bdfa6a
ChrisPenner/advent-of-code-haskell
Day06.hs
# LANGUAGE TypeApplications # # LANGUAGE QuasiQuotes # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE ScopedTypeVariables # # LANGUAGE BlockArguments # {-# LANGUAGE RankNTypes #-} # LANGUAGE LambdaCase # # LANGUAGE TupleSections # # LANGUAGE ViewPatterns # # LANGUAGE DeriveFunctor # # LANGUAGE TemplateHaskell # # LANGUA...
null
https://raw.githubusercontent.com/ChrisPenner/advent-of-code-haskell/da10d53b3e98b67c9cb499dd8b2ddadd121c932e/src/Y2019/Day06.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE RankNTypes # Select the graph stash the graph in the index for later fold over vertices, keeping graph stashed Pull the graph from the index alongside each vertex fold over every vertex reachable from every vertex! connectToSanta _ xs = fold xs <&> \case That x -> That...
# LANGUAGE TypeApplications # # LANGUAGE QuasiQuotes # # LANGUAGE ScopedTypeVariables # # LANGUAGE BlockArguments # # LANGUAGE LambdaCase # # LANGUAGE TupleSections # # LANGUAGE ViewPatterns # # LANGUAGE DeriveFunctor # # LANGUAGE TemplateHaskell # # LANGUAGE LambdaCase # module Y2019.Day06 where import Control.Lens i...
88c778e1cd6445a3b3782297b604d0cf047d274a81962330a500d6ef9e786c9d
kitten/bs-flow-parser
pattern_parser.ml
* * Copyright ( c ) Facebook , Inc. and its affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the...
null
https://raw.githubusercontent.com/kitten/bs-flow-parser/00630c06016b51a7040ef4160ed2999cd208babd/src/pattern_parser.ml
ocaml
these should never happen it is a syntax error if `name` is a reserved word other than await or yield it is a syntax error if `name` is a strict reserved word, in strict mode invalid shorthand destructuring seen_rest is true when we've seen a rest element. rest_trailing_comma is the location of * the rest...
* * Copyright ( c ) Facebook , Inc. and its affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the...
14c1d444bd3226fb20b09ae72b78ff9ad379c73b8250c8c3eb4bdffcccdb67d0
markhibberd/postmark
Data.hs
# LANGUAGE CPP # {-# LANGUAGE OverloadedStrings, GADTSyntax #-} module Network.Api.Postmark.Data ( -- * Request types -- ** Email Email (..), defaultEmail, -- ** Email with template EmailWithTemplate (..), defaultEmailWithTemplate, -- ** Track links TrackLinks (..), -- ** Attachment Attachmen...
null
https://raw.githubusercontent.com/markhibberd/postmark/2882dc323d5945a1116fc8267817ab74d749ff0b/src/Network/Api/Postmark/Data.hs
haskell
# LANGUAGE OverloadedStrings, GADTSyntax # * Request types ** Email ** Email with template ** Track links ** Attachment ** Response type * Request types | Email data type. It is recommended that you use the defaultEmail function and selector syntax to build an email, e.g.: > defaultEmail { > emailFrom...
# LANGUAGE CPP # module Network.Api.Postmark.Data ( Email (..), defaultEmail, EmailWithTemplate (..), defaultEmailWithTemplate, TrackLinks (..), Attachment (..), Sent (..), * Internal Json tools ojson, oljson, omjson, toText ) where import qualified Data.ByteString.Lazy as BL import qual...
8e546172c5c16fd783c7a07cd9fbdc825ee657ba6c3a836c125a7d3832aefc9d
Drup/dowsing
Directories.ml
(* We should be using the library "directories". Unfortunately, compiling with dune gives "inconsistent assumptions over interface Common". *) let ( / ) = Fpath.( / ) let home_dir = Bos.OS.Dir.user () |> CCResult.get_lazy @@ fun (`Msg msg) -> failwith msg module type S = sig val data_dir : Fpath.t end ...
null
https://raw.githubusercontent.com/Drup/dowsing/b4ce55ac163a659450c02b5bb556248a0adf31fe/lib/utils/Directories.ml
ocaml
We should be using the library "directories". Unfortunately, compiling with dune gives "inconsistent assumptions over interface Common".
let ( / ) = Fpath.( / ) let home_dir = Bos.OS.Dir.user () |> CCResult.get_lazy @@ fun (`Msg msg) -> failwith msg module type S = sig val data_dir : Fpath.t end module Linux : S = struct let data_dir = home_dir / ".local" / "share" end module Macos : S = struct let data_dir = home_dir / "Library" / "Appli...
fd12127a6164b11fb335df1f988b1e1d69f246ae0988fdb0246cd2639b663009
flybot-sg/Pastoral
http.cljc
Copyright ( c ) 2018 Flybot Pte Ltd , Singapore . ;; This file is distributed under the Eclipse Public License , the same as Clojure . (ns pastoral.fx.http (:require [clojure.string :as string] [pastoral.console :refer [console]] [pastoral.coro :as coro] [pastoral.core :refer [dispatch]] [pa...
null
https://raw.githubusercontent.com/flybot-sg/Pastoral/c0bfb0e083e7fee22cb242d03768fc8a72598683/src/pastoral/fx/http.cljc
clojure
assume uri don't include any query parameter assume post don't have any query parameters status code, last modified etc. TODO avoid conflict if user start multiple coro For multipart/form-data, file upload, not work with aleph for now
Copyright ( c ) 2018 Flybot Pte Ltd , Singapore . This file is distributed under the Eclipse Public License , the same as Clojure . (ns pastoral.fx.http (:require [clojure.string :as string] [pastoral.console :refer [console]] [pastoral.coro :as coro] [pastoral.core :refer [dispatch]] [pasto...
49d52f2adb52d8c5b23aebdee2fb1009e7e301a8570f07cab9359a042a8b38a5
logseq/logseq
backup_file.cljs
(ns electron.backup-file (:require [clojure.string :as string] ["path" :as path] ["fs" :as fs] ["fs-extra" :as fs-extra])) (def backup-dir "logseq/bak") (def version-file-dir "logseq/version-files/local") (defn- get-backup-dir* [repo relative-path bak-dir] (let [relative-path...
null
https://raw.githubusercontent.com/logseq/logseq/01d879c18ed69a206bb85f0b06a63673dd217e90/src/electron/electron/backup_file.cljs
clojure
(ns electron.backup-file (:require [clojure.string :as string] ["path" :as path] ["fs" :as fs] ["fs-extra" :as fs-extra])) (def backup-dir "logseq/bak") (def version-file-dir "logseq/version-files/local") (defn- get-backup-dir* [repo relative-path bak-dir] (let [relative-path...
1bd578c0ea547278f0921b757ad50804674c99c7e69f9e9cfd8f25fdf78c356e
cyga/real-world-haskell
GlobRegexEither.hs
-- file: ch08/GlobRegexEither.hs type GlobError = String globToRegex :: String -> Either GlobError String
null
https://raw.githubusercontent.com/cyga/real-world-haskell/4ed581af5b96c6ef03f20d763b8de26be69d43d9/ch08/GlobRegexEither.hs
haskell
file: ch08/GlobRegexEither.hs
type GlobError = String globToRegex :: String -> Either GlobError String
438108965de5ec2050d4fa53c55398039d90caed64c892741212e791a49d0091
monadbobo/ocaml-core
host_and_port.ml
open Std_internal module T = struct type t = string * int with sexp, bin_io let compare = Pervasives.compare let hash = Hashtbl.hash end include T let create ~host ~port = (host, port) let host = fst let port = snd let tuple t = t let to_string (host, port) = sprintf "%s:%d" host port let of_string s = mat...
null
https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/lib/host_and_port.ml
ocaml
open Std_internal module T = struct type t = string * int with sexp, bin_io let compare = Pervasives.compare let hash = Hashtbl.hash end include T let create ~host ~port = (host, port) let host = fst let port = snd let tuple t = t let to_string (host, port) = sprintf "%s:%d" host port let of_string s = mat...
694c5b5620dad7f24be3a02f2f4b8d2cfe777eff3c2719b9086c30a60b0cad9d
aeternity/aeternity
aetx_tests.erl
%%%------------------------------------------------------------------- ( C ) 2017 , Aeternity Anstalt %%%------------------------------------------------------------------- -module(aetx_tests). -include_lib("eunit/include/eunit.hrl"). -include_lib("aecore/include/blocks.hrl"). -include_lib("aecontract/include/har...
null
https://raw.githubusercontent.com/aeternity/aeternity/e66a588a41d8af5f4ce8467f28258d3f2c74cd8e/apps/aetx/test/aetx_tests.erl
erlang
------------------------------------------------------------------- ------------------------------------------------------------------- Probably to be moved to common tests Initial balance - spend_tx amount - spend_tx fee higher gas price, so a bit more of gas consumed for the bigger size of the transaction
( C ) 2017 , Aeternity Anstalt -module(aetx_tests). -include_lib("eunit/include/eunit.hrl"). -include_lib("aecore/include/blocks.hrl"). -include_lib("aecontract/include/hard_forks.hrl"). -define(TEST_MODULE, aetx). -define(RECIPIENT_PUBKEY, <<"_________recipient_pubkey_______">>). apply_signed_txs_test_() -> ...
c39c535e702ff6590cc16ca3d2648b744a0c4ff304991a6122252bc2ebb4c9b5
facebook/flow
monitorRPC.mli
* Copyright ( c ) Meta Platforms , Inc. and affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in t...
null
https://raw.githubusercontent.com/facebook/flow/0a121296f053100ff0a26ac79f335dbc6759692d/src/monitor/rpc/monitorRPC.mli
ocaml
* Copyright ( c ) Meta Platforms , Inc. and affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in t...
220817e60bd4531a9887e80cf63129e9fadb2853f7a7a193c998ffb7ed32419e
zotonic/zotonic
m_ratelimit.erl
@author < > 2019 Driebit BV %% @doc Rate limiting of authentication tries and other types of requests Copyright 2019 Driebit BV %% 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 Licens...
null
https://raw.githubusercontent.com/zotonic/zotonic/852f627c28adf6e5212e8ad5383d4af3a2f25e3f/apps/zotonic_mod_ratelimit/src/models/m_ratelimit.erl
erlang
@doc Rate limiting of authentication tries and other types of requests 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 expre...
@author < > 2019 Driebit BV Copyright 2019 Driebit BV Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(m_ratelimit). -behaviour(zotonic_model). -export([ m_get/3, init/1, insert_event/4, ...
ed55783d2448d236b3fef146998c0f9c8e476b56417c1451c063885957fa0c4f
TristeFigure/shuriken
sexp_macros_test.clj
(ns shuriken.reader-macros.sexp-macros-test (:require [clojure.test :refer :all] [shuriken.reader-macros.sexp-macros :refer :all]) (:import [java.nio CharBuffer] [java.io StringReader])) (deftest test-dynamic-pushback-reader (let [r #(dynamic-pushback-reader (StringReader. "xyz"))] (...
null
https://raw.githubusercontent.com/TristeFigure/shuriken/cd36dd2a4005c85260125d89d5a3f475d248e6e4/test/shuriken/reader_macros/sexp_macros_test.clj
clojure
(ns shuriken.reader-macros.sexp-macros-test (:require [clojure.test :refer :all] [shuriken.reader-macros.sexp-macros :refer :all]) (:import [java.nio CharBuffer] [java.io StringReader])) (deftest test-dynamic-pushback-reader (let [r #(dynamic-pushback-reader (StringReader. "xyz"))] (...
ac3cb0029aef142eced1d84907566ed88602ccb047281c11de106817b8dff9b9
Engil/Toolboy
addressable.ml
type t = { buffer : bytes; get : int -> Uint8.t; set : int -> Uint8.t -> unit; } exception Out_of_range of string let make ?buffer ~name (b, e) = let get buffer addr = try Bytes.unsafe_get buffer (addr - b) with | Invalid_argument _ -> let err = Printf.sprintf "tried to get byt...
null
https://raw.githubusercontent.com/Engil/Toolboy/04fcda69a8b1c79a68fe316a1e85d70c93238a0c/lesserboy/addressable.ml
ocaml
type t = { buffer : bytes; get : int -> Uint8.t; set : int -> Uint8.t -> unit; } exception Out_of_range of string let make ?buffer ~name (b, e) = let get buffer addr = try Bytes.unsafe_get buffer (addr - b) with | Invalid_argument _ -> let err = Printf.sprintf "tried to get byt...
cdd454b1cbaad56da4b5e69747c1326b619e16b33b31a219b2457b4eeac0dd4b
gowthamk/ocaml-irmin
iset_imp.ml
open Printf open Lwt.Infix open Irmin_unix module type Config = sig val root : string val shared : string val init : unit -> unit end let from_just op msg = match op with | Some x -> x | None -> failwith @@ (msg ^ ": Expected Some. Got None.") module MakeVersioned(Config:Config)(Atom:Set_imp.ATOM) = struct module OM =...
null
https://raw.githubusercontent.com/gowthamk/ocaml-irmin/54775f6c3012e87d2d0308f37a2ec7b27477e887/set/mem/iset_imp.ml
ocaml
printf "%s\n" (Fmt.to_to_string K.pp k);
open Printf open Lwt.Infix open Irmin_unix module type Config = sig val root : string val shared : string val init : unit -> unit end let from_just op msg = match op with | Some x -> x | None -> failwith @@ (msg ^ ": Expected Some. Got None.") module MakeVersioned(Config:Config)(Atom:Set_imp.ATOM) = struct module OM =...
d059d5a8d4c17330bee57080b4b1f6aefa9c8fe4c8105c64976e88edbe6904b1
andreasabel/Sit
Internal.hs
# LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE DeriveFunctor # # LANGUAGE DeriveFoldable # {-# LANGUAGE DeriveTraversable #-} # LANGUAGE TemplateHaskell # -- | Internal Syntax. module Internal where import Data.Foldable (Foldable) import Data.Traversable (Traversable) import Lens -- | Definition names are stri...
null
https://raw.githubusercontent.com/andreasabel/Sit/330c7d4582a2c602c7bf034670152ea57056dd40/src/Internal.hs
haskell
# LANGUAGE DeriveTraversable # | Internal Syntax. | Definition names are strings. | Variables are de Bruijn indices. | Size expressions. | Terms/types | Universe with level. | Type of sizes (internal use only). | Sized natural number type. | Successor constructor, or successor size (then @Size@ is ignored). |...
# LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE DeriveFunctor # # LANGUAGE DeriveFoldable # # LANGUAGE TemplateHaskell # module Internal where import Data.Foldable (Foldable) import Data.Traversable (Traversable) import Lens type Id = String newtype Index = Index { dbIndex :: Int } deriving (Eq, Ord, Show,...