_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 |
|---|---|---|---|---|---|---|---|---|
4eeeb3b29678d87ea0b9205e09caf51c5b26fb9f1610b5498e40449f26e55c12 | tdammers/ginger | PropertyTests.hs | {-#LANGUAGE OverloadedStrings #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
module Text.Ginger.PropertyTests
where
import Test.Tasty
import Test.Tasty.QuickCheck
import Data.Text (Text)
import qualified Data.Text as Text
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
impo... | null | https://raw.githubusercontent.com/tdammers/ginger/bd8cb39c1853d4fb4f663c4c201884575906acea/test/Text/Ginger/PropertyTests.hs | haskell | #LANGUAGE OverloadedStrings #
, InterpolationS <$> arbitrary
, ForS <$> arbitrary <*> arbitrary <*> arbitrary <*> arbitrary
, SetVarS <$> arbitrary <*> arbitrary
, DefMacroS <$> arbitrary <*> arbitrary
, BlockRefS <$> arbitrary
of datetimes across time zones is unsolvable; we can, however, use
a "strict" equalit... | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
module Text.Ginger.PropertyTests
where
import Test.Tasty
import Test.Tasty.QuickCheck
import Data.Text (Text)
import qualified Data.Text as Text
import Data.ByteString (ByteString)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy ... |
549af996f69b5a12e87aad07128dde30f06c730e25d5534f55b95eff43829d11 | practicalli/banking-on-clojure-webapp | request_handler.clj | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Request handlers
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(ns practicalli.request-handler
(:require
Web Application
[ring.util.response :refer [response]]
[hiccup.core :refer [html]]
[hiccup.page :refer [html5 include-js include-css]]
[hiccup.element :ref... | null | https://raw.githubusercontent.com/practicalli/banking-on-clojure-webapp/e903e0a72f664ae8959dc5dc05fc5149cd18f422/src/practicalli/request_handler.clj | clojure |
Request handlers
Data access
Markup Generators
HTML Pages
Test handler function with empty request
=> "<!DOCTYPE html>\n<html lang=\"en\"><head><script src=\"myscript.js\" type=\"text/javascript\"></script><link href=\"mystyle.css\" rel=\"stylesheet\" type=\"text/css\"></head><body><div><h1 class=\"info\">Hic... |
(ns practicalli.request-handler
(:require
Web Application
[ring.util.response :refer [response]]
[hiccup.core :refer [html]]
[hiccup.page :refer [html5 include-js include-css]]
[hiccup.element :refer [link-to]]
[practicalli.hanlder-helpers :as helper]))
(defn bank-account-media-object
[account... |
ff24011bc914c253fbefe542ccbe40dc69a9131fcbd100abc916854709ac65ba | clojure-interop/aws-api | project.clj | (defproject clojure-interop/com.amazonaws.services.cloudsearchv2 "1.0.0"
:description "Clojure to Java Interop Bindings for com.amazonaws.services.cloudsearchv2"
:url "-interop/aws-api"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]]
:source... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.cloudsearchv2/project.clj | clojure | (defproject clojure-interop/com.amazonaws.services.cloudsearchv2 "1.0.0"
:description "Clojure to Java Interop Bindings for com.amazonaws.services.cloudsearchv2"
:url "-interop/aws-api"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]]
:source... | |
49dc98cbe923ce13b0d32181bd73cb8b2c47294a5abc229834c7c8b74aa582fd | msakai/data-interval | IntervalRelation.hs | # OPTIONS_GHC -Wall #
# LANGUAGE CPP , DeriveDataTypeable , DeriveGeneric #
{-# LANGUAGE Safe #-}
-----------------------------------------------------------------------------
-- |
-- Module : Data.IntervalRelation
Copyright : ( c ) 2016
-- License : BSD-style
--
-- Maintainer :
-- Stability : ... | null | https://raw.githubusercontent.com/msakai/data-interval/c37e7994be95623be5f05741f2a50e98fa0788e2/src/Data/IntervalRelation.hs | haskell | # LANGUAGE Safe #
---------------------------------------------------------------------------
|
Module : Data.IntervalRelation
License : BSD-style
Maintainer :
Stability : provisional
Interval relations and their algebra.
------------------------------------------------------------------------... | # OPTIONS_GHC -Wall #
# LANGUAGE CPP , DeriveDataTypeable , DeriveGeneric #
Copyright : ( c ) 2016
Portability : non - portable ( CPP , DeriveDataTypeable , DeriveGeneric )
module Data.IntervalRelation
( Relation(..)
, invert
)
where
import Data.Data
import GHC.Generics (Generic)
| Describes ho... |
1bc249b1a653aec128fdf30ed88d0fb942f6f698bbc05d18abe41eb0b4f5c27c | racket/frtime | lang-ext.rkt | #lang racket/base
(provide raise-exceptions
deep-value-now
nothing
nothing?
;general-event-processor
;general-event-processor2
emit
select
switch
merge-e
once-e
changes
never-e
when-e
while-e
... | null | https://raw.githubusercontent.com/racket/frtime/9b9db67581107f4d7b995541c70f2d08f03ae89e/lang-ext.rkt | racket | general-event-processor
general-event-processor2
from core/frp
(string->uninterned-symbol "nothing"))
won't work in the presence of super structs or immutable fields
(define deep-value-now
maybe fix later to handle undefined-strictness
switch : event[behavior] behavior -> behavior
event ... -> event
behavior[a] -... | #lang racket/base
(provide raise-exceptions
deep-value-now
nothing
nothing?
emit
select
switch
merge-e
once-e
changes
never-e
when-e
while-e
==>
-=>
=#>
=#=>
map-e
... |
65e95a42ac349d10e3f33a46cd7babd6932423117d37ff3144f1cc033c222638 | anurudhp/CPHaskell | d.hs | -- AC
{-# LANGUAGE Safe #-}
import Control.Arrow ((>>>))
import qualified Data.ByteString.Lazy.Char8 as C
import safe Data.Graph (flattenSCC, stronglyConnComp)
import safe Data.Maybe (catMaybes, fromJust)
main :: IO ()
main =
C.interact $
C.lines >>>
drop 1 >>>
map (C.words >>> map readInt) >>>
process >>>... | null | https://raw.githubusercontent.com/anurudhp/CPHaskell/01ae8dde6aab4f6ddfebd122ded0b42779dd16f1/contests/codeforces/1327/d.hs | haskell | AC
# LANGUAGE Safe # |
import Control.Arrow ((>>>))
import qualified Data.ByteString.Lazy.Char8 as C
import safe Data.Graph (flattenSCC, stronglyConnComp)
import safe Data.Maybe (catMaybes, fromJust)
main :: IO ()
main =
C.interact $
C.lines >>>
drop 1 >>>
map (C.words >>> map readInt) >>>
process >>> map (show >>> C.pack) >>> C.... |
17aab285b1d49646bdaaa130e72aa395cc80e82d518b20559736e86984e489bd | tonyg/racket-nat-traversal | info.rkt | #lang setup/infotab
(define name "nat-traversal")
(define blurb
(list
`(p "Implementation of NAT traversal utilities for opening ports on home routers.")))
(define categories '(net))
(define can-be-loaded-with 'all)
(define homepage "-nat-traversal")
(define primary-file "main.rkt")
(define repositories '("4.x"))
... | null | https://raw.githubusercontent.com/tonyg/racket-nat-traversal/091d3ce0990b05508d1b0e0ff9997774a48161d2/info.rkt | racket | #lang setup/infotab
(define name "nat-traversal")
(define blurb
(list
`(p "Implementation of NAT traversal utilities for opening ports on home routers.")))
(define categories '(net))
(define can-be-loaded-with 'all)
(define homepage "-nat-traversal")
(define primary-file "main.rkt")
(define repositories '("4.x"))
... | |
a6ae9d99d985c3d8739a3ae7f78731549ac70757c6fd202aab43196a1527ee9d | raaz-crypto/raaz | Blake2bSpec.hs | # LANGUAGE ForeignFunctionInterface #
module Monocypher.Blake2bSpec where
import Data.ByteString.Internal (unsafeCreate)
import Data.ByteString.Unsafe (unsafeUseAsCStringLen)
import qualified Foreign.Storable as Storable
import Foreign.Ptr
import Foreign.C.Types
import ... | null | https://raw.githubusercontent.com/raaz-crypto/raaz/91799e1ae528e909ad921f6c0d6f51ebd8c7328f/monocypher/tests/Monocypher/Blake2bSpec.hs | haskell | hash
message | # LANGUAGE ForeignFunctionInterface #
module Monocypher.Blake2bSpec where
import Data.ByteString.Internal (unsafeCreate)
import Data.ByteString.Unsafe (unsafeUseAsCStringLen)
import qualified Foreign.Storable as Storable
import Foreign.Ptr
import Foreign.C.Types
import ... |
5bb05e4f82ef789c62372cdde86e3a91f51ae14fd414759bb84e738f78dc2b2c | nikita-volkov/rebase | Strict.hs | module Rebase.Data.HashMap.Strict
(
module Data.HashMap.Strict
)
where
import Data.HashMap.Strict
| null | https://raw.githubusercontent.com/nikita-volkov/rebase/7c77a0443e80bdffd4488a4239628177cac0761b/library/Rebase/Data/HashMap/Strict.hs | haskell | module Rebase.Data.HashMap.Strict
(
module Data.HashMap.Strict
)
where
import Data.HashMap.Strict
| |
d5fd48377fe1dcf198051b4f0ea873e7e0e946d158f6bf0b9a4315356c6ee414 | kmarekspartz/TaPL | Parser.hs | module Language.TaPL.Boolean.Parser (parseString, parseFile) where
import qualified Text.Parsec.Token as Token
import Text.Parsec.Language (emptyDef)
import Text.Parsec.Prim (parse)
import Text.Parsec.String (Parser)
import Control.Applicative ((<|>))
import Language.TaPL.Boolean.Syntax (Term(..))
-- This module is... | null | https://raw.githubusercontent.com/kmarekspartz/TaPL/2f1aebf5ed370f769709852ee27020f5cb715123/src/Language/TaPL/Boolean/Parser.hs | haskell | This module is adapted from:
parses a reserved name
parses surrounding parenthesis:
parens p
takes care of the parenthesis and
parses whitespace | module Language.TaPL.Boolean.Parser (parseString, parseFile) where
import qualified Text.Parsec.Token as Token
import Text.Parsec.Language (emptyDef)
import Text.Parsec.Prim (parse)
import Text.Parsec.String (Parser)
import Control.Applicative ((<|>))
import Language.TaPL.Boolean.Syntax (Term(..))
booleanDef =
e... |
15ca460d096718572b79f63db9bfa8e7d4941fada533d78904e261bcfcfb50be | noinia/hgeometry | RangeTree.hs | # LANGUAGE UndecidableInstances #
# LANGUAGE UndecidableSuperClasses #
--------------------------------------------------------------------------------
-- |
-- Module : Geometry.RangeTree
Copyright : ( C )
-- License : see the LICENSE file
Maintainer :
---------------------------------------... | null | https://raw.githubusercontent.com/noinia/hgeometry/f8cdbc02c6878d4883ce95ed229d9cb09ffe296f/hgeometry/src/Geometry/RangeTree.hs | haskell | ------------------------------------------------------------------------------
|
Module : Geometry.RangeTree
License : see the LICENSE file
------------------------------------------------------------------------------
------------------------------------------------------------------------------
--------... | # LANGUAGE UndecidableInstances #
# LANGUAGE UndecidableSuperClasses #
Copyright : ( C )
Maintainer :
module Geometry.RangeTree where
import Control.Lens hiding (element)
import Data.Ext
import qualified Data.Foldable as F
import Geometry.Point
import qualified Geometry.R... |
8a3fea9f180ac19e503f33d98f9e15d3eb166da412440c39c4dd4e940b69d634 | kuberlog/daemon-clj | emotion_animation_test.clj | (ns dameon.face.emotion-animation-test.clj
(use clojure.test)
(require [dameon.face.emotion-animation :as subject]
[quil.core :as q]
[quil.middleware :as m]))
(deftest generate-animation-file-paths
(is (= "happy/emotion.png" (:emotion-loop-path (subject/get-full-file-paths "happy"))));param... | null | https://raw.githubusercontent.com/kuberlog/daemon-clj/904699d005ea2df3d86426d8aa1d3b030178e683/test/daemon/face/emotion_animation_test.clj | clojure | param without trailing slash
param without trailing slash | (ns dameon.face.emotion-animation-test.clj
(use clojure.test)
(require [dameon.face.emotion-animation :as subject]
[quil.core :as q]
[quil.middleware :as m]))
(deftest generate-animation-file-paths
2nd file . with trailing /
)
(run-tests)
|
be9b58b7269abf63f27d36e11e71c068e360850066b99a83e4b370cf9e444396 | cronokirby/haskell-in-haskell | 0004.hs | -- OUT(24)
main = 1 * 2 * 3 * 4
| null | https://raw.githubusercontent.com/cronokirby/haskell-in-haskell/83cb8114c7a71f2fc530d1865dd22776a3779417/integration_tests/0004.hs | haskell | OUT(24) | main = 1 * 2 * 3 * 4
|
d110d9b3a4eb49d7b430fdec63310d7632643447c4a230b10f7392f7ad678bb6 | processone/tsung | ts_mon_cache.erl | %%% This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
%%% (at your option) any later version.
%%%
%%% This program is distributed in the hope that it will ... | null | https://raw.githubusercontent.com/processone/tsung/e9babe2acfb4298e3b51bd56886561b052979884/src/tsung/ts_mon_cache.erl | erlang | This program is free software; you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General P... | it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
You should have received a copy of the GNU General Public License
Foundation , Inc. , 59 Temple Place , Suite 330 , Boston , MA 02111 - 1307 , USA .
the EPL license and... |
f091d3270955580e08df4829831fec0b2c20b4711706ffdcf72fb0a31ae8516b | gvannest/piscine_OCaml | ribosome.ml | type phosphate = string
type deoxyribose = string
type nucleobase = A | T | C | G | U | None
type nucleotide = {
phosphate : phosphate ;
deoxyribose : deoxyribose ;
nucleobase : nucleobase
}
type helix = nucleotide list
let generate_nucleotide c =
{
phosphate = "phosphate" ;
deoxyribo... | null | https://raw.githubusercontent.com/gvannest/piscine_OCaml/2533c6152cfb46c637d48a6d0718f7c7262b3ba6/d02/ex07/ribosome.ml | ocaml | ----------------- ex06 -----------------
----------------- ex07 ----------------- | type phosphate = string
type deoxyribose = string
type nucleobase = A | T | C | G | U | None
type nucleotide = {
phosphate : phosphate ;
deoxyribose : deoxyribose ;
nucleobase : nucleobase
}
type helix = nucleotide list
let generate_nucleotide c =
{
phosphate = "phosphate" ;
deoxyribo... |
ada73b7380860d439d08f1866d391f850cc100191dfdc5586bc0b24982b30bd0 | reasonml/reason | migrate_parsetree_413_414_migrate.ml | open Stdlib0
module From = Ast_413
module To = Ast_414
let rec copy_out_type_extension :
Ast_413.Outcometree.out_type_extension ->
Ast_414.Outcometree.out_type_extension
=
fun
{ Ast_413.Outcometree.otyext_name = otyext_name;
Ast_413.Outcometree.otyext_params = otyext_params;
Ast_413.Outcometre... | null | https://raw.githubusercontent.com/reasonml/reason/4f6ff7616bfa699059d642a3d16d8905d83555f6/src/vendored-omp/src/migrate_parsetree_413_414_migrate.ml | ocaml | open Stdlib0
module From = Ast_413
module To = Ast_414
let rec copy_out_type_extension :
Ast_413.Outcometree.out_type_extension ->
Ast_414.Outcometree.out_type_extension
=
fun
{ Ast_413.Outcometree.otyext_name = otyext_name;
Ast_413.Outcometree.otyext_params = otyext_params;
Ast_413.Outcometre... | |
4f3d223f81721b9c0c9567d202d8f505c58b6a43669f634cddebabe4c9344fc3 | ashinkarov/heh | value.ml |
* Copyright ( c ) 2017 - 2018 , < >
*
* Permission to use , copy , modify , and/or distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS ... | null | https://raw.githubusercontent.com/ashinkarov/heh/42866803b2ffacdc42b8f06203bf4e5bd18e03b0/value.ml | ocaml | :: ptr_func * ptr_expr * [limit_ord * vector * int]
A shortcut for raising an exception. |
* Copyright ( c ) 2017 - 2018 , < >
*
* Permission to use , copy , modify , and/or distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS ... |
48f7f9423d10791145abf220e3f47142895093d92fde2a9cc15481a78c44de87 | wireapp/wire-server | Servant.hs | # LANGUAGE LambdaCase #
# OPTIONS_GHC -Wno - orphans #
-- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free... | null | https://raw.githubusercontent.com/wireapp/wire-server/33fcf30057511ebd824702333b088382e178e062/services/spar/src/Spar/Sem/SamlProtocolSettings/Servant.hs | haskell | This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTI... | # LANGUAGE LambdaCase #
# OPTIONS_GHC -Wno - orphans #
Copyright ( C ) 2022 Wire Swiss GmbH < >
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option ) any
You should have received a copy of the GNU Affero Genera... |
2b9c1b0629ce0fb0f8d8baddadfdce862bba4745d08f50097b579903abe98a36 | metaocaml/ber-metaocaml | D.ml | let z x = imp (x*2)
| null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/tool-ocamldep-modalias/D.ml | ocaml | let z x = imp (x*2)
| |
c36607d237f0697c3ce9d065e13b3d1d2dbb1bb304cfff7244bf8011cd9371ad | klutometis/clrs | payoff.scm | (define (maximize-payoff A B)
(let ((A (sort A >))
(B (sort B >)))
(fold (lambda (a b product) (* product (expt a b))) 1 A B)))
| null | https://raw.githubusercontent.com/klutometis/clrs/f85a8f0036f0946c9e64dde3259a19acc62b74a1/16.2/payoff.scm | scheme | (define (maximize-payoff A B)
(let ((A (sort A >))
(B (sort B >)))
(fold (lambda (a b product) (* product (expt a b))) 1 A B)))
| |
ecad57c10fe4429a7223d596082aaada4ac3848e385195cf492c4de1947d0956 | mokus0/junkbox | New.hs | # LANGUAGE DoRec #
module Functions.New where
import Control.Monad.Fix
import Data.IORef
type New t = t -> t
new :: New t -> t
new init = self where self = init self
ones = new (1:)
data Animal = Animal {
catchPhrase :: String,
speak :: IO ()
}
protoAnimal :: New Animal
protoAnimal self = Animal {
... | null | https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/Haskell/Functions/New.hs | haskell | # LANGUAGE DoRec #
module Functions.New where
import Control.Monad.Fix
import Data.IORef
type New t = t -> t
new :: New t -> t
new init = self where self = init self
ones = new (1:)
data Animal = Animal {
catchPhrase :: String,
speak :: IO ()
}
protoAnimal :: New Animal
protoAnimal self = Animal {
... | |
ff57f316cc249d86b0c29f968d2eda9a2359072af98d728d8b22a2079e223056 | BitGameEN/bitgamex | bg_xchgsvr_sup.erl | %%%-----------------------------------
%%% @Module : bg_xchgsvr_sup
%%% @Description: 监控树
%%%-----------------------------------
-module(bg_xchgsvr_sup).
-behaviour(supervisor).
-export([start_link/1]).
-export([init/1]).
-include("common.hrl").
start_link([Ip, ServerId]) ->
supervisor:start_link({... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/bg_xchgsvr_sup.erl | erlang | -----------------------------------
@Module : bg_xchgsvr_sup
@Description: 监控树
-----------------------------------
| -module(bg_xchgsvr_sup).
-behaviour(supervisor).
-export([start_link/1]).
-export([init/1]).
-include("common.hrl").
start_link([Ip, ServerId]) ->
supervisor:start_link({local,?MODULE}, ?MODULE, [Ip, ServerId]).
init([Ip, ServerId]) ->
Children =
[
{
bg_xch... |
bf10ec023f145615b602f7702880949642ffd2e70fae5700ba5e67ae8a8ead83 | exercism/erlang | anagram_tests.erl | Generated with ' v0.2.0 '
%% Revision 1 of the exercises generator was used
%% -specifications/raw/6373ab6c335278328259f6407f3a3adfd4afa0f5/exercises/anagram/canonical-data.json
%% This file is automatically generated from the exercises canonical data.
-module(anagram_tests).
-include_lib("erl_exercism/include/exe... | null | https://raw.githubusercontent.com/exercism/erlang/9b3d3c14ef826e7efbc4fcd024fd20ed09332562/exercises/practice/anagram/test/anagram_tests.erl | erlang | Revision 1 of the exercises generator was used
-specifications/raw/6373ab6c335278328259f6407f3a3adfd4afa0f5/exercises/anagram/canonical-data.json
This file is automatically generated from the exercises canonical data. | Generated with ' v0.2.0 '
-module(anagram_tests).
-include_lib("erl_exercism/include/exercism.hrl").
-include_lib("eunit/include/eunit.hrl").
'1_no_matches_test_'() ->
{"no matches",
?_assertMatch([],
lists:sort(anagram:find_anagrams("diaper",
["hello", "world",
"zombies", "p... |
7b5ec7e54a539a5bb751a9c8f1b33520c4e811966e0b8f4f09c00775e1c6d8fe | plumatic/grab-bag | classify_test.clj | (ns classify.classify-test
(:use clojure.test plumbing.core plumbing.test)
(:require
[flop.map :as map]
[classify.features :as features]
[classify.features-test :as features-test]
[classify.learn :as learn]
[classify.classify :as classify]))
(defn raw-data [& doc-args-and-labels]
(assert (even? (c... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/classify/test/classify/classify_test.clj | clojure | (ns classify.classify-test
(:use clojure.test plumbing.core plumbing.test)
(:require
[flop.map :as map]
[classify.features :as features]
[classify.features-test :as features-test]
[classify.learn :as learn]
[classify.classify :as classify]))
(defn raw-data [& doc-args-and-labels]
(assert (even? (c... | |
01a135cf5dcf116b281ccf3f285c74a7168efbb9783accc8c19196f0a76eb327 | startalkIM/ejabberd | jid.erl | %%%-------------------------------------------------------------------
@author < >
%%% @doc
JID processing library
%%% @end
Created : 24 Nov 2015 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
modify it under th... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/src/jid.erl | erlang | -------------------------------------------------------------------
@doc
@end
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warrant... | @author < >
JID processing library
Created : 24 Nov 2015 by < >
ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General... |
8581502cdeea5d9784c2c7cf6c6950a14ca804d6d5a97bda73dd8cbc7acd6ce3 | MyDataFlow/ttalk-server | riakc_obj.erl | %% -------------------------------------------------------------------
%%
riakc_obj : Container for data and metadata
%%
Copyright ( c ) 2007 - 2010 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this fi... | null | https://raw.githubusercontent.com/MyDataFlow/ttalk-server/07a60d5d74cd86aedd1f19c922d9d3abf2ebf28d/deps/riakc/src/riakc_obj.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissi... | riakc_obj : Container for data and metadata
Copyright ( c ) 2007 - 2010 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BA... |
e7b6cfe6d6ac08b74450cc8ec1f63154f08756ec9bb7b94a4d665840e04a51c9 | PeterDWhite/Osker | KernelCoreMessage.hs | Copyright ( C ) , 2001 , 2002 , 2003
Copyright ( c ) OHSU , 2001 , 2002 , 2003
module KernelCoreMessage
A type for messages in kernel core
Get index to call table from message
) where
----------------------------------------------------------------------
The definitions that localize the message to... | null | https://raw.githubusercontent.com/PeterDWhite/Osker/301e1185f7c08c62c2929171cc0469a159ea802f/Kernel/KernelCore/KernelCoreMessage.hs | haskell | --------------------------------------------------------------------
half instantiation of the executive.
--------------------------------------------------------------------
From self
Convert the incoming payload to the system half to a message type.
Message type
Message index | Copyright ( C ) , 2001 , 2002 , 2003
Copyright ( c ) OHSU , 2001 , 2002 , 2003
module KernelCoreMessage
A type for messages in kernel core
Get index to call table from message
) where
The definitions that localize the message to the system
Osker imports
import qualified CallTableIndex as CTI
imp... |
7a1d75ca54f0029280cfbde304beb86de4bb360cfb53bdba5895786394018841 | GaloisInc/llvm-verifier | Debugger.hs | |
Module : $ Header$
Description : Debugger implementation for LSS
License : BSD3
Stability : provisional
Point - of - contact : acfoltzer , for the LLVM Symbolic Simulator . This module provides
implementations of the ' SEH ' event handlers . Commands and their
sem... | null | https://raw.githubusercontent.com/GaloisInc/llvm-verifier/d97ee6d2e731f48db833cc451326e737e1e39963/src/Verifier/LLVM/Debugger.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE DoAndIfThenElse #
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
# LANGUAGE Rank2Types #
GHC.IO.Exception is imported so that we can catch
| Treat as IORef as a state transformer.
| Break on entry to the function.
exceptions that may be thrown.
----------------------------... | |
Module : $ Header$
Description : Debugger implementation for LSS
License : BSD3
Stability : provisional
Point - of - contact : acfoltzer , for the LLVM Symbolic Simulator . This module provides
implementations of the ' SEH ' event handlers . Commands and their
sem... |
20a8284a413ae9eaf43b10d0178587075469e290cfcecba250f46fe703663df4 | lilactown/pyramid | benchmark.clj | (ns benchmark
(:require
[pyramid.core :as p]
[criterium.core :as c]
[clj-async-profiler.core :as prof]))
(prof/serve-files 8080)
(prof/profile (dotimes [i 10000]
(p/db [{:person/id 123
:person/name "Will"
:contact {:phone "000-000-0001"}
... | null | https://raw.githubusercontent.com/lilactown/pyramid/eda474116574ec90f4199f6b2544c6fc75787653/benchmark.clj | clojure | this throws w/ StackOverflow on my computer when running p/db
testing out different trampoline strategies | (ns benchmark
(:require
[pyramid.core :as p]
[criterium.core :as c]
[clj-async-profiler.core :as prof]))
(prof/serve-files 8080)
(prof/profile (dotimes [i 10000]
(p/db [{:person/id 123
:person/name "Will"
:contact {:phone "000-000-0001"}
... |
92f0068d9d06acc1bf2c602d02f1406eabbc64aaabf3fa499e2228aa3adce1ef | fugue/fregot | BuildTree.hs | |
Copyright : ( c ) 2020 Fugue , Inc.
License : Apache License , version 2.0
Maintainer :
Stability : experimental
Portability : POSIX
Helper module for building rule trees from JSON and YAML documents .
Copyright : (c) 2020 Fugue, Inc.
License : Apache License, version 2.0
Maintainer... | null | https://raw.githubusercontent.com/fugue/fregot/c3d87f37c43558761d5f6ac758d2f1a4117adb3e/lib/Fregot/Prepare/BuildTree.hs | haskell | # LANGUAGE OverloadedStrings #
NOTE(jaspervdj): Should we have this use the new 'ValueT' to only represent
values? | |
Copyright : ( c ) 2020 Fugue , Inc.
License : Apache License , version 2.0
Maintainer :
Stability : experimental
Portability : POSIX
Helper module for building rule trees from JSON and YAML documents .
Copyright : (c) 2020 Fugue, Inc.
License : Apache License, version 2.0
Maintainer... |
65ea7f537c535cf7e38e0a10194e7667da3a65ef01e559529a44744f7e721da1 | mirage/conan | number.mli | type t
val int64 : int64 -> t
val float : float -> t
val pp : Format.formatter -> t -> unit
val to_float : t -> float
val to_int : t -> int
val to_int64 : t -> int64
val to_int32 : t -> int32
val to_short : t -> int
val to_byte : t -> char
val to_ptime : t -> Ptime.Span.t
val parse : Sub.t -> (t * Sub.t, [> `Empty | `... | null | https://raw.githubusercontent.com/mirage/conan/fb144c7785ff0aa4ec6d8c87e58ca2a0c2d328db/src/number.mli | ocaml | type t
val int64 : int64 -> t
val float : float -> t
val pp : Format.formatter -> t -> unit
val to_float : t -> float
val to_int : t -> int
val to_int64 : t -> int64
val to_int32 : t -> int32
val to_short : t -> int
val to_byte : t -> char
val to_ptime : t -> Ptime.Span.t
val parse : Sub.t -> (t * Sub.t, [> `Empty | `... | |
b01dba792423febcebffb1744b7f7c9ba527654741299512adfe2581a9a84ef7 | fujita-y/ypsilon | 27.scm | #!nobacktrace
(define-library (srfi 27)
(import (core) (rnrs))
(export make-random-source
random-source?
random-source-state-ref
random-source-state-set!
random-source-randomize!
random-source-pseudo-randomize!
random-source-make-integers
random-... | null | https://raw.githubusercontent.com/fujita-y/ypsilon/44260d99e24000f9847e79c94826c3d9b76872c2/sitelib/srfi/27.scm | scheme | #!nobacktrace
(define-library (srfi 27)
(import (core) (rnrs))
(export make-random-source
random-source?
random-source-state-ref
random-source-state-set!
random-source-randomize!
random-source-pseudo-randomize!
random-source-make-integers
random-... | |
18c508fd9ea1f9ede7a2b734f95a4010a1f5660aad8c5a387732b39be3c35922 | roman01la/hooks | impl.cljs | (ns hooks.impl
(:require ["use-sync-external-store/shim/with-selector" :refer [useSyncExternalStoreWithSelector]]
[react-dom]
[react]))
(defn- setup-batched-updates-listener [^js ref]
;; Adding an atom holding a set of listeners on a ref if it wasn't added yet
(when-not (.-react-listeners... | null | https://raw.githubusercontent.com/roman01la/hooks/7b26bcb68afdb0991f2efb341cec3d70ef5ba576/src/hooks/impl.cljs | clojure | Adding an atom holding a set of listeners on a ref if it wasn't added yet
When the last listener was removed,
remove batched updates listener from the ref
selector, not using, just returning the value itself
value equality check | (ns hooks.impl
(:require ["use-sync-external-store/shim/with-selector" :refer [useSyncExternalStoreWithSelector]]
[react-dom]
[react]))
(defn- setup-batched-updates-listener [^js ref]
(when-not (.-react-listeners ref)
(set! (.-react-listeners ref) (atom #{}))
When the ref is updated ,... |
e751e5de55523064a5261839e4e5b04a0751e0c44d59b45b547344568ddf0b9a | racket/typed-racket | with-type-lift.rkt | #lang racket/base
;; Test syntax lifting in `with-type`
(require rackunit typed/racket)
(with-type #:result Number
(define-syntax (m stx)
(syntax-local-lift-expression #'(+ 1 2)))
(m))
(define-syntax (m2 stx)
(syntax-local-lift-expression #'(+ 1 2)))
(with-type #:result Number (m2))
(with-type ([val Num... | null | https://raw.githubusercontent.com/racket/typed-racket/0236151e3b95d6d39276353cb5005197843e16e4/typed-racket-test/succeed/with-type-lift.rkt | racket | Test syntax lifting in `with-type`
casts do lifts for the contract
as do predicates | #lang racket/base
(require rackunit typed/racket)
(with-type #:result Number
(define-syntax (m stx)
(syntax-local-lift-expression #'(+ 1 2)))
(m))
(define-syntax (m2 stx)
(syntax-local-lift-expression #'(+ 1 2)))
(with-type #:result Number (m2))
(with-type ([val Number]) (define val (m2)))
(check-equal?... |
dbbeea9acb1a5a664b8b45f4dc5576360557bfc84b5cc199a3ec1f0ab587162e | craigfe/oskel | main.ml | let ( >>| ) x f = Lwt.map f x
let git_user_name () =
Oskel.Utils.Utils_unix.exec "git config user.name"
>>| function
| Ok [ name ] -> if String.(equal (trim name) "") then None else Some name
| Ok o ->
Oskel.show_errorf "Unexpected output from `git config`: %a"
Fmt.Dump.(list string)
o
... | null | https://raw.githubusercontent.com/craigfe/oskel/057129faaf8171ff4ed49022346e9179b04735b2/bin/main.ml | ocaml | let ( >>| ) x f = Lwt.map f x
let git_user_name () =
Oskel.Utils.Utils_unix.exec "git config user.name"
>>| function
| Ok [ name ] -> if String.(equal (trim name) "") then None else Some name
| Ok o ->
Oskel.show_errorf "Unexpected output from `git config`: %a"
Fmt.Dump.(list string)
o
... | |
b2d1f4c93a70225b5a75c63d524daa08fda83717e77dd6abfecfd0923eb1fcba | clojurians-org/haskell-example | DataSandbox.hs | module Frontend.Page.DataSandbox (module X) where
import Frontend.Page.DataSandbox.DataSource.SQLCursor as X
import Frontend.Page.DataSandbox.DataService.FileService.SFTP as X
| null | https://raw.githubusercontent.com/clojurians-org/haskell-example/c96b021bdef52a121e04ea203c8c3e458770a25a/conduit-ui/frontend/src/Frontend/Page/DataSandbox.hs | haskell | module Frontend.Page.DataSandbox (module X) where
import Frontend.Page.DataSandbox.DataSource.SQLCursor as X
import Frontend.Page.DataSandbox.DataService.FileService.SFTP as X
| |
5ff53938f625977cdc9b476f24d01ba6fb6442c3016f9b69d58a2ea193a6de23 | ejgallego/coq-serapi | ser_cooking.ml | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * INRIA , CNRS and contributors - Copyright 1999 - 2018
(* <O___,, * (see CREDITS file for the list of authors) *)
\VV/ * * * *... | null | https://raw.githubusercontent.com/ejgallego/coq-serapi/dd9e3fbf7faaf3bf365fa3eff134641055151a9b/serlib/ser_cooking.ml | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
<O___,, * (see CREDITS file for the list of authors)
// * This file is distributed under the terms of the
* (see LICENSE file for... | v * INRIA , CNRS and contributors - Copyright 1999 - 2018
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser General Public License Version 2.1
Copyright 2016 - 2019 MINES ParisT... |
f45b5160f49be773d389ed561c5d52262d174bcdd136fd0485150e59257f9ccd | cljfx/cljfx | custom_menu_item.clj | (ns cljfx.fx.custom-menu-item
"Part of a public API"
(:require [cljfx.composite :as composite]
[cljfx.lifecycle :as lifecycle]
[cljfx.fx.menu-item :as fx.menu-item]
[cljfx.coerce :as coerce])
(:import [javafx.scene.control CustomMenuItem]))
(set! *warn-on-reflection* true)
(d... | null | https://raw.githubusercontent.com/cljfx/cljfx/543f7409290051e9444771d2cd86dadeb8cdce33/src/cljfx/fx/custom_menu_item.clj | clojure | overrides
definitions | (ns cljfx.fx.custom-menu-item
"Part of a public API"
(:require [cljfx.composite :as composite]
[cljfx.lifecycle :as lifecycle]
[cljfx.fx.menu-item :as fx.menu-item]
[cljfx.coerce :as coerce])
(:import [javafx.scene.control CustomMenuItem]))
(set! *warn-on-reflection* true)
(d... |
2280469ab8d77d477871f1a6c473aca0fc0d3326df10b5a88c5986b3a1143af3 | glutamate/bugpan | Format2.hs | # LANGUAGE GeneralizedNewtypeDeriving #
module Format2 where
import EvalM
import Data.Binary
import Data.Binary.Get
import qualified Data.ByteString.Lazy as L
import Numbers
--import Array
import Control.Monad
import TNUtils
import Debug.Trace
import Unsafe.Coerce
import Data.Array.IO
import System.IO
import Data.A... | null | https://raw.githubusercontent.com/glutamate/bugpan/d0983152f5afce306049262cba296df00e52264b/Format2.hs | haskell | import Array
++ typeTag t1 ++ typeTag t2
++ typeTag t
vls <- get
we must seq x to avoid stack overflows due to laziness in
(>>=)
- SPECIALIZE getMany :: Int -> Get [RealNum] -} | # LANGUAGE GeneralizedNewtypeDeriving #
module Format2 where
import EvalM
import Data.Binary
import Data.Binary.Get
import qualified Data.ByteString.Lazy as L
import Numbers
import Control.Monad
import TNUtils
import Debug.Trace
import Unsafe.Coerce
import Data.Array.IO
import System.IO
import Data.Array.MArray
imp... |
f3b4a9de489fe020f9982c10de5afaf0ec391500b7cfb93eed0c95fd0e4ec97f | JKTKops/cspim | Expr.hs | # LANGUAGE ExistentialQuantification #
module Parser.Expr
( Expr(..)
, parseExpr
, parseRValue
, gatherExpToRValue
) where
import Pretty
import TAC.Pretty
import Text.Parsec.Expr hiding (Operator)
import qualified Text.Parsec.Expr as Parsec
import Text.Parsec as TP hiding ((<|>), (<?>))
import Dat... | null | https://raw.githubusercontent.com/JKTKops/cspim/0218d88ee774023eecef2c4a0733c3cf1184f443/src/Parser/Expr.hs | haskell | buildExpressionParser, and allow monadic operator functions.
TODO : correct this type
right-to-left to match gcc
------------------------------------------------------------------------------------
Alternative to Nested Parser Strategy
------------------------------------------------------------------------------... | # LANGUAGE ExistentialQuantification #
module Parser.Expr
( Expr(..)
, parseExpr
, parseRValue
, gatherExpToRValue
) where
import Pretty
import TAC.Pretty
import Text.Parsec.Expr hiding (Operator)
import qualified Text.Parsec.Expr as Parsec
import Text.Parsec as TP hiding ((<|>), (<?>))
import Dat... |
89b4667f7786ff039acfe917a4e9675f9e4f8e501fc1ce3622dfd692029a849c | joinr/clclojure | recurtest.lisp | (defpackage common-utils.recurtest
(:use :common-lisp :common-utils))
(in-package :common-utils.recurtest)
;;can we implement (recur ...) ?
;; (block some-name
;; (tagbody some-point
:
;; (when :recur
( progn ( update - vars )
;; (go some-point))
;; )
;; )
;; ... | null | https://raw.githubusercontent.com/joinr/clclojure/8b51214891c4da6dfbec393dffac70846ee1d0c5/dustbin/recurtest.lisp | lisp | can we implement (recur ...) ?
(block some-name
(tagbody some-point
(when :recur
(go some-point))
)
)
result)
(defun custom-loop (x)
(let ((res))
(pprint ,'x)
(go ,'recur-from))))
(tagbody recur-from
... | (defpackage common-utils.recurtest
(:use :common-lisp :common-utils))
(in-package :common-utils.recurtest)
:
( progn ( update - vars )
( ( ( recur ( )
` ( progn ( setf , ' x , )
( setf res
( if (= x 10 )
( defmacro with - recur ( args & r... |
c2b2c60f88c5b4e510bd45ffec0bde224ce1ec831b21f28824d6744f8cf3f968 | oral-health-and-disease-ontologies/ohd-ontology | data-source-methods.lisp |
;;; generic methods for data-source class
(defgeneric initialize-instance ((ds data-source) &key &allow-other-keys)
(:documentation "Initializes the data source."))
(defgeneric open-data-source ((ds data-source) &key &allow-other-keys)
(:documentation "Opens a stream (or connection) the data source."))
;;; met... | null | https://raw.githubusercontent.com/oral-health-and-disease-ontologies/ohd-ontology/ba3f502b86487c8ba5fa04ff8ba33312a1679570/src/vdw-translation/development-library/classes/data-source-methods.lisp | lisp | generic methods for data-source class
methods for file-data-source
open a file stream
return the data-source
methods for jdbc-data-source
set key value
check for jdbc-url
return the data source
although it listed as a key, the sql-string must be supplied |
(defgeneric initialize-instance ((ds data-source) &key &allow-other-keys)
(:documentation "Initializes the data source."))
(defgeneric open-data-source ((ds data-source) &key &allow-other-keys)
(:documentation "Opens a stream (or connection) the data source."))
(defmethod open-data-source ((fs file-data-sourc... |
894ba31d2fafa384df131d7679c79f387bbf3f86900e0a927a39f88e95834dbc | rabbitmq/rabbitmq-test | gm_soak_test.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License at
%% /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/rabbitmq/rabbitmq-test/c77ef827396a32aa67b4cbfe9c237485a2650d2d/test/src/gm_soak_test.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 GoPivotal , Inc.
Copyright ( c ) 2007 - 2015 Pivotal Software , Inc. All rights reserved .
... |
0c3997e32648edd55a3069a6a7d40012d3ff22d15132ee27d75705451b760829 | bobzhang/fan | test_nest_quotation.ml |
open Camlp4.PreCast;
value _loc = Loc.ghost;
value f x = <:expr<
<:patt<
<:expr< >>
;
| null | https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/todoml/test/test_nest_quotation.ml | ocaml |
open Camlp4.PreCast;
value _loc = Loc.ghost;
value f x = <:expr<
<:patt<
<:expr< >>
;
| |
e9a1549c0349934163dcc058ede25deebcbc3f150f6cdcf09c091f70e4f39f13 | leo-project/leo_gateway | leo_nfs_proto3_server.erl | %%======================================================================
%%
Leo Gateway
%%
Copyright ( c ) 2012 - 2015 Rakuten , Inc.
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a... | null | https://raw.githubusercontent.com/leo-project/leo_gateway/7bac8912b762688f0ef237b31fee17e30e3888a3/src/leo_nfs_proto3_server.erl | erlang | ======================================================================
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permis... | Leo Gateway
Copyright ( c ) 2012 - 2015 Rakuten , Inc.
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module(leo_nfs_proto3... |
8316cccfd6a3b560ebdd92718ca9e0deeae2c787e4479f381646293c88f7aa87 | souenzzo/souenzzo.github.io | helper.clj | (ns stackfriend.helper)
(defn ^Throwable create-exception
[]
(ex-info "" {}))
(defn simple-exception
[]
(let [p (promise)]
(.start (Thread. (fn []
(let [x (create-exception)]
(deliver p x)))))
@p))
| null | https://raw.githubusercontent.com/souenzzo/souenzzo.github.io/30a811c4e5633ad07bba1d58d19eb091dac222e9/stackfriend/test/stackfriend/helper.clj | clojure | (ns stackfriend.helper)
(defn ^Throwable create-exception
[]
(ex-info "" {}))
(defn simple-exception
[]
(let [p (promise)]
(.start (Thread. (fn []
(let [x (create-exception)]
(deliver p x)))))
@p))
| |
eec60fce6bae1fe69064f87be5e3db7d3c3425a4ac6e901cb03a4e41b19a335c | xapi-project/xen-api | test_vm.ml |
* Copyright ( C ) 2017 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in fi... | null | https://raw.githubusercontent.com/xapi-project/xen-api/47fae74032aa6ade0fc12e867c530eaf2a96bf75/ocaml/tests/test_vm.ml | ocaml | Correct value
Empty value
Value having non printable ascii characters |
* Copyright ( C ) 2017 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in fi... |
a7bc2d04d89e95126be6fbacfef3ad28531965956ffac68560ac75ccaa2e7efc | jsdw/jsdw.me | examples.hs | # LANGUAGE FlexibleContexts #
-- I import qualified so that it's clear which
functions are from the parsec library :
import qualified Text.Parsec as Parsec
-- I am the choice and optional error message infix operator, used later:
import Text.Parsec ((<?>))
-- Imported so we can play with applicative things later.
... | null | https://raw.githubusercontent.com/jsdw/jsdw.me/da25ce265afbb8facbe902aae7a5c2a4d88c1f11/content/posts/haskell-parsec-basics/examples.hs | haskell | I import qualified so that it's clear which
I am the choice and optional error message infix operator, used later:
Imported so we can play with applicative things later.
not qualified as mostly infix operators we'll be using.
Get the Identity monad from here:
alias parseTest for more concise usage in my examples:... | # LANGUAGE FlexibleContexts #
functions are from the parsec library :
import qualified Text.Parsec as Parsec
import Text.Parsec ((<?>))
import Control.Applicative
import Control.Monad.Identity (Identity)
parse rule text = Parsec.parse rule "(source)" text
error_example = do
let result = parse (Parsec.char '... |
1a20dfd6c9226823802195874420efb8e23ba604180cca42f66f0de0f24087cb | cljfx/cljfx | renderer.clj | (ns cljfx.renderer
"Part of a public API"
(:require [cljfx.lifecycle :as lifecycle]
[cljfx.platform :as platform]))
(set! *warn-on-reflection* true)
(defn- complete-rendering [renderer desc component]
(let [with-component (assoc renderer :component component)]
(if (= desc (:desc renderer))
... | null | https://raw.githubusercontent.com/cljfx/cljfx/acbe9972e99abdce2d88d4595aa90f4d7c865629/src/cljfx/renderer.clj | clojure | (ns cljfx.renderer
"Part of a public API"
(:require [cljfx.lifecycle :as lifecycle]
[cljfx.platform :as platform]))
(set! *warn-on-reflection* true)
(defn- complete-rendering [renderer desc component]
(let [with-component (assoc renderer :component component)]
(if (= desc (:desc renderer))
... | |
05847a1e6aa571350a45af66505e7321ddbf2f542660f48e8a9d16eda67153d0 | Quviq/webdrv | webdrv_cap.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2013 , Quviq AB
%%%
%%% @doc
Handling of capabilities for WebDriver protocol
%%%
%%% <h2>License</h2>
%%% <pre>
%%% Permission is hereby granted, free of charge, to any person
%%% obtaining a copy of this software and ass... | null | https://raw.githubusercontent.com/Quviq/webdrv/7ceaf1f67d834e841ca0133b4bf899a9fa2db6bb/src/webdrv_cap.erl | erlang | -------------------------------------------------------------------
@doc
<h2>License</h2>
<pre>
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use, copy,
modify, merge, publish, d... | @author < >
( C ) 2013 , Quviq AB
Handling of capabilities for WebDriver protocol
files ( the " Software " ) , to deal in the Software without
of the Software , and to permit persons to whom the Software is
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS ... |
e1a0bfed29fc29904eb5488933b2be59e9ce9f14b4fcedb67c9cefbe2c20d4e2 | zalando-stups/kio | api.clj | ; Copyright 2015 Zalando SE
;
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 Li... | null | https://raw.githubusercontent.com/zalando-stups/kio/d84dd2e27d155340c4d2ae45908a11d637563493/src/org/zalando/stups/kio/api.clj | clojure | Copyright 2015 Zalando SE
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 speci... | Licensed under the Apache License , Version 2.0 ( the " License " )
distributed under the License is distributed on an " AS IS " BASIS ,
(ns org.zalando.stups.kio.api
(:require [org.zalando.stups.friboo.system.http :refer [def-http-component]]
[org.zalando.stups.friboo.config :refer [require-config]]... |
a1ac5f2c7945a07e01a7f363cbb2ef6f7c142c0c3cc06b61a3629f93a9d4e058 | Clojure2D/clojure2d-examples | main.clj | (ns rt4.the-next-week.ch05b.main
(:require [fastmath.core :as m]
[fastmath.vector :as v]
[rt4.common :as common]
[rt4.the-next-week.ch05b.sphere :as sphere]
[rt4.the-next-week.ch05b.moving-sphere :as moving-sphere]
[rt4.the-next-week.ch05b.camera :as camera]... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/ead92d6f17744b91070e6308157364ad4eab8a1b/src/rt4/the_next_week/ch05b/main.clj | clojure | camera | (ns rt4.the-next-week.ch05b.main
(:require [fastmath.core :as m]
[fastmath.vector :as v]
[rt4.common :as common]
[rt4.the-next-week.ch05b.sphere :as sphere]
[rt4.the-next-week.ch05b.moving-sphere :as moving-sphere]
[rt4.the-next-week.ch05b.camera :as camera]... |
49831e583c5bf00b128b6572fe8e64fa7f25cbb3fec027a691de89f57018f9ee | janestreet/hardcaml | test_signal.ml | open! Import
open Signal
let%expect_test "[Reg_spec.sexp_of_t]" =
print_s [%sexp (Reg_spec.create () ~clock : Reg_spec.t)];
[%expect {|
((clock clock)
(clock_edge Rising)) |}]
;;
let%expect_test "name of empty" =
require_does_raise [%here] (fun () -> Signal.names empty);
[%expect {| "cannot get ... | null | https://raw.githubusercontent.com/janestreet/hardcaml/4126f65f39048fef5853ba9b8d766143f678a9e4/test/lib/test_signal.ml | ocaml | open! Import
open Signal
let%expect_test "[Reg_spec.sexp_of_t]" =
print_s [%sexp (Reg_spec.create () ~clock : Reg_spec.t)];
[%expect {|
((clock clock)
(clock_edge Rising)) |}]
;;
let%expect_test "name of empty" =
require_does_raise [%here] (fun () -> Signal.names empty);
[%expect {| "cannot get ... | |
a1de98a3267284dce834dda46ed36d71bc3467a5d54a10739acac5ad29a75288 | jeffshrager/biobike | specials.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : CL - PPCRE ; Base : 10 -*-
$ Header : /cvsroot - fuse / biolingua / BioLisp / ppcre / cl - ppcre-1.2.3 / specials.lisp , v 1.1 2005/02/03 06:09:46 roton Exp $
;;; globally declared special variables
Copyright ( c ) 2002 - 2004 , Dr. . All rights reserved .
... | null | https://raw.githubusercontent.com/jeffshrager/biobike/5313ec1fe8e82c21430d645e848ecc0386436f57/BioLisp/ppcre/cl-ppcre-1.2.3/specials.lisp | lisp | Syntax : COMMON - LISP ; Package : CL - PPCRE ; Base : 10 -*-
globally declared special variables
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
n... | $ Header : /cvsroot - fuse / biolingua / BioLisp / ppcre / cl - ppcre-1.2.3 / specials.lisp , v 1.1 2005/02/03 06:09:46 roton Exp $
Copyright ( c ) 2002 - 2004 , Dr. . All rights reserved .
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY T... |
6da9dbbe406cfbfbfd8518c7695bbe4467b1475eba09565e6bd96c751a135198 | LdBeth/CLFSWM | clfswm-info.lisp | ;;; --------------------------------------------------------------------------
;;; CLFSWM - FullScreen Window Manager
;;;
;;; --------------------------------------------------------------------------
;;; Documentation: Info function (see the end of this file for user definition
;;; ------------------------------------... | null | https://raw.githubusercontent.com/LdBeth/CLFSWM/4e936552d1388718d2947a5f6ca3eada19643e75/src/clfswm-info.lisp | lisp | --------------------------------------------------------------------------
CLFSWM - FullScreen Window Manager
--------------------------------------------------------------------------
Documentation: Info function (see the end of this file for user definition
------------------------------------------------------... | ( C ) 2005 - 2015 < >
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
Foundation , Inc. , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
(in-package :clfswm)
(defstruct info window gc font list ilw ilh x ... |
b2cea8045aa3ced6bc5e3ee8cc2dbf581d5ab6cd91f450da2cc272f1b32b841f | tolitius/cbass | tools.clj | (ns cbass.tools
(:require [taoensso.nippy :as n]
[æsahættr :refer [hash-object hash-bytes murmur3-32 murmur3-128]])
(:import [org.apache.hadoop.hbase.util Bytes]
[java.time Instant ZoneId ZonedDateTime ZoneOffset Duration]
[java.time.format DateTimeFormatter]
(com.google... | null | https://raw.githubusercontent.com/tolitius/cbass/73701133650c7b5b8a3e098abd66c1987319b7a8/src/cbass/tools.clj | clojure | (ns cbass.tools
(:require [taoensso.nippy :as n]
[æsahættr :refer [hash-object hash-bytes murmur3-32 murmur3-128]])
(:import [org.apache.hadoop.hbase.util Bytes]
[java.time Instant ZoneId ZonedDateTime ZoneOffset Duration]
[java.time.format DateTimeFormatter]
(com.google... | |
2aa44a2934f75e14d2c66b00a720a5335acea80e5337afc7cbcffe0810ffad73 | incoherentsoftware/defect-process | Shot.hs | module Player.Gun.All.Revolver.Shot
( mkShotProjectile
) where
import Control.Monad.IO.Class (MonadIO)
import qualified Data.List.NonEmpty as NE
import qualified Data.Set as S
import Attack.Hit
import Collision
import Configs
import Configs.All.PlayerGun.Revolver
import Configs.All.Settings
import Configs.All... | null | https://raw.githubusercontent.com/incoherentsoftware/defect-process/ae362274cca0e59c0fc0dcaee0f0e208db8ccc46/src/Player/Gun/All/Revolver/Shot.hs | haskell | module Player.Gun.All.Revolver.Shot
( mkShotProjectile
) where
import Control.Monad.IO.Class (MonadIO)
import qualified Data.List.NonEmpty as NE
import qualified Data.Set as S
import Attack.Hit
import Collision
import Configs
import Configs.All.PlayerGun.Revolver
import Configs.All.Settings
import Configs.All... | |
c7d32289575983b275020be691cfc6956ab6fe7a8bf6f8e971c4e7aea5d76455 | open-company/open-company-web | lazy_stream.cljs | (ns oc.web.components.ui.lazy-stream
(:require [rum.core :as rum]
[org.martinklepsch.derivatives :as drv]
[oc.web.dispatcher :as dis]
[oc.web.components.paginated-stream :refer (paginated-stream)]
[oc.web.actions.nav-sidebar :as nav-actions]
[oc.web.lib.util... | null | https://raw.githubusercontent.com/open-company/open-company-web/700f751b8284d287432ba73007b104f26669be91/src/main/oc/web/components/ui/lazy_stream.cljs | clojure | (drv/drv :foc-layout)
(= current-board-slug "replies"))
(not data-ready?)
[:div.lazy-stream-interstitial
{:class (when collapsed-foc? "collapsed")
:style {:height (str (+ (dis/route-param :scroll-y)
(or (.. js/document -documentElement -clientHeight)
... | (ns oc.web.components.ui.lazy-stream
(:require [rum.core :as rum]
[org.martinklepsch.derivatives :as drv]
[oc.web.dispatcher :as dis]
[oc.web.components.paginated-stream :refer (paginated-stream)]
[oc.web.actions.nav-sidebar :as nav-actions]
[oc.web.lib.util... |
f79596ea62d1103fc6acedc4a5c41da0c07c63cb12710050820a4330f4d3bfcc | bn-d/ppx_make | record_types.ml | type b = { b1 : int } [@@deriving make]
type o = { o1 : int option } [@@deriving make]
type l = { l1 : int list } [@@deriving make]
type a = { a1 : int array } [@@deriving make]
type s = { s1 : string } [@@deriving make]
(*type q = { q1 : int seq }[@@deriving make]*)
type d = { answer : int [@default 42] } [@@derivin... | null | https://raw.githubusercontent.com/bn-d/ppx_make/1fa039397d839a7c9199e32b16e6623b4c199f16/test/record_types.ml | ocaml | type q = { q1 : int seq }[@@deriving make] | type b = { b1 : int } [@@deriving make]
type o = { o1 : int option } [@@deriving make]
type l = { l1 : int list } [@@deriving make]
type a = { a1 : int array } [@@deriving make]
type s = { s1 : string } [@@deriving make]
type d = { answer : int [@default 42] } [@@deriving make]
type m = { m1 : int; [@main] m2 : int [... |
6084b81efcb9079c808e44cf9b31409a656c84b4490860f2e19347ee8db95cff | andersfugmann/ppx_protocol_conv | test_types.ml | open Sexplib.Std
module Make(Driver: Testable.Driver) = struct
module M = Testable.Make(Driver)
module S3 : M.Testable = struct
let name = "S3"
type storage_class = Standard [@key "STANDARD"]
| Standard_ia [@key "STANDARD_IA"]
| Reduced_redundancy [@key "RED... | null | https://raw.githubusercontent.com/andersfugmann/ppx_protocol_conv/e93eb01ca8ba8c7dd734070316cd281a199dee0d/test/test_types.ml | ocaml | open Sexplib.Std
module Make(Driver: Testable.Driver) = struct
module M = Testable.Make(Driver)
module S3 : M.Testable = struct
let name = "S3"
type storage_class = Standard [@key "STANDARD"]
| Standard_ia [@key "STANDARD_IA"]
| Reduced_redundancy [@key "RED... | |
e7de9d52aa40d5f32f1efff47e621042b5c311898d40d0c52ce756972147ce18 | drlivingston/kabob | refseq_to_uniprot_mapping_rules.clj | ;; The UniProt idmapping_selected.tab file contains a variety of identifier mappings. Here we link
;; mappings among protein identifiers using the skos:exactMatch predicate
;; uniport to refseq
`{:name "refseq-uniprot-exact-mapping-assertion"
:head ((?/uniprot skos/exactMatch ?/refseq))
:body
(~@(kabob/rtv _/rec... | null | https://raw.githubusercontent.com/drlivingston/kabob/7038076849744c959da9c8507e8a8ab7215410aa/kabob-build/src/main/resources/edu/ucdenver/ccp/kabob/build/rules/id_mapping/skos_exact/refseq_to_uniprot_mapping_rules.clj | clojure | The UniProt idmapping_selected.tab file contains a variety of identifier mappings. Here we link
mappings among protein identifiers using the skos:exactMatch predicate
uniport to refseq
protein
is this triple redundant ?
so there will be further links to add via subclass_of
`{:name "uniprot-exact-refseq-id-mappi... |
`{:name "refseq-uniprot-exact-mapping-assertion"
:head ((?/uniprot skos/exactMatch ?/refseq))
:body
(~@(kabob/rtv _/record
iaoeg/EntrezGeneRefSeqUniprotKbCollabFileData_uniprotIdDataField1
?/uniprot
iaoeg/EntrezGeneRefSeqUniprotKbCollabFil... |
2b159331f4880b41bb60cca2edc2e4b4e0cb74b9423a14bfcea3fb74facb0265 | ocaml-community/yojson | monomorphic.mli | val pp : Format.formatter -> t -> unit
(** Pretty printer, useful for debugging *)
val show : t -> string
(** Convert value to string, useful for debugging *)
val equal : t -> t -> bool
* [ equal a b ] is the monomorphic equality .
Determines whether two JSON values are considered equal . In the case of
... | null | https://raw.githubusercontent.com/ocaml-community/yojson/a3fbc94d1d57bcacb00d3b1b9ec4aa602326a4d0/lib/monomorphic.mli | ocaml | * Pretty printer, useful for debugging
* Convert value to string, useful for debugging | val pp : Format.formatter -> t -> unit
val show : t -> string
val equal : t -> t -> bool
* [ equal a b ] is the monomorphic equality .
Determines whether two JSON values are considered equal . In the case of
JSON objects , the order of the keys does not matter , except for
duplicate keys which... |
a4c551d2f8fd6001ede388e65ec61212d5dd2754035574f835f8803fdbf47d55 | Metaxal/bazaar | compiler.rkt | #lang racket/base
; Originally from /collects/scribble/tools/drracket-buttons.rkt
(require racket/runtime-path
;racket/class
racket/path
racket/system
setup/xref
;net/sendurl
)
(provide scribble->PDF
scribble->HTML)
(define-namespace-anchor anchor)
; f... | null | https://raw.githubusercontent.com/Metaxal/bazaar/8432d3c5398225a4bfb5ed5c25a1beffa06409ec/scribble/compiler.rkt | racket | Originally from /collects/scribble/tools/drracket-buttons.rkt
racket/class
net/sendurl
file should be a full-path
(printf "A\n")
(fprintf out "cla:~a\n" (current-command-line-arguments))
(fprintf out "currdir:~a\n" (current-directory))
(current-output-port out)
return:
(cond
(let ([html-button
when we have a ge... | #lang racket/base
(require racket/runtime-path
racket/path
racket/system
setup/xref
)
(provide scribble->PDF
scribble->HTML)
(define-namespace-anchor anchor)
(define (scribble-compile file mode suffix extra-cmdline)
(let-values ([(out) (current-output-port)]
... |
732c8d21b6efed2132af3debfe1f1a032fbee485e75c86b81e3e970f5bf14727 | ryukinix/discrete-mathematics | functions.hs | {--
This file explain the basic function to do:
* type declaration
* pattern matching
* function definition
* function composition
--}
-- :: factorial function
fat :: Integer -> Integer
fat 0 = 1
fat n | n > 0 = n * fat (n - 1)
-- :: fibonacci function
| domain and contra - domain declaratio... | null | https://raw.githubusercontent.com/ryukinix/discrete-mathematics/1f779e05822c094af33745e2dd3c9a35c6dfb388/src/01-introduction-to-haskell/functions.hs | haskell | -
This file explain the basic function to do:
* type declaration
* pattern matching
* function definition
* function composition
-
:: factorial function
:: fibonacci function
| pattern matching
| formal definition of fib function
| function composition
is just like fatfib = fat(fib(x))
:: ... |
fat :: Integer -> Integer
fat 0 = 1
fat n | n > 0 = n * fat (n - 1)
| domain and contra - domain declaration
fib :: Integer -> Integer
fib n | n <= 1 = 1
fib n | n > 1 = fib(n - 1) + fib(n - 2)
fatfib :: Integer -> Integer
fatfib = fat . fib
For example , some of the functions that we have already seen have ... |
f44e37863cfbc3937a25cfaf56229f2b524739422b6f784339fa82ad5675ef60 | metabase/metabase | upload.clj | (ns release.common.upload
(:require
[metabuild-common.core :as u]
[release.common :as c]))
(defn upload-artifact!
"Upload an artifact to downloads.metabase.com and create a CloudFront invalidation."
([source-file filename]
(upload-artifact! source-file (c/version) filename))
([source-file version fil... | null | https://raw.githubusercontent.com/metabase/metabase/5e9b52a32dfeab754d218c758d08fffbacb7c0e7/bin/build/src/release/common/upload.clj | clojure | (ns release.common.upload
(:require
[metabuild-common.core :as u]
[release.common :as c]))
(defn upload-artifact!
"Upload an artifact to downloads.metabase.com and create a CloudFront invalidation."
([source-file filename]
(upload-artifact! source-file (c/version) filename))
([source-file version fil... | |
5893daa120473a70490dea295aef73c89f7cc15d5c620e65975c0c3217c0cb13 | alex-gutev/generic-cl | object.lisp | ;;;; object.lisp
;;;;
Copyright 2019
;;;;
;;;; 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, m... | null | https://raw.githubusercontent.com/alex-gutev/generic-cl/e337b8d2198791994f4377a522bf0200d2285548/src/object/object.lisp | lisp | object.lisp
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
Software is furnished to do so, subject to the fol... | Copyright 2019
files ( the " Software " ) , to deal in the Software without
copies of the Software , and to permit persons to whom the
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
(in-package :generic-cl.object)
(def... |
9964ee51864c004e058572b2fed7310af0c05c8ad0598a47ce08e51fd6b10a7f | sig-gis/gridfire | spotting_test.clj | (ns gridfire.spec.spotting-test
(:require [clojure.spec.alpha :as s]
[clojure.test :refer [deftest is testing]]
[gridfire.spec.spotting :as spotting]))
(deftest spotting-test
(let [required {:mean-distance {:lo 5.0 :hi 15.0}
:normalized-distance-variance {:l... | null | https://raw.githubusercontent.com/sig-gis/gridfire/44aeaf56fceb01f61b21db6220d2cb562a92570b/test/gridfire/spec/spotting_test.clj | clojure | (ns gridfire.spec.spotting-test
(:require [clojure.spec.alpha :as s]
[clojure.test :refer [deftest is testing]]
[gridfire.spec.spotting :as spotting]))
(deftest spotting-test
(let [required {:mean-distance {:lo 5.0 :hi 15.0}
:normalized-distance-variance {:l... | |
23ee7ee059fffc04f58c1e16c6a4671b2f2a9216f3f715f8293fac18dce2d87a | plumatic/grab-bag | admin.clj | (ns dashboard.pages.admin
(:use plumbing.core)
(:require
[plumbing.graph :as graph]
[plumbing.parallel :as parallel]
[store.snapshots :as snapshots]
[service.nameserver :as nameserver]
[dashboard.pages.admin.api :as api]))
(set! *warn-on-reflection* true)
(def admin-resources
(graph/graph
:sna... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/service/dashboard/src/clj/dashboard/pages/admin.clj | clojure | (ns dashboard.pages.admin
(:use plumbing.core)
(:require
[plumbing.graph :as graph]
[plumbing.parallel :as parallel]
[store.snapshots :as snapshots]
[service.nameserver :as nameserver]
[dashboard.pages.admin.api :as api]))
(set! *warn-on-reflection* true)
(def admin-resources
(graph/graph
:sna... | |
f19fd9cb39342a08bd7c3254900ef288f8ee876f28bd54c81f997166431879b6 | eareese/htdp-exercises | 171-list-of-strings-definition.rkt | #lang htdp/bsl
(require 2htdp/batch-io)
Exercise 171 . You know what the data definition for List - of - strings looks like . Spell it out . Make sure that you can represent ’s poem as an instance of the definition where each line is a represented as a string and another one where each word is a string . Use read ... | null | https://raw.githubusercontent.com/eareese/htdp-exercises/a85ff3111d459dda0e94d9b463d01a09accbf9bf/part02-arbitrarily-large-data/171-list-of-strings-definition.rkt | racket |
- '()
- (cons String Los)
(cons ""
(cons "Put up in a place"
(cons "where it's easy to see"
(cons "the cryptic admonishment"
(cons ...
'()))))))
(cons "Put"
(cons "u... | #lang htdp/bsl
(require 2htdp/batch-io)
Exercise 171 . You know what the data definition for List - of - strings looks like . Spell it out . Make sure that you can represent ’s poem as an instance of the definition where each line is a represented as a string and another one where each word is a string . Use read ... |
66a5d349df73aabb73c5e55d62bb7949104b4f70dc41370abb5fba73b9022aef | ejconlon/blanks | Sub.hs | {-# LANGUAGE DeriveAnyClass #-}
module Blanks.Util.Sub
( SubError (..)
, ThrowSub (..)
, rethrowSub
) where
import Control.DeepSeq (NFData)
import Control.Exception (Exception, throwIO)
import GHC.Generics (Generic)
-- | Errors that happen in the course of instantiation
data SubError
= ApplyError !Int !Int... | null | https://raw.githubusercontent.com/ejconlon/blanks/3235518e765a69f62ffaa1620e883270c2860dde/src/Blanks/Util/Sub.hs | haskell | # LANGUAGE DeriveAnyClass #
| Errors that happen in the course of instantiation
Exists to let you rethrow to a more convenient context rather than
pattern maching. |
module Blanks.Util.Sub
( SubError (..)
, ThrowSub (..)
, rethrowSub
) where
import Control.DeepSeq (NFData)
import Control.Exception (Exception, throwIO)
import GHC.Generics (Generic)
data SubError
= ApplyError !Int !Int
| NonBinderError
deriving stock (Eq, Show, Generic)
deriving anyclass (NFData)
... |
5710e3ad3464c3e05fa61d0410ff7978190b7d54afb575604d6aad59918c96af | hatsugai/Guedra | test_listboxvs.ml | open Csp
open Guedra
let interval_map a b f =
let rec g rs k =
if k >= b then
List.rev rs
else
g ((f k)::rs) (k + 1)
in g [] a
let item_string _ = ""
let draw_item x y width height cs i sel ud dc act =
(if i = sel then
(set_color o_o.color_fore;
fill_rect (flo x) (flo y) (flo wid... | null | https://raw.githubusercontent.com/hatsugai/Guedra/592e9b4cff151228735d2c61c337154cde8b5329/test/test_listboxvs.ml | ocaml | open Csp
open Guedra
let interval_map a b f =
let rec g rs k =
if k >= b then
List.rev rs
else
g ((f k)::rs) (k + 1)
in g [] a
let item_string _ = ""
let draw_item x y width height cs i sel ud dc act =
(if i = sel then
(set_color o_o.color_fore;
fill_rect (flo x) (flo y) (flo wid... | |
f12840073ff6f7c93b615b4501f0bafc9df5405f37bf4a4d9521299ae307859f | iamFIREcracker/adventofcode | day13.lisp | (defpackage :aoc/2020/13 #.cl-user::*aoc-use*)
(in-package :aoc/2020/13)
(defun read-buses (string &aux (offset 0) buses)
(dolist (item (cl-ppcre:split "," string) buses)
(when (string/= item "x")
(push (cons (parse-integer item) offset) buses))
(incf offset)))
(defun id (bus) (car bus))
(defun offset ... | null | https://raw.githubusercontent.com/iamFIREcracker/adventofcode/c395df5e15657f0b9be6ec555e68dc777b0eb7ab/src/2020/day13.lisp | lisp | (defpackage :aoc/2020/13 #.cl-user::*aoc-use*)
(in-package :aoc/2020/13)
(defun read-buses (string &aux (offset 0) buses)
(dolist (item (cl-ppcre:split "," string) buses)
(when (string/= item "x")
(push (cons (parse-integer item) offset) buses))
(incf offset)))
(defun id (bus) (car bus))
(defun offset ... | |
46bc72b8c279cee278c37ddffb130e29619880c06534416c0fef39db98931731 | racket/games | gofish.rkt | #lang racket
(require games/cards racket/gui racket/class racket/unit)
(provide game@)
(define game@ (unit (import) (export)
;; Player record
(define-struct player (r hand-r discard-r count-r ; regions
hand discarded ; cards
tried) #:mutable) ; memory for simulating playe... | null | https://raw.githubusercontent.com/racket/games/e57376f067be51257ed12cdf3e4509a00ffd533d/gofish/gofish.rkt | racket | Player record
regions
cards
memory for simulating players
Player names
Initial card count
Messages
Region layout constants
Set up the table
Get table width & height
Set up the cards
Function for dealing or drawing cards
Put the cards on the table
Player region size
Region-makers
Define the initial regio... | #lang racket
(require games/cards racket/gui racket/class racket/unit)
(provide game@)
(define game@ (unit (import) (export)
(define PLAYER-1-NAME "Opponent 1")
(define PLAYER-2-NAME "Opponent 2")
(define YOUR-NAME "You")
(define DEAL-COUNT 7)
(define YOUR-TURN-MESSAGE
"Your turn. (Drag a match to your discard ... |
7d0983a0e12553f66aabb0811cf1aefbda0e8645bccaa09a3f0fab6112609443 | markus-git/co-feldspar | Backend.hs | # language GADTs #
# language QuasiQuotes #
{-# language ScopedTypeVariables #-}
{-# language FlexibleContexts #-}
module Feldspar.Software.Primitive.Backend where
import Feldspar.Software.Primitive
import Data.Complex (Complex (..))
import Data.Constraint (Dict (..))
import Data.Proxy
-- syntactic.
import Language... | null | https://raw.githubusercontent.com/markus-git/co-feldspar/bf598c803d41e03ed894bbcb490da855cce9250e/src/Feldspar/Software/Primitive/Backend.hs | haskell | # language ScopedTypeVariables #
# language FlexibleContexts #
syntactic.
language-c-quote.
imperative-edsl.
------------------------------------------------------------------------------
* Compilation of software primitives.
------------------------------------------------------------------------------
------------... | # language GADTs #
# language QuasiQuotes #
module Feldspar.Software.Primitive.Backend where
import Feldspar.Software.Primitive
import Data.Complex (Complex (..))
import Data.Constraint (Dict (..))
import Data.Proxy
import Language.Syntactic
import Language.C.Quote.C
import qualified Language.C.Syntax as C
import... |
4d7877a5c944a67d82fa87a49b9f58bdbc89cfc655605ff44fa1df13a67322fe | takikawa/tr-pfds | physicists.rkt | #lang typed/racket
(provide filter remove Queue head+tail build-queue
empty empty? enqueue head tail queue->list queue list->queue
(rename-out [qmap map]
[queue-andmap andmap]
[queue-ormap ormap]) fold)
(define-type (Promiseof A) (Boxof (U (→ (Listof A)) (... | null | https://raw.githubusercontent.com/takikawa/tr-pfds/a08810bdfc760bb9ed68d08ea222a59135d9a203/pfds/queue/physicists.rkt | racket | Physicists Queue
Maintains invariant lenr <= lenf
pref is empty only if lenf = 0
Empty Queue Because of some limitations in TR in typechecking the
boxed values, I had to make empty a macro so that users can
instantiate empty easily.
Checks if the given Queue is empty
Maintains "preF" invariant (preF in not not ... | #lang typed/racket
(provide filter remove Queue head+tail build-queue
empty empty? enqueue head tail queue->list queue list->queue
(rename-out [qmap map]
[queue-andmap andmap]
[queue-ormap ormap]) fold)
(define-type (Promiseof A) (Boxof (U (→ (Listof A)) (... |
d7ec7aea4c3169b5d1e3523e80792dc4a510b39857883da0e9ec6ee02d33407f | ocsigen/js_of_ocaml | transaction.ml |
Copyright ( c ) 2015 , < >
Permission to use , copy , modify , and/or distribute this software for any
purpose with or without fee is hereby granted , provided that the above
copyright notice and this permission notice appear in all copies .
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL... | null | https://raw.githubusercontent.com/ocsigen/js_of_ocaml/1ecf83641b4ccfebaa7bf37bd1197a91d36ddc41/compiler/tests-jsoo/lib-effects/transaction.ml | ocaml |
Copyright ( c ) 2015 , < >
Permission to use , copy , modify , and/or distribute this software for any
purpose with or without fee is hereby granted , provided that the above
copyright notice and this permission notice appear in all copies .
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL... | |
19137135e8a826c0cdfc850d3f206ec16644510a48e527b20df18e056217dcc1 | korya/efuns | appMgr.ml | (***********************************************************************)
(* *)
(* Gwml *)
(* *)
Fabrice Le Fessa... | null | https://raw.githubusercontent.com/korya/efuns/78b21d9dff45b7eec764c63132c7a564f5367c30/gwml/appMgr.ml | ocaml | *********************************************************************
Gwml
... | Fabrice Le Fessant , projet Para / SOR , INRIA Rocquencourt
Copyright 1999 Institut National de Recherche en Informatique et
Automatique . Distributed only by permission .
open Options
open Xtypes
open Xlib
open Gwml
open Stdconfig
type app_manager = {
pred : cl... |
86810bae75af8421a351f3778fe50ac228e249d6894d8575d5657bc7962b3089 | REPROSEC/dolev-yao-star | Spec_P256_MontgomeryMultiplication_PointDouble.ml | open Prims
let (prime : Prims.pos) = Spec_P256_Definitions.prime256
| null | https://raw.githubusercontent.com/REPROSEC/dolev-yao-star/d97a8dd4d07f2322437f186e4db6a1f4d5ee9230/concrete/hacl-star-snapshot/ml/Spec_P256_MontgomeryMultiplication_PointDouble.ml | ocaml | open Prims
let (prime : Prims.pos) = Spec_P256_Definitions.prime256
| |
868ee1d906f2af1fb474f4abae439acaf69204be51303e35c1abd15438fc8c93 | lymar/hastache | conditionalNumber.hs | #!/usr/local/bin/runhaskell
import Text.Hastache
import Text.Hastache.Context
import qualified Data.Text.Lazy.IO as TL
-- begin example
main = mapM_ (\ctx ->
hastacheStr defaultConfig (encodeStr template) (mkStrContext ctx)
>>= TL.putStrLn) [context1,context2]
template = "{{#msg}}{{msg}}{{/msg}}{{^msg}}No{... | null | https://raw.githubusercontent.com/lymar/hastache/cd299ff1ac4c35259fbd333ea7fa9b3c280b9ff9/examples/conditionalNumber.hs | haskell | begin example | #!/usr/local/bin/runhaskell
import Text.Hastache
import Text.Hastache.Context
import qualified Data.Text.Lazy.IO as TL
main = mapM_ (\ctx ->
hastacheStr defaultConfig (encodeStr template) (mkStrContext ctx)
>>= TL.putStrLn) [context1,context2]
template = "{{#msg}}{{msg}}{{/msg}}{{^msg}}No{{/msg}} new messa... |
ab8d1e70cca172441d2bed6b7c432b17649ff2ce014127ba275884db2a017a12 | cadpnq/papyrith | instructions.lisp | ;;;; Define the instructions of the papyrus VM
(in-package :papyrith)
(defstruct instruction
op asm target name dest arg1 arg2 arg3
arg4 arg5 parameters)
(defmacro def-instruction (name asm &rest arguments)
`(defstruct (,name
(:include instruction
(op ',name)
(asm ',asm))
... | null | https://raw.githubusercontent.com/cadpnq/papyrith/755579f38a7f3f20d528966b4e548cc6e9bb006f/instructions.lisp | lisp | Define the instructions of the papyrus VM |
(in-package :papyrith)
(defstruct instruction
op asm target name dest arg1 arg2 arg3
arg4 arg5 parameters)
(defmacro def-instruction (name asm &rest arguments)
`(defstruct (,name
(:include instruction
(op ',name)
(asm ',asm))
(:constructor ,name ,arguments)
(:print-... |
fd0e7028c5226c05be99335a98e5ff0682db0372378aa34632e63d29d16412b3 | inaka/sumo_rest | sr_elements_SUITE.erl | -module(sr_elements_SUITE).
-include_lib("mixer/include/mixer.hrl").
-mixin([{ sr_test_utils
, [ init_per_suite/1
, end_per_suite/1
]
}]).
-export([ all/0
, init_per_testcase/2
, end_per_testcase/2
]).
-export([ success_scenario/1
, duplicated_key/1... | null | https://raw.githubusercontent.com/inaka/sumo_rest/19a3685ab477222738ac27b72e39346cbad9463d/test/sr_elements_SUITE.erl | erlang | -module(sr_elements_SUITE).
-include_lib("mixer/include/mixer.hrl").
-mixin([{ sr_test_utils
, [ init_per_suite/1
, end_per_suite/1
]
}]).
-export([ all/0
, init_per_testcase/2
, end_per_testcase/2
]).
-export([ success_scenario/1
, duplicated_key/1... | |
69581126e911bf08b4eabfa802871820109caabe20d8255b8a429ac7a544987a | kongo2002/statser | statser_util.erl | Copyright 2017 - 2018
%
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 Li... | null | https://raw.githubusercontent.com/kongo2002/statser/1cb0498f56c97d8a010b979c5163dd2750064e98/src/statser_util.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 2017 - 2018
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(statser_util).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
-include("statser.hrl").
-compile({no_auto_import, [floor/1]}... |
869d85d7afd4dfc582d1afbd8ac4cb64373d8180dee286efde645c331babb182 | circuithub/rel8 | ReadShow.hs | {-# language ScopedTypeVariables #-}
# language StandaloneKindSignatures #
# language TypeApplications #
# language ViewPatterns #
module Rel8.Type.ReadShow ( ReadShow(..) ) where
-- base
import Data.Kind ( Type )
import Data.Proxy ( Proxy( Proxy ) )
import Data.Typeable ( Typeable, typeRep )
import Prelude
import T... | null | https://raw.githubusercontent.com/circuithub/rel8/2a25126e214c1171c3d0c2d12d5a14ca831a266c/src/Rel8/Type/ReadShow.hs | haskell | # language ScopedTypeVariables #
base
rel8
text | # language StandaloneKindSignatures #
# language TypeApplications #
# language ViewPatterns #
module Rel8.Type.ReadShow ( ReadShow(..) ) where
import Data.Kind ( Type )
import Data.Proxy ( Proxy( Proxy ) )
import Data.Typeable ( Typeable, typeRep )
import Prelude
import Text.Read ( readMaybe )
import Rel8.Type ( DB... |
b7ef9eec415b97510a70193faf00e904c30274ae5052442af4bb684cffd6c27d | rems-project/cerberus | rt_ocaml.ml | Created by 2017 - 03 - 10
open Util
open Cerb_frontend
module M = Impl_mem
module C = Ctype
(* Undefined Behaviour *)
exception Undefined of string
exception Error of string
let (>>=) = M.bind
let return = M.return
(* Keep track of the last memory operation, for error display *)
type memop = Store | Load | Cre... | null | https://raw.githubusercontent.com/rems-project/cerberus/e0f817cebf331b1d9f741c1f82e129c93c99f33c/backend/ocaml/runtime/rt_ocaml.ml | ocaml | Undefined Behaviour
Keep track of the last memory operation, for error display
Runtime flags
stdout if in batch mode
TODO: digest is wrong
Helper Types
Non deterministic choice
IV wraps
Ail types
Loaded - Specified and unspecified values
Cast from memory values
Cast to memory values
M.array_mval... | Created by 2017 - 03 - 10
open Util
open Cerb_frontend
module M = Impl_mem
module C = Ctype
exception Undefined of string
exception Error of string
let (>>=) = M.bind
let return = M.return
type memop = Store | Load | Create | Alloc | None
let last_memop = ref None
let show_memop = function
| Store -> "store... |
432494523b4a71f807d56376fc944285b5706c8f8e05f21c66789ca799d1f6cf | hunt-framework/hunt | Hunt.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ExistentialQua... | null | https://raw.githubusercontent.com/hunt-framework/hunt/d692aae756b7bdfb4c99f5a3951aec12893649a8/hunt-searchengine/test/Hunt.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeSynonymInstances #
# LANGUAGE RankNTypes #
XXX refactor ranking tests to be conform with new ranking
++ rankingTests | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE ExistentialQuantification #
module Main where
import Hunt.AnalyzerTests
import Hunt.IndexTests
import Hunt.InterpreterTests
import Hunt.QueryParserTests
import Hunt . RankingTe... |
5bdc804143c21c36e56711da1c39453bc6fa27067b8d461474cf801015d36659 | Deltaphish/UwUpp | Spec.hs | main :: IO ()
main = putStrLn "Hahahahahahhahaaaahahaha"
| null | https://raw.githubusercontent.com/Deltaphish/UwUpp/4b993e7bd989e31dafd5e12cf3e9e53cc4f9882a/test/Spec.hs | haskell | main :: IO ()
main = putStrLn "Hahahahahahhahaaaahahaha"
| |
5240f0af2de13be7b9c2197a4bd0a6554395b233423d74e8a6d8b93d05e79699 | processone/ejabberd | mod_carboncopy.erl | %%%----------------------------------------------------------------------
%%% File : mod_carboncopy.erl
Author : < >
Purpose : Message Carbons XEP-0280 0.8
Created : 5 May 2008 by < >
%%% Usage : Add the following line in modules section of ejabberd.yml:
%%% {mod_carboncopy, []}
%%%
%%%
... | null | https://raw.githubusercontent.com/processone/ejabberd/c103182bc7e5b8a8ab123ce02d1959a54e939480/src/mod_carboncopy.erl | erlang | ----------------------------------------------------------------------
File : mod_carboncopy.erl
Usage : Add the following line in modules section of ejabberd.yml:
{mod_carboncopy, []}
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.... | Author : < >
Purpose : Message Carbons XEP-0280 0.8
Created : 5 May 2008 by < >
ejabberd , Copyright ( C ) 2002 - 2023 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of... |
772a9e296d3af3bac924c9f1e1a74e287ca7d0d95195b3afb7fc08a800d903e2 | Risto-Stevcev/bastet | Test_JsPromise.ml | open BsMocha.Mocha
open BsJsverify.Verify.Arbitrary
open BsJsverify.Verify.Property
let ( <. ) =
let open Function.Infix in
( <. )
(** Note: Promises are not actually Monads because you can't have
Js.Promise.t(Js.Promise.t('a))
Even though it's a valid bucklescript signature *)
module ComparePromise = st... | null | https://raw.githubusercontent.com/Risto-Stevcev/bastet/030db286f57d2e316897f0600d40b34777eabba6/bastet_js/test/Test_JsPromise.ml | ocaml | * Note: Promises are not actually Monads because you can't have
Js.Promise.t(Js.Promise.t('a))
Even though it's a valid bucklescript signature | open BsMocha.Mocha
open BsJsverify.Verify.Arbitrary
open BsJsverify.Verify.Property
let ( <. ) =
let open Function.Infix in
( <. )
module ComparePromise = struct
type 'a t = 'a Js.Promise.t
let eq a b =
Js.Promise.then_ (fun a' -> Js.Promise.then_ (fun b' -> Js.Promise.resolve (a' = b')) b) a
|> Obj... |
90b074e16a7d5e7ad0592ac09abae81d073419004a48ed1a8b0ddf5765d144a0 | zed-throben/erlangeos | io_inheritance.erl | - module('io_inheritance').
- compile(export_all).
start() ->
Dog = eos:new(eos@obj,[],[{barkPhrase , "woof!" },{bark , fun (This,Arguments) ->
io:format(eosstd:fmt("~s\n",[eosstd:to_str(eos:get_slot(This,barkPhrase))])) end }]),
Chiwawa = eos:invoke(Dog,clone,[]),
eos:set_slot(Chiwawa,barkPhrase ... | null | https://raw.githubusercontent.com/zed-throben/erlangeos/44e50e442f5d396c69ae90db530b0b60b01d692a/sample/io_inheritance.erl | erlang | - module('io_inheritance').
- compile(export_all).
start() ->
Dog = eos:new(eos@obj,[],[{barkPhrase , "woof!" },{bark , fun (This,Arguments) ->
io:format(eosstd:fmt("~s\n",[eosstd:to_str(eos:get_slot(This,barkPhrase))])) end }]),
Chiwawa = eos:invoke(Dog,clone,[]),
eos:set_slot(Chiwawa,barkPhrase ... | |
6c07139671a9b2f5aa49eb18acb83ba7d95e5bc0fdd022ba6ce99032d4476cac | DaMSL/K3 | Common.hs | # LANGUAGE TupleSections #
# LANGUAGE ViewPatterns #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
-- Common utilities in writing program transformations.
module Language.K3.Transform.Common where
import Control.Monad.Identity
import Control.Monad.State
import Data.Hashable
import Data.Tree
import Languag... | null | https://raw.githubusercontent.com/DaMSL/K3/51749157844e76ae79dba619116fc5ad9d685643/src/Language/K3/Transform/Common.hs | haskell | Common utilities in writing program transformations.
Configuration for many transformations at once
| Returns whether all occurrences of a binding can be substituted in a target expression.
| Substitute all occurrences of a variable with an expression in the specified target expression.
Renumber the uuids in a pro... | # LANGUAGE TupleSections #
# LANGUAGE ViewPatterns #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
module Language.K3.Transform.Common where
import Control.Monad.Identity
import Control.Monad.State
import Data.Hashable
import Data.Tree
import Language.K3.Core.Annotation
import Language.K3.Core.Common
impo... |
2a352f4f1515fd0a3121bf9e426cacb77711f32e3955cc5bb6b8ddbc993e86b1 | hhucn/decide3 | pathom.clj | (ns decide.server-components.pathom
(:require
[clojure.spec.alpha :as s]
[clojure.string :as str]
[com.fulcrologic.rad.pathom :as rad-pathom]
[com.wsscode.pathom.connect :as pc]
[com.wsscode.pathom.core :as p]
[datahike.api :as d]
[decide.models.argumentation.api :as argumentation.api]
[decide... | null | https://raw.githubusercontent.com/hhucn/decide3/71834033c4e61da9d7b70953ca537dafd1576162/src/main/decide/server_components/pathom.clj | clojure | this is necessary for now, because the index contains functions which can not be serialized by transit.
to minimize clutter in the Index Explorer
TODO Errors are data too!
This is borrowed from com.fulcrologic.rad.pathom
TODO: Do we need this, and if so, we need to pass the attribute map | (ns decide.server-components.pathom
(:require
[clojure.spec.alpha :as s]
[clojure.string :as str]
[com.fulcrologic.rad.pathom :as rad-pathom]
[com.wsscode.pathom.connect :as pc]
[com.wsscode.pathom.core :as p]
[datahike.api :as d]
[decide.models.argumentation.api :as argumentation.api]
[decide... |
a45df4ceea943681a26cd8be3fdc4a413e0a34b90cf192cb53217e2c71a19e65 | UU-ComputerScience/js-asteroids | jquery.hs |
import Language.UHC.JS.Assorted
import Language.UHC.JS.ECMA.String
import Language.UHC.JS.Primitives
import Language.UHC.JS.Types
import Language.UHC.JS.JQuery.JQuery
main :: IO ()
main = return ()
-- Main function
foreign export jscript "jQueryMain"
jQueryMain :: IO ()
jQueryMain :: IO ()
jQueryMain = do
sho... | null | https://raw.githubusercontent.com/UU-ComputerScience/js-asteroids/b7015d8ad4aa57ff30f2631e0945462f6e1ef47a/uhc-js/tests/in-progress/jquery/jquery.hs | haskell | Main function
Show an alert
Set the contents for to the body element.
Add a (hidden) paragraph to the body element.
Show the previously added paragraph using an animation. |
import Language.UHC.JS.Assorted
import Language.UHC.JS.ECMA.String
import Language.UHC.JS.Primitives
import Language.UHC.JS.Types
import Language.UHC.JS.JQuery.JQuery
main :: IO ()
main = return ()
foreign export jscript "jQueryMain"
jQueryMain :: IO ()
jQueryMain :: IO ()
jQueryMain = do
showAlert
sayHi
... |
a8aa7a3575b7182bb441cefaa6afa6492271299b06e009b74871cedf16c504d3 | emqx/hocon | demo_schema3.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2021 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/hocon/10fefe7e0ddf3f01d45d2d631562afe614ca357f/sample-schemas/demo_schema3.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2021 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(demo_schema3).
-include_lib("typerefl/include/types.hrl").
-behaviour(hocon_schema).
-e... |
b5082a71e262f9a3e8ad8511f80c70ec8d65ca0b713e384f497b0a1f72a64692 | herd/herdtools7 | outUtils.ml | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/6d781eb91debffdf56998171862a18e40908c3c5/litmus/outUtils.ml | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2014 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
d964a85f3b57739d63dba3a2148a1906c02747712b37c0b8b85e5edbd34cf296 | onedata/op-worker | qos_downtree_status.erl | %%%-------------------------------------------------------------------
@author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
Module responsible for managing QoS ... | null | https://raw.githubusercontent.com/onedata/op-worker/4a305af02da4b510c4f5c41502d7500469762c4e/src/modules/qos/qos_status/qos_downtree_status.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
For more details consult `qos_status` module doc.
@end
-------------------------------------------------------------------
API
==========================================... | @author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
Module responsible for managing QoS status downtree ( top - down ) .
-module(qos_downtree_status).
-author("Michal Stanisz").
-include("modules/datastore/qos.hrl").
-include("modules/datastore/da... |
4936c0dcac09770544ded968c8c6ed89c9bf48bed15bf36391d0807486a7b33e | tschady/advent-of-code | d07.clj | (ns aoc.2020.d07
(:require [aoc.file-util :as file-util]
[loom.derived :refer [subgraph-reachable-from]]
[loom.graph :as loom :refer [successors weight transpose nodes]]))
(def input (file-util/read-lines "2020/d07.txt"))
(defn parse-rule [s]
(when (not (re-find #"no other" s))
(let [[... | null | https://raw.githubusercontent.com/tschady/advent-of-code/9cd0cbbbbeadd083b9030f21e49ca1ac26aee53a/src/aoc/2020/d07.clj | clojure | (ns aoc.2020.d07
(:require [aoc.file-util :as file-util]
[loom.derived :refer [subgraph-reachable-from]]
[loom.graph :as loom :refer [successors weight transpose nodes]]))
(def input (file-util/read-lines "2020/d07.txt"))
(defn parse-rule [s]
(when (not (re-find #"no other" s))
(let [[... | |
1ae14b89acd4acdd017a23f8cb6be76e2dd7bfaf164c7fc03f4efa32fef88bd4 | funcool/buddy-sign | jwe_tests.clj | Copyright 2014 - 2016 < >
;;
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 un... | null | https://raw.githubusercontent.com/funcool/buddy-sign/c1c7ffcd4b49d3604916736d15f03893e15e5814/test/buddy/sign/jwe_tests.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 perm... | Copyright 2014 - 2016 < >
Licensed under the Apache License , Version 2.0 ( the " License " )
distributed under the License is distributed on an " AS IS " BASIS ,
(ns buddy.sign.jwe-tests
(:require [clojure.test :refer :all]
[clojure.test.check.clojure-test :refer (defspec)]
[clojure... |
4d508923c88547c4295ce2549165539f114c13ce984e1981e72a4df07418ce7d | argp/bap | batSys.ml |
* BatSys - additional and modified functions for System
* Copyright ( C ) 1996 Copyright ( C ) 2009 , LIFO , Universite d'Orleans
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Sof... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/batteries/src/batSys.ml | ocaml |
* BatSys - additional and modified functions for System
* Copyright ( C ) 1996 Copyright ( C ) 2009 , LIFO , Universite d'Orleans
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public
* License as published by the Free Sof... | |
ba97b835bbc16929d640c91f6b79384a727bf426fae9df2af63fbcc4055214e0 | reborg/clojure-essential-reference | 12.clj | (def m {:a [0 1 2 {:d 4 :e [0 1 2]}]})
< 1 >
(into (subvec v 0 idx)
(subvec v (inc idx) (count v))))
(defn dissoc-in [m [k & ks]]
(if ks
(assoc m k (dissoc-in (get m k) ks))
(cond
(map? m) (dissoc m k)
(vector? m) (remove-at m k)
< 2 >
(dissoc-in m [:a 3 :e 0]) ;<3>
{ : a [ 0 1 ... | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/Maps/Processing/assoc%2Cassoc-inanddissoc/12.clj | clojure | <3> | (def m {:a [0 1 2 {:d 4 :e [0 1 2]}]})
< 1 >
(into (subvec v 0 idx)
(subvec v (inc idx) (count v))))
(defn dissoc-in [m [k & ks]]
(if ks
(assoc m k (dissoc-in (get m k) ks))
(cond
(map? m) (dissoc m k)
(vector? m) (remove-at m k)
< 2 >
{ : a [ 0 1 2 { : d 4 , : e [ 1 2 ] } ] } |
b26dfee2a7e1201a68f7509de632c7507ccc03ff5817ba7b6ad1c3c1b079197b | superbobry/pareto | test.ml | open OUnit
let all () = TestList [
Tests_test.test;
Sample_test.test;
Distributions_test.test
]
| null | https://raw.githubusercontent.com/superbobry/pareto/8b3b27bce7b7df5d9713d16ed40a844861aa368e/lib_test/test.ml | ocaml | open OUnit
let all () = TestList [
Tests_test.test;
Sample_test.test;
Distributions_test.test
]
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.