_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 |
|---|---|---|---|---|---|---|---|---|
c58b4cab1c967f9283c78e5552bf9f5df8074c83c19954d8c99f1db9663a2358 | dwysocki/mini-java | errors.clj | (ns mini-java.errors
"Utility functions for printing errors.
Used in both parse errors and static semantics errors."
(:require [mini-java.util :refer [parser-filename]]))
(defn underline-str
"Given a line with an error at the given index,
returns a string of whitespace ending with the ^ character, which
po... | null | https://raw.githubusercontent.com/dwysocki/mini-java/5f20c87fd33c7535b126a0c01bc567489b60cb67/src/mini_java/errors.clj | clojure | (ns mini-java.errors
"Utility functions for printing errors.
Used in both parse errors and static semantics errors."
(:require [mini-java.util :refer [parser-filename]]))
(defn underline-str
"Given a line with an error at the given index,
returns a string of whitespace ending with the ^ character, which
po... | |
40a6e7b0830686cf6afbbd1e430f47a1a459a6c6d506f897140dce6da582b1c2 | LeventErkok/sbvPlugin | Plugin.hs | ---------------------------------------------------------------------------
-- |
-- Module : Data.SBV.Plugin.Analyze
Copyright : ( c )
-- License : BSD3
-- Maintainer :
-- Stability : experimental
--
-- Main entry point to the SBV Plugin
--------------------------------------------------------... | null | https://raw.githubusercontent.com/LeventErkok/sbvPlugin/8d414961ed68aa80f306056eff4fe462142fc26e/Data/SBV/Plugin/Plugin.hs | haskell | -------------------------------------------------------------------------
|
Module : Data.SBV.Plugin.Analyze
License : BSD3
Maintainer :
Stability : experimental
Main entry point to the SBV Plugin
---------------------------------------------------------------------------
# OPTIONS_GHC -Wall -We... | Copyright : ( c )
# LANGUAGE NamedFieldPuns #
module Data.SBV.Plugin.Plugin(plugin) where
import GHC.Plugins
import System.Exit
import Data.Maybe (fromJust)
import Data.List (sortBy)
import Data.Bits (bitSizeMaybe)
import Data.IORef
import qualified Data.Map as M
import Data.SBV.Plugin.Common
import ... |
09d9f9078b107219a8288e807b8bb128cf03d9f328955363f614fd382b081497 | monadbobo/ocaml-core | extended_monad.ml | module List = Core.Std.List
module type S = sig
include Core.Monad.S
(* Like [List.map] but for functions which return monads *)
val map_monad : 'a list -> f : ('a -> 'b t) -> 'b list t
(* Like [map_monad] but ignores the outputs from the function. *)
val map_monad_ignore : 'a list -> f : ('a -> unit t) ->... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/extended/lib/extended_monad.ml | ocaml | Like [List.map] but for functions which return monads
Like [map_monad] but ignores the outputs from the function. | module List = Core.Std.List
module type S = sig
include Core.Monad.S
val map_monad : 'a list -> f : ('a -> 'b t) -> 'b list t
val map_monad_ignore : 'a list -> f : ('a -> unit t) -> unit t
end
module Make (M : Core.Monad.Basic) : S with type 'a t := 'a M.t = struct
include Core.Monad.Make (M)
let map_mon... |
1b1ecd2d577d18a62b592ed2b2aa6e6303b717a5554cf01039d3036515577bc6 | WorksHub/client | www_homepage.cljc | (ns wh.components.www-homepage
(:require
#?(:cljs [reagent.core :as r])
[clojure.string :as str]
[wh.common.data :as data]
[wh.common.text :as txt]
[wh.components.carousel :refer [carousel]]
[wh.components.common :refer [companies-section link]]
[wh.components.icons :refer [icon]]
[wh.... | null | https://raw.githubusercontent.com/WorksHub/client/e05a66f512bd37d0c3372e3d305fdfaa43290c79/common/src/wh/components/www_homepage.cljc | clojure | (ns wh.components.www-homepage
(:require
#?(:cljs [reagent.core :as r])
[clojure.string :as str]
[wh.common.data :as data]
[wh.common.text :as txt]
[wh.components.carousel :refer [carousel]]
[wh.components.common :refer [companies-section link]]
[wh.components.icons :refer [icon]]
[wh.... | |
412d7c6eb327488ee808da2c748363060585be5169062facb67fb12370f61e02 | binsec/haunted | relse_utils.mli | type assignment_t =
| Var of string * Size.Bit.t * Rel_expr.rel_bv (* name, value *)
| Mem of Dba.size * Rel_expr.rel_bv * Rel_expr.rel_bv (* size, index, value *)
(* TODO: change to functions ? *)
32 bits
32 bits
8
val is_sse : unit -> bool
val is_self_composed : unit -> bool
val is_relational : unit -> bo... | null | https://raw.githubusercontent.com/binsec/haunted/7ffc5f4072950fe138f53fe953ace98fff181c73/src/relse/relse_utils.mli | ocaml | name, value
size, index, value
TODO: change to functions ?
* Detect if the instruction is a conditional jump.
Heuristic to detect conditional jump: has multiple outer targets. *
* Detect if the instruction is a return statement *
* [read_bitvector bv size] Reads [size] bytes in the image of the
executable ... | type assignment_t =
32 bits
32 bits
8
val is_sse : unit -> bool
val is_self_composed : unit -> bool
val is_relational : unit -> bool
val get_main_symbol: unit -> Loader.Symbol.t
val int_to_bitvector : int -> Bitvector.t
val dba_constant_from_int: int -> Dba.Expr.t
* [ is_loadable addr ] Returns true if [ ad... |
6ba12aa383da8de8e66e90c656d2850369add5dea4789991db26bf818787542b | Helium4Haskell/helium | CatchBug.hs | main = catch (do { [x] <- return [1, 2, 3]; return () })
(\err -> putStr "The exception has been caught")
| null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/runtimeerrors/CatchBug.hs | haskell | main = catch (do { [x] <- return [1, 2, 3]; return () })
(\err -> putStr "The exception has been caught")
| |
0fb2c3bac98640de514f4490453786545406b0c5d3da0337e87b35775f80f3b7 | lambdaclass/riak_core_tutorial | rc_example_app.erl | -module(rc_example_app).
-behaviour(application).
%% Application callbacks
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
ok = riak_core:register([{vnode_module, rc_example_vnode}]),
ok = riak_core_node_watcher:service_up(rc_example, self()),
rc_example_sup:start_link().
stop(_State) ->
... | null | https://raw.githubusercontent.com/lambdaclass/riak_core_tutorial/45245d92e080032696e6cee1dbe5741abd7a986d/src/rc_example_app.erl | erlang | Application callbacks | -module(rc_example_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
ok = riak_core:register([{vnode_module, rc_example_vnode}]),
ok = riak_core_node_watcher:service_up(rc_example, self()),
rc_example_sup:start_link().
stop(_State) ->
ok.
|
2c5da7084606a1be9343475f59e84c193551b98ac5164603609038dae947cc48 | vaclavsvejcar/headroom | UpdateCopyrightSpec.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE StrictData #-}
# LANGUAGE NoImplicitPrelude #
module Headroom.PostProcess.UpdateCopyrightSpec
( spec
)
where
import Headroom.Data.Has (Has (..))
import Headroom.Data.Text (fromLines)
import Headroo... | null | https://raw.githubusercontent.com/vaclavsvejcar/headroom/3b20a89568248259d59f83f274f60f6e13d16f93/test/Headroom/PostProcess/UpdateCopyrightSpec.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
----------------------------- TEST DATA TYPES ------------------------------ | # LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoImplicitPrelude #
module Headroom.PostProcess.UpdateCopyrightSpec
( spec
)
where
import Headroom.Data.Has (Has (..))
import Headroom.Data.Text (fromLines)
import Headroom.PostProcess (postProcess)
import Headroom.PostProcess.UpdateC... |
9e80e93522836481bcf3967a65e767eb4ede3839215b67d52b76123441d4676a | keithfancher/tvmv | Rename.hs | module Exec.Rename
( RenameResult (..),
executeRename,
getOp,
makeOpRelative,
makeResultRelative,
)
where
import Control.Exception (try)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Writer.Class (MonadWriter, tell)
import Domain.Rename (RenameOp (..))
import System.Directory... | null | https://raw.githubusercontent.com/keithfancher/tvmv/62e500e5dbc981ae7baeea8e6608e0db3fea21ef/src/Exec/Rename.hs | haskell | Not quite an Either, since we want the op to exist even in failure cases.
Actually rename the files on the file system. Accumulate a "log" of rename
results.
Rename a single file on the file system. The result of the operation,
whether a success or failure, will be added to the Writer values for later
logging. | module Exec.Rename
( RenameResult (..),
executeRename,
getOp,
makeOpRelative,
makeResultRelative,
)
where
import Control.Exception (try)
import Control.Monad.IO.Class (MonadIO, liftIO)
import Control.Monad.Writer.Class (MonadWriter, tell)
import Domain.Rename (RenameOp (..))
import System.Directory... |
321f67ba081158f3a6fe59a8a47f706134b9d731662a2fa6c1ccb355b7fae884 | luminus-framework/luminus-migrations | core.clj | (ns luminus-migrations.core
(:require
[clojure.set :refer [rename-keys]]
[clojure.string :refer [join]]
[migratus.core :as migratus]
[luminus-migrations.util :refer [to-jdbc-uri]]))
(defn- parse-ids [args]
(map #(Long/parseLong %) (rest args)))
(defn- parse-url
([opts] (parse-url opts identity))... | null | https://raw.githubusercontent.com/luminus-framework/luminus-migrations/9f9437a9a817c297bdfb9209a64cde290c7f06c0/src/luminus_migrations/core.clj | clojure | (ns luminus-migrations.core
(:require
[clojure.set :refer [rename-keys]]
[clojure.string :refer [join]]
[migratus.core :as migratus]
[luminus-migrations.util :refer [to-jdbc-uri]]))
(defn- parse-ids [args]
(map #(Long/parseLong %) (rest args)))
(defn- parse-url
([opts] (parse-url opts identity))... | |
99208f4289b862a453528deaecba3d92c6a6e4fc603afc45dc8f7391603c584e | racket/math | number-theory.rkt | #lang typed/racket
(require "../base/base-random.rkt"
"divisibility.rkt"
"modular-arithmetic.rkt"
"types.rkt"
"small-primes.rkt")
(require/typed typed/racket
[integer-sqrt/remainder (Natural -> (Values Natural Natural))])
(provide solve-chinese
; ... | null | https://raw.githubusercontent.com/racket/math/3409a8e6e3b456fd3a5622e525931af49cd456b5/math-lib/math/private/number-theory/number-theory.rkt | racket | primes
roots
Powers
number theoretic functions
Configuration
Determines the size of the pre-built table of very small primes
Powers
(max-dividing-power p n) = m <=> p^m | n and p^(m+1) doesn't divide n
(display (list 'fs 'p-to-e p-to-e 'e e)) (newline)
p-to-e divides n and p-to-e = p^e
(display (list... | #lang typed/racket
(require "../base/base-random.rkt"
"divisibility.rkt"
"modular-arithmetic.rkt"
"types.rkt"
"small-primes.rkt")
(require/typed typed/racket
[integer-sqrt/remainder (Natural -> (Values Natural Natural))])
(provide solve-chinese
nt... |
844ec282827175096c4881419b0c843432b4c3dd7d3cacb0ee13be15111da9c6 | sellout/haskerwaul | Ribbon.hs | # language UndecidableSuperClasses #
module Haskerwaul.Category.Ribbon
( module Haskerwaul.Category.Ribbon
-- * extended modules
, module Haskerwaul.Category.Monoidal.Balanced
, module Haskerwaul.Category.Monoidal.Rigid
) where
import Haskerwaul.Category.Monoidal.Balanced
import Haskerwaul.Category.Monoidal... | null | https://raw.githubusercontent.com/sellout/haskerwaul/cf54bd7ce5bf4f3d1fd0d9d991dc733785b66a73/src/Haskerwaul/Category/Ribbon.hs | haskell | * extended modules
|
= references
- [nLab](+category)
- [Wikipedia]()
__NB__: Instances for this are automatically coalesced. | # language UndecidableSuperClasses #
module Haskerwaul.Category.Ribbon
( module Haskerwaul.Category.Ribbon
, module Haskerwaul.Category.Monoidal.Balanced
, module Haskerwaul.Category.Monoidal.Rigid
) where
import Haskerwaul.Category.Monoidal.Balanced
import Haskerwaul.Category.Monoidal.Rigid
class (BalancedM... |
06ad3d4f0337dfaf78a6056887dac8f8954f67358dbdd64c4018f292d07a450b | linkfluence/inventory | app.clj | (ns com.linkfluence.inventory.app
(:import [java.util.concurrent LinkedBlockingQueue])
(:require [clojure.string :as str]
[clojure.tools.logging :as log]
[com.linkfluence.store :as store]
[com.linkfluence.utils :as u]
[clj-http.client :as http]
[cheshire.c... | null | https://raw.githubusercontent.com/linkfluence/inventory/b69110494f8db210d14cc7093834c441440cd4e8/src/clj/com/linkfluence/inventory/app.clj | clojure | queue for inventory update
this the main inventory for apps
atom for conf
return queue size
applicable if we wan't to store something (ie : not during test)
load envs
store inventory backup
applicable if we wan't to store something (ie : not during test)
save apps
add event Update
Env mgt
Env getter
App tagging
App ge... | (ns com.linkfluence.inventory.app
(:import [java.util.concurrent LinkedBlockingQueue])
(:require [clojure.string :as str]
[clojure.tools.logging :as log]
[com.linkfluence.store :as store]
[com.linkfluence.utils :as u]
[clj-http.client :as http]
[cheshire.c... |
29f409655e8406442362a49f92adcc374f3058cf1044ab5078c74c20965f35f2 | engineyard/vertebra-erl | uuid_server.erl | Copyright 2008 , Engine Yard , Inc.
%
This file is part of Vertebra .
%
Vertebra 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
% lat... | null | https://raw.githubusercontent.com/engineyard/vertebra-erl/cf6e7c84f6dfbf2e31f19c47e9db112ae292ec27/lib/vertebra/src/uuid_server.erl | erlang |
terms of the GNU Lesser General Public License as published by the Free
later version.
WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR
A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
details.
API
gen_server callbacks
====================================... | Copyright 2008 , Engine Yard , Inc.
This file is part of Vertebra .
Vertebra is free software : you can redistribute it and/or modify it under the
Software Foundation , either version 3 of the License , or ( at your option ) any
Vertebra is distributed in the hope that it will be useful , but WITHOUT ANY
Yo... |
02fa120caeb9b7f2944c0603520027be36daa7c67135d36c90f44f5a4fc7744a | ocamllabs/ocaml-modular-implicits | t210-setfield0.ml | open Lib;;
type t = {
mutable a : int;
};;
let x = {a = 7} in
x.a <- 11;
if x.a <> 11 then raise Not_found;
x
;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 CONSTINT 7
11 MAKEBLOCK1 0
13 PUSHCONSTINT 11
15 PUSHACC1
16 ... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/tool-ocaml/t210-setfield0.ml | ocaml | open Lib;;
type t = {
mutable a : int;
};;
let x = {a = 7} in
x.a <- 11;
if x.a <> 11 then raise Not_found;
x
;;
*
0 CONSTINT 42
2 PUSHACC0
3 MAKEBLOCK1 0
5 POP 1
7
9 CONSTINT 7
11 MAKEBLOCK1 0
13 PUSHCONSTINT 11
15 PUSHACC1
16 ... | |
b3e19ac6a5f1c0a0e68d3299637ef30cb001afc1ce211d1ae5ac05c307b44f65 | kiranlak/austin-sbst | checkUnsupportedFeatures.ml | Copyright : , University College London , 2011
open Cil
class unsupportedVisitor (found:bool ref) = object
inherit nopCilVisitor
method vfunc (f:fundec) =
if (startsWith "Austin__" f.svar.vname) then SkipChildren
else DoChildren
method vinst (i:instr) =
match i with
| Call(_,f,_,_) ->
(
... | null | https://raw.githubusercontent.com/kiranlak/austin-sbst/9c8aac72692dca952302e0e4fdb9ff381bba58ae/AustinOcaml/instrumentation/checkUnsupportedFeatures.ml | ocaml | Copyright : , University College London , 2011
open Cil
class unsupportedVisitor (found:bool ref) = object
inherit nopCilVisitor
method vfunc (f:fundec) =
if (startsWith "Austin__" f.svar.vname) then SkipChildren
else DoChildren
method vinst (i:instr) =
match i with
| Call(_,f,_,_) ->
(
... | |
70be9e58003ee00bda100de645d3660e933622310dfcef68074d65806744906b | mbj/mhs | CBT.hs | module CBT
( CBT.Config
, CBT.Env
, CBT.loadDefaultConfig
, Environment(..)
, runDefaultEnvironment
)
where
import CBT.Prelude
import qualified CBT.Config as CBT
import qualified MRIO.Log as Log
data Environment = Environment
{ cbtConfig :: CBT.Config
, logAction :: Log.Action
}
runDefaultEnviro... | null | https://raw.githubusercontent.com/mbj/mhs/703bf13f973cb89c983b5c79ae18b71447b04d18/cbt/src/CBT.hs | haskell | module CBT
( CBT.Config
, CBT.Env
, CBT.loadDefaultConfig
, Environment(..)
, runDefaultEnvironment
)
where
import CBT.Prelude
import qualified CBT.Config as CBT
import qualified MRIO.Log as Log
data Environment = Environment
{ cbtConfig :: CBT.Config
, logAction :: Log.Action
}
runDefaultEnviro... | |
9138e82d30b07b63803d23f2594d1bec5740d505562b6d170f90bb6014488347 | petelliott/pscheme | base.scm | (import (scheme base)
(pscheme test))
6.1 : Equivalence predicates
(define-test "eqv?"
;; true cases
(assert (eqv? #t #t))
(assert (eqv? #f #f))
(assert (eqv? 'hello 'hello))
(assert (eqv? (+ 1 2) (+ 1 2)))
;; TODO: non-fixnums
(assert (eqv? #\a #\a))
(assert (eqv? '() '()))
(define a '(1 ... | null | https://raw.githubusercontent.com/petelliott/pscheme/2f887315d9f667ed4c15f4fcc7bcbfc873aa74c9/test/lib/scheme/base.scm | scheme | true cases
TODO: non-fixnums
false cases
TODO: exact vs inexact
TODO: NaN
true cases
false cases
true cases
TODO: circular forms | (import (scheme base)
(pscheme test))
6.1 : Equivalence predicates
(define-test "eqv?"
(assert (eqv? #t #t))
(assert (eqv? #f #f))
(assert (eqv? 'hello 'hello))
(assert (eqv? (+ 1 2) (+ 1 2)))
(assert (eqv? #\a #\a))
(assert (eqv? '() '()))
(define a '(1 2 3))
(assert (eqv? a a))
(define b... |
73bc6aae3b1eb8f61648c301be6e879e2480e65ae7e271f0e4588817c2a9c768 | cram2/cram | low-level-common.lisp | ;;;
Copyright ( c ) 2016 , < >
;;; 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... | null | https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_pr2/cram_pr2_low_level/src/low-level-common.lisp | lisp |
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redi... | Copyright ( c ) 2016 , < >
* Neither the name of the Institute for Artificial Intelligence/
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR ... |
f0ea9ab9e1482eff64fe4ba611b1aac423a31bd1ecb800d8eef9d14f0efe5186 | ocamllabs/ocaml-modular-implicits | stypes.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ,... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/typing/stypes.ml | ocaml | *********************************************************************
OCaml
... | , projet , INRIA Rocquencourt
Copyright 2003 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
open Annot;;
open Lexing;;
open Location;;
ope... |
96fccbeb3129b43e83e74a8557ee72daebf027c1db38a924c2fcd0e4e9a9c368 | danoctavian/bit-smuggler | StreamMultiplexSpec.hs | {-# LANGUAGE OverloadedStrings #-}
module StreamMultiplexSpec (main, spec) where
import Test.Hspec
import Test.QuickCheck
import Test.QuickCheck.Monadic (PropertyM, assert, monadicIO, pick, pre, run)
import Data.Conduit as DC
import Data.Conduit.List as DC
import Prelude as P
import Control.Concurrent.Async
import Con... | null | https://raw.githubusercontent.com/danoctavian/bit-smuggler/4385ed67f1fec4ed441832fc9a119de632b796aa/BitSmuggler/test/unit/StreamMultiplexSpec.hs | haskell | # LANGUAGE OverloadedStrings #
easiest test
liftIO $ updateGlobalLogger logger (setLevel DEBUG)
run concurrent requests | module StreamMultiplexSpec (main, spec) where
import Test.Hspec
import Test.QuickCheck
import Test.QuickCheck.Monadic (PropertyM, assert, monadicIO, pick, pre, run)
import Data.Conduit as DC
import Data.Conduit.List as DC
import Prelude as P
import Control.Concurrent.Async
import Control.Concurrent.STM
import Control.... |
9e77cd9b414d27ba30ddc72c7b4598becfd164b9b4e0507e7324ba78c0b4650b | patricoferris/jsoo-mithril | vnode.mli | type t
* The type of virtual DOM nodes
val of_jv : Jv.t -> t
val to_jv : t -> Jv.t
type tag =
| String of Jstr.t
| Obj of Jv.t
* Virtual DOM tags see { { : #structure }
vnode docs } .
mithril vnode docs}. *)
(** {1 Properties} *)
val tag : t -> tag
val key : t -> Jv.t option
val attrs ... | null | https://raw.githubusercontent.com/patricoferris/jsoo-mithril/5f2ccebd647f737bac7dbd1981b78a4d5bd0f5ea/lib/vnode.mli | ocaml | * {1 Properties} | type t
* The type of virtual DOM nodes
val of_jv : Jv.t -> t
val to_jv : t -> Jv.t
type tag =
| String of Jstr.t
| Obj of Jv.t
* Virtual DOM tags see { { : #structure }
vnode docs } .
mithril vnode docs}. *)
val tag : t -> tag
val key : t -> Jv.t option
val attrs : t -> Jv.t option
va... |
17ec04cb09d26660011315487c04e318fc5daa99bf7fafe2549805c2e1c10257 | pariyatti/kosa | mediabox.cljs | (ns kuti.mediabox
(:require-macros
[reagent-forms.macros :refer [render-element]])
(:require
[clojure.string :as string :refer [trim]]
[reagent.core :as r :refer [atom]]
[reagent-forms.core :as rf]))
(defn- scroll-to [element idx]
(let [list-elem (-> element
.-target
... | null | https://raw.githubusercontent.com/pariyatti/kosa/75896fea96b3ff3f47551e272be2c45616af074e/src-cljs/kuti/mediabox.cljs | clojure | NOTE: this used to be `.-target` but since our contents are an `img` tag, we
need to target the actual `li`. there might be a much better way. -sd
show selected url: | (ns kuti.mediabox
(:require-macros
[reagent-forms.macros :refer [render-element]])
(:require
[clojure.string :as string :refer [trim]]
[reagent.core :as r :refer [atom]]
[reagent-forms.core :as rf]))
(defn- scroll-to [element idx]
(let [list-elem (-> element
.-target
... |
2c1784bfb968e01fb20db686255af8129f7e8f3ec6e398d212272d73e4bf4cdd | vaibhavsagar/experiments | A.hs | module A where
a :: Char
a = 'a'
| null | https://raw.githubusercontent.com/vaibhavsagar/experiments/378d7ba97eabfc7bbeaa4116380369ea6612bfeb/hugs/packages/Cabal/tests/depOnLib/libs/A.hs | haskell | module A where
a :: Char
a = 'a'
| |
7e82b75ed98dd993ebe203eeeb1a79f61e6eea295904122ca4088ecc08f79e58 | robert-strandh/SICL | dependent-maintenance.lisp | (cl:in-package #:sicl-clos)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
Generic function ADD - DEPENDENT .
;;;
;;; For the specification of this generic function, see
;;; -MOP/add-dependent.html
(defgeneric add-dependent (metaobject dependent))
(defun add-dependent-default (metaobject... | null | https://raw.githubusercontent.com/robert-strandh/SICL/cc8406ee55c5dbc13387204777ff10d398a24ac4/Code/CLOS/dependent-maintenance.lisp | lisp |
For the specification of this generic function, see
-MOP/add-dependent.html
Generic function REMOVE-DEPENDENT.
For the specification of this generic function, see
-MOP/remove-dependent.html
For the specification of this generic function, see
-MOP/map-dependents.html
For the specification of this gen... | (cl:in-package #:sicl-clos)
Generic function ADD - DEPENDENT .
(defgeneric add-dependent (metaobject dependent))
(defun add-dependent-default (metaobject dependent)
(pushnew dependent (dependents metaobject) :test #'eq))
(defmethod add-dependent ((metaobject standard-class) dependent)
(add-dependent-default me... |
6755f67403d2c4b8ddd4cb447dc0a75d30c3b25ec6f5d2b1f94ae1726ab56d1a | pflanze/chj-schemelib | wbtable.scm | Copyright 2016 - 2020 by < >
;;; This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 3 of the License , or
;;; (at your option) any later version. Also, as a spe... | null | https://raw.githubusercontent.com/pflanze/chj-schemelib/59ff8476e39f207c2f1d807cfc9670581c8cedd3/wbtable.scm | scheme | This file is free software; you can redistribute it and/or modify
(at your option) any later version. Also, as a special exception to the
terms of the GPL you can link it with any code produced by Categorical
list.wbtable-of nah just too many args, k? ;; no list.wbtable, OK?
list.wbtable-function
with r... | Copyright 2016 - 2020 by < >
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 3 of the License , or
Design Solutions Inc. from Quebec , Canada .
(require easy
show
cj-cmp
wbtree
Maybe
test)
(export (class ... |
c026991258be283dd1f05206c78c1c141cea5ba33eccc488d0d6ec48603bfa55 | returntocorp/semgrep | Rule.ml |
*
* Copyright ( C ) 2019 - 2022 r2c
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file LICE... | null | https://raw.githubusercontent.com/returntocorp/semgrep/ab09346ea6471a5c7f4db0791657d35d6de61817/src/core/Rule.ml | ocaml | ***************************************************************************
Prelude
***************************************************************************
***************************************************************************
Position information
***********************************************************... |
*
* Copyright ( C ) 2019 - 2022 r2c
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file LICE... |
7a1061fc5f4cc64750112af3341862d54fdf43c7a4025255e80d242cd40eaf34 | tnelson/Forge | address.rkt | #lang forge2
module tour/addressBook1
sig Name, Addr {}
sig Book {addr: Name -> lone Addr}
pred show (b: Book) {
#b.addr > 1
#Name.(b.addr) > 1
}
/*
run show for 3 but 1 Book
pred add (b, b': Book, n: Name, a: Addr) {b'.addr = b.addr + n -> a}
pred del (b, b': Book, n: Name) {b'.addr = b.addr - n -> Addr... | null | https://raw.githubusercontent.com/tnelson/Forge/1687cba0ebdb598c29c51845d43c98a459d0588f/forge/examples/address.rkt | racket | #lang forge2
module tour/addressBook1
sig Name, Addr {}
sig Book {addr: Name -> lone Addr}
pred show (b: Book) {
#b.addr > 1
#Name.(b.addr) > 1
}
/*
run show for 3 but 1 Book
pred add (b, b': Book, n: Name, a: Addr) {b'.addr = b.addr + n -> a}
pred del (b, b': Book, n: Name) {b'.addr = b.addr - n -> Addr... | |
99782214b5392566889a0161ece2e676f8119f1b517f3f2e631df45fa17d8845 | acowley/hpp | Directive.hs | # LANGUAGE LambdaCase , OverloadedStrings , ScopedTypeVariables ,
ViewPatterns #
ViewPatterns #-}
| Implement the logic of CPP directives ( commands prefixed with an
octothorpe ) .
module Hpp.Directive (directive, macroExpansion) where
import Control.Monad (unless)
import Control.Monad.T... | null | https://raw.githubusercontent.com/acowley/hpp/e54be4a8da7c9812c2a5e3f7f69ffe13ad7ea638/src/Hpp/Directive.hs | haskell | | Returns everything up to the next newline. The newline character
itself is consumed.
Eat the newline character
Eat the newline character
| Run a Stream with a configuration for a new file.
NOTE: We should *NOT* use a the config lens here
because it will mutate the directory which
we *don't* want i... | # LANGUAGE LambdaCase , OverloadedStrings , ScopedTypeVariables ,
ViewPatterns #
ViewPatterns #-}
| Implement the logic of CPP directives ( commands prefixed with an
octothorpe ) .
module Hpp.Directive (directive, macroExpansion) where
import Control.Monad (unless)
import Control.Monad.T... |
4370bb9cb4511106fb2c4d23590848928244cf88f01a2e928f4dadff15de8543 | crisptrutski/matchbox | utils.cljc | (ns matchbox.utils
(:refer-clojure :exclude [prn])
(:require [clojure.string :as str]))
(defn kebab->underscore [keyword]
(-> keyword name (str/replace "-" "_")))
(defn underscore->kebab [string]
(-> string (str/replace "_" "-") keyword))
(defn korks->path [korks]
(if (sequential? korks)
(str/join "/" ... | null | https://raw.githubusercontent.com/crisptrutski/matchbox/5bb9ba96f5df01bce302a8232f6cddd9d64a1d71/src/matchbox/utils.cljc | clojure | (ns matchbox.utils
(:refer-clojure :exclude [prn])
(:require [clojure.string :as str]))
(defn kebab->underscore [keyword]
(-> keyword name (str/replace "-" "_")))
(defn underscore->kebab [string]
(-> string (str/replace "_" "-") keyword))
(defn korks->path [korks]
(if (sequential? korks)
(str/join "/" ... | |
8cb9ec7e92476c4d24018ad01aa0663b82a1bd5a702a86201a997199bfd79509 | DOBRO/uef-lib | uef_bin_tests.erl | Copyright ( c ) 2019 - 2022 , < > . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in w... | null | https://raw.githubusercontent.com/DOBRO/uef-lib/765d28837584bcfced1aae5d5f831972ec0254bb/test/uef_bin_tests.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permi... | Copyright ( c ) 2019 - 2022 , < > . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(uef_bin_tests).
-include_lib("eunit/include/eunit.hrl").
numeric_prefix_test_() ->
[
?_assertE... |
7187f8f0c3098122d2eedc492c9f784d935f42de8adad63008e32e75a42994b0 | cornell-netlab/yates | LP_Lang.ml | open Core
open Yates_types.Types
(* (s,t,r) = node s wants to send to node t at rate r *)
type demand_pair = Topology.vertex * Topology.vertex * float
type arith_exp =
| Var of string
| Num of float
| Times of float * arith_exp
| Sum of arith_exp list
type constrain =
| Eq of string * arith_exp * float
... | null | https://raw.githubusercontent.com/cornell-netlab/yates/fc30922933fae3184923f7b138d24454a9537536/lib/routing/LP_Lang.ml | ocaml | (s,t,r) = node s wants to send to node t at rate r
Given an edge (i,j) and a source-sink pair (s,t),
* returns the name of the variable representing the
* flow on (i,j) originating from s and going to t.
Same as above, but for the flow in the reverse direction (j,i). | open Core
open Yates_types.Types
type demand_pair = Topology.vertex * Topology.vertex * float
type arith_exp =
| Var of string
| Num of float
| Times of float * arith_exp
| Sum of arith_exp list
type constrain =
| Eq of string * arith_exp * float
| Leq of string * arith_exp * float
| Geq of string * a... |
475463fdd07ea000493364a8f59f13c70a4fde0fc50bfd018081c01c2a26acb8 | erlang-ls/erlang_ls | els_dap_test_utils.erl | -module(els_dap_test_utils).
-export([
all/1,
all/2,
end_per_suite/1,
end_per_testcase/2,
init_per_suite/1,
init_per_testcase/2,
wait_for/2,
wait_for_fun/3
]).
-include_lib("common_test/include/ct.hrl").
%%==============================================================================
... | null | https://raw.githubusercontent.com/erlang-ls/erlang_ls/2dfb48aca3879e5b44f6fd676f8349525262779f/apps/els_dap/test/els_dap_test_utils.erl | erlang | ==============================================================================
Defines
==============================================================================
==============================================================================
Types
===================================================================... | -module(els_dap_test_utils).
-export([
all/1,
all/2,
end_per_suite/1,
end_per_testcase/2,
init_per_suite/1,
init_per_testcase/2,
wait_for/2,
wait_for_fun/3
]).
-include_lib("common_test/include/ct.hrl").
-define(TEST_APP, <<"code_navigation">>).
-type config() :: [{atom(), any()}].
... |
da96b2e81187ebe8e55e2aabe9f3c45d31d3112bb7669f44c72c85177a9ea961 | binaryage/chromex | playground.cljs | (ns chromex.test.playground
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [chromex.chrome-event-channel :refer [make-chrome-event-channel]]
[chromex.config :refer-macros [with-custom-config with-custom-event-listener-factory with-muted-error-reporting]]
[chromex.er... | null | https://raw.githubusercontent.com/binaryage/chromex/33834ba5dd4f4238a3c51f99caa0416f30c308c5/test/src/chromex/test/playground.cljs | clojure | -- test against mocks -----------------------------------------------------------------------------------------------------
last error got resetted to nil
we should be receiving only non-deprecated events | (ns chromex.test.playground
(:require-macros [cljs.core.async.macros :refer [go go-loop]])
(:require [chromex.chrome-event-channel :refer [make-chrome-event-channel]]
[chromex.config :refer-macros [with-custom-config with-custom-event-listener-factory with-muted-error-reporting]]
[chromex.er... |
26cd0f826b7e6edc7fc8d86088026e1d94f1c3ccf8de3f1040b985adbd87b427 | symbiont-io/detsys-testkit | EstimateTest.hs | -- |
-- Ported from:
--
module Ldfi.EstimateTest where
import Ldfi.Estimate
import Test.HUnit
------------------------------------------------------------------------
-- * The failure free scenario
-- should only be one such scenario.
unit_estFailureFree :: Assertion
unit_estFailureFree =
grossEstimate (Eot 3) (... | null | https://raw.githubusercontent.com/symbiont-io/detsys-testkit/29a3a0140730420e4c5cc8db23df6fdb03f9302c/src/ldfi/test/Ldfi/EstimateTest.hs | haskell | |
Ported from:
----------------------------------------------------------------------
* The failure free scenario
should only be one such scenario.
----------------------------------------------------------------------
* Fail-stop scenarios
should treat failures independently
should allow each node to crash on... | module Ldfi.EstimateTest where
import Ldfi.Estimate
import Test.HUnit
unit_estFailureFree :: Assertion
unit_estFailureFree =
grossEstimate (Eot 3) (Eff 0) (MaxCrashes 0) nodes3 @=? 1
unit_estTreatFailuresIndependently :: Assertion
unit_estTreatFailuresIndependently =
grossEstimate (Eot 3) (Eff 0) (MaxCrashes... |
f882a0105a2c2299acee193abfbd15ee21b917d7af8b98adbd07d69e87c3da9c | chaoxu/fancy-walks | 110.hs | {-# OPTIONS_GHC -O2 #-}
import Data.List
-- (x + y) n = xy
( x - n)(y - n ) = n^2
answer is ( # divisors of n^2 + 1 ) ` div ` 2
minusOrd :: Ord a => [a] -> [a] -> [a]
minusOrd a@(x:xs) b@(y:ys) = case compare x y of
EQ -> minusOrd xs ys
LT -> x : minusOrd xs b
GT -> minusOrd a ys
minusOrd xs _ = xs
... | null | https://raw.githubusercontent.com/chaoxu/fancy-walks/952fcc345883181144131f839aa61e36f488998d/projecteuler.net/110.hs | haskell | # OPTIONS_GHC -O2 #
(x + y) n = xy |
import Data.List
( x - n)(y - n ) = n^2
answer is ( # divisors of n^2 + 1 ) ` div ` 2
minusOrd :: Ord a => [a] -> [a] -> [a]
minusOrd a@(x:xs) b@(y:ys) = case compare x y of
EQ -> minusOrd xs ys
LT -> x : minusOrd xs b
GT -> minusOrd a ys
minusOrd xs _ = xs
unionOrd :: Ord a => [a] -> [a] -> [a]
uni... |
85eb4565fe90947aca5bb2de979aeeafdbf872924b0a6033298c4a92aa3f5019 | lgessler/glam | text.clj | (ns glam.xtdb.text
(:require [xtdb.api :as xt]
[glam.xtdb.util :as xutil]
[glam.xtdb.easy :as gxe]
[glam.xtdb.token :as tok]
[glam.algos.text :as ta]
[taoensso.timbre :as log])
(:refer-clojure :exclude [get merge]))
(def attr-keys [:text/id
... | null | https://raw.githubusercontent.com/lgessler/glam/7c6ffc73b3e72c17c4314f1e8aec3f90721ecb51/src/main/glam/xtdb/text.clj | clojure | Mutations ----------------------------------------------------------------------
We don't follow the usual pattern of relying on child nodes' delete** functions here because
this would lead to children being included multiple times. Instead, we write a bespoke fn. | (ns glam.xtdb.text
(:require [xtdb.api :as xt]
[glam.xtdb.util :as xutil]
[glam.xtdb.easy :as gxe]
[glam.xtdb.token :as tok]
[glam.algos.text :as ta]
[taoensso.timbre :as log])
(:refer-clojure :exclude [get merge]))
(def attr-keys [:text/id
... |
6936ea75c98c1103b2016bbcaa7f347b0c783aaaf0e21cc6b1ec0d1e7f38510c | cstar/ejabberd-old | gen_pubsub_node.erl | %%% ====================================================================
` ` The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%%% compliance with the License. You should have received a copy of the
%%% Erlang Public License ... | null | https://raw.githubusercontent.com/cstar/ejabberd-old/559f8b6b0a935710fe93e9afacb4270d6d6ea00f/src/mod_pubsub/gen_pubsub_node.erl | erlang | ====================================================================
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved via the world wide web at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
th... | ` ` The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
The Initial Developer of the Original Code is ProcessOne .
Portions created by ProcessOne are C... |
bf782a424de92b7734250beccf38fe628b4512b81d7e03f5474e55fcb968a1d0 | azimut/shiny | xanadu.lisp | (in-package :shiny)
(start-csound (get-orchestra :xanadu))
(load-csound (get-orchestra :xanadu))
(start-thread)
;; XANADU
(make-play plucke "i1" :p4 0 :keynum 60)
(make-play pluck "i2" :p4 0 :keynum 60)
(make-play newfm "i3" :p4 0 :keynum 60 :llimit .2 :rlimit 2.0)
(play-newfm 90 5 :p4 .9)
(play-pluck 90 2)
(pla... | null | https://raw.githubusercontent.com/azimut/shiny/774381a9bde21c4ec7e7092c7516dd13a5a50780/compositions/drafts/csound/xanadu.lisp | lisp | XANADU
Csound tutorial | (in-package :shiny)
(start-csound (get-orchestra :xanadu))
(load-csound (get-orchestra :xanadu))
(start-thread)
(make-play plucke "i1" :p4 0 :keynum 60)
(make-play pluck "i2" :p4 0 :keynum 60)
(make-play newfm "i3" :p4 0 :keynum 60 :llimit .2 :rlimit 2.0)
(play-newfm 90 5 :p4 .9)
(play-pluck 90 2)
(play-pluck-ar... |
c51e33514cd5af0708e282d2e29da77473f6ce59d46ccd1220c07072ce6bf592 | input-output-hk/rscoin-core | MessagePack.hs | | MessagePack serialization / deserialization for Core types
module RSCoin.Core.MessagePack () where
import Control.Lens (view, _3)
import Data.Bifunctor (bimap)
import Data.Binary (decodeOrFail, encode)
import qualified Data.ByteString.Lazy ... | null | https://raw.githubusercontent.com/input-output-hk/rscoin-core/5b3fde8de1bdce71ee6ea0e8f1582ea28f451171/src/RSCoin/Core/MessagePack.hs | haskell | msgpack library we use is awful :( | | MessagePack serialization / deserialization for Core types
module RSCoin.Core.MessagePack () where
import Control.Lens (view, _3)
import Data.Bifunctor (bimap)
import Data.Binary (decodeOrFail, encode)
import qualified Data.ByteString.Lazy ... |
8f56ed003be108eb6f6ca597d756160acd08d6dae79550aaa6bc2c3180b588e0 | GaloisInc/llvm-verifier | Common.hs | # LANGUAGE CPP #
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE ImplicitParams #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TupleSections #
|
Module : $ Header$
Descrip... | null | https://raw.githubusercontent.com/GaloisInc/llvm-verifier/d97ee6d2e731f48db833cc451326e737e1e39963/test/src/Tests/Common.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE ImplicitParams #
# LANGUAGE RankNTypes #
# LANGUAGE ScopedTypeVariables #
| Create buddy backend and initial memory.
| Create buddy backend and initial memory.
^ Code to run in.
arguments to main
expected number of error paths
expected return value | # LANGUAGE CPP #
# LANGUAGE DeriveFunctor #
# LANGUAGE FlexibleContexts #
# LANGUAGE TupleSections #
|
Module : $ Header$
Description : Symbolic execution tests
License : BSD3
Stability : provisional
Point - of - contact : atomb
Module : $... |
234ae0f7c7681909e3fdd1da32863ba500dd9d9196e13d3510c97b4777706a76 | digitallyinduced/ihp | Interval.hs | # LANGUAGE TemplateHaskell #
|
Module : IHP.Postgres . Interval
Description : Adds support for the Postgres Interval type
Copyright : ( c ) digitally induced GmbH , 2020
Module: IHP.Postgres.Interval
Description: Adds support for the Postgres Interval type
Copyright: (c) digitally induced GmbH, 2020
-}
module I... | null | https://raw.githubusercontent.com/digitallyinduced/ihp/37cb74ce42420dec43376f921255b883e21bc3e8/IHP/Postgres/Interval.hs | haskell | # LANGUAGE TemplateHaskell #
|
Module : IHP.Postgres . Interval
Description : Adds support for the Postgres Interval type
Copyright : ( c ) digitally induced GmbH , 2020
Module: IHP.Postgres.Interval
Description: Adds support for the Postgres Interval type
Copyright: (c) digitally induced GmbH, 2020
-}
module I... | |
c9799d9515b95dfbdc49b3261fda307af10db38d323b0822f70bc9474f34397c | blak3mill3r/noah | serdes.clj | (ns noah.serdes
"There's a lot of room for improvement here. They don't take options, and I haven't thought it all through.
You can always build a Serde yourself. `serdes` is a multimethod so it is open to extension."
(:require
[taoensso.nippy :as nippy]
[clojure.data.json :as json])
(:import
[java.nio... | null | https://raw.githubusercontent.com/blak3mill3r/noah/03f63316a082baa7a57d00fbfe6d7164061f952d/src/noah/serdes.clj | clojure | TODO:(Blake) allow the user to configure this
`serdes` is a multimethod in order to be open to extension | (ns noah.serdes
"There's a lot of room for improvement here. They don't take options, and I haven't thought it all through.
You can always build a Serde yourself. `serdes` is a multimethod so it is open to extension."
(:require
[taoensso.nippy :as nippy]
[clojure.data.json :as json])
(:import
[java.nio... |
b3ba1cd9448bc85b0d09d0c83bda4d0e2cb5345e0b24a0ab22961159165d6853 | wdebeaum/step | useless.lisp | ;;;;
;;;; W::useless
;;;;
(define-words :pos W::adj :templ CENTRAL-ADJ-TEMPL
:words (
(W::useless
(wordfeats (W::morph (:FORMS (-LY))))
(SENSES
((meta-data :origin calo :entry-date 20031223 :change-date 20090731 :wn ("useless%3:00:00") :comments html-purchasing-corpus)
(LF-PARENT ONT::useless)
... | null | https://raw.githubusercontent.com/wdebeaum/step/f38c07d9cd3a58d0e0183159d4445de9a0eafe26/src/LexiconManager/Data/new/useless.lisp | lisp |
W::useless
|
(define-words :pos W::adj :templ CENTRAL-ADJ-TEMPL
:words (
(W::useless
(wordfeats (W::morph (:FORMS (-LY))))
(SENSES
((meta-data :origin calo :entry-date 20031223 :change-date 20090731 :wn ("useless%3:00:00") :comments html-purchasing-corpus)
(LF-PARENT ONT::useless)
)
)
)
))
|
26e5c4fece78fc7acbe238cbf44d69fae1fdace295c3dedb65d9ad280dcfaa56 | ogaml/ogaml | matrix3D.mli | Optimized operations on 3D ( 4x4 ) float matrices
exception Matrix3D_exception of string
Type of 4x4 matrices stored in a flat column major array
type t
Zero matrix
val zero : unit -> t
(* Identity matrix *)
val identity : unit -> t
(* Pretty-printer to string *)
val to_string : t -> string
(* Translation m... | null | https://raw.githubusercontent.com/ogaml/ogaml/5e74597521abf7ba2833a9247e55780eabfbab78/src/math/matrix3D.mli | ocaml | Identity matrix
Pretty-printer to string
Translation matrix
Scaling matrix
Rotation matrix
Product
Return a new, translated matrix
Return a new, scaled matrix
Return a new, rotated matrix
Vector right-product
Rotation matrix from a quaternion
Look-At view matrix
Inverse Look-At view matrix
Lo... | Optimized operations on 3D ( 4x4 ) float matrices
exception Matrix3D_exception of string
Type of 4x4 matrices stored in a flat column major array
type t
Zero matrix
val zero : unit -> t
val identity : unit -> t
val to_string : t -> string
val translation : Vector3f.t -> t
val scaling : Vector3f.t -> t
val... |
af1552b00b19ddb8af650f04313e167065fc568f9df5897204a49c709db2eacd | fukamachi/lack | util.lisp | (in-package :cl-user)
(defpackage t.lack.util
(:use :cl
:prove
:lack.util
:lack.test))
(in-package :t.lack.util)
(plan 2)
(subtest "find-package-or-load"
(is (find-package-or-load "LACK")
(find-package :lack))
(is (find-package-or-load "hoge") nil))
(subtest "funcall-with-cb"
(l... | null | https://raw.githubusercontent.com/fukamachi/lack/1f155216aeea36291b325c519f041e469262a399/t/util.lisp | lisp | cons
function
otherwise | (in-package :cl-user)
(defpackage t.lack.util
(:use :cl
:prove
:lack.util
:lack.test))
(in-package :t.lack.util)
(plan 2)
(subtest "find-package-or-load"
(is (find-package-or-load "LACK")
(find-package :lack))
(is (find-package-or-load "hoge") nil))
(subtest "funcall-with-cb"
(l... |
3c9637601f9d2ae962a00e8fb55e3a7d35b6a61a91a29cb636383269cd92b1b8 | pegesund/clojureranker | test.clj | (ns clojureranker.test)
(defn rescore [score_list]
"this is only a test rescore function"
(map (fn [doc]
(let [old-score (first doc)
lucene-id (second doc)
solr-doc (nth doc 2)
new-score (if (= (.get solr-doc "id") "055357342X") 1 (rand))
]
... | null | https://raw.githubusercontent.com/pegesund/clojureranker/693057db12dda391e5e6b1567cb21b20e98d6c01/src/clj/clojureranker/test.clj | clojure | (ns clojureranker.test)
(defn rescore [score_list]
"this is only a test rescore function"
(map (fn [doc]
(let [old-score (first doc)
lucene-id (second doc)
solr-doc (nth doc 2)
new-score (if (= (.get solr-doc "id") "055357342X") 1 (rand))
]
... | |
a6fdda3d08aa6cee123eee0642383093438d61105ac0c93576c8c59343763c51 | clojure/core.typed | frozen_macros.clj | (ns clojure.core.typed.test.frozen-macros
(:require
this loads the type system , must go first
[clojure.core.typed.test.test-utils :as tu]
[clojure.core.typed :as t]
[clojure.core.typed.analyzer.jvm :as ana]
[clojure.core.typed.analyzer.jvm.passes.emit-form :refer [emit-form]]
[clojure.core.typ... | null | https://raw.githubusercontent.com/clojure/core.typed/f5b7d00bbb29d09000d7fef7cca5b40416c9fa91/typed/checker.jvm/test/clojure/core/typed/test/frozen_macros.clj | clojure | inherits column from outer expression
exact column number
better error
'else' expected error
'then+else' expected error
better error
'then' expected error
'then+else' expected error
better error
destructuring
locals shadow vars
improved error
unreachable message
better error
approximates line number from ... | (ns clojure.core.typed.test.frozen-macros
(:require
this loads the type system , must go first
[clojure.core.typed.test.test-utils :as tu]
[clojure.core.typed :as t]
[clojure.core.typed.analyzer.jvm :as ana]
[clojure.core.typed.analyzer.jvm.passes.emit-form :refer [emit-form]]
[clojure.core.typ... |
cdc305ab1b3404ff4b60c7d8094f32219d13460f823ffbe7bd2d4360c3673997 | squirrel-prover/squirrel-prover | term.ml | open Utils
module L = Location
module Sv = Vars.Sv
module Mv = Vars.Mv
(*------------------------------------------------------------------*)
(** {2 Symbols} *)
(** Ocaml type of a typed index symbol.
Invariant: [s_typ] do not contain tvar or univars *)
type 'a isymb = {
s_symb : 'a;
s_indices : Vars.var... | null | https://raw.githubusercontent.com/squirrel-prover/squirrel-prover/c86fe5a24fbfa4db34adc01c11d8d7718a8bf870/src/term.ml | ocaml | ------------------------------------------------------------------
* {2 Symbols}
* Ocaml type of a typed index symbol.
Invariant: [s_typ] do not contain tvar or univars
------------------------------------------------------------------
------------------------------------------------------------------
-----------... | open Utils
module L = Location
module Sv = Vars.Sv
module Mv = Vars.Mv
type 'a isymb = {
s_symb : 'a;
s_indices : Vars.var list;
s_typ : Type.ty;
}
let mk_isymb (s : 'a) (t : Type.ty) (is : Vars.vars) =
let () = match t with
| Type.TVar _ | Type.TUnivar _ -> assert false;
| _ -> ()
in
as... |
1d79ea97878e23bbc6faf04535a2f5a025350b69a4784d10de2f8cc582cd76d7 | zkat/sheeple | amop-3.7.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Base : 10 ; indent - tabs - mode : nil -*-
This is a translation of section 3.7 from Art of the Metaobject Protocol , which
;;;; implements a 'monitored class' whose slot-accesses are taken note of.
(in-package :sheeple-user)
The first step is to create the met... | null | https://raw.githubusercontent.com/zkat/sheeple/5393c74737ccf22c3fd5f390076b75c38453cb04/examples/amop-3.7.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 ; indent - tabs - mode : nil -*-
implements a 'monitored class' whose slot-accesses are taken note of.
The AMOP example puts the access history in a closure. In our case, we can simply use the
metaobject to hold this 'global' data.
We use NOTE-OPERATION to actually registe... |
This is a translation of section 3.7 from Art of the Metaobject Protocol , which
(in-package :sheeple-user)
The first step is to create the metaobject . MOP messages will dispatch in this to alter behavior .
(defproto =monitored-metaobject= =standard-metaobject=
((access-history nil)))
(defmessage note-operat... |
c23936a7bd8e54674da990f76216057697049dea258a15bf61585f3073c4a78a | nuprl/gradual-typing-performance | image.rkt | #lang typed/racket
(provide Mode Image-Color Y-Place X-Place Angle Side-Count
Pen-Style Pen-Cap Pen-Join)
(define-type Mode
(U 'solid "solid" 'outline "outline" Byte))
(define-type Image-Color
(U String Symbol color))
(define-type Y-Place
(U "top" 'top "bottom" 'bottom "middle" 'middle "center" 'cent... | null | https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/pre-benchmark/ecoop/tr-wrapper/typed/2htdp/image.rkt | racket |
Can't use this type unless mrlib/image-core provides the struct:pen
binding. For now, just leave it opaque
2.3.4 | #lang typed/racket
(provide Mode Image-Color Y-Place X-Place Angle Side-Count
Pen-Style Pen-Cap Pen-Join)
(define-type Mode
(U 'solid "solid" 'outline "outline" Byte))
(define-type Image-Color
(U String Symbol color))
(define-type Y-Place
(U "top" 'top "bottom" 'bottom "middle" 'middle "center" 'cent... |
cf53b1fae2f629a4026cc899b35f42035a36a66cf1665e56c31da26c214f95c8 | dharmatech/abstracting | gambit.scm |
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; (load "~~/Gambit-C/lib/syntax-case.scm")
(load "support/gambit/srfi-1/srfi-1")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(define scheme-implementation 'gambit)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/dharmatech/abstracting/9dc5d9f45a9de03c6ee379f1928ebb393dfafc52/src/boot/gambit/gambit.scm | scheme |
(load "~~/Gambit-C/lib/syntax-case.scm")
(define (snarf dir)
(let ((import-file (string-append dir "/import"))
(include-file (string-append dir "/include"))
(export-file (string-append dir "/export"))
(compiled-file (string-append dir "/compiled-gambit")))
... |
(load "support/gambit/srfi-1/srfi-1")
(define scheme-implementation 'gambit)
(define abstracting-root-directory (current-directory))
(define *roots* #f)
(define *loaded* '())
(define *included* '())
(define (directory-contains file)
(lambda (dir)
(file-exists?
(string-append dir "/" file))))
(... |
b9b97974c3004e48b141bfe2dddd97472385860b2ba995ad33f3e9358095858e | coast-framework/db | helper.clj | (ns db.migrator.helper
(:require [helper.core :as helper]
[clojure.string :as string]
[env.core :as env]
[db.connector :as connector]))
(def rollback? (atom false))
(def sql {"sqlite" {:timestamp "integer"
:now "(strftime('%s', 'now'))"
:... | null | https://raw.githubusercontent.com/coast-framework/db/e738cd6402a89c591363ac6f3e7a6e08bcc28a0e/src/db/migrator/helper.clj | clojure | (ns db.migrator.helper
(:require [helper.core :as helper]
[clojure.string :as string]
[env.core :as env]
[db.connector :as connector]))
(def rollback? (atom false))
(def sql {"sqlite" {:timestamp "integer"
:now "(strftime('%s', 'now'))"
:... | |
65bbc32a180afd36f4bccb6bd4f8a2c6930a3985ae030741ef083d9092ecec86 | maximedenes/native-coq | cctac.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/plugins/cc/cctac.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
i camlp4deps: "parsing/grammar.cma" ... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
This file is the interface... |
d83e7c7b81f7850ac22f9b35130d224511e53788f10ea70ab124a8b3455119bc | LuisThiamNye/chic | spec.clj | (ns jl.compiler.spec
(:require
[jl.interop :as interop]
[jl.compiler.type :as type])
(:import
(org.objectweb.asm Type)))
(defn with-cast [ctor spec])
(defn untyped-num-literal? [spec]
(= [:number] (:traits spec)))
(defn untyped-int-literal? [spec]
(= [:integer] (:traits spec)))
(defn specialise-... | null | https://raw.githubusercontent.com/LuisThiamNye/chic/5cd7c951b5ac97db2b9434e0dc4b3961f5d9dddb/src/jl/compiler/spec.clj | clojure | returns a class of the intersection of behaviours
valueOf
int ctor
string ctor
todo | (ns jl.compiler.spec
(:require
[jl.interop :as interop]
[jl.compiler.type :as type])
(:import
(org.objectweb.asm Type)))
(defn with-cast [ctor spec])
(defn untyped-num-literal? [spec]
(= [:number] (:traits spec)))
(defn untyped-int-literal? [spec]
(= [:integer] (:traits spec)))
(defn specialise-... |
1675afa0ab4d6e1a3ca8d423244c0dca8247ef4a7d0ac7c419e6b6dfebf6d355 | icicle-lang/icicle-ambiata | Desugar.hs | # LANGUAGE DeriveFoldable #
# LANGUAGE DeriveFunctor #
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveTraversable #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternGuards #
# LANGUAGE PatternSynonyms #
# LANGUAGE TupleSections #
module Icicle.Source.Tra... | null | https://raw.githubusercontent.com/icicle-lang/icicle-ambiata/9b9cc45a75f66603007e4db7e5f3ba908cae2df2/icicle-source/src/Icicle/Source/Transform/Desugar.hs | haskell | # LANGUAGE DeriveTraversable #
# LANGUAGE OverloadedStrings #
^ we generated a pattern that cannot be matched
with any alternative.
^ just impossible, the world has ended.
^ duh
^ patterns use constructors from different types
------------------------------------------------------------------------------
* Case... | # LANGUAGE DeriveFoldable #
# LANGUAGE DeriveFunctor #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE PatternGuards #
# LANGUAGE PatternSynonyms #
# LANGUAGE TupleSections #
module Icicle.Source.Transform.Desugar
( DesugarError(..)
, annotOfError
, runDesugar
... |
48b9035e01814cc19f49c47e3307abfeeab598d8ab10f0b7921ceb3e6e610238 | MassD/99 | p65.ml |
Layout a binary tree ( 2 ) . ( medium )
-layout2.gif
An alternative layout method is depicted in this illustration . Find out the rules and write the corresponding OCaml function .
Hint : On a given level , the horizontal distance between neighbouring nodes is constant .
Layout a binary tree (2). (mediu... | null | https://raw.githubusercontent.com/MassD/99/1d3019eb55b0d621ed1df4132315673dd812b1e1/55-69-binary-tress/p65.ml | ocaml | represents the empty tree
below is also wrong, as it doesn't handle the special case of leftmost node
below is a so wrong algorithm |
Layout a binary tree ( 2 ) . ( medium )
-layout2.gif
An alternative layout method is depicted in this illustration . Find out the rules and write the corresponding OCaml function .
Hint : On a given level , the horizontal distance between neighbouring nodes is constant .
Layout a binary tree (2). (mediu... |
7234005aa0e11f5f9cdd697dbb28a8c2735ff4a16664a624ec73c7e907af8a9c | input-output-hk/marlowe-cardano | GetNextSteps.hs | # LANGUAGE DataKinds #
{-# LANGUAGE GADTs #-}
# LANGUAGE QuasiQuotes #
module Language.Marlowe.Runtime.Sync.Database.PostgreSQL.GetNextSteps
where
import Control.Applicative ((<|>))
import qualified Control.Foldl as Fold
import Data.Binary (get)
import Data.Binary.Get (runGet)
import Data.ByteString (ByteString)
im... | null | https://raw.githubusercontent.com/input-output-hk/marlowe-cardano/3e7471464a54f2705157380b99839770b98eede3/marlowe-runtime/sync/Language/Marlowe/Runtime/Sync/Database/PostgreSQL/GetNextSteps.hs | haskell | # LANGUAGE GADTs # | # LANGUAGE DataKinds #
# LANGUAGE QuasiQuotes #
module Language.Marlowe.Runtime.Sync.Database.PostgreSQL.GetNextSteps
where
import Control.Applicative ((<|>))
import qualified Control.Foldl as Fold
import Data.Binary (get)
import Data.Binary.Get (runGet)
import Data.ByteString (ByteString)
import Data.ByteString.La... |
7e2857d6453463714aa702dd9cc7f993dee939a4d76c5934c813b8fbdc98926c | cinmcantu/cartao-de-credito | dashboard.clj | (ns cartao-de-credito.dashboard.dashboard
(:require [cartao-de-credito.database.card-db :as c.d.card-db]
[cartao-de-credito.database.client-db :as c.d.client-db]
[cartao-de-credito.database.expends-db :as c.d.expends-db]
[cartao-de-credito.logics.join :as c.l.join]
[car... | null | https://raw.githubusercontent.com/cinmcantu/cartao-de-credito/e9fc761ee1fdd0f404449b3bf4d375f54ff60680/src/cartao_de_credito/dashboard/dashboard.clj | clojure | Global symbols definitions
All data
Expends grouped by category | (ns cartao-de-credito.dashboard.dashboard
(:require [cartao-de-credito.database.card-db :as c.d.card-db]
[cartao-de-credito.database.client-db :as c.d.client-db]
[cartao-de-credito.database.expends-db :as c.d.expends-db]
[cartao-de-credito.logics.join :as c.l.join]
[car... |
79c7ee280dc90b1c678a78c3198fd34bfeac32b465d04db51296611a20c7c627 | hasktorch/hasktorch | Native13.hs |
-- generated by using spec/Declarations.yaml
# LANGUAGE DataKinds #
# LANGUAGE PolyKinds #
# LANGUAGE TemplateHaskell #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE OverloadedStrings #-}
module Torch.Internal.Unmanaged.Native.Native13 where
import Foreign.C.String
import Foreign.C.Types
i... | null | https://raw.githubusercontent.com/hasktorch/hasktorch/6233c173e1dd9fd7218fd13b104da15fc457f67e/libtorch-ffi/src/Torch/Internal/Unmanaged/Native/Native13.hs | haskell | generated by using spec/Declarations.yaml
# LANGUAGE OverloadedStrings #
:: Ptr Tensor
-> Ptr IntArray
-> CDouble
-> IO (Ptr Tensor)
_upsample_nearest_exact1d_tld _self _output_size _scales =
[C.throwBlock| at::Tensor* { return new at::Tensor(at::_upsample_nearest_exact1d(
*$(at::Tensor* _self)
... |
# LANGUAGE DataKinds #
# LANGUAGE PolyKinds #
# LANGUAGE TemplateHaskell #
# LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
module Torch.Internal.Unmanaged.Native.Native13 where
import Foreign.C.String
import Foreign.C.Types
import Foreign
import Torch.Internal.Type
import qualified Language.C.Inline.Cpp... |
18209c0b50396f307d41d3dc08d15d0d9f2c71da35104e515e03e4069b47f9ea | cark/cark.behavior-tree | sequence.cljc | (ns cark.behavior-tree.node-defs.sequence
"The :sequence function succeeds when all its children succeed and fails when any of these fails."
(:require [cark.behavior-tree.context :as ctx]
[cark.behavior-tree.db :as db]
[cark.behavior-tree.tree :as tree]
[cark.behavior-tree.t... | null | https://raw.githubusercontent.com/cark/cark.behavior-tree/4e229fcc2ed3af3c66e74d2c51dda6684927d254/src/main/cark/behavior_tree/node_defs/sequence.cljc | clojure | (ns cark.behavior-tree.node-defs.sequence
"The :sequence function succeeds when all its children succeed and fails when any of these fails."
(:require [cark.behavior-tree.context :as ctx]
[cark.behavior-tree.db :as db]
[cark.behavior-tree.tree :as tree]
[cark.behavior-tree.t... | |
cc6e1ff46ea877dfcf73f6f2d2146ac11d52856c5392849edbbb83daecf77d18 | Vigilans/hscc | Utils.hs | module Language.C.Syntax.Utils where
import Language.C.Syntax
import Data.Either
-- Type
type TypeInfo = Either (Type -> Type) Type
void :: Type
void = Void
bool :: Type
bool = Integer Bool Unsigned
char :: Type
char = Integer Char Unsigned
short :: Type
short = Integer Short Signed
int :: Type
int = Integer In... | null | https://raw.githubusercontent.com/Vigilans/hscc/d612c54f9263d90fb01673aea1820a62fdf62551/src/Language/C/Syntax/Utils.hs | haskell | Type
Deduce start from never | module Language.C.Syntax.Utils where
import Language.C.Syntax
import Data.Either
type TypeInfo = Either (Type -> Type) Type
void :: Type
void = Void
bool :: Type
bool = Integer Bool Unsigned
char :: Type
char = Integer Char Unsigned
short :: Type
short = Integer Short Signed
int :: Type
int = Integer Int Signed... |
453876410808a3c79b45d2101b7512274048cd3fc0ed11a3495bd13c0bc60221 | WormBase/wormbase_rest | associations.clj | (ns rest-api.classes.anatomy-term.widgets.associations
(:require
[clojure.string :as str]
[datomic.api :as d]
[pseudoace.utils :as pace-utils]
[rest-api.formatters.object :as obj :refer [pack-obj]]
[rest-api.classes.generic-functions :as generic-functions]
[rest-api.classes.generic-fields :as ... | null | https://raw.githubusercontent.com/WormBase/wormbase_rest/e51026f35b87d96260b62ddb5458a81ee911bf3a/src/rest_api/classes/anatomy_term/widgets/associations.clj | clojure | can't find any | (ns rest-api.classes.anatomy-term.widgets.associations
(:require
[clojure.string :as str]
[datomic.api :as d]
[pseudoace.utils :as pace-utils]
[rest-api.formatters.object :as obj :refer [pack-obj]]
[rest-api.classes.generic-functions :as generic-functions]
[rest-api.classes.generic-fields :as ... |
fa8d9332c8bc6e42dd77b2177ea4aab0645f95948f3eb857f3c169a81d8ca25c | OCamlPro/digodoc | objects.ml | (**************************************************************************)
(* *)
Copyright ( c ) 2021 OCamlPro SAS & Origin Labs SAS
(* *)
(* All right... | null | https://raw.githubusercontent.com/OCamlPro/digodoc/431b29c097a5cf17cd546efc32006e2be4a167b0/src/frontend/objects.ml | ocaml | ************************************************************************
All rights reserved.
This file is distributed u... | Copyright ( c ) 2021 OCamlPro SAS & Origin Labs SAS
Public License version 2.1 , with the special exception on linking
type nonrec opam_entry = Data_types.opam_entry = {
name : string;
path : string;
version : string;
synopsis : string;
} [@@deriving jsoo]
type nonrec packag... |
ef81737bd263032293a3597d8353199de527e2f692ce49fadcf3c695797f3afc | argp/bap | euler014.ml | let rec seq i = function
1 -> i
| n when n land 1 = 0 -> seq (i+1) (n asr 1)
| n (* odd *) -> seq (i+1) (3*n+1)
let () =
let best_i = ref 1
and best_n0 = ref 1 in
for n = 1 to 1_000_000 do
let i = seq 1 n in
if i > !best_i then
( best_i := i; best_n0 := n );
done;
print_int !best_n0; pr... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/batteries/examples/euler/euler014.ml | ocaml | odd | let rec seq i = function
1 -> i
| n when n land 1 = 0 -> seq (i+1) (n asr 1)
let () =
let best_i = ref 1
and best_n0 = ref 1 in
for n = 1 to 1_000_000 do
let i = seq 1 n in
if i > !best_i then
( best_i := i; best_n0 := n );
done;
print_int !best_n0; print_newline ()
|
b9778b9ee0910d86b64d61de80200ba2727b0a78e6c754894943cc28c5ce0382 | jarvinet/scheme | section122.scm | Structure and Interpretation of Computer Programs , 1st edition
;-------------------------------------------------------------
; Section 1.2.2
(define (count-change amount)
(cc amount 5))
(define (cc amount kinds-of-coins)
(cond ((= amount 0) 1)
((or (< amount 0) (= kinds-of-coins 0)) 0)
(else (+ (cc (- amo... | null | https://raw.githubusercontent.com/jarvinet/scheme/47633d7fc4d82d739a62ceec75c111f6549b1650/Book/Edition1/section122.scm | scheme | -------------------------------------------------------------
Section 1.2.2
pennies
nickels
dimes
quarters
-------------------------------------------------------------
(cc 10 2)
(+ (cc 5 2) (cc 10 1))
(+ (+ (cc 0 2) (cc 5 1)) (+ (cc 9 1) (cc 10 0)))
(+ (+ 1 (+ (cc 4 1) (cc 5 0)))
(cc 5... | Structure and Interpretation of Computer Programs , 1st edition
(define (count-change amount)
(cc amount 5))
(define (cc amount kinds-of-coins)
(cond ((= amount 0) 1)
((or (< amount 0) (= kinds-of-coins 0)) 0)
(else (+ (cc (- amount
(first-denomination kinds-of-coins))
kinds-of-coins)
(cc amoun... |
2ccdc6eb0cec3a0d0ffcb544309153fe3fd7664156ca2c81f3e31de2f08a4b21 | eerohele/tab | auto.clj | (ns tab.auto
"Load this namespace to run a Tab using sensible defaults.
See tab.api for the API proper."
(:require [tab.api :as tab]))
(def tab "A Tab." nil)
(alter-var-root #'tab
(fn [_]
(let [tab (tab/run)]
(printf "Tab is listening on %s\n" (tab/address tab))
tab)))
(defn halt
[]
(alt... | null | https://raw.githubusercontent.com/eerohele/tab/6882e860acb42423dfbe78bcc86b8a0dbe91a118/src/tab/auto.clj | clojure | (ns tab.auto
"Load this namespace to run a Tab using sensible defaults.
See tab.api for the API proper."
(:require [tab.api :as tab]))
(def tab "A Tab." nil)
(alter-var-root #'tab
(fn [_]
(let [tab (tab/run)]
(printf "Tab is listening on %s\n" (tab/address tab))
tab)))
(defn halt
[]
(alt... | |
1ad67299797e602197deaa238013c1724519384c38a3edafa1fae4977116df95 | biocaml/biocaml | sam.ml | open OUnit
module Sam = Biocaml_unix.Sam
let ( %> ) f g x = g (f x)
let test_parse_optional_field s v =
let f = Sam.parse_optional_field s in
assert_equal ~msg:"Optional field value (i type)"
~printer:
(Or_error.sexp_of_t Sam.sexp_of_optional_field
%> Sexplib.Sexp.to_string_hum)
f v
let test_... | null | https://raw.githubusercontent.com/biocaml/biocaml/ac619539fed348747d686b8f628e80c1bb8bfc59/lib/test/sam.ml | ocaml | module Tfxm = Biocaml_unix.Tfxm
let test_parser_deprecated () =
let test_line l f =
in
let test_output l o = test_line l (fun oo -> `output (Ok o) = oo) in
test_output "@HD\tVN:1.3\tSO:coordinate"
test_output "r001\t83\tref\t37\t30\t9M\t=\t7\t-39\tCAGCGCCAT\t*"
(`alignment
qual =... | open OUnit
module Sam = Biocaml_unix.Sam
let ( %> ) f g x = g (f x)
let test_parse_optional_field s v =
let f = Sam.parse_optional_field s in
assert_equal ~msg:"Optional field value (i type)"
~printer:
(Or_error.sexp_of_t Sam.sexp_of_optional_field
%> Sexplib.Sexp.to_string_hum)
f v
let test_... |
a85b6972a1c2165024f115487acc3973645b2d8d8eb3df6d3ef7d3fc0fe1dbe3 | hasktorch/hasktorch | DType.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Torch.DType where
import Data.Complex
import qualified Numeric.Half as N
import Data.Int
import Data.Reflection
import Data.Word
import Torch.Internal.Class (Castable (..))
import qualified... | null | https://raw.githubusercontent.com/hasktorch/hasktorch/4abfd12a22d0ac0161827e2b5b170762c08fba47/hasktorch/src/Torch/DType.hs | haskell | | Bool
| Byte
| Short
| Int
| Long
| Half
| Float
| Double
| ComplexFloat
| ComplexDouble
| QInt8
| QUInt8
| BFloat16 | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Torch.DType where
import Data.Complex
import qualified Numeric.Half as N
import Data.Int
import Data.Reflection
import Data.Word
import Torch.Internal.Class (Castable (..))
import qualified... |
1ad8f6af93a87f521bbca0e8141796ca2cbdb76cdfd44a27c3848b84d46d3665 | axelarge/advent-of-code | day13.clj | (ns advent-of-code.y2016.day13
(:require [advent-of-code.support :refer :all]
[clojure.string :as str])
(:import (java.util PriorityQueue)))
(def input (get-input 2016 13))
(defn wall? [n [x y]]
(or (neg? x)
(neg? y)
(odd? (bit-count (+ (* x (+ x 3 y y))
(* y (i... | null | https://raw.githubusercontent.com/axelarge/advent-of-code/4c62a53ef71605780a22cf8219029453d8e1b977/src/advent_of_code/y2016/day13.clj | clojure | (ns advent-of-code.y2016.day13
(:require [advent-of-code.support :refer :all]
[clojure.string :as str])
(:import (java.util PriorityQueue)))
(def input (get-input 2016 13))
(defn wall? [n [x y]]
(or (neg? x)
(neg? y)
(odd? (bit-count (+ (* x (+ x 3 y y))
(* y (i... | |
86ab8a9432c1d3693b8e78bb02f2536625ab61d26435b9abdbe8445222dbceb3 | OCamlPro/alt-ergo | zarithNumbers.ml | (******************************************************************************)
(* *)
(* The Alt-Ergo theorem prover *)
Copyright ( C ) 2006 - 2013 ... | null | https://raw.githubusercontent.com/OCamlPro/alt-ergo/291523151417f4cd112744d740b58ab1e8a630b4/src/lib/util/zarithNumbers.ml | ocaml | ****************************************************************************
The Alt-Ergo theorem prover
... | Copyright ( C ) 2006 - 2013
... |
4bb4c242e2035329c48791f387ba6919912ad30454feea2046c59d45951eefd1 | tjammer/raylib-ocaml | models_mesh_generation.ml | open Raylib
let get f i a = Raylib.CArray.get (f a) i
let ( %. ) = Fun.flip
let make_mesh () =
let of_list l = CArray.of_list Ctypes.float l in
let mesh = Mesh.create () in
Mesh.set_triangle_count mesh 1;
Mesh.set_vertex_count mesh 3;
Mesh.set_vertices mesh
(of_list [ 0.0; 0.0; 0.0; 1.0; 0.0; 2.0; 2.0;... | null | https://raw.githubusercontent.com/tjammer/raylib-ocaml/76955c30d0a776138daeb93bfc73b104aefc6f6d/examples/models/models_mesh_generation.ml | ocaml | open Raylib
let get f i a = Raylib.CArray.get (f a) i
let ( %. ) = Fun.flip
let make_mesh () =
let of_list l = CArray.of_list Ctypes.float l in
let mesh = Mesh.create () in
Mesh.set_triangle_count mesh 1;
Mesh.set_vertex_count mesh 3;
Mesh.set_vertices mesh
(of_list [ 0.0; 0.0; 0.0; 1.0; 0.0; 2.0; 2.0;... | |
676d2029f93a43a7f5a863d92a19b72a19436631f7bcabb5a5590a5e31c3dd35 | justinkirby/handlebar | handlebar_out.erl | -module(handlebar_out).
-export([
output/2
]).
-include("handlebar.hrl").
output(Template, Data) ->
?DEBUG("HANDLING ~p->~p~n",[Template,Data]),
we can do one of three things
1 . stdout
2 . filename ( append or overwrite ? )
3 . dir / filename
%% is outdir specified?
case h... | null | https://raw.githubusercontent.com/justinkirby/handlebar/330abd32841e6428d4e45f86d8af07a605176049/src/handlebar_out.erl | erlang | is outdir specified?
is outfile specified?
nothing specified, dump straight to stdout | -module(handlebar_out).
-export([
output/2
]).
-include("handlebar.hrl").
output(Template, Data) ->
?DEBUG("HANDLING ~p->~p~n",[Template,Data]),
we can do one of three things
1 . stdout
2 . filename ( append or overwrite ? )
3 . dir / filename
case handlebar_config:get_global(o... |
bebcd49323eef1efd3c5755a6ed12a8ca67399fa5de8de3d00d80f974f426f8c | Perry961002/SICP | exa2.3.3-set.scm | 集合作为未排序的表
(define (element-of-set? x set)
(cond ((null? set) #f)
((equal? x (car set)) #t)
(else (element-of-set? x (cdr set)))))
(define (adjoin-set x set)
(if (element-of-set? x set)
set
(cons x set)))
(define (intersection-set set1 set2)
(cond ((or (null? set1) (... | null | https://raw.githubusercontent.com/Perry961002/SICP/89d539e600a73bec42d350592f0ac626e041bf16/Chap2/example/exa2.3.3-set.scm | scheme | -------------------------------------------------------------------
对于有序集合的element-of-set?操作
对于有序集合的intersection-set操作
-------------------------------------------------------------------------
集合作为二叉树(BST)
用空表作为左子树或者右子树,就表示没有子树连接在那里
-----------------------------------------------------------------------------
集合与信息检索 | 集合作为未排序的表
(define (element-of-set? x set)
(cond ((null? set) #f)
((equal? x (car set)) #t)
(else (element-of-set? x (cdr set)))))
(define (adjoin-set x set)
(if (element-of-set? x set)
set
(cons x set)))
(define (intersection-set set1 set2)
(cond ((or (null? set1) (... |
84d4e42ae97ddee4f09e5ca096404b51f0a96caa0b8e0637d2549a4e4fbd2863 | mars0i/masonclj | project.clj | (defproject mars0i/masonclj "0.2.0"
:description "masonclj is a small library providing functions and macros
to make it easier to use the MASON ABM library in Clojure."
:url ""
:license {:name "LGPL 3.0"
:url ""}
:deploy-repositories {"clojars"
{:url "" :sign... | null | https://raw.githubusercontent.com/mars0i/masonclj/976eb9460076629d31c7b00a97dcff62ea1e7791/project.clj | clojure | (defproject mars0i/masonclj "0.2.0"
:description "masonclj is a small library providing functions and macros
to make it easier to use the MASON ABM library in Clojure."
:url ""
:license {:name "LGPL 3.0"
:url ""}
:deploy-repositories {"clojars"
{:url "" :sign... | |
d58848dc66819d5508832e33a982e6ff635ae844bb977bb3f8d109876637b71c | cnuernber/dtype-next | const_reader.clj | (ns tech.v3.datatype.const-reader
(:require [tech.v3.datatype.protocols :as dtype-proto]
[tech.v3.datatype.casting :as casting]
[tech.v3.datatype.monotonic-range :as monotonic-range]
[ham-fisted.api :as hamf])
(:import [tech.v3.datatype ObjectReader LongReader DoubleReader Buffer... | null | https://raw.githubusercontent.com/cnuernber/dtype-next/99079b733d519dbfebb2b5da79419800597edd7c/src/tech/v3/datatype/const_reader.clj | clojure | (ns tech.v3.datatype.const-reader
(:require [tech.v3.datatype.protocols :as dtype-proto]
[tech.v3.datatype.casting :as casting]
[tech.v3.datatype.monotonic-range :as monotonic-range]
[ham-fisted.api :as hamf])
(:import [tech.v3.datatype ObjectReader LongReader DoubleReader Buffer... | |
cb68c41776b24e5633ba1e8f0235d2c211ffa371f516f06690ad759ea31f75a4 | kunstmusik/pink | horn.clj | (ns pink.instruments.horn
"Implementation of Andrew Horner and Lydia Ayer's French Horn models using
banded wavetable synthesis. Based on the Csound code implementaiton."
(:require [pink.util :refer :all]
[pink.config :refer [*buffer-size* *current-buffer-num* *sr*]]
[pink.envelopes :refer :all]... | null | https://raw.githubusercontent.com/kunstmusik/pink/7d37764b6a036a68a4619c93546fa3887f9951a7/src/main/pink/instruments/horn.clj | clojure | Ensure unchecked math used for this namespace
TABLES
audio generator functions | (ns pink.instruments.horn
"Implementation of Andrew Horner and Lydia Ayer's French Horn models using
banded wavetable synthesis. Based on the Csound code implementaiton."
(:require [pink.util :refer :all]
[pink.config :refer [*buffer-size* *current-buffer-num* *sr*]]
[pink.envelopes :refer :all]... |
113a6639bcdc2fda9b5bd08a97b2c6bdeafceae9601d161d5f3b222493ce39a5 | haskell-mafia/mafia | Tripping.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
module Test.Mafia.Tripping where
import Control.Applicative
import Data.Monoid
import Data.Function
import Test.QuickCheck
import Prelude
-- | Generalized round-trip property function
tripping :: (Ap... | null | https://raw.githubusercontent.com/haskell-mafia/mafia/529440246ee571bf1473615e6218f52cd1e990ae/test/Test/Mafia/Tripping.hs | haskell | # LANGUAGE OverloadedStrings #
| Generalized round-trip property function | # LANGUAGE ScopedTypeVariables #
module Test.Mafia.Tripping where
import Control.Applicative
import Data.Monoid
import Data.Function
import Test.QuickCheck
import Prelude
tripping :: (Applicative f, Show (f a), Eq (f a)) => (a -> b) -> (b -> f a) -> a -> Property
tri... |
f02c1f0ff8e88816eb33cfa3f9e5a9eb9cadb01230db073bd9352e93527637ad | sifbiri/project-resources-operations | at_at.clj | (ns app.at-at
(:import [java.util.concurrent ScheduledThreadPoolExecutor TimeUnit ThreadPoolExecutor]
[java.io Writer]))
(defrecord PoolInfo [thread-pool jobs-ref id-count-ref])
(defrecord MutablePool [pool-atom])
(defrecord RecurringJob [id created-at ms-period initial-delay job pool-info desc scheduled?... | null | https://raw.githubusercontent.com/sifbiri/project-resources-operations/b08adb09ef03f123ca7ad19ec1c2bdc070a66291/src/main/app/at_at.clj | clojure | => pool is reset gracefully
=> pool is reset forcefully"
return true if success | (ns app.at-at
(:import [java.util.concurrent ScheduledThreadPoolExecutor TimeUnit ThreadPoolExecutor]
[java.io Writer]))
(defrecord PoolInfo [thread-pool jobs-ref id-count-ref])
(defrecord MutablePool [pool-atom])
(defrecord RecurringJob [id created-at ms-period initial-delay job pool-info desc scheduled?... |
967251404a07eaa1f5bd2faa5053528f1bf47544607a85ad575f8e5340182aab | iconnect/regex | PCRE.hs | {-# LANGUAGE NoImplicitPrelude #-}
# LANGUAGE RecordWildCards #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE TypeSynonymInstances #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE CPP #
#if __GLASGOW_HASKELL__ >= ... | null | https://raw.githubusercontent.com/iconnect/regex/68752790a8f75986b917b71cf0e8e22cd3a28a3d/Text/RE/ZeInternals/PCRE.hs | haskell | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TypeSynonymInstances #
# LANGUAGE TemplateHaskellQuotes #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
* About
$about
* RE Type
* Compiling Regular Expressions
* Compiling Search-Replace Templates
* Escaping String
*... | # LANGUAGE RecordWildCards #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE CPP #
#if __GLASGOW_HASKELL__ >= 800
# OPTIONS_GHC -fno - warn - redundant - constraints #
#else
#endif
# OPTIONS_GHC -fn... |
bc82034bda971fb6da47ab16f819a4447afce780582862620b2d5a2b59b288dc | williamthome/eel | eel_convert.erl | %%%-----------------------------------------------------------------------------
%%% @doc EEl converter module.
%%%
@author [ ]
%%% @end
%%%-----------------------------------------------------------------------------
-module(eel_convert).
-export([to_binary/1, to_binary/2]).
to_binary(Value) ->
to_binary(V... | null | https://raw.githubusercontent.com/williamthome/eel/7f933858c4346c5adacabd748b4ef6f8df832c26/src/eel_convert.erl | erlang | -----------------------------------------------------------------------------
@doc EEl converter module.
@end
----------------------------------------------------------------------------- | @author [ ]
-module(eel_convert).
-export([to_binary/1, to_binary/2]).
to_binary(Value) ->
to_binary(Value, undefined).
to_binary(Bin, _) when is_binary(Bin) ->
Bin;
to_binary(undefined, _) ->
<<>>;
to_binary([], _) ->
<<>>;
to_binary(Atom, undefined) when is_atom(Atom) ->
erlang:atom_to_bi... |
eda04fff5b9a3f2e9b66a78b5ce826416b6acac9a7e650d23429da17ceb25537 | jacekschae/learn-datomic-course-files | handlers.clj | (ns cheffy.recipe.handlers
(:require [cheffy.recipe.db :as recipe-db]
[cheffy.responses :as responses]
[ring.util.response :as rr])
(:import (java.util UUID)))
(defn list-all-recipes
[{:keys [env claims] :as _request}]
(let [account-id (:sub claims)]
(rr/response (recipe-db/find-all... | null | https://raw.githubusercontent.com/jacekschae/learn-datomic-course-files/c337e9efe3744705fe2aac786cf87a89995517b9/increments/36-favorite-counter-tests/src/main/cheffy/recipe/handlers.clj | clojure | (ns cheffy.recipe.handlers
(:require [cheffy.recipe.db :as recipe-db]
[cheffy.responses :as responses]
[ring.util.response :as rr])
(:import (java.util UUID)))
(defn list-all-recipes
[{:keys [env claims] :as _request}]
(let [account-id (:sub claims)]
(rr/response (recipe-db/find-all... | |
8750e445f3d03b961f37dbf41e5b6e4ac1e3cff09b101a3a5a26f93db8fad36c | ocamllabs/ocaml-modular-implicits | float_record.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/testsuite/tests/basic-float/float_record.ml | ocaml | *********************************************************************
OCaml
... | , projet Cristal , 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 Q Public License version 1.0 .
type t = float;;
let make f = f;;
le... |
d5fe25f3c3f1a19f971b2a77f4dca651e459189b034a7c6941c8175fe1f587e6 | backtracking/ocamlgraph | dGraphView.mli | (**************************************************************************)
(* *)
(* This file is part of OcamlGraph. *)
(* *)
Copyright... | null | https://raw.githubusercontent.com/backtracking/ocamlgraph/1c028af097339ca8bc379436f7bd9477fa3a49cd/dgraph/dGraphView.mli | ocaml | ************************************************************************
This file is part of OcamlGraph.
... | Copyright ( C ) 2009 - 2010
CEA ( Commissariat à )
Lesser General Public License as published by the Free Software
Foundation , version 2.1 , with a linking exception .
( ) ... |
d7f7a554b0fba6b135973205e534ea3a2a26ad2de381426d1cd3a7588e54b12b | facebook/duckling | Tests.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
module Duckling.AmountOfMoney.Tests
( tests
) where
import Data.String
import Prelude
import Test.Tasty... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/tests/Duckling/AmountOfMoney/Tests.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree. | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.AmountOfMoney.Tests
( tests
) where
import Data.String
import Prelude
import Test.Tasty
import qualified Duckling.AmountOfMoney.AR.Tests as AR
import qualified Duckling.AmountOfMoney.CA.Tests as CA
import qualified Duckling.AmountOfMoney.EN.Test... |
d8ea6ad159d77b933f18faac2ed5e0a93954182ae97bc91a626dd9c0bc47a9c4 | ulfsauer0815/ghmm | Message.hs | {-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
| Rendering of GitHub events as Mattermost messages .
module Mattermost.Github.Message
( renderMessage
, renderMessage'
, messageTemplate
) where
import Data.Maybe
import Data.Monoid
import qualified Data.Text ... | null | https://raw.githubusercontent.com/ulfsauer0815/ghmm/fc81948316156c67f6af9fe08a8a49472e9a42b8/src/Mattermost/Github/Message.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
----------------------------------------------
Uses a message template for generic fields, see 'messageTemplate' and
'renderMessage''.
supplied message template.
| Default Mattermost message template. |
| Rendering of GitHub events as Mattermost messages .
module Mattermost.Github.Message
( renderMessage
, renderMessage'
, messageTemplate
) where
import Data.Maybe
import Data.Monoid
import qualified Data.Text as T
import Github.Api hiding (rep... |
a333da2bde233a03440d8aba769016728c75424701156fe1707ec50d36db03b3 | softlab-ntua/bencherl | my_plugin_example.erl | Copyright ( C ) 2014 EDF R&D
This file is part of Sim - Diasca .
Sim - Diasca 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 late... | null | https://raw.githubusercontent.com/softlab-ntua/bencherl/317bdbf348def0b2f9ed32cb6621e21083b7e0ca/app/sim-diasca/sim-diasca/src/core/src/plugins/tests/my_plugin_example.erl | erlang | it under the terms of the GNU Lesser General Public License as
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
If not, see </>.
This is a typical plugin example, to be re-used as a guide to develop actual
For the technical_settings recor... | Copyright ( C ) 2014 EDF R&D
This file is part of Sim - Diasca .
Sim - Diasca is free software : you can redistribute it and/or modify
published by the Free Software Foundation , either version 3 of
the License , or ( at your option ) any later version .
Sim - Diasca is distributed in the hope that it wi... |
62a1a9a82600578147c645b52cf8f68794f7c040f1778e8451b2675ba5d46eec | DaMSL/K3 | Graph.hs | # LANGUAGE PatternGuards #
-- | Dependent type-manifestation using graph traversal.
--
-- This module defines an algorithm and supporting machinery to perform dependent type manifestation
-- on a consistent constraint set obtained from a successful typechecking run.
--
-- The algorithm picks types for type variables w... | null | https://raw.githubusercontent.com/DaMSL/K3/51749157844e76ae79dba619116fc5ad9d685643/src/Language/K3/TypeSystem/Manifestation/Graph.hs | haskell | | Dependent type-manifestation using graph traversal.
This module defines an algorithm and supporting machinery to perform dependent type manifestation
on a consistent constraint set obtained from a successful typechecking run.
The algorithm picks types for type variables whilst respecting constraints between the... | # LANGUAGE PatternGuards #
module Language.K3.TypeSystem.Manifestation.Graph where
import Control.Applicative
import Data.Functor.Identity
import Data.Maybe
import Data.Tuple (swap)
import qualified Data.Graph.Wrapper as G
import qualified Data.Map as M
import qualified Data.Set as S
import Language.K3.Core.Annota... |
06ea761ae86ebf7ed807dba32f871c3eed0af62dbc5901fe3e5cc27dc1ea167b | scicloj/notespace | run.clj | (ns scicloj.notespace.v4.run
(:require [scicloj.notespace.v4.read :as v4.read]
[scicloj.notespace.v4.view :as v4.view]
[scicloj.notespace.v4.frontend.change :as v4.frontend.change]
[scicloj.notespace.v4.frontend.engine :as v4.frontend.engine]
[scicloj.notespace.v4.event... | null | https://raw.githubusercontent.com/scicloj/notespace/1929f4d2b69c9e52f4ddb5581d10ecaaa29b3c69/src/scicloj/notespace/v4/run.clj | clojure | (ns scicloj.notespace.v4.run
(:require [scicloj.notespace.v4.read :as v4.read]
[scicloj.notespace.v4.view :as v4.view]
[scicloj.notespace.v4.frontend.change :as v4.frontend.change]
[scicloj.notespace.v4.frontend.engine :as v4.frontend.engine]
[scicloj.notespace.v4.event... | |
3c73e6188351bc3d2f0645e1c52427bbf5ad00fa7283343f01bacc09082b0240 | exoscale/vinyl | query_filter_test.clj | (ns exoscale.vinyl.query-filter-test
(:require [clojure.test :refer :all]
[exoscale.vinyl.query :as query]
[clojure.spec.alpha :as s]))
(deftest filter-types-test
(testing "Filter spec"
(is (s/valid? ::query/filter [:matches :a [:= :b 2]]))
(is (s/valid? ::query/filter [:nested :a [... | null | https://raw.githubusercontent.com/exoscale/vinyl/4ee9d40f9268abda731284bb020878fc350801fe/test/exoscale/vinyl/query_filter_test.clj | clojure | (ns exoscale.vinyl.query-filter-test
(:require [clojure.test :refer :all]
[exoscale.vinyl.query :as query]
[clojure.spec.alpha :as s]))
(deftest filter-types-test
(testing "Filter spec"
(is (s/valid? ::query/filter [:matches :a [:= :b 2]]))
(is (s/valid? ::query/filter [:nested :a [... | |
3e73715938effcee06bcec86e59becc6a8c2896007e1af0d9d028cdfc9b269ad | processone/ejabberd | extauth.erl | %%%-------------------------------------------------------------------
Created : 7 May 2018 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2023 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the... | null | https://raw.githubusercontent.com/processone/ejabberd/c103182bc7e5b8a8ab123ce02d1959a54e939480/src/extauth.erl | erlang | -------------------------------------------------------------------
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHA... | Created : 7 May 2018 by < >
ejabberd , Copyright ( C ) 2002 - 2023 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
with this program ; i... |
d3bf55b4c4a57bfaf755ef0b374599cbfa10e7f0b56129e474d4eb85bdf3c31c | pmembrey/molderl | molderl_eunit_tests.erl |
-module(molderl_eunit_tests).
-include_lib("eunit/include/eunit.hrl").
-include("molderl.hrl").
-include("molderl_tests.hrl").
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
start() ->
io:format(us... | null | https://raw.githubusercontent.com/pmembrey/molderl/10e9a6faeb73a0bc601ade5bd1ea1484957c33c3/test/molderl_eunit_tests.erl | erlang |
Recovery tests
first send a broken recovery request, see if it breaks
using same port for streaming and recovery
using different ports for streaming and recovery
test when requested count > max recovery count
test when requested sequence number starts at very last message |
-module(molderl_eunit_tests).
-include_lib("eunit/include/eunit.hrl").
-include("molderl.hrl").
-include("molderl_tests.hrl").
start() ->
io:format(user,"Initiating tests...~n",[]),
file:delete("/tmp/foo"),
file:delete("/tmp/bar"),
file:delete("/tmp/baz"),
application:start(molderl),
[].... |
3fb65deb742f87c7ad9040a19fc23b8595638d1cea3b25c62d053aa16e37dd29 | BoeingX/haskell-programming-from-first-principles | ParseDigitAndInteger.hs | module ParserCombinators.ChapterExercises.ParseDigitAndInteger where
import Control.Applicative
import Data.List
import Text.Trifecta
instance (Eq a) => Eq (Result a) where
Success a == Success b = a == b
Failure a == Failure b = True
_ == _ = False
parseDigit :: Parser Char
parseDigit = oneOf $ concatMa... | null | https://raw.githubusercontent.com/BoeingX/haskell-programming-from-first-principles/ffb637f536597f552a4e4567fee848ed27f3ba74/src/ParserCombinators/ChapterExercises/ParseDigitAndInteger.hs | haskell | (<?>) give parser a name
See -0.12.9/docs/Text-Parser-Combinators.html | module ParserCombinators.ChapterExercises.ParseDigitAndInteger where
import Control.Applicative
import Data.List
import Text.Trifecta
instance (Eq a) => Eq (Result a) where
Success a == Success b = a == b
Failure a == Failure b = True
_ == _ = False
parseDigit :: Parser Char
parseDigit = oneOf $ concatMa... |
68d794c6e9107efd666b1c12dec7ab5224fea66463ad8c2641be53591cce16d5 | haskell-game/tiny-games-hs | lambda-ray.hs | import Control.Concurrent; import System.Posix.Internals;w=100;q=0.4;n=min;c=cos
p=[(x/w*2-1,(y/20*2-1)*0.2)| y<-[0..20], x<-[0..w+1]];t=max 0;o=True;a=abs;s=sin
main=go 0;r t (x,y,z)=(x*c t - y*s t, x*s t + y*c t, z);v=sqrt;u _(1.02,_)= '\n'
u t(x,y)=m t 0(10*x,10*y,-5);b h w(x,y,z)=v(t(a x-w)**2+t(a y-h)**2+t(a z-q)*... | null | https://raw.githubusercontent.com/haskell-game/tiny-games-hs/3ccee1a663ac93a3bd2a302a9c09c2f5c60306ac/base/lambda-ray/lambda-ray.hs | haskell | ^10 ------------------------------------------------------------------ 80> -- | import Control.Concurrent; import System.Posix.Internals;w=100;q=0.4;n=min;c=cos
p=[(x/w*2-1,(y/20*2-1)*0.2)| y<-[0..20], x<-[0..w+1]];t=max 0;o=True;a=abs;s=sin
main=go 0;r t (x,y,z)=(x*c t - y*s t, x*s t + y*c t, z);v=sqrt;u _(1.02,_)= '\n'
u t(x,y)=m t 0(10*x,10*y,-5);b h w(x,y,z)=v(t(a x-w)**2+t(a y-h)**2+t(a z-q)*... |
2ed1d08f2eac37af2cff4e9a95e334aed50aa4934b8d1f4acf11ec6badc4702c | HaskellZhangSong/Introduction_to_Haskell_2ed_source | Iteratee.hs | # LANGUAGE DeriveFunctor #
import Data.Function (fix)
import Control.Monad
import qualified Control.Exception as Exc
import Control.Monad.IO.Class
import Control.Monad.Trans
data Stream a = Chunks [a] | EOF
deriving (Show, Eq,Functor)
instance Monoid (Stream a) where
mempty = Chunks me... | null | https://raw.githubusercontent.com/HaskellZhangSong/Introduction_to_Haskell_2ed_source/140c50fdccfe608fe499ecf2d8a3732f531173f5/C14/Iteratee.hs | haskell | # LANGUAGE DeriveFunctor #
import Data.Function (fix)
import Control.Monad
import qualified Control.Exception as Exc
import Control.Monad.IO.Class
import Control.Monad.Trans
data Stream a = Chunks [a] | EOF
deriving (Show, Eq,Functor)
instance Monoid (Stream a) where
mempty = Chunks me... | |
145a5d7a60225ec1f406ad3fca370b4d900b051d1d70ff3a4dcc35f96d4a998c | epicallan/hreq | SuccessSpec.hs | module Hreq.Pure.SuccessSpec (spec) where
import Data.Foldable
import Data.Proxy
import Test.Hspec
import Hreq.Client
import Hreq.Core.Client (RequestBody (..))
import Hreq.Pure.Util (TestState (..), TestUser (..), defaultResponse, runClientPure)
spec :: Spec
spec = describe "Hreq.SuccessSpec" successSpec
testUser ... | null | https://raw.githubusercontent.com/epicallan/hreq/f12fcb9b9dd1ad903c6b36a8cf850edb213d4792/hreq-client/test/Hreq/Pure/SuccessSpec.hs | haskell | module Hreq.Pure.SuccessSpec (spec) where
import Data.Foldable
import Data.Proxy
import Test.Hspec
import Hreq.Client
import Hreq.Core.Client (RequestBody (..))
import Hreq.Pure.Util (TestState (..), TestUser (..), defaultResponse, runClientPure)
spec :: Spec
spec = describe "Hreq.SuccessSpec" successSpec
testUser ... | |
a87f0f8928289d0388ad44c38dcbed76b3dd3b294eaa3fbebdf20bc1769ca2c2 | samply/blaze | resource_spec.clj | (ns blaze.db.impl.index.compartment.resource-spec
(:require
[blaze.byte-string-spec]
[blaze.coll.core-spec]
[blaze.db.impl.codec.spec]
[blaze.db.impl.index.compartment.resource :as cr]
[blaze.db.impl.iterators-spec]
[blaze.db.impl.search-param.spec]
[blaze.db.kv.spec]
[clojure.spec.alp... | null | https://raw.githubusercontent.com/samply/blaze/e84c106b5ca235600c20ba74fe8a2295eb18f350/modules/db/test/blaze/db/impl/index/compartment/resource_spec.clj | clojure | (ns blaze.db.impl.index.compartment.resource-spec
(:require
[blaze.byte-string-spec]
[blaze.coll.core-spec]
[blaze.db.impl.codec.spec]
[blaze.db.impl.index.compartment.resource :as cr]
[blaze.db.impl.iterators-spec]
[blaze.db.impl.search-param.spec]
[blaze.db.kv.spec]
[clojure.spec.alp... | |
1f2c8f8211df1883ea11842613ebbbc2c16c07f40306428c9a2f354b48c06d6a | MinaProtocol/mina | construction_parse_response.ml |
* This file has been generated by the OCamlClientCodegen generator for openapi - generator .
*
* Generated by : -generator.tech
*
* Schema Construction_parse_response.t : ConstructionParseResponse contains an array of operations that occur in a transaction blob . This should match the array of operations... | null | https://raw.githubusercontent.com/MinaProtocol/mina/a80b00221953c26ff158e7375a948b5fa9e7bd8b/src/lib/rosetta_models/construction_parse_response.ml | ocaml | [DEPRECATED by `account_identifier_signers` in `v1.4.4`] All signers (addresses) of a particular transaction. If the transaction is unsigned, it should be empty.
* ConstructionParseResponse contains an array of operations that occur in a transaction blob. This should match the array of operations provided to `/const... |
* This file has been generated by the OCamlClientCodegen generator for openapi - generator .
*
* Generated by : -generator.tech
*
* Schema Construction_parse_response.t : ConstructionParseResponse contains an array of operations that occur in a transaction blob . This should match the array of operations... |
1c6ca7653b6784071cd30bb7765a961ba145aa62770b6d9b970a5d9b949402b6 | pveber/biotk | sam.ml | open Core
module Seq = Caml.Seq
open Result.Monad_infix
let ( >>?~ )
(x : 'a option Or_error.t)
(f : 'a -> 'b Or_error.t)
: 'b option Or_error.t
=
let open Result.Monad_infix in
x >>= function
| None -> Ok None
| Some x -> f x >>| Option.some
(*************************************************... | null | https://raw.githubusercontent.com/pveber/biotk/422640d9303c90c43ecb4b679a8bf5867998119c/lib/sam.ml | ocaml | ****************************************************************************
Header Types
****************************************************************************
****************************************************************************
Alignment T... | open Core
module Seq = Caml.Seq
open Result.Monad_infix
let ( >>?~ )
(x : 'a option Or_error.t)
(f : 'a -> 'b Or_error.t)
: 'b option Or_error.t
=
let open Result.Monad_infix in
x >>= function
| None -> Ok None
| Some x -> f x >>| Option.some
type header_item_tag = [
| `HD | `SQ | `RG | `PG |... |
a3eb032e6ceee806fec2c8ab8fcb1def1d5943020f0942d1c53335728cd71aef | falsetru/htdp | 33.4.3.scm | #lang racket
(define (sum xs) (foldr + 0 xs))
(define JANUS
(list #i31
#i2e+34
#i-1.2345678901235e+80
#i2749
#i-2939234
#i-2e+33
#i3.2e+270
#i17
#i-2.4e+270
#i4.2344294738446e+170
#i1
#i-8e+269
#i0
#i99))
(displ... | null | https://raw.githubusercontent.com/falsetru/htdp/4cdad3b999f19b89ff4fa7561839cbcbaad274df/33/33.4.3.scm | scheme | #lang racket
(define (sum xs) (foldr + 0 xs))
(define JANUS
(list #i31
#i2e+34
#i-1.2345678901235e+80
#i2749
#i-2939234
#i-2e+33
#i3.2e+270
#i17
#i-2.4e+270
#i4.2344294738446e+170
#i1
#i-8e+269
#i0
#i99))
(displ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.