_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
281f71abfd904ce6f8fa5860e8576b587cfd9f2c7601c65929aed8aefc56957f
dgiot/dgiot
pkcs.erl
%%-------------------------------------------------------------------- Copyright ( c ) 2022 - 2023 DGIOT Technologies Co. , Ltd. All Rights Reserved . %% Licensed under the Apache License , Version 2.0 ( the " License " ) ; %% you may not use this file except in compliance with the License. %% You may obtain a copy...
null
https://raw.githubusercontent.com/dgiot/dgiot/1b502c2a45de67d4158f84c01c61f3af22aa7577/apps/dgiot/src/crypto/pkcs.erl
erlang
-------------------------------------------------------------------- you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ...
Copyright ( c ) 2022 - 2023 DGIOT Technologies Co. , Ltd. All Rights Reserved . Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module (pkcs). -export ([ pad/1, pad/2, unpad/1, unpad/2, pkcs5_pad/1, ...
41552026ed3ed76d777f8120256f5f9c143ccc2f00119205102088f2a62bd885
seckcoder/iu_c311
example.rkt
#lang racket (require racket/pretty "interp.rkt" "../../parser.rkt" "../../base/utils.rkt") (define (example1) Q : what 's the value of cc ? ; A: cc is the continuation of the `then` expression in `if`, ; it also equals the continuation of `if` expression, ; therefore it's the...
null
https://raw.githubusercontent.com/seckcoder/iu_c311/a1215983b6ab08df32058ef1e089cb294419e567/racket/c5_43/scheme/example.rkt
racket
A: cc is the continuation of the `then` expression in `if`, it also equals the continuation of `if` expression, therefore it's the continuation after if A: cc = k because in call/cc the argument pass to `k` is regarded as the result of evaluating call/cc Q: how the code runs? A: cc send the argument as ...
#lang racket (require racket/pretty "interp.rkt" "../../parser.rkt" "../../base/utils.rkt") (define (example1) Q : what 's the value of cc ? (meval '(let ((start #f)) (if (not start) (call/cc (lambda (cc) (set! start cc)))) ...
548188663387d5f6c5daea6c23c46e4c16f7fba92355532edb8d94a81cd3bf84
magnars/what-the-emacsd
templates.clj
(ns what-the-emacsd.templates (:require [net.cgrand.enlive-html :refer :all] [optimus.link :as link] [clojure.java.io :as io])) (defn- stylesheet-link [path] {:tag :link, :attrs {:rel "stylesheet" :href path}}) (defn- inline-script [request path] {:tag :script :content (->> request :o...
null
https://raw.githubusercontent.com/magnars/what-the-emacsd/df4fc396b079e17e476336b497f4e9a38f09a977/src/what_the_emacsd/templates.clj
clojure
(ns what-the-emacsd.templates (:require [net.cgrand.enlive-html :refer :all] [optimus.link :as link] [clojure.java.io :as io])) (defn- stylesheet-link [path] {:tag :link, :attrs {:rel "stylesheet" :href path}}) (defn- inline-script [request path] {:tag :script :content (->> request :o...
1be9cbd30cc0846e03d9af4809a75614fc98fe7a9cfeab5df68fa77b4ed3380d
esl/MongooseIM
graphql_stats_SUITE.erl
-module(graphql_stats_SUITE). -compile([export_all, nowarn_export_all]). -import(common_helper, [unprep/1]). -import(distributed_helper, [mim/0, require_rpc_nodes/1]). -import(domain_helper, [host_type/0, domain/0, secondary_domain/0]). -import(graphql_helper, [execute_command/4, get_ok_value/2, get_unauthorized/1])....
null
https://raw.githubusercontent.com/esl/MongooseIM/2f465eed9a2ac3aae5282b42b52971886e225d81/big_tests/tests/graphql_stats_SUITE.erl
erlang
Admin test cases Domain admin test cases Commands Helpers
-module(graphql_stats_SUITE). -compile([export_all, nowarn_export_all]). -import(common_helper, [unprep/1]). -import(distributed_helper, [mim/0, require_rpc_nodes/1]). -import(domain_helper, [host_type/0, domain/0, secondary_domain/0]). -import(graphql_helper, [execute_command/4, get_ok_value/2, get_unauthorized/1])....
cb0d564d84fd1c6b02098c7c20ec94a7c5da60426bf8670e913acca867c1cdbe
chenyukang/eopl
store.scm
(define instrument-newref (make-parameter #f)) ;;;;;;;;;;;;;;;; references and the store ;;;;;;;;;;;;;;;; ;;; world's dumbest model of the store: the store is a list and a ;;; reference is number which denotes a position in the list. ;; the-store: a Scheme variable containing the current state of the ;; store...
null
https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/ch5/base/store.scm
scheme
references and the store ;;;;;;;;;;;;;;;; world's dumbest model of the store: the store is a list and a reference is number which denotes a position in the list. the-store: a Scheme variable containing the current state of the store. Initially set to a dummy variable. empty-store : () -> Sto initialize-store! ...
(define instrument-newref (make-parameter #f)) (define the-store 'uninitialized) (define empty-store (lambda () '())) (define initialize-store! (lambda () (set! the-store (empty-store)))) (define get-store (lambda () the-store)) (define reference? (lambda (v) (integer? v))) (define newref (lam...
b8d1acf9c8ede50e8ff8eb15a57eba5012421e7276372b8fc9c8293023daf50f
Bike/mother
dumb-vau.lisp
;;;; dumb-vau.lisp ;;;; simplistic implementation of interpreted operatives ;;;; req. dumb-1parent-env stuff in dumb-1parent-env.lisp (in-package #:mother) (defclass dumb-vau (operative) ((static-env :accessor vau-env :initarg :env) ; i.e. the parent of the constructed env (args-augmenter :accessor vau-augmenter...
null
https://raw.githubusercontent.com/Bike/mother/be571bcc8ed2a9f6c65a5d73e5e711509499420b/dumb-vau.lisp
lisp
dumb-vau.lisp simplistic implementation of interpreted operatives req. dumb-1parent-env stuff in dumb-1parent-env.lisp i.e. the parent of the constructed env typecheck for ptree is implicit in make-matcher CIRCULAR LISTS: replace copy-tree FIXME: dumb error, but i'd like to avoid closing over ptree (both on pri...
(in-package #:mother) (defclass dumb-vau (operative) (args-augmenter :accessor vau-augmenter :initarg :aug :type ptree-matcher) (code :accessor vau-code :initarg :code) (envparam :accessor vau-envparam :initarg :envparam :type (or symbol %ignore)))) (defun make-dumb-vau (env ptree envparam source...
218280391d0a6dd9b3d2f7634f2ef632eacb9fd45bcb9d0c51f8f10ec7e01e31
jpmonettas/clograms
selection.cljs
(ns clograms.diagram.selection (:require [clograms.db :as db])) (defn node-selection-updated [db nodes] (when (= 1 (count nodes)) (let [entity (-> nodes first :entity)] (case (:entity/type entity) :var {:db db} :project {:db db :dispatch-n [[:clograms.events/side-bar-bro...
null
https://raw.githubusercontent.com/jpmonettas/clograms/8586948b5e7439171f1d63030b7a34127c8a63f6/src/cljs/clograms/diagram/selection.cljs
clojure
we also need to select a project and namespace since the browser back button needs it
(ns clograms.diagram.selection (:require [clograms.db :as db])) (defn node-selection-updated [db nodes] (when (= 1 (count nodes)) (let [entity (-> nodes first :entity)] (case (:entity/type entity) :var {:db db} :project {:db db :dispatch-n [[:clograms.events/side-bar-bro...
870d2373f89f409bb311a64bdd93858d66d8a0ad49cf3fd913a760f7e6d745b7
lpeterse/haskell-ssh
Exception.hs
{-# LANGUAGE OverloadedStrings #-} # LANGUAGE GeneralizedNewtypeDeriving # module Network.SSH.Exception where import Control.Exception ( Exception ) import qualified Data.ByteString as BS import Data.String import Data.Word data Disconnect = Disconnect...
null
https://raw.githubusercontent.com/lpeterse/haskell-ssh/d1a614b6bf30c4932ee5a66efcae6e71680b4819/src/hssh-internal/Network/SSH/Exception.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE GeneralizedNewtypeDeriving # module Network.SSH.Exception where import Control.Exception ( Exception ) import qualified Data.ByteString as BS import Data.String import Data.Word data Disconnect = Disconnect DisconnectParty DisconnectReason Disconnect...
bd3c8c0bba0f6ad5fbef8e162a1398f3e0784db66e7761eda2d87ad8f2116ec0
Bogdanp/racket-gui-easy
modal.rkt
#lang racket/base (require racket/gui/easy racket/gui/easy/operator) (define @msg (@ "Click the button")) (define root-renderer (render (window (vpanel (text @msg) (button "Display Modal" (λ () (render (dialog #:style '(close-button) (vpane...
null
https://raw.githubusercontent.com/Bogdanp/racket-gui-easy/6c19681cacff2bf1691b041ebb5eda825687c0b5/examples/modal.rkt
racket
#lang racket/base (require racket/gui/easy racket/gui/easy/operator) (define @msg (@ "Click the button")) (define root-renderer (render (window (vpanel (text @msg) (button "Display Modal" (λ () (render (dialog #:style '(close-button) (vpane...
03f4810f90e951146f2fafbf57e8a0e4b28b5703e6a12c416513549de3f5874a
kit-ty-kate/visitors
expr12.ml
type 'expr oexpr = | EConst of int | EAdd of 'expr * 'expr [@@deriving visitors { name = "omap"; variety = "map" }]
null
https://raw.githubusercontent.com/kit-ty-kate/visitors/fc53cc486178781e0b1e581eced98e07facb7d29/test/expr12.ml
ocaml
type 'expr oexpr = | EConst of int | EAdd of 'expr * 'expr [@@deriving visitors { name = "omap"; variety = "map" }]
3d22a2475f9eece24e4f471e41590063944ca02470830e83aad506cff35e6a73
exercism/racket
triangle-test.rkt
#lang racket (require "triangle.rkt") (module+ test (require rackunit rackunit/text-ui) (define equilateral (test-suite "Equilateral tests" (test-true "All sides are equal" (triangle? '(2 2 2) 'equilateral)) (test-false "Any side is unequal" (...
null
https://raw.githubusercontent.com/exercism/racket/b58b895f9d5a35f5b50e317ec377cd290c8c581e/exercises/practice/triangle/triangle-test.rkt
racket
#lang racket (require "triangle.rkt") (module+ test (require rackunit rackunit/text-ui) (define equilateral (test-suite "Equilateral tests" (test-true "All sides are equal" (triangle? '(2 2 2) 'equilateral)) (test-false "Any side is unequal" (...
2b5dfa8ad415673ff31d1762f1d6499aa0cdbdea3767d6f0d6dc9f47ef67957b
VisionsGlobalEmpowerment/webchange
utils.cljs
(ns webchange.admin.widgets.navigation.utils) (defn set-navigation-items-active [navigation-tree current-route] (map (fn [{:keys [children route] :as item}] (let [updated-children (set-navigation-items-active children current-route) child-active? (some :active? updated-children) ...
null
https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/9f8bf7414a51a0a6b2f8e29088b7e4ecd7233d0f/src/cljs/webchange/admin/widgets/navigation/utils.cljs
clojure
(ns webchange.admin.widgets.navigation.utils) (defn set-navigation-items-active [navigation-tree current-route] (map (fn [{:keys [children route] :as item}] (let [updated-children (set-navigation-items-active children current-route) child-active? (some :active? updated-children) ...
45b8342d203813fa795eaf8a50a2169e466061927b1ddf2954658f9a8f78b8e5
lambe-lang/nethra
t03_terms.ml
open Common open Nethra.Syntax.Source open Nethra.Toy.Parser let parser_pi_implicit () = let open Expression.Impl (Parsec) in let result = response render @@ term @@ Parsec.source (Utils.chars_of_string "{a:b} -> c") and expected = (Some "{a:b} -> c", true) in Alcotest.(check (pair (option string) ...
null
https://raw.githubusercontent.com/lambe-lang/nethra/7211f2524a77d42e15a0ceda4bde4324987d6dd8/test/nethra/toy/s01_parser/t03_terms.ml
ocaml
TODO(didier)
open Common open Nethra.Syntax.Source open Nethra.Toy.Parser let parser_pi_implicit () = let open Expression.Impl (Parsec) in let result = response render @@ term @@ Parsec.source (Utils.chars_of_string "{a:b} -> c") and expected = (Some "{a:b} -> c", true) in Alcotest.(check (pair (option string) ...
0b33b194840d879b6a5357dc73981833c45c5d3753e98ae71a212b32d99d6db5
lispbuilder/lispbuilder
package.lisp
;;;; lispbuilder-sdl (in-package #:lispbuilder-sdl) (export ;; cl-vectors.lisp '(image-put-pixel image-put-span))
null
https://raw.githubusercontent.com/lispbuilder/lispbuilder/589b3c6d552bbec4b520f61388117d6c7b3de5ab/lispbuilder-sdl/glue-cl-vectors/package.lisp
lisp
lispbuilder-sdl cl-vectors.lisp
(in-package #:lispbuilder-sdl) (export '(image-put-pixel image-put-span))
6751a1c301faa8c014fb32978c0c0cbf74387d99b8c6a8e4215baf2d9721a194
newque/newque
local.mli
module M : Persistence.Template val create : file:string -> chan_name:string -> avg_read:int -> M.t Lwt.t
null
https://raw.githubusercontent.com/newque/newque/dee73e2cb7be8700847f9e5cf900731cc20b1b8c/src/persistence/local/local.mli
ocaml
module M : Persistence.Template val create : file:string -> chan_name:string -> avg_read:int -> M.t Lwt.t
6de6f219e8bf0075e3613c20cda9214a5e7d9f79dbf8d641ab6f9d60ffb49466
thomas-villagers/clojurelibgdx
myscreen.clj
(ns clojure.gdx.myscreen (:import (com.badlogic.gdx Gdx Screen) (com.badlogic.gdx.scenes.scene2d Stage) (com.badlogic.gdx.scenes.scene2d.ui Label Label$LabelStyle) (com.badlogic.gdx.graphics Color) (com.badlogic.gdx.graphics.g2d BitmapFont))) (declare ^Stage stage) (defn ...
null
https://raw.githubusercontent.com/thomas-villagers/clojurelibgdx/902f7ce0618a938d2b4ad47f8eb58f4876de7a3e/clojure.gdx/src/clojure/gdx/myscreen.clj
clojure
(ns clojure.gdx.myscreen (:import (com.badlogic.gdx Gdx Screen) (com.badlogic.gdx.scenes.scene2d Stage) (com.badlogic.gdx.scenes.scene2d.ui Label Label$LabelStyle) (com.badlogic.gdx.graphics Color) (com.badlogic.gdx.graphics.g2d BitmapFont))) (declare ^Stage stage) (defn ...
9bf941ddd795d2f015cd6006b95d693fbb61045386a221633382d0f4f49c1d47
owickstrom/pandoc-emphasize-code
Latex.hs
# LANGUAGE CPP # # LANGUAGE LambdaCase # {-# LANGUAGE OverloadedStrings #-} module Text.Pandoc.Filter.EmphasizeCode.Latex ( Latex (Latex), ) where #if MIN_VERSION_base(4,8,0) import Data.Semigroup ((<>)) #else import Control.Applicative import Data.Monoid...
null
https://raw.githubusercontent.com/owickstrom/pandoc-emphasize-code/8f2de8fd78206eb6583bb5a6beca492f250cc25e/src/Text/Pandoc/Filter/EmphasizeCode/Latex.hs
haskell
# LANGUAGE OverloadedStrings #
# LANGUAGE CPP # # LANGUAGE LambdaCase # module Text.Pandoc.Filter.EmphasizeCode.Latex ( Latex (Latex), ) where #if MIN_VERSION_base(4,8,0) import Data.Semigroup ((<>)) #else import Control.Applicative import Data.Monoid #endif import Data.Char (isSpace) ...
a8a0bbe3dfd9459b7ae31976c9c110f85747486277da4944506e4c4a74f134b3
cyverse-archive/DiscoveryEnvironmentBackend
apps.clj
(ns mescal.agave-de-v2.apps (:use [medley.core :only [remove-vals]] [mescal.agave-de-v2.app-listings :only [get-app-name]]) (:require [clojure.string :as string] [mescal.agave-de-v2.constants :as c] [mescal.agave-de-v2.params :as mp] [mescal.util :as util])) (defn- get-b...
null
https://raw.githubusercontent.com/cyverse-archive/DiscoveryEnvironmentBackend/7f6177078c1a1cb6d11e62f12cfe2e22d669635b/libs/mescal/src/mescal/agave_de_v2/apps.clj
clojure
(ns mescal.agave-de-v2.apps (:use [medley.core :only [remove-vals]] [mescal.agave-de-v2.app-listings :only [get-app-name]]) (:require [clojure.string :as string] [mescal.agave-de-v2.constants :as c] [mescal.agave-de-v2.params :as mp] [mescal.util :as util])) (defn- get-b...
fb56ef78fac74db348521bd9bfb3e65fca83a1c924b3ca75c995e3ef099cedcc
jerith/chaocaml
test_discord.ml
open OUnit2 open Lwt.Infix let section = Lwt_log.Section.make "test_discord" let dlog msg = Lwt_log.debug ~section ("[D] " ^ msg) let api_port = ref 20000 let api_base () = ":" ^ (string_of_int !api_port) ^ "/api" let fping () = let open Cohttp in let open Cohttp_lwt_unix in api_base () ^ "/fping" |> Uri.of_...
null
https://raw.githubusercontent.com/jerith/chaocaml/9489ee4386f9e97becebc5afab85cada6c5466ab/test/test_discord.ml
ocaml
Lwt_log.(add_rule "discord" Debug); Lwt_log.(add_rule "fake_discord" Debug); The token is random, so we can't test it directly, but it's checked when we get the gateway.
open OUnit2 open Lwt.Infix let section = Lwt_log.Section.make "test_discord" let dlog msg = Lwt_log.debug ~section ("[D] " ^ msg) let api_port = ref 20000 let api_base () = ":" ^ (string_of_int !api_port) ^ "/api" let fping () = let open Cohttp in let open Cohttp_lwt_unix in api_base () ^ "/fping" |> Uri.of_...
e7c7520ae4747438ebe555ce37d215f94e048fd27d1039d79a2fd27aedead411
SnootyMonkey/coming-soon
webhook.clj
(ns coming-soon.webhooks.webhook) ;; Call an external service as a result of a new contact (:email and ;; :referrer) being created. The webhook specific configuration options, if any, ;; are passed in as a :config map. It's OK if your implementation is blocking as ;; this will be invoked asynchronously. (defmulti invo...
null
https://raw.githubusercontent.com/SnootyMonkey/coming-soon/52f9ed9911b8eeb005f43dd13f3ff0285c418e01/src/coming_soon/webhooks/webhook.clj
clojure
Call an external service as a result of a new contact (:email and :referrer) being created. The webhook specific configuration options, if any, are passed in as a :config map. It's OK if your implementation is blocking as this will be invoked asynchronously.
(ns coming-soon.webhooks.webhook) (defmulti invoke :webhook) (defmethod invoke :default [args] (println "Warning: no webhook implementation for -" (:webhook args)))
f7a0494df58e927c75a5b111e552162d82499a41deae93aa252569a01a00c4b2
Clozure/ccl
l1-processes.lisp
-*- Mode : Lisp ; Package : CCL -*- ;;; Copyright 1994 - 2009 Clozure Associates ;;; 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 appl...
null
https://raw.githubusercontent.com/Clozure/ccl/6c1a9458f7a5437b73ec227e989aa5b825f32fd3/level-1/l1-processes.lisp
lisp
Package : CCL -*- 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 la...
Copyright 1994 - 2009 Clozure Associates distributed under the License is distributed on an " AS IS " BASIS , (cl:in-package "CCL") (let* ((all-processes ()) (shutdown-processes ()) (all-processes-lock (make-lock))) (defun add-to-all-processes (p) (with-lock-grabbed (all-processes-lock) ...
f11de1f216fc397060969543dfba2ef95743d41ebf76290573d654f8ce1b384f
dimitri/pginstall
client.lisp
;;; ;;; Some tooling to talk to the repository server. ;;; (in-package #:pginstall.client) (defun build-api-uri (&rest query) "Build the API HTTP URI to use for the API described in API." (format nil "~aapi/~{~a~^/~}" *repo-server* (mapcar (lambda (element) (typecase element...
null
https://raw.githubusercontent.com/dimitri/pginstall/66e4274fc544c48be03c719f8d3f03955649a994/src/animal/client.lisp
lisp
Some tooling to talk to the repository server. given our strange specs on the parameter list, we get to parse it ourselves.
(in-package #:pginstall.client) (defun build-api-uri (&rest query) "Build the API HTTP URI to use for the API described in API." (format nil "~aapi/~{~a~^/~}" *repo-server* (mapcar (lambda (element) (typecase element (symbol (string-downcase (symbol-nam...
91a643ee788a461a257f87666b1dc3a5f98f0d9cff8276c005f9cfbf67b90576
ice1000/learn
sumfibs.hs
module Codewars.Fibonacci where fibs = 0 : 1 : (zipWith (+) fibs $ tail fibs) sumFibs :: Int -> Integer sumFibs n = sum $ filter even $ take (n + 1) fibs
null
https://raw.githubusercontent.com/ice1000/learn/4ce5ea1897c97f7b5b3aee46ccd994e3613a58dd/Haskell/CW-Kata/sumfibs.hs
haskell
module Codewars.Fibonacci where fibs = 0 : 1 : (zipWith (+) fibs $ tail fibs) sumFibs :: Int -> Integer sumFibs n = sum $ filter even $ take (n + 1) fibs
91ab2add8775093ea28f5813f88cdd80c7d331fcd1e55f9bc6e42de053e6b4d0
kindista/kindista
help.lisp
Copyright 2012 - 2016 CommonGoods Network , Inc. ;;; This file is part of Kindista . ;;; Kindista is free software : you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation , either version 3 of the License , or ;;; (at you...
null
https://raw.githubusercontent.com/kindista/kindista/60da1325e628841721200aa00e4de5f9687c0adb/src/features/help.lisp
lisp
(at your option) any later version. without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public License for more details.
Copyright 2012 - 2016 CommonGoods Network , Inc. This file is part of Kindista . Kindista is free software : you can redistribute it and/or modify it under the terms of the GNU Affero General Public License as published by the Free Software Foundation , either version 3 of the License , or Kindista is distr...
09d64d43f03cb5dc486ac518f1a9d1ae637b545e878a88d6fcaf9da93d82f1a7
ocaml-flambda/ocaml-jst
stypes.ml
(**************************************************************************) (* *) (* OCaml *) (* *) ...
null
https://raw.githubusercontent.com/ocaml-flambda/ocaml-jst/5bf2820278c58f6715dcfaf6fa61e09a9b0d8db3/typing/stypes.ml
ocaml
************************************************************************ OCaml ...
, projet , INRIA Rocquencourt Copyright 2003 Institut National de Recherche en Informatique et the GNU Lesser General Public License version 2.1 , with the open Annot;; open Lexing;; open Location;; open Typedtree;; let output_int oc i = output_string oc (Int.to_stri...
77a9ca3e21fdc89f6e04a39596cf075f600208bdc1fcb44dd83a44328e1c7c98
hemmi/coq2scala
glob_termops.mli
open Glob_term (* Ocaml 3.06 Map.S does not handle is_empty *) val idmap_is_empty : 'a Names.Idmap.t -> bool (* [get_pattern_id pat] returns a list of all the variable appearing in [pat] *) val get_pattern_id : cases_pattern -> Names.identifier list (* [pattern_to_term pat] returns a glob_constr corresponding to [p...
null
https://raw.githubusercontent.com/hemmi/coq2scala/d10f441c18146933a99bf2088116bd213ac3648d/coq-8.4pl2/plugins/funind/glob_termops.mli
ocaml
Ocaml 3.06 Map.S does not handle is_empty [get_pattern_id pat] returns a list of all the variable appearing in [pat] [pattern_to_term pat] returns a glob_constr corresponding to [pat]. [pat] must not contain occurences of anonymous pattern Some basic functions to rebuild glob_constr In each of them the ...
open Glob_term val idmap_is_empty : 'a Names.Idmap.t -> bool val get_pattern_id : cases_pattern -> Names.identifier list val pattern_to_term : cases_pattern -> glob_constr val mkGRef : Libnames.global_reference -> glob_constr val mkGVar : Names.identifier -> glob_constr val mkGApp : glob_constr*(glob_constr list)...
6e412adffbf908ce295ab97b27b25ec8843bcc68186c50f11fa4f2bf1d01e513
PaulRivier/kiwi
Search.hs
# LANGUAGE OverloadedStrings , NamedFieldPuns # module Kiwi.Search ( initPageSearchEngine , extractTerms ) where import Data.Text.ICU.Char import Data.Text.ICU.Normalize import Data.SearchEngine import qualified Data.Set as S import qualified Data.Text as T import NLP.Sno...
null
https://raw.githubusercontent.com/PaulRivier/kiwi/fa6974af68809f59a39cb1458f58b082d0e552b3/src/Kiwi/Search.hs
haskell
[tag] ainsi que les termes qui le composent
# LANGUAGE OverloadedStrings , NamedFieldPuns # module Kiwi.Search ( initPageSearchEngine , extractTerms ) where import Data.Text.ICU.Char import Data.Text.ICU.Normalize import Data.SearchEngine import qualified Data.Set as S import qualified Data.Text as T import NLP.Sno...
32f3d5e4e76805450f637b0ffd213922f59b8650dbf3432a3b2383757a29bcfc
HouzuoGuo/Aurinko
col_test.clj
(ns Aurinko.col-test (:require (Aurinko [col :as col] [hash :as hash] [fs :as fs])) (:use clojure.test [clojure.java.io :only [file]])) (defn all-docs [col] (let [docs (transient [])] (col/all col #(conj! docs %)) (persistent! docs))) (deftest index2filename (is (= (col/index2filename [:a :b :...
null
https://raw.githubusercontent.com/HouzuoGuo/Aurinko/f24bcab53da45b477d0b842bc4ab9ff1e08f505c/test/Aurinko/col_test.clj
clojure
insert - indexed insert - not indexed read all hash working? update - no grow update and grow index updated? removed removed remove index make a new index get number of documents
(ns Aurinko.col-test (:require (Aurinko [col :as col] [hash :as hash] [fs :as fs])) (:use clojure.test [clojure.java.io :only [file]])) (defn all-docs [col] (let [docs (transient [])] (col/all col #(conj! docs %)) (persistent! docs))) (deftest index2filename (is (= (col/index2filename [:a :b :...
7cc6cd02036b8ec7308f041f930afc70c588926a9a582d1a2bdab076d88e65ef
ghc/testsuite
TH_exn2.hs
# LANGUAGE TemplateHaskell # -- Test error message when the code in a splice -- fails in a lazy fashion (e.g. a (head []) -- thunk is embedded in the returned structure). module TH where $( do { ds <- [d| |] ; return (tail ds) } )
null
https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/th/TH_exn2.hs
haskell
Test error message when the code in a splice fails in a lazy fashion (e.g. a (head []) thunk is embedded in the returned structure).
# LANGUAGE TemplateHaskell # module TH where $( do { ds <- [d| |] ; return (tail ds) } )
28673902341a74cc207b5841338baf4bfe73f18fb584d22851decccb077ca419
eamsden/Animas
VectorSpace.hs
# LANGUAGE MultiParamTypeClasses , FunctionalDependencies , FlexibleInstances # -- | Module : FRP.Animas . Copyright : ( c ) and , Yale University , 2003 -- License : BSD-style (see the LICENSE file in the distribution) -- -- Maintainer : -- Stability : provisional Portability : non...
null
https://raw.githubusercontent.com/eamsden/Animas/2404d1de20982a337109fc6032cb77b022514f9d/src/FRP/Animas/VectorSpace.hs
haskell
| License : BSD-style (see the LICENSE file in the distribution) Maintainer : Stability : provisional Vector space type relation and basic instances. | Type class for a vector space | Vector with no magnitude | Scale the magnitude | De-scale the magnitude | Negation | Subtract a vector from anot...
# LANGUAGE MultiParamTypeClasses , FunctionalDependencies , FlexibleInstances # Module : FRP.Animas . Copyright : ( c ) and , Yale University , 2003 Portability : non - portable ( GHC extensions ) module FRP.Animas.VectorSpace where infixr *^ infixl ^/ infix 7 `dot` infixl 6 ^+^, ^-^ class ...
3fad1371360c80ce0c9e8b241b174df763ddc4ecc14f3cefc9469f676b45f1af
simonmichael/hledger
Custom.hs
A bunch of megaparsec helpers for re - parsing etc . I think these are generic apart from the HledgerParseError name . {-# LANGUAGE BangPatterns #-} # LANGUAGE CPP # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE LambdaCase # # LANGUAGE ScopedTypeVariables # # LANGUAGE StandaloneDeriving #...
null
https://raw.githubusercontent.com/simonmichael/hledger/8f06cefab4dcfd61b5844603a1584d73f367e216/hledger-lib/Text/Megaparsec/Custom.hs
haskell
# LANGUAGE BangPatterns # * Custom parse error types * Failing with an arbitrary source position * Re-parsing * Pretty-printing custom parse errors * "Final" parse errors * Constructing "final" parse errors * Pretty-printing "final" parse errors * Handling parse errors from include files with "final" parse erro...
A bunch of megaparsec helpers for re - parsing etc . I think these are generic apart from the HledgerParseError name . # LANGUAGE CPP # # LANGUAGE FlexibleContexts # # LANGUAGE FlexibleInstances # # LANGUAGE LambdaCase # # LANGUAGE ScopedTypeVariables # # LANGUAGE StandaloneDeriving # module Text.Megaparsec.Custo...
ccde7cf14303d517eeb8a1f0b3b365f157336ae5c70edd5df1bd66eab56346dc
tadeuzagallo/verve-lang
Loc.hs
module Absyn.Loc ( SourcePos , SourceSpan(..) ) where import Text.Parsec (SourcePos) data SourceSpan = SourceSpan { spanStart :: SourcePos , spanEnd :: SourcePos }
null
https://raw.githubusercontent.com/tadeuzagallo/verve-lang/c7db1f5d4bb399b6c2623dd2444a981b5aba1aa4/src/Absyn/Loc.hs
haskell
module Absyn.Loc ( SourcePos , SourceSpan(..) ) where import Text.Parsec (SourcePos) data SourceSpan = SourceSpan { spanStart :: SourcePos , spanEnd :: SourcePos }
38c746e7da18044321d1624675e1a5375429e594151f9329eb93285329995591
msantos/pkt
pkt_arp.erl
Copyright ( c ) 2009 - 2015 , < > %% 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 %% notice, this list of condition...
null
https://raw.githubusercontent.com/msantos/pkt/8c826b25098b06db8c24805fb1da2d65c14abe06/src/pkt_arp.erl
erlang
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 notice, this list of conditions and the following disclaimer. Redistributions in bi...
Copyright ( c ) 2009 - 2015 , < > " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT COPYRIGHT HOLDER OR FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES ; LOSS OF U...
83182c64c2e4e65a3455b7f929c9b0fd2023f9f5ea6a8216457c938eb50051dc
elastic/eui-cljs
search_filters.cljs
(ns eui.search-filters (:require ["@elastic/eui/lib/components/search_bar/search_filters.js" :as eui])) (def EuiSearchFilters eui/EuiSearchFilters)
null
https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/search_filters.cljs
clojure
(ns eui.search-filters (:require ["@elastic/eui/lib/components/search_bar/search_filters.js" :as eui])) (def EuiSearchFilters eui/EuiSearchFilters)
235ee27d8792175bc13007d73f2e3aba1b81bdb815b1d8ccd39322cd290097e8
jrh13/hol-light
make.ml
#load "unix.cma";; loadt "miz3/miz3.ml";;
null
https://raw.githubusercontent.com/jrh13/hol-light/d125b0ae73e546a63ed458a7891f4e14ae0409e2/miz3/make.ml
ocaml
#load "unix.cma";; loadt "miz3/miz3.ml";;
69437248d4fac28a34c5d6a260b17742b50358cb38b9bf64d36854f54ceed843
ocaml-flambda/ocaml-jst
loadprinter.ml
(**************************************************************************) (* *) (* OCaml *) (* *) ...
null
https://raw.githubusercontent.com/ocaml-flambda/ocaml-jst/1bb6c797df7c63ddae1fc2e6f403a0ee9896cc8e/debugger/loadprinter.ml
ocaml
************************************************************************ OCaml ...
, projet Cristal , INRIA Rocquencourt Copyright 1997 Institut National de Recherche en Informatique et the GNU Lesser General Public License version 2.1 , with the open Misc open Longident open Types type error = | Load_failure of Dynlink.error | Unbound_identif...
ec23bbf453a8d50b6843601fd1a41891506f8154ee5f632f89cd4d1dbdfbe2f8
lispbuilder/lispbuilder
fireworks.lisp
;;;;; From Schaf5 at -neues-jahr/ (in-package #:sdl-gfx-examples) (defparameter *width* 640) (defparameter *height* 480) (defun fireworks () (sdl:WITH-INIT () (sdl:WINDOW *width* *height* :title-caption "Fireworks" :icon-caption "Fireworks") (setf (sdl:frame-rate) 0) (let ((world (make-world)) (100-...
null
https://raw.githubusercontent.com/lispbuilder/lispbuilder/589b3c6d552bbec4b520f61388117d6c7b3de5ab/lispbuilder-sdl-gfx/examples/fireworks.lisp
lisp
From Schaf5 at -neues-jahr/
(in-package #:sdl-gfx-examples) (defparameter *width* 640) (defparameter *height* 480) (defun fireworks () (sdl:WITH-INIT () (sdl:WINDOW *width* *height* :title-caption "Fireworks" :icon-caption "Fireworks") (setf (sdl:frame-rate) 0) (let ((world (make-world)) (100-frames-p (every-n-frames 500))) ...
a93410cf52af6a29b0b39faea81bc29537c55334756cee3eaf918a8fa792c3c5
ghc/testsuite
tcrun027.hs
# LANGUAGE ImplicitParams # Killed GHC 5.04.1 module Main where type CTPar = ([Double],Int) us :: (?ctPar :: CTPar) => [Double] us = let (d,_) = ?ctPar in d main = let ?ctPar = ([3.4],2) in print us
null
https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_run/tcrun027.hs
haskell
# LANGUAGE ImplicitParams # Killed GHC 5.04.1 module Main where type CTPar = ([Double],Int) us :: (?ctPar :: CTPar) => [Double] us = let (d,_) = ?ctPar in d main = let ?ctPar = ([3.4],2) in print us
f226b5ae1d9af29d68821ea013e381b6422ed3ef562eb3e2eb30433619093927
stepcut/hyperdrive
HyperIORef.hs
{-# LANGUAGE NoMonomorphismRestriction, OverloadedStrings #-} module Main where import Control.Applicative ((<$>)) import Control.Monad.Trans.State.Strict (StateT(..)) import Control.Monad (when) import Data.ByteString (ByteString) import qualified Data.ByteString ...
null
https://raw.githubusercontent.com/stepcut/hyperdrive/0121e018b6f7aa52f5d513aa2bdee92aafe5439a/experiments/HyperIORef.hs
haskell
# LANGUAGE NoMonomorphismRestriction, OverloadedStrings #
module Main where import Control.Applicative ((<$>)) import Control.Monad.Trans.State.Strict (StateT(..)) import Control.Monad (when) import Data.ByteString (ByteString) import qualified Data.ByteString as B import qualified Data.ByteString.Char8 as B import Dat...
2a47a01f4061886b31406e9241394e129707021d7baa5f046e1810281ee2f9bf
geneweb/geneweb
gwexport.mli
type gwexport_charset = Ansel | Ansi | Ascii | Utf8 type gwexport_opts = { asc : int option; (* Maximum generation of the root's ascendants *) ascdesc : int option; (* Maximum generation of the root's ascendants descendants *) base : (string * Gwdb.base) option; (* The base analyzed *) Censors the base f...
null
https://raw.githubusercontent.com/geneweb/geneweb/747f43da396a706bd1da60d34c04493a190edf0f/bin/gwexport/gwexport.mli
ocaml
Maximum generation of the root's ascendants Maximum generation of the root's ascendants descendants The base analyzed The charset of the export Maximum generation of the root's descendants Unused by this module (and not set by options) Key reference of additional persons to select Unused by this module ...
type gwexport_charset = Ansel | Ansi | Ascii | Utf8 type gwexport_opts = { ascdesc : int option; Censors the base for ' n ' years no_notes : [ `nn | `nnn | `none ]; parentship : bool; If asc , ascdesc and desc are not set & parenting = true , then select individuals involved in parentship between ...
4ae331bbad797269eb162c7d6cd619e17d87b2c9348797eff4cb267204334d95
snowdriftcoop/snowdrift
Import.hs
module Import ( module Import ) where import AppDataTypes as Import import Foundation as Import import Import.NoFoundation as Import
null
https://raw.githubusercontent.com/snowdriftcoop/snowdrift/91fd1b84fea5d9c4aa2c419d91d790d886b3d100/website/src/Import.hs
haskell
module Import ( module Import ) where import AppDataTypes as Import import Foundation as Import import Import.NoFoundation as Import
dc94c169b10e798563064f42307bf62f29020305e0704511d72be78ad5e26490
flexsurfer/re-frame-steroid
fx.clj
(ns steroid.fx (:refer-clojure :exclude [defn])) source (defn- register-events [events interceptors name argsyms] (mapv (fn [event] `(re-frame.core/reg-event-fx ~event (steroid.fx/get-interceptors ~interceptors) (fn [cofx# [_# ~@argsyms]] (~name cofx# ~@argsyms))...
null
https://raw.githubusercontent.com/flexsurfer/re-frame-steroid/c763cb80e34b191824af204bded87a9ccbc23dc3/src/steroid/fx.clj
clojure
(ns steroid.fx (:refer-clojure :exclude [defn])) source (defn- register-events [events interceptors name argsyms] (mapv (fn [event] `(re-frame.core/reg-event-fx ~event (steroid.fx/get-interceptors ~interceptors) (fn [cofx# [_# ~@argsyms]] (~name cofx# ~@argsyms))...
7e3f13b3f0d1a36f2e6928a6682f054392cece44aa497ae75811252496da1fb2
quil/quil-examples
13_noisy_spiral.clj
(ns quil-sketches.gen-art.13-noisy-spiral (:require [quil.core :refer :all] [quil.helpers.drawing :refer [line-join-points]] [quil.helpers.seqs :refer [range-incl steps]] [quil.helpers.calc :refer [mul-add]])) ;; Example 13 - Noisy Spiral Taken from Listing 4.3 , p69 ;; void se...
null
https://raw.githubusercontent.com/quil/quil-examples/9ff9d5578d93682af29d9a080b917a19f8deafc8/src/quil_sketches/gen_art/13_noisy_spiral.clj
clojure
Example 13 - Noisy Spiral void setup() { size(500,300); smooth(); ellipse(centX,centY,radius*2,radius*2); float x, y; float lastx = -999; float lasty = -999; float radiusNoise = random(10); for(float ang=0;ang<=1440;ang+=5){ float rad = radians(ang); if (lastx > -999) {...
(ns quil-sketches.gen-art.13-noisy-spiral (:require [quil.core :refer :all] [quil.helpers.drawing :refer [line-join-points]] [quil.helpers.seqs :refer [range-incl steps]] [quil.helpers.calc :refer [mul-add]])) Taken from Listing 4.3 , p69 (defn setup [] (background 255) (...
810580ebb85da8415effd90ebbeb9d3743f4778c5d2047596cc8b9a0bec4ffb0
dandoh/web-haskell-graphql-postgres-boilerplate
Error.hs
module Error (Error, simpleError, ErrorResponse, toErrorResponse) where import Data.Aeson (ToJSON (..), Value) import GHC.Generics (Generic) data Error = Error {message :: String, extensions :: Maybe Value} deriving (Show, Eq, Generic) newtype ErrorResponse = ErrorResponse {errors :: [Error]} deriving (Show, Eq,...
null
https://raw.githubusercontent.com/dandoh/web-haskell-graphql-postgres-boilerplate/e673e9ee07ce7a4dd9b023328038664e8fdfdd78/src/Error.hs
haskell
----------------------------------------------------------------------------- -----------------------------------------------------------------------------
module Error (Error, simpleError, ErrorResponse, toErrorResponse) where import Data.Aeson (ToJSON (..), Value) import GHC.Generics (Generic) data Error = Error {message :: String, extensions :: Maybe Value} deriving (Show, Eq, Generic) newtype ErrorResponse = ErrorResponse {errors :: [Error]} deriving (Show, Eq,...
77f2af32bcb9fde0d60995e901faa5b1f388d75042922a5bf5e1cb73c6e8572e
achin/lein-parent
t_parent.clj
(ns leiningen.t-parent (:use [midje.sweet]) (:require [leiningen.parent :as p] [lein-parent.plugin :as plugin] [clojure.test :refer :all] [leiningen.core.project :as project] [leiningen.install :as install]) (:import (java.io FileNotFoundException))) (def m {:a 1 ...
null
https://raw.githubusercontent.com/achin/lein-parent/37630e184a37f9adc2a431f4016624b3e815f848/test/leiningen/t_parent.clj
clojure
should not get here! with-profiles calls the set-profiles function to 'activate' selected profiles with-profiles calls the set-profiles function to 'activate' selected profiles
(ns leiningen.t-parent (:use [midje.sweet]) (:require [leiningen.parent :as p] [lein-parent.plugin :as plugin] [clojure.test :refer :all] [leiningen.core.project :as project] [leiningen.install :as install]) (:import (java.io FileNotFoundException))) (def m {:a 1 ...
f04739fa62f2d6ad06e8e1178c511c73d695c59b1096960d25f63630fab6f1b1
backtracking/ocaml-bazaar
test_bitset.ml
open Bitset let () = assert (cardinal full = Sys.int_size) let () = assert (max_elt full = Sys.int_size - 1) let () = assert (min_elt full = 0) let () = assert (union full full = full) let () = assert (union empty full = full) let () = assert (inter full full = full) let () = assert (inter full empty = empty) let () ...
null
https://raw.githubusercontent.com/backtracking/ocaml-bazaar/115ab846356fef628e25a496876fd560e7beae40/test_bitset.ml
ocaml
open Bitset let () = assert (cardinal full = Sys.int_size) let () = assert (max_elt full = Sys.int_size - 1) let () = assert (min_elt full = 0) let () = assert (union full full = full) let () = assert (union empty full = full) let () = assert (inter full full = full) let () = assert (inter full empty = empty) let () ...
498c81b147e8855561eda205c303f7791781be902e5dac29c6746e691e7d91c1
coalton-lang/coalton
ord-tree.lisp
(coalton-library/utils:defstdlib-package :coalton-library/ord-tree (:use :coalton :coalton-library/classes #:coalton-library/hash :coalton-library/tuple :coalton-library/functions) (:local-nicknames (#:iter :coalton-library/iterator) (#:cell :coalton-library/cell)) (:shadow #:em...
null
https://raw.githubusercontent.com/coalton-lang/coalton/57e5622346add6aca753e3c4830afaed65e6d6df/library/ord-tree.lisp
lisp
adapted from -black-delete/ the red-black tree invariants: - the left child of a node is less than the node, and the right child is greater - a red node has no red children - a leaf is black - every path from the root to a leaf passes through the same number of black nodes unexported; a marker held by trees to e...
(coalton-library/utils:defstdlib-package :coalton-library/ord-tree (:use :coalton :coalton-library/classes #:coalton-library/hash :coalton-library/tuple :coalton-library/functions) (:local-nicknames (#:iter :coalton-library/iterator) (#:cell :coalton-library/cell)) (:shadow #:em...
ed9fc6992c1b3d32f571109c95afae9236bfdd8e35e5e3589df3d89305d47dae
dalaing/little-languages
Lazy.hs
| Copyright : ( c ) , 2016 License : : Stability : experimental Portability : non - portable Small - step rules and helpers for the N language . This is the lazy evaluation variant . Copyright : (c) Dave Laing, 2016 License : BSD3 Maintainer : Stability : experimental Portab...
null
https://raw.githubusercontent.com/dalaing/little-languages/9f089f646a5344b8f7178700455a36a755d29b1f/code/n/src/Term/Eval/SmallStep/Lazy.hs
haskell
from 'base' local | The small-step rule for the 'pred O' case. | The small-step rule for the 'pred S' case. | The small-step rule for the 'pred tm' where tm is not a value. ^ The small-step function for N | The set of small-step rules for the N language. The small-step rules return a 'Just' value when their i...
| Copyright : ( c ) , 2016 License : : Stability : experimental Portability : non - portable Small - step rules and helpers for the N language . This is the lazy evaluation variant . Copyright : (c) Dave Laing, 2016 License : BSD3 Maintainer : Stability : experimental Portab...
ed094d74b249d87d77f5ce516f02ef3edc61f7f8c2178c716238cf657b7e124e
hyperfiddle/electric
hfql25.clj
* Rewrite of HFQL 24 to qualify or unqualify symbols ;; Same tests , same context as HFQL 24 . Only ` compile - hfql * ` changes . ;; ;; ** DONE unqualify in let binding CLOSED : [ 2021 - 04 - 22 jeu . 12:10 ] ;; `clojure.core/let` don't support it. We need to generate a unique name ;; compatible with ...
null
https://raw.githubusercontent.com/hyperfiddle/electric/1c6c3891cbf13123fef8d33e6555d300f0dac134/scratch/dustin/y2021/hfql/hfql25.clj
clojure
** DONE unqualify in let binding `clojure.core/let` don't support it. We need to generate a unique name compatible with `c.c/let` and rewrite terms where needed. ** DONE qualify symbols in quoted forms According to current ns, including aliases, except for lexically bound ones. We manually qua...
* Rewrite of HFQL 24 to qualify or unqualify symbols Same tests , same context as HFQL 24 . Only ` compile - hfql * ` changes . CLOSED : [ 2021 - 04 - 22 jeu . 12:10 ] CLOSED : [ 2021 - 04 - 22 jeu . 15:27 ] (ns dustin.hfql.hfql25 (:require # ? (: [ datomic.api : as d ] ) [dustin.dev :refer [male...
b20e316ad9c180eac9220207d51c746869ead6cfaa0055096d0547f1cd1ec279
lambdaclass/holiday_pinger
db_user.erl
-module(db_user). -export([create_user/4, get/1, delete/1, get_with_password/1, get_verification/1, reset_verification/2, get_password_reset/1, reset_password/2, set_password/2, set_verified/1, user_keys/0]). %% needed so atoms ...
null
https://raw.githubusercontent.com/lambdaclass/holiday_pinger/a8a6d1e28de57cf24d6205d275981a718305b351/src/db/db_user.erl
erlang
needed so atoms exist.
-module(db_user). -export([create_user/4, get/1, delete/1, get_with_password/1, get_verification/1, reset_verification/2, get_password_reset/1, reset_password/2, set_password/2, set_verified/1, user_keys/0]). user_keys () -> [em...
6f4dc842e0e83eccf5b7f07593efbb6136724e5b6dca004a901b78d18436b017
fyquah/hardcaml_zprize
test_mixed_add_barrett_reduction.ml
open Core open Test_mixed_add module Xyzt = Test_mixed_add.Xyzt module Xyt = Test_mixed_add.Xyt let random_z = Field_ops_test.Utils.random_z let p = Ark_bls12_377_g1.modulus () let xyzt_to_xyt xyzt = let ({ x; y } : Model.Twisted_edwards_curve.affine) = let { Xyzt.x; y; z; t } = xyzt in Model.Twisted_edward...
null
https://raw.githubusercontent.com/fyquah/hardcaml_zprize/553b1be10ae9b977decbca850df6ee2d0595e7ff/libs/twisted_edwards/test/test_mixed_add_barrett_reduction.ml
ocaml
Exercise doubling Exercise x + -x Exercise x + O
open Core open Test_mixed_add module Xyzt = Test_mixed_add.Xyzt module Xyt = Test_mixed_add.Xyt let random_z = Field_ops_test.Utils.random_z let p = Ark_bls12_377_g1.modulus () let xyzt_to_xyt xyzt = let ({ x; y } : Model.Twisted_edwards_curve.affine) = let { Xyzt.x; y; z; t } = xyzt in Model.Twisted_edward...
7ee83475edc25dfb0ecf7f6ea118f3803212f4c0d418d01bc00917226dc77887
RuiL1904/Block-Knight-LI1
Tarefa3_2021li1g033.hs
| Module : Tarefa3_2021li1g033 Description : Representação textual do : < > ; : < > ; O objetivo desta tarefa é tornar o tipo de dados ' ' uma class ' Show ' de acordo com a seguinte formatação : 1 . Espaços vazios por " " ( um espaço em branco ) . 2 . Blocos de p...
null
https://raw.githubusercontent.com/RuiL1904/Block-Knight-LI1/84330a7691b407189771e53a4cd543fdb592bc2b/src/Tarefa3_2021li1g033.hs
haskell
** Posicionar o 'Jogador'. ^ Resultado. ^ Resultado. | Auxiliar de 'mapaParaString' - Transforma uma linha (lista de 'Peca') numa 'String'. ^ Resultado. p é uma ' ' neste caso . p é uma 'Peca' neste caso. ^ Resultado. ^ O 'Jogador'. dir = = Oeste dir == Oeste ^ O 'Jogador'. ^ Resultado. dir == Oeste ^...
| Module : Tarefa3_2021li1g033 Description : Representação textual do : < > ; : < > ; O objetivo desta tarefa é tornar o tipo de dados ' ' uma class ' Show ' de acordo com a seguinte formatação : 1 . Espaços vazios por " " ( um espaço em branco ) . 2 . Blocos de p...
c141f7bcfa2092dbe46a89a41f63edda263792bbeeb0df89eecd241ed4a1b434
funcool/octet
deps.cljs
{:externs ["octet/_externs.js"]}
null
https://raw.githubusercontent.com/funcool/octet/6afe46d98717e5a538c97c5445a29686524bd0c9/src/deps.cljs
clojure
{:externs ["octet/_externs.js"]}
bb7e6e2996389e47214cca7074632f0a56066d2a1bb26e00d55da11582683c3c
xxyzz/SICP
Exercise_4_28.rkt
#lang racket/base (define (add1 x) (+ x 1)) (define (add1-to-list proc l) (if (null? l) l (cons (proc (car l)) (cdr l)))) (add1-to-list add1 (list 1 2 3)) ;; if use `eval` instead of `actual-val` in the `application?` branch of `eval`, `myapply` will get a thunk of `proc` as a prcedure. Thus we get unk...
null
https://raw.githubusercontent.com/xxyzz/SICP/e26aea1c58fd896297dbf5406f7fcd32bb4f8f78/4_Metalinguistic_Abstraction/4.2_Variations_on_a_Scheme_Lazy_Evaluation/Exercise_4_28.rkt
racket
if use `eval` instead of `actual-val` in the `application?` branch of `eval`, `myapply` will get a thunk of `proc` as a prcedure. Thus we get unknown procedure type error.
#lang racket/base (define (add1 x) (+ x 1)) (define (add1-to-list proc l) (if (null? l) l (cons (proc (car l)) (cdr l)))) (add1-to-list add1 (list 1 2 3))
4a2ca2f0fe4f2677cb3d657e7152e9f02c03f5f0f1ede02b2a3f59ac0af418fa
basho/riak_test
verify_tick_change.erl
%% ------------------------------------------------------------------- %% Copyright ( c ) 2013 Basho Technologies , 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 %% a copy of the Li...
null
https://raw.githubusercontent.com/basho/riak_test/8170137b283061ba94bc85bf42575021e26c929d/tests/verify_tick_change.erl
erlang
------------------------------------------------------------------- Version 2.0 (the "License"); you may not use this file a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, KIND, either express or implied. See the License for the specific language governing permissio...
Copyright ( c ) 2013 Basho Technologies , 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(verify_tick_change). -b...
79c415e98eebce3c6a80df2dc249d3b75a4d9b4534554399b18833f1e76d2c19
lopec/LoPEC
logger_ext_test.erl
-module(logger_ext_test). This can not be done simple with EUnit ( ) % $DateLastEdited$ report_from_client_test() -> ServerPid = spawn(logger_ext, start, ["test.txt"]), ClientPid = spawn(logger_int, start, [ServerPid, [error]]), ClientPid ! {event, self(), "This is a message to Client which will be ...
null
https://raw.githubusercontent.com/lopec/LoPEC/29a3989c48a60e5990615dea17bad9d24d770f7b/branches/stable-1/old_stuff/old_master/src/logger_ext_test.erl
erlang
$DateLastEdited$
-module(logger_ext_test). This can not be done simple with EUnit ( ) report_from_client_test() -> ServerPid = spawn(logger_ext, start, ["test.txt"]), ClientPid = spawn(logger_int, start, [ServerPid, [error]]), ClientPid ! {event, self(), "This is a message to Client which will be relayed to ser...
73638dafb653e216f615c5d6fba5442c11a5a367478a2115172441b186fa8b91
samrushing/irken-compiler
t_llp.scm
;; -*- Mode: Irken -*- (define (^llvm-mv) (let ((v (%make-vector #f 10 0))) v[5])) (^llvm-mv)
null
https://raw.githubusercontent.com/samrushing/irken-compiler/690da48852d55497f873738df54f14e8e135d006/tests/llvm/t_llp.scm
scheme
-*- Mode: Irken -*-
(define (^llvm-mv) (let ((v (%make-vector #f 10 0))) v[5])) (^llvm-mv)
5fd3617d3be83916327420818c790830d146bcef36f940d97d781e06d7b59b21
elastic/eui-cljs
icon_copy.cljs
(ns eui.icon-copy (:require ["@elastic/eui/lib/components/icon/assets/copy.js" :as eui])) (def copy eui/icon)
null
https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/icon_copy.cljs
clojure
(ns eui.icon-copy (:require ["@elastic/eui/lib/components/icon/assets/copy.js" :as eui])) (def copy eui/icon)
ad2b6d7110ce6a86e62d354e60e702b7997ac6f5352008f63d2d2927e861e704
yutopp/rill
counter.ml
* Copyright yutopp 2019 - . * * Distributed under the Boost Software License , Version 1.0 . * ( See accompanying file LICENSE_1_0.txt or copy at * ) * Copyright yutopp 2019 - . * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * )...
null
https://raw.githubusercontent.com/yutopp/rill/375b67c03ab2087d0a2a833bd9e80f3e51e2694f/rillc/lib/common/counter.ml
ocaml
* Copyright yutopp 2019 - . * * Distributed under the Boost Software License , Version 1.0 . * ( See accompanying file LICENSE_1_0.txt or copy at * ) * Copyright yutopp 2019 - . * * Distributed under the Boost Software License, Version 1.0. * (See accompanying file LICENSE_1_0.txt or copy at * )...
a6b4c1296b8563eec8fa03fb65acc5071c1fc9b353209b395423089b47715ad8
theodormoroianu/SecondYearCourses
HaskellChurch_20210415163722.hs
{-# LANGUAGE RankNTypes #-} module HaskellChurch where A boolean is any way to choose between two alternatives newtype CBool = CBool {cIf :: forall t. t -> t -> t} An instance to show as regular Booleans instance Show CBool where show b = "cBool " <> show (cIf b True False) The boolean constant true always ...
null
https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/HaskellChurch_20210415163722.hs
haskell
# LANGUAGE RankNTypes # The boolean negation switches the alternatives The boolean conjunction can be built as a conditional The boolean disjunction can be built as a conditional a pair is a way to compute something based on the values contained within the pair. a function to be applied on the values, it will apply i...
module HaskellChurch where A boolean is any way to choose between two alternatives newtype CBool = CBool {cIf :: forall t. t -> t -> t} An instance to show as regular Booleans instance Show CBool where show b = "cBool " <> show (cIf b True False) The boolean constant true always chooses the first alternativ...
747c97c169db68e75e934d022a794d55417ee1176605b83d134833805381111a
PagingMatt/osilo
File_tree.ml
type 'a t = | Node of string * 'a option * 'a t * 'a t * 'a t | Leaf exception Path_empty let empty = Leaf let insert ~element ~tree ~location ~select ~terminate = let location' = location element in let rec ins path tree' = match path with | [] -> raise Path_empty | x::[] -> (matc...
null
https://raw.githubusercontent.com/PagingMatt/osilo/3ef63a3c0970444c19bd5abf52ad9db154829904/src/File_tree.ml
ocaml
type 'a t = | Node of string * 'a option * 'a t * 'a t * 'a t | Leaf exception Path_empty let empty = Leaf let insert ~element ~tree ~location ~select ~terminate = let location' = location element in let rec ins path tree' = match path with | [] -> raise Path_empty | x::[] -> (matc...
d13e6fa1e77748af50ae631d199fe8c6ff890d2854c5f43a10776609d01d2e9c
gabebw/croniker
Feed.hs
module Handler.Feed ( getFeedR ) where import Import import Helper.Request (fromMaybe404) import Model.Profile (feedProfilesFor) import Text.Blaze.Html5 ((!), textValue, img, li, p, ul) import Text.Blaze.Html5.Attributes (src) import Yesod.RssFeed getFeedR :: UserId -> Handler RepRss getFeedR userId = do ...
null
https://raw.githubusercontent.com/gabebw/croniker/89f081738c229a3302af3b0123fea208bccbda11/Handler/Feed.hs
haskell
module Handler.Feed ( getFeedR ) where import Import import Helper.Request (fromMaybe404) import Model.Profile (feedProfilesFor) import Text.Blaze.Html5 ((!), textValue, img, li, p, ul) import Text.Blaze.Html5.Attributes (src) import Yesod.RssFeed getFeedR :: UserId -> Handler RepRss getFeedR userId = do ...
a00fc1117380ead5479a3194092b0da024ca11e1da5e1a370f42d9523fe84f7c
tari3x/csec-modex
bad_opaque_calls.ml
Copyright ( c ) ( ) . This file is distributed as part of csec - tools under a BSD license . See LICENSE file for copyright notice . Copyright (c) Mihhail Aizatulin (). This file is distributed as part of csec-tools under a BSD license. See LICENSE file for copyright notice. *) (** Outputs all pairs...
null
https://raw.githubusercontent.com/tari3x/csec-modex/5ab2aa18ef308b4d18ac479e5ab14476328a6a50/src/CIL/bad_opaque_calls.ml
ocaml
* Outputs all pairs (v, w) such that v is a proxy, w is an opaque function called from v and v <> w_proxy. && not w.is_vararg
Copyright ( c ) ( ) . This file is distributed as part of csec - tools under a BSD license . See LICENSE file for copyright notice . Copyright (c) Mihhail Aizatulin (). This file is distributed as part of csec-tools under a BSD license. See LICENSE file for copyright notice. *) module List = ListLabe...
3afffc393d6e1033151d774046fa386438552c6597af4b7e564968887c51d50e
vaibhavsagar/experiments
Serve.hs
{-# LANGUAGE OverloadedStrings #-} module Nix.Serve (module Nix.Serve) where import Data.ByteString import Network.HTTP.Types.Status import Nix.LocalStore import Nix.Store import Web.Scotty server :: ScottyM () server = do get "/nix-cache-info" $ do return () get (regex "/([0-9a-z]+)\\.narinfo") $ do ...
null
https://raw.githubusercontent.com/vaibhavsagar/experiments/378d7ba97eabfc7bbeaa4116380369ea6612bfeb/hnix-serve/Nix/Serve.hs
haskell
# LANGUAGE OverloadedStrings #
module Nix.Serve (module Nix.Serve) where import Data.ByteString import Network.HTTP.Types.Status import Nix.LocalStore import Nix.Store import Web.Scotty server :: ScottyM () server = do get "/nix-cache-info" $ do return () get (regex "/([0-9a-z]+)\\.narinfo") $ do hashPart <- param "1" :: ActionM B...
cc2cf2c4526d260d472ca7ba81a0e5ce685339e98d86cbed5f22091e382cce19
ahungry/slugelisp
shlyfile.lisp
;; -*- mode: common-lisp -*- (ql:quickload '(:slugelisp :split-sequence)) (import 'split-sequence:split-sequence) #+sbcl(setf sb-impl::*default-external-format* :utf-8) #+sbcl(setf sb-alien::*default-c-string-external-format* :utf-8) (defun start (&key (port 8080) (server :fcgi) ...
null
https://raw.githubusercontent.com/ahungry/slugelisp/ff4118e59691cc8d9e87966b0dfdfaa8986004c9/shlyfile.lisp
lisp
-*- mode: common-lisp -*-
(ql:quickload '(:slugelisp :split-sequence)) (import 'split-sequence:split-sequence) #+sbcl(setf sb-impl::*default-external-format* :utf-8) #+sbcl(setf sb-alien::*default-c-string-external-format* :utf-8) (defun start (&key (port 8080) (server :fcgi) (debug nil)) (flet ((star...
6bbcb01e7d00285ee625b04630faac728b8de4b19fdc8936216608b02c74ce43
basho/riak_kv
riak_kv_yessir_backend.erl
%% ------------------------------------------------------------------- %% riak_kv_yessir_backend : simulation backend for Riak %% Copyright ( c ) 2012 - 2013 Basho Technologies , Inc. All Rights Reserved . %% This file is provided to you under the Apache License , %% Version 2.0 (the "License"); you may not use...
null
https://raw.githubusercontent.com/basho/riak_kv/aeef1591704d32230b773d952a2f1543cbfa1889/src/riak_kv_yessir_backend.erl
erlang
------------------------------------------------------------------- Version 2.0 (the "License"); you may not use this file a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, KIND, either express or implied. See the License for the specific language governing permissi...
riak_kv_yessir_backend : simulation backend for Riak Copyright ( c ) 2012 - 2013 Basho Technologies , Inc. All Rights Reserved . This file is provided to you under the Apache License , except in compliance with the License . You may obtain software distributed under the License is distributed on an " AS...
c61d933bc507ee6d6d479e3f7069e8e111ff462fe30d81eb0ff9d378bdd81cda
jyh/metaprl
itt_supinf.mli
doc <:doc< @module[Itt_supinf] SupInf decision procedure (eventually it'll become a true tactic). ---------------------------------------------------------------- @begin[license] This file is part of MetaPRL, a modular, higher order logical framework that provides a logical programming environm...
null
https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/itt/applications/supinf/itt_supinf.mli
ocaml
doc <:doc< @module[Itt_supinf] SupInf decision procedure (eventually it'll become a true tactic). ---------------------------------------------------------------- @begin[license] This file is part of MetaPRL, a modular, higher order logical framework that provides a logical programming environm...
a90e5be249ffdf9f6d8559123bdd35599c0daba540adcb4483233f1afb78bf5d
kind2-mc/kind2
model.mli
This file is part of the Kind 2 model checker . Copyright ( c ) 2015 by the Board of Trustees of the University of Iowa 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 a...
null
https://raw.githubusercontent.com/kind2-mc/kind2/c601470eb68af9bd3b88828b04dbcdbd6bd6bbf5/src/model.mli
ocaml
* Term or lambda expression * A model is a list of variables and assignemnts * A path is a map of state variables to assignments * Equality over values of model * Offset of the variables at each step of a path. * Pretty-print a value * Pretty-print a value in xml format * Pretty-print a model * Pretty-print a p...
This file is part of the Kind 2 model checker . Copyright ( c ) 2015 by the Board of Trustees of the University of Iowa 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 a...
6f5b72144f899d71080a8578c93e84f7b178c7942bf457b94c446b46cef93853
gedge-platform/gedge-platform
rabbit_stomp_processor.erl
This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. %% Copyright ( c ) 2007 - 2021 VMware , Inc. or its affiliates . All rights reserved . %% -module(rabbit_stomp_processor). -compile({no_au...
null
https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/rabbitmq_stomp/src/rabbit_stomp_processor.erl
erlang
see rabbitmq/rabbitmq-stomp#39 ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- ---------------------------------------------------------------------------- Public API -------------------------------------------...
This Source Code Form is subject to the terms of the Mozilla Public License , v. 2.0 . If a copy of the MPL was not distributed with this file , You can obtain one at /. Copyright ( c ) 2007 - 2021 VMware , Inc. or its affiliates . All rights reserved . -module(rabbit_stomp_processor). -compile({no_auto_imp...
8d089ec623d14b7efad6101ea11b057d727903d7ebcac5bad16983c93b48d8bb
phillord/tawny-owl
polyglot_test.clj
The contents of this file are subject to the LGPL License , Version 3.0 . Copyright ( C ) 2013 , 2017 , , Newcastle University ;; 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 , e...
null
https://raw.githubusercontent.com/phillord/tawny-owl/331e14b838a42adebbd325f80f60830fa0915d76/test/tawny/polyglot_test.clj
clojure
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 (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHA...
The contents of this file are subject to the LGPL License , Version 3.0 . Copyright ( C ) 2013 , 2017 , , Newcastle University the Free Software Foundation , either version 3 of the License , or GNU Lesser General Public License for more details . You should have received a copy of the GNU Lesser Genera...
71c58ffb618a0ded8dadc23d093e8e6156c64ed4c30f262b2866122c6974aa32
tgbugs/laundry
timestamp.rkt
#lang brag ;;; timestamps ; the org spec is currently silent on how org will handle dates beyond 0000 and 9999 , the relevant standards for expanded representations are ISO 8601 - 1:2019,5.2.2.3 and ISO 8601 - 2:2019,8.4.3 . The problem ; with expanded representations is that they require all parties to agree ah...
null
https://raw.githubusercontent.com/tgbugs/laundry/fa9e70aa607cb48f97445cd24e8ca63addb74e9d/laundry/grammar/timestamp.rkt
racket
timestamps the org spec is currently silent on how org will handle dates beyond with expanded representations is that they require all parties to digits must be prefixed by the plus sign, the standard is not entirely clear, but I think that we could do PLUS digits HYPHEN or DIGIT-4 HYPHEN and everything would wor...
#lang brag 0000 and 9999 , the relevant standards for expanded representations are ISO 8601 - 1:2019,5.2.2.3 and ISO 8601 - 2:2019,8.4.3 . The problem agree ahead of time how wide the year is and prefix with + and leading zeros , I am not sure that this is as robust as we would like 0000 - 01 - 01 is january...
69cd1fdce35feec4a69d1b3ea0657fedadde821f17f74226142f0ddc44c5a9ba
c-cube/trustee
Sexp_decode.mli
open Common_ type sexp = Sexp_loc.t type +'a t type 'a m = 'a t val return : 'a -> 'a t val fail : string -> _ t val failf : ((('a, Format.formatter, unit, string) format4 -> 'a) -> string) -> 'b m type err * Internal type of errors . See { ! to manipulate them . module Infix : sig val ( let+ ) : 'a t -> ('a ...
null
https://raw.githubusercontent.com/c-cube/trustee/499cc5df22c3c261120ad9b72879797ddb5a081e/src/syntax/Sexp_decode.mli
ocaml
* [succeeds d] returns [true] if [d] parses the S-expr, and [false] otherwise. * [is_applied "foo"] is the recognizer that accepts expressions of the form [("foo" …)] * [try_succeed d] is [succeeds d, d] * [with_msg ~msg d] behaves like [d] but replaces [d]'s errors with [msg] * [try_apply f ok else_] tries...
open Common_ type sexp = Sexp_loc.t type +'a t type 'a m = 'a t val return : 'a -> 'a t val fail : string -> _ t val failf : ((('a, Format.formatter, unit, string) format4 -> 'a) -> string) -> 'b m type err * Internal type of errors . See { ! to manipulate them . module Infix : sig val ( let+ ) : 'a t -> ('a ...
af7b640ec89ac6e368279b54c87c2caafd355cc4d0e6d99db068dd13b754e847
tsloughter/rebar3_tests
db_worker.erl
-module(db_worker). -behaviour(gen_server). %% Api functions -export([start_link/1 %,store/2 ,direct_store/1 ,read_cache/1 ,read_db/1 ,dump_data/1 ,store_batch/3 ,prepare_batch/2 ,get_clients/2 ]). %% gen_server callbacks -export([init/1, ...
null
https://raw.githubusercontent.com/tsloughter/rebar3_tests/090bfef7d3a4790bb6b16e4c38df6e4c0460b4b2/sub_app_eleveldb/apps/graph_db/src/db_worker.erl
erlang
Api functions ,store/2 gen_server callbacks =================================================================== API functions =================================================================== store data point in metric cache -------------------------------------------------------------------- @doc Starts the se...
-module(db_worker). -behaviour(gen_server). -export([start_link/1 ,direct_store/1 ,read_cache/1 ,read_db/1 ,dump_data/1 ,store_batch/3 ,prepare_batch/2 ,get_clients/2 ]). -export([init/1, handle_call/3, handle_cast/2, handle_in...
dee86ded938e3c973b5ad7e0c0e43448d83c41cf8d3835b459c4b5073c988ade
cj1128/sicp-review
2.41.scm
(load "flatmap.scm") (define (make-range start end) (if (> start end) '() (cons start (make-range (+ start 1) end)))) find triples ( i , j , k ) where 1 < = i < j < k < = n and i + j + k = s. (define (find-triples n s) (define (sum-equal? triple) (= (+ (list-ref triple 0) (...
null
https://raw.githubusercontent.com/cj1128/sicp-review/efaa2f863b7f03c51641c22d701bac97e398a050/chapter-2/2.2/2.41.scm
scheme
(load "flatmap.scm") (define (make-range start end) (if (> start end) '() (cons start (make-range (+ start 1) end)))) find triples ( i , j , k ) where 1 < = i < j < k < = n and i + j + k = s. (define (find-triples n s) (define (sum-equal? triple) (= (+ (list-ref triple 0) (...
b4b3e28316bc673ce9d9a8bb3f2e2f7d38c9246bb3b683a4ee21fa937e645be0
robertluo/waterfall
build.clj
(ns build (:require [clojure.tools.build.api :as b] [org.corfield.build :as cb])) (defn project [opts] (merge opts {:lib 'io.github.robertluo/waterfall :version (format "0.1.%s" (b/git-count-revs nil)) :scm {:url ""}})) (defn tests "run tests" [opts] (-> opts (c...
null
https://raw.githubusercontent.com/robertluo/waterfall/65ae08105aa44bb1e774bd91d395a0c60b3b1ba5/build.clj
clojure
(ns build (:require [clojure.tools.build.api :as b] [org.corfield.build :as cb])) (defn project [opts] (merge opts {:lib 'io.github.robertluo/waterfall :version (format "0.1.%s" (b/git-count-revs nil)) :scm {:url ""}})) (defn tests "run tests" [opts] (-> opts (c...
38d1f89b0b0ded66c2fe66ebeed8a514b583a96380d4916dacc62bc0adc3e8aa
jarcane/heresy
hole-test.rkt
#lang heresy (def foo (hole 1)) (hole? foo) (reset foo 2) (deref foo) (update foo + 5) (deref foo) (reset foo (thing (foo 1))) ((deref foo)) (reset-thing foo (foo 2)) ((deref foo))
null
https://raw.githubusercontent.com/jarcane/heresy/a736b69178dffa2ef97f5eb5204f3e06840088c2/examples/hole-test.rkt
racket
#lang heresy (def foo (hole 1)) (hole? foo) (reset foo 2) (deref foo) (update foo + 5) (deref foo) (reset foo (thing (foo 1))) ((deref foo)) (reset-thing foo (foo 2)) ((deref foo))
8eb472333532be8af8acbf3b8af99778d400540be5538f1de0a6db091e8303c2
FranklinChen/hugs98-plus-Sep2006
CTimeval.hs
{-# OPTIONS -ffi -Wall -Werror -cpp #-} -- #hide module Data.Time.Clock.CTimeval where #ifndef mingw32_HOST_OS -- All Unix-specific, this import Foreign import Foreign.C data CTimeval = MkCTimeval CLong CLong instance Storable CTimeval where sizeOf _ = (sizeOf (undefined :: CLong)) * 2 alignment _ = alignment (u...
null
https://raw.githubusercontent.com/FranklinChen/hugs98-plus-Sep2006/54ab69bd6313adbbed1d790b46aca2a0305ea67e/packages/time/Data/Time/Clock/CTimeval.hs
haskell
# OPTIONS -ffi -Wall -Werror -cpp # #hide All Unix-specific, this | Get the current POSIX time from the system clock.
module Data.Time.Clock.CTimeval where #ifndef mingw32_HOST_OS import Foreign import Foreign.C data CTimeval = MkCTimeval CLong CLong instance Storable CTimeval where sizeOf _ = (sizeOf (undefined :: CLong)) * 2 alignment _ = alignment (undefined :: CLong) peek p = do s <- peekElemOff (castPtr p) 0 mus <- ...
b622f64b4545e2cab641599c38598a5c47ce81d233ab8284860bd51c75b1e4e0
YoshikuniJujo/test_haskell
try-generating-mipmaps-single.hs
# LANGUAGE TemplateHaskell , QuasiQuotes # # , LambdaCase , OverloadedStrings # # LANGUAGE ScopedTypeVariables , RankNTypes , TypeApplications # # LANGUAGE GADTs , TypeFamilies # # LANGUAGE DataKinds # # LANGUAGE TypeOperators # # LANGUAGE MultiParamTypeClasses , AllowAmbiguousTypes # # LANGUAGE FlexibleContexts , Fl...
null
https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/37eb9675bf1c0b008c7af4843713c91623c1e7f4/themes/gui/vulkan/try-my-vulkan-snd/app/try-generating-mipmaps-single.hs
haskell
# LANGUAGE PatternSynonyms, ViewPatterns #
# LANGUAGE TemplateHaskell , QuasiQuotes # # , LambdaCase , OverloadedStrings # # LANGUAGE ScopedTypeVariables , RankNTypes , TypeApplications # # LANGUAGE GADTs , TypeFamilies # # LANGUAGE DataKinds # # LANGUAGE TypeOperators # # LANGUAGE MultiParamTypeClasses , AllowAmbiguousTypes # # LANGUAGE FlexibleContexts , Fl...
1d149590bfddc959a672b8da615b8a3a825aa9681e9b6617b0e467d75d3cf3a0
herd/herdtools7
compile.ml
(****************************************************************************) (* the diy toolsuite *) (* *) , University College London , UK . , INRIA Par...
null
https://raw.githubusercontent.com/herd/herdtools7/6d781eb91debffdf56998171862a18e40908c3c5/litmus/compile.ml
ocaml
************************************************************************** the diy toolsuite en Automatique and ...
, University College London , UK . , INRIA Paris - Rocquencourt , France . Copyright 2010 - present Institut National de Recherche en Informatique et This software is governed by the CeCILL - B license under French law and modify and/ or redistribu...
536edd4eb7a120767ab785e6db0c7f5ca22615f8f90ee0f92340f87c6910aea2
compiling-to-categories/concat
Color.hs
# LANGUAGE TypeFamilies # # LANGUAGE CPP # # LANGUAGE FlexibleInstances # # LANGUAGE FlexibleContexts # {-# LANGUAGE TypeSynonymInstances #-} # OPTIONS_GHC -Wall # ---------------------------------------------------------------------- -- | -- Module : ConCat.Graphics.Color -- -- Maintainer : -- Stability :...
null
https://raw.githubusercontent.com/compiling-to-categories/concat/999d8a7c6dbec117ff04371149077e293001200f/graphics/src/ConCat/Graphics/Color.hs
haskell
# LANGUAGE TypeSynonymInstances # -------------------------------------------------------------------- | Module : ConCat.Graphics.Color Maintainer : Stability : experimental Colors -------------------------------------------------------------------- * Basics * Color operations * Some colors * Con...
# LANGUAGE TypeFamilies # # LANGUAGE CPP # # LANGUAGE FlexibleInstances # # LANGUAGE FlexibleContexts # # OPTIONS_GHC -Wall # #include "ConCat/AbsTy.inc" AbsTyPragmas module ConCat.Graphics.Color ( Color, rgba, rgb, colorR, colorG, colorB, colorA , overC, over , black, white, red, green, blue, clear, grey...
318ad2590e4859c69464d64da65f812915fb446077ca731b1dafe113c783bb29
raml-org/api-modeling-framework
document.cljc
(ns api-modeling-framework.model.document) (defprotocol Node "Basic behaviour for every single node in the model" (id [this] "Returns a unique identifier for this node") (name [this] "A string readable title for this node") (description [this] "A human readable description of this node") (sources [this] "Col...
null
https://raw.githubusercontent.com/raml-org/api-modeling-framework/34bb3b6c3e3f91b775e27f8e389e04eb2c36beb7/src/api_modeling_framework/model/document.cljc
clojure
related to this node, for example as traits or types used to mark that an included fragment has been extended by the node Is trait is used to mark that the fragment is a RAML trait Is type is used to mark that the fragment is a RAML type Is annotation is used to mark that the fragment is a RAML annotation Extends...
(ns api-modeling-framework.model.document) (defprotocol Node "Basic behaviour for every single node in the model" (id [this] "Returns a unique identifier for this node") (name [this] "A string readable title for this node") (description [this] "A human readable description of this node") (sources [this] "Col...
58602cecf5a7cdaf1accb06b5ad660d0acf63889d5eb5e25c605ae1b4d18246a
iskandr/parakeet-retired
Inline.mli
val do_inline : TypedSSA.fn -> TypedSSA.value_nodes -> TypedSSA.block * TypedSSA.exp_node * (ID.t*Type.t) list val run_fn_inliner : TypedSSA.fn -> TypedSSA.fn * bool
null
https://raw.githubusercontent.com/iskandr/parakeet-retired/3d7e6e5b699f83ce8a1c01290beed0b78c0d0945/SSA/Optimizations/Inline.mli
ocaml
val do_inline : TypedSSA.fn -> TypedSSA.value_nodes -> TypedSSA.block * TypedSSA.exp_node * (ID.t*Type.t) list val run_fn_inliner : TypedSSA.fn -> TypedSSA.fn * bool
ea4989c893a6c9c114400c7b56a9ca25d7a1f4bcca759ef1b0c54cc25d5c4907
manuel-serrano/bigloo
pdgphidget.scm
;*=====================================================================*/ ;* .../prgm/project/bigloo/api/phidget/src/Llib/pdgphidget.scm */ ;* ------------------------------------------------------------- */ * Author : * / * Creation : Tue Sep 21...
null
https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/api/phidget/src/Llib/pdgphidget.scm
scheme
*=====================================================================*/ * .../prgm/project/bigloo/api/phidget/src/Llib/pdgphidget.scm */ * ------------------------------------------------------------- */ * ------------------------------------------------------------- */ * Phidget objects ...
* Author : * / * Creation : Tue Sep 21 16:54:10 2010 * / * Last change : Thu Oct 4 17:56:48 2012 ( serrano ) * / * Copyright : 2010 - 12 * / (module __phidget_phidget ...
a923de42116b06d353dda85a2aab74ac7629daba02461c30c75d5e5859500814
bvaugon/ocapic
osolilet.ml
(*************************************************************************) (* *) (* OCaPIC *) (* *) ...
null
https://raw.githubusercontent.com/bvaugon/ocapic/a14cd9ec3f5022aeb5fe2264d595d7e8f1ddf58a/tests/osolilet/osolilet.ml
ocaml
*********************************************************************** OCaPIC ...
This file is distributed under the terms of the CeCILL license . open Pic;; set_bit IRCF1;; set_bit IRCF0;; set_bit PLLEN;; write_reg TRISB 0;; write_reg PORTB 0;; set_bit RB0;; type peg = Out | Empty | Peg ;; exception Found;; let dir = [| [|0...
58d9ed1c457f71913e046b6dc077b40bdf006dc8f738ed69b5f2ca12e45a21cf
FlowForwarding/loom
ofs_util_tests.erl
%%------------------------------------------------------------------------------ Copyright 2014 FlowForwarding.org %% 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 %%...
null
https://raw.githubusercontent.com/FlowForwarding/loom/86a9c5aa8b7d4776062365716c9a3dbbf3330bc5/simple_ne/apps/simple_ne/test/ofs_util_tests.erl
erlang
------------------------------------------------------------------------------ you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, eithe...
Copyright 2014 FlowForwarding.org Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , @author Erlang Solutions Ltd. < > 2014 FlowForwarding.org -module(ofs_util_tests). -include_lib("eunit/include/eunit.hrl").
fe2b6ef7e69c9550e87ec11a6a20adc331037b897af7a7ba7c3a5b3230cf9b94
binsec/binsec
base_logger.ml
(**************************************************************************) This file is part of BINSEC . (* *) Copyright ( C ) 2016 - 2022 CEA ( Co...
null
https://raw.githubusercontent.com/binsec/binsec/8ed9991d36451a3ae7487b966c4b38acca21a5b3/src/base/base_logger.ml
ocaml
************************************************************************ alternatives) you can redistribute it an...
This file is part of BINSEC . Copyright ( C ) 2016 - 2022 CEA ( Commissariat à l'énergie atomique et aux énergies Lesser General Public License as published by the Free Software Foundation , ve...
419d6eef08bfa3a2a93b76a6a1ab5a64ec535fa2bd13886ca232c9dc8f607407
mikepjb/sail
autocomplete.clj
(ns sail.autocomplete (:import [clojure.lang Namespace])) ; fn to determine what should invoke autocomplete (defn candidates [^String prefix ^Namespace ns context] (let [single-colon? (.startsWith prefix ":")] ;; is this part of a keyword? (str ":yesxxx" "yyy") ;; dummy autocomplete )) ; fn to determi...
null
https://raw.githubusercontent.com/mikepjb/sail/85a2a18ee8e0786640615107c511c973de9c8831/src/clj/sail/autocomplete.clj
clojure
fn to determine what should invoke autocomplete is this part of a keyword? dummy autocomplete fn to determind what should invoke doc
(ns sail.autocomplete (:import [clojure.lang Namespace])) (defn candidates [^String prefix ^Namespace ns context] )) (defn doc [^String symbol-str ^Namespace ns] (if (= "m-4" symbol-str) "m-4 docstring" "i do not know")) candidates and doc are two already defined functions . (defn init-source [...
3d8475375f28060424ee167fcba79bb4e10f0f9a5b46ddd664fc46fb5397c573
input-output-hk/project-icarus-importer
UtilSpec.hs
-- | Tests of Pos.Explorer.Socket.Util module Test.Pos.Explorer.Socket.UtilSpec ( spec ) where import Universum import qualified Data.IntSet as IS import qualified Data.Map as M import Pos.Explorer.Socket.Util (regroupBySnd) import Test.Hspec (Spec, describe, it, shouldBe...
null
https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/explorer/test/Test/Pos/Explorer/Socket/UtilSpec.hs
haskell
| Tests of Pos.Explorer.Socket.Util -------------------------------------------------------------------------- -------------------------------------------------------------------------- stack test cardano-sl-explorer --fast --test-arguments "-m Test.Pos.Explorer.Socket"
module Test.Pos.Explorer.Socket.UtilSpec ( spec ) where import Universum import qualified Data.IntSet as IS import qualified Data.Map as M import Pos.Explorer.Socket.Util (regroupBySnd) import Test.Hspec (Spec, describe, it, shouldBe) Spec spec :: Spec spec = d...
8af39bc6154a2f87a7d70583e8cb3c0a032af2b1baf9057b7924aae6948571c5
census-instrumentation/opencensus-erlang
oc_stat_aggregation_count.erl
%%%------------------------------------------------------------------------ Copyright 2018 , OpenCensus Authors 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...
null
https://raw.githubusercontent.com/census-instrumentation/opencensus-erlang/7fb276ff73d677c00458922c9180df634f45e018/src/oc_stat_aggregation_count.erl
erlang
------------------------------------------------------------------------ you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express o...
Copyright 2018 , OpenCensus Authors Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , aggregated by using Count . -module(oc_stat_aggregation_count). -include("opencensus.hrl"). -export([init/3, type/0, ...
6ceee0fd32ae188649f6b94eae3564a7d8be5d3b15181f7c08c5caa3ffae3352
janestreet/universe
sess_test.ml
open Netsnmp_raw_monad let die msg = prerr_endline msg; exit 1 let run hostname community = let version = Session.Snmp_version.Version_2c in let retries = 3 in let timeout = 3_000_000 in let peername = hostname in let localname = "" in let local_port = 0 in let community = community in let securit...
null
https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/netsnmp/test_manual/basic/sess_test.ml
ocaml
open Netsnmp_raw_monad let die msg = prerr_endline msg; exit 1 let run hostname community = let version = Session.Snmp_version.Version_2c in let retries = 3 in let timeout = 3_000_000 in let peername = hostname in let localname = "" in let local_port = 0 in let community = community in let securit...
9a6ec4e49113c097421890a7e83a49b7ddc237c87600935601d7e4bd556b5f7f
UnixJunkie/orf
RFC.ml
Copyright ( C ) 2021 , laboratory , Tokyo university , 5 - 1 - 5 Kashiwa - no - ha , , Chiba - ken , 277 - 8561 , Japan . Tsuda laboratory, Tokyo university, 5-1-5 Kashiwa-no-ha, Kashiwa-shi, Chiba-ken, 277-8561, Japan. *) (* Random Forets Classifier *) module A = BatArray module Ht = BatHas...
null
https://raw.githubusercontent.com/UnixJunkie/orf/001342aab0a5512c98370ced5a1f1f04c7fe2f0a/src/RFC.ml
ocaml
Random Forets Classifier X y (feature, threshold) rhs default A feature with non constant value allows to discriminate samples we have a sparse representation: always explicitely add the 0 value then split a node how many times we see each class label single label find max count ...
Copyright ( C ) 2021 , laboratory , Tokyo university , 5 - 1 - 5 Kashiwa - no - ha , , Chiba - ken , 277 - 8561 , Japan . Tsuda laboratory, Tokyo university, 5-1-5 Kashiwa-no-ha, Kashiwa-shi, Chiba-ken, 277-8561, Japan. *) module A = BatArray module Ht = BatHashtbl module IntSet = BatSet.Int...
c799d4fe8cd8420553b62836d3ef6f17ecdc7c9702fe0c1bc84b41b9cbaf4d95
bherrmann7/table-explorer
diagram_builder.clj
(ns diagram-builder (:require [db] [clojure.string :as cs])) (def double-quotes "\"\"") (defn column-type-to-string [{:keys [type_name column_size]}] (cond (and (= type_name "int8") (= column_size 19)) "bigint" (= type_name "timestamp") type_name :else (str type_name "(" column_size ")")...
null
https://raw.githubusercontent.com/bherrmann7/table-explorer/6f8e6a36cf1fcf08c5860910e71ca898674f82f2/src/diagram_builder.clj
clojure
(def header "@startuml\n")
(ns diagram-builder (:require [db] [clojure.string :as cs])) (def double-quotes "\"\"") (defn column-type-to-string [{:keys [type_name column_size]}] (cond (and (= type_name "int8") (= column_size 19)) "bigint" (= type_name "timestamp") type_name :else (str type_name "(" column_size ")")...
59c7aabf0b5860344f7a2afb6914b9c1f69d55e60252381f105d14e0e99ed2a2
rizo/streams-bench
Push_reducer_obj.ml
type ('a, 'r) reducer = | Reducer : < init : 's ; step : 'a -> 's -> 's ; is_done : 's -> bool ; extract : 's -> 'r > -> ('a, 'r) reducer type 'a t = { run : 'r. ('a, 'r) reducer -> 'r } [@@unboxed] let return x = let run (Reducer r) = r#extract (r#step x r#init) in { run } let fl...
null
https://raw.githubusercontent.com/rizo/streams-bench/87baf838971c84613b801ab32b6473d397bcc23f/src/Push_reducer_obj.ml
ocaml
type ('a, 'r) reducer = | Reducer : < init : 's ; step : 'a -> 's -> 's ; is_done : 's -> bool ; extract : 's -> 'r > -> ('a, 'r) reducer type 'a t = { run : 'r. ('a, 'r) reducer -> 'r } [@@unboxed] let return x = let run (Reducer r) = r#extract (r#step x r#init) in { run } let fl...
8700d88d155e98b168c8a9875e144ecd452112b3af259a99b5beba9bc9941963
pascal-knodel/haskell-craft
E'10'15.hs
-- -- -- ------------------ Exercise 10.15 . ------------------ -- -- -- module E'10'15 where import Prelude hiding ( unzip , last , init ) import qualified Prelude ( unzip , last , init ) import Test.QuickCheck ( Property , (==>) , quickCheck ) -- "unzip": -- -------- unzip :: [(t, t)] -> ([t],...
null
https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/Chapter%C2%A010/E'10'15.hs
haskell
---------------- ---------------- "unzip": -------- ( [] , [] ) ( [ 0 ] , [ 0 ] ) "last": ------- ----------------- *** Exception: Empty list. GHCi> quickCheck prop_last ----------------------------------- Using "foldr" --------------------------------- Thoughts ... *** Exception: Empty list. ... ***...
Exercise 10.15 . module E'10'15 where import Prelude hiding ( unzip , last , init ) import qualified Prelude ( unzip , last , init ) import Test.QuickCheck ( Property , (==>) , quickCheck ) unzip :: [(t, t)] -> ([t], [t]) unzip pairs = foldr unzipPair ( [] , [] ) pairs where unzipPair ::...
9810f353b739a1b07a232ebebe0baa26af9f90e53eedd69dcd07a2663cf21f3e
softwarelanguageslab/maf
R5RS_scp1_deep-map-combine-4.scm
; Changes: * removed : 0 * added : 1 * swaps : 0 ; * negated predicates: 0 * swapped branches : 1 ; * calls to id fun: 0 (letrec ((atom? (lambda (x) (not (pair? x)))) (deep-combine (lambda (combiner null-value l) (if (null? l) (<cha...
null
https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_scp1_deep-map-combine-4.scm
scheme
Changes: * negated predicates: 0 * calls to id fun: 0
* removed : 0 * added : 1 * swaps : 0 * swapped branches : 1 (letrec ((atom? (lambda (x) (not (pair? x)))) (deep-combine (lambda (combiner null-value l) (if (null? l) (<change> null-value ...
5b74ab94841cf753d7abf54f1d2e2e633305d238cae35627d29e39b33d03d232
arttuka/reagent-material-ui
bar_chart_sharp.cljs
(ns reagent-mui.icons.bar-chart-sharp "Imports @mui/icons-material/BarChartSharp 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 bar-chart-sharp (create-svg...
null
https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/icons/reagent_mui/icons/bar_chart_sharp.cljs
clojure
(ns reagent-mui.icons.bar-chart-sharp "Imports @mui/icons-material/BarChartSharp 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 bar-chart-sharp (create-svg...
b43b366b43fb9c3a37c232b5adc030692080512125eb71aaef73956af55c9ed7
cooldaemon/ermlia
ermlia_mock_facade.erl
@author < > [ / ] @copyright 2008 %% @doc This module is mock data store manager. %% %% This module is facade mock for k-buckets and data store. Copyright 2008 %% Licensed under the Apache License , Version 2.0 ( the " License " ) ; %% you may not use this file except in compliance with the License. %%...
null
https://raw.githubusercontent.com/cooldaemon/ermlia/fa5f8acf5965893b33f405de048e6d570d4aba53/test/ermlia_mock_facade.erl
erlang
@doc This module is mock data store manager. This module is facade mock for k-buckets and data store. 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 CONDIT...
@author < > [ / ] @copyright 2008 Copyright 2008 Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(ermlia_mock_facade). -export([setup/0, cleanup/0]). -export([ add_node/3, find_node/1, find_value/1, p...
5ea1048f3ffea2087282fb559855d3789ee5b5d47a010d0b4ef53b9d9133d4f1
andrewMacmurray/haskell-book-solutions
users.hs
module RegisteredUser where newtype Username = Username String newtype AccountNumber = AccountNumber Integer data User = UnregisteredUser | RegisteredUser Username AccountNumber user1 :: User user1 = RegisteredUser (Username "Andrew") (AccountNumber 12345) printUser :: User -> IO () printUser Unregistere...
null
https://raw.githubusercontent.com/andrewMacmurray/haskell-book-solutions/f4fd386187c03828d1736d9a43642ab4f0ec6462/src/ch7/users.hs
haskell
module RegisteredUser where newtype Username = Username String newtype AccountNumber = AccountNumber Integer data User = UnregisteredUser | RegisteredUser Username AccountNumber user1 :: User user1 = RegisteredUser (Username "Andrew") (AccountNumber 12345) printUser :: User -> IO () printUser Unregistere...
cdba261978143464b6a2aaccd128484913d7f1d07a56a7519aec5a8ec6bcb3d5
WormBase/wormbase_rest
endpoints.clj
(ns rest-api.db.endpoints (:require [clojure.string :as str] [ring.util.http-response :refer :all] [rest-api.db.sequence :as db-sequence] [compojure.api.sweet :as sweet] [rest-api.db.main :refer [datomic-conn]] [datomic.api :as d])) (defn version-handler [request] (ok {:data (db-sequence/da...
null
https://raw.githubusercontent.com/WormBase/wormbase_rest/e51026f35b87d96260b62ddb5458a81ee911bf3a/src/rest_api/db/endpoints.clj
clojure
(ns rest-api.db.endpoints (:require [clojure.string :as str] [ring.util.http-response :refer :all] [rest-api.db.sequence :as db-sequence] [compojure.api.sweet :as sweet] [rest-api.db.main :refer [datomic-conn]] [datomic.api :as d])) (defn version-handler [request] (ok {:data (db-sequence/da...
97c8993feba9cda04eeaa2199d6c8f072c34f831bbc3ebb6c4a1314e183ddb9a
kayceesrk/ocaml5-tutorial
incr_cas.ml
let twice_in_parallel f = let d1 = Domain.spawn f in let d2 = Domain.spawn f in ignore @@ Domain.join d1; ignore @@ Domain.join d2 let rec incr r = let curr = Atomic.get r in if Atomic.compare_and_set r curr (curr + 1) then () else begin Domain.cpu_relax (); incr r end let main () = let r = ...
null
https://raw.githubusercontent.com/kayceesrk/ocaml5-tutorial/36989cd5ffe42d7fc0b2710443b612f27bc9af5d/src/incr_cas.ml
ocaml
let twice_in_parallel f = let d1 = Domain.spawn f in let d2 = Domain.spawn f in ignore @@ Domain.join d1; ignore @@ Domain.join d2 let rec incr r = let curr = Atomic.get r in if Atomic.compare_and_set r curr (curr + 1) then () else begin Domain.cpu_relax (); incr r end let main () = let r = ...