_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
65814df0d70f67b882b95e3e8f16ae686fc7cbca15f8b18e5a3007ce46ae3275
mirage/irmin
lower.mli
* Copyright ( c ) 2023 Tarides < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVIDED " AS IS " AND ...
null
https://raw.githubusercontent.com/mirage/irmin/e68f6a71e348f5009250b0fe9e16b81020001891/src/irmin-pack/unix/lower.mli
ocaml
* Copyright ( c ) 2023 Tarides < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVIDED " AS IS " AND ...
18e441828cf04d5db958a30fa6b658969600e047a91d74db0dc9b9c477ba9a2b
ocaml-multicore/tezos
carbonated_map.mli
(*****************************************************************************) (* *) (* Open Source License *) Copyright ( c ) 2021 , < > (* ...
null
https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_alpha/lib_protocol/carbonated_map.mli
ocaml
*************************************************************************** Open Source License Permission is h...
Copyright ( c ) 2021 , < > to deal in the Software without restriction , including without limitation and/or sell copies of the Software , and to permit persons to whom the THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR LIABILITY , WHETHER IN AN A...
5aa26ea80dc2998a50588def23fd28bc5a439f6979b02e681a3fc226dd989b17
BinaryAnalysisPlatform/bap-plugins
predicate.mli
open Bap.Std type t = {sat : 'a. 'a term -> exp -> bool} val register : string -> t -> unit val lookup : string -> t option val test : string -> 'a term -> exp -> bool
null
https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap-plugins/2e9aa5c7c24ef494d0e7db1b43c5ceedcb4196a8/saluki/predicate.mli
ocaml
open Bap.Std type t = {sat : 'a. 'a term -> exp -> bool} val register : string -> t -> unit val lookup : string -> t option val test : string -> 'a term -> exp -> bool
a3868436c22457270b44e90903fd7b534f42819078d037978e8a262362e7f059
mirage/functoria
functoria.mli
* Copyright ( c ) 2015 < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVIDED " AS IS " AND THE AU...
null
https://raw.githubusercontent.com/mirage/functoria/d15603d5e32d335cd075d426aee7038f786eb497/lib/functoria.mli
ocaml
* The type for values representing module types. * [type t] is a value representing the module type [t]. * Type for job values. * [job] is the signature for user's application main module. * The type for values representing module implementations. * [m $ a] applies the functor [m] to the module [a]. * The type fo...
* Copyright ( c ) 2015 < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVIDED " AS IS " AND THE AU...
d74db3021bb8416b0ff56adaf4fcf2d903cc869df1a6c2d1bde53e29efa89d2a
mstksg/nonempty-containers
Util.hs
{-# LANGUAGE CPP #-} # LANGUAGE DeriveFunctor # # LANGUAGE DeriveGeneric # # LANGUAGE FlexibleInstances # {-# LANGUAGE GADTs #-} {-# LANGUAGE KindSignatures #-} # LANGUAGE LambdaCase # {-# LANGUAGE OverloadedStrings #-} {-# LANGUAGE RankNTypes ...
null
https://raw.githubusercontent.com/mstksg/nonempty-containers/ccc4283f48592efe47b41d2f44330cbadfa73e4d/test/Tests/Util.hs
haskell
# LANGUAGE CPP # # LANGUAGE GADTs # # LANGUAGE KindSignatures # # LANGUAGE OverloadedStrings # # LANGUAGE RankNTypes # # LANGUAGE ScopedTypeVariables # # LANGUAGE TypeSynonymInstances # | test for stability --------------------- Properties --------------------- r...
# LANGUAGE DeriveFunctor # # LANGUAGE DeriveGeneric # # LANGUAGE FlexibleInstances # # LANGUAGE LambdaCase # # LANGUAGE RecordWildCards # # LANGUAGE TypeApplications # # OPTIONS_GHC -Wno - orphans # module Tests.Util ( K(..), KeyType, overKX, dummyKey , SortType(.....
36dad85d1fec12585cb90f506014556a786e5841ad1686765063a8cbf57fa6c2
kumarshantanu/ring-sse-middleware
core.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/core.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.core (:require [ring-sse-middleware.wrapper :as w]) (:import [java.util.concurrent Semaphore])) (def sse-empty-response {:status 200 :headers {"Content-Type" "text/event-stream;charset=UTF-8" ...
be7d4121d8fc821befb515548e475db6a27a90a4e92c3db3247c3d009ff4070f
well-typed-lightbulbs/rpi
gpio.ml
let base = Rpi_hardware.gpio GPIO addresses let gp_sel0 = Mem.offset base 0x00 let gp_set0 = Mem.offset base 0x1C let gp_set1 = Mem.offset base 0x20 let gp_clr0 = Mem.offset base 0x28 let gp_clr1 = Mem.offset base 0x2C let gp_lev0 = Mem.offset base 0x34 let gp_lev1 = Mem.offset base 0x38 let gp_pud = Mem.offset bas...
null
https://raw.githubusercontent.com/well-typed-lightbulbs/rpi/9bedf5735277c66009dffb0c70489ca0f88d84fc/src/peripherals/gpio.ml
ocaml
Pins Setup Read and write
let base = Rpi_hardware.gpio GPIO addresses let gp_sel0 = Mem.offset base 0x00 let gp_set0 = Mem.offset base 0x1C let gp_set1 = Mem.offset base 0x20 let gp_clr0 = Mem.offset base 0x28 let gp_clr1 = Mem.offset base 0x2C let gp_lev0 = Mem.offset base 0x34 let gp_lev1 = Mem.offset base 0x38 let gp_pud = Mem.offset bas...
cd72cb0c087c4017767779313e397e3be024ae8e6ef4bfc4f84f23c2da38445d
fons/cl-twitter
twitter-macro.lisp
(in-package :twitter) (defmacro fixup (lst) `(and (keywordp (car ,lst)) (cons nil ,lst))) (defmacro with-gensyms ((&rest names) &rest body) `(let ,(loop for n in names collect `(,n (gensym))) ,@body)) (defun push-until-keyword (lst &optional (accum nil)) (cond ((keywordp (car lst)) (values accum lst)) ...
null
https://raw.githubusercontent.com/fons/cl-twitter/6a72291f8c60bd07efd2a8605f18a3eb7570cc4a/api/twitter-macro.lisp
lisp
max -> max calls not max results have to be zipped with the arg-list... TBD for now (defmacro define-twitter-method (method (arg-list &rest keys) &body twitter-command) (labels ((add-pair (l r lst) (cons l (cons r lst)))) (let ((cmd-sym (intern (symbol-name method))) (key-list (construct-arg-list (c...
(in-package :twitter) (defmacro fixup (lst) `(and (keywordp (car ,lst)) (cons nil ,lst))) (defmacro with-gensyms ((&rest names) &rest body) `(let ,(loop for n in names collect `(,n (gensym))) ,@body)) (defun push-until-keyword (lst &optional (accum nil)) (cond ((keywordp (car lst)) (values accum lst)) ...
96bfe8acaf3588f890df920df15ccac8dedbde17d4b1fa5c39ae24f24562e6c3
shirok/Gauche
mt-random.scm
;;; ;;; mt-random - Mersenne Twister interface ;;; 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 the a...
null
https://raw.githubusercontent.com/shirok/Gauche/4c281d938b2021813446ac8486b2f089c92b3c8e/ext/mt-random/mt-random.scm
scheme
mt-random - Mersenne Twister interface 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 following...
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 (define-module math.mt-random (export <mer...
7f19defec2c92baabbbc6da394a0797af666eca8a11819ae7b3f251f719f2de8
kindista/kindista
requested-invite.lisp
Copyright 2012 - 2015 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/7d2be6d1bf2e8a8d027854998017f6cdcc70691a/src/email/invitations/requested-invite.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 - 2015 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...
9b05a70975bb6ccb300a401623c8deb9b1bd73b339f5e54f9f5bc5201b2f14a2
w3ntao/sicp-solution
3-18.rkt
#lang racket (require (only-in (combine-in rnrs/base-6 rnrs/mutable-pairs-6) car cdr list set-cdr!)) (define nil '()) (define (last-pair x) (if (null? (cdr x)) x (last-pair (cdr x)))) (define (make-cy...
null
https://raw.githubusercontent.com/w3ntao/sicp-solution/00be3a7b4da50bb266f8a2db521a24e9f8c156be/chap-3/3-18.rkt
racket
#lang racket (require (only-in (combine-in rnrs/base-6 rnrs/mutable-pairs-6) car cdr list set-cdr!)) (define nil '()) (define (last-pair x) (if (null? (cdr x)) x (last-pair (cdr x)))) (define (make-cy...
4013f9c19f7977624cca12d3ea2826d9cc671e308f8f7bdafa3a20d12cdc3d68
music-suite/music-preludes
chopin.hs
import Music.Prelude rh :: Music rh = [((1/2) <-> (3/4),e)^.event,((3/4) <-> (15/16),cs')^.event,((15/16) <-> 1,d')^.event,(1 <-> (5/4),d)^.event,(1 <-> (5/4),gs)^.event,(1 <-> (5/4),b)^.event,((5/4) <-> (3/2),d)^.event,((5/4) <-> (3/2),gs)^.event,((5/4) <-> (3/2),b)^.event,((3/2) <-> 2,d)^.event,((3/2) <-> 2,gs)...
null
https://raw.githubusercontent.com/music-suite/music-preludes/2512b7dba62b4adadd04c01772046a3c09be72d7/examples/chopin.hs
haskell
import Music.Prelude rh :: Music rh = [((1/2) <-> (3/4),e)^.event,((3/4) <-> (15/16),cs')^.event,((15/16) <-> 1,d')^.event,(1 <-> (5/4),d)^.event,(1 <-> (5/4),gs)^.event,(1 <-> (5/4),b)^.event,((5/4) <-> (3/2),d)^.event,((5/4) <-> (3/2),gs)^.event,((5/4) <-> (3/2),b)^.event,((3/2) <-> 2,d)^.event,((3/2) <-> 2,gs)...
8dcb7b3d9ebaffe234a12b89a3a1d52da5bd91702c5580531d04c1e4a593e91d
mylesmegyesi/metis
test_validators.clj
(ns metis.test-validators (:use [metis.core :only [defvalidator]])) (defvalidator :foreign [:first-name :presence])
null
https://raw.githubusercontent.com/mylesmegyesi/metis/44127ac75fb6ce6235a516bf6a6f8a9222e5dd67/spec/metis/test_validators.clj
clojure
(ns metis.test-validators (:use [metis.core :only [defvalidator]])) (defvalidator :foreign [:first-name :presence])
0f2bd59d56251763d003fabcdde9eec80780431630cd748586367f6512270ad2
iokasimov/pandora
Tap.hs
# LANGUAGE UndecidableInstances # module Pandora.Paradigm.Primary.Transformer.Tap where import Pandora.Core.Functor (type (>>>>>>)) import Pandora.Pattern.Semigroupoid ((.)) import Pandora.Pattern.Category ((<--), (<---), (<----), (<------)) import Pandora.Pattern.Functor.Covariant (Covariant ((<-|-), (<-|--))) import...
null
https://raw.githubusercontent.com/iokasimov/pandora/68662a508749f1cf02d0178679435a24f07dcaf2/Pandora/Paradigm/Primary/Transformer/Tap.hs
haskell
), (<---), (<----), (<------)) ))) ), (<<-|--), extract, type (<:*:>), (<:*:>)) <), type (-->)) -- f x <---- f <-|- xs >) (:*:) (:*:) t => Semimonoidal (-->) (:*:) (:*:) (Tap t) where -- x :* : y < ---- mult @(-- > ) < ~~~ xs :* : ys <) (:*:) (:*:) t => Semimonoidal (--<) (:*:) (:*:) (Tap t) where Tap y < -|- mult @(-...
# LANGUAGE UndecidableInstances # module Pandora.Paradigm.Primary.Transformer.Tap where import Pandora.Core.Functor (type (>>>>>>)) import Pandora.Pattern.Semigroupoid ((.)) import Pandora.Pattern.Functor.Semimonoidal (Semimonoidal (mult)) import Pandora.Pattern.Functor.Monoidal (Monoidal (unit)) import Pandora.Patter...
c2806918b8b852281cceafd0709a1548f5597348941b44d245a53b9b4d39567c
modular-macros/ocaml-macros
t250-closurerec-1.ml
open Lib;; let rec f _ = 0;; * 0 CONSTINT 42 2 PUSHACC0 3 MAKEBLOCK1 0 5 POP 1 7 9 BRANCH 14 11 CONST0 12 RETURN 1 14 CLOSUREREC 0 , 11 18 ACC0 19 MAKEBLOCK1 0 21 POP 1 23 SETGLOBAL T250 - closurerec-1 ...
null
https://raw.githubusercontent.com/modular-macros/ocaml-macros/05372c7248b5a7b1aa507b3c581f710380f17fcd/testsuite/tests/tool-ocaml/t250-closurerec-1.ml
ocaml
open Lib;; let rec f _ = 0;; * 0 CONSTINT 42 2 PUSHACC0 3 MAKEBLOCK1 0 5 POP 1 7 9 BRANCH 14 11 CONST0 12 RETURN 1 14 CLOSUREREC 0 , 11 18 ACC0 19 MAKEBLOCK1 0 21 POP 1 23 SETGLOBAL T250 - closurerec-1 ...
fd775523125edf02f894e20299435828032ff3bacff2a05a7f681e8c9a6d0a23
mtravers/heroku-cl-example
heroku-setup.lisp
(in-package :cl-user) (print ">>> Building system....") (load (make-pathname :directory *build-dir* :defaults "example.asd")) (ql:quickload :example) ;;; Copy wuwei public files to build (wu:heroku-install-wupub-files) (print ">>> Done building system")
null
https://raw.githubusercontent.com/mtravers/heroku-cl-example/a471c57cc453fcd768d35e291c3dc13fa740a8fd/heroku-setup.lisp
lisp
Copy wuwei public files to build
(in-package :cl-user) (print ">>> Building system....") (load (make-pathname :directory *build-dir* :defaults "example.asd")) (ql:quickload :example) (wu:heroku-install-wupub-files) (print ">>> Done building system")
d8b1eddf5bc7ed9ae053150816b89a1d82006d5417de0bbc5b1b74e88f523d97
lnostdal/SymbolicWeb
text_input.clj
(in-ns 'symbolicweb.core) No input parsing here since it seems doing that on the Model end of things is better . E.g. sometimes input can come from ;; several sources. TODO : does not trigger onchange event ref . issue # 35 . Dealing with this using polling or similar leads to races ;; with other things; e.g. f...
null
https://raw.githubusercontent.com/lnostdal/SymbolicWeb/d9600b286f70f88570deda57b05ca240e4e06567/src/symbolicweb/text_input.clj
clojure
several sources. with other things; e.g. form submit event. The currently best way of dealing with this that I know of is to on submit "manually" trigger 'change' events for each form field that might (no way to tell) have been autofilled. :( not the other way around. Continious sync: server --> client. NOTE: Chr...
(in-ns 'symbolicweb.core) No input parsing here since it seems doing that on the Model end of things is better . E.g. sometimes input can come from TODO : does not trigger onchange event ref . issue # 35 . Dealing with this using polling or similar leads to races (defn ^WidgetBase mk-TextInput [^ValueModel i...
604fd6a2cdb2463f1eb898c13ac3750ddc63ff8663541802c2649215d6d04669
samrushing/irken-compiler
t_recmac.scm
;; -*- Mode: Irken -*- (include "lib/core.scm") ;; test macros that output record literals and attribute references. (defmacro thing (thing a b) -> {x=a y=b} ) (defmacro yattr (yattr ob) -> ob.y ) (defmacro attr (attr ob z) -> ob.z ) (defmacro mkrec (mkrec field val) -> {field=val} ) (let...
null
https://raw.githubusercontent.com/samrushing/irken-compiler/690da48852d55497f873738df54f14e8e135d006/tests/t_recmac.scm
scheme
-*- Mode: Irken -*- test macros that output record literals and attribute references.
(include "lib/core.scm") (defmacro thing (thing a b) -> {x=a y=b} ) (defmacro yattr (yattr ob) -> ob.y ) (defmacro attr (attr ob z) -> ob.z ) (defmacro mkrec (mkrec field val) -> {field=val} ) (let ((o (thing 1 2))) (printn (+ (yattr o) (attr o x))) (printn (mkrec z 34)) )
4ce49a93cbd330a7dae156da75cb332318b1fe56887179a80fc31abe78915d74
lispbuilder/lispbuilder
random-circles.lisp
;;;; Demonstration/Test of using the SDL_gfx library using CFFI for foreign function interfacing ... ( C)2006 ;;;; see COPYING for license (in-package #:sdl-gfx-examples) (defvar *circles-per-frame* 1) (defun random-circles () (let ((width 640) (height 480) (100-frames-p (every-n-frames 100))) (sdl:with...
null
https://raw.githubusercontent.com/lispbuilder/lispbuilder/589b3c6d552bbec4b520f61388117d6c7b3de5ab/lispbuilder-sdl-gfx/examples/random-circles.lisp
lisp
Demonstration/Test of using the SDL_gfx library see COPYING for license
using CFFI for foreign function interfacing ... ( C)2006 (in-package #:sdl-gfx-examples) (defvar *circles-per-frame* 1) (defun random-circles () (let ((width 640) (height 480) (100-frames-p (every-n-frames 100))) (sdl:with-init () (sdl:window width height) (setf (sdl:frame-rate) 0) (s...
eb43583e051dfbf58cd6c3caa4c39606e10056a21ec8c64f194418792a80e89a
BrunoBonacci/mulog
jvm_metrics_test.clj
(ns com.brunobonacci.mulog.publishers.jvm-metrics-test (:require [com.brunobonacci.mulog.publishers.jvm-metrics :refer [jvm-sample]] [midje.sweet :refer [facts fact => contains anything just]] [clojure.spec.test.alpha :as st]) (:import [java.lang.management ManagementFactory])) (st/instru...
null
https://raw.githubusercontent.com/BrunoBonacci/mulog/e31f84ccf6d62d43c1c620ef5584722886e0d8a5/mulog-jvm-metrics/test/com/brunobonacci/mulog/publishers/jvm_metrics_test.clj
clojure
(ns com.brunobonacci.mulog.publishers.jvm-metrics-test (:require [com.brunobonacci.mulog.publishers.jvm-metrics :refer [jvm-sample]] [midje.sweet :refer [facts fact => contains anything just]] [clojure.spec.test.alpha :as st]) (:import [java.lang.management ManagementFactory])) (st/instru...
85247d96171f48d323bf2a333e4b2fbea5047d06b8ca836f220aac4d821e821d
tsloughter/kuberl
kuberl_v1_node_affinity.erl
-module(kuberl_v1_node_affinity). -export([encode/1]). -export_type([kuberl_v1_node_affinity/0]). -type kuberl_v1_node_affinity() :: #{ 'preferredDuringSchedulingIgnoredDuringExecution' => list(), 'requiredDuringSchedulingIgnoredDuringExecution' => kuberl_v1_node_selector:kuberl_v1_node_selector() }....
null
https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1_node_affinity.erl
erlang
-module(kuberl_v1_node_affinity). -export([encode/1]). -export_type([kuberl_v1_node_affinity/0]). -type kuberl_v1_node_affinity() :: #{ 'preferredDuringSchedulingIgnoredDuringExecution' => list(), 'requiredDuringSchedulingIgnoredDuringExecution' => kuberl_v1_node_selector:kuberl_v1_node_selector() }....
b414390bcce7cde50b1963859dc6b116bf97c63a245397c51779d57fe02859db
bitonic/tog
FreeVars.hs
module Tog.Term.FreeVars ( FreeVars(..) , fvAll , freeVars ) where import qualified Data.Set as Set import Tog.Prelude import Tog.Term.Types -- Free variables ------------------------------------------------------------------------ data FreeVars = FreeVars { fvR...
null
https://raw.githubusercontent.com/bitonic/tog/0da3b6ec82ac1fa3ce91d7f9b683a8ddedfd732f/src/Tog/Term/FreeVars.hs
haskell
Free variables ----------------------------------------------------------------------
module Tog.Term.FreeVars ( FreeVars(..) , fvAll , freeVars ) where import qualified Data.Set as Set import Tog.Prelude import Tog.Term.Types data FreeVars = FreeVars { fvRigid :: Set.Set Var , fvFlexible :: Set.Set Var } fvAll :: FreeVars -> Set.Set Var ...
18c17a5470bd676ca780e4e1b08e55ee126c5fe041f8f543660093be54397680
typeclasses/dsv
Vector.hs
# LANGUAGE NoImplicitPrelude # # LANGUAGE ScopedTypeVariables # module DSV.Vector ( Vector , vectorIndexInt, vectorIndexNat, vectorIndexInteger, nthVectorElement , vectorLookup , vectorZip, vectorZipWith , listToVector, vectorToList , emptyVector ) where import DSV.Numbers import DSV.Prelude -- base im...
null
https://raw.githubusercontent.com/typeclasses/dsv/ae4eb823e27e4c569c4f9b097441985cf865fbab/dsv/library/DSV/Vector.hs
haskell
base vector
# LANGUAGE NoImplicitPrelude # # LANGUAGE ScopedTypeVariables # module DSV.Vector ( Vector , vectorIndexInt, vectorIndexNat, vectorIndexInteger, nthVectorElement , vectorLookup , vectorZip, vectorZipWith , listToVector, vectorToList , emptyVector ) where import DSV.Numbers import DSV.Prelude import Con...
d8c7b9a1d84e62a1269e12e8f00b181e90ceb5186463369bebacd64eebf4dc2f
ajhc/ajhc
Text.hs
# OPTIONS_JHC -fno - prelude # module Prelude.Text ( ReadS, ShowS, Read(readsPrec, readList), Show(showsPrec, show, showList), reads, shows, read, lex, showChar, showString, readParen, showParen,readIO,readLn,showLitChar ) where import Jhc.Basics import Jhc.Type.Float import Jhc.IO import Jhc.Monad...
null
https://raw.githubusercontent.com/ajhc/ajhc/8ef784a6a3b5998cfcd95d0142d627da9576f264/lib/jhc/Prelude/Text.hs
haskell
raises an exception instead of an error instance (Read a) => Read (Maybe a) where readsPrec d input = (\ inp -> [((Nothing) , rest) | ("Nothing" , rest) <- lex inp]) input ++ readParen (d > 9) (\ inp -> input
# OPTIONS_JHC -fno - prelude # module Prelude.Text ( ReadS, ShowS, Read(readsPrec, readList), Show(showsPrec, show, showList), reads, shows, read, lex, showChar, showString, readParen, showParen,readIO,readLn,showLitChar ) where import Jhc.Basics import Jhc.Type.Float import Jhc.IO import Jhc.Monad...
5ad291083e95053143fbab087fa52e716ddf5c7cae72edb9b6a1fd968e4e6d14
mcna/usocket
test-datagram.lisp
$ I d : test-datagram.lisp 660 2011 - 05 - 11 13:08:19Z ctian $ ;;;; $URL: svn-lisp.net/project/usocket/svn/usocket/tags/0.6.0.1/test/test-datagram.lisp $ (in-package :usocket-test) (defvar *echo-server*) (defvar *echo-server-port*) (defun start-server () (multiple-value-bind (thread socket) (usocket:socke...
null
https://raw.githubusercontent.com/mcna/usocket/187e0ecd58ec0b2093d972e0eb607a50182a3efd/test/test-datagram.lisp
lisp
$URL: svn-lisp.net/project/usocket/svn/usocket/tags/0.6.0.1/test/test-datagram.lisp $
$ I d : test-datagram.lisp 660 2011 - 05 - 11 13:08:19Z ctian $ (in-package :usocket-test) (defvar *echo-server*) (defvar *echo-server-port*) (defun start-server () (multiple-value-bind (thread socket) (usocket:socket-server "127.0.0.1" 0 #'identity nil :in-new-thread t :protocol :datagram)...
eb989b9300a45977291724e5537c7a88ba099f0ced3204592eb0da74a8b14095
simplex-chat/simplex-chat
M20220812_incognito_profiles.hs
# LANGUAGE QuasiQuotes # module Simplex.Chat.Migrations.M20220812_incognito_profiles where import Database.SQLite.Simple (Query) import Database.SQLite.Simple.QQ (sql) m20220812_incognito_profiles :: Query m20220812_incognito_profiles = [sql| ALTER TABLE connections ADD COLUMN custom_user_profile_id INTEGER REFERE...
null
https://raw.githubusercontent.com/simplex-chat/simplex-chat/1a36c88f72534e48d3972689a68b67f0fc60f16c/src/Simplex/Chat/Migrations/M20220812_incognito_profiles.hs
haskell
only set for direct connections member profile id if incognito profile was saved for member (used when invitation is received via incognito direct connection with host)
# LANGUAGE QuasiQuotes # module Simplex.Chat.Migrations.M20220812_incognito_profiles where import Database.SQLite.Simple (Query) import Database.SQLite.Simple.QQ (sql) m20220812_incognito_profiles :: Query m20220812_incognito_profiles = [sql| 1 for incognito |]
96e356b7a3b95a1cfa801f9b8a47615ea2f6d18ea848dbe6101d07b5f9f28b10
anmonteiro/ocaml-quic
quic_lwt.mli
---------------------------------------------------------------------------- * Copyright ( c ) 2020 * * All rights reserved . * * Redistribution and use in source and binary forms , with or without * modification , are permitted provided that the following conditions are met : * * 1...
null
https://raw.githubusercontent.com/anmonteiro/ocaml-quic/7f1a06fbe5380954bf49adc53a8fa7458bdc0024/lwt/quic_lwt.mli
ocaml
XXX: Alternative: ~conn_handler:(conn -> stream_handler) called for each * connection. Unix.sockaddr ->
---------------------------------------------------------------------------- * Copyright ( c ) 2020 * * All rights reserved . * * Redistribution and use in source and binary forms , with or without * modification , are permitted provided that the following conditions are met : * * 1...
08da12a8af124e002be530cfb3aff69b6e362a0b2c60d5e0437f30e4cd934208
saltysystems/overworld
ow_util.erl
-module(ow_util). -export([ run_checks/1, run_bchecks/1, any_in_list/2, pipeline/2, remove_dups/1 ]). -export([ mapfind/3, mapstore/4, maplistsort/2, maplistsort/3 ]). -export([ take_random/1, take_random/2, weighted_random/1 ]). -spec run_bchecks(list()) -> ok | any(...
null
https://raw.githubusercontent.com/saltysystems/overworld/934d5e5c07e5a75a2d0327599c03887fe2224a95/src/ow_util.erl
erlang
poor man's pipe Remove duplicates from a list -duplicate-elements-from-a-list-in-erlang some map* functions equivalent to the list functions that operate over tuples ----------------------------------------------------------------------------- @doc This function will take a list of items and return a random elemen...
-module(ow_util). -export([ run_checks/1, run_bchecks/1, any_in_list/2, pipeline/2, remove_dups/1 ]). -export([ mapfind/3, mapstore/4, maplistsort/2, maplistsort/3 ]). -export([ take_random/1, take_random/2, weighted_random/1 ]). -spec run_bchecks(list()) -> ok | any(...
354aff773b600b6e8498dc667f898334ff7e34a1b75d15759b56575b0149fb31
smart-chain-fr/tokenomia
Plan.hs
# LANGUAGE LambdaCase # # LANGUAGE FlexibleContexts # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE TypeApplications # {-# LANGUAGE QuasiQuotes, ExtendedDefaultRules #-} # LANGUAGE LambdaCase # # LANGUAGE ScopedTypeVariables # # LANGUAGE DerivingVia # {-# LANGUAGE QuasiQuotes, ExtendedDefaultRules #-} # LANGUAGE Fle...
null
https://raw.githubusercontent.com/smart-chain-fr/tokenomia/3ce4bb202912601720083f7a1dad8b2d7996b424/test/Spec/Tokenomia/ICO/Funds/Validation/CardanoCLI/Plan.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE QuasiQuotes, ExtendedDefaultRules # # LANGUAGE QuasiQuotes, ExtendedDefaultRules # # LANGUAGE OverloadedStrings #
# LANGUAGE LambdaCase # # LANGUAGE FlexibleContexts # # LANGUAGE TypeApplications # # LANGUAGE LambdaCase # # LANGUAGE ScopedTypeVariables # # LANGUAGE DerivingVia # # LANGUAGE FlexibleContexts # # LANGUAGE DuplicateRecordFields # # LANGUAGE DeriveGeneric # # LANGUAGE DeriveFunctor # # LANGUAGE NamedFieldPuns # # LA...
1938fc641b68dae32560619a2e5f80777c50d8993ca3713578f6af887af1baf6
lambdamikel/DLMAPS
concept-selection13.lisp
;;; -*- Mode: LISP; Syntax: Common-Lisp; Package: PROVER -*- (in-package :PROVER) ;;; ;;; ;;; (defun ensure-active-nodes-present () (unless (is-abox1-p *abox*) (error "Bad ABox for trace strategy!")) (when (and *reflexive-checks-p* (not *maintain-active-nodes-p*)) (error "active nodes mi...
null
https://raw.githubusercontent.com/lambdamikel/DLMAPS/7f8dbb9432069d41e6a7d9c13dc5b25602ad35dc/src/prover/concept-selection13.lisp
lisp
-*- Mode: LISP; Syntax: Common-Lisp; Package: PROVER -*- Code for semantic branching (format t "~% ~A ~A ~A ~A" node role succ edge)
(in-package :PROVER) (defun ensure-active-nodes-present () (unless (is-abox1-p *abox*) (error "Bad ABox for trace strategy!")) (when (and *reflexive-checks-p* (not *maintain-active-nodes-p*)) (error "active nodes missing!"))) (defun ensure-not-blocked (node) (when *reflexive-checks-p...
e0f24e0a08498139237a2ff1dbf763e20525d84385d8940bd5d5b1c52ac19432
denisidoro/floki
events.cljs
(ns floki.global.events (:require [re-frame.core :as rf] [quark.navigation.core :as nav] [floki.preview.events] [floki.movement.events] [floki.global.logic :as l.global])) (rf/reg-event-db :init (fn [_ _] {:tree/input {} :tree/paths [] :pos/x -1 ...
null
https://raw.githubusercontent.com/denisidoro/floki/519e1de6aa102ccf871361d0140abab16cc187c5/src/floki/global/events.cljs
clojure
(ns floki.global.events (:require [re-frame.core :as rf] [quark.navigation.core :as nav] [floki.preview.events] [floki.movement.events] [floki.global.logic :as l.global])) (rf/reg-event-db :init (fn [_ _] {:tree/input {} :tree/paths [] :pos/x -1 ...
ea4d2332bcd324165a1dd6ce1be645ec0e7e71286df935a30130b98fa6e1d0f2
zwizwa/erl_tools
socks_proxy.erl
Simple proxy . -module(socks_proxy). -export([start_serv/1, on_accept/1, handle/2, connect_via_socks/5]). start_serv(#{ port := _ } = Spec) -> serv_tcp:start_link( maps:merge( Spec, #{ opts => [binary, {send_timeout,3000}, {pa...
null
https://raw.githubusercontent.com/zwizwa/erl_tools/07645992e968c1456c9d0212f380afd1ffce4c1f/src/socks_proxy.erl
erlang
log:info("S: ~p~n",[D]), %% This appears to happen with Error=ehostunreach log:info("WARNING: serv_tcp:listener_handle: ~p~n",[Msg]), FIXME: handle {tcp_error,#Port<0.17430>,ehostunreach} Handshake Only support connect Arbitrary bytes? Arbitrary bytes? Not checking _Auths. Assume no auth is ok. ...
Simple proxy . -module(socks_proxy). -export([start_serv/1, on_accept/1, handle/2, connect_via_socks/5]). start_serv(#{ port := _ } = Spec) -> serv_tcp:start_link( maps:merge( Spec, #{ opts => [binary, {send_timeout,3000}, {pa...
eb7205d3b272d505716ed7f97dc81465b238018ef448a6145e49cc9d0c46d2a4
susanemcg/pandoc-tufteLaTeX2GitBook
PDF.hs
# LANGUAGE OverloadedStrings , CPP # Copyright ( C ) 2012 - 2014 < > This program is free software ; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 2 of the License , or ( at your option ) any later v...
null
https://raw.githubusercontent.com/susanemcg/pandoc-tufteLaTeX2GitBook/00c34b4299dd89c4e339e1cde006061918b559ab/pandoc-1.12.4.2/src/Text/Pandoc/PDF.hs
haskell
^ writer ^ options ^ document ^ source base URL ^ temp dir to store images ^ document ^ temp directory for output ^ tex program ^ tex source to get page numbers parsing output contents of stdout, contents of produced PDF if any). Rerun a fixed number of times to resolve references. We read PDF as a stric...
# LANGUAGE OverloadedStrings , CPP # Copyright ( C ) 2012 - 2014 < > This program is free software ; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation ; either version 2 of the License , or ( at your option ) any later v...
93140c4b761ef6b98c13707f49664ba73d51e0741ad4c68389ae2919c57f7416
mini-monkey/mini-monkey
mock_user.erl
-module(mock_user). -behaviour(gen_server). -export([start_link/0, messages/1]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). start_link() -> gen_server:start_link(?MODULE, [], []). messages(User) -> gen_server:call(User, messages, 200). init(_) ->...
null
https://raw.githubusercontent.com/mini-monkey/mini-monkey/4afa4385256c0f1d23db522c0725c3291a8c86c8/test/mock_user.erl
erlang
-module(mock_user). -behaviour(gen_server). -export([start_link/0, messages/1]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). start_link() -> gen_server:start_link(?MODULE, [], []). messages(User) -> gen_server:call(User, messages, 200). init(_) ->...
8ede4b6df4aab3457a0102168b4f647c9b6e295fc44a84692efb0d616cdf730e
stassats/lisp-bots
colorize.lisp
;;;; colorize.lisp (in-package :colorize) (eval-when (:compile-toplevel :load-toplevel :execute) (defparameter *coloring-types* nil) (defparameter *version-token* (gensym))) (defclass coloring-type () ((default-mode :initarg :default-mode :accessor coloring-type-default-mode) (transition-functions :initarg ...
null
https://raw.githubusercontent.com/stassats/lisp-bots/09bfce724afd20c91a08acde8816be6faf5f54b2/colorize.lisp
lisp
colorize.lisp
(in-package :colorize) (eval-when (:compile-toplevel :load-toplevel :execute) (defparameter *coloring-types* nil) (defparameter *version-token* (gensym))) (defclass coloring-type () ((default-mode :initarg :default-mode :accessor coloring-type-default-mode) (transition-functions :initarg :transition-functio...
ac9330591218e429295a0f3f07f23a09131f00840e5162e405c9d4caa3ebb72b
lpeterse/haskell-utc
DateTime.hs
# LANGUAGE FlexibleInstances # module Data.UTC.Type.DateTime ( -- * Type DateTime (..) ) where import Data.Maybe import Data.UTC.Class.Epoch import Data.UTC.Class.IsDate import Data.UTC.Class.IsTime import Data.UTC.Class.IsUnixTime import Data.UTC.Type.Date import Data.UTC.Type.Time import Data.UTC.Type.Local...
null
https://raw.githubusercontent.com/lpeterse/haskell-utc/e4502c08591e80d411129bb7c0414539f6302aaf/Data/UTC/Type/DateTime.hs
haskell
* Type | A time representation based on a 'Data.UTC.Date' and the 'Data.UTC.Time' of the day. * The type uses multiprecision integers internally and is able to represent any UTC date in the past and in the future with arbitrary precision meant for debugging purposes. Don't rely on its behaviour! > > s...
# LANGUAGE FlexibleInstances # module Data.UTC.Type.DateTime DateTime (..) ) where import Data.Maybe import Data.UTC.Class.Epoch import Data.UTC.Class.IsDate import Data.UTC.Class.IsTime import Data.UTC.Class.IsUnixTime import Data.UTC.Type.Date import Data.UTC.Type.Time import Data.UTC.Type.Local import Data.U...
8318f325562c688009daa6ef7934f8375b7068f16f6565360ba617f4b8148998
AndrewRademacher/gdax
Feed.hs
module Network.GDAX.Feed ( module Core , module Exceptions , module Feed , module Shared , defaultClient ) where import Control.Monad.Catch import qualified Data.Aeson as Aeson import qualified Data.Text as T import Network.GDAX.Core a...
null
https://raw.githubusercontent.com/AndrewRademacher/gdax/3473aef6eb0282779b061875b7ea7e959e18b24f/lib/Network/GDAX/Feed.hs
haskell
module Network.GDAX.Feed ( module Core , module Exceptions , module Feed , module Shared , defaultClient ) where import Control.Monad.Catch import qualified Data.Aeson as Aeson import qualified Data.Text as T import Network.GDAX.Core a...
ffc7b6982c2c86675cf0a6f6902c7610fadf4e89bd2bb0be5c6e361a0a403d17
ryanpbrewster/haskell
008.hs
Problem 008 Find the largest product of 5 consecutive digits in Problem008.in import Data.Char -- group L n = a list of n-tuples made of elements in L group [] n = [] group digits n = (take n digits) : group (tail digits) n -- Read in a file, turn it into a big long string of digits -- Then group them into chunk...
null
https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/project-euler/src/Old/008.hs
haskell
group L n = a list of n-tuples made of elements in L Read in a file, turn it into a big long string of digits Then group them into chunks and find the biggest product
Problem 008 Find the largest product of 5 consecutive digits in Problem008.in import Data.Char group [] n = [] group digits n = (take n digits) : group (tail digits) n problem008 filename = do text <- readFile filename let digits = map digitToInt $ concat $ lines text return $ maximum $ map product $...
96c4e1de7bab3f1b6ccda8d9c5a18534e1c852ef7e8e14fedc2300da9f52cfa0
jonschoning/pinboard
ApiTypesLens.hs
# LANGUAGE KindSignatures # {-# LANGUAGE RankNTypes #-} module Pinboard.ApiTypesLens where import Pinboard.ApiTypes import Data.Text (Text) import Data.Time (UTCTime) import Data.Time.Calendar (Day) import Data.Kind (Type) import Control.Applicative import Data.Profunctor import Data.Either import Prelude hiding (w...
null
https://raw.githubusercontent.com/jonschoning/pinboard/d6175e7966dd11fcd0fac9b90ea0db4988eb5410/src/Pinboard/ApiTypesLens.hs
haskell
# LANGUAGE RankNTypes # * Lens Aliases * Posts # INLINE postsUserL # * Post # INLINE postMetaL # * NoteListItem * Suggested (Prism)
# LANGUAGE KindSignatures # module Pinboard.ApiTypesLens where import Pinboard.ApiTypes import Data.Text (Text) import Data.Time (UTCTime) import Data.Time.Calendar (Day) import Data.Kind (Type) import Control.Applicative import Data.Profunctor import Data.Either import Prelude hiding (words, unwords) type Lens_' ...
d0d5c166b7f265aa236e6b56dd867961aba155bdca6f3819b39a4d5fa7438aa3
smanek/trivial-lisp-webapp
package.lisp
Copyright ( C ) 2001 , 2003 Copyright ( C ) 2005 " the conditions and ENSURE - SSL - FUNCALL are by . " ;;; ;;; See LICENSE for details. #+xcvb (module (:depends-on ((:when (:featurep :sbcl) (:require :sb-posix))))) (in-package :cl-user) (defpackage :cl+ssl (:use :common-lisp :trivial-gray-streams)...
null
https://raw.githubusercontent.com/smanek/trivial-lisp-webapp/36816c17ea378822e02a123c1be960fd9ce3e29d/aux/cl%2Bssl/package.lisp
lisp
See LICENSE for details.
Copyright ( C ) 2001 , 2003 Copyright ( C ) 2005 " the conditions and ENSURE - SSL - FUNCALL are by . " #+xcvb (module (:depends-on ((:when (:featurep :sbcl) (:require :sb-posix))))) (in-package :cl-user) (defpackage :cl+ssl (:use :common-lisp :trivial-gray-streams) (:export #:ensure-initialized ...
e82fd344738aede8becb3a8bf80d4c84f270feff2009637ad85cee0c87801e6e
xvw/preface
category.ml
module Core (Req : Preface_specs.Category.WITH_ID_AND_COMPOSE) = Req module Operation (Core : Preface_specs.Category.CORE) = struct include Semigroupoid.Operation (Core) end module Infix (Core : Preface_specs.Category.CORE) = struct include Semigroupoid.Infix (Core) end module Via_id_and_compose (Req : Preface_s...
null
https://raw.githubusercontent.com/xvw/preface/89af07e80f2e7458a1381ec22aa85036b68e6e8a/lib/preface_make/category.ml
ocaml
module Core (Req : Preface_specs.Category.WITH_ID_AND_COMPOSE) = Req module Operation (Core : Preface_specs.Category.CORE) = struct include Semigroupoid.Operation (Core) end module Infix (Core : Preface_specs.Category.CORE) = struct include Semigroupoid.Infix (Core) end module Via_id_and_compose (Req : Preface_s...
c7fff43ef3e6784ba9c46cc3586581e507baded064085251e90fdb9a512b85cf
pedestal/pedestal-app
route.clj
Copyright 2013 Relevance , Inc. ; The use and distribution terms for this software are covered by the Eclipse Public License 1.0 ( ) ; which can be found in the file epl-v10.html at the root of this distribution. ; ; By using this software in any fashion, you are agreeing to be bound by ; the terms of this licens...
null
https://raw.githubusercontent.com/pedestal/pedestal-app/509ab766a54921c0fbb2dd7c6a3cb20223b8e1a1/app/src/io/pedestal/app/route.clj
clojure
The use and distribution terms for this software are covered by the which can be found in the file epl-v10.html at the root of this distribution. By using this software in any fashion, you are agreeing to be bound by the terms of this license. You must not remove this notice, or any other, from this software.
Copyright 2013 Relevance , Inc. Eclipse Public License 1.0 ( ) (ns io.pedestal.app.route "Route transform messages from incoming channel to an outbound channel." (:require [io.pedestal.app.match :as match]) (:use [clojure.core.async :only [go chan <! put!]])) (defn- add-channel [idx config] (match/index...
b840d10f47f8b8cc3356219423ed18b594172f821f492c49968d73090e29a1f8
BinaryAnalysisPlatform/bap
x86_legacy_bil_lifter.ml
[@@@warning "-40"] open Core_kernel[@@warning "-D"] open Bap_knowledge open Bap_core_theory module Bil = X86_legacy_bil open Bil open X86_legacy_bil_pp type exp = Ast.exp type stmt = Ast.stmt module Var = Var type rmode = Type.roundmode_type module Binary = X86_legacy_bil_semantics.Binary include Bap.Std.Self() ...
null
https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/253afc171bbfd0fe1b34f6442795dbf4b1798348/plugins/x86/x86_legacy_bil_lifter.ml
ocaml
ill-formed expressions the rest is ill-formed the rest is ill-formed will add those later
[@@@warning "-40"] open Core_kernel[@@warning "-D"] open Bap_knowledge open Bap_core_theory module Bil = X86_legacy_bil open Bil open X86_legacy_bil_pp type exp = Ast.exp type stmt = Ast.stmt module Var = Var type rmode = Type.roundmode_type module Binary = X86_legacy_bil_semantics.Binary include Bap.Std.Self() ...
29918bfdf919e1a4e14ea1d7cf23e24d7343f7ffe6a168ebe62b32befbdb3257
NorfairKing/cursor
Tree.hs
# OPTIONS_GHC -fno - warn - duplicate - exports # module Cursor.Tree ( TreeCursor (..), TreeAbove (..), -- * Types module Cursor.Tree.Types, -- * Construction, destruction module Cursor.Tree.Base, -- * Drawing module Cursor.Tree.Draw, -- * Collapsing module Cursor.Tree.Collaps...
null
https://raw.githubusercontent.com/NorfairKing/cursor/71ec3154809e229efbf35d500ac6d1a42ae5fdc0/cursor/src/Cursor/Tree.hs
haskell
* Types * Construction, destruction * Drawing * Collapsing * Movements * Insertions * Deletions * Swapping * Promotions * Demotions
# OPTIONS_GHC -fno - warn - duplicate - exports # module Cursor.Tree ( TreeCursor (..), TreeAbove (..), module Cursor.Tree.Types, module Cursor.Tree.Base, module Cursor.Tree.Draw, module Cursor.Tree.Collapse, module Cursor.Tree.Movement, module Cursor.Tree.Insert, module Cursor...
b4da2382f8fa718859b5b65549d5da5b256b3b82368a793bc0562b99f98e3fb9
racket/web-server
dummy-stateless-servlet.rkt
#lang racket/base (define interface-version #f) (define stuffer #f) (define manager #f) (define start #f) (provide (all-defined-out))
null
https://raw.githubusercontent.com/racket/web-server/f718800b5b3f407f7935adf85dfa663c4bba1651/web-server-doc/web-server/scribblings/dummy-stateless-servlet.rkt
racket
#lang racket/base (define interface-version #f) (define stuffer #f) (define manager #f) (define start #f) (provide (all-defined-out))
0b2821c52781dd0be735514d647c06c6329e3ae8e480c92253fc701f2b37272b
Perry961002/SICP
exe2.64-list-to-tree.scm
(define (make-tree entry left right) (list entry left right)) ;将有序表转换成一棵平衡二叉树 (define (list->tree elements) (car (partial-tree elements (length elements)))) ;将elts的前n个变成树 (define (partial-tree elts n) (if (= n 0) (cons '() elts) (let ((left-size (quotient (- n 1) 2))) ;求左子树的节点树 对左子树转换成平衡二叉...
null
https://raw.githubusercontent.com/Perry961002/SICP/89d539e600a73bec42d350592f0ac626e041bf16/Chap2/exercise/exe2.64-list-to-tree.scm
scheme
将有序表转换成一棵平衡二叉树 将elts的前n个变成树 求左子树的节点树 取出表中的第一个元素,即左子树 取出还未转换的 a) 原理:以中间元素为根节点,前半部分为左子树,后半部分为右子树,最后合成一棵二叉树 b) 按O(n)的量级增长,一个最直观的考虑是因为list->tree过程要对每一个元素进行访问 根据主定理可得T(n) = Θ(n)
(define (make-tree entry left right) (list entry left right)) (define (list->tree elements) (car (partial-tree elements (length elements)))) (define (partial-tree elts n) (if (= n 0) (cons '() elts) 对左子树转换成平衡二叉树 , left - result的第一个元素就是左子树,其余的就是未转换的元素 转换剩余元素 右子树 (rem...
e18cf42096723f2bb6352cd044bbfeaa652003eb33f24b9fd5b90b4b0981cf84
owlbarn/owl_symbolic
onnx_pb.ml
[@@@ocaml.warning "-27-30-39"] type tensor_proto_segment_mutable = { mutable begin_ : int64 option ; mutable end_ : int64 option } let default_tensor_proto_segment_mutable () : tensor_proto_segment_mutable = { begin_ = None; end_ = None } type string_string_entry_proto_mutable = { mutable key : string opt...
null
https://raw.githubusercontent.com/owlbarn/owl_symbolic/dc853a016757d3f143c5e07e50075e7ae605d969/src/onnx_specs/onnx_pb.ml
ocaml
[@@@ocaml.warning "-27-30-39"] type tensor_proto_segment_mutable = { mutable begin_ : int64 option ; mutable end_ : int64 option } let default_tensor_proto_segment_mutable () : tensor_proto_segment_mutable = { begin_ = None; end_ = None } type string_string_entry_proto_mutable = { mutable key : string opt...
bddc1326b77e429952aa020ec1f4f99555013a11475c3d1d85e44cc3fe1d19d8
imandra-ai/imandra-ros
controller_manager_msgs_to_json.ml
open Json_utils;; open Basic_types_to_json;; open Ros_messages.Controller_manager_msgs;; let controllerStatistics_to_json x = [ ( "controllerStatistics_name" , x.controllerStatistics_name |> string_to_json ); ( "controllerStatistics_ros_type" , x.controllerStatistics_ros_type |> string_to_json ); ( "contro...
null
https://raw.githubusercontent.com/imandra-ai/imandra-ros/e1380c267ee319dd4f86c4b54e0b270bc0738796/imandra_model/src-messages-pp/controller_manager_msgs_to_json.ml
ocaml
open Json_utils;; open Basic_types_to_json;; open Ros_messages.Controller_manager_msgs;; let controllerStatistics_to_json x = [ ( "controllerStatistics_name" , x.controllerStatistics_name |> string_to_json ); ( "controllerStatistics_ros_type" , x.controllerStatistics_ros_type |> string_to_json ); ( "contro...
786c78b1fbab5786d08a9c4d862b1805a747f4cef3b57d5e32fe84147d200a71
fumieval/xml-lens
Lens.hs
{-# LANGUAGE Rank2Types, FlexibleContexts #-} # OPTIONS_GHC -fno - warn - orphans # ----------------------------------------------------------------------------- -- | -- Module : Text.XML.Lens Copyright : ( C ) 2015 -- License : BSD-style (see the file LICENSE) -- Maintainer : < > -- Stabil...
null
https://raw.githubusercontent.com/fumieval/xml-lens/4612e5ea18822baef678d7176c1ab5f93e4e31e9/Text/XML/Lens.hs
haskell
# LANGUAGE Rank2Types, FlexibleContexts # --------------------------------------------------------------------------- | Module : Text.XML.Lens License : BSD-style (see the file LICENSE) Stability : provisional Portability : non-portable -------------------------------------------------------------...
# OPTIONS_GHC -fno - warn - orphans # Copyright : ( C ) 2015 Maintainer : < > module Text.XML.Lens ( Element(..) , (...) , name , localName , el , ell , named , attributeIs , attributeSatisfies , attributeSatisfies' , withoutAttribute , attr , attrib...
724d52b3b818ce3be62c2d8a9a134016306b19918e6ec2383b39dd6ea319e764
leo-project/leo_gateway
leo_nfs_file_handler.erl
%%====================================================================== %% Leo Gateway %% Copyright ( c ) 2012 - 2015 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 %% a...
null
https://raw.githubusercontent.com/leo-project/leo_gateway/7bac8912b762688f0ef237b31fee17e30e3888a3/src/leo_nfs_file_handler.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 permis...
Leo Gateway Copyright ( c ) 2012 - 2015 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_nfs_file_h...
f07ba8aa413c4d658ce2b841fba937e2c7446e26b99be92b00d42c9109760c81
typedclojure/typedclojure
malli_extensible.cljc
(ns typed-example.malli-extensible (:require [typed.clojure :as-alias t] [malli.core :as m])) here 's a new malli schema . we need to teach Typed Clojure what it means . ;; the namespace typed-example.register-malli-extensions does this via `register-malli->type-extension`. ;; Typed Clojure will automa...
null
https://raw.githubusercontent.com/typedclojure/typedclojure/f20949883029f3875457ffc6e446afbee8531fb3/example-projects/malli-type-providers/src/typed_example/malli_extensible.cljc
clojure
the namespace typed-example.register-malli-extensions does this via `register-malli->type-extension`. Typed Clojure will automatically load this namespace during checking since it's [Over ...] schemas are of m/type ::over, which is registered in typed-example.register-malli-extensions
(ns typed-example.malli-extensible (:require [typed.clojure :as-alias t] [malli.core :as m])) here 's a new malli schema . we need to teach Typed Clojure what it means . added to the src / typedclojure_config.cljc file in the : - extensions entry . ^::t/ignore (def Over (m/-simple-schema (fn [...
2ab8a07a9fe98f1393f05f850abdde0cd667d0d1c2c6c9c3cb2df382d5a8d3dd
facebook/duckling
Rules.hs
Copyright ( c ) 2016 - present , Facebook , Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. {-# LANGUAGE GADTs #-} {-# LANGUAGE OverloadedStrings #-} # LANGUAGE NoRebindableSyntax # module Duckling.N...
null
https://raw.githubusercontent.com/facebook/duckling/c6a48a1d0678a389f86d17db2676e1a289e355ce/Duckling/Numeral/AR/Rules.hs
haskell
All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree. # LANGUAGE GADTs # # LANGUAGE OverloadedStrings #
Copyright ( c ) 2016 - present , Facebook , Inc. # LANGUAGE NoRebindableSyntax # module Duckling.Numeral.AR.Rules (rules) where import Data.Maybe import Prelude import qualified Data.HashMap.Strict as HashMap import qualified Data.Text as Text import Duckling.Dimensions.Types import Duckling.Numeral.AR.Helpers ...
dee9c1a611f1170fb3df5a9bc82c4ce14716041d87173a03bd9d75fc9b3d0dea
Frama-C/Frama-C-snapshot
trace_partitioning.mli
(**************************************************************************) (* *) This file is part of Frama - C. (* *) Copyright ...
null
https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/value/partitioning/trace_partitioning.mli
ocaml
************************************************************************ alternatives) ...
This file is part of Frama - C. Copyright ( C ) 2007 - 2019 CEA ( Commissariat à l'énergie atomique et aux énergies Lesser General Public License as published by the Free Software Foundation , v...
84c7a500fb5bbe6a5c000ad797105088c5592fef7559f7dab5b4c0631e1969c9
prl-julia/juliette-wa
redex.rkt
#lang racket (require redex) ; import surface language (require "../../../src/redex/core/wa-surface.rkt") ; import full language (require "../../../src/redex/core/wa-full.rkt") ; import optimizations (require "../../../src/redex/optimizations/wa-optimized.rkt") (displayln "Test for litmus-wa/test04:") (define p ...
null
https://raw.githubusercontent.com/prl-julia/juliette-wa/1d1a2154e7b4e232ea2166fba485a3bf574ebd88/tests/litmus-wa/test04/redex.rkt
racket
import surface language import full language import optimizations
#lang racket (require redex) (require "../../../src/redex/core/wa-surface.rkt") (require "../../../src/redex/core/wa-full.rkt") (require "../../../src/redex/optimizations/wa-optimized.rkt") (displayln "Test for litmus-wa/test04:") (define p (term (evalg (seq (mdef "r2" () (mcall r1)) (seq (mdef "i" ...
25b29f4398f13035bf017f7d99c4435206fdf9124d93667684a8270e50875589
qfpl/reflex-tutorial
EventWriter.hs
{-# LANGUAGE OverloadedStrings #-} # LANGUAGE TemplateHaskell # # LANGUAGE RecursiveDo # # LANGUAGE FlexibleContexts # {-# LANGUAGE GADTs #-} module Posts.Collection.EventWriter ( todoList , ceMarkAllComplete , ceClearComplete ) where import Control.Monad (void, join) import Control.Monad.Reader (MonadReade...
null
https://raw.githubusercontent.com/qfpl/reflex-tutorial/07c1e6fab387cbeedd031630ba6a5cd946cc612e/code/basics/src/Posts/Collection/EventWriter.hs
haskell
# LANGUAGE OverloadedStrings # # LANGUAGE GADTs #
# LANGUAGE TemplateHaskell # # LANGUAGE RecursiveDo # # LANGUAGE FlexibleContexts # module Posts.Collection.EventWriter ( todoList , ceMarkAllComplete , ceClearComplete ) where import Control.Monad (void, join) import Control.Monad.Reader (MonadReader, ask , runReaderT) import Control.Lens import Data.Tex...
d97b09074d0aaf84256d6b70de0b110d34db1b9b8d3ae1738d2c9ae83dc5c427
mlabs-haskell/plutus-simple-model
TimeSlot.hs
{-# LANGUAGE DeriveAnyClass #-} # LANGUAGE DeriveGeneric # # LANGUAGE DerivingStrategies # # LANGUAGE NamedFieldPuns # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE TemplateHaskell # # LANGUAGE NoImplicitPrelude # # OPTIONS_GHC -Wno - orphans # module Cardano.Simple.Ledger.TimeSlot ( SlotConfig (..), SlotConversio...
null
https://raw.githubusercontent.com/mlabs-haskell/plutus-simple-model/10000d64ede979bb1d7838b3ed20b785615910b9/cardano-simple/src/Cardano/Simple/Ledger/TimeSlot.hs
haskell
# LANGUAGE DeriveAnyClass # # LANGUAGE OverloadedStrings # ^ Beginning of slot 0 (in milliseconds) # INLINEABLE def # # INLINEABLE slotToEndPOSIXTime # | Get the current slot number Convert to ms
# LANGUAGE DeriveGeneric # # LANGUAGE DerivingStrategies # # LANGUAGE NamedFieldPuns # # LANGUAGE TemplateHaskell # # LANGUAGE NoImplicitPrelude # # OPTIONS_GHC -Wno - orphans # module Cardano.Simple.Ledger.TimeSlot ( SlotConfig (..), SlotConversionError (..), slotRangeToPOSIXTimeRange, slotToPOSIXTimeRange, ...
d19cf92e7d3aa221917714c0a79d6552c2c13f76a717ca48a125c8e20835bbe8
jrm-code-project/LISP-Machine
sd.lisp
-*- Mode : LISP ; Package : USER ; ; : CL -*- (defvar *supdup-server-default-rubout-handler* nil) : CLEAR - BETWEEN - CURSORPOSES ;:INSERT-STRING (optional) ;:DELETE-STRING (optional) (defconst %tdmov #o200 "move: oldv oldh newv newh") (defconst %tdmv1 #o201 "move: newv newh") (defconst %tdeof #o202 "clear to en...
null
https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/pace/sd.lisp
lisp
Package : USER ; ; : CL -*- :INSERT-STRING (optional) :DELETE-STRING (optional) character insert/delete line insert/delete generates real control-meta can send lowercase scroll if possible do more processing can move cursor up display sail characters sail characters can backspace can erase convert lower to upper cas...
(defvar *supdup-server-default-rubout-handler* nil) : CLEAR - BETWEEN - CURSORPOSES (defconst %tdmov #o200 "move: oldv oldh newv newh") (defconst %tdmv1 #o201 "move: newv newh") (defconst %tdeof #o202 "clear to end of screen") (defconst %tdeol #o203 "clear rest of line") (defconst %tddlf #o204 "clear current char") ...
e3cab533d8f8a10ae80329cb1be9ecea2fe2c6524fc6b15e317a037af9180766
hspec/hspec
Location.hs
# LANGUAGE CPP # module Test.Hspec.Core.Example.Location ( Location(..) , extractLocation #ifdef TEST , parseAssertionFailed , parseCallStack , parseLocation , parseSourceSpan , workaroundForIssue19236 #endif ) where import Prelude () import Test.Hspec.Core.Compat import Data.Char im...
null
https://raw.githubusercontent.com/hspec/hspec/be02df2ff68562d900eab79680dd63a39dd2f584/hspec-core/src/Test/Hspec/Core/Example/Location.hs
haskell
| @Location@ is used to represent source locations.
# LANGUAGE CPP # module Test.Hspec.Core.Example.Location ( Location(..) , extractLocation #ifdef TEST , parseAssertionFailed , parseCallStack , parseLocation , parseSourceSpan , workaroundForIssue19236 #endif ) where import Prelude () import Test.Hspec.Core.Compat import Data.Char im...
95ba51c619e0958c28b0f0e4094dd92745b9bc4ead02196a8dc11b71336749aa
con-kitty/categorifier-c
Function.hs
# LANGUAGE DataKinds # # LANGUAGE QuasiQuotes # {-# LANGUAGE RankNTypes #-} # LANGUAGE TypeFamilies # # LANGUAGE UndecidableInstances # -- | This module provides an abstract interface to function calls in the K DSL. module Categorifier.C.KTypes.Function * Functions on ' Arrays ' instead of user - defined types ...
null
https://raw.githubusercontent.com/con-kitty/categorifier-c/f8cf0c08a48ffc4bcb8c0be095a98dc940e32ca1/Categorifier/C/KTypes/Function.hs
haskell
# LANGUAGE RankNTypes # | This module provides an abstract interface to function calls in the K DSL. * Variadic function calls using 'PolyVec' * External C function calls ** Helper machinery | An 'Arrays' of immutable vectors | An 'Arrays' of mutable vectors | Function name in C | Input spec | Output spec | U...
# LANGUAGE DataKinds # # LANGUAGE QuasiQuotes # # LANGUAGE TypeFamilies # # LANGUAGE UndecidableInstances # module Categorifier.C.KTypes.Function * Functions on ' Arrays ' instead of user - defined types ArraysVec, KFunCall (..), kFunctionCall, Callee (..), kForeignFunctionCall, KForeignFu...
2e72cee313a33bc3f7a379bc3bcda60687aa7b692a088803bd60e03ab15709d8
nomeata/kaleidogen
Tutorial.hs
-- The abstract script of the tutorial module Tutorial ( Script , ScriptStep(..) , Delay , Destination(..) , Variation(..) , tutorial ) where import Control.Monad.Writer type Script = [ScriptStep] type ScriptM = Writer Script () type Delay = Double -- in milliseconds data Destination = Center |...
null
https://raw.githubusercontent.com/nomeata/kaleidogen/3906d86052a1b895cc07acc1af0180054bc27f30/src/Tutorial.hs
haskell
The abstract script of the tutorial in milliseconds Long enough to run animation (see videoSpeed)
module Tutorial ( Script , ScriptStep(..) , Delay , Destination(..) , Variation(..) , tutorial ) where import Control.Monad.Writer type Script = [ScriptStep] type ScriptM = Writer Script () data Destination = Center | DNA Int Variation data Variation = NE | W data ScriptStep = Wait Delay ...
6220eb117edebbe0d5e3ccd3c2c8f9dcff5de11fdb184058992dd307f891088a
philnguyen/soft-contract
zo-string.rkt
#lang racket/base ;; Convert a zo struct to a more readable string representation. ;; Uses predicates to guess which struct we have, then convert the known ;; fields to strings. ;; Printing a field recursively is potentially expensive, ;; so we wrap the computation in a thunk. ;; The macro `lcons` makes thunk creatio...
null
https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/gradual-typing-benchmarks/zordoz.6.2/zo-string.rkt
racket
Convert a zo struct to a more readable string representation. Uses predicates to guess which struct we have, then convert the known fields to strings. Printing a field recursively is potentially expensive, so we wrap the computation in a thunk. The macro `lcons` makes thunk creation a little prettier. The functi...
#lang racket/base (provide zo->string zo->spec ) (require compiler/zo-structs racket/match (only-in racket/list empty?) (only-in racket/string string-join) (for-syntax racket/base racket/syntax)) (define (zo->spec z) (define z* (try-spec z)) (if z* z* (e...
1e0353ff3ddea7cb6be5f7dde01bd245ded5d604a00dcf64a42a3f771feab77d
soegaard/little-helper
set--greedy-set-cover.scm
-- (require (planet "set.scm" ("soegaard" "galore.plt" 2 1))) ; An instance (X,F) of the "set-covering problem" consists ; of a finite set X and a family F of subsets of X covering X, that is , every element of X belongs to at least one subset in F. ; Example: (define X (insert* '(a b c ...
null
https://raw.githubusercontent.com/soegaard/little-helper/26249c688e5adf1e2535c405c6289030eff561b4/planet/galore.plt/2/2/examples/set--greedy-set-cover.scm
scheme
An instance (X,F) of the "set-covering problem" consists of a finite set X and a family F of subsets of X covering X, Example: A minimum set cover is C={S3,S4,S5}. Let's try a greedy approach: greedy-set-cover : (set alpha) (list (set alpha)) -> (list (set alpha)) returns an approximation of the minima...
-- (require (planet "set.scm" ("soegaard" "galore.plt" 2 1))) that is , every element of X belongs to at least one subset in F. (define X (insert* '(a b c d e f g h i j k l) (empty))) (define S1 (insert* '(a...
b141974391908e9b70a5d5cfa5cb535dee59a6513c3be3ff3447dae3a1049358
silkapp/rest
Combinators.hs
# LANGUAGE DataKinds , RankNTypes , ScopedTypeVariables , TypeFamilies # DataKinds , RankNTypes , ScopedTypeVariables , TypeFamilies #-} -- | Combinators for specifying the input/output dictionaries of a -- 'Handler'. The combinators can be combined using @(@'.'@)@. module Rest.Diction...
null
https://raw.githubusercontent.com/silkapp/rest/f0462fc36709407f236f57064d8e37c77bdf8a79/rest-core/src/Rest/Dictionary/Combinators.hs
haskell
| Combinators for specifying the input/output dictionaries of a 'Handler'. The combinators can be combined using @(@'.'@)@. ** Input dictionaries ** Output dictionaries ** Error dictionaries ** Composed dictionaries ** Header dictionaries ** Parameter dictionaries ** Deprecated | Set custom sub-dictionary for...
# LANGUAGE DataKinds , RankNTypes , ScopedTypeVariables , TypeFamilies # DataKinds , RankNTypes , ScopedTypeVariables , TypeFamilies #-} module Rest.Dictionary.Combinators ( stringI , xmlTextI , fileI , readI , xmlI , rawXmlI , jsonI , rawJsonI , rawJsonAndXmlI ...
b59130810ab4fae5ef2ec772d7025ebbcf079e322ed898f5b559f97b69b5fdff
hailstorm-hs/hailstorm
HailstormCLI.hs
module Main (main) where import Control.Applicative import Control.Monad import Data.List.Split import Data.Maybe import Hailstorm.InputSource import Hailstorm.InputSource.FileSource import Hailstorm.InputSource.KafkaSource import Hailstorm.Logging import Hailstorm.Processor import Hailstorm.Sample.WordCountKafkaEmitt...
null
https://raw.githubusercontent.com/hailstorm-hs/hailstorm/3c595336038a7a6417a31cb8b1fc38780f27c520/src/HailstormCLI.hs
haskell
| Options for the main program. | For run_sample_emitter | For run_processors | Builds Zookeeper options from command line options. | Runs the sample scenario and topology. | Runs specific processors relative to a topology. | Main entry point.
module Main (main) where import Control.Applicative import Control.Monad import Data.List.Split import Data.Maybe import Hailstorm.InputSource import Hailstorm.InputSource.FileSource import Hailstorm.InputSource.KafkaSource import Hailstorm.Logging import Hailstorm.Processor import Hailstorm.Sample.WordCountKafkaEmitt...
e3cb04ed0b48066fff47b607e5972842b6c8274db3594eb15edcdc3c9f4efc48
Ptival/yugioh
Card.hs
# LANGUAGE DeriveGeneric # # LANGUAGE QuasiQuotes # # LANGUAGE RecordWildCards # # LANGUAGE TemplateHaskell # -- | A `Card` is a card when not in a particular position (for instance, in the -- player's hand, or in the graveyard). When it is played on the field, it will -- require extra informtaion to keep track of wh...
null
https://raw.githubusercontent.com/Ptival/yugioh/855e8f22c3ff322c7ca1d0a1fa96c50a54724aeb/lib/YuGiOh/Card.hs
haskell
| A `Card` is a card when not in a particular position (for instance, in the player's hand, or in the graveyard). When it is played on the field, it will require extra informtaion to keep track of what happens to it.
# LANGUAGE DeriveGeneric # # LANGUAGE QuasiQuotes # # LANGUAGE RecordWildCards # # LANGUAGE TemplateHaskell # module YuGiOh.Card ( Card (..), attack, attribute, defense, description, level, monsterType, name, ) where import Control.Lens import Data.String.Interpolate import GHC.Generic...
03e6a8605ba8c509985d0a687eac7b0c2237111b38d31bd420db329f4fa75e80
discus-lang/ddc
Sub.hs
module DDC.Core.Check.Judge.Sub (makeSub) where import DDC.Type.Transform.SubstituteT import DDC.Core.Check.Judge.EqT import DDC.Core.Exp.Annot.AnTEC import DDC.Core.Check.Judge.Inst import DDC.Core.Check.Base import qualified DDC.Core.Check.Context.Resolve as Resolve import qualified DDC.Type.Sum ...
null
https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-core/DDC/Core/Check/Judge/Sub.hs
haskell
| Make the left type a subtype of the right type, or throw the provided error if this is not possible. The inferred type may already be a subtype of the expected type, and in that case we don't need to do anything extra. If the inferred type is a 'S e a' computation type and the expected by running th...
module DDC.Core.Check.Judge.Sub (makeSub) where import DDC.Type.Transform.SubstituteT import DDC.Core.Check.Judge.EqT import DDC.Core.Exp.Annot.AnTEC import DDC.Core.Check.Judge.Inst import DDC.Core.Check.Base import qualified DDC.Core.Check.Context.Resolve as Resolve import qualified DDC.Type.Sum ...
d4b39ab5fdabef4e4f7b00b6d5e38af37a4dc471d52ea639e6b7d03865b37502
fossas/fossa-cli
GoModGraphSpec.hs
module Go.GoModGraphSpec (spec) where import Data.Map qualified as Map import Data.SemVer (version) import Data.Set qualified as Set import Data.Text (Text) import Data.Text.IO qualified as TIO import Data.Void (Void) import DepTypes ( DepType (GoType), Dependency (..), VerConstraint (CEq), ) import GraphUtil (...
null
https://raw.githubusercontent.com/fossas/fossa-cli/84d2017faafb01a679e0951868e6e6b292781faa/test/Go/GoModGraphSpec.hs
haskell
from A from B from C from E from F Act Act A B C E
module Go.GoModGraphSpec (spec) where import Data.Map qualified as Map import Data.SemVer (version) import Data.Set qualified as Set import Data.Text (Text) import Data.Text.IO qualified as TIO import Data.Void (Void) import DepTypes ( DepType (GoType), Dependency (..), VerConstraint (CEq), ) import GraphUtil (...
e990dd578df33d56ebe40f4b206e348bdc43dee3c63a33922d6b8bad7d981d02
cryogen-project/cryogen-asciidoc
project.clj
(defproject cryogen-asciidoc "0.3.4" :description "AsciiDoc parser for Cryogen" :url "-project/cryogen-asciidoc" :license {:name "Eclipse Public License" :url "-v10.html"} :dependencies [[org.clojure/clojure "1.10.1"] [cryogen-core "0.3.2"] [org.asciidoctor/asciidoc...
null
https://raw.githubusercontent.com/cryogen-project/cryogen-asciidoc/3ee7282083c6eef3539c1f09834704fd85650ff1/project.clj
clojure
(defproject cryogen-asciidoc "0.3.4" :description "AsciiDoc parser for Cryogen" :url "-project/cryogen-asciidoc" :license {:name "Eclipse Public License" :url "-v10.html"} :dependencies [[org.clojure/clojure "1.10.1"] [cryogen-core "0.3.2"] [org.asciidoctor/asciidoc...
9df367d5c299bdc2f991ecdb600fc9d43b7974b94adb2f26570561e97fa84504
Dasudian/DSDIN
dsdva_compile.erl
%%%------------------------------------------------------------------- ( C ) 2018 , Dasudian Technologies %%% @doc Compiler for Varna . %%% @end %%% %%%------------------------------------------------------------------- -module(dsdva_compile). -export([format_error/1]). -export([file/1,file/2,string/1,string...
null
https://raw.githubusercontent.com/Dasudian/DSDIN/b27a437d8deecae68613604fffcbb9804a6f1729/apps/dsdvarna/src/dsdva_compile.erl
erlang
------------------------------------------------------------------- @doc @end ------------------------------------------------------------------- Bloody useful Base name Output directory User options Code last pass Errors Warnings Errors. file(Name) -> file(Name, Options) -> Compile the Varna file Name. strin...
( C ) 2018 , Dasudian Technologies Compiler for Varna . -module(dsdva_compile). -export([format_error/1]). -export([file/1,file/2,string/1,string/2,default_options/0]). -import(lists, [member/2]). -define(IF(Test,True,False), case Test of true -> True; false -> False end). -define(DEFAULT_OPTS, [verbose,r...
4b330b02def4008c7ea3f26e9b7e1c12a02ba553583464d8587a0e2b77e0a1b9
mlabs-haskell/bot-plutus-interface
CoinSelection.hs
{-# OPTIONS_GHC -Wno-unused-binds #-} module Spec.BotPlutusInterface.CoinSelection (tests) where import BotPlutusInterface.CoinSelection (selectTxIns, uniqueAssetClasses, valuesToVecs) import BotPlutusInterface.Effects (PABEffect) import BotPlutusInterface.Helpers (addressTxOut, lovelaceValueOf, unsafeToCardanoAddres...
null
https://raw.githubusercontent.com/mlabs-haskell/bot-plutus-interface/a1f1d0ec7112b5ecde5ac31471c1a75b67b9dd9d/test/Spec/BotPlutusInterface/CoinSelection.hs
haskell
# OPTIONS_GHC -Wno-unused-binds #
module Spec.BotPlutusInterface.CoinSelection (tests) where import BotPlutusInterface.CoinSelection (selectTxIns, uniqueAssetClasses, valuesToVecs) import BotPlutusInterface.Effects (PABEffect) import BotPlutusInterface.Helpers (addressTxOut, lovelaceValueOf, unsafeToCardanoAddressInEra, unsafeValueOf) import Cardano....
22c068644308d80ec9043e410101eb40bee530691979d397b9e11217fbb04740
exercism/haskell
Tests.hs
import Control.Monad (unless) import Test.Hspec (Spec, describe, expectationFailure, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import Beer (song) main :: IO () main = hspecWith defaultConfig {configFastFail = True} specs specs :: Spec specs = describe "song" $ do ...
null
https://raw.githubusercontent.com/exercism/haskell/f81ee7dc338294b3dbefb7bd39fc193546fcec26/exercises/practice/beer-song/test/Tests.hs
haskell
First we test the input, line by line, to give more useful error messages. Finally, because testing lines we are unable to detect a missing newline at the end of the lyrics, we test the full song.
import Control.Monad (unless) import Test.Hspec (Spec, describe, expectationFailure, it, shouldBe) import Test.Hspec.Runner (configFastFail, defaultConfig, hspecWith) import Beer (song) main :: IO () main = hspecWith defaultConfig {configFastFail = True} specs specs :: Spec specs = describe "song" $ do ...
762d68f45522e2d0866c8bf7bf65aeeef1d0752ca6c2dc5aaf0c44b8a08d14ba
eeng/shevek
importd.cljs
(ns shevek.pages.dashboards.actions.importd (:require [reagent.core :as r] [shevek.rpc :as rpc] [shevek.i18n :refer [t]] [shevek.components.modal :refer [show-modal close-modal]] [shevek.components.form :refer [input-field]] [shevek.components.shortcuts :ref...
null
https://raw.githubusercontent.com/eeng/shevek/7783b8037303b8dd5f320f35edee3bfbb2b41c02/src/cljs/shevek/pages/dashboards/actions/importd.cljs
clojure
(ns shevek.pages.dashboards.actions.importd (:require [reagent.core :as r] [shevek.rpc :as rpc] [shevek.i18n :refer [t]] [shevek.components.modal :refer [show-modal close-modal]] [shevek.components.form :refer [input-field]] [shevek.components.shortcuts :ref...
8b0a4fa0519af24c9a0cf1dcb265c084de33549e32bd185d6814a0c5b53a5988
smallmelon/sdzmmo
lib_account.erl
%%%-------------------------------------- %%% @Module : lib_account @Author : xyao %%% @Email : @Created : 2010.05.10 %%% @Description:用户账户处理 %%%-------------------------------------- -module(lib_account). -export( [ get_info_by_id/1, get_role_list/1, create_role/6, delete_...
null
https://raw.githubusercontent.com/smallmelon/sdzmmo/254ff430481de474527c0e96202c63fb0d2c29d2/src/lib/lib_account.erl
erlang
-------------------------------------- @Module : lib_account @Email : @Description:用户账户处理 -------------------------------------- 通过帐号名称取得帐号信息 取得指定帐号的角色列表 创建角色 职业 昆仑(战士) 逍遥(法师) 唐门(刺客) 阵营 傲世盟 性别 女 默认参数 送一件武器 NewInfo1 = goods_util:get_new_goods(GoodsTypeInfo1), (catch lib_goods:add_goods(GoodsInfo1)), 送一件衣...
@Author : xyao @Created : 2010.05.10 -module(lib_account). -export( [ get_info_by_id/1, get_role_list/1, create_role/6, delete_role/2 ] ). -include("common.hrl"). -include("record.hrl"). get_info_by_id(Pid) -> db_sql:get_row(io_lib:format(<<"select id, accid, accname, ...
feeade1847ef5fda682251798ee83c74a6a7607a8be2eccabc3ec06c96d731ab
marigold-dev/mankavar
para.ml
module H = Das_helpers let bytes_pp_hex ppf b = b |> Bytes.iter @@ fun c -> let i = Char.code c in Format.fprintf ppf "%x" i ; () let public_key_pp ppf x = Format.fprintf ppf "%a" bytes_pp_hex @@ Sodium.Sign.Bytes.of_public_key x module Signature_request = struct type t = { pk : Sodium.Sign.p...
null
https://raw.githubusercontent.com/marigold-dev/mankavar/080fe6bf77e712408e60195cfc5d2ac3ad3db31e/bench/parallel/.multiple-distributed/para.ml
ocaml
spawn and monitor a process on the remote node separately send messages to the spawned remote processes, using the infix funtion '>!' alias of send process messages that are sent to us
module H = Das_helpers let bytes_pp_hex ppf b = b |> Bytes.iter @@ fun c -> let i = Char.code c in Format.fprintf ppf "%x" i ; () let public_key_pp ppf x = Format.fprintf ppf "%a" bytes_pp_hex @@ Sodium.Sign.Bytes.of_public_key x module Signature_request = struct type t = { pk : Sodium.Sign.p...
7a96ef07daaa08173eb756190b7ef724fdde71c414faa81e7eacfa29809a9f62
mstksg/advent-of-code-2017
Day15.hs
module AOC2017.Day15 (day15a, day15b) where import AOC2017.Types (Challenge) import Data.Char (isDigit) import Data.Function (on) import Data.Word (Word16) generate :: Int -> Int -> Int generate fac = go where go = (`mod` 2147483647) . (* fac) facA, facB :: Int f...
null
https://raw.githubusercontent.com/mstksg/advent-of-code-2017/f9e97680726e87be175cf423241da3048ef6564d/src/AOC2017/Day15.hs
haskell
module AOC2017.Day15 (day15a, day15b) where import AOC2017.Types (Challenge) import Data.Char (isDigit) import Data.Function (on) import Data.Word (Word16) generate :: Int -> Int -> Int generate fac = go where go = (`mod` 2147483647) . (* fac) facA, facB :: Int f...
156ea697d09fc7e7f5bb633048ebfa2a2e04d2dbdb5048f525e857195fbc319c
jscrane/jvml
test_ex7.clj
(ns ml.test-ex7 (:use (clojure test) (incanter core) [ml.ex7 :only (init-ex7)] [ml.util :only (feature-normalize)] (ml matlab kmeans pca testutil))) (deftest test-find-closest-centroids (let [{:keys [centroids X]} (init-ex7)] (is (= 0 (find-closest-centroid centroids [1.8421 4.6...
null
https://raw.githubusercontent.com/jscrane/jvml/844eb267150564a3a0f882edbbd505ce94924c8f/test/ml/test_ex7.clj
clojure
(ns ml.test-ex7 (:use (clojure test) (incanter core) [ml.ex7 :only (init-ex7)] [ml.util :only (feature-normalize)] (ml matlab kmeans pca testutil))) (deftest test-find-closest-centroids (let [{:keys [centroids X]} (init-ex7)] (is (= 0 (find-closest-centroid centroids [1.8421 4.6...
b32e7978e9edb249146f7b4d124833b64b55885edfc05fc84a3e00cc6b22d374
stanfordhaskell/cs43
Main.hs
module Main where import Data.List import Data.Ord import Data.Semigroup import qualified Data.List.NonEmpty as NE import Data.Coerce main :: IO () main = do putStrLn "hello world" ----------------------- -- background ----------------------- - review of algebraic data types data Typename a b c = Constructor...
null
https://raw.githubusercontent.com/stanfordhaskell/cs43/8353da9e27336a7fe23488c3536e0dab4aaabfff/lecture-code/week4/monoids/src/Main.hs
haskell
--------------------- background --------------------- docs example Maybe customary Typename = Constructor docs examples Any , Sum docs example Maybe customary Typename = Constructor docs examples Any, Sum } show docs > ( coerce $ Any True ) : : > ( coerce True ) : : Any > ( coerce not : : Any - > Any...
module Main where import Data.List import Data.Ord import Data.Semigroup import qualified Data.List.NonEmpty as NE import Data.Coerce main :: IO () main = do putStrLn "hello world" - review of algebraic data types data Typename a b c = Constructor | Constructor Type Type ... ...
7acfcf08859e0e923db1239cbd6402ea4257d4fcf5ebcabe2bf8044450a0a6d4
echeran/clj-thamil
project.clj
(defproject turtle-thamil "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "" :license {:name "Eclipse Public License" :url "-v10.html"} :dependencies [[org.clojure/clojure "1.7.0"] [clj-thamil "0.1.2"] [com.google/clojure-turtle "0.2.0"]])
null
https://raw.githubusercontent.com/echeran/clj-thamil/692a6d94329bb14cb58fb39b875792e5d774d2c4/examples/clj/turtle-thamil/project.clj
clojure
(defproject turtle-thamil "0.1.0-SNAPSHOT" :description "FIXME: write description" :url "" :license {:name "Eclipse Public License" :url "-v10.html"} :dependencies [[org.clojure/clojure "1.7.0"] [clj-thamil "0.1.2"] [com.google/clojure-turtle "0.2.0"]])
db0ef0e0748655eaddd211ca3b8c8add371377908e51e21f6fd2c26a01b31340
samrocketman/home
slice-and-join.scm
Studio Tecnico Arch . via Roma , 28 72026 - San Pancrazio Salentino ( BR ) - Italy ; ; Plugin : slice-and-join.scm Author : Arch . Date : 03 marzo 2009 - San Pancrazio Salentino ( BR ) Revision : 04 marzo 2009 - 20 marzo 2009 ; Version : 1.0 ; Last version at: / ; Help guide at : -slice-and-j...
null
https://raw.githubusercontent.com/samrocketman/home/63a8668a71dc594ea9ed76ec56bf8ca43b2a86ca/dotfiles/.gimp/scripts/slice-and-join.scm
scheme
Plugin : slice-and-join.scm Last version at: / Help guide at : -slice-and-join.htm Description: Slice: subdivide the active image in M x N Rows and Columns and save any rectangular portion in the new files. Slice save into file *.rcm all the data necessary in order to reconstruct the image Join: read da...
Studio Tecnico Arch . via Roma , 28 72026 - San Pancrazio Salentino ( BR ) - Italy Author : Arch . Date : 03 marzo 2009 - San Pancrazio Salentino ( BR ) Revision : 04 marzo 2009 - 20 marzo 2009 Version : 1.0 row 1 : " ATGrcm " row 2 : imageWidth row 3 : imageHeight row 4 : n...
4368f26bd04589b86c708f2a684b50c4b292bbb059d663fddd290d5d4a7aac50
psibi/shell-conduit
Streaming.hs
import Data.Conduit.Shell main = run (do tail' "/tmp/example.txt" "-f" $| grep "--line-buffered" "Hello")
null
https://raw.githubusercontent.com/psibi/shell-conduit/ac93851967d3f3099fdbafa9f5bdb4b990537f06/examples/Streaming.hs
haskell
import Data.Conduit.Shell main = run (do tail' "/tmp/example.txt" "-f" $| grep "--line-buffered" "Hello")
b7680615a6664a470c23229c0cb94be9a6a3b6dde11b56752c2ca3cd89f1bb19
originrose/cortex
train.clj
(ns cortex.verify.nn.train (:require [clojure.test :refer :all] [clojure.pprint :as pprint] [clojure.core.matrix :as m] [think.resource.core :as resource] [cortex.loss.core :as loss] [cortex.loss.softmax :as softmax] [cortex.optimize :as opt] ...
null
https://raw.githubusercontent.com/originrose/cortex/94b1430538e6187f3dfd1697c36ff2c62b475901/src/cortex/verify/nn/train.clj
clojure
for the creation of the main cuda and cudnn contexts if necessary. This also does all the dynamic compilation required thus making the loop below a bit tighter. Without the outer resource context and initial backend creation, each of the train/run functions below is rebuilding the entire cuda context which includes co...
(ns cortex.verify.nn.train (:require [clojure.test :refer :all] [clojure.pprint :as pprint] [clojure.core.matrix :as m] [think.resource.core :as resource] [cortex.loss.core :as loss] [cortex.loss.softmax :as softmax] [cortex.optimize :as opt] ...
edbf3b92f23ca568863e604103abf970bb4fd65f28679cbc5623555ce107bfe7
cyppan/grape
default_sort_test.clj
(ns grape.hooks.default-sort-test)
null
https://raw.githubusercontent.com/cyppan/grape/62488a335542fc58fc9126b8d5ff7fccdd16f1d7/test/grape/hooks/default_sort_test.clj
clojure
(ns grape.hooks.default-sort-test)
db22e24ba16bd3e90d16f061da2bd2298aa99f4c1b01266bd441eb1af7a368ee
alex-hhh/ActivityLog2
esc-controls.rkt
#lang racket/base ;; This file is part of ActivityLog2, an fitness activity tracker Copyright ( C ) 2018 , 2019 , 2020 < > ;; ;; This program is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation , either versio...
null
https://raw.githubusercontent.com/alex-hhh/ActivityLog2/36a4bb8af45db19cea02e982e22379acb18d0c49/rkt/widgets/esc-controls.rkt
racket
This file is part of ActivityLog2, an fitness activity tracker This program is free software: you can redistribute it and/or modify it any later version. This program is distributed in the hope that it will be useful, but WITHOUT without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR P...
#lang racket/base Copyright ( C ) 2018 , 2019 , 2020 < > under the terms of the GNU General Public License as published by the Free Software Foundation , either version 3 of the License , or ( at your option ) (require racket/class racket/draw) (provide esc-button% esc-slider% esc...
4b0ed4dc6be07baeea9dd9081fedeb6ea80809d93e001290d696f6dedb9fd37b
janestreet/command_rpc
heartbeat_pipe_rpc_intf.ml
open! Core open! Async module type S = Command_rpc.Command.T_pipe_conv with type query = int and type response = int and type error = Error.t module type Heartbeat_pipe_rpc = sig module type S = S val server : min_version:int -> max_version:int -> (module S) val client : version:int -> (int, int, Err...
null
https://raw.githubusercontent.com/janestreet/command_rpc/3d495b60083b76d9859b6fe4df899b35896ef009/test/protocol/heartbeat_pipe_rpc_intf.ml
ocaml
open! Core open! Async module type S = Command_rpc.Command.T_pipe_conv with type query = int and type response = int and type error = Error.t module type Heartbeat_pipe_rpc = sig module type S = S val server : min_version:int -> max_version:int -> (module S) val client : version:int -> (int, int, Err...
4ccaa18e088aef45c3081140dc85cc14f0ba61ac2647ada4382aa609a26bce50
esl/MongooseIM
keystore_SUITE.erl
-module(keystore_SUITE). -include_lib("eunit/include/eunit.hrl"). -compile([export_all, nowarn_export_all]). -import(config_parser_helper, [default_mod_config/1, mod_config/2]). -define(ae(Expected, Actual), ?assertEqual(Expected, Actual)). all() -> [ module_startup_no_opts, module_startup_read_key_from...
null
https://raw.githubusercontent.com/esl/MongooseIM/7b91117c0ec1018e3f847da9cfabdd89c50d358b/test/keystore_SUITE.erl
erlang
Tests given when then then we can access the key then given no key when keystore starts with config to generate a memory-only key given when then given when then Helpers Use a function like this in your module which is a client of mod_keystore.
-module(keystore_SUITE). -include_lib("eunit/include/eunit.hrl"). -compile([export_all, nowarn_export_all]). -import(config_parser_helper, [default_mod_config/1, mod_config/2]). -define(ae(Expected, Actual), ?assertEqual(Expected, Actual)). all() -> [ module_startup_no_opts, module_startup_read_key_from...
2fb536092407fce8ec12a259451ff7c83f9d4c3421e181b662093ead92edd71d
tsloughter/kuberl
kuberl_storage_v1_api.erl
-module(kuberl_storage_v1_api). -export([create_storage_class/2, create_storage_class/3, delete_collection_storage_class/1, delete_collection_storage_class/2, delete_storage_class/3, delete_storage_class/4, get_api_resources/1, get_api_resources/2, list_storage_class/1, list_storage...
null
https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_storage_v1_api.erl
erlang
@doc @doc @doc @doc get available resources @doc @doc @doc @doc
-module(kuberl_storage_v1_api). -export([create_storage_class/2, create_storage_class/3, delete_collection_storage_class/1, delete_collection_storage_class/2, delete_storage_class/3, delete_storage_class/4, get_api_resources/1, get_api_resources/2, list_storage_class/1, list_storage...
3d5a7d51d24b5aea61ffda323a4cdf0085da8a65cd8f88855c5b5adb04806b6a
Idorobots/spartan
closures.rkt
#lang racket ;; Closure conversion (require "../testing.rkt") (require "../../src/compiler/ast.rkt") (require "../../src/compiler/substitute.rkt") (require "../../src/compiler/utils/gensym.rkt") (require "../../src/compiler/utils/utils.rkt") (require "../../src/compiler/utils/set.rkt") (require "../../src/compiler/pa...
null
https://raw.githubusercontent.com/Idorobots/spartan/ef3b032906655585d284f1c9a33a58f1e35cb180/test/compiler/closures.rkt
racket
Closure conversion NOTE The order of the offsets is unpredictable as well. NOTE The order of the consed values is unpredictable. NOTE The order of these is unpredictable.
#lang racket (require "../testing.rkt") (require "../../src/compiler/ast.rkt") (require "../../src/compiler/substitute.rkt") (require "../../src/compiler/utils/gensym.rkt") (require "../../src/compiler/utils/utils.rkt") (require "../../src/compiler/utils/set.rkt") (require "../../src/compiler/passes/closures.rkt") (...
56f7e1367d154ac3f289fd3301913b80e7cee967354bf2ff30da046e56f793dd
jeapostrophe/mode-lambda
2d-hash.rkt
#lang racket/base (require racket/math racket/contract/base) (struct 2d-hash (xbs xdiv ybs ydiv vec)) (define (log2 x) (inexact->exact (ceiling (/ (log x) (log 2))))) (define (make-2d-hash w h) (define x-buckets (* 4 (log2 w))) (define y-buckets (* 4 (log2 h))) (define xdiv (ceiling (/ w x-buckets))...
null
https://raw.githubusercontent.com/jeapostrophe/mode-lambda/64b5ae81f457ded7664458cd9935ce7d3ebfc449/mode-lambda/backend/software/2d-hash.rkt
racket
#lang racket/base (require racket/math racket/contract/base) (struct 2d-hash (xbs xdiv ybs ydiv vec)) (define (log2 x) (inexact->exact (ceiling (/ (log x) (log 2))))) (define (make-2d-hash w h) (define x-buckets (* 4 (log2 w))) (define y-buckets (* 4 (log2 h))) (define xdiv (ceiling (/ w x-buckets))...
415928d448afc37160d1220449642ab903f144ff5674505c5b4c8e1c3d5d3d7b
practicalli/covid19-dashboard
vega_lite_views.clj
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; ;; Vega-lite components ;; Named components generating the vega-lite specification ;; ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; (ns practicalli.vega-lite-views (:require [practicalli.data-gov-uk-depricated :as data-gov-uk-depricated])) ;; Line plot chart ;;;;;;;;;;;;...
null
https://raw.githubusercontent.com/practicalli/covid19-dashboard/0d3cd5d7958881268620beaf05722c5b20f8f3dd/src/practicalli/vega_lite_views.clj
clojure
Vega-lite components Named components generating the vega-lite specification Line plot chart TODO: change to function Stacked bar chart TODO: change to function GeoJSON view
(ns practicalli.vega-lite-views (:require [practicalli.data-gov-uk-depricated :as data-gov-uk-depricated])) (def line-plot-uk-countries-cumulative-cases "Transform data for visualization" {:height 400 :width 400 :mark "line" :data {:values data-gov-uk-depricated/covid19-uk-countries...
7c844c65b28bb7af64532c6fdc931205c5f8e9bce5d2dede71f5bd7741849c2f
2garryn/esli
esli_admin.erl
-module(esli_admin). -export([start_link/2,count_url_per_date/2,remove_last_month/1]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). -record(state, {pid}). -include("esli.hrl"). 30 days -define(REQUEST_TIMEOUT, 30000). %%% ----------------------------------------------...
null
https://raw.githubusercontent.com/2garryn/esli/6e48337b066bb230813317dcda613993c2929684/apps/esli/src/esli_admin.erl
erlang
-------------------------------------------------------- External API -------------------------------------------------------- -------------------------------------------------------- Callbacks --------------------------------------------------------
-module(esli_admin). -export([start_link/2,count_url_per_date/2,remove_last_month/1]). -export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]). -record(state, {pid}). -include("esli.hrl"). 30 days -define(REQUEST_TIMEOUT, 30000). start_link(Host, Port) -> gen_server:start_l...
9de3a919ee099a4f50ae93700080ec8b5c76e6d1e9246c89779f5ec2d9e74937
TerrorJack/ghc-alter
readFloat.hs
import Numeric main :: IO () main = putStrLn $ showFloat (read "" :: Float) ""
null
https://raw.githubusercontent.com/TerrorJack/ghc-alter/db736f34095eef416b7e077f9b26fc03aa78c311/ghc-alter/boot-lib/base/tests/readFloat.hs
haskell
import Numeric main :: IO () main = putStrLn $ showFloat (read "" :: Float) ""
b1c02e5e6883ec327b67ac3255380f5b9a5df214b337b549fbf3f11cbd6aa102
rtoy/cmucl
proclaim.lisp
;;; -*- Package: C; Log: C.Log -*- ;;; ;;; ********************************************************************** This code was written as part of the CMU Common Lisp project at Carnegie Mellon University , and has been placed in the public domain . ;;; (ext:file-comment "$Header: src/compiler/proclaim.lisp $") ;...
null
https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/compiler/proclaim.lisp
lisp
-*- Package: C; Log: C.Log -*- ********************************************************************** ********************************************************************** This file contains load-time support for declaration processing. It is split off from the compiler so that the compiler doesn'thave to...
This code was written as part of the CMU Common Lisp project at Carnegie Mellon University , and has been placed in the public domain . (ext:file-comment "$Header: src/compiler/proclaim.lisp $") Written by (in-package "C") (intl:textdomain "cmucl") (in-package "EXTENSIONS") (export '(inhibit-warnings freeze-...
1cad88316c69e1912dae5b09254d8c19e9b728cdb8209a77808cc62e6ad699ad
anwarmamat/cmsc330spring19-public
regexp.mli
IMPORTANT : YOU MAY NOT MODIFY THIS FILE ! * OUR TESTS USE THE ORIGINAL VERSION . * YOUR CODE WILL NOT COMPILE IF YOU CHANGE THIS FILE . * OUR TESTS USE THE ORIGINAL VERSION. * YOUR CODE WILL NOT COMPILE IF YOU CHANGE THIS FILE. *) (* This is the type used to describe the form of a regexp *) type regexp_t =...
null
https://raw.githubusercontent.com/anwarmamat/cmsc330spring19-public/98af1e8efc3d8756972731eaca19e55fe8febb69/project4/src/regexp.mli
ocaml
This is the type used to describe the form of a regexp These are the regexp functions you must implement
IMPORTANT : YOU MAY NOT MODIFY THIS FILE ! * OUR TESTS USE THE ORIGINAL VERSION . * YOUR CODE WILL NOT COMPILE IF YOU CHANGE THIS FILE . * OUR TESTS USE THE ORIGINAL VERSION. * YOUR CODE WILL NOT COMPILE IF YOU CHANGE THIS FILE. *) type regexp_t = | Empty_String | Char of char | Union of regexp_t * re...
662684b9e3146b954448a4bba4ec841af0fe0bc903c76e739332afb3bfe2d8f8
rd--/hsc3
delay1.help.hs
-- delay1 let s = impulse ar 1 0 * 0.25 in s + (delay1 s) -- delay1 ; left=original, right=subtract delayed from original let z = dustId 'α' ar 1000 * 0.1 in mce2 z (z - delay1 z)
null
https://raw.githubusercontent.com/rd--/hsc3/60cb422f0e2049f00b7e15076b2667b85ad8f638/Help/Ugen/delay1.help.hs
haskell
delay1 delay1 ; left=original, right=subtract delayed from original
let s = impulse ar 1 0 * 0.25 in s + (delay1 s) let z = dustId 'α' ar 1000 * 0.1 in mce2 z (z - delay1 z)
3003869ffd7ef8101cbafcfa9a0df8d66159ee1742f9db6c750bea1b86daab20
SparkFund/spec-tacular
generators.clj
(ns spark.spec-tacular.generators "Provides generators to be used in conjunction with [clojure.test.check.generators]()" (:refer-clojure :exclude [assoc!]) (:use spark.spec-tacular [spark.spec-tacular.datomic :exclude [db]]) (:require [datomic.api :as db] [spark.spec-tacular.schema :as sch...
null
https://raw.githubusercontent.com/SparkFund/spec-tacular/2ddeaa0a33593a5e71f377368ded4701fa223e20/src/spark/spec_tacular/generators.clj
clojure
distinct works for primitives but not for spec instances for some reason hijack use-pre? to stop infinite recursion
(ns spark.spec-tacular.generators "Provides generators to be used in conjunction with [clojure.test.check.generators]()" (:refer-clojure :exclude [assoc!]) (:use spark.spec-tacular [spark.spec-tacular.datomic :exclude [db]]) (:require [datomic.api :as db] [spark.spec-tacular.schema :as sch...
3a7052018c522b6142440d5beac2733aa1a41743ac69b5da7f306a0e3da54cc1
maximedenes/native-coq
type_errors.mli
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/checker/type_errors.mli
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** i i Type errors. \label{typeerrors}...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * open Names open Term open Env...
26a775e14335de75271b9161cc4c18a6204edf5e4f0d701832864a0cbf20a3c8
jaked/orpc
gen_js_comet_srv.ml
* This file is part of orpc , OCaml signature to ONC RPC generator * Copyright ( C ) 2008 - 9 Skydeck , Inc * Copyright ( C ) 2010 * * This program is free software ; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software F...
null
https://raw.githubusercontent.com/jaked/orpc/ecb5df8ec928070cd89cf035167fcedf3623ee3c/src/generator/gen_js_comet_srv.ml
ocaml
* This file is part of orpc , OCaml signature to ONC RPC generator * Copyright ( C ) 2008 - 9 Skydeck , Inc * Copyright ( C ) 2010 * * This program is free software ; you can redistribute it and/or * modify it under the terms of the GNU General Public License as * published by the Free Software F...
cdf8af3aee7b02f8a78a15925a6ea732838a4570a95b00320e0460fced449d21
Nick-Chapman/niz
tracing.ml
open Core open Numbers type step = | Decode of int * Loc.t * Instruction.t [@@deriving sexp_of] let decode ~stepnum loc i = Decode (stepnum,loc,i) let program_counter (Decode (_,pc,_)) = pc let display ~print step = print (String.tr ~target:'\n' ~replacement:' ' (Sexp.to_string_hum (sexp_of_step step)))
null
https://raw.githubusercontent.com/Nick-Chapman/niz/603a437ace7c6babcb08648a98c6ace099e99216/lib/tracing.ml
ocaml
open Core open Numbers type step = | Decode of int * Loc.t * Instruction.t [@@deriving sexp_of] let decode ~stepnum loc i = Decode (stepnum,loc,i) let program_counter (Decode (_,pc,_)) = pc let display ~print step = print (String.tr ~target:'\n' ~replacement:' ' (Sexp.to_string_hum (sexp_of_step step)))
216573e8d5d52eb16220dbcd5274734bcba66845edbd805479f1e5112948ca17
anwarmamat/cmsc330spring21
basics.ml
(***********************************) (* Part 1: Non-Recursive Functions *) (***********************************) let rev_tup tup = failwith "unimplemented" let abs x = failwith "unimplemented" let area x y = failwith "unimplemented" let volume x y = failwith "unimplemented" (*******************************) (* Pa...
null
https://raw.githubusercontent.com/anwarmamat/cmsc330spring21/071cb1aab3af77e7d103865d05f27f5c78bed6ef/project2a/src/basics.ml
ocaml
********************************* Part 1: Non-Recursive Functions ********************************* ***************************** Part 2: Recursive Functions ***************************** *************** ***************
let rev_tup tup = failwith "unimplemented" let abs x = failwith "unimplemented" let area x y = failwith "unimplemented" let volume x y = failwith "unimplemented" let rec fibonacci n = failwith "unimplemented" let rec pow x y = failwith "unimplemented" let rec log x y = failwith "unimplemented" let rec is_prime...
a4290af7e5d078bc8ff8c11d854b21916d588a10acae1ec4397ba88d47010d4e
craigl64/clim-ccl
clim-defs.lisp
-*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Package : CLIM - INTERNALS ; Base : 10 ; Lowercase : Yes -*- ;; See the file LICENSE for the full license governing this code. ;; (in-package :clim-internals) " Copyright ( c ) 1990 , 1991 , 1992 Symbolics , Inc. All rights reserved . Portions copyright ( c ) 19...
null
https://raw.githubusercontent.com/craigl64/clim-ccl/301efbd770745b429f2b00b4e8ca6624de9d9ea9/clim/clim-defs.lisp
lisp
Syntax : ANSI - Common - Lisp ; Package : CLIM - INTERNALS ; Base : 10 ; Lowercase : Yes -*- See the file LICENSE for the full license governing this code. POSITIONS is a list of pairs of numbers. No assumptions are made about the types of the numbers. Destructive version of the above eval-when recording streams...
(in-package :clim-internals) " Copyright ( c ) 1990 , 1991 , 1992 Symbolics , Inc. All rights reserved . Portions copyright ( c ) 1988 , 1989 , 1990 International Lisp Associates . " (defmacro translate-positions (x-delta y-delta &body positions) (once-only (x-delta y-delta) `(progn ,@(let ((forms n...