_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 |
|---|---|---|---|---|---|---|---|---|
8dfaf50e67a1254d6c943df8a6c73fb3f50a7bd74472679130789c2683525a3a | LennMars/algorithms_in_OCaml | test.ml | open Main
let a = SparseMatrix.make [|
[|6.;4.;1.|];
[|4.;5.;0.|];
[|1.;0.;1.|]|]
let x = [|1.;1.;1.|]
let b = SparseMatrix.mut_mul_vec a x
let x' = SparseMatrix.cg a b [|0.;0.;0.|]
| null | https://raw.githubusercontent.com/LennMars/algorithms_in_OCaml/f7fb8ca9f497883d86be3167bfc98a4a28ac73c9/matrix/test.ml | ocaml | open Main
let a = SparseMatrix.make [|
[|6.;4.;1.|];
[|4.;5.;0.|];
[|1.;0.;1.|]|]
let x = [|1.;1.;1.|]
let b = SparseMatrix.mut_mul_vec a x
let x' = SparseMatrix.cg a b [|0.;0.;0.|]
| |
d3d87f090354a4f5c45b81b64336311636e6d40b206297758ad80869db15870c | fpco/ide-backend | Install.hs | -----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Install
Copyright : 2003 - 2004
--
-- Maintainer :
-- Portability : portable
--
-- This is the entry point into installing a built package. Performs the
-- \"@.\/setup install@\" and \"@... | null | https://raw.githubusercontent.com/fpco/ide-backend/860636f2d0e872e9481569236bce690637e0016e/ide-backend/TestSuite/inputs/Cabal-1.18.1.5/Distribution/Simple/Install.hs | haskell | ---------------------------------------------------------------------------
|
Module : Distribution.Simple.Install
Maintainer :
Portability : portable
This is the entry point into installing a built package. Performs the
\"@.\/setup install@\" and \"@.\/setup copy@\" actions. It moves files into
plac... | Copyright : 2003 - 2004
All rights reserved .
Redistribution and use in source and binary forms , with or without
modification , are permitted provided that the following conditions are
met :
* Redistributions of source code must retain the above copyright
notice , this list of conditi... |
1d6bf69b43affe1c72990403cb5cfeead8eb8d9ddec16f43c99ec4c767de42e2 | imrehg/ypsilon | events.scm | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gdk events)
(export gdk_events_pending)
(import (rnrs) (ypsilon ffi))
(define lib-name
(cond (on-linux "libgdk-x11-2.0.so.0")
... | null | https://raw.githubusercontent.com/imrehg/ypsilon/e57a06ef5c66c1a88905b2be2fa791fa29848514/sitelib/ypsilon/gdk/events.scm | scheme | gboolean gdk_events_pending (void)
[end] | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gdk events)
(export gdk_events_pending)
(import (rnrs) (ypsilon ffi))
(define lib-name
(cond (on-linux "libgdk-x11-2.0.so.0")
... |
9a5235dde06f2ec29ee590fc44a21e9677510c31a166ed7ea2c619ca00749424 | philnguyen/soft-contract | r-file.rkt | #lang racket
(provide/contract
[main (integer? integer? . -> . any/c)])
(define STATE/C (one-of/c 'init 'opened 'closed 'ignore))
(define (loop) (loop))
(define (readit st)
(if (equal? 'opened st) 'opened 'ignore))
(define (read_ x st)
(if x (readit st) st))
(define (closeit st)
(cond
[(equal? 'opened ... | null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/mochi/r-file.rkt | racket | #lang racket
(provide/contract
[main (integer? integer? . -> . any/c)])
(define STATE/C (one-of/c 'init 'opened 'closed 'ignore))
(define (loop) (loop))
(define (readit st)
(if (equal? 'opened st) 'opened 'ignore))
(define (read_ x st)
(if x (readit st) st))
(define (closeit st)
(cond
[(equal? 'opened ... | |
6077789717a9c7e450b77e02c4c354f1f6fe68059d5047011985de509fa616f8 | ThoughtWorksInc/stonecutter | change_password.cljs | (ns stonecutter.js.controller.change-password
(:require [stonecutter.validation :as v]
[stonecutter.js.dom.common :as dom]
[stonecutter.js.dom.change-password :as cpd]
[stonecutter.js.controller.client_translations :as ct]))
(def default-state {:current-password {:value nil :error... | null | https://raw.githubusercontent.com/ThoughtWorksInc/stonecutter/37ed22dd276ac652176c4d880e0f1b0c1e27abfe/src-cljs/stonecutter/js/controller/change_password.cljs | clojure | (ns stonecutter.js.controller.change-password
(:require [stonecutter.validation :as v]
[stonecutter.js.dom.common :as dom]
[stonecutter.js.dom.change-password :as cpd]
[stonecutter.js.controller.client_translations :as ct]))
(def default-state {:current-password {:value nil :error... | |
689d31e2729ba4421674a2d598d353e48a8cc923ba72be41fdf6af962218a39f | juxt/apex | router.clj | Copyright © 2020 , JUXT LTD .
(ns juxt.apex.examples.cms.router
(:require
[juxt.apex.examples.cms.cache :as cache]
[juxt.apex.examples.cms.flowables :as flowables]
[juxt.apex.examples.cms.upload :as upload]
[juxt.apex.examples.cms.rs :as rs]
[juxt.apex.examples.cms.sse :as sse]
[integrant.core :a... | null | https://raw.githubusercontent.com/juxt/apex/cb4c0016d817ebb03d4f84e572ca71edd84ed79d/examples/cms/src/juxt/apex/examples/cms/router.clj | clojure | Copyright © 2020 , JUXT LTD .
(ns juxt.apex.examples.cms.router
(:require
[juxt.apex.examples.cms.cache :as cache]
[juxt.apex.examples.cms.flowables :as flowables]
[juxt.apex.examples.cms.upload :as upload]
[juxt.apex.examples.cms.rs :as rs]
[juxt.apex.examples.cms.sse :as sse]
[integrant.core :a... | |
80f52799edbc1c3c59ed5512486c386b5a28544842eed31f0ca8f89156c737fc | returntocorp/ocaml-tree-sitter-core | Fresh.ml | (*
Unit tests for the Fresh module.
*)
open Printf
open Tree_sitter_gen
let test_simple () =
let scope = Fresh.create_scope () in
let add name =
let res = Fresh.create_name scope name in
printf "%s -> %s\n%!" name res;
res
in
assert (add "x" = "x");
assert (add "y" = "y");
assert (add "x" =... | null | https://raw.githubusercontent.com/returntocorp/ocaml-tree-sitter-core/28f750bb894ea4c0a7f6b911e568ab9d731cc0b5/src/gen/test/Fresh.ml | ocaml |
Unit tests for the Fresh module.
|
open Printf
open Tree_sitter_gen
let test_simple () =
let scope = Fresh.create_scope () in
let add name =
let res = Fresh.create_name scope name in
printf "%s -> %s\n%!" name res;
res
in
assert (add "x" = "x");
assert (add "y" = "y");
assert (add "x" = "x_");
assert (add "x" = "x2")
let tes... |
dc42e1d836b7e99534540990f37e18fb1794d493ed3a587cdfa7e9e466d01ac8 | anuragsoni/postgres-protocol | postgres_lwt.mli | BSD 3 - Clause License
Copyright ( c ) 2020 , All rights reserved .
Redistribution and use in source and binary forms , with or without modification , are
permitted provided that the following conditions are met :
1 . Redistributions of source code must retain the above copyright notice , thi... | null | https://raw.githubusercontent.com/anuragsoni/postgres-protocol/e3e1743c138e527a2285dfd1eb240f49fd764b25/postgres-lwt/postgres_lwt.mli | ocaml | BSD 3 - Clause License
Copyright ( c ) 2020 , All rights reserved .
Redistribution and use in source and binary forms , with or without modification , are
permitted provided that the following conditions are met :
1 . Redistributions of source code must retain the above copyright notice , thi... | |
28a20472e582d06cd34ce5cafa5987b4c4f9a52e896667e32951b2e67161b879 | leonardb/mfdb | mfdb_app.erl | 2020 < >
%%% @hidden
%%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
%%% use this file except in compliance with the License. You may obtain a copy of
%%% the License at
%%%
%%% -2.0
%%%
%%% Unless required by applicable law or agreed to in writing, software
distributed... | null | https://raw.githubusercontent.com/leonardb/mfdb/4d084806cb81dc825f59fc8b83b59ec35940f525/src/mfdb_app.erl | erlang | @hidden
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
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and l... | 2020 < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
-module(mfdb_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
mfdb_sup:start_link().
stop(_... |
6d804d0a7bc1835653d623dfc8d952786b62b35e039af7485baa8d514ed0b86e | originrose/cortex | compute_binding.clj | (ns cortex.nn.compute-binding
"Internal machinery needed to make execute work. Ideally this machinery is used during
execute, layer unit tests, and gradient checking in such a way that once the layer unit tests
work someone has some confidence that this module is correct."
(:require [clojure.pprint]
... | null | https://raw.githubusercontent.com/originrose/cortex/94b1430538e6187f3dfd1697c36ff2c62b475901/src/cortex/nn/compute_binding.clj | clojure |
Utility Functions
Bind/save functionality
Allocate any buffers not included in the traversal information (streams used
only for loss do not get included in the traversal)
If the user is forcing gradients then that is something different.
Set the gradients flag for the general case of training.
Setup the parame... | (ns cortex.nn.compute-binding
"Internal machinery needed to make execute work. Ideally this machinery is used during
execute, layer unit tests, and gradient checking in such a way that once the layer unit tests
work someone has some confidence that this module is correct."
(:require [clojure.pprint]
... |
ac225134a9921df06c792220d24f69e38ef3411207534c709504e3b0117a1d9f | batterseapower/supercompilation-by-evaluation | Split.hs | # LANGUAGE ViewPatterns , TupleSections , PatternGuards #
# OPTIONS_GHC -fno - warn - name - shadowing #
module Supercompile.Split (split) where
import Core.FreeVars
import Core.Renaming
import Core.Syntax
import Evaluator.Evaluate (step)
import Evaluator.FreeVars
import Evaluator.Syntax
import Name
import Renaming
... | null | https://raw.githubusercontent.com/batterseapower/supercompilation-by-evaluation/daeb3e12ca8319a5144dd48a763cf7e7825a1999/Supercompile/Split.hs | haskell |
== Gathering entry information for the splitter ==
^ The Id is a context identifier: if a binding is Entered twice from the same context it's really a single Entrance. Nothing signifies the residual context (i.e. there is no associated float)
== The splitter ==
Non-expansive simplification that we can safely do... | # LANGUAGE ViewPatterns , TupleSections , PatternGuards #
# OPTIONS_GHC -fno - warn - name - shadowing #
module Supercompile.Split (split) where
import Core.FreeVars
import Core.Renaming
import Core.Syntax
import Evaluator.Evaluate (step)
import Evaluator.FreeVars
import Evaluator.Syntax
import Name
import Renaming
... |
a3efb696dacf2e3c490bf160c71255dcac727101744089707171f83823fe53cb | nineties/Choco | Flags.hs | -------------------------------------------------
Choco --
Chikadzume Oriented Compiler --
Copyright 2007 - 2008 by Basement fairy --
-------------------------------------------------
module Flags (
CFlags(..),
defaultCFlags
) where
data... | null | https://raw.githubusercontent.com/nineties/Choco/0081351d0b556ff74f096accb65c9ab45d29ddfe/src/Flags.hs | haskell | -----------------------------------------------
-----------------------------------------------
name of the source file
name of the output file (without suffix)
dump output of the parser
dump output of the typechecker
dump output of the lambda transformer
dump simplified lambda | module Flags (
CFlags(..),
defaultCFlags
) where
data CFlags = CFlags {
}
defaultCFlags = CFlags {
in_name = "",
out_name = "a",
dump_parser = False,
dump_typecheck = False,
dump_lambda = False,
dump_simpl = False
}
|
762296b9b097e9018a8394e7d356a5e2d35602e3d681f18a5d4752d9ad6c3ee2 | ocsigen/ocaml-eliom | plugin.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocsigen/ocaml-eliom/497c6707f477cb3086dc6d8124384e74a8c379ae/testsuite/tests/lib-dynlink-native/plugin.mli | ocaml | ************************************************************************
OCaml
... | , LexiFi
Copyright 2007 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
val facts: int list
|
4e3919116a285aa88a8e74a56a996dbc1762dbf686aeceb664acc5046a0e43a3 | eta-lang/eta-prelude | IsString.hs | |
The type class ' IsString ' defines a ' convertString '
method that allows to convert from a regular ' String '
to another type that implements this type class .
It is very useful for using with other string - like types
like ' ByteString ' or ByteArray
The type class 'IsString' defines a 'convertString'... | null | https://raw.githubusercontent.com/eta-lang/eta-prelude/e25e9aa42093e090a86d2728b0cac288a25bc52e/src/Eta/Classes/IsString.hs | haskell | |
Converts a String into another string-like type.
| |
The type class ' IsString ' defines a ' convertString '
method that allows to convert from a regular ' String '
to another type that implements this type class .
It is very useful for using with other string - like types
like ' ByteString ' or ByteArray
The type class 'IsString' defines a 'convertString'... |
f779ff8386ca6bb3c39f7ec70c85eda3bf7772828ee65cf965959fbfe745333d | Deep-Symmetry/afterglow | layout.clj | (ns afterglow.web.layout
(:require [clojure.java.io]
[environ.core :refer [env]]
[markdown.core :refer [md-to-html-string]]
[ring.middleware.anti-forgery :refer [*anti-forgery-token*]]
[ring.util.anti-forgery :refer [anti-forgery-field]]
[ring.util.response ... | null | https://raw.githubusercontent.com/Deep-Symmetry/afterglow/12b8c90f22c591549adc4d89b8a19853f5e9e3a5/src/afterglow/web/layout.clj | clojure | (ns afterglow.web.layout
(:require [clojure.java.io]
[environ.core :refer [env]]
[markdown.core :refer [md-to-html-string]]
[ring.middleware.anti-forgery :refer [*anti-forgery-token*]]
[ring.util.anti-forgery :refer [anti-forgery-field]]
[ring.util.response ... | |
d546e552ae95542e5aaabe78f3e43ee8c8df375cd59a982b453730360d00f376 | jessealama/argo | info.rkt | #lang info
(define collection "argo")
(define version "2.0.0")
(define deps
'("base"
"rackunit-lib"
"http"
"http-easy"
"sugar"
"beautiful-racket-lib"
"web-server-lib"
"json-pointer"
"uri-template"
"brag"))
(define build-deps
'("scribble-lib"
"racket-doc"
"rackunit-lib... | null | https://raw.githubusercontent.com/jessealama/argo/e0d6dc20ffa43ae81bdf16e9b73e5707e5e17cbf/info.rkt | racket | #lang info
(define collection "argo")
(define version "2.0.0")
(define deps
'("base"
"rackunit-lib"
"http"
"http-easy"
"sugar"
"beautiful-racket-lib"
"web-server-lib"
"json-pointer"
"uri-template"
"brag"))
(define build-deps
'("scribble-lib"
"racket-doc"
"rackunit-lib... | |
dead9d373917ebca70ae4c0c2369de4b89998653cd62aad008883a390af4bec5 | CatalaLang/catala | expr.mli | This file is part of the Catala compiler , a specification language for tax
and social benefits computation rules . Copyright ( C ) 2020 - 2022 Inria ,
contributor : < > , Tixeuil
< > , < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
use this f... | null | https://raw.githubusercontent.com/CatalaLang/catala/fced0fff54ddeacee74b357196bdac3151c4c0ef/compiler/shared_ast/expr.mli | ocaml | * Functions handling the expressions of [shared_ast]
* Box the expression from the outside
* For closed expressions, similar to [Bindlib.unbox]
* Rebuild the whole term, re-binding all variables and exposing free variables
* Manipulation of marks
* Adds the given type information only on typed marks
* Identity on... | This file is part of the Catala compiler , a specification language for tax
and social benefits computation rules . Copyright ( C ) 2020 - 2022 Inria ,
contributor : < > , Tixeuil
< > , < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
use this f... |
1865bf526c16ad9531416713afb30d5a0a9a450c8b119667fc9dffb5fd7c6054 | facebook/duckling | Rules.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE GADTs #-}
{-# LANGUAGE OverloadedStrings #-}
module Duckling.TimeGrain.HR.Rules
( rules ) whe... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/TimeGrain/HR/Rules.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings # | Copyright ( c ) 2016 - present , Facebook , Inc.
module Duckling.TimeGrain.HR.Rules
( rules ) where
import Data.String
import Data.Text (Text)
import Prelude
import Duckling.Dimensions.Types
import Duckling.Types
import qualified Duckling.TimeGrain.Types as TG
grains :: [(Text, String, TG.Grain)]
grains = [ ("... |
1631c230b984e5946500a3534b69e50c72ccf4e72928c0fb6c88a01bfee284f9 | Risto-Stevcev/bs-declaredom | Html_Aria.ml | module Value = struct
type autocomplete =
[ `inline | `list | `both | `none ]
[@@bs.deriving jsConverter]
type current =
[ `page | `step | `location | `date | `time
| `true_ [@bs.as "true"] | `false_ [@bs.as "false"] ]
[@@bs.deriving jsConverter]
type dropeffect =
[ `copy | `execute | `l... | null | https://raw.githubusercontent.com/Risto-Stevcev/bs-declaredom/6e2eb1f0daa32a7253caadbdd6392f3371807c88/src/html/Html_Aria.ml | ocaml | * {{: -aria-1.1/#state_prop_def} Properties} | module Value = struct
type autocomplete =
[ `inline | `list | `both | `none ]
[@@bs.deriving jsConverter]
type current =
[ `page | `step | `location | `date | `time
| `true_ [@bs.as "true"] | `false_ [@bs.as "false"] ]
[@@bs.deriving jsConverter]
type dropeffect =
[ `copy | `execute | `l... |
da132683883d600e9cbb911f62b020d9f1336d1ef81de2d64d3f205c00a3ea16 | rampion/Cascade | Operators.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE TypeOperators #-}
module Cascade.Operators where
import Control.Category (Category(..))
import Control.Comonad (Comonad(..))
import Cascade.Util.ListKind
import Cascade
(#) :: Category c => CascadeC c (t ': ts) -> c t (Last (t ': ts))
(#) = cascade
infixr 0... | null | https://raw.githubusercontent.com/rampion/Cascade/94d4acbf725fb49cd815c7c76e69cecc8174974d/Cascade/Operators.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators # | module Cascade.Operators where
import Control.Category (Category(..))
import Control.Comonad (Comonad(..))
import Cascade.Util.ListKind
import Cascade
(#) :: Category c => CascadeC c (t ': ts) -> c t (Last (t ': ts))
(#) = cascade
infixr 0 #
(#~) :: Monad m => CascadeM m (t ': ts) -> t -> m (Last (t ': ts))
(#~) = c... |
d03e4310a347075040caa41d1e2cb97e8e0ca2b49101add96e7bd9a3cd7c8e50 | TempusMUD/cl-tempus | char-class.lisp | (in-package #:tempus)
;; 0 - class/race combination not allowed
1 - class / race combination allowed only for secondary class
2 - class / race combination allowed for primary class
(defparameter +race-restrictions+
MG CL TH WR BR PS PH CY KN RN BD MN VP MR S1 S2 S3
#2A((#.+race-human+ 2... | null | https://raw.githubusercontent.com/TempusMUD/cl-tempus/c5008c8d782ba44373d89b77c23abaefec3aa6ff/src/events/char-class.lisp | lisp | 0 - class/race combination not allowed
Mobiles don't learn skills
You can't gain in a skill that you don't really know
Check for remort skills too
increment a random stat
then decrement a random stat
human
remove implant affects
hitpoint gains
mana gains
move gains
Male stats
Female stats | (in-package #:tempus)
1 - class / race combination allowed only for secondary class
2 - class / race combination allowed for primary class
(defparameter +race-restrictions+
MG CL TH WR BR PS PH CY KN RN BD MN VP MR S1 S2 S3
#2A((#.+race-human+ 2 2 2 0 2 2 2 2 2 2 2 2 0 2 0... |
369c43829e6c9ae522dff2ac57d8396f0a2fefdf4a8919ed9cd949a6f4d7a1e5 | softwarelanguageslab/maf | let.scm | (let ((x 1))
(letrec ((x 2))
x)
(let* ((x 3))
x)
(letrec ((x 4))
x)
x)
| null | https://raw.githubusercontent.com/softwarelanguageslab/maf/daf47e4bf939936535739a83fcf9c09bc93f287f/test/R5RS/various/let.scm | scheme | (let ((x 1))
(letrec ((x 2))
x)
(let* ((x 3))
x)
(letrec ((x 4))
x)
x)
| |
4679228ab262c0c7475c325451e39c3578f980a3832fba618c4af6da0a3026b2 | zotonic/zotonic | z_exometer_mqtt.erl | @author < >
2015
@doc Exometer reporter which publishes exometer stats to mqtt topics .
Copyright 2015
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% ... | null | https://raw.githubusercontent.com/zotonic/zotonic/aa38d5bd01f20696a7c5230b97ea23d2d1678e79/apps/zotonic_core/src/support/z_exometer_mqtt.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | @author < >
2015
@doc Exometer reporter which publishes exometer stats to mqtt topics .
Copyright 2015
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(z_exometer_mqtt).
exometer_report callba... |
19d24bfe4b6dfeefff1d26ac49e179c311895887c7f42c9a1b314b0d2823461e | spechub/Hets | ProveWithTruthTable.hs | |
Module : ./Propositional / ProveWithTruthTable.hs
Description : Provers for propositional logic
Copyright : ( c ) , Uni Bremen 2008
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : experimental
Portability : portable
A truth table prover for ... | null | https://raw.githubusercontent.com/spechub/Hets/af7b628a75aab0d510b8ae7f067a5c9bc48d0f9e/Propositional/ProveWithTruthTable.hs | haskell | * Prover implementation
| the name of the prover
maximal size of the signature
display error message when signature is too large
|
Models and evaluation of sentences
a model specifies which propositions are true
| evaluation of sentences in a model
|
Evaluation of (co)freeness constraints
| amalgamation ... | |
Module : ./Propositional / ProveWithTruthTable.hs
Description : Provers for propositional logic
Copyright : ( c ) , Uni Bremen 2008
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : experimental
Portability : portable
A truth table prover for ... |
aa4d5a843666a1ed3a1c67c84f1e4233c7a6eb0d5808e157969fd69fcf965728 | tezos-commons/baseDAO | Types.hs | SPDX - FileCopyrightText : 2021 Tezos Commons
SPDX - License - Identifier : LicenseRef - MIT - TC
module Test.Ligo.TreasuryDAO.Types
( TransferProposal (..)
, TreasuryDaoProposalMetadata (..)
) where
import Universum
import Lorentz as L
import Ligo.BaseDAO.Common.Types
import Ligo.BaseDAO.Types
# ANN mod... | null | https://raw.githubusercontent.com/tezos-commons/baseDAO/55c168a09d507795af1b4fe4361c1243ebdb84f8/haskell/test/Test/Ligo/TreasuryDAO/Types.hs | haskell | | Helper type for unpack/pack | SPDX - FileCopyrightText : 2021 Tezos Commons
SPDX - License - Identifier : LicenseRef - MIT - TC
module Test.Ligo.TreasuryDAO.Types
( TransferProposal (..)
, TreasuryDaoProposalMetadata (..)
) where
import Universum
import Lorentz as L
import Ligo.BaseDAO.Common.Types
import Ligo.BaseDAO.Types
# ANN mod... |
37f1c6ab4ae6eff5af638664920b67e53858032bf0ff203c6ea73aade77956d3 | ucsd-progsys/liquidhaskell | ReflString0.hs |
cf -progsys/liquidhaskell/issues/1044
module ReflString0 where
{-@ reflect foo @-}
{-@ foo :: x:_ -> {v:_ | v <=> x == "cat"} @-}
foo :: String -> Bool
foo x = x == "cat"
| null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/20cd67af038930cb592d68d272c8eb1cbe3cb6bf/tests/reflect/pos/ReflString0.hs | haskell | @ reflect foo @
@ foo :: x:_ -> {v:_ | v <=> x == "cat"} @ |
cf -progsys/liquidhaskell/issues/1044
module ReflString0 where
foo :: String -> Bool
foo x = x == "cat"
|
6c7c3fa89c29687b5595cfc60fe44a7bd74739a5a8486d0c78bbd683498ada67 | nuvla/ui | spec.cljs | (ns sixsq.nuvla.ui.utils.spec
(:require [clojure.spec.alpha :as s]
[clojure.string :as str]))
(defn nonblank-string [s]
(let [str-s (str s)]
(when-not (str/blank? str-s)
str-s)))
(defn acceptable-password?
[password]
(and (string? password)
(>= (count password) 8)
(re-mat... | null | https://raw.githubusercontent.com/nuvla/ui/c10704eabd339489722fa53bc99f11f21103c070/code/src/cljs/sixsq/nuvla/ui/utils/spec.cljs | clojure | (ns sixsq.nuvla.ui.utils.spec
(:require [clojure.spec.alpha :as s]
[clojure.string :as str]))
(defn nonblank-string [s]
(let [str-s (str s)]
(when-not (str/blank? str-s)
str-s)))
(defn acceptable-password?
[password]
(and (string? password)
(>= (count password) 8)
(re-mat... | |
80ca0470d8b7c62b91e3f405cc839a4dab7a542c7cb6ca0214a5de362353cf09 | input-output-hk/offchain-metadata-tools | Server.hs | {-# LANGUAGE OverloadedStrings #-}
module Cardano.Metadata.Webhook.Server where
import Control.Lens ( (.~), (^.) )
import Control.Monad.IO.Class ( liftIO )
import qualified Data.Aeson as Aeson
import qualified Data.ByteString.Char8 as C8
import qualified Data.ByteString.Lazy.Char8 as BLC
import Data.Foldable ( traver... | null | https://raw.githubusercontent.com/input-output-hk/offchain-metadata-tools/794f08cedbf555e9d207bccc45c08abbcf98add9/metadata-lib/src/Cardano/Metadata/Webhook/Server.hs | haskell | # LANGUAGE OverloadedStrings #
API handlers
putStrLn $ (show . whUserLogin . evPullRequestSender) ev ++ " pullRequested a commit, resulting in the following event: " |
module Cardano.Metadata.Webhook.Server where
import Control.Lens ( (.~), (^.) )
import Control.Monad.IO.Class ( liftIO )
import qualified Data.Aeson as Aeson
import qualified Data.ByteString.Char8 as C8
import qualified Data.ByteString.Lazy.Char8 as BLC
import Data.Foldable ( traverse_ )
import Data.Function ( (&) )
... |
0218a8e7c123607edd4dfcf60cab95b80a4cfcaa4f8dde15030b75b1a417d35c | zalora/zerobin | SJCL.hs | |
Encryption compatible with < / SJCL >
> > > import Web . . SJCL
> > > import Data . ByteString . Char8
> > > encrypt " secret - word " ( pack " hello " )
Content { iv = " VxyuJRVtKJqhG2iR / sPjAQ " , salt = " AhnDuP1CkTCBlQTHgw " , ct = " cqr7 / pMRXrcROmcgwA " }
Encryption compatible with </ SJCL>
... | null | https://raw.githubusercontent.com/zalora/zerobin/3c3da3eca80e2343fa196c864d06653784169c03/src/Web/ZeroBin/SJCL.hs | haskell | | Encrypted content. Each field is a 'toWeb'-encoded byte-string
^ random initialization vector (IV)
^ random salt
^ encrypted data
FIXME: -haskell-aeson-warning-no-explicit-implementation-for-tojson
TODO: this is default, we can specify it explicitly for forward compatibility
padded
| </ SJCL>-compatible enc... | |
Encryption compatible with < / SJCL >
> > > import Web . . SJCL
> > > import Data . ByteString . Char8
> > > encrypt " secret - word " ( pack " hello " )
Content { iv = " VxyuJRVtKJqhG2iR / sPjAQ " , salt = " AhnDuP1CkTCBlQTHgw " , ct = " cqr7 / pMRXrcROmcgwA " }
Encryption compatible with </ SJCL>
... |
9a573556d6d242b77c9048eac3f34721ada2dbf84dcc0a4709e8a169ef886d69 | kloimhardt/werkbank | filters.cljs | (ns ui.filters)
(enable-console-print!)
(def turb
(let [id "filter-tirb"]
{ :id id
:def [:filter { :id id :key (random-uuid) }
[:feTurbulence { :type "turbulence"
:baseFrequency "0.1 0.1"
:numOctaves "2"
:stitchTiles "sti... | null | https://raw.githubusercontent.com/kloimhardt/werkbank/df66274eb978d060a043b8429b29d0f36c4a2e89/ui_src/ui/filters.cljs | clojure | (ns ui.filters)
(enable-console-print!)
(def turb
(let [id "filter-tirb"]
{ :id id
:def [:filter { :id id :key (random-uuid) }
[:feTurbulence { :type "turbulence"
:baseFrequency "0.1 0.1"
:numOctaves "2"
:stitchTiles "sti... | |
df323de8f898b44a698692b445b5db3ae8ed7764f565d97aa6c6235298a86d86 | cognitect-labs/day-of-datomic-cloud | best_practices.clj | Copyright ( c ) Cognitect , Inc. 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... | null | https://raw.githubusercontent.com/cognitect-labs/day-of-datomic-cloud/b1684c8d131942f0451185288ed65bc51ee2b81d/doc-examples/best_practices.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 ) Cognitect , Inc. All rights reserved .
(require '[datomic.client.api :as d])
(import 'clojure.lang.ExceptionInfo
'java.util.UUID)
(def client-cfg (read-string (slurp "config.edn")))
(def client (d/client client-cfg))
(def db-name (str "scratch-" (UUID/randomUUID)))
(d/create-database clien... |
6c3afa6c6e2ec9dd61c064bdb25c67012aa19180c6881e32e87ec29c5d795dc0 | MichaelBurge/yxdb-utils | Utils.hs | module Tests.Database.Utils where
import Data.ByteString as BS
import GHC.IO.Handle
import System.IO
import System.Directory
captureStdout :: IO () -> IO BS.ByteString
captureStdout f = do
tmpd <- getTemporaryDirectory
(tmpf, tmph) <- openTempFile tmpd "haskell_stdout"
stdout_dup <- hDuplicate stdout
hDuplica... | null | https://raw.githubusercontent.com/MichaelBurge/yxdb-utils/955995a95cf56b7cb3c45e0175e2b574411d1a18/Tests/Database/Utils.hs | haskell | module Tests.Database.Utils where
import Data.ByteString as BS
import GHC.IO.Handle
import System.IO
import System.Directory
captureStdout :: IO () -> IO BS.ByteString
captureStdout f = do
tmpd <- getTemporaryDirectory
(tmpf, tmph) <- openTempFile tmpd "haskell_stdout"
stdout_dup <- hDuplicate stdout
hDuplica... | |
6619d62bcc9656b2f447d3aa966560e907664968ba4ca4f6e52e87582e08ee4a | commercialhaskell/rio | RIO.hs | module RIO
(
-- * Custom @Prelude@
| One of the core features of is that it can be used as a @Prelude@
replacement . Therefore it is best to disable the default ` Prelude ` with :
[ NoImplicitPrelude](/~ghc / latest / docs / html / users_guide / glasgow_exts.html#extension - NoImplicitPrelude )
-- pra... | null | https://raw.githubusercontent.com/commercialhaskell/rio/4eba306d37a60a20f0bed27f40afc23a7c892c40/rio/src/RIO.hs | haskell | * Custom @Prelude@
pragma:
> {-# LANGUAGE NoImplicitPrelude #-}
** @SimpleApp@
| If all you need is just some default environment that does basic logging and allows
> {-# LANGUAGE OverloadedStrings #-}
> module Main where
>
> main :: IO ()
> main =
> runSimpleApp $ do
Note the
[OverloadedStrings](/~... | module RIO
(
| One of the core features of is that it can be used as a @Prelude@
replacement . Therefore it is best to disable the default ` Prelude ` with :
[ NoImplicitPrelude](/~ghc / latest / docs / html / users_guide / glasgow_exts.html#extension - NoImplicitPrelude )
> import RIO
Some functions not ... |
63f470d339da5abc7d72a968458e65e10f5303cbbde5f4459aa44d7e03432f41 | jabber-at/ejabberd | ejabberd_listener.erl | %%%----------------------------------------------------------------------
%%% File : ejabberd_listener.erl
Author : < >
%%% Purpose : Manage socket listener
Created : 16 Nov 2002 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2018 ProcessOne
%%%
%%% This program is free software; you can redistrib... | null | https://raw.githubusercontent.com/jabber-at/ejabberd/7bfec36856eaa4df21b26e879d3ba90285bad1aa/src/ejabberd_listener.erl | erlang | ----------------------------------------------------------------------
File : ejabberd_listener.erl
Purpose : Manage socket listener
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
... | Author : < >
Created : 16 Nov 2002 by < >
ejabberd , Copyright ( C ) 2002 - 2018 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
... |
598e9640d74a4ff26a89179d24ff47b6cd5c7c4529e2bea50046154049778970 | MattWindsor91/travesty | container_exts.mli | This file is part of ' travesty ' .
Copyright ( c ) 2018 by
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
... | null | https://raw.githubusercontent.com/MattWindsor91/travesty/3f4da33830cc928ad879077e690277088de1f836/src/container_exts.mli | ocaml | * {2 Signatures}
For input and output module signatures for this module's functors, see
{!Container_exts_types}.
* [Extend0] creates {{!Container_exts_types.S0} extensions} for a
[Container.S0].
* [Extend0_predicate] creates {{!Container_exts_types.S0_predicate}
extensions} for a [Container.S0] over ... | This file is part of ' travesty ' .
Copyright ( c ) 2018 by
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
... |
fe38a0f5e0356108343d5b59468da4e04f75e78813f5a85276b76a5c1a833a0f | elastic/eui-cljs | stepped_gradient.cljs | (ns eui.services.stepped-gradient
(:require ["@elastic/eui/lib/services/color/stepped_gradient.js" :as eui]))
(def getSteppedGradient eui/getSteppedGradient)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/services/stepped_gradient.cljs | clojure | (ns eui.services.stepped-gradient
(:require ["@elastic/eui/lib/services/color/stepped_gradient.js" :as eui]))
(def getSteppedGradient eui/getSteppedGradient)
| |
bc9a7850b93a7873e73719a2d1f068960770cc21eab4a40688eb796763d6ac8f | chetmurthy/ledit | go.ml | (***********************************************************************)
(* *)
(* *)
, INRIA Rocquencourt
(* ... | null | https://raw.githubusercontent.com/chetmurthy/ledit/a34ac8d1ec4c7d29d18c274bc42312b031af2ae2/go.ml | ocaml | *********************************************************************
et Automatique. Distributed only by p... |
, INRIA Rocquencourt
Copyright 2001 - 2012 Institut National de Recherche en Informatique
$ Id$
open Ledit;
open Sys;
value version = "2.05";
value usage () = do {
prerr_string "Usage: ";
prerr_string argv.(0);
prerr_endline " [options] [... |
18c47935842af7d917b3c408984f7f81ceceadebb8f861ff36335474168e12bb | nvim-treesitter/nvim-treesitter | injections.scm | (comment) @comment
Github actions ( " run " ) / Gitlab CI ( " scripts " )
(block_mapping_pair
key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script")
value: (flow_node
(plain_scalar) @bash))
(block_mapping_pair
key: (flow_node) @_run (#any-of? @_run "run" "script" "bef... | null | https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/d2d8980c5cef0d42aa7a2444d95d3c06fd216720/queries/yaml/injections.scm | scheme | (comment) @comment
Github actions ( " run " ) / Gitlab CI ( " scripts " )
(block_mapping_pair
key: (flow_node) @_run (#any-of? @_run "run" "script" "before_script" "after_script")
value: (flow_node
(plain_scalar) @bash))
(block_mapping_pair
key: (flow_node) @_run (#any-of? @_run "run" "script" "bef... | |
52ac7498a996a59e67e65ff919c083c54b19ab251524a53f91547fd10327ae48 | bburdette/chordster | AddChordRoot.hs | module Handler.AddChordRoot where
import Import
import Handler.ChordRoot
getAddChordRootR :: Handler Html
getAddChordRootR = do
(widg,etype) <- generateFormPost $ chordRootForm Nothing
defaultLayout $ [whamlet|
<h1> Chord Root
<form method=post enctype=#{etype}>
^{widg}
<input type=submit valu... | null | https://raw.githubusercontent.com/bburdette/chordster/70d235f1ca379e5ecd4a8f39dc1e734e2d50978b/Handler/AddChordRoot.hs | haskell | module Handler.AddChordRoot where
import Import
import Handler.ChordRoot
getAddChordRootR :: Handler Html
getAddChordRootR = do
(widg,etype) <- generateFormPost $ chordRootForm Nothing
defaultLayout $ [whamlet|
<h1> Chord Root
<form method=post enctype=#{etype}>
^{widg}
<input type=submit valu... | |
408a1f41935cb4caee481e3f069ba4ebef9ed160571d468daa900b944d296329 | serokell/blockchain-util | Chain.hs | # LANGUAGE ScopedTypeVariables #
module Snowdrop.Block.Chain
( wholeChain
, forkDepthChain
, loadBlocksFromTo
, loadHeadersFrom
, loadAllHeadersToNoThrow
, IterationException (..)
, FromRef (..)
, ToRef (..)
) where
import Universum
import ... | null | https://raw.githubusercontent.com/serokell/blockchain-util/a6428c6841e7002605a115002f58eff78ff9f128/snowdrop-block/src/Snowdrop/Block/Chain.hs | haskell | ^ Given fork is too deep.
^ Wrong block reference occurred during chain traversal (of block that is not present in storage). | # LANGUAGE ScopedTypeVariables #
module Snowdrop.Block.Chain
( wholeChain
, forkDepthChain
, loadBlocksFromTo
, loadHeadersFrom
, loadAllHeadersToNoThrow
, IterationException (..)
, FromRef (..)
, ToRef (..)
) where
import Universum
import ... |
1969015e4df9f1afa20d16fb812f6e01941c54c7e08c8137a46a5d901e9b1894 | RedPRL/algaett | AsciiToken.mli | val keyword : KeywordClass.t Earley_core.Earley.grammar
val name : string list Earley_core.Earley.grammar
val pos_num : int Earley_core.Earley.grammar
val num : int Earley_core.Earley.grammar
| null | https://raw.githubusercontent.com/RedPRL/algaett/9228506610dd94b202824cfe462be764d54cab75/src/parser/AsciiToken.mli | ocaml | val keyword : KeywordClass.t Earley_core.Earley.grammar
val name : string list Earley_core.Earley.grammar
val pos_num : int Earley_core.Earley.grammar
val num : int Earley_core.Earley.grammar
| |
71ee313bbe612abc372d9310fbb2233bb1ef39ed3d83ee7dcedb4eca6204d04e | Deaf-Clojurian/sudoku-solver | core.clj | (ns sudoku-solver.core
(:require
[ring.middleware.defaults :refer [site-defaults wrap-defaults]]
[sudoku-solver.adapters.solver :as adapters.solver]
[sudoku-solver.controllers.solver :as controllers.solver]
[sudoku-solver.controllers.verifiers :as controllers.verifiers]
[sudoku-solver.diplomat.http-ser... | null | https://raw.githubusercontent.com/Deaf-Clojurian/sudoku-solver/223ef9fd178f96f13747fc99a32d76c94d890729/src/sudoku_solver/core.clj | clojure | (ns sudoku-solver.core
(:require
[ring.middleware.defaults :refer [site-defaults wrap-defaults]]
[sudoku-solver.adapters.solver :as adapters.solver]
[sudoku-solver.controllers.solver :as controllers.solver]
[sudoku-solver.controllers.verifiers :as controllers.verifiers]
[sudoku-solver.diplomat.http-ser... | |
275f0a949c540641c3e84bf331d8ec17075913d21d3cd2f09bfd334244e0e312 | hoytech/antiweb | load.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*-
$ Header : /usr / cvs / hcsw / antiweb / bundled / cl - ppcre / load.lisp , v 1.1 2008/04/26 02:40:56
Copyright ( c ) 2002 - 2007 , Dr. . All rights reserved .
;;; Redistribution and use in source and binary forms, with or wit... | null | https://raw.githubusercontent.com/hoytech/antiweb/53c38f78ea01f04f6d1a1ecdca5c012e7a9ae4bb/bundled/cl-ppcre/load.lisp | lisp | Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*-
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... | $ Header : /usr / cvs / hcsw / antiweb / bundled / cl - ppcre / load.lisp , v 1.1 2008/04/26 02:40:56
Copyright ( c ) 2002 - 2007 , Dr. . All rights reserved .
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
(in-... |
c9b87f6f244a6bec436f563b1ae82435fcd46c3fd2fce355af31bf65675be2ba | 8c6794b6/haskell-sc-scratch | Respond.hs | # LANGUAGE NoMonomorphismRestriction #
{-# LANGUAGE BangPatterns #-}
|
Module : $ Header$
License : : unstable
Portability : portable
Sequential OSC message sending without Control . Concurrent.threadDelay .
Module : $Header$
License : BSD3
Stability : unstable
Portability : port... | null | https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/Scratch/Conc/Respond.hs | haskell | # LANGUAGE BangPatterns #
hiding (Ppar(..))
after 'withSC3'.
| Silent UGen with done action.
| Wait until specified message has been returned from server.
sNew :: Transport t
^ Add action for s_new message
-> Int
-- ^ Node id of add target
-> String
^ name
-> [(String,R Double)]
^ name and patter... | # LANGUAGE NoMonomorphismRestriction #
|
Module : $ Header$
License : : unstable
Portability : portable
Sequential OSC message sending without Control . Concurrent.threadDelay .
Module : $Header$
License : BSD3
Stability : unstable
Portability : portable
Sequential OSC message s... |
4724ddd2f4139d4bebb082b00ec91680144c522040579ad67c7b1482bef1cdbf | ivarref/yoltq | error_poller.clj | (ns com.github.ivarref.yoltq.error-poller
(:require [clojure.tools.logging :as log]
[com.github.ivarref.yoltq.ext-sys :as ext]
[com.github.ivarref.yoltq.utils :as u]
[datomic.api :as d]))
(defn get-state [v]
(case v
[:error :none] :recovery
[:error :some] :error
[:e... | null | https://raw.githubusercontent.com/ivarref/yoltq/812a07b3b9f2d212f80499433b638fb5b4a78f70/src/com/github/ivarref/yoltq/error_poller.clj | clojure | (ns com.github.ivarref.yoltq.error-poller
(:require [clojure.tools.logging :as log]
[com.github.ivarref.yoltq.ext-sys :as ext]
[com.github.ivarref.yoltq.utils :as u]
[datomic.api :as d]))
(defn get-state [v]
(case v
[:error :none] :recovery
[:error :some] :error
[:e... | |
19ca10cdd7ef932f568630799096878455817c214db28c17c7574db33e9c3af1 | neilprosser/mr-maestro | block_devices_test.clj | (ns maestro.block-devices-test
(:require [maestro.block-devices :refer :all]
[midje.sweet :refer :all]))
(fact "that creating an EBS volume using nil gives sensible defaults"
(ebs-volume nil) => {:ebs {:volume-size 10
:volume-type "standard"}})
(fact "that we can o... | null | https://raw.githubusercontent.com/neilprosser/mr-maestro/469790fd712262016729c1d83d4b4e11869237a2/test/maestro/block_devices_test.clj | clojure | (ns maestro.block-devices-test
(:require [maestro.block-devices :refer :all]
[midje.sweet :refer :all]))
(fact "that creating an EBS volume using nil gives sensible defaults"
(ebs-volume nil) => {:ebs {:volume-size 10
:volume-type "standard"}})
(fact "that we can o... | |
f574649bd5f03bb5237abedfddd6591bbec7184a793575c08b5f30755100ccb7 | Holmusk/three-layer | Prelude.hs | module Prelude
( module Relude
) where
import Relude
| null | https://raw.githubusercontent.com/Holmusk/three-layer/1b58ec102f206681b66a584ca4a7d18f2eb4ef81/fix-point/src/Prelude.hs | haskell | module Prelude
( module Relude
) where
import Relude
| |
993682991fc2c8c2f7eb8d28b3135e52c346c60a42e4bef93e3834ba8d23b1b7 | casperschipper/ocaml-cisp | cisp2.ml | open Cisp
open Midi
let ofOpt optEvt = match optEvt with Some evt -> evt | None -> SilenceEvent
type direction =
Up
| Down
type posInt =
Posi of int
let positive x =
if x == Int.min_int then Posi 0 else
Posi (abs x)
let sortArgs x y =
if x > y then
(y,x)
else
(x,y)
let sortArgsBy f x y =... | null | https://raw.githubusercontent.com/casperschipper/ocaml-cisp/571ffb8e508c5427d01e407ba5e91ff2a4604f40/examples/cisp_backup/zimmermanzel/cisp2.ml | ocaml | type walkmind direction is state
a walk that updates boundaries only when hit | open Cisp
open Midi
let ofOpt optEvt = match optEvt with Some evt -> evt | None -> SilenceEvent
type direction =
Up
| Down
type posInt =
Posi of int
let positive x =
if x == Int.min_int then Posi 0 else
Posi (abs x)
let sortArgs x y =
if x > y then
(y,x)
else
(x,y)
let sortArgsBy f x y =... |
b3de556ad89a7bf5fccbba04199963e3356118b5b092574af32cede7b0f3a7cf | steshaw/PLAR | paramodulation.ml | (* ========================================================================= *)
Paramodulation .
(* *)
Copyright ( c ) 2003 - 2007 , . ( See " LICENSE.txt " for details . )
(* ===... | null | https://raw.githubusercontent.com/steshaw/PLAR/c143b097d1028963f4c1d24f45a1a56c8b65b838/paramodulation.ml | ocaml | =========================================================================
=========================================================================
-------------------------------------------------------------------------
Find paramodula... | Paramodulation .
Copyright ( c ) 2003 - 2007 , . ( See " LICENSE.txt " for details . )
let rec overlapl (l,r) fm rfn =
match fm with
Atom(R(f,args)) -> listcases (overlaps (l,r))
(fun i a -> rfn i (Atom(R(f,a)))) ar... |
376b281edbd502de8d82e04866d67134bf51b8879e9f14a85fd659bb41622695 | pfeodrippe/pitoco | api_schema.clj | (ns pitoco.api-schema)
| null | https://raw.githubusercontent.com/pfeodrippe/pitoco/14ae5afd012e699e88c6f186c864cfb4722defc8/src/pitoco/api_schema.clj | clojure | (ns pitoco.api-schema)
| |
176093aa4acb32bdbf7ef6f9874a41f46f52340bba069994052a23cbd0e76316 | LexiFi/dead_code_analyzer | foo.ml | let f ?(a = 0) ?(b = 0) () = a + b
let x = f ~b:30 ()
let y = f ~b:40 ()
| null | https://raw.githubusercontent.com/LexiFi/dead_code_analyzer/c44dc2ea5ccb13df2145e9316e21c39f09dad506/examples/foo.ml | ocaml | let f ?(a = 0) ?(b = 0) () = a + b
let x = f ~b:30 ()
let y = f ~b:40 ()
| |
fe7f8d228052fc36bf9bf95b7afb6592c37daef3e67cf08bb56220e12c24fa69 | erlangonrails/devdb | yaws_ls.erl | %%%----------------------------------------------------------------------
%%% File : yaws_ls.erl
Author : < >
%%% Purpose :
Created : 5 Feb 2002 by < >
Modified : 13 Jan 2004 by < >
Modified : Jan 2006 by < >
%%%----------------------------------------------------------------------
-mod... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/scalaris/contrib/yaws/src/yaws_ls.erl | erlang | ----------------------------------------------------------------------
File : yaws_ls.erl
Purpose :
----------------------------------------------------------------------
if DoAllGZip == true -> alltgz() end,
yaws:address(),
name
last modified
size
Description ... | Author : < >
Created : 5 Feb 2002 by < >
Modified : 13 Jan 2004 by < >
Modified : Jan 2006 by < >
-module(yaws_ls).
-author('').
-include("../include/yaws.hrl").
-include("../include/yaws_api.hrl").
-include("yaws_debug.hrl").
-include_lib("kernel/include/file.hrl").
-export([list_directo... |
a48e01e6ed497ccd375f63808f952faf85114d5677298a17605060495fb3b24d | ocaml-multicore/tezos | apply.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
(* ... | null | https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_012_Psithaca/lib_protocol/apply.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
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
LIABILITY , WHETH... |
3cf08bcdbb1b7ccaad0a74959547d79b81949fe56e7f2219308ef47a09451377 | CLowcay/hgbc | Memory.hs | {-# LANGUAGE OverloadedStrings #-}
module HGBC.Debugger.Memory
( backtrace,
stackAt,
memoryAt,
)
where
import Control.Monad.Reader (ReaderT (runReaderT))
import qualified Data.Aeson.Encoding as JSON
import qualified Data.ByteString as B
import qualified Data.ByteString.Builder as BB
import qualified Data.... | null | https://raw.githubusercontent.com/CLowcay/hgbc/76a8cf91f3c3b160eadf019bc8fc75ef07601c2f/main/src/HGBC/Debugger/Memory.hs | haskell | # LANGUAGE OverloadedStrings # |
module HGBC.Debugger.Memory
( backtrace,
stackAt,
memoryAt,
)
where
import Control.Monad.Reader (ReaderT (runReaderT))
import qualified Data.Aeson.Encoding as JSON
import qualified Data.ByteString as B
import qualified Data.ByteString.Builder as BB
import qualified Data.ByteString.Lazy.Char8 as LBC
import... |
ee2f515858553de8bb24aa444e354684b7e4dd8f73b11388662218e76b16e8f4 | skrah/minicaml | Types.ml |
* Copyright ( c ) 2015 . All rights reserved .
*
* This file is distributed under the terms of the Q Public License
* version 1.0 .
* Copyright (c) 2015 Stefan Krah. All rights reserved.
*
* This file is distributed under the terms of the Q Public License
* version 1.0.
*)
open Shared
open Symbol... | null | https://raw.githubusercontent.com/skrah/minicaml/e5f5cad7fdbcfc11561f717042fae73fa743823f/Types.ml | ocaml | ********************************************************************
Types
********************************************************************
********************************************************************
Initialize primitive typ... |
* Copyright ( c ) 2015 . All rights reserved .
*
* This file is distributed under the terms of the Q Public License
* version 1.0 .
* Copyright (c) 2015 Stefan Krah. All rights reserved.
*
* This file is distributed under the terms of the Q Public License
* version 1.0.
*)
open Shared
open Symbol... |
cb95cd2a9842afa60f9c67aad74c7562265fcdb98153729a8e3deca611b621af | YoungTurks/hackerdict | mock_data.cljc | (ns hackerdict.mock-data)
(def mock-side-bar-data
[
{:text "clojure" :n-entries-today 5 :n-entries-total 10}
{:text "compojure" :n-entries-today 5 :n-entries-total 10}
{:text "ring" :n-entries-today 5 :n-entries-total 10}
{:text "selmer" :n-entries-today 5 :n-entries-total 10}
{:text "luminus" :n-en... | null | https://raw.githubusercontent.com/YoungTurks/hackerdict/44e5c285b3195718c4d5bc9cb4423623f22d3da3/src/hackerdict/mock_data.cljc | clojure | (ns hackerdict.mock-data)
(def mock-side-bar-data
[
{:text "clojure" :n-entries-today 5 :n-entries-total 10}
{:text "compojure" :n-entries-today 5 :n-entries-total 10}
{:text "ring" :n-entries-today 5 :n-entries-total 10}
{:text "selmer" :n-entries-today 5 :n-entries-total 10}
{:text "luminus" :n-en... | |
b841e6bf6e0d8c9575cdb2d3c3b7d818c99922bb434446403fb3c0957b229df0 | dimitri/pgloader | copy-rows-in-batch.lisp | ;;;
;;; The PostgreSQL COPY TO implementation, with batches and retries.
;;;
(in-package :pgloader.pgcopy)
(defun batch-rows-to-copy (table columns copy nbcols queue)
"Add rows that we pop from QUEUE into a batch, that we then COPY over to
PostgreSQL as soon as the batch is full. This allows sophisticated error
... | null | https://raw.githubusercontent.com/dimitri/pgloader/3047c9afe141763e9e7ec05b7f2a6aa97cf06801/src/pg-copy/copy-rows-in-batch.lisp | lisp |
The PostgreSQL COPY TO implementation, with batches and retries.
the last batch might not be empty
protocol to PostgreSQL to be able to process them again in case
of a data error being signaled, that's the BATCH here.
We can't use with-pgsql-transaction here because of the specifics
of error handling in case of... | (in-package :pgloader.pgcopy)
(defun batch-rows-to-copy (table columns copy nbcols queue)
"Add rows that we pop from QUEUE into a batch, that we then COPY over to
PostgreSQL as soon as the batch is full. This allows sophisticated error
handling and recovery, where we can retry rows that are not rejected by
... |
5f86bd7da64caa49f8bd875c721c31448f07428db1fa2dcfc56a2360859d8596 | Cumulus/Syndic | syndic_date.ml | open Printf
open Scanf
type t = Ptime.t
let epoch = Ptime.epoch
let compare = Ptime.compare
let max d1 d2 = if compare d1 d2 < 0 then d2 else d1
let min d1 d2 = if compare d1 d2 < 0 then d1 else d2
let month_to_int = Hashtbl.create 12
let () =
let add m i = Hashtbl.add month_to_int m i in
add "Jan" 1 ;
add "Fe... | null | https://raw.githubusercontent.com/Cumulus/Syndic/7a70e3062e42f9ee0ec77f282e1924736b0dff2a/lib/syndic_date.ml | ocaml | FIXME: this should be made more robust.
RFC3339 date
Convenience functions | open Printf
open Scanf
type t = Ptime.t
let epoch = Ptime.epoch
let compare = Ptime.compare
let max d1 d2 = if compare d1 d2 < 0 then d2 else d1
let min d1 d2 = if compare d1 d2 < 0 then d1 else d2
let month_to_int = Hashtbl.create 12
let () =
let add m i = Hashtbl.add month_to_int m i in
add "Jan" 1 ;
add "Fe... |
eca9b8ba612fc454e715c61887234e2dad2f2c0b367e55a835160a2bb3e3c494 | TGOlson/blockchain | HLint.hs | module HLint.HLint where
import "hint" HLint.Builtin.All
import "hint" HLint.Default
import "hint" HLint.Generalise
-- Better for haddock
ignore "Use import/export shortcut"
| null | https://raw.githubusercontent.com/TGOlson/blockchain/da53ad888589b5a2f3fd2c53c33a399fefb48ab1/HLint.hs | haskell | Better for haddock | module HLint.HLint where
import "hint" HLint.Builtin.All
import "hint" HLint.Default
import "hint" HLint.Generalise
ignore "Use import/export shortcut"
|
3573aa87cba2dda7048a5dafcdc0a703e754f3990d4ce892b49428a5a0159046 | stchang/macrotypes | main.rkt | #lang racket/base
(require turnstile/main)
(provide (all-from-out turnstile/main))
| null | https://raw.githubusercontent.com/stchang/macrotypes/05ec31f2e1fe0ddd653211e041e06c6c8071ffa6/turnstile-lib/turnstile%2B/main.rkt | racket | #lang racket/base
(require turnstile/main)
(provide (all-from-out turnstile/main))
| |
dec57f7412c8b54b4d02ea110b242f6f8e392fdd77394ee652d12237b4dc1e6d | basho/yokozuna | yz_errors.erl | %% @doc Ensure that error messages return as expected
-module(yz_errors).
-compile(export_all).
-import(yz_rt, [host_entries/1,
search_expect/5]).
-include("yokozuna.hrl").
-include_lib("eunit/include/eunit.hrl").
-define(NO_HEADERS, []).
-define(CFG,
[{riak_core,
[
{handof... | null | https://raw.githubusercontent.com/basho/yokozuna/e15fe64f9ef9318c0cc21754f3dfdd073d2dc77d/riak_test/yz_errors.erl | erlang | @doc Ensure that error messages return as expected
Sleep for soft commit
Sleep for soft commit
send a bad query | -module(yz_errors).
-compile(export_all).
-import(yz_rt, [host_entries/1,
search_expect/5]).
-include("yokozuna.hrl").
-include_lib("eunit/include/eunit.hrl").
-define(NO_HEADERS, []).
-define(CFG,
[{riak_core,
[
{handoff_concurrency, 16},
{inactivity_timeout, 10... |
308c0ba05643c243983928331cb713fa1729ef5377029f2370d399f50bf13d0a | masatoi/cl-zerodl | network.lisp | (defpackage #:cl-zerodl/core/network
(:use #:cl
#:mgl-mat
#:cl-zerodl/core/layer)
(:nicknames :zerodl.network)
(:import-from #:cl-zerodl/core/utils
#:define-class)
(:import-from #:cl-zerodl/core/initializer
#:initializer
#:he-initializer
... | null | https://raw.githubusercontent.com/masatoi/cl-zerodl/5c453321b41f07610cdee248792499b5b742f550/core/network.lisp | lisp | Network slots
Learning interfaces
Calculate gradient
forward
backward
;; weight-decay
(do-layer (layer network affine-layer)
)
Set/Reset mini-batch
Training
Predict class, Accuracy for dataset | (defpackage #:cl-zerodl/core/network
(:use #:cl
#:mgl-mat
#:cl-zerodl/core/layer)
(:nicknames :zerodl.network)
(:import-from #:cl-zerodl/core/utils
#:define-class)
(:import-from #:cl-zerodl/core/initializer
#:initializer
#:he-initializer
... |
f404de7e5749652414b173246a8d88e6c0dc65f8a8764f8a8e2bcc54c718b59b | apwheele/ResearchDesign | Intro_SPSS.sps | * Encoding: UTF-8.
*This code snippet shows how to create a reproducible data analysis in SPSS.
*Comments in SPSS start with an asterisk and need to end with a period.
*Clearing any prior SPSS datasets and output windows that are open.
DATASET CLOSE ALL.
OUTPUT CLOSE ALL.
*path where data is located.
FILE HANDLE data... | null | https://raw.githubusercontent.com/apwheele/ResearchDesign/b2071e749edf042276010d66b837755c8c7f5f64/Week02_PresentingResearch/Intro_SPSS.sps | scheme | * Encoding: UTF-8.
*This code snippet shows how to create a reproducible data analysis in SPSS.
*Comments in SPSS start with an asterisk and need to end with a period.
*Clearing any prior SPSS datasets and output windows that are open.
DATASET CLOSE ALL.
OUTPUT CLOSE ALL.
*path where data is located.
FILE HANDLE data... | |
b73ffdbacc2a3ad7eec4128fe807675b808081c2f309bfd3a1c2979897e30fef | bishboria/learnyouahaskell | 5_higher_order_function.hs | -- Can't run this file
-- currying
max 4 5
(max 4) 5
:t max
max :: Ord a => a -> a -> a
-- could be written as
max :: Ord a => a -> (a -> a)
multThree :: Int -> Int -> Int -> Int
multThree x y z = x * y * z
multTwoWithNine = multThree 9
multTwoWithNine 2 3
compareWithHundred :: Int -> Ordering
compareWithHundred ... | null | https://raw.githubusercontent.com/bishboria/learnyouahaskell/d8c7b41398e9672db18c1b1360372fc4a4adefa8/05/5_higher_order_function.hs | haskell | Can't run this file
currying
could be written as
which is equivalent to
Sections
higher orderism
examples
examples
examples
examples
equivalent to -- I prefer comprehension here.
lambdas
equivalent
better
more readable
is equivalent to
folding
or
defining map with foldr
or with foldl
++ is slower t... |
max 4 5
(max 4) 5
:t max
max :: Ord a => a -> a -> a
max :: Ord a => a -> (a -> a)
multThree :: Int -> Int -> Int -> Int
multThree x y z = x * y * z
multTwoWithNine = multThree 9
multTwoWithNine 2 3
compareWithHundred :: Int -> Ordering
compareWithHundred x = compare 100 x
compareWithHundred' :: Int -> Ordering
c... |
572bbd43a4f1d9ec03b7dca570547d2eaca8b337e4c8d331590278afca3805ae | eponai/sulolive | auth.clj | (ns eponai.server.auth
(:require
[buddy.auth]
[buddy.auth.accessrules :as buddy]
[buddy.auth.backends :as backends]
[buddy.auth.middleware :refer [wrap-authentication wrap-authorization]]
[buddy.auth.protocols :as auth.protocols]
[manifold.deferred :as deferred]
[environ.core :refer [env]]... | null | https://raw.githubusercontent.com/eponai/sulolive/7a70701bbd3df6bbb92682679dcedb53f8822c18/src/eponai/server/auth.clj | clojure | Move this to location.clj?
Routing to :landing-page instead of :landing-page/location
because this will be an entire page reload, so it'll take
(when auth0-user
(let [db-user (db/lookup-entity (db/db conn) [:user/email (:email auth0-user)])]
(when-not db-user
Throw it so we can handle it in our wrapper
... | (ns eponai.server.auth
(:require
[buddy.auth]
[buddy.auth.accessrules :as buddy]
[buddy.auth.backends :as backends]
[buddy.auth.middleware :refer [wrap-authentication wrap-authorization]]
[buddy.auth.protocols :as auth.protocols]
[manifold.deferred :as deferred]
[environ.core :refer [env]]... |
8699479cb41dcecf2169636db25e65303e1d76f1a87f5fae41ec8f06d6dd27a1 | wireless-net/erlang-nommu | xmerl_b64Bin.erl | -module(xmerl_b64Bin).
-export([parse/1, parse_and_scan/1, format_error/1]).
-file("/net/isildur/ldisk/daily_build/17_prebuild_master-opu_o.2014-04-07_20/otp_src_17/bootstrap/lib/parsetools/include/yeccpre.hrl", 0).
%%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2013 . All Rights Reserved .
%%
The contents... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/xmerl/src/xmerl_b64Bin.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 limitatio... | -module(xmerl_b64Bin).
-export([parse/1, parse_and_scan/1, format_error/1]).
-file("/net/isildur/ldisk/daily_build/17_prebuild_master-opu_o.2014-04-07_20/otp_src_17/bootstrap/lib/parsetools/include/yeccpre.hrl", 0).
Copyright Ericsson AB 1996 - 2013 . All Rights Reserved .
The contents of this file are subject to ... |
4799cf9fe32cc6ed995c0e2fabc8f48856757c06dc51e7359f859bcab7bda3f4 | nyu-acsys/drift | printer.ml | open Syntax
open AbstractDomain
open SemanticDomain
open SemanticsDomain
open SensitiveDomain
open SenSemantics
(** Pretty printing *)
let pr_relation ppf = function
| Bool (vt, vf) -> Format.fprintf ppf "@[<1>{@ cur_v:@ Bool@ |@ TRUE:@ %a,@ FALSE:@ %a@ }@]" AbstractValue.print_abs vt AbstractValue.print_abs vf
|... | null | https://raw.githubusercontent.com/nyu-acsys/drift/51a3160d74b761626180da4f7dd0bb950cfe40c0/src/utils/printer.ml | ocaml | * Pretty printing | open Syntax
open AbstractDomain
open SemanticDomain
open SemanticsDomain
open SensitiveDomain
open SenSemantics
let pr_relation ppf = function
| Bool (vt, vf) -> Format.fprintf ppf "@[<1>{@ cur_v:@ Bool@ |@ TRUE:@ %a,@ FALSE:@ %a@ }@]" AbstractValue.print_abs vt AbstractValue.print_abs vf
| Int v -> Format.fprint... |
dc7a77008dbb17daffa3510d28c16fe39e8d33b43184a6e8f076202cb3f80b50 | heraldry/heraldicon | element_test.cljs | (ns spec.heraldicon.entity.collection.element-test
(:require
[cljs.test :refer-macros [are deftest]]
[spec.heraldicon.specs]
[spec.heraldicon.test-util :as tu]))
(deftest valid-collection-element
(are [form] (tu/valid? :heraldicon.entity.collection/element form)
{:type :heraldicon.entity.collection/el... | null | https://raw.githubusercontent.com/heraldry/heraldicon/19c9d10485bbc48e98ddee30092a246cccc986d2/test/spec/heraldicon/entity/collection/element_test.cljs | clojure | (ns spec.heraldicon.entity.collection.element-test
(:require
[cljs.test :refer-macros [are deftest]]
[spec.heraldicon.specs]
[spec.heraldicon.test-util :as tu]))
(deftest valid-collection-element
(are [form] (tu/valid? :heraldicon.entity.collection/element form)
{:type :heraldicon.entity.collection/el... | |
92320b1236f4080e2684fe57a3a7f843b06eece753652d5c1b7de0766a64f99e | ndmitchell/neil | Talk.hs |
module Paper.Talk(talk) where
import Control.Monad
import Data.List.Extra
import Data.Char
import Data.Maybe
import Paper.Util.CmdNumber
import Paper.Util.String
import System.FilePath
import System.Process
import System.Directory
talk :: FilePath -> [FilePath] -> [String] -> IO ()
talk objDir files args = do
r... | null | https://raw.githubusercontent.com/ndmitchell/neil/b06624fe697c23375222856d538cb974e96da048/src/Paper/Talk.hs | haskell | -------------------------------------------------------------------
TEXT PROCESSING BIT
read a file and split it into text chunks
compress \n\n\n -> \n
" " -> " "
" \n" -> "\n"
change some constructs to insert pauses
Given an environment there are several behaviours:
replace the entire enviro... |
module Paper.Talk(talk) where
import Control.Monad
import Data.List.Extra
import Data.Char
import Data.Maybe
import Paper.Util.CmdNumber
import Paper.Util.String
import System.FilePath
import System.Process
import System.Directory
talk :: FilePath -> [FilePath] -> [String] -> IO ()
talk objDir files args = do
r... |
2bc78af199c3fc5c3c11dea043c1c9b1b4a07f2607fa532da845bb8453f9fe78 | aiju/lilith | LALR.mli | type t
type rule = {
lhs: Symbol.t;
rhs: Symbol.t list;
prec: (int * Dat.assoctype) option;
idx: int;
code: Dat.fragment list option
}
val startSym : Symbol.t
val endSym : Symbol.t
val create : rule list -> (Symbol.t, int * Dat.assoctype) Hashtbl.t -> Symbol.t -> t
val actions : t -> (int * Symbol.t, Dat.action... | null | https://raw.githubusercontent.com/aiju/lilith/56a34309abb016d75c7aa25937f9350f337287d7/serpent/LALR.mli | ocaml | type t
type rule = {
lhs: Symbol.t;
rhs: Symbol.t list;
prec: (int * Dat.assoctype) option;
idx: int;
code: Dat.fragment list option
}
val startSym : Symbol.t
val endSym : Symbol.t
val create : rule list -> (Symbol.t, int * Dat.assoctype) Hashtbl.t -> Symbol.t -> t
val actions : t -> (int * Symbol.t, Dat.action... | |
2b33452707b39d5af6155b70ee5549988a03d001de93dde37baadf17347263de | nikita-volkov/rebase | Error.hs | module Rebase.System.IO.Error
(
module System.IO.Error
)
where
import System.IO.Error
| null | https://raw.githubusercontent.com/nikita-volkov/rebase/7c77a0443e80bdffd4488a4239628177cac0761b/library/Rebase/System/IO/Error.hs | haskell | module Rebase.System.IO.Error
(
module System.IO.Error
)
where
import System.IO.Error
| |
437fd396204ecc3c5a6a49015a366480cac93221c88bee51c1fe15f059ce5f0b | luc-tielen/llvm-codegen | APISpec.hs | module Test.LLVM.C.APISpec
( module Test.LLVM.C.APISpec
) where
import Test.Hspec
import Foreign hiding (void)
import qualified LLVM.C.API as C
import LLVM.Codegen.Type
import LLVM.Codegen.Name
import LLVM.Codegen.Flag
NOTE : if it ca n't find libffi , you 're linking against wrong libLLVM !
-- Be sure to updat... | null | https://raw.githubusercontent.com/luc-tielen/llvm-codegen/a783cb933146d8f95282e7ec207e5510bc36e3ce/tests/Test/LLVM/C/APISpec.hs | haskell | Be sure to update Setup.hs LLVM version as well to be in sync!
padding!
padding!
NOTE: not allowed for function type => has no size, triggers undefined behavior. | module Test.LLVM.C.APISpec
( module Test.LLVM.C.APISpec
) where
import Test.Hspec
import Foreign hiding (void)
import qualified LLVM.C.API as C
import LLVM.Codegen.Type
import LLVM.Codegen.Name
import LLVM.Codegen.Flag
NOTE : if it ca n't find libffi , you 're linking against wrong libLLVM !
mkType :: ForeignP... |
d5c220a9c307295916777054d3e329f3248da7ef2ff89954905c8c89dff79e7e | robert-strandh/SICL | import-from-host.lisp | (cl:in-package #:sicl-boot-phase-2)
(defun import-from-host (boot)
(with-accessors ((e2 sicl-boot:e2))
boot
(let ((client (env:client e2)))
;; Import class T so that it can be found when we need to create
;; the class T as a specializer for unspecialized method parameters.
(setf (env:find... | null | https://raw.githubusercontent.com/robert-strandh/SICL/f01b8fff053b124a7756d317fda5a7a993aa169d/Code/Boot/Phase-2/import-from-host.lisp | lisp | Import class T so that it can be found when we need to create
the class T as a specializer for unspecialized method parameters.
Create classes in E2 that are potential metaclasses for the
these metaclasses are related by inheritance, so we just make
them all the same class, i.e. our special metaclass defined
abov... | (cl:in-package #:sicl-boot-phase-2)
(defun import-from-host (boot)
(with-accessors ((e2 sicl-boot:e2))
boot
(let ((client (env:client e2)))
(setf (env:find-class client e2 't)
(find-class 't))
classes we will create in phase 2 . It does n't matter much how
(setf (env:find-class ... |
0e410eb3f0c4408dc1ff910acb4f2e98b7cc9d91daf57b4ee9cf9f4691fa38f4 | chovencorp/erlangzmq | erlangzmq_lb.erl | @copyright 2016 Choven Corp.
%%
This file is part of erlangzmq .
%%
erlangzmq is free software : you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
%% (at your option) any later v... | null | https://raw.githubusercontent.com/chovencorp/erlangzmq/2be5c3b36dd78b010d1790a8f74ae2e823f5a424/src/erlangzmq_lb.erl | erlang |
(at your option) any later version.
erlangzmq 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 Affero General Public License for more details.
@doc ZeroMQ Simple Round-robin load-... | @copyright 2016 Choven Corp.
This file is part of erlangzmq .
erlangzmq is free software : you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of ... |
40aeb5a6d05c3764edf5d8d327a7874f68e8b28712573333b693a6bc3b6d6b28 | PrincetonUniversity/lucid | SolitaryMatches.ml | (*
Match statements with many branches are expensive
to place into shared tables during the layout phase.
This pass identifies match tables with many branches
and annotates them as "solitary," so that they
are placed in their own tables. *)
open TofinoCore
let is_simple_branch stmt =
let remove_noops ... | null | https://raw.githubusercontent.com/PrincetonUniversity/lucid/3a94505efa50e988b4c9ef28048be47cc65b4355/src/lib/backend/transformations/SolitaryMatches.ml | ocaml |
Match statements with many branches are expensive
to place into shared tables during the layout phase.
This pass identifies match tables with many branches
and annotates them as "solitary," so that they
are placed in their own tables. | open TofinoCore
let is_simple_branch stmt =
let remove_noops st = InterpHelpers.unfold_stmts st |> InterpHelpers.fold_stmts in
match ((remove_noops stmt).s) with
| SSeq(_)
| SMatch(_)
| SIf(_) -> false
| _ -> true
;;
let is_solitary bs =
let res = List.fold_left (fun acc (_, stmt) ->
((is_simpl... |
9e56525694f2d9cf7b6d1be872d3f4ca7f50eb0ced017ebb7a1c63135d38f810 | ujamjar/hardcaml | test_vpi.ml | open HardCaml
open Signal.Comb
open Signal.Seq
module I = interface
clock[1] reset[1] clear[1] enable a[2] b[2]
end
module O = interface
c[2] d[2]
end
let reg i enable d =
reg Signal.Types.{ r_full with
reg_clock = i.I.clock;
reg_reset = i.I.reset;
reg_clear = i.I.clear;
} enable d
let f i =
... | null | https://raw.githubusercontent.com/ujamjar/hardcaml/65f32f543348e81cbb7f6d0e77f1f1203bf4e335/test/test_vpi.ml | ocaml | open HardCaml
open Signal.Comb
open Signal.Seq
module I = interface
clock[1] reset[1] clear[1] enable a[2] b[2]
end
module O = interface
c[2] d[2]
end
let reg i enable d =
reg Signal.Types.{ r_full with
reg_clock = i.I.clock;
reg_reset = i.I.reset;
reg_clear = i.I.clear;
} enable d
let f i =
... | |
26d796603536cac09fadcaaf18c242aca68afc0c21826e3f6e0770e6a5a7e1b4 | avsm/melange | dnsquery.mli |
dnsquery.mli -- map DNS query - response mechanism onto trie database
Copyright ( c ) 2005 - 2006 < >
dnsquery.mli -- map DNS query-response mechanism onto trie database
Copyright (c) 2005-2006 Tim Deegan <>
*)
type query_answer = {
rcode : Dns.Dns.rcode_t;
aa : bool;
answer : (M... | null | https://raw.githubusercontent.com/avsm/melange/e92240e6dc8a440cafa91488a1fc367e2ba57de1/lib/dns/dnsquery.mli | ocaml |
dnsquery.mli -- map DNS query - response mechanism onto trie database
Copyright ( c ) 2005 - 2006 < >
dnsquery.mli -- map DNS query-response mechanism onto trie database
Copyright (c) 2005-2006 Tim Deegan <>
*)
type query_answer = {
rcode : Dns.Dns.rcode_t;
aa : bool;
answer : (M... | |
2fe140d285400f50fab48aaef75f0f8261e59baa1c5587cf15705e21ce96f82c | robrix/path | Doctest.hs | module Main
( main
) where
import System.Environment
import Test.DocTest
main :: IO ()
main = do
args <- getArgs
autogen <- fmap (<> "/build/doctest/autogen") <$> lookupEnv "HASKELL_DIST_DIR"
doctest (maybe id ((:) . ("-i" <>)) autogen ("-isrc" : "--fast" : if null args then ["src"] else args))
| null | https://raw.githubusercontent.com/robrix/path/4682978f63a9a5df40fa79635db30bb92ffe0dc8/test/Doctest.hs | haskell | module Main
( main
) where
import System.Environment
import Test.DocTest
main :: IO ()
main = do
args <- getArgs
autogen <- fmap (<> "/build/doctest/autogen") <$> lookupEnv "HASKELL_DIST_DIR"
doctest (maybe id ((:) . ("-i" <>)) autogen ("-isrc" : "--fast" : if null args then ["src"] else args))
| |
aa3f855fc3ed737906ed16f961b1aba536c83508c0dfbfb041b6aa07fa82a068 | egri-nagy/lambdago | sgf2latex.clj | (def DIR "FOLDER_TO_BE_SCANNED_FOR_SGFS")
(require '[clojure.java.io :as io :refer :all])
(require '[lgo.sgf :refer :all])
(def fs (.list (io/file DIR)))
(doseq [f (sort fs)]
(println "%" f)
(println (positionsgf->goban (slurp (str DIR f)))))
| null | https://raw.githubusercontent.com/egri-nagy/lambdago/58e714b5c8ff47743738e32ee2fadf4790e63591/scripts/sgf2latex.clj | clojure | (def DIR "FOLDER_TO_BE_SCANNED_FOR_SGFS")
(require '[clojure.java.io :as io :refer :all])
(require '[lgo.sgf :refer :all])
(def fs (.list (io/file DIR)))
(doseq [f (sort fs)]
(println "%" f)
(println (positionsgf->goban (slurp (str DIR f)))))
| |
9dca34f99a6e6e68c3355cde38bc2730339fc5d047af4acde8a6672eac3217e8 | dbuenzli/remat | fineReader.ml | ---------------------------------------------------------------------------
Copyright 2012 . All rights reserved .
Distributed under the BSD3 license , see license at the end of the file .
% % NAME%% release % % ---------------------------------------------------------------------------
Copyright 201... | null | https://raw.githubusercontent.com/dbuenzli/remat/28d572e77bbd1ad46bbfde87c0ba8bd0ab99ed28/src-remat/fineReader.ml | ocaml | Parsing element attributes
Parsing elements.
Formatter tools
Fine reader elements and attributes.
Attributes common to many tags
charParams element
formatting element
line element
par element
text element
cell element
row element
rect element
region element
block element
no data ?
page ... | ---------------------------------------------------------------------------
Copyright 2012 . All rights reserved .
Distributed under the BSD3 license , see license at the end of the file .
% % NAME%% release % % ---------------------------------------------------------------------------
Copyright 201... |
b3a87f4031d2ca80df3b393249f88bf13879063718bfd2c3c55e14fc561209c3 | reach-sh/reach-lang | Core.hs | # OPTIONS_GHC -Wno - missing - export - lists #
module Reach.Simulator.Core where
import Control.Monad.Reader
import Data.Aeson
import Data.Bits
import qualified Data . ByteString . Char8 as BS
import qualified Data.Map.Strict as M
import Data.Maybe (fromMaybe)
import Data.Set (member)
import Data.List (partition)
im... | null | https://raw.githubusercontent.com/reach-sh/reach-lang/f79282c49705c66fc10489045d502d17621d60c5/hs/src/Reach/Simulator/Core.hs | haskell | XXX BS.ByteString
XXX BS.ByteString
events from Events are : [a] -> Null
XXX make an interact point with dr
A better implementation is to make it a choice or consult the table of apps | # OPTIONS_GHC -Wno - missing - export - lists #
module Reach.Simulator.Core where
import Control.Monad.Reader
import Data.Aeson
import Data.Bits
import qualified Data . ByteString . Char8 as BS
import qualified Data.Map.Strict as M
import Data.Maybe (fromMaybe)
import Data.Set (member)
import Data.List (partition)
im... |
39f874f67a3302f1074c3c0398583c8c39519117e6a41df56d5f836224415cd9 | fpottier/stores | Univ.ml | (* Our universal type is an extensible algebraic data type. *)
type univ =
..
(* [make] is implemented by generating a fresh data constructor [Tag].
The functions [project] and [inject] respectively apply [Tag] and
match against [Tag]. *)
let make (type a) () : (a -> univ) * (univ -> a option) =
let modul... | null | https://raw.githubusercontent.com/fpottier/stores/0752321be1ba6c355a7008ebb210bbd91a77e001/src/Univ.ml | ocaml | Our universal type is an extensible algebraic data type.
[make] is implemented by generating a fresh data constructor [Tag].
The functions [project] and [inject] respectively apply [Tag] and
match against [Tag]. |
type univ =
..
let make (type a) () : (a -> univ) * (univ -> a option) =
let module T = struct
type univ += Tag of a
let inject (x : a) : univ =
Tag x
let project (u : univ) : a option =
match u with
| Tag x ->
Some x
| _ ->
None
end in
T.inject, T.project
|
4101aece8fa29dcecb60b8401e241ded1385b286ed91b6a813bec7c3f85ba742 | spawnfest/eep49ers | win32reg.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1997 - 2016 . 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 applic... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/stdlib/src/win32reg.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 l... | Copyright Ericsson AB 1997 - 2016 . 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(win32reg).
-export([open/1, close/1,
current_key/1, change_key/2, change_key_create/2,
sub_keys/1, delet... |
e07859e991f3fb327c24d174e3a0cfc30d80041229c9174e3b45cf8a97620ad2 | unisonweb/unison | ANF.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE PatternGuards #
module Unison.Test.ANF where
import Control.Monad.Reader (ReaderT (..))
import Control.Monad.State (evalState)
import qualified Data.Map as Map
import qualified Data.Set as Set
import Data.Word (Word64)
import EasyTest
import qualified Unison.ABT as ABT
import ... | null | https://raw.githubusercontent.com/unisonweb/unison/cf278f9fb66ccb9436bf8a2eb4ab03fc7a92021d/parser-typechecker/tests/Unison/Test/ANF.hs | haskell | # LANGUAGE BangPatterns #
testSNF s = ok
where
t0 = tm s
snf = toSuperNormal (const 0) t0
= Term.match () (denormalize b) $ denormalizeHandler h | # LANGUAGE PatternGuards #
module Unison.Test.ANF where
import Control.Monad.Reader (ReaderT (..))
import Control.Monad.State (evalState)
import qualified Data.Map as Map
import qualified Data.Set as Set
import Data.Word (Word64)
import EasyTest
import qualified Unison.ABT as ABT
import Unison.ABT.Normalized (Term (T... |
a4785a78b9211da028fc591006936d72c0745858bb6f5cf43b4b714573364c6a | facebookarchive/pfff | graph_code_includes.mli |
val build:
?verbose:bool -> Common.dirname -> Common.filename list -> Graph_code.graph
| null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/lang_cpp/analyze/graph_code_includes.mli | ocaml |
val build:
?verbose:bool -> Common.dirname -> Common.filename list -> Graph_code.graph
| |
bf07ffb61b52c34bb695672af2201552661a9bed8531fb40f8336580e04ecc7c | startalkIM/ejabberd | luerl_lib_math.erl | Copyright ( c ) 2013
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
distributed under ... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/deps/luerl/src/luerl_lib_math.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright ( c ) 2013
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
Author :
Purpose : The math library for Luerl .
-module(luerl_lib_math).
-export([install/1,fmod/2,frexp/2]).
install(St) ->
luerl_emul... |
abd18cb1c488aa9e4bb0beedce7b21a0dae9e5c2a6c290ff2b0282ca8123c389 | crategus/cl-cffi-gtk | event-box.lisp | Example Event Box ( 2021 - 6 - 11 )
;;;;
Example Event Box demonstrates both uses of a GtkEventBox widget - a label
;;;; is created that is clipped to a small box, and set up so that a mouse-click
;;;; on the label causes the program to exit. Resizing the window reveals
;;;; varying amounts of the label.
;;;;
;;;; ... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/b613a266a5f8e7f477b66a33d4df84fbed3dc7bc/demo/gtk-example/event-box.lisp | lisp |
is created that is clipped to a small box, and set up so that a mouse-click
on the label causes the program to exit. Resizing the window reveals
varying amounts of the label.
In addition, example Event Box shows how to change the cursor over a
be get with the function gtk-widget-window. The function gdk-window-c... | Example Event Box ( 2021 - 6 - 11 )
Example Event Box demonstrates both uses of a GtkEventBox widget - a label
window . Every widget has an associated window of type GdkWindow , which can
sets a cursor for this GdkWindow . A new cursor is created with the function
gdk - cursor - new - from - name . The functi... |
79c70835fb6cf390bc57a57f5e4c45541931559560dbf4e3aab2a1abd164fdcb | racket/htdp | check-ordered.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 check-ordered) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-dec... | null | https://raw.githubusercontent.com/racket/htdp/aa78794fa1788358d6abd11dad54b3c9f4f5a80b/htdp-test/tests/test-engine/check-ordered.rkt | racket | about the language level of this file in a form that our tools can easily process.
this test should not be reported as failing:
OUCH :: expected to fail, get your work done | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname check-ordered) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
# lang htdp / bsl
1 . it passes
2 . it is f that is... |
11b06053ce97ebe5d71990e7bfdc0e7a5ae58e0c78564e61315730d3edc94dd8 | rjnw/sham | main.rkt | #lang racket
(require sham/sam/ast
sham/sam/rkt
sham/sam/transform
sham/ir
sham/jit
(prefix-in ll- sham/llvm/ir/simple)
syntax/parse/define
syntax/parse)
(define-ast arir
(expr
[add (es:expr ...)]
[sub (es:expr ...)]
[mul (es:expr ...)]
[div... | null | https://raw.githubusercontent.com/rjnw/sham/49260f397fdb8798b692179669eed9c15933888a/sham-examples/sham/arith/main.rkt | racket | #lang racket
(require sham/sam/ast
sham/sam/rkt
sham/sam/transform
sham/ir
sham/jit
(prefix-in ll- sham/llvm/ir/simple)
syntax/parse/define
syntax/parse)
(define-ast arir
(expr
[add (es:expr ...)]
[sub (es:expr ...)]
[mul (es:expr ...)]
[div... | |
7aafc593d872221939795acd74558c766f3cc1c098587c1f7e3ef10573c9d7fd | wireless-net/erlang-nommu | cprof_SUITE.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2002 - 2013 . 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 Publi... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/tools/test/cprof_SUITE.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 limitatio... | Copyright Ericsson AB 2002 - 2013 . 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(cprof_SUITE).
-export([basic_tes... |
a1eb7b8d573326f5837c6af16f1a91e5839147c58e08d23d6c3de92eb041451d | TristanCacqueray/haskell-butler | Main.hs | module Main where
import ButlerDemos (main)
main :: IO ()
main = ButlerDemos.main
| null | https://raw.githubusercontent.com/TristanCacqueray/haskell-butler/1b1946eb3bba621f458ae0e782d7bb706cad77fd/app/Main.hs | haskell | module Main where
import ButlerDemos (main)
main :: IO ()
main = ButlerDemos.main
| |
e322106d93e3b7d5030ef5d4fa0189b1f7a3615ade35972efe00de29b6007a84 | JoeKennedy/fantasy | Settings.hs | -- | Settings are centralized, as much as possible, into this file. This
-- includes database connection settings, static file locations, etc.
In addition , you can configure a number of different aspects of Yesod
by overriding methods in the Yesod typeclass . That instance is
declared in the Foundation.hs file .... | null | https://raw.githubusercontent.com/JoeKennedy/fantasy/eb9dc9bf6074be5c5ca951e323c6497676424dda/Settings.hs | haskell | | Settings are centralized, as much as possible, into this file. This
includes database connection settings, static file locations, etc.
| Runtime settings to configure this application. These settings can be
loaded from various sources: defaults, environment variables, config files,
theoretically even a database.... | In addition , you can configure a number of different aspects of Yesod
by overriding methods in the Yesod typeclass . That instance is
declared in the Foundation.hs file .
module Settings where
import ClassyPrelude.Yesod
import qualified Control.Exception as CE (throw)
import Data.Aeson (Result ... |
b5cb4a15e99d6c4a12ed618e777ecf4264b9e624f7297aab03388108c6c3487b | thorinii/hsraytrace | Vector.hs | {-# LANGUAGE BangPatterns #-}
module Vector (
Vec3(Vec3),
x, y, z,
add, sub, div,
min, max,
squared_mag, mag,
scalarmult,
dot, cross,
normalize,
neg
) where
import Prelude hiding (div, min, max)
import qualified Prelude as P
-------------------------------------------------
-- 3d vector representati... | null | https://raw.githubusercontent.com/thorinii/hsraytrace/2d606aef4ba3be404a3a3a16753099fb7c6603e8/src/Vector.hs | haskell | # LANGUAGE BangPatterns #
-----------------------------------------------
3d vector representation and manipulation
you are looking in the direction of increasing Z. | module Vector (
Vec3(Vec3),
x, y, z,
add, sub, div,
min, max,
squared_mag, mag,
scalarmult,
dot, cross,
normalize,
neg
) where
import Prelude hiding (div, min, max)
import qualified Prelude as P
NB : We have a right handed coordinate system . If x increases to your right , and Y increases downw... |
5304ef0dfbf4f9e99df078065e9a4cb056de4c82bddc1accb007ee21d785d49f | mbenke/jnp3-haskell | activity.hs | {-# LANGUAGE OverloadedStrings #-}
import CodeWorld
program wykonuje IO i nie daje wartości
main :: Program
main = program
program = activityOf start handleEvent draw
start = (0,0)
draw (x,y) = translated x y (solidCircle 0.5) & coordinatePlane
handleEvent (KeyPress key) (x, y)
| key == "Right" = (x+1,y)
... | null | https://raw.githubusercontent.com/mbenke/jnp3-haskell/90c488f52908fec3f6ac020177de9f798927c63f/Code/activity.hs | haskell | # LANGUAGE OverloadedStrings # | import CodeWorld
program wykonuje IO i nie daje wartości
main :: Program
main = program
program = activityOf start handleEvent draw
start = (0,0)
draw (x,y) = translated x y (solidCircle 0.5) & coordinatePlane
handleEvent (KeyPress key) (x, y)
| key == "Right" = (x+1,y)
| key == "Up" = (x,y+1)
| ke... |
132fd4ea7c489693d41c101d44aa8c2d9b6c803f0c846b8ab113a36d6701bca4 | fjames86/fsocket | test4.lisp | Copyright ( c ) 2015 < >
This code is licensed under the MIT license .
;;; This file shows how to pass foreign poiters instead of Lisp octet vectors.
(defpackage #:fsocket.test4
(:use #:cl #:fsocket))
(in-package #:fsocket.test4)
(defstruct (handle (:constructor %make-handle))
ptr
count)
(defun alloc-... | null | https://raw.githubusercontent.com/fjames86/fsocket/faa315c05074b345a971cfd890074a11ece8389a/test/test4.lisp | lisp | This file shows how to pass foreign poiters instead of Lisp octet vectors. | Copyright ( c ) 2015 < >
This code is licensed under the MIT license .
(defpackage #:fsocket.test4
(:use #:cl #:fsocket))
(in-package #:fsocket.test4)
(defstruct (handle (:constructor %make-handle))
ptr
count)
(defun alloc-handle (count)
(%make-handle :ptr (cffi:foreign-alloc :uint8 :count count)
... |
ca78b0ea72a12843bd880700057e6d2b7555a7de274b5d02f054f4fffda6d117 | jbrisbin/rabbit_common | rabbit_basic.erl | The contents of this file are subject to the Mozilla Public License
%% Version 1.1 (the "License"); you may not use this file except in
%% compliance with the License. You may obtain a copy of the License
%% at /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITHOUT WARRANTY OF ... | null | https://raw.githubusercontent.com/jbrisbin/rabbit_common/80814606ae23cc820c74e443383e192cd69ec030/src/rabbit_basic.erl | erlang | Version 1.1 (the "License"); you may not use this file except in
compliance with the License. You may obtain a copy of the License
at /
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and
limitations under the License.
----------------... | The contents of this file are subject to the Mozilla Public License
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ .
The Initial Developer of the Original Code is GoPivotal , Inc.
Copyright ( c ) 2007 - 2016 Pivotal Software , Inc. All rights reserved .
... |
210b11f7b001b160062f4b0e627d9b10258a10729cd94082aa4ab8e592748d42 | plum-umd/fundamentals | snake-client.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-intermediate-reader.ss" "lang")((modname snake-client) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-... | null | https://raw.githubusercontent.com/plum-umd/fundamentals/eb01ac528d42855be53649991a17d19c025a97ad/0/www/code/snake-client.rkt | racket | about the language level of this file in a form that our tools can easily process.
Snake Client
main : Anything -> Game
Launches a game of "Snake" played at given tick rate
Data Definitions
A Bug is a (make-bug Dir Posn [Lo Posn])
A Food is a Posn
A Posn is a (make-posn Integer Integer)
- "left"
- "right"
-... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-reader.ss" "lang")((modname snake-client) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
(require 2htdp/universe)
(require 2htdp/image)
Exam... |
b3552a616b20c8055af839dcfe7d94115ff443d0547b6a15bd49cd52113ee347 | yesodweb/yesod | Korean.hs | {-# LANGUAGE OverloadedStrings #-}
module Yesod.Form.I18n.Korean where
import Yesod.Form.Types (FormMessage (..))
import Data.Monoid (mappend)
import Data.Text (Text)
koreanFormMessage :: FormMessage -> Text
koreanFormMessage (MsgInvalidInteger t) = "잘못된 정수입니다: " `Data.Monoid.mappend` t
koreanFormMessage (MsgInvalidN... | null | https://raw.githubusercontent.com/yesodweb/yesod/48d05fd6ab12ad440e1f2aa32684ed08b23f0613/yesod-form/Yesod/Form/I18n/Korean.hs | haskell | # LANGUAGE OverloadedStrings # | module Yesod.Form.I18n.Korean where
import Yesod.Form.Types (FormMessage (..))
import Data.Monoid (mappend)
import Data.Text (Text)
koreanFormMessage :: FormMessage -> Text
koreanFormMessage (MsgInvalidInteger t) = "잘못된 정수입니다: " `Data.Monoid.mappend` t
koreanFormMessage (MsgInvalidNumber t) = "잘못된 숫자입니다: " `mappend` ... |
5d96c55843c071b6188333087cecef8fe1cf124ecf19a489a18675eb9cedf9bb | quil-lang/qvm | mixed-state-qvm.lisp | ;;;; src/mixed-state-qvm.lisp
;;;;
Authors :
(in-package #:qvm)
This file implements a qvm that evolves pure and mixed states by
means of a DENSITY - MATRIX - STATE .
;;; General Overview
The MIXED - STATE - QVM is an implementation of a QVM that can evolve
either a pure or mix... | null | https://raw.githubusercontent.com/quil-lang/qvm/de95ead6e7df70a1f8e0212455a802bd0cef201c/src/mixed-state-qvm.lisp | lisp | src/mixed-state-qvm.lisp
General Overview
but provides more specialized functionality for methods like
superoperators for gate application. Additional superoperators can
XXX: Should we nix
the null option
here?
here we make sure that the STATE slot has a vector of the
right size (e.g. it was constructed by MA... | Authors :
(in-package #:qvm)
This file implements a qvm that evolves pure and mixed states by
means of a DENSITY - MATRIX - STATE .
The MIXED - STATE - QVM is an implementation of a QVM that can evolve
either a pure or mixed state using a DENSITY - MATRIX - STATE . The
MIXED ... |
5b3f8a473c17ccba902fce407566f727a0241462c7939d6c01efcaf35ee1d964 | keithfancher/tvmv | API.hs | module API
( defaultAPI,
searchSeasonById,
searchSeasonByName,
searchShowByName,
)
where
import API.TMDB (tmdbApiWrapper)
import Control.Monad.Except (MonadError, liftEither)
import Data.Text qualified as T
import Domain.API (APIKey, APIWrapper (..))
import Domain.Error (Error (..))
import Domain.Show ... | null | https://raw.githubusercontent.com/keithfancher/tvmv/62e500e5dbc981ae7baeea8e6608e0db3fea21ef/src/API.hs | haskell | Get season episode data using the show's unique ID directly. Doesn't
actually save on API calls, which is kind of funny, but ensures you're
getting exactly the match you want.
Given a show name, or a fragment of a name, get back a list of matches. | module API
( defaultAPI,
searchSeasonById,
searchSeasonByName,
searchShowByName,
)
where
import API.TMDB (tmdbApiWrapper)
import Control.Monad.Except (MonadError, liftEither)
import Data.Text qualified as T
import Domain.API (APIKey, APIWrapper (..))
import Domain.Error (Error (..))
import Domain.Show ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.