_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 |
|---|---|---|---|---|---|---|---|---|
575c62cb10727209916b6dccdef27e582d29f4ec54a8c64f950431267e36bbcc | joedevivo/chatterbox | h2_frame_data.erl | -module(h2_frame_data).
-include("http2.hrl").
-behaviour(h2_frame).
-export([
format/1,
read_binary/2,
to_frames/3,
to_binary/1,
data/1,
new/1
]).
-record(data, {
data :: iodata()
}).
-type payload() :: #data{}.
-type frame() :: {h2_frame:header(), ... | null | https://raw.githubusercontent.com/joedevivo/chatterbox/560f2c71a151716512781f0f6196a8a9ff678852/src/h2_frame_data.erl | erlang | -module(h2_frame_data).
-include("http2.hrl").
-behaviour(h2_frame).
-export([
format/1,
read_binary/2,
to_frames/3,
to_binary/1,
data/1,
new/1
]).
-record(data, {
data :: iodata()
}).
-type payload() :: #data{}.
-type frame() :: {h2_frame:header(), ... | |
47191b9777424fa8730130d16b3194def52de79282fe6feba75f57d22c1e5a6e | BillHallahan/G2 | Fold_div.hs | -- We substitute the use of random in the original benchmark with a symbolic [Int].
This is because the GHC standard library does not provide a random function
module Fold_div (main) where
{-@ die :: {v:String | false} -> a @-}
die str = error str
fold_left :: (b -> a -> b) -> b -> [a] -> b
fold_left f acc xs =
... | null | https://raw.githubusercontent.com/BillHallahan/G2/e2b99d2918a28eee81edac26fa4ba423abf2ebda/tests/LiquidInf/Paper/Eval/Sato/Fold_div.hs | haskell | We substitute the use of random in the original benchmark with a symbolic [Int].
@ die :: {v:String | false} -> a @
Ocaml version uses rand here | This is because the GHC standard library does not provide a random function
module Fold_div (main) where
die str = error str
fold_left :: (b -> a -> b) -> b -> [a] -> b
fold_left f acc xs =
case xs of
[] -> acc
x:xs' -> fold_left f (f acc x) xs'
randpos :: [Int] -> (Int, [Int])
randpos [] = (1... |
9bb0eb6ff802a5bce8909f872ce1858687a5fee4b9371e0e44201d424a3c39e4 | exoscale/tools.project | version.clj | (ns exoscale.tools.project.api.version
(:require [exoscale.deps-version :as version]))
(defn get-version
[{:as _opts :exoscale.project/keys [version-file version]}]
(or version
(some-> version-file version/read-version-file*)))
(defn remove-snapshot
[{:as _opts
:exoscale.project/keys [version-file]
... | null | https://raw.githubusercontent.com/exoscale/tools.project/4b97ccbd4a8460cdd7644cc3574a7ff6a21a5b30/src/exoscale/tools/project/api/version.clj | clojure | (ns exoscale.tools.project.api.version
(:require [exoscale.deps-version :as version]))
(defn get-version
[{:as _opts :exoscale.project/keys [version-file version]}]
(or version
(some-> version-file version/read-version-file*)))
(defn remove-snapshot
[{:as _opts
:exoscale.project/keys [version-file]
... | |
b58944f443df5e65100b55caa584c2ffdfc91c61dd0f6248b686b8322ee4ca8c | pjotrp/guix | emacs.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2014 / < >
Copyright © 2013 , 2014 , 2015 < >
Copyright © 2014 , 2015 < >
Copyright © 2014 , 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can... | null | https://raw.githubusercontent.com/pjotrp/guix/96250294012c2f1520b67f12ea80bfd6b98075a2/gnu/packages/emacs.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2014 / < >
Copyright © 2013 , 2014 , 2015 < >
Copyright © 2014 , 2015 < >
Copyright © 2014 , 2015 < >
Copyright © 2015 < >
Copyright © 2015 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public Lic... |
4128a943438ef4011333965ebfcd6edc885b82fafc33588fd988f111eb15d52b | s-expressionists/Cleavir | environment-query.lisp | (cl:in-package #:cleavir-cst-to-ast)
(defun variable-info (system environment var-name-cst)
(let* ((symbol (cst:raw var-name-cst))
(info (env:variable-info system environment symbol)))
(loop while (null info)
do (restart-case (error 'no-variable-info
:name symbol :cst var-name-cst)
(con... | null | https://raw.githubusercontent.com/s-expressionists/Cleavir/1aee4c5111c0dadb06c08f1ab8828e9b2c97bd16/CST-to-AST/environment-query.lisp | lisp | This is identical to CONTINUE, but more specifically named. | (cl:in-package #:cleavir-cst-to-ast)
(defun variable-info (system environment var-name-cst)
(let* ((symbol (cst:raw var-name-cst))
(info (env:variable-info system environment symbol)))
(loop while (null info)
do (restart-case (error 'no-variable-info
:name symbol :cst var-name-cst)
(con... |
35820b36075d2d5508739eb381e08d576ac31839229e51db93eb6d2d5f73b63b | gearnode/erl-oauth2c | oauth2c.erl | Copyright ( c ) 2022 < > .
Copyright ( c ) 2021 Exograd SAS .
Copyright ( c ) 2020 < > .
%%
%% Permission to use, copy, modify, and/or distribute this software for any
%% purpose with or without fee is hereby granted, provided that the above
%% copyright notice and this permission notice appear in all copie... | null | https://raw.githubusercontent.com/gearnode/erl-oauth2c/e5c00a0e27a775790ae8b56f1d6d3617ae92d05e/src/oauth2c.erl | erlang |
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted, provided that the above
copyright notice and this permission notice appear in all copies.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVE... | Copyright ( c ) 2022 < > .
Copyright ( c ) 2021 Exograd SAS .
Copyright ( c ) 2020 < > .
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN... |
391df3fbf886092316ba32df00b312234f975b5d4f635d32d277999904d1c7a5 | Ptival/chick | Variable.hs | module Diff.Variable
( Diff (..),
)
where
import Term.Variable (Variable)
data Diff
= Same
| Renamed Variable
| null | https://raw.githubusercontent.com/Ptival/chick/5f21b154acbc04f6572692ad1d592a50c37a638e/backend/lib/Diff/Variable.hs | haskell | module Diff.Variable
( Diff (..),
)
where
import Term.Variable (Variable)
data Diff
= Same
| Renamed Variable
| |
e26998ba0f9c31f34d3c08900723ae97366598a095f0a1f561fe06db1c435e94 | exercism/scheme | example.scm |
(define (collatz n)
(cond ((= n 1) 0)
((even? n) (+ 1 (collatz (/ n 2))))
(else (+ 1 (collatz (+ 1 (* 3 n)))))))
| null | https://raw.githubusercontent.com/exercism/scheme/aa880e6222a393fcf5d672decb5c5dd6fae286ff/exercises/practice/collatz-conjecture/.meta/example.scm | scheme |
(define (collatz n)
(cond ((= n 1) 0)
((even? n) (+ 1 (collatz (/ n 2))))
(else (+ 1 (collatz (+ 1 (* 3 n)))))))
| |
be0a4feb5721288ff1c62c6eea61f1fc9322fcf0afc84742e2c504ef926732de | jakemcc/sicp-study | ex3_53.clj | Exercise 3.53
; Q.
; Without running it, describe the elements of
( define s ( cons - stream 1 ( add - streams s s ) ) )
; A.
; s looks like the following
; '(1 2 4 8 16 ....)
; The equation f(n) = f(n-1) + f(n-1) describes it. | null | https://raw.githubusercontent.com/jakemcc/sicp-study/3b9e3d6c8cc30ad92b0d9bbcbbbfe36a8413f89d/clojure/section3.5/src/ex3_53.clj | clojure | Q.
Without running it, describe the elements of
A.
s looks like the following
'(1 2 4 8 16 ....)
The equation f(n) = f(n-1) + f(n-1) describes it. | Exercise 3.53
( define s ( cons - stream 1 ( add - streams s s ) ) )
|
6c7338a8ecf7f681c96ee536832b411b3cfd582b8a0edf637fe4fa4ceb88cfc8 | huangz1990/SICP-answers | test-p33-find-divisor.scm | (load "test-manager/load.scm")
(load "p33-find-divisor.scm")
(define-each-check
(= 2 (find-divisor 4 2))
(= 2 (find-divisor 6 2))
(= 7 (find-divisor 7 2))
)
(run-registered-tests)
| null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp1/code/test-p33-find-divisor.scm | scheme | (load "test-manager/load.scm")
(load "p33-find-divisor.scm")
(define-each-check
(= 2 (find-divisor 4 2))
(= 2 (find-divisor 6 2))
(= 7 (find-divisor 7 2))
)
(run-registered-tests)
| |
702460e2842b7928c8192d67233964683069ba98473292462be07cdf141092af | kushidesign/kushi | config.cljc | (ns ^:dev/always kushi.config
(:require
[clojure.edn :as edn]))
(def default-font-families-from-google-fonts
{:code "Fira Code"
:sans "Inter"
;; :serif ""
})
(def default-kushi-responsive
[:xsm {:min-width :480px}
:sm {:min-width :640px}
:md {:min-width :768px}
:lg {:min-width :1024px}
... | null | https://raw.githubusercontent.com/kushidesign/kushi/4434a009eee873f3c3741894d3ff5f2e8d3d2c37/src/kushi/config.cljc | clojure | :serif ""
TODO use warning or error panel
REQUIRED
Needs to be a path to a dir
OPTIONAL
Misc --------------------------------------------------------------
User theme - this should be a fully qualified symbol to a theme config map
Usually would be the id of the "app" container, e.g "#app".
A typical override ... | (ns ^:dev/always kushi.config
(:require
[clojure.edn :as edn]))
(def default-font-families-from-google-fonts
{:code "Fira Code"
:sans "Inter"
})
(def default-kushi-responsive
[:xsm {:min-width :480px}
:sm {:min-width :640px}
:md {:min-width :768px}
:lg {:min-width :1024px}
:xl {:min-width ... |
1c6d7d78468254c3611443ba9d770872d79cedd70f82248982725a127163be43 | yakaz/yamerl | ex_6.12_separation_spaces.erl | -module('ex_6.12_separation_spaces').
-include_lib("eunit/include/eunit.hrl").
-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").
single_test_() ->
?_assertMatch(
{yamerl_parser,
{file,?FILENAME},
[],
<<>>,
97,
true,
[],
0,
98,
... | null | https://raw.githubusercontent.com/yakaz/yamerl/0032607a7b27fa2b548fc9a02d7ae6b53469c0c5/test/parsing/ex_6.12_separation_spaces.erl | erlang | -module('ex_6.12_separation_spaces').
-include_lib("eunit/include/eunit.hrl").
-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").
single_test_() ->
?_assertMatch(
{yamerl_parser,
{file,?FILENAME},
[],
<<>>,
97,
true,
[],
0,
98,
... | |
4d0b9a8dd19457cdacdea44f30b6ec8c4011f4ce03da36ea36c44b9dd9d449ce | ahrefs/monorobot | slack_message.ml | open Base
open Printf
open Github_t
open Slack_t
open Mrkdwn
let color_of_state ?(draft = false) ?(merged = false) state =
match draft with
| true -> Colors.gray
| false ->
match merged with
| true -> Colors.purple
| false ->
match state with
| Open -> Colors.green
| Closed -> Colors.red
let gh_name... | null | https://raw.githubusercontent.com/ahrefs/monorobot/93ccfca195f81d5e7534f0b0d0777e191f07e00e/lib/slack_message.ml | ocaml | use some date library :see_no_evil: | open Base
open Printf
open Github_t
open Slack_t
open Mrkdwn
let color_of_state ?(draft = false) ?(merged = false) state =
match draft with
| true -> Colors.gray
| false ->
match merged with
| true -> Colors.purple
| false ->
match state with
| Open -> Colors.green
| Closed -> Colors.red
let gh_name... |
e4377a95277fa2994b93e6e0f34a8c078f5b0e6ce6c779b88558a7444162dcae | Clozure/ccl-tests | gclload2.lsp | ;;; Load test files
;;; Tests of symbols
(load "load-symbols.lsp")
;;; Tests of evaluation and compilation
(load "load-eval-and-compile.lsp")
;;; Tests of data and control flow
(load "load-data-and-control-flow.lsp")
;;; Tests of iteration forms
(load "load-iteration.lsp")
;;; Tests of objects
(load "load-objects.... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/gclload2.lsp | lisp | Load test files
Tests of symbols
Tests of evaluation and compilation
Tests of data and control flow
Tests of iteration forms
Tests of objects
Tests of conditions
Tests of conses
Tests on arrays
Tests of hash tables
Tests of packages
Tests of sequences
Tests of structures
Tests of types and classes
Tests ... |
(load "load-symbols.lsp")
(load "load-eval-and-compile.lsp")
(load "load-data-and-control-flow.lsp")
(load "load-iteration.lsp")
(load "load-objects.lsp")
(load "load-conditions.lsp")
(load "load-cons.lsp")
(load "load-arrays.lsp")
(load "load-hash-tables.lsp")
(load "load-packages.lsp")
Tests of numbers ... |
c5649b8ab7f850f41736b2335dffa22cdf7fcc66f5b0befdf12985cd255c69ad | DaMSL/K3 | Hints.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
-- Type definitions to avoid circular imports.
module Language.K3.Codegen.CPP.Materialization.Hints where
import Control.DeepSeq
import Data.Binary
import Data.Hashable
import Data.Serialize
import Data.Typeable
import GHC.Generics (Generic)
data Method
... | null | https://raw.githubusercontent.com/DaMSL/K3/51749157844e76ae79dba619116fc5ad9d685643/src/Language/K3/Codegen/CPP/Materialization/Hints.hs | haskell | # LANGUAGE DeriveDataTypeable #
Type definitions to avoid circular imports.
Typeclass Instances | # LANGUAGE DeriveGeneric #
module Language.K3.Codegen.CPP.Materialization.Hints where
import Control.DeepSeq
import Data.Binary
import Data.Hashable
import Data.Serialize
import Data.Typeable
import GHC.Generics (Generic)
data Method
= ConstReferenced
| Referenced
| Moved
| Copied
| Forwarded
deriving (Eq... |
035b9a5d52765cde1a366865ad1ecca05f0cf68dfdc10404e82b4156e21759ec | ghcjs/jsaddle-dom | SVGFETileElement.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.SVGFETileElement
(getIn1, SVGFETileElement(..), gTypeSVGFETileElement) where
import Prelude ((.), (==), (>>=), retu... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/SVGFETileElement.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.SVGFETileElement
(getIn1, SVGFETileElement(..), gTypeSVGFETileElement) where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show, Re... |
44619c4641470d94eb72636960151e19f697803eb98444cb2f2537fe53dbcb8f | magnars/stubadub | test_runner.cljs | (ns stubadub.test-runner
(:require [doo.runner :refer-macros [doo-tests]]
[stubadub.core-test]))
(doo-tests 'stubadub.core-test)
| null | https://raw.githubusercontent.com/magnars/stubadub/dfde3b069f5c37769c3c432494892032eb3ac521/test/stubadub/test_runner.cljs | clojure | (ns stubadub.test-runner
(:require [doo.runner :refer-macros [doo-tests]]
[stubadub.core-test]))
(doo-tests 'stubadub.core-test)
| |
dd6c52a03223e33dfce4eca2b4df3071db02304c140bdc97fe54e95a1b29e766 | lambdacube3d/lambdacube-edsl | Backend.hs | module LambdaCube.GL.Backend where
import Debug.Trace
import Control.Applicative
import Control.Monad
import Data.ByteString.Char8 (ByteString)
import Data.IORef
import Data.List as L
import Data.Maybe
import Data.Set (Set)
import Data.Map (Map)
import Data.Trie as T
import Foreign
import qualified Data.ByteString.Ch... | null | https://raw.githubusercontent.com/lambdacube3d/lambdacube-edsl/4347bb0ed344e71c0333136cf2e162aec5941df7/lambdacube-gl/src/lib/LambdaCube/GL/Backend.hs | haskell | create
content manipulation
Renderer
-------------------------
odered according pass dependency (topology order)
[e | e@(Accumulate{}) <- IM.elems m]
-------------------------
texture attributes: GL texture target (1D,2D,etc), arity, float/word/int, size, mipmap
sampler attributes: filter, edge mode
putStr " -- d... | module LambdaCube.GL.Backend where
import Debug.Trace
import Control.Applicative
import Control.Monad
import Data.ByteString.Char8 (ByteString)
import Data.IORef
import Data.List as L
import Data.Maybe
import Data.Set (Set)
import Data.Map (Map)
import Data.Trie as T
import Foreign
import qualified Data.ByteString.Ch... |
d23d5c5393057d212f678635babafe9cb1becd8e039cce7315059ce48a151dc7 | racket/drracket | eval-helpers-and-pref-init.rkt | #lang racket/base
(require racket/class
racket/draw
racket/list
racket/unit
racket/set
compiler/cm
setup/dirs
planet/config
pkg/lib
framework/preferences
errortrace/stacktrace
"drracket-errortrace-key.rkt"
(prefi... | null | https://raw.githubusercontent.com/racket/drracket/92b90efd0de4ed6392306816a4f4c9eb475eebb5/drracket/drracket/private/eval-helpers-and-pref-init.rkt | racket | just to make sure it is here
get-init-dir : (or/c path? #f) -> path?
returns the initial directory for a program
that is saved in 'path/f' (with #f indicating
an unsaved file)
is this wise?
Use this parameter when creating a parallel-lock client,
so locks can be released when the user custodian is shut down.
T... | #lang racket/base
(require racket/class
racket/draw
racket/list
racket/unit
racket/set
compiler/cm
setup/dirs
planet/config
pkg/lib
framework/preferences
errortrace/stacktrace
"drracket-errortrace-key.rkt"
"compi... |
42e4331da73e8343feb4fed1496a20b8c67052ffa7f2abbc2028d137931bdaa2 | aaronc/fx-clj | util.clj | (ns ^:no-doc fx-clj.util
(:require
[fx-clj.impl.bootstrap]
[fx-clj.impl.util :refer [javadoc-link]]))
;; From :
(defn event-handler*
[f]
(reify javafx.event.EventHandler
(handle [this e] (f e))))
;; From :
(defmacro event-handler
{:doc (str "Wraps a " (javadoc-link javafx.event.EventHandler) ": (e... | null | https://raw.githubusercontent.com/aaronc/fx-clj/29639356d8d1253438ecf61e123caacefa9269ec/src/fx_clj/util.clj | clojure | From :
From : | (ns ^:no-doc fx-clj.util
(:require
[fx-clj.impl.bootstrap]
[fx-clj.impl.util :refer [javadoc-link]]))
(defn event-handler*
[f]
(reify javafx.event.EventHandler
(handle [this e] (f e))))
(defmacro event-handler
{:doc (str "Wraps a " (javadoc-link javafx.event.EventHandler) ": (event-handler \\[e\\]... |
5079cc0b6eaf70e1d96aa2795b447542e990631acf3b91f57d2d30b6bad5fece | realworldocaml/book | native_pointer.ml | * [ Native_pointer ] uses Nativeint to hold a pointer to a memory block allocated
outside the OCaml heap . The pointer is not required to be aligned .
outside the OCaml heap. The pointer is not required to be aligned. *)
type t = private nativeint
external create : nativeint -> t = "%identity"
(**
[... | null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/ocaml_intrinsics/src/native_pointer.ml | ocaml | *
[ext_pointer_as_native_pointer p] takes an int [p] that encodes
a pointer to a memory block outside of the OCaml heap,
decodes [p] by clearing the least significant bit of [p],
and boxes the result as [nativeint].
Unlike untagging, decoding [p] does not shift the bits of [p].
* [load_immediate] assume... | * [ Native_pointer ] uses Nativeint to hold a pointer to a memory block allocated
outside the OCaml heap . The pointer is not required to be aligned .
outside the OCaml heap. The pointer is not required to be aligned. *)
type t = private nativeint
external create : nativeint -> t = "%identity"
external... |
f5515d8755e7e643e67a3581e2d416210cfca3fa58077ff72feda3c41ee17b3b | ypyf/fscm | stdlib.scm | ; Continuation
(define call/cc call-with-current-continuation)
;(define call/fc call-with-failure-continuation)
(define (not x) (if x #f #t))
(define (null? obj) (if (eqv? obj '()) #t #f))
(define (list . objs) objs)
; alternative `list'
(define list (lambda x x))
(define (id obj) obj)
(define (flip func) (lambda (a... | null | https://raw.githubusercontent.com/ypyf/fscm/4e6a31665051d51bbcfc823ac8d85dcc3491a6ef/stdlib.scm | scheme | Continuation
(define call/fc call-with-failure-continuation)
alternative `list'
library syntax
(define map
(lambda (f lst)
(if (null? lst)
'()
(cons (f (car lst)) (map f (cdr lst))))))
(define (append . lst)
(define append-2
(if (null? lst)
(if (null? (cdr lst))
(car lst)
(d... | (define call/cc call-with-current-continuation)
(define (not x) (if x #f #t))
(define (null? obj) (if (eqv? obj '()) #t #f))
(define (list . objs) objs)
(define list (lambda x x))
(define (id obj) obj)
(define (flip func) (lambda (arg1 arg2) (func arg2 arg1)))
(define (curry func arg1) (lambda (arg) (apply func (con... |
c57acdde8dc3875e080acf778923aa881df186884455124d396562cc0aec7e9d | tommaisey/aeon | running-min.help.scm | ;; (running-min in trig)
;; Track minimum level. outputs the minimum value received at the
;; input. When triggered, the minimum output value is reset to the
;; current value.
;; in - input signal
;; trig - reset the output value to the current input value
(let* ((t (impulse ar 2.0 0))
(f (mul-add (runnin... | null | https://raw.githubusercontent.com/tommaisey/aeon/80744a7235425c47a061ec8324d923c53ebedf15/libs/third-party/sc3/rsc3/help/ugen/triggers/running-min.help.scm | scheme | (running-min in trig)
Track minimum level. outputs the minimum value received at the
input. When triggered, the minimum output value is reset to the
current value.
in - input signal
trig - reset the output value to the current input value |
(let* ((t (impulse ar 2.0 0))
(f (mul-add (running-min (sub 1 (dust ar 20)) t) 500 200)))
(audition (out 0 (mul (sin-osc ar f 0) 0.2))))
(let* ((t (impulse kr (mouse-x kr 0.5 4 1 0.1) 0))
(f (mul-add (running-min (sub 2 (sin-osc kr 2 0)) t) 500 200)))
(audition (out 0 (mul (sin-osc ar f 0) 0.2))))... |
c1f0913c5ea42b3e340cc5c4aa10c2bab3101182dbc90d9c617c8daf48c8e1d1 | LonoCloud/step.async | step_timeout.clj | (ns lonocloud.step.async.step-timeout
"Logic for dealing with timeouts in step machines"
(:require [lonocloud.step.async.pschema :as s]
[lonocloud.step.async.step-model :refer [TimeoutId ThreadId Channel]]
[lonocloud.step.async.util :as util :refer [no-nil no-empty]]))
;; schema
(def Timeo... | null | https://raw.githubusercontent.com/LonoCloud/step.async/31dc58f72cb9719a11a97dc36992c67cf3efb766/src/lonocloud/step/async/step_timeout.clj | clojure | schema | (ns lonocloud.step.async.step-timeout
"Logic for dealing with timeouts in step machines"
(:require [lonocloud.step.async.pschema :as s]
[lonocloud.step.async.step-model :refer [TimeoutId ThreadId Channel]]
[lonocloud.step.async.util :as util :refer [no-nil no-empty]]))
(def Timeout {:threa... |
4c5fb9af0afe232fd07b6178b025498f05843427bd91e4083338f72685bea38a | open-company/open-company-web | org.cljs | (ns oc.web.actions.org
(:require-macros [if-let.core :refer (when-let*)])
(:require [oc.web.api :as api]
[oops.core :refer (oget oset!)]
[clojure.string :as clj-str]
[oc.web.lib.jwt :as jwt]
[oc.web.urls :as oc-urls]
[oc.web.router :as router]
... | null | https://raw.githubusercontent.com/open-company/open-company-web/246cccb2818cc3bb9f05adeea4364ffa7171a586/src/main/oc/web/actions/org.cljs | clojure | User related functions
FIXME: these functions shouldn't be here but calling oc.web.actions.user from here is causing a circular dep
Do we need to show the add bot banner?
Active users
Org get
avoid infinite loop of the Go to digest button
by changing the value of the last visited slug
Replace default-board with... | (ns oc.web.actions.org
(:require-macros [if-let.core :refer (when-let*)])
(:require [oc.web.api :as api]
[oops.core :refer (oget oset!)]
[clojure.string :as clj-str]
[oc.web.lib.jwt :as jwt]
[oc.web.urls :as oc-urls]
[oc.web.router :as router]
... |
d4eae055b9e6c7104ed2a39c2331659410cb7a9a937030e9da4ae770fe57fffb | ekmett/lens | PrismTH.hs | # LANGUAGE CPP #
#ifdef TRUSTWORTHY
# LANGUAGE Trustworthy #
#endif
#include "lens-common.h"
-----------------------------------------------------------------------------
-- |
-- Module : Control.Lens.Internal.PrismTH
Copyright : ( C ) 2014 - 2016 and
-- License : BSD-style (see the file LICENSE... | null | https://raw.githubusercontent.com/ekmett/lens/8079273da1b8d67f2c2adf94f83915b591a9c1e9/src/Control/Lens/Internal/PrismTH.hs | haskell | ---------------------------------------------------------------------------
|
Module : Control.Lens.Internal.PrismTH
License : BSD-style (see the file LICENSE)
Stability : experimental
Portability : non-portable
---------------------------------------------------------------------------
| Generate... | # LANGUAGE CPP #
#ifdef TRUSTWORTHY
# LANGUAGE Trustworthy #
#endif
#include "lens-common.h"
Copyright : ( C ) 2014 - 2016 and
Maintainer : < >
module Control.Lens.Internal.PrismTH
( makePrisms
, makeClassyPrisms
, makeDecPrisms
) where
import Control.Applicative
import Control.Lens.Gett... |
34d44fb70a60165519074f4b6eff18930a8593aebb3fca845cb0b485d13c44eb | ZHaskell/stdio | Utils.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE UndecidableInstances #
# LANGUAGE TypeOperators #
# LANGUAGE MagicHash #
# LANGUAGE KindSignatures #
# LANGUAGE DataKinds #
# LANGUAGE TypeFamilies #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FunctionalDependenc... | null | https://raw.githubusercontent.com/ZHaskell/stdio/7887b9413dc9feb957ddcbea96184f904cf37c12/std-data/Std/Data/Generics/Utils.hs | haskell | | type class for calculating product size. | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE UndecidableInstances #
# LANGUAGE TypeOperators #
# LANGUAGE MagicHash #
# LANGUAGE KindSignatures #
# LANGUAGE DataKinds #
# LANGUAGE TypeFamilies #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FunctionalDependenc... |
8797443693825e8fdb4001e3ea0fcdfae21b49e3d60f76282fc7c238acf7685c | mdaguete/tcpbalance | tcp_proxy.erl | %%%-------------------------------------------------------------------------
%%% File : tcp_proxy.erl
%%% Purpose : A simple load balancing TCP proxy server
Author : , email : lhs = slfritchie , rhs = snookles.com
Copyright : ( c ) 2003 Caspian Networks , Inc.
%%%-----------------------------------------... | null | https://raw.githubusercontent.com/mdaguete/tcpbalance/d551d331bf01deb6ffeb60c6290598eac86d89dd/src/tcp_proxy.erl | erlang | -------------------------------------------------------------------------
File : tcp_proxy.erl
Purpose : A simple load balancing TCP proxy server
-------------------------------------------------------------------------
Setsockopt buffer size.
External exports
Internal exports
--------------------------------... | Author : , email : lhs = slfritchie , rhs = snookles.com
Copyright : ( c ) 2003 Caspian Networks , Inc.
-module(tcp_proxy).
-include("balance.hrl").
-define(BUFSIZ, (128*1024)).
-export([init/1, init/2]).
-export([accept_init/2, proxy/1]).
init(LocalPort) ->
init(LocalPort, self()).
init(LocalPort, ... |
7cb6339aaf9732e6fc261a07201b1c50c0fce29489bdfeb35383955814cf7183 | borodust/bodge-ui | color-box.lisp | (cl:in-package :bodge-ui)
;;;
;;; COLOR BOX
;;;
(defclass color-box (%layout widget)
((label :initarg :label :initform "")
(color :initarg :color :initform nil)
(height :initarg :height :initform 400f0)))
(defmethod compose ((this color-box))
(with-slots (height (this-color color) label) this
(c-with (... | null | https://raw.githubusercontent.com/borodust/bodge-ui/db896ca3be9026444398e0192a48b048aa7db574/src/elements/color-box.lisp | lisp |
COLOR BOX
| (cl:in-package :bodge-ui)
(defclass color-box (%layout widget)
((label :initarg :label :initform "")
(color :initarg :color :initform nil)
(height :initarg :height :initform 400f0)))
(defmethod compose ((this color-box))
(with-slots (height (this-color color) label) this
(c-with ((size (:struct %nuklea... |
ed2b0362a55f56941804514089d52800b0bdab793ecbe6ef77c69eaf0b11bc00 | k16shikano/xml2tex | latextable.scm | xmltex / latex.scm -- Some utilities for SXML to LaTeX converter
;; intended to use with cnvr.scm
Copyright ( c ) 2014 < >
;; Permission is hereby granted, free of charge, to any person obtaining a copy
;; of this software and associated documentation files (the "Software"), to deal
in the Softw... | null | https://raw.githubusercontent.com/k16shikano/xml2tex/6f8b1760a8914ca241fe24505b27151ae20b0192/xmltex/latextable.scm | scheme | intended to use with cnvr.scm
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the followin... | xmltex / latex.scm -- Some utilities for SXML to LaTeX converter
Copyright ( c ) 2014 < >
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTW... |
1539dc50b372763bdbf3f73531d272e226dc495e883f99968d5265d9581abdb2 | lem-project/lem | swank-macrostep.lisp | swank-macrostep.lisp -- fancy macro - expansion via macrostep.el
;;
Authors : < >
< >
;;
;; License: Public Domain
(defpackage :micros/contrib/macrostep
(:use cl :micros)
(:import-from :micros
#:*macroexpand-printer-bindings*
#:with-buffer-syntax
#:with-bindings
... | null | https://raw.githubusercontent.com/lem-project/lem/c1c3d35905bfd0c6d1af1df4f7c6a7f415a1c7e9/lib/micros/contrib/swank-macrostep.lisp | lisp |
License: Public Domain
Hacks to support macro-expansion within local context
using the private-use characters U+E000..U+F8FF as markers, so
that's our upper limit for how many we can use.
The pprint-dispatch table constructed by
MAKE-TRACKING-PPRINT-DISPATCH causes an infinite loop and stack
entry point a no-o... | swank-macrostep.lisp -- fancy macro - expansion via macrostep.el
Authors : < >
< >
(defpackage :micros/contrib/macrostep
(:use cl :micros)
(:import-from :micros
#:*macroexpand-printer-bindings*
#:with-buffer-syntax
#:with-bindings
#:to-string
... |
229f8e505e2ee06f130d2b13d96aa03450e945708feabc81bce0600a158cdc98 | finnishtransportagency/harja | hinnoittelut.clj | (ns harja.palvelin.palvelut.vesivaylat.hinnoittelut
(:require [clojure.java.jdbc :as jdbc]
[com.stuartsierra.component :as component]
[taoensso.timbre :as log]
[harja.palvelin.komponentit.http-palvelin :refer [julkaise-palvelu poista-palvelut]]
[harja.palvelin.asetukset... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/488b1e096f0611e175221d74ba4f2ffed6bea8f1/src/clj/harja/palvelin/palvelut/vesivaylat/hinnoittelut.clj | clojure | (ns harja.palvelin.palvelut.vesivaylat.hinnoittelut
(:require [clojure.java.jdbc :as jdbc]
[com.stuartsierra.component :as component]
[taoensso.timbre :as log]
[harja.palvelin.komponentit.http-palvelin :refer [julkaise-palvelu poista-palvelut]]
[harja.palvelin.asetukset... | |
d4f3b1d64d4aa770beb23ad5bedf7f9419fd187ce40a26ab16d03fd77da74306 | manavpatnaik/haskell | 1_greatest_of_2_nums.hs | maxTwoNums :: Int -> Int -> Int
maxTwoNums a b = if a>b then a else b
maxTwoNumsA :: Int -> Int -> Int
maxTwoNumsA a b
| a>=b = a
| otherwise = b
main = do
print(maxTwoNums 5 3)
print(maxTwoNums 5 6)
print(maxTwoNumsA 5 3)
print(maxTwoNumsA 5 6) | null | https://raw.githubusercontent.com/manavpatnaik/haskell/af45c3eb5c3461aa77cf25610dfcb3b41c7f7ef9/basic-programs/1_greatest_of_2_nums.hs | haskell | maxTwoNums :: Int -> Int -> Int
maxTwoNums a b = if a>b then a else b
maxTwoNumsA :: Int -> Int -> Int
maxTwoNumsA a b
| a>=b = a
| otherwise = b
main = do
print(maxTwoNums 5 3)
print(maxTwoNums 5 6)
print(maxTwoNumsA 5 3)
print(maxTwoNumsA 5 6) | |
1957233acd29b0c493d30bc7142f012c3861be9a97a8c338f6a35546f3b19045 | gvannest/piscine_OCaml | army.ml | class ['a] army (member:'a list) =
object (self)
val mutable _member = member
method add (soldier:'a) = _member <- (soldier :: _member)
method delete = _member <- try (List.tl _member) with | Failure err -> print_endline "Army is empty!" ; _member
method armySize = List.length _memb... | null | https://raw.githubusercontent.com/gvannest/piscine_OCaml/2533c6152cfb46c637d48a6d0718f7c7262b3ba6/d07/ex04/army.ml | ocaml | class ['a] army (member:'a list) =
object (self)
val mutable _member = member
method add (soldier:'a) = _member <- (soldier :: _member)
method delete = _member <- try (List.tl _member) with | Failure err -> print_endline "Army is empty!" ; _member
method armySize = List.length _memb... | |
99b9871758995fb70aa4348e3454338585161f20f61b2d056b88241be038127f | emqx/emqx | emqx_gc.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2017 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/emqx/dbc10c2eed3df314586c7b9ac6292083204f1f68/apps/emqx/src/emqx_gc.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2017 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
( 1 ) Total number of messages passed through
( 2 ) Total data volume passed through
-modul... |
d691536ae1ae64cbe87f3407a39bae3c51b629d548d21cd7de57b3b56c4c796d | idream-build/idream | Test.hs | module Idream.Command.Test
( testImpl
, NonTestPackagesErr (..)
) where
import qualified Data.Map as Map
import qualified Data.Set as Set
import Idream.Command.Common (mkProgramSpec, pkgGroupToText, readDepInfoMap, readResolvedProject)
import Idream.Effects.Process (procInvokeEnsure_)
import Idream.Prelude
impor... | null | https://raw.githubusercontent.com/idream-build/idream/61af6ef68abe6d4f9b67c10f1a3efde9bd93827b/src/Idream/Command/Test.hs | haskell | module Idream.Command.Test
( testImpl
, NonTestPackagesErr (..)
) where
import qualified Data.Map as Map
import qualified Data.Set as Set
import Idream.Command.Common (mkProgramSpec, pkgGroupToText, readDepInfoMap, readResolvedProject)
import Idream.Effects.Process (procInvokeEnsure_)
import Idream.Prelude
impor... | |
16ce1bceb3a9b4fe353f7d3570dce82cad9e7ba15378c6d139bc3f2e476ffe70 | kseo/poly_constraints | Parser.hs | {-# LANGUAGE OverloadedStrings #-}
module Parser (
parseExpr,
parseModule
) where
import Text.Parsec
import Text.Parsec.Text.Lazy (Parser)
import qualified Text.Parsec.Expr as Ex
import qualified Text.Parsec.Token as Tok
import qualified Data.Text.Lazy as L
import Lexer
import Syntax
integer :: Parser Integer... | null | https://raw.githubusercontent.com/kseo/poly_constraints/897240cd56b5aefae6f46aa445db055652a18b5b/src/Parser.hs | haskell | # LANGUAGE OverloadedStrings # |
module Parser (
parseExpr,
parseModule
) where
import Text.Parsec
import Text.Parsec.Text.Lazy (Parser)
import qualified Text.Parsec.Expr as Ex
import qualified Text.Parsec.Token as Tok
import qualified Data.Text.Lazy as L
import Lexer
import Syntax
integer :: Parser Integer
integer = Tok.integer lexer
varia... |
98141cab70736cad46003a6598c32962d3b1bc566eb19077d0b03f926de1407b | ujamjar/hardcaml | lwtsim.ml | open HardCaml
module Make(B : Comb.S)(I : Interface.S)(O : Interface.S) = struct
module S = Interface.Sim(B)(I)(O)
let make name f =
let circ,sim,i,o,n = S.make name f in
let reset () = Cyclesim.Api.reset sim in
let cycle () i' =
ignore @@ I.map2 (:=) i i';
Cyclesim.Api.cycle sim;
... | null | https://raw.githubusercontent.com/ujamjar/hardcaml/65f32f543348e81cbb7f6d0e77f1f1203bf4e335/lwttb/lwtsim.ml | ocaml | open HardCaml
module Make(B : Comb.S)(I : Interface.S)(O : Interface.S) = struct
module S = Interface.Sim(B)(I)(O)
let make name f =
let circ,sim,i,o,n = S.make name f in
let reset () = Cyclesim.Api.reset sim in
let cycle () i' =
ignore @@ I.map2 (:=) i i';
Cyclesim.Api.cycle sim;
... | |
14deb6790fb1a543c615287d1c9e23e771c508347d7fb7b7a7b5c9bc5d84fb5c | day8/re-frame-10x | cljs_devtools.cljs | (ns day8.re-frame-10x.components.cljs-devtools
(:require-macros
[day8.re-frame-10x.components.cljs-devtools :refer [with-cljs-devtools-prefs]])
(:require
[clojure.string :as string]
[devtools.prefs]
[devtools.formatters.core]
[goog.dom]
[goog.events]
[goog.style]
[g... | null | https://raw.githubusercontent.com/day8/re-frame-10x/d23563aa42955c71108f3175dc5dbd806012a280/src/day8/re_frame_10x/components/cljs_devtools.cljs | clojure | Hide index tags
Our JSON renderer does not have hierarchy depth limit,
See -devtools/blob/master/src/lib/devtools/formatters/budgeting.cljs
This used to be in the api-call fn below. However, recalculating this on *every* render is expensive so moved
here as static def.
TODO: If we expose ambiance and/or syntax co... | (ns day8.re-frame-10x.components.cljs-devtools
(:require-macros
[day8.re-frame-10x.components.cljs-devtools :refer [with-cljs-devtools-prefs]])
(:require
[clojure.string :as string]
[devtools.prefs]
[devtools.formatters.core]
[goog.dom]
[goog.events]
[goog.style]
[g... |
fa6ab6cc5c367be4d33fa7f49377997b5f29b53235c35701eeae2054ab262703 | webyrd/n-grams-for-synthesis | utilities_tiny-clos.scm | Copyright ( C ) 2003 and . See the LICENCE
;; file for details.
This file requires Tiny - CLOS and utilities.scm .
(define (subclass? c1 c2)
(or (eq? c2 <top>)
(and (memq c2 (class-cpl c1)) #t)))
(define (make-generic-predicate class)
(let ((g (make-generic)))
(add-method g
(make-metho... | null | https://raw.githubusercontent.com/webyrd/n-grams-for-synthesis/b53b071e53445337d3fe20db0249363aeb9f3e51/datasets/srfi/srfi-44/srfi-44/utilities_tiny-clos.scm | scheme | file for details.
Convenience macro for making methods.
(breakpoint
function generic specializers) | Copyright ( C ) 2003 and . See the LICENCE
This file requires Tiny - CLOS and utilities.scm .
(define (subclass? c1 c2)
(or (eq? c2 <top>)
(and (memq c2 (class-cpl c1)) #t)))
(define (make-generic-predicate class)
(let ((g (make-generic)))
(add-method g
(make-method (list <object>)
... |
d0543743f1dd664a6de591292af5f8b2e2db25974298922b41f23fea97db8156 | mejgun/haskell-tdlib | ResendPhoneNumberVerificationCode.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Query.ResendPhoneNumberVerificationCode where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
-- |
Resends the code to verify a phone number to be added to a user 's Telegram Passport
data ResendPhoneNumberVerific... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/e5c8059a74f88073b27dbfafb6908de0729af110/src/TD/Query/ResendPhoneNumberVerificationCode.hs | haskell | # LANGUAGE OverloadedStrings #
|
| |
module TD.Query.ResendPhoneNumberVerificationCode where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
Resends the code to verify a phone number to be added to a user 's Telegram Passport
data ResendPhoneNumberVerificationCode = ResendPhoneNumberVerificationCode... |
7b4d0639990d5efc567fd6e3a925d93a6e2459637f9ebfb1da6958c95c1e82bb | gsakkas/rite | 20060420-15:04:44-224ca4c8f96b2c6dcf0e1f035d8fdb0b.seminal.ml |
exception Unimplemented
exception RuntimeTypeError
exception DoesNotTypecheck of string
(****** Syntax for our language, including types (do not change) *****)
type exp = Var of string
| Lam of string * typ * exp
| Apply of exp * exp
| Closure of string * exp * (env ref)
| Int of int
| Pl... | null | https://raw.githubusercontent.com/gsakkas/rite/958a0ad2460e15734447bc07bd181f5d35956d3b/features/data/seminal/20060420-15%3A04%3A44-224ca4c8f96b2c6dcf0e1f035d8fdb0b.seminal.ml | ocaml | ***** Syntax for our language, including types (do not change) ****
***** Interpreter for our language (do not change) ****
**** helper functions provided to you (do not change) ****
********* examples and testing ********** |
exception Unimplemented
exception RuntimeTypeError
exception DoesNotTypecheck of string
type exp = Var of string
| Lam of string * typ * exp
| Apply of exp * exp
| Closure of string * exp * (env ref)
| Int of int
| Plus of exp * exp
| If of exp * exp * exp
| RecordE of (string * exp)... |
e5eacaf6e11144320213f3d25d1a8aaac08e622318a0fef552764839d4f87be2 | lispnik/iup | dialogs.lisp | ;;; Generated from org-mode, do not edit
(eval-when (:compile-toplevel :load-toplevel :execute)
(ql:quickload '("iup" "iup-scintilla")))
(defpackage #:iup-examples.dialogs
(:use #:common-lisp)
(:export #:dialogs))
(in-package #:iup-examples.dialogs)
(defun dialogs ()
(iup:with-iup ()
(iup-scintilla:open... | null | https://raw.githubusercontent.com/lispnik/iup/f8e5f090bae47bf8f91ac6fed41ec3bc01061186/examples/dialogs.lisp | lisp | Generated from org-mode, do not edit |
(eval-when (:compile-toplevel :load-toplevel :execute)
(ql:quickload '("iup" "iup-scintilla")))
(defpackage #:iup-examples.dialogs
(:use #:common-lisp)
(:export #:dialogs))
(in-package #:iup-examples.dialogs)
(defun dialogs ()
(iup:with-iup ()
(iup-scintilla:open)
(flet ((button (title callback)
... |
79b65d378c05d33d43f2cea144798c1fd85281aedf071c410ee5729f0d0fb1c6 | aarkerio/ZentaurLMS | env.clj | (ns zentaur.env
(:require [clojure.tools.logging :as log]))
(System/setProperty "tika.config" "tika-config.xml")
(System/setProperty "lein.profile" "uberjar")
(def secret-salt {:salt "1fcg54arw3dc1ea6"})
(def defaults
{:init
(fn []
(log/info "\n-=[Production zentaur started successfully]=-"))
:stop
... | null | https://raw.githubusercontent.com/aarkerio/ZentaurLMS/adb43fb879b88d6a35f7f556cb225f7930d524f9/env/prod/clj/zentaur/env.clj | clojure | (ns zentaur.env
(:require [clojure.tools.logging :as log]))
(System/setProperty "tika.config" "tika-config.xml")
(System/setProperty "lein.profile" "uberjar")
(def secret-salt {:salt "1fcg54arw3dc1ea6"})
(def defaults
{:init
(fn []
(log/info "\n-=[Production zentaur started successfully]=-"))
:stop
... | |
14e55bf780425f7a1dc33631df1cc5933f1355cb351001aead6470346921c060 | bcc32/projecteuler-ocaml | sol_blank.ml | open! Core
open! Import
let main () =
if debug then Debug.eprint "<debugging output>";
printf "<dummy answer>\n"
;;
include
(val Solution.make
~problem:
(Custom
{ name = "blank"
; description =
"dummy solution for benchmarking solution apparatus ... | null | https://raw.githubusercontent.com/bcc32/projecteuler-ocaml/712f85902c70adc1ec13dcbbee456c8bfa8450b2/sol/sol_blank.ml | ocaml | open! Core
open! Import
let main () =
if debug then Debug.eprint "<debugging output>";
printf "<dummy answer>\n"
;;
include
(val Solution.make
~problem:
(Custom
{ name = "blank"
; description =
"dummy solution for benchmarking solution apparatus ... | |
f9cbbc210852fc4dc3201347f8a7961a9a22834b89595f69871ef8b0e3cf7067 | ghcjs/ghcjs | t15696_3.hs | import qualified Data.Set as S
main = print $
# noinline f #
f () = T2
in S.fromList [f (), f ()]
data T = T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9
deriving (Show, Read, Eq, Ord, Bounded, Enum)
| null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/codeGen/t15696_3.hs | haskell | import qualified Data.Set as S
main = print $
# noinline f #
f () = T2
in S.fromList [f (), f ()]
data T = T1 | T2 | T3 | T4 | T5 | T6 | T7 | T8 | T9
deriving (Show, Read, Eq, Ord, Bounded, Enum)
| |
06461fd3e86fba01bbb4f6e3cf4bd6664a5e4323d1f84cbb116714adf6a1b334 | primeteach/specomatic | util_test.cljc | (ns specomatic.util-test
(:require
[clojure.test :refer [deftest is]]
[specomatic.util :as su]))
(deftest concat-keywords-test
(is (= :ns/ab (su/concat-keywords :ns/a :ns2/b)))
(is (thrown? Exception (su/concat-keywords "a" "b"))
"concat-keywords should only accept keywords as arguments"))
(defte... | null | https://raw.githubusercontent.com/primeteach/specomatic/de219bc8cd2119080ca1b68d0c2b837f14368215/test/specomatic/util_test.cljc | clojure | (ns specomatic.util-test
(:require
[clojure.test :refer [deftest is]]
[specomatic.util :as su]))
(deftest concat-keywords-test
(is (= :ns/ab (su/concat-keywords :ns/a :ns2/b)))
(is (thrown? Exception (su/concat-keywords "a" "b"))
"concat-keywords should only accept keywords as arguments"))
(defte... | |
c8f61344d1a0ef95e3f61a89772687712de68e2eb9a210a01659986088f7d50b | andreaslyn/mini-yu | Term.hs | module TypeCheck.Term
( Var (..)
, VarId
, VarIdSet
, VarName
, SubstMap
, CaseTree (..)
, PreTerm (..)
, RefVar (..)
, DataCtorMap
, Term (..)
, mkTerm
, PrePattern (..)
, Pattern (..)
, RefMap
, RefMeta (..)
, ImplicitMap
, ExternSet
, Implicits
, mkVar
, mkTermTy
, mkTermUni... | null | https://raw.githubusercontent.com/andreaslyn/mini-yu/b4c5ef2ac24c6e9519d79ee378e39e9c22ee873d/src/TypeCheck/Term.hs | haskell | number of explicit arguments, and case tree:
Lazy fun Bool = True if IO fun:
Lazy arrow Bool = True if it is an IO arrow:
Application Bool = True if IO application:
Bool for implicit app is true if the implicit app
has been given explicitly:
Lazy aplication where Bool = True if IO application:
Val name and lazy... | module TypeCheck.Term
( Var (..)
, VarId
, VarIdSet
, VarName
, SubstMap
, CaseTree (..)
, PreTerm (..)
, RefVar (..)
, DataCtorMap
, Term (..)
, mkTerm
, PrePattern (..)
, Pattern (..)
, RefMap
, RefMeta (..)
, ImplicitMap
, ExternSet
, Implicits
, mkVar
, mkTermTy
, mkTermUni... |
a6384dc1dec25d092e92ddd595782c6a03068d021f625a4ec814c2ce3fad4c18 | ipfs-shipyard/cube | gui.clj | (ns cube.gui
(:gen-class)
(:require [clojure.pprint :refer [pprint]]
[clojure.java.browse :refer [browse-url]]
[com.stuartsierra.component :as c])
(:use seesaw.core))
(def cube-status-str {:starting "Starting..."
:running "Running!"
:error "Erro... | null | https://raw.githubusercontent.com/ipfs-shipyard/cube/bd835a35a5273c744cbc415425ffbdb0990901e6/src/cube/gui.clj | clojure | (ns cube.gui
(:gen-class)
(:require [clojure.pprint :refer [pprint]]
[clojure.java.browse :refer [browse-url]]
[com.stuartsierra.component :as c])
(:use seesaw.core))
(def cube-status-str {:starting "Starting..."
:running "Running!"
:error "Erro... | |
aa604ee3f76cb23a21a20d67a69ec32ea5ee12a7d0d70dc50408511530b7528b | rosejn/Peer | dht.clj | (defprotocol IDHT
(assoc [this id data])
(dissoc [this id])
(get [this id]))
| null | https://raw.githubusercontent.com/rosejn/Peer/f79c39f5155def9de224207922658587fa576e2a/src/peer/dht.clj | clojure | (defprotocol IDHT
(assoc [this id data])
(dissoc [this id])
(get [this id]))
| |
63491a1e4fa114ee77547b2373e9af55f39fd8c0f85600dfb71f33fc7ac3eb4d | haskell-opengl/OpenGLRaw | F11.hs | {-# OPTIONS_HADDOCK hide #-}
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.Functions.F11
Copyright : ( c ) 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
-- Raw functions from ... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/Functions/F11.hs | haskell | # OPTIONS_HADDOCK hide #
------------------------------------------------------------------------------
|
Module : Graphics.GL.Functions.F11
License : BSD3
Stability : stable
Portability : portable
Raw functions from the
</ OpenGL registry>.
-----------------------------------------------------... | Copyright : ( c ) 2019
Maintainer : < >
module Graphics.GL.Functions.F11 (
glGetMaterialxOES,
glGetMaterialxv,
glGetMaterialxvOES,
glGetMemoryObjectDetachedResourcesuivNV,
glGetMemoryObjectParameterivEXT,
glGetMinmax,
glGetMinmaxEXT,
glGetMinmaxParameterfv,
glGetMinmaxParameterfvEXT... |
9c10e67d95b533c65fa18c9d32c162d95fa707c7a1db1883b57bef4dc0a927a4 | patrikja/AFPcourse | Problem2Test.hs | {-# LANGUAGE TypeSynonymInstances #-}
module Problem2Test where
import Control.Monad
import Test.QuickCheck
import Problem2c
-- Generators
string :: Gen String
string = do
NonNegative n <- arbitrary
replicateM n $ elements "XYZ"
genIndent :: Gen Int
genIndent = sized $ \n -> resize (div n 3) $ do
NonNegativ... | null | https://raw.githubusercontent.com/patrikja/AFPcourse/1a079ae80ba2dbb36f3f79f0fc96a502c0f670b6/exam/2008-08/Problem2Test.hs | haskell | # LANGUAGE TypeSynonymInstances #
Generators
Tests |
module Problem2Test where
import Control.Monad
import Test.QuickCheck
import Problem2c
string :: Gen String
string = do
NonNegative n <- arbitrary
replicateM n $ elements "XYZ"
genIndent :: Gen Int
genIndent = sized $ \n -> resize (div n 3) $ do
NonNegative n <- arbitrary
return n
newtype Doc' = Doc' Doc... |
24ba51cbd26c7fdfaeee550b1c450a3da780aa3b061041b82955fb808d019b1a | ekmett/coda | Alex.hs |
# language BangPatterns #
{-# language TypeFamilies #-}
# language DeriveGeneric #
{-# language DeriveDataTypeable #-}
---------------------------------------------------------------------------------
-- |
Copyright : ( c ) 2017 - 2018
License : BSD-2 - Clause OR Apache-2.0
Maintainer : < >
-- Sta... | null | https://raw.githubusercontent.com/ekmett/coda/bca7e36ab00036f92d94eb86298712ab1dbf9b8d/src/coda/Syntax/Alex.hs | haskell | # language TypeFamilies #
# language DeriveDataTypeable #
-------------------------------------------------------------------------------
|
Stability : experimental
Portability: non-portable
A simple input adapter that allows @alex@ to work with 'Text'
-------------------------------------------------------------... |
# language BangPatterns #
# language DeriveGeneric #
Copyright : ( c ) 2017 - 2018
License : BSD-2 - Clause OR Apache-2.0
Maintainer : < >
module Syntax.Alex
( AlexInput(..)
, AlexInputState(..)
, alexGetByte
) where
import Data.Bits
import Data.Data
import Data.String
import Data.Text
i... |
bc5a1a5769fb4e459166d8fa86719613565ae0d57c42bfaaf6f99448c7f17d02 | aleator/CV | Binary.hs | -- |Binary instances for images. Currently it only supports the type
` Image Grayscale D32 ` .
{-#LANGUAGE ScopedTypeVariables, FlexibleInstances#-}
module CV.Binary where
import CV.Image (Image,GrayScale,D32)
import CV.Conversions
import Data.Maybe (fromJust)
import Data.Binary
import Data.Array.CArray
import Data... | null | https://raw.githubusercontent.com/aleator/CV/1e2c9116bcaacdf305044c861a1b36d0d8fb71b7/CV/Binary.hs | haskell | |Binary instances for images. Currently it only supports the type
#LANGUAGE ScopedTypeVariables, FlexibleInstances#
NOTE: This binary instance is NOT PORTABLE. | ` Image Grayscale D32 ` .
module CV.Binary where
import CV.Image (Image,GrayScale,D32)
import CV.Conversions
import Data.Maybe (fromJust)
import Data.Binary
import Data.Array.CArray
import Data.Array.IArray
instance Binary (Image GrayScale D32) where
put img = do
let arr :: CArray (Int,Int) Double... |
d063a300c693bbfe203621b77a25e4b836e8d6b51f1c1548a7fb273de0b08ddd | racket/plai | global-roots.rkt | #lang plai/mutator
(allocator-setup "../good-collectors/good-collector.rkt" 20)
(define car first)
'junk
'junk
'junk
(test/value=? (car (cons 'this-car 2)) 'this-car)
| null | https://raw.githubusercontent.com/racket/plai/164f3b763116fcfa7bd827be511650e71fa04319/plai-lib/tests/gc/good-mutators/global-roots.rkt | racket | #lang plai/mutator
(allocator-setup "../good-collectors/good-collector.rkt" 20)
(define car first)
'junk
'junk
'junk
(test/value=? (car (cons 'this-car 2)) 'this-car)
| |
3282be7c67095ce9ab7a5ba42797700f7b3114a110241130e2224d5c303dca29 | nilenso/time-tracker | io.clj | (ns time-tracker.timers.pubsub.io
(:require [org.httpkit.server :refer [send!]]
[cheshire.core :as json]
[taoensso.timbre :as log]
[time-tracker.timers.pubsub.state :as state]))
(defn send-data!
"Wrapper of send! that logs data and encodes JSON."
[channel data]
;; TODO: Some... | null | https://raw.githubusercontent.com/nilenso/time-tracker/054d0dc6d6b89a4ed234d8f0b0a260b6deeef9e3/src/clj/time_tracker/timers/pubsub/io.clj | clojure | TODO: Somehow log the recepient host. | (ns time-tracker.timers.pubsub.io
(:require [org.httpkit.server :refer [send!]]
[cheshire.core :as json]
[taoensso.timbre :as log]
[time-tracker.timers.pubsub.state :as state]))
(defn send-data!
"Wrapper of send! that logs data and encodes JSON."
[channel data]
(log/debug (m... |
a33fde9d1b0f0f7dfb6a4cce35f548f988ec433ac4b8e99e91444857e8faf6d9 | Cumulus/Cumulus | db_table.ml |
Copyright ( c ) 2012
Permission is hereby granted , free of charge , to any person obtaining a copy of
this software and associated documentation files ( the " Software " ) , to deal in
the Software without restriction , including without limitation the rights to
use , copy , modify , merge , publish , dis... | null | https://raw.githubusercontent.com/Cumulus/Cumulus/3b6de05d76c57d528e052aa382f98e40354cf581/src/base/db/db_table.ml | ocaml | id integer NOT NULL DEFAULT(nextval $favs_id_seq$), |
Copyright ( c ) 2012
Permission is hereby granted , free of charge , to any person obtaining a copy of
this software and associated documentation files ( the " Software " ) , to deal in
the Software without restriction , including without limitation the rights to
use , copy , modify , merge , publish , dis... |
b335685d483fa7cc5a6dae084f1409d69c5e5b4ef07ea1252b82d4099c06d90b | mattboehm/dottask | help.cljs | (ns dottask.help
(:require
[reagent.core :as reagent]
[dottask.core :as core]
)
)
(def dottask-help [
{:id "toolbar-buttons" :title "Toolbar" :contents [
{:id "add-card" :title "Add a card" :contents ["Click the 'Add card' button to add a new blank card"]}
{:id "bulk-add" :title "Bulk ... | null | https://raw.githubusercontent.com/mattboehm/dottask/0e481424a6a1f2fa60620af99e73e2efe218ca88/src/dottask/help.cljs | clojure | [{:id "foo" :title "fooing a bar" :contents ["this is how you foo a bar"]}]
anchor-link that scrolls to the element with the given ID | (ns dottask.help
(:require
[reagent.core :as reagent]
[dottask.core :as core]
)
)
(def dottask-help [
{:id "toolbar-buttons" :title "Toolbar" :contents [
{:id "add-card" :title "Add a card" :contents ["Click the 'Add card' button to add a new blank card"]}
{:id "bulk-add" :title "Bulk ... |
70943462b22107d2841d2d0bf9e2f4993a2e1ad61f3cfc119385e7aa4145ecd5 | EarnestResearch/yambda | KinesisSpec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeApplications #
module AWS.Lambda.Event.KinesisSpec where
import AWS.Lambda.Event.Kinesis
import Data.Aeson
import qualified Data.ByteString.Lazy as LB
import qualified Paths_yambda as Paths
import Test.Hspec
spec :: Spec
spec = descri... | null | https://raw.githubusercontent.com/EarnestResearch/yambda/b1f45e42447c08d7da4b3f470bdb849c9ea1b200/core/test/AWS/Lambda/Event/KinesisSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TypeApplications #
module AWS.Lambda.Event.KinesisSpec where
import AWS.Lambda.Event.Kinesis
import Data.Aeson
import qualified Data.ByteString.Lazy as LB
import qualified Paths_yambda as Paths
import Test.Hspec
spec :: Spec
spec = describe "JSON decoding" $
it "parse ki... |
8f3c8e7770d6b98b11785b0c6f87a01baf916ca926799a52a039207cb8bc9d76 | mfikes/fifth-postulate | ns50.cljs | (ns fifth-postulate.ns50)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (xs... | null | https://raw.githubusercontent.com/mfikes/fifth-postulate/22cfd5f8c2b4a2dead1c15a96295bfeb4dba235e/src/fifth_postulate/ns50.cljs | clojure | (ns fifth-postulate.ns50)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (xs... | |
99069947452216d7abbe98604a76d77607c7243417834507fdbcdac0cae59574 | icicle-lang/icicle-ambiata | Constraints.hs | -- | Doing things with Constraints
--
# LANGUAGE DeriveGeneric #
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternGuards #
module Icicle.Source.Type.Constraints (
DischargeResult (..)
, DischargeError (..)
, dischargeC
, dischargeC'toplevel
, dischargeCS
, dischargeCS'
... | null | https://raw.githubusercontent.com/icicle-lang/icicle-ambiata/9b9cc45a75f66603007e4db7e5f3ba908cae2df2/icicle-source/src/Icicle/Source/Type/Constraints.hs | haskell | | Doing things with Constraints
# LANGUAGE OverloadedStrings #
| Result of discharging a single constraint
| Don't yet know whether the constraint is satisfied
This is really only for things like "IsNum a"
| Constraint requires a substitution
| Errors that arise from constraints
| Two types that can't be unifie... | # LANGUAGE DeriveGeneric #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE PatternGuards #
module Icicle.Source.Type.Constraints (
DischargeResult (..)
, DischargeError (..)
, dischargeC
, dischargeC'toplevel
, dischargeCS
, dischargeCS'
, nubConstraints
) where
import Data.Hashable (Hashable)
im... |
bd89fc6bdf0a0f996a5180d6b4f755d1e51f27866b5e9dcf537ba8c56c0d4410 | kqr/gists | linkcrawler.hs | # LANGUAGE OverloadedStrings , TemplateHaskell #
-
- This is probably a bit useless at the moment because the crawling is
- untargeted , so it 'll generate a bunch of useless links . You probably
- want to first check whether the link leads to HTML data to get a more
- sensible set .
-
- Oh , and... | null | https://raw.githubusercontent.com/kqr/gists/b0b5ab2a6af0f939a9e24165959bb362281ce897/utils/linkcrawler.hs | haskell | ----------------------------------
where each element can only exist
in it once ever, and it keeps track
of which elements has passed
through it.
End of super fancy special queue object
------------------------------------------
recursively visit all urls in the uniqueue
get and parse all href attributes for a p... | # LANGUAGE OverloadedStrings , TemplateHaskell #
-
- This is probably a bit useless at the moment because the crawling is
- untargeted , so it 'll generate a bunch of useless links . You probably
- want to first check whether the link leads to HTML data to get a more
- sensible set .
-
- Oh , and... |
c713627f814e4c31ef3f26bb48f6eb1cf9e6698b75deee5c79aed5be391c0d17 | input-output-hk/cardano-benchmarking | Analysis.hs | # LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE StrictData #-}
# OPTIONS_GHC -Wno - incomplete - patterns -Wno - name - shadowing #
module Cardano.Unlog.Analysis (module Cardano.Unlog.Analysis) where
import ... | null | https://raw.githubusercontent.com/input-output-hk/cardano-benchmarking/af05b42df27e2cc7305475cf5c4efa81e7f97540/locli/src/Cardano/Unlog/Analysis.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE StrictData #
Slot log entry for a slot we've supposedly done processing.
Limited back-patching:
Give up.
We have a slot check gap to patch:
Update resource stats accumulators & record values current slot.
Updated as we see repeats: | # LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -Wno - incomplete - patterns -Wno - name - shadowing #
module Cardano.Unlog.Analysis (module Cardano.Unlog.Analysis) where
import Prelude (String, error)
import Cardano.Pr... |
3f347fcf2daf426715a731ecb445e00548ebe27faebaabbc5f03722353d2fd85 | MinaProtocol/mina | operation.ml |
* This file has been generated by the OCamlClientCodegen generator for openapi - generator .
*
* Generated by : -generator.tech
*
* Schema Operation.t : Operations contain all balance - changing information within a transaction . They are always one - sided ( only affect 1 AccountIdentifier ) and can suc... | null | https://raw.githubusercontent.com/MinaProtocol/mina/a80b00221953c26ff158e7375a948b5fa9e7bd8b/src/lib/rosetta_models/operation.ml | ocaml | Status is the network-specific status of the operation. Status is not defined on the transaction object because blockchains with smart contracts may have transactions that partially apply (some operations are successful and some are not). Blockchains with atomic transactions (all operations succeed or all operations f... |
* This file has been generated by the OCamlClientCodegen generator for openapi - generator .
*
* Generated by : -generator.tech
*
* Schema Operation.t : Operations contain all balance - changing information within a transaction . They are always one - sided ( only affect 1 AccountIdentifier ) and can suc... |
cc498cb943ec33b503058f0f5c983481bbb10f6c24575d91e1e8ec6a0f428cd1 | scrintal/heroicons-reagent | minus_small.cljs | (ns com.scrintal.heroicons.solid.minus-small)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M5.25 12a.75.75 0 01.75-.75h12a.75.75 0 010 1.5H6a.75.75 0 01-.75-.75z"
... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/solid/minus_small.cljs | clojure | (ns com.scrintal.heroicons.solid.minus-small)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M5.25 12a.75.75 0 01.75-.75h12a.75.75 0 010 1.5H6a.75.75 0 01-.75-.75z"
... | |
d7c8dd8359abcb2b500d168616febaaf0c4c23d9a6e827d9068d4eb130255319 | zen-lang/zen | store.clj | (ns zen.store
(:require [zen.v2-validation :as v2]
[zen.utils]
[clojure.edn]
[clojure.java.io :as io]
[clojure.walk :as walk]
[edamame.core]
[clojure.string :as str]))
(def get-symbol zen.utils/get-symbol)
(def get-tag zen.utils/get-tag)
(def ... | null | https://raw.githubusercontent.com/zen-lang/zen/d18a6980b145b37659209c2c75c0bbc7dfbcaacc/src/zen/store.clj | clojure | do not validate zen/quote'd symbols
save resource
upd tags registry
resolve late binding
TODO: maybe not only tags must be saved?
do imports
process aliases
eval symbols and aliases
TODO: cache find file | (ns zen.store
(:require [zen.v2-validation :as v2]
[zen.utils]
[clojure.edn]
[clojure.java.io :as io]
[clojure.walk :as walk]
[edamame.core]
[clojure.string :as str]))
(def get-symbol zen.utils/get-symbol)
(def get-tag zen.utils/get-tag)
(def ... |
59e04d89bb4acd82a68f9d8e8a0d30de991677523d0939428fe1c80a7b1f7512 | NorfairKing/autorecorder | Main.hs | module Main where
import AutoRecorder
main :: IO ()
main = autoRecorder
| null | https://raw.githubusercontent.com/NorfairKing/autorecorder/8d0b771324c2cf79448fea30725d7b5899eeb557/autorecorder/app/Main.hs | haskell | module Main where
import AutoRecorder
main :: IO ()
main = autoRecorder
| |
b4c78258a16345c132ad305783e801a7a52590806fd4ba9b313efd22ecde88bf | clj-commons/iapetos | registry.clj | (ns iapetos.registry
(:refer-clojure :exclude [get name])
(:require [iapetos.registry
[collectors :as collectors]
[utils :as utils]])
(:import [io.prometheus.client Collector CollectorRegistry]))
# # Protocol
(defprotocol Registry
"Protocol for the iapetos collector registry."
(s... | null | https://raw.githubusercontent.com/clj-commons/iapetos/493b38c0d22afc5a4cd409bdd9748e15a960aa44/src/iapetos/registry.clj | clojure | (ns iapetos.registry
(:refer-clojure :exclude [get name])
(:require [iapetos.registry
[collectors :as collectors]
[utils :as utils]])
(:import [io.prometheus.client Collector CollectorRegistry]))
# # Protocol
(defprotocol Registry
"Protocol for the iapetos collector registry."
(s... | |
755090f453a3513b5302a57cde047d9eb19e6cabebedf4fc9a4d0b1f12dd8841 | mks-m/wower | logon_server.erl | -module(logon_server).
-export([loop/1]).
-export([receiver/2, sender/2]).
-include("logon_records.hrl").
-include("database_records.hrl").
loop(Socket) ->
R = spawn_link(?MODULE, receiver, [Socket, self()]),
S = spawn_link(?MODULE, sender, [Socket, self()]),
client(#logon_state{receiver = R, sender = S})... | null | https://raw.githubusercontent.com/mks-m/wower/ce9724876cf57b67ce72f2a9a6f74bb1ebffd53a/logon/src/logon_server.erl | erlang | -module(logon_server).
-export([loop/1]).
-export([receiver/2, sender/2]).
-include("logon_records.hrl").
-include("database_records.hrl").
loop(Socket) ->
R = spawn_link(?MODULE, receiver, [Socket, self()]),
S = spawn_link(?MODULE, sender, [Socket, self()]),
client(#logon_state{receiver = R, sender = S})... | |
4503a619124218451e3d7aa2416a4ea442daf925fd7125063f45e6f89b7c6139 | LeventErkok/sbv | Int_ABC.hs | -----------------------------------------------------------------------------
-- |
Module : TestSuite . Queries . Int_ABC
Copyright : ( c )
-- License : BSD3
-- Maintainer:
-- Stability : experimental
--
Testing ABC specific interactive features .
---------------------------------------------------------... | null | https://raw.githubusercontent.com/LeventErkok/sbv/cfaa40b8c8ff8e1b7ff9ab71304654f6f531ba72/SBVTestSuite/TestSuite/Queries/Int_ABC.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD3
Maintainer:
Stability : experimental
---------------------------------------------------------------------------
# OPTIONS_GHC -Wall -Werror #
Test suite
Query a/b | Module : TestSuite . Queries . Int_ABC
Copyright : ( c )
Testing ABC specific interactive features .
# LANGUAGE ScopedTypeVariables #
module TestSuite.Queries.Int_ABC (tests) where
import Data.SBV.Control
import Control.Monad (unless)
import Utils.SBVTestFramework
tests :: TestTree
tests =
testGro... |
05cbd0c72e1b720c36682982e71dde50e93ce1188ea4d11b1c808f08cb88d98d | joneshf/open-source | Core.hs | -- |
-- Module: Dhall.JavaScript.Core
Description : The core of the logic for compiling to JavaScript .
--
Copyright : ( c ) , 2018
-- License: BSD3
-- Maintainer:
-- Stability: experimental
module Dhall.JavaScript.Core
( toJS
) where
import "base" Control.Monad ((>=>))
import "freer-s... | null | https://raw.githubusercontent.com/joneshf/open-source/e3412fc68c654d89a8d3af4e12ac19c70e3055ec/packages/dhall-javascript/haskell/src/Dhall/JavaScript/Core.hs | haskell | |
Module: Dhall.JavaScript.Core
License: BSD3
Maintainer:
Stability: experimental
| | Description : The core of the logic for compiling to JavaScript .
Copyright : ( c ) , 2018
module Dhall.JavaScript.Core
( toJS
) where
import "base" Control.Monad ((>=>))
import "freer-simple" Control.Monad.Freer (Eff, Member)
import "freer-simple" Control.Monad.Freer.Fresh (F... |
a66283abd1fd4c9f1d03f8ad544f9ce4c2a5a885b4eb6c7ad07a6ff959cb9c23 | ocaml/dune | action_mapper.ml | open Import
module Make (Src : Action_intf.Ast) (Dst : Action_intf.Ast) = struct
type map =
Src.t
-> dir:Src.path
-> f_program:(dir:Src.path -> Src.program -> Dst.program)
-> f_string:(dir:Src.path -> Src.string -> Dst.string)
-> f_path:(dir:Src.path -> Src.path -> Dst.path)
-> f_target:(d... | null | https://raw.githubusercontent.com/ocaml/dune/ea424da26ffbbf255a6f64998bd798d0ebaa3e2a/src/dune_engine/action_mapper.ml | ocaml | open Import
module Make (Src : Action_intf.Ast) (Dst : Action_intf.Ast) = struct
type map =
Src.t
-> dir:Src.path
-> f_program:(dir:Src.path -> Src.program -> Dst.program)
-> f_string:(dir:Src.path -> Src.string -> Dst.string)
-> f_path:(dir:Src.path -> Src.path -> Dst.path)
-> f_target:(d... | |
a1e485d7ff54bf254c08d8922a5abf336b0bbe8d6baee1b0d7979b9c58e139c5 | containium/containium | elasticsearch.clj | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns containium.systems.elasticsearch
(:require [containium.systems :refer (require-system)]
[containium.systems.config :refer (Co... | null | https://raw.githubusercontent.com/containium/containium/dede4098de928bed9ce8fccfc0a3891655ee162e/src/containium/systems/elasticsearch.clj | clojure | The public API for Elastic systems.
(reset! stop-monitor true)
(reset! stop-monitor true) | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns containium.systems.elasticsearch
(:require [containium.systems :refer (require-system)]
[containium.systems.config :refer (Co... |
6f00cb284a53894342561aa4b28e65555c6b0aed7622f97b8c64c7c6be10e244 | rescript-lang/rescript-compiler | ast_compatible.mli | Copyright ( C ) 2018 Authors of ReScript
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/4419af7d822c7c9dffe21532624810985915908b/jscomp/frontend/ast_compatible.mli | ocaml | [(label,e)] [label] is strictly interpreted as label
* Note this function would slightly
change its semantics depending on compiler versions
for newer version: it means always label
for older version: it could be optional (which we should avoid)
val opt_label : string -> Asttypes.arg_label | Copyright ( C ) 2018 Authors of ReScript
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .... |
4bbbc7620b15fae9682a4bc47a34890231accc3ca3b9f0628f8f1d73d3b4aa32 | sosy-lab/tbf | simplemem.inferred.mli | val thefunc : Cil.fundec option ref
val assignment_list : Cil.instr list ref
val array_to_pointer : Cil.typ -> Cil.typ
val make_temp : Cil.typ -> Cil.varinfo
val separate_loffsets : Cil.offset -> Cil.offset * Cil.offset
val handle_lvalue : Cil.lhost * Cil.offset -> Cil.lval
val handle_loffset : Cil.lval -> Cil.offset -... | null | https://raw.githubusercontent.com/sosy-lab/tbf/18d08d6cee6fbfbad4d4ebfa7aed235521edec2b/tbf/tools/crest/cil/_build/src/ext/simplemem.inferred.mli | ocaml | val thefunc : Cil.fundec option ref
val assignment_list : Cil.instr list ref
val array_to_pointer : Cil.typ -> Cil.typ
val make_temp : Cil.typ -> Cil.varinfo
val separate_loffsets : Cil.offset -> Cil.offset * Cil.offset
val handle_lvalue : Cil.lhost * Cil.offset -> Cil.lval
val handle_loffset : Cil.lval -> Cil.offset -... | |
a0da835d00d7f1e21debdc5a96984936a0f2342232b9a68bf171af3b4e420a9f | the-dr-lazy/cascade | Foldable.hs | |
Module : Cascade . Data . Foldable
Description : ! ! ! INSERT MODULE SHORT DESCRIPTION ! ! !
Copyright : ( c ) 2020 - 2021 Cascade
License : MPL 2.0
Maintainer : < > ( the-dr-lazy.github.io )
Stability : Stable
Portability : POSIX
! ! ! INSERT MODULE LONG DESCRIPTION ! ! !
Mod... | null | https://raw.githubusercontent.com/the-dr-lazy/cascade/014a5589a2763ce373e8c84a211cddc479872b44/cascade-prelude/src/Cascade/Data/Foldable.hs | haskell | |
Module : Cascade . Data . Foldable
Description : ! ! ! INSERT MODULE SHORT DESCRIPTION ! ! !
Copyright : ( c ) 2020 - 2021 Cascade
License : MPL 2.0
Maintainer : < > ( the-dr-lazy.github.io )
Stability : Stable
Portability : POSIX
! ! ! INSERT MODULE LONG DESCRIPTION ! ! !
Mod... | |
463a57aa587d0fa195a7c1276cd6d3e37c6ae9bae4aedc59da22838b0cf398e3 | jordanthayer/ocaml-search | astar.ml | *
A * search algorithm as through the search interface
- June 2009
A* search algorithm as through the search interface
Jordan Thayer - June 2009
*)
type 'a node = {
Data Payload
f : float; (* Total cost of a node*)
g : float; (* Cost of reaching a node *)
depth : int; ... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/search/best_first/astar.ml | ocaml | Total cost of a node
Cost of reaching a node
Depth of node in tree. Root @ 0
Position info for dpq
* takes a function to be applied to the data payload
such as the goal-test or the domain heuristic and
wraps it so that it can be applied to the entire
node
* Unwraps a solution which is in the ... | *
A * search algorithm as through the search interface
- June 2009
A* search algorithm as through the search interface
Jordan Thayer - June 2009
*)
type 'a node = {
Data Payload
}
let wrap f =
(fun n -> f n.data)
let unwrap_sol s =
match s with
| Limit.Nothing -> None
| Limit.... |
40b68d96609d5d90ef038910e3187c023883295c07dc2183b5321c1d098d22f8 | leocadiotine/fred | image_resizer.clj | (ns fred.image-resizer
(:import java.io.File
javax.imageio.ImageIO
org.imgscalr.Scalr
org.imgscalr.Scalr$Method
java.awt.image.BufferedImageOp))
(defn list-all-files
"List all files on a given directory."
[root-dir relative-dir]
(.listFiles (File. (str root-dir rela... | null | https://raw.githubusercontent.com/leocadiotine/fred/8fa95f83f5fec49bc35676dc6261e0cbccb911fc/code/src/fred/image_resizer.clj | clojure | (ns fred.image-resizer
(:import java.io.File
javax.imageio.ImageIO
org.imgscalr.Scalr
org.imgscalr.Scalr$Method
java.awt.image.BufferedImageOp))
(defn list-all-files
"List all files on a given directory."
[root-dir relative-dir]
(.listFiles (File. (str root-dir rela... | |
fa7580e44a0818c1da36bd43b19b9e9f417965411451cdafdd82623ffcccf835 | exercism/scheme | rna-transcription.scm | (import (rnrs))
(define (dna->rna dna)
'implement-me!)
| null | https://raw.githubusercontent.com/exercism/scheme/bad074a0b46c05820c2a0397ff922499087d8ea0/input/exercises/rna-transcription/rna-transcription.scm | scheme | (import (rnrs))
(define (dna->rna dna)
'implement-me!)
| |
5ac636d5d7a81a17145e88274e795be57d47588f8707ed75c58c57d0f182ab1e | input-output-hk/project-icarus-importer | ProtocolConstants.hs | -- | Protocol constants and some derived terms.
module Pos.Core.ProtocolConstants
( ProtocolConstants (..)
, VssMinTTL (..)
, VssMaxTTL (..)
, pcBlkSecurityParam
, pcSlotSecurityParam
, pcChainQualityThreshold
, pcEpochSlots
) where
import Universum
import Pos.Cor... | null | https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/core/src/Pos/Core/ProtocolConstants.hs | haskell | | Protocol constants and some derived terms.
| The 'k' parameter and TTLs for VSS certificates.
| Security parameter from the paper.
| VSS certificates min timeout to live (number of epochs).
| VSS certificates max timeout to live (number of epochs).
| Minimum time-to-live for a VSS certificate.
| Maximum time-t... |
module Pos.Core.ProtocolConstants
( ProtocolConstants (..)
, VssMinTTL (..)
, VssMaxTTL (..)
, pcBlkSecurityParam
, pcSlotSecurityParam
, pcChainQualityThreshold
, pcEpochSlots
) where
import Universum
import Pos.Core.Common (BlockCount (..))
import Pos.... |
529d23923fb261f990f4d6eb865e04223917fc6fa3a75c1eceaa9e69fe442301 | deobald/sicp-clojure | scheme_helpers.clj |
(ns ch4.scheme-helpers)
(defn car [x] (first x))
(defn cdr [x] (next x))
(defn cadr [x] (second x))
(defn caddr [x] (first (next (next x))))
(defn cdddr [x] (next (next (next x))))
(defn caddr [x] (first (next (next x))))
(defn cadddr [x] (first (next (next (next x)))))
(defn null? [x] (nil? x))
| null | https://raw.githubusercontent.com/deobald/sicp-clojure/fc24e5114604e7a0510dab779bbff962aac7ee7e/src/ch4/scheme_helpers.clj | clojure |
(ns ch4.scheme-helpers)
(defn car [x] (first x))
(defn cdr [x] (next x))
(defn cadr [x] (second x))
(defn caddr [x] (first (next (next x))))
(defn cdddr [x] (next (next (next x))))
(defn caddr [x] (first (next (next x))))
(defn cadddr [x] (first (next (next (next x)))))
(defn null? [x] (nil? x))
| |
c6b3644bd965d2bfa0045d94cb33081758b01f449bc8bf1dd1a84e4d9ce7548f | threatgrid/clj-momo | console.clj | (ns clj-momo.lib.metrics.console
(:require [metrics.reporters.console :as console]))
(defn start [interval]
(console/start (console/reporter {}) interval))
| null | https://raw.githubusercontent.com/threatgrid/clj-momo/7bc0a411593eee4a939b6a3d0f628413518e09e2/src/clj_momo/lib/metrics/console.clj | clojure | (ns clj-momo.lib.metrics.console
(:require [metrics.reporters.console :as console]))
(defn start [interval]
(console/start (console/reporter {}) interval))
| |
a80bbbbd12240db37e1b45e151cd66b7e00a65d02f0e2a0eb6847c4c38aefe56 | janestreet/async_kernel | eager_deferred_or_error.ml | open! Core
open! Async_kernel
open! Import
module Deferred = Eager_deferred0
module Deferred_result = Eager_deferred_result
module Monitor = struct
let try_with ?(run = `Now) = Monitor.try_with ~run
end
Copied from [ deferred_or_error.ml ] . There should be no diffs below this line .
include (Deferred_result :... | null | https://raw.githubusercontent.com/janestreet/async_kernel/765ab511573166377eb3ed76ff069d6a4bdfb399/eager_deferred/src/eager_deferred_or_error.ml | ocaml | from Applicative.Make | open! Core
open! Async_kernel
open! Import
module Deferred = Eager_deferred0
module Deferred_result = Eager_deferred_result
module Monitor = struct
let try_with ?(run = `Now) = Monitor.try_with ~run
end
Copied from [ deferred_or_error.ml ] . There should be no diffs below this line .
include (Deferred_result :... |
beddff51334ab06cac679b7f91ab6ee251ee345a325f46156cbe97d6630038b9 | toyokumo/tarayo | body_test.clj | (ns tarayo.mail.mime.multipart.body-test
(:require
[clojure.java.io :as io]
[clojure.test :as t]
[tarayo.mail.mime.multipart.body :as sut])
(:import
(jakarta.mail.internet
MimeBodyPart
MimeUtility)
java.nio.file.Files))
(t/deftest make-bodypart-text-html-test
(t/testing "string type"
(... | null | https://raw.githubusercontent.com/toyokumo/tarayo/f9b10b85b7bc1a188d808c3955e258916cd0b38a/test/tarayo/mail/mime/multipart/body_test.clj | clojure | (ns tarayo.mail.mime.multipart.body-test
(:require
[clojure.java.io :as io]
[clojure.test :as t]
[tarayo.mail.mime.multipart.body :as sut])
(:import
(jakarta.mail.internet
MimeBodyPart
MimeUtility)
java.nio.file.Files))
(t/deftest make-bodypart-text-html-test
(t/testing "string type"
(... | |
f49fba35484da2e20dc8e722b729aa8e9bc5fde9fd1b19dec5f04ce375483b4b | marcioj/todo-cljs | store_test.cljs | (ns todo.store-test
(:require
[cljs.test :refer-macros [deftest testing is use-fixtures]]
[todo.store :as store]))
(use-fixtures :each
{:before #(reset! store/state {:todos [] :filter-fn identity})})
(deftest add-todo-test
(do (store/add-todo "hey")
(is (= (count (:todos @store/state)) 1))))
(deftes... | null | https://raw.githubusercontent.com/marcioj/todo-cljs/9cbf9cdf8b9866313d51b7998d50366912ac1758/test/todo/store_test.cljs | clojure | (ns todo.store-test
(:require
[cljs.test :refer-macros [deftest testing is use-fixtures]]
[todo.store :as store]))
(use-fixtures :each
{:before #(reset! store/state {:todos [] :filter-fn identity})})
(deftest add-todo-test
(do (store/add-todo "hey")
(is (= (count (:todos @store/state)) 1))))
(deftes... | |
85113c80034a35b899f01afba16c804a0586408682fe71c3bdc59a21a4ad04a8 | AngryLawyer/reactjs_of_ocaml | ReactAddonsTestUtils.ml | let render_into_document item =
let test_utils = [%require "react-addons-test-utils"] in
Js.Unsafe.meth_call test_utils "renderIntoDocument" [| Js.Unsafe.inject item |]
| null | https://raw.githubusercontent.com/AngryLawyer/reactjs_of_ocaml/e89b077cc5c43b09021234478a82e66f2bfe5c37/lib/ReactAddonsTestUtils.ml | ocaml | let render_into_document item =
let test_utils = [%require "react-addons-test-utils"] in
Js.Unsafe.meth_call test_utils "renderIntoDocument" [| Js.Unsafe.inject item |]
| |
828fae606a9d20720be412aab18e588e85c1450f848d50d39a6d3c19e98aa51f | Clozure/ccl | ffi-freebsdx8664.lisp | -*- Mode : Lisp ; Package : CCL -*-
;;;
Copyright 2007 - 2009 Clozure Associates
;;;
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 appl... | null | https://raw.githubusercontent.com/Clozure/ccl/6c1a9458f7a5437b73ec227e989aa5b825f32fd3/lib/ffi-freebsdx8664.lisp | lisp | Package : CCL -*-
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 la... | Copyright 2007 - 2009 Clozure Associates
distributed under the License is distributed on an " AS IS " BASIS ,
(in-package "CCL")
It looks like x86 - 64 Linux , FreeBSD , and all share the same
ABI .
(defun x86-freebsd64::record-type-returns-structure-as-first-arg (rtype)
(x8664::record-type-returns-struct... |
27086e6421c40fe27143f5aa08ebbf16d65b01965ac868268726da3f99fa3e7d | xapi-project/xen-api | server_helpers.mli |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | null | https://raw.githubusercontent.com/xapi-project/xen-api/406251e895ffe5300e90206ee46b271f2e85af4a/ocaml/xapi/server_helpers.mli | ocaml |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | |
8904bbbb5abbc6985ef241e00c7c0721221f3c68a36c3891df3c67805aa98403 | jbracker/supermonad | Types.hs |
# LANGUAGE RebindableSyntax #
{-# OPTIONS_GHC -fplugin Control.Supermonad.Plugin #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE TypeOperators #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -fno - warn - orphans #
module Types
( Message, User
, Update(..), Request(..), Response(..)
... | null | https://raw.githubusercontent.com/jbracker/supermonad/2595396a225a65b1dce6ed9a1ce59960f392a55b/examples/monad/session-chat/supermonad/Types.hs | haskell | # OPTIONS_GHC -fplugin Control.Supermonad.Plugin #
| Type of the user identifier.
| Type of messages.
| Updates from the server.
| Requests from the client.
| Responses from the server to the client 'Request's.
| Type of a connection between server and client (View from server-side).
| Create a new connection.
... |
# LANGUAGE RebindableSyntax #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE TypeOperators #
# LANGUAGE TypeFamilies #
# OPTIONS_GHC -fno - warn - orphans #
module Types
( Message, User
, Update(..), Request(..), Response(..)
, UpdateS, RequestS, EndS
, ServerInit, ServerProto... |
092823bd0a2dfc80b32d1c5755fc1c1bd5c04d0798bccb4a1664ca1292b1ed51 | MinaProtocol/mina | mina_base_zkapp_precondition.ml | module Closed_interval = struct
module V1 = struct
type 'a t = { lower : 'a; upper : 'a }
end
end
module Numeric = struct
module V1 = struct
type 'a t = 'a Closed_interval.V1.t Mina_base_zkapp_basic.Or_ignore.V1.t
end
end
module Protocol_state = struct
module Epoch_data = struct
module V1 = stru... | null | https://raw.githubusercontent.com/MinaProtocol/mina/9a97ea71909a802f2ade0305a8069f7cbace5619/src/lib/mina_wire_types/mina_base/mina_base_zkapp_precondition.ml | ocaml | module Closed_interval = struct
module V1 = struct
type 'a t = { lower : 'a; upper : 'a }
end
end
module Numeric = struct
module V1 = struct
type 'a t = 'a Closed_interval.V1.t Mina_base_zkapp_basic.Or_ignore.V1.t
end
end
module Protocol_state = struct
module Epoch_data = struct
module V1 = stru... | |
758230a44934a8e30fdcb0c5f10691c2c54f92e92285147e6df011ff11fe0e06 | metabase/metabase | large_int_id_test.clj | (ns metabase.query-processor.middleware.large-int-id-test
(:require
[clojure.test :refer :all]
[metabase.query-processor :as qp]
[metabase.query-processor.middleware.large-int-id :as large-int-id]
[metabase.test :as mt]))
(set! *warn-on-reflection* true)
(deftest convert-ids
(let [query (mt/mbql-query... | null | https://raw.githubusercontent.com/metabase/metabase/7e3048bf73f6cb7527579446166d054292166163/test/metabase/query_processor/middleware/large_int_id_test.clj | clojure | see comment in [[metabase.query-processor.middleware.large-int-id/convert-id-to-string]]
for why this value does not change | (ns metabase.query-processor.middleware.large-int-id-test
(:require
[clojure.test :refer :all]
[metabase.query-processor :as qp]
[metabase.query-processor.middleware.large-int-id :as large-int-id]
[metabase.test :as mt]))
(set! *warn-on-reflection* true)
(deftest convert-ids
(let [query (mt/mbql-query... |
61d08d74397629428c1965a952138841d455f427b3baf93c95d7620d5da3f21d | phadej/cabal-extras | GHC.hs | module Peura.GHC (
* GHC info
GhcInfo (..),
getGhcInfo,
* ghc - pkg
findGhcPkg,
-- * Package databases
PackageDb,
readPackageDb,
-- * Flags
GhcFlags (..),
getGhcFlags,
-- * Trace
TraceGhc (..),
MakeGhcTracer (..),
) where
import Data.List (isSuffixOf, l... | null | https://raw.githubusercontent.com/phadej/cabal-extras/34663e3e5b6105fffa54800462462fc79f0a68f3/peura/src/Peura/GHC.hs | haskell | * Package databases
* Flags
* Trace
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------... | module Peura.GHC (
* GHC info
GhcInfo (..),
getGhcInfo,
* ghc - pkg
findGhcPkg,
PackageDb,
readPackageDb,
GhcFlags (..),
getGhcFlags,
TraceGhc (..),
MakeGhcTracer (..),
) where
import Data.List (isSuffixOf, lookup)
import Distribution.Parsec (eitherParsec)
import ... |
3388f21b2c6a92e4c630573aa26c027cfb560ffec4c493c3dc08616a5ea4b7af | philipcristiano/etsdb | etsdb_vnode_SUITE.erl | -module(etsdb_vnode_SUITE).
-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
-include_lib("riak_core/include/riak_core_vnode.hrl").
-export([all/0]).
-export([groups/0, init_per_testcase/2, end_per_testcase/2]).
-export([list_keys/1,
read/1,
aggregate/1]).
send_... | null | https://raw.githubusercontent.com/philipcristiano/etsdb/f1c0d1d8baff8666d55a1f30e77a40652d173826/test/etsdb_vnode_SUITE.erl | erlang | -module(etsdb_vnode_SUITE).
-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
-include_lib("riak_core/include/riak_core_vnode.hrl").
-export([all/0]).
-export([groups/0, init_per_testcase/2, end_per_testcase/2]).
-export([list_keys/1,
read/1,
aggregate/1]).
send_... | |
962fd9fe0475b72fc9d7053d3a4796e90e960822d32a493d50f0c6e86c82ead3 | g-andrade/erlwitness | erlwitness_conf.erl | % vim: set expandtab softtabstop=4 shiftwidth=4:
-module(erlwitness_conf).
-author('Guilherme Andrade <erlwitness(at)gandrade(dot)net>').
-export([get_lookup_module/0,
use_internal_indexing/0,
get_index_serv_count/0]).
-spec get_lookup_module() -> module().
get_lookup_module() ->
application:get... | null | https://raw.githubusercontent.com/g-andrade/erlwitness/047ea86ea2fec9c3dab1ef091a3a1dfea23abaad/src/erlwitness_conf.erl | erlang | vim: set expandtab softtabstop=4 shiftwidth=4: | -module(erlwitness_conf).
-author('Guilherme Andrade <erlwitness(at)gandrade(dot)net>').
-export([get_lookup_module/0,
use_internal_indexing/0,
get_index_serv_count/0]).
-spec get_lookup_module() -> module().
get_lookup_module() ->
application:get_env(erlwitness, entity_lookup_module,
... |
2ee9a4e950047c70a86b1a94587b3c69699d915264d36123cd4573bec0b42a29 | rain-1/tarot-compiler | display.scm | ;; defines DISPLAY in terms of primitive %DISPLAY
;; also defines WRITE and PRINT
(define (display-symbol port form) (%display port form))
(define (display-char port ch) (%display port ch))
(define (display-chars port chrs) (for-each (lambda (ch) (display-char port ch)) chrs))
(define (display-boolean port form)
(... | null | https://raw.githubusercontent.com/rain-1/tarot-compiler/aff0d0cdddc185e8f8c4eb2fa92f67fbdc0a2677/std/display.scm | scheme | defines DISPLAY in terms of primitive %DISPLAY
also defines WRITE and PRINT
TODO escaping |
(define (display-symbol port form) (%display port form))
(define (display-char port ch) (%display port ch))
(define (display-chars port chrs) (for-each (lambda (ch) (display-char port ch)) chrs))
(define (display-boolean port form)
(if form
(display-chars port '(#\# #\t))
(display-chars port '(#\# #\f)... |
2791942172348ed1c6efa800038714d76b599618764dc690e79e55c79fc5fe33 | ferigis/netconf | netconf_server.erl | %%%-------------------------------------------------------------------
%%% @doc
%%% This module is a gen server. It manages the session ids.
%%% @end
%%%-------------------------------------------------------------------
-module(netconf_server).
-behaviour(gen_server).
%% API
-export([start_link/0]).
-export([new_ses... | null | https://raw.githubusercontent.com/ferigis/netconf/c92654450039a0604296851b13e545db3e26d7bb/src/netconf_server.erl | erlang | -------------------------------------------------------------------
@doc
This module is a gen server. It manages the session ids.
@end
-------------------------------------------------------------------
API
gen_server callbacks
===================================================================
API
==============... | -module(netconf_server).
-behaviour(gen_server).
-export([start_link/0]).
-export([new_session_id/0]).
-export([init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3]).
-define(SERVER, ?MODULE).
-define(ETS, ?MODULE).
start_link() ->
gen_server:start_link({local, ?SERVER}, ?M... |
7076e361100308790d9766cacb951ffdb027a952b7b0869bae981df6ef1a56ce | input-output-hk/cardano-sl | Types.hs | # LANGUAGE TypeFamilies #
-- | Types used for pure transaction processing (aka Toil).
module Pos.Chain.Txp.Toil.Types
( Utxo
, UtxoLookup
, UtxoModifier
, formatUtxo
, utxoF
, utxoToModifier
, utxoToLookup
, StakesView (..)
, svStakes
, svTotal
... | null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/chain/src/Pos/Chain/Txp/Toil/Types.hs | haskell | | Types used for pure transaction processing (aka Toil).
--------------------------------------------------------------------------
--------------------------------------------------------------------------
| Unspent transaction outputs.
Transaction inputs are identified by (transaction ID, index in list of
output... | # LANGUAGE TypeFamilies #
module Pos.Chain.Txp.Toil.Types
( Utxo
, UtxoLookup
, UtxoModifier
, formatUtxo
, utxoF
, utxoToModifier
, utxoToLookup
, StakesView (..)
, svStakes
, svTotal
, TxFee(..)
, MemPool (..)
, mpLocalTxs
... |
15e7a8d178fb213e6bdfa852edc35ba04786d2fa3b0faeb05bb0fac3efe6e4a3 | jimcrayne/jhc | Random.hs | # OPTIONS_JHC -fffi #
The June 1988 ( v31 # 6 ) issue of the Communications of the ACM has an
article by called , " Efficient and Portable Combined
Random Number Generators " . Here is the Portable Combined Generator of
L'Ecuyer for 32 - bit computers . It has a period of roughly 2.30584e18 .
Translite... | null | https://raw.githubusercontent.com/jimcrayne/jhc/1ff035af3d697f9175f8761c8d08edbffde03b4e/lib/haskell-extras/System/Random.hs | haskell | without this Hat+nhc98 do not work
because it shouldn't ever fail.
Minimal complete definition: random and randomR
hah, so you thought you were saving cycles by using Float?
mkStdRNG o = do
ct <- getCPUTime
TODO Bad !
no statistical foundation for this!
#else
ptr_b = unsadePerformIO $ malloc
theStd... | # OPTIONS_JHC -fffi #
The June 1988 ( v31 # 6 ) issue of the Communications of the ACM has an
article by called , " Efficient and Portable Combined
Random Number Generators " . Here is the Portable Combined Generator of
L'Ecuyer for 32 - bit computers . It has a period of roughly 2.30584e18 .
Translite... |
49146299b028bd41943502a732edf7c777ca5baf1ff4d13fb07651af422ea863 | hjwylde/werewolf | Circle.hs | |
Module : Werewolf . Command . Circle
Description : Options and handler for the circle subcommand .
Copyright : ( c ) , 2016
License : :
Options and handler for the circle subcommand .
Module : Werewolf.Command.Circle
Description : Options and handler for the circle subcommand... | null | https://raw.githubusercontent.com/hjwylde/werewolf/d22a941120a282127fc3e2db52e7c86b5d238344/app/Werewolf/Command/Circle.hs | haskell | * Options
* Handle | |
Module : Werewolf . Command . Circle
Description : Options and handler for the circle subcommand .
Copyright : ( c ) , 2016
License : :
Options and handler for the circle subcommand .
Module : Werewolf.Command.Circle
Description : Options and handler for the circle subcommand... |
6a72f22f544ae44a51ce42663bd67f96e3a04d0040138c4b67280d96e85237d8 | racket/drracket | harness.rkt | #lang racket
(require gui-debugger/annotator gui-debugger/load-sandbox syntax/parse
gui-debugger/marks)
(provide run-code-with-annotator break/test)
;; Syntax -> Any
;; run the given code with the debugging annotator
;; WARNING: the code *must* have src-locs to be annotated
;; the debugging annotator skips c... | null | https://raw.githubusercontent.com/racket/drracket/2d7c2cded99e630a69f05fb135d1bf7543096a23/drracket-test/tests/drracket/gui-debugger/harness.rkt | racket | Syntax -> Any
run the given code with the debugging annotator
WARNING: the code *must* have src-locs to be annotated
the debugging annotator skips code with no source
always trigger breaks
don't interpose on returned values
if we are not in tail position don't interpose on returned values
record-bound-identifie... | #lang racket
(require gui-debugger/annotator gui-debugger/load-sandbox syntax/parse
gui-debugger/marks)
(provide run-code-with-annotator break/test)
(define (run-code-with-annotator code)
(parameterize ([current-namespace (make-base-namespace)])
(define stx (expand-syntax code))
(eval/annotations
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.