_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 |
|---|---|---|---|---|---|---|---|---|
8c2b6ba3708502bba3ea4a50fcd710738906bf249b8a8642400e8b84c54fba0c | appleshan/cl-http | html-utilities.lisp | -*- Syntax : Ansi - Common - Lisp ; Package : html - parser ; Base : 10 ; Mode : lisp -*-
;;; File: html-utilities.lisp
Last edited by smishra on We d Jul 30 23:22:52 1997
( c ) Copyright 1996 - 97 , ( )
;;; All Rights Reserved
(in-package :html-parser)
;;; Miscellaneous utilities for handling HTML str... | null | https://raw.githubusercontent.com/appleshan/cl-http/a7ec6bf51e260e9bb69d8e180a103daf49aa0ac2/html-parser/v8/html-utilities.lisp | lisp | Package : html - parser ; Base : 10 ; Mode : lisp -*-
File: html-utilities.lisp
All Rights Reserved
Miscellaneous utilities for handling HTML structures
))
))
The parser definition below shall take a string as argument and
return a parsed structure. |
Last edited by smishra on We d Jul 30 23:22:52 1997
( c ) Copyright 1996 - 97 , ( )
(in-package :html-parser)
(defun attr-val (attr tag-data &optional default-value error-if-not-found)
(let ((attr-val (find (if (typep attr 'html-name-token)
attr
(tokenize-name (string attr)))
(attr-values... |
38b109005b5e83d503aa64fdf8f1ea266d910e083e6ec10c2e7fed099661b96e | haskell-effectful/effectful | Effect.hs | module Effectful.Concurrent.Effect
( -- * Effect
Concurrent
-- ** Handlers
, runConcurrent
) where
import Effectful
import Effectful.Dispatch.Static
| Provide the ability to run ' Eff ' computations concurrently in multiple
-- threads and communicate between them.
--
-- /Warning:/ unless you stick to... | null | https://raw.githubusercontent.com/haskell-effectful/effectful/c3f673ed699b684a31f19cfcfb4b49da5353d5ea/effectful/src/Effectful/Concurrent/Effect.hs | haskell | * Effect
** Handlers
threads and communicate between them.
/Warning:/ unless you stick to high level functions from the
'Effectful.Concurrent.Async.withAsync' family, the 'Concurrent' effect makes
it possible to escape the scope of any scoped effect operation. Consider the
following:
>>> import qualified Effe... | module Effectful.Concurrent.Effect
Concurrent
, runConcurrent
) where
import Effectful
import Effectful.Dispatch.Static
| Provide the ability to run ' Eff ' computations concurrently in multiple
> > > printAsk msg = liftIO . . ( msg + + ) . ( " : " + + ) = < < R.ask
runEff . R.runReader " GLOBAL " .... |
79d56f62a04ecc7b128ac4b904dc5e74e617a7e55f31c41a1085c3ad295d2501 | ghc/packages-Cabal | setup.test.hs | import Test.Cabal.Prelude
import Distribution.Version
import Distribution.Simple.LocalBuildInfo
import Distribution.Package
import Distribution.PackageDescription
import Distribution.Types.UnqualComponentName
import Control.Monad.IO.Class
import Distribution.Simple.Configure
main = setupAndCabalTest $ do
assertOu... | null | https://raw.githubusercontent.com/ghc/packages-Cabal/6f22f2a789fa23edb210a2591d74ea6a5f767872/cabal-testsuite/PackageTests/TestStanza/setup.test.hs | haskell | NB: Not testing targetBuildDepends (testBuildInfo gotTestSuite)
as dependency varies with cabal-install | import Test.Cabal.Prelude
import Distribution.Version
import Distribution.Simple.LocalBuildInfo
import Distribution.Package
import Distribution.PackageDescription
import Distribution.Types.UnqualComponentName
import Control.Monad.IO.Class
import Distribution.Simple.Configure
main = setupAndCabalTest $ do
assertOu... |
b48788aa0f4085a29d8c14b6654feb596de4061d01475a0953bd3a20470e4505 | EFanZh/EOPL-Exercises | exercise-1.26.rkt | #lang eopl
Exercise 1.26 [ ★ ★ ] ( up lst ) removes a pair of parentheses from each top - level element of lst . If a top - level element
is not a list , it is included in the result , as is . The value of ( up ( down lst ) ) is equivalent to lst , but
( down ( up lst ) ) is not necessarily lst . ( See exercise ... | null | https://raw.githubusercontent.com/EFanZh/EOPL-Exercises/11667f1e84a1a3e300c2182630b56db3e3d9246a/solutions/exercise-1.26.rkt | racket |
(1 2 3 4)
> (up '((x (y)) z))
(x (y) z) | #lang eopl
Exercise 1.26 [ ★ ★ ] ( up lst ) removes a pair of parentheses from each top - level element of lst . If a top - level element
is not a list , it is included in the result , as is . The value of ( up ( down lst ) ) is equivalent to lst , but
( down ( up lst ) ) is not necessarily lst . ( See exercise ... |
ec298a87aa784bb298e5ae9aaf1ab0088d30d268087d928a0776f40aa4ef2b83 | marick/Midje | used_with_protocols.clj | (ns as-documentation.prerequisites.used-with-protocols
(:require [midje.sweet :refer :all]
[midje.test-util :refer :all]
[midje.open-protocols :refer :all]))
Clojure inlines deftype and defrecord functions for speed . Consider this protocol and record :
(defprotocol Addable
(add-fields [... | null | https://raw.githubusercontent.com/marick/Midje/2b9bcb117442d3bd2d16446b47540888d683c717/test/as_documentation/prerequisites/used_with_protocols.clj | clojure | Although add-fields is now a defined var...
... you cannot use it as a prerequisite: the changed behavior isn't noticed.
In order to override the default add-fields, we have to fake out the inlining. That's done with the
Now the prerequisite works:
You can also use the "-openly" suffix with deftypes. There's an ex... | (ns as-documentation.prerequisites.used-with-protocols
(:require [midje.sweet :refer :all]
[midje.test-util :refer :all]
[midje.open-protocols :refer :all]))
Clojure inlines deftype and defrecord functions for speed . Consider this protocol and record :
(defprotocol Addable
(add-fields [... |
c93534ccca42135c53f8faa57750b1eea25f5de367579bf605f53ad2f1718e54 | cmonty/brainiac | elovation_game.clj | (ns brainiac.plugins.elovation-game
(:import [java.text SimpleDateFormat]
[java.util TimeZone])
(:use [clojure.contrib.json :only (read-json)]
[clojure.java.io :only (reader)])
(:require [brainiac.plugin :as brainiac]
[brainiac.helpers.gravatar :as gravatar]))
(def parse-time-forma... | null | https://raw.githubusercontent.com/cmonty/brainiac/f0e1e1e112e1b10f3f135d959c34aa8b7f2ca086/src/brainiac/plugins/elovation_game.clj | clojure | (ns brainiac.plugins.elovation-game
(:import [java.text SimpleDateFormat]
[java.util TimeZone])
(:use [clojure.contrib.json :only (read-json)]
[clojure.java.io :only (reader)])
(:require [brainiac.plugin :as brainiac]
[brainiac.helpers.gravatar :as gravatar]))
(def parse-time-forma... | |
ad25feae1c5ae05849abbbed41dd8ea3a51282f04c9cd30c187b67132695b7d9 | benzap/eden | utils.cljc | (ns eden-test.utils
(:require
[clojure.test :refer [deftest is testing are]]
[eden.core :as eden :include-macros true]))
(defmacro teval [& tokens]
`(eden/eval ~@tokens))
( teval x = 5 )
(defmacro teval-expression [& tokens]
`(eden/eval-expression ~@tokens))
;;(teval-expression 2 + 2)
(defmacro ar... | null | https://raw.githubusercontent.com/benzap/eden/dbfa63dc18dbc5ef18a9b2b16dbb7af0e633f6d0/test/eden_test/utils.cljc | clojure | (teval-expression 2 + 2) | (ns eden-test.utils
(:require
[clojure.test :refer [deftest is testing are]]
[eden.core :as eden :include-macros true]))
(defmacro teval [& tokens]
`(eden/eval ~@tokens))
( teval x = 5 )
(defmacro teval-expression [& tokens]
`(eden/eval-expression ~@tokens))
(defmacro are-eq* [& body]
`(are [x# ... |
f23bdb1903a8516a43061d7995d7d9cd0e5f2fe09bd0b69ba7c9ecb29c72f041 | slipstream/SlipStreamServer | virtual_machine_mapping_lifecycle_test.clj | (ns com.sixsq.slipstream.ssclj.resources.virtual-machine-mapping-lifecycle-test
(:require
[clojure.data.json :as json]
[clojure.test :refer :all]
[com.sixsq.slipstream.ssclj.app.params :as p]
[com.sixsq.slipstream.ssclj.middleware.authn-info-header :refer [authn-info-header]]
[com.sixsq.slipstream... | null | https://raw.githubusercontent.com/slipstream/SlipStreamServer/3ee5c516877699746c61c48fc72779fe3d4e4652/cimi-resources/test/com/sixsq/slipstream/ssclj/resources/virtual_machine_mapping_lifecycle_test.clj | clojure | admin collection query should succeed but be empty (no records created yet)
normal collection query should not succeed
anonymous collection query should not succeed
creating a virtual machine mapping as a normal user should fail
create a vm as a normal user
adding the same resource again should give a conflict
... | (ns com.sixsq.slipstream.ssclj.resources.virtual-machine-mapping-lifecycle-test
(:require
[clojure.data.json :as json]
[clojure.test :refer :all]
[com.sixsq.slipstream.ssclj.app.params :as p]
[com.sixsq.slipstream.ssclj.middleware.authn-info-header :refer [authn-info-header]]
[com.sixsq.slipstream... |
495d47d4df65a42e58ec6cc4890ef862ecec91729588f1982f4dc26b7b212fc1 | distrap/lambdadrive | EncoderTest.hs |
module Main where
import Ivory.Tower.Config
import Ivory.OS.FreeRTOS.Tower.STM32
import LDrive.Platforms
import LDrive.Tests.Encoder (app)
main :: IO ()
main = compileTowerSTM32FreeRTOS testplatform_stm32 p $
app (stm32config_clock . testplatform_stm32)
testplatform_enc
testplatform_... | null | https://raw.githubusercontent.com/distrap/lambdadrive/2bbf6b173fbc1c6d1f809ee4f95ec0bf737d7064/test/EncoderTest.hs | haskell |
module Main where
import Ivory.Tower.Config
import Ivory.OS.FreeRTOS.Tower.STM32
import LDrive.Platforms
import LDrive.Tests.Encoder (app)
main :: IO ()
main = compileTowerSTM32FreeRTOS testplatform_stm32 p $
app (stm32config_clock . testplatform_stm32)
testplatform_enc
testplatform_... | |
c17578c575de6ebeda164aab66c718eb4c643ae79b37eaea37027f5931634c14 | gmartinezramirez/USACH-Paradigmas-Programacion | P2_PEP1_02_2020_otra_solucion.rkt | #lang racket
;a) Representación TDAs
(define (pelicula id nombre duracion año tags precio)
(list id nombre duracion año tags precio))
(define (usuario rut username password preferencias cartera peliculas)
(list rut username password preferencias cartera peliculas))
(define (lista-peliculas . peliculas) peliculas... | null | https://raw.githubusercontent.com/gmartinezramirez/USACH-Paradigmas-Programacion/e1fdfe7501a156e2e17fcefb8e30068cee3fb44f/2021-02/01-FP/PEPs/02-2020/P2_PEP1_02_2020_otra_solucion.rkt | racket | a) Representación TDAs
c) Comprar película
(define (filtrar-peliculas lista-peliculas c)
(if (null? lista-peliculas)
null
(if (c (car lista-peliculas))
(cons (car lista-peliculas) (filtrar-peliculas (cdr lista-peliculas) c))
(filtrar-peliculas (cdr filtrar-peliculas) c))))
(d... | #lang racket
(define (pelicula id nombre duracion año tags precio)
(list id nombre duracion año tags precio))
(define (usuario rut username password preferencias cartera peliculas)
(list rut username password preferencias cartera peliculas))
(define (lista-peliculas . peliculas) peliculas)
(define (lista-usuari... |
61435d91add52e2001b67d7d0d0fcac2f59e86288ce8cb97f5e2cf08ded1838d | MarcusPlieninger/HtDP_2e_solutions | HtDP_2e_Exercise_012.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname HtDP_2e_Exercise_12) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib... | null | https://raw.githubusercontent.com/MarcusPlieninger/HtDP_2e_solutions/1b25b01ee950034c43cc9a907c4eabae2b5e4dbc/HtDP_2e_Exercise_012.rkt | racket | about the language level of this file in a form that our tools can easily process.
If you have time, consider defining csurface, too.
You can determine the surface of a cube if you know that the square’s area is its length multiplied by itself.
Volume of an equilateral cube
Surface of an equilateral cube
the space th... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname HtDP_2e_Exercise_12) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t constructor repeating-decim... |
cf585fccbb8718e1e8d2137ccf979c307d47d9f991cbec24bdc2f222785458f0 | damianfral/BrainHask | Main.hs | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
module Main where
import Control.Exception (throwIO)
import Control.Monad
import Criterion.Main
import Criterion.Types
import Data.ByteString.Internal
import Data.FileEmbed
import Data.Text (unpack)
import Data.Text.Encoding (decodeUtf8... | null | https://raw.githubusercontent.com/damianfral/BrainHask/eb330ebb6324139bef435cb0ebe0c19521634e30/benchmark/Main.hs | haskell | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
module Main where
import Control.Exception (throwIO)
import Control.Monad
import Criterion.Main
import Criterion.Types
import Data.ByteString.Internal
import Data.FileEmbed
import Data.Text (unpack)
import Data.Text.Encoding (decodeUtf8... | |
ef0cad87ca0ce4490b0e9c814d0ce337a2a0cdc62dd9e27401a24c59f8e984ba | remyzorg/pendulum | main.ml |
open Firebug
let error f = Printf.ksprintf
(fun s -> Firebug.console##error (Js.string s); failwith s) f
let debug f = Printf.ksprintf
(fun s -> Firebug.console##log(Js.string s)) f
let alert f = Printf.ksprintf
(fun s -> Dom_html.window##alert(Js.string s); failwith s) f
let (@>) s coerce =
Js.Opt.get... | null | https://raw.githubusercontent.com/remyzorg/pendulum/a532681c6f99d77129e31fbe27cc56c396a7c63c/examples/checksubmit/main.ml | ocaml |
open Firebug
let error f = Printf.ksprintf
(fun s -> Firebug.console##error (Js.string s); failwith s) f
let debug f = Printf.ksprintf
(fun s -> Firebug.console##log(Js.string s)) f
let alert f = Printf.ksprintf
(fun s -> Dom_html.window##alert(Js.string s); failwith s) f
let (@>) s coerce =
Js.Opt.get... | |
faf38e5087aadf6b993781521777c228961dba1df8a03efaa3fb0276a37b5323 | repl-electric/cassiopeia | sequencer.clj | (ns cassiopeia.engine.sequencer
(:use overtone.live)
(:require [cassiopeia.engine.mixers :as mixers]))
(defsynth phasor-skipping-sequencer
"Supports looping and jumping position"
[buf 0 rate-b 0 out-bus 0 start-point 0 bar-trg [0 :tr] loop? 0 amp 1.0 cb 0]
(let [rate (in:kr rate-b 1)
ph (phasor:ar :t... | null | https://raw.githubusercontent.com/repl-electric/cassiopeia/a42c01752fc8dd04ea5db95c8037f393c29cdb75/src/cassiopeia/engine/sequencer.clj | clojure | (ns cassiopeia.engine.sequencer
(:use overtone.live)
(:require [cassiopeia.engine.mixers :as mixers]))
(defsynth phasor-skipping-sequencer
"Supports looping and jumping position"
[buf 0 rate-b 0 out-bus 0 start-point 0 bar-trg [0 :tr] loop? 0 amp 1.0 cb 0]
(let [rate (in:kr rate-b 1)
ph (phasor:ar :t... | |
ca802ab6a98eb072545433bf2746181f08db398ab68fc696bc9cb4768760c3ef | mrkkrp/modern-uri | QQSpec.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
# LANGUAGE ViewPatterns #
module Text.QQSpec (spec) where
import Test.Hspec
import Text.URI
import qualified Text.URI.QQ as QQ
spec :: Spec
spec = do
describe "uri" $ do
it "works as an expression" ... | null | https://raw.githubusercontent.com/mrkkrp/modern-uri/d39c8b2b1b863ec1c255e533af663a398f2d6347/tests/Text/QQSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE LambdaCase #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
# LANGUAGE ViewPatterns #
module Text.QQSpec (spec) where
import Test.Hspec
import Text.URI
import qualified Text.URI.QQ as QQ
spec :: Spec
spec = do
describe "uri" $ do
it "works as an expression" $ do
let uriQQ = [QQ.uri||]
... |
6d126882ab3a52137b14c6ffeb2a761fe2be41c5c498940f5dbd75b55064debc | viercc/kitchen-sink-hs | readwrite.hs | module Main where
import System.IO
import System.Process
main :: IO ()
main = withFile "hello.txt" ReadWriteMode $ \h -> do
hPutStrLn h "hello"
hFlush h
callProcess "bash" ["-c", "echo foo > hello.txt"]
hSeek h AbsoluteSeek 0
str <- hGetContents' h
print str
| null | https://raw.githubusercontent.com/viercc/kitchen-sink-hs/2919cf37c56dec74a0d74740199d3319e7560a82/execs/readwrite/readwrite.hs | haskell | module Main where
import System.IO
import System.Process
main :: IO ()
main = withFile "hello.txt" ReadWriteMode $ \h -> do
hPutStrLn h "hello"
hFlush h
callProcess "bash" ["-c", "echo foo > hello.txt"]
hSeek h AbsoluteSeek 0
str <- hGetContents' h
print str
| |
1f51519811e82b4e3316be8015d2865f2954e0f30d6402e523d577e18ea106c1 | wjt/bustle | Types.hs | # LANGUAGE GeneralizedNewtypeDeriving , DeriveFunctor #
Bustle . Types : defines types used by Bustle
Copyright ( C ) 2008 Collabora Ltd.
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 Foundat... | null | https://raw.githubusercontent.com/wjt/bustle/0a8cf38db3fbdca4d1501f1effa110448ab219ba/Bustle/Types.hs | haskell | -core suffix.
FIXME: nothing stops someone passing in garbage
vim: sw=2 sts=2 | # LANGUAGE GeneralizedNewtypeDeriving , DeriveFunctor #
Bustle . Types : defines types used by Bustle
Copyright ( C ) 2008 Collabora Ltd.
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 Foundat... |
1a96ce43b3360d078388716374252e0061099ec4c0d2b1be790d57f55f29367f | SahilKang/cl-avro | map.lisp | Copyright 2021 Google LLC
;;;
;;; This file is part of cl-avro.
;;;
;;; cl-avro 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 your option) any later version.
;... | null | https://raw.githubusercontent.com/SahilKang/cl-avro/70fcaa32514cfb59b75812b2eab45ed24cce9d27/src/complex/map.lisp | lisp |
This file is part of cl-avro.
cl-avro is free software: you can redistribute it and/or modify
(at your option) any later version.
cl-avro is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See t... | Copyright 2021 Google LLC
it under the terms of the GNU 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 General Public License
(in-package #:cl-user)
(defpackage #:cl-avro.internal.map
(:use #:cl)
(:shadow... |
e439cffcc137a01516ff799ee5c58d48d1787f4187cb05d2e44234b9b3a07611 | deadpendency/deadpendency | RepoStatsResult.hs | module Common.GitHub.RepoStats.Model.RepoStatsResult
( RepoStatsResult (..),
)
where
import Common.Aeson.Aeson
import Common.Model.Dependency.Repo.DependencyRepoStats
import Data.Aeson
newtype RepoStatsResult = RepoStatsResult
{ _dependencyRepoStats :: Maybe DependencyRepoStats
}
deriving stock (Eq, Show, G... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/common/src/Common/GitHub/RepoStats/Model/RepoStatsResult.hs | haskell | module Common.GitHub.RepoStats.Model.RepoStatsResult
( RepoStatsResult (..),
)
where
import Common.Aeson.Aeson
import Common.Model.Dependency.Repo.DependencyRepoStats
import Data.Aeson
newtype RepoStatsResult = RepoStatsResult
{ _dependencyRepoStats :: Maybe DependencyRepoStats
}
deriving stock (Eq, Show, G... | |
b965eaa00002c6651bae8953d98dde54faacd42248f0f77176b6afecfa11b55a | sabine/ocaml-to-wasm | test.ml | let f = ref 4
let g = (+) !f | null | https://raw.githubusercontent.com/sabine/ocaml-to-wasm/de98909a3ce3e902c4d18852a142c33ae75f7285/tests/b01_closures/test.ml | ocaml | let f = ref 4
let g = (+) !f | |
761449410917848753310cc04c329ba8722e821cddb99e0feeaf3886534cb877 | MastodonC/witan.ui | data_select.clj | (ns witan.ui.style.components.data-select
(:require [garden.units :refer [px em percent]]
[witan.ui.style.colour :as colour]
[witan.ui.style.values :as values]))
(def style [[:#data-select
[:#no-data
{:margin (em 1)}]
[:table
{:width (perc... | null | https://raw.githubusercontent.com/MastodonC/witan.ui/5ea6baaff52824ac61737911dd2c11b451157bad/src/styles/witan/ui/style/components/data_select.clj | clojure | (ns witan.ui.style.components.data-select
(:require [garden.units :refer [px em percent]]
[witan.ui.style.colour :as colour]
[witan.ui.style.values :as values]))
(def style [[:#data-select
[:#no-data
{:margin (em 1)}]
[:table
{:width (perc... | |
59fba7ea70860ea3c0c6353d3ac9ae58afce19888dfdc3ad50681eb8184a7127 | quil-lang/quilc | pauli.lisp | ;;;; src/discrete/operators/pauli.lisp
;;;;
Author :
(cl:in-package #:cl-quil.discrete/operators)
Wrapper around Quilc 's groups
(has-singleton Pauli)
(coalton-toplevel
(repr :native cl-quil.clifford:pauli)
(define-type (Pauli :a))
(define (pauli-phase-factor p)
(RootUnity4
(modulo
(lis... | null | https://raw.githubusercontent.com/quil-lang/quilc/0561b21bf6c60924b0437d8d7de73310b1f4ad34/src/discrete/operators/pauli.lisp | lisp | src/discrete/operators/pauli.lisp
| Author :
(cl:in-package #:cl-quil.discrete/operators)
Wrapper around Quilc 's groups
(has-singleton Pauli)
(coalton-toplevel
(repr :native cl-quil.clifford:pauli)
(define-type (Pauli :a))
(define (pauli-phase-factor p)
(RootUnity4
(modulo
(lisp Integer (p)
(cl-quil.clifford::pha... |
3e94441e1b13da71de9f2c038b0c4dcbe5a964305715b46d9ddb41e6b6343e17 | kayhide/wakame | Main.hs | import Test.DocTest
main :: IO ()
main = doctest $ ["src", "test/examples"] <> extensions
extensions :: [String]
extensions =
[ "-XBangPatterns"
, "-XBinaryLiterals"
, "-XConstraintKinds"
, "-XDataKinds"
, "-XDefaultSignatures"
, "-XDeriveAnyClass"
, "-XDeriveDataTypeable"
, "-XDeriveFoldable"
, "-X... | null | https://raw.githubusercontent.com/kayhide/wakame/4d16ecf2221655300b5db588c2775cfc0b8d92cd/test/doctest/Main.hs | haskell | import Test.DocTest
main :: IO ()
main = doctest $ ["src", "test/examples"] <> extensions
extensions :: [String]
extensions =
[ "-XBangPatterns"
, "-XBinaryLiterals"
, "-XConstraintKinds"
, "-XDataKinds"
, "-XDefaultSignatures"
, "-XDeriveAnyClass"
, "-XDeriveDataTypeable"
, "-XDeriveFoldable"
, "-X... | |
2429ddeb2ab3511a6d5999e3d6fa50cd07a7bab83fb54b4b472cc462807eda5f | gebi/jungerl | ipcalc.erl | %%% File : ipcalc.erl
%%% Author : <>
%%% Purpose : various operations on ip addresses/network addresses
Created : 12 May 2003 by < >
%% This module provides various operations and calculations
on
an IP is an arity 4 tuple
-module(ipcalc).
-author('').
Ipaddress - > deep list
format/2, ... | null | https://raw.githubusercontent.com/gebi/jungerl/8f5c102295dbe903f47d79fd64714b7de17026ec/lib/msc/src/ipcalc.erl | erlang | File : ipcalc.erl
Author : <>
Purpose : various operations on ip addresses/network addresses
This module provides various operations and calculations
Ipaddresses, Separator -> deep list
ipaddresses, Separator -> string
string --> Ipaddr
string/bits -> {Net, Mask}
extract the network part of an IP+Ma... | Created : 12 May 2003 by < >
on
an IP is an arity 4 tuple
-module(ipcalc).
-author('').
Ipaddress - > deep list
ipaddress - > string
format to IP / BITS
flat format to IP / BITS
construct the broadcast add from IP+Mask
increment IP by one
size compare IP eq
check if is in a n... |
c82827ccb1a802f4a4b5829148e6fb813c6ccbfb00b9fe10d32244b61a02378b | NetComposer/nksip | nksip_uac_auto_outbound_plugin.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2019 . All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the... | null | https://raw.githubusercontent.com/NetComposer/nksip/7fbcc66806635dc8ecc5d11c30322e4d1df36f0a/src/plugins/nksip_uac_auto_outbound_plugin.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2019 . All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
@private
-module(nksip_uac... |
6c33c2cf1c58164b8ec1af1840c8c3259ee0a63180e4947a06f1d2106a4591db | bmsherman/haskell-matlab | Setup.hs | import Distribution.Simple
import Distribution.Simple.Utils
import Distribution.Simple.Setup
import Distribution.Simple.Program
import Distribution.Simple.LocalBuildInfo
import Distribution.PackageDescription
import Distribution.ModuleName (components)
import Control.Monad
import Data.Maybe
import System.Directory
impo... | null | https://raw.githubusercontent.com/bmsherman/haskell-matlab/21cdb98a2bcf23c90eb31026063f4c3a2cf5da15/Setup.hs | haskell | import Distribution.Simple
import Distribution.Simple.Utils
import Distribution.Simple.Setup
import Distribution.Simple.Program
import Distribution.Simple.LocalBuildInfo
import Distribution.PackageDescription
import Distribution.ModuleName (components)
import Control.Monad
import Data.Maybe
import System.Directory
impo... | |
d452203c1d88d5d9fa96a3bb6daab82fe78b0fff608e6c9a931928a924be5a13 | cojna/iota | GCD.hs | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Data.Monoid.GCD where
import Control.Monad
import Data.Coerce (coerce)
import qualified Data.Foldable as F
import qualified Data.Vector.Generic as G
import qualified Data.Vector.Generic.M... | null | https://raw.githubusercontent.com/cojna/iota/a64e8c5e4dd4f92e5ed3fcd0413be94ef1108f9e/src/Data/Monoid/GCD.hs | haskell | # INLINE (<>) # | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Data.Monoid.GCD where
import Control.Monad
import Data.Coerce (coerce)
import qualified Data.Foldable as F
import qualified Data.Vector.Generic as G
import qualified Data.Vector.Generic.M... |
6af4ac7b3d3a304133ddb63d5e88e336c23cdc1f2e5f407c9891f141859bc22f | patrickt/possession | Terrain.hs | # LANGUAGE ImportQualifiedPost #
module Game.Entity.Terrain
(Tag (..),
Terrain,
wall
) where
import Raw.Types qualified as Color (Color (..))
import Data.Glyph (Glyph (..))
import Data.Position (Position)
import qualified Raw.Types as Raw
import qualified Game.Flag as Flag
import GHC.Generics
import Data.St... | null | https://raw.githubusercontent.com/patrickt/possession/29c84dc2948a0206d859e711eae525e0653d4ef2/src/Game/Entity/Terrain.hs | haskell | # LANGUAGE ImportQualifiedPost #
module Game.Entity.Terrain
(Tag (..),
Terrain,
wall
) where
import Raw.Types qualified as Color (Color (..))
import Data.Glyph (Glyph (..))
import Data.Position (Position)
import qualified Raw.Types as Raw
import qualified Game.Flag as Flag
import GHC.Generics
import Data.St... | |
54e6cf2a12d7f0a42186eb0f3d6ba932acfc2ec7f6c38afbf8cad34d9aa45bda | thierry-martinez/stdcompat | set.mli | module type OrderedType = sig type t val compare : t -> t -> int end
module type S =
sig
type elt
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val i... | null | https://raw.githubusercontent.com/thierry-martinez/stdcompat/83d786cdb17fae0caadf5c342e283c3dcfee2279/interfaces/4.01/set.mli | ocaml | module type OrderedType = sig type t val compare : t -> t -> int end
module type S =
sig
type elt
type t
val empty : t
val is_empty : t -> bool
val mem : elt -> t -> bool
val add : elt -> t -> t
val singleton : elt -> t
val remove : elt -> t -> t
val union : t -> t -> t
val i... | |
f0fa944c831e12761fbdbc6ab00ba074ff458b6dc3676b04ac57b33d0796ac20 | mpardalos/Kima | Tokenizer.hs | module Kima.Syntax.Tokenizer where
import Control.Monad
import Data.Functor
import Data.Char
import GHC.Exts
import Kima.Syntax.Types
import Text.Megaparsec
import Text.Megaparsec.Char as C
hiding ... | null | https://raw.githubusercontent.com/mpardalos/Kima/2d9bfb44d873795108789910c4b374059786c0e4/src/Kima/Syntax/Tokenizer.hs | haskell | Base combinators
Literals
Reserved words and symbols
| A type that can be parsed as a simple string
| The canonical representation of the token
| The parser for a given token. Defined in terms of 'toString'
Reserved words
Symbols | module Kima.Syntax.Tokenizer where
import Control.Monad
import Data.Functor
import Data.Char
import GHC.Exts
import Kima.Syntax.Types
import Text.Megaparsec
import Text.Megaparsec.Char as C
hiding ... |
7222eee414b791939eb1af356665c534046cd07d96928bd64a7e4e0bb5441b27 | reactiveml/rml | dom.ml | Js_of_ocaml library
* /
* Copyright ( C ) 2010
* Laboratoire PPS - CNRS Université Paris Diderot
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking ... | null | https://raw.githubusercontent.com/reactiveml/rml/d178d49ed923290fa7eee642541bdff3ee90b3b4/toplevel-alt/js/js-of-ocaml/lib/dom.ml | ocaml | Will not happen
* Specification of [Attr] objects.
* Specification of [NamedNodeMap] objects.
* Specification of [Element] objects.
Legacy methods
The function preventDefault must be called explicitely when
using addEventListener...
depending on the internet explorer version, e can be 0, null
or undefine... | Js_of_ocaml library
* /
* Copyright ( C ) 2010
* Laboratoire PPS - CNRS Université Paris Diderot
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking ... |
65aa30c8881901d764a7bd131317e2268281a4b79c8c9a783701f0a69f0c7289 | LeventErkok/hArduino | Comm.hs | -------------------------------------------------------------------------------
-- |
-- Module : System.Hardware.Arduino.Comm
Copyright : ( c )
-- License : BSD3
-- Maintainer :
-- Stability : experimental
--
-- Basic serial communication routines
----------------------------------------------... | null | https://raw.githubusercontent.com/LeventErkok/hArduino/b568087b51b75babb1dc90d3f7a6e7b3c8d134b9/System/Hardware/Arduino/Comm.hs | haskell | -----------------------------------------------------------------------------
|
Module : System.Hardware.Arduino.Comm
License : BSD3
Maintainer :
Stability : experimental
Basic serial communication routines
-----------------------------------------------------------------------------
* The ... | Copyright : ( c )
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -Wno - incomplete - uni - patterns #
module System.Hardware.Arduino.Comm where
import Control.Monad (when, forever)
import Control.Concurrent (MVar, ThreadId, newChan, newMVar, newEmptyMVar, putMVar,... |
24c0c49dd0b79110f6075e364b75d0b304dad146696cf4cee4179e92dc2fa6b2 | instedd/planwise | providers_set.clj | (ns planwise.component.providers-set
(:require [planwise.boundary.providers-set :as boundary]
[integrant.core :as ig]
[clojure.string :refer [includes?]]
[taoensso.timbre :as timbre]
[clojure.data.csv :as csv]
[clojure.java.jdbc :as jdbc]
[clojur... | null | https://raw.githubusercontent.com/instedd/planwise/1bc2a5742ae3dc377dddf1f9e9bb60f0d2f59084/src/planwise/component/providers_set.clj | clojure | ----------------------------------------------------------------------
Auxiliary and utility functions
----------------------------------------------------------------------
Service definition
Pre-processing job implementation
| (ns planwise.component.providers-set
(:require [planwise.boundary.providers-set :as boundary]
[integrant.core :as ig]
[clojure.string :refer [includes?]]
[taoensso.timbre :as timbre]
[clojure.data.csv :as csv]
[clojure.java.jdbc :as jdbc]
[clojur... |
fe685fbc43d5198df71c800d53719df061128e2e255189b206e7a9bf76edc513 | codereport/SICP-2020 | conor_hoekstra_solutions.rkt | #lang racket
(define table (make-hash))
(define (put key1 key2 value) (hash-set! table (list key1 key2) value))
(define (get key1 key2) (hash-ref table (list key1 key2) #f))
;; from previous chapter
(define (apply-generic op . args)
(let ((type-tags (map type-tag args)))
(let ((proc (get op type-tags)))... | null | https://raw.githubusercontent.com/codereport/SICP-2020/2d1e60048db89678830d93fcc558a846b7f57b76/Chapter%202.5%20Solutions/conor_hoekstra_solutions.rkt | racket | from previous chapter
from the book
internal procedures
interface to rest of the system
imported procedures from rectangular and polar packages
internal procedures
interface to rest of the system
put in number package
put in rational package
put in complex package | #lang racket
(define table (make-hash))
(define (put key1 key2 value) (hash-set! table (list key1 key2) value))
(define (get key1 key2) (hash-ref table (list key1 key2) #f))
(define (apply-generic op . args)
(let ((type-tags (map type-tag args)))
(let ((proc (get op type-tags)))
(if proc
... |
79401f9dc0879b47dfddf92ac6a1062162da03c9e058f6eb5905298c85bf6eb6 | zotonic/zotonic | action_admin_modules_module_toggle.erl | @author < >
2009
Date : 2009 - 06 - 11
@doc Activate / dactivate a module
Copyright 2009
%%
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
%%
%% Unles... | null | https://raw.githubusercontent.com/zotonic/zotonic/ec05433cffa39b13585ffbbbb50119767cf522fd/apps/zotonic_mod_admin_modules/src/actions/action_admin_modules_module_toggle.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | @author < >
2009
Date : 2009 - 06 - 11
@doc Activate / dactivate a module
Copyright 2009
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(action_admin_modules_module_toggle).
-author("Marc Worrell <... |
75e45ddada80dbc15f12be4e2adbe39ea13a05df74429ee18d212afa0816460f | uw-unsat/serval | c-type.rkt | #lang rosette
(require "common.rkt")
(provide (all-defined-out))
;;; Common
(define ((interpret-shift-immediate op dec-reg) cpu insn imm5 rd imm4:0)
(define xlen (cpu-xlen cpu))
(define imm (zero-extend (concat imm5 imm4:0) (bitvector xlen)))
(core:bug-on (&& (= xlen 32) (! (bvzero? imm5)))
#:... | null | https://raw.githubusercontent.com/uw-unsat/serval/be11ecccf03f81b8bd0557acf8385a6a5d4f51ed/serval/riscv/interp/c-type.rkt | racket | Common
CR-type "Register" instructions
CI-type "Immediate" instructions
decode offset[5] and offset[4:2|7:6]
decode offset[5] and offset[4:3|8:6]
Always sign-extend.
non-zero rd
c.addiw is rv64-only
CSS-type "Stack-relative Store" instructions
decode uimm[5:2|7:6]
decode uimm[5:3|8:6]
decode offset[5:3] and... | #lang rosette
(require "common.rkt")
(provide (all-defined-out))
(define ((interpret-shift-immediate op dec-reg) cpu insn imm5 rd imm4:0)
(define xlen (cpu-xlen cpu))
(define imm (zero-extend (concat imm5 imm4:0) (bitvector xlen)))
(core:bug-on (&& (= xlen 32) (! (bvzero? imm5)))
#:msg (format... |
67bbc51ab6c4c60a357489047a9a3ab72d9e197e3095ec5113a255887ec3bfba | wireless-net/erlang-nommu | snmp_standard_mib.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2012 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pu... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/snmp/src/agent/snmp_standard_mib.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limit... | Copyright Ericsson AB 1996 - 2012 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(snmp_standard_mib).
-include("snm... |
df65f0c2d75cae551b89ed4c9af65ac8e2e20070f7b499b34b05815077985061 | atlas-engineer/nyxt | browser.lisp | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(in-package :nyxt)
(hooks:define-hook-type prompt-buffer (function (prompt-buffer)))
(hooks:define-hook-type resource (function (request-data) (or request-data null)))
(hooks:define-hook-type browser (function (browser)))
(... | null | https://raw.githubusercontent.com/atlas-engineer/nyxt/1e97389e3376e41981ebbcbb5566d6f941724da0/source/browser.lisp | lisp | Hooks follow:
`messages-appender' requires `*browser*' to be initialized.
TODO: Run outside the main loop?
`startup' must be run _after_ this function returns; It's not enough since
the `startup' may invoke the prompt buffer, which cannot be invoked from
the renderer thread: this is why we run the `startup' in a ... | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(in-package :nyxt)
(hooks:define-hook-type prompt-buffer (function (prompt-buffer)))
(hooks:define-hook-type resource (function (request-data) (or request-data null)))
(hooks:define-hook-type browser (function (browser)))
(... |
abf4ea3e291f7f51bc07c05b207a729205d7317ecb1401b9ec7e2c7ce843ad02 | HuwCampbell/orc-haskell | Bytes.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
module Test.Orc.Streams.Bytes where
import qualified Data.Vector.Storable as Storable
import Hedgehog
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import... | null | https://raw.githubusercontent.com/HuwCampbell/orc-haskell/259649bc5fa5c6d8bd850fdad0517af6c028e00e/test/Test/Orc/Streams/Bytes.hs | haskell | # LANGUAGE RankNTypes # | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
module Test.Orc.Streams.Bytes where
import qualified Data.Vector.Storable as Storable
import Hedgehog
import qualified Hedgehog.Gen as Gen
import qualified Hedgehog.Range as Range
import Orc.Prelude
impor... |
2d64a28d4d27f924668a806c4f6c39736b2c185cfea435838d4fbf003105d01d | liquidz/jubot | brain.clj | (ns jubot.brain
"Jubot brain manager."
(:require
[jubot.system :refer [system]]
[jubot.brain.memory :refer [map->MemoryBrain]]
[jubot.brain.redis :refer [map->RedisBrain]])
(:refer-clojure :exclude [set get keys]))
(defn create-brain
"Create the specified brain.
Params
config-option
... | null | https://raw.githubusercontent.com/liquidz/jubot/0a2d7b18db801c3fe72f7ff216e8381df9b40815/src/jubot/brain.clj | clojure | (ns jubot.brain
"Jubot brain manager."
(:require
[jubot.system :refer [system]]
[jubot.brain.memory :refer [map->MemoryBrain]]
[jubot.brain.redis :refer [map->RedisBrain]])
(:refer-clojure :exclude [set get keys]))
(defn create-brain
"Create the specified brain.
Params
config-option
... | |
7fb2a37b801b444231d81c757a4ce60ec0e8b2d717535c994b23c55e522647ff | ocsigen/js_of_ocaml | boyer.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/ocsigen/js_of_ocaml/8eb1e6ec8390c1a7c79691ba2a1657c71b878dd0/benchmarks/sources/ml/boyer.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ I d : boyer.ml 7017 2005 - 08 - 12 ... |
db5b068cb8508119ba91f46587b8de1a3142b6efe5114019ab3f0eb1eda2e570 | inaka/sumo_db | sumo_store.erl | %%% @doc Main interface for stores.
%%%
Copyright 2012 Inaka & lt;> ;
%%%
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 la... | null | https://raw.githubusercontent.com/inaka/sumo_db/080b42480d2fee938e6c2e00b6fef9e6f108ebed/src/sumo_store.erl | erlang | @doc Main interface for stores.
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 th... | Copyright 2012 Inaka & lt;> ;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
< >
-module(sumo_store).
-author("Marcelo Gornstein <>").
-github("").
-license("Apache License 2.0").
-behaviour(gen_server).
-export([... |
c252a376c380f37be292ae8f172850454ca990dc7ebdc7557f7e59a7c9cb4ce5 | ropas/sparrow | instrumentedMem.mli | (***********************************************************************)
(* *)
Copyright ( c ) 2007 - present .
Programming Research Laboratory ( ROPAS ) , Seoul National University .
(* All rights reserved... | null | https://raw.githubusercontent.com/ropas/sparrow/3ec055b8c87b5c8340ef3ed6cde34f5835865b31/src/domain/instrumentedMem.mli | ocaml | *********************************************************************
All rights reserved.
See the LICENSE file for details. ... | Copyright ( c ) 2007 - present .
Programming Research Laboratory ( ROPAS ) , Seoul National University .
This software is distributed under the term of the BSD license .
module type S =
sig
include MapDom.CPO
module Access : Access.S with type Loc.t = A.t and type... |
ed94de1e373136421e594d8f256ca1c20566ee5292b6fe274e8f57124a34edc0 | ulricha/dsh | Kure.hs | module Database.DSH.Common.Kure
( -- * Logging
RewriteLog
, logR
-- * Context Modification
, withContextT
) where
import qualified Data.Sequence as S
import Language.KURE
import Text.PrettyPrint.ANSI.Leijen hiding ((<$>))
import qualified Text.PrettyPrint.ANSI.Leijen ... | null | https://raw.githubusercontent.com/ulricha/dsh/e6cd5c6bea575e62a381e89bfc4cc7cb97485106/src/Database/DSH/Common/Kure.hs | haskell | * Logging
* Context Modification
------------------------------------------------------------------------------
Rewrite logging
------------------------------------------------------------------------------
Context Modification
| Execute a transformation with a given context. | module Database.DSH.Common.Kure
RewriteLog
, logR
, withContextT
) where
import qualified Data.Sequence as S
import Language.KURE
import Text.PrettyPrint.ANSI.Leijen hiding ((<$>))
import qualified Text.PrettyPrint.ANSI.Leijen as P
import Database.DSH.Common.Pret... |
dc1b67c351b272dd0559bab3c74902ca0e63afaf0607c0203cbfc6dc14de92ce | mirage/ocaml-dns | dns_client_mirage.mli | module type S = sig
module Transport : Dns_client.S
with type io_addr = [
| `Plaintext of Ipaddr.t * int
| `Tls of Tls.Config.client * Ipaddr.t * int
]
and type +'a io = 'a Lwt.t
include module type of Dns_client.Make(Transport)
val nameserver_of_string : string ->
(Dns.proto ... | null | https://raw.githubusercontent.com/mirage/ocaml-dns/3e5968d38282ad949aa91527f3046bd7b84c75a8/mirage/client/dns_client_mirage.mli | ocaml | module type S = sig
module Transport : Dns_client.S
with type io_addr = [
| `Plaintext of Ipaddr.t * int
| `Tls of Tls.Config.client * Ipaddr.t * int
]
and type +'a io = 'a Lwt.t
include module type of Dns_client.Make(Transport)
val nameserver_of_string : string ->
(Dns.proto ... | |
60dd3bca585fdc6a1fcaddbdad349980ee9ea7e10d6118f536c8f7eff0205858 | coccinelle/coccinelle | externalanalysis.ml |
* This file is part of Coccinelle , licensed under the terms of the GPL v2 .
* See copyright.txt in the Coccinelle source code for more information .
* The Coccinelle source code can be obtained at
* This file is part of Coccinelle, licensed under the terms of the GPL v2.
* See copyright.txt in the Cocci... | null | https://raw.githubusercontent.com/coccinelle/coccinelle/57cbff0c5768e22bb2d8c20e8dae74294515c6b3/ocaml/externalanalysis.ml | ocaml | provides a search structure for providing a map from posl to
* some value, and search operations that find the nearest posl.
* This is mainly a hack for backwards compatibility with older
* ocaml versions that provide only limited functionality on
* Maps.
throws Not_found if such a key does not exist
throws N... |
* This file is part of Coccinelle , licensed under the terms of the GPL v2 .
* See copyright.txt in the Coccinelle source code for more information .
* The Coccinelle source code can be obtained at
* This file is part of Coccinelle, licensed under the terms of the GPL v2.
* See copyright.txt in the Cocci... |
3123f400e7bf29853562aef79fafc8a24451c96cdd9096c01572c5a91481138e | mirage/ocaml-openflow | ofswitch_config.mli |
* Copyright ( c ) 2011 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/mirage/ocaml-openflow/dcda113745e8edc61b5508eb8ac2d1e864e1a2df/lib/ofswitch_config.mli | ocaml |
* Copyright ( c ) 2011 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | |
1fe994f7fdc8ea4157189c8dabcae4f764a71c8ab2812588db64304c25882760 | aryx/fork-efuns | objects.ml | open Common
let test () =
let clipboard = GData.clipboard Gdk.Atom.clipboard in
if you type after the # it should complete
clipboard#
| null | https://raw.githubusercontent.com/aryx/fork-efuns/8f2f8f66879d45e26ecdca0033f9c92aec2b783d/tests/ml/objects.ml | ocaml | open Common
let test () =
let clipboard = GData.clipboard Gdk.Atom.clipboard in
if you type after the # it should complete
clipboard#
| |
f5072fb6f6c6f2b4d53704ee60a17df126f5e56dfebb9af5ad413069d259cd38 | patricoferris/sesame | responsive.mli | * { 2 Tools for Responsive Web Pages }
This modules contains different tools for building more responsive web
pages . In particular , its biggest selling feature is the responsive images
module which can generate [ < img srcset= ... > ] HTML tags from a source image
i.e. it can create the resca... | null | https://raw.githubusercontent.com/patricoferris/sesame/8521e2a086b49d0bc20f0fca705f07675c52e1ae/src/sesame/responsive.mli | ocaml | * The media type allows you specify how the responsive image generator show
create new resized images allowing with the media conditions to add to the
image srcset attribute.
* A slightly extended image conf, you need to also provide the file to which
the images are relative too.
* [v ~alt ~conf t] ... | * { 2 Tools for Responsive Web Pages }
This modules contains different tools for building more responsive web
pages . In particular , its biggest selling feature is the responsive images
module which can generate [ < img srcset= ... > ] HTML tags from a source image
i.e. it can create the resca... |
296ace9765e44357afedeaf7f4824c1d082ddb52b57913661a9e6fe842ec065d | zellige/hs-geojson | Main.hs | module Main (main) where
-- Local
import qualified Data.Geospatial.Internal.CRSTests as CRS
import qualified Data.Geospatial.Internal.GeoFeatureCollectionTests as FC
import qualified Data.Geospatial.Internal.GeoFeatureTests as F
import qualified Data.Geospatial.Internal.GeometryTests as G
import qualified Data.LineStr... | null | https://raw.githubusercontent.com/zellige/hs-geojson/fb66e4f1b016d8e73408d9faa0945f61253131fa/test/Main.hs | haskell | Local | module Main (main) where
import qualified Data.Geospatial.Internal.CRSTests as CRS
import qualified Data.Geospatial.Internal.GeoFeatureCollectionTests as FC
import qualified Data.Geospatial.Internal.GeoFeatureTests as F
import qualified Data.Geospatial.Internal.GeometryTests as G
import qualified Data.LineStringTests ... |
255e5fd5f7748aaeb1a8cd3b096f57028071dd28222cbf42eff498f09fce75e2 | jaspervdj/digestive-functors | TestSuite.hs | module Main
( main
) where
import Test.Framework (defaultMain)
import qualified Text.Digestive.Field.Tests (tests)
import qualified Text.Digestive.Field.QTests (tests)
import qualified Text.Digestive.Form.Encoding.Tests (tests)
import qualified Text.Digestive.View.Tests (tests)
import qualified Text.Digestive... | null | https://raw.githubusercontent.com/jaspervdj/digestive-functors/5827b47404a93b103cc57ad0f54f4dc0bdf94e24/digestive-functors/tests/TestSuite.hs | haskell | module Main
( main
) where
import Test.Framework (defaultMain)
import qualified Text.Digestive.Field.Tests (tests)
import qualified Text.Digestive.Field.QTests (tests)
import qualified Text.Digestive.Form.Encoding.Tests (tests)
import qualified Text.Digestive.View.Tests (tests)
import qualified Text.Digestive... | |
bf065124ea4dd9b18f72d94c4afead480746587c8154e643a2acd208961dc387 | Jell/euroclojure-2016 | designers.cljs | (ns euroclojure.designers)
(defn slide [{:keys [speaker]}]
[:div.slide.left
(when speaker
[:div "How to empower designers when working with React & ClojureScript?"])
[:h1.centered "Designers, React & ClojureScript"]
[:ul
[:li [:b "Profile 1: "] "Wants to work with PhotoShop"]
[:em "Templates: ... | null | https://raw.githubusercontent.com/Jell/euroclojure-2016/a8ca883e8480a4616ede19995aaacd4a495608af/src/euroclojure/designers.cljs | clojure | (ns euroclojure.designers)
(defn slide [{:keys [speaker]}]
[:div.slide.left
(when speaker
[:div "How to empower designers when working with React & ClojureScript?"])
[:h1.centered "Designers, React & ClojureScript"]
[:ul
[:li [:b "Profile 1: "] "Wants to work with PhotoShop"]
[:em "Templates: ... | |
e3c29ba0c91d60a1a7ba19997335e171676dbf6563065bef67ba14ad00273b74 | NelosG/fp-tests | Spec.hs | # LANGUAGE TemplateHaskell , NegativeLiterals , BlockArguments ,
StandaloneKindSignatures , ConstraintKinds , GeneralizedNewtypeDeriving ,
DerivingStrategies , FlexibleInstances , BangPatterns #
StandaloneKindSignatures, ConstraintKinds, GeneralizedNewtypeDeriving,
... | null | https://raw.githubusercontent.com/NelosG/fp-tests/2997fc0d4cf08fa17dffa00242369ac039e709aa/hw3/baseTests/T9/Spec.hs | haskell | -------------------------
---- NAME CHECKING ------
-------------------------
-------
-------------------------
---- TYPE CHECKING ------
-------------------------
-------------------------
---- PROP CHECKING ------
------------------------- | # LANGUAGE TemplateHaskell , NegativeLiterals , BlockArguments ,
StandaloneKindSignatures , ConstraintKinds , GeneralizedNewtypeDeriving ,
DerivingStrategies , FlexibleInstances , BangPatterns #
StandaloneKindSignatures, ConstraintKinds, GeneralizedNewtypeDeriving,
... |
1cb061495473a6d49cadfa87afcd447b381b4d6e9d6954c0caa7b8c7c8a2e2af | iustin/corydalis | Development.hs |
Copyright ( C ) 2013
This program 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 version .
This program is distributed i... | null | https://raw.githubusercontent.com/iustin/corydalis/43f8bf004904847fad43c428a9e1b20e67da964d/src/Settings/Development.hs | haskell | | Suffix to use for file names which depend on version.
The idea is to be able to share a cache between production and
development, and have both versions running, without conflicts for
files whose format changes over time (like the binary exif cache
files). |
Copyright ( C ) 2013
This program 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 version .
This program is distributed i... |
43c7a8215646554b711e7c480c2f68d1b854328229c845decc252fd350239718 | gildor478/ocaml-gettext | gui.ml | (**************************************************************************)
(* ocaml-gettext: a library to translate messages *)
(* *)
Copyright ( C ) 2003 - 2008 < >
(* ... | null | https://raw.githubusercontent.com/gildor478/ocaml-gettext/9b7afc702bccace9a544b8efa2a28bc2b13371ed/examples/gui/gui.ml | ocaml | ************************************************************************
ocaml-gettext: a library to translate messages
This library is free softw... | Copyright ( C ) 2003 - 2008 < >
License as published by the Free Software Foundation ; either
version 2.1 of the License , or ( at your option ) any later version ;
You should have received a copy of the GNU Lesser General Public
License along with this library ; if not ,... |
acf6f5ad2c33ba5341d690f2913687e7aab11308c13a40cdd5fb77c240fa0a52 | NorfairKing/habitscipline | Gen.hs | # LANGUAGE FlexibleInstances #
# OPTIONS_GHC -fno - warn - orphans #
module Habitscipline.API.Server.Data.Gen where
import Control.Monad
import qualified Data.ByteString as SB
import Data.GenValidity
import Data.GenValidity.Mergeful ()
import Data.GenValidity.Persist ()
import Data.GenValidity.Text ()
import Data.Pas... | null | https://raw.githubusercontent.com/NorfairKing/habitscipline/56637f324fbdf9c7983c2180fcdea89518e27500/habitscipline-api-server-data-gen/src/Habitscipline/API/Server/Data/Gen.hs | haskell | No use
No use
No use | # LANGUAGE FlexibleInstances #
# OPTIONS_GHC -fno - warn - orphans #
module Habitscipline.API.Server.Data.Gen where
import Control.Monad
import qualified Data.ByteString as SB
import Data.GenValidity
import Data.GenValidity.Mergeful ()
import Data.GenValidity.Persist ()
import Data.GenValidity.Text ()
import Data.Pas... |
9b65ff0a77f5aa690f87d8d72f20eca3b7171549a77792c0b4fef0edf4bbfe12 | haskell-works/avro | Writer.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
# LANGUAGE TemplateHaskell #
module Avro.Deconflict.C.Writer where
import Data.Avro.Deriving
deriveAvroFromByteString [r|
[
{
"type": "record",
"name": "Foo",
"namespace": "avro.test",
"fields": [
{ "... | null | https://raw.githubusercontent.com/haskell-works/avro/9eb4970fd72939a68aa6f947d3d2dc17280352f8/test/Avro/Deconflict/C/Writer.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE QuasiQuotes # | # LANGUAGE DeriveGeneric #
# LANGUAGE TemplateHaskell #
module Avro.Deconflict.C.Writer where
import Data.Avro.Deriving
deriveAvroFromByteString [r|
[
{
"type": "record",
"name": "Foo",
"namespace": "avro.test",
"fields": [
{ "name": "fieldA",
"type": ["null", {
"type": "record",
... |
cfaa7582640dc6ee2cd834077fe93a4d6974a8939d36522c445c77f25af42f6c | icfpcontest2021/icfpcontest2021.github.io | RandomMany.hs | -- |
# LANGUAGE ScopedTypeVariables #
module BrainWall.Main.RandomMany where
import qualified BrainWall.Main.RandomProblem as RP
import BrainWall.Random
import Control.Monad
import qualified Data.UUID as UUID
import qualified Data.UUID.V4 as UUID
import qualified Data.Vector as V
import Data.Word
import qualified Opt... | null | https://raw.githubusercontent.com/icfpcontest2021/icfpcontest2021.github.io/fb23fea2a8ecec7740017d3dda78d921c1df5a26/toolchain/lib/BrainWall/Main/RandomMany.hs | haskell | | | # LANGUAGE ScopedTypeVariables #
module BrainWall.Main.RandomMany where
import qualified BrainWall.Main.RandomProblem as RP
import BrainWall.Random
import Control.Monad
import qualified Data.UUID as UUID
import qualified Data.UUID.V4 as UUID
import qualified Data.Vector as V
import Data.Word
import qualified Options.... |
8743d00227ffb7482ebcf1de1886458ae6961b2e1419daf816950b5aec253760 | haskus/packages | Variant.hs | # LANGUAGE DataKinds #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeApplications #
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE UndecidableInstances #
# LANGUAGE ScopedTypeVariables #
module Variant
( testsVariant
)
where
import Test.Tasty
import Test.Tast... | null | https://raw.githubusercontent.com/haskus/packages/40ea6101cea84e2c1466bc55cdb22bed92f642a2/haskus-utils-variant/src/tests/Variant.hs | haskell | # LANGUAGE ConstraintKinds # | # LANGUAGE DataKinds #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeApplications #
# LANGUAGE FlexibleInstances #
# LANGUAGE UndecidableInstances #
# LANGUAGE ScopedTypeVariables #
module Variant
( testsVariant
)
where
import Test.Tasty
import Test.Tasty.QuickCheck as QC
import Data.Ei... |
cc26bb66b5cc9d2acbbfa8c482170c83e0cdf057cd48dd3ecac9308027e6d494 | cj1128/sicp-review | fixed-point.scm | (define tolerance 0.00001)
(define (fixed-point f first-guess)
(define (close-enough? x y)
(< (abs (- x y)) tolerance))
(define (try guess)
(let ((next (f guess)))
(if (close-enough? guess next)
guess
(try next))))
(try first-guess))
| null | https://raw.githubusercontent.com/cj1128/sicp-review/efaa2f863b7f03c51641c22d701bac97e398a050/chapter-1/1.3/fixed-point.scm | scheme | (define tolerance 0.00001)
(define (fixed-point f first-guess)
(define (close-enough? x y)
(< (abs (- x y)) tolerance))
(define (try guess)
(let ((next (f guess)))
(if (close-enough? guess next)
guess
(try next))))
(try first-guess))
| |
5d43067f9dcdd3ca3ad66cc997c2cb52b710d1c664cc4fa2d1f670f7bc6a6131 | BitGameEN/bitgamex | toppage_handler.erl | %% Feel free to use, reuse and abuse the code in this file.
%% @doc Cookie handler.
-module(toppage_handler).
-export([init/2]).
init(Req0, Opts) ->
NewValue = integer_to_list(rand:uniform(1000000)),
Req1 = cowboy_req:set_resp_cookie(<<"server">>, NewValue,
Req0, #{path => <<"/">>}),
#{client := ClientCookie, s... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/deps/cowboy/examples/cookie/src/toppage_handler.erl | erlang | Feel free to use, reuse and abuse the code in this file.
@doc Cookie handler. |
-module(toppage_handler).
-export([init/2]).
init(Req0, Opts) ->
NewValue = integer_to_list(rand:uniform(1000000)),
Req1 = cowboy_req:set_resp_cookie(<<"server">>, NewValue,
Req0, #{path => <<"/">>}),
#{client := ClientCookie, server := ServerCookie}
= cowboy_req:match_cookies([{client, [], <<>>}, {server, []... |
ca1e9f49a9ef97b4336e516d85aedffd5747231d7b547300aed64b702ac42837 | melusina-org/cl-rashell | rashell.lisp | rashell.lisp — Resilient replicant Shell Programming Library for Common Lisp
;;;; Rashell (-org/cl-rashell)
This file is part of Rashell .
;;;;
Copyright © 2017–2022
;;;; All rights reserved.
This file must be used under the terms of the MIT License .
;;;; This source file is licensed as described in the f... | null | https://raw.githubusercontent.com/melusina-org/cl-rashell/42b6842c1507518da51a277e60f4c3371097656f/src/rashell.lisp | lisp | Rashell (-org/cl-rashell)
All rights reserved.
This source file is licensed as described in the file LICENSE, which
you should have received as part of this distribution. The terms
are also available at
Signal Table
The COMMAND class
Starting and controlling external programs associated to a command
... | rashell.lisp — Resilient replicant Shell Programming Library for Common Lisp
This file is part of Rashell .
Copyright © 2017–2022
This file must be used under the terms of the MIT License .
(in-package #:org.melusina.rashell)
(defparameter *signal-table*
(append
'((:hangup . 1)
(:interrupt . 2... |
ed7fef9be9e4b6d6e5407dffc3d2e496f463abb2123e502e50fd64e04bb805d7 | arttuka/reagent-material-ui | styled_engine_provider.cljs | (ns reagent-mui.material.styled-engine-provider
"Imports @mui/material/StyledEngineProvider as a Reagent component.
Original documentation is at -ui/api/styled-engine-provider/ ."
(:require [reagent.core :as r]
["@mui/material/StyledEngineProvider" :as MuiStyledEngineProvider]))
(def styled-engine-p... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/core/reagent_mui/material/styled_engine_provider.cljs | clojure | (ns reagent-mui.material.styled-engine-provider
"Imports @mui/material/StyledEngineProvider as a Reagent component.
Original documentation is at -ui/api/styled-engine-provider/ ."
(:require [reagent.core :as r]
["@mui/material/StyledEngineProvider" :as MuiStyledEngineProvider]))
(def styled-engine-p... | |
b776458d8d3a9af5687ffe2555f61f406e5b0f5f229458999d0b6070f4043625 | ushitora-anqou/alqo | room_sup.erl | -module(room_sup).
-behaviour(supervisor).
-export([init/1]).
-export([start_link/0, create_room/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
create_room(NumPlayers) ->
supervisor:start_child(?MODULE, [NumPlayers]).
init([]) ->
{ok,
{{simple_one_for_one, 10, 60}, [
... | null | https://raw.githubusercontent.com/ushitora-anqou/alqo/9900172d765100dec40c00a7aec3c2dc971956f1/src/room_sup.erl | erlang | -module(room_sup).
-behaviour(supervisor).
-export([init/1]).
-export([start_link/0, create_room/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
create_room(NumPlayers) ->
supervisor:start_child(?MODULE, [NumPlayers]).
init([]) ->
{ok,
{{simple_one_for_one, 10, 60}, [
... | |
3ea8788eba032b83bb8d7f3c09fab084a1b8cd3ce376d2ef5f93a8ae2fd788bd | david-christiansen/pudding-old | term-pict.rkt | #lang racket
(require pict presentations syntax/parse
"../expand-bindings.rkt" "../metavariables.rkt"
"pict-helpers.rkt" "presentation-types.rkt")
(require (prefix-in pp: pprint))
(provide term->pict)
(define (pprint-term stx canvas bindings)
(-> syntax?
(is-a?/c presentation-pict-canvas%)
... | null | https://raw.githubusercontent.com/david-christiansen/pudding-old/6b9ee633b551226df61d40191bafa14386fc86ad/gui/term-pict.rkt | racket | #lang racket
(require pict presentations syntax/parse
"../expand-bindings.rkt" "../metavariables.rkt"
"pict-helpers.rkt" "presentation-types.rkt")
(require (prefix-in pp: pprint))
(provide term->pict)
(define (pprint-term stx canvas bindings)
(-> syntax?
(is-a?/c presentation-pict-canvas%)
... | |
689cdbd62c0913b9b39d0890343efb9b0991b7a704499957a089e0777962bef2 | cl-axon/cl-paip | compile1.lisp | ;;; -*- Mode: Lisp; Syntax: Common-Lisp; -*-
;;; Code from Paradigms of Artificial Intelligence Programming
Copyright ( c ) 1991
;;;; File compile1.lisp: Simplest version of Scheme compiler
(requires "interp1") ; Uses the Scheme macro facility
(defun comp (x env)
"Compile the expression x into a list of instru... | null | https://raw.githubusercontent.com/cl-axon/cl-paip/5922be8e3aae00197779bad4a05afa8ea1f6b8c9/compile1.lisp | lisp | -*- Mode: Lisp; Syntax: Common-Lisp; -*-
Code from Paradigms of Artificial Intelligence Programming
File compile1.lisp: Simplest version of Scheme compiler
Uses the Scheme macro facility
Procedure application:
Compile args, then fn, then the call
==============================
==============================
==... | Copyright ( c ) 1991
(defun comp (x env)
"Compile the expression x into a list of instructions"
(cond
((symbolp x) (gen-var x env))
((atom x) (gen 'CONST x))
((scheme-macro (first x)) (comp (scheme-macro-expand x) env))
((case (first x)
(QUOTE (gen 'CONST (second x)))
(BEGIN (... |
a4e21f6e0363a3989fe9bcf5fa367c5d57d18fef9d0efab8ec7870d94a19f402 | rvirding/luerl | minibench.erl | File :
Author :
%% File : luerl/examples/minibench/minibench.erl
Purpose : Benchmark for frequent calls to small Luerl scripts
Author :
Use $ cd ./examples / minibench
%% $ erlc minibench.erl
$ erl -pa .. / .. /ebin -s minibench run -s init stop -noshell
%% Or $ ma... | null | https://raw.githubusercontent.com/rvirding/luerl/fc668ef337b04ca2aee83c648cf6853dab8babe6/examples/minibench/minibench.erl | erlang | File : luerl/examples/minibench/minibench.erl
$ erlc minibench.erl
Or $ make minibench
I. eval and execute
II. eval once, then only execute
III. eval once, then only execute
IV. measure but state initialization
V. eval once, then only execute, re-use previous state
VI. measure but parsing
hel... | File :
Author :
Purpose : Benchmark for frequent calls to small Luerl scripts
Author :
Use $ cd ./examples / minibench
$ erl -pa .. / .. /ebin -s minibench run -s init stop -noshell
-module(minibench).
-export([run/0]).
run() ->
io:format("-----------------------------------... |
d4b5d06c59073f013757fbc4fc433975165252e6e23879fed1425f2b0d8e06ab | Opetushallitus/ataru | form_access_control.clj | (ns ataru.forms.form-access-control
(:require
[ataru.forms.form-store :as form-store]
[ataru.schema.form-schema :as form-schema]
[clojure.walk :refer [prewalk]]
[ataru.util :as util]
[ataru.virkailija.editor.form-diff :as form-diff]
[ataru.tarjonta-service.tarjonta-protocol :as tarjonta-protoc... | null | https://raw.githubusercontent.com/Opetushallitus/ataru/878b095e2289cf389d693447ba99adf4b84e03cb/src/clj/ataru/forms/form_access_control.clj | clojure | (ns ataru.forms.form-access-control
(:require
[ataru.forms.form-store :as form-store]
[ataru.schema.form-schema :as form-schema]
[clojure.walk :refer [prewalk]]
[ataru.util :as util]
[ataru.virkailija.editor.form-diff :as form-diff]
[ataru.tarjonta-service.tarjonta-protocol :as tarjonta-protoc... | |
95a27cc30e267c6fc941c3663ec02f9e1147728e0bd336442ee5e745a9d80b6c | helins/kafka.clj | java.clj | (ns dvlopt.kafka.-interop.java
"Convert clojure data structures to java objects."
{:author "Adam Helinski"}
(:require [dvlopt.kafka :as K]
[dvlopt.kafka.-interop :as K.-interop]
[dvlopt.kafka.-interop.clj :as K.-interop.clj]
[dvlopt.void :as vo... | null | https://raw.githubusercontent.com/helins/kafka.clj/ecf688f1a8700491c2cd65bcfb19a3781aa4f575/src/dvlopt/kafka/_interop/java.clj | clojure | For sorting vars in alpĥabetic order.
Private
Keeping track of the number of stores for generating store names.
Contains what is needed besides the key and the value.
Throw if the value is nil.
For missing mandatory arguments.
Generates a name for a state store.
Java standard library
Used by `dvlopt.kstreams/... | (ns dvlopt.kafka.-interop.java
"Convert clojure data structures to java objects."
{:author "Adam Helinski"}
(:require [dvlopt.kafka :as K]
[dvlopt.kafka.-interop :as K.-interop]
[dvlopt.kafka.-interop.clj :as K.-interop.clj]
[dvlopt.void :as vo... |
95f46a15dd3570723c9deafdaf42ecfe8954201db892c64e63e44cc20ba43a3c | mattmundell/nightshade | arith.lisp | ;;; Stuff to handle simple cases for generic arithmetic.
(in-package "SPARC")
;;;; Addition and subtraction.
(define-assembly-routine (generic-+
(:cost 10)
(:return-style :full-call)
(:translate +)
(:policy :safe)
(:save-p t))
((:arg x (descriptor-reg any-reg) a0-offset)
(:arg y (... | null | https://raw.githubusercontent.com/mattmundell/nightshade/d8abd7bd3424b95b70bed599e0cfe033e15299e0/src/assembly/sparc/arith.lisp | lisp | Stuff to handle simple cases for generic arithmetic.
Addition and subtraction.
Multiplication
If either arg is not a fixnum, call the static function.
fixnum tag.
Compute the produce temp * y and return the double-word product
in hi:lo.
sign-extended by the sra instruction above.
Check to see if the result wil... |
(in-package "SPARC")
(define-assembly-routine (generic-+
(:cost 10)
(:return-style :full-call)
(:translate +)
(:policy :safe)
(:save-p t))
((:arg x (descriptor-reg any-reg) a0-offset)
(:arg y (descriptor-reg any-reg) a1-offset)
(:res res (descriptor-reg any-reg) a0-offset)
... |
a9b93c95edba380dd83684110d352fc2af41f60343c3622ee38cbe2998484f0a | haskell-webgear/webgear | Scotty.hs | module Scotty where
import Network.HTTP.Types (noContent204, notFound404)
import Network.Wai
import Web.Scotty
import Model
application :: UserStore -> IO Application
application store = scottyApp $ do
get "/v1/users/:userId" $ getUser store
put "/v1/users/:userId" $ putUser store
delete "/v1/users/:userId" $ ... | null | https://raw.githubusercontent.com/haskell-webgear/webgear/52e90e28d81e4ce6d7c8e63b3f9769f6629b031f/webgear-benchmarks/src/users/Scotty.hs | haskell | module Scotty where
import Network.HTTP.Types (noContent204, notFound404)
import Network.Wai
import Web.Scotty
import Model
application :: UserStore -> IO Application
application store = scottyApp $ do
get "/v1/users/:userId" $ getUser store
put "/v1/users/:userId" $ putUser store
delete "/v1/users/:userId" $ ... | |
94e402f6909a3d0d8a87dde48933089006399f2ae96c5517a360801b61128b66 | awkay/om-tutorial | client_mutation.cljs | (ns om-tutorial.client-mutation
(:require
[om-tutorial.parsing :as p]
[om.next :as om]))
(defmulti mutate om/dispatch)
;"Update the client-local holder for an input in progress"
(defmethod mutate 'app/set-new-person
[{:keys [state] :as env} k {:keys [value]}]
(println "VALUE: " value)
{:action (fn [] ... | null | https://raw.githubusercontent.com/awkay/om-tutorial/83ca10d91380ba62458b98ccaa80fd11b9c8321d/src/main/om_tutorial/client_mutation.cljs | clojure | "Update the client-local holder for an input in progress"
rewrite the save params using local state
"Clear the people, which will trigger a re-read from remote."
"Add a person. Does this locally only, with temporary IDs. These are persisted on save."
(swap! state update-in [:widget :people] (partial remove-person id)... | (ns om-tutorial.client-mutation
(:require
[om-tutorial.parsing :as p]
[om.next :as om]))
(defmulti mutate om/dispatch)
(defmethod mutate 'app/set-new-person
[{:keys [state] :as env} k {:keys [value]}]
(println "VALUE: " value)
{:action (fn [] (swap! state assoc :new-person value))})
(defn ref-to-id [... |
aeee9fc2bf5b5cdeffd1917516f16578705793f55e03bf1daa53c52034450600 | the-dr-lazy/cascade | Config.hs | |
Module : Cascade . CLI.Data . Model . Config
Description : ! ! ! INSERT MODULE SHORT DESCRIPTION ! ! !
Copyright : ( c ) 2020 - 2021 Cascade
License : MPL 2.0
Maintainer : < > ( the-dr-lazy.github.io )
Stability : Stable
Portability : POSIX
! ! ! INSERT MODULE LONG DESCRIPTION !... | null | https://raw.githubusercontent.com/the-dr-lazy/cascade/014a5589a2763ce373e8c84a211cddc479872b44/cascade-cli/src/Cascade/CLI/Data/Model/Config.hs | haskell | |
Module : Cascade . CLI.Data . Model . Config
Description : ! ! ! INSERT MODULE SHORT DESCRIPTION ! ! !
Copyright : ( c ) 2020 - 2021 Cascade
License : MPL 2.0
Maintainer : < > ( the-dr-lazy.github.io )
Stability : Stable
Portability : POSIX
! ! ! INSERT MODULE LONG DESCRIPTION !... | |
8ae7115721dd7c2b6650b88077f5fb1a2a856da3bf55502bc8d29f555383b9f5 | narimiran/AdventOfCode2022 | solutions_tests.clj | (ns solutions-tests
(:require day01 day02 day03 day04 day05
day06 day07 day08 day09 day10
day11 day12 day13 day14 day15
day16 day17 day18 day19 day20
day21 day22 day23 day24 day25
[clojure.test :refer [deftest are run-tests]]))
(defmacro check-day [day tes... | null | https://raw.githubusercontent.com/narimiran/AdventOfCode2022/7a970afa11ca2ccc61b611f36b0601c5401a4f35/clojure/tests/solutions_tests.clj | clojure | hardcoded for real input --> wrong test results | (ns solutions-tests
(:require day01 day02 day03 day04 day05
day06 day07 day08 day09 day10
day11 day12 day13 day14 day15
day16 day17 day18 day19 day20
day21 day22 day23 day24 day25
[clojure.test :refer [deftest are run-tests]]))
(defmacro check-day [day tes... |
90bc6fc576c2461ec299df9fd6865debcf272649d5f29c3f90f16e19e56804b6 | 2600hz/kazoo | kzs_util_tests.erl | %%%-----------------------------------------------------------------------------
( C ) 2010 - 2020 , 2600Hz
%%% @doc
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%%
%%% @end
%%%--------... | null | https://raw.githubusercontent.com/2600hz/kazoo/24519b9af9792caa67f7c09bbb9d27e2418f7ad6/core/kazoo_data/test/kzs_util_tests.erl | erlang | -----------------------------------------------------------------------------
@doc
@end
-----------------------------------------------------------------------------
For format_account_* tests
Note: the whole point of exporting some of these is so that function_clause can be caught | ( C ) 2010 - 2020 , 2600Hz
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
-module(kzs_util_tests).
-export([format_account_id_raw/1
,format_account_id_encoded/1
,format_ac... |
f1a5ceffadd71ae288889639cf3da750151ad8d51ba322d4fb431c567bc6a382 | nunchaku-inria/nunchaku | Lazy_list.mli |
(* This file is free software, part of nunchaku. See file "license" for more details. *)
* { 1 Lazy List }
type +'a t = 'a cell lazy_t
and +'a cell =
| Nil
| Cons of 'a * 'a t
val empty : 'a t
val return : 'a -> 'a t
val is_empty : _ t -> bool
val cons : 'a -> 'a t -> 'a t
val head : 'a t -> ('a * 'a t) opt... | null | https://raw.githubusercontent.com/nunchaku-inria/nunchaku/16f33db3f5e92beecfb679a13329063b194f753d/src/core/Lazy_list.mli | ocaml | This file is free software, part of nunchaku. See file "license" for more details. |
* { 1 Lazy List }
type +'a t = 'a cell lazy_t
and +'a cell =
| Nil
| Cons of 'a * 'a t
val empty : 'a t
val return : 'a -> 'a t
val is_empty : _ t -> bool
val cons : 'a -> 'a t -> 'a t
val head : 'a t -> ('a * 'a t) option
val map : f:('a -> 'b) -> 'a t -> 'b t
val append : 'a t -> 'a t -> 'a t
module In... |
0ec936f937505d54659a3669fa9a45333bd0982a3fa965ce72ec7d47852e618d | Eonblast/Scalaxis | dht_node_state.erl | 2007 - 2011 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
di... | null | https://raw.githubusercontent.com/Eonblast/Scalaxis/10287d11428e627dca8c41c818745763b9f7e8d4/src/dht_node_state.erl | erlang | you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language gov... | 2007 - 2011 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
-module(dht_node_state).
-author('').
-vsn('$Id$').
-include("scalaris.hrl").
-include("record_helpers.hrl").
-expo... |
430d6a52644e41e0bab16626021d89167dc03aadef7d61a01ac9ba8578d9d79b | discus-lang/ddc | Run.hs |
module DDC.Driver.Build.Run where
import DDC.Driver.Build.Query
import DDC.Driver.Build.State
import DDC.Driver.Interface.Source
import DDC.Driver.Config
import qualified DDC.Driver.Interface.Status as Status
import Control.DeepSeq
import Data.Maybe
import qualified DDC.Core.Module ... | null | https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-driver/DDC/Driver/Build/Run.hs | haskell | -------------------------------------------------------------------------------------------------
| Try to run a job, returning True if it made progress.
-------------------------------------------------------------------------------------------------
| Load a module interface into the store.
Always rebuild and reli... |
module DDC.Driver.Build.Run where
import DDC.Driver.Build.Query
import DDC.Driver.Build.State
import DDC.Driver.Interface.Source
import DDC.Driver.Config
import qualified DDC.Driver.Interface.Status as Status
import Control.DeepSeq
import Data.Maybe
import qualified DDC.Core.Module ... |
58b779ab3b89b73a271e10c891368abdf7e2b80b56be74216e798e5fcc1fe7f4 | awkay/om-tutorial | Z_Glossary.cljs | (ns om-tutorial.Z-Glossary
(:require-macros [cljs.test :refer [is]])
(:require [om.next :as om :refer-macros [defui]]
[om.dom :as dom]
[devcards.core :as dc :refer-macros [defcard defcard-doc]]))
(defcard-doc
"# Glossary of Terms
- `Default database format`: A tree of data where all of... | null | https://raw.githubusercontent.com/awkay/om-tutorial/83ca10d91380ba62458b98ccaa80fd11b9c8321d/src/tutorial/om_tutorial/Z_Glossary.cljs | clojure | (ns om-tutorial.Z-Glossary
(:require-macros [cljs.test :refer [is]])
(:require [om.next :as om :refer-macros [defui]]
[om.dom :as dom]
[devcards.core :as dc :refer-macros [defcard defcard-doc]]))
(defcard-doc
"# Glossary of Terms
- `Default database format`: A tree of data where all of... | |
7f686927c3d0260282b17a95e289e31da2e9d0402ae8196053bc8d40b62acb53 | bitemyapp/bloodhound | Doc.hs | # LANGUAGE DerivingStrategies #
# LANGUAGE GeneralizedNewtypeDeriving #
module Database.Bloodhound.Internal.Client.Doc
( DocVersion (..),
ExternalDocVersion (..),
mkDocVersion,
VersionControl (..),
)
where
import Data.Aeson
import Data.Maybe
import GHC.Enum
| ' DocVersion ' is an integer version nu... | null | https://raw.githubusercontent.com/bitemyapp/bloodhound/7402e66455adebaa2b2fd9ae1e8c60bb4b48505c/src/Database/Bloodhound/Internal/Client/Doc.hs | haskell | | Smart constructor for in-range doc version
| 'ExternalDocVersion' is a convenience wrapper if your code uses its
own version numbers instead of ones from ES.
optimistic concurrency control.
| Don't send a version. This is a pure overwrite.
index the document if the version is the same
updates, as you should be... | # LANGUAGE DerivingStrategies #
# LANGUAGE GeneralizedNewtypeDeriving #
module Database.Bloodhound.Internal.Client.Doc
( DocVersion (..),
ExternalDocVersion (..),
mkDocVersion,
VersionControl (..),
)
where
import Data.Aeson
import Data.Maybe
import GHC.Enum
| ' DocVersion ' is an integer version nu... |
fef8288d256e86677c38d3ea7eb1bfa6bfd2e4b5f6c0eac23fe0906ff857665d | candera/khordr | logging.clj | (ns khordr.logging)
(def ^:private l (Object.))
(def ^:dynamic *log-level* :debug)
(def ^:private logger (agent nil))
(def log-level-values
{:debug 3
:info 2
:error 1
:critial 0
:silent -1})
(defn log
"Write to the log"
[data]
(send-off logger (fn [a d] (try (prn d) (catch Throwable t))) data))... | null | https://raw.githubusercontent.com/candera/khordr/cd9ad9df3dc6692b583b844244260b5b619745f7/src/clj/khordr/logging.clj | clojure | (ns khordr.logging)
(def ^:private l (Object.))
(def ^:dynamic *log-level* :debug)
(def ^:private logger (agent nil))
(def log-level-values
{:debug 3
:info 2
:error 1
:critial 0
:silent -1})
(defn log
"Write to the log"
[data]
(send-off logger (fn [a d] (try (prn d) (catch Throwable t))) data))... | |
e4a34e962e7b839797d505dd3acfa1bb5d303f89333aa6e16ffd17b235332b43 | prg-titech/baccaml | jit_entry.ml | open Jit
open Runtime
open Config
module F = Filename
module V1 = struct
let parser file =
let open Deprecated in
Arg.parse
[ ( "-no-jit"
, Arg.Unit (fun _ -> jit_flag := `Off)
, "disable jit compilation" )
; ( "-debug"
, Arg.Unit (fun _ -> Log.log_level := `Debug)
... | null | https://raw.githubusercontent.com/prg-titech/baccaml/a3b95e996a995b5004ca897a4b6419edfee590aa/interp/jit_entry.ml | ocaml | open Jit
open Runtime
open Config
module F = Filename
module V1 = struct
let parser file =
let open Deprecated in
Arg.parse
[ ( "-no-jit"
, Arg.Unit (fun _ -> jit_flag := `Off)
, "disable jit compilation" )
; ( "-debug"
, Arg.Unit (fun _ -> Log.log_level := `Debug)
... | |
9079bc706138df4a4ff5393bd9d43864170b8401da51b7ce296e874b65442368 | technomancy/leiningen | project.clj | (defproject project-with-pom-plugins "0.1.0-SNAPSHOT"
:pom-plugins [[two.parameter/simple-plugin "1.0.0"]
[three.parameter/with-vec "1.0.1"
[:a 1 :a 2 :a 3]]
[three.parameter/with-map "1.0.2"
{:a 1
:b 2
:c 3}]
... | null | https://raw.githubusercontent.com/technomancy/leiningen/24fb93936133bd7fc30c393c127e9e69bb5f2392/test_projects/with-pom-plugins/project.clj | clojure | (defproject project-with-pom-plugins "0.1.0-SNAPSHOT"
:pom-plugins [[two.parameter/simple-plugin "1.0.0"]
[three.parameter/with-vec "1.0.1"
[:a 1 :a 2 :a 3]]
[three.parameter/with-map "1.0.2"
{:a 1
:b 2
:c 3}]
... | |
3fd05ac4b86178e09747b24cb08c5205a31944b51d5dbdfeb1f58f02141045af | gelisam/klister | SrcLoc.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE TemplateHaskell #
module Syntax.SrcLoc where
import Control.Monad
import Control.Lens
import Data.Data (Data)
import Alpha
import ShortShow
data SrcPos = SrcPos
{ _srcPosLine :: !Int
, _srcPosCol :: !Int
}
deriving (Data, Eq, Show)
makeLenses ''SrcPos
instance... | null | https://raw.githubusercontent.com/gelisam/klister/71c71e6ab768e7e6b43e9402bc127423cd6e562b/src/Syntax/SrcLoc.hs | haskell | # LANGUAGE DeriveDataTypeable # | # LANGUAGE TemplateHaskell #
module Syntax.SrcLoc where
import Control.Monad
import Control.Lens
import Data.Data (Data)
import Alpha
import ShortShow
data SrcPos = SrcPos
{ _srcPosLine :: !Int
, _srcPosCol :: !Int
}
deriving (Data, Eq, Show)
makeLenses ''SrcPos
instance ShortShow SrcPos where
shortShow ... |
3b5ba019a44bc1865b3aa187248543c345ec60364a07dc4a12ddf16c071b5471 | shirok/Gauche | control.scm | ;; Tests for control.* modules
(use gauche.test)
(use gauche.vport)
(use gauche.threads)
(use scheme.list)
(use srfi.19)
(use data.queue)
(test-start "control")
;;--------------------------------------------------------------------
control.job
;;
(test-section "control.job")
(use control.job)
(test-module 'control... | null | https://raw.githubusercontent.com/shirok/Gauche/5df8f510bd3a9929508a5e92e04becd28e944a49/test/control.scm | scheme | Tests for control.* modules
--------------------------------------------------------------------
--------------------------------------------------------------------
control.thread-pool
Testing max backlog and timeout
synchronize
fill the queue.
subtle arrangement: The timing of thread execution isn't
guarante... |
(use gauche.test)
(use gauche.vport)
(use gauche.threads)
(use scheme.list)
(use srfi.19)
(use data.queue)
(test-start "control")
control.job
(test-section "control.job")
(use control.job)
(test-module 'control.job)
(let ((j #f)
(z #f))
(test* "make-job" #t
(begin (set! j (make-job (^[] #f)))
... |
a76f56f7f6c76577e54a383c5ab2355ec4c7f9a07eb0959a4dfdd5c522d5761b | tendant/clj-telemetry | middleware.clj | (ns telemetry.middleware
(:require [telemetry.tracing :as tracing]
[clojure.string :as string]))
(defn event-fn-skip-probe
[req]
(let [user-agent (get-in req [:headers "user-agent"])]
(if (and user-agent
(string/includes? user-agent "probe"))
false
true)))
(defn wrap-tel... | null | https://raw.githubusercontent.com/tendant/clj-telemetry/1cadf232399921d5819855fffb4247be0109374c/src/telemetry/middleware.clj | clojure | (ns telemetry.middleware
(:require [telemetry.tracing :as tracing]
[clojure.string :as string]))
(defn event-fn-skip-probe
[req]
(let [user-agent (get-in req [:headers "user-agent"])]
(if (and user-agent
(string/includes? user-agent "probe"))
false
true)))
(defn wrap-tel... | |
6e182ee9228a12fd98f1429ac06ae1d7e658790c9a79d565449814c7dca1bc04 | cjay/vulkyrie | Utils.hs | module Vulkyrie.Utils where
import Control.Exception (Exception, catch, throwIO)
import Control.Monad ( forM_ )
import Control.Monad.IO.Unlift (MonadUnliftIO, withRunInIO)
import Numeric.DataFrame ( scalar, Mat44f )
import Control.Concurrent
( forkFinally,
myThreadId,
newEmptyMVar,
newMVar,
... | null | https://raw.githubusercontent.com/cjay/vulkyrie/7ec31181bd456c863da96743c216ff6610d3cd00/src/Vulkyrie/Utils.hs | haskell |
UnliftIO.Exception.catch can't catch async exceptions, and the unliftio
library has no way to do it on purpose. We need it for resource cleanup
^ action
^ handler
Needed to rethrow async exceptions during resource cleanup.
| Like forkIO, but prints when the thread starts and ends, and tells if it ends with an e... | module Vulkyrie.Utils where
import Control.Exception (Exception, catch, throwIO)
import Control.Monad ( forM_ )
import Control.Monad.IO.Unlift (MonadUnliftIO, withRunInIO)
import Numeric.DataFrame ( scalar, Mat44f )
import Control.Concurrent
( forkFinally,
myThreadId,
newEmptyMVar,
newMVar,
... |
c70f22affed1902e12244618b294b74e0c4bff1e4e198bce078dd45ab02d3cec | Twinside/Eq | formulaMain.hs | import CharArray
#ifdef _DEBUG
import Language.Eq.Renderer.Sexpr
#endif
import Control.Monad
import System.Environment
import System.Exit
import System.IO
import qualified System.IO as Io
import System.Console.GetOpt
import Data.List( find, intersperse, foldl' )
import Data.Maybe( fromMaybe )
import qualified Dat... | null | https://raw.githubusercontent.com/Twinside/Eq/60105372d55420735b722245db7021c239c812f4/formulaMain.hs | haskell | Debugging
for plotting
| Helper function to get file names for input/output
| Command which just format an equation
without affecting it's form.
| Command which just format an equation
without affecting it's form.
| Give the user some information about the defined
elements. This help cannot lie =) | import CharArray
#ifdef _DEBUG
import Language.Eq.Renderer.Sexpr
#endif
import Control.Monad
import System.Environment
import System.Exit
import System.IO
import qualified System.IO as Io
import System.Console.GetOpt
import Data.List( find, intersperse, foldl' )
import Data.Maybe( fromMaybe )
import qualified Dat... |
9260685f5ee51872911c0e62210249d4550cb5e45f7d6b5207572e44cae2c6d9 | google/codeworld | Framework.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
Copyright 2020 The CodeWorld Authors . All rights reserved .
Licen... | null | https://raw.githubusercontent.com/google/codeworld/77b0863075be12e3bc5f182a53fcc38b038c3e16/codeworld-requirements/src/CodeWorld/Requirements/Framework.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE ConstraintKinds #
# LANGUAGE OverloadedStrings #
# LANGUAGE PackageImports # | # LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
Copyright 2020 The CodeWorld Authors . All rights reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the Licen... |
59dff5b48d6da5a5d76703f878a55474547fd5669a382a8803ce390a919f6806 | zack-bitcoin/amoveo | create_account_tx.erl | -module(create_account_tx).
-export([go/4, new/5, make_dict/4, from/1, pubkey/1]).
-include("../../records.hrl").
from(X) -> X#create_acc_tx.from.
pubkey(X) -> X#create_acc_tx.pubkey.
make_dict(Pub, Amount, Fee, From) ->
PS = size(Pub),
PS = size(From),
PS = constants:pubkey_size(),
Account = trees:get(... | null | https://raw.githubusercontent.com/zack-bitcoin/amoveo/2d5755abd80f0852ab2faf3f1fda83c76de07f93/apps/amoveo_core/src/consensus/txs/create_account_tx.erl | erlang | To is a new ID. set it to any unused ID.
true -> none
end, | -module(create_account_tx).
-export([go/4, new/5, make_dict/4, from/1, pubkey/1]).
-include("../../records.hrl").
from(X) -> X#create_acc_tx.from.
pubkey(X) -> X#create_acc_tx.pubkey.
make_dict(Pub, Amount, Fee, From) ->
PS = size(Pub),
PS = size(From),
PS = constants:pubkey_size(),
Account = trees:get(... |
fbd92ad8998dec3512221fddf14a07e77c84c94a3631300b0a58ef29a7f8190e | mkoeppe/cl-bibtex | cmp.lisp | -*- Mode : LISP ; Syntax : ANSI - Common - Lisp ; Package : CMP -*-
$ Revision : 1.2 $
Copyright 2005 ( )
;;; All rights reserved. Use and verbatim redistribution permitted.
;;;
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ` ` AS IS '' AND ANY EXPRESS
;;; OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, TH... | null | https://raw.githubusercontent.com/mkoeppe/cl-bibtex/17a16f564b72da681b1e2cf7afbb496836781828/cmp.lisp | lisp | Syntax : ANSI - Common - Lisp ; Package : CMP -*-
All rights reserved. Use and verbatim redistribution permitted.
OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT
... |
$ Revision : 1.2 $
Copyright 2005 ( )
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ` ` AS IS '' AND ANY EXPRESS
ARE DISCLAIMED . IN NO EVENT SHALL THE AUTHOR OR
LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT
#+CMU (ext... |
57fb9d7df70d9fb5b7177c442c7641ef52cce162c5a39dd2b943e56cc6b9cc60 | default-kramer/fission-flare | util.rkt | #lang racket/base
(provide assert fail
)
(require "../util/assert.rkt"
)
| null | https://raw.githubusercontent.com/default-kramer/fission-flare/80d8e0649a6088912da257a59ffd82b361acab98/src/ui/util.rkt | racket | #lang racket/base
(provide assert fail
)
(require "../util/assert.rkt"
)
| |
fdecf7b71597bddb3fc572c43f5d365f6e4a28b2d1a999bea6eb4e206fe17049 | quil-lang/quilc | suite.lisp | ;;;; tests/tools/suite.lisp
;;;;
Author :
(in-package #:cl-quil.tools-tests)
(defun run-tools-tests (&key (verbose nil) (headless nil))
"Run all CL-QUIL/TOOLS tests. If VERBOSE is T, print out lots of test info. If HEADLESS is T, disable interactive debugging and quit on completion."
Bug in Fiasco commit fe89... | null | https://raw.githubusercontent.com/quil-lang/quilc/a6010b7ef60af482faf2c761259bfc247735c116/tests/tools/suite.lisp | lisp | tests/tools/suite.lisp
| Author :
(in-package #:cl-quil.tools-tests)
(defun run-tools-tests (&key (verbose nil) (headless nil))
"Run all CL-QUIL/TOOLS tests. If VERBOSE is T, print out lots of test info. If HEADLESS is T, disable interactive debugging and quit on completion."
Bug in Fiasco commit fe89c0e924c22c667cc11c6fc6e79419fc7c1... |
b88a0d18988b36173fdeee4c98b8ba5e846aa34713048a5f82a5b9d95b37a38f | functional-koans/clojure-koans | 06_maps.clj | (ns koans.06-maps
(:require [koan-engine.core :refer :all]))
(meditations
"Don't get lost when creating a map"
(= {:a 1 :b 2} (hash-map :a 1 __ __))
"A value must be supplied for each key"
(= {:a 1} (hash-map :a __))
"The size is the number of entries"
(= __ (count {:a 1 :b 2}))
"You can look up the... | null | https://raw.githubusercontent.com/functional-koans/clojure-koans/a9c22921a5a3fb0c7fc09d9bd57c61b308b1a803/src/koans/06_maps.clj | clojure | (ns koans.06-maps
(:require [koan-engine.core :refer :all]))
(meditations
"Don't get lost when creating a map"
(= {:a 1 :b 2} (hash-map :a 1 __ __))
"A value must be supplied for each key"
(= {:a 1} (hash-map :a __))
"The size is the number of entries"
(= __ (count {:a 1 :b 2}))
"You can look up the... | |
4ca69c4622da7e60d3bcf4026de86c2d83c11376f54628ba0cf125f855bea33a | e-bigmoon/haskell-blog | Mul.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
module Expr.Mul where
import Expr
import Expr.Base
import Field.Mul
import Operation.Pretty
import Data.Extensible
newtype ExprM = ExprM
{ unwrapExprM :: Variant ExprMFields
} deriving (Eq, Show)
... | null | https://raw.githubusercontent.com/e-bigmoon/haskell-blog/5c9e7c25f31ea6856c5d333e8e991dbceab21c56/sample-code/2019/09-09/Expr/Mul.hs | haskell | # LANGUAGE DataKinds #
type ExprMFields = '[ Constant, Add ExprM, Mul ExprM ] | # LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
module Expr.Mul where
import Expr
import Expr.Base
import Field.Mul
import Operation.Pretty
import Data.Extensible
newtype ExprM = ExprM
{ unwrapExprM :: Variant ExprMFields
} deriving (Eq, Show)
type ExprMFields = ExprBField... |
00bb1d79d6eebe991e976aa6071cb9d94eded2f7687466e8e9beaddd1c7111b7 | jeffshrager/biobike | temp-frames.lisp | -*- Package : aframes ; mode : lisp ; base : 10 ; Syntax : Common - Lisp ; -*-
(in-package :aframes)
;;; +=========================================================================+
| Copyright ( c ) 2002 , 2003 , 2004 JP , , |
;;; | ... | null | https://raw.githubusercontent.com/jeffshrager/biobike/5313ec1fe8e82c21430d645e848ecc0386436f57/BioLisp/Nframes/temp-frames.lisp | lisp | mode : lisp ; base : 10 ; Syntax : Common - Lisp ; -*-
+=========================================================================+
| |
| Permission is hereby granted, free of charge, to any person obtaining |
| a copy of this software and as... |
(in-package :aframes)
| Copyright ( c ) 2002 , 2003 , 2004 JP , , |
| " Software " ) , to deal in the Software without restriction , including |
| distribute , sublicense , and/or sell copies of the Software , and to |
| permit persons to whom the Software is furnished to do so , subject t... |
f3aeac9f121916155ae0a87ef3f91ca4318f6c07bbc90fb2fc46750252f26cef | OCamlPro/liquidity | config_network.ml | (****************************************************************************)
(* Liquidity *)
(* *)
Copyright ( C ) 2017 - 2020 OCamlPro SAS
(* ... | null | https://raw.githubusercontent.com/OCamlPro/liquidity/3578de34cf751f54b9e4c001a95625d2041b2962/libs/dune-network-lib/config_network.ml | ocaml | **************************************************************************
Liquidity
... | Copyright ( C ) 2017 - 2020 OCamlPro SAS
it under the terms of the GNU General Public License as published by
... |
4d9f5b3f4b1f507ce604e1db94c68282324028d09a87cd847b15ea3909c33b6c | city41/reagent-breakout | paddle.cljs | (ns breakout.cmp.paddle)
(defn cmp [{x :x y :y}]
[:div.paddle {:style {:position "absolute"
:background-image "url(img/tiles.png)"
:background-position "0 -64px"
:width 48
:height 16
:left x
... | null | https://raw.githubusercontent.com/city41/reagent-breakout/84907d0cbc2d3cae917e30f955bc8e42fcb2d505/src/cljs/breakout/cmp/paddle.cljs | clojure | (ns breakout.cmp.paddle)
(defn cmp [{x :x y :y}]
[:div.paddle {:style {:position "absolute"
:background-image "url(img/tiles.png)"
:background-position "0 -64px"
:width 48
:height 16
:left x
... | |
0b62c6ce2c82faff9d70ab2ce7b9b8e40133eeb79831dd1b73356cbda049704a | mokus0/junkbox | Haar1D.hs | translation of SML code from wikipedia , mostly just an exercise in reading ML
-- Turns out this is a pretty goofy implementation. It reverses every other level,
-- which decodes just fine as long as you don't try to truncate the encoded form
-- by an odd number of levels.
module Math.Haar1D where
haar [] = []
haar... | null | https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/Math/Haar1D.hs | haskell | Turns out this is a pretty goofy implementation. It reverses every other level,
which decodes just fine as long as you don't try to truncate the encoded form
by an odd number of levels. | translation of SML code from wikipedia , mostly just an exercise in reading ML
module Math.Haar1D where
haar [] = []
haar l = aux l [] []
where
aux [s] [] d = s : d
aux [] s d = aux s [] d
aux (h1:h2:t) s d = aux t ((h1 + h2) : s) ((h1 - h2) : d)
aux _ _ _ = error "haar: list le... |
90fb717b9f27e5836c8d51836ef0d2ca0e15b6e98d5926a6d97ba265c0396323 | project-oak/hafnium-verification | bufferOverrunField.ml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/bufferoverrun/bufferOverrunField.ml | ocaml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.