_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 |
|---|---|---|---|---|---|---|---|---|
7f05102ecc8d5298095017e5f5d16155e5bd6ab3f119c5c9392895d1c35460e1 | murtaza52/almonds | core.clj | (ns almonds.core
(:require [almonds.api :as api]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; reset state ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(api/clear-all)
;;;;;;;;;;;;;;;; execute the handler calls ;;;;;;;;;;;;;;;
(require 'almonds.handler)
;;;;;;;;;;;;;;;; reset resources ;;;;;;;;;;;;;;;;;;;;;;
(require 'almonds.resource... | null | https://raw.githubusercontent.com/murtaza52/almonds/f7c5879833316ce395788bcf304eedab8315f0e5/src/almonds/core.clj | clojure | reset state ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
execute the handler calls ;;;;;;;;;;;;;;;
reset resources ;;;;;;;;;;;;;;;;;;;;;;
compile other resources ;;;;;;;;;;;;;;;;;; | (ns almonds.core
(:require [almonds.api :as api]))
(api/clear-all)
(require 'almonds.handler)
(require 'almonds.resources :reload)
(require 'almonds.resources.security-group
'almonds.resources.eip-assoc
'almonds.resources.elastic-ip
'almonds.resources.instance
'almonds.resour... |
70d96c017efe773bf84271970a5041316c9f27ca747c8ebb536689d1969e3316 | brendanhay/gogol | Patch.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/77394c4e0f5bd729e6fe27119701c45f9d5e1e9a/lib/services/gogol-dialogflow/gen/Gogol/DialogFlow/Projects/Locations/Agents/EntityTypes/Patch.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
Updates the specified entity type. Note: You should always train a flow prior to sending it queries. See the < training documentation>.
* Resource
** Constructing a Request
'DialogFlowProjectsLocationsAgentsEntityTypesPatch' r... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
35887fb54ef208a8e2257a07d0945ecfbc0593ed37b86c0688cdcce8ed9cfd13 | basho/riak_kv | riak_kv_schema_tests.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2013 - 2016 Basho Technologies , Inc.
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of... | null | https://raw.githubusercontent.com/basho/riak_kv/0a5f60faeb11a59ce15acf249c9464f58853c609/test/riak_kv_schema_tests.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2013 - 2016 Basho Technologies , Inc.
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(riak_kv_schema_t... |
6f5afdd554c241fefcd06df517230d4c9a5f7d742aa452b29caf42b2a1ec8e0d | migamake/json-autotype | CommonCLI.hs | module CommonCLI(TypeOpts(..), unflag, tyOptParser) where
import Data.Monoid ((<>))
import Options.Applicative
import System.Process (system)
import qualified System.Environment (lookupEnv)
import System.Exit (Ex... | null | https://raw.githubusercontent.com/migamake/json-autotype/6244e1f2c0352e9a18657051b65df62b9af157cd/json-autotype/common/CommonCLI.hs | haskell | module CommonCLI(TypeOpts(..), unflag, tyOptParser) where
import Data.Monoid ((<>))
import Options.Applicative
import System.Process (system)
import qualified System.Environment (lookupEnv)
import System.Exit (Ex... | |
2ee687724cb186f4d99f298c0cd7aa363148d5421b74fd22ee6acd6e43aa198b | waddlaw/TAPL | Utils.hs | module Utils (evalAllStrategy) where
import Language.Core.Types
import Language.UntypedLambda
import RIO
import Test.Tasty.HUnit
evalAllStrategy :: UntypedLambda -> UntypedLambda -> IO ()
evalAllStrategy term expected = do
eval NormalOrder term @?= expected
eval CallByName term @?= expected
eval CallByValue ter... | null | https://raw.githubusercontent.com/waddlaw/TAPL/94576e46821aaf7abce6d1d828fc3ce6d05a40b8/subs/lambda-untyped/test/Utils.hs | haskell | module Utils (evalAllStrategy) where
import Language.Core.Types
import Language.UntypedLambda
import RIO
import Test.Tasty.HUnit
evalAllStrategy :: UntypedLambda -> UntypedLambda -> IO ()
evalAllStrategy term expected = do
eval NormalOrder term @?= expected
eval CallByName term @?= expected
eval CallByValue ter... | |
b87cfb49c326957f902f15de317726693ca51527fdd9fb27115233e8feb904d6 | manuel-serrano/bigloo | build.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / comptime / Ast / build.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/comptime/Ast/build.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
*=====================================================================*/
*---------------------------... | * serrano / prgm / project / bigloo / comptime / Ast / build.scm * /
* Author : * /
* Creation : Fri May 31 14:00:21 1996 * /
* Last change : Tue Apr 19 14:18:41 2016 ( serrano ) * /
* From... |
74acbae19d84585c4621dd78b12cad994530608da734f4647998127b2e66afcd | nuprl/gradual-typing-performance | render-utils.rkt | #lang scheme/base
(require "../core.rkt")
(provide part-style?
select-suffix
extract-table-cell-styles
empty-content?)
(define (part-style? p s)
(memq s (style-properties (part-style p))))
(define (select-suffix path suggested-suffixes accepted-suffixes)
(or (ormap (lambda (suggested)
... | null | https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/pre-benchmark/ecoop/scribble-lib/scribble/private/render-utils.rkt | racket | #lang scheme/base
(require "../core.rkt")
(provide part-style?
select-suffix
extract-table-cell-styles
empty-content?)
(define (part-style? p s)
(memq s (style-properties (part-style p))))
(define (select-suffix path suggested-suffixes accepted-suffixes)
(or (ormap (lambda (suggested)
... | |
4f1a78f024d2047164dd3a79cb6daa9c6e4c87e64e71f61e66f8f6f61ca506eb | SKA-ScienceDataProcessor/RC | Vector.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE RankNTypes , ScopedTypeVariables #
# LANGUAGE CPP #
{-# LANGUAGE MultiWayIf #-}
module Flow.Vector
( Vector(..)
, vectorSize, vectorByteSize
, nullVector
, castVector
, offsetVector
, peekVector, pokeVector
, makeVector, unmakeVect... | null | https://raw.githubusercontent.com/SKA-ScienceDataProcessor/RC/1b5e25baf9204a9f7ef40ed8ee94a86cc6c674af/MS6/dna/flow/Flow/Vector.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE MultiWayIf #
* Memory Management
* Conversion
| The alignment that we are going to use for all vectors
| Vector type. Depending on the requirements of the kernel that
uses it, it might have a different underlying pointer type.
FIXME: No sane binary instance but we need ... | # LANGUAGE DeriveGeneric #
# LANGUAGE RankNTypes , ScopedTypeVariables #
# LANGUAGE CPP #
module Flow.Vector
( Vector(..)
, vectorSize, vectorByteSize
, nullVector
, castVector
, offsetVector
, peekVector, pokeVector
, makeVector, unmakeVector
, copyVector
, allocCVector
#ifdef USE_CUDA
, allocHost... |
4a8a55f783f3887edbc5089a41a4dd5ed7ac0501a451916f0d2d277842fec104 | apache/couchdb-couch-mrview | couch_mrview_changes_since_tests.erl | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an " A... | null | https://raw.githubusercontent.com/apache/couchdb-couch-mrview/f08c26a098a46366cfaf0e14b940af1f11d84577/test/couch_mrview_changes_since_tests.erl | erlang | 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
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations... | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
-module(couch_mrview_changes_since_tests).
-include_lib("couch/include/couch_eunit.hrl").
-include_lib("couch/include/couch_db.hrl").
-define(TIMEOUT, 100... |
f2c454f0c6c7789188b23fa4d1c5f7b1a6b4e737cba93d4752c262f5db39736d | tomjridge/imp_fs | v3_live_object_cache.ml | * Live object cache .
A cache of " live " objects . Expunging an object may take some
time . Resurrecting an object may take some time . We use reference
counting to prevent objects from being expunged while references
remain live .
We are maintaining a cache of objects by i d. We can maintain the ... | null | https://raw.githubusercontent.com/tomjridge/imp_fs/dae69505130073747f37ecab845fe3b6c495e66a/src/_v3/v3_live_object_cache.ml | ocaml | * backing counter
Add a finalizer to ensure that the obj is not GC'ed in valid state
* resurrect: slow operation to resurrect an object from a
persistent store; finalise:called when removing objects from the
cache; no outstanding references remain; as such, the object
should certainly not be locked
... | * Live object cache .
A cache of " live " objects . Expunging an object may take some
time . Resurrecting an object may take some time . We use reference
counting to prevent objects from being expunged while references
remain live .
We are maintaining a cache of objects by i d. We can maintain the ... |
078284ae8721c76d6b8e3892e85cca72cd3eac6a2c8c85ed156339023a97b54f | fugue/fregot | Order.hs | |
Copyright : ( c ) 2020 Fugue , Inc.
License : Apache License , version 2.0
Maintainer :
Stability : experimental
Portability : POSIX
Copyright : (c) 2020 Fugue, Inc.
License : Apache License, version 2.0
Maintainer :
Stability : experimental
Portability : POSIX
-}
# LANGUAGE Flexib... | null | https://raw.githubusercontent.com/fugue/fregot/c3d87f37c43558761d5f6ac758d2f1a4117adb3e/lib/Fregot/Compile/Order.hs | haskell | # LANGUAGE MultiWayIf #
| General strategy for reordering.
^ Initial accumulator.
^ Items to order.
^ Reordered, errors.
Associate a number with each item.
Perform a fold over the remaining items to add them all to the list.
Update the remaining items, these are only the ones that still
have err... | |
Copyright : ( c ) 2020 Fugue , Inc.
License : Apache License , version 2.0
Maintainer :
Stability : experimental
Portability : POSIX
Copyright : (c) 2020 Fugue, Inc.
License : Apache License, version 2.0
Maintainer :
Stability : experimental
Portability : POSIX
-}
# LANGUAGE Flexib... |
45ca6820af72d37cd3d79c9fd2872d3459d4035af30b23c5945d9b5365da406b | nathanmarz/cascalog | stats.clj | (ns cascalog.math.stats
(:use cascalog.api)
(:require [cascalog.logic.ops :as c]
[cascalog.logic.def :as d]
[cascalog.math.contrib [accumulators :as acc]]))
(defn initialize-mean-variance-parallel [& X]
(map (fn [x] (acc/mean-variance {:mean x :variance 0 :n 1})) X))
(d/defparallelagg me... | null | https://raw.githubusercontent.com/nathanmarz/cascalog/deaad977aa98985f68f3d1cc3e081d345184c0c8/cascalog-math/src/cascalog/math/stats.clj | clojure | (ns cascalog.math.stats
(:use cascalog.api)
(:require [cascalog.logic.ops :as c]
[cascalog.logic.def :as d]
[cascalog.math.contrib [accumulators :as acc]]))
(defn initialize-mean-variance-parallel [& X]
(map (fn [x] (acc/mean-variance {:mean x :variance 0 :n 1})) X))
(d/defparallelagg me... | |
de6a5a85229ec2830739bb68c3afe6a4934f9eba66a5320611c42bd7d2d901d9 | FestCat/festival-ca | upclex_central.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Lexicon , LTS and Postlexical rules for upc_catalan
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Adapted for Catalan by the UPC team
;;;
( c )
Universitat Politècnica de Catalunya , Barcelona , Spain... | null | https://raw.githubusercontent.com/FestCat/festival-ca/f6b2d9bf4fc4f77b80890ebb95770075ad36ccaf/src/data/festival/lib/dicts/upc/upclex_central.scm | scheme |
Words to be added in future versions:
Currently prediction is bad for these words:
<Empty (for now)>
Common words on the internet
gmail, hotmail, facebook
;;; Symbols ...
Basic punctuation must be in with nil pronunciation
Sons i u àtons (vocals dèbils)
(SC y w ) ;; Sons semi-consonàntics
; Sons semi ... | Lexicon , LTS and Postlexical rules for upc_catalan
Adapted for Catalan by the UPC team
( c )
Universitat Politècnica de Catalunya , Barcelona , Spain
(define (upc_catalan_addenda_central)
"(upc_catalan_addenda_central)
Basic lexicon should (must ?) have basic letters, symbols and punctuation."
(le... |
ee03d5cc38d4e6e7b26d87b39a305588a76de03f12f8eb57c2d7a01d2ed85060 | semilin/layoup | Oneproduct.lisp |
(MAKE-LAYOUT :NAME "Oneproduct" :MATRIX
(APPLY #'KEY-MATRIX '("pldwgjxoyq" "nrstmuaeih" "zcfvb,.';k"))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | null | https://raw.githubusercontent.com/semilin/layoup/27ec9ba9a9388cd944ac46206d10424e3ab45499/data/layouts/Oneproduct.lisp | lisp |
(MAKE-LAYOUT :NAME "Oneproduct" :MATRIX
(APPLY #'KEY-MATRIX '("pldwgjxoyq" "nrstmuaeih" "zcfvb,.';k"))
:SHIFT-MATRIX NIL :KEYBOARD NIL) | |
e748050643c674eea9411843dbf24bd884ef69a5777dcaac3a0eadeb8dafdcde | metosin/tyylikas | project.clj | (defproject tyylikas "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[rewrite-clj "0.6.0"]])
| null | https://raw.githubusercontent.com/metosin/tyylikas/e2d57acf86df38fb0aafed2c14a64bdd1602a87e/project.clj | clojure | (defproject tyylikas "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[rewrite-clj "0.6.0"]])
| |
4d99cdda42ceccab24f1c9ea20f3932b72d37938cd2bcecf7f0e12a466cbb585 | lingnand/VIMonad | GridVariants.hs | # LANGUAGE DeriveDataTypeable , FlexibleInstances , MultiParamTypeClasses #
----------------------------------------------------------------------
-- |
-- Module : XMonad.Layout.GridVariants
Copyright : ( c )
-- License : BSD-style (see LICENSE)
--
-- Maintainer :
-- Stability : unstable
-- Portabi... | null | https://raw.githubusercontent.com/lingnand/VIMonad/048e419fc4ef57a5235dbaeef8890faf6956b574/XMonadContrib/XMonad/Layout/GridVariants.hs | haskell | --------------------------------------------------------------------
|
Module : XMonad.Layout.GridVariants
License : BSD-style (see LICENSE)
Maintainer :
Stability : unstable
Portability : unportable
desired aspect ratio of windows to be specified. The other is like
Tall but places a grid with f... | # LANGUAGE DeriveDataTypeable , FlexibleInstances , MultiParamTypeClasses #
Copyright : ( c )
Two layouts : one is a variant of the Grid layout that allows the
ChangeMasterGridGeom(..)
, ChangeGridGeom(..)
... |
131f8ada5d2f0cf26bd74a454c2fae2277ea692b8fd3b0d9575de60d8309e585 | mlabs-haskell/plutus-simple-model | Oracle.hs | # OPTIONS_GHC -Wno - incomplete - uni - patterns #
| Oracle example to test reference inputs
with inlined and hashed datums .
The players bet on integer value and oracle should provide an aswer .
Answer is read by reference input . Oracle inlines the answer to datum .
The BetDatum keeps the track of an... | null | https://raw.githubusercontent.com/mlabs-haskell/plutus-simple-model/10000d64ede979bb1d7838b3ed20b785615910b9/psm/test/Suites/Plutus/Model/Script/V2/Onchain/Oracle.hs | haskell | | Answer of the oracle
| User mades a guess
| User answers | # OPTIONS_GHC -Wno - incomplete - uni - patterns #
| Oracle example to test reference inputs
with inlined and hashed datums .
The players bet on integer value and oracle should provide an aswer .
Answer is read by reference input . Oracle inlines the answer to datum .
The BetDatum keeps the track of an... |
e4a1f1c35359c314057c263fed4a6ed4de726ee085f9dbb8fa5486b995bfde7a | juspay/atlas | OnSearch.hs | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | null | https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/driver-offer-bpp/src/Core/ACL/OnSearch.hs | haskell | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | |
e0d1ec9d684a3485b6679b587a007080422861a7a043d63415d65323617b71ff | Ericson2314/lighthouse | MenuEvent.hs | -- #hide
-----------------------------------------------------------------------------
-- |
-- Module : OS.MenuEvent
Copyright : ( c ) 2002
-- License : BSD-style
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
-- OS.MenuEvent defines the DeviceEventFunction for th... | null | https://raw.githubusercontent.com/Ericson2314/lighthouse/210078b846ebd6c43b89b5f0f735362a01a9af02/ghc-6.8.2/libraries/ObjectIO/Graphics/UI/ObjectIO/OS/MenuEvent.hs | haskell | #hide
---------------------------------------------------------------------------
|
Module : OS.MenuEvent
License : BSD-style
Maintainer :
Stability : provisional
Portability : portable
OS.MenuEvent defines the DeviceEventFunction for the menu device.
This function is placed in a separate ... | Copyright : ( c ) 2002
module Graphics.UI.ObjectIO.OS.MenuEvent(menuEvent, menuHandlesGetMenuStateHandles) where
import Graphics.UI.ObjectIO.CommonDef
import Graphics.UI.ObjectIO.Device.Events
import Graphics.UI.ObjectIO.Device.SystemState
import Graphics.UI.ObjectIO.Process.IOState
import Graphics.UI.Obj... |
5a3d1f5db799820b3461ac03ff21b100da63421eda49161a0c1ed0a9cb1aa8ab | gerritjvv/fun-utils | apply_get_create_tests.clj | (ns fun-utils.apply-get-create-tests
(:require [fun-utils.core :refer [apply-get-create]])
(:use midje.sweet))
(facts "Test apply-get-create"
(fact "test new value created"
(apply-get-create {} :a inc (fn [& args] 1)) => {:a 1}
;the inc is applied but the result is not assoced t... | null | https://raw.githubusercontent.com/gerritjvv/fun-utils/72152ce4ca901af9a89bb21ca5817dbead773151/test/fun_utils/apply_get_create_tests.clj | clojure | the inc is applied but the result is not assoced to the map
e.g. agents, channels, files
(fact "test with ref"
(let [v (ref {})]
(dosync
(prn @v)
)) | (ns fun-utils.apply-get-create-tests
(:require [fun-utils.core :refer [apply-get-create]])
(:use midje.sweet))
(facts "Test apply-get-create"
(fact "test new value created"
(apply-get-create {} :a inc (fn [& args] 1)) => {:a 1}
this method is used to creawte resources in a map if they do not... |
7afcdc233599767a1dc9572a5247e1fa0c760ccfd89f1240c9d2c22841423b10 | bintracker/bintracker | m6809.tests.scm | (import scheme (chicken base) test schemta)
(define (run-src src)
(map char->integer (assemble 'm6809 src)))
(test-group
"Addressing Modes"
(test "immediate" '(#x89 #xff) (run-src " adca #$ff"))
(test "direct" '(#x99 #xff) (run-src " adca <$ffff"))
(test "extended" '(#xb9 #xff #xfe) (run-src " adca $fffe"))
(... | null | https://raw.githubusercontent.com/bintracker/bintracker/d09e0a9315b988b2aa2f8e4d1754182b17e10a54/libmdal/schemta-tests/m6809.tests.scm | scheme | (import scheme (chicken base) test schemta)
(define (run-src src)
(map char->integer (assemble 'm6809 src)))
(test-group
"Addressing Modes"
(test "immediate" '(#x89 #xff) (run-src " adca #$ff"))
(test "direct" '(#x99 #xff) (run-src " adca <$ffff"))
(test "extended" '(#xb9 #xff #xfe) (run-src " adca $fffe"))
(... | |
0cc9f9d0837911fb0af2414047b8eef5d02e23d7b229bcd66e10ea6825fa6afa | camoy/contract-etc | no-env.rkt | #lang racket/base
(require chk
racket/contract
"../annotate.rkt")
;; outside `test` submodule
(: foo-fo integer?)
(define foo-fo 42)
(: foo-ho (-> integer?))
(define (foo-ho) "hi")
(chk
foo-fo 42
#:t (procedure? foo-ho)
(foo-ho) "hi"
#:x
(let ()
(: bar-fo integer?)
(define (bar-fo) 42... | null | https://raw.githubusercontent.com/camoy/contract-etc/3758ad23c407f72b160df4969623576d661301b8/tests/no-env.rkt | racket | outside `test` submodule
make sure we don't break submodule order
inside `test` submodule | #lang racket/base
(require chk
racket/contract
"../annotate.rkt")
(: foo-fo integer?)
(define foo-fo 42)
(: foo-ho (-> integer?))
(define (foo-ho) "hi")
(chk
foo-fo 42
#:t (procedure? foo-ho)
(foo-ho) "hi"
#:x
(let ()
(: bar-fo integer?)
(define (bar-fo) 42)
(void))
"bar-fo: broke... |
9de628b58461373107737dcf2f5ad1cfa20a7a54f2aa7c898a4e5f988603673b | xively/clj-mqtt | pubrec_test.clj | (ns mqtt.packets.pubrec-test
(:use clojure.test
mqtt.test-helpers
mqtt.decoder
mqtt.encoder
mqtt.packets.common
mqtt.packets.pubrec)
(:import [io.netty.buffer Unpooled]
[io.netty.handler.codec EncoderException]))
(deftest pubrec-validate-message-test
(testing "n... | null | https://raw.githubusercontent.com/xively/clj-mqtt/74964112505da717ea88279b62f239146450528c/test/mqtt/packets/pubrec_test.clj | clojure | fixed header
remaining length
message id
fixed header
remaining length
message id | (ns mqtt.packets.pubrec-test
(:use clojure.test
mqtt.test-helpers
mqtt.decoder
mqtt.encoder
mqtt.packets.common
mqtt.packets.pubrec)
(:import [io.netty.buffer Unpooled]
[io.netty.handler.codec EncoderException]))
(deftest pubrec-validate-message-test
(testing "n... |
db6ddc79434b40bc213c4cfa14ede151477b65ba14c43eb56b13c35e07e98122 | rescript-lang/syntax | res_driver_reason_binary.ml | module IO = Res_io
let isReasonDocComment (comment : Res_comment.t) =
let content = Res_comment.txt comment in
let len = String.length content in
if len = 0 then true
else if
len >= 2
&& String.unsafe_get content 0 = '*'
&& String.unsafe_get content 1 = '*'
then false
else if len >= 1 && String... | null | https://raw.githubusercontent.com/rescript-lang/syntax/67fec537284579e58bee8e70120bff8e03688fa8/src/res_driver_reason_binary.ml | ocaml | handle {| |} or {sql||sql} quoted strings. We don't care about its contents.
Why? // abcdef inside the quoted string would otherwise be picked up as an extra comment | module IO = Res_io
let isReasonDocComment (comment : Res_comment.t) =
let content = Res_comment.txt comment in
let len = String.length content in
if len = 0 then true
else if
len >= 2
&& String.unsafe_get content 0 = '*'
&& String.unsafe_get content 1 = '*'
then false
else if len >= 1 && String... |
5115a1b5a3622fcc81303d3667e0a653ab999fa15a88e2f2a7c1062e358f770d | unclebob/ubc-website | zorch.clj | (ns ubc-website.interactors.zorch
(:use [hiccup core page])
(:require
[ubc-website.presenters.util :refer [markdown]]))
(declare display-file)
(defn exec [key]
(cond
(nil? key)
(display-file "nilkey")
(= "" key)
(display-file "badkey")
(.exists (clojure.java.io/file (str "resources/zor... | null | https://raw.githubusercontent.com/unclebob/ubc-website/3773ef24e0baef20dfa579661496aecb4326236e/src/ubc_website/interactors/zorch.clj | clojure | (ns ubc-website.interactors.zorch
(:use [hiccup core page])
(:require
[ubc-website.presenters.util :refer [markdown]]))
(declare display-file)
(defn exec [key]
(cond
(nil? key)
(display-file "nilkey")
(= "" key)
(display-file "badkey")
(.exists (clojure.java.io/file (str "resources/zor... | |
a60d7bb7840326638d9c00d10a9894f441995ac0be8d64e87d6b3085923266e6 | openmusic-project/openmusic | win32.lisp | -*- Mode : Lisp ; rcs - header : " $ Header : /hope / lwhope1 - cam / hope.0 / compound/61 / LISPopengl / RCS / win32.lisp , v 1.10.1.1 2014/05/27 20:56:57 davef Exp $ " -*-
Copyright ( c ) 1987 - -2015 LispWorks Ltd. All rights reserved .
(in-package "WIN32")
From WINGDI.H
;;; /* pixel types */
(defconstant ... | null | https://raw.githubusercontent.com/openmusic-project/openmusic/9560c064512a1598cd57bcc9f0151c0815178e6f/OPENMUSIC/code/api/externals/OpenGL/opengl-lw/win32.lisp | lisp | rcs - header : " $ Header : /hope / lwhope1 - cam / hope.0 / compound/61 / LISPopengl / RCS / win32.lisp , v 1.10.1.1 2014/05/27 20:56:57 davef Exp $ " -*-
/* pixel types */
/* layer types */
/* PIXELFORMATDESCRIPTOR flags */
------------------------------------------------------------
--------------------------... |
Copyright ( c ) 1987 - -2015 LispWorks Ltd. All rights reserved .
(in-package "WIN32")
From WINGDI.H
(defconstant *PFD-TYPE-RGBA* 0)
(defconstant *PFD-TYPE-COLORINDEX* 1)
(defconstant *PFD-MAIN-PLANE* 0)
(defconstant *PFD-OVERLAY-PLANE* 1)
(defconstant *PFD-UNDERLAY-PLANE* -1)
(defconstant ... |
0bc76b4834609209cbb2dd998275456c52cd9cc6fc0d78c68ed861aa1844d803 | couchbase/couchdb | cb_auth_info.erl | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an " A... | null | https://raw.githubusercontent.com/couchbase/couchdb/8a75fd2faa89f95158de1776354ceccf3e762753/src/couch_dcp/src/cb_auth_info.erl | erlang | 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
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations... | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
-module(cb_auth_info).
-export([get/0, trick_dialyzer/1]).
This is a fake cb_auth_info service ( provided by ns_server in couchbase stack )
get() ->
... |
38226bc33f6ba54bbd226f30a96bc039731ad60476618babe612b688e372c83b | racket/web-server | dummy-v2-servlet.rkt | #lang racket/base
(define interface-version #f)
(define start #f)
(define manager #f)
(provide (all-defined-out))
| null | https://raw.githubusercontent.com/racket/web-server/f718800b5b3f407f7935adf85dfa663c4bba1651/web-server-doc/web-server/scribblings/dummy-v2-servlet.rkt | racket | #lang racket/base
(define interface-version #f)
(define start #f)
(define manager #f)
(provide (all-defined-out))
| |
778ef73139699037fc52188ee9cb300987b0e5cd9753e8546d28b74a4c7b4865 | ThomasCrevoisier/chrome-remote-interface-haskell | TH.hs | module Chrome.Target.Message.TH where
import Data.Aeson.TH
import Language.Haskell.TH.Syntax (Dec, Name, Q)
escapeKeywords :: String -> String
escapeKeywords "type" = "_type"
escapeKeywords "data" = "_data"
escapeKeywords str = str
deriveJSONMsg :: Name -> Q [Dec]
deriveJSONMsg = deriveJSON (d... | null | https://raw.githubusercontent.com/ThomasCrevoisier/chrome-remote-interface-haskell/b7cb4a2367fda40a1e90bc3378a6c4e52578b2d7/src/Chrome/Target/Message/TH.hs | haskell | module Chrome.Target.Message.TH where
import Data.Aeson.TH
import Language.Haskell.TH.Syntax (Dec, Name, Q)
escapeKeywords :: String -> String
escapeKeywords "type" = "_type"
escapeKeywords "data" = "_data"
escapeKeywords str = str
deriveJSONMsg :: Name -> Q [Dec]
deriveJSONMsg = deriveJSON (d... | |
9ca12e08ec37de4862c7cf27f7a4a07e32722996e0de40a14720b0bdb5da128d | RichiH/git-annex | UpdateInstead.hs | git - annex UpdateIntead emulation
-
- Copyright 2017 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2017 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Annex.UpdateInstead where
import qualified Annex
import Annex.Common
import Config
impor... | null | https://raw.githubusercontent.com/RichiH/git-annex/bbcad2b0af8cd9264d0cb86e6ca126ae626171f3/Annex/UpdateInstead.hs | haskell | receive.denyCurrentBranch=updateInstead does not work in direct mode
- repositories or when an adjusted branch is checked out, so must be
- emulated. | git - annex UpdateIntead emulation
-
- Copyright 2017 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2017 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Annex.UpdateInstead where
import qualified Annex
import Annex.Common
import Config
impor... |
f0a0def1af5b558005aa9815e73dc1e9f7242c88d9615f7ee66769d93ac16380 | typedclojure/typedclojure | namespaced_specials.clj | (ns clojure.core.typed.test.namespaced-specials
(:require [typed.clj.checker.test-utils :refer :all]
[clojure.test :refer :all]
[typed.clojure :as t]))
;backwards compatibility tests for type syntax
(deftest value-test
(is-tc-e (ann-form :a ':a))
;old syntax
(is-cf (clojure.core.typed/... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/5fd7cdf7941c6e7d1dd5df88bf44474fa35e1fca/typed/clj.checker/test/clojure/core/typed/test/namespaced_specials.clj | clojure | backwards compatibility tests for type syntax
old syntax
runtime parsing
old syntax
bare quote should always resolve to clojure.core/quote
old syntax
new syntax
old syntax
new syntax
old syntax
new syntax
old syntax
new syntax | (ns clojure.core.typed.test.namespaced-specials
(:require [typed.clj.checker.test-utils :refer :all]
[clojure.test :refer :all]
[typed.clojure :as t]))
(deftest value-test
(is-tc-e (ann-form :a ':a))
(is-cf (clojure.core.typed/ann-form :a (clojure.core.typed/Value :a)))
(is-tc-e (ann-f... |
9141892c14d2bd00abcab9e6883f2100b506c11f636ec1f19a347359a3f10678 | haslab/HAAP | Tarefa4_2017li1g180.hs | # LANGUAGE PatternGuards #
module Tarefa4_2017li1g180 where
import LI11718
import Tarefa3_2017li1g180
import Tarefa1_2017li1g180
import Test.QuickCheck.Gen
import Data.List
import Data.Maybe
--import Safe
--import Debug.Trace
testesT4 :: [(Tempo,Jogo,Acao)]
testesT4 = [(0.2,jogoT { carros = ((head $ carros jogoT) { ... | null | https://raw.githubusercontent.com/haslab/HAAP/5acf9efaf0e5f6cba1c2482e51bda703f405a86f/examples/plab/svn/2017li1g180/src/Tarefa4_2017li1g180.hs | haskell | import Safe
import Debug.Trace
going right
going left | # LANGUAGE PatternGuards #
module Tarefa4_2017li1g180 where
import LI11718
import Tarefa3_2017li1g180
import Tarefa1_2017li1g180
import Test.QuickCheck.Gen
import Data.List
import Data.Maybe
testesT4 :: [(Tempo,Jogo,Acao)]
testesT4 = [(0.2,jogoT { carros = ((head $ carros jogoT) { velocidade = (1,0)}) : tail (carros... |
2adb722f2ae2f7855855b585082228bd218cc7281e5866774382352249468bf6 | mikeizbicki/subhask | Logic.hs | module SubHask.Algebra.Logic
where
import Control.Monad
import Test.QuickCheck.Gen (suchThat,oneof)
import SubHask.Algebra
import SubHask.Category
import SubHask.Internal.Prelude
import SubHask.TemplateHaskell.Deriving
class (Ord r, Ring r) => OrdRing_ r
instance (Ord r, Ring r) => OrdRing_ r
------------------... | null | https://raw.githubusercontent.com/mikeizbicki/subhask/f53fd8f465747681c88276c7dabe3646fbdf7d50/src/SubHask/Algebra/Logic.hs | haskell | ------------------------------------------------------------------------------
See the <plato.stanford.edu/entries/logic-fuzzy standford encyclopedia of logic>
-------------------------------------
In addition to true and false, there is a value to represent whether something's truth is unknown.
See <#Examples wik... | module SubHask.Algebra.Logic
where
import Control.Monad
import Test.QuickCheck.Gen (suchThat,oneof)
import SubHask.Algebra
import SubHask.Category
import SubHask.Internal.Prelude
import SubHask.TemplateHaskell.Deriving
class (Ord r, Ring r) => OrdRing_ r
instance (Ord r, Ring r) => OrdRing_ r
| The fuzzy lo... |
82e466aa9490aca8c41722ce07cdf93c43e966c8e85e53a4e5e550ea6a9b3e22 | PrincetonUniversity/lucid | ifToMatch.ml | ifToMatch -- convert if statements to match statements .
Before running this pass , the expressions that if
statements test must be in the following canonical form :
a disjunction of terms ,
where each term is a conjunction of atom ,
where each atom is an equality or inequality check
... | null | https://raw.githubusercontent.com/PrincetonUniversity/lucid/627c08aabfa47d165f8fedbf569750ac724ad760/src/lib/backend/transformations/ifToMatch.ml | ocaml | the core algorithm is pulled out of the old backend
get the mapping from key (which appears in the atom) to value
get a pattern that encodes exact matches for the keys in the atoms,
and wildcard for the other keys.
*** from mergeutils ***
extend a pattern so that it has a column for every var in vars
empty... | ifToMatch -- convert if statements to match statements .
Before running this pass , the expressions that if
statements test must be in the following canonical form :
a disjunction of terms ,
where each term is a conjunction of atom ,
where each atom is an equality or inequality check
... |
4f5766e6c9be13f729f3ddcc8febd5d8b8c6993437d02decf6ddd905d30e8ad8 | wilbowma/cur | cur.rkt | #lang racket/base
(require
racket/function
racket/list
scribble/base
(rename-in
retex
[render-mathpar-judgment _render-mathpar-judgment])
typeset-rewriter
cur/curnel/model/core
redex/reduction-semantics
[except-in
redex/pict
render-term
render-language
render-judgment-form
render-reduction-relati... | null | https://raw.githubusercontent.com/wilbowma/cur/e039c98941b3d272c6e462387df22846e10b0128/cur-paper/cur.rkt | racket | (except-out
NB: Manually compiled because rw-lambda was producing garbage
,(just-before (text "Unv" (literal-style) (default-font-size)) i)
,(text (format "~a" (lw-e i)) (non-terminal-subscript-style) (default-font-size)) | #lang racket/base
(require
racket/function
racket/list
scribble/base
(rename-in
retex
[render-mathpar-judgment _render-mathpar-judgment])
typeset-rewriter
cur/curnel/model/core
redex/reduction-semantics
[except-in
redex/pict
render-term
render-language
render-judgment-form
render-reduction-relati... |
e11d5ac69b019abd742ca395c7c1af6121829ead1007bb6a49e646b547cffc6a | nyinyithann/favemarks | db.ml | open Core
open Sqlite3
open Core.Result
let get_total_count ~db_path =
try
let db = db_open ~mode:`NO_CREATE ~uri:true db_path in
let sql = sprintf "SELECT COUNT(*) FROM bookmarks" in
let stmt = prepare db sql in
ignore @@ step stmt;
let c = column_int stmt 0 in
ignore @@ finalize stmt;
i... | null | https://raw.githubusercontent.com/nyinyithann/favemarks/55fb52d4f3efeae8ef478f1fe098456196e80dea/src/db/db.ml | ocaml | open Core
open Sqlite3
open Core.Result
let get_total_count ~db_path =
try
let db = db_open ~mode:`NO_CREATE ~uri:true db_path in
let sql = sprintf "SELECT COUNT(*) FROM bookmarks" in
let stmt = prepare db sql in
ignore @@ step stmt;
let c = column_int stmt 0 in
ignore @@ finalize stmt;
i... | |
c82112dced515733c486d5f8dafa71d369833d37c2a06dc92e86af117842312b | votinginfoproject/data-processor | tree_xml_postgres_test.clj | (ns vip.data-processor.output.tree-xml-postgres-test
(:require [clojure.test :refer :all]
[korma.core :as korma]
[vip.data-processor.db.postgres :as postgres]
[vip.data-processor.output.tree-xml :refer :all]
[vip.data-processor.pipeline :as pipeline]
[vip.da... | null | https://raw.githubusercontent.com/votinginfoproject/data-processor/b4baf334b3a6219d12125af8e8c1e3de93ba1dc9/test/vip/data_processor/output/tree_xml_postgres_test.clj | clojure | (ns vip.data-processor.output.tree-xml-postgres-test
(:require [clojure.test :refer :all]
[korma.core :as korma]
[vip.data-processor.db.postgres :as postgres]
[vip.data-processor.output.tree-xml :refer :all]
[vip.data-processor.pipeline :as pipeline]
[vip.da... | |
474b5f9a03e77e785a9e0227923f008446ea1305650c6844b577fa0a5361c3c2 | technoblogy/lisp-riscv-assembler | RISC-V Assembler.lisp | ;
; RISC-V Assembler - 20th March 2020
; see
;
Print 16 - bit number in hex
(defun x16 (n)
(printhex 4 n))
Print 32 - bit number in hex
(defun x32 (n)
(printhex 8 n))
(defun printhex (m n)
(princ "#x")
(dotimes (j m nil)
(let ((d (logand (ash n (* (- j m -1) 4)) #xf)))
(princ
(code-char... | null | https://raw.githubusercontent.com/technoblogy/lisp-riscv-assembler/de1f66b29dbabb205c32ee896968b3fb577f0956/RISC-V%20Assembler.lisp | lisp |
RISC-V Assembler - 20th March 2020
see
Extract register number
Short 3-bit register
Pack arguments into bit fields
Errors
Test range of immediate values
Extract bitfield
Instruction formats
Alphabetical list of mnemonics
rs1 = sp
rs1 = general
$addi
rs1 = sp
rs1 = general
base = sp
base = general
... |
Print 16 - bit number in hex
(defun x16 (n)
(printhex 4 n))
Print 32 - bit number in hex
(defun x32 (n)
(printhex 8 n))
(defun printhex (m n)
(princ "#x")
(dotimes (j m nil)
(let ((d (logand (ash n (* (- j m -1) 4)) #xf)))
(princ
(code-char (+ d (if (< d 10) (char-code #\0) (char-code #\... |
89e1a21dabb76472b4fc68f4e1b89424dcb2efddb5f212d55e8c0fa8383ac61a | nikodemus/sb-cga | ecl.lisp | By < > , 2010 .
;;;;
;;;; Permission is hereby granted, free of charge, to any person
;;;; obtaining a copy of this software and associated documentation files
( the " Software " ) , to deal in the Software without restriction ,
;;;; including without limitation the rights to use, copy, modify, merge,
publish ... | null | https://raw.githubusercontent.com/nikodemus/sb-cga/8d83e4a045f6aa408c82b26dcec5b196849ec1bf/ports/ecl.lisp | lisp |
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation files
including without limitation the rights to use, copy, modify, merge,
subject to the following conditions:
EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
IN NO EVEN... | By < > , 2010 .
( the " Software " ) , to deal in the Software without restriction ,
publish , distribute , sublicense , and/or sell copies of the Software ,
and to permit persons to whom the Software is furnished to do so ,
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
MERCHANTABIL... |
bcf06fb3638f9102566e98b601ba17260121cac4fdfddf68d33ea67762fd5c21 | ddmcdonald/sparser | drugs.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER COMMON-LISP) -*-
Copyright ( c ) 2014 - 2017 SIFT LLC . All Rights Reserved
;;;
;;; File: "drugs"
;;; Module: "grammar/model/sl/biology/
version : May 2017
Define drugs based on results gleaned from the cureRAS corpus with SketchEngine
;; NOTE: there ar... | null | https://raw.githubusercontent.com/ddmcdonald/sparser/4bb59f0989152f059f7b008ca4bfd89501bae04c/Sparser/code/s/grammar/model/sl/biology/drugs.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:(SPARSER COMMON-LISP) -*-
File: "drugs"
Module: "grammar/model/sl/biology/
NOTE: there are a number of mis-spelling here -- neeed to figure out how to deal with them
LB 5/10/2017 moved inhibitors here since they specialize drug
--- Drugs
MAPK pathway inhibitors. MAP... | Copyright ( c ) 2014 - 2017 SIFT LLC . All Rights Reserved
version : May 2017
Define drugs based on results gleaned from the cureRAS corpus with SketchEngine
RJB 12/13/2014 make " drug " and " inhibitor " drugs -- not sure about this , but they are treated like that for the annotation
added a couple of new d... |
e693e04ef6ca050866ad96693f540a4f5cd240196f75a9c73a90352d29a079f7 | walmartlabs/schematic | lang.clj | Copyright ( c ) 2017 - present , Walmart Inc.
;;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;;; you may not use this file except in compliance with the License.
;;; You may obtain a copy of the License at
;;;
;;; -2.0
;;;
;;; Unless required by applicable law or agreed to in writing, sof... | null | https://raw.githubusercontent.com/walmartlabs/schematic/9d2eb16eb3550f06d3030b3b0ff9d519b803f88a/src/com/walmartlabs/schematic/lang.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permiss... | Copyright ( c ) 2017 - present , Walmart Inc.
distributed under the License is distributed on an " AS IS " BASIS ,
(ns ^:no-doc com.walmartlabs.schematic.lang
"Internal utilities used by Schematic.")
(defn map-vals
"Maps f over every value in the hash-map mm and returns a new
hash-map. E.g (map-vals inc {:a... |
64595231b300b49b805e31de673f1092333b2f815a602791e39c4a5d6e520eef | janestreet/merlin-jst | ast_iterator.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/janestreet/merlin-jst/980b574405617fa0dfb0b79a84a66536b46cd71b/upstream/ocaml_413/parsing/ast_iterator.ml | ocaml | ************************************************************************
OCaml
... | , LexiFi
Copyright 2012 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
A generic Parsetree mapping class
[ @@@ocaml.warning " +9 " ]
( * Ensure that record patterns do n't ... |
c1a4beacf1c3dd797bb254928129d3b8390812bd530d62cb8b954d973703716e | agrafix/openai-hs | ApiSpec.hs | module ApiSpec (apiSpec) where
import qualified Data.Text as T
import qualified Data.Vector as V
import Network.HTTP.Client
import Network.HTTP.Client.TLS
import OpenAI.Client
import System.Environment (getEnv)
import Test.Hspec
makeClient :: IO OpenAIClient
makeClient =
do
manager <- newManager tlsManagerSetti... | null | https://raw.githubusercontent.com/agrafix/openai-hs/e4be98ddedf2d566623826bb1c5d45bba1869571/openai-hs/test/ApiSpec.hs | haskell | pool | module ApiSpec (apiSpec) where
import qualified Data.Text as T
import qualified Data.Vector as V
import Network.HTTP.Client
import Network.HTTP.Client.TLS
import OpenAI.Client
import System.Environment (getEnv)
import Test.Hspec
makeClient :: IO OpenAIClient
makeClient =
do
manager <- newManager tlsManagerSetti... |
7d856ffe4beae84d3dcd81df2030d65504c446653ff5f664541831fbc411fa6e | erlang/otp | erl_scan.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2022 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/erlang/otp/1a3e3c492378d119e96a0f24f71b9d0313076447/lib/stdlib/src/erl_scan.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 1996 - 2022 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
Erlang token scanning functions of io library .
000 - 037 NUL - US control
040 - 057 SPC - / ... |
5bf1b23b7780bad2906f9dcd6f18a44828fbcf8d66f31f47bf281b19ccee6eed | ErlyORM/boss_db | boss_db_sup.erl | -module(boss_db_sup).
-author('').
-behaviour(supervisor).
-export([start_link/0, start_link/1]).
-export([init/1]).
start_link() ->
start_link([]).
start_link(StartArgs) ->
supervisor:start_link({local, ?MODULE}, ?MODULE, StartArgs).
init(StartArgs) ->
Args = StartArgs ++ [{name, {local, boss_db_pool... | null | https://raw.githubusercontent.com/ErlyORM/boss_db/20060a061d3c4120929e4a4fedae1bb5e5830426/src/boss_db_sup.erl | erlang | -module(boss_db_sup).
-author('').
-behaviour(supervisor).
-export([start_link/0, start_link/1]).
-export([init/1]).
start_link() ->
start_link([]).
start_link(StartArgs) ->
supervisor:start_link({local, ?MODULE}, ?MODULE, StartArgs).
init(StartArgs) ->
Args = StartArgs ++ [{name, {local, boss_db_pool... | |
836bafc22c418134657a851ad9f432bbacc4d201efdc3547573988447579a42b | synrc/mad | mad_cubical.erl | -module(mad_cubical).
-copyright('Maxim Sokhatsky').
-compile(export_all).
compile(File,_Inc,_Bin,_Opt,_Deps) ->
{_,Res,Msg} = sh:run(sh:executable("cubical"), ["-b", File], binary, "."),
case Res of
1 -> true;
0 -> case binary:match(Msg,[<<"File loaded.">>]) of
nomatch -> ... | null | https://raw.githubusercontent.com/synrc/mad/b8811aebd662c2a281c9f87642b5cab9321cf543/src/compile/mad_cubical.erl | erlang | -module(mad_cubical).
-copyright('Maxim Sokhatsky').
-compile(export_all).
compile(File,_Inc,_Bin,_Opt,_Deps) ->
{_,Res,Msg} = sh:run(sh:executable("cubical"), ["-b", File], binary, "."),
case Res of
1 -> true;
0 -> case binary:match(Msg,[<<"File loaded.">>]) of
nomatch -> ... | |
453c45799af404ffc57d3a5497e2fc4eea61fe1923fd4d8bfa25c42649f80218 | BitGameEN/bitgamex | hello.erl | %% File : hello.erl
Purpose : Brief demonstration of Luerl basics .
Use $ erlc hello.erl & & erl -pa ./ebin -s hello run -s init stop -noshell
%% Or $ make hello
-module(hello).
-export([run/0]).
run() ->
% execute a string
luerl:do("print(\"Hello, Robert(o)!\")"),
% execute a file
... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/deps/luerl/examples/hello/hello.erl | erlang | File : hello.erl
Or $ make hello
execute a string
execute a file
separately parse, then execute | Purpose : Brief demonstration of Luerl basics .
Use $ erlc hello.erl & & erl -pa ./ebin -s hello run -s init stop -noshell
-module(hello).
-export([run/0]).
run() ->
luerl:do("print(\"Hello, Robert(o)!\")"),
luerl:dofile("./hello.lua"),
State0 = luerl:init(),
{ok, Chunk, State1} = luerl:lo... |
2e0d4819fd47cfb46a094672d09b1fad02a1582edf7b9c5549f0680d85493b03 | facebookarchive/duckling_old | duration.clj | ; Durations / Periods
(
"second (unit-of-duration)"
#"(?i)sec(ond[oi])?"
{:dim :unit-of-duration
width of interval when " in 10 secs "
"minute (unit-of-duration)"
#"(?i)min(ut[oi])?"
{:dim :unit-of-duration
:grain :minute}
"hour (unit-of-duration)"
#"(?i)or[ae]"
{:dim :unit-of-duration
:gra... | null | https://raw.githubusercontent.com/facebookarchive/duckling_old/bf5bb9758c36313b56e136a28ba401696eeff10b/resources/languages/it/rules/duration.clj | clojure | Durations / Periods
prevent negative duration... |
(
"second (unit-of-duration)"
#"(?i)sec(ond[oi])?"
{:dim :unit-of-duration
width of interval when " in 10 secs "
"minute (unit-of-duration)"
#"(?i)min(ut[oi])?"
{:dim :unit-of-duration
:grain :minute}
"hour (unit-of-duration)"
#"(?i)or[ae]"
{:dim :unit-of-duration
:grain :hour}
"day (uni... |
1e3c7239d21d8dcdafc1f5bb1b3f44a12bc57373a86df99004c165b600020439 | IxpertaSolutions/freer-effects | Coroutine.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE NoImplicitPrelude #
module Tests.Coroutine (tests)
where
import Prelude ((+), even)
import Control.Applicative ((<*>), pure)
import Control.Monad ((>>), (>>=), unless)
import Data.Bool (Bool, (&&))
import Data.Eq ((==))... | null | https://raw.githubusercontent.com/IxpertaSolutions/freer-effects/39a7e62cc049d43d36ece4ac24ba19e545f0b726/tests/Tests/Coroutine.hs | haskell | # LANGUAGE ConstraintKinds #
| Counts number of consecutive pairs of odd elements at beginning of a list. | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE NoImplicitPrelude #
module Tests.Coroutine (tests)
where
import Prelude ((+), even)
import Control.Applicative ((<*>), pure)
import Control.Monad ((>>), (>>=), unless)
import Data.Bool (Bool, (&&))
import Data.Eq ((==))
import Data.Function (($), (.))
... |
32c6e3e92cc99e7c0f083e3882d5f90f01fdaa49fbc33ad5a7095ce23936ae8b | argp/bap | debug.ml | let logfile = ref stderr
let set_logfile log = logfile := log
let debug_string s = output_string !logfile s
let debug_endline s =
debug_string s;
debug_string "\n";
flush !logfile
(* Disabling global debugging turns off all debug functionality for all modules *)
let global_debug = ref true
let set_global_debug ... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/ocaml/debug.ml | ocaml | Disabling global debugging turns off all debug functionality for all modules
Use the appropriate logfile, as per environment variables
[has_debug d s] returns true when debugging is enabled for s. d is the
default behavior.
See documentation on [BAP_DEBUG_MODULES] at the top.
number of "normal" indents ... | let logfile = ref stderr
let set_logfile log = logfile := log
let debug_string s = output_string !logfile s
let debug_endline s =
debug_string s;
debug_string "\n";
flush !logfile
let global_debug = ref true
let set_global_debug v = global_debug := v
let () =
try
let filename = Sys.getenv "BAP_LOGFILE" i... |
46ab626290cd0f7d4e445da9755366f717d562a9de9c495d97a69c1a0f0d05a0 | dbuenzli/mu | articulation.ml | (* This code is in the public domain *)
open Mu
open Mu.Syntax
let art m a = M.phrase [`Art a] m
let arts = [ `Staccato Q.(1 #/ 4);
`Legato Q.(int 4);
`Slurred Q.(int 4); ]
let boogie = M.line M.[c 4 en; e 4 en; g 4 en; a 4 en]
let song = boogie ^ M.line (List.map (art boogie) arts)
let m... | null | https://raw.githubusercontent.com/dbuenzli/mu/f6028ba4515bd49eb076b7394dee39e8f35e13fa/test/articulation.ml | ocaml | This code is in the public domain |
open Mu
open Mu.Syntax
let art m a = M.phrase [`Art a] m
let arts = [ `Staccato Q.(1 #/ 4);
`Legato Q.(int 4);
`Slurred Q.(int 4); ]
let boogie = M.line M.[c 4 en; e 4 en; g 4 en; a 4 en]
let song = boogie ^ M.line (List.map (art boogie) arts)
let main () = Mu_player.main (Music.map Pnote... |
5b3b3f0263e225cb0a066c1e26c8c6a0e03ac20f8b0dcfdf31652cb2853a39b7 | pink-gorilla/goldly | css_theme.clj | (ns goldly.config.build.css-theme)
; the lazy-css loader loads the entire css for an extension, when this
; extension gets lazy-loaded.
; therefore we need to have a map of key:module-name => value module-css-theme
; this is different to the webly static loaded css themes
; which is run at run-time.
(defn- extensio... | null | https://raw.githubusercontent.com/pink-gorilla/goldly/9589dc51c8fe894319e9eededdc1c965c3314491/goldly/src/goldly/config/build/css_theme.clj | clojure | the lazy-css loader loads the entire css for an extension, when this
extension gets lazy-loaded.
therefore we need to have a map of key:module-name => value module-css-theme
this is different to the webly static loaded css themes
which is run at run-time.
| (ns goldly.config.build.css-theme)
(defn- extension-css-theme [themes
{:keys [lazy name theme]
:or {theme {:available {} :current {}}}}]
(if lazy
(assoc themes name theme)
themes))
(defn css-theme-config [exts]
(reduce extension-css-theme {} (val... |
c0dc1f6ad173ee3005921429d9d0d4bc29f0d9fd1520b43ebf437427aad38f3b | elizabethsiegle/reddit-slack-bot | AvailablePhoneNumber.hs | # LANGUAGE MultiParamTypeClasses #
{-#LANGUAGE OverloadedStrings #-}
module Twilio.AvailablePhoneNumber
( -- * Resource
AvailablePhoneNumber(..)
) where
import Control.Applicative
import Control.Error.Safe
import Control.Monad
import Data.Aeson
import Data.Text (Text)
import Twilio.Types
import Twilio.Intern... | null | https://raw.githubusercontent.com/elizabethsiegle/reddit-slack-bot/a52ab60dcaae8e16bee8cdba22fce627157a42d8/twilio-haskell-move-to-stack/src/Twilio/AvailablePhoneNumber.hs | haskell | #LANGUAGE OverloadedStrings #
* Resource | # LANGUAGE MultiParamTypeClasses #
module Twilio.AvailablePhoneNumber
AvailablePhoneNumber(..)
) where
import Control.Applicative
import Control.Error.Safe
import Control.Monad
import Data.Aeson
import Data.Text (Text)
import Twilio.Types
import Twilio.Internal.Parser
Resource
data AvailablePhoneNumber = A... |
8e28e658d8d931952a67273cc9f7b7688c55d00b92c3061cbd170d3da08f4782 | Appliscale/xprof | xprof_core_lib.erl | -module(xprof_core_lib).
-export([mfaspec2atom/1,
mfa2atom/1,
mfaspec2id/1,
now2epoch/1,
set_mode/1,
get_mode/0,
get_mode_cb/0,
set_event_handler/1,
unset_event_handler/0,
notify_event_handler/1,
prefix/2,
prefix_rest/2,... | null | https://raw.githubusercontent.com/Appliscale/xprof/fbe4c1743fd9caf003ed5fd77e2ac20a4eab4349/apps/xprof_core/src/xprof_core_lib.erl | erlang | ignore crash
@doc Throw an error in a common format
@doc Return an error in a common format | -module(xprof_core_lib).
-export([mfaspec2atom/1,
mfa2atom/1,
mfaspec2id/1,
now2epoch/1,
set_mode/1,
get_mode/0,
get_mode_cb/0,
set_event_handler/1,
unset_event_handler/0,
notify_event_handler/1,
prefix/2,
prefix_rest/2,... |
318ec587edd6904d48d499a2945b55af60f8ba20597f855dd6fd6eeb4a47bb46 | evrim/core-server | authorize.lisp | ;; -------------------------------------------------------------------------
;; Authorization
;; -------------------------------------------------------------------------
Author : >
Date : 11/3/2012
(in-package :core-server)
;; -------------------------------------------------------------------------
;; Secure... | null | https://raw.githubusercontent.com/evrim/core-server/200ea8151d2f8d81b593d605b183a9cddae1e82d/src/security/authorize.lisp | lisp | -------------------------------------------------------------------------
Authorization
-------------------------------------------------------------------------
-------------------------------------------------------------------------
Secure Object
----------------------------------------------------------------... | Author : >
Date : 11/3/2012
(in-package :core-server)
(defparameter +umask+
'((owner . 1) (group . 0) (other . 0) (anonymous . 0) (unauthorized . -1)))
(defclass+ secure-object ()
((owner :host local :type abstract-user :export nil :reader secure.owner
:initarg :owner :initform (error "Provide :owner")... |
30156fb9aae5a84e07b42182b87402f1d6eb688cf534c08cac371778f88e927c | informatikr/hedis | ClusterMain.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
module Main (main) where
import qualified Test.Framework as Test
import Database.Redis
import Tests
main :: IO ()
main = do
-- We're looking for the cluster on a non-default port to support running
-- this test in parallel witht the regular non-clust... | null | https://raw.githubusercontent.com/informatikr/hedis/8b61416f44d7ae781f2cd1e4d842577971243aba/test/ClusterMain.hs | haskell | # LANGUAGE OverloadedStrings #
We're looking for the cluster on a non-default port to support running
this test in parallel witht the regular non-cluster tests. To quickly
spin up a cluster on this port using docker you can run:
should always be run last as connection gets closed after it | # LANGUAGE LambdaCase #
module Main (main) where
import qualified Test.Framework as Test
import Database.Redis
import Tests
main :: IO ()
main = do
docker run -e " IP=0.0.0.0 " -p 7000 - 7010:7000 - 7010 grokzen / redis - cluster:5.0.6
conn <- connectCluster defaultConnectInfo { connectPort = PortNumber 70... |
564d5713757d7532068d9272496921d8d0fc3f22226d4d6c48d53e33e542730e | acieroid/scala-am | mutex2.scm | (letrec ((lock (atom #f))
(acq (lambda ()
(if (compare-and-set! lock #f #t)
#t
(acq))))
(rel (lambda ()
(set! lock #f)))
(counter 0)
(inc (lambda ()
(acq)
(set! counter (+ counter ... | null | https://raw.githubusercontent.com/acieroid/scala-am/13ef3befbfc664b77f31f56847c30d60f4ee7dfe/test/concurrentScheme/futures/variations/mutex2.scm | scheme | (letrec ((lock (atom #f))
(acq (lambda ()
(if (compare-and-set! lock #f #t)
#t
(acq))))
(rel (lambda ()
(set! lock #f)))
(counter 0)
(inc (lambda ()
(acq)
(set! counter (+ counter ... | |
abcc592ad7e5574dd8c57c1153a786bcc01d442d06ea9cdc1487faab5db64ec0 | oxidizing/letters | test.ml | open Letters
let stream_to_string s =
let b = Buffer.create 4096 in
let rec go () =
match s () with
| Some (buf, off, len) ->
Buffer.add_substring b buf off len;
go ()
| None -> Buffer.contents b
in
go ()
;;
let test_create_plain_text_email _ () =
let recipients = [ To "" ] in
let ... | null | https://raw.githubusercontent.com/oxidizing/letters/35f7594d15e3e670a5b99c8f6f75248bad9f7f85/test/test.ml | ocaml | check for config compatibility | open Letters
let stream_to_string s =
let b = Buffer.create 4096 in
let rec go () =
match s () with
| Some (buf, off, len) ->
Buffer.add_substring b buf off len;
go ()
| None -> Buffer.contents b
in
go ()
;;
let test_create_plain_text_email _ () =
let recipients = [ To "" ] in
let ... |
9e74d7b47d5c263eb8d19b66cb1058f28aa9da17f9a1840d30400e56f807448d | noitcudni/google-search-console-bulk-url-removal | project.clj | (defproject noitcudni/google-webmaster-tools-bulk-url-removal "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.520"]
[org.clojure/core.async "0.4.500"]
[binaryage/chromex "0.8.1"]
;; [binaryage/chromex "... | null | https://raw.githubusercontent.com/noitcudni/google-search-console-bulk-url-removal/0f922c7301e26fba0c7ec75e73e4f8df29962348/project.clj | clojure | [binaryage/chromex "0.8.5"]
:optimizations :whitespace ; content scripts cannot do eval / load script dynamically
:content-script-2
{:source-paths ["src/content_script"]
:compiler {:output-to "resources/unpacked/compiled/removals_request/removals_request.j... | (defproject noitcudni/google-webmaster-tools-bulk-url-removal "0.1.0-SNAPSHOT"
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/clojurescript "1.10.520"]
[org.clojure/core.async "0.4.500"]
[binaryage/chromex "0.8.1"]
[binaryage/devtools "0.... |
e33ac12573e61cecfb575e4363c05e259c7b2ef8e4a71eb217ffeb327a650b73 | achirkin/vulkan | VK_EXT_shader_demote_to_helper_invocation.hs | # OPTIONS_HADDOCK not - home #
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE MagicHash #-}
# LANGUAGE PatternSynonyms #
{-# LANGUAGE Strict #-}
{-# LANGUAGE ViewPatterns #-}
module Graphics.Vulkan.Ext.VK_EXT_shader_demote_to_helper_invocation
* Vulkan extension : @VK_EXT_shader_demote_to_helper_invo... | null | https://raw.githubusercontent.com/achirkin/vulkan/b2e0568c71b5135010f4bba939cd8dcf7a05c361/vulkan-api/src-gen/Graphics/Vulkan/Ext/VK_EXT_shader_demote_to_helper_invocation.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE MagicHash #
# LANGUAGE Strict #
# LANGUAGE ViewPatterns #
|
supported: @vulkan@
author: @EXT@
type: @device@
Required extensions: 'VK_KHR_get_physical_device_properties2'.
** Required extensions: 'VK_KHR_get_physical_device_properties2'.
> #include... | # OPTIONS_HADDOCK not - home #
# LANGUAGE PatternSynonyms #
module Graphics.Vulkan.Ext.VK_EXT_shader_demote_to_helper_invocation
* Vulkan extension : @VK_EXT_shader_demote_to_helper_invocation@
contact : @Jeff Bolz @jeffbolznv@
Extension number :
module Graphics.Vulkan.Marshal, AHardwareBuffer(),
... |
78e5b3e0c8634150960255fce143e6384c793eb8c80a88950d147d7d4084f001 | b0-system/b0 | b0_cmd_log.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2020 The b0 programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... | null | https://raw.githubusercontent.com/b0-system/b0/cbe12b8a55da6b50ab01ed058b339dbed3cfe894/tool-b0/b0_cmd_log.ml | ocaml | FIXME
This should also be fixed b00-cache / B00_cli.Memo.log_file
Command line interface | ---------------------------------------------------------------------------
Copyright ( c ) 2020 The b0 programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... |
45cae2503c2239d1b98dee20014f3b7a20696b7afb6cc832f06b281eba86d551 | jarvinet/scheme | section334_sample_simulation.scm | ;;; Sample simulation
(define the-agenda (make-agenda))
(define inverter-delay 2)
(define and-gate-delay 3)
(define or-gate-delay 5)
(define input-1 (make-wire))
(define input-2 (make-wire))
(define sum (make-wire))
(define carry (make-wire))
(probe 'sum sum)
(probe 'carry carry)
(half-adder input-1 input-2 sum car... | null | https://raw.githubusercontent.com/jarvinet/scheme/47633d7fc4d82d739a62ceec75c111f6549b1650/Book/Edition1/section334_sample_simulation.scm | scheme | Sample simulation |
(define the-agenda (make-agenda))
(define inverter-delay 2)
(define and-gate-delay 3)
(define or-gate-delay 5)
(define input-1 (make-wire))
(define input-2 (make-wire))
(define sum (make-wire))
(define carry (make-wire))
(probe 'sum sum)
(probe 'carry carry)
(half-adder input-1 input-2 sum carry)
(set-signal! input... |
cff52efa12324a3b4dbcc0fa75e01308de4d0f1f561891c0dc1c3cbb2313d00b | slipstream/SlipStreamServer | acl.clj | (ns com.sixsq.slipstream.db.es.acl
(:require
[com.sixsq.slipstream.db.es.filter :as ef]
[com.sixsq.slipstream.db.utils.acl :as acl-utils]))
(def ^:private query-no-result (ef/term-query "id" ""))
(defn and-acl
"Enriches query-builder by adding a clause on ACL (extracted from options)"
[query-builder {:k... | null | https://raw.githubusercontent.com/slipstream/SlipStreamServer/3ee5c516877699746c61c48fc72779fe3d4e4652/db-binding/src/com/sixsq/slipstream/db/es/acl.clj | clojure | (ns com.sixsq.slipstream.db.es.acl
(:require
[com.sixsq.slipstream.db.es.filter :as ef]
[com.sixsq.slipstream.db.utils.acl :as acl-utils]))
(def ^:private query-no-result (ef/term-query "id" ""))
(defn and-acl
"Enriches query-builder by adding a clause on ACL (extracted from options)"
[query-builder {:k... | |
1b43f324a76e8b87b0687bce0d0dba1d69e6e34ffd1b14f9eae444758c3c9b8a | gdamore/tree-sitter-d | typeof.scm | ==================
Typeof expression
==================
auto t = typeof(0);
---
(source_file
(auto_declaration
(storage_class (auto))
(identifier)
(typeof_expression (typeof) (expression (int_literal)))
)
)
==================
Typeof expression (return)
==================
auto t = typeof (return);
---
... | null | https://raw.githubusercontent.com/gdamore/tree-sitter-d/d7b3cc1f9f1f59518457696a8547e0e1bb1a64b4/test/corpus/typeof.scm | scheme | ==================
Typeof expression
==================
---
(source_file
(auto_declaration
(storage_class (auto))
(identifier)
(typeof_expression (typeof) (expression (int_literal)))
)
)
==================
Typeof expression (return)
==================
---
(source_file
(auto_declaration
(storage_cla... | |
d32098efe8cba2b05f15c3f8c6c3c1c4a635ba6b21e2254db0f79b2eda502dbe | jarohen/graph-zip | merge_graph.clj | (ns graph-zip.merge-graph
(:use [graph-zip.core]
[graph-zip.in-memory :only [my-map build-in-memory-graph]]))
(defrecord MergeGraph [graphs]
Graph
(props-map [this node direction]
(let [maps (map #(props-map % node direction) graphs)
non-empty-maps (filter #(not (empty? %)) maps)]
(ap... | null | https://raw.githubusercontent.com/jarohen/graph-zip/fdcd533cee64140758624f15b36de9e0a6e1c789/src/graph_zip/merge_graph.clj | clojure | TESTS -----------------------
-> "prod-host/instance3"
-> "prod-host/instance" | (ns graph-zip.merge-graph
(:use [graph-zip.core]
[graph-zip.in-memory :only [my-map build-in-memory-graph]]))
(defrecord MergeGraph [graphs]
Graph
(props-map [this node direction]
(let [maps (map #(props-map % node direction) graphs)
non-empty-maps (filter #(not (empty? %)) maps)]
(ap... |
f12b0c17fbf69fa6959101f21e3eb1447b39cfb4cd88f3549ca210d1ef120526 | NorfairKing/validity | Map.hs | # OPTIONS_GHC -fno - warn - orphans #
module Data.Validity.Map
( decorateMap,
)
where
import Data.Map (Map)
import qualified Data.Map as M
import Data.Validity
-- | A 'Map' of things is valid if all the keys and values are valid and the 'Map' itself
-- is valid.
instance (Show k, Ord k, Validity k, Validity v) =... | null | https://raw.githubusercontent.com/NorfairKing/validity/1c3671a662673e21a1c5e8056eef5a7b0e8720ea/validity-containers/src/Data/Validity/Map.hs | haskell | | A 'Map' of things is valid if all the keys and values are valid and the 'Map' itself
is valid. | # OPTIONS_GHC -fno - warn - orphans #
module Data.Validity.Map
( decorateMap,
)
where
import Data.Map (Map)
import qualified Data.Map as M
import Data.Validity
instance (Show k, Ord k, Validity k, Validity v) => Validity (Map k v) where
validate m =
mconcat
[ declare "The Map structure is valid." $ M... |
306c6d59dcf52824a35553149dde732e0a4896c2f7bb829610f4e981b7fd6866 | 2600hz-archive/whistle | rabbit_msg_store_index.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/lib/rabbitmq_server-2.4.1/src/rabbit_msg_store_index.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License
at /
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
| The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is VMware , Inc.
Copyright ( c ) 2007 - 2011 VMware , Inc. All rights reserved .
-module(rabbi... |
911b1170573ad9a5a6d94890d9936b2982b64f2c25736d17339e88051ffc82c1 | uw-unsat/serval-sosp19 | basic.rkt | #lang rosette
(require (except-in rackunit fail)
rackunit/text-ui
rosette/lib/roseunit
serval/lib/unittest
(prefix-in core: serval/lib/core)
(prefix-in riscv: serval/riscv/objdump)
(prefix-in keystone: "symbols.rkt")
(prefix-in keystone: "generated/monitor... | null | https://raw.githubusercontent.com/uw-unsat/serval-sosp19/175c42660fad84b44e4c9f6f723fd3c9450d65d4/monitors/keystone/verif/basic.rkt | racket | Start a CPU in fresh, just-after-reset state
Trash every GPR
Resume enclave
Run again (from machine_trap_vector this time)
(test-case+ "Check keystone" (check-keystone)) | #lang rosette
(require (except-in rackunit fail)
rackunit/text-ui
rosette/lib/roseunit
serval/lib/unittest
(prefix-in core: serval/lib/core)
(prefix-in riscv: serval/riscv/objdump)
(prefix-in keystone: "symbols.rkt")
(prefix-in keystone: "generated/monitor... |
09e96c1f4ddf6dc0fa434e49e6699d8b2ea9db506c6730e50050cafaf5a7eeb2 | solita/mnt-teet | user_tx.clj | (ns teet.user.user-tx
(:require [datomic.client.api :as d]
[teet.meta.meta-model :as meta-model]
[datomic.ion :as ion])
(:import (java.util Date)))
(defn ensure-unique-email [db email tx-data]
(if-not email
tx-data
(let [{db-after :db-after} (d/with db {:tx-data tx-data})
... | null | https://raw.githubusercontent.com/solita/mnt-teet/7a5124975ce1c7f3e7a7c55fe23257ca3f7b6411/app/backend/src/clj/teet/user/user_tx.clj | clojure | (ns teet.user.user-tx
(:require [datomic.client.api :as d]
[teet.meta.meta-model :as meta-model]
[datomic.ion :as ion])
(:import (java.util Date)))
(defn ensure-unique-email [db email tx-data]
(if-not email
tx-data
(let [{db-after :db-after} (d/with db {:tx-data tx-data})
... | |
290d6951ff6097f62f9a8ec7ea6c91fdb261875fb9f63350a3183e8278c23e23 | cnuernber/tmdjs | cljs_ajax.cljs | (ns tech.v3.libs.cljs-ajax
"Bindings to use the dataset handlers in cljs GET/POST calls."
(:require [ajax.core :as ajax]
[ajax.interceptors :as ajax-interceptors]
[ajax.transit :as ajax-transit]
[tech.v3.dataset :as ds]
[tech.v3.datatype.datetime :as dtype-dt]
... | null | https://raw.githubusercontent.com/cnuernber/tmdjs/c0086716801cc0fa3161813a4598772241909410/src/tech/v3/libs/cljs_ajax.cljs | clojure | (ns tech.v3.libs.cljs-ajax
"Bindings to use the dataset handlers in cljs GET/POST calls."
(:require [ajax.core :as ajax]
[ajax.interceptors :as ajax-interceptors]
[ajax.transit :as ajax-transit]
[tech.v3.dataset :as ds]
[tech.v3.datatype.datetime :as dtype-dt]
... | |
e5a3679bffcadb57cee213e81aee2ceaae9ca64d98326630ff61facaf507b1da | dyzsr/ocaml-selectml | disable_warnings_classes.ml | (* TEST
flags = " -w +A "
* expect
*)
class c = object
val a =
let b = 5 in ()
[@@warning "-26"]
val x =
let y = 5 in ()
end;;
[%%expect {|
Line 8, characters 8-9:
8 | let y = 5 in ()
^
Warning 26 [unused-var]: unused variable y.
class c : object val a : unit val x : unit end
|}]... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/testsuite/tests/typing-warnings/disable_warnings_classes.ml | ocaml | TEST
flags = " -w +A "
* expect
|
class c = object
val a =
let b = 5 in ()
[@@warning "-26"]
val x =
let y = 5 in ()
end;;
[%%expect {|
Line 8, characters 8-9:
8 | let y = 5 in ()
^
Warning 26 [unused-var]: unused variable y.
class c : object val a : unit val x : unit end
|}];;
class c = object
method a =
let b... |
1631d2a6c02e8fd1528e47a6e00b0ca8128a670694c2927017783bfc7970eb15 | jimpil/fudje | sweet.clj | (ns fudje.sweet
(:require [fudje.checkers :as checkers]
[fudje.core :refer [mocking]]))
(defonce anything
(fudje.checkers/->AnythingChecker))
(defonce irrelevant anything) ;; just a synonym
(defonce truthy
(checkers/->TruthyChecker))
(defonce falsey
(checkers/->FalseyChecker))
(defmacro contain... | null | https://raw.githubusercontent.com/jimpil/fudje/dfe042303887b2d33bd0b30f5ec6cbec1a18dbc2/src/clojure/fudje/sweet.clj | clojure | just a synonym
this is the common case
<xxx> will either be a Class or an Exception object
MAKE SURE THERE IS NO EXPRESSION SHADOWING THE MOCKS:
we want to avoid a situation where the `provided` clauses are not visible when splitting the entire `fact` into assertions & mocks.
(fact ""
(provided
Instead of bypas... | (ns fudje.sweet
(:require [fudje.checkers :as checkers]
[fudje.core :refer [mocking]]))
(defonce anything
(fudje.checkers/->AnythingChecker))
(defonce truthy
(checkers/->TruthyChecker))
(defonce falsey
(checkers/->FalseyChecker))
(defmacro contains
"A macro to help us simulate the `contains` ... |
f93ac15ce7b489261a90a21028a6e29dfcbb12f57f567ac987e26ecf3700b99d | apg/cfdg | spiral.rkt | #lang s-exp cfdg/language
(set background "DimGray")
(set width 1000)
(set height 1000)
(set size 50)
(set luminance 80)
(set rotation 0)
(set saturation 90)
(set nesting 100)
(set alpha 0)
(rule brick
(square)
(if (> .2 (random))
(brick 'r -13 'a 0.3 'x 1.7 's 0.95 'b .2)
(brick 'r -2... | null | https://raw.githubusercontent.com/apg/cfdg/95cb006c6ea43cc09c47d68fe9c7dc4597a3ed3e/cfdg/examples/spiral.rkt | racket | #lang s-exp cfdg/language
(set background "DimGray")
(set width 1000)
(set height 1000)
(set size 50)
(set luminance 80)
(set rotation 0)
(set saturation 90)
(set nesting 100)
(set alpha 0)
(rule brick
(square)
(if (> .2 (random))
(brick 'r -13 'a 0.3 'x 1.7 's 0.95 'b .2)
(brick 'r -2... | |
269b9f964634b3990bed215778c7bc50ccb504b39cf40854858ab0382f2394ef | jrheard/voke | movement.cljs | (ns voke.system.movement
(:require [cljs.spec :as s]
[voke.system.collision.system :refer [attempt-to-move!]]))
; A dumb-as-rocks velocity/acceleration system.
; Based on -2d-vector-physics-acceleration-orientation-and-friction/ .
;
; If I were a better man, I would have implemented /
; or -algebra-for-g... | null | https://raw.githubusercontent.com/jrheard/voke/15b272955d214ce0c531fb2b8d645feb217255c2/src/voke/system/movement.cljs | clojure | A dumb-as-rocks velocity/acceleration system.
Based on -2d-vector-physics-acceleration-orientation-and-friction/ .
If I were a better man, I would have implemented /
or -algebra-for-game-developers-part-2/
This system was easy to implement and I don't need all the bells/whistles in the linear-algebra-based
arti... | (ns voke.system.movement
(:require [cljs.spec :as s]
[voke.system.collision.system :refer [attempt-to-move!]]))
May have made collision resolution a bit more fiddly / less elegant than it could have been , though .
(def friction-value 0.80)
(def min-velocity 0.05)
(defn should-update-velocity?
"Ent... |
a01875a61b7516f1c8e78bc6eb730f911ebede13a7b85a893838533f150dc16c | emina/rosette | fragment.rkt | #lang racket
(require "program.rkt" rosette/query/eval)
(provide fragment fragment->syntax)
Given a BV program and a solution , returns
; a sorted fragment of all instructions on which the final (output)
; instruction is data dependent according to the given solution.
; The output takes the form of a list in which... | null | https://raw.githubusercontent.com/emina/rosette/a64e2bccfe5876c5daaf4a17c5a28a49e2fbd501/sdsl/bv/lang/fragment.rkt | racket | a sorted fragment of all instructions on which the final (output)
instruction is data dependent according to the given solution.
The output takes the form of a list in which the ith element is
the instruction with output location i iff the output depends on
Given a solution, a library of instructions, and list o... | #lang racket
(require "program.rkt" rosette/query/eval)
(provide fragment fragment->syntax)
Given a BV program and a solution , returns
the value produced that instruction . Otherwise , the ith element is # f.
(define (fragment prog sol)
(let* ([lib (prog-insts prog)]
[locs (sort (for/list ([inst lib]... |
544188bc5c9141231f3128cfef1b6aa867b6de343abb622f4dc66c9335ab6675 | clojure-interop/aws-api | core.clj | (ns com.amazonaws.services.marketplacemetering.core
(:refer-clojure :only [require comment defn ->])
(:import ))
(require '[com.amazonaws.services.marketplacemetering.AWSMarketplaceMetering])
(require '[com.amazonaws.services.marketplacemetering.AWSMarketplaceMeteringAsync])
(require '[com.amazonaws.services.marke... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.marketplacemetering/src/com/amazonaws/services/marketplacemetering/core.clj | clojure | (ns com.amazonaws.services.marketplacemetering.core
(:refer-clojure :only [require comment defn ->])
(:import ))
(require '[com.amazonaws.services.marketplacemetering.AWSMarketplaceMetering])
(require '[com.amazonaws.services.marketplacemetering.AWSMarketplaceMeteringAsync])
(require '[com.amazonaws.services.marke... | |
309f8e2c67312273ffaead8db68e97cd642cb8fa672f948b9a41f4351076f45a | spurious/sagittarius-scheme-mirror | args-fold.scm | #!core
(library (srfi :37 args-fold)
(export args-fold
;; issue, option is already defined, so import can not
;; figure out which one should take.
;;(rename (make-option option))
option
option?
option-names
option-required-arg?
option-optional-arg?
option-processor)
(import (rnrs))
(... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/sitelib/srfi/%253a37/args-fold.scm | scheme | issue, option is already defined, so import can not
figure out which one should take.
(rename (make-option option))
ISSUE: This is a brute force search. Could use a table.
NOTE: This string matching code would be simpler
using a regular expression matcher.
End option scanning:
(rx bos
"--"
"="
Found long... | #!core
(library (srfi :37 args-fold)
(export args-fold
option
option?
option-names
option-required-arg?
option-optional-arg?
option-processor)
(import (rnrs))
(define-record-type (option: option option?)
(fields
(immutable names option-names)
(immutable required-arg? option-r... |
ff9c82494cbec65e988843df1b6e7853b2a4c0e3eacb3684351afb2eb2cee416 | maralorn/kassandra | Config.hs | module Backend.Config (
readConfig,
BackendConfig (..),
) where
import Dhall (FromDhall)
import Kassandra.Config (
AccountConfig,
Dict,
)
import Kassandra.Config.Dhall (
DhallLoadConfig (
DhallLoadConfig
),
defaultConfig,
defaultFile,
envName,
loadDhallConfig,
)
import Kassandra.Standalone.Co... | null | https://raw.githubusercontent.com/maralorn/kassandra/598133b89ab4e4a6209da920636e9e6ee540f38a/apps/kassandra/backend/src/Backend/Config.hs | haskell | module Backend.Config (
readConfig,
BackendConfig (..),
) where
import Dhall (FromDhall)
import Kassandra.Config (
AccountConfig,
Dict,
)
import Kassandra.Config.Dhall (
DhallLoadConfig (
DhallLoadConfig
),
defaultConfig,
defaultFile,
envName,
loadDhallConfig,
)
import Kassandra.Standalone.Co... | |
b4eac20ac12cf02c72239d450fc10ffd70e9221682585e6b225cfa1de2886f09 | Vortecsmaster/EmurgoAcademyPlutusExamples | NFTsV2.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE OverloadedStrings #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE RecordW... | null | https://raw.githubusercontent.com/Vortecsmaster/EmurgoAcademyPlutusExamples/7a360ac043e9ceb6146cf73cbd2a546af492c984/V1/NativeTokens/src/NFTsV2.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE RankNTypes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeOperators #
Related to minting policy validator cod... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module NFTsV2
( printRedeemer,
serialisedScript,
scriptSBS,
script,
writeSerialisedSc... |
e4ea314d9f7631ec8eadc2ae939dfe1acb337f0ca4a53e940da0f978155e0922 | generateme/inferme | pencil_factory.clj | (ns anglican.pencil-factory
(:require [fastmath.core :as m]
[fastmath.random :as r]
[fastmath.stats :as stats]
[inferme.core :refer :all]
[inferme.plot :as plot]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/use-primitive-operators)
(def... | null | https://raw.githubusercontent.com/generateme/inferme/3cee4695bdf2c9c4d79d5257184f5db5e4774bdf/notebooks/anglican/pencil_factory.clj | clojure | (ns anglican.pencil-factory
(:require [fastmath.core :as m]
[fastmath.random :as r]
[fastmath.stats :as stats]
[inferme.core :refer :all]
[inferme.plot :as plot]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/use-primitive-operators)
(def... | |
8b86c1a5632fa29f6010b1593db2be9da168c29cc1a14c5ea8980fc7c4d3b043 | geophf/1HaskellADay | Solution.hs | {-# LANGUAGE QuasiQuotes, OverloadedStrings #-}
module Y2018.M01.D02.Solution where
-
OOH ! HAPPY NEW YEAR , ALL YE HASKELLERS !
Yesterday we scanned our archive of articles and resolved our DatedArticle
type so that we could , finally , upload all 100 articles to the database .
And even before that , we ha... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2018/M01/D02/Solution.hs | haskell | # LANGUAGE QuasiQuotes, OverloadedStrings #
}
for Subject storage and retrieval
for Block
for inserting staged articles
}
the keywords are already parsed from the articles, so we simply repurpose
art2Subj as (map kw2subj . keywords) and rock and roll
--------------------------------------------------------------- ... |
module Y2018.M01.D02.Solution where
-
OOH ! HAPPY NEW YEAR , ALL YE HASKELLERS !
Yesterday we scanned our archive of articles and resolved our DatedArticle
type so that we could , finally , upload all 100 articles to the database .
And even before that , we handled optionality ( that we did n't know we had ... |
7cc68cf65b220e6d07ccc68b8ea6a10d852552cc9e461b9781ec84a8501c9404 | spechub/Hets | SortItem.hs | |
Module : ./CASL / SortItem.hs
Description : parser for SORT - ITEMs
Copyright : ( c ) , Uni Bremen 2002 - 2004
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : provisional
Portability : portable
for SORT - ITEMs ( sort and subsort declaratio... | null | https://raw.githubusercontent.com/spechub/Hets/af7b628a75aab0d510b8ae7f067a5c9bc48d0f9e/CASL/SortItem.hs | haskell | * sortItem
* typeItem | |
Module : ./CASL / SortItem.hs
Description : parser for SORT - ITEMs
Copyright : ( c ) , Uni Bremen 2002 - 2004
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : provisional
Portability : portable
for SORT - ITEMs ( sort and subsort declaratio... |
04ad0e420b5109702c634d6ac1183bfa84c96a65580d93771c88fb680189f51b | m4b/rdr | MachLoadCommandTypes.ml | (* ==================================== *)
Load Commands from mach - o /
(* ==================================== *)
type load_command = {
cmd: int [@size 4];
cmdsize: int [@size 4];
}
let sizeof_load_command = 8
(* NOTE: str is _not_ apart of the lc_str struct, but added for convenience *)
type lc_str = {
... | null | https://raw.githubusercontent.com/m4b/rdr/2bf1f73fc317cd74f8c7cacd542889df729bd003/lib/mach/MachLoadCommandTypes.ml | ocaml | ====================================
====================================
NOTE: str is _not_ apart of the lc_str struct, but added for convenience
for 64-bit architectures
name of this section
segment this section goes in
memory address of this section
size in bytes of this section
file offset of this ... | Load Commands from mach - o /
type load_command = {
cmd: int [@size 4];
cmdsize: int [@size 4];
}
let sizeof_load_command = 8
type lc_str = {
offset: int [@size 4];
str: string [@computed];
}
let sizeof_lc_str = 4
struct section_64 { ( * for 64 - bit architectures
section alignment ( power of 2 )... |
0fe88c6b602bee982e44382db3312e11812625ef9ae110a4aa77277886b298f9 | wangsix/VMO_repeated_themes_discovery | converter.lisp |
;(in-package :common-lisp-user)
(load
(concatenate
'string
*lisp-code-root* "/File conversion"
"/csv-files.lisp"))
(load
(concatenate
'string
*lisp-code-root* "/File conversion"
"/humdrum-by-col.lisp"))
(load
(concatenate
'string
*lisp-code-root* "/File conversion"
"/midi-save.lisp"))
(setq
*pa... | null | https://raw.githubusercontent.com/wangsix/VMO_repeated_themes_discovery/0082b3c55e64ed447c8b68bcb705fd6da8e3541f/JKUPDD-Aug2013/groundTruth/beethovenOp2No1Mvt3/polyphonic/script/converter.lisp | lisp | (in-package :common-lisp-user) |
(load
(concatenate
'string
*lisp-code-root* "/File conversion"
"/csv-files.lisp"))
(load
(concatenate
'string
*lisp-code-root* "/File conversion"
"/humdrum-by-col.lisp"))
(load
(concatenate
'string
*lisp-code-root* "/File conversion"
"/midi-save.lisp"))
(setq
*path&name*
(concatenate
'string... |
ae8e06a7486b26b10aebd7d4fd477588ca2c1c470c48954f8d83e528ee06b37c | aryx/ocamltarzan | path.mli | File : path.mli
Copyright ( C ) 2005-
Jane Street Holding , LLC
Author :
email : mmottl\@janestcapital.com
WWW :
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 ... | null | https://raw.githubusercontent.com/aryx/ocamltarzan/4140f5102cee83a2ca7be996ca2d92e9cb035f9c/lib-sexp/path.mli | ocaml | * Path: Module for Substitutions within S-expressions
* {6 Types}
* Type of substitution elements
* [Pos n] denotes [n]th element in a tuple
* [Match (tag, n)] denotes [n]th argument of sum matching [tag]
* [Rec name] denotes the record field having [name]
* Type of substitution paths
* [replace ?path ?str sexp ... | File : path.mli
Copyright ( C ) 2005-
Jane Street Holding , LLC
Author :
email : mmottl\@janestcapital.com
WWW :
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 ... |
3c7416772af98b31266386429bd5d4edc30a01c939b2daed70031c07a948927a | johnridesabike/acutis | data.ml | (**************************************************************************)
(* *)
Copyright ( c ) 2022 .
(* *)
This Source Code For... | null | https://raw.githubusercontent.com/johnridesabike/acutis/aafe2b8479c25a16e382621654430f87a2aa8cd7/lib/data-js/data.ml | ocaml | ************************************************************************
****************************... | Copyright ( c ) 2022 .
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 /.
open Acutis
open Js_of_ocaml
module Ty = Typescheme
mo... |
5b5e665ddcfc2d4b38b15b674cb71bd7d4292552c821b14a3097f03fcac021bb | clojure-liberator/liberator | core.clj | (ns liberator.core
(:require [liberator.conneg :as conneg]
[liberator.representation :refer
[Representation as-response ring-response]]
[liberator.util :refer
[as-date http-date parse-http-date
combine make-function is-protocol-exception?]]
[... | null | https://raw.githubusercontent.com/clojure-liberator/liberator/4de95d28b259f12f130bdccfae5d3ad7f8447cd9/src/liberator/core.clj | clojure | Status
Last modified
Finally the result of the handler. We allow the handler to
override the status and headers.
Provide :see-other which returns a location or override :handle-see-other
nil body because the body is reserved to reveal the actual representations available.
"If no Accept header field is present, ... | (ns liberator.core
(:require [liberator.conneg :as conneg]
[liberator.representation :refer
[Representation as-response ring-response]]
[liberator.util :refer
[as-date http-date parse-http-date
combine make-function is-protocol-exception?]]
[... |
4ab88c8b82e3d3c4d1f3ff7a7c47b4105f47a9b45796e81b1f6b459dbb8f31c5 | rvantonder/CryptOSS | footer.ml | open Tyxml.Html
module B = Bootstrap
let copyright =
div ~a:[ a_class ["footer-copyright"] ] [
div ~a:[ a_class ["container-fluid"] ] [
pcdata "Copyright 2019 CryptoOSS"
]
]
let row_navigation =
B.row [
div ~a:[a_class [ "col-4"; ] ] []
; div ~a:[ a_class [ "col-2"; ] ] [
p [
... | null | https://raw.githubusercontent.com/rvantonder/CryptOSS/acd931433f70fd097930b2e62a294af6d31a2a77/site/footer.ml | ocaml | open Tyxml.Html
module B = Bootstrap
let copyright =
div ~a:[ a_class ["footer-copyright"] ] [
div ~a:[ a_class ["container-fluid"] ] [
pcdata "Copyright 2019 CryptoOSS"
]
]
let row_navigation =
B.row [
div ~a:[a_class [ "col-4"; ] ] []
; div ~a:[ a_class [ "col-2"; ] ] [
p [
... | |
b989617fc4d2999e5f15a3f54bed46f6a0585b1bbff8ccabe931722fd413419f | chris-taylor/aima-haskell | Restaurant.hs | module AI.Learning.Example.Restaurant where
import Control.Monad
import Control.Monad.Random
import qualified Graphics.Gnuplot.Simple as G
import System.IO.Unsafe
import AI.Learning.Core
import AI.Learning.DecisionTree
import qualified AI.Learning.RandomForest as RF
import AI.Util.Util
data Patrons = Empty | Some | ... | null | https://raw.githubusercontent.com/chris-taylor/aima-haskell/538dcfe82a57a623e45174e911ce68974d8aa839/src/AI/Learning/Example/Restaurant.hs | haskell | is there an alternative?
is there a bar?
are you hungry?
how many patrons are there?
how cheap is it?
is it raining?
do you have a reservation?
what type of food is it?
what is the wait?
will you wait?
------------------
Model builders --
------------------
-------------------------------------
Demo of the ... | module AI.Learning.Example.Restaurant where
import Control.Monad
import Control.Monad.Random
import qualified Graphics.Gnuplot.Simple as G
import System.IO.Unsafe
import AI.Learning.Core
import AI.Learning.DecisionTree
import qualified AI.Learning.RandomForest as RF
import AI.Util.Util
data Patrons = Empty | Some | ... |
8a956f7ffc50fe477c6c947b268dc356904fabc21ef5aa707d79ed233d00fe29 | hyperfiddle/electric | trace19.cljc | (ns dustin.trace19
(:require [missionary.core :as m]
[minitest :refer [tests]]
[dustin.trace17 :as trace]
[leo.extend-seq :refer [extend-seq]]))
;We could assume that extend-seq works, continue with tracing it, and
;then come back to the UI. This is because the submission fiddle ... | null | https://raw.githubusercontent.com/hyperfiddle/electric/1c6c3891cbf13123fef8d33e6555d300f0dac134/scratch/dustin/y2021/trace/trace19.cljc | clojure | We could assume that extend-seq works, continue with tracing it, and
then come back to the UI. This is because the submission fiddle UI is adding too much
complexity. Even if we're wrong with extend-seq's implementation (diffing) we will
still learn a lot by continuing with it. Lets do this
We could work on:
- [X] id... | (ns dustin.trace19
(:require [missionary.core :as m]
[minitest :refer [tests]]
[dustin.trace17 :as trace]
[leo.extend-seq :refer [extend-seq]]))
(defn init [inputs _!replayers tracef]
(let [>control (m/signal! (m/watch (get inputs '>control)))
>p (m/signal! (m/wa... |
9e6d7a5ae569767c4092e2f4ff76aefda9c76af79b7fcd507f56f42180ca8947 | mwand/eopl3 | tests.scm | (module tests mzscheme
(provide test-list)
;;;;;;;;;;;;;;;; tests ;;;;;;;;;;;;;;;;
(define test-list
'(
;; simple arithmetic
(positive-const "11" 11)
(negative-const "-33" -33)
(simple-arith-1 "-(44,33)" 11)
;; nested arithmetic
(nested-arith-left "-(-(44,33),22... | null | https://raw.githubusercontent.com/mwand/eopl3/b50e015be7f021d94c1af5f0e3a05d40dd2b0cbf/chapter4/call-by-reference/tests.scm | scheme | tests ;;;;;;;;;;;;;;;;
simple arithmetic
nested arithmetic
simple variables
simple unbound variables
simple conditionals
test dynamic typechecking
make sure that the test and both arms get evaluated
properly.
and make sure the other arm doesn't get evaluated.
simple let
check nested let and shadowing
simp... | (module tests mzscheme
(provide test-list)
(define test-list
'(
(positive-const "11" 11)
(negative-const "-33" -33)
(simple-arith-1 "-(44,33)" 11)
(nested-arith-left "-(-(44,33),22)" -11)
(nested-arith-right "-(55, -(22,11))" 44)
(test-var-1 "x" 10)
(test... |
f75aded15f9f57196800589263809e6b94dfc7040e1cbb9b414f68e1b8a11594 | penpot/penpot | pages.cljs | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
;;
;; Copyright (c) KALEIDOS INC
(ns frontend-tests.helpers.pages
(:require
[app.common.geom.point :as gpt]
[app.common.geom.shapes :as... | null | https://raw.githubusercontent.com/penpot/penpot/62aa6569f258829d36bbdf7d43819fe876f6b8b2/frontend/test/frontend_tests/helpers/pages.cljs | clojure |
Copyright (c) KALEIDOS INC
---- Helpers to manage pages and objects | 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 /.
(ns frontend-tests.helpers.pages
(:require
[app.common.geom.point :as gpt]
[app.common.geom.shapes :as gsh]
[app.common.pages :as cp... |
4b905056d14ce413537fe1a67b2b45066bd75500f13e2a642c5e0fd92574617f | dongcarl/guix | rdf.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013 , 2014 , 2015 < >
Copyright © 2015 , 2016 , 2018 < >
Copyright © 2018–2021 < >
Copyright © 2019 < >
Copyright © 2020 < >
Copyright © 2020 Pjotr Prins < >
Copyright © 2020 < >
Copyright © 2020 >
;;;
;;; This f... | null | https://raw.githubusercontent.com/dongcarl/guix/82543e9649da2da9a5285ede4ec4f718fd740fcb/gnu/packages/rdf.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2013 , 2014 , 2015 < >
Copyright © 2015 , 2016 , 2018 < >
Copyright © 2018–2021 < >
Copyright © 2019 < >
Copyright © 2020 < >
Copyright © 2020 Pjotr Prins < >
Copyright © 2020 < >
Copyright © 2020 >
under the terms of the GNU General Public License as published by
... |
166e62b2774881939d770784f3876c136ef9fc31f911f98602f67d8033ee8bce | haskell/haskell-language-server | PunShadowing.hs | data Bar = Bar { ax :: Int, bax :: Bool }
bar :: () -> Bar -> Int
bar ax x = _
| null | https://raw.githubusercontent.com/haskell/haskell-language-server/f3ad27ba1634871b2240b8cd7de9f31b91a2e502/plugins/hls-tactics-plugin/new/test/golden/PunShadowing.hs | haskell | data Bar = Bar { ax :: Int, bax :: Bool }
bar :: () -> Bar -> Int
bar ax x = _
| |
4fdc39e3e6ca9da7168f4b02402758e7ac40bc5a763f7b16c8993487f961f282 | tschady/advent-of-code | d22_test.clj | (ns aoc.2021.d22-test
(:require [aoc.2021.d22 :as sut]
[clojure.test :refer :all]))
(deftest challenges
(is (= 527915 (sut/part-1 sut/input)))
(is (= 1218645427221987 (sut/part-2 sut/input))))
| null | https://raw.githubusercontent.com/tschady/advent-of-code/4928cfac176a76292ae8c5823205dc6cb028200e/test/aoc/2021/d22_test.clj | clojure | (ns aoc.2021.d22-test
(:require [aoc.2021.d22 :as sut]
[clojure.test :refer :all]))
(deftest challenges
(is (= 527915 (sut/part-1 sut/input)))
(is (= 1218645427221987 (sut/part-2 sut/input))))
| |
c66f19516d6a9d081c8307b758c85aa2e5fd5979b53813d057b675754bc2bf07 | Technologicat/spicy | example_sexp.rkt | #lang spicy
(define (foldl f x lst)
(match lst
('() x)
((cons a l) (foldl f (f a x) l))))
(define (foldr f x lst)
(match lst
('() x)
((cons a l) (f a (foldr f x l)))))
(define reverse
(foldl cons empty))
(define (append a b)
(foldr cons b a))
(define (append* . lsts)
(... | null | https://raw.githubusercontent.com/Technologicat/spicy/f0c8b44a5719fb7fffc63d25547e0cea35f2f0de/example_sexp.rkt | racket | #lang spicy
(define (foldl f x lst)
(match lst
('() x)
((cons a l) (foldl f (f a x) l))))
(define (foldr f x lst)
(match lst
('() x)
((cons a l) (f a (foldr f x l)))))
(define reverse
(foldl cons empty))
(define (append a b)
(foldr cons b a))
(define (append* . lsts)
(... | |
39afa5aaf40914afeda9e5ef83d091219495d77933ca8078f1ad463e35d5a68e | kitten/bs-flow-parser | loc.mli | *
* 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/kitten/bs-flow-parser/00630c06016b51a7040ef4160ed2999cd208babd/src/loc.mli | ocaml | filename, line, column. produces a Loc.t at the given location
Produces a location at the start of the input location
Produces a location at the end of the input location | *
* 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... |
955a029f1fccf010a65934dd8be2af8e8c9c56304ddb0760b818936fecc85f3e | lilactown/punk | jvm.clj | (ns punk.adapter.jvm
(:require
[aleph.http :as ah]
[clojure.edn :as ce]
[compojure.core :as cc]
[compojure.route :as cr]
[frame.core :as fc]
[manifold.stream :as ms]
[manifold.deferred :as md]
[manifold.bus :as mb]
[punk.core :as pc]
[ring.middleware.params :as rmp]))
(def port
9876)
... | null | https://raw.githubusercontent.com/lilactown/punk/0c6e529429837c00958d41e09fd672f49778dedf/adapter-jvm/src/punk/adapter/jvm.clj | clojure | ":8701/main.js"
for alternative styles, see:
/ \
src/aleph/examples/websocket.clj
XXX: fill in and uncomment as desired
(pc/remove-taps!) ; XXX: called by add-taps!
XXX: not working so well yet...
| (ns punk.adapter.jvm
(:require
[aleph.http :as ah]
[clojure.edn :as ce]
[compojure.core :as cc]
[compojure.route :as cr]
[frame.core :as fc]
[manifold.stream :as ms]
[manifold.deferred :as md]
[manifold.bus :as mb]
[punk.core :as pc]
[ring.middleware.params :as rmp]))
(def port
9876)
... |
eab0d6dc4e52a0b7e769218948827cffc97f6d6cba15c608084a6d8d5672cdd5 | cl-axon/cl-aima | mdp.lisp | Definitions for Markov decision processes ( MDPs ) .
An MDP is defined by initial state , transition model , rewards , and
;;; distinguished terminal states. Model and rewards are hash tables
;;; index by state (after application of hash-key function).
;;; The entries in the model are alists keyed by action; each ... | null | https://raw.githubusercontent.com/cl-axon/cl-aima/1e6915fa9f3e5f2c6fd75952d674ebec53558d04/uncertainty/domains/mdp.lisp | lisp | distinguished terminal states. Model and rewards are hash tables
index by state (after application of hash-key function).
The entries in the model are alists keyed by action; each action is
associated with an action model: basically a list of transitions.
The initial state for the problem
Describes transition pro... | Definitions for Markov decision processes ( MDPs ) .
An MDP is defined by initial state , transition model , rewards , and
Markov chains ( i.e. , stochastic processes with no distinct agent )
can be defined by allowing only a no - op action in the MDP .
(defstruct mdp
(defstruct (mdp-action-model (:type list... |
a15ba949f27d37f3ceda1983a1713ea3522dd5e5d7cebfff46b74725ff53b4dc | ChildsplayOSU/bogl | Syntax.hs | # LANGUAGE DeriveGeneric #
|
Module : Language . Syntax
Description : BoGL Syntax
Copyright : ( c )
License : BSD-3
BoGL language AST . This slightly deviates from the specified syntax in spots .
Module : Language.Syntax
Description : BoGL Syntax
Copyright : (c)
License : BSD-3
... | null | https://raw.githubusercontent.com/ChildsplayOSU/bogl/8c649689bf26543be1a7ec72787b9c013ecb754f/src/Language/Syntax.hs | haskell | | Names of games, signatures, etc.
| An unparsed expression
| A type definition or synonym
| Game datatype
^ The name of the game
^ Size and type of the board
^ Type of input
^ List of value definitions
^ Type definitions and type synonyms
| Signatures are a product of name and type.
| Parameters are lists o... | # LANGUAGE DeriveGeneric #
|
Module : Language . Syntax
Description : BoGL Syntax
Copyright : ( c )
License : BSD-3
BoGL language AST . This slightly deviates from the specified syntax in spots .
Module : Language.Syntax
Description : BoGL Syntax
Copyright : (c)
License : BSD-3
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.