_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
68eebc2b7532b0fde8b9da110942296dfb9c0c24b62a79a28b5d249d5c8a26fc
originrose/cortex
train.clj
(ns cortex.experiment.train (:require [clojure.java.io :as io] [think.parallel.core :as parallel] [cortex.optimize :as opt] [cortex.optimize.adam :as adam] [cortex.nn.execute :as execute] [cortex.nn.compute-binding :as compute-binding] [cortex.nn...
null
https://raw.githubusercontent.com/originrose/cortex/94b1430538e6187f3dfd1697c36ff2c62b475901/experiment/src/cortex/experiment/train.clj
clojure
TODO: No need for context here. global arguments per-epoch arguments [{:keys [network train-ds-fn test-ds-fn optimizer train-fn epoch-eval-fn] :as recur-args}] If someone is training with an infinite data sequence they have to actually pass in a function that when called returns the next epoch of data. This is th...
(ns cortex.experiment.train (:require [clojure.java.io :as io] [think.parallel.core :as parallel] [cortex.optimize :as opt] [cortex.optimize.adam :as adam] [cortex.nn.execute :as execute] [cortex.nn.compute-binding :as compute-binding] [cortex.nn...
8b688980ce886600c90c484bddee7a8eb6f7c582ad79f3914a527db980fec50d
chetmurthy/poly-protobuf
test12_ml.ml
module T = Test12_types module Pb = Test12_pb module Pp = Test12_pp let decode_ref_data () = T.({ to_ = 1l; type_ = 1l; }) let () = let mode = Test_util.parse_args () in match mode with | Test_util.Decode -> Test_util.decode "test12.c2ml.data" Pb.decode_m Pp.pp_m (decode_ref_data ()) |...
null
https://raw.githubusercontent.com/chetmurthy/poly-protobuf/1f80774af6472fa30ee2fb10d0ef91905a13a144/tests/testdata/integration-tests/test12_ml.ml
ocaml
module T = Test12_types module Pb = Test12_pb module Pp = Test12_pp let decode_ref_data () = T.({ to_ = 1l; type_ = 1l; }) let () = let mode = Test_util.parse_args () in match mode with | Test_util.Decode -> Test_util.decode "test12.c2ml.data" Pb.decode_m Pp.pp_m (decode_ref_data ()) |...
8d2650ea426d40100235cd5b6e59f3e3029b375f09a1bbfa6a674bf23c062c30
scicloj/clj-djl
nn.clj
(ns clj-djl.nn (:require [clj-djl.ndarray :as nd] [clj-djl.model :as m] [clj-djl.utils :as utils]) (:import [ai.djl.nn Activation SequentialBlock] [ai.djl.nn.core Linear] [ai.djl.nn Blocks] [ai.djl.training.initializer NormalInitializer] [ai.djl.nn.convolutional Conv2d] [ai.djl.nn.norm Ba...
null
https://raw.githubusercontent.com/scicloj/clj-djl/d735c5885ca82a4b69cc51d6a4a8897ca9f804f1/src/clj_djl/nn.clj
clojure
(ns clj-djl.nn (:require [clj-djl.ndarray :as nd] [clj-djl.model :as m] [clj-djl.utils :as utils]) (:import [ai.djl.nn Activation SequentialBlock] [ai.djl.nn.core Linear] [ai.djl.nn Blocks] [ai.djl.training.initializer NormalInitializer] [ai.djl.nn.convolutional Conv2d] [ai.djl.nn.norm Ba...
b3c1a43b66dfd13747b9ca5dfc797924d12c39abe0d49c94d0182d54cf67b94e
tfeb/tfeb-lisp-toys
locatives.lisp
This is not really ;;; #+org.tfeb.tools.require-module (org.tfeb.tools.require-module:needs :org.tfeb.hax.collecting) (defpackage :org.tfeb.toys.locatives (:use :cl :org.tfeb.hax.collecting) (:export #:locative #:with-locatives #:locf)) (in-package :org.tfeb.toys.locatives) (provide :org.tfeb.toys....
null
https://raw.githubusercontent.com/tfeb/tfeb-lisp-toys/875bce2bc994e6104b74d56319622463afb05cd1/locatives.lisp
lisp
This is not really #+org.tfeb.tools.require-module (org.tfeb.tools.require-module:needs :org.tfeb.hax.collecting) (defpackage :org.tfeb.toys.locatives (:use :cl :org.tfeb.hax.collecting) (:export #:locative #:with-locatives #:locf)) (in-package :org.tfeb.toys.locatives) (provide :org.tfeb.toys.loca...
e3de6f3d58ce540d0ce34ca853b26c7c17c78507d9680be12b5edf8516835e16
racket/gui
interactive-value-port.rkt
#lang racket/base (require racket/pretty racket/gui/base racket/class "syntax-browser.rkt") (provide set-interactive-display-handler set-interactive-write-handler set-interactive-print-handler) (define op (current-output-port)) (define (oprintf . x) (appl...
null
https://raw.githubusercontent.com/racket/gui/d1fef7a43a482c0fdd5672be9a6e713f16d8be5c/gui-lib/mrlib/interactive-value-port.rkt
racket
these handlers aren't used, but are set to override the user's settings
#lang racket/base (require racket/pretty racket/gui/base racket/class "syntax-browser.rkt") (provide set-interactive-display-handler set-interactive-write-handler set-interactive-print-handler) (define op (current-output-port)) (define (oprintf . x) (appl...
c2c3013be8a4abf44d6b8e2285dd1cfc693f97d67f4d2387349b9c21e657fe5c
jordwalke/rehp
splay.ml
// Copyright 2009 the V8 project authors . All rights reserved . // Redistribution and use in source and binary forms , with or without // modification , are permitted provided that the following conditions are // met : // // * Redistributions of source code must retain the above copyright // ...
null
https://raw.githubusercontent.com/jordwalke/rehp/f122b94f0a3f06410ddba59e3c9c603b33aadabf/benchmarks/sources/ml/splay.ml
ocaml
not found zig not found zig-zig zig-zag zag not found zag-zag not found zag-zig here we do not splay (but that's what the original program does) // Verify that the splay tree has the right size. // Verify that the splay tree has sorted, unique keys. // Replace a few nodes in the splay tree...
// Copyright 2009 the V8 project authors . All rights reserved . // Redistribution and use in source and binary forms , with or without // modification , are permitted provided that the following conditions are // met : // // * Redistributions of source code must retain the above copyright // ...
32da7cc71eb25a0514088a4ae8e1822e46f8be0b43f97f2a18dff3751534093d
tree-sitter/haskell-tree-sitter
JSON.hs
module TreeSitter.JSON ( tree_sitter_json , getNodeTypesPath , getTestCorpusDir ) where import Foreign.Ptr import TreeSitter.Language import Paths_tree_sitter_json foreign import ccall unsafe "vendor/tree-sitter-json/src/parser.c tree_sitter_json" tree_sitter_json :: Ptr Language getNodeTypesPath :: IO FilePath getN...
null
https://raw.githubusercontent.com/tree-sitter/haskell-tree-sitter/8a5a2b12a3c36a8ca7e117fff04023f1595e04e7/tree-sitter-json/TreeSitter/JSON.hs
haskell
module TreeSitter.JSON ( tree_sitter_json , getNodeTypesPath , getTestCorpusDir ) where import Foreign.Ptr import TreeSitter.Language import Paths_tree_sitter_json foreign import ccall unsafe "vendor/tree-sitter-json/src/parser.c tree_sitter_json" tree_sitter_json :: Ptr Language getNodeTypesPath :: IO FilePath getN...
c3cecbc853fd21f7a8cc980a416585542c50f2f05d13b4b46f075e0e797ff94b
FlowerWrong/mblog
shop.erl
%% --- Excerpted from " Programming Erlang , Second Edition " , published by The Pragmatic Bookshelf . %% Copyrights apply to this code. It may not be used to create training material, %% courses, books, articles, and the like. Contact us if you are in doubt. %% We make no guarantees that this code is fit for...
null
https://raw.githubusercontent.com/FlowerWrong/mblog/3233ede938d2019a7b57391405197ac19c805b27/categories/erlang/demo/jaerlang2_code/shop.erl
erlang
--- Copyrights apply to this code. It may not be used to create training material, courses, books, articles, and the like. Contact us if you are in doubt. We make no guarantees that this code is fit for any purpose. Visit for more book information. --- END:function
Excerpted from " Programming Erlang , Second Edition " , published by The Pragmatic Bookshelf . -module(shop). -export([cost/1]). cost(oranges) -> 5; cost(newspaper) -> 8; cost(apples) -> 2; cost(pears) -> 9; cost(milk) -> 7.
a4aaeb045e9fc687c3cc50ec0a580796527e1ab0e170cca9604af54c6b44178e
jaspervdj/advent-of-code
20.hs
# LANGUAGE BangPatterns # # LANGUAGE DeriveGeneric # import Data.Char (isDigit) import Data.Hashable (Hashable) import qualified Data.HashMap.Strict as HMS import Data.Maybe (mapMaybe) import Data.Ord (comparing) import qualified Data.Vector ...
null
https://raw.githubusercontent.com/jaspervdj/advent-of-code/bdc9628d1495d4e7fdbd9cea2739b929f733e751/2017/20.hs
haskell
# UNPACK # # UNPACK # # UNPACK # # UNPACK # # UNPACK # # UNPACK # acceleration.
# LANGUAGE BangPatterns # # LANGUAGE DeriveGeneric # import Data.Char (isDigit) import Data.Hashable (Hashable) import qualified Data.HashMap.Strict as HMS import Data.Maybe (mapMaybe) import Data.Ord (comparing) import qualified Data.Vector ...
aab261655bb1f61f1d3382fdd11df354eeaa50ced8d69dc9820cbc7a3342ed14
Frama-C/Frama-C-snapshot
analysis.ml
(**************************************************************************) (* *) This file is part of Frama - C. (* *) Copyright ...
null
https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/value/engine/analysis.ml
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...
29c6b54d63175e133eb346f2bd5a1b703f9daeb0ba3f56a9479041cfeb43f64e
blockfrost/blockfrost-haskell
Env.hs
-- | Blockfrost environments module Blockfrost.Env ( Env (..) , parseEnv ) where import Data.Text (Text) import qualified Data.Text import GHC.Generics (Generic) import qualified Text.Read -- | Blockfrost environments -- Corresponds to Network when creating a Blockfrost project . -- Each environment has sepa...
null
https://raw.githubusercontent.com/blockfrost/blockfrost-haskell/5ced57686d95e7b14569e96f4244b701f1e321e4/blockfrost-api/src/Blockfrost/Env.hs
haskell
| Blockfrost environments | Blockfrost environments Each environment has separate token. | Try parsing @Env@ from @Text@
module Blockfrost.Env ( Env (..) , parseEnv ) where import Data.Text (Text) import qualified Data.Text import GHC.Generics (Generic) import qualified Text.Read Corresponds to Network when creating a Blockfrost project . data Env = Ipfs | Mainnet | Testnet | Preprod | Preview | Localhost deriv...
3566c707f6a7342a1ac70da3e81433715c4b1f8ecb26460a1e4135f1e6d08c43
erlangonrails/devdb
kai_memcache.erl
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not use this file except in compliance with the License . You may obtain a copy of % the License at % % -2.0 % % Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an ...
null
https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/kai-0.4.0/src/kai_memcache.erl
erlang
the License at -2.0 Unless required by applicable law or agreed to in writing, software WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.
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 distributed under the License is distributed on an " AS IS " BASIS , WITHOUT -module(kai_memcache). -behaviour(kai_tcp_server). -export([start_link/0...
234720329ab12c35eaf5c23c3eb5b36193a6b6f6833535fc5f0ccbd260a6e27f
wireless-net/erlang-nommu
b.erl
` ` The contents of this file are subject to the Erlang Public License , Version 1.1 , ( the " License " ) ; you may not use this file except in %% compliance with the License. You should have received a copy of the %% Erlang Public License along with this software. If not, it can be %% retrieved via the world wide...
null
https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/sasl/test/release_handler_SUITE_data/c/b.erl
erlang
compliance with the License. You should have received a copy of the Erlang Public License along with this software. If not, it can be retrieved via the world wide web at /. basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the License for the specific language governing rights and limitations u...
` ` The contents of this file are subject to the Erlang Public License , Version 1.1 , ( the " License " ) ; you may not use this file except in Software distributed under the License is distributed on an " AS IS " The Initial Developer of the Original Code is Ericsson Utvecklings AB . Portions created by Eri...
bf7ff241b58b51073e6b63254c08f4bfae84dfae03c27cac81f1554acde42894
gonimo/gonimo
Route.hs
# LANGUAGE EmptyCase # # LANGUAGE FlexibleContexts # {-# LANGUAGE GADTs #-} # LANGUAGE LambdaCase # {-# LANGUAGE RankNTypes #-} # LANGUAGE TemplateHaskell # # LANGUAGE KindSignatures # # LANGUAGE EmptyCase # # LANGUAGE MultiParamTypeClasses # # LANGUAGE FlexibleInstances # {-# LANGUAGE OverloadedStrings #-} module Com...
null
https://raw.githubusercontent.com/gonimo/gonimo/f4072db9e56f0c853a9f07e048e254eaa671283b/common/src/Common/Route.hs
haskell
# LANGUAGE GADTs # # LANGUAGE RankNTypes # # LANGUAGE OverloadedStrings # You will probably want these imports for composing Encoders . | Used to handle unparseable routes. You can define any routes that will be handled specially by the backend here. i.e. These do not serve the frontend, but do something different...
# LANGUAGE EmptyCase # # LANGUAGE FlexibleContexts # # LANGUAGE LambdaCase # # LANGUAGE TemplateHaskell # # LANGUAGE KindSignatures # # LANGUAGE EmptyCase # # LANGUAGE MultiParamTypeClasses # # LANGUAGE FlexibleInstances # module Common.Route where import Prelude hiding ( i d , ( . ) ) import Control . Category ...
1be15582bd088548e16616b3f7f431532731df51fdad0e2fb40025e06e183006
melisgl/mgl
conjugate-gradient.lisp
Conjugate gradient descent along the lines described by ;;;; Rasmussen at ;;;; /~delve/methods/mlp-ese-1/minimize.ps.gz ;;;; and / . ;;;; ;;;; Licensing needs to be clarified with upstream author. (in-package :mgl-cg) (defsection @mgl-cg (:title "Conjugate Gradient") "Conjugate gradient is a first-order optimiza...
null
https://raw.githubusercontent.com/melisgl/mgl/27a2552632a6a9330c1a133e519e676d9c6ca714/src/conjugate-gradient.lisp
lisp
Rasmussen at /~delve/methods/mlp-ese-1/minimize.ps.gz and / . Licensing needs to be clarified with upstream author. Create an object representing the sine function. We are going to optimize its only parameter. parameters are being optimized. Create a differentiable function for f(x,y)=(x-y)^2. X is a MINIMIZE...
Conjugate gradient descent along the lines described by (in-package :mgl-cg) (defsection @mgl-cg (:title "Conjugate Gradient") "Conjugate gradient is a first-order optimization algorithm. It's more advanced than gradient descent as it does line searches which unfortunately also makes it unsuitable for non-de...
7b0687e56de459a9f4587863b3a5083dd68b283390468302d55692ee6c295553
flatironinstitute/flathub
HDF5.hs
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes #-} # LANGUAGE RecordWildCards # # LANGUAGE TupleSections # # LANGUAGE ViewPatterns # module Ingest.HDF5 ( ingestHDF5 ) where import Control.Arrow ((&&&)) import Control.Exception (bracket, handleJust) import Control.Monad (f...
null
https://raw.githubusercontent.com/flatironinstitute/flathub/767c97b32a7de729b5f076c5e4da54debe478541/src/Ingest/HDF5.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE RankNTypes # replicate n 0 not quite right name handling XXX only top-level ingest flags processed here
# LANGUAGE RecordWildCards # # LANGUAGE TupleSections # # LANGUAGE ViewPatterns # module Ingest.HDF5 ( ingestHDF5 ) where import Control.Arrow ((&&&)) import Control.Exception (bracket, handleJust) import Control.Monad (foldM, guard, when, unless) import Control.Monad.IO.Cl...
9f863cd5e7b3df133a103e44404eec774a7181a5a8eb2486a5d4d12dfd87a454
alonsodomin/groot
Service.hs
{-# LANGUAGE OverloadedStrings #-} module Groot.CLI.Service ( ServiceSubCmd , serviceCmds , runServiceCmd ) where import Control.Exception.Lens import Control.Monad.Catch import Data.Semigroup ((<>)) import qualified Data.Text as T import ...
null
https://raw.githubusercontent.com/alonsodomin/groot/040215db2797bef27b1c336ea826a58ddd45f8de/src/Groot/CLI/Service.hs
haskell
# LANGUAGE OverloadedStrings # CLI Error handlers run function
module Groot.CLI.Service ( ServiceSubCmd , serviceCmds , runServiceCmd ) where import Control.Exception.Lens import Control.Monad.Catch import Data.Semigroup ((<>)) import qualified Data.Text as T import Options.Applicative import...
ce8dc87ea1f930f415aafff4d2867a51657b85c68cbf5c98eef4e1d69de0c22e
flipstone/orville
QueryKey.hs
| Module : Database . Orville . PostgreSQL.Internal . QueryKey Copyright : Flipstone Technology Partners 2016 - 2018 License : MIT Module : Database.Orville.PostgreSQL.Internal.QueryKey Copyright : Flipstone Technology Partners 2016-2018 License : MIT -} # LANGUAGE CPP # module Database.Orville.Pos...
null
https://raw.githubusercontent.com/flipstone/orville/aee8d7a47ab3a7b442fdb274dbb5a95d687a23ce/orville-postgresql/src/Database/Orville/PostgreSQL/Internal/QueryKey.hs
haskell
| Module : Database . Orville . PostgreSQL.Internal . QueryKey Copyright : Flipstone Technology Partners 2016 - 2018 License : MIT Module : Database.Orville.PostgreSQL.Internal.QueryKey Copyright : Flipstone Technology Partners 2016-2018 License : MIT -} # LANGUAGE CPP # module Database.Orville.Pos...
3f3526da407010e16bf8af7291cc66f2e2944f75679e62c0569fa8b6c1d8c974
clj-commons/rewrite-clj
find.clj
(ns ^:no-doc rewrite-clj.zip.find "This ns exists to preserve compatability for rewrite-clj v0 clj users who were using an internal API. This ns does not work for cljs due to namespace collisions." (:refer-clojure :exclude [find]) (:require [rewrite-clj.zip.findz])) (set! *warn-on-reflection* true) #_{:impor...
null
https://raw.githubusercontent.com/clj-commons/rewrite-clj/7621126caae5f21dc5150d52a6c9b747dc0aeeff/template/rewrite_clj/zip/find.clj
clojure
(ns ^:no-doc rewrite-clj.zip.find "This ns exists to preserve compatability for rewrite-clj v0 clj users who were using an internal API. This ns does not work for cljs due to namespace collisions." (:refer-clojure :exclude [find]) (:require [rewrite-clj.zip.findz])) (set! *warn-on-reflection* true) #_{:impor...
56259f44a2c8a2c887a98953c5f7f558c13acc47f34c997f8226f8cf6e0fe327
rpav/cl-xcb-xlib
swig-util.lisp
(in-package :xcb) (defun custom-lispify (name flag &optional (package *package*)) (cond ((eq flag 'structname) (list :struct (swig-lispify name flag package))) ((eq flag 'unionname) (list :union (swig-lispify name flag package))) ((eq flag 'structname-decl) `(,(swig-lispify name flag package) ...
null
https://raw.githubusercontent.com/rpav/cl-xcb-xlib/1b00c44d4723b3a8334f36e731906d4679341c0e/src/swig-util.lisp
lisp
(in-package :xcb) (defun custom-lispify (name flag &optional (package *package*)) (cond ((eq flag 'structname) (list :struct (swig-lispify name flag package))) ((eq flag 'unionname) (list :union (swig-lispify name flag package))) ((eq flag 'structname-decl) `(,(swig-lispify name flag package) ...
c55ae55ee93b9db2f1fb980a5963cf07ae370870210bb74a1b674bc7178b6c12
gowthamk/ocaml-irmin
test3.ml
(* Utility functions *) U is a module with two functions module U = struct let string_of_list f l = "[ " ^ List.fold_left (fun a b -> a ^ (f b) ^ "; ") "" l ^ "]" let print_header h = Printf.printf "%s" ("\n" ^ h ^ "\n") end let _ = U.print_header "List"; let module MkConfig (Vars: sig val root: string end)...
null
https://raw.githubusercontent.com/gowthamk/ocaml-irmin/54775f6c3012e87d2d0308f37a2ec7b27477e887/list/test3.ml
ocaml
Utility functions
U is a module with two functions module U = struct let string_of_list f l = "[ " ^ List.fold_left (fun a b -> a ^ (f b) ^ "; ") "" l ^ "]" let print_header h = Printf.printf "%s" ("\n" ^ h ^ "\n") end let _ = U.print_header "List"; let module MkConfig (Vars: sig val root: string end) : Ilist.Config = struct...
2ea5566287e6d0017c2e1264bec226b696d4f9b48760bc95ac50c053b27b9d88
kelamg/HtDP2e-workthrough
ex341.rkt
The first three lines of this file were inserted by . They record metadata ;; about the language level of this file in a form that our tools can easily process. #reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex341) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-...
null
https://raw.githubusercontent.com/kelamg/HtDP2e-workthrough/ec05818d8b667a3c119bea8d1d22e31e72e0a958/HtDP/Intertwined-Data/ex341.rkt
racket
about the language level of this file in a form that our tools can easily process. A File is a structure: (make-file String N String) A Dir is a structure: (make-dir String [List-of Dir] [List-of File]) Dir -> N
The first three lines of this file were inserted by . They record metadata #reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex341) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f))) (require htdp/dir) (require 2htdp/abstraction) (def...
0a622aa0da0369f5774074236df4a12681aaefdfcef147b063569b92f47b1ca7
naga-framework/naga
naga_cowboy.erl
-module(naga_cowboy). -description('NAGA Cowboy Server Bridge to HTTP Server Pages'). -author('Roman Shestakov'). -behaviour(cowboy_http_handler). -include_lib("n2o/include/wf.hrl"). -export([init/3, handle/2, terminate/3]). -compile(export_all). -record(state, {headers, body}). % Cowboy HTTP Handler init(_Transport,...
null
https://raw.githubusercontent.com/naga-framework/naga/d859a7880228d3509cc12dc53e6f33c0edfeaf67/src/naga_cowboy.erl
erlang
Cowboy HTTP Handler Cowboy Bridge Abstraction
-module(naga_cowboy). -description('NAGA Cowboy Server Bridge to HTTP Server Pages'). -author('Roman Shestakov'). -behaviour(cowboy_http_handler). -include_lib("n2o/include/wf.hrl"). -export([init/3, handle/2, terminate/3]). -compile(export_all). -record(state, {headers, body}). init(_Transport, Req, Opts) -> {o...
1a39f1168b6de7ca572c8a33250c81f10b9dd8439775ff924803b93af371be73
tnelson/Forge
lone.rkt
#lang forge option run_sterling off option verbose 0 sig Node { edge: lone Node } test expect Lone { positive: { all n: Node | lone n.edge } is theorem negativeNo: { some n: Node | no n.edge } is sat negativeOne: { some n: Node | one n.edge } is sat }
null
https://raw.githubusercontent.com/tnelson/Forge/a7187ef110f46493c1d45011035b05646b9ccd22/forge/tests/forge/relations/lone.rkt
racket
#lang forge option run_sterling off option verbose 0 sig Node { edge: lone Node } test expect Lone { positive: { all n: Node | lone n.edge } is theorem negativeNo: { some n: Node | no n.edge } is sat negativeOne: { some n: Node | one n.edge } is sat }
80c4de2abc5b7a0a24a289a10bf91439620f95db5cb77b14e7352d24b64588d9
christiaanb/clash
HsTools.hs
module CLasH.Utils.HsTools where -- Standard modules import qualified Unsafe.Coerce import qualified Maybe GHC API import qualified GHC import qualified HscMain import qualified HscTypes import qualified DynFlags import qualified FastString import qualified StringBuffer import qualified MonadUtils import Outputable...
null
https://raw.githubusercontent.com/christiaanb/clash/18247975e8bbd3f903abc667285e11228a640457/clash/CLasH/Utils/HsTools.hs
haskell
Standard modules checking, simplification of class instances and desugaring. The result is a let expression that holds the given expression and a number of binds that let (==) = Prelude.(==) Int $dInt in ^ The resulting core expression. Translage the TcRn (typecheck-rename) monad into an IO monad Trans...
module CLasH.Utils.HsTools where import qualified Unsafe.Coerce import qualified Maybe GHC API import qualified GHC import qualified HscMain import qualified HscTypes import qualified DynFlags import qualified FastString import qualified StringBuffer import qualified MonadUtils import Outputable ( showSDoc, ppr ) i...
54cab44f121fc1fdd760820cf4c808daa01f5f6c7c3f1fc5e1ab4954c47442ef
alhimik45/three-man-chess
project.clj
(defproject three-man-chess "0.1.0-SNAPSHOT" :dependencies [[org.clojure/clojure "1.6.0"] [tailrecursion/boot.core "2.5.1" :exclusions [[org.clojure/clojure]]] [tailrecursion/boot.task "2.2.4"] [tailrecursion/hoplon "5.10.24"] [org.clojure/clojure "1.6.0"] [tailrecursion/javelin "3.7.1"] [org.clojure/co...
null
https://raw.githubusercontent.com/alhimik45/three-man-chess/ffde0eb152d795aac829a9e82f4bbd0b6455659c/project.clj
clojure
(defproject three-man-chess "0.1.0-SNAPSHOT" :dependencies [[org.clojure/clojure "1.6.0"] [tailrecursion/boot.core "2.5.1" :exclusions [[org.clojure/clojure]]] [tailrecursion/boot.task "2.2.4"] [tailrecursion/hoplon "5.10.24"] [org.clojure/clojure "1.6.0"] [tailrecursion/javelin "3.7.1"] [org.clojure/co...
29a74b975bbf0170d97a9c276b9121d6f6a77b358c8314bd9bd12c00289cbfc4
mbenke/zpf2013
MergeSort.hs
module MergeSort (mergeSort) where mergeSort :: (a -> a -> Ordering) -> [a] -> [a] mergeSort pred = go where go [] = [] go [x] = [x] go xs = merge (go xs1) (go xs2) where (xs1,xs2) = split xs merge xs [] = xs merge [] ys = ys merge (x:xs) (y:ys) = case pred x y of GT -> y...
null
https://raw.githubusercontent.com/mbenke/zpf2013/85f32747e17f07a74e1c3cb064b1d6acaca3f2f0/Slides/13QC/MergeSort.hs
haskell
module MergeSort (mergeSort) where mergeSort :: (a -> a -> Ordering) -> [a] -> [a] mergeSort pred = go where go [] = [] go [x] = [x] go xs = merge (go xs1) (go xs2) where (xs1,xs2) = split xs merge xs [] = xs merge [] ys = ys merge (x:xs) (y:ys) = case pred x y of GT -> y...
7b1cd2687a74c118ef8a29eeb2f0155b9ffb9bf07f3fcb23d9b0069513062fc9
lispbuilder/lispbuilder
packages.lisp
-*- Mode : Lisp ; Syntax : Common - Lisp ; Base : 10 -*- (defpackage LISPBUILDER-REGEX #+:Genera (:use COMMON-LISP CLOS) #-:Genera (:use COMMON-LISP) (:export ;; compiler "PARSE-STR" "COMPILE-STR" "COMPILE-EXPR" "MACROEXPAND-REGEX-STR" "MACROEXPAND-REGEX-EXPR" "DEFREGEX" ;; match/scan ...
null
https://raw.githubusercontent.com/lispbuilder/lispbuilder/589b3c6d552bbec4b520f61388117d6c7b3de5ab/lispbuilder-regex/packages.lisp
lisp
Syntax : Common - Lisp ; Base : 10 -*- compiler match/scan matcher structure Accessors into match registers. Overloaded on string, symbol, matcher, and register array. housekeeping tweak the syntax, speed, etc. regex as sexpr special char classes
(defpackage LISPBUILDER-REGEX #+:Genera (:use COMMON-LISP CLOS) #-:Genera (:use COMMON-LISP) (:export "PARSE-STR" "COMPILE-STR" "COMPILE-EXPR" "MACROEXPAND-REGEX-STR" "MACROEXPAND-REGEX-EXPR" "DEFREGEX" "MATCH-STR" "SCAN-STR" "MATCHER" "MATCHER-P" "MATCHER-MATCHFN" "MATCHER-NUMREGS" "RE...
9be22eaa1c4fb68229f3733af5afdccce18234345ca3eba280bccba1269c7954
facebook/pyre-check
classIntervalSetGraph.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/pyre-check/8e719a317120478e869becfc8064a4c7c9993244/source/interprocedural/classIntervalSetGraph.mli
ocaml
* Mapping from a class name to its class interval set, stored in the ocaml heap. * Mapping from a class name to its class interval set, stored in shared memory. * Return the current class interval graph in shared memory. Only exposed for tests.
* 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...
aefa3cec351f4d78d654c99bf6177e048e3774111305d347a139ebe5e1bfd80d
soegaard/remacs
ring-buffer.rkt
#lang racket/base (require racket/match racket/format) ;;; ;;; RING BUFFER (AKA CIRCULAR STACK) ;;; (provide new-ring ring-insert! ring-ref ring-set! ring->list in-ring ring-empty?) ; A ring buffer holds up to max-size elements. ; The next element is inserted at index index. ; Inserting elements in a full buffer will...
null
https://raw.githubusercontent.com/soegaard/remacs/8681b3acfe93335e2bc2133c6f144af9e0a1289e/ring-buffer.rkt
racket
RING BUFFER (AKA CIRCULAR STACK) A ring buffer holds up to max-size elements. The next element is inserted at index index. Inserting elements in a full buffer will overwrite the oldest element. new-ring : [natural] -> ring make ring with room for max-size elements ring-insert! : ring element -> void insert...
#lang racket/base (require racket/match racket/format) (provide new-ring ring-insert! ring-ref ring-set! ring->list in-ring ring-empty?) (struct ring (buffer index size max-size) #:transparent #:mutable) (define (new-ring [max-size 60]) (ring (make-vector max-size) 0 0 max-size)) (define (ring-insert! r x) (ma...
7fa1c29e59f4e1b753b1ca459e650aefd098099e9610832b98638a6cfbff9422
kitlangton/eulerplate
Renderer.hs
{-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} # LANGUAGE RecordWildCards # module Eulerplate.Renderer where import Data.Text as T hiding (init, length) import Eulerplate.Parser import Eulerplate.Types import Text.Casing (camel) import ...
null
https://raw.githubusercontent.com/kitlangton/eulerplate/ac6c0c14a0190a570cb88b3ad4e711c98782f7b8/src/Eulerplate/Renderer.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE QuasiQuotes # Eulerplate generated spec for #{title} Challenge url: #{url}. Eulerplate generated module for #{title} Challenge url: #{url}. Write your solution in here. We've attempted to parse the types from the problem sets, but feel free to change it in case we ...
# LANGUAGE RecordWildCards # module Eulerplate.Renderer where import Data.Text as T hiding (init, length) import Eulerplate.Parser import Eulerplate.Types import Text.Casing (camel) import Text.Shakespeare.Text import Turtle hiding (input) writeChalle...
6600ca091e545befb4472db643359c0d773cbe4dd52033652f267354746916b6
mejgun/haskell-tdlib
MessageSendOptions.hs
{-# LANGUAGE OverloadedStrings #-} -- | module TD.Data.MessageSendOptions where import qualified Data.Aeson as A import qualified Data.Aeson.Types as T import qualified TD.Data.MessageSchedulingState as MessageSchedulingState import qualified Utils as U -- | data MessageSendOptions = -- | Options to be used when a m...
null
https://raw.githubusercontent.com/mejgun/haskell-tdlib/e5c8059a74f88073b27dbfafb6908de0729af110/src/TD/Data/MessageSendOptions.hs
haskell
# LANGUAGE OverloadedStrings # | | | Options to be used when a message is sent | Message scheduling state; pass null to send message immediately. Messages sent to a secret chat, live location messages and self-destructing messages can't be scheduled | Pass true if the user explicitly chosen a sticker or a custom e...
module TD.Data.MessageSendOptions where import qualified Data.Aeson as A import qualified Data.Aeson.Types as T import qualified TD.Data.MessageSchedulingState as MessageSchedulingState import qualified Utils as U MessageSendOptions scheduling_state :: Maybe MessageSchedulingState.MessageSchedulingState, u...
e7cbeb49fbc8ac7f988cfe0962703b2b1ae6274553530cfd3492db3b8bd2a318
anwarmamat/cmsc330spring21
disc4.soln.ml
(*The following functions have been provided for your convenience*) let rec map f xs = match xs with | [] -> [] | x :: xt -> (f x)::(map f xt) let rec foldl f a xs = match xs with | [] -> a | x :: xt -> foldl f (f a x) xt let rec foldr f xs a = match xs with | [] -> a | x :: xt -> f x (foldr f xt a) let rec rev...
null
https://raw.githubusercontent.com/anwarmamat/cmsc330spring21/071cb1aab3af77e7d103865d05f27f5c78bed6ef/disc4/src/disc4.soln.ml
ocaml
The following functions have been provided for your convenience Implement these functions here
let rec map f xs = match xs with | [] -> [] | x :: xt -> (f x)::(map f xt) let rec foldl f a xs = match xs with | [] -> a | x :: xt -> foldl f (f a x) xt let rec foldr f xs a = match xs with | [] -> a | x :: xt -> f x (foldr f xt a) let rec rev lst = match lst with | [] -> [] | x :: xt -> (rev xt) @ [x] let mul...
50c5811c0ecf736730f28143757fed72790ab37017d7ac31523b165c038a778b
lazy-cat-io/metaverse
icon.cljs
(ns metaverse.runner.electron.icon (:require [metaverse.runner.electron :as electron])) (defn create-empty [] (.createEmpty electron/NativeImage)) (defn create-from-path [path] (some->> path (.createFromPath electron/NativeImage)))
null
https://raw.githubusercontent.com/lazy-cat-io/metaverse/2e5754967ac0e4219197da3ff6937b666d2d26fa/src/main/clojure/metaverse/runner/electron/icon.cljs
clojure
(ns metaverse.runner.electron.icon (:require [metaverse.runner.electron :as electron])) (defn create-empty [] (.createEmpty electron/NativeImage)) (defn create-from-path [path] (some->> path (.createFromPath electron/NativeImage)))
a283ac06ff2b3ff3a35b4f6689212ad7e803eebdca68ffe5e6e9560fd06e8470
nchataing/caml-migrate-floatarray
par.mli
(******************************************************************) Copyright ( C ) 2020 - 2021 . All rights reserved . (* *) (* This software may be modified and distributed under the terms *) of the BSD license . See the LICENSE file for details...
null
https://raw.githubusercontent.com/nchataing/caml-migrate-floatarray/9e7bb55ba7a801f20cdd9ce7701f0bb0200c1459/src/par.mli
ocaml
**************************************************************** This software may be modified and distributed under the terms **************************************************************** * Iterator based on Tast_iterator.default_iterator that comp...
Copyright ( C ) 2020 - 2021 . All rights reserved . of the BSD license . See the LICENSE file for details . val iterator : Tast_iterator.iterator val put : unit -> bool val put_on_child : Typedtree.expression -> bool
603300e5129562b5ff7922fb56a2340c8b5e0329d491f61e136019be7d404d55
kupl/FixML
sub24.ml
type aexp = | Const of int | Var of string | Power of string * int | Times of aexp list | Sum of aexp list let rec diff : aexp * string -> aexp = fun (aexp,x) -> match aexp with | Const c -> Const c | Var v -> (match v with | x -> Times [Const 0;Var x]) | Power (p,a) -> (match p,a with | ...
null
https://raw.githubusercontent.com/kupl/FixML/0a032a733d68cd8ccc8b1034d2908cd43b241fce/benchmarks/differentiate/diff1/submissions/sub24.ml
ocaml
type aexp = | Const of int | Var of string | Power of string * int | Times of aexp list | Sum of aexp list let rec diff : aexp * string -> aexp = fun (aexp,x) -> match aexp with | Const c -> Const c | Var v -> (match v with | x -> Times [Const 0;Var x]) | Power (p,a) -> (match p,a with | ...
e3f507112ce398aa63bf8e8419d9df0c344f5fee97b532e62cfe978f4cbedbd5
input-output-hk/cardano-wallet
NonEmptyMap.hs
-- | Copyright : © 2018 - 2020 IOHK -- License: Apache-2.0 -- -- Provides a strict implementation of a non-empty map. -- -- This implementation is based on the implementation of 'Data.Map.Strict' -- provided by the 'containers' package, but provides an extra guarantee that the map contains at least one entry at all...
null
https://raw.githubusercontent.com/input-output-hk/cardano-wallet/4dd33e7842f5cf3d33ffdfde35a3398504cc7dc0/lib/strict-non-empty-containers/src/Data/Map/Strict/NonEmptyMap.hs
haskell
| License: Apache-2.0 Provides a strict implementation of a non-empty map. This implementation is based on the implementation of 'Data.Map.Strict' provided by the 'containers' package, but provides an extra guarantee * Map type * Construction * Deconstruction * Insertion * Deletion * Lookup * Combination
Copyright : © 2018 - 2020 IOHK that the map contains at least one entry at all times . module Data.Map.Strict.NonEmptyMap ( NonEmptyMap , fromList , fromMap , singleton , toList , toMap , insert , delete , lookup , unionWith ) where import Data.Map.Strict.Non...
0e9b2eb2cc248020945ffb6c4a29e3bcc69f2ece01299408e2c334d4c1335109
haskell-gi/haskell-gi
Callable.hs
module Data.GI.GIR.Callable ( Callable(..) , parseCallable ) where import Data.GI.GIR.Arg (Arg(..), parseArg, parseTransfer) import Data.GI.GIR.BasicTypes (Transfer(..), Type) import Data.GI.GIR.Parser import Data.GI.GIR.Type (parseOptionalType) data Callable = Callable { returnType :: Maybe Type,...
null
https://raw.githubusercontent.com/haskell-gi/haskell-gi/bff8f3b92bf2594ea3d6745c346a8de594fc3709/lib/Data/GI/GIR/Callable.hs
haskell
| Whether the symbol for this callable can be resolved in the dynamical library associated with the current introspection data. 'Nothing' means that we have not checked yet. Some symbols are present in the @.gir@ file, but they are absent from the library itself. Generating bindings for such symbols could then ...
module Data.GI.GIR.Callable ( Callable(..) , parseCallable ) where import Data.GI.GIR.Arg (Arg(..), parseArg, parseTransfer) import Data.GI.GIR.BasicTypes (Transfer(..), Type) import Data.GI.GIR.Parser import Data.GI.GIR.Type (parseOptionalType) data Callable = Callable { returnType :: Maybe Type,...
7c30e3d0dd38a78995c752940fe5b36b8822b75092aa0abc58294035f58577f5
feliciofilipe/university
Editor.hs
module Editor where -- (0) Imports ----------------------------------------------------------------- import Cp import Direction import Double import Pentuple import Map import Matrix import Tetromino ( 1 ) Datatype definition ----------------------------------------------------- -- | The internal state of a map ...
null
https://raw.githubusercontent.com/feliciofilipe/university/f2b5a00921c97d48033edbe21488ac829927caae/1st/LI1/clean/Tanks1939/src/Editor.hs
haskell
(0) Imports ----------------------------------------------------------------- --------------------------------------------------- | The internal state of a map editor. ^ Type of the current 'Wall'. ^ Current 'Map'. | A sequence of instructions give birth to a map. | An instruction given to an editor. ^ Moves the...
module Editor where import Cp import Direction import Double import Pentuple import Map import Matrix import Tetromino data Editor = Editor ^ cursor ' Position ' given as the current 's top left corner . ^ ' Direction ' of the current ' ' . ^ Type of the current ' ' . } deriving (Read,Show,Eq) outE...
0655ad1a13774cbd1ce39faa69e59a25ea0ba779c50754483bffa89ecd5172d6
manuel-serrano/bigloo
if.scm
;*=====================================================================*/ * serrano / prgm / project / bigloo / comptime / Expand / if.scm * / ;* ------------------------------------------------------------- */ * Author : * / * Creation ...
null
https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/comptime/Expand/if.scm
scheme
*=====================================================================*/ * ------------------------------------------------------------- */ * ------------------------------------------------------------- */ * The `if' macro expansion */ *===========================...
* serrano / prgm / project / bigloo / comptime / Expand / if.scm * / * Author : * / * Creation : We d Dec 28 15:42:10 1994 * / * Last change : Sat Jan 30 05:22:02 2016 ( serrano ) * / * Cop...
c3dab876fb386dcd319f1ac2ca134f540262b851c616b81aad86643e99f55f57
apache/couchdb-mochiweb
mochiweb_multipart.erl
@author < > 2007 Mochi Media , Inc. %% %% Permission is hereby granted, free of charge, to any person obtaining a %% copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction , including without limitation %% the rights to use, copy, modify, merge, ...
null
https://raw.githubusercontent.com/apache/couchdb-mochiweb/845803a5defa693c546ea7250818f226a52d2891/src/mochiweb_multipart.erl
erlang
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), the rights to use, copy, modify, merge, publish, distribute, sublicense, Software is furnished to do so, subject to the following conditions: The above copyright noti...
@author < > 2007 Mochi Media , Inc. to deal in the Software without restriction , including without limitation and/or sell copies of the Software , and to permit persons to whom the all copies or substantial portions of the Software . THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , E...
16941f16800b04f481d8be334d2fa28d3c3ce03d215ec99994db438363c4a4c5
abdulapopoola/SICPBook
Ex2.85.scm
#lang planet neil/sicp ;; INSTALLATION Integer number package Internal implementation (define (rational->integer rat) (make-integer (round (/ (numer rat) (denom rat))))) ;; External interface (put-coercion 'rational 'integer rational->integer) ;; Rational number package Internal procedure (define (real->ratio...
null
https://raw.githubusercontent.com/abdulapopoola/SICPBook/c8a0228ebf66d9c1ddc5ef1fcc1d05d8684f090a/Chapter%202/2.5/Ex2.85.scm
scheme
INSTALLATION External interface Rational number package External interface Real number package External interface Drop can also be achieved by passing in a reversed tower to the raise operator in Ex2.84. copying from 2.84
#lang planet neil/sicp Integer number package Internal implementation (define (rational->integer rat) (make-integer (round (/ (numer rat) (denom rat))))) (put-coercion 'rational 'integer rational->integer) Internal procedure (define (real->rational real) (make-rational (inexact-exact (numerator real)) ...
fd5d1493fffe07cbfab1cb85eadda1e4bf7bd19fe5483cf9682d12c3ca9e4cc4
startalkIM/ejabberd
ejabberd_rdbms.erl
%%%---------------------------------------------------------------------- %%% File : ejabberd_rdbms.erl Author : < > %%% Purpose : Manage the start of the database modules when needed Created : 31 Jan 2003 by < > %%% %%% ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne %%% %%% This program is free ...
null
https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/src/ejabberd_rdbms.erl
erlang
---------------------------------------------------------------------- File : ejabberd_rdbms.erl Purpose : Manage the start of the database modules when needed This program is free software; you can redistribute it and/or License, or (at your option) any later version. This program is distributed in the hop...
Author : < > Created : 31 Jan 2003 by < > ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 2 of the You should have received a copy of the GNU General Public License along ...
bb44e6dc120b9aebaa28149bac00815a9abd9d4caa4e6396f0106f79194be9f2
asakeron/cljs-webgl
separate_blend_function.cljs
(ns cljs-webgl.constants.separate-blend-function) (def blend-dst-rgb 0x80C8) (def blend-src-rgb 0x80C9) (def blend-dst-alpha 0x80CA) (def blend-src-alpha 0x80CB) (def constant-color 0x8001) (def one-minus-constant-color 0x8002) (def constant-alpha 0x8003) (de...
null
https://raw.githubusercontent.com/asakeron/cljs-webgl/f4554fbee6fbc6133a4eb0416548dabd284e735c/src/cljs/cljs_webgl/constants/separate_blend_function.cljs
clojure
(ns cljs-webgl.constants.separate-blend-function) (def blend-dst-rgb 0x80C8) (def blend-src-rgb 0x80C9) (def blend-dst-alpha 0x80CA) (def blend-src-alpha 0x80CB) (def constant-color 0x8001) (def one-minus-constant-color 0x8002) (def constant-alpha 0x8003) (de...
3ee90c654437f40f7edb8c7e1f984ba0ac9d3640beea084b8c06dac94f20157d
facebook/infer
uninit.ml
* Copyright ( c ) Facebook , Inc. and its affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the ...
null
https://raw.githubusercontent.com/facebook/infer/28e867254f6dc8c2a26d749575b472ca0ae27a0f/infer/src/checkers/uninit.ml
ocaml
* Forward analysis to compute uninitialized variables at each program point T30105165 remove filtering after we improve union translation checks that the set of initialized formal parameters defined in the precondition of the function (init_formal_params) contains the (base of) nth formal parameter of the func...
* 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 ...
b3c34f65ba3069e72c2bdef81cc5a7ddd1825a52a5e404815d69fecafbabeb44
elizabethsiegle/reddit-slack-bot
Tokens.hs
# LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # {-#LANGUAGE OverloadedStrings #-} # LANGUAGE ViewPatterns # module Twilio.Tokens ( -- * Resource Token(..) , IceServer(..) , Twilio.Tokens.post ) where import Control.Applicative import Control.Error.Safe import Control.Monad import Control...
null
https://raw.githubusercontent.com/elizabethsiegle/reddit-slack-bot/a52ab60dcaae8e16bee8cdba22fce627157a42d8/twilio-haskell-move-to-stack/src/Twilio/Tokens.hs
haskell
#LANGUAGE OverloadedStrings # * Resource
# LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # # LANGUAGE ViewPatterns # module Twilio.Tokens Token(..) , IceServer(..) , Twilio.Tokens.post ) where import Control.Applicative import Control.Error.Safe import Control.Monad import Control.Monad.Catch import Data.Aeson import qualified Data...
173b736d4eb4d78089e601e394ad8f3df0d7f0042f6a5d0489b7d22b6de04e90
racket/gui
dialog.rkt
#lang racket/base (require racket/class ffi/unsafe "../../syntax.rkt" "../common/queue.rkt" "../common/dialog.rkt" "../../lock.rkt" "types.rkt" "utils.rkt" "frame.rkt") (provide (protect-out dialog%)) (define GTK_WIN_POS_CENTER 1) (defin...
null
https://raw.githubusercontent.com/racket/gui/3025166115abdd519290447f9a9d47c048be6c10/gui-lib/mred/private/wx/gtk/dialog.rkt
racket
#lang racket/base (require racket/class ffi/unsafe "../../syntax.rkt" "../common/queue.rkt" "../common/dialog.rkt" "../../lock.rkt" "types.rkt" "utils.rkt" "frame.rkt") (provide (protect-out dialog%)) (define GTK_WIN_POS_CENTER 1) (defin...
90aeb675b9ef4baa3397a8c165063960ca3ae764b20fbbb18a29c33b0fd306e8
rfindler/lindenmayer
reader.rkt
#lang racket/base (require "../parse.rkt" "../lex.rkt") (provide (rename-out [-read read] [-read-syntax read-syntax] [-get-info get-info])) (define (-read port) (syntax->datum (-read-syntax #f port #f #f #f #f))) (define (-read-syntax name port source line col position) (parse-module port name)) (define (-ge...
null
https://raw.githubusercontent.com/rfindler/lindenmayer/2ef7b4535d8ae1eb7cc2e16e2b630c30a4b9a34d/simple/lang/reader.rkt
racket
#lang racket/base (require "../parse.rkt" "../lex.rkt") (provide (rename-out [-read read] [-read-syntax read-syntax] [-get-info get-info])) (define (-read port) (syntax->datum (-read-syntax #f port #f #f #f #f))) (define (-read-syntax name port source line col position) (parse-module port name)) (define (-ge...
d5f286455b3bcb67eb7d176900ced2549b96d78ab0ae9804596c0586df6f592a
hexlet-basics/exercises-clojure
index.clj
(ns index) ;BEGIN (defn say-boom [v] (when (= v "go") "Boom!")) ;END
null
https://raw.githubusercontent.com/hexlet-basics/exercises-clojure/ede14102d01f9ef736e0af811cd92f5b22a83bc2/modules/20-logic/30-guards/index.clj
clojure
BEGIN END
(ns index) (defn say-boom [v] (when (= v "go") "Boom!"))
2d413666befef09762a19ca9b17254f100a60bc528190db25ca2828536ebf889
Helium4Haskell/helium
EQGroupBug.hs
p _ (x:xs) (rij: rijen ) = if eqString x rij then rij else p xs : rijen
null
https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/simple/typeerrors/Examples/EQGroupBug.hs
haskell
p _ (x:xs) (rij: rijen ) = if eqString x rij then rij else p xs : rijen
a0e5f49b5498cf2ea87836c3cd1a03f361646dd5c2f9e0f1daaeed4df2dad051
haskell-hint/hint
Util.hs
module Hint.Util where import Data.Char type Expr = String @safeBndFor expr@ generates a name such that it does not occur free in @expr@ and , thus , it is safe to write something like @e = expr@ ( otherwise , it will get accidentally bound ) . -- This ought to do the trick: observe that @safeBndFor expr@ c...
null
https://raw.githubusercontent.com/haskell-hint/hint/097e307dce86e39f5ccab044fd539b413348ece4/src/Hint/Util.hs
haskell
This ought to do the trick: observe that @safeBndFor expr@ @expr@.
module Hint.Util where import Data.Char type Expr = String @safeBndFor expr@ generates a name such that it does not occur free in @expr@ and , thus , it is safe to write something like @e = expr@ ( otherwise , it will get accidentally bound ) . contains more digits than @expr@ and , thus , can not occur ins...
e89983645cf9bb5552f20dd16bae68e9306b931a4dafa76522ac3347e87e2cf3
iand675/hs-opentelemetry
Default.hs
# LANGUAGE CPP # ----------------------------------------------------------------------------- ----------------------------------------------------------------------------- | Module : OpenTelemetry . Trace . Id. Generator . Default Copyright : ( c ) , 2021 License : BSD-3 Maintain...
null
https://raw.githubusercontent.com/iand675/hs-opentelemetry/b08550db292ca0d8b9ce9156988e6d08dd6a2e61/sdk/src/OpenTelemetry/Trace/Id/Generator/Default.hs
haskell
--------------------------------------------------------------------------- ---------------------------------------------------------------------------
# LANGUAGE CPP # | Module : OpenTelemetry . Trace . Id. Generator . Default Copyright : ( c ) , 2021 License : BSD-3 Maintainer : Stability : experimental Portability : non - portable ( GHC extensions ) A reasonably performant out of the box implementation o...
4ddbf11c59944d9709402696a1a5b12a31322cba673cf163ccb480d5b12db7db
input-output-hk/cardano-base
Extend.hs
module Cardano.Slotting.EpochInfo.Extend where import Cardano.Slotting.EpochInfo.API (EpochInfo (..)) import Cardano.Slotting.Slot (EpochNo (EpochNo), EpochSize (EpochSize), SlotNo (SlotNo)) import Cardano.Slotting.Time ( SlotLength (getSlotLength), addRelativeTime, multNominalDiffTime, ) -- | Given a bas...
null
https://raw.githubusercontent.com/input-output-hk/cardano-base/7e64caa79e0f751f1333ccbce4a64cb48752ae69/cardano-slotting/src/Cardano/Slotting/EpochInfo/Extend.hs
haskell
| Given a basis point, use it and its slot length to impute a linear relationship between slots and time in order to extend an 'EpochInfo' to infinity. specified monad) if any of the underlying operations fail. For example, if we cannot translate the basis point.
module Cardano.Slotting.EpochInfo.Extend where import Cardano.Slotting.EpochInfo.API (EpochInfo (..)) import Cardano.Slotting.Slot (EpochNo (EpochNo), EpochSize (EpochSize), SlotNo (SlotNo)) import Cardano.Slotting.Time ( SlotLength (getSlotLength), addRelativeTime, multNominalDiffTime, ) The returned `...
7aee6f97ce5bfda002a6e809b6c28a0c6a038c01a40cb95f8a5cfb90232caca8
zotonic/zotonic
mod_custom_redirect.erl
@author < > 2013 %% @doc Redirect custom domains/paths to other domains/paths. %% This module is notified when the dispatcher found an unknown host name. Copyright 2013 %% Licensed under the Apache License , Version 2.0 ( the " License " ) ; %% you may not use this file except in compliance with t...
null
https://raw.githubusercontent.com/zotonic/zotonic/852f627c28adf6e5212e8ad5383d4af3a2f25e3f/apps/zotonic_mod_custom_redirect/src/mod_custom_redirect.erl
erlang
@doc Redirect custom domains/paths to other domains/paths. This module is notified when the dispatcher found an unknown host name. 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, so...
@author < > 2013 Copyright 2013 Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(mod_custom_redirect). -author("Marc Worrell <>"). -mod_title("Custom Redirects"). -mod_description("Redirect custom doma...
a1d69efe08db6568d38a6d7ffd161c0ba4dfdf75ff866485fe66ad6e92bc9879
mankyKitty/cautious-sniffle
Commands.hs
{-# LANGUAGE DataKinds #-} # LANGUAGE LambdaCase # # LANGUAGE FlexibleContexts # {-# LANGUAGE KindSignatures #-} {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE QuasiQuotes #-} {-# LANGUAGE RankNTypes #-} # LANGUAGE ScopedTypeVariables # module Commands where import ...
null
https://raw.githubusercontent.com/mankyKitty/cautious-sniffle/8916ef6e2d310158a76f8f573841e09ce3a0d7da/test/Commands.hs
haskell
# LANGUAGE DataKinds # # LANGUAGE KindSignatures # # LANGUAGE OverloadedStrings # # LANGUAGE QuasiQuotes # # LANGUAGE RankNTypes # Require Execute Update Require Execute Update Require Execute Ensure Update Require Execute Update Require Execute Update
# LANGUAGE LambdaCase # # LANGUAGE FlexibleContexts # # LANGUAGE ScopedTypeVariables # module Commands where import Control.Lens (use, (^.), (.=), (%=)) import Control.Monad (void, unless, when) import Control.Monad.IO.Class ...
2dbdcdefd790fc3b4c2818738ea9ad47f42c70a8dfdd778edec6da292a4bd062
pokepay/aws-sdk-lisp
greengrass.lisp
;; DO NOT EDIT: File is generated by AWS-SDK/GENERATOR. (uiop:define-package #:aws-sdk/services/greengrass (:use) (:use-reexport #:aws-sdk/services/greengrass/api))
null
https://raw.githubusercontent.com/pokepay/aws-sdk-lisp/836b87df520391478a19462443342dc56f4b3f2c/services/greengrass.lisp
lisp
DO NOT EDIT: File is generated by AWS-SDK/GENERATOR.
(uiop:define-package #:aws-sdk/services/greengrass (:use) (:use-reexport #:aws-sdk/services/greengrass/api))
3c62ebba0d768708ae6c989e03296a27d5599a11febea2b8aa587a2e28feccca
mfp/extprot
test_subsets.ml
open OUnit open Test_types open Test_util module PP = Extprot.Pretty_print module M = Extprot.Msg_buffer let aeq pp exp actual = assert_equal ~printer:(PP.pp pp) exp actual let check_roundtrip pp enc dec v1 v2 = let enc = encode enc v1 in aeq pp v2 (decode dec enc) let raises_extprot_err ?msg (f : 'a -> unit) ...
null
https://raw.githubusercontent.com/mfp/extprot/c69eb66398e35b964c4232a7c3c85151fb5eddbe/test/test_subsets.ml
ocaml
open OUnit open Test_types open Test_util module PP = Extprot.Pretty_print module M = Extprot.Msg_buffer let aeq pp exp actual = assert_equal ~printer:(PP.pp pp) exp actual let check_roundtrip pp enc dec v1 v2 = let enc = encode enc v1 in aeq pp v2 (decode dec enc) let raises_extprot_err ?msg (f : 'a -> unit) ...
c186f4d1881fdb6feb8599055bcab9009114b6b9e0931aaea6895eed4fa0a114
ninenines/cowboy
req_SUITE.erl
Copyright ( c ) 2016 - 2017 , < > %% %% Permission to use, copy, modify, and/or distribute this software for any %% purpose with or without fee is hereby granted, provided that the above %% copyright notice and this permission notice appear in all copies. %% THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISC...
null
https://raw.githubusercontent.com/ninenines/cowboy/8795233c57f1f472781a22ffbf186ce38cc5b049/test/req_SUITE.erl
erlang
Permission to use, copy, modify, and/or distribute this software for any purpose with or without fee is hereby granted, provided that the above copyright notice and this permission notice appear in all copies. WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS. IN NO EVE...
Copyright ( c ) 2016 - 2017 , < > THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN -module(req_SUITE). -compile(export_all). -compile(no...
bf315461ac1ebff1d4516bdc2f776eb107c74b91ac522664703ba8ad41562283
bmeurer/ocaml-experimental
thread.ml
(***********************************************************************) (* *) (* Objective Caml *) (* *) , projet ...
null
https://raw.githubusercontent.com/bmeurer/ocaml-experimental/fe5c10cdb0499e43af4b08f35a3248e5c1a8b541/otherlibs/threads/thread.ml
ocaml
********************************************************************* Objective Caml ...
, projet Cristal , INRIA Rocquencourt Copyright 1996 Institut National de Recherche en Informatique et en Automatique . All rights reserved . This file is distributed under the terms of the GNU Library General Public License , with $ Id$ type t let critical_section ...
18cef56996e9ec403795a21db1d8f0e8d49aeb84c9a5bfa32895ae1c146f9193
GillianPlatform/Gillian
WLemma.mli
type t = { lemma_name : string; lemma_params : string list; lemma_proof : WLCmd.t list option; lemma_variant : WLExpr.t option; lemma_hypothesis : WLAssert.t; lemma_conclusion : WLAssert.t; lemma_id : int; lemma_loc : CodeLoc.t; } val get_id : t -> int val get_loc : t -> CodeLoc.t val get_by_id : in...
null
https://raw.githubusercontent.com/GillianPlatform/Gillian/511a16196bd89d25ffe5cf868188b6ddf546efd7/wisl/lib/syntax/WLemma.mli
ocaml
type t = { lemma_name : string; lemma_params : string list; lemma_proof : WLCmd.t list option; lemma_variant : WLExpr.t option; lemma_hypothesis : WLAssert.t; lemma_conclusion : WLAssert.t; lemma_id : int; lemma_loc : CodeLoc.t; } val get_id : t -> int val get_loc : t -> CodeLoc.t val get_by_id : in...
36c905d40939817f0452749338783eba1861e0ffd4a85e2592779e76d3066c92
techascent/tech.datatype
list.clj
(ns tech.v2.datatype.list (:require [tech.v2.datatype.base :as base] [tech.v2.datatype.protocols :as dtype-proto] [tech.v2.datatype.array :as dtype-array] [tech.v2.datatype.nio-buffer] [tech.v2.datatype.typed-buffer :as typed-buffer] [tech.v2.datatype.reader...
null
https://raw.githubusercontent.com/techascent/tech.datatype/8cc83d771d9621d580fd5d4d0625005bd7ab0e0c/src/tech/v2/datatype/list.clj
clojure
(ns tech.v2.datatype.list (:require [tech.v2.datatype.base :as base] [tech.v2.datatype.protocols :as dtype-proto] [tech.v2.datatype.array :as dtype-array] [tech.v2.datatype.nio-buffer] [tech.v2.datatype.typed-buffer :as typed-buffer] [tech.v2.datatype.reader...
ceb6f65bd36c22e44482e1fe837669737c7300fe554a186c3067fe26b09c5878
macchiato-framework/examples
core.cljs
(ns file-upload.core (:require [file-upload.config :refer [env]] [file-upload.middleware :refer [wrap-defaults]] [file-upload.routes :refer [router]] [macchiato.server :as http] [macchiato.session.memory :as mem] [mount.core :as mount :refer [defstate]] [taoensso.timbre :refer-macros [log ...
null
https://raw.githubusercontent.com/macchiato-framework/examples/946bdf1a04f5ef787fc83affdcbf6603bbf29b5c/file-upload/src/file_upload/core.cljs
clojure
(ns file-upload.core (:require [file-upload.config :refer [env]] [file-upload.middleware :refer [wrap-defaults]] [file-upload.routes :refer [router]] [macchiato.server :as http] [macchiato.session.memory :as mem] [mount.core :as mount :refer [defstate]] [taoensso.timbre :refer-macros [log ...
9c9303071c7cc70e00c15c9c9f0f442608c0f7064a2d930c49c7ed9b212febe2
flipstone/haskell-for-beginners
3_maps_and_filters.hs
-- Use map and filter to construct expressions -- for the following calculations. Double all the numbers from 1 to 10 twoToTwenty = map (*2) [1..10] Compute the first 20 perfect cubes . cubes = map (^3) [1..20] Greet [ , , and ] by adding " Hello , " in front each name . greetings = map ("Hello, " ++) ["Bob...
null
https://raw.githubusercontent.com/flipstone/haskell-for-beginners/e586a1f3ef08f21d5181171fe7a7b27057391f0b/answers/chapter_06/3_maps_and_filters.hs
haskell
Use map and filter to construct expressions for the following calculations. Find all the odd numbers in [2,13,7,14,4,15,6,8,9,11] Create a list of all the positive even numbers (using filter) Create a list of all the positive even numbers (using map) integers that divide it evenly and are less than it.
Double all the numbers from 1 to 10 twoToTwenty = map (*2) [1..10] Compute the first 20 perfect cubes . cubes = map (^3) [1..20] Greet [ , , and ] by adding " Hello , " in front each name . greetings = map ("Hello, " ++) ["Bob", "Alice", "Eve"] odds = filter odd [2,13,7,14,4,15,6,8,9,11] Find all the ev...
30a17610965723343e89fd44119ddfb7fabe731983048b77f90c317851aaa20b
walmartlabs/lacinia
input_types_test.clj
Copyright ( c ) 2021 - 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/c0870e8c0c3537aede93aa6c711291ffc5a3695e/test/com/walmartlabs/lacinia/input_types_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 ) 2021 - 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.input-types-test (:require [clojure.test :refer [deftest is]] [com.walmartlabs.test-util...
73b9466015cb171fbf51373038fe1825de1c943858b40e39a2e1eb8361c70a82
lambdaisland/chui
a_test.cljs
(ns lambdaisland.chui-demo.a-test (:require [clojure.test :refer [deftest testing is are async use-fixtures]] [lambdaisland.glogi :as log])) (use-fixtures :each {:id 1 :before (fn [] (log/info :each :before)) :after (fn [] (log/info :each :after))} {:id 2 :before ...
null
https://raw.githubusercontent.com/lambdaisland/chui/dc8735863b461cf529881ba263e1096a39378ba4/test/lambdaisland/chui_demo/a_test.cljs
clojure
(ns lambdaisland.chui-demo.a-test (:require [clojure.test :refer [deftest testing is are async use-fixtures]] [lambdaisland.glogi :as log])) (use-fixtures :each {:id 1 :before (fn [] (log/info :each :before)) :after (fn [] (log/info :each :after))} {:id 2 :before ...
21fcdc0028f1ef71ba2e3cb2110a5a5faceb40a97a130fad109f11914f0df17e
clojure-interop/aws-api
EC2MetadataUtils$InstanceInfo.clj
(ns com.amazonaws.util.EC2MetadataUtils$InstanceInfo "This POJO is a best attempt to capture the instance info which is only guaranteed to be a JSON document per /UserGuide/ec2-instance-metadata.html Instance info includes dynamic information about the current instance such as region, instanceId, private ...
null
https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.util/src/com/amazonaws/util/EC2MetadataUtils%24InstanceInfo.clj
clojure
(ns com.amazonaws.util.EC2MetadataUtils$InstanceInfo "This POJO is a best attempt to capture the instance info which is only guaranteed to be a JSON document per /UserGuide/ec2-instance-metadata.html Instance info includes dynamic information about the current instance such as region, instanceId, private ...
b95e515eee534e53599126b84f650a7ed4516130767afdb5e7e443a3f102a2ba
brendanhay/terrafomo
DataSources.hs
-- This module is auto-generated. # LANGUAGE NoImplicitPrelude # # LANGUAGE RecordWildCards # # LANGUAGE StrictData # # LANGUAGE UndecidableInstances # # OPTIONS_GHC -fno - warn - unused - imports # -- | Module : . . DataSources Copyright : ( c ) 2017 - 2018 License : Moz...
null
https://raw.githubusercontent.com/brendanhay/terrafomo/387a0e9341fb9cd5543ef8332dea126f50f1070e/provider/terrafomo-scaleway/gen/Terrafomo/Scaleway/DataSources.hs
haskell
This module is auto-generated. | Stability : auto-generated * scaleway_bootscript * scaleway_image * scaleway_security_group * scaleway_volume | The main @scaleway_bootscript@ datasource definition. ^ @architecture@ - (Optional) Architecture of the desired bootscript ^ @name@ - (Optional, Forces New) E...
# LANGUAGE NoImplicitPrelude # # LANGUAGE RecordWildCards # # LANGUAGE StrictData # # LANGUAGE UndecidableInstances # # OPTIONS_GHC -fno - warn - unused - imports # Module : . . DataSources Copyright : ( c ) 2017 - 2018 License : Mozilla Public License , v. 2.0 . Mainta...
2b89cbbc7bfc9258a207785f2c9015138f4b283114c0c1ceb3b5acbfc7d0c586
weavejester/ragtime
core.clj
(ns ragtime.core "Functions for applying and rolling back migrations." (:require [ragtime.protocols :as p] [ragtime.strategy :as strategy] [ragtime.reporter :as reporter])) (defn into-index "Add migrations to a map, using their :id as the key." ([migrations] (into-index {} migrations...
null
https://raw.githubusercontent.com/weavejester/ragtime/b49d44742cfd4d1226755a78fdcddb9e8df44b59/core/src/ragtime/core.clj
clojure
(ns ragtime.core "Functions for applying and rolling back migrations." (:require [ragtime.protocols :as p] [ragtime.strategy :as strategy] [ragtime.reporter :as reporter])) (defn into-index "Add migrations to a map, using their :id as the key." ([migrations] (into-index {} migrations...
67669e45819b037a13b4f0b8329f9c495607e5c5f98cf0cbb581786c254f6207
vimus/vimus
Song.hs
-- | Songs metadata module Vimus.Song ( metaQueries , album , artist , title , track , filename ) where import Data.List (intercalate) import Data.Map (Map) import qualified Data.Map as Map import Prelude hiding (length) import qualified System.FilePath as FilePath import Text...
null
https://raw.githubusercontent.com/vimus/vimus/26a164fb50870f8112ca4b6c30820431c015916f/src/Vimus/Song.hs
haskell
| Songs metadata | Song tags queries | Get comma-separated list of meta data | Song file queries
module Vimus.Song ( metaQueries , album , artist , title , track , filename ) where import Data.List (intercalate) import Data.Map (Map) import qualified Data.Map as Map import Prelude hiding (length) import qualified System.FilePath as FilePath import Text.Printf (printf) im...
438afd590b0a5c06b7050977d2afe24d8dd0860f57aad8e38e4de3c780195e99
pipefy/metabase-bigquery
project.clj
(defproject metabase/bigquery-alt-driver "0.34.0-SNAPSHOT-1.30.3" :min-lein-version "2.5.0" :aliases {"install-for-building-drivers" ["with-profile" "+install-for-building-drivers" "install"]} :dependencies [[com.google.apis/google-api-services-bigquery "v2-rev20190917-1.30.3"]] :profiles {:provided ...
null
https://raw.githubusercontent.com/pipefy/metabase-bigquery/9501c016fcb9c7891f3d7ff017c462c48ea31e1b/project.clj
clojure
(defproject metabase/bigquery-alt-driver "0.34.0-SNAPSHOT-1.30.3" :min-lein-version "2.5.0" :aliases {"install-for-building-drivers" ["with-profile" "+install-for-building-drivers" "install"]} :dependencies [[com.google.apis/google-api-services-bigquery "v2-rev20190917-1.30.3"]] :profiles {:provided ...
19e439c6e36a43c881b2e2221984ef98e91945ff3548fffe9311f1d8dde5637a
eareese/htdp-exercises
235.rkt
;;--------------------------------------------------------------------------------------------------- #lang htdp/bsl+ ;; String List-of-Strings -> Boolean ;; produces #t when s is found in l (check-expect (contains? "basic" '("cat" "basic")) #t) (check-expect (contains? "basic" '("cat")) #f) (check-expect (contains? "...
null
https://raw.githubusercontent.com/eareese/htdp-exercises/a85ff3111d459dda0e94d9b463d01a09accbf9bf/part03-abstraction/235.rkt
racket
--------------------------------------------------------------------------------------------------- String List-of-Strings -> Boolean produces #t when s is found in l "zoo", respectively. List of strings -> Boolean Does l contain "atom"? List of strings -> Boolean Does l contain "zoo"? List of strings -> Boolea...
#lang htdp/bsl+ (check-expect (contains? "basic" '("cat" "basic")) #t) (check-expect (contains? "basic" '("cat")) #f) (check-expect (contains? "cat" '("cat" "basic")) #t) (check-expect (contains? "cat" '()) #f) (define (contains? s l) (cond [(empty? l) #f] [(string=? s (first l)) #t] [else (contains? s (...
0a66822ad63570634a212f0f0d867546950679b4ecf28ef68423503039226068
haskell-repa/repa
Dim2.hs
# LANGUAGE CPP , MagicHash # -- This is specialised for stencils up to 7x7. Due to limitations in the GHC optimiser , using larger stencils does n't -- work, and will yield `error` at runtime. We can probably increase the -- limit if required -- just ask. -- -- The focus of the stencil is in the center of t...
null
https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/repa/Data/Array/Repa/Stencil/Dim2.hs
haskell
This is specialised for stencils up to 7x7. work, and will yield `error` at runtime. We can probably increase the limit if required -- just ask. The focus of the stencil is in the center of the 7x7 tile, which has coordinates (0, 0). All coefficients in the stencil must fit in the tile, The stencil c...
# LANGUAGE CPP , MagicHash # Due to limitations in the GHC optimiser , using larger stencils does n't so they can be given X , Y coordinates up to + /- 3 positions . module Data.Array.Repa.Stencil.Dim2 makeStencil2, #ifndef REPA_NO_TH stencil2, #endif PC5, mapStencil2, forStencil2)...
e706f4e1684714050acd2331ce6cbb9ffbd7757d52f5c30977a52eb978e26551
project-oak/hafnium-verification
sh_domain.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/sledge/src/symbheap/sh_domain.ml
ocaml
* Abstract domain only support DNF for now Add the formals here to do garbage collection and then get rid of them * Express formula in terms of formals instead of actuals, and enter scope of locals: rename formals to fresh vars in formula and actuals, add equations between each formal and actual, and quant...
* 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 ...
67c19e19cf732787c366db4f2c4de3a6e3e157c6a0eb2267160c568b440c1851
haskell-lisp/yale-haskell
locate-entity.scm
;;; This file deals with entities in import / export lists ;;; This resolves an entity with the export table of a ;;; module. It returns either a group, the symbol 'error, or the symbol ;;; 'not-found. When force-error? is true, signal an error when ;;; the module is not found & return 'error. (define (locate-entit...
null
https://raw.githubusercontent.com/haskell-lisp/yale-haskell/4e987026148fe65c323afbc93cd560c07bf06b3f/import-export/locate-entity.scm
scheme
This file deals with entities in import / export lists This resolves an entity with the export table of a module. It returns either a group, the symbol 'error, or the symbol 'not-found. When force-error? is true, signal an error when the module is not found & return 'error. The following routine locates an enti...
(define (locate-entity/export-table entity mod force-error?) (let* ((name (entity-name entity)) (group (table-entry (module-export-table mod) name))) (if (eq? group '#f) (if (not force-error?) 'not-found (signal-entity-not-found name (module-name mod))) (let ((def (group-definition group))) (co...
d99bf03cd69c69d138c26020aac9a753f49b4c9996d99110626ee9f180914994
MaskRay/OJHaskell
113.hs
import Data.Array digits = 100 dp = listArray ((1,0), (digits,9)) $ map f $ range ((1,0), (digits,9)) f (1, _) = 1 f (i, j) = sum [dp ! (i-1, j') | j' <- [0..j]] main = print $ sum [dp!i | i <- range ((digits,0), (digits,9))] + sum [dp!i | i <- range ((1,1), (digits,9))] - digits*9 - 1
null
https://raw.githubusercontent.com/MaskRay/OJHaskell/ba24050b2480619f10daa7d37fca558182ba006c/Project%20Euler/113.hs
haskell
import Data.Array digits = 100 dp = listArray ((1,0), (digits,9)) $ map f $ range ((1,0), (digits,9)) f (1, _) = 1 f (i, j) = sum [dp ! (i-1, j') | j' <- [0..j]] main = print $ sum [dp!i | i <- range ((digits,0), (digits,9))] + sum [dp!i | i <- range ((1,1), (digits,9))] - digits*9 - 1
33af438c5512b3e6f8d33233bad770d514d622cb31c47a9f31501ec0f753dac7
launchdarkly/erlang-server-sdk
ldclient_usage.erl
%%------------------------------------------------------------------- %% @doc `ldclient_usage' module @private %% @end %%------------------------------------------------------------------- This file contains top level usage of ldclient to allow for dialyzing %% these methods. If the methods were only used in tests...
null
https://raw.githubusercontent.com/launchdarkly/erlang-server-sdk/d9a4442a8a214bf950dec8182b26cd042436f4c8/test-usage/ldclient_usage.erl
erlang
------------------------------------------------------------------- @doc `ldclient_usage' module @end ------------------------------------------------------------------- these methods. If the methods were only used in tests, then issue with their usage would not be reported.
@private This file contains top level usage of ldclient to allow for dialyzing -module(ldclient_usage). -export([ init_with_all_options/0 ]). init_with_all_options() -> ldclient:start_instance("sdk-key", instance_name, #{ base_uri => "", stream_uri => "", feature_store => ldclien...
5c7c652d9ceb5a8b9c5e91b18d863e2472318be5ce7a601cf3706c73c362aa2e
purescript/purescript
Imports.hs
module Language.PureScript.Sugar.Names.Imports ( ImportDef , resolveImports , resolveModuleImport , findImports ) where import Prelude import Control.Monad import Control.Monad.Error.Class (MonadError(..)) import Data.Foldable (for_, traverse_) import Data.Maybe (fromMaybe) import qualified Data.Map as M i...
null
https://raw.githubusercontent.com/purescript/purescript/02bd6ae60bcd18cbfa892f268ef6359d84ed7c9b/src/Language/PureScript/Sugar/Names/Imports.hs
haskell
| Finds the imports within a module, mapping the imported module name to an optional set of explicitly imported declarations. | | Constructs a set of imports for a single module import. | Extends the local environment for a module by resolving an import of another module. Check that a 'DeclarationRef' refers...
module Language.PureScript.Sugar.Names.Imports ( ImportDef , resolveImports , resolveModuleImport , findImports ) where import Prelude import Control.Monad import Control.Monad.Error.Class (MonadError(..)) import Data.Foldable (for_, traverse_) import Data.Maybe (fromMaybe) import qualified Data.Map as M i...
fe8f90ae1ec1840d79242a435bd382215e2db9f62ec08a9a3d7a18ff298e7618
folivetti/Category4Programmers
Writer.hs
type Writer a = (a, String) return :: a -> Writer a return x = (x, "") (>=>) :: (a -> Writer b) -> (b -> Writer c) -> (a -> Writer c) m1 >=> m2 = \a -> let (b, s1) = m1 a (c, s2) = m2 b in (c, s1 ++ s2) notW :: Bool -> Writer Bool notW b = (b, "not") is_even :: Int -> Writer Bool is_even x = (x ...
null
https://raw.githubusercontent.com/folivetti/Category4Programmers/b002b7eeeddf272ca94bd2467db535e0ad268176/Kleisli/Writer.hs
haskell
type Writer a = (a, String) return :: a -> Writer a return x = (x, "") (>=>) :: (a -> Writer b) -> (b -> Writer c) -> (a -> Writer c) m1 >=> m2 = \a -> let (b, s1) = m1 a (c, s2) = m2 b in (c, s1 ++ s2) notW :: Bool -> Writer Bool notW b = (b, "not") is_even :: Int -> Writer Bool is_even x = (x ...
fc37ff6fb6249007649ef38eb74487313fbf1c90e5994080bd81b8b98e570f29
arttuka/reagent-material-ui
eighteen_up_rating.cljs
(ns reagent-mui.icons.eighteen-up-rating "Imports @mui/icons-material/EighteenUpRating as a Reagent component." (:require-macros [reagent-mui.util :refer [create-svg-icon e]]) (:require [react :as react] ["@mui/material/SvgIcon" :as SvgIcon] [reagent-mui.util])) (def eighteen-up-rating (c...
null
https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/icons/reagent_mui/icons/eighteen_up_rating.cljs
clojure
(ns reagent-mui.icons.eighteen-up-rating "Imports @mui/icons-material/EighteenUpRating as a Reagent component." (:require-macros [reagent-mui.util :refer [create-svg-icon e]]) (:require [react :as react] ["@mui/material/SvgIcon" :as SvgIcon] [reagent-mui.util])) (def eighteen-up-rating (c...
89292540727f8ea432c75c9e955d7d3b35f78396dda4d36d4f3f2162af90bf56
manuel-serrano/bigloo
levenshtein.scm
;*=====================================================================*/ ;* .../prgm/project/bigloo/api/text/src/Llib/levenshtein.scm */ ;* ------------------------------------------------------------- */ * Author : * / * Creation : Tue Jun ...
null
https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/api/text/src/Llib/levenshtein.scm
scheme
*=====================================================================*/ * .../prgm/project/bigloo/api/text/src/Llib/levenshtein.scm */ * ------------------------------------------------------------- */ * ------------------------------------------------------------- */ *===========================...
* Author : * / * Creation : Tue Jun 4 12:07:40 2013 * / * Last change : Tue Jun 4 15:16:54 2013 ( serrano ) * / * Copyright : 2013 * / * string distance implemen...
1390afc40f3392fd5aae9da4dd47d5e588f3d3bbec4ea6cec828e520754cbe18
tarides/opam-monorepo
map.ml
module type S = sig include MoreLabels.Map.S val mem : 'a t -> key -> bool val set : 'a t -> key -> 'a -> 'a t val find : 'a t -> key -> 'a option val update : 'a t -> key -> f:('a option -> 'a option) -> 'a t val values : 'a t -> 'a list val keys : 'a t -> key list val of_list : (key * 'a) list -> ('a...
null
https://raw.githubusercontent.com/tarides/opam-monorepo/9262e7f71d749520b7e046fbd90a4732a43866e9/stdext/map.ml
ocaml
module type S = sig include MoreLabels.Map.S val mem : 'a t -> key -> bool val set : 'a t -> key -> 'a -> 'a t val find : 'a t -> key -> 'a option val update : 'a t -> key -> f:('a option -> 'a option) -> 'a t val values : 'a t -> 'a list val keys : 'a t -> key list val of_list : (key * 'a) list -> ('a...
d97168864e9fa3f2a13d26108e7818a9d023d0249bd71befcbb8cbad8e31d2f0
cfcs/ocaml-socks
socks.ml
(* SOCKS4 / SOCKS4a #SOCKS4a *) open Rresult include Socks_types let bigendian_port_of_int port = begin match port with | x when 0 <= x && x <= 0xFFFF -> R.ok @@ String.concat "" [ (port land 0xff00) lsr 8 |> char_of_int |> String.make 1 ; port land 0xff |> char_of_int |> Strin...
null
https://raw.githubusercontent.com/cfcs/ocaml-socks/00d2467f8e1ff2f369f4c8145654df51a35d8e08/src/socks.ml
ocaml
SOCKS4 / SOCKS4a #SOCKS4a NMETHODS - number of METHODS let parse_socks5_auth_request data see [parse_request] SOCKS version METHOD chosen by the server ULEN - username length UNAME - username PLEN - password length PASSWD - password CMD (we only implement 'connect' RSV - reserved DST.ADDR ...
open Rresult include Socks_types let bigendian_port_of_int port = begin match port with | x when 0 <= x && x <= 0xFFFF -> R.ok @@ String.concat "" [ (port land 0xff00) lsr 8 |> char_of_int |> String.make 1 ; port land 0xff |> char_of_int |> String.make 1 ] | _ -> R.error (`Ms...
010050c5285b404df15c4867ab7f3497483809c56e1cbb16187ce13e51a0cf2d
kahua/Kahua
session.scm
-*- coding : utf-8 ; mode : scheme -*- ;; test kahua.session NB : first we test state session without session key server ( local mode ) , ;; then start up the server process and test the shared key mode. (use gauche.test) (use gauche.process) (use gauche.net) (use util.list) (use kahua.gsid) (use kahua.config) (u...
null
https://raw.githubusercontent.com/kahua/Kahua/41fa415511c54beab4922820989faf7ea71d2818/test/session.scm
scheme
mode : scheme -*- test kahua.session then start up the server process and test the shared key mode. ------------------------------------------------------------------ ------------------------------------------------------------------ ------------------------------------------------------------------ ----------------...
NB : first we test state session without session key server ( local mode ) , (use gauche.test) (use gauche.process) (use gauche.net) (use util.list) (use kahua.gsid) (use kahua.config) (use kahua.test.util) (test-start "kahua.session") (use kahua.session) (test-module 'kahua.session) (define *site* "_site") (sys-...
eaf0bd9db92e0c708ba71dd4af5d666b1c014184318893dec8b6fb1b879065e8
michalkonecny/aern2
WithCurrentPrec.hs
{-# LANGUAGE EmptyDataDecls #-} # LANGUAGE DataKinds # # LANGUAGE PolyKinds # {-# LANGUAGE RankNTypes #-} # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE StandaloneDeriving # # OPTIONS_GHC -Wno - orphans # | Module : AERN2.MP.WithCurrentPrec Description : Type wrapper setting default precision ...
null
https://raw.githubusercontent.com/michalkonecny/aern2/f88f4c734ba438fd7a18142d910f12945a9fc755/aern2-mp/src/AERN2/MP/WithCurrentPrec.hs
haskell
# LANGUAGE EmptyDataDecls # # LANGUAGE RankNTypes # , _example1 , _example2 , _example3 , _example1P , _example2P , _example3P import Text.Printf
# LANGUAGE DataKinds # # LANGUAGE PolyKinds # # LANGUAGE GeneralizedNewtypeDeriving # # LANGUAGE StandaloneDeriving # # OPTIONS_GHC -Wno - orphans # | Module : AERN2.MP.WithCurrentPrec Description : Type wrapper setting default precision Copyright : ( c ) : : St...
9098edd6044485454b5247b2d5dda200447a15803cd0728f43ed94fff3c1356b
lamdu/lamdu
Add.hs
# LANGUAGE NoMonomorphismRestriction , MultiParamTypeClasses , FlexibleInstances # module Lamdu.Sugar.Names.Add ( addToWorkArea , -- re-export for tests addToWorkAreaTest , InternalName(..), inTag, inContext, runPasses ) where import qualified Lamdu.Calc.Type as T import qualified Lamdu.Data.Tag...
null
https://raw.githubusercontent.com/lamdu/lamdu/68b17c507c987309d99daad10b006c06d2a0210e/src/Lamdu/Sugar/Names/Add.hs
haskell
re-export for tests TODO: Switch to regular type in tests
# LANGUAGE NoMonomorphismRestriction , MultiParamTypeClasses , FlexibleInstances # module Lamdu.Sugar.Names.Add ( addToWorkArea addToWorkAreaTest , InternalName(..), inTag, inContext, runPasses ) where import qualified Lamdu.Calc.Type as T import qualified Lamdu.Data.Tag as Tag import qualified Lamd...
47a17070d2bb2709d2ee3a9eb0f7538ff4249a78e00598b7c1ee6badb3c99c3a
purescript/purescript
Types.hs
-- | Type definitions for psc - ide # language , NoGeneralizedNewtypeDeriving , TemplateHaskell # module Language.PureScript.Ide.Types where import Protolude hiding (moduleName) import Control.Concurrent.STM (TVar) import Control.Lens hiding (op, (.=)) import Control.Monad...
null
https://raw.githubusercontent.com/purescript/purescript/a3beca3ccc17e3b0b645d52a1ccc4f521c02a019/src/Language/PureScript/Ide/Types.hs
haskell
| annotations found in a module the output folder, and modules are parsed ASTs from source files. This means, that we can update single modules or ExternsFiles inside this state whenever the corresponding entity changes on the file system. | @IdeVolatileState@ is derived from the @IdeFileState@ and needs to be i...
Type definitions for psc - ide # language , NoGeneralizedNewtypeDeriving , TemplateHaskell # module Language.PureScript.Ide.Types where import Protolude hiding (moduleName) import Control.Concurrent.STM (TVar) import Control.Lens hiding (op, (.=)) import Control.Monad.Fail...
3435c1ba5c5d10c7d2bea9fb5b070ebab9240e6d022ee04c23f60d2eca57f2c0
xapi-project/stdext
xstringext_test.ml
Copyright ( C ) Citrix Systems Inc. This program is free software ; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation ; version 2.1 only . with the special exception on linking described in file LICENSE ....
null
https://raw.githubusercontent.com/xapi-project/stdext/ac48af8699b7f4d283500139e75cf5167f4f0773/lib/xapi-stdext-std/xstringext_test.ml
ocaml
limit being set to -1 is the same as not using the parameter
Copyright ( C ) Citrix Systems Inc. This program is free software ; you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation ; version 2.1 only . with the special exception on linking described in file LICENSE ....
c9351977ad540810901e04d270068c1b0c36a97d2783c5001259280056bd10c9
janestreet/hardcaml
constant.ml
open Base include Bits0 let char_zero = Char.to_int '0' let char_a = Char.to_int 'a' let char_A = Char.to_int 'A' module Signedness = struct type t = | Signed | Unsigned [@@deriving sexp_of] end module Raw = struct let of_bytes bytes ~width = init_byte ~width ~f:(fun i -> try Bytes.get bytes ...
null
https://raw.githubusercontent.com/janestreet/hardcaml/15727795c2bf922dd852cc0cd895a4ed1d9527e5/src/constant.ml
ocaml
Pretty printer
open Base include Bits0 let char_zero = Char.to_int '0' let char_a = Char.to_int 'a' let char_A = Char.to_int 'A' module Signedness = struct type t = | Signed | Unsigned [@@deriving sexp_of] end module Raw = struct let of_bytes bytes ~width = init_byte ~width ~f:(fun i -> try Bytes.get bytes ...
307fd136705b825d8e6706926206d779ea4d789f9d5ed72099bffda6c24267c1
dradtke/Lisp-Text-Editor
pango.lisp
(defpackage #:pango-cffi (:use #:common-lisp #:cffi-object #:cffi #:iterate #:g-object-cffi #:alexandria #:gtk-cffi-utils) (:export #:font #:tab-array #:language #:alignment #:ellipsize-mode #:stretch #:style #:underline #:variant #:wrap-mode #:direction #:attr-list)) (i...
null
https://raw.githubusercontent.com/dradtke/Lisp-Text-Editor/b0947828eda82d7edd0df8ec2595e7491a633580/quicklisp/dists/quicklisp/software/gtk-cffi-20120208-cvs/gdk/pango.lisp
lisp
We need to pass positions-in-pixels (boolean) and list of tab-stops in lisp it is handy to represent as (pixels {tab-stop}*), where pixels is t or nil and tab-stop is a fixnum (declare (ignore param)) (pango-tab-array-free value)) for language we don't need foreign type, because we don't need to free these poi...
(defpackage #:pango-cffi (:use #:common-lisp #:cffi-object #:cffi #:iterate #:g-object-cffi #:alexandria #:gtk-cffi-utils) (:export #:font #:tab-array #:language #:alignment #:ellipsize-mode #:stretch #:style #:underline #:variant #:wrap-mode #:direction #:attr-list)) (i...
04e538234a1aa17ce2a4f38a672f61862e0d99b1f6b8a006fd40c1a27194e5a1
leo-project/leo_storage
leo_storage_watchdog_msgs.erl
%%====================================================================== %% %% Leo Storage %% Copyright ( c ) 2012 - 2016 Rakuten , Inc. %% This file is provided to you under the Apache License , %% Version 2.0 (the "License"); you may not use this file except in compliance with the License . You may obtain %% ...
null
https://raw.githubusercontent.com/leo-project/leo_storage/9bd2bb0b7cedcdbe1bf0b5c4dcf708be16664d2a/src/leo_storage_watchdog_msgs.erl
erlang
====================================================================== Leo Storage Version 2.0 (the "License"); you may not use this file a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, KIND, either express or implied. See the License for the specific language gov...
Copyright ( c ) 2012 - 2016 Rakuten , Inc. This file is provided to you under the Apache License , except in compliance with the License . You may obtain software distributed under the License is distributed on an " AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY -module(leo_storage_watchdog_msgs...
c3e14c2d6d58b023d7ed8b920e061c99505e1a2c1f2d759dfdad0449507300fa
roelvandijk/numerals
TestData.hs
| [ @ISO639 - 1@ ] - [ @ISO639 - 2B@ ] - [ @ISO639 - 3@ ] clm [ @Native name@ ] [ @English name@ ] [@ISO639-1@] - [@ISO639-2B@] - [@ISO639-3@] clm [@Native name@] nəxʷsƛ̕ay̕əmúcən [@English name@] Klallam -} module Text.Numeral.Language.C...
null
https://raw.githubusercontent.com/roelvandijk/numerals/b1e4121e0824ac0646a3230bd311818e159ec127/src-test/Text/Numeral/Language/CLM/TestData.hs
haskell
------------------------------------------------------------------------------ Imports ------------------------------------------------------------------------------ ------------------------------------------------------------------------------ Test data ---------------------------------------------------------------...
| [ @ISO639 - 1@ ] - [ @ISO639 - 2B@ ] - [ @ISO639 - 3@ ] clm [ @Native name@ ] [ @English name@ ] [@ISO639-1@] - [@ISO639-2B@] - [@ISO639-3@] clm [@Native name@] nəxʷsƛ̕ay̕əmúcən [@English name@] Klallam -} module Text.Numeral.Language.C...
24ffdbbaee9287bcca217d820500bad968235f88326f690e2ecca737c9b12639
kumarshantanu/ring-sse-middleware
wrapper.clj
Copyright ( c ) . All rights reserved . ; The use and distribution terms for this software are covered by the ; Eclipse Public License 1.0 (-1.0.php) ; which can be found in the file LICENSE at the root of this distribution. ; By using this software in any fashion, you are agreeing to be bound by ; the ...
null
https://raw.githubusercontent.com/kumarshantanu/ring-sse-middleware/67dae006cfda2fa2fef93eea92557aeffff0b6a7/src/ring_sse_middleware/wrapper.clj
clojure
The use and distribution terms for this software are covered by the Eclipse Public License 1.0 (-1.0.php) which can be found in the file LICENSE at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this ...
Copyright ( c ) . All rights reserved . (ns ring-sse-middleware.wrapper) (defn sleep "Sleep for specified number of milliseconds." [^long millis] (try (Thread/sleep millis) (catch InterruptedException e (.interrupt (Thread/currentThread))))) (defn wrap-delay "Given number of millisecon...
c8661babdecbb8eea37578471e0f89528e6bf2ad6af0911beac23a27fecf0065
footprintanalytics/footprint-web
metadata_queries.clj
(ns metabase.db.metadata-queries "Predefined MBQL queries for getting metadata about an external database. TODO -- these have nothing to do with the application database. This namespace should be renamed something like `metabase.driver.util.metadata-queries`." (:require [clojure.tools.logging :as log] ...
null
https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/src/metabase/db/metadata_queries.clj
clojure
this seeming useless `merge` statement IS in fact doing something important. `ql/query` is a threading macro for building queries. Do not remove we need some sort of hard limit to prevent catastrophes. So this
(ns metabase.db.metadata-queries "Predefined MBQL queries for getting metadata about an external database. TODO -- these have nothing to do with the application database. This namespace should be renamed something like `metabase.driver.util.metadata-queries`." (:require [clojure.tools.logging :as log] ...
07d8000326303fdd6555c9e73a65d39c36a247078a2c408a46e8c836b445d566
shirok/Gauche
libchar.scm
;;; ;;; libchar.scm - builtin character procedures ;;; Copyright ( c ) 2000 - 2022 < > ;;; ;;; Redistribution and use in source and binary forms, with or without ;;; modification, are permitted provided that the following conditions ;;; are met: ;;; ;;; 1. Redistributions of source code must retain t...
null
https://raw.githubusercontent.com/shirok/Gauche/b773899dbe0b2955e1c4f1daa066da874070c1e4/src/libchar.scm
scheme
libchar.scm - builtin character procedures Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met: 1. Redistributions of source code must retain the above copyright notice, this list of conditions and the follo...
Copyright ( c ) 2000 - 2022 < > " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING (select-module gauche.internal) (inline-stu...
fce5eac1d14215735674df0affb223729544e77e8a03d543700290c81e93e1e9
PLTools/GT
test027.ml
open GT @type ('a, 'b) t = {x: int; y: string; a: 'a; b: 'b} with show, gmap, eq, compare, foldl, foldr class ['a, 'b, 'self] print fa fb _prereq = object inherit [unit, 'a, unit, unit, 'b, unit, unit, 'self, unit] @t method do_t _ {x; y; a; b} = Printf.printf "%d\n" x; Printf.printf "%s\n" y; fa () a...
null
https://raw.githubusercontent.com/PLTools/GT/62d1a424a3336f2317ba67e447a9ff09d179b583/regression/test027.ml
ocaml
open GT @type ('a, 'b) t = {x: int; y: string; a: 'a; b: 'b} with show, gmap, eq, compare, foldl, foldr class ['a, 'b, 'self] print fa fb _prereq = object inherit [unit, 'a, unit, unit, 'b, unit, unit, 'self, unit] @t method do_t _ {x; y; a; b} = Printf.printf "%d\n" x; Printf.printf "%s\n" y; fa () a...
a779c19a3eaafb300f3d5f25f128ac1c0ce8eb136b1f893e17500b5fe63586ca
kitnil/dotfiles
networking.scm
;;; GNU Guix --- Functional package management for GNU Copyright © 2020 , 2022 < > ;;; ;;; This file is part of GNU Guix. ;;; GNU is free software ; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 3 of t...
null
https://raw.githubusercontent.com/kitnil/dotfiles/c0f4e78fa6aa5c7fc36a2ca1b3f61af73147329c/dotfiles/guixsd/modules/services/networking.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 © 2020 , 2022 < > under the terms of the GNU General Public License as published by You should have received a copy of the GNU General Public License along with GNU . If not , see < / > . (define-module (services networking) #:use-module (gnu packages linux) #:use-module (gnu packages netwo...
d83332edbbee398cc1694b813fad62db17442e15ef94f6bb1fb3f86e8a03aa8e
lukaszkorecki/taskmaster
component.clj
(ns taskmaster.component (:require [clojure.tools.logging :as log] [taskmaster.queue :as queue])) ;; Doesn't depend on the lifecycle, e.g. is stateless really ;; so doesn't depend on the Component Lifecycle protocol (defprotocol Publish (put! [this payload-map])) (defrecord Publisher [db-conn] Publish ...
null
https://raw.githubusercontent.com/lukaszkorecki/taskmaster/f8803e2cb4e093d4148316787285a8c53eae7e5f/src/taskmaster/component.clj
clojure
Doesn't depend on the lifecycle, e.g. is stateless really so doesn't depend on the Component Lifecycle protocol dependencies internal state
(ns taskmaster.component (:require [clojure.tools.logging :as log] [taskmaster.queue :as queue])) (defprotocol Publish (put! [this payload-map])) (defrecord Publisher [db-conn] Publish (put! [this payload-map] (queue/put! db-conn payload-map))) (def has-component? (try (require '[com.stuart...
21697e304a5561afc46f94a1939f0545fb7a5a60fd3c68b3a7766d0bded2a8c1
KestrelInstitute/Specware
load.lisp
(in-package :cl-user) (Specware::make-system ".")
null
https://raw.githubusercontent.com/KestrelInstitute/Specware/2be6411c55f26432bf5c9e2f7778128898220c24/Languages/MetaSlang/CodeGen/Handwritten/Lisp/load.lisp
lisp
(in-package :cl-user) (Specware::make-system ".")
8ea67d27bd02e1f473c47951739c026c85d157d45768b13f3c0e5fe19ee7678f
acl2/acl2
pow.lisp
; Prime fields library: Exponentiation ; Copyright ( C ) 2019 - 2023 Kestrel Institute ; License : A 3 - clause BSD license . See the file books/3BSD - mod.txt . ; Author : ( ) ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (in-package "PFIELD") (include-book "mul") (includ...
null
https://raw.githubusercontent.com/acl2/acl2/66e178070ee4d354f8fc463eba82a825c8937b31/books/kestrel/prime-fields/pow.lisp
lisp
Prime fields library: Exponentiation just provides mod-expt-fast Compute x to the nth power (x^n) modulo the prime. Note that n can be any natural. done below express pow in terms of expt and do the entire mod at the end gen?
Copyright ( C ) 2019 - 2023 Kestrel Institute License : A 3 - clause BSD license . See the file books/3BSD - mod.txt . Author : ( ) (in-package "PFIELD") (include-book "mul") (include-book "minus1") (local (include-book "../number-theory/divides")) (local (include-book "../arithmetic-light/mod")) (local (in...
509a42015f81414a792871f2220ff1854a1354fc393306ce4fdd6e798f79d821
seckcoder/course-compiler
s6_0.rkt
(project (inject 42 Integer) Integer)
null
https://raw.githubusercontent.com/seckcoder/course-compiler/4363e5b3e15eaa7553902c3850b6452de80b2ef6/tests/s6_0.rkt
racket
(project (inject 42 Integer) Integer)