_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 |
|---|---|---|---|---|---|---|---|---|
4300a760b048ba9bb07614e988644e0b2b05dc0d22806712701682caf8eb5832 | Kappa-Dev/KappaTools | locality.mli | (******************************************************************************)
(* _ __ * The Kappa Language *)
| |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
(* | ' / ********************************************************************... | null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/777835b82f449d3d379713df76ff25fd5926b762/core/dataStructures/locality.mli | ocaml | ****************************************************************************
_ __ * The Kappa Language
| ' / ********************************************************************
| . \ * This file is distributed under the terms of the
|_|\_\ * GN... | | |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
type position = { chr: int; line: int }
type range = {
file : string ;
from_position: position;
to_position: position
}
type t = range
type 'a annot = 'a * t
type 'a maybe = ?pos:t -> 'a
val of_pos : Lexing.position -> Lexing.posit... |
cdff4164c0890cce4462ddf5b9c9ce2c242c715575e449ed78eb520035fa014c | ocaml-ppx/ppx_tools_versioned | ast_lifter_402.ml | open Migrate_parsetree.Ast_402
class virtual ['res] lifter =
object (this)
method lift_Parsetree_expression : Parsetree.expression -> 'res=
(fun
{ Parsetree.pexp_desc = pexp_desc; Parsetree.pexp_loc = pexp_loc;
Parsetree.pexp_attributes = pexp_attributes }
->
this#rec... | null | https://raw.githubusercontent.com/ocaml-ppx/ppx_tools_versioned/00a0150cdabfa7f0dad2c5e0e6b32230d22295ca/ast_lifter_402.ml | ocaml | open Migrate_parsetree.Ast_402
class virtual ['res] lifter =
object (this)
method lift_Parsetree_expression : Parsetree.expression -> 'res=
(fun
{ Parsetree.pexp_desc = pexp_desc; Parsetree.pexp_loc = pexp_loc;
Parsetree.pexp_attributes = pexp_attributes }
->
this#rec... | |
300721f8379f57bcced200fb7fa61d8a0f8737627439fb08b1ca066d5a597966 | peak6/mmd_core | mmd_app_load.erl | -module(mmd_app_load).
-include("mmd.hrl").
-behaviour(gen_server).
-export([start_link/0]).
-export([get/2]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-define(SERVER,?MODULE).
-define(DMAP,app_load_map).
get(Node,App) ->
case p6dmap:g... | null | https://raw.githubusercontent.com/peak6/mmd_core/f90469ea9eac8cd607aa6ec5b9ad6ff003a35572/src/mmd_app_load.erl | erlang | gen_server callbacks | -module(mmd_app_load).
-include("mmd.hrl").
-behaviour(gen_server).
-export([start_link/0]).
-export([get/2]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-define(SERVER,?MODULE).
-define(DMAP,app_load_map).
get(Node,App) ->
case p6dmap:getForNode(?DMAP,Node,lc(... |
8efba3979e0c21263ead64166896ce420200a229ff6bc6c4a7c615dab0f2ae37 | Opetushallitus/ataru | hyvaksynnan_ehto_xforms.cljs | (ns ataru.virkailija.application.hyvaksynnan-ehto.hyvaksynnan-ehto-xforms)
(defn filter-hyvaksynnan-ehdot-for-correct-hakukohde [hakukohde-oids]
(filter (fn [[hakukohde-oid]]
(some #{hakukohde-oid} hakukohde-oids))))
(defn filter-hyvaksynnan-ehdot-for-hakukohteet []
(filter (fn [[_ hyvaksynnan-ehto]]
... | null | https://raw.githubusercontent.com/Opetushallitus/ataru/2d8ef1d3f972621e301a3818567d4e11219d2e82/src/cljs/ataru/virkailija/application/hyvaksynnan_ehto/hyvaksynnan_ehto_xforms.cljs | clojure | (ns ataru.virkailija.application.hyvaksynnan-ehto.hyvaksynnan-ehto-xforms)
(defn filter-hyvaksynnan-ehdot-for-correct-hakukohde [hakukohde-oids]
(filter (fn [[hakukohde-oid]]
(some #{hakukohde-oid} hakukohde-oids))))
(defn filter-hyvaksynnan-ehdot-for-hakukohteet []
(filter (fn [[_ hyvaksynnan-ehto]]
... | |
095826d9c79a1cf1e2eed2c76fcefb206a05a3924b346cfd9e6b4942adf74697 | AccelerationNet/buildnode | excel.lisp | (in-package :net.acceleration.buildnode)
(eval-when (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE)
(asdf:oos 'asdf:load-op 'buildnode-excel))
(defun simple-excel-test ( &optional file)
(let ((doc (excel:with-excel-workbook () ;; declare a new excel workbook type document
;; add a single worksheet
(ss... | null | https://raw.githubusercontent.com/AccelerationNet/buildnode/c614ead94d00795c1a862f344d45aef52e568e2b/examples/excel.lisp | lisp | declare a new excel workbook type document
add a single worksheet | (in-package :net.acceleration.buildnode)
(eval-when (:COMPILE-TOPLEVEL :LOAD-TOPLEVEL :EXECUTE)
(asdf:oos 'asdf:load-op 'buildnode-excel))
(defun simple-excel-test ( &optional file)
(ss:worksheet `("ss:Name" "First WorkSheet")
(ss:table ()
(ss:row ()
(set-attribute
(ss:string-cell "PA... |
e908db5a8a78fa0ddf2d5f007b3dc5d42f83fd9b423c93ec0f33973ea1627163 | JacquesCarette/Drasil | Assumptions.hs | # LANGUAGE PostfixOperators #
module Drasil.NoPCM.Assumptions where --all of this file is exported
import Language.Drasil
import Language.Drasil.Chunk.Concept.NamedCombinators
import qualified Language.Drasil.NounPhrase.Combinators as NP
import qualified Language.Drasil.Sentence.Combinators as S
import Data.Drasil.Co... | null | https://raw.githubusercontent.com/JacquesCarette/Drasil/a1c22b739c958ae169e8fe4fb2ea2b0a670dc7df/code/drasil-example/nopcm/lib/Drasil/NoPCM/Assumptions.hs | haskell | all of this file is exported
-----------------------
----------------------- | # LANGUAGE PostfixOperators #
import Language.Drasil
import Language.Drasil.Chunk.Concept.NamedCombinators
import qualified Language.Drasil.NounPhrase.Combinators as NP
import qualified Language.Drasil.Sentence.Combinators as S
import Data.Drasil.Concepts.Documentation (model, assumpDom, material_)
import Data.Drasi... |
8cd2697d420b769ab8b533c054916cc314703ba8ea7bf6a5a9ff8686c20c2602 | nfrisby/coxswain | T14.hs | -- Inference that definitely involves a restriction skolem, with
nested givens via a GADT pattern .
# LANGUAGE DataKinds #
{-# OPTIONS_GHC -fconstraint-solver-iterations=10 #-}
import Coxswain
import Data.Proxy (Proxy(Proxy))
import Data.Type.Equality
f :: (Lacks p 0,Lacks q 1,(p .& 0 .= ()) ~ (q .& 1 .= ())) => ... | null | https://raw.githubusercontent.com/nfrisby/coxswain/bfd5777964a5b4ba64e1bcc4cf18df1c9d8fc558/coxswain/test/well-typed/T14.hs | haskell | Inference that definitely involves a restriction skolem, with
# OPTIONS_GHC -fconstraint-solver-iterations=10 # | nested givens via a GADT pattern .
# LANGUAGE DataKinds #
import Coxswain
import Data.Proxy (Proxy(Proxy))
import Data.Type.Equality
f :: (Lacks p 0,Lacks q 1,(p .& 0 .= ()) ~ (q .& 1 .= ())) => Proxy p -> Proxy q -> z :~: y -> ()
f _ _ Refl = ()
g x y = f x y
|
72400fd511abe035f5d4f3b6b01255b55c71a80882b8ffcc9540952b9b26893c | dto/cypress | enemy.lisp | (in-package :cypress)
(defparameter *attack-hint*
"Double-click enemy to attack.
Press Spacebar to pause action,
or right-click Geoffrey.")
(defresource "creep-1.wav" :volume 10)
(defresource "creep-2.wav" :volume 10)
(defresource "creep-3.wav" :volume 10)
(defresource "groar.wav" :volume 20)
(defresource "grak.wav"... | null | https://raw.githubusercontent.com/dto/cypress/c33c26f8bf470dbd74b14ed5afa2cbf25aea0ca6/enemy.lisp | lisp | (defmethod encountered ((enemy enemy))
(field-value :encountered enemy))
(defmethod end-encounter ((enemy enemy))
(defmethod encounter-hint ((enemy enemy))
"The ~A draws near!"
(find-description enemy)))
(defmethod begin-encounter ((enemy enemy))
(pause)
(show-hint (encounter-hint enemy) :f... | (in-package :cypress)
(defparameter *attack-hint*
"Double-click enemy to attack.
Press Spacebar to pause action,
or right-click Geoffrey.")
(defresource "creep-1.wav" :volume 10)
(defresource "creep-2.wav" :volume 10)
(defresource "creep-3.wav" :volume 10)
(defresource "groar.wav" :volume 20)
(defresource "grak.wav"... |
9da5e839350b49356e1b71300392bbb2adf29eafabe713331c1934945b15744a | boris-ci/boris | Error.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - name - shadowing #
module Boris.Http.Template.Page.Error where
import qualified Projector.Html.Runtime
import Boris.Http.Template.Data.Build.Data
import Boris.Http.Template.Data.C... | null | https://raw.githubusercontent.com/boris-ci/boris/c321187490afc889bf281442ac4ef9398b77b200/boris-http/gen/Boris/Http/Template/Page/Error.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - name - shadowing #
module Boris.Http.Template.Page.Error where
import qualified Projector.Html.Runtime
import Boris.Http.Template.Data.Build.Data
import Boris.Http.Template.Data.Commit.Data
import Boris.Http.Templa... |
443590b517aac44fd92446efd02559f6ab3cdd9c0290367ff2814797ef23ede3 | fpco/inline-c | Dummy.hs | | This module exists because of TH staging restrictions .
module Dummy (dummyFun) where
import Foreign.C.Types
dummyFun :: CDouble -> IO CDouble
dummyFun x = return $ cos x
| null | https://raw.githubusercontent.com/fpco/inline-c/b37b60f1712b12b43c86493cafb9ac324443d22e/inline-c/test/Dummy.hs | haskell | | This module exists because of TH staging restrictions .
module Dummy (dummyFun) where
import Foreign.C.Types
dummyFun :: CDouble -> IO CDouble
dummyFun x = return $ cos x
| |
f3f1e2db6c0a31a3d4fe713ee60b6842e9c7e9c6a497dca81e9101592e64528f | adamwalker/sdr-apps | record.hs | # LANGUAGE RecordWildCards #
module Main where
import Control.Monad.Trans.Except
import System.IO
import Data.Word
import Data.Complex
import Foreign.C.Types
import Data.Monoid
import Control.Error.Util
import Foreign.Storable.Complex
import Options.Applicative
import Pipes as P
import Pipes.Prelude as P
import Data.... | null | https://raw.githubusercontent.com/adamwalker/sdr-apps/b44b9cac4f0ab857d5889141d94ae15aa3025896/record/record.hs | haskell | # LANGUAGE RecordWildCards #
module Main where
import Control.Monad.Trans.Except
import System.IO
import Data.Word
import Data.Complex
import Foreign.C.Types
import Data.Monoid
import Control.Error.Util
import Foreign.Storable.Complex
import Options.Applicative
import Pipes as P
import Pipes.Prelude as P
import Data.... | |
d494c67db37136c4ff389f988c63c96b537b2a17da7539e9e67c201d3b5f85c8 | herd/herdtools7 | switch.ml | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/7fdc531ef06aab2ba8c0a28df77d49c7a131b31f/litmus/switch.ml | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2013 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
c67fb393319ef4b9b5e1232e3e9e4ecffac91cbd29a2839aa9fa6fa989643dd9 | huangz1990/SICP-answers | 35-count-leaves-using-length.scm | 35-count-leaves-using-length.scm
(load "28-fringe.scm")
(define (count-leaves tree)
(length (fringe tree)))
| null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp2/code/35-count-leaves-using-length.scm | scheme | 35-count-leaves-using-length.scm
(load "28-fringe.scm")
(define (count-leaves tree)
(length (fringe tree)))
| |
2bb9581a725c169314680a42e51338849b1f955e28acb3d5310acf6204e3e34b | agda/agda | Benchmarking.hs | # OPTIONS_GHC -fno - warn - orphans #
-- | Agda-specific benchmarking structure.
module Agda.Benchmarking where
import Control.DeepSeq
import qualified Control.Exception as E
import Data.IORef
import GHC.Generics (Generic)
import System.IO.Unsafe
import Agda.Syntax.Concrete.Pretty () --instance only
import Agda.... | null | https://raw.githubusercontent.com/agda/agda/c859b5e8737a006b559723a1048bba10806bda2d/src/full/Agda/Benchmarking.hs | haskell | | Agda-specific benchmarking structure.
instance only
| Phases to allocate CPU time to.
^ Happy parsing and operator parsing.
^ Import chasing.
^ Reading interface files.
^ Scope checking and translation to abstract syntax.
^ Type checking and translation to internal syntax.
^ Termination checking.
^ Positivit... | # OPTIONS_GHC -fno - warn - orphans #
module Agda.Benchmarking where
import Control.DeepSeq
import qualified Control.Exception as E
import Data.IORef
import GHC.Generics (Generic)
import System.IO.Unsafe
import Agda.Syntax.Abstract.Name
import Agda.Syntax.TopLevelModuleName (TopLevelModuleName)
import Agda.Utils... |
490afcffb3a5a144e9fb7dfec9fac002d717964818bb70f7389b170615f9892f | TaktInc/freer | Core.hs | # LANGUAGE NoMonomorphismRestriction #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE GADTs #-}
# LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
# LANGUAGE DeriveFunctor #
# LANGUAGE CPP #
module Main where
#if __GLASGOW_HASKELL__ <= 708
import Control.Applicative
import qualified Control... | null | https://raw.githubusercontent.com/TaktInc/freer/b1e4911832ad12ef0b9b23883548dcf44ea3bd59/bench/Core.hs | haskell | # LANGUAGE GADTs #
------------------------------------------------------------------------------
State Benchmarks --
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Exception + State --
---------------------... | # LANGUAGE NoMonomorphismRestriction #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
# LANGUAGE DeriveFunctor #
# LANGUAGE CPP #
module Main where
#if __GLASGOW_HASKELL__ <= 708
import Control.Applicative
import qualified Control.Monad.Error as MTL
#el... |
898e4726712a5664a47e2fdf0027f174963df64f4942caf14e7750c78eec5269 | jimmythompson/halboy | cachable.clj | (ns halboy.http.cachable
(:require
[clojure.walk :refer [stringify-keys keywordize-keys]]
[cheshire.core :as json]
[org.httpkit.client :as http]
[clojure.core.cache :as cache]
[halboy.argutils :refer [deep-merge]]
[halboy.http.protocol :as protocol])
(:import [com.fasterxml.jackson.core Json... | null | https://raw.githubusercontent.com/jimmythompson/halboy/aef94a2b6a94e63045c369bc7679a7d6fc57b43c/src/halboy/http/cachable.clj | clojure | (ns halboy.http.cachable
(:require
[clojure.walk :refer [stringify-keys keywordize-keys]]
[cheshire.core :as json]
[org.httpkit.client :as http]
[clojure.core.cache :as cache]
[halboy.argutils :refer [deep-merge]]
[halboy.http.protocol :as protocol])
(:import [com.fasterxml.jackson.core Json... | |
56790791d5ac7fd08e82544cfd5a5bd4ce4676cbd584677e33d61d36250a7c52 | justinethier/husk-scheme | Core.hs | # LANGUAGE CPP #
|
Module : Language . Scheme . Core
Copyright :
Licence : MIT ( see LICENSE in the distribution )
Maintainer : github.com/justinethier
Stability : experimental
Portability : portable
This module contains Core functionality , primarily Scheme expression evaluation... | null | https://raw.githubusercontent.com/justinethier/husk-scheme/d5643af2f344013f403bc4c97d6ead4e6c19af52/hs-src/Language/Scheme/Core.hs | haskell | * Scheme code evaluation
* Core data
* Utility functions
* Error handling
* Internal use only
import Debug.Trace
|Husk version number
|A utility function to display the husk console banner
TODO: windows posix
|Get the full path to a data file installed for husk
Future use:
getDataFileFullPath' :: [LispVal] ... | # LANGUAGE CPP #
|
Module : Language . Scheme . Core
Copyright :
Licence : MIT ( see LICENSE in the distribution )
Maintainer : github.com/justinethier
Stability : experimental
Portability : portable
This module contains Core functionality , primarily Scheme expression evaluation... |
aa0584ab5d2fbd3f52efb40c4c07ac2ca5d465ee2a7ad7a7731fef184d9f1b95 | thelema/ocaml-community | set.mli | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/thelema/ocaml-community/ed0a2424bbf13d1b33292725e089f0d7ba94b540/stdlib/set.mli | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
module type OrderedType =
sig
ty... |
b482d2f1e51503984f9e987ac5b799eb537964d131a8003f5e31ba3001b04648 | juspay/atlas | AllocatorMetrics.hs | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | null | https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/driver-offer-bpp/src/Tools/Metrics/AllocatorMetrics.hs | haskell | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | |
13c20e5e48415e560899a50c5b190d8174e12e8763e65f3db3d1db3352ef09cf | ekmett/ad | Double.hs | -----------------------------------------------------------------------------
-- |
Copyright : ( c ) 2010 - 2021
-- License : BSD3
-- Maintainer :
-- Stability : experimental
Portability : GHC only
--
-- Higher order derivatives via a \"dual number tower\".
--
------------------------------------------... | null | https://raw.githubusercontent.com/ekmett/ad/6454d35d1aa6e2af04db9e549146c9cfe8d8bd3b/src/Numeric/AD/Rank1/Sparse/Double.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD3
Maintainer :
Stability : experimental
Higher order derivatives via a \"dual number tower\".
---------------------------------------------------------------------------
* Sparse Gradients
* Variadic Gradients
*... | Copyright : ( c ) 2010 - 2021
Portability : GHC only
module Numeric.AD.Rank1.Sparse.Double
( SparseDouble
, auto
, grad
, grad'
, gradWith
, gradWith'
$ vgrad
, Grad
, vgrad
, grads
, Grads
, vgrads
* ( synonyms )
, jacobian
, jacobian'
, jacobianWith
, jacobianWith'
, j... |
2a90352d363aad6d0343041c8c8ddcdd06eabcbf769f83a93e4c36908dc60ef3 | jrm-code-project/LISP-Machine | adabug.lisp | -*- Mode : LISP ; Package : SYSTEM - INTERNALS ; -*-
(defun area-name-1 (x)
(if (numberp x) (area-name x) x))
(advise si:fasl-op-frame :before check1 nil
(format t "~%ENTER: ~S" (area-name-1 (AREF FASL-TABLE FASL-LIST-AREA))))
(advise si:fasl-op-frame :after check2 nil
(format t "~%EXIT: ~S" (area-name-1 (... | null | https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/gjc/adabug.lisp | lisp | Package : SYSTEM - INTERNALS ; -*- |
(defun area-name-1 (x)
(if (numberp x) (area-name x) x))
(advise si:fasl-op-frame :before check1 nil
(format t "~%ENTER: ~S" (area-name-1 (AREF FASL-TABLE FASL-LIST-AREA))))
(advise si:fasl-op-frame :after check2 nil
(format t "~%EXIT: ~S" (area-name-1 (AREF FASL-TABLE FASL-LIST-AREA)) ))
(breakon ' FASL-OP... |
636298767a65c00d4506b2df3c51501654cd86140bb9a212a9117884211b6c6f | static-analysis-engineering/codehawk | jCHGlobals.ml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author :
------------------------------------------------------------------------------
The MIT License ( MIT )
... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/98ced4d5e6d7989575092df232759afc2cb851f6/CodeHawk/CHJ/jchsys/jCHGlobals.ml | ocaml | chutil | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Java Analyzer
Author :
------------------------------------------------------------------------------
The MIT License ( MIT )
... |
c1c9ac29dff7e54857709ba3b9cbfe8f5277b2ea260afd7dcd0736fd0c33fe29 | cram-code/cram_core | fluent-tracing.lisp | ;;;
Copyright ( c ) 2009 - 2010
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions are met:
;;;
;;; * Redistributions of source code must retain the above copyright
;;; notice, this list o... | null | https://raw.githubusercontent.com/cram-code/cram_core/984046abe2ec9e25b63e52007ed3b857c3d9a13c/cram_execution_trace/src/fluent-tracing.lisp | lisp |
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redi... | Copyright ( c ) 2009 - 2010
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR
LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY ,... |
6732b665a2ef674e48309c9a361166c653620bc8de4da677eb603e01d9d32667 | david-christiansen/pie-hs | Parse.hs | # OPTIONS_GHC -fwarn - incomplete - patterns #
-- | The Pie parser
module Pie.Parse (
-- * General parsing infrastructure
ParseErr(..),
Parser,
-- ** Running parsers
parse,
startParsing,
keepParsing,
* Parsers
eof,
expr,
program,
spacing,
topLevel
) where
import Control.Applicative
import ... | null | https://raw.githubusercontent.com/david-christiansen/pie-hs/57a72035c23b6bf0b12492decb77690fea9dfa11/src/Pie/Parse.hs | haskell | | The Pie parser
* General parsing infrastructure
** Running parsers
| Things that could go wrong during parsing.
^ An unknown error (should never be shown to users)
^ The characters are expected specific characters, while the text
values are descriptions of expected productions.
^ An unexpected end of input wa... | # OPTIONS_GHC -fwarn - incomplete - patterns #
module Pie.Parse (
ParseErr(..),
Parser,
parse,
startParsing,
keepParsing,
* Parsers
eof,
expr,
program,
spacing,
topLevel
) where
import Control.Applicative
import Data.Char
import Data.Foldable
import Data.List (nub)
import Data.List.NonEmpty (N... |
4b67552d1cefeadb7aab41c3074483085a256f95d25d3262adcef153e8a31b4b | oakes/Nightcode | console.clj | (ns leiningen.new.console
(:require [leiningen.new.templates :as t]))
(defn console
[name package-name]
(let [render (t/renderer "console")
package-name (t/sanitize (t/multi-segment (or package-name name)))
main-ns (t/sanitize-ns package-name)
data {:app-name name
:name (t/p... | null | https://raw.githubusercontent.com/oakes/Nightcode/2e112c59cddc5fdec96059a08912c73b880f9ae8/resources/leiningen/new/console.clj | clojure | (ns leiningen.new.console
(:require [leiningen.new.templates :as t]))
(defn console
[name package-name]
(let [render (t/renderer "console")
package-name (t/sanitize (t/multi-segment (or package-name name)))
main-ns (t/sanitize-ns package-name)
data {:app-name name
:name (t/p... | |
419e6ec6a4083c04db031b4c4135c6a8021951b7bd64c2fae6b602fa361a4218 | goBuildRun/buildrun-emqx-backend-mysql | emqx_backend_mysql_cli.erl | -file("/emqx_rel/_checkouts/emqx_backend_mysql/src/e"
"mqx_backend_mysql_cli.erl",
1).
-module(emqx_backend_mysql_cli).
-file("/emqx_rel/_checkouts/emqx/include/emqx.hrl", 1).
-record(subscription, {topic, subid, subopts}).
-record(message,
{id :: binary(), qos = 0, from :: atom() | binary(),
flags... | null | https://raw.githubusercontent.com/goBuildRun/buildrun-emqx-backend-mysql/3b9f2d4c6320c3e6faf7a2cea621055a961f58be/src/emqx_backend_mysql_cli.erl | erlang | -file("/emqx_rel/_checkouts/emqx_backend_mysql/src/e"
"mqx_backend_mysql_cli.erl",
1).
-module(emqx_backend_mysql_cli).
-file("/emqx_rel/_checkouts/emqx/include/emqx.hrl", 1).
-record(subscription, {topic, subid, subopts}).
-record(message,
{id :: binary(), qos = 0, from :: atom() | binary(),
flags... | |
2deae9c87316b1406121e7393ece211d144af2e6076df2e22723f2578aafbff9 | Frechmatz/cl-synthesizer | packages.lisp | (defpackage :cl-synthesizer-monitor-csv-file-agent
(:use :cl)
(:export
:make-backend))
| null | https://raw.githubusercontent.com/Frechmatz/cl-synthesizer/4dfc5c804e56cffbba57744b92b2eebc3b514d1e/src/monitor/csv-file/packages.lisp | lisp | (defpackage :cl-synthesizer-monitor-csv-file-agent
(:use :cl)
(:export
:make-backend))
| |
315b6e524ea78248fbb6ff416d673a4f4e89a233b9553ea51f45d3228a1573d7 | SparkFund/sails-forth | spec.clj | (ns sails-forth.spec
(:require [clojure.spec.alpha :as s]))
(s/def ::id
string?)
(s/def ::type
string?)
(s/def ::field
(s/or :keyword keyword?
:string string?))
(s/def ::attrs
(s/map-of ::field ::json-simple))
(s/def ::query
string?)
(s/def ::entity
(s/keys :req-un [::id]))
(s/def ::json-si... | null | https://raw.githubusercontent.com/SparkFund/sails-forth/acc97f01d5d1bf21ee7139eee9360d363515d737/src/sails_forth/spec.clj | clojure | some internal unit tests fail with bigdec?
bigdec?
other possible keys:
:validFor
label can be nil in a picklistValue, is that correct? Awkward to express.
::label | (ns sails-forth.spec
(:require [clojure.spec.alpha :as s]))
(s/def ::id
string?)
(s/def ::type
string?)
(s/def ::field
(s/or :keyword keyword?
:string string?))
(s/def ::attrs
(s/map-of ::field ::json-simple))
(s/def ::query
string?)
(s/def ::entity
(s/keys :req-un [::id]))
(s/def ::json-si... |
9f04140235c88d4b195a7823dc2cffdd2cc7bdca1cb19ee5fb658955a69a46a4 | ftovagliari/ocamleditor | dialog_rename.ml |
OCamlEditor
Copyright ( C ) 2010 - 2014
This file is part of OCamlEditor .
OCamlEditor is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at y... | null | https://raw.githubusercontent.com/ftovagliari/ocamleditor/53284253cf7603b96051e7425e85a731f09abcd1/src/otherwidgets/dialog_rename.ml | ocaml | * colorize
* sync_page
* rename
* window
Because of Win32 case insensitiveness of filenames
we delete both old file and new file, we close the editor
page of the existing file and we create a new file with the
given new filename.
Close the editor page to a... |
OCamlEditor
Copyright ( C ) 2010 - 2014
This file is part of OCamlEditor .
OCamlEditor is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at y... |
8efa87c5d98b3c28bea1e0b6ce6b656d3c410140f0fad5f61d672dfbeb070fcd | racket/rhombus-prototype | math.rkt | #lang racket/base
(require "name-root.rkt"
"static-info.rkt"
"define-arity.rkt"
"realm.rkt")
(provide (for-space rhombus/namespace
math))
(define-name-root math
#:fields
(abs
min max
floor ceiling round
sqrt
log exp expt
cos sin tan
acos asin atan
... | null | https://raw.githubusercontent.com/racket/rhombus-prototype/60070a3edd2b850bf429298b84b66eee3ea79194/rhombus/private/math.rkt | racket | #lang racket/base
(require "name-root.rkt"
"static-info.rkt"
"define-arity.rkt"
"realm.rkt")
(provide (for-space rhombus/namespace
math))
(define-name-root math
#:fields
(abs
min max
floor ceiling round
sqrt
log exp expt
cos sin tan
acos asin atan
... | |
7e730a64c8ad815162451cfffec81c51091aec094983066970e72422c020d68c | ragkousism/Guix-on-Hurd | nano.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2012 < >
Copyright © 2015 , 2016 < >
Copyright © 2016 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
... | null | https://raw.githubusercontent.com/ragkousism/Guix-on-Hurd/e951bb2c0c4961dc6ac2bda8f331b9c4cee0da95/gnu/packages/nano.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2012 < >
Copyright © 2015 , 2016 < >
Copyright © 2016 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages nano)
#:use-module (guix... |
3fd6636bea92480e83cde48e3eb32d57de3d95f86dfd4b5343576a732905bd9b | yihuang/xml2json | Test.hs | {-# LANGUAGE OverloadedStrings #-}
import Control.Applicative
import Control.Monad.Trans.Resource (ExceptionT(runExceptionT))
import Control.Exception (throw)
import Data.Maybe (fromMaybe)
import Data.Functor.Identity (Identity(runIdentity))
import qualified Data.ByteString.Char8 as S
import qualified Data.ByteString.L... | null | https://raw.githubusercontent.com/yihuang/xml2json/fed8f1125ad8af9e3fe85ddf1e701a9a00e147c3/tests/Test.hs | haskell | # LANGUAGE OverloadedStrings # | import Control.Applicative
import Control.Monad.Trans.Resource (ExceptionT(runExceptionT))
import Control.Exception (throw)
import Data.Maybe (fromMaybe)
import Data.Functor.Identity (Identity(runIdentity))
import qualified Data.ByteString.Char8 as S
import qualified Data.ByteString.Lazy as L
import Data.ByteString.Laz... |
8a1ce0b65fb2f5cce5d2178f56251324bab6beb583c7d4ba320703618373757e | bos/rwh | UglyStack.hs | # LANGUAGE GeneralizedNewtypeDeriving #
module UglyStack (AppConfig, AppState) where
import CountEntries (listDirectory)
{-- snippet AppData --}
import System.Directory
import System.FilePath
import Control.Monad.Reader
import Control.Monad.State
data AppConfig = AppConfig {
cfgMaxDepth :: Int
} deriving ... | null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch18/UglyStack.hs | haskell | - snippet AppData -
- /snippet AppData -
- snippet App -
- /snippet App -
- snippet App2 -
- /snippet App2 -
- snippet runApp -
- /snippet runApp -
- snippet constrainedCount -
- /snippet constrainedCount -
- snippet MyApp -
- /snippet MyApp -
- snippet explicitGet -
- /snippet explicitGet -
- snippet implicitGet -
- /... | # LANGUAGE GeneralizedNewtypeDeriving #
module UglyStack (AppConfig, AppState) where
import CountEntries (listDirectory)
import System.Directory
import System.FilePath
import Control.Monad.Reader
import Control.Monad.State
data AppConfig = AppConfig {
cfgMaxDepth :: Int
} deriving (Show)
data AppState = ... |
9be584d902020c3a3fb0db2ac59dfd7c0e53b512d4463f2cf975ddbaa32d9b4e | input-output-hk/plutus-apps | Scheduler.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DerivingStrategies #-}
# LANGUAGE DerivingVia #
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE GADTs #
# LANGUAGE LambdaCase #
# L... | null | https://raw.githubusercontent.com/input-output-hk/plutus-apps/4b516499f6305643cf90001f89e8f044672a5201/plutus-contract/src/Plutus/Trace/Scheduler.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
# LANGUAGE TypeOperators #
* Thread API
* Etc.
| Unique identifier of a thread.
| Priority of a thread.
^ Threa... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE GADTs #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE TypeF... |
667cfc38269dc4e84aad9c37cb7fd0ad4219e6259c2d270a2c40ea8c898cfcab | dharmatech/abstracting | source.scm | noise calculations
;;
by
: , winter 2008
;;
;;
This library possess functions that calculates the perlin noise on
;; a 2d grid. Caching is used to accelerate the library procedures.
;; (declare (inline)
;; (inline-p... | null | https://raw.githubusercontent.com/dharmatech/abstracting/9dc5d9f45a9de03c6ee379f1928ebb393dfafc52/examples/perlin-noise/source.scm | scheme |
a 2d grid. Caching is used to accelerate the library procedures.
(declare (inline)
(inline-primitives)
(block)
(lambda-lift)
(constant-fold)
(not safe)
(standard-bindings)
(extended-bindings))
Sources of inspiration:
/~mzu... | noise calculations
by
: , winter 2008
This library possess functions that calculates the perlin noise on
( inlining - limit 350 )
(define (create-point2d x y) (vector (exact->inexact x)
(exa... |
6d5c659ba10d638f4e16105e92b3389bb976a59a5cdc87e1ca4b65d8aa563b53 | amuletml/amulet | Unify.hs | # LANGUAGE FlexibleContexts , ScopedTypeVariables , ViewPatterns , ConstraintKinds , CPP , TypeFamilies , OverloadedStrings , DisambiguateRecordFields , TypeApplications #
-- | This module implements the logic responsible for solving the
-- sequence of @Constraint@s the type-checker generates for a particular
-- bindi... | null | https://raw.githubusercontent.com/amuletml/amulet/fcba0b7e198b8d354e95722bbe118bccc8483f4e/src/Types/Unify.hs | haskell | | This module implements the logic responsible for solving the
sequence of @Constraint@s the type-checker generates for a particular
binding groups.
| Solve a sequence of constraints, returning either a substitution
variables.
particular instance of the solver is allowed to generate from.
{{{
{{{
}}}
{{{
}}... | # LANGUAGE FlexibleContexts , ScopedTypeVariables , ViewPatterns , ConstraintKinds , CPP , TypeFamilies , OverloadedStrings , DisambiguateRecordFields , TypeApplications #
module Types.Unify
( SolveState, emptyState
, typeWithin
, solve, solveImplies
, skolemise, freshSkol, skolFreeTy
, unifyPure_v, unifyPur... |
1536f934f61905896efada471dedd6d01c382f2b1e05aa7a50f3b29a90f33e76 | puppetlabs/puppetdb | utils_test.clj | (ns puppetlabs.puppetdb.utils-test
(:require
[clojure.test :refer :all]
[clojure.walk :as walk]
[puppetlabs.puppetdb.testutils :as tu]
[puppetlabs.puppetdb.utils
:refer [assoc-when
describe-bad-base-url
match-any-of
print-err
println-err
rege... | null | https://raw.githubusercontent.com/puppetlabs/puppetdb/b3d6d10555561657150fa70b6d1e609fba9c0eda/test/puppetlabs/puppetdb/utils_test.clj | clojure | (ns puppetlabs.puppetdb.utils-test
(:require
[clojure.test :refer :all]
[clojure.walk :as walk]
[puppetlabs.puppetdb.testutils :as tu]
[puppetlabs.puppetdb.utils
:refer [assoc-when
describe-bad-base-url
match-any-of
print-err
println-err
rege... | |
31779c873d0817793e15f4f46b5db70e05ba4c0868758f67d0dd6f09d17e7e86 | spawnfest/eep49ers | wxPaintEvent.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2020 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/wx/src/gen/wxPaintEvent.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2008 - 2020 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(wxPaintEvent).
-include("wxe.hrl").
-export([]).
-export([getId/1,getSkipped/1,getTimestamp/1,isCommandEven... |
7f4c137dd1f75e070d070214dd925553fee78314478c8800e4417c1de6105bd9 | OCamlPro/typerex-lint | make_doc.ml | (**************************************************************************)
(* *)
(* OCamlPro Typerex *)
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/OCamlPro/typerex-lint/6d9e994c8278fb65e1f7de91d74876531691120c/tools/ocp-lint-doc/make_doc.ml | ocaml | ************************************************************************
OCamlPro Typerex
This file is distributed ... | Copyright OCamlPro 2011 - 2016 . All rights reserved .
( GNU General Public Licence version 3.0 ) .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
NONINFRINGEMENT . IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE... |
584166aede47668683e6b4ff553b151ebffb3c5826975a39b4c0520caf17b7a1 | zwizwa/staapl | task.rkt | #lang staapl/pic18 \ -*- forth -*-
provide-all
\ This file contains bare bones task switching code, in the form of
\ the following words. It switches the 3 stacks and the a and f
\ registers.
\
\ suspend \ -- task | copy state to data stack, return task pointer
\ resume \ task -- | ignore current co... | null | https://raw.githubusercontent.com/zwizwa/staapl/e30e6ae6ac45de7141b97ad3cebf9b5a51bcda52/pic18/task.rkt | racket | #lang staapl/pic18 \ -*- forth -*-
provide-all
\ This file contains bare bones task switching code, in the form of
\ the following words. It switches the 3 stacks and the a and f
\ registers.
\
\ suspend \ -- task | copy state to data stack, return task pointer
\ resume \ task -- | ignore current co... | |
4e5c28e692422480041a656a06d4668991a62de056b86978d2db84f8de803fd5 | returntocorp/semgrep | AST.ml |
Regexp AST
Regexp AST
*)
open Printf
type loc = Parse_info.t * Parse_info.t
type opt =
| Caseless
| Allow_duplicate_names
| Multiline
| Dotall
| Default_lazy
| Ignore_whitespace
type special =
| Beginning_of_line
| End_of_line
| Beginning_of_input
| End_of_last_line
| End_of_input
... | null | https://raw.githubusercontent.com/returntocorp/semgrep/00f1e67bbb80f00e29db3381288fc00398b6868a/languages/regexp/AST.ml | ocaml | exotic
exotic
anything we can't make sense of
some unrecognized character following '(?'
TODO: set correct location for the character |
Regexp AST
Regexp AST
*)
open Printf
type loc = Parse_info.t * Parse_info.t
type opt =
| Caseless
| Allow_duplicate_names
| Multiline
| Dotall
| Default_lazy
| Ignore_whitespace
type special =
| Beginning_of_line
| End_of_line
| Beginning_of_input
| End_of_last_line
| End_of_input
... |
c0f88ebf7aba92776c73c4374ba10659adc3a98229c9feb74e96edfa701b442b | tnelson/Forge | restrictionOperatorBug.rkt | #lang forge
-- I'm not sure if it's meant to be implemented, but <: and :> cause a weird
-- error: "match: no matching clause for [...]"
-- Commented out tests in:
-- - forge-alloy/expressions/expressionOperators.rkt
option verbose 0
sig Node {
edges : set Node
}
pred LessColon {
all n: Node |
n.e... | null | https://raw.githubusercontent.com/tnelson/Forge/1687cba0ebdb598c29c51845d43c98a459d0588f/forge/OLD/bugs/restrictionOperatorBug.rkt | racket | #lang forge
-- I'm not sure if it's meant to be implemented, but <: and :> cause a weird
-- error: "match: no matching clause for [...]"
-- Commented out tests in:
-- - forge-alloy/expressions/expressionOperators.rkt
option verbose 0
sig Node {
edges : set Node
}
pred LessColon {
all n: Node |
n.e... | |
d4258b46099631b7dd7e9d4292a335a0a1f6d3efa213b9789f9eb17d9700ef6c | CryptoKami/cryptokami-core | Signing.hs | -- | Signing done with public/private keys.
module Pos.Crypto.Signing.Signing
(
-- * Keys
emptyPass
, keyGen
, deterministicKeyGen
-- * Signing and verification
, sign
reexport
, fullSignatureHexF
, parseFullSignature
, mkSigned
-- * Ve... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/crypto/Pos/Crypto/Signing/Signing.hs | haskell | | Signing done with public/private keys.
* Keys
* Signing and verification
* Versions for raw bytestrings
* Proxy signature scheme
--------------------------------------------------------------------------
Keys, key generation & printing & decoding
-----------------------------------------------------------------... |
module Pos.Crypto.Signing.Signing
(
emptyPass
, keyGen
, deterministicKeyGen
, sign
reexport
, fullSignatureHexF
, parseFullSignature
, mkSigned
, signRaw
reexport
reexport
, fullProxyCertHexF
, parseFullProxyCert
reexport
... |
de2f9400b7914bacbad10a59fb7dda54db4f596228969004b85289f04c84298a | mfikes/fifth-postulate | ns188.cljs | (ns fifth-postulate.ns188)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | null | https://raw.githubusercontent.com/mfikes/fifth-postulate/22cfd5f8c2b4a2dead1c15a96295bfeb4dba235e/src/fifth_postulate/ns188.cljs | clojure | (ns fifth-postulate.ns188)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | |
09145f5af67755fe3989a92b55d94d6bf9c539f0a39e72dfe98fab0f8da08cb3 | bsansouci/reasonglexampleproject | edge.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/bsansouci/reasonglexampleproject/4ecef2cdad3a1a157318d1d64dba7def92d8a924/vendor/camlimages/examples/edgedetect/edge.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1999 - 2004 ,
Institut National de Recherche en Informatique et en Automatique .
$ I d : edge.ml , v 1.12 2004/09/12 21:47:43 weis Exp $
open Images
open OImages
let edge (bmp : rgb24) =... |
fa26fdf8b414e79a2b536c4f58fd398f036a35dd03cd47f15d118b75bf1ab025 | erlangonrails/devdb | yaws_content_negotiation.erl | -module(yaws_content_negotiation).
-export([compute_rsva/2, parse_accept_field/1, match_media_type/2]).
-include("../include/yaws_api.hrl").
%% TODO: analyze impact of spaces in headers; when/where to strip?
%% RFC 2296
compute_rsva(Arg, VariantList) ->
Headers = Arg#arg.headers,
Accept = parse_accept_field... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/scalaris/contrib/yaws/src/yaws_content_negotiation.erl | erlang | TODO: analyze impact of spaces in headers; when/where to strip?
RFC 2296
move these into #headers{} !
yet to be implemented
TODO: build Alternates: header field
TODO: must be neighbour variant (same root as request)
Accept-Features: not yet implemented
fallback-variant | -module(yaws_content_negotiation).
-export([compute_rsva/2, parse_accept_field/1, match_media_type/2]).
-include("../include/yaws_api.hrl").
compute_rsva(Arg, VariantList) ->
Headers = Arg#arg.headers,
Accept = parse_accept_field(Headers#headers.accept),
AcceptCharset = parse_accept_field(
... |
c38cfc2eea57a695f724bf4f53d03ea7083cd6f60b7d039c60b6ddae8734af5a | conreality/conreality | check_physics.ml | (* This is free and unencumbered software released into the public domain. *)
open Check_common
open Consensus.Physics
| null | https://raw.githubusercontent.com/conreality/conreality/e03328ef1f0056b58e4ffe181a279a1dc776e094/test/consensus/check_physics.ml | ocaml | This is free and unencumbered software released into the public domain. |
open Check_common
open Consensus.Physics
|
4864914bea4496fcec5fca048e488240d70aac3b2ebc7627aa99b5a49e13ff85 | skanev/playground | 56-tests.scm | (require rackunit rackunit/text-ui)
(load "../56.scm")
(load "helpers/query.scm")
(define sicp-4.56-tests
(test-suite
"Tests for SICP exercise 4.56"
(check-equal? (matches-of query-a)
'((and (address (Hacker Alyssa P) (Cambridge (Mass Ave) 78))
(supervisor (Hacker... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/04/tests/56-tests.scm | scheme | (require rackunit rackunit/text-ui)
(load "../56.scm")
(load "helpers/query.scm")
(define sicp-4.56-tests
(test-suite
"Tests for SICP exercise 4.56"
(check-equal? (matches-of query-a)
'((and (address (Hacker Alyssa P) (Cambridge (Mass Ave) 78))
(supervisor (Hacker... | |
ad6ad7e0f42b874d2329483a54769dd604b5e7f336ff47d8f7076a4e59478ef4 | ghc/packages-Cabal | ReadP.hs | # LANGUAGE CPP #
{-# LANGUAGE GADTs #-}
-----------------------------------------------------------------------------
-- |
--
-- Module : Distribution.Deprecated.ReadP
Copyright : ( c ) The University of Glasgow 2002
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
--... | null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/cabal-install/Distribution/Deprecated/ReadP.hs | haskell | # LANGUAGE GADTs #
---------------------------------------------------------------------------
|
Module : Distribution.Deprecated.ReadP
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Portability : portable
It parses all alternatives in parallel, so it never keeps hold of
... | # LANGUAGE CPP #
Copyright : ( c ) The University of Glasgow 2002
This is a library of parser combinators , originally written by .
See also 's paper /Parallel
This version of ReadP has been locally hacked to make it H98 , by
< mailto: >
The unit tests have been moved to UnitTest . Distribution ... |
49e8d5fd9e9246fb33dc2d36d271cadfa45306e499af68077eaaccf074ed9271 | raph-amiard/CamllVM | ray.ml | (* ocamlc -rectypes scratchpad/ray.ml *)
let delta = sqrt epsilon_float
type vec = {x:float; y:float; z:float}
let zero = {x=0.; y=0.; z=0.}
let ( *| ) s r = {x = s *. r.x; y = s *. r.y; z = s *. r.z}
let ( +| ) a b = {x = a.x +. b.x; y = a.y +. b.y; z = a.z +. b.z}
let ( -| ) a b = {x = a.x -. b.x; y = a.y -. b.y; z... | null | https://raw.githubusercontent.com/raph-amiard/CamllVM/d36928f0e81a6f4f65ddd3a8653887d187632dc2/scratchpad/ray.ml | ocaml | ocamlc -rectypes scratchpad/ray.ml
function |
let delta = sqrt epsilon_float
type vec = {x:float; y:float; z:float}
let zero = {x=0.; y=0.; z=0.}
let ( *| ) s r = {x = s *. r.x; y = s *. r.y; z = s *. r.z}
let ( +| ) a b = {x = a.x +. b.x; y = a.y +. b.y; z = a.z +. b.z}
let ( -| ) a b = {x = a.x -. b.x; y = a.y -. b.y; z = a.z -. b.z}
let dot a b = a.x *. b.x +... |
9c945e8b5687ce33805f8a10ee7842863a77896f497514b5758ec321d4e87cfd | babashka/babashka | core_test.clj | (ns omniconf.core-test
(:require [clojure.string :as str]
[clojure.test :refer [deftest is testing]]
[omniconf.core :as cfg])
(:import (java.io File)))
(cfg/define
{:conf {:type :file}
:foo {:type :string
:required true}
:the-boolean {:type :boole... | null | https://raw.githubusercontent.com/babashka/babashka/097e45d180fce8a7082fe29ee3b55b97d838e871/test-resources/lib_tests/omniconf/core_test.clj | clojure | put some props in the temp file
and set a system property
cleanup | (ns omniconf.core-test
(:require [clojure.string :as str]
[clojure.test :refer [deftest is testing]]
[omniconf.core :as cfg])
(:import (java.io File)))
(cfg/define
{:conf {:type :file}
:foo {:type :string
:required true}
:the-boolean {:type :boole... |
2e4aa8ef174041dca514214005fc46d65c40ca5565973f8a69df831660520a55 | borodust/mortar-combat | room.lisp | (in-package :mortar-combat)
(defclass wall-geom (collidable plane-geom) ())
(defclass room-floor (disposable)
(walls))
(defmethod initialize-instance :after ((this room-floor) &key)
(with-slots (walls) this
(setf walls (list (make-instance 'wall-geom :normal (vec3 0.0 1.0 0.0))
(make-... | null | https://raw.githubusercontent.com/borodust/mortar-combat/548bdda21594185f36c365f25015c5edcc37b828/client/src/room.lisp | lisp | (in-package :mortar-combat)
(defclass wall-geom (collidable plane-geom) ())
(defclass room-floor (disposable)
(walls))
(defmethod initialize-instance :after ((this room-floor) &key)
(with-slots (walls) this
(setf walls (list (make-instance 'wall-geom :normal (vec3 0.0 1.0 0.0))
(make-... | |
b5ab3a64128d04b25658c2a788b7f72abb4c6580dcbf86e2aca02a7e164841f2 | snoyberg/why-you-should-use-stm | exercise.hs | #!/usr/bin/env stack
-- stack --resolver lts-13.21 script
import Data.IORef
main :: IO ()
main = do
-- Create a new reference
ref <- newIORef "Hello"
origVal <- readIORef ref
writeIORef ref (origVal ++ " World")
-- This line won't compile, fix it!
putStrLn ref
| null | https://raw.githubusercontent.com/snoyberg/why-you-should-use-stm/adf3366aebd6daf1dd702ed4cad1c2303d296afc/exercises/01-ioref/exercise.hs | haskell | stack --resolver lts-13.21 script
Create a new reference
This line won't compile, fix it! | #!/usr/bin/env stack
import Data.IORef
main :: IO ()
main = do
ref <- newIORef "Hello"
origVal <- readIORef ref
writeIORef ref (origVal ++ " World")
putStrLn ref
|
0ba78e43905e20f381ca06c5c934ce435adc511f98308106ce4bc3f2f302b00e | mtnygard/datoms-say-what | render.clj | (ns datoms-say.render
(:require [clojure.string :as str]
[datomic.api :as d]))
(defprotocol RenderAtom
(render-atom [this] "Render to an atomic string"))
(defn attributes
[as]
(interpose
" "
(map (fn [[k v]] [(str/upper-case (name k)) "=\"" (render-atom v) "\""]) as)))
(defn- delimited [sta... | null | https://raw.githubusercontent.com/mtnygard/datoms-say-what/d352efde39dfc3d3a1a40b1d4a1d4493c835c1ae/src/datoms_say/render.clj | clojure | (println "render-atom Object " this)
(println "render-atom IPersistentVector " this)
(println "render Object " this " in scope " level)
(println "render IPersistentCollection " this " in scope " level) | (ns datoms-say.render
(:require [clojure.string :as str]
[datomic.api :as d]))
(defprotocol RenderAtom
(render-atom [this] "Render to an atomic string"))
(defn attributes
[as]
(interpose
" "
(map (fn [[k v]] [(str/upper-case (name k)) "=\"" (render-atom v) "\""]) as)))
(defn- delimited [sta... |
04bf60a1d11cc16d8c0313d95d0d62c176af2bf43fd68f708b3f49f6f5e4564c | hamler-lang/hamler | Env.erl | %%---------------------------------------------------------------------------
%% |
%% Module : Env
Copyright : ( c ) 2020 - 2021 EMQ Technologies Co. , Ltd.
%% License : BSD-style (see the LICENSE file)
%%
Maintainer : ,
,
%% Stability : experimental
%% Portability : p... | null | https://raw.githubusercontent.com/hamler-lang/hamler/3ba89dde3067076e112c60351b019eeed6c97dd7/lib/System/Env.erl | erlang | ---------------------------------------------------------------------------
|
Module : Env
License : BSD-style (see the LICENSE file)
Stability : experimental
Portability : portable
The Erlang Env module.
---------------------------------------------------------------------------
getAllEnv :: I... | Copyright : ( c ) 2020 - 2021 EMQ Technologies Co. , Ltd.
Maintainer : ,
,
-module('Env').
-include("../Foreign.hrl").
-export([ getAllEnv/0
, getEnv/1
, lookupEnv/1
, setEnv/2
, unsetEnv/1
]).
getAllEnv() ->
?IO([list_to_tuple(string:spli... |
7fe62b927d364fc8657ffd1652efeb46ea13b40fd92edc27e1ab4b3616f5ffd3 | music-suite/music-suite | Solo.hs | # OPTIONS_GHC -fno - warn - name - shadowing
-fno - warn - unused - imports
-fno - warn - redundant - constraints #
-fno-warn-unused-imports
-fno-warn-redundant-constraints #-}
| Representation of solo vs. tutti .
module Music.Parts.Solo
( Solo (..),
)
where
import Control.Applicative
import Control... | null | https://raw.githubusercontent.com/music-suite/music-suite/7f01fd62334c66418043b7a2d662af127f98685d/src/Music/Parts/Solo.hs | haskell | # OPTIONS_GHC -fno - warn - name - shadowing
-fno - warn - unused - imports
-fno - warn - redundant - constraints #
-fno-warn-unused-imports
-fno-warn-redundant-constraints #-}
| Representation of solo vs. tutti .
module Music.Parts.Solo
( Solo (..),
)
where
import Control.Applicative
import Control... | |
be544d4cc5868d0d7f1fd5b448d83766118c8daf29c21c529887f3abd7146150 | quil-lang/quilc | ansatz-search.lisp | ansatz-search.lisp
;;;;
Author :
Cole Scott
(in-package #:cl-quil)
;;; This file contains a simple procedure for taking a "template"
parametric circuit and using Nelder - Mead to find parameters to
;;; fill in that circuit with.
;;;
;;; This function may be useful to build compilers with.
(defun so... | null | https://raw.githubusercontent.com/quil-lang/quilc/3f3260aaa65cdde25a4f9c0027959e37ceef9d64/src/compilers/ansatz-search.lisp | lisp |
This file contains a simple procedure for taking a "template"
fill in that circuit with.
This function may be useful to build compilers with.
Below are examples purely for illustrative purposes.
Example #1: Euler decomposition
Example #2: Find an exotic non-orthogonal decomposition
Given the matrices RZ(thet... | ansatz-search.lisp
Author :
Cole Scott
(in-package #:cl-quil)
parametric circuit and using Nelder - Mead to find parameters to
(defun solve-for-ansatz-inputs (matrix k ansatz &key initial-guess)
"Let MATRIX be a unitary matrix. Let ANSATZ be a function taking a vector of K reals (as DOUBLE-FLOATs... |
37f05f5e196806c9dc4f9bc901655d539aaef0b51578200ecdb1abc81e80854e | AtillaE/Exago | exago_reader.erl | %%%-------------------------------------------------------------------
@author < >
@author < >
@author
%%% @doc Reader
%%%
Created : 22 Apr 2010 by
Copyright ( c ) 2009,2010 Erlang Solutions formerly Erlang Training & Consulting
%%% All rights reserved.
%%%
%%% Redistribution and use in so... | null | https://raw.githubusercontent.com/AtillaE/Exago/39fd7172ae232981b2aaa6a2c9e9d1d68a3b6963/apps/exago/src/exago_reader.erl | erlang | -------------------------------------------------------------------
@doc Reader
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
n... | @author < >
@author < >
@author
Created : 22 Apr 2010 by
Copyright ( c ) 2009,2010 Erlang Solutions formerly Erlang Training & Consulting
* Neither the name of the Erlang Solutions nor the names of its
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPL... |
851d1be721d15c3df9870874761e0a8ee0f99f9e623d3b64557319e264812e5a | andorp/bead | I18N.hs | # LANGUAGE GeneralizedNewtypeDeriving , FlexibleInstances #
module Bead.View.I18N where
import Data.String
import Control.Monad.Trans.Reader
import Text.Blaze.Internal (MarkupM)
import qualified Text.Blaze.Html5 as H
import Bead.View.Translation
type IHtml = Reader I18N (Mark... | null | https://raw.githubusercontent.com/andorp/bead/280dc9c3d5cfe1b9aac0f2f802c705ae65f02ac2/src/Bead/View/I18N.hs | haskell | Produces a Html snipet combining the given translation with the given template
# INLINE getI18N #
# INLINE fromString # | # LANGUAGE GeneralizedNewtypeDeriving , FlexibleInstances #
module Bead.View.I18N where
import Data.String
import Control.Monad.Trans.Reader
import Text.Blaze.Internal (MarkupM)
import qualified Text.Blaze.Html5 as H
import Bead.View.Translation
type IHtml = Reader I18N (Mark... |
d456b05976a964a315ebf86d17f67335efb6fb4f3009836a63a44bba11c0329e | bmeurer/ocamljit2 | pr5057a_bad.ml | (* This one should fail *)
let f flag =
let module T = Set.Make(struct type t = int let compare = compare end) in
let _ = match flag with `A -> 0 | `B r -> r in
let _ = match flag with `A -> T.mem | `B r -> r in
()
| null | https://raw.githubusercontent.com/bmeurer/ocamljit2/ef06db5c688c1160acc1de1f63c29473bcd0055c/testsuite/tests/typing-polyvariants-bugs/pr5057a_bad.ml | ocaml | This one should fail |
let f flag =
let module T = Set.Make(struct type t = int let compare = compare end) in
let _ = match flag with `A -> 0 | `B r -> r in
let _ = match flag with `A -> T.mem | `B r -> r in
()
|
79b0c07f3a444f850b429a945d2b8037c536f69054ef73d1088d2229ed18a027 | albertoruiz/easyVision | imagproc.hs | {-# LANGUAGE RecordWildCards, TemplateHaskell #-}
import Vision.GUI
import Contours
import Image.Processing
import Image.ROI
import Util.Misc(vec)
import Util.Debug(debug)
import Numeric.LinearAlgebra
autoParam "DemoParam" "" [ ("rad","Int",intParam 2 1 20)
, ("val","Int",intParam 0 (-255) ... | null | https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/projects/examples/imagproc.hs | haskell | # LANGUAGE RecordWildCards, TemplateHaskell #
, msg "distance transform" [ Draw disTra ]
, msg "fast marching" [ Draw fm ]
, msg "DCT" [ Draw dctt ] |
import Vision.GUI
import Contours
import Image.Processing
import Image.ROI
import Util.Misc(vec)
import Util.Debug(debug)
import Numeric.LinearAlgebra
autoParam "DemoParam" "" [ ("rad","Int",intParam 2 1 20)
, ("val","Int",intParam 0 (-255) 255)
, ("scale","Int",in... |
c40923beedc0f0260671090354e3a42777ed26cbc7578d865ea1fcd97e1d7a87 | iconnect/ridley | Internal.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE ExistentialQuantification #
module System.Metrics.Prometheus.Ridley.Types.Internal
( RidleyMetricHandler(..)
, Logger
) where
import Katip
import GHC.Stack
import qualified Data.Text as T
---------------------------------------------------------------... | null | https://raw.githubusercontent.com/iconnect/ridley/d0d045ed0334af9b2403f60e8abe945b4e193d7e/ridley/src/System/Metrics/Prometheus/Ridley/Types/Internal.hs | haskell | # LANGUAGE BangPatterns #
------------------------------------------------------------------------------
| An opaque metric
| An IO action used to update the metric
| Whether or not to flush this Metric
| A user-friendly label, used to report errors | # LANGUAGE ExistentialQuantification #
module System.Metrics.Prometheus.Ridley.Types.Internal
( RidleyMetricHandler(..)
, Logger
) where
import Katip
import GHC.Stack
import qualified Data.Text as T
data RidleyMetricHandler = forall c. RidleyMetricHandler {
metric :: c
, updateMe... |
436c605b4339ff3c4983bb3b2ed9461ffab68ea47a5c65319433ff6f0d61c585 | jenshweber/grape | visualizer.clj | (ns grape.visualizer
(:require
[clojure.string :as str]
[clojure.set :refer :all]
[dorothy.core :as dorothy]
[clojure.data.codec.base64 :as b64]
[grape.util :refer :all]
[clojure.java.io :as io]
[gorilla-repl.image :as image]))
(import javax.imageio.ImageIO)
(def ctr-atom (atom 0))
(defn reset... | null | https://raw.githubusercontent.com/jenshweber/grape/34cb5aa03e5200edb07550aa533c553c62b27c78/src/grape/visualizer.clj | clojure | ")))
(get-ctr!) | (ns grape.visualizer
(:require
[clojure.string :as str]
[clojure.set :refer :all]
[dorothy.core :as dorothy]
[clojure.data.codec.base64 :as b64]
[grape.util :refer :all]
[clojure.java.io :as io]
[gorilla-repl.image :as image]))
(import javax.imageio.ImageIO)
(def ctr-atom (atom 0))
(defn reset... |
30241fc4d3f9f78e4d745249dcae0a6b5934bf120ba35f5f10a02e54dde19fb6 | default-kramer/fission-flare | core.rkt | #lang typed/racket
(provide make-loc
; Occupants
occupant? occupant-color
catalyst? catalyst-direction
fuel? ground? contaminant?
State
State state? make-initial-state
state-get state-apply state-penalty-state
state-settings state-width state-height stat... | null | https://raw.githubusercontent.com/default-kramer/fission-flare/56969185f9daf8788698b93a5cd01823fdd7b4c2/src/core.rkt | racket | Occupants
Actions
Stamped
Frame
Timing
Stats
GameLog
=== below this line is only used in multiplayer ===
requests and responses:
Token
Server
Replay
PlayerInfo
(println name) | #lang typed/racket
(provide make-loc
occupant? occupant-color
catalyst? catalyst-direction
fuel? ground? contaminant?
State
State state? make-initial-state
state-get state-apply state-penalty-state
state-settings state-width state-height state-next-spawns state-g... |
f86d00617fe24d7000c23a2285b66c3bcc07cb3982f2ae23bd18ecb67dcd0da7 | thoughtstem/morugamu | cards.rkt | #lang racket
(provide render-example
render-symbols)
(require 2htdp/image)
(require racket-bricks/renderer)
(require (rename-in "./card-designs.rkt"
[render-symbol design-1]))
(require "../util/config.rkt")
(define (example->image-list e (render-symbol design-1))
(cond [(not (list? ... | null | https://raw.githubusercontent.com/thoughtstem/morugamu/a9095ddebe364adffb036c3faed95c873a4d9f3c/rule-systems/cards.rkt | racket | (pen clear 1 "solid" "butt" "bevel")
( CONTAINER rectangle) | #lang racket
(provide render-example
render-symbols)
(require 2htdp/image)
(require racket-bricks/renderer)
(require (rename-in "./card-designs.rkt"
[render-symbol design-1]))
(require "../util/config.rkt")
(define (example->image-list e (render-symbol design-1))
(cond [(not (list? ... |
94e2220039323ca9cd9932798fb5abfd1cef12c3cbcfc7d4dce66a97ef9983aa | mirage/conan | arithmetic.mli | type 'a t =
| Invert of 'a t
| Add of 'a
| Sub of 'a
| Mul of 'a
| Div of 'a
| Mod of 'a
| Bitwise_and of 'a
| Bitwise_xor of 'a
| Bitwise_or of 'a
val serialize :
(Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit
val pp : (Format.formatter -> 'a -> unit) -> Format.formatter -> ... | null | https://raw.githubusercontent.com/mirage/conan/fb144c7785ff0aa4ec6d8c87e58ca2a0c2d328db/src/arithmetic.mli | ocaml | type 'a t =
| Invert of 'a t
| Add of 'a
| Sub of 'a
| Mul of 'a
| Div of 'a
| Mod of 'a
| Bitwise_and of 'a
| Bitwise_xor of 'a
| Bitwise_or of 'a
val serialize :
(Format.formatter -> 'a -> unit) -> Format.formatter -> 'a t -> unit
val pp : (Format.formatter -> 'a -> unit) -> Format.formatter -> ... | |
b08ab10b172b3e7212fd0f5fa92c47394e63ea41b5958fa3182adb24869f6a93 | pmatos/darwin | info.rkt | #lang info
(define version "0.1")
(define collection 'multi)
(define deps '(["base" #:version "6.2"]
"find-parent-dir"
"html-lib"
["markdown-ng" #:version "0.1"]
"txexpr"
"racket-index"
["rackjure" #:version "0.9"]
... | null | https://raw.githubusercontent.com/pmatos/darwin/311df33cc83f67859ed9db8b236d227dec83d895/info.rkt | racket | #lang info
(define version "0.1")
(define collection 'multi)
(define deps '(["base" #:version "6.2"]
"find-parent-dir"
"html-lib"
["markdown-ng" #:version "0.1"]
"txexpr"
"racket-index"
["rackjure" #:version "0.9"]
... | |
1a095cfb66c8f76a0c8009732cc4f95b5d0a44571bcd6187aa553473980359ca | msantos/tunctl | br.erl | -module(br).
-export([start/0, start/1]).
start() ->
start(["erlbr0", "erl0"]).
start(Ifaces) ->
Switch ports
Dev = [ begin
{ok, N} = tuncer:create(Iface, [tap, no_pi, {active, true}]),
N
end || Iface <- Ifaces ],
switch(Dev).
switch(Dev) ->
receive
{tuntap, Port, Da... | null | https://raw.githubusercontent.com/msantos/tunctl/26c42df28a1734750c992c3a8d954335b57088ac/examples/br.erl | erlang | Data received on port: flood to all other ports and uplink | -module(br).
-export([start/0, start/1]).
start() ->
start(["erlbr0", "erl0"]).
start(Ifaces) ->
Switch ports
Dev = [ begin
{ok, N} = tuncer:create(Iface, [tap, no_pi, {active, true}]),
N
end || Iface <- Ifaces ],
switch(Dev).
switch(Dev) ->
receive
{tuntap, Port, Da... |
ed7c731c76610a7a7fcff6b75e0e1104ed2ffe7c5bb3b953b861683631507a9d | ciderpunx/57-exercises-for-programmers | P26PayOffSpec.hs | module P26PayOffSpec (main,spec) where
import Test.Hspec
import Test.Hspec.QuickCheck
import P26PayOff hiding (main)
import Data.List (sort)
import Control.Exception (evaluate)
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "monthsToPayOff" $ do
it "works for book example" $ do
monthsToP... | null | https://raw.githubusercontent.com/ciderpunx/57-exercises-for-programmers/25958ab80cc3edc29756d3bddd2d89815fd390bf/test/P26PayOffSpec.hs | haskell | module P26PayOffSpec (main,spec) where
import Test.Hspec
import Test.Hspec.QuickCheck
import P26PayOff hiding (main)
import Data.List (sort)
import Control.Exception (evaluate)
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "monthsToPayOff" $ do
it "works for book example" $ do
monthsToP... | |
14b8f2917aba914413b8ad830cb69eb33bba6acfc1e634409d4de36af8e32683 | rkaippully/webgear | Path.hs | -- |
Copyright : ( c ) , 2020
-- License : MPL-2.0
-- Maintainer :
--
module Unit.Trait.Path
( tests
) where
import Control.Monad.State (evalState)
import Network.Wai (defaultRequest)
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (assertFailure, testCase, (@?=))
import... | null | https://raw.githubusercontent.com/rkaippully/webgear/db122125c35e5853251bfd68a0e5222fafd6cd49/webgear-server/test/Unit/Trait/Path.hs | haskell | |
License : MPL-2.0
Maintainer :
| Copyright : ( c ) , 2020
module Unit.Trait.Path
( tests
) where
import Control.Monad.State (evalState)
import Network.Wai (defaultRequest)
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.HUnit (assertFailure, testCase, (@?=))
import WebGear.Middlewares.Path
import WebGear.Trait
import WebGear... |
2086cda834944babb884d41d5e2825a03d775fd4636c4a1cb510052ffb2526e0 | coq/coq | miscprint.ml | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/31f1f391e9898c42ff8584fb291c43c1e310867a/proofs/miscprint.ml | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
e6effa4ccf5db71998345134c10e86330504a7323cea7312a0def121a991c88d | LaurentMazare/ocaml-wasmtime | import.ml | open! Base
module W = Bindings.C (Wasmtime_generated)
exception Trap of { message : string }
(* Taken from [Core_kernel.Gc]. *)
let zero = Sys.opaque_identity (Caml.int_of_string "0")
(* The compiler won't optimize int_of_string away so it won't
perform constant folding below. *)
let rec keep_alive o = if zero <>... | null | https://raw.githubusercontent.com/LaurentMazare/ocaml-wasmtime/49d3e35676d79d6573600fa4e9ff7460106341e3/src/wrapper/import.ml | ocaml | Taken from [Core_kernel.Gc].
The compiler won't optimize int_of_string away so it won't
perform constant folding below. | open! Base
module W = Bindings.C (Wasmtime_generated)
exception Trap of { message : string }
let zero = Sys.opaque_identity (Caml.int_of_string "0")
let rec keep_alive o = if zero <> 0 then keep_alive (Sys.opaque_identity o)
|
fb50628fe81e50073ba6d483863349b6b50f253702e09601636d1b3b0ef4216f | pflanze/chj-schemelib | template.scm | Copyright 2014 - 2018 by < >
;;; This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
;;; (at your option) any later version.
;; Code temp... | null | https://raw.githubusercontent.com/pflanze/chj-schemelib/59ff8476e39f207c2f1d807cfc9670581c8cedd3/template.scm | scheme | This file is free software; you can redistribute it and/or modify
(at your option) any later version.
Code templates:
A code template consists of named template arguments (symbols), and
as substrings in symbols or strings. Replacements are done on an
s-expression basis, not Scheme AST. Also, substring match... | Copyright 2014 - 2018 by < >
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
the code containing these symbols either directly ( as in |eq?| ) or
like $ T$ or < T > .
[ 1 ] One could change the imp... |
01c27a3395f0e1e55c75b99e3f86c696fd7eb01d81da9c143a9402f58955ab3f | vascokk/NumEr | numer_sup.erl |
-module(numer_sup).
-behaviour(supervisor).
%% API
-export([start_link/0]).
%% Supervisor callbacks
-export([init/1]).
%% Helper macro for declaring children of supervisor
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
%% ============================================================... | null | https://raw.githubusercontent.com/vascokk/NumEr/0d22c31633ef2ab43dde50809a9dbbb6a736f5b7/src/numer_sup.erl | erlang | API
Supervisor callbacks
Helper macro for declaring children of supervisor
===================================================================
API functions
===================================================================
===================================================================
Supervisor callback... |
-module(numer_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init([]) ->
{ok, { {one_for_one, 5, 10}, []} }.
|
db351d03b624e550a679d4d1e75ed5784e0b3080c6156521c56261ecf51246cb | techascent/tvm-clj | auto_scheduler.clj | (ns tvm-clj.impl.fns.auto_scheduler
(:require [tvm-clj.impl.tvm-ns-fns :as tvm-ns-fns]))
(tvm-ns-fns/export-tvm-functions "auto_scheduler") | null | https://raw.githubusercontent.com/techascent/tvm-clj/1088845bd613b4ba14b00381ffe3cdbd3d8b639e/src/tvm_clj/impl/fns/auto_scheduler.clj | clojure | (ns tvm-clj.impl.fns.auto_scheduler
(:require [tvm-clj.impl.tvm-ns-fns :as tvm-ns-fns]))
(tvm-ns-fns/export-tvm-functions "auto_scheduler") | |
db579e975998c1be0729654bca959cb14325e0f6f91eb4ad13fcad103f316822 | squaresLab/footpatch | candidate.ml | module L = Logging
type prop = Prop.normal Prop.t
let in_reexec : bool ref = ref false
let set_reexec v = in_reexec := v
module Top_down = struct
type t =
{ insn : Sil.instr
; pre : prop
; post : prop list
; f : string option
; loc : Location.t
No obvious way to extract procname from insn so... | null | https://raw.githubusercontent.com/squaresLab/footpatch/8b79c1964d89b833179aed7ed4fde0638a435782/infer/src/footpatch/candidate.ml | ocaml | * Dump all candidates to a DB, using the filename of logs and special
dirname. Triggered through environment variable 'DUMP_CANDS'
we have to manually delete candidates in parallel mode...
* merge store' into !store | module L = Logging
type prop = Prop.normal Prop.t
let in_reexec : bool ref = ref false
let set_reexec v = in_reexec := v
module Top_down = struct
type t =
{ insn : Sil.instr
; pre : prop
; post : prop list
; f : string option
; loc : Location.t
No obvious way to extract procname from insn so... |
af77daa0bdde94b055ca54e2c0473fd92532b5d840d1c8412e6e21ffb4dd5505 | huangz1990/SICP-answers | 9-another-plus.scm | 9-another-plus.scm
(load "9-inc.scm")
(load "9-dec.scm")
(define (plus a b)
(if (= a 0)
b
(plus (dec a) (inc b))))
| null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp1/code/9-another-plus.scm | scheme | 9-another-plus.scm
(load "9-inc.scm")
(load "9-dec.scm")
(define (plus a b)
(if (= a 0)
b
(plus (dec a) (inc b))))
| |
3dcaf4f8d85f8c06ddff7bee6e39e89904550e8eb518a547304853a5092d5dcc | dmitryvk/sbcl-win32-threads | wrapper.lisp | Bits and pieces of the wrapper machninery . This used to live in cache.lisp ,
;;;; but doesn't really logically belong there.
This software is part of the SBCL system . See the README file for
;;;; more information.
This software is derived from software originally released by Xerox
;;;; Corporation. Copyright ... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/src/pcl/wrapper.lisp | lisp | but doesn't really logically belong there.
more information.
Corporation. Copyright and release statements follow. Later modifications
to the software are in the public domain and are provided with
absolutely no warranty. See the COPYING and CREDITS files for more
information.
All rights reserved.
Use and cop... | Bits and pieces of the wrapper machninery . This used to live in cache.lisp ,
This software is part of the SBCL system . See the README file for
This software is derived from software originally released by Xerox
copyright information from original PCL sources :
Copyright ( c ) 1985 , 1986 , 1987 , 1988 , ... |
7535502a89e8f1fcb7e7c0f5baf2d5e392646de455c230e221a8437c7b63ae08 | Incanus3/ExiL | simple.lisp | (in-package :integration-tests)
(declaim (optimize (compilation-speed 0) (debug 3) (space 0) (speed 0)))
(defclass integration-tests (test-case)
((env :accessor env)))
(defmethod set-up ((tests integration-tests))
(defenv int-test)
(setenv int-test)
(setf (env tests) (getenv :int-test)))
(defmethod tear-down... | null | https://raw.githubusercontent.com/Incanus3/ExiL/de0f7c37538cecb7032cc1f2aa070524b0bc048d/src/tests/integration/simple.lisp | lisp | (textui-test-run (get-suite simple-integration-tests)) | (in-package :integration-tests)
(declaim (optimize (compilation-speed 0) (debug 3) (space 0) (speed 0)))
(defclass integration-tests (test-case)
((env :accessor env)))
(defmethod set-up ((tests integration-tests))
(defenv int-test)
(setenv int-test)
(setf (env tests) (getenv :int-test)))
(defmethod tear-down... |
9cb02ff2fb4def48da9f12fa586306f88ef0e331f7659a3d92a18776cf0eaf2e | semerdzhiev/fp-2020-21 | class.rkt | #lang racket
(define graph '(
(ver1 . (ver2 ver3 ver5))
(ver2 . (ver2))
(ver3 . (ver1 ver5))
(ver4 . (ver2 ver3))
(ver5 . (ver1))
)
)
(define (get-edges-from graph vertex)
(let
((edges (assq vertex graph)))
(... | null | https://raw.githubusercontent.com/semerdzhiev/fp-2020-21/64fa00c4f940f75a28cc5980275b124ca21244bc/group-a/Week9/class.rkt | racket | #lang racket
(define graph '(
(ver1 . (ver2 ver3 ver5))
(ver2 . (ver2))
(ver3 . (ver1 ver5))
(ver4 . (ver2 ver3))
(ver5 . (ver1))
)
)
(define (get-edges-from graph vertex)
(let
((edges (assq vertex graph)))
(... | |
df34194a052f9948575669a5c77afe0f6fa9052241c6f80555d55acd5734eae6 | 8c6794b6/guile-tjit | calling.scm | ;;;; calling.scm --- Calling Conventions
;;;;
Copyright ( C ) 1995 , 1996 , 1997 , 2000 , 2001 , 2006 Free Software Foundation , Inc.
;;;;
;;;; This library is free software; you can redistribute it and/or
;;;; modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Fo... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/module/ice-9/calling.scm | scheme | calling.scm --- Calling Conventions
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY o... | Copyright ( C ) 1995 , 1996 , 1997 , 2000 , 2001 , 2006 Free Software Foundation , Inc.
version 3 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth Floor , Boston , USA
(define-module ... |
feabb2eaf67de56a0d9b80a995c80d223c19dbd0c928ca7f107efce99c665e9e | hoodunit/grub | client_sync.cljc | (ns grub.client-sync
(:require [grub.diff :as diff]
[grub.state :as state]
[grub.event :as event]
#?(:cljs [cljs.core.async :as a :refer [<! >! chan]]
:clj [clojure.core.async :as a :refer [<! >! chan go]]))
#?(:cljs (:require-macros [cljs.core.async.macros :refer [go]])))
(def D... | null | https://raw.githubusercontent.com/hoodunit/grub/6e47218c34a724d1123717997eac5e196a5bba9b/src/cljc/grub/client_sync.cljc | clojure | Our state is based on what they think it's based on
Update server state we are based on
Apply changes directly to UI
If there are any diffs to reconcile, they will come back through input buffer
Need to make sure we are in sync, send diff | (ns grub.client-sync
(:require [grub.diff :as diff]
[grub.state :as state]
[grub.event :as event]
#?(:cljs [cljs.core.async :as a :refer [<! >! chan]]
:clj [clojure.core.async :as a :refer [<! >! chan go]]))
#?(:cljs (:require-macros [cljs.core.async.macros :refer [go]])))
(def D... |
4bb6bfcb07e6ba4d22e18f7a0f21ad133967bee65fbe4860bc8e9fcefdb6d22a | racket/web-server | dynamic.rkt | #lang racket/base
(require web-server/servlet-env)
(define (fac n a)
(if (zero? n) a
(fac (sub1 n) (* n a))))
(define (start req)
(number->string (fac 10 1)))
(serve/servlet start
#:servlet-regexp #rx""
#:port 8000
#:command-line? #t)
| null | https://raw.githubusercontent.com/racket/web-server/f718800b5b3f407f7935adf85dfa663c4bba1651/web-server-test/tests/web-server/stress/vs-hop/dynamic.rkt | racket | #lang racket/base
(require web-server/servlet-env)
(define (fac n a)
(if (zero? n) a
(fac (sub1 n) (* n a))))
(define (start req)
(number->string (fac 10 1)))
(serve/servlet start
#:servlet-regexp #rx""
#:port 8000
#:command-line? #t)
| |
2b59bf91a633dcb12689d77fc319fd9f8b9b17c3a68fbec8a27caaa1dc217527 | Vetd-Inc/vetd-app | initiation.cljs | (ns vetd-app.buyers.pages.round-detail.initiation
(:require [vetd-app.common.components :as cc]
[vetd-app.buyers.pages.round-detail.subs :as round-subs]
[vetd-app.ui :as ui]
[vetd-app.util :as util]
[reagent.core :as r]
[re-frame.core :as rf]
[cl... | null | https://raw.githubusercontent.com/Vetd-Inc/vetd-app/9b33b1443b9d84d39305a63fc58119f8e014cf11/src/cljs/app/vetd_app/buyers/pages/round_detail/initiation.cljs | clojure | Events
Components
sanity check
a little easier to read
the ids of the selected topics
(this dumbly actually keeps everything, but that seems fine)
keep options for the current values
idk why 0 width works, but it does | (ns vetd-app.buyers.pages.round-detail.initiation
(:require [vetd-app.common.components :as cc]
[vetd-app.buyers.pages.round-detail.subs :as round-subs]
[vetd-app.ui :as ui]
[vetd-app.util :as util]
[reagent.core :as r]
[re-frame.core :as rf]
[cl... |
41332d6f7c87aad86abafc79cf3d416f1f576a8eca7a5d1e3428ddb4bf5d8ef6 | rabbitmq/rabbitmq-ha | rabbit_mirror_queue_slave_sup.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License at
%% /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/rabbitmq/rabbitmq-ha/ec16a25cc6175f4cdf10421f4ac488090d6a0696/src/rabbit_mirror_queue_slave_sup.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License at
/
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
| The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is VMware , Inc.
Copyright ( c ) 2007 - 2010 VMware , Inc. All rights reserved .
-module(rabbi... |
c98e4b58a9ee207a46e120aab06b494a1e86fef022c08ed31bc76ce8b8a7373f | disteph/cdsat | dSubst.ml | (*************************)
(* Delayed Substitutions *)
(*************************)
open General
open Variables
exception DSubst of string
type 'l t = ('l*World.t) list [@@deriving eq, hash, show]
let get_arity = function
| [] -> World.init
| (_,ar)::_ -> ar
let rec get ppl j d = match d with
| [] -> raise (D... | null | https://raw.githubusercontent.com/disteph/cdsat/1b569f3eae59802148f4274186746a9ed3e667ed/src/kernel/kernel.mld/top.mld/dSubst.ml | ocaml | ***********************
Delayed Substitutions
*********************** | open General
open Variables
exception DSubst of string
type 'l t = ('l*World.t) list [@@deriving eq, hash, show]
let get_arity = function
| [] -> World.init
| (_,ar)::_ -> ar
let rec get ppl j d = match d with
| [] -> raise (DSubst
(Print.toString
(fun f -> f "Attempt... |
2c5d4138b2cedd272c7081be6d55120ae6278001762ec7dbedf32b52d7c75cce | cryptosense/pkcs11 | pkcs11_CK_MECHANISM_INFO.ml | open Ctypes
type _t
type t = _t structure
let ck_mechanism_info : t typ = structure "CK_MECHANISM_INFO"
let ( -: ) ty label = Ctypes_helpers.smart_field ck_mechanism_info label ty
let ulMinKeySize = ulong -: "ulMinKeySize"
let ulMaxKeySize = ulong -: "ulMaxKeySize"
let flags = Pkcs11_CK_FLAGS.typ -: "flags"
let... | null | https://raw.githubusercontent.com/cryptosense/pkcs11/93c39c7a31c87f68f0beabf75ef90d85a782a983/driver/pkcs11_CK_MECHANISM_INFO.ml | ocaml | open Ctypes
type _t
type t = _t structure
let ck_mechanism_info : t typ = structure "CK_MECHANISM_INFO"
let ( -: ) ty label = Ctypes_helpers.smart_field ck_mechanism_info label ty
let ulMinKeySize = ulong -: "ulMinKeySize"
let ulMaxKeySize = ulong -: "ulMaxKeySize"
let flags = Pkcs11_CK_FLAGS.typ -: "flags"
let... | |
b35dc65f730063372820f0676b4864efddc2acf1707d3663593e8760f57987f4 | ijvcms/chuanqi_dev | charge_pp.erl | %%%-------------------------------------------------------------------
%%% @author tuhujia
( C ) 2016 , < COMPANY >
%%% @doc
%%%
%%% @end
Created : 26 . 一月 2016 14:43
%%%-------------------------------------------------------------------
-module(charge_pp).
-include("common.hrl").
-include("record.hrl").
-include... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/business/charge/charge_pp.erl | erlang | -------------------------------------------------------------------
@author tuhujia
@doc
@end
-------------------------------------------------------------------
API
====================================================================
API functions
===============================================================... | ( C ) 2016 , < COMPANY >
Created : 26 . 一月 2016 14:43
-module(charge_pp).
-include("common.hrl").
-include("record.hrl").
-include("proto.hrl").
-include("cache.hrl").
-include("config.hrl").
-include("language_config.hrl").
-export([
handle/3
]).
handle(30001, PlayerState, Data) ->
Key= Data#req_buy_charge.... |
1dcc81992a74fbaf64e5f00aac439a88596f83d19b637c8e116270b31f0d779e | tolitius/chazel | core_test.clj | (ns chazel.core-test
(:require [clojure.test :refer :all]
[chazel.core :refer :all]))
(defn do-work [& args]
(println "printing remotely..." args)
(str "doing work remotely with args: " args))
| null | https://raw.githubusercontent.com/tolitius/chazel/e188effa7712ee6f38998053cb54fce2e191c70e/test/chazel/core_test.clj | clojure | (ns chazel.core-test
(:require [clojure.test :refer :all]
[chazel.core :refer :all]))
(defn do-work [& args]
(println "printing remotely..." args)
(str "doing work remotely with args: " args))
| |
9c419f0f28fbf7d903a84b4af9f85b0f8fd526e942cb841506c2883132344de8 | Viasat/halite | test_prop_abstract.clj | Copyright ( c ) 2022 Viasat , Inc.
Licensed under the MIT license
(ns com.viasat.halite.propagate.test-prop-abstract
(:require [com.viasat.halite.choco-clj-opt :as choco-clj]
[com.viasat.halite.envs :as envs]
[com.viasat.halite.propagate.prop-abstract :as pa]
[com.viasat.halit... | null | https://raw.githubusercontent.com/Viasat/halite/0960db0950835d6e699e4b871f326361eede29f9/test/com/viasat/halite/propagate/test_prop_abstract.clj | clojure | enumerate the discriminator's domain
absence of an alternative in :$if is just absence of a constraint
a concrete bound fixes the type
absence of an alternative in :$in is a constraint
$refines-to constraints get passed down
unqualified :$refines-to applies to all alternatives
TODO: Intersect concrete bounds
{:... | Copyright ( c ) 2022 Viasat , Inc.
Licensed under the MIT license
(ns com.viasat.halite.propagate.test-prop-abstract
(:require [com.viasat.halite.choco-clj-opt :as choco-clj]
[com.viasat.halite.envs :as envs]
[com.viasat.halite.propagate.prop-abstract :as pa]
[com.viasat.halit... |
6846368ba781a7e934bc080229c4c89bfeaca7c5c97ad4e47da9c8331f044eaa | purebred-mua/purebred | Keybindings.hs | -- This file is part of purebred
Copyright ( C ) 2017 - 2019 and
--
-- purebred 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 your option) any later ... | null | https://raw.githubusercontent.com/purebred-mua/purebred/8473998d796dea121ef879c7f7b119284e1511f1/src/Purebred/UI/Index/Keybindings.hs | haskell | This file is part of purebred
purebred is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. ... | Copyright ( C ) 2017 - 2019 and
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
You should have received a copy of the GNU Affero General Public License
# LANGUAGE DataKinds #
# LANGUAGE TypeApplications #
modu... |
7a57d981c26b588d8776869e58eaf1f311f1227181577ba83698d9992c597699 | haskell/cabal | cabal.test.hs | import Test.Cabal.Prelude
-- No synopsis.
main = cabalTest $
fails $ cabal "check" []
| null | https://raw.githubusercontent.com/haskell/cabal/1cfe7c4c7257aa7ae450209d34b4a359e6703a10/cabal-testsuite/PackageTests/Check/ConfiguredPackage/Fields/NoSynopsis/cabal.test.hs | haskell | No synopsis. | import Test.Cabal.Prelude
main = cabalTest $
fails $ cabal "check" []
|
2baba8e1b051f0deaf1012225157c54879aee327b4a88218ed4aa7ea0b25a0e2 | janestreet/incr_dom | entries.ml | open! Async_kernel
open! Core
open! Import
open Js_of_ocaml
let log_s = Async_js.log_s
module Model = struct
type t =
{ entries : Entry.Model.t Entry_id.Map.t
; focus : (Entry_id.t * Focus_point.t option) option
; search_string : string
; visible_range : (Entry_id.t * Entry_id.t) option
}
[@@d... | null | https://raw.githubusercontent.com/janestreet/incr_dom/7aaba451cf76dc493e218d738c6391882b55ef1b/example/entry_table/entries.ml | ocaml | Right now, the incrementality of this is terrible. Waiting on better support from
Incremental. | open! Async_kernel
open! Core
open! Import
open Js_of_ocaml
let log_s = Async_js.log_s
module Model = struct
type t =
{ entries : Entry.Model.t Entry_id.Map.t
; focus : (Entry_id.t * Focus_point.t option) option
; search_string : string
; visible_range : (Entry_id.t * Entry_id.t) option
}
[@@d... |
2b4a7b1d1ba3e2c38c7db6d1f0a4ef76af173b338a753609f2cb14dcd5caa068 | MastodonC/witan.ui | primary.cljs | (ns witan.ui.components.primary
(:require [reagent.core :as r]
[witan.ui.components.icons :as icons]
[witan.ui.data :as data]
[cljs.reader :as reader]
[witan.ui.utils :as utils]
[witan.ui.route :as route]
[witan.ui.strings :refer [get-string]]
... | null | https://raw.githubusercontent.com/MastodonC/witan.ui/5ea6baaff52824ac61737911dd2c11b451157bad/src/cljs/witan/ui/components/primary.cljs | clojure | (ns witan.ui.components.primary
(:require [reagent.core :as r]
[witan.ui.components.icons :as icons]
[witan.ui.data :as data]
[cljs.reader :as reader]
[witan.ui.utils :as utils]
[witan.ui.route :as route]
[witan.ui.strings :refer [get-string]]
... | |
a3f52e4706204f1b863e493170083a10e5a7dbe2d9e88d606cb12aec16561218 | huiqing/percept2 | wrangler_prettypr_v0.erl | %% =====================================================================
Pretty printing of abstract Erlang syntax trees
%%
Copyright ( C ) 1997 - 2002
%%
%% This library is free software; you can redistribute it and/or modify
%% it under the terms of the GNU Lesser General Public License as
published by the Fr... | null | https://raw.githubusercontent.com/huiqing/percept2/fa796a730d6727210a71f185e6a39a960c2dcb90/case_studies/pp_v0/wrangler_prettypr_v0.erl | erlang | =====================================================================
This library is free software; you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License as
License, or (at your option) any later version.
This library is distributed in the hope that it will be useful... | Pretty printing of abstract Erlang syntax trees
Copyright ( C ) 1997 - 2002
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 59 Temple Place , Suite 330 , Boston , MA 02111 - 1307
USA
Modified : 17 Ja... |
a8c860d7bcdd7d364c4aa7855726da7fc75c2a4f21081f66971ba914cec8085b | rlepigre/pml | buckets.ml | open List
type ('a, 'b) t =
{ data : ('a * 'b list) list
; eq : 'a -> 'a -> bool }
type ('a, 'b) buckets = ('a, 'b) t
let empty : ('a -> 'a -> bool) -> ('a, 'b) t = fun eq ->
{ data = [] ; eq }
let add : 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t = fun key v bcks ->
let rec find_and_add acc data =
match dat... | null | https://raw.githubusercontent.com/rlepigre/pml/cdfdea0eecc6767b16edc6a7bef917bc9dd746ed/src/util/buckets.ml | ocaml | open List
type ('a, 'b) t =
{ data : ('a * 'b list) list
; eq : 'a -> 'a -> bool }
type ('a, 'b) buckets = ('a, 'b) t
let empty : ('a -> 'a -> bool) -> ('a, 'b) t = fun eq ->
{ data = [] ; eq }
let add : 'a -> 'b -> ('a, 'b) t -> ('a, 'b) t = fun key v bcks ->
let rec find_and_add acc data =
match dat... | |
3d8d485a5cfd1308dddbf3a88484102c272c25cc5fb6c41f012f2fe9049d4ea5 | imdea-software/leap | PairsInterface.ml |
(***********************************************************************)
(* *)
LEAP
(* *)
, IMDEA ... | null | https://raw.githubusercontent.com/imdea-software/leap/5f946163c0f80ff9162db605a75b7ce2e27926ef/src/theories/pairs/PairsInterface.ml | ocaml | *********************************************************************
... |
LEAP
, IMDEA Software Institute
Copyright 2011 IMDEA Software Institute
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compl... |
c51cbf9d556116a9ac175ff069f46e06af831368685347ef9ca74311278c1e0c | nomeata/arbtt | Cache.hs | module Data.Regex.Cache where
import qualified Text.Regex.PCRE.Light.Text as RE
import qualified Data.MyText as T
import qualified Data.Trie as Trie
import Data.IORef
import System.IO.Unsafe
import Debug.Trace
type RegexMatcher = T.Text -> Maybe [T.Text]
cacheRegex :: Monad m => RE.Regex -> m (T.Text -> Maybe [T.Te... | null | https://raw.githubusercontent.com/nomeata/arbtt/5e9bf42785e075adaa574bf853f7adbc3408e7f4/src/Data/Regex/Cache.hs | haskell | module Data.Regex.Cache where
import qualified Text.Regex.PCRE.Light.Text as RE
import qualified Data.MyText as T
import qualified Data.Trie as Trie
import Data.IORef
import System.IO.Unsafe
import Debug.Trace
type RegexMatcher = T.Text -> Maybe [T.Text]
cacheRegex :: Monad m => RE.Regex -> m (T.Text -> Maybe [T.Te... | |
3c27354c04cd7a35f5defba4438b36f996b1df2c72c8a5aa66d5f46e27069b08 | acl2/acl2 | r1cs-bridge@useless-runes.lsp | (PFCS::R1CS-VEC-ELEM-TO-PFCS
(142 8 (:REWRITE R1CS::PSEUDO-VAR-LISTP-FORWARD-TO-TRUE-LISTP))
(118 8 (:REWRITE R1CS::PSEUDO-VAR-LISTP-WHEN-SYMBOL-LISTP))
(80 16 (:DEFINITION SYMBOL-LISTP))
(64 8 (:REWRITE SET::SETS-ARE-TRUE-LISTS-CHEAP))
(57 15 (:REWRITE SYMBOL-LISTP-OF-CDR-WHEN-SYMBOL-LISTP))
(52 6 (:REWRITE INTE... | null | https://raw.githubusercontent.com/acl2/acl2/f64742cc6d41c35f9d3f94e154cd5fd409105d34/books/kestrel/crypto/pfcs/.sys/r1cs-bridge%40useless-runes.lsp | lisp | (PFCS::R1CS-VEC-ELEM-TO-PFCS
(142 8 (:REWRITE R1CS::PSEUDO-VAR-LISTP-FORWARD-TO-TRUE-LISTP))
(118 8 (:REWRITE R1CS::PSEUDO-VAR-LISTP-WHEN-SYMBOL-LISTP))
(80 16 (:DEFINITION SYMBOL-LISTP))
(64 8 (:REWRITE SET::SETS-ARE-TRUE-LISTS-CHEAP))
(57 15 (:REWRITE SYMBOL-LISTP-OF-CDR-WHEN-SYMBOL-LISTP))
(52 6 (:REWRITE INTE... | |
2abbbe00a291205ccc95f8a39a8d407e6773ba7d0954f0c7239d2ed04b0a968e | Chris00/ocaml-dropbox | chunked_upload.ml | open Lwt
module D = Dropbox_lwt_unix
let upload t fn =
We first open the file and get its size
Lwt_unix.(openfile fn [O_RDONLY] 0) >>= fun fd ->
Lwt_unix.stat fn >>= fun u ->
let size = u.Lwt_unix.st_size in
Use a 1Mb buffer to exert the upload in several chunks on file of
" small " size .
"smal... | null | https://raw.githubusercontent.com/Chris00/ocaml-dropbox/36b222269e6bc7e5486cbb69738841d87a1212fb/tests/chunked_upload.ml | ocaml | Send the whole file in chunks.
Finally, we finish the upload of the file by using
commit_chunked_upload. | open Lwt
module D = Dropbox_lwt_unix
let upload t fn =
We first open the file and get its size
Lwt_unix.(openfile fn [O_RDONLY] 0) >>= fun fd ->
Lwt_unix.stat fn >>= fun u ->
let size = u.Lwt_unix.st_size in
Use a 1Mb buffer to exert the upload in several chunks on file of
" small " size .
"smal... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.