_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 |
|---|---|---|---|---|---|---|---|---|
081c7d67f1c888385eb9e908bc1920a10575ba3fcbc0f6c980561b56ec4581ff | footprintanalytics/footprint-web | vertica.clj | (ns metabase.test.data.vertica
"Code for creating / destroying a Vertica database from a `DatabaseDefinition`."
(:require [clojure.data.csv :as csv]
[clojure.java.jdbc :as jdbc]
[clojure.string :as str]
[clojure.test :refer :all]
[java-time :as t]
[medley.... | null | https://raw.githubusercontent.com/footprintanalytics/footprint-web/d3090d943dd9fcea493c236f79e7ef8a36ae17fc/modules/drivers/vertica/test/metabase/test/data/vertica.clj | clojure | #2
TODO = explain...
escape commas
make sure the Table is empty
load the rows from the CSV file
it should return the number of rows inserted; make sure this matches what we expected
make sure SELECT COUNT(*) matches as well
success!
Close all existing sessions connected to our test DB
the default is 5 or so w... | (ns metabase.test.data.vertica
"Code for creating / destroying a Vertica database from a `DatabaseDefinition`."
(:require [clojure.data.csv :as csv]
[clojure.java.jdbc :as jdbc]
[clojure.string :as str]
[clojure.test :refer :all]
[java-time :as t]
[medley.... |
452f6f4cc8b6462a227f34f8945692cf58f1307679b7cd842bc226334107d584 | janestreet/core | bool.mli | * This module extends { { ! Base . Bool}[Base . ] } .
type t = bool [@@deriving bin_io, typerep]
include module type of Base.Bool with type t := t
include
Identifiable.S
with type t := t
and type comparator_witness := Base.Bool.comparator_witness
(**
Human readable parsing. Accepted inputs are (case inse... | null | https://raw.githubusercontent.com/janestreet/core/4b6635d206f7adcfac8324820d246299d6f572fe/core/src/bool.mli | ocaml | *
Human readable parsing. Accepted inputs are (case insensitive):
- true/false
- yes/no
- 1/0
- t/f
- y/n
| * This module extends { { ! Base . Bool}[Base . ] } .
type t = bool [@@deriving bin_io, typerep]
include module type of Base.Bool with type t := t
include
Identifiable.S
with type t := t
and type comparator_witness := Base.Bool.comparator_witness
val of_string_hum : string -> t
include Quickcheckable.S wit... |
be8aba0c8b34c71cf32075ac2dda6975b7abe06c9a91496d61d03a1753eee957 | bpoweski/athena-tools | tools.clj | (ns athena.tools
(:require [cheshire.core :as json]
[puget.printer :as puget]
[clojure.tools.cli :as cli]
[clojure.string :as str]
[clojure.java.io :as io]
[puget.printer :as puget]
[clojure.tools.trace :as t]
[orca.core :as orca])
... | null | https://raw.githubusercontent.com/bpoweski/athena-tools/9b54e4a49815d97b94b1031ca37097822f6b8460/src/athena/tools.clj | clojure | useful technique from -etl-pipelines-with-clojure | (ns athena.tools
(:require [cheshire.core :as json]
[puget.printer :as puget]
[clojure.tools.cli :as cli]
[clojure.string :as str]
[clojure.java.io :as io]
[puget.printer :as puget]
[clojure.tools.trace :as t]
[orca.core :as orca])
... |
42eec29c883a8b139e7088217aec114ea04f82b4888acf0b1b9f5b90e0e6953c | alsonkemp/turbinado | Server.hs | module Turbinado.Server where
import Control.Concurrent
import Control.Monad
import System.IO
import System.Directory
import System.Time
import System.Environment (getArgs, getEnvironment)
import System.Console.GetOpt
import Network hiding (accept)
import Network.FastCGI
import Network.Socket
import Prelude hiding (... | null | https://raw.githubusercontent.com/alsonkemp/turbinado/da2ba7c3443ddf6a51d1ec5b05cb45a85efc0809/Turbinado/Server.hs | haskell | | Handle a few options, then kick off the server.
starts listening on the specified port. As soon as a request is noticed,
Run as Server
----------------------------------------------
| Worker stuff used for HTTP processing
----------------------------------------------
| Basic request handling: setup the 'Envir... | module Turbinado.Server where
import Control.Concurrent
import Control.Monad
import System.IO
import System.Directory
import System.Time
import System.Environment (getArgs, getEnvironment)
import System.Console.GetOpt
import Network hiding (accept)
import Network.FastCGI
import Network.Socket
import Prelude hiding (... |
5397f55cfb94526c3ab780bece185835016813180df571f6f4f6f9cb3bac23e2 | sgbj/MaximaSharp | dlasd5.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy ... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/lapack/lapack/dlasd5.lisp | lisp | Compiled by f2cl version:
Using Lisp CMU Common Lisp 20d (20D Unicode)
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 2edcbd958861 2012/05/30 03:34:52 toy $ "
" f2cl2.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl3.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl4.l , v 96616d88fb7e 2008/02/22 22:19:34 rtoy $ "
" f2cl5.l , v 3fe93de3be82 2012/05/06 02:17:14 toy $ "
" f2cl6.l , v 1d5cbacbb... |
ba9db2be072c19f38c43c6c16cc3fd79278da381b910f1f3fbd1f32733f3eac9 | tsloughter/rebar3_tests | project_app_behaviours.erl | -module(project_app_behaviours).
-behaviour(project_app_with_behaviour).
-export([test/0]).
test() ->
ok.
| null | https://raw.githubusercontent.com/tsloughter/rebar3_tests/090bfef7d3a4790bb6b16e4c38df6e4c0460b4b2/project_app_behaviours/apps/project_app_behaviours/src/project_app_behaviours.erl | erlang | -module(project_app_behaviours).
-behaviour(project_app_with_behaviour).
-export([test/0]).
test() ->
ok.
| |
07ea17234ad5ea041d32eb8e980aad6c06fa0567a30c1acb48201313802dbf99 | huangjs/cl | autol.lisp | (in-package :maxima)
;; These are the helper functions for autoloading.
;; The actual autoloading data is in src/max_ext.lisp
( aload " plot.o " )
(defun aload (file &aux *load-verbose* tem)
(let (($system (list '(mlist)
#+kcl (concatenate 'string si::*system-directory*
"../src/foo.{o,lsp,lisp}"))))
... | null | https://raw.githubusercontent.com/huangjs/cl/96158b3f82f82a6b7d53ef04b3b29c5c8de2dbf7/lib/maxima/src/autol.lisp | lisp | These are the helper functions for autoloading.
The actual autoloading data is in src/max_ext.lisp
foo(x,y):=..
foo(x,y):=.. | (in-package :maxima)
( aload " plot.o " )
(defun aload (file &aux *load-verbose* tem)
(let (($system (list '(mlist)
#+kcl (concatenate 'string si::*system-directory*
"../src/foo.{o,lsp,lisp}"))))
(declare (special $system))
(setq tem ($file_search1 file '((mlist)
$file_search_lisp
... |
4622d4c71fb42c91702edcfd502e63e561de7fcab04d38bba1d0a4ebab04da8d | robert-strandh/CLIMatis | packages.lisp | (defpackage :mf
(:use #:cl)
(:export #:make-bezier-segment #:bezier-segment
#:make-open-path #:make-closed-path
#:closed-path #:concatenate-paths #:path-start
#:close-path
#:polygonalize
#:path-bounding-box
#:scan-lines
#:first-line #:nb-lines #:crossings
#:translate #:rotate #:scale... | null | https://raw.githubusercontent.com/robert-strandh/CLIMatis/4949ddcc46d3f81596f956d12f64035e04589b29/Fonts/MF/packages.lisp | lisp | mf-like stuff | (defpackage :mf
(:use #:cl)
(:export #:make-bezier-segment #:bezier-segment
#:make-open-path #:make-closed-path
#:closed-path #:concatenate-paths #:path-start
#:close-path
#:polygonalize
#:path-bounding-box
#:scan-lines
#:first-line #:nb-lines #:crossings
#:translate #:rotate #:scale... |
6b99d5302afe8ca19e2cfdd070d9ebfedaa6000e1ac53f8bd2e88fa1bf59e3f0 | cjdev/monad-io-adapter | Adapter.hs | # LANGUAGE CPP #
# LANGUAGE PatternSynonyms #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
|
This module provides utilities for converting between computations
parameterized via two different typeclasses , both of which can be used to
abstract over monad transformer stacks with ' IO ' at the... | null | https://raw.githubusercontent.com/cjdev/monad-io-adapter/c30e7b442864e2e0fb9acbf2643f09c6645dec61/src/Control/Monad/IO/Adapter.hs | haskell | | “Runs” a 'MonadIOAdapterT' computation and returns the remaining
transformer stack.
| “Runs” a 'MonadBaseIOAdapterT' computation and returns the remaining
transformer stack. | # LANGUAGE CPP #
# LANGUAGE PatternSynonyms #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
|
This module provides utilities for converting between computations
parameterized via two different typeclasses , both of which can be used to
abstract over monad transformer stacks with ' IO ' at the... |
eca20c2faaeabd022bb3ccf3d02ffc958a45400debaec24ec17b19f5d30709f2 | uber/queryparser | Test.hs | Copyright ( c ) 2017 Uber Technologies , Inc.
--
-- 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, mer... | null | https://raw.githubusercontent.com/uber/queryparser/4a0bc08260651741a24ecee10c641c2d00ea127e/test/Database/Sql/Util/Eval/Test.hs | haskell |
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 following conditions:
The above copyright notice ... | Copyright ( c ) 2017 Uber Technologies , Inc.
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 SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY K... |
6f65d0312ca33dbffa0878003bc6cfbf8cf7e741354ad3b0c3692ab81a051045 | lordi/haskell-terminal | Main.hs | module Main where
import Data.Monoid
import System.Random (getStdGen)
import Control.Applicative ((<$>))
import Test.Framework
import Test.Framework.Providers.HUnit
import Test.Framework.Providers.QuickCheck2
import Test.HUnit
import Test.QuickCheck hiding ((==>),)
import Terminal.Parser
import Terminal.Terminal
impo... | null | https://raw.githubusercontent.com/lordi/haskell-terminal/037a1374c3e28a9cc00f9da0ec8b2887944ab943/tests/parser/Main.hs | haskell | |This section contains unit tests to validate the parser, that is to ensure
that the incoming character stream is correctly translated into
of the assertion function parsesTo which is used in the assertions below.
type is defined which represents the incoming character stream.
Finally, execute the tests with the c... | module Main where
import Data.Monoid
import System.Random (getStdGen)
import Control.Applicative ((<$>))
import Test.Framework
import Test.Framework.Providers.HUnit
import Test.Framework.Providers.QuickCheck2
import Test.HUnit
import Test.QuickCheck hiding ((==>),)
import Terminal.Parser
import Terminal.Terminal
impo... |
548aafa9f4696e6cf5f8b2c567ab0662c497fb20df1c12e845354e423647a7b6 | backtracking/combine | zdd.mli | (**************************************************************************)
(* *)
(* Combine - an OCaml library for combinatorics *)
(* *)
Copyright... | null | https://raw.githubusercontent.com/backtracking/combine/d2d9276c99f6d09662900c348f062c618a1b4c95/src/lib/zdd.mli | ocaml | ************************************************************************
Combine - an OCaml library for combinatorics
... | Copyright ( C ) 2012 - 2014
modify it under the terms of the GNU Library General Public
License version 2.1 , with the special exception on linking
* { 1 Zero - suppres... |
190fa09746b2f9b75a8f4c4eea129836bf1c952171b28fc8a22848bf8cadfb6c | waldheinz/ads | Requests.hs |
module Requests (
-- * Requesting Data
UriFetch(..)
-- * Inserting Data
) where
import Control.Concurrent ( forkIO )
import Control.Concurrent.STM
import Control.Monad ( void, when )
import qualified Data.ByteString as BS
import qualified Data.HashMap.Strict as HMap
import... | null | https://raw.githubusercontent.com/waldheinz/ads/7695a157d76f35849351b2e039890eae1b419088/src/lib/Requests.hs | haskell | * Requesting Data
* Inserting Data
-----------------------------------------------------------------------------------------------
Organizing data requests
-----------------------------------------------------------------------------------------------
request is already running
make new Delayed
-------------------... |
module Requests (
UriFetch(..)
) where
import Control.Concurrent ( forkIO )
import Control.Concurrent.STM
import Control.Monad ( void, when )
import qualified Data.ByteString as BS
import qualified Data.HashMap.Strict as HMap
import qualified Data.Text as T
import qualified F... |
33f83afc083a545253dbbc32b8d9e7a44b728e9382d3b79ea269613b0208442f | kupl/VeriSmart-public | txOrigin.ml | open Query
open Vlang
open Lang
open Semantics
open Global
let collect_queries : Global.t -> vformula -> Path.t -> cfg -> Node.t -> query list
= fun global vf path g node ->
let func = FuncMap.find (Path.get_fkey path) global.fmap in
let params = List.map (fun (v,vinfo) -> (v,vinfo.vtyp)) (get_params func) in
le... | null | https://raw.githubusercontent.com/kupl/VeriSmart-public/99be7ba88b61994f1ed4c0d3a8e6a6db0f790431/src/checker/txOrigin.ml | ocaml | open Query
open Vlang
open Lang
open Semantics
open Global
let collect_queries : Global.t -> vformula -> Path.t -> cfg -> Node.t -> query list
= fun global vf path g node ->
let func = FuncMap.find (Path.get_fkey path) global.fmap in
let params = List.map (fun (v,vinfo) -> (v,vinfo.vtyp)) (get_params func) in
le... | |
557a087ed9de449a091e5b08e4b6fddd3061f9e51a8a5c4387b36ba310678c8b | racket/rhombus-prototype | reducer-macro.rkt | #lang racket/base
(require (for-syntax racket/base
syntax/parse/pre)
"provide.rkt"
"reducer.rkt"
"space.rkt"
"name-root.rkt")
(provide (for-spaces (rhombus/namespace
rhombus/space)
reducer))
(define-space-syntax reduce... | null | https://raw.githubusercontent.com/racket/rhombus-prototype/4e66c1361bdde51c2df9332644800baead49e86f/rhombus/private/reducer-macro.rkt | racket | #lang racket/base
(require (for-syntax racket/base
syntax/parse/pre)
"provide.rkt"
"reducer.rkt"
"space.rkt"
"name-root.rkt")
(provide (for-spaces (rhombus/namespace
rhombus/space)
reducer))
(define-space-syntax reduce... | |
5c2c08934683d0661874a3a1ca661f393b3271448bffea10d24cfcf364b41ce6 | ropas/sparrow | prodDom.ml | (***********************************************************************)
(* *)
Copyright ( c ) 2007 - present .
Programming Research Laboratory ( ROPAS ) , Seoul National University .
(* All rights reserved... | null | https://raw.githubusercontent.com/ropas/sparrow/3ec055b8c87b5c8340ef3ed6cde34f5835865b31/src/domain/prodDom.ml | ocaml | *********************************************************************
All rights reserved.
See the LICENSE file for details. ... | Copyright ( c ) 2007 - present .
Programming Research Laboratory ( ROPAS ) , Seoul National University .
This software is distributed under the term of the BSD license .
open AbsDom
open Vocab
module Make (A:CPO) (B:CPO) =
struct
type t = A.t * B.t [@@deriving comp... |
00c61a97f86e78b79da9292d5195890b2c2d0bdaf2b713721d1733c10926b1d7 | orbitz/scow | scow_log.ml | open Async.Std
module type S = sig
type elt
type t
val append :
t ->
(Scow_term.t * elt) list ->
(Scow_log_index.t, [> `Append_failed | `Invalid_log ]) Deferred.Result.t
val get_entry :
t ->
Scow_log_index.t ->
((Scow_term.t * elt), [> `Not_found of Scow_log_index.t | `Invalid_log ]) ... | null | https://raw.githubusercontent.com/orbitz/scow/feb633ef94824f44f0ffc679a548f97288c8ae48/lib/scow/scow_log.ml | ocaml | open Async.Std
module type S = sig
type elt
type t
val append :
t ->
(Scow_term.t * elt) list ->
(Scow_log_index.t, [> `Append_failed | `Invalid_log ]) Deferred.Result.t
val get_entry :
t ->
Scow_log_index.t ->
((Scow_term.t * elt), [> `Not_found of Scow_log_index.t | `Invalid_log ]) ... | |
3c350b779b6aa4673499d5d600ee5df566a9a56a33f13dfcbc81d2c6e224432b | uwplse/coq-plugin-lib | indutils.mli |
* Inductive types and their eliminators ( TODO organize , maybe move some stuff )
* Inductive types and their eliminators (TODO organize, maybe move some stuff)
*)
open Environ
open Constr
open Evd
open Names
open Declarations
(*
* Fail if the inductive type is mutually inductive or coinductive
* TO... | null | https://raw.githubusercontent.com/uwplse/coq-plugin-lib/cbfde621598d26f365d195aa47207d2407ccc263/src/coq/logicutils/inductive/indutils.mli | ocaml |
* Fail if the inductive type is mutually inductive or coinductive
* TODO move
* Get the number of constructors for an inductive type
* Determine if a term represents an inductive eliminator
* For now, this is a naive syntactic check
* Get an inductive type from an eliminator, if possible
* Lookup th... |
* Inductive types and their eliminators ( TODO organize , maybe move some stuff )
* Inductive types and their eliminators (TODO organize, maybe move some stuff)
*)
open Environ
open Constr
open Evd
open Names
open Declarations
val check_inductive_supported : mutual_inductive_body -> unit
val num_cons... |
6b6983138939ed4287ace6f8b1205ebc67e869b799c99a7d9509c4d29b8c5ae3 | Ucombinator/parsing-with-zippers | arithGrammar_WorklistWithLookahead.ml | open PwZ_WorklistWithLookahead
open ArithTags
This format is the construction of our grammar .
*
* We have a Racket program that can generate these types of files , but this
* example was written by hand . We would not recommend handwriting more complex
* grammars , so we assume a " full " implementation... | null | https://raw.githubusercontent.com/Ucombinator/parsing-with-zippers/168252c3598f7e704b8484bb469b37aa1a9b0313/arithGrammar_WorklistWithLookahead.ml | ocaml | open PwZ_WorklistWithLookahead
open ArithTags
This format is the construction of our grammar .
*
* We have a Racket program that can generate these types of files , but this
* example was written by hand . We would not recommend handwriting more complex
* grammars , so we assume a " full " implementation... | |
c0e86341c158763af1446b828a8e6322446068116194094427515209ba6e0a87 | theam/aws-lambda-haskell-runtime | Main.hs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
module Main where
import Aws.Lambda
import Lib
import qualified Lib
-- This tells the Lambda runtime how to initialize your application context.
-- If you do not wish to use a shared context, you can just use Unit as the context value.
-- E.g.
-- ini... | null | https://raw.githubusercontent.com/theam/aws-lambda-haskell-runtime/0031c3eea919d0b1505dde5aa24fd31436a49503/examples/wai-app/app/Main.hs | haskell | This tells the Lambda runtime how to initialize your application context.
If you do not wish to use a shared context, you can just use Unit as the context value.
E.g.
initializeContext :: IO ()
initializeContext = return () | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
module Main where
import Aws.Lambda
import Lib
import qualified Lib
initializeContext :: IO AppConfig
initializeContext = Lib.initializeAppConfig
generateLambdaDispatcher UseWithAPIGateway defaultDispatcherOptions
|
c3f58efcf12302dbfee410a9fd665cbae8297d212fa94072942f83035f1f0c04 | replikativ/datahike | cljs_utils.cljc | (ns datahike.test.cljs-utils
(:require
[clojure.string :as str]
[cljs.test :as t])
#?(:cljs
(:require-macros
[datahike.test.cljs])))
; The datahike.test.cljs namespace exists only for the side
; effect of extending the cljs.test/assert-expr multimethod.
This has to be done on the clj side of cl... | null | https://raw.githubusercontent.com/replikativ/datahike/408cb0f538a837267e44b098df895fa00348fe10/test/datahike/test/cljs_utils.cljc | clojure | The datahike.test.cljs namespace exists only for the side
effect of extending the cljs.test/assert-expr multimethod.
via a :require-macros clause in datahike.test.core. This
means we have a clj namespace that should only be loaded by
cljs compilation. | (ns datahike.test.cljs-utils
(:require
[clojure.string :as str]
[cljs.test :as t])
#?(:cljs
(:require-macros
[datahike.test.cljs])))
This has to be done on the clj side of cljs compilation , and
so we have a separate namespace that is only loaded by cljs
#?(:clj
(defmethod t/assert-expr '... |
7b54fdcaee09fa369c0f2274994f9a25dff3d3826bdd4e2d2b41e36fdc4a4dda | RyanGlScott/text-show | Stats.hs | {-# LANGUAGE CPP #-}
#if !(MIN_VERSION_base(4,11,0))
# LANGUAGE DeriveGeneric #
# LANGUAGE StandaloneDeriving #
# OPTIONS_GHC -fno - warn - deprecations #
# OPTIONS_GHC -fno - warn - orphans #
#endif
|
Module : Instances . : ( C ) 2014 - 2017
License : BSD - style ( s... | null | https://raw.githubusercontent.com/RyanGlScott/text-show/5ea297d0c7ae2d043f000c791cc12ac53f469944/tests/Instances/GHC/Stats.hs | haskell | # LANGUAGE CPP # |
#if !(MIN_VERSION_base(4,11,0))
# LANGUAGE DeriveGeneric #
# LANGUAGE StandaloneDeriving #
# OPTIONS_GHC -fno - warn - deprecations #
# OPTIONS_GHC -fno - warn - orphans #
#endif
|
Module : Instances . : ( C ) 2014 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :... |
a899cee13fa896a4cd9abd6514f01a6076f0e2b47796461bf10b6f417db07dcf | josefs/Gradualizer | scope.erl | -module(scope).
-compile([export_all, nowarn_export_all, nowarn_unused_vars]).
f(X) ->
case g(X) of
true -> A = 5,
B = 7;
false -> B = 6
end,
% Fails
% A.
B.
g(_X) ->
true.
% Fails
% h() ->
( X = 5 ) + X.
t() ->
_ = { X = 5, Y = 4 },
% Fails
, Y ... | null | https://raw.githubusercontent.com/josefs/Gradualizer/208f5816b0157f282212fc036ba7560f0822f9fc/test/should_pass/scope.erl | erlang | Fails
A.
Fails
h() ->
Fails | -module(scope).
-compile([export_all, nowarn_export_all, nowarn_unused_vars]).
f(X) ->
case g(X) of
true -> A = 5,
B = 7;
false -> B = 6
end,
B.
g(_X) ->
true.
( X = 5 ) + X.
t() ->
_ = { X = 5, Y = 4 },
, Y = 4 , X } ,
X.
|
107be400b24fc745e612b874b8b8a9cbee835da993c517ffb9b59936632e8f6f | avh4/elm-format | Messages.hs | module ElmFormat.Messages (PromptMessage(..), InfoMessage(..), ErrorMessage(..)) where
-- inspired by:
--
import Prelude ()
import Relude
import CommandLine.InfoFormatter (ToConsole(..), Loggable(..))
import CommandLine.ResolveFiles as ResolveFiles
import qualified Data.Text as Text
import qualified ElmFormat.Versi... | null | https://raw.githubusercontent.com/avh4/elm-format/af3acfc89b619b9dbcdbdb7185d3936971d76f87/src/ElmFormat/Messages.hs | haskell | inspired by:
| module ElmFormat.Messages (PromptMessage(..), InfoMessage(..), ErrorMessage(..)) where
import Prelude ()
import Relude
import CommandLine.InfoFormatter (ToConsole(..), Loggable(..))
import CommandLine.ResolveFiles as ResolveFiles
import qualified Data.Text as Text
import qualified ElmFormat.Version
import ElmVersion... |
58f4dedcd814cd0aee23ed2039559769e962e3fadee8141332cafcc915d51244 | Netflix/PigPen | viz.clj | ;;
;;
Copyright 2013 - 2015 Netflix , Inc.
;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -2.0
;;
;; Unless required by applicable law or agreed to ... | null | https://raw.githubusercontent.com/Netflix/PigPen/18d461d9b2ee6c1bb7eee7324889d32757fc7513/pigpen-viz/src/main/clojure/pigpen/viz.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the speci... | Copyright 2013 - 2015 Netflix , Inc.
distributed under the License is distributed on an " AS IS " BASIS ,
(ns pigpen.viz
"Functions to create graph-viz graphs from PigPen queries.
"
(:require [rhizome.viz :as viz]
[pigpen.oven :as oven]))
(set! *warn-on-reflection* true)
(defn ^:private comm... |
e81aa0ca8a24b16a9d11c8ecef8bf47839c097bbb0a9747e84348460febae65b | wgnet/wgconfig | wgconfig_tests.erl | -module(wgconfig_tests).
-include_lib("eunit/include/eunit.hrl").
setup() ->
application:ensure_all_started(wgconfig),
file:set_cwd(code:lib_dir(wgconfig)),
ok.
base_api_test() ->
setup(),
Res = wgconfig:load_configs(["./test/data/my_config.ini", "./test/data/my_config2.ini"]),
?assertEqual([... | null | https://raw.githubusercontent.com/wgnet/wgconfig/28faf11b9f36eddb57ed7d45727459686c9906af/test/wgconfig_tests.erl | erlang | -module(wgconfig_tests).
-include_lib("eunit/include/eunit.hrl").
setup() ->
application:ensure_all_started(wgconfig),
file:set_cwd(code:lib_dir(wgconfig)),
ok.
base_api_test() ->
setup(),
Res = wgconfig:load_configs(["./test/data/my_config.ini", "./test/data/my_config2.ini"]),
?assertEqual([... | |
3a53fdca8912f65794fd0e1fb82fb039b73dd5771beeefffbae670c7577bc48d | dizengrong/erlang_game | account_srv.erl | @author dzR < >
%% @doc 全局的账号服务进程,管理账号的注册和查询
-module (account_srv).
-include("db_table_account.hrl").
-include("db_table_role.hrl").
-include("db_table_magic.hrl").
-include("db_table_rune.hrl").
-include("log.hrl").
-export([start_link/0]).
-export([is_account_exist/1, get_role_id_by_account/1, register_account/3... | null | https://raw.githubusercontent.com/dizengrong/erlang_game/4598f97daa9ca5eecff292ac401dd8f903eea867/gerl/src/center_srv/account_srv.erl | erlang | @doc 全局的账号服务进程,管理账号的注册和查询
账号已存在
角色名已存在
服务器发生错误了
每个服务器最大的账号容量
账号名与账号id的索引表
角色名与账号id的索引表
@doc 账号是否已存在了(即该账号是否已注册了)
@doc 根据账号名获取role_id,不存在账号的话返回0
@doc 根据玩家名获取role_id,不存在的话返回0
@doc 根据账号名获取role_id,不存在账号的话返回0
TODO:数据库插入式同步的,可以做插入数据是否都ok的try/catch,并做回滚 | @author dzR < >
-module (account_srv).
-include("db_table_account.hrl").
-include("db_table_role.hrl").
-include("db_table_magic.hrl").
-include("db_table_rune.hrl").
-include("log.hrl").
-export([start_link/0]).
-export([is_account_exist/1, get_role_id_by_account/1, register_account/3]).
-export([get_role_id_by_n... |
5226f077559efe9f94d019eb90de728f9bea435aff94b55459a0030732f20492 | slyrus/mcclim-old | presentation-defs.lisp | ;;; -*- Mode: Lisp; Package: CLIM-INTERNALS -*-
( c ) copyright 2001,2002 by ( )
;;; This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Public
License as published by the Free Software Foundation ; either
version 2 of the License , or ( at you... | null | https://raw.githubusercontent.com/slyrus/mcclim-old/354cdf73c1a4c70e619ccd7d390cb2f416b21c1a/presentation-defs.lisp | lisp | -*- Mode: Lisp; Package: CLIM-INTERNALS -*-
This library is free software; you can redistribute it and/or
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
Licen... |
( c ) copyright 2001,2002 by ( )
modify it under the terms of the GNU Library General Public
version 2 of the License , or ( at your option ) any later version .
Library General Public License for more details .
You should have received a copy of the GNU Library General Public
Free Software Foundation ... |
67fae5b39c260377c058b271a121b76dcae37996efc65310f2dd66697dd4f56f | Carnap/Carnap | Main.hs | module Main where
import Carnap.GHCJS.Action.Translate
main :: IO ()
main = translateAction
| null | https://raw.githubusercontent.com/Carnap/Carnap/99546e377008247c5a1e8de1e294aac8e22584d7/Carnap-GHCJS/Translate/Main.hs | haskell | module Main where
import Carnap.GHCJS.Action.Translate
main :: IO ()
main = translateAction
| |
bfaddb9ea498b7cdff88b7955b6fc319a9ba50b622d420e6b424953e2aed4ec2 | IBM/probzelus | run.ml |
* Copyright 2018 - 2020 IBM Corporation
*
* Licensed under the Apache License , Version 2.0 ( the " License " ) ;
* you may not use this file except in compliance with the License .
* You may obtain a copy of the License at
*
* -2.0
*
* Unless required by applicable law or agreed to in writin... | null | https://raw.githubusercontent.com/IBM/probzelus/c56573201b43780b9c103e5616bb193ababa3399/benchmarks/gtree/ds_bounded/run.ml | ocaml |
* Copyright 2018 - 2020 IBM Corporation
*
* Licensed under the Apache License , Version 2.0 ( the " License " ) ;
* you may not use this file except in compliance with the License .
* You may obtain a copy of the License at
*
* -2.0
*
* Unless required by applicable law or agreed to in writin... | |
f94a7f1718ccd2723032293e81876568a897595ad01bb34397f36f91130203cd | jiangpengnju/htdp2e | ex78.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex78) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #... | null | https://raw.githubusercontent.com/jiangpengnju/htdp2e/d41555519fbb378330f75c88141f72b00a9ab1d3/fixed-size-data/adding-structure/ex78.rkt | racket | about the language level of this file in a form that our tools can easily process.
Provide a structure type definition and a data definition for representing
lower case "a" through "z"
#false
l1, l2, l3 (orderly) | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname ex78) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
lower - case three - letter words . A word consists of letters , ... |
4c2c7bc1bc4350283fc7f764960c80ab4682fbf9e5351242b6354db945aafac2 | ryanpbrewster/haskell | P147.hs | module Problems.P147
( solve
) where
- In a 3x2 cross - hatched grid , a total of 37 different rectangles could be
- situated within that grid as indicated in the sketch .
-
- There are 5 grids smaller than 3x2 , vertical and horizontal dimensions being
- important , i.e. 1x1 , 2x1 , 3x1 , 1x2 and 2... | null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/project-euler/src/Problems/P147.hs | haskell | Ostensibly it could be derived by using the bounds I included above
in the brute-force solution. I do not have the patience for that. | module Problems.P147
( solve
) where
- In a 3x2 cross - hatched grid , a total of 37 different rectangles could be
- situated within that grid as indicated in the sketch .
-
- There are 5 grids smaller than 3x2 , vertical and horizontal dimensions being
- important , i.e. 1x1 , 2x1 , 3x1 , 1x2 and 2... |
379f86b15cf3476c3ca5557f6c30e30449d165f84d4f0f66d8acb6601c315f4f | ucsd-progsys/dsolve | all.ml | DSOLVE -dontgenmlq
Adapted from an example of and * /~hwxi/DML/DML/examples/avl.dml
* /~hwxi/DML/DML/examples/avl.dml
*)
type 'a avl =
| E
lh bigger : height v < = height e1 < = 1 + height v
rh bigger : height e1 < = height v < = 1 + height e1
let rec len t =
match t with
| E -> 0
... | null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/postests/avltree/all.ml | ocaml | DSOLVE -dontgenmlq
Adapted from an example of and * /~hwxi/DML/DML/examples/avl.dml
* /~hwxi/DML/DML/examples/avl.dml
*)
type 'a avl =
| E
lh bigger : height v < = height e1 < = 1 + height v
rh bigger : height e1 < = height v < = 1 + height e1
let rec len t =
match t with
| E -> 0
... | |
e318eca4b4053859ed426de8a6f456ae6172f55af2c0be1973319201338b711d | Frama-C/Frama-C-snapshot | TacInstance.ml | (**************************************************************************)
(* *)
This file is part of WP plug - in of Frama - C.
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/wp/TacInstance.ml | ocaml | ************************************************************************
alternatives)
... | This file is part of WP plug - in of Frama - C.
Copyright ( C ) 2007 - 2019
CEA ( Commissariat a l'energie atomique et aux energies
Lesser General Public License as published by the Free Software
Foundation ,... |
120c6b9faca4a27c5fe22eddc9e31c484e681a9abf4955ceeddd1c1b9c212b02 | camlp5/camlp5 | location.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/camlp5/camlp5/d992b63c45bac62ebdb4a33a5ae66dd81d883a1b/ocaml_stuff/5.0.0/parsing/location.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
* Source code locations ( ranges of positions ) , used in parsetree .
{ b Warning :} this module is ... |
a09f5c733c37786c405cbe6fb5596c095e19a2b10a620c2bbb84e1abbd571cd7 | bcc32/projecteuler-ocaml | sol_108.ml | open! Core
open! Import
TODO : After solving 110 , see if the below can be made faster .
let num_solutions n =
if debug && n % 1000 = 0 then Debug.eprintf "%d" n;
let count = ref 2 in
for i = n + 2 to (2 * n) - 1 do
if n * i mod (i - n) = 0 then incr count
done;
!count
;;
let main () =
Number_theor... | null | https://raw.githubusercontent.com/bcc32/projecteuler-ocaml/712f85902c70adc1ec13dcbbee456c8bfa8450b2/sol/sol_108.ml | ocaml | open! Core
open! Import
TODO : After solving 110 , see if the below can be made faster .
let num_solutions n =
if debug && n % 1000 = 0 then Debug.eprintf "%d" n;
let count = ref 2 in
for i = n + 2 to (2 * n) - 1 do
if n * i mod (i - n) = 0 then incr count
done;
!count
;;
let main () =
Number_theor... | |
da1e67156db423ff920abb96c04b9423c330ddf82067ae7e01e4db34b968882f | epiccastle/spire | test_nio.clj | (ns test-pod.test-nio
(:require [test-pod.conf :refer [username]]
[test-pod.utils :refer
[bash run-int run-trim
stat-mode stat-last-modified-time stat-last-access-time]]
[clojure.test :refer [is deftest]]
[pod.epiccastle.spire.nio :as nio]))
(def user-i... | null | https://raw.githubusercontent.com/epiccastle/spire/f1161ae5ff74124d603c1679507fc0a1b31c26eb/test/test_pod/test_nio.clj | clojure | (ns test-pod.test-nio
(:require [test-pod.conf :refer [username]]
[test-pod.utils :refer
[bash run-int run-trim
stat-mode stat-last-modified-time stat-last-access-time]]
[clojure.test :refer [is deftest]]
[pod.epiccastle.spire.nio :as nio]))
(def user-i... | |
32893c87253b43fc2d14fd974605d08d11d714cb6332c15a8e281e9fa441363a | VictorNicollet/Ohm | form.ml | Ohm is © 2011
open Util
open BatPervasives
open Universal
type ('cfg,'ctx) field =
{
name : string ;
render : Id.t -> I18n.t -> 'cfg -> 'ctx View.t ;
label : 'cfg -> I18n.text ;
json : 'cfg -> bool
}
let field ?json ~name ~render ~label () = {
name = name ;
render = ... | null | https://raw.githubusercontent.com/VictorNicollet/Ohm/ca90c162f6c49927c893114491f29d44aaf71feb/src/form.ml | ocaml | Only static fields included in mapping, of course : templates ARE static. | Ohm is © 2011
open Util
open BatPervasives
open Universal
type ('cfg,'ctx) field =
{
name : string ;
render : Id.t -> I18n.t -> 'cfg -> 'ctx View.t ;
label : 'cfg -> I18n.text ;
json : 'cfg -> bool
}
let field ?json ~name ~render ~label () = {
name = name ;
render = ... |
aaf18262161eb0fa8ca7283ef497846c155f75e4ba88228c39434e8c925511f7 | dgiot/dgiot | emqx_mountpoint.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2018 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/dgiot/dgiot/c601555e45f38d02aafc308b18a9e28c543b6f2c/src/emqx_mountpoint.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 ) 2018 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_mountpoint).
-include("emqx.hrl").
-include("types.hrl").
-export([ mount/2
... |
b1700356a9f0a2b1ec7366d9ce602fcf7eaf9a1703972ea42168b09530325780 | drfloob/ezic | ezic_tests.erl | -module(ezic_tests).
-include("include/ezic.hrl").
-include_lib("eunit/include/eunit.hrl").
smoke_test_() ->
[
%% utc_to_local - normal tests
?_assertEqual({{2012,12,17},{13,20,0}}, ezic:utc_to_local({{2012,12,17},{4,20,0}}, "Asia/Tokyo"))
, ?_assertEqual({{2012,12,16},{23,20,0}}, ezic:utc_to_local(... | null | https://raw.githubusercontent.com/drfloob/ezic/d95e92d1dc5ac763558da52c271b8a1b76f48122/test/ezic_tests.erl | erlang | utc_to_local - normal tests
local_to_utc - normal tests
Tests overlap logic around timezones that have odd DST rules
gap
overlap
DST end
final DST gap
DST overlap
weird date
invalid zone
ambiguous zone
weird date
invalid zone | -module(ezic_tests).
-include("include/ezic.hrl").
-include_lib("eunit/include/eunit.hrl").
smoke_test_() ->
[
?_assertEqual({{2012,12,17},{13,20,0}}, ezic:utc_to_local({{2012,12,17},{4,20,0}}, "Asia/Tokyo"))
, ?_assertEqual({{2012,12,16},{23,20,0}}, ezic:utc_to_local({{2012,12,17},{4,20,0}}, "America/Ja... |
f316e781629a5bf77f2e2b949fcab5b6abfac7f639b3178af9a3fb5c1290db87 | cram2/cram | package.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;; * Introduction
;;;; FiveAM is a testing framework. It takes care of all the boring
;;;; bookkeeping associated with managing a test framework allowing
;;;; the developer to focus on writing tests and code.
;;;; FiveAM was designed with the following premises:
;;;;... | null | https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_3rdparty/fiveam/src/src/package.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
* Introduction
FiveAM is a testing framework. It takes care of all the boring
bookkeeping associated with managing a test framework allowing
the developer to focus on writing tests and code.
FiveAM was designed with the following premises:
- Defining tests should be abou... |
(defpackage :it.bese.fiveam
(:use :common-lisp :alexandria)
(:nicknames :5am :fiveam)
#+sb-package-locks
(:lock t)
(:export
#:make-suite
#:def-suite
#:in-suite
#:in-suite*
#:make-test
#:test
#:def-test
#:get-test
#:rem-test
#:test-names
#:make-fixture
#:def-fixture
... |
5b1b2a1dc0dcc30cceef9bf36054c7ac1556dd7db44a10add351469e3a943030 | codinuum/cca | f_flush_spec.ml |
Copyright 2013 - 2018 RIKEN
Copyright 2018 - 2020 Chiba Institude of Technology
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 b... | null | https://raw.githubusercontent.com/codinuum/cca/88ea07f3fe3671b78518769d804fdebabcd28e90/src/ast/analyzing/langs/fortran/parsing/src/labels/f_flush_spec.ml | ocaml | F2003 |
Copyright 2013 - 2018 RIKEN
Copyright 2018 - 2020 Chiba Institude of Technology
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 b... |
c3b8e5568f97d03d72c7c26e60195a9ac2c6d13fb0348ba96ef8116d4b3b979c | mfoemmel/erlang-otp | filelib.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1997 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/stdlib/src/filelib.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 1997 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(filelib).
-export([wildcard/1, w... |
02489d53d180b3ed08f37fe1dcba6c8c9c12b837db632d1e9ebaa29168a7c710 | tsloughter/kuberl | kuberl_v1_topology_spread_constraint.erl | -module(kuberl_v1_topology_spread_constraint).
-export([encode/1]).
-export_type([kuberl_v1_topology_spread_constraint/0]).
-type kuberl_v1_topology_spread_constraint() ::
#{ 'labelSelector' => kuberl_v1_label_selector:kuberl_v1_label_selector(),
'maxSkew' := integer(),
'topologyKey' := binary(),
... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1_topology_spread_constraint.erl | erlang | -module(kuberl_v1_topology_spread_constraint).
-export([encode/1]).
-export_type([kuberl_v1_topology_spread_constraint/0]).
-type kuberl_v1_topology_spread_constraint() ::
#{ 'labelSelector' => kuberl_v1_label_selector:kuberl_v1_label_selector(),
'maxSkew' := integer(),
'topologyKey' := binary(),
... | |
06eb21063f152ca834bdb36bdbd0ef27f6cae83a181b7a6202f5e09e961c8b72 | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | PaymentMethodDetailsSepaDebit.hs | {-# LANGUAGE MultiWayIf #-}
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
-- | Contains the types generated from the schema PaymentMethodDetailsSepaDebit
module StripeAPI.Types.PaymentMethodDetailsSe... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/PaymentMethodDetailsSepaDebit.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Contains the types generated from the schema PaymentMethodDetailsSepaDebit
| Defines the object schema located at @components.schemas.payment_method_details_sepa_debit@ in the specification.
| bank_code: Bank code of bank associated with the bank account.
Co... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
module StripeAPI.Types.PaymentMethodDetailsSepaDebit where
import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encoding.Internal
impo... |
389ed9f4ee3c0d25d5e435b822010556472d8fd6c70d16c342213373a7e2d584 | froydnj/binascii | ascii85.lisp | ascii85.lisp -- The ascii85 encoding , as used in PDF and btoa / atob .
(cl:in-package :binascii)
(defvar *ascii85-encode-table*
#.(coerce "!\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstu" 'simple-base-string))
(defstruct (ascii85-encode-state
(:include encode... | null | https://raw.githubusercontent.com/froydnj/binascii/0fb0a9e5773148fd04d50efef08c1cc10f6fc487/ascii85.lisp | lisp | <=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstu" 'simple-base-string))
FIXME: check for overflow.
FIXME: There's nothing smart we can do without scanning the string.
We have to assume the worst case, that all the characters in the | ascii85.lisp -- The ascii85 encoding , as used in PDF and btoa / atob .
(cl:in-package :binascii)
(defvar *ascii85-encode-table*
(defstruct (ascii85-encode-state
(:include encode-state)
(:copier nil)
(:predicate nil)
(:constructor make-ascii85-encode-state
... |
41154115ddbe2a464389606e68df7f2efe79296f46d5154271bc53ac90b75a2e | Javran/advent-of-code | ColorfulTerminal.hs | module Javran.AdventOfCode.ColorfulTerminal (
OutputMethod,
getOutputMethod,
TermOutputMode (..),
ColorfulTerminal (..),
getColorfulTerminal,
termText,
threadDelay,
module System.Console.Terminfo.Color,
TermOutput,
) where
import Control.Concurrent
import System.Console.Terminfo
import System.Console... | null | https://raw.githubusercontent.com/Javran/advent-of-code/676ef13c2f9d341cf7de0f383335a1cf577bd73d/src/Javran/AdventOfCode/ColorfulTerminal.hs | haskell | module Javran.AdventOfCode.ColorfulTerminal (
OutputMethod,
getOutputMethod,
TermOutputMode (..),
ColorfulTerminal (..),
getColorfulTerminal,
termText,
threadDelay,
module System.Console.Terminfo.Color,
TermOutput,
) where
import Control.Concurrent
import System.Console.Terminfo
import System.Console... | |
37c9a27e3435dcaa17cb8a3f391a99526d15f318323901470a1c09f1e1de4ffe | avsm/eeww | ocamltest_config.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/avsm/eeww/4d65720b5dd51376842ffe5c8c220d5329c1dc10/boot/ocaml/ocamltest/ocamltest_config.mli | ocaml | ************************************************************************
OCaml
... | , projet Gallium , INRIA Paris
Copyright 2017 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
Interface for ocamltest 's configuration module
val arch : string
val afl_instrument : bool
val asm : stri... |
6c52bee765e2230397233e293295d5f770cf765da0f52157cf98cc81fa716448 | tweag/ormolu | list-comprehensions-out.hs | foo x = [a | a <- x]
bar x y = [(a, b) | a <- x, even a, b <- y, a != b]
barbaz x y z w =
[ (a, b, c, d) -- Foo
| a <-
x, -- Bar
any even [a, b],
c <-
z
* z ^ 2, -- Bar baz
d <-
w
+ w, -- Baz bar
all
even
[ a,
b,
... | null | https://raw.githubusercontent.com/tweag/ormolu/7fc42d1929dbd69d04220201800f360f9e774100/data/examples/declaration/value/function/list-comprehensions-out.hs | haskell | Foo
Bar
Bar baz
Baz bar | foo x = [a | a <- x]
bar x y = [(a, b) | a <- x, even a, b <- y, a != b]
barbaz x y z w =
| a <-
any even [a, b],
c <-
z
d <-
w
all
even
[ a,
b,
c,
d
]
]
a = do
[ c
| c <- d
]
|
7ce27fc8adfa20d33acefa9ed23c7091e1a5f44b8683de28c4cce6c835ec4106 | msakai/toysolver | Tseitin.hs |
# OPTIONS_GHC -Wall #
{-# OPTIONS_HADDOCK show-extensions #-}
# LANGUAGE TypeFamilies #
-----------------------------------------------------------------------------
-- |
-- Module : ToySolver.Converter.Tseitin
Copyright : ( c ) 2018
-- License : BSD-style
--
-- Maintainer :
-- Stability : ex... | null | https://raw.githubusercontent.com/msakai/toysolver/6233d130d3dcea32fa34c26feebd151f546dea85/src/ToySolver/Converter/Tseitin.hs | haskell | # OPTIONS_HADDOCK show-extensions #
---------------------------------------------------------------------------
|
Module : ToySolver.Converter.Tseitin
License : BSD-style
Maintainer :
Stability : experimental
Portability : non-portable
----------------------------------------------------------... |
# OPTIONS_GHC -Wall #
# LANGUAGE TypeFamilies #
Copyright : ( c ) 2018
module ToySolver.Converter.Tseitin
( TseitinInfo (..)
) where
import Data.Array.IArray
import ToySolver.Converter.Base
import qualified ToySolver.SAT.Types as SAT
import qualified ToySolver.SAT.Encoder.Tseitin as Tseitin
data Tseitin... |
a4278b62f755f9273b6873d932367268c3501ec32dff87ca27a1031b78d04e9a | awakesecurity/grpc-mqtt | Extra.hs | -- |
-- Module : Proto3.Wire.Encode.Extra
Copyright : ( c ) Arista Networks , 2022 - 2023
License : Apache License 2.0 , see COPYING
--
-- Stability : stable
Portability : non - portable ( GHC extensions )
--
Extensions to the proto - wire format encoders missing from the - wire
-- packa... | null | https://raw.githubusercontent.com/awakesecurity/grpc-mqtt/fbde6f3fe90e82260469bab922c5ebb9f0b40e95/src/Proto3/Wire/Encode/Extra.hs | haskell | |
Module : Proto3.Wire.Encode.Extra
Stability : stable
package.
@since 1.0.0
* Primitive Message Builders
-------------------------------------------------------------------------------
Primitive Message Builders ---------------------------------------------------
@since 1.0.0 | Copyright : ( c ) Arista Networks , 2022 - 2023
License : Apache License 2.0 , see COPYING
Portability : non - portable ( GHC extensions )
Extensions to the proto - wire format encoders missing from the - wire
module Proto3.Wire.Encode.Extra
sint,
)
where
import Proto3.Wire (FieldNumber)
... |
65a1fcc10fbe1b2d7c47e1df453455a41df52571e0d50d4a923eba6cefa1e66a | PacktPublishing/Haskell-High-Performance-Programming | string-builder.hs |
type Builder = [Char] -> [Char]
toString :: Builder -> String
toString b = b []
string :: String -> Builder
string str = (str ++)
data Tree = Tree !(Int, Tree) !(Int, Tree)
| Leaf !String
encodeTree :: Tree -> Builder
encodeTree (Tree (l1, t1) (l2, t2)) =
string "[" . string (show l1) . string ":" . ... | null | https://raw.githubusercontent.com/PacktPublishing/Haskell-High-Performance-Programming/2b1bfdb8102129be41e8d79c7e9caf12100c5556/Chapter02/string-builder.hs | haskell |
type Builder = [Char] -> [Char]
toString :: Builder -> String
toString b = b []
string :: String -> Builder
string str = (str ++)
data Tree = Tree !(Int, Tree) !(Int, Tree)
| Leaf !String
encodeTree :: Tree -> Builder
encodeTree (Tree (l1, t1) (l2, t2)) =
string "[" . string (show l1) . string ":" . ... | |
c02ffa039f5914b45d67497309af2563dd0c07d16a3cc546c28fdf9a73e11a7f | haskell/win32 | Internal.hs | # LANGUAGE CPP #
|
Module : System . Win32.HardLink . Internal
Copyright : 2013 shelarcy
License : BSD - style
Maintainer :
Stability : Provisional
Portability : Non - portable ( Win32 API )
Handling hard link using Win32 API . [ NTFS only ]
N... | null | https://raw.githubusercontent.com/haskell/win32/931497f7052f63cb5cfd4494a94e572c5c570642/System/Win32/HardLink/Internal.hs | haskell | ^ Hard link name
^ Target file path
^ This parameter is reserved. You should pass just /nullPtr/. | # LANGUAGE CPP #
|
Module : System . Win32.HardLink . Internal
Copyright : 2013 shelarcy
License : BSD - style
Maintainer :
Stability : Provisional
Portability : Non - portable ( Win32 API )
Handling hard link using Win32 API . [ NTFS only ]
N... |
0a51350df9085414c852a0c55fbf327b2f6b7aed0f5f37a2f5ff209a3c8c64ae | typelead/eta | T2412.hs |
module T2412 ( Baz ) where
import T2412A ( Bar )
type Spqr = Bar
data Baz = Baz Spqr
| null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/typecheck/compile/T2412/T2412.hs | haskell |
module T2412 ( Baz ) where
import T2412A ( Bar )
type Spqr = Bar
data Baz = Baz Spqr
| |
ff98dfe251bb4719ce1229e7872d617c24a6f98da6377da00e623633897582ab | plumatic/grab-bag | dynamo.clj | (ns store.dynamo
(:use plumbing.core)
(:require
[plumbing.logging :as log]
[plumbing.serialize :as serialize]
[aws.dynamo :as dynamo]
[store.bucket :as bucket])
(:import
[com.amazonaws.services.dynamodbv2.model AttributeValue
Condition
ConditionalCheckFailedException
DeleteItemRequest
... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/store/src/store/dynamo.clj | clojure | Actual item ops
(println (bean td))
TODO: handle remove and partial attributes properly.
partial impl only meant to get us through resource/slave in :test | (ns store.dynamo
(:use plumbing.core)
(:require
[plumbing.logging :as log]
[plumbing.serialize :as serialize]
[aws.dynamo :as dynamo]
[store.bucket :as bucket])
(:import
[com.amazonaws.services.dynamodbv2.model AttributeValue
Condition
ConditionalCheckFailedException
DeleteItemRequest
... |
e8d69cd72eea337e610cf574017e36a1db376055df670210d5015f42816d50d5 | imalooney/t3tr0s | spectate.cljs | (ns client.pages.spectate
(:require-macros [hiccups.core :as hiccups])
(:require
[cljs.reader :refer [read-string]]
hiccups.runtime
[client.dom :as dom]
[client.game.paint :refer [draw-board! size-canvas!]]
[client.game.board :refer [empty-board rows-cutoff]]
[client.util :as util]
... | null | https://raw.githubusercontent.com/imalooney/t3tr0s/2f9529e7138a0bc3a8578aa89c9661fc89e81cc0/src/client/pages/spectate.cljs | clojure | ------------------------------------------------------------------------------
Dummy Data for Debugging / Testing
------------------------------------------------------------------------------
------------------------------------------------------------------------------
HTML
------------------------------------... | (ns client.pages.spectate
(:require-macros [hiccups.core :as hiccups])
(:require
[cljs.reader :refer [read-string]]
hiccups.runtime
[client.dom :as dom]
[client.game.paint :refer [draw-board! size-canvas!]]
[client.game.board :refer [empty-board rows-cutoff]]
[client.util :as util]
... |
e23072e66870f0f204b6884c0ab81940abcaa5d19d22b79bb5c3c0fbcd9dd706 | GentlemanHal/ring-curl | clj_http.clj | (ns ring-curl.clj-http
(:require [clj-http.client :refer :all])
(:refer-clojure :exclude [get update]))
(def middleware
[wrap-basic-auth
wrap-oauth
wrap-user-info
wrap-url
wrap-accept
wrap-accept-encoding
wrap-content-type
wrap-form-params
wrap-nested-params
wrap-method
wrap-query-p... | null | https://raw.githubusercontent.com/GentlemanHal/ring-curl/ea1f6d5b5626e58d3d586392eeccbf69ad2892a8/src/ring_curl/clj_http.clj | clojure | (ns ring-curl.clj-http
(:require [clj-http.client :refer :all])
(:refer-clojure :exclude [get update]))
(def middleware
[wrap-basic-auth
wrap-oauth
wrap-user-info
wrap-url
wrap-accept
wrap-accept-encoding
wrap-content-type
wrap-form-params
wrap-nested-params
wrap-method
wrap-query-p... | |
926e7d23aa192e849007b518e5fc81c64fb17de251f707a4f27156097823b337 | nilenso/time-tracker | core.clj | (ns time-tracker.users.core
(:require [time-tracker.users.db :as users-db]
[time-tracker.invited-users.db :as invited-users-db]
[time-tracker.web.util :as web-util]))
(defn wrap-autoregister
[handler]
(fn [{:keys [credentials] :as request} connection]
(let [google-id (:sub credentia... | null | https://raw.githubusercontent.com/nilenso/time-tracker/054d0dc6d6b89a4ed234d8f0b0a260b6deeef9e3/src/clj/time_tracker/users/core.clj | clojure | (ns time-tracker.users.core
(:require [time-tracker.users.db :as users-db]
[time-tracker.invited-users.db :as invited-users-db]
[time-tracker.web.util :as web-util]))
(defn wrap-autoregister
[handler]
(fn [{:keys [credentials] :as request} connection]
(let [google-id (:sub credentia... | |
d3456daddc3c50f44ee2ac12a0b099510c2ee09f668d47ff3d4dae15cd857474 | pedestal/samples | service_test.clj | Copyright 2013 Relevance , Inc.
; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( )
; which can be found in the file epl-v10.html at the root of this distribution.
;
; By using this software in any fashion, you are agreeing to be bound by
; the terms of this licens... | null | https://raw.githubusercontent.com/pedestal/samples/caaf04afe255586f8f4e1235deeb0c1904179355/cors/test/cors/service_test.clj | clojure | The use and distribution terms for this software are covered by the
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice, or any other, from this software. | Copyright 2013 Relevance , Inc.
Eclipse Public License 1.0 ( )
(ns cors.service-test
(:require [clojure.test :refer :all]
[io.pedestal.service.test :refer :all]
[io.pedestal.service.http :as bootstrap]
[cors.service :as service]))
(def service
(::bootstrap/service-fn (boo... |
f04bef01fb6d251159415d65558efbf30ef20d3b63b683740b1a57a9fee068fa | threatgrid/ctia | asset_test.clj | (ns ctia.http.routes.graphql.asset-test
(:require
[clj-momo.test-helpers.core :as mth]
[clojure.test :refer [deftest is join-fixtures testing use-fixtures]]
[ctia.entity.asset :as asset]
[ctia.test-helpers.auth :refer [all-capabilities]]
[ctia.test-helpers.core :as helpers]
[ctia.test-helpers.fake-w... | null | https://raw.githubusercontent.com/threatgrid/ctia/32857663cdd7ac385161103dbafa8dc4f98febf0/test/ctia/http/routes/graphql/asset_test.clj | clojure | (ns ctia.http.routes.graphql.asset-test
(:require
[clj-momo.test-helpers.core :as mth]
[clojure.test :refer [deftest is join-fixtures testing use-fixtures]]
[ctia.entity.asset :as asset]
[ctia.test-helpers.auth :refer [all-capabilities]]
[ctia.test-helpers.core :as helpers]
[ctia.test-helpers.fake-w... | |
bb3b189e80db4da4ec2edb8dd7249e72c953ec4d5db4b403982d4db20019821f | sneeuwballen/zipperposition | simplM.ml |
This file is free software , part of Zipperposition . See file " license " for more details .
* { 1 Simplification Monad }
type +'a t = 'a * [ `Same | `New]
let return_same x = x, `Same
let return_new x = x, `New
let return = return_same
let get = fst
let is_new (_,st) = match st with `New -> true | `Same -> fal... | null | https://raw.githubusercontent.com/sneeuwballen/zipperposition/7f1455fbe2e7509907f927649c288141b1a3a247/src/prover/simplM.ml | ocaml | chaining simplifications |
This file is free software , part of Zipperposition . See file " license " for more details .
* { 1 Simplification Monad }
type +'a t = 'a * [ `Same | `New]
let return_same x = x, `Same
let return_new x = x, `New
let return = return_same
let get = fst
let is_new (_,st) = match st with `New -> true | `Same -> fal... |
d328ca031f58467c1d96013fe46ca5731a12fd03ac7b2eb4b71085f0dfcd62fa | comptekki/esysman | main_handler.erl | Copyright ( c ) 2012 , < >
%% All rights reserve.
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions are met:
%%
%% * Redistributions of source code must retain the above copyright
%% notice, this list of condit... | null | https://raw.githubusercontent.com/comptekki/esysman/ac182b47e952e47684a9ab4b82c0061404e8d83a/src/main_handler.erl | erlang | All rights reserve.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redi... | Copyright ( c ) 2012 , < >
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR
LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY... |
53b1aa8ca5663b2a94e5386b8d45ccf95a8a34a86819c9e80dc48f5363df0bb2 | pirapira/coq2rust | genarg.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/pirapira/coq2rust/22e8aaefc723bfb324ca2001b2b8e51fcc923543/lib/genarg.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
Basic types
Specific types
Dyna... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2012
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Pp
open Util
type argum... |
860243f43a669e7221f351ddc1aed11a41662a6951c1c144cf7bcbf8af79bbcf | UChicago-PL/smyth | io2.ml | let read_all : in_channel -> string =
fun channel ->
let contents =
really_input_string channel (in_channel_length channel)
in
close_in channel;
contents
let read_file : string -> string =
fun path ->
read_all (open_in path)
let path : string list -> string =
fun parts ->
let stand... | null | https://raw.githubusercontent.com/UChicago-PL/smyth/08fea281f70d3ee604fde9dde140c8a570d6905d/lib/stdlib2/io2.ml | ocaml | let read_all : in_channel -> string =
fun channel ->
let contents =
really_input_string channel (in_channel_length channel)
in
close_in channel;
contents
let read_file : string -> string =
fun path ->
read_all (open_in path)
let path : string list -> string =
fun parts ->
let stand... | |
fcc90d10214d01436c88f93b946708f61985e7977bd000fe6bd2190b2a4ff63f | eglaysher/rldev | text.ml |
RLdev : unicode handling
Copyright ( C ) 2006 Haeleth
This program is free software ; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation ; either version 2 of the License , or ( at your option ) any later
... | null | https://raw.githubusercontent.com/eglaysher/rldev/e59103b165e1c20bd940942405b2eee767933c96/src/common/text.ml | ocaml | Ignore BOM |
RLdev : unicode handling
Copyright ( C ) 2006 Haeleth
This program is free software ; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation ; either version 2 of the License , or ( at your option ) any later
... |
cea85d67672937d1f30962c10e9923adff6eeadd955b34124447c68923ab1a48 | input-output-hk/cardano-sl | Chrono.hs | {-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE TypeFamilies #-}
-- | Chronological sequences.
module Pos.Core.Chrono
( Chrono
, NewestFirst(..)
, _NewestFirst
, OldestFirst(..)
, _OldestFirst
, toNewestFirst
, toOldestFirst
, NE
, nonEmptyOldestFirs... | null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/src/Pos/Core/Chrono.hs | haskell | # LANGUAGE DeriveTraversable #
# LANGUAGE TypeFamilies #
| Chronological sequences. |
module Pos.Core.Chrono
( Chrono
, NewestFirst(..)
, _NewestFirst
, OldestFirst(..)
, _OldestFirst
, toNewestFirst
, toOldestFirst
, NE
, nonEmptyOldestFirst
, nonEmptyNewestFirst
, splitAtNewestFirst
, splitAtOldestFirst
) wher... |
4e3698f055cc2055076d623b4a0bfa71f0b4c140fd150d99e5f7fb78579acf1b | dmitryvk/sbcl-win32-threads | assem-rtns.lisp | This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and is
;;;; provided with absolutely no wa... | null | https://raw.githubusercontent.com/dmitryvk/sbcl-win32-threads/5abfd64b00a0937ba2df2919f177697d1d91bde4/src/assembly/alpha/assem-rtns.lisp | lisp | more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
We don't want a vop for this one.
These are just needed to facilitate the transfer
These are needed so we can get at the register args.
has ... | This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB!VM")
Return - multiple with other than one value
(define-assembly-routine
(return-multiple
(:ret... |
0b56b7ed84b56a01577b458444a4f59806a2b086581d187b0983b6a33349f6df | theodormoroianu/SecondYearCourses | LambdaChurch_20210415170415.hs | module LambdaChurch where
import Data.Char (isLetter)
import Data.List ( nub )
class ShowNice a where
showNice :: a -> String
class ReadNice a where
readNice :: String -> (a, String)
data Variable
= Variable
{ name :: String
, count :: Int
}
deriving (Show, Eq, Ord)
var :: String -> Variable
var ... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%209/.history/LambdaChurch_20210415170415.hs | haskell | alpha-equivalence
subst u x t defines [u/x]t, i.e., substituting u for x in t
This substitution avoids variable captures so it is safe to be used when
reducing terms with free variables (e.g., if evaluating inside lambda abstractions)
^ substitution term
^ variable to be substitutes
^ term in which the substit... | module LambdaChurch where
import Data.Char (isLetter)
import Data.List ( nub )
class ShowNice a where
showNice :: a -> String
class ReadNice a where
readNice :: String -> (a, String)
data Variable
= Variable
{ name :: String
, count :: Int
}
deriving (Show, Eq, Ord)
var :: String -> Variable
var ... |
a01ed0aac0b2308bc5b46e6feb1a0edcb1872c7540817e085b965f321bfe729c | mk270/archipelago | daemon.mli |
Archipelago , a multi - user dungeon ( MUD ) server , by ( C ) 2009 - 2012
This programme is free software ; you may redistribute and/or modify
it under the terms of the GNU Affero General Public Licence as published by
the Free Software Foundation , either version 3 of said Licence , or
( ... | null | https://raw.githubusercontent.com/mk270/archipelago/4241bdc994da6d846637bcc079051405ee905c9b/src/game/daemon.mli | ocaml |
Archipelago , a multi - user dungeon ( MUD ) server , by ( C ) 2009 - 2012
This programme is free software ; you may redistribute and/or modify
it under the terms of the GNU Affero General Public Licence as published by
the Free Software Foundation , either version 3 of said Licence , or
( ... | |
0fda4ce0c46d4e41233e18710966d7f240804d59bef2e280aa03baec9bee77f0 | termite-analyser/termite | monodimensional.mli | (**
Monodimensional algorithm
*)
open Smt.ZZ
*
[ monodimensional vars inv rel rho verbose ] returns the next linear
component [ l ] of a weak ranking function , such that [ pi(l ) ] is
maximal .
- [ vars ] is associating each variable of the automaton to a unique
positive integer ( see { ... | null | https://raw.githubusercontent.com/termite-analyser/termite/285d92215a28fcce55614f6d04b44886f253a894/src/monodimensional.mli | ocaml | *
Monodimensional algorithm
|
open Smt.ZZ
*
[ monodimensional vars inv rel rho verbose ] returns the next linear
component [ l ] of a weak ranking function , such that [ pi(l ) ] is
maximal .
- [ vars ] is associating each variable of the automaton to a unique
positive integer ( see { ! } )
- [ inv ] contains the i... |
1fbb5bbe5e27e143a7ae4a45de41a4af541e876f4f4de49d5a74db7f78a25167 | jscl-project/jscl | tests.lisp | (defparameter *total-tests* 0)
(defparameter *passed-tests* 0)
(defparameter *failed-tests* 0)
(defvar *use-html-output-p* nil)
(defvar *timestamp* nil)
(defun test-fn (fn form expect-success)
(let (result success normal-exit)
Execute the test and put T / NIL if SUCCESS if the test
;; completed successfully.
... | null | https://raw.githubusercontent.com/jscl-project/jscl/dd613aa7a2f09591bccbfc3f4c727c98a867cae2/tests.lisp | lisp | completed successfully.
do nothing | (defparameter *total-tests* 0)
(defparameter *passed-tests* 0)
(defparameter *failed-tests* 0)
(defvar *use-html-output-p* nil)
(defvar *timestamp* nil)
(defun test-fn (fn form expect-success)
(let (result success normal-exit)
Execute the test and put T / NIL if SUCCESS if the test
(handler-case
(catc... |
b1a135a5821bdeff776616cbc35277b9c7796f24ece6469a60c853b9de6d19b4 | lasp-lang/partisan | erpc.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2020 - 2021 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/lasp-lang/partisan/5992c43d466fa6df059be4de10c269efccbc4861/otp_src/otp_24.3.4.8/erpc.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2020 - 2021 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
Author :
-module(erpc).
-export([call/2,
call/3,
call/4,
call/5,
cast/2,
... |
f7c7c94f749032674e3b581350c5a7f9dc59cf5ad3d647d3306a5c5fb4342631 | braveclojure/training | odds.clj | (ns valeria.odds)
(defn sums
[d1 d2]
(loop [d1' d1
pairs []]
(if (= d1' 0)
pairs
(recur (dec d1')
(loop [d2' d2
pairs' pairs]
(if (= d2' 0)
pairs'
(recur (dec d2')
(conj pairs' (+ d1' ... | null | https://raw.githubusercontent.com/braveclojure/training/5b7fb9059c17b2166c2e66850094f424319e55eb/projects/valeria/src/valeria/odds.clj | clojure | (ns valeria.odds)
(defn sums
[d1 d2]
(loop [d1' d1
pairs []]
(if (= d1' 0)
pairs
(recur (dec d1')
(loop [d2' d2
pairs' pairs]
(if (= d2' 0)
pairs'
(recur (dec d2')
(conj pairs' (+ d1' ... | |
49bfa8cd28a561d387d31b8cfc81ad774bd2652e4480d39ede435b178f61ee20 | dalaing/little-languages | Type.hs | # LANGUAGE TemplateHaskell #
module Type where
import Control.Lens.TH
data Type =
TyBool
| TyNat
deriving (Eq, Ord, Show)
makeClassyPrisms ''Type
| null | https://raw.githubusercontent.com/dalaing/little-languages/9f089f646a5344b8f7178700455a36a755d29b1f/code/old/multityped/nb/src/Type.hs | haskell | # LANGUAGE TemplateHaskell #
module Type where
import Control.Lens.TH
data Type =
TyBool
| TyNat
deriving (Eq, Ord, Show)
makeClassyPrisms ''Type
| |
3a61bfe637d6dae9159c42902ed5aea6b70285f095267500af82d6b3c77b96e0 | soulomoon/SICP | Exercise3.15.scm | Exercise 3.15 : Draw box - and - pointer diagrams to explain the effect of set - to - wow ! on the structures z1 and z2 above .
Z1-->[*][*]
| |
V V
x-->[*][*]->[*][/]
| |
V V
'wow b
Z2-->[*][*]-->[*][*]-->[*][/]
| v ... | null | https://raw.githubusercontent.com/soulomoon/SICP/1c6cbf5ecf6397eaeb990738a938d48c193af1bb/Chapter3/Exercise3.15.scm | scheme | Exercise 3.15 : Draw box - and - pointer diagrams to explain the effect of set - to - wow ! on the structures z1 and z2 above .
Z1-->[*][*]
| |
V V
x-->[*][*]->[*][/]
| |
V V
'wow b
Z2-->[*][*]-->[*][*]-->[*][/]
| v ... | |
d170b0cb36c98874e53c2c3d58975b919a40445eb6025a1c0aba0c2b26780ae0 | wavewave/hoodle | VerticalSpace.hs | # LANGUAGE CPP #
module Hoodle.Coroutine.VerticalSpace where
import Control.Category ((.))
import Control.Lens (at, set, view, (.~))
import Control.Monad ((>=>))
import Control.Monad.State (gets)
import Control.Monad.Trans (liftIO)
import Data.Bifunctor (second)
import Data.Foldable (concat, concatMap, mapM_)
import ... | null | https://raw.githubusercontent.com/wavewave/hoodle/fa7481d14a53733b2f6ae9debc95357d904a943c/core/src/Hoodle/Coroutine/VerticalSpace.hs | haskell |
|
|
|
|
|
| (background, item, total)
-----------------------------------------------------------
add space within this page
----------------------------------------------------------- | # LANGUAGE CPP #
module Hoodle.Coroutine.VerticalSpace where
import Control.Category ((.))
import Control.Lens (at, set, view, (.~))
import Control.Monad ((>=>))
import Control.Monad.State (gets)
import Control.Monad.Trans (liftIO)
import Data.Bifunctor (second)
import Data.Foldable (concat, concatMap, mapM_)
import ... |
61087d678ce650268910c0826e249fd93c320b257e40e2eee1f1e6aa66e8b0bd | racket/compiler | embed-me22.rkt | #lang racket/kernel
(printf "This is 22.\n")
(module configure-runtime racket/kernel
(printf "Configure!\n"))
| null | https://raw.githubusercontent.com/racket/compiler/88acf8a1ec81fec0fbcb6035af1d994d2fec4154/compiler-test/tests/compiler/embed/embed-me22.rkt | racket | #lang racket/kernel
(printf "This is 22.\n")
(module configure-runtime racket/kernel
(printf "Configure!\n"))
| |
7924098a6a5ec4c3e3f1927b5973e341671e9246dcbb5c9753e0f01b85e88b91 | serokell/time-warp | Transfer.hs | {-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE Rank2Types #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
# LANGUAGE TupleSections #
# LANGUAGE TypeFamilies #
# LANGUAGE Undecidabl... | null | https://raw.githubusercontent.com/serokell/time-warp/2783f81957a2e5b02e9d3425d760247a6c5a766b/src/Control/TimeWarp/Rpc/Transfer.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE Rank2Types #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
|
Module : Control.TimeWarp.Rpc.Transfer
License : GPL-3 (see the file LICENSE)
Stability : experimental
It operates with so called /lively sockets/, so that, if ... | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TupleSections #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# LANGUAGE ViewPatterns #
Copyright : ( c ) , 2016
Maintainer : >
Portability : POSIX , GHC
This module provides ... |
e284921b7fc8200a78b16d552c704420b4731dfccee3ecec0406027e757f81a0 | ThatGeoGuy/chicken-miniKanren | numbero-tests.scm | (test-group "numbero tests"
(test "numbero-1"
(run* (q) (numbero q))
'((_.0 (num _.0))))
(test "numbero-2"
(run* (q) (numbero q) (== 5 q))
'(5))
(test "numbero-3"
(run* (q) (== 5 q) (numbero q))
'(5))
(test "numbero-4"
(run* (q) (== 'x q) (numbero q))
... | null | https://raw.githubusercontent.com/ThatGeoGuy/chicken-miniKanren/4371396a8cb5798cd4d8a6ea42ba2587b2a77ed9/tests/numbero-tests.scm | scheme | (test-group "numbero tests"
(test "numbero-1"
(run* (q) (numbero q))
'((_.0 (num _.0))))
(test "numbero-2"
(run* (q) (numbero q) (== 5 q))
'(5))
(test "numbero-3"
(run* (q) (== 5 q) (numbero q))
'(5))
(test "numbero-4"
(run* (q) (== 'x q) (numbero q))
... | |
7210db9531661b6c54605dbd34935add6d7fd1229a09beaa73c89a7f53d86eab | imandra-ai/catapult | catapult_client.ml | module P = Catapult
module Tracing = P.Tracing
module Endpoint_address = P.Endpoint_address
let trace_id = ref (try Sys.getenv "TRACE_ID" with _ -> "")
let set_trace_id s = trace_id := s
try to make a non - stupid default i d , based on PID + date .
This is not perfect , use a UUID4 if possible .
This is no... | null | https://raw.githubusercontent.com/imandra-ai/catapult/4bc5444a8471c5d0d7cb9a376a5a895c0ab042e6/src/client/catapult_client.ml | ocaml | module P = Catapult
module Tracing = P.Tracing
module Endpoint_address = P.Endpoint_address
let trace_id = ref (try Sys.getenv "TRACE_ID" with _ -> "")
let set_trace_id s = trace_id := s
try to make a non - stupid default i d , based on PID + date .
This is not perfect , use a UUID4 if possible .
This is no... | |
455d98b6842f8d258e6e035e606255d0e3be901ad30fbf0c9915f1ebecc734b0 | gowthamk/ocaml-irmin | test2.ml | open Lwt.Infix
open Irmin_unix
open Printf
type t = Empty | Node of int32
let t =
let open Irmin.Type in
variant "t" (fun b e -> function
| Node a -> b a
| Empty -> e)
|~ case1 "Node" int32 (fun x -> Node x)
|~ case0 "Empty" Empty
|> sealv
let pp_json = Irmin.Type.pp_json ~minify:false t
le... | null | https://raw.githubusercontent.com/gowthamk/ocaml-irmin/54775f6c3012e87d2d0308f37a2ec7b27477e887/tests/serialization/test2.ml | ocaml | open Lwt.Infix
open Irmin_unix
open Printf
type t = Empty | Node of int32
let t =
let open Irmin.Type in
variant "t" (fun b e -> function
| Node a -> b a
| Empty -> e)
|~ case1 "Node" int32 (fun x -> Node x)
|~ case0 "Empty" Empty
|> sealv
let pp_json = Irmin.Type.pp_json ~minify:false t
le... | |
c03977a19b412ef69a826a5137d62dde1c1aa95fa6647a5fa9639af72b6db8ac | ijvcms/chuanqi_dev | email_misc.erl | -module(email_misc).
-export([index/2, split_binary_by_digit/2, basename/1]).
%% 取出二进制或列表里对应下标(从0开始)的值
index(Data, Index) when is_binary(Data) ->
index(binary_to_list(Data), Index);
index(Data, Index)
when is_list(Data), is_integer(Index),
Index >= 0, Index < length(Data) ->
index(Data, Index, 0).
ind... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/system/email/email_misc.erl | erlang | 取出二进制或列表里对应下标(从0开始)的值
将二进制Bin按数字Digit分隔成左右两个二进制数
取出文件路径中的文件名 | -module(email_misc).
-export([index/2, split_binary_by_digit/2, basename/1]).
index(Data, Index) when is_binary(Data) ->
index(binary_to_list(Data), Index);
index(Data, Index)
when is_list(Data), is_integer(Index),
Index >= 0, Index < length(Data) ->
index(Data, Index, 0).
index([D0 | _DRest], GivenIn... |
75e626e10ed5b5a74280fddeb92f8b9048ab2229407570f741141eea50812f8c | rescript-lang/rescript-compiler | gpr_3595_test.ml | let suites : Mt.pair_suites ref = ref []
let test_id = ref 0
let eq loc x y = Mt.eq_suites ~test_id ~suites loc x y
[@@@warning "-a"]
(* let [|a|] = [|1|] *)
let x = 1
let ( ) =
eq _ _ LOC _ _ a 1
let ( ) = Mt.from_pair_suites _ _ FILE _ _ ! suites
eq __LOC__ a 1
let () = Mt.from_pair_suites... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/7dc4441661f56210e2a6f9f44d623aa5c7eb9b6a/jscomp/test/gpr_3595_test.ml | ocaml | let [|a|] = [|1|] | let suites : Mt.pair_suites ref = ref []
let test_id = ref 0
let eq loc x y = Mt.eq_suites ~test_id ~suites loc x y
[@@@warning "-a"]
let x = 1
let ( ) =
eq _ _ LOC _ _ a 1
let ( ) = Mt.from_pair_suites _ _ FILE _ _ ! suites
eq __LOC__ a 1
let () = Mt.from_pair_suites __FILE__ !suites *) |
c3c3975d43059e3af726cb71ba2fabdb4d534d4eb5591201a36d9c217bddebf8 | t-sin/niko | util.lisp | (defpackage #:niko/util
(:use #:cl)
(:import-from #:split-sequence
#:split-sequence)
(:import-from #:ningle
#:<app>)
(:export #:*project-name*
#:project-root
#:version
#:assoc*
#:append-header
#:defroute
#:defapi
... | null | https://raw.githubusercontent.com/t-sin/niko/53cbb4c31ad80379144b839b252d6067f134698a/util.lisp | lisp | (defpackage #:niko/util
(:use #:cl)
(:import-from #:split-sequence
#:split-sequence)
(:import-from #:ningle
#:<app>)
(:export #:*project-name*
#:project-root
#:version
#:assoc*
#:append-header
#:defroute
#:defapi
... | |
bebb86ed704d008fa7df8cfe724d1d4032dd27fab0c9fdcba5e6944110b311cb | GaloisInc/argo | Netstring.hs | {-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
-- | A netstring is an ASCII-encoded sequence of digits representing a
number N , followed by an ASCII colon , followed by N bytes , followed
-- by an ASCII comma. This allows receivers to know how much is needed.
--
-- Definition:
--
Netstrings allo... | null | https://raw.githubusercontent.com/GaloisInc/argo/b9b3edd992e57ca31224530f763f313fcf24bab7/argo/src/Argo/Netstring.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| A netstring is an ASCII-encoded sequence of digits representing a
by an ASCII comma. This allows receivers to know how much is needed.
Definition:
| A ByteString together with a header that provides its length.
| Construct a new netstring from a bytestrin... |
number N , followed by an ASCII colon , followed by N bytes , followed
Netstrings allow malformed JSON to be more robustly detected when
using JSON - RPC .
module Argo.Netstring
( Netstring
, encodeNetstring
, decodeNetstring
, netstring
, parseNetstring
, netstringFromHandle
)
where
import Contr... |
ffba5f38d9ae0df34d7a183fea71fc8edd490d6d4ef3c1b8bfde06a379290803 | haskell-gi/haskell-gi | CabalHooks.hs | -- | Convenience hooks for writing custom @Setup.hs@ files for
-- bindings.
module Data.GI.CodeGen.CabalHooks
( setupBinding
, configureDryRun
, TaggedOverride(..)
) where
import qualified Distribution.ModuleName as MN
import Distribution.Simple.LocalBuildInfo
import Distribution.Simple.Setup
import Di... | null | https://raw.githubusercontent.com/haskell-gi/haskell-gi/bff8f3b92bf2594ea3d6745c346a8de594fc3709/lib/Data/GI/CodeGen/CabalHooks.hs | haskell | | Convenience hooks for writing custom @Setup.hs@ files for
bindings.
| Included overrides file.
^ Tag for the override, for error reporting purposes.
| Generate the code for the given module.
^ name
^ version
^ pkgName
^ pkgVersion
^ verbose
^ Explicit overrides
| Write a module containing information abou... | module Data.GI.CodeGen.CabalHooks
( setupBinding
, configureDryRun
, TaggedOverride(..)
) where
import qualified Distribution.ModuleName as MN
import Distribution.Simple.LocalBuildInfo
import Distribution.Simple.Setup
import Distribution.Simple (UserHooks(..), simpleUserHooks,
... |
a0ff920492c71c86fabc7fb3196a7f8124255bbdab19690f8d49eccdb2d3e6dc | noinia/hgeometry | MainSelfContained.hs | # LANGUAGE OverloadedLabels #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
module Main where
import Control.Exception (catch)
import Control.Monad (forM_)
import Control.Monad.IO.Class (MonadIO)
import Control.Monad.Trans.Reader (runReaderT)
import ... | null | https://raw.githubusercontent.com/noinia/hgeometry/89cd3d3109ec68f877bf8e34dc34b6df337a4ec1/hgeometry-web/old/MainSelfContained.hs | haskell | # LANGUAGE OverloadedStrings #
------------------------------------------------------------------------------
| Get an 'Reactive.Banana.Event' from
^ function to transform the Event with
we return True because the event has been
handled, don't want to propagate it
further
gets the initial canvas
redraw
register... | # LANGUAGE OverloadedLabels #
# LANGUAGE ScopedTypeVariables #
module Main where
import Control.Exception (catch)
import Control.Monad (forM_)
import Control.Monad.IO.Class (MonadIO)
import Control.Monad.Trans.Reader (runReaderT)
import Data.GI.Base
import Da... |
cd3f74e38fb085233fe553a8a620e9f40438ffddd0c0394f28dc7679308b7c7d | cmcl/franklyfrank | debug.ml |
let do_debug = ref false
let debug_flag b = do_debug := b
let print fmt =
let f = if !do_debug then Printf.fprintf else Printf.ifprintf in
f stderr fmt
| null | https://raw.githubusercontent.com/cmcl/franklyfrank/6cc1c4f7377ea2a907675ec0fae9ff32829cec83/util/debug.ml | ocaml |
let do_debug = ref false
let debug_flag b = do_debug := b
let print fmt =
let f = if !do_debug then Printf.fprintf else Printf.ifprintf in
f stderr fmt
| |
eb8ed415bea33d6403dd48f70137b98c8c9b7ce2b8e75c04e7765d9c7da33426 | onyx-platform/learn-onyx | challenge_1_1_test.clj | (ns workshop.jobs.challenge-1-1-test
(:require [clojure.test :refer [deftest is]]
[onyx.test-helper :refer [with-test-env feedback-exception!]]
[workshop.challenge-1-1 :as c]
[workshop.workshop-utils :as u]
[onyx.api]))
;; This challenge builds on the previous challeng... | null | https://raw.githubusercontent.com/onyx-platform/learn-onyx/6bf1936f35d26e3c8cf171b5971e1bc95e82b3c8/test/workshop/jobs/challenge_1_1_test.clj | clojure | This challenge builds on the previous challenge - you'll implement
the workflow should look like:
read-segments
|
v
cube-n
|
v
add-ten
|
v
multiply-by-5
|
v
write-segments
Open the corresponding src file for this chall... | (ns workshop.jobs.challenge-1-1-test
(:require [clojure.test :refer [deftest is]]
[onyx.test-helper :refer [with-test-env feedback-exception!]]
[workshop.challenge-1-1 :as c]
[workshop.workshop-utils :as u]
[onyx.api]))
your first workflow . Below is a pictorial desc... |
44ff157cc87291acee24ac3ea494cd2e27c16d471f7bd843d8667d9aeb8e40ed | SecPriv/webspec | logger.mli | (********************************************************************************)
Copyright ( c ) 2021
(* *)
(* Permission is hereby granted, free of charge, to any person obtaining a *)
(* c... | null | https://raw.githubusercontent.com/SecPriv/webspec/9f500bd85400551d8bf0e117ac5aa57088f9bc20/compiler/src/logger.mli | ocaml | ******************************************************************************
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
th... | Copyright ( c ) 2021
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABI... |
55d28e4ed867f4e776341ea60df6570092e3585be4df97c55fb517c23ff5acbf | clojure-vim/neovim-client | test_helper.clj | (ns neovim-client.test-helper)
(defn neovim
"Make a neovim subprocess."
[]
(let [p (.exec (Runtime/getRuntime) "nvim --embed")]
{:process p
:in (.getInputStream p)
:out (.getOutputStream p)}))
(defn stop-neovim
[{:keys [process]}]
(.destroy process))
(defmacro with-neovim
[& body]
`(let [... | null | https://raw.githubusercontent.com/clojure-vim/neovim-client/664813b6890b9acdf4cdf58ea72049744898159f/test/neovim_client/test_helper.clj | clojure | (ns neovim-client.test-helper)
(defn neovim
"Make a neovim subprocess."
[]
(let [p (.exec (Runtime/getRuntime) "nvim --embed")]
{:process p
:in (.getInputStream p)
:out (.getOutputStream p)}))
(defn stop-neovim
[{:keys [process]}]
(.destroy process))
(defmacro with-neovim
[& body]
`(let [... | |
ae494913484cd41267a772c554bb573b19aa119565c79bb134e6b6e8d430099f | commsor/titanoboa | repl.clj | (ns user
(:require [figwheel-sidecar.repl-api :as ra]))
(ra/start-figwheel!) ;; <-- fetches configuration
(ra/cljs-repl) | null | https://raw.githubusercontent.com/commsor/titanoboa/ffe3e1e58f89169092d7b6a3a45e1707a0ecc9ee/script/repl.clj | clojure | <-- fetches configuration | (ns user
(:require [figwheel-sidecar.repl-api :as ra]))
(ra/cljs-repl) |
2f20acd460424953a6d3eed575a3da9708f9fe6287b459cb8b72a4ac18492d00 | ocaml-sf/learn-ocaml-corpus | schizophrenic_failure.ml | let return (x : 'a) : 'a m =
let compute s f =
wrong and very weird : call both success continuation and
failure continuation , keep only one result
failure continuation, keep only one result *)
let answer1, answer2 = s x f, f() in
answer2
in
{ compute }
let (>>=) (m1 : 'a m) (f2 : 'a -... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/nondet_monad_cont/wrong/schizophrenic_failure.ml | ocaml | The functions [reflect] and [msplit] witness an isomorphism between the
type ['a m] and the type [unit -> ('a * 'a m) option]. | let return (x : 'a) : 'a m =
let compute s f =
wrong and very weird : call both success continuation and
failure continuation , keep only one result
failure continuation, keep only one result *)
let answer1, answer2 = s x f, f() in
answer2
in
{ compute }
let (>>=) (m1 : 'a m) (f2 : 'a -... |
be8fe628f1a57a957d1702ad97dbdb691247251b2e569646177b64f7bccf492d | vvvvalvalval/scope-capture | example.cljs | (ns sc.lab.cljs.example
(:require [sc.api :as sc])
#_(:require-macros [sc.api :as scm]))
(def foo
(let [a 1
b (inc a)]
(fn [x y]
(let [z (+ x (* a y))]
(* 3
(sc.api/spy
(throw (ex-info "Arrrrrg" {}))))))))
(foo 1 2)
#_'{:protocol-inline nil,
: repl - env # cljs... | null | https://raw.githubusercontent.com/vvvvalvalval/scope-capture/1214ff41459c41df57ef55b3fdf01d965ad611b2/lab/sc/lab/cljs/example.cljs | clojure | (ns sc.lab.cljs.example
(:require [sc.api :as sc])
#_(:require-macros [sc.api :as scm]))
(def foo
(let [a 1
b (inc a)]
(fn [x y]
(let [z (+ x (* a y))]
(* 3
(sc.api/spy
(throw (ex-info "Arrrrrg" {}))))))))
(foo 1 2)
#_'{:protocol-inline nil,
: repl - env # cljs... | |
66f8c7d270cabe86739713560f16a3b10efd056ace95af11410b289e7f66ea2e | danielcompton/defn-spec | utils.cljc | (ns net.danielcompton.defn-spec-alpha.utils
"Private utilities used in schema implementation."
(:refer-clojure :exclude [record?])
#?(:clj
(:require [clojure.string :as string])
(:require
goog.string.format
[goog.string :as gstring]
[clojure.string :as string]))
#?(:cljs (:require... | null | https://raw.githubusercontent.com/danielcompton/defn-spec/831ce2efb41149e86e4258bdbd9f62e33d3d0003/src/net/danielcompton/defn_spec_alpha/utils.cljc | clojure |
Miscellaneous helpers | (ns net.danielcompton.defn-spec-alpha.utils
"Private utilities used in schema implementation."
(:refer-clojure :exclude [record?])
#?(:clj
(:require [clojure.string :as string])
(:require
goog.string.format
[goog.string :as gstring]
[clojure.string :as string]))
#?(:cljs (:require... |
273cfdc8f499a8fb94485d2727fcffb67d8608d8fa9eeef76ae9cfa9396d7054 | stuartsierra/lazytest | rt.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; ... | null | https://raw.githubusercontent.com/stuartsierra/lazytest/3b0f419ce3d6f259d2ab3cfde475fa491a4db23e/modules/clojure-language-tests/test/clojure/test_clojure/rt.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) . All rights reserved .
Author :
(ns clojure.test-clojure.rt
(:use lazytest.deftest clojure.test-clojure.helpers))
(defmacro with-err-print-writer
"Evaluate with err pointing to a temporary PrintWriter, and
return err contents as a string."
[& body]
`(let [s# (java.io.StringWrite... |
feb79301c7640b028732e920d8a971c82293c5f8d9504942d0313ae3acf73267 | jellelicht/guix | utils.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2012 , 2013 , 2014 , 2015 < >
Copyright © 2013 < >
Copyright © 2013 < >
Copyright © 2015 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU ... | null | https://raw.githubusercontent.com/jellelicht/guix/83cfc9414fca3ab57c949e18c1ceb375a179b59c/guix/build/utils.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 © 2012 , 2013 , 2014 , 2015 < >
Copyright © 2013 < >
Copyright © 2013 < >
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 License
along with GNU . If not , see < / > .
(define-module... |
31af7ea208f4827c429a748fe9e16720260c6de732c58ea91aed75fc317cd375 | jesperes/aoc_erlang | aoc2016_day07.erl | -module(aoc2016_day07).
-behavior(aoc_puzzle).
-export([parse/1, solve1/1, solve2/1, info/0]).
-include("aoc_puzzle.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2016,
day = 7,
name = "Internet Protocol Version 7",
... | null | https://raw.githubusercontent.com/jesperes/aoc_erlang/ec0786088fb9ab886ee57e17ea0149ba3e91810a/src/2016/aoc2016_day07.erl | erlang | and no "abba" sequence has been found inside brackets. | -module(aoc2016_day07).
-behavior(aoc_puzzle).
-export([parse/1, solve1/1, solve2/1, info/0]).
-include("aoc_puzzle.hrl").
-spec info() -> aoc_puzzle().
info() ->
#aoc_puzzle{module = ?MODULE,
year = 2016,
day = 7,
name = "Internet Protocol Version 7",
... |
4ebd548537bab3bb0487e10a8f94ff5ef192ed58a5ea54899f9c6e27619e52dc | jumarko/clojure-experiments | 06_example.clj | (ns clojure-experiments.purely-functional.property-based-testing.06-example
"Check -overview-with-an-example-test/
Also Unicode FAQ: "
(:require
[clojure.string :as string]
[clojure.test.check.clojure-test :refer [defspec]]
[clojure.test.check.properties :as prop]
[clojure.test.check.generators :as ge... | null | https://raw.githubusercontent.com/jumarko/clojure-experiments/f0f9c091959e7f54c3fb13d0585a793ebb09e4f9/src/clojure_experiments/purely_functional/property_based_testing/06_example.clj | clojure | Testing clojure.string/upper-case
as a demonstration
remove this dummy tests
end
Process of writing propery-based tests
may seem hard to come up with
let's start with sanity checking - so to know that the fn doesn't do anything crazy
like throwing exceptions
if you like to see what the generator does you can "... | (ns clojure-experiments.purely-functional.property-based-testing.06-example
"Check -overview-with-an-example-test/
Also Unicode FAQ: "
(:require
[clojure.string :as string]
[clojure.test.check.clojure-test :refer [defspec]]
[clojure.test.check.properties :as prop]
[clojure.test.check.generators :as ge... |
48ee512fd7f3031b6e30592db163a8a6c108c2dae49df3d2505603d136f19b32 | zellerin/http2 | streams.lisp | (in-package :http2)
(fiasco:deftest guess-encodings-from-content-type ()
"Test encoding guesses based on the content-type."
(let ((*default-encoding* :foo)
(*default-text-encoding* :bar))
(handler-bind ((warning 'muffle-warning))
(fiasco:is (equalp (extract-charset-from-content-type "text/plain; ... | null | https://raw.githubusercontent.com/zellerin/http2/6b3216a2743d303686c3c94bacaee66abccd9d1e/tests/streams.lisp | lisp | text
binary data
expected usage - text
binary data | (in-package :http2)
(fiasco:deftest guess-encodings-from-content-type ()
"Test encoding guesses based on the content-type."
(let ((*default-encoding* :foo)
(*default-text-encoding* :bar))
(handler-bind ((warning 'muffle-warning))
(fiasco:is (equalp (extract-charset-from-content-type "text/plain; ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.