_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 |
|---|---|---|---|---|---|---|---|---|
493299b722921f6b4acdca1a2a2eaaa8bf984e28802cb87580133ba4f35a7aa7 | blindglobe/clocc | section17.lisp | section 17 : sequences -*- mode : lisp -*-
(in-package :cl-user)
(proclaim '(special log))
17.2.1.1
(check-for-bug :section17-legacy-8
(remove "FOO" '(foo bar "FOO" "BAR" "foo" "bar") :test #'equal)
(foo bar "BAR" "foo" "bar"))
(check-for-bug :section17-legacy-12
(remove "FOO" '(foo bar "FOO" "BAR" "foo" ... | null | https://raw.githubusercontent.com/blindglobe/clocc/a50bb75edb01039b282cf320e4505122a59c59a7/src/tools/ansi-test/section17.lisp | lisp | 17.2.2.1
copy-seq
elt
fill
make-sequence
map
map-into
reduce
count
length
reverse
sort
Note that individual alphabetical order within `committees'
is preserved.
find
position
search
mismatch
replace
substitute
concatenate
merge
remove
((C))) or ...
T or ...
remove-duplicates | section 17 : sequences -*- mode : lisp -*-
(in-package :cl-user)
(proclaim '(special log))
17.2.1.1
(check-for-bug :section17-legacy-8
(remove "FOO" '(foo bar "FOO" "BAR" "foo" "bar") :test #'equal)
(foo bar "BAR" "foo" "bar"))
(check-for-bug :section17-legacy-12
(remove "FOO" '(foo bar "FOO" "BAR" "foo" ... |
beae0b045fd73a1d25dddb149fa07bc0b4170b4ff92607b464d5ace27533138e | exoscale/coax | inspect.cljc | (ns exoscale.coax.inspect
(:require [clojure.spec.alpha :as s]))
(defn- accept-keyword [x]
(when (qualified-keyword? x)
x))
(defn- accept-symbol [x]
(when (qualified-symbol? x)
x))
(defn- accept-set [x]
(when (set? x)
x))
(defn- accept-symbol-call [spec]
(when (and (seq? spec)
(sy... | null | https://raw.githubusercontent.com/exoscale/coax/c2c127f58bbdac4e035fefea8768d8b4723a3fd4/src/exoscale/coax/inspect.cljc | clojure | (ns exoscale.coax.inspect
(:require [clojure.spec.alpha :as s]))
(defn- accept-keyword [x]
(when (qualified-keyword? x)
x))
(defn- accept-symbol [x]
(when (qualified-symbol? x)
x))
(defn- accept-set [x]
(when (set? x)
x))
(defn- accept-symbol-call [spec]
(when (and (seq? spec)
(sy... | |
5eb9618ebd94cf3f1219179b3419040f0f5c240454e6ede7d020cb6ff7ffd760 | stevejenkins/UBNT-EdgeRouter-Example-Configs | config.boot.erl | /* EdgeRouter Lite + Comcast IPv4/IPv6 Dual Stack Config - -EdgeRouter-Example-Configs */
firewall {
all-ping enable
broadcast-ping disable
ipv6-name WANv6_IN {
default-action drop
description "WANv6 inbound traffic forwarded to LAN"
rule 10 {
action accept
de... | null | https://raw.githubusercontent.com/stevejenkins/UBNT-EdgeRouter-Example-Configs/2eb96e7e618db69ff0481833f57044ac3060d99a/Comcast/config.boot.erl | erlang | /* EdgeRouter Lite + Comcast IPv4/IPv6 Dual Stack Config - -EdgeRouter-Example-Configs */
firewall {
all-ping enable
broadcast-ping disable
ipv6-name WANv6_IN {
default-action drop
description "WANv6 inbound traffic forwarded to LAN"
rule 10 {
action accept
de... | |
95050b1ff2f55d5e5b838165df885f9882eb73280a6c1a53b440bd2abb8bf9f2 | codinuum/volt | custom.ml | let () =
Bolt.Filter.register
"myfilter"
(fun e -> (e.Bolt.Event.line mod 2) = 0)
let () =
Bolt.Layout.register
"mylayout"
([],
[],
(fun e ->
Printf.sprintf "file \"%s\" says \"%s\" with level \"%s\" (line: %d)"
e.Bolt.Event.file
e.Bolt.Event.message
(Bol... | null | https://raw.githubusercontent.com/codinuum/volt/546207693ef102a2f02c85af935f64a8f16882e6/tests/03-customize/custom.ml | ocaml | let () =
Bolt.Filter.register
"myfilter"
(fun e -> (e.Bolt.Event.line mod 2) = 0)
let () =
Bolt.Layout.register
"mylayout"
([],
[],
(fun e ->
Printf.sprintf "file \"%s\" says \"%s\" with level \"%s\" (line: %d)"
e.Bolt.Event.file
e.Bolt.Event.message
(Bol... | |
10fa08821d1ce244e55f8b562758a120ddfa4b1cad10add2a9f48fb09559e9d5 | footprintanalytics/footprint-web | add_dimension_projections_test.clj | (ns metabase.query-processor.middleware.add-dimension-projections-test
(:require [clojure.test :refer :all]
[metabase.models.dimension :refer [Dimension]]
[metabase.models.field :refer [Field]]
[metabase.query-processor.context.default :as context.default]
[metabase.que... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/test/metabase/query_processor/middleware/add_dimension_projections_test.clj | clojure | ----------------------------------------- add-fk-remaps (pre-processing) -----------------------------------------
make sure that we don't add duplicate columns even if the column has some weird unexpected options, i.e. we
need to do 'normalized' Field comparison for preventing duplicates.
-------------------------... | (ns metabase.query-processor.middleware.add-dimension-projections-test
(:require [clojure.test :refer :all]
[metabase.models.dimension :refer [Dimension]]
[metabase.models.field :refer [Field]]
[metabase.query-processor.context.default :as context.default]
[metabase.que... |
3e41921c15e3c3616c768fcc4a3b9c028aa4f230a2cca0b85fcb2b582d7578f3 | alexandroid000/improv | BinaryIter.hs | -- |Binary iteratee-style serialization helpers for working with ROS
-- message types. This module is used by the automatically-generated
-- code for ROS .msg types.
module Ros.Node.BinaryIter (streamIn, getServiceResult) where
import Control.Applicative
import Control.Concurrent (myThreadId, killThread)
import Control... | null | https://raw.githubusercontent.com/alexandroid000/improv/ef0f4a6a5f99a9c7ff3d25f50529417aba9f757c/roshask/src/Ros/Node/BinaryIter.hs | haskell | |Binary iteratee-style serialization helpers for working with ROS
message types. This module is used by the automatically-generated
code for ROS .msg types.
Get the specified number of bytes from a 'Handle'. Returns a
wrapped-up 'Nothing' if the client shutdown (indicated by receiving
|The function that does the ... | module Ros.Node.BinaryIter (streamIn, getServiceResult) where
import Control.Applicative
import Control.Concurrent (myThreadId, killThread)
import Control.Monad.IO.Class
import Control.Monad.Trans.Maybe
import Data.Binary.Get
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as BL
import Syst... |
53eae0860be66a7a86005d49ac1649c3585dfa805175418313b71f680daace1d | luminus-framework/luminus-template | core.cljs | (ns <<project-ns>>.core)
(defn<% if shadow-cljs %> ^:dev/after-load<% endif %> mount-components []
(let [content (js/document.getElementById "app")]
(while (.hasChildNodes content)
(.removeChild content (.-lastChild content)))
(.appendChild content (js/document.createTextNode "Welcome to <<name>>"))))
... | null | https://raw.githubusercontent.com/luminus-framework/luminus-template/3278aa727cef0a173ed3ca722dfd6afa6b4bbc8f/resources/leiningen/new/luminus/cljs/src/cljs/core.cljs | clojure | (ns <<project-ns>>.core)
(defn<% if shadow-cljs %> ^:dev/after-load<% endif %> mount-components []
(let [content (js/document.getElementById "app")]
(while (.hasChildNodes content)
(.removeChild content (.-lastChild content)))
(.appendChild content (js/document.createTextNode "Welcome to <<name>>"))))
... | |
547c7d7fd2f77d1af831f3a6de5321a0b1083e91e93432a8f4397f9ffb92b3e5 | INRIA/zelus | printer.ml | (***********************************************************************)
(* *)
(* *)
(* Zelus, a synchronous language for hybrid systems *)
(* ... | null | https://raw.githubusercontent.com/INRIA/zelus/685428574b0f9100ad5a41bbaa416cd7a2506d5e/compiler/global/printer.ml | ocaml | *********************************************************************
Zelus, a synchronous language for hybrid systems
... | ( c ) 2020 Paris ( see the file )
Automatique . All rights reserved . This file is distributed under
the terms of the INRIA Non - Commercial License Agreement ( see the
open Zlocation
open Zmisc
open Zelus
open Deftypes
open Ptypes
open Global
open Modules
open Pp_tools
open F... |
49447014099d322dee449e75415feeaf98e1ee0755d7d3d532ba98990515cd51 | Gadjib/ocamlhomeworks | p2.ml | let string_n n =
let s = ref "" in
begin
for i = 1 to n do
s:=!s^"*";
done;
!s;
end
;;
let main n =
let s = ref "" in
begin
for i = 1 to n do
s:=!s^(string_n n)^"\n";
done;
!s;
end;
;;
print_string (main (read_int()));; ... | null | https://raw.githubusercontent.com/Gadjib/ocamlhomeworks/d5568d4830d4306ea56749f17af355bc35001eff/8%20%D0%BA%D0%BB%D0%B0%D1%81%D1%81/2019.04.03/p2.ml | ocaml | let string_n n =
let s = ref "" in
begin
for i = 1 to n do
s:=!s^"*";
done;
!s;
end
;;
let main n =
let s = ref "" in
begin
for i = 1 to n do
s:=!s^(string_n n)^"\n";
done;
!s;
end;
;;
print_string (main (read_int()));; ... | |
313f5915d0c6528b60c3cec49d6794dae7fc8aa8c09c514deaef9070343ee20f | semerdzhiev/fp-2020-21 | 04-filter.rkt | #lang racket
(require rackunit)
(require rackunit/text-ui)
; filter
; приема едноместен предикат и списък
връща списък само с елементите на оригиналния , които изпълняват условието
(define (filter p? ys)
(void)
)
(define tests
(test-suite "filter"
(check-equal? (filter even? '(1 2 3)) '(2))
(check-equ... | null | https://raw.githubusercontent.com/semerdzhiev/fp-2020-21/64fa00c4f940f75a28cc5980275b124ca21244bc/group-b/exercises/05.more-lists/04-filter.rkt | racket | filter
приема едноместен предикат и списък | #lang racket
(require rackunit)
(require rackunit/text-ui)
връща списък само с елементите на оригиналния , които изпълняват условието
(define (filter p? ys)
(void)
)
(define tests
(test-suite "filter"
(check-equal? (filter even? '(1 2 3)) '(2))
(check-equal? (filter (lambda (x) (> x 200)) '(1 2 3)) '... |
1fb0d27bfcfcd344423407615fd21aa1c1be29ecad5a93f071dd820a398bbf18 | locusmath/locus | func.clj | (ns locus.set.mapping.function.indexing.func
(:require [locus.set.logic.core.set :refer :all]
[locus.set.logic.numeric.nms :refer :all]
[locus.set.logic.structure.protocols :refer :all]
[locus.set.mapping.general.core.object :refer :all]
[locus.set.logic.limit.product :... | null | https://raw.githubusercontent.com/locusmath/locus/fb6068bd78977b51fd3c5783545a5f9986e4235c/src/clojure/locus/set/mapping/function/indexing/func.clj | clojure | An indexing function is essentially just a presentation of an ordinary
sequence like (a,b,c) as a function from a subset of the natural numbers
to the value at the index in the list. This allows for lists and sequences
to be treated like objects in the topos of functions, for example, when
constructing subobject a... | (ns locus.set.mapping.function.indexing.func
(:require [locus.set.logic.core.set :refer :all]
[locus.set.logic.numeric.nms :refer :all]
[locus.set.logic.structure.protocols :refer :all]
[locus.set.mapping.general.core.object :refer :all]
[locus.set.logic.limit.product :... |
5ffb1d3ffe242f3a662d281f5d840c8c50b55e9302bba7cc96aac44b9b212580 | AndrasKovacs/ELTE-func-lang | Notes12.hs |
# LANGUAGE InstanceSigs , DeriveFunctor , ,
DeriveTraversable #
DeriveTraversable #-}
import Data.Foldable
import Data.Traversable
import Control.Monad
import Control.Applicative -- many, some
isDigit : : Bool
digitToInt : : Int
import Debug.Trace -- trace :: String -> a -> a
... | null | https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/41fc0127a81733007a54024d51f94d2964db3288/2021-22-1/gyak_1/Notes12.hs | haskell | many, some
trace :: String -> a -> a
traceShow :: Show b => b -> a -> a
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Canvas feladat
egyiket definiáld
----------------------------------------------------... |
# LANGUAGE InstanceSigs , DeriveFunctor , ,
DeriveTraversable #
DeriveTraversable #-}
import Data.Foldable
import Data.Traversable
import Control.Monad
isDigit : : Bool
digitToInt : : Int
import Control.Monad.State
Következő canvas feladat : ismétlő kisfeladat
data List a = Nil | Cons1 ... |
7ce9cf11b52f600385fd4fa430dfc301202974886e6e1fbfe0f9f8b1c35d4398 | csabahruska/jhc-components | Type.hs | module FrontEnd.Tc.Type(
Kind(..),
KBase(..),
MetaVar(..),
MetaVarType(..),
Pred(..),
Preds(),
Qual(..),
Tycon(..),
Type(..),
Tyvar(..),
kindStar,
kindFunRet,
kindUTuple,
unfoldKind,
fn,
fromTAp,
fromTArrow,
module FrontEnd.Tc.Type,
prettyPrint... | null | https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/jhc-frontend/src/FrontEnd/Tc/Type.hs | haskell | XXX name capture!
# SPECIALIZE flattenType :: MonadIO m => Type -> m Type #
| Apply the function if the 'Bool' is 'True'.
f [] [] = CTId | module FrontEnd.Tc.Type(
Kind(..),
KBase(..),
MetaVar(..),
MetaVarType(..),
Pred(..),
Preds(),
Qual(..),
Tycon(..),
Type(..),
Tyvar(..),
kindStar,
kindFunRet,
kindUTuple,
unfoldKind,
fn,
fromTAp,
fromTArrow,
module FrontEnd.Tc.Type,
prettyPrint... |
c04adcc1490f5ea1417202f8854bf116a28a01f95f865c82870f3dccfd3160ce | GaloisInc/semmc | Extract.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
# LANGUAGE PolyKinds #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module SemMC.Stochastic.Extract (
extractFormula
) where
import qualified GHC.Err.Located as L
import Control.Monad.Trans ( liftIO )
impo... | null | https://raw.githubusercontent.com/GaloisInc/semmc/3d9bc90f92a7f7ef59ff4943369dea9c0eb4b3ae/semmc-learning/src/SemMC/Stochastic/Extract.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes #
'F.ParameterizedFormula' that has holes for the given 'Opcode'.
| Take a pass through the formula to rename variables standing in for
parameters into friendlier names.
The names we get out of 'parameterizeFormula' are named after the concrete
locations that were used in ... | # LANGUAGE FlexibleContexts #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module SemMC.Stochastic.Extract (
extractFormula
) where
import qualified GHC.Err.Located as L
import Control.Monad.Trans ( liftIO )
import qualified Data.Foldable as F
import Da... |
85c921b05046dfa6c00e0a03f182522cb9795ef7e7daed89f94a7e160c645163 | rescript-lang/rescript-compiler | ext_color.mli | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* 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 , either version 3 of the License , or
* ( at your option ) any later... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/3a6999082bb842e7d00b99f1e70b39b595b35ba9/jscomp/ext/ext_color.mli | ocaml | * Input is the tag for example `@{<warning>@}` return escape code | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* 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 , either version 3 of the License , or
* ( at your option ) any later... |
56db45766cdf4f9fb447950f10c12a53a6c99dc0259cecf5fc78fdf7aead31ed | ekmett/machines | Is.hs | # LANGUAGE GADTs , TypeFamilies , TypeOperators #
-----------------------------------------------------------------------------
-- |
-- Module : Data.Machine.Is
Copyright : ( C ) 2012
-- License : BSD-style (see the file LICENSE)
--
Maintainer : < >
-- Stability : provisional
Portabili... | null | https://raw.githubusercontent.com/ekmett/machines/58e39c953e7961e22765898d29ce1981f8147804/src/Data/Machine/Is.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.Machine.Is
License : BSD-style (see the file LICENSE)
Stability : provisional
--------------------------------------------------------------------------
| Witnessed type equality
# INLINE (<>) #
# INLINE id ... | # LANGUAGE GADTs , TypeFamilies , TypeOperators #
Copyright : ( C ) 2012
Maintainer : < >
Portability : GADTs , Type Families
module Data.Machine.Is
( Is(..)
) where
import Control.Category
import Data.Semigroup
import Prelude
data Is a b where
Refl :: Is a a
instance Show (Is a b) where
... |
c7a4aaba521a426f3a7525abc7e551612b7d80bf8c4bf8240de2a519283dc16a | haskell/deepseq | DeepSeq.hs | # LANGUAGE CPP #
# LANGUAGE DefaultSignatures #
# LANGUAGE EmptyCase #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PolyKinds #
# LANGUAGE QuantifiedConstraints #
{-# LANGUAGE Safe #-}
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
#if __GLASGOW_HASKE... | null | https://raw.githubusercontent.com/haskell/deepseq/be30621bdc318c58b5438603f3ddad160f5339b6/Control/DeepSeq.hs | haskell | # LANGUAGE Safe #
---------------------------------------------------------------------------
|
License : BSD-style (see the file LICENSE)
Maintainer :
Stability : stable
Portability : portable
This module provides overloaded functions, such as 'deepseq' and
'rnf', for fully evaluating data structu... | # LANGUAGE CPP #
# LANGUAGE DefaultSignatures #
# LANGUAGE EmptyCase #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE PolyKinds #
# LANGUAGE QuantifiedConstraints #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
#if __GLASGOW_HASKELL__ >= 811 && __GLASG... |
600e803aa74a78a10fa40e8b54acebf1cb82f6dcee8ed69a3f58d443e5d8544f | BranchTaken/Hemlock | test_hd.ml | open! Basis.Rudiments
open! Basis
open Q
let test () =
let rec fn i n t = begin
match i <= n with
| false -> ()
| true -> begin
let elm = hd t in
File.Fmt.stdout
|> Fmt.fmt "hd "
|> (pp Uns.pp) t
|> Fmt.fmt " = "
|> Uns.pp elm
|> Fmt.fmt "\n"
... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/f3604ceda4f75cf18b6ee2b1c2f3c5759ad495a5/bootstrap/test/basis/q/test_hd.ml | ocaml | halts if we start with empty | open! Basis.Rudiments
open! Basis
open Q
let test () =
let rec fn i n t = begin
match i <= n with
| false -> ()
| true -> begin
let elm = hd t in
File.Fmt.stdout
|> Fmt.fmt "hd "
|> (pp Uns.pp) t
|> Fmt.fmt " = "
|> Uns.pp elm
|> Fmt.fmt "\n"
... |
e30fbda146978dcde1be417444c34027f384c3e0e6e0d1884a8d616fed23693b | braidchat/braid | core.cljc | (ns braid.embeds-website.core
"If a message contains a link, displays a generic website embed"
(:require
[braid.base.api :as base]
[braid.embeds.api :as embeds]
#?@(:cljs
[[braid.embeds-website.styles :as styles]
[braid.embeds-website.views :as views]]
:clj
[[braid.embeds-websi... | null | https://raw.githubusercontent.com/braidchat/braid/2e44eb6e77f1d203115f9b9c529bd865fa3d7302/src/braid/embeds_website/core.cljc | clojure | (ns braid.embeds-website.core
"If a message contains a link, displays a generic website embed"
(:require
[braid.base.api :as base]
[braid.embeds.api :as embeds]
#?@(:cljs
[[braid.embeds-website.styles :as styles]
[braid.embeds-website.views :as views]]
:clj
[[braid.embeds-websi... | |
e78eb08bcad9463fe5a469223c10f6f152049d6f2a1c303c66676a183e1dd6d1 | mbenke/zpf2013 | sudoku-par2.hs | import Sudoku
import Control.Exception
import System.Environment
import Data.Maybe
import Control.Monad.Par
main :: IO ()
main = do
[f] <- getArgs
grids <- fmap lines $ readFile f
let (as,bs) = splitAt (length grids `div` 2) grids
print $ length $ filter isJust $ runPar $ do
i1 <- new
i... | null | https://raw.githubusercontent.com/mbenke/zpf2013/85f32747e17f07a74e1c3cb064b1d6acaca3f2f0/Code/Par/Marlow/sudoku-par2.hs | haskell | import Sudoku
import Control.Exception
import System.Environment
import Data.Maybe
import Control.Monad.Par
main :: IO ()
main = do
[f] <- getArgs
grids <- fmap lines $ readFile f
let (as,bs) = splitAt (length grids `div` 2) grids
print $ length $ filter isJust $ runPar $ do
i1 <- new
i... | |
b99f228fb3fa4ebd89d8997aa657d499a7ea1c46b5dd9644bfcbb52f70b79ef0 | holyjak/fulcro-billing-app | charge.cljc | (ns billing-app.model.billing.invoice.charge
"A single invoice line - an employee X is charged some amount for a particular service"
(:refer-clojure :exclude [name])
(:require
#?@(:clj
[[com.wsscode.pathom.connect :as pc :refer [defmutation]]
[billing-app.components.billing-data :as billing-d... | null | https://raw.githubusercontent.com/holyjak/fulcro-billing-app/568bf28552989e1e611773b2d946c9990e1edc3d/src/shared/billing_app/model/billing/invoice/charge.cljc | clojure | Extra props: | (ns billing-app.model.billing.invoice.charge
"A single invoice line - an employee X is charged some amount for a particular service"
(:refer-clojure :exclude [name])
(:require
#?@(:clj
[[com.wsscode.pathom.connect :as pc :refer [defmutation]]
[billing-app.components.billing-data :as billing-d... |
d9dad567710e915d2da4e60074dbe650ab0c38f02d5f5e90f70cea0dd3bb8431 | practicalli/clojure-through-code | composing_functions.clj | (ns clojure-through-code.composing-functions)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; map over collections with partial
;; We can map over a collection of words and increment them by writing an anonymous function.
(map (fn [animal] (str animal "s")) ["pig" "cow" "goat" "cat" "dog" "rabbit"])
;; or using the s... | null | https://raw.githubusercontent.com/practicalli/clojure-through-code/82834cdab6b5315aea630386c851200f98d5e48f/src/clojure_through_code/composing_functions.clj | clojure |
map over collections with partial
We can map over a collection of words and increment them by writing an anonymous function.
or using the syntactic sugar form of an anonymous function we get
by default map returns a list/sequence. We can specify a vector be returned instead using `mapv'
what about sheep, where th... | (ns clojure-through-code.composing-functions)
(map (fn [animal] (str animal "s")) ["pig" "cow" "goat" "cat" "dog" "rabbit"])
(map #(str % "s") ["pig" "cow" "goat" "cat" "dog" "rabbit"])
(mapv #(str % "s") ["pig" "cow" "goat" "cat" "dog" "rabbit"])
(defn pluralise
"Pluralise a given string value"
[animal]... |
cce3629c444c35434226d36fd60aa016f521be5afc4ebe55acd2bfdbc541d647 | acieroid/scala-am | treiber-stack.scm | ; Treiber stack as an example of a lock-free data structure using atoms.
(define (new-stack)
(atom '()))
(define (push stk el)
(let loop ((top (read stk)))
(if (not (compare-and-set! stk top (cons el top)))
(loop (read stk)))))
(define (pop stk)
(let loop ((top (read stk)))
(cond ((null? top) #f)
(... | null | https://raw.githubusercontent.com/acieroid/scala-am/13ef3befbfc664b77f31f56847c30d60f4ee7dfe/test/concurrentScheme/futures/treiber-stack.scm | scheme | Treiber stack as an example of a lock-free data structure using atoms. |
(define (new-stack)
(atom '()))
(define (push stk el)
(let loop ((top (read stk)))
(if (not (compare-and-set! stk top (cons el top)))
(loop (read stk)))))
(define (pop stk)
(let loop ((top (read stk)))
(cond ((null? top) #f)
((compare-and-set! stk top (cdr top)) (car top))
(else (loop (rea... |
47c888d5511cb4bb3a781016d2fa6aa25f06fb858356118c0d36addabe8c0421 | channable/alfred-margaret | Main.hs | module Main where
import Test.Hspec (describe, hspec)
import Data.Text.AhoCorasickSpec as AhoCorasickSpec
import Data.Text.BoyerMooreSpec as BoyerMooreSpec
import Data.Text.BoyerMooreCISpec as BoyerMooreCISpec
import Data.Text.Utf8Spec as Utf8Spec
main :: IO ()
main = hspec $ do
describe "Data.Text.AhoCorasick" Ah... | null | https://raw.githubusercontent.com/channable/alfred-margaret/be96f07bb74c5aa65ce01d664de5d98badbee307/tests/Main.hs | haskell | module Main where
import Test.Hspec (describe, hspec)
import Data.Text.AhoCorasickSpec as AhoCorasickSpec
import Data.Text.BoyerMooreSpec as BoyerMooreSpec
import Data.Text.BoyerMooreCISpec as BoyerMooreCISpec
import Data.Text.Utf8Spec as Utf8Spec
main :: IO ()
main = hspec $ do
describe "Data.Text.AhoCorasick" Ah... | |
4b8fd969445183945a8e62996318021a34cc034f139abc868c60e05e5fac1c5b | odis-labs/onix | Onix_lock_opam.ml | let gen ~opam_lock_file_path lock_file =
Onix_core.Utils.Out_channel.with_open_text opam_lock_file_path (fun chan ->
let out = Format.formatter_of_out_channel chan in
Fmt.pf out "%a" Pp.pp lock_file);
Logs.info (fun log ->
log "Created an opam lock file at %S." opam_lock_file_path)
| null | https://raw.githubusercontent.com/odis-labs/onix/81cc82953ef062425656ac9bf80474f2ce642f5b/src/onix_lock_opam/Onix_lock_opam.ml | ocaml | let gen ~opam_lock_file_path lock_file =
Onix_core.Utils.Out_channel.with_open_text opam_lock_file_path (fun chan ->
let out = Format.formatter_of_out_channel chan in
Fmt.pf out "%a" Pp.pp lock_file);
Logs.info (fun log ->
log "Created an opam lock file at %S." opam_lock_file_path)
| |
fb154adcf8029096147940c5b52ed045a856f9f17f975f16fb601261f26ba9c3 | 2600hz/kazoo | cb_presence.erl | %%%-----------------------------------------------------------------------------
( C ) 2013 - 2020 , 2600Hz
%%% @doc
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%%
%%% @end
%%%--------... | null | https://raw.githubusercontent.com/2600hz/kazoo/24519b9af9792caa67f7c09bbb9d27e2418f7ad6/applications/crossbar/src/modules/cb_presence.erl | erlang | -----------------------------------------------------------------------------
@doc
@end
-----------------------------------------------------------------------------
=============================================================================
API
====================================================================... | ( C ) 2013 - 2020 , 2600Hz
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
-module('cb_presence').
-export([init/0
,authenticate/1, authenticate/2
,authorize/1, authorize/2... |
5cff4c83b1ef3e91f224952ded14dc9d97c4ea8b5e8c10f9ec1e6046dd7f8436 | choener/ADPfusion | Core.hs |
-- |
--
-- TODO the 'mkStream' instances here are probably wonky for everything that is
-- non-static.
--
TODO should @d@ in each case here be @d==0@ ? What is the exact meaning @d@
-- should convey?
module ADPfusion.Unit.Core where
import Data.Proxy
import Data.Vector.Fusion.Stream.Monadic (singleton,map,filter,S... | null | https://raw.githubusercontent.com/choener/ADPfusion/fcbbf05d0f438883928077e3d8a7f1cbf8c2e58d/ADPfusion/Unit/Core.hs | haskell | |
TODO the 'mkStream' instances here are probably wonky for everything that is
non-static.
should convey?
# Inline mkStream #
# Inline mkStream #
# Inline mkStream #
# Inline mkStream #
instance
)
mkStream Proxy S grd (us:.._) (is:._)
$ mkStream (Proxy ∷ Proxy ps) S grd us is
{-# Inline mkStream #-}
... |
TODO should @d@ in each case here be @d==0@ ? What is the exact meaning @d@
module ADPfusion.Unit.Core where
import Data.Proxy
import Data.Vector.Fusion.Stream.Monadic (singleton,map,filter,Step(..))
import Debug.Trace
import Prelude hiding (map,filter)
import Data.PrimitiveArray hiding (map)
import ADPfusion.Co... |
610f8a3a011ee0dda6755976e7e548fc0e7fbbbb1bb2a1cc3069be77b2b6c3fc | jiesoul/soul-talk | effects.cljs | (ns soul-talk.effects
(:require [re-frame.core :as rf :refer [dispatch reg-fx reg-event-fx reg-event-db]]
[accountant.core :as accountant]
[ajax.core :as ajax]
[reagent.core :as r]))
(reg-event-fx
:ajax-error
(fn [_ [_ {:keys [response status] :as resp}]]
(let [message (:m... | null | https://raw.githubusercontent.com/jiesoul/soul-talk/630de08c6549b206d59023764d5f2576d97d1030/admin/src/soul_talk/effects.cljs | clojure | 响应事件 | (ns soul-talk.effects
(:require [re-frame.core :as rf :refer [dispatch reg-fx reg-event-fx reg-event-db]]
[accountant.core :as accountant]
[ajax.core :as ajax]
[reagent.core :as r]))
(reg-event-fx
:ajax-error
(fn [_ [_ {:keys [response status] :as resp}]]
(let [message (:m... |
030028be0f7ea2e6a6c6775a27fad59810708808d8c0920e1478bd9e846eec0f | velveteer/slacker | Button.hs | module Slacker.Blocks.Elements.Button
( ButtonElement(..)
, HasButton(..)
, defaultButton
) where
import qualified Data.Aeson as Aeson
import Data.Text (Text)
import GHC.Generics (Generic)
import Slacker.Blocks.Elements.TextObject
import Slacker.Util (toJSONWithTypeFiel... | null | https://raw.githubusercontent.com/velveteer/slacker/3f2046b2631624d0684834347f4b0a08b2d9dcdb/src/Slacker/Blocks/Elements/Button.hs | haskell | module Slacker.Blocks.Elements.Button
( ButtonElement(..)
, HasButton(..)
, defaultButton
) where
import qualified Data.Aeson as Aeson
import Data.Text (Text)
import GHC.Generics (Generic)
import Slacker.Blocks.Elements.TextObject
import Slacker.Util (toJSONWithTypeFiel... | |
315731398dc0abd2dce2415c1f75630d296046fde70484c2845d32fd25df0134 | yuriy-chumak/ol | gl-3.scm | (define-library (lib gl-3)
(import
(scheme base)
(owl math) (otus async)
(lib gl config)
(lib gl-2)
(OpenGL version-3-0))
(export
gl:set-context-version ; recreate OpenGL with version
(exports (lib gl-2))
(exports (OpenGL version-3-0)))
; -=( 3.0+ )=-------------------------
; Higher OpenGL ve... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/5e00a1d1df8a8f20d5d6b7714275a1578a56b8a0/libraries/lib/gl-3.scm | scheme | recreate OpenGL with version
-=( 3.0+ )=-------------------------
Higher OpenGL versions support
#(display screen window cx)
(print "display: " display)
(print "screen: " screen)
GLX_DRAWABLE_TYPE GLX_WINDOW_BIT
GLX_RENDER_TYPE GLX_RGBA_BIT
GLX_RED_SIZE
GLX_GREEN_SIZE
GLX_BLUE_SIZE
GLX_DEPTH_SIZE
GLX_DOUBLE... | (define-library (lib gl-3)
(import
(scheme base)
(owl math) (otus async)
(lib gl config)
(lib gl-2)
(OpenGL version-3-0))
(export
(exports (lib gl-2))
(exports (OpenGL version-3-0)))
(cond-expand
TODO : dev only , please rename to Android
(begin
(define (gl:set-context-version ma... |
8445b2d27f2555d995bf748e4699d4b70eb464fecf08910a0e965997ea559fcd | 8c6794b6/haskell-sc-scratch | SCShell.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE UndecidableInstances #
------------------------------------------------------------------------------
-- |
-- Module : $Header$
-- License : BSD3
Maintainer :
-- Stability : unstable
-- Portability : non-portable
--
-- Interactive shell for scsynth nodes.
--
N... | null | https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/Scratch/Repl/SCShell.hs | haskell | ----------------------------------------------------------------------------
|
Module : $Header$
License : BSD3
Stability : unstable
Portability : non-portable
Interactive shell for scsynth nodes.
|
TODO:
* Reuse synth connection inside shell.
|
TODO:
* DONE, but not so useful: 'pwd'
* DO... | # LANGUAGE FlexibleInstances #
# LANGUAGE UndecidableInstances #
Maintainer :
Note that , backend used in this module is customized .
Modified mtl version in dependency list of Shellac - haskeline 's cabal file
from 1.1.1.1 to 2.0.1 .
module SCShell where
import Control.Monad.Trans (liftIO)
import System.... |
9f08b8b9afadc399bd128c6573efabed50723631e9a30e56538722503f4a8e05 | bos/rwh | PodDownload.hs | {-- snippet all --}
module PodDownload where
import PodTypes
import PodDB
import PodParser
import Network.HTTP
import System.IO
import Database.HDBC
import Data.Maybe
import Network.URI
{- | Download a URL. (Left errorMessage) if an error,
(Right doc) if success. -}
downloadURL :: String -> IO (Either String String)
... | null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch23/PodDownload.hs | haskell | - snippet all -
| Download a URL. (Left errorMessage) if an error,
(Right doc) if success.
A HTTP redirect
| Update the podcast in the database.
| Downloads an episode, returning a String representing
the filename it was placed into, or Nothing on error.
This function ought to apply an extension based on the f... | module PodDownload where
import PodTypes
import PodDB
import PodParser
import Network.HTTP
import System.IO
import Database.HDBC
import Data.Maybe
import Network.URI
downloadURL :: String -> IO (Either String String)
downloadURL url =
do resp <- simpleHTTP request
case resp of
Left x -> return $ Le... |
016d42bf5264cf392cadcda93e79172539c41bcb8574e5ad88962acec2dc8539 | v0d1ch/plaid | TransactionsRefreshBody.hs | module Data.Proof.TransactionsRefreshBody
( HasTransactionsRefreshBody
, proveTransactionsRefreshBody
) where
import Data.Api.Types
import Data.Proof.Named
import Data.Text (Text)
data HasTransactionsRefreshBody plaidEnv accessToken = Proof
proveTransactionsRefreshBody
:: Named ... | null | https://raw.githubusercontent.com/v0d1ch/plaid/9a9a37e4284f890a1dbebfcd515eea72510bf805/Data/Proof/TransactionsRefreshBody.hs | haskell | module Data.Proof.TransactionsRefreshBody
( HasTransactionsRefreshBody
, proveTransactionsRefreshBody
) where
import Data.Api.Types
import Data.Proof.Named
import Data.Text (Text)
data HasTransactionsRefreshBody plaidEnv accessToken = Proof
proveTransactionsRefreshBody
:: Named ... | |
d4412080e881c71f97aeefa02ebc3989c639f7b36211784c37857616e9b3a241 | liqd/aula | SeleniumSpec.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE ViewPatterns #
# OPTIONS_GHC -Werror -Wall -fno - warn - incomplete - patterns #
-- | selenium tests.
--
-- run these by running `make selenium` in a terminal in the aula-docker image.
--
for debugging , you have two opt... | null | https://raw.githubusercontent.com/liqd/aula/f96dbf85cd80d0b445e7d198c9b2866bed9c4e3d/tests/SeleniumSpec.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE ScopedTypeVariables #
| selenium tests.
run these by running `make selenium` in a terminal in the aula-docker image.
login and visit own profile
liftIO $ print imgdata
Just (Object (fromList [("value",String "data:image/png;base64,[...]")])) | # LANGUAGE ViewPatterns #
# OPTIONS_GHC -Werror -Wall -fno - warn - incomplete - patterns #
for debugging , you have two options :
1 . sprinkle @getSource > > = writeFile " /page.html"@ , @saveScreenshot " /screenshot.png"@
over your ' WD ' monads .
2 . watch with vncviewer ( see ` /docs / testing... |
e325ff927a0551fcfaeed6a2385d14e5dbb539c0d790b879a937bc4914962ac8 | melisgl/mgl-pax | util.lisp | (in-package :mgl-pax)
(defmacro with-standard-io-syntax* (&body body)
`(with-standard-io-syntax
With * PRINT - READABLY * , CLISP insists on printing FOO as |FOO| .
(let (#+clisp (*print-readably* nil))
,@body)))
(defun find-package* (name)
On AllegroCL , FIND - PACKAGE will signal an error if a rel... | null | https://raw.githubusercontent.com/melisgl/mgl-pax/bdd4cd21e41460610796a58812f021b054e0d463/src/navigate/util.lisp | lisp | package name has too many leading dots.
Like SYMBOL-FUNCTION*, but sees through encapsulated functions.
Tracing typically encapsulate a function in a closure. The
function we need is at the end of the encapsulation chain.
Function arglist don't have the default values of &KEY and
&KEY arguments are given as keywo... | (in-package :mgl-pax)
(defmacro with-standard-io-syntax* (&body body)
`(with-standard-io-syntax
With * PRINT - READABLY * , CLISP insists on printing FOO as |FOO| .
(let (#+clisp (*print-readably* nil))
,@body)))
(defun find-package* (name)
On AllegroCL , FIND - PACKAGE will signal an error if a rel... |
9dbbe1fb78551b3944788f9640257d191da2b6de3ececb75640f470c5ec3732a | aisamanra/apicius | ReverseTree.hs | # LANGUAGE ParallelListComp #
module Apicius.ReverseTree where
import Apicius.AST
import Data.Monoid ((<>))
import Data.Text (Text)
import qualified Data.Text as T
An ' ActionChunk ' represents a set of actions in between two join
-- points. This is 'reversed' from what we'd expect: the 'name' is
-- actually the n... | null | https://raw.githubusercontent.com/aisamanra/apicius/2ea26530f99adbdbac139175922ecf61b596d408/Apicius/ReverseTree.hs | haskell | points. This is 'reversed' from what we'd expect: the 'name' is
actually the name of the join point at the end of a sequence of
actions, or the string DONE, while the 'prev' is the name of the
join point that came at the beginning, or the ingredients list
that started the rule. The actions also will appear in reve... | # LANGUAGE ParallelListComp #
module Apicius.ReverseTree where
import Apicius.AST
import Data.Monoid ((<>))
import Data.Text (Text)
import qualified Data.Text as T
An ' ActionChunk ' represents a set of actions in between two join
will produce two ActionChunks :
data ActionChunk = ActionChunk
{ acName :: Text... |
809b1b04216183f4426cc645301873c48742020c1467056562195db6129dd0e1 | onedata/op-worker | mi_transfers.erl | %%%-------------------------------------------------------------------
@author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
Interface for managing transfers ( r... | null | https://raw.githubusercontent.com/onedata/op-worker/a48082aad45530ab40cbe15a69c5057970a4bba1/src/middleware/interface/mi_transfers.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
===================================================================
API
====================... | @author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
Interface for managing transfers ( requests are delegated to middleware_worker ) .
-module(mi_transfers).
-author("Bartosz Walkowicz").
-include("middleware/middleware.hrl").
-export([
sched... |
544d6d7bc57f5c55b55d601fdf52ce8af6019124a895a36cfb1483a5c61abaae | imitator-model-checker/imitator | AlgoEFgen.mli | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* IMITATOR
*
* Université Paris 13 , LIPN , CNRS , France
* Université de Lorraine , CNRS , , LORIA , Nancy , France
*
* Module description : generic EFsyn... | null | https://raw.githubusercontent.com/imitator-model-checker/imitator/105408ae2bd8c3e3291f286e4d127defd492a58b/src/AlgoEFgen.mli | ocaml | **********************************************************
Modules
**********************************************************
**********************************************************
Class definition
**********************************************************
*******************************************************... | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* IMITATOR
*
* Université Paris 13 , LIPN , CNRS , France
* Université de Lorraine , CNRS , , LORIA , Nancy , France
*
* Module description : generic EFsyn... |
21a9f862217fa251e2f1d6fc49a1dc783bcea95151ac28e0e9ed7f11498f7583 | noteed/mojito | SExpr.hs | # LANGUAGE FlexibleContexts #
module Language.Mojito.Syntax.SExpr where
import Text.ParserCombinators.Parsec hiding (State)
import Control.Monad.Except
----------------------------------------------------------------------
-- S-Expressions
----------------------------------------------------------------------
-- An ... | null | https://raw.githubusercontent.com/noteed/mojito/893d1d826d969b0db7bbc8884df3b417db151d14/Language/Mojito/Syntax/SExpr.hs | haskell | --------------------------------------------------------------------
S-Expressions
--------------------------------------------------------------------
An s-expression is either an atom or a list of s-expression.
An atom can be a floating or integral number, a string, or
a symbol (anything else).
------------------... | # LANGUAGE FlexibleContexts #
module Language.Mojito.Syntax.SExpr where
import Text.ParserCombinators.Parsec hiding (State)
import Control.Monad.Except
data SExpr = Sym String | FltNum Double | IntNum Integer | Str String
| List [SExpr]
deriving (Eq, Show)
isSym :: SExpr -> Bool
isSym (Sym _) = True
is... |
7b261c762190c765efa21a596b56ba1fe0682df6215a70f34aeed3cc18a4a4cd | nklein/grid-generators | taxicab.lisp | ;;;; taxicab.lisp
(in-package #:grid-generators-tests)
(nst:def-test-group 1d-taxicab-generator-tests ()
(nst:def-test 1d-taxicab (generates ((0) (-1) (1) (-2) (2)))
(grid-generators:make-taxicab-generator 1
:minimum-steps 0
... | null | https://raw.githubusercontent.com/nklein/grid-generators/5f7b790c339123f84710d907ddafdb52c160d44e/test/taxicab.lisp | lisp | taxicab.lisp
steps 0 |
(in-package #:grid-generators-tests)
(nst:def-test-group 1d-taxicab-generator-tests ()
(nst:def-test 1d-taxicab (generates ((0) (-1) (1) (-2) (2)))
(grid-generators:make-taxicab-generator 1
:minimum-steps 0
:maximum-steps 2)... |
0243eab83c9b570d2b30ce285692951fa6b50a6177b18302c2c4754588fa3127 | penpot/penpot | render.cljs | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
;;
;; Copyright (c) KALEIDOS INC
(ns app.libs.render
(:require
[app.common.uuid :as uuid]
[app.main.render :as r]
[beicon.core :as r... | null | https://raw.githubusercontent.com/penpot/penpot/cc18f84d620e37d8efafc5bed1bcdbe70ec23c1e/frontend/src/app/libs/render.cljs | clojure |
Copyright (c) KALEIDOS INC | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns app.libs.render
(:require
[app.common.uuid :as uuid]
[app.main.render :as r]
[beicon.core :as rx]
[promesa.core :as p]))
(de... |
86df1b07576ff3c9ad60315a7249e8459339157076ba2189ac9483001c453c9c | otherjoel/beeswax | for-pollen.rkt | #lang racket/base
(require (prefix-in pollen: pollen/render)
pollen/setup
racket/match
racket/path
sugar/file
"render.rkt")
; This is a renderer specifically for use by Pollen
(provide external-renderer)
(define (external-renderer source-path orig-template-path output-pat... | null | https://raw.githubusercontent.com/otherjoel/beeswax/993b5364b474ff0d8a1f8c26dac192cb4408f385/for-pollen.rkt | racket | This is a renderer specifically for use by Pollen | #lang racket/base
(require (prefix-in pollen: pollen/render)
pollen/setup
racket/match
racket/path
sugar/file
"render.rkt")
(provide external-renderer)
(define (external-renderer source-path orig-template-path output-path)
(case (path-get-extension source-path)
[(#"... |
6b954123c95df2e9ac9b7ac05607b97ed2be2381b16dc520c2875e14204d6d6d | wireapp/wire-server | GroupInfoBundle.hs | -- 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
Software Foundation , either version 3 of the License... | null | https://raw.githubusercontent.com/wireapp/wire-server/8d0c53abd7eb1e0237b39dfdd216acd88d537d98/libs/wire-api/src/Wire/API/MLS/GroupInfoBundle.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... | 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 General Public License along
module Wire.API.MLS.GroupInfoBun... |
9782f3c3f7f78a57bfd8e093d659e213758f06f34ef1dcd71960a644a20c9daa | andrewthad/sockets | Error.hs | module Socket.Error
( die
) where
die :: String -> IO a
die = fail
| null | https://raw.githubusercontent.com/andrewthad/sockets/90d314bd2ec71b248a90da6ad964c679f75cfcca/src-err/Socket/Error.hs | haskell | module Socket.Error
( die
) where
die :: String -> IO a
die = fail
| |
6b56a7f3c1eb9d1c94e4a7846e7dc5526ae79e53105c08f1d478361da0efe204 | sbcl/sbcl | fndb.lisp | ;;;; This file defines all the standard functions to be known
;;;; functions. Each function has type and side-effect information,
;;;; and may also have IR1 optimizers.
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , w... | null | https://raw.githubusercontent.com/sbcl/sbcl/6bb4483ae43d485f0a09eb354dd4e03fe5ac7eae/src/compiler/fndb.lisp | lisp | This file defines all the standard functions to be known
functions. Each function has type and side-effect information,
and may also have IR1 optimizers.
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more ... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB-C")
(defknown coerce (t type-specifier) t
(movable)
: DERIVE - TYPE RESULT - TYPE - SPEC - NTH - ARG... |
b3808a820d448fcc30f3accfda01f9a377ad439730f60adb83e8c62717e15fbd | mentat-collective/MathBox.cljs | closed_line.clj | ^#:nextjournal.clerk
{:toc true
:no-cache true
:visibility :hide-ns}
(ns mathbox.examples.test.closed-line
(:require [mentat.clerk-utils.show :refer [show-sci]]
[nextjournal.clerk :as clerk]))
^{::clerk/visibility {:code :hide :result :hide}}
(clerk/eval-cljs
;; These aliases only apply inside this na... | null | https://raw.githubusercontent.com/mentat-collective/MathBox.cljs/665a0d5f01fb2ed9b0bfeee6f9ad679915f13465/dev/mathbox/examples/test/closed_line.clj | clojure | These aliases only apply inside this namespace.
# Closed Line | ^#:nextjournal.clerk
{:toc true
:no-cache true
:visibility :hide-ns}
(ns mathbox.examples.test.closed-line
(:require [mentat.clerk-utils.show :refer [show-sci]]
[nextjournal.clerk :as clerk]))
^{::clerk/visibility {:code :hide :result :hide}}
(clerk/eval-cljs
'(require '[mathbox.core :as mathbox])
'(... |
b8984e3855b197b32cae8906ca1b48b8a9d348d683ad6058b86d495c27fa0888 | fuchsto/drool | Disco.hs | -----------------------------------------------------------------------------
--
-- Module : Drool.UI.Visuals.Disco
Copyright :
License : MIT
--
-- Maintainer :
-- Stability : experimental
-- Portability : POSIX
--
-- |
--
------------------------------------------------------------------... | null | https://raw.githubusercontent.com/fuchsto/drool/d9318c641a6a94a8450b5118db7b3213a93209ea/src/Drool/UI/Visuals/Disco.hs | haskell | ---------------------------------------------------------------------------
Module : Drool.UI.Visuals.Disco
Maintainer :
Stability : experimental
Portability : POSIX
|
---------------------------------------------------------------------------
# OPTIONS -O2 -Wall #
hidden type constructor
Import... | Copyright :
License : MIT
module Drool.UI.Visuals.Disco (
newDiscoVisual,
newDiscoState
) where
import Drool.UI.Visuals.Visual as Visual
import Data.IORef ( IORef, newIORef, readIORef, modifyIORef )
import qualified Drool.Utils.RenderHelpers as RH ( RenderSettings(..), color4MulAlpha )
im... |
1f14dfe2a71f978fb689bd14e86c68b2e09c1801c38c0de847425c6b242b8eb6 | flipstone/orville | Conduit.hs | |
Module : Database . Orville . PostgreSQL.Conduit
Copyright : Flipstone Technology Partners 2016 - 2018
License : MIT
Module : Database.Orville.PostgreSQL.Conduit
Copyright : Flipstone Technology Partners 2016-2018
License : MIT
-}
# LANGUAGE CPP #
module Database.Orville.PostgreSQL.Conduit
( se... | null | https://raw.githubusercontent.com/flipstone/orville/aee8d7a47ab3a7b442fdb274dbb5a95d687a23ce/orville-postgresql/src/Database/Orville/PostgreSQL/Conduit.hs | haskell | Note this doesn't use finally to release this, but it will be released
automatically at the end of runResourceT. finally cannot be used here
withAllocate here, but that would require an UNLiftIO instance
All the masking manual cleanup in this function amounts to a
poor man's ResourceT that I *hope* is correct. The... | |
Module : Database . Orville . PostgreSQL.Conduit
Copyright : Flipstone Technology Partners 2016 - 2018
License : MIT
Module : Database.Orville.PostgreSQL.Conduit
Copyright : Flipstone Technology Partners 2016-2018
License : MIT
-}
# LANGUAGE CPP #
module Database.Orville.PostgreSQL.Conduit
( se... |
57e46575ec0f3d275a258e5780c2f68654b1959aaa13d053da4b756ef294733c | opencog/pln | amusing-friend-bc.scm | Like moses-pln-synergy-pm.scm but relies on the backward chainer .
;; Set logger to DEBUG
;; (ure-logger-set-sync! #t)
;; (ure-logger-set-stdout! #t)
(ure-logger-set-level! "debug")
;; Load the background knowledge
(load "kb.scm")
;; Load the PLN configuration for this demo
(load "pln-bc-config.scm")
Run the BC... | null | https://raw.githubusercontent.com/opencog/pln/52dc099e21393892cf5529fef687a69682436b2d/examples/pln/amusing-friend/amusing-friend-bc.scm | scheme | Set logger to DEBUG
(ure-logger-set-sync! #t)
(ure-logger-set-stdout! #t)
Load the background knowledge
Load the PLN configuration for this demo
debugging.
(define step-1
(Evaluation
(Predicate "is-honest")
)
(define step-2
(Implication
(Lambda
(Variable "$X")
(Variable "$Y")... | Like moses-pln-synergy-pm.scm but relies on the backward chainer .
(ure-logger-set-level! "debug")
(load "kb.scm")
(load "pln-bc-config.scm")
Run the BC on each steps as described in amusing-friend-pm.scm , for
( Concept " " ) )
( pln - bc step-1 )
( VariableList
( TypedVariable
... |
cc989e6bd68df35ba57c39cc0b09883f03833ea32088f8cb5a0a4b670c97d47d | duncanatt/detecter | cow_hpack.erl | Copyright ( c ) 2015 - 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 " AND THE AUTHOR DISC... | null | https://raw.githubusercontent.com/duncanatt/detecter/95b6a758ce6c60f3b7377c07607f24d126cbdacf/experiments/coordination_2022/src/cowlib/cow_hpack.erl | erlang |
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.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVE... | Copyright ( c ) 2015 - 2018 , < >
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
-module(cow_hpack).
-dialyzer(no_improper_lists).
-... |
7c7836ffcb4d5ca49264297d933afedd0d11bef4f9917a59bb5318954633809b | ku-fpg/kansas-lava | Wakarusa.hs | # LANGUAGE ScopedTypeVariables , RankNTypes , TypeFamilies , FlexibleContexts , ExistentialQuantification #
module Wakarusa where
import Language.KansasLava
import Test
import Language.KansasLava.Fabric
import Language.KansasLava.Wakarusa
import Data.Sized.Ix
import Data.Sized.Unsigned
import Data.Sized.Matrix
test... | null | https://raw.githubusercontent.com/ku-fpg/kansas-lava/cc0be29bd8392b57060c3c11e7f3b799a6d437e1/tests/Wakarusa.hs | haskell | ----------------------------------------------------------------------
----------------------------------------------------------------------
----------------------------------------------------------------------
----------------------------------------------------------------------
------------------------------------... | # LANGUAGE ScopedTypeVariables , RankNTypes , TypeFamilies , FlexibleContexts , ExistentialQuantification #
module Wakarusa where
import Language.KansasLava
import Test
import Language.KansasLava.Fabric
import Language.KansasLava.Wakarusa
import Data.Sized.Ix
import Data.Sized.Unsigned
import Data.Sized.Matrix
test... |
f7799417f15dd41924a8e2cc2381385b212f0dd6124546b110fe60f0af687b0f | NalaGinrut/artanis | upload.scm | #!/usr/bin/env guile
!#
-*- indent - tabs - mode : nil ; coding : utf-8 -*-
;; Copyright (C) 2013,2014,2015
" Mu Lei " known as " NalaGinrut " < >
Artanis is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License and GNU
Lesser General Public L... | null | https://raw.githubusercontent.com/NalaGinrut/artanis/3412d6eb5b46fde71b0965598ba085bacc2a6c12/examples/upload.scm | scheme | coding : utf-8 -*-
Copyright (C) 2013,2014,2015
any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License and GNU Lesser General Public License
for more details.
and GNU Lesser General Public ... | #!/usr/bin/env guile
!#
" Mu Lei " known as " NalaGinrut " < >
Artanis is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License and GNU
Lesser General Public License published by the Free Software
Foundation , either version 3 of the License , or... |
03e5ac4a90746fb83965bd819dc5d535e83c00e73d022e7e0591388c1052e891 | zudov/haskell-comark | EmphLink.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE ViewPatterns #-}
-- | Code and data types for parsing emphasis and links
module Comark.Parser.Inline.EmphLink where
import Data.Text (Text)
import qualified Data.Text as Text
import Comark.Parser.Reference
import Comark.Syn... | null | https://raw.githubusercontent.com/zudov/haskell-comark/b84cf1d5623008673402da3a5353bdc5891d3a75/comark-parser/src/Comark/Parser/Inline/EmphLink.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE ViewPatterns #
| Code and data types for parsing emphasis and links | # LANGUAGE RecordWildCards #
module Comark.Parser.Inline.EmphLink where
import Data.Text (Text)
import qualified Data.Text as Text
import Comark.Parser.Reference
import Comark.Syntax
import Data.Sequence (Seq, ViewR(..), singleton, viewr, (<|), (><), (|>))
type DelimStack = Seq Token
data EmphDelim
... |
3fb8f70683936f03f84dc77e9ea6dfc291d631bdd30a02e2888f4d8203278fce | NB-Iot/emqx-hw-coap | emqx_hw_coap_mqtt_adapter.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2013 - 2017 EMQ Enterprise , Inc. ( )
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% ... | null | https://raw.githubusercontent.com/NB-Iot/emqx-hw-coap/76436492a22eaa0cd6560b4f135275ecf16245d0/src/emqx_hw_coap_mqtt_adapter.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 ) 2013 - 2017 EMQ Enterprise , Inc. ( )
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_hw_coap_mqtt_adapter).
-behaviour(gen_server).
-include("emqx_hw_coap.hrl").
-include_lib("emqx/include... |
dafe4b0a5081992237e021dc2b5511df5d20f25f7ddebae090220d06e96690df | yallop/ocaml-asp | sexp_staged_combinator_parser.ml |
* Copyright ( c ) 2018 and
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2018 Neelakantan Krishnaswami and Jeremy Yallop
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*... | null | https://raw.githubusercontent.com/yallop/ocaml-asp/a092f17ea55d427c63414899e39a8fe80b30db14/benchmarks/sexp/sexp_staged_combinator_parser.ml | ocaml |
* Copyright ( c ) 2018 and
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2018 Neelakantan Krishnaswami and Jeremy Yallop
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*... | |
9c034d5c233a79e30275898342ae2dc55c9802c9d4d0c4108efbde640853a507 | LaurentMazare/ocaml-minipy | bc_list.mli | open Base
val attrs : Bc_value.t Queue.t -> attr:string -> Bc_value.t
| null | https://raw.githubusercontent.com/LaurentMazare/ocaml-minipy/e83d4bfad55819a27195109d401437faa0f65f69/src/bc_list.mli | ocaml | open Base
val attrs : Bc_value.t Queue.t -> attr:string -> Bc_value.t
| |
da4931b8949a5d12da24904a81aa240ae33c24ece2302d96c01f631abdd74281 | robrix/starlight | Faction.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TypeApplications #
module Starlight.Faction
( Factions
, factions_
, factions
, getFactions
, Faction(..)
, name_
, relationships_
) where
import Control.Lens
import Data.Generics.Product.Fields
... | null | https://raw.githubusercontent.com/robrix/starlight/ad80ab74dc2eedbb52a75ac8ce507661d32f488e/src/Starlight/Faction.hs | haskell | # LANGUAGE DeriveTraversable #
# LANGUAGE RankNTypes # | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE TypeApplications #
module Starlight.Faction
( Factions
, factions_
, factions
, getFactions
, Faction(..)
, name_
, relationships_
) where
import Control.Lens
import Data.Generics.Product.Fields
import Data.IntMap as IntMap
import Data.Text (Text)
import GHC... |
5e6f116478c2289f07fc433d4fbc6c60c525cbc9f186021a3d3692d6231ecf11 | lambdacube3d/lambdacube-compiler | Reducer.hs | -- efficient lazy evaluation for lambda calculus with constructors and delta functions
-- eliminators are used instead of case expressions
# LANGUAGE LambdaCase #
{-# LANGUAGE RankNTypes #-}
import Control.Monad.ST
import Control.Monad.Fix
import System.Environment
import Data.STRef
-----------------------------------... | null | https://raw.githubusercontent.com/lambdacube3d/lambdacube-compiler/ca8d65a210a8801c8358fc29a9ead427afc9fce4/prototypes/Reducer.hs | haskell | efficient lazy evaluation for lambda calculus with constructors and delta functions
eliminators are used instead of case expressions
# LANGUAGE RankNTypes #
------------------------------------------------------------------------------
------------------------------------------------------------------------------
ev... | # LANGUAGE LambdaCase #
import Control.Monad.ST
import Control.Monad.Fix
import System.Environment
import Data.STRef
data Exp s
= Ref !(STRef s (Exp s))
| Lam !(Exp s -> Exp s)
| App (Exp s) (Exp s)
| Action !(ST s (Exp s))
| Con !ConName [Exp s]
| Int !Int
| LetRec (Exp s -> Exp s) (Exp s... |
eafa9ca840a31878b1d8dd41764bfdf78ecadc6f3182bcac22288f9862184477 | bbc/haskell-workshop | C4SyntaxInFunctions.hs | module C4SyntaxInFunctions where
-- Pattern Matching
-- finish this fibonaacci function using pattern matching
fib 10 should return 89
fib :: Int -> Int
fib 0 = 1
fib 1 = 1
fib n = fib (n - 1) + fib (n - 2)
-- write a safeTail function that returns the tail of a list if it is not empty
-- otherwise returns an empt... | null | https://raw.githubusercontent.com/bbc/haskell-workshop/475b9bac04167665030d7863798ccd27dfd589d0/chrisb/exercises/src/C4SyntaxInFunctions.hs | haskell | Pattern Matching
finish this fibonaacci function using pattern matching
write a safeTail function that returns the tail of a list if it is not empty
otherwise returns an empty list, []
use pattern matching
(note that the patterns are not filled in like they are in the fib example, you will need to write the patt... | module C4SyntaxInFunctions where
fib 10 should return 89
fib :: Int -> Int
fib 0 = 1
fib 1 = 1
fib n = fib (n - 1) + fib (n - 2)
safeTail :: [String] -> [String]
safeTail [] = []
safeTail (x:xs) = xs
myReverse :: [a] -> [a]
myReverse [] = []
myReverse (x:xs) = myReverse xs ++ [x]
Write a function that takes t... |
fead82f89a88797df8a923ee71732c805c486701ea55ad4c7f4863b08c44ed40 | sharplispers/montezuma | tc-term-info.lisp | (in-package #:montezuma)
(deftestfun test-term-info
(let ((ti-1 (make-instance 'term-info
:doc-freq 1
:freq-pointer 2
:prox-pointer 3
:skip-offset 1)))
(test term-info-1 (doc-freq ti-1) 1)
(test term-info-2 (freq-pointer ti-1) 2)
(test term-info-3 (prox-pointer ti-1) 3)
... | null | https://raw.githubusercontent.com/sharplispers/montezuma/ee2129eece7065760de4ebbaeffaadcb27644738/tests/unit/index/tc-term-info.lisp | lisp | (in-package #:montezuma)
(deftestfun test-term-info
(let ((ti-1 (make-instance 'term-info
:doc-freq 1
:freq-pointer 2
:prox-pointer 3
:skip-offset 1)))
(test term-info-1 (doc-freq ti-1) 1)
(test term-info-2 (freq-pointer ti-1) 2)
(test term-info-3 (prox-pointer ti-1) 3)
... | |
66c4d8d6dbbc23988b16a8b6028c4a113492382964589927c5fbe3977899f21d | rabeckett/Temporal-NetKAT | fdd.mli | open Common
open Syntax
type 'a fdd
(** Forwarding Decision Diagram over polymorphic leaf type *)
type 'a mem
* An FDD memory to ensure unicity of nodes ,
functions require a memory from which to perform hashconsing .
Memories should be global and reused to ensure correctness
functions require a memory f... | null | https://raw.githubusercontent.com/rabeckett/Temporal-NetKAT/829d1847c18d77f40501fe4d988eec6e7867c94d/src/fdd.mli | ocaml | * Forwarding Decision Diagram over polymorphic leaf type
* Forwarding rules contain match * action pairs
* Module for bulding efficient sets/maps over fdds
* Module for bulding efficient sets/maps over fdds
* Create a memory with a equality and hash function
* Build a leaf fdd node from a value of type 'a
* Map o... | open Common
open Syntax
type 'a fdd
type 'a mem
* An FDD memory to ensure unicity of nodes ,
functions require a memory from which to perform hashconsing .
Memories should be global and reused to ensure correctness
functions require a memory from which to perform hashconsing.
Memories should be globa... |
44cd4ab7e2a4fc594d368118bfc4b60982ea9305d0ab0be7575309b393675b81 | esl/amoc-arsenal-xmpp | mongoose_muc.erl | %==============================================================================
2019 - 2020 Erlang Solutions Ltd.
Licensed under the Apache License , Version 2.0 ( see LICENSE file )
%% @end
%%
%% @doc
%% In this scenario, users are entering MUC Rooms and exchanging messages.
Each room has one sender .
%%
%% == ... | null | https://raw.githubusercontent.com/esl/amoc-arsenal-xmpp/5422d01a0e0f6c588b8139891de131e1fbf964e7/src/scenarios/mongoose_muc.erl | erlang | ==============================================================================
@end
@doc
In this scenario, users are entering MUC Rooms and exchanging messages.
== User steps: ==
to be sent per room is defined by the `messages_to_send_per_room' variable.
The rate of messages that is being sent is def... | 2019 - 2020 Erlang Solutions Ltd.
Licensed under the Apache License , Version 2.0 ( see LICENSE file )
Each room has one sender .
1 . Connect to the XMPP host .
2 . Send presence ` available ' .
3 . Enter selected MUC rooms . After each entered room , wait for
` delay_after_entering_room ' before join... |
3fa42e0245d178322b09bd4254a6dc8908a7f3150159d23ed4ec61d3acc087d0 | Bogdanp/marionette | page.rkt | #lang racket/base
(require json
net/base64
net/url
racket/contract
racket/match
racket/string
"private/browser.rkt"
"private/json.rkt"
"private/marionette.rkt"
"private/template.rkt"
"rect.rkt")
;; page ;;;;;;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/Bogdanp/marionette/dad793f0cda19801316ef2ff4d70b7f6af466036/marionette-lib/page.rkt | racket | page ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
element ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
common ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; | #lang racket/base
(require json
net/base64
net/url
racket/contract
racket/match
racket/string
"private/browser.rkt"
"private/json.rkt"
"private/marionette.rkt"
"private/template.rkt"
"rect.rkt")
(provide
cookie/c
exn:fail:m... |
68e547df6a49265cf589661eb9c43b53810279a9e60d7924ac8c216b29486c91 | reborg/clojure-essential-reference | 5.clj | < 1 >
(into (subvec v 0 idx)
(subvec v (inc idx) (count v))))
< 2 >
;; [0 1 2 4 5] | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/Vectors/subvec/5.clj | clojure | [0 1 2 4 5] | < 1 >
(into (subvec v 0 idx)
(subvec v (inc idx) (count v))))
< 2 > |
e5b6c9a13788b6737a1567563b612c3682ad12ccab00934a84f78988d9f652d0 | ocaml-sf/learn-ocaml-corpus | test.ml | open Report
open Test_lib
let sampler () = Random.int 10000
let () =
set_result @@
ast_sanity_check code_ast @@ fun () ->
[ Section ([ Text "Exercise 1:" ; Code "multiple_of" ],
test_function_2_against_solution
[%ty: int -> int -> bool] "multiple_of"
[ 4, 2 ; 8,3 ; 13,... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/mooc/week1/seq4/ex1/test.ml | ocaml | open Report
open Test_lib
let sampler () = Random.int 10000
let () =
set_result @@
ast_sanity_check code_ast @@ fun () ->
[ Section ([ Text "Exercise 1:" ; Code "multiple_of" ],
test_function_2_against_solution
[%ty: int -> int -> bool] "multiple_of"
[ 4, 2 ; 8,3 ; 13,... | |
329b211ca5675aa0daf0fc53060ccc74e6245beda7e16f31cde912cb05df3204 | robert-dodier/maxima-jupyter | kernel.lisp | (in-package #:maxima-jupyter)
(defparameter +status-complete+ "complete")
(defparameter +status-incomplete+ "incomplete")
(defparameter +status-invalid+ "invalid")
(defparameter +status-unknown+ "unknown")
(defvar *page-output* nil)
(defvar +abort-report+ "Exit debugger and halt cell execution.")
(defparameter over... | null | https://raw.githubusercontent.com/robert-dodier/maxima-jupyter/0e2ead13b5e4da93f0c35ea6c411df35b246b31b/src/kernel.lisp | lisp | This is the entry point for a saved lisp image created by
trivial-dump-core:save-executable or equivalent. | (in-package #:maxima-jupyter)
(defparameter +status-complete+ "complete")
(defparameter +status-incomplete+ "incomplete")
(defparameter +status-invalid+ "invalid")
(defparameter +status-unknown+ "unknown")
(defvar *page-output* nil)
(defvar +abort-report+ "Exit debugger and halt cell execution.")
(defparameter over... |
1c27519790b79a79c6bdbc9cf984eaee2c39dbc6c9f907ae6f71e032c19d4f02 | imitator-model-checker/imitator | Input.mli | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* IMITATOR
*
* Laboratoire Spécification et Vérification ( ENS Cachan & CNRS , France )
* Université Paris 13 , LIPN , CNRS , France
* Université de Lorraine ,... | null | https://raw.githubusercontent.com/imitator-model-checker/imitator/105408ae2bd8c3e3291f286e4d127defd492a58b/src/Input.mli | ocaml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
*
* IMITATOR
*
* Laboratoire Spécification et Vérification ( ENS Cachan & CNRS , France )
* Université Paris 13 , LIPN , CNRS , France
* Université de Lorraine ,... | |
a04dbc35bfa116c7048de1ad1019a3ccab425f19f06024855da603b2a787f184 | Factual/skuld | admin.clj | (ns skuld.admin
"Administrative cluster-management tasks."
(:require [clj-helix.admin :as helix]
[skuld.node :as node]))
(defn admin
"Create an administrator tool. Options:
:cluster the name of the skuld cluster (default \"skuld\")
:zookeeper a zookeeper connect string (\"localhost:2181\")
... | null | https://raw.githubusercontent.com/Factual/skuld/79599f9b13aee35c680183d6bf9e2fcbfde1d7c7/src/skuld/admin.clj | clojure | Create cluster itself
Create resource | (ns skuld.admin
"Administrative cluster-management tasks."
(:require [clj-helix.admin :as helix]
[skuld.node :as node]))
(defn admin
"Create an administrator tool. Options:
:cluster the name of the skuld cluster (default \"skuld\")
:zookeeper a zookeeper connect string (\"localhost:2181\")
... |
b89f63ee7e69236d98daff1fe0393a7d33959b3b7c3fa7ca19c741a36b94649b | lindig/lipsum | weave.mli | (** Weaving is called the process of formatting a literate program
as documentation (in contrast to formatting its embedded code
for compilation). This module provides formatters for weaving
a literate program. *)
exception NoSuchFormat of string (** requested format doesn't exist *)
type t = out_channel ... | null | https://raw.githubusercontent.com/lindig/lipsum/c441d7fddb6ecb0f6e306e536e5ed44bc40ccd93/src/weave.mli | ocaml | * Weaving is called the process of formatting a literate program
as documentation (in contrast to formatting its embedded code
for compilation). This module provides formatters for weaving
a literate program.
* requested format doesn't exist
emit doc to channel
* lookup named format
* names of availabl... |
type t = out_channel -> Litprog.doc -> unit
val lookup : string -> t
val formats : string list
|
d346385497530f979c097a29a6e151d53544d3eb2452f24edbffd5c9eb74505e | nomeata/free-theorems-static-webui | NameStores.hs |
-- | Provides functions to generate new variable names of different kinds.
module Language.Haskell.FreeTheorems.NameStores
( typeNameStore
, relationNameStore
, typeExpressionNameStore
, functionNameStore1
, functionNameStore2
, variableNameStore
) where
import Data.List (unfoldr)
... | null | https://raw.githubusercontent.com/nomeata/free-theorems-static-webui/44149706c2b809734ab3848047e314359bc59ccb/free-theorems/src/Language/Haskell/FreeTheorems/NameStores.hs | haskell | | Provides functions to generate new variable names of different kinds.
| An infinite list of names for type variables.
| An infinite list of names for relation variables.
| An infinite list of names for type expressions.
| An infinite list of names for function variables.
| Another infinite list of names for fun... |
module Language.Haskell.FreeTheorems.NameStores
( typeNameStore
, relationNameStore
, typeExpressionNameStore
, functionNameStore1
, functionNameStore2
, variableNameStore
) where
import Data.List (unfoldr)
typeNameStore :: [String]
typeNameStore = createNames "abcde" 'a'
rela... |
b07aacdc4ca42a73bc45bdb97999dc273bf522838b6d1e81731f113394441091 | mirage/bechamel | select.ml | let invalid_arg fmt = Format.ksprintf (fun s -> invalid_arg s) fmt
let load_file filename =
let ic = open_in filename in
let ln = in_channel_length ic in
let rs = Bytes.create ln in
let () = really_input ic rs 0 ln in
Bytes.unsafe_to_string rs
let sexp_linux = "(-lrt)"
let sexp_empty = "()"
let () =
let ... | null | https://raw.githubusercontent.com/mirage/bechamel/8e1a3e64c6723d1d9b2081aeb06d725024f88012/lib/monotonic_clock/select/select.ml | ocaml | let invalid_arg fmt = Format.ksprintf (fun s -> invalid_arg s) fmt
let load_file filename =
let ic = open_in filename in
let ln = in_channel_length ic in
let rs = Bytes.create ln in
let () = really_input ic rs 0 ln in
Bytes.unsafe_to_string rs
let sexp_linux = "(-lrt)"
let sexp_empty = "()"
let () =
let ... | |
da70107e1578d00b30cace532c4a3e0d39d306e95d2dfe33fb63d47d6860c1b7 | hexlet-codebattle/battle_asserts | core_test.clj | (ns battle-asserts.core-test
(:require [test-helper :as h]
[clojure.string :as s]
[clojure.test :refer [deftest]]
[clojure.java.io :as io]
[clojure.tools.namespace.find :as nsf]))
(defn test-issue [issue-ns-name]
(require [issue-ns-name])
(let [issue-name (s/replac... | null | https://raw.githubusercontent.com/hexlet-codebattle/battle_asserts/db9a3666c994c2a1fdbc013c69060ff512a8335d/test/battle_asserts/core_test.clj | clojure | (ns battle-asserts.core-test
(:require [test-helper :as h]
[clojure.string :as s]
[clojure.test :refer [deftest]]
[clojure.java.io :as io]
[clojure.tools.namespace.find :as nsf]))
(defn test-issue [issue-ns-name]
(require [issue-ns-name])
(let [issue-name (s/replac... | |
def292b43e51746eda7a485a8542f0d6786cf8bc2b9eba2488036b0e06fe82f1 | troy-west/kstream-examples | serdes.clj | (ns troy-west.serdes
(:require [cognitect.transit :as transit])
(:import (org.apache.kafka.common.serialization Deserializer Serializer Serde)
(java.io ByteArrayInputStream ByteArrayOutputStream)))
(defn do-serialize
[format data]
(when data
(let [stream (ByteArrayOutputStream.)]
(transit/... | null | https://raw.githubusercontent.com/troy-west/kstream-examples/bda1d0d898829ca44a07cf8ee488e940431e427f/src/troy_west/serdes.clj | clojure | (ns troy-west.serdes
(:require [cognitect.transit :as transit])
(:import (org.apache.kafka.common.serialization Deserializer Serializer Serde)
(java.io ByteArrayInputStream ByteArrayOutputStream)))
(defn do-serialize
[format data]
(when data
(let [stream (ByteArrayOutputStream.)]
(transit/... | |
18d62180f2ff41f979ef9b48ca6fb7a7cf5aca2d82c922d6480b8bce45d153f4 | camllight/camllight | ouster-f16.10.ml | #open "tk";;
let parse_color line =
let sep = function
` ` | `\t` -> true
| _ -> false in
let l = support__split_str sep line in
let r::rest = l in
let g::rest = rest in
let b::rest = rest in
let name = support__catenate_sep " " rest in
r,g,b,name
;;
(* Same bug as in the book (when color name... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/contrib/camltk/books-examples/ouster-f16.10.ml | ocaml | Same bug as in the book (when color name contains spaces)
e.g. selection get will return "{ghost white}"
| #open "tk";;
let parse_color line =
let sep = function
` ` | `\t` -> true
| _ -> false in
let l = support__split_str sep line in
let r::rest = l in
let g::rest = rest in
let b::rest = rest in
let name = support__catenate_sep " " rest in
r,g,b,name
;;
let top = OpenTk () in
let lb = listbo... |
2ec22f4a89d6bd6c9ddd4fe511b8afe4d443cbb2254762c2b94bf6362ee62ded | kadena-io/chainweaver | Orphans.hs | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE StandaloneDeriving #
# OPTIONS_GHC -Wno - orphans #
module Common.Orphans where
import Data.Aeson (FromJSONKey, ToJSONKey)
import qualified Pact.Types.ChainId as Pact
deriving instance Ord Pact.ChainId
deriving instance ToJSONKey Pact.ChainId
deriving instance From... | null | https://raw.githubusercontent.com/kadena-io/chainweaver/3ea0bb317c07ddf954d4ebf24b33d1be7d5f9c45/common/src/Common/Orphans.hs | haskell | # LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE StandaloneDeriving #
# OPTIONS_GHC -Wno - orphans #
module Common.Orphans where
import Data.Aeson (FromJSONKey, ToJSONKey)
import qualified Pact.Types.ChainId as Pact
deriving instance Ord Pact.ChainId
deriving instance ToJSONKey Pact.ChainId
deriving instance From... | |
62422df20c27a80c513839ddd03ac52033931cfb8d888ffaa8b63b56dc9150db | m4dc4p/haskelldb | DBSpecToDBDirect.hs | -----------------------------------------------------------
-- |
-- Module : DBSpecToDBDirect
Copyright : HWT Group ( c ) 2004 ,
-- License : BSD-style
--
Maintainer :
-- Stability : experimental
-- Portability : non-portable
--
Converts a DBSpec - generated database to a set of
( File... | null | https://raw.githubusercontent.com/m4dc4p/haskelldb/a1fbc8a2eca8c70ebe382bf4c022275836d9d510/src/Database/HaskellDB/DBSpec/DBSpecToDBDirect.hs | haskell | ---------------------------------------------------------
|
Module : DBSpecToDBDirect
License : BSD-style
Stability : experimental
Portability : non-portable
---------------------------------------------------------
| Common header for all files
| Adds LANGUAGE pragrams to the top of generated... | Copyright : HWT Group ( c ) 2004 ,
Maintainer :
Converts a DBSpec - generated database to a set of
( FilePath , Doc ) , that can be used to generate definition
files usable in HaskellDB ( the generation itself is done
in DBDirect )
module Database.HaskellDB.DBSpec.DBSpecToDBDirect
(specToHDB,... |
7f2a4890e62d27a2d31711696e22066152a36a5a630a5a29799c12df72d0e6e7 | fredlund/McErlang | mce_behav_schedulerOps.erl | Copyright ( c ) 2009 ,
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions are met:
%% %% Redistributions of source code must retain the above copyright
%% notice, this list of conditions a... | null | https://raw.githubusercontent.com/fredlund/McErlang/25b38a38a729fdb3c3d2afb9be016bbb14237792/behaviours/src/mce_behav_schedulerOps.erl | erlang | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
%% Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
%% Redi... | Copyright ( c ) 2009 ,
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR
@author
2006 - 2009
@private
-module(mce_behav_schedulerOps).
-include("sched.hrl").
-export([init/2,choose/4,willCom... |
d7d983b7c25a73a557ae5bf3ba8cb9cefb3701b1b67512e5a28dfd08d52aa4fe | metosin/metosin-common | dates.cljc | (ns metosin.edn.dates
"EDN tag readers and writers for JodaTime and goog.date.
Supports two types:
- DateTime (org.joda.time.DateTime, goog.date.UtcDateTime)
- LocalDate (org.joda.time.LocalDate, goog.date.Date)
Represents DateTimes in RFC 3339 format: yyyy-mm-ddTHH:MM:SS.sssZ.
RFC 3339 format is an speci... | null | https://raw.githubusercontent.com/metosin/metosin-common/6f6471052a82f85828c647b86905edd3890c825d/src/cljc/metosin/edn/dates.cljc | clojure | (ns metosin.edn.dates
"EDN tag readers and writers for JodaTime and goog.date.
Supports two types:
- DateTime (org.joda.time.DateTime, goog.date.UtcDateTime)
- LocalDate (org.joda.time.LocalDate, goog.date.Date)
Represents DateTimes in RFC 3339 format: yyyy-mm-ddTHH:MM:SS.sssZ.
RFC 3339 format is an speci... | |
8deeca4c8d698155926c8bebcc588a9ea113f6a16710c6e3868e60a8d1aab6d6 | ThoughtWorksInc/stonecutter | middleware.clj | (ns stonecutter.test.middleware
(:require [midje.sweet :refer :all]
[stonecutter.middleware :as middleware]))
(defn example-handler [request] "return value")
(defn wrap-function [handler] (fn [request] "wrap function return value"))
(def handlers {:handler-1 example-handler
:handler-2 ex... | null | https://raw.githubusercontent.com/ThoughtWorksInc/stonecutter/37ed22dd276ac652176c4d880e0f1b0c1e27abfe/test/stonecutter/test/middleware.clj | clojure | (ns stonecutter.test.middleware
(:require [midje.sweet :refer :all]
[stonecutter.middleware :as middleware]))
(defn example-handler [request] "return value")
(defn wrap-function [handler] (fn [request] "wrap function return value"))
(def handlers {:handler-1 example-handler
:handler-2 ex... | |
57ddb629e97a1aacd8424d3981790e52339113d588e2a483bd6ecae10b06d558 | haskellari/splitmix | MiniQC.hs | # LANGUAGE DeriveFunctor #
-- | This QC doesn't shrink :(
module MiniQC where
import Control.Monad (ap)
import Data.Int (Int32, Int64)
import Data.Word (Word32, Word64)
import Prelude ()
import Prelude.Compat
import Test.Framework.Providers.API (Test, TestN... | null | https://raw.githubusercontent.com/haskellari/splitmix/f89a4bb6a5f87565d15e88c3b3c0023546bbd0ff/tests/MiniQC.hs | haskell | | This QC doesn't shrink :( | # LANGUAGE DeriveFunctor #
module MiniQC where
import Control.Monad (ap)
import Data.Int (Int32, Int64)
import Data.Word (Word32, Word64)
import Prelude ()
import Prelude.Compat
import Test.Framework.Providers.API (Test, TestName)
import Test.Framework.Prov... |
5e14a55db0536f05380873a13c22b8eb0e6608d2c0407f2f93abc32637a7de7b | waldheinz/bling | Heightmap.hs |
module Graphics.Bling.Primitive.Heightmap (
heightMap
) where
import Graphics.Bling.Primitive
import Graphics.Bling.Primitive.TriangleMesh
import Graphics.Bling.Reflection
import Graphics.Bling.Texture
import qualified Data.Vector.Unboxed as UV
heightMap
:: ScalarMap2d
-> PixelSize
-> Material
... | null | https://raw.githubusercontent.com/waldheinz/bling/1f338f4b8dbd6a2708cb10787f4a2ac55f66d5a8/src/lib/Graphics/Bling/Primitive/Heightmap.hs | haskell | triangle indices
coordinates
normals
epsilon in x and z
uv |
module Graphics.Bling.Primitive.Heightmap (
heightMap
) where
import Graphics.Bling.Primitive
import Graphics.Bling.Primitive.TriangleMesh
import Graphics.Bling.Reflection
import Graphics.Bling.Texture
import qualified Data.Vector.Unboxed as UV
heightMap
:: ScalarMap2d
-> PixelSize
-> Material
... |
8427a251175887be87af8f7c2601093ac6105afddddc4505e2b25ecf68614a73 | AlexKnauth/toki-pi-kalama-musi | chord-names-in-C.rkt | #lang racket/base
(provide toki-pona-string->chord-names-in-C)
(require (only-in (submod music/data/note/note example) C4)
"chord-names.rkt")
(module+ main
(require racket/file
racket/string
rackunit
"../../common/command-line.rkt"))
(module+ test
(require racket/file
... | null | https://raw.githubusercontent.com/AlexKnauth/toki-pi-kalama-musi/b8a892f67fb5a2e370e982afa2c5c0ed2a8a3a44/racket/toki-pi-kalama-musi-lib/diatonic/inversion/chord-names-in-C.rkt | racket | ---------------------------------------------------------
toki-pona-string->chord-names-in-C : String -> String
--------------------------------------------------------- | #lang racket/base
(provide toki-pona-string->chord-names-in-C)
(require (only-in (submod music/data/note/note example) C4)
"chord-names.rkt")
(module+ main
(require racket/file
racket/string
rackunit
"../../common/command-line.rkt"))
(module+ test
(require racket/file
... |
29198d6461ea2f41c9e4c9df0f491e949aeec68fbc64d94cb858c0066e66194e | skanev/playground | 80.scm | SICP exercise 2.80
;
Define a generic predicate = zero ? that tests if its argument is zero , and
; instal it in the generic artihmetic package. The operation should work for
; ordinary numbers, rational numbers, and complex numbers.
; It would have been awesome if we could base this on the previous exercise.
; Ou... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/02/80.scm | scheme |
instal it in the generic artihmetic package. The operation should work for
ordinary numbers, rational numbers, and complex numbers.
It would have been awesome if we could base this on the previous exercise.
Our type system, however, unboxes the type tags and we cannot directly
delegate to equ?. Unfortunatelly, we... | SICP exercise 2.80
Define a generic predicate = zero ? that tests if its argument is zero , and
First , let 's start with the dispatch table .
(define table (make-hash))
(define (put op type item)
(hash-set! table (list op type) item))
(define (get op type)
(hash-ref table (list op type)))
(define (att... |
ffa5ad2ee6f998a830b7fe2a9e1f73cd8838d19a0b9d096bdef1d60e0a9d4b19 | nixeagle/nisp | util.lisp | (defpackage #:nisp.fbi.util
(:use :cl :iterate)
(:export #:make-keyword))
(in-package :nisp.fbi.util)
(defun make-keyword (string)
"Convert STRING to a keyword (uppercased)."
(declare (type string string))
(intern (string-upcase string) :keyword)) | null | https://raw.githubusercontent.com/nixeagle/nisp/680b40b3b9ea4c33db0455ac73cbe3756afdbb1e/fbi/util.lisp | lisp | (defpackage #:nisp.fbi.util
(:use :cl :iterate)
(:export #:make-keyword))
(in-package :nisp.fbi.util)
(defun make-keyword (string)
"Convert STRING to a keyword (uppercased)."
(declare (type string string))
(intern (string-upcase string) :keyword)) | |
a9d2a5961a062bceefb4f1d0f2e72f5f3cdb8f6db61c4186c5c974cebfdf51dc | billstclair/trubanc-lisp | md5.lisp | ;;;; This file implements The MD5 Message-Digest Algorithm, as defined in
RFC 1321 by , published April 1992 .
;;;;
It was written by , with copious input from the
cmucl - help mailing - list hosted at cons.org , in November 2001 and
;;;; has been placed into the public domain.
;;;;
$ I d : md5.lisp , v 1.... | null | https://raw.githubusercontent.com/billstclair/trubanc-lisp/5436d2eca5b1ed10bc47eec7080f6cb90f98ca65/systems/ironclad_0.26/md5.lisp | lisp | This file implements The MD5 Message-Digest Algorithm, as defined in
has been placed into the public domain.
While the implementation should work on all conforming Common
where it achieved comparable performance to the standard md5sum
hardware).
Since the implementation makes heavy use of arithmetic on
The ... | RFC 1321 by , published April 1992 .
It was written by , with copious input from the
cmucl - help mailing - list hosted at cons.org , in November 2001 and
$ I d : md5.lisp , v 1.3 2003/09/16 12:07:39 crhodes Exp $
Lisp implementations , it has only been optimized for CMU CL ,
utility ( within a factor ... |
72ecbfe98f688437c36fd4e2de773d227e3d81c0d2e0f733f0511963c6921726 | ronxin/stolzen | container.scm | #lang scheme
(define (container)
(define hash (make-hash))
(define (put op type item)
(hash-set! hash (cons op type) item)
)
(define (get op type)
(let
((key (cons op type)))
(if (hash-has-key? hash key)
(hash-ref hash key)
... | null | https://raw.githubusercontent.com/ronxin/stolzen/bb13d0a7deea53b65253bb4b61aaf2abe4467f0d/sicp/chapter2/2.5/generic-ops/container.scm | scheme | #lang scheme
(define (container)
(define hash (make-hash))
(define (put op type item)
(hash-set! hash (cons op type) item)
)
(define (get op type)
(let
((key (cons op type)))
(if (hash-has-key? hash key)
(hash-ref hash key)
... | |
f923c2960b96089572378c685fea7627cc5b50cd1906ed07265fd9a7ec035e66 | Oblosys/proxima | DocTypes_Generated.hs | # LANGUAGE StandaloneDeriving #
module DocTypes_Generated where
import Common.CommonTypes
import Evaluation.DocTypes
import Presentation.PresTypes
import Data.List
import Data.Char
import Data.Generics
data UserToken = KeyTk String -- StrTk is for keywords, so eq takes the string value into account
|... | null | https://raw.githubusercontent.com/Oblosys/proxima/f154dff2ccb8afe00eeb325d9d06f5e2a5ee7589/helium-editor/src/DocTypes_Generated.hs | haskell | StrTk is for keywords, so eq takes the string value into account
--- GENERATED PART STARTS HERE. DO NOT EDIT ON OR BEYOND THIS LINE -----
------------------------------------------------------------------------
------------------------------------------------------------------------
----------------------------------... | # LANGUAGE StandaloneDeriving #
module DocTypes_Generated where
import Common.CommonTypes
import Evaluation.DocTypes
import Presentation.PresTypes
import Data.List
import Data.Char
import Data.Generics
| IntTk
| LIdentTk
| UIdentTk
| OpTk
| S... |
3acfc7c25dd491fda5fdc87abf7b1c8c4634d760fc0311e01c2339900a74bc66 | andrewberls/predis | zset.clj | (ns predis.util.zset)
(defn zset-compare [[member-a score-a] [member-b score-b]]
(let [score-comp (compare score-a score-b)]
(if (zero? score-comp)
(compare member-a member-b)
score-comp)))
(defn sort-zset [zset]
(sort zset-compare zset))
(defn parse-zmin [score]
(if (= score "-inf") Float/NEGA... | null | https://raw.githubusercontent.com/andrewberls/predis/9479323a757dc73ee5101c4904b6bd7ef742aed6/src/predis/util/zset.clj | clojure | (ns predis.util.zset)
(defn zset-compare [[member-a score-a] [member-b score-b]]
(let [score-comp (compare score-a score-b)]
(if (zero? score-comp)
(compare member-a member-b)
score-comp)))
(defn sort-zset [zset]
(sort zset-compare zset))
(defn parse-zmin [score]
(if (= score "-inf") Float/NEGA... | |
7dfa23e323d3febe91a404dca5cbf5078b9bb96e1ab34910e71537f43da7b7af | eareese/htdp-exercises | 119-illegal-sentences.rkt | ; (define (f "x") x)
;; This is illegal because "x" is a value, not a variable, since it is in quote marks. Therefore, (f "x") is not legal syntax for the "as many variables as you wish" part of the define syntax.
; (define (f x y z) (x))
;; This would be legal, if not for the (x), which is not valid syntax for an exp... | null | https://raw.githubusercontent.com/eareese/htdp-exercises/a85ff3111d459dda0e94d9b463d01a09accbf9bf/part01-fixed-size-data/119-illegal-sentences.rkt | racket | (define (f "x") x)
This is illegal because "x" is a value, not a variable, since it is in quote marks. Therefore, (f "x") is not legal syntax for the "as many variables as you wish" part of the define syntax.
(define (f x y z) (x))
This would be legal, if not for the (x), which is not valid syntax for an expression... | |
33d17f839665b6111b121ae4fa51bcb62d597ded91e280b98e7220322040ace0 | manuel-serrano/bigloo | loops.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / api / libuv / examples / loops.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/d315487d6a97ef7b4483e919d1823a408337bd07/api/libbacktrace/examples/loops.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
*=====================================================================*/
*---------------------------... | * serrano / prgm / project / bigloo / api / libuv / examples / loops.scm * /
* Author : * /
* Creation : Tue May 6 12:10:13 2014 * /
* Last change : Thu Oct 23 08:20:28 2014 ( serrano ) * /
* C... |
93635109fd82ceb9eabab1cbd04c4c0c1bead883b00de40cd8fc4fb7bb391114 | input-output-hk/cardano-wallet | TxOut.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedLabels #
# LANGUAGE TypeApplications #
-- |
Copyright : © 2018 - 2022 IOHK
-- License: Apache-2.0
--
-- This module defines the 'TxOut' type.
--
module Cardano.Wallet.Primitive.Types.Tx.TxOut
(
-- *... | null | https://raw.githubusercontent.com/input-output-hk/cardano-wallet/157a6d5f977f4600373596b7cfa9700138e8e140/lib/primitive/lib/Cardano/Wallet/Primitive/Types/Tx/TxOut.hs | haskell | |
License: Apache-2.0
This module defines the 'TxOut' type.
* Type
* Queries
* Modifiers
------------------------------------------------------------------------------
Type
------------------------------------------------------------------------------
-----------------------------------------------------------... | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedLabels #
# LANGUAGE TypeApplications #
Copyright : © 2018 - 2022 IOHK
module Cardano.Wallet.Primitive.Types.Tx.TxOut
(
TxOut (..)
, assetIds
, coin
, addCoin
, mapAssetIds
, ... |
ee670aa1107dbf7e952cb09c863792b2592b99c3febe223e6329952d6d473238 | wargrey/graphics | mesh.rkt | #lang racket/base
(provide cairo-mesh-pattern) ; for tamer/prefab.rkt
(require "../../digitama/unsafe/pangocairo.rkt")
;;; -cairo-pattern-t.html#cairo-pattern-create-mesh
(define (cairo-mesh-pattern width height ratio density)
(define-values (bmp cr) (make-cairo-image width height density #true))
(define patter... | null | https://raw.githubusercontent.com/wargrey/graphics/50751297f244a01ac734099b9a1e9be97cd36f3f/bitmap/tamer/cairo/mesh.rkt | racket | for tamer/prefab.rkt
-cairo-pattern-t.html#cairo-pattern-create-mesh
Add a Gouraud-shaded triangle | #lang racket/base
(require "../../digitama/unsafe/pangocairo.rkt")
(define (cairo-mesh-pattern width height ratio density)
(define-values (bmp cr) (make-cairo-image width height density #true))
(define pattern (cairo_pattern_create_mesh))
(define-values (side rest) (values (* height ratio) (* height (- 1.0 ra... |
264bbf6ce9c3844719466ba3fc488945bf8b621116e6f9bcc4f67148ff059fa6 | PrecursorApp/precursor | common.clj | (ns pc.views.common
(:require [pc.assets]
[pc.profile :refer (prod-assets?)]))
(defn cdn-base-url []
(if (prod-assets?)
(pc.profile/cdn-base-url)
""))
(defn cdn-path [path]
(str (cdn-base-url) path))
(defn external-cdn-path [path]
(str "" path))
(defn head-style [] "
#om-app {
backgrou... | null | https://raw.githubusercontent.com/PrecursorApp/precursor/30202e40365f6883c4767e423d6299f0d13dc528/src/pc/views/common.clj | clojure | (ns pc.views.common
(:require [pc.assets]
[pc.profile :refer (prod-assets?)]))
(defn cdn-base-url []
(if (prod-assets?)
(pc.profile/cdn-base-url)
""))
(defn cdn-path [path]
(str (cdn-base-url) path))
(defn external-cdn-path [path]
(str "" path))
(defn head-style [] "
#om-app {
backgrou... | |
12f932e5f1c22f79a4b68345fb81dc9808d68fb756a2d6cd28fb7e7d12d43929 | ijvcms/chuanqi_dev | node_merge.erl | %%%-------------------------------------------------------------------
%%% @author qhb
( C ) 2016 , < COMPANY >
%%% @doc
%%% 合服相关节点
%%% @end
Created : 15 . 六月 2016 上午9:58
%%%-------------------------------------------------------------------
-module(node_merge).
%% API
-export([
start/0
]).
start() ->
merge_d... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/node/node_merge.erl | erlang | -------------------------------------------------------------------
@author qhb
@doc
合服相关节点
@end
-------------------------------------------------------------------
API | ( C ) 2016 , < COMPANY >
Created : 15 . 六月 2016 上午9:58
-module(node_merge).
-export([
start/0
]).
start() ->
merge_db:init_mysql(),
ServerIds = merge_cfg:get_source_servers(),
lists:foreach(fun(ServerId) -> merge_db:connect(ServerId) end, ServerIds),
ModList = [{misc_timer}, {mod_randseed},{merge_mod}],
o... |
534fd017bb1a2a34960c9ccbe11b6865a0a06c81bb47e8b3f8ce88d1c395b6ce | ocaml/ocamlbuild | lexers.mli | (***********************************************************************)
(* *)
(* ocamlbuild *)
(* *)
, , projet Galliu... | null | https://raw.githubusercontent.com/ocaml/ocamlbuild/792b7c8abdbc712c98ed7e69469ed354b87e125b/src/lexers.mli | ocaml | *********************************************************************
ocamlbuild
... | , , projet Gallium , INRIA Rocquencourt
Copyright 2007 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
Original author :
exception Error of (string * Lo... |
1b50ec9ef201647d3a22a0f124b6a592867476aed334c4716f5f841974ec53d7 | nikomatsakis/a-mir-formality | wfwc--hrtb.rkt | #lang racket
(require redex/reduction-semantics
"../../util.rkt"
"../../ty/user-ty.rkt"
"../grammar.rkt"
"../prove.rkt"
"../libcore.rkt"
)
#;(module+ test
(redex-let*
formality-decl
[(; trait Wf { }
TraitDecl_Wf
(term (trait Wf ((type S... | null | https://raw.githubusercontent.com/nikomatsakis/a-mir-formality/71be4d5c4bd5e91d326277eaedd19a7abe3ac76a/racket-src/rust/test/wfwc--hrtb.rkt | racket | (module+ test
trait Wf { }
impl<T> Wf for T { } | #lang racket
(require redex/reduction-semantics
"../../util.rkt"
"../../ty/user-ty.rkt"
"../grammar.rkt"
"../prove.rkt"
"../libcore.rkt"
)
(redex-let*
formality-decl
TraitDecl_Wf
(term (trait Wf ((type Self)) where [] {})))
TraitImpl... |
6be2568325d940ed091809cef33c1dd3868f56a7081e3dbbbca82c999be64242 | ttuegel/pipes-ghc-events | ghc-events-count.hs | module Main (main) where
import qualified GHC.RTS.Events as GHC
import qualified System.Environment as System
main :: IO ()
main = do
[filename] <- System.getArgs
eventLog <- GHC.readEventLogFromFile filename >>= either error return
let events = GHC.events $ GHC.dat eventLog
print (length events)
return ()
| null | https://raw.githubusercontent.com/ttuegel/pipes-ghc-events/9b658e8947f18cb1195e84d2b0c8a7c244161652/ghc-events-count.hs | haskell | module Main (main) where
import qualified GHC.RTS.Events as GHC
import qualified System.Environment as System
main :: IO ()
main = do
[filename] <- System.getArgs
eventLog <- GHC.readEventLogFromFile filename >>= either error return
let events = GHC.events $ GHC.dat eventLog
print (length events)
return ()
| |
c8fdb00877aa3e9be4c6053da8133da3ad5057cdcf685c628870e8700097cfed | RedPRL/stagedtt | Staging.ml | open Prelude
type mode =
| Inner
| Outer
type _ Effect.t +=
| GetStage : int Effect.t
let run ~(stage:int) k =
let open Effect.Deep in
try_with k ()
{ effc = fun (type a) (eff : a Effect.t) ->
match eff with
| GetStage -> Option.some @@ fun (k : (a, _) continuation) ->
c... | null | https://raw.githubusercontent.com/RedPRL/stagedtt/f88538036b51cebb83ebb0b418ec9b089550275d/lib/eff/Staging.ml | ocaml | open Prelude
type mode =
| Inner
| Outer
type _ Effect.t +=
| GetStage : int Effect.t
let run ~(stage:int) k =
let open Effect.Deep in
try_with k ()
{ effc = fun (type a) (eff : a Effect.t) ->
match eff with
| GetStage -> Option.some @@ fun (k : (a, _) continuation) ->
c... | |
da46332cb6e70fe08d6f4305e401f6671373ae00f61ef9100e13b0948d61362f | amnh/PCG | Internal.hs | -----------------------------------------------------------------------------
-- |
Module : Analysis . . Dynamic . DirectOptimization . Pairwise . Internal
Copyright : ( c ) 2015 - 2021 Ward Wheeler
-- License : BSD-style
--
-- Maintainer :
-- Stability : provisional
-- Portability : porta... | null | https://raw.githubusercontent.com/amnh/PCG/9341efe0ec2053302c22b4466157d0a24ed18154/lib/core/analysis/src/Analysis/Parsimony/Dynamic/DirectOptimization/Pairwise/Internal.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style
Maintainer :
Stability : provisional
Portability : portable
algorithms for performing a direct optimization heuristic alignment between
-----------------------------------------------------------------... | Module : Analysis . . Dynamic . DirectOptimization . Pairwise . Internal
Copyright : ( c ) 2015 - 2021 Ward Wheeler
Defines the primitive operations for standard Needleman - Wunsch and
two dynamic characters .
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
module Analysi... |
84a69f2f966bb5f90daf9e59c3682f79dd5e59acb88338b2fef79a7783b8e44f | janestreet/async_kernel | async_condition.mli | * Async 's implementation of the standard notion of a " condition " variable .
This is analogous to 's [ Condition ] module . The main guarantee that a condition
variable provides is that a call to [ signal ] ( or [ broadcast ] ) after a call to [ wait ]
will be seen by the waiter .
Unlike ... | null | https://raw.githubusercontent.com/janestreet/async_kernel/9575c63faac6c2d6af20f0f21ec535401f310296/src/async_condition.mli | ocaml | * Async 's implementation of the standard notion of a " condition " variable .
This is analogous to 's [ Condition ] module . The main guarantee that a condition
variable provides is that a call to [ signal ] ( or [ broadcast ] ) after a call to [ wait ]
will be seen by the waiter .
Unlike ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.