_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 |
|---|---|---|---|---|---|---|---|---|
37cdcab380f1020fca60c56e756ff867858cfedaf8dae3aca7a320197544f3a6 | pedestal/pedestal | project.clj | Copyright 2013 Relevance , Inc.
Copyright 2014 - 2022 Cognitect , Inc.
; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( )
; which can be found in the file epl-v10.html at the root of this distribution.
;
; By using this software in any fashion, you are agreeing ... | null | https://raw.githubusercontent.com/pedestal/pedestal/53bfe70143a22cdfd2f0d183023334a199c9e9a2/samples/jetty-web-sockets/project.clj | clojure | The use and distribution terms for this software are covered by the
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice, or any other, from this software. | Copyright 2013 Relevance , Inc.
Copyright 2014 - 2022 Cognitect , Inc.
Eclipse Public License 1.0 ( )
(defproject jetty-web-sockets "0.5.5"
:description "Sample of web sockets with Jetty"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure ... |
cc07739aba6202cb797398c249fa5f092c41c456d9b85e98ce06cbc3cfe54c5e | tweag/asterius | T7689.hs | # LANGUAGE BangPatterns , MagicHash #
module Main where
import Data.Bits (finiteBitSize)
import GHC.Exts
main :: IO ()
main = do
-- 0 is the annihilator of andI#
print (I# (maxI# `andI#` 0#) == 0)
print (I# (minI# `andI#` 0#) == 0)
print (I# (0# `andI#` maxI#) == 0)
print (I# (0# `andI#` minI#) ... | null | https://raw.githubusercontent.com/tweag/asterius/e7b823c87499656860f87b9b468eb0567add1de8/asterius/test/ghc-testsuite/primops/T7689.hs | haskell | 0 is the annihilator of andI#
0 is the neutral element of orI#
this time we should get an integer with all bits set, that is -1
magic int numbers are bitwise complementary
0 is the identity of xor
anything xored with itself is 0
give an int with all bits set, and that is -1 as you probably already
remember by n... | # LANGUAGE BangPatterns , MagicHash #
module Main where
import Data.Bits (finiteBitSize)
import GHC.Exts
main :: IO ()
main = do
print (I# (maxI# `andI#` 0#) == 0)
print (I# (minI# `andI#` 0#) == 0)
print (I# (0# `andI#` maxI#) == 0)
print (I# (0# `andI#` minI#) == 0)
print (I# (0# `andI#` ... |
91bdb1380bdf04a7f3d1cbe04ad9468622b39dedaa1adf5b3cf4b654f229b867 | coq/coq | common.ml | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/144e89582473a9ee0ce0a3d5b3c3df3350cef817/tools/coqdoc/common.ml | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
b48a3e588e00b791eb0c63c9c1fddb6e58793fba19bb7758db6cd3986aa24ed0 | pallet/pallet | debian_backports.clj | (ns pallet.crate.package.debian-backports
"Actions for working with the debian backports repository"
(:require
[pallet.action :refer [with-action-options]]
[pallet.actions :refer [package-source package repository]]
[pallet.crate :refer [defplan]]
[pallet.script.lib :as lib]
[pallet.stevedore :as ste... | null | https://raw.githubusercontent.com/pallet/pallet/30226008d243c1072dcfa1f27150173d6d71c36d/src/pallet/crate/package/debian_backports.clj | clojure | (ns pallet.crate.package.debian-backports
"Actions for working with the debian backports repository"
(:require
[pallet.action :refer [with-action-options]]
[pallet.actions :refer [package-source package repository]]
[pallet.crate :refer [defplan]]
[pallet.script.lib :as lib]
[pallet.stevedore :as ste... | |
0a11ec4dbe1474f1b0d7774ab1dd186c107187d8fd3d3f5a760121f11350176c | ajchemist/rum-mdl | layout.cljc | (ns rum.mdl.examples.layout
(:require
[rum.core :as rum]
[rum.mdl :as mdl]
[rum.mdl.demo :as demo]))
(rum/defc grid []
[:.demo.grid
(mdl/grid
(mdl/cell {:mdl [:1]} "1")
(mdl/cell {:mdl [:1]} "1")
(mdl/cell {:mdl [:1]} "1")
(mdl/cell {:mdl [:1]} "1")
(mdl/cell {:mdl [:1]} "1")
(... | null | https://raw.githubusercontent.com/ajchemist/rum-mdl/87376da0f73c5bcafa64bed0fa10c7b653bcf149/examples/rum/mdl/examples/layout.cljc | clojure | (ns rum.mdl.examples.layout
(:require
[rum.core :as rum]
[rum.mdl :as mdl]
[rum.mdl.demo :as demo]))
(rum/defc grid []
[:.demo.grid
(mdl/grid
(mdl/cell {:mdl [:1]} "1")
(mdl/cell {:mdl [:1]} "1")
(mdl/cell {:mdl [:1]} "1")
(mdl/cell {:mdl [:1]} "1")
(mdl/cell {:mdl [:1]} "1")
(... | |
7ffd229b25929208a58a70b32d8765b83871805d4d63eb94672306102dc89192 | cedlemo/OCaml-GI-ctypes-bindings-generator | Cell_renderer_text.mli | open Ctypes
type t
val t_typ : t typ
val create :
unit -> Cell_renderer.t ptr
val set_fixed_height_from_font :
t -> int32 -> unit
| null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Cell_renderer_text.mli | ocaml | open Ctypes
type t
val t_typ : t typ
val create :
unit -> Cell_renderer.t ptr
val set_fixed_height_from_font :
t -> int32 -> unit
| |
e17acb3373d597191e4da23173ad029df3cafa1cf1e98ca73aaeba0744b7e046 | contivero/hasmin | Properties.hs | {-# LANGUAGE OverloadedStrings #-}
-----------------------------------------------------------------------------
-- |
Module : Hasmin . Properties
Copyright : ( c ) 2017
-- License : BSD3
-- Stability : experimental
-- Portability : unknown
--
------------------------------------------------------... | null | https://raw.githubusercontent.com/contivero/hasmin/2a7604159b51e69c5e9c564dce53cb3ab09ae22b/src/Hasmin/Properties.hs | haskell | # LANGUAGE OverloadedStrings #
---------------------------------------------------------------------------
|
License : BSD3
Stability : experimental
Portability : unknown
---------------------------------------------------------------------------
shorthands that overwrite it
longhands that can be merged in... | Module : Hasmin . Properties
Copyright : ( c ) 2017
module Hasmin.Properties
( PropertyInfo(..)
, Inheritance(..)
, propertiesTraits
) where
import Control.Applicative ((<|>))
import Data.Attoparsec.Text (parseOnly)
import Data.Text (Text)
import Data.Map.Strict (Map)
import qualified D... |
0afc60126363d1abd8c68bec7259e3e95904bfe5fa54b636864f5cfa9eddf460 | TrustInSoft/tis-interpreter | logic_interp.mli | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of Frama - C.
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/kernel_services/analysis/logic_interp.mli | ocaml | ************************************************************************
alternatives)
... | Modified by TrustInSoft
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Softwa... |
00cf326e1e8cd765e6bc5d3e893710f5f0ba6927eae1402b2613cd7e12a1fba2 | 2600hz/kazoo | kz_fax_converter_convertapi.erl | %%%-----------------------------------------------------------------------------
( C ) 2018 - 2020 , 2600Hz
%%% @doc
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%%
%%% @end
%%%--------... | null | https://raw.githubusercontent.com/2600hz/kazoo/24519b9af9792caa67f7c09bbb9d27e2418f7ad6/core/kazoo_convert/src/providers/kz_fax_converter_convertapi.erl | erlang | -----------------------------------------------------------------------------
@doc
@end
-----------------------------------------------------------------------------
------------------------------------------------------------------------------
@doc Converts the data or file specified in `Content' from the `From' m... | ( C ) 2018 - 2020 , 2600Hz
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
-module(kz_fax_converter_convertapi).
-behaviour(gen_kz_converter).
-export([convert/4
,read_metadata/1
... |
6b9e74f2c3034912c4d5d06cb70bb17f1f3a0f8876e23e2a8e4b78e168da8542 | callum-oakley/advent-of-code | 05.clj | (ns aoc.2020.05
(:require
[clojure.string :as str]
[clojure.set :as set]
[clojure.test :refer [deftest are]]))
(def parse str/split-lines)
(defn decode [s]
(read-string (apply str "2r" (map {\F \0 \B \1 \L \0 \R \1} s))))
(defn part-1 [passes]
(apply max (map decode passes)))
(defn part-2 [passes]
... | null | https://raw.githubusercontent.com/callum-oakley/advent-of-code/e24c126fdfa4852c1380f5d1b1fda96da1ebe553/src/aoc/2020/05.clj | clojure | (ns aoc.2020.05
(:require
[clojure.string :as str]
[clojure.set :as set]
[clojure.test :refer [deftest are]]))
(def parse str/split-lines)
(defn decode [s]
(read-string (apply str "2r" (map {\F \0 \B \1 \L \0 \R \1} s))))
(defn part-1 [passes]
(apply max (map decode passes)))
(defn part-2 [passes]
... | |
28059177a99411541d6ac38963d22c787c98f4e031123a9a29d0625306bb719d | clojure-interop/google-cloud-clients | SpannerClient$ListSessionsPagedResponse.clj | (ns com.google.cloud.spanner.v1.SpannerClient$ListSessionsPagedResponse
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.spanner.v1 SpannerClient$ListSessionsPagedResponse]))
(defn *create-async
"context - `com.google.api.gax.rpc.PageContext`
future-response - `com.google.api.core.Ap... | null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.spanner/src/com/google/cloud/spanner/v1/SpannerClient%24ListSessionsPagedResponse.clj | clojure | (ns com.google.cloud.spanner.v1.SpannerClient$ListSessionsPagedResponse
(:refer-clojure :only [require comment defn ->])
(:import [com.google.cloud.spanner.v1 SpannerClient$ListSessionsPagedResponse]))
(defn *create-async
"context - `com.google.api.gax.rpc.PageContext`
future-response - `com.google.api.core.Ap... | |
a4d98e2f9b4909659e372f280cc7201cb7338cc4ef4f592b07f68963bd66c17b | cjay/vulkyrie | Game.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
{-# LANGUAGE TemplateHaskell #-}
# LANGUAGE TypeApplications ... | null | https://raw.githubusercontent.com/cjay/vulkyrie/0a53e6c943c535117e2676753d9bf3e04b37b26e/src/Vulkyrie/Examples/Flat/Game.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE TemplateHaskell #
now the consequences of the event can propagate
that would need unliftIO
| This is the glue between game logic and graphics code.
It carries only what the graphics part needs. | # LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Vulkyrie.Examples.Flat.Gam... |
df3b1ce66821f064079e1d03ab0e165ce71cd430650494e22519411e68b01686 | geophf/1HaskellADay | Exercise.hs | module Y2020.M08.D25.Exercise where
import Data.Map (Map)
-
Let 's continue , shall we ? # BladeRunner
To get to the point of cosine similarities , we need ( to generate ) a set of
vector - sets to align cosinely similarly .
So there .
Today 's # haskell exercise .
From project gutenberg :
-
Let's c... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2020/M08/D25/Exercise.hs | haskell | }
}
yes, it's in HTML. yes: deal with it.
} | module Y2020.M08.D25.Exercise where
import Data.Map (Map)
-
Let 's continue , shall we ? # BladeRunner
To get to the point of cosine similarities , we need ( to generate ) a set of
vector - sets to align cosinely similarly .
So there .
Today 's # haskell exercise .
From project gutenberg :
-
Let's c... |
f07eb52377816ed26d64ca6bfd271ac3967f11be54a21568c9daf86b301be5f2 | janestreet/core | indexed_container_intf.ml | (** This module extends {!Base.Indexed_container}. *)
open! Import
open Perms.Export
module type S1_permissions = sig
include Container.S1_permissions
val foldi
: ('a, [> read ]) t
-> init:'acc
-> f:((int -> 'acc -> 'a -> 'acc)[@local])
-> 'acc
val iteri : ('a, [> read ]) t -> f:((int -> 'a -... | null | https://raw.githubusercontent.com/janestreet/core/f382131ccdcb4a8cd21ebf9a49fa42dcf8183de6/core/src/indexed_container_intf.ml | ocaml | * This module extends {!Base.Indexed_container}.
* @open |
open! Import
open Perms.Export
module type S1_permissions = sig
include Container.S1_permissions
val foldi
: ('a, [> read ]) t
-> init:'acc
-> f:((int -> 'acc -> 'a -> 'acc)[@local])
-> 'acc
val iteri : ('a, [> read ]) t -> f:((int -> 'a -> unit)[@local]) -> unit
val existsi : ('a, [> read ... |
186921257beb045cd363ccfc6598da1fb87ad3752bdb4688d5e49694fe22f3bc | antoniogarrote/clj-ml | kernel_functions.clj | ;;
Kernel functions for SVM classifiers
@author
;;
(ns #^{:author "Antonio Garrote <>"}
clj-ml.kernel-functions
"Kernel functions that can be passed as parameters to support vector machines classifiers.
Polynomic, radial basis and string kernels are supported"
(:use [clj-ml utils data])
(:import (wek... | null | https://raw.githubusercontent.com/antoniogarrote/clj-ml/a6e3a41b7eed0c31ea344b286ebbeb0e81ce68bc/src/clj_ml/kernel_functions.clj | clojure | Kernel functions for SVM classifiers
@author
(ns #^{:author "Antonio Garrote <>"}
clj-ml.kernel-functions
"Kernel functions that can be passed as parameters to support vector machines classifiers.
Polynomic, radial basis and string kernels are supported"
(:use [clj-ml utils data])
(:import (weka.clas... | |
afb4c8fa5af41516a4d88b35d645d2416f47f86ef39e41d61b3e1a1e4c31324b | marigold-dev/deku | lexer.mli | val convert_pos : Lexing.position -> Source.pos
val token : Lexing.lexbuf -> Parser.token (* raises Source.Error *)
| null | https://raw.githubusercontent.com/marigold-dev/deku/a26f31e0560ad12fd86cf7fa4667bb147247c7ef/deku-c/interpreter/text/lexer.mli | ocaml | raises Source.Error | val convert_pos : Lexing.position -> Source.pos
|
77d1cca0d5038dcf43c0f5da64e5a5510a0df2f31c62a374e29167c8c8310b7f | ollef/navm-hs | RegisterAllocation.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE DuplicateRecordFields #
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeFamilies #
# LANGUAGE ViewPatterns #
# LANGUAGE NoFieldSelectors #
module Target.X86.RegisterAllocation where
import Data.Bifunctor
import qualified Data.BitSet as... | null | https://raw.githubusercontent.com/ollef/navm-hs/d42cdd01d9d5f8dbb874a76790af72e0a39cff3e/src/Target/X86/RegisterAllocation.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings # | # LANGUAGE DuplicateRecordFields #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE TypeFamilies #
# LANGUAGE ViewPatterns #
# LANGUAGE NoFieldSelectors #
module Target.X86.RegisterAllocation where
import Data.Bifunctor
import qualified Data.BitSet as BitSet
import Data.Bits
import Data.ByteString.Builder (Builder)... |
09320b23bb5aab361ac72d9dd45c9df523b95349e7f846bdfb45d1e8de453386 | UberPyro/prowl | gen.ml | open Batteries
open Printf
open Ast
open Parse
let parse ch =
let lexbuf = Lexing.from_channel ch in
try Parse.program Lex.token lexbuf with
| _ ->
let p = lexbuf.lex_curr_p in
Printf.sprintf
"Unexpected Token at [%d,%d]"
p.pos_lnum (p.pos_cnum - p.pos_bol)
|> failwith
let string_of_qu... | null | https://raw.githubusercontent.com/UberPyro/prowl/8b59cf8870bfe0fab9b8b61f3f6662895b8c0f51/src/parse/gen.ml | ocaml | open Batteries
open Printf
open Ast
open Parse
let parse ch =
let lexbuf = Lexing.from_channel ch in
try Parse.program Lex.token lexbuf with
| _ ->
let p = lexbuf.lex_curr_p in
Printf.sprintf
"Unexpected Token at [%d,%d]"
p.pos_lnum (p.pos_cnum - p.pos_bol)
|> failwith
let string_of_qu... | |
5f40155c79a36e557a82944f1fe1a5c5414288781a434f289bab2d19df074e10 | solita/mnt-teet | activity_procurement_info.clj | (ns teet.migration.activity-procurement-info
(:require [datomic.client.api :as d]))
(defn extract-procurement-info-from-integration-info [conn]
(let [activities (d/q '[:find ?a ?ii
:where [?a :activity/integration-info ?ii]]
(d/db conn))
parse #(binding [*r... | null | https://raw.githubusercontent.com/solita/mnt-teet/367e225aa5ab06099059267df83367bcc45404db/app/backend/src/clj/teet/migration/activity_procurement_info.clj | clojure | (ns teet.migration.activity-procurement-info
(:require [datomic.client.api :as d]))
(defn extract-procurement-info-from-integration-info [conn]
(let [activities (d/q '[:find ?a ?ii
:where [?a :activity/integration-info ?ii]]
(d/db conn))
parse #(binding [*r... | |
c02875059d46ac7b1173f66aa58ba5119567b1eab2cc2a6df8ce862ba0f69a2a | Enecuum/Node | Language.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE FunctionalDependencies #
{-# LANGUAGE GADTs #-}
{-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeInType #-}
# LANGUAGE UndecidableInstances #
module Enecuum.Framework.Node.Language where
import qualified Enecuum.Core.Language ... | null | https://raw.githubusercontent.com/Enecuum/Node/3dfbc6a39c84bd45dd5f4b881e067044dde0153a/src/Enecuum/Framework/Node/Language.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE GADTs #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeInType #
| Node language.
| Eval stateful action atomically.
| Eval networking.
| Eval core effect.
| Eval graph non-atomically (parts of script are evaluated atomically but separa... | # LANGUAGE FunctionalDependencies #
# LANGUAGE UndecidableInstances #
module Enecuum.Framework.Node.Language where
import qualified Enecuum.Core.Language as L
import qualified Enecuum.Core.Types as D
import qualified Enecuum.Framework.Domain.Networking as D
impo... |
cda067e4e206ff2e90aba2fffcde5fd68531bfca8b4e97612d1dc1860af550e0 | inconvergent/cl-veq | veq.lisp |
(in-package #:veq-tests)
(plan 6)
(subtest "2d double ops"
(veq:fvprogn
(is (veq:lst (veq:d2 1d0 2d0)) '(1d0 2d0))
(is (veq:lst (veq:d2~ 1 2d0)) '(1d0 2d0))
(is (veq:lst (veq:d2+ 1d0 2d0 (veq:d2 1d0 3d0))) '(2d0 5d0))
(is (veq:lst (veq:d2* 1d0 2d0 (veq:d2 1d0 3d0))) '(1d0 6d0))
(is (veq:lst ... | null | https://raw.githubusercontent.com/inconvergent/cl-veq/04386c4019e1f7a6824fc97640458232f426c32d/test/veq.lisp | lisp | (veq:d2 -0.12403473458920847d0 -0.9922778767136677d0))
(is (veq:d2lsum (list (veq:d2 1.0d0 2.0d0) (veq:d2 0.5d0 4.32d20)))
(veq:f2 -0.12403473458920847f0 -0.9922778767136677f0)) |
(in-package #:veq-tests)
(plan 6)
(subtest "2d double ops"
(veq:fvprogn
(is (veq:lst (veq:d2 1d0 2d0)) '(1d0 2d0))
(is (veq:lst (veq:d2~ 1 2d0)) '(1d0 2d0))
(is (veq:lst (veq:d2+ 1d0 2d0 (veq:d2 1d0 3d0))) '(2d0 5d0))
(is (veq:lst (veq:d2* 1d0 2d0 (veq:d2 1d0 3d0))) '(1d0 6d0))
(is (veq:lst ... |
7aa76964b19bb2a89a0704d53577f73c5f425dfb18431a15ae50a93e35962e25 | den1k/vimsical | queries.cljc | (ns vimsical.frontend.vcs.queries
(:require
[vimsical.vims :as vims]
[vimsical.vcs.core :as vcs]
[vimsical.queries.branch :as branch]
[vimsical.queries.file :as file]))
(def file file/pull-query)
(def vims
[:db/uid
{::vims/owner [:db/uid]}
{::vims/branches branch/pull-query}])
(def vcs
['* {:... | null | https://raw.githubusercontent.com/den1k/vimsical/1e4a1f1297849b1121baf24bdb7a0c6ba3558954/src/frontend/vimsical/frontend/vcs/queries.cljc | clojure | (ns vimsical.frontend.vcs.queries
(:require
[vimsical.vims :as vims]
[vimsical.vcs.core :as vcs]
[vimsical.queries.branch :as branch]
[vimsical.queries.file :as file]))
(def file file/pull-query)
(def vims
[:db/uid
{::vims/owner [:db/uid]}
{::vims/branches branch/pull-query}])
(def vcs
['* {:... | |
c94637d573a26708afeeb5c81ad479abd3bccacd08268e3c47c70aa4f66a84b9 | casperschipper/ocaml-cisp | midi.ml | open Cisp
open Seq
module Reader = struct
*
I use a reader module to easily extract multiple properties at once from one midi input stream .
I use a reader module to easily extract multiple properties at once from one midi input stream.
*)
type ('e, 'a) t = Reader of ('e -> 'a)
let run = function Re... | null | https://raw.githubusercontent.com/casperschipper/ocaml-cisp/4926eaa1332a6d7ef4404cc9962666399ecca88f/src/midi/midi.ml | ocaml | return the complete reader env
can be used to return something within the reader environment , like a record field
Protected newtypes, so we are sure we have valid midi data instead of arbitrary ints
a (opt b) -> opt (a, b)
applicative = m (a -> b) -> m a -> m b
always returns a note, even if your paramete... | open Cisp
open Seq
module Reader = struct
*
I use a reader module to easily extract multiple properties at once from one midi input stream .
I use a reader module to easily extract multiple properties at once from one midi input stream.
*)
type ('e, 'a) t = Reader of ('e -> 'a)
let run = function Re... |
28019be46e381db0695932e94c5a640e9e94d91d59e378bc6f7d8253f8acc3e7 | jrm-code-project/LISP-Machine | bootstrap.lisp | LAMBDA pseudo - PROM . -*- Mode : Text -*-
Copyright ( c ) LISP Machine , Inc. 1984
;;; See filename "Copyright" for
;;;licensing and release information.
;;; to do
* * * things that think the system configuration area is 1 page
;;; There are many places in this code in which cycles are... | null | https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/ulambda/bootstrap.lisp | lisp | See filename "Copyright" for
licensing and release information.
to do
There are many places in this code in which cycles are wasted.
This is to make the code clearer, since it is far more important
that code in a PROM be bug-free than that the boot sequence be
150 nanoseconds faster.
Still to be done is the fe... | LAMBDA pseudo - PROM . -*- Mode : Text -*-
Copyright ( c ) LISP Machine , Inc. 1984
* * * things that think the system configuration area is 1 page
used to be PROM - DIRECT.TEXT - this version started 4/29/84
(SETQ bootstrap '(
(LOCALITY M-MEM)
M-GARBAGE (0)
M-HUNOZ ... |
d661a594a6a909c155862961493a1b29aa5d915fb6a38081644098be3dfed548 | grin-compiler/ghc-whole-program-compiler-project | Convert.hs | # LANGUAGE ImplicitParams , RecordWildCards , LambdaCase , MultiWayIf , TupleSections , OverloadedStrings , CPP #
#ifdef EXTERNAL_STG_COMPILER_PACKAGE
module Stg.GHC.Convert where
#else
module GHC.Stg.External.Convert where
import GHC.Prelude
#endif
import Stg.Syntax
import qualified Data.ByteString.Char8 as BS8
im... | null | https://raw.githubusercontent.com/grin-compiler/ghc-whole-program-compiler-project/6e75aaccf4df0d78786f5bb1a28778d54c09a7be/external-stg-compiler/lib/Stg/GHC/Convert.hs | haskell | trace :: String -> a -> a
trace _ = id
conversion env
debug state
debug
helpers
name conversion
source location conversion
tickish conversion
data con conversion
type conversion
cvtType msg t = trpp (unwords [msg, "cvtType"]) cvtType3 $ deepCheckType t
cvtType msg t = trpp (unwords [msg, "cvtType"]) cvtTypeNor... | # LANGUAGE ImplicitParams , RecordWildCards , LambdaCase , MultiWayIf , TupleSections , OverloadedStrings , CPP #
#ifdef EXTERNAL_STG_COMPILER_PACKAGE
module Stg.GHC.Convert where
#else
module GHC.Stg.External.Convert where
import GHC.Prelude
#endif
import Stg.Syntax
import qualified Data.ByteString.Char8 as BS8
im... |
e7a3e5762d8f33fa1682319dc89f6b182298ab4cadfe597f68cb2997fa84efec | stedolan/crowbar | test_serializer.ml | open Crowbar
module S = Serializer
type any_ty = Any : 'a S.ty -> any_ty
let ty_gen =
with_printer (fun ppf (Any t)-> S.pp_ty ppf t) @@
fix (fun ty_gen -> choose [
const (Any S.Int);
const (Any S.Bool);
map [ty_gen; ty_gen] (fun (Any ta) (Any tb) ->
Any (S.Prod (ta, tb)));
map [ty_gen] (fun... | null | https://raw.githubusercontent.com/stedolan/crowbar/0061f60605b550c967fd5ccdcc95fcab786b55fa/examples/serializer/test_serializer.ml | ocaml | The generator for the final value, [gen_of_ty t], depends on the
generated type representation, [t]. This dynamic dependency cannot
be expressed with [map], it requires [dynamic_bind]. | open Crowbar
module S = Serializer
type any_ty = Any : 'a S.ty -> any_ty
let ty_gen =
with_printer (fun ppf (Any t)-> S.pp_ty ppf t) @@
fix (fun ty_gen -> choose [
const (Any S.Int);
const (Any S.Bool);
map [ty_gen; ty_gen] (fun (Any ta) (Any tb) ->
Any (S.Prod (ta, tb)));
map [ty_gen] (fun... |
98167ad689f11ac287d0062130564f60a58026d96b07fcf559e23a91054e2e13 | webyrd/n-grams-for-synthesis | sort.scm | The SRFI- ? ? sort package -- general sort & merge procedures
;;;
Copyright ( c ) 1998 by .
;;; You may do as you please with this code, as long as you do not delete this
;;; notice or hold me responsible for any outcome related to its use.
10/98 .
;;; This file just defines the general sort API in terms of ... | null | https://raw.githubusercontent.com/webyrd/n-grams-for-synthesis/b53b071e53445337d3fe20db0249363aeb9f3e51/datasets/srfi/srfi-32/sort-ref-impl/sort.scm | scheme |
You may do as you please with this code, as long as you do not delete this
notice or hold me responsible for any outcome related to its use.
This file just defines the general sort API in terms of some
algorithm-specific calls.
Sort lists by converting to
a vector and sorting that. | The SRFI- ? ? sort package -- general sort & merge procedures
Copyright ( c ) 1998 by .
10/98 .
(heap-sort! v <)
(vector->list v)))
(define list-sort! list-merge-sort!)
(define list-stable-sort list-merge-sort)
(define list-stable-sort! list-merge-sort!)
(define vector-sort heap-sort)
(define v... |
4c8b459fe3b29d40da6f24b2e585bfd11c4b7f76f687144f503d9771eea0fc72 | may-liu/qtalk | http_check_user_status.erl | %% Feel free to use, reuse and abuse the code in this file.
-module(http_check_user_status).
-export([init/3]).
-export([handle/2]).
-export([terminate/3]).
-include("logger.hrl").
-include("http_req.hrl").
-include("ejb_http_server.hrl").
init(_Transport, Req, []) ->
{ok, Req, undefined}.
handle(Req, State) ->
... | null | https://raw.githubusercontent.com/may-liu/qtalk/f5431e5a7123975e9656e7ab239e674ce33713cd/qtalk_opensource/scripts/ejb_http_server/src/http_check_user_status.erl | erlang | Feel free to use, reuse and abuse the code in this file. |
-module(http_check_user_status).
-export([init/3]).
-export([handle/2]).
-export([terminate/3]).
-include("logger.hrl").
-include("http_req.hrl").
-include("ejb_http_server.hrl").
init(_Transport, Req, []) ->
{ok, Req, undefined}.
handle(Req, State) ->
catch ejb_monitor:monitor_count(<<"http_check_user_status... |
eb07e8196b291cd182154f0ec1a477c605677a0847bbf91837a919ab1b6806be | AHAAAAAAA/mapbh | model.cljs | (ns app.model
"This namespace contains your application and is the entrypoint for 'yarn start'."
(:require [re-frame.core :as rf]))
(rf/reg-sub
::active-panel
(fn [db _]
(:active-panel db)))
(rf/reg-sub
::language
(fn [db _]
(:language db)))
| null | https://raw.githubusercontent.com/AHAAAAAAA/mapbh/d9fd7d250e6ce39ac753bed311dccb2be909905a/src/app/model.cljs | clojure | (ns app.model
"This namespace contains your application and is the entrypoint for 'yarn start'."
(:require [re-frame.core :as rf]))
(rf/reg-sub
::active-panel
(fn [db _]
(:active-panel db)))
(rf/reg-sub
::language
(fn [db _]
(:language db)))
| |
4762fcf47a305a698158d518e49deb423ee4ba9e65f86e7478e51bf200e256de | liamoc/dixi | API.hs | # LANGUAGE DataKinds #
# LANGUAGE PolyKinds #
{-# LANGUAGE TypeFamilies #-}
{-# LANGUAGE TypeOperators #-}
# LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE RecordWildCards #
# LANGUAGE CPP #
module Dixi.API where... | null | https://raw.githubusercontent.com/liamoc/dixi/4a2aeef11378adf63ddf3d5787611e49220d6f6e/Dixi/API.hs | haskell | # LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# LANGUAGE OverloadedStrings #
# LANGUAGE ConstraintKinds # | # LANGUAGE DataKinds #
# LANGUAGE PolyKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE RecordWildCards #
# LANGUAGE CPP #
module Dixi.API where
import Control.Lens hiding ((.=))
import Data.Aeson
import Data.Aeson.Types
import Data.Foldable
import Data.Text (Text)
import Data.Patch... |
49aa92630b4d212d134249005239cfc4c018aa821bf361931a19b309494d1f50 | theodormoroianu/SecondYearCourses | lab6-sol_20210115151148.hs | -- /
import Data.Char
import Data.List
import Test.QuickCheck
1 .
rotate :: Int -> [Char] -> [Char]
rotate n l
| n > 0
, n < length l
= suf ++ pre
where
(pre, suf) = splitAt n l
rotate _ _ = error "număr negativ sau prea mare"
2 .
prop_rotate :: Int -> String -> Bool
prop_rotate k str = rotate (l ... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/99185b0e97119135e7301c2c7be0f07ae7258006/Haskell/l/.history/lab6/lab6-sol_20210115151148.hs | haskell | / |
import Data.Char
import Data.List
import Test.QuickCheck
1 .
rotate :: Int -> [Char] -> [Char]
rotate n l
| n > 0
, n < length l
= suf ++ pre
where
(pre, suf) = splitAt n l
rotate _ _ = error "număr negativ sau prea mare"
2 .
prop_rotate :: Int -> String -> Bool
prop_rotate k str = rotate (l + 1 -... |
ce8b7765ced2cbbe4faeb17491eb2c88d6a96e86e66a49d6cd5380f1ef55cc07 | ml-in-barcelona/server-reason-react | belt_MapDict.ml | module N = Belt_internalAVLtree
module A = Belt_Array
type ('key, 'a, 'id) t = ('key, 'a) N.t
type ('key, 'id) cmp = ('key, 'id) Belt_Id.cmp
let empty = N.empty
let fromArray = N.fromArray
let isEmpty = N.isEmpty
let cmp = N.cmp
let cmpU = N.cmpU
let eq = N.eq
let eqU = N.eqU
let has = N.has
let forEach = N.forEach
l... | null | https://raw.githubusercontent.com/ml-in-barcelona/server-reason-react/a5d22907eb2633bcb8e77808f6c677802062953a/lib/belt/belt_MapDict.ml | ocaml | module N = Belt_internalAVLtree
module A = Belt_Array
type ('key, 'a, 'id) t = ('key, 'a) N.t
type ('key, 'id) cmp = ('key, 'id) Belt_Id.cmp
let empty = N.empty
let fromArray = N.fromArray
let isEmpty = N.isEmpty
let cmp = N.cmp
let cmpU = N.cmpU
let eq = N.eq
let eqU = N.eqU
let has = N.has
let forEach = N.forEach
l... | |
4d190def4f0e6e792846232956020b3d615a130806a7298531e03904e7884716 | TheLortex/mirage-monorepo | location.mli | (** Overrides the Location module of OCaml *)
(** There are less functions in this module. However the API should be more
stable than the Location module of OCaml. *)
open! Import
type t = location = {
loc_start : Lexing.position;
loc_end : Lexing.position;
loc_ghost : bool;
}
val in_file : string -> t
(*... | null | https://raw.githubusercontent.com/TheLortex/mirage-monorepo/b557005dfe5a51fc50f0597d82c450291cfe8a2a/duniverse/ppxlib/src/location.mli | ocaml | * Overrides the Location module of OCaml
* There are less functions in this module. However the API should be more
stable than the Location module of OCaml.
* Return an empty ghost range located in a given file.
* Set the [pos_fname] both in [loc_start] and [loc_end]. Leave the rest as is.
* An arbitrary value ... |
open! Import
type t = location = {
loc_start : Lexing.position;
loc_end : Lexing.position;
loc_ghost : bool;
}
val in_file : string -> t
val set_filename : t -> string -> t
val none : t
val init : Lexing.lexbuf -> string -> unit
val raise_errorf : ?loc:t -> ('a, Caml.Format.formatter, unit, 'b) format4 ->... |
f6ed5d6eede740a1026c9526fae821a16f21d0f50d5f9bb02dfe5bd8571e7ab9 | mirage/irmin | async_intf.ml |
* Copyright ( c ) 2022 - 2022 Tarides < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS... | null | https://raw.githubusercontent.com/mirage/irmin/4ab886c2f2c259d4a072ace24b02d97482399335/src/irmin-pack/unix/async_intf.ml | ocaml | * Basic abstraction for a worker.
* A task
* Start a task.
* If running, wait for a task to finish and return its outcome.
If not running, return the oucome of the task.
* If running, refresh the status of the task, without blocking.
If not running, return the oucome of the task.
* If running, cancel... |
* Copyright ( c ) 2022 - 2022 Tarides < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS... |
d04f369c36da2837001a7729036e0be2ff64ef21394d5ef6558e4c9e3ce3270e | cedlemo/OCaml-GI-ctypes-bindings-generator | Log_level_flags.ml | open Ctypes
open Foreign
type t = Flag_recursion | Flag_fatal | Level_error | Level_critical | Level_warning | Level_message | Level_info | Level_debug | Level_mask
type t_list = t list
let of_value v =
if v = Int32.of_int 1 then Flag_recursion
else if v = Int32.of_int 2 then Flag_fatal
else if v = Int32.of_int... | null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/GLib/Log_level_flags.ml | ocaml | open Ctypes
open Foreign
type t = Flag_recursion | Flag_fatal | Level_error | Level_critical | Level_warning | Level_message | Level_info | Level_debug | Level_mask
type t_list = t list
let of_value v =
if v = Int32.of_int 1 then Flag_recursion
else if v = Int32.of_int 2 then Flag_fatal
else if v = Int32.of_int... | |
867965dbb163ea21579425c6a0cfc54fa64a52dd90e3da56ad4a04a173ffffbc | hmac/kite | Syn.hs | module Syn
( Module
, Module_(..)
, dataDecls
, funDecls
, extractDecl
, Import(..)
, ImportItem
, ImportItem_(..)
, unName
, Decl
, Decl_(..)
, Fun
, Fun_(..)
, Data
, Data_(..)
, Alias
, Alias_(..)
, DataCon
, DataCon_(..)
, Pattern
, tyapp
, fn
, ftv
, binOps
, Syn
... | null | https://raw.githubusercontent.com/hmac/kite/a48839fa5a4edce3bc7a758e4fcb1bda38a556f0/src/Syn.hs | haskell | import Bar
from http import Server (serve)
foo x (y : ys) (a, b, c) = ...
foo x [] _ = ...
A type alias in its raw form. The variables in aliasTyVars are free in the
type. This is later converted into a Scheme, so they get quantified over
properly.
Left a
Foo { unFoo : a, label : String }
Int
M... | module Syn
( Module
, Module_(..)
, dataDecls
, funDecls
, extractDecl
, Import(..)
, ImportItem
, ImportItem_(..)
, unName
, Decl
, Decl_(..)
, Fun
, Fun_(..)
, Data
, Data_(..)
, Alias
, Alias_(..)
, DataCon
, DataCon_(..)
, Pattern
, tyapp
, fn
, ftv
, binOps
, Syn
... |
b1b1c2c713ddf595b70a8d5726fe6f2a35926a411846d0f6a0a11e5685c99855 | pomanu/waxeye | waxeye.rkt | #lang racket/base
(require "main.rkt")
(main (vector->list (current-command-line-arguments)))
| null | https://raw.githubusercontent.com/pomanu/waxeye/8c2fdc7d85d7c4f87adfc8f482a311b55bfda1e2/src/waxeye/waxeye.rkt | racket | #lang racket/base
(require "main.rkt")
(main (vector->list (current-command-line-arguments)))
| |
5fd41f0d78376e976e50210829dd3e8e8e175568f9d8c8346d1585d0fbf0d96b | finnishtransportagency/harja | kartta.cljs | (ns harja.views.kartta
"Tämä namespace sisältää varsinaisen, käyttäjälle näkyvän karttakomponentin.
Karttakokonaisuus on Harjan toteutuksen aikana laajentunut paljon, ja aina kun
tuska on kasvanut tarpeeksi suureksi, on koodia refaktoroitu eri namespaceihin.
Valitettavasti tämä refaktorointi ei ole ikinä onnist... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/232a1cb3f9afdce7e631bbc309ecfc30ba2c7c76/src/cljs/harja/views/kartta.cljs | clojure | (log "ASETA-KARTAN-SIJAINTI: " x ", " y ", " w ", " h ", " naulattu?)
(log "EKA KERTA")
suurenna | pienennä | piilota
Avaimet:
klikkaile kartalta pisteitä...
zoomaus (urakka/hallintayksikkö muutos)
Älä siirrä tätä cond-ehtoon
"Ohi klikkaaminen" etusivulla ei tee mitään
muutakin
set width/height as CSS units, ... | (ns harja.views.kartta
"Tämä namespace sisältää varsinaisen, käyttäjälle näkyvän karttakomponentin.
Karttakokonaisuus on Harjan toteutuksen aikana laajentunut paljon, ja aina kun
tuska on kasvanut tarpeeksi suureksi, on koodia refaktoroitu eri namespaceihin.
Valitettavasti tämä refaktorointi ei ole ikinä onnist... |
e5c468e4fe7e6bc4875aa15c9ead430b4a940abfff57bb689e91b56ceeb37635 | alsonkemp/turbinado-website | Routes.hs | module Config.Routes where
import App.Controllers.HelloWorld
--
-- Import modules for which you'll be creating static routes.
--
--
-- Configure dynamic routes for on-the-fly compiled-and-loaded
modules ( ala Rails )
--
routes = [ "/:controller/:action/:id.:format"
, "/:controller/:action/:id"
, ... | null | https://raw.githubusercontent.com/alsonkemp/turbinado-website/310f38dd7d13cdb838e2ea6181c61521021c32b5/Config/Routes.hs | haskell |
Import modules for which you'll be creating static routes.
Configure dynamic routes for on-the-fly compiled-and-loaded
Statically compile and load these Layouts, Controllers and Views
| module Config.Routes where
import App.Controllers.HelloWorld
modules ( ala Rails )
routes = [ "/:controller/:action/:id.:format"
, "/:controller/:action/:id"
, "/:controller/:action.:format"
, "/:controller/:action"
, "/:controller"
, "/home"
]
staticLayouts =... |
787f8638cc268b07d0c8080859832e708c9810ef78cec46a929a9e7d8cb2e034 | input-output-hk/ouroboros-network | SupportsProtocol.hs | {-# LANGUAGE FlexibleContexts #-}
# LANGUAGE ScopedTypeVariables #
module Ouroboros.Consensus.Ledger.SupportsProtocol (LedgerSupportsProtocol (..)) where
import Control.Monad.Except
import GHC.Stack (HasCallStack)
import Ouroboros.Consensus.Block
import Ouroboros.Consensus.... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/c82309f403e99d916a76bb4d96d6812fb0a9db81/ouroboros-consensus/src/Ouroboros/Consensus/Ledger/SupportsProtocol.hs | haskell | # LANGUAGE FlexibleContexts #
| Link protocol to ledger
| Extract ticked ledger view from ticked ledger state
See 'ledgerViewForecastAt' for a discussion and precise definition of the
relation between this and forecasting.
| Get a forecast at the given ledger state.
This forecast can be used to validate head... | # LANGUAGE ScopedTypeVariables #
module Ouroboros.Consensus.Ledger.SupportsProtocol (LedgerSupportsProtocol (..)) where
import Control.Monad.Except
import GHC.Stack (HasCallStack)
import Ouroboros.Consensus.Block
import Ouroboros.Consensus.Forecast
import Ouroboros.C... |
e1e6d30721e41eab27793efdae582f698b992e282150c0e09f3b6f157a145ef5 | AndrasKovacs/ELTE-func-lang | Notes10.hs |
import Control.Monad
import Control.Applicative
isSpace , isLetter , isDigit , isAlpha
newtype Parser a = Parser {runParser :: String -> Maybe (a, String)}
instance Functor Parser where
fmap f (Parser g) = Parser $ \s ->
fmap (\(a, s') -> (f a, s')) (g s)
instance Applicative Parser where
pure = return... | null | https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/88d41930999d6056bdd7bfaa85761a527cce4113/2019-20-2/gyak_1/Notes10.hs | haskell | extra feltétel, f c == True
----------------------------------------------------------
anyChar = Parser $ \s -> case s of
[] -> Nothing
c : , cs : input
tipp: Data.Char.isSpace használható
alternatív:
do
cs <- many (satisfy isSpace)
pure ()
olvasunk egy a-t
visszaadjuk az a-t
char 'a'
char 'b'... |
import Control.Monad
import Control.Applicative
isSpace , isLetter , isDigit , isAlpha
newtype Parser a = Parser {runParser :: String -> Maybe (a, String)}
instance Functor Parser where
fmap f (Parser g) = Parser $ \s ->
fmap (\(a, s') -> (f a, s')) (g s)
instance Applicative Parser where
pure = return... |
2e4dba83f3706e53bc6caa6669cfe8e259245f0e86c9ff68f5d99fbf0e602682 | mikera/core.matrix | mathsops.cljc | (ns clojure.core.matrix.impl.mathsops
(:refer-clojure :exclude [abs])
#?(:cljs (:require-macros [clojure.core.matrix.impl.mathsops :refer [def-mop def-mops]])))
;; data structure for code generation of maths operations
;; format is (<symbol> <java.lang.Math equivalent>)
(defn ^double to-degrees*
[^double x]
#... | null | https://raw.githubusercontent.com/mikera/core.matrix/5b6c9512ce764b69146145449eab0bbf69cf3e81/src/main/clojure/clojure/core/matrix/impl/mathsops.cljc | clojure | data structure for code generation of maths operations
format is (<symbol> <java.lang.Math equivalent>) | (ns clojure.core.matrix.impl.mathsops
(:refer-clojure :exclude [abs])
#?(:cljs (:require-macros [clojure.core.matrix.impl.mathsops :refer [def-mop def-mops]])))
(defn ^double to-degrees*
[^double x]
#?(:clj (Math/toDegrees x)
:cljs (/ (* x 180.0) Math/PI)))
(defn ^double to-radians*
[^double x]
#?(:... |
b01b617baf7d5695ec469fea261e73e43c765223cca662a0ec85db246d29cbb2 | returntocorp/semgrep | Test_parsing_python.mli | Print the set of tokens in a .py file
val test_tokens_python : Common.filename -> unit
This makes accessible the different test_xxx functions above from
* the command line , e.g. ' -parse_python foo.py will call the
* test_parse_python function .
* the command line, e.g. '$ pfff -parse_python foo.py wi... | null | https://raw.githubusercontent.com/returntocorp/semgrep/00f1e67bbb80f00e29db3381288fc00398b6868a/languages/python/menhir/Test_parsing_python.mli | ocaml | Print the set of tokens in a .py file
val test_tokens_python : Common.filename -> unit
This makes accessible the different test_xxx functions above from
* the command line , e.g. ' -parse_python foo.py will call the
* test_parse_python function .
* the command line, e.g. '$ pfff -parse_python foo.py wi... | |
dffe2f4773d62e4c0d5c38a7ff892f4ee7586ceadd9e884f02c3130741b4e999 | rethab/h-gpgme | Types.hs | module Crypto.Gpgme.Types where
import Bindings.Gpgme
import qualified Data.ByteString as BS
import Data.Maybe (mapMaybe)
import Foreign
import qualified Foreign.Concurrent as FC
import Foreign.C.String (peekCString)
import System.IO.Unsafe (unsafePerformIO)
import Control.Exception (SomeException, Exception)
-- | th... | null | https://raw.githubusercontent.com/rethab/h-gpgme/56fc760ef6628ade4520df8f516a7ad3806dc915/src/Crypto/Gpgme/Types.hs | haskell | | the protocol to be used in the crypto engine
| Context to be passed around with operations. Use 'newCtx' or
'withCtx' in order to obtain an instance.
^ context
^ context protocol
^ engine version
| Modes for key listings
| a fingerprint
| a plaintext
| an ciphertext
| a signature
| the summary of a sign... | module Crypto.Gpgme.Types where
import Bindings.Gpgme
import qualified Data.ByteString as BS
import Data.Maybe (mapMaybe)
import Foreign
import qualified Foreign.Concurrent as FC
import Foreign.C.String (peekCString)
import System.IO.Unsafe (unsafePerformIO)
import Control.Exception (SomeException, Exception)
data Pr... |
7d9f211bdd46bb108d832facea9c614ca13820af3cfc22d15a240f09099f00fb | omcljs/om | build.clj | (require '[cljs.build.api :as b])
(b/build (b/inputs "src/main" "src/devcards")
{:main 'om.devcards.core
:asset-path "/devcards/out"
:output-to "resources/public/devcards/main.js"
:output-dir "resources/public/devcards/out"
:parallel-build true
:compiler-stats true
:verbose true})
(System/exit 0)
| null | https://raw.githubusercontent.com/omcljs/om/3a1fbe9c0e282646fc58550139b491ff9869f96d/script/build.clj | clojure | (require '[cljs.build.api :as b])
(b/build (b/inputs "src/main" "src/devcards")
{:main 'om.devcards.core
:asset-path "/devcards/out"
:output-to "resources/public/devcards/main.js"
:output-dir "resources/public/devcards/out"
:parallel-build true
:compiler-stats true
:verbose true})
(System/exit 0)
| |
f0a4e798dde251e6526680b5925890616709f64cc69e1b27612da3facfd1bd29 | aws-beam/aws-erlang | aws_schemas.erl | %% WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
See -beam/aws-codegen for more details .
@doc Amazon EventBridge Schema Registry
-module(aws_schemas).
-export([create_discoverer/2,
create_discoverer/3,
create_registry/3,
create_registry/4,
create_schema/4,
create_schema/... | null | https://raw.githubusercontent.com/aws-beam/aws-erlang/699287cee7dfc9dc8c08ced5f090dcc192c9cba8/src/aws_schemas.erl | erlang | WARNING: DO NOT EDIT, AUTO-GENERATED CODE!
====================================================================
API
====================================================================
@doc Creates a discoverer.
@doc Creates a registry.
@doc Creates a schema definition.
@doc Deletes a discoverer.
@doc Deletes a... | See -beam/aws-codegen for more details .
@doc Amazon EventBridge Schema Registry
-module(aws_schemas).
-export([create_discoverer/2,
create_discoverer/3,
create_registry/3,
create_registry/4,
create_schema/4,
create_schema/5,
delete_discoverer/3,
dele... |
dee99e891042cff10981be86fb768ce055aed8e63bc559c70cd0e899573ccca1 | somnusand/Poker | hackney_local_tcp.erl | %%% -*- erlang -*-
%%%
This file is part of hackney released under the Apache 2 license .
%%% See the NOTICE for more information.
%%%
Copyright ( c ) 2011 - 2012 , < >
%%%
-module(hackney_local_tcp).
-export([messages/1,
connect/3, connect/4,
recv/2, recv/3,
send/2,
setopts/2... | null | https://raw.githubusercontent.com/somnusand/Poker/4934582a4a37f28c53108a6f6e09b55d21925ffa/server/deps/hackney/src/hackney_local_tcp.erl | erlang | -*- erlang -*-
See the NOTICE for more information.
@doc Atoms used to identify messages in {active, once | true} mode.
connect
@doc Receive a packet from a socket in passive mode.
@see gen_tcp:recv/3
@doc Send a packet on a socket.
@see gen_tcp:send/2
@see inet:setopts/2
@doc Assign a new controlling proc... | This file is part of hackney released under the Apache 2 license .
Copyright ( c ) 2011 - 2012 , < >
-module(hackney_local_tcp).
-export([messages/1,
connect/3, connect/4,
recv/2, recv/3,
send/2,
setopts/2,
controlling_process/2,
peername/1,
close/1,... |
265bae23f2a0e5ebbc22993d45e497cadbd15e9bbafcab62fc1c4f5157b74381 | mfoemmel/erlang-otp | snmp_log.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1997 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pu... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/snmp/src/misc/snmp_log.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 limit... | Copyright Ericsson AB 1997 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(snmp_log).
-export([
create/4,... |
b1139e6d2361b20ba8d95ab67078aa38ee22b197b54f0f9b601f50072401a8f2 | dbuenzli/topkg | topkg_care_ocamlfind.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/dbuenzli/topkg/ea1e0981a18ce4160ec21e8a73f67cb748059671/src-care/topkg_care_ocamlfind.ml | ocaml | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | |
26bd5a9d56caccf35bebc74b2bc35daab21ea05d2c2e9d50a83e9695770416e3 | simplex-chat/simplex-chat | Core.hs | # LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
module Simplex.Chat.Core where
import Control.Logger.Simple
import Control.Monad.Reader
import qualified Data.Text as T
import Data.Text.Encoding (encodeUtf8)
import Simplex.Chat
import Simplex.Chat.Controller
import Simplex.Chat.Options (ChatOpts (..), C... | null | https://raw.githubusercontent.com/simplex-chat/simplex-chat/01acbb970ae7762e1551e352131453e77a601764/src/Simplex/Chat/Core.hs | haskell | # LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
module Simplex.Chat.Core where
import Control.Logger.Simple
import Control.Monad.Reader
import qualified Data.Text as T
import Data.Text.Encoding (encodeUtf8)
import Simplex.Chat
import Simplex.Chat.Controller
import Simplex.Chat.Options (ChatOpts (..), C... | |
cad5e510e5c4f24d8b0504a268689069a78f222807b3b2cf8d844c5c3e4faf3b | BranchTaken/Hemlock | test_of_real_to_real.ml | open! Basis.Rudiments
open! Basis
open I64
let test () =
let rec test_rs rs = begin
match rs with
| [] -> ()
| r :: rs' -> begin
let x = of_real r in
File.Fmt.stdout
|> Fmt.fmt "of_real "
|> Real.fmt ~alt:true ~radix:Radix.Hex r
|> Fmt.fmt " -> "
|> fmt ~al... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/a07e362d66319108c1478a4cbebab765c1808b1a/bootstrap/test/basis/i64/test_of_real_to_real.ml | ocaml | open! Basis.Rudiments
open! Basis
open I64
let test () =
let rec test_rs rs = begin
match rs with
| [] -> ()
| r :: rs' -> begin
let x = of_real r in
File.Fmt.stdout
|> Fmt.fmt "of_real "
|> Real.fmt ~alt:true ~radix:Radix.Hex r
|> Fmt.fmt " -> "
|> fmt ~al... | |
801a2ac4c2d6f13afeec6909b5fd2e38fb9a9bbccb5dba0f67915dae98431ed8 | ocaml-batteries-team/batteries-included | euler021.ml | open Batteries
let d n = Mathlib.sum_factors n
module ISet = Set.Make(Int)
let ret_amicable ~upto =
let is_amic = ref ISet.empty
and not_amic = ref ISet.empty
and to_test = ref ((2--upto) |> ISet.of_enum)
in
let test n = (* cleanup - ugly code *)
if n >= upto then ()
else if ISet.mem n !is_amic
... | null | https://raw.githubusercontent.com/ocaml-batteries-team/batteries-included/f143ef5ec583d87d538b8f06f06d046d64555e90/examples/euler/euler021.ml | ocaml | cleanup - ugly code | open Batteries
let d n = Mathlib.sum_factors n
module ISet = Set.Make(Int)
let ret_amicable ~upto =
let is_amic = ref ISet.empty
and not_amic = ref ISet.empty
and to_test = ref ((2--upto) |> ISet.of_enum)
in
if n >= upto then ()
else if ISet.mem n !is_amic
|| ISet.mem n !not_amic then
()
... |
2bf53f632e2e37776308f18454b1329a0155ae7f3876882dad4bd6947460c1b9 | well-typed-lightbulbs/ocaml-esp32 | fileio.ml | (* TEST
* hassysthreads
include systhreads
** bytecode
** native
*)
(* Test a file copy function *)
let test msg producer consumer src dst =
print_string msg; print_newline();
let ic = open_in_bin src in
let oc = open_out_bin dst in
let (in_fd, out_fd) = Unix.pipe() in
let ipipe = Unix.in_channel_of_descr... | null | https://raw.githubusercontent.com/well-typed-lightbulbs/ocaml-esp32/c24fcbfbee0e3aa6bb71c9b467c60c6bac326cc7/testsuite/tests/lib-threads/fileio.ml | ocaml | TEST
* hassysthreads
include systhreads
** bytecode
** native
Test a file copy function
File copy with constant-sized chunks
File copy with random-sized chunks
File copy line per line
Create long lines of text
Test input_line on truncated lines
The test |
let test msg producer consumer src dst =
print_string msg; print_newline();
let ic = open_in_bin src in
let oc = open_out_bin dst in
let (in_fd, out_fd) = Unix.pipe() in
let ipipe = Unix.in_channel_of_descr in_fd in
let opipe = Unix.out_channel_of_descr out_fd in
let prod = Thread.create producer (ic, o... |
24c12bedae76bb4e4bd165faba7487dcb171f829f08e6f926f8ac3d3fa31c5cd | zalando-incubator/chisel | metrics.clj | (ns chisel.metrics
(:require [io.pedestal.interceptor.helpers :as interceptor]
[io.pedestal.log :as log]
[metrics.timers :as timers]
[metrics.ring.expose :as expose])
(:import (java.util.concurrent TimeUnit)))
(def metric-registry log/default-recorder)
(def metric-prefix "ing... | null | https://raw.githubusercontent.com/zalando-incubator/chisel/8ddf7e32bd66980555ef809f0b78b1d5af051d4f/src/chisel/metrics.clj | clojure | (ns chisel.metrics
(:require [io.pedestal.interceptor.helpers :as interceptor]
[io.pedestal.log :as log]
[metrics.timers :as timers]
[metrics.ring.expose :as expose])
(:import (java.util.concurrent TimeUnit)))
(def metric-registry log/default-recorder)
(def metric-prefix "ing... | |
7aee85f207a3e8de8bfefedbac4a5b33a856b64af37308c19e590c6e51683b88 | mflatt/shrubbery-rhombus-0 | import-syntax.rkt | #lang racket/base
(require (for-syntax racket/base
syntax/parse
syntax/boundmap
enforest/proc-name
"srcloc.rkt"
"tail.rkt")
"name-root.rkt"
(submod "import.rkt" for-meta)
"syntax.rkt"
... | null | https://raw.githubusercontent.com/mflatt/shrubbery-rhombus-0/b6ee40b64b19623d5a8c1ee735378761fd25110a/rhombus/private/import-syntax.rkt | racket | #lang racket/base
(require (for-syntax racket/base
syntax/parse
syntax/boundmap
enforest/proc-name
"srcloc.rkt"
"tail.rkt")
"name-root.rkt"
(submod "import.rkt" for-meta)
"syntax.rkt"
... | |
2155706d9f7b74aaf42f196f9f6357eb0f79de36133269922863f91d4518780c | compiling-to-categories/concat | Deep.hs | {-# LANGUAGE RankNTypes #-}
# LANGUAGE CPP #
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE KindSignatures #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE TypeOperators #
# LANGUAGE TypeApplications #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE MonadComprehensions #
# LANGU... | null | https://raw.githubusercontent.com/compiling-to-categories/concat/49e554856576245f583dfd2484e5f7c19f688028/examples/src/ConCat/Deep.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE ConstraintKinds #
TEMP
| Simple feed-forward deep learning
import ConCat.Orphans (fstF, sndF)
-------------------------------------------------------------------
Simple linear algebra
-------------------------------------------------------------------
| Generalized matrix
*
* ... | # LANGUAGE CPP #
# LANGUAGE KindSignatures #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE TypeOperators #
# LANGUAGE TypeApplications #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE MonadComprehensions #
# LANGUAGE UndecidableInstances #
# LANGUAGE MonoLocalBinds #
# OPT... |
a984233e167e60eb3850808caef648f82dc4fc79d9172e92f430e735e83e2416 | den1k/vimsical | views.cljs | (ns vimsical.frontend.vcr.views
(:require
[re-com.core :as re-com]
[re-frame.core :as re-frame]
[vimsical.frontend.code-editor.views :refer [code-editor]]
[vimsical.frontend.live-preview.views :refer [live-preview]]
[vimsical.frontend.timeline.subs :as timeline.subs]
[vimsical.frontend.timeline.view... | null | https://raw.githubusercontent.com/den1k/vimsical/1e4a1f1297849b1121baf24bdb7a0c6ba3558954/src/frontend/vimsical/frontend/vcr/views.cljs | clojure |
* Temp
* Components
rename to button
rename to button
component for a description of the problem | (ns vimsical.frontend.vcr.views
(:require
[re-com.core :as re-com]
[re-frame.core :as re-frame]
[vimsical.frontend.code-editor.views :refer [code-editor]]
[vimsical.frontend.live-preview.views :refer [live-preview]]
[vimsical.frontend.timeline.subs :as timeline.subs]
[vimsical.frontend.timeline.view... |
66174e7cf3b80f05350a3e5f5940f46fccc15a590d96e4a19f06dfeee6f3c4d5 | simplex-chat/simplexmq | Client.hs | # LANGUAGE DataKinds #
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE NumericUnderscores #
# LANGUAGE OverloadedLists #
{-# LANGUAGE OverloadedStrings #-}
# ... | null | https://raw.githubusercontent.com/simplex-chat/simplexmq/e4aad7583f425765c605cd8042e3136e048bdbec/src/Simplex/Messaging/Client.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
|
Module : Simplex.Messaging.Client
Copyright : (c) simplex.chat
License : AGPL-3
Maintainer :
Stability : experimental
Portability : non-portable
This module provides a functional client API for SMP protocol.
See -... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE NumericUnderscores #
# LANGUAGE OverloadedLists #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Simplex.Messaging.Cli... |
6fbb8a097c29dd50bb8ed3945fe3f98ed5cd8eb9468a9bf3e15967609116185d | brendanhay/amazonka | ListMailDomains.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE StrictData #-}
# LANGUAGE TypeFamilies #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - binds #
# OPTIONS_GHC -fno - warn - unused -... | null | https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-workmail/gen/Amazonka/WorkMail/ListMailDomains.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Module : Amazonka.WorkMail.ListMailDomains
Stability : auto-generated
Lists the mail domains in a given WorkMail organization.
* Creating a Request
* Request Lenses
* Destructuring the Response
* Response Lenses
| /See:/ 'newListMailDomains' smar... | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - binds #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
De... |
fc982d01bd164714aa39813c2686cc8ca9f2252ab63b15965f2decdcb432a7c0 | camoy/trace-contract | collector-transformer.rkt | #lang racket/base
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; provide
(provide map/t
list/t)
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; require
(require "collector-contract.rkt")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/camoy/trace-contract/06f2778c1ab63a773c029783152a070f3ab4feba/private/collector-transformer.rkt | racket |
provide
require
transformers
Applies a function before the value is added to the trace.
Collector transformer that produces lists.
tests | #lang racket/base
(provide map/t
list/t)
(require "collector-contract.rkt")
(define (map/t f cctc)
(define old-mapper (collector-contract-mapper cctc))
(define mapper* (if old-mapper (compose f old-mapper) f))
(if (chaperone-collector-contract? cctc)
(struct-copy chaperone-collector-contract ... |
85231bc17b076a9fffc0e24f0f8f98bef6e8581a3349e375f44bad362c5e54fe | Nutr1t07/wl-bot | Config.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TemplateHaskell #
module Utils.Config where
import Control.Lens
import Data.Aeson
data Config = Config
{
-- admins :: [Integer]
_port :: Int
, _webhook_server :: String
, _mirai_ser... | null | https://raw.githubusercontent.com/Nutr1t07/wl-bot/985e27caf2d492c32e5e73b64f0bc5f718e72c76/src/Utils/Config.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
admins :: [Integer] | # LANGUAGE TemplateHaskell #
module Utils.Config where
import Control.Lens
import Data.Aeson
data Config = Config
{
_port :: Int
, _webhook_server :: String
, _mirai_server :: String
, _tg_token :: String
, _ws_host :: String
, _ws_port ... |
b2fe44f454a2d1b9d181821fde1aa251ef8d045a87a9db68904f1f491b2991a5 | metosin/sieppari | core_test.clj | (ns sieppari.core-test
(:require [clojure.test :refer :all]
[testit.core :refer :all]
[sieppari.core :as s]
[sieppari.async.core-async]
[clojure.core.async :as a]))
(def try-f #'s/-try)
(deftest try-f-test
(fact
(try-f {} nil)
=> {})
(fact
(try-f {} (f... | null | https://raw.githubusercontent.com/metosin/sieppari/7a97d55d8063f30359e902b0678c6ebca952f9fd/test/clj/sieppari/core_test.clj | clojure | (ns sieppari.core-test
(:require [clojure.test :refer :all]
[testit.core :refer :all]
[sieppari.core :as s]
[sieppari.async.core-async]
[clojure.core.async :as a]))
(def try-f #'s/-try)
(deftest try-f-test
(fact
(try-f {} nil)
=> {})
(fact
(try-f {} (f... | |
ae11c59b75a9fed7aca4bcb55b08d8bfda4cba080ce03c854f4d300339e145e6 | maximedenes/native-coq | mod_subst.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/kernel/mod_subst.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* {6 [Mod_subst] }
* A delta_resolv... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Term
* { 6 ... |
92a104f4202a7cb3054f66efb6dd890edfc97b07734e559e90897024f00dacfb | strint/sicpAns | 1008_cube_roots.scm | (define (cube-roots in)
(cube-roots-iter 1.0 in in))
(define (cube-roots-iter guess pre-guess x)
(if (good-enough? guess pre-guess)
guess
(cube-roots-iter (improve guess x) guess x)))
(define (improve g x)
(/ (+ (/ x (* g g))
(* 2 g))
3))
使用前后两次计算结果的变化率不超过0.0001来作为证明计算结果达到精度的条件
(define... | null | https://raw.githubusercontent.com/strint/sicpAns/efc4bdfaab7583117d42f2141d4b3b9e12792b79/1.1.7-8_SquareRoot/1008_cube_roots.scm | scheme | (define (cube-roots in)
(cube-roots-iter 1.0 in in))
(define (cube-roots-iter guess pre-guess x)
(if (good-enough? guess pre-guess)
guess
(cube-roots-iter (improve guess x) guess x)))
(define (improve g x)
(/ (+ (/ x (* g g))
(* 2 g))
3))
使用前后两次计算结果的变化率不超过0.0001来作为证明计算结果达到精度的条件
(define... | |
b967093424092ce1f10eea912457f678a9d78412988add2e46e5d9043d137cc9 | serioga/webapp-clojure-2020 | watcher.clj | (ns dev.env.tailwind.watcher
(:require [clojure.java.shell :as shell]
[clojure.string :as string]
[lib.clojure-tools-logging.logger :as logger]))
(set! *warn-on-reflection* true)
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
(def ^:privat... | null | https://raw.githubusercontent.com/serioga/webapp-clojure-2020/365d70fea9eaee7e6b0fe3a9da6893fdb4189b19/dev/dev/env/tailwind/watcher.clj | clojure | (ns dev.env.tailwind.watcher
(:require [clojure.java.shell :as shell]
[clojure.string :as string]
[lib.clojure-tools-logging.logger :as logger]))
(set! *warn-on-reflection* true)
••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••••
(def ^:privat... | |
9e9c9278ca206eee0e58e3a40b4ab51dbede81f8d8e7b317442569f1c55b012a | UU-ComputerScience/uhc | data-field1.hs | -- data fields consistency: wrong
% % inline test ( ) --
data X
= X { b :: Int, a, c :: Char }
| Y { b :: Char }
x1 = X { c = ' y ' , a = ' x ' , b = 444 }
x1 = X 3 'z' 'a'
main = c x1
| null | https://raw.githubusercontent.com/UU-ComputerScience/uhc/f2b94a90d26e2093d84044b3832a9a3e3c36b129/EHC/test/regress/7/data-field1.hs | haskell | data fields consistency: wrong
|
data X
= X { b :: Int, a, c :: Char }
| Y { b :: Char }
x1 = X { c = ' y ' , a = ' x ' , b = 444 }
x1 = X 3 'z' 'a'
main = c x1
|
71b3f35c29849f29aa73ad6412425877f5ec839d583919664511be5a76a1bc93 | acid-state/acid-state | ChangeVersion.hs | {-# LANGUAGE TemplateHaskell #-}
{-# LANGUAGE TypeFamilies #-}
module ChangeVersion (main, test) where
import Data.Acid
import Control.Exception
import Control.Monad
import Data.SafeCopy
import System.Directory
import System.Environment
----------... | null | https://raw.githubusercontent.com/acid-state/acid-state/60b75c5cb75fdd760c3f2a2c3f0394a620cf2e8c/examples/errors/ChangeVersion.hs | haskell | # LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
----------------------------------------------------
The version number difference is important here, as safecopy has no
way to reliably notice if we change a type and fail to update its
migration history. In some cases the serialised data will fail to... |
module ChangeVersion (main, test) where
import Data.Acid
import Control.Exception
import Control.Monad
import Data.SafeCopy
import System.Directory
import System.Environment
The structure that we want to encapsulate
data FirstState = FirstState String
... |
a1a2e7c0face870fbe498e10873c49e5935a4176eb58c7dccc60272e3c8e31cd | jberryman/chan-benchmarks | TestAtomics.hs | import Control.Concurrent
import Data.Atomics.Counter
import Data.Atomics
import Data.IORef
import Control.Monad
import GHC.Conc
import Control.Exception(evaluate)
import qualified Data.Set as Set
import Data.List
main = do
testCounterOverflow
testConsistentSuccessFailure
counterTest
testCAS_ABA_0
... | null | https://raw.githubusercontent.com/jberryman/chan-benchmarks/a59fd96889457987452aa4fe9b7c5d658aea67a6/TestAtomics.hs | haskell | or something more fancy?
make sure our test is working
We don't use this property
Test these assumptions:
which wasn't sent by another thread, which isn't ideal
any failures in either should be marked as successes in the other
()
{-# NOINLINE True #-}
let true = True
returns False
same
testCAS_ABA_... | import Control.Concurrent
import Data.Atomics.Counter
import Data.Atomics
import Data.IORef
import Control.Monad
import GHC.Conc
import Control.Exception(evaluate)
import qualified Data.Set as Set
import Data.List
main = do
testCounterOverflow
testConsistentSuccessFailure
counterTest
testCAS_ABA_0
... |
08d8d40066f74b9b218eed53e75f25702634c886e8de3102657f73662eb6d523 | ekmett/lens | Lens.hs | # LANGUAGE CPP #
{-# LANGUAGE Rank2Types #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoMonomorphismRestriction #
# LANGUAGE PatternSynonyms #
# LANGUAGE ViewPatterns #
#ifdef TRUSTWORTHY
# LANGUAGE Trustworthy #
#endif
#include "lens-common.h"
---... | null | https://raw.githubusercontent.com/ekmett/lens/479966809048787402adb0ff4d03525b8a65ada6/src/Control/Exception/Lens.hs | haskell | # LANGUAGE Rank2Types #
---------------------------------------------------------------------------
|
Module : Control.Exception.Lens
License : BSD-style (see the file LICENSE)
Stability : provisional
Portability : Control.Exception
that we can model with prisms and isomorphisms.
Additional comb... | # LANGUAGE CPP #
# LANGUAGE FlexibleInstances #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NoMonomorphismRestriction #
# LANGUAGE PatternSynonyms #
# LANGUAGE ViewPatterns #
#ifdef TRUSTWORTHY
# LANGUAGE Trustworthy #
#endif
#include "lens-common.h"
Copyright : ( C ) 2012 -... |
9180f2ce1ff828c63fc488217b877c50ef06c20d013fc1b4bc3fcc62b29636ec | kellymclaughlin/rebar3-eqc-plugin | rebar3_eqc.erl | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
%% ex: ts=4 sw=4 et
-module(rebar3_eqc).
-behaviour(provider).
-export([init/1,
do/1,
format_error/1]).
%% Avoid including `eqc.hrl` (`-include_lib("eqc/include/eqc.hrl").`) unnecessarily, in order to ease build.
-define(PROVIDER, e... | null | https://raw.githubusercontent.com/kellymclaughlin/rebar3-eqc-plugin/aaab3543cef712a03482da5ab87eb6ed077c7cb3/src/rebar3_eqc.erl | erlang | ex: ts=4 sw=4 et
Avoid including `eqc.hrl` (`-include_lib("eqc/include/eqc.hrl").`) unnecessarily, in order to ease build.
===================================================================
Public API
===================================================================
TODO: add support for command line option
=... | -*- erlang - indent - level : 4;indent - tabs - mode : nil -*-
-module(rebar3_eqc).
-behaviour(provider).
-export([init/1,
do/1,
format_error/1]).
-define(PROVIDER, eqc).
-define(DEPS, [compile]).
-define(PRV_ERROR(Reason), {error, {?MODULE, Reason}}).
-spec init(rebar_state:t()) -> {ok, reba... |
a8b95289bd1daf431397dd2c1b1740b457e3692d18498dbb9adcbb3042bf33db | heyoka/faxe | esp_tcp_recv.erl | %%%-------------------------------------------------------------------
@author
( C ) 2019 , < COMPANY >
%%% @doc
%%% This node connects to a tcp endpoint and awaits data in a special format, which is defined
%%% by the parser parameter, the parser will then try to convert the data to faxe format and emit the
%%% ... | null | https://raw.githubusercontent.com/heyoka/faxe/058bb0e542bb28bfa235b271d778632c512dbb65/apps/faxe/src/components/esp_tcp_recv.erl | erlang | -------------------------------------------------------------------
@doc
This node connects to a tcp endpoint and awaits data in a special format, which is defined
by the parser parameter, the parser will then try to convert the data to faxe format and emit the
result
<< Length_Header:16/integer, Data:{Length_Head... | @author
( C ) 2019 , < COMPANY >
At the moment tcp messages must start with a 2 byte header denoting the length of the following data .
Created : 27 . May 2019 09:00
-module(esp_tcp_recv).
-author("heyoka").
-behavior(df_component).
-include("faxe.hrl").
-export([init/3, process/3, options/0, handle_info/2,... |
ee5d54745eac742e7ce7431d502b6a1aa7291d1542d69bbceef850d56e79b56b | UnixJunkie/omlr | gnuplot.ml |
open Printf
module L = BatList
let regr_plot title actual preds =
let x_min, x_max = L.min_max ~cmp:BatFloat.compare actual in
let y_min, y_max = L.min_max ~cmp:BatFloat.compare preds in
let xy_min = min x_min y_min in
let xy_max = max x_max y_max in
let data_fn = Filename.temp_file "RFR_regr_data_" ".txt"... | null | https://raw.githubusercontent.com/UnixJunkie/omlr/e6f9302e01c31663d98c7b207f5e43554cbdfdd0/src/gnuplot.ml | ocaml |
open Printf
module L = BatList
let regr_plot title actual preds =
let x_min, x_max = L.min_max ~cmp:BatFloat.compare actual in
let y_min, y_max = L.min_max ~cmp:BatFloat.compare preds in
let xy_min = min x_min y_min in
let xy_max = max x_max y_max in
let data_fn = Filename.temp_file "RFR_regr_data_" ".txt"... | |
60d90ea8934866125e8afe5f4f426b9efa895d21ca3f5797e97feebf3e690e66 | simedw/Kandidat | STGParser.hs | module Parser.STGParser where
import Text.ParserCombinators.Parsec
import Text.ParserCombinators.Parsec.Token
import Text.ParserCombinators.Parsec.Expr
import Text.ParserCombinators.Parsec.Prim
import Data.Maybe
import Control.Monad
import Stg.AST
import Shared.Primitives
-- The reserved operators
operators :: [Str... | null | https://raw.githubusercontent.com/simedw/Kandidat/fbf68edf5b003aba2ce13dac32ee1b94172d57d8/src/Parser/STGParser.hs | haskell | The reserved operators
The keywords
Creating the lexer
The state is Nothing if not parsing sugar,
otherwise it is Just the next integer in the name supply.
Run the parser
Parse an identifier
f = obj
Parses an expression, which is expr' between infix operators.
(does this work?)
This is very unfortunate that ... | module Parser.STGParser where
import Text.ParserCombinators.Parsec
import Text.ParserCombinators.Parsec.Token
import Text.ParserCombinators.Parsec.Expr
import Text.ParserCombinators.Parsec.Prim
import Data.Maybe
import Control.Monad
import Stg.AST
import Shared.Primitives
operators :: [String]
operators = ["->", "=... |
40f0512dd0c949ba7208625f5df1d9668c3560b7b123ff56b3ddf442aafa6107 | ates/netspire-core | mod_eap_md5.erl | -module(mod_eap_md5).
-behaviuor(gen_module).
%% API
-export([verify_eap/6]).
%% gen_module callbacks
-export([start/1, stop/0]).
-include("eap.hrl").
-include("../netspire.hrl").
-include("../radius/radius.hrl").
-define(CHALLENGE_LEN, 16).
-record(eap_md5_state, {username, challenge, state}).
start(_Options) -... | null | https://raw.githubusercontent.com/ates/netspire-core/746c0f254aa6f2669040d954096b4a95ae58b3ce/src/modules/mod_eap_md5.erl | erlang | API
gen_module callbacks
Send EAP-MD5 Challenge
| -module(mod_eap_md5).
-behaviuor(gen_module).
-export([verify_eap/6]).
-export([start/1, stop/0]).
-include("eap.hrl").
-include("../netspire.hrl").
-include("../radius/radius.hrl").
-define(CHALLENGE_LEN, 16).
-record(eap_md5_state, {username, challenge, state}).
start(_Options) ->
?INFO_MSG("Starting dynam... |
2b742f2f405bcb3b762e825bcb451443a3293a13ffc3e5101f0c08d306feaa24 | lijunsong/fl-compiler | test_basic_block.ml | open Utils
open OUnit
open Ir
open Batteries
let newl () = LABEL(Temp.new_label())
let printer s : string =
(String.concat "\n" (List.map Ir.stmt_to_string s))
let assert_basic_block ir expected =
(fun ctx ->
let result, _ = Basic_block.basic_blocks ir in
let result' = List.flatten (Basic_block.to_stmt... | null | https://raw.githubusercontent.com/lijunsong/fl-compiler/6d2938855012a7a0a8767dc342f6abb454c43eec/tests/test_basic_block.ml | ocaml | dead
dead
because trace generate exit label | open Utils
open OUnit
open Ir
open Batteries
let newl () = LABEL(Temp.new_label())
let printer s : string =
(String.concat "\n" (List.map Ir.stmt_to_string s))
let assert_basic_block ir expected =
(fun ctx ->
let result, _ = Basic_block.basic_blocks ir in
let result' = List.flatten (Basic_block.to_stmt... |
0dfb3c99823783084d558c9dfabb79d7a0963858653b7a8f641056bf6b4f9fe3 | solita/mnt-teet | contract_db.clj | (ns teet.contract.contract-db
(:require [datomic.client.api :as d]
[teet.user.user-model :as user-model]
[teet.util.datomic :as du]
[teet.company.company-model :as company-model]
[teet.user.user-db :as user-db]
[clojure.walk :as walk])
(:import (java.util ... | null | https://raw.githubusercontent.com/solita/mnt-teet/051bf6fedc9472838620f1d49b3e87aac5a1266b/app/backend/src/clj/teet/contract/contract_db.clj | clojure | For contracts that are targeting tasks...
... related contracts are the contracts that are
targeting activity of the task.
For contracts that are targeting the activity...
related contracts are the contracts that are
targeting the tasks of the activity
Signed - when start of work is not given
Deadline overdue - ... | (ns teet.contract.contract-db
(:require [datomic.client.api :as d]
[teet.user.user-model :as user-model]
[teet.util.datomic :as du]
[teet.company.company-model :as company-model]
[teet.user.user-db :as user-db]
[clojure.walk :as walk])
(:import (java.util ... |
cb026a864620182594eb30e06a726a23e396e8fd8d8caeb735a04810208e8112 | berke/aurochs | bytes.ml | Bytes
open Int_operators;;
type sink = {
sk_put_byte : int -> unit;
sk_put_string : string -> unit
};;
let put_byte sk b = sk.sk_put_byte b;;
let put_string sk b = sk.sk_put_string b;;
let put_int16 sk x =
let f x = put_byte sk x in
f ((x lsr 8) land 255);
f (x land 255)
;;
let put_int sk x =
let f =... | null | https://raw.githubusercontent.com/berke/aurochs/637bdc0d4682772837f9e44112212e7f20ab96ff/util/bytes.ml | ocaml | Bytes
open Int_operators;;
type sink = {
sk_put_byte : int -> unit;
sk_put_string : string -> unit
};;
let put_byte sk b = sk.sk_put_byte b;;
let put_string sk b = sk.sk_put_string b;;
let put_int16 sk x =
let f x = put_byte sk x in
f ((x lsr 8) land 255);
f (x land 255)
;;
let put_int sk x =
let f =... | |
842716a416a779d9a22350e9fd625d65550f72b4edf34448f826798ace9b1603 | goldfirere/thesis | Vector.hs | # LANGUAGE CPP
, FlexibleInstances
, MultiParamTypeClasses
, TypeFamilies
, Rank2Types
, BangPatterns
#
, FlexibleInstances
, MultiParamTypeClasses
, TypeFamilies
, Rank2Types
, BangPatterns
#-}... | null | https://raw.githubusercontent.com/goldfirere/thesis/22f066bc26b1147530525aabb3df686416b3e4aa/cab/vector-0.10.12.3/Data/Vector.hs | haskell | |
Module : Data.Vector
License : BSD-style
Stability : experimental
Portability : non-portable
A library for boxed vectors (that is, polymorphic arrays capable of
* mutable
* immutable
and support a rich interface of both list-like operations, and bulk
array operations.
* Boxed vectors
... | # LANGUAGE CPP
, FlexibleInstances
, MultiParamTypeClasses
, TypeFamilies
, Rank2Types
, BangPatterns
#
, FlexibleInstances
, MultiParamTypeClasses
, TypeFamilies
, Rank2Types
, BangPatterns
#-}... |
5d41cb255eb948a762bf0cb63cbce3bcd45203c31d13e87d9b0c7c28e64459df | nicdard/compiler-design-eth-tests | nicdard.ml | open Assert
Indent a string , apply one or more \t at each line .
let indent (n:int) (s:string) =
let indent_chars = (String.make n '\t') in
String.split_on_char '\n' s
|> String.concat @@ "\n" ^ indent_chars
|> (^) indent_chars
(* Equality assertion which explain expected value on failure. *)
let expect_... | null | https://raw.githubusercontent.com/nicdard/compiler-design-eth-tests/4faadee1aea539b832637982589431096c11696e/03/nicdard.ml | ocaml | Equality assertion which explain expected value on failure.
Equality assertion which explain expected value on failure.
Add prefix to tests
The following tests files where already included in the project material, but they were not run in gradedtests.ml. | open Assert
Indent a string , apply one or more \t at each line .
let indent (n:int) (s:string) =
let indent_chars = (String.make n '\t') in
String.split_on_char '\n' s
|> String.concat @@ "\n" ^ indent_chars
|> (^) indent_chars
let expect_eq (s:'a -> string) (v1:'a) (v2:'a): assertion =
fun () -> if v1... |
dbd0be363a8e8aa40ea9348020ff4c7a945e12255c27929f629343c303b1ada6 | rabbitmq/rabbitmq-common | rabbit_auth_mechanism.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(rabbit_auth_mechanism).
-behaviour(rabbi... | null | https://raw.githubusercontent.com/rabbitmq/rabbitmq-common/67c4397ffa9f51d87f994aa4db4a68e8e95326ab/src/rabbit_auth_mechanism.erl | erlang |
A description.
If this mechanism is enabled, should it be offered for a given socket?
Called before authentication starts. Should create a state
object to be passed through all the stages of authentication.
Handle a stage of authentication. Possible responses:
{ok, User}
Authentication succeeded, and here'... | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
-module(rabbit_auth_mechanism).
-behaviour(rabbit_regi... |
9adcc3f0c1e33d5202b31083de811662a5431e823996cc8a2ed206420cb85a14 | achirkin/vulkan | VK_QCOM_render_pass_shader_resolve.hs | # OPTIONS_HADDOCK not - home #
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE MagicHash #-}
# LANGUAGE PatternSynonyms #
{-# LANGUAGE Strict #-}
{-# LANGUAGE ViewPatterns #-}
module Graphics.Vulkan.Ext.VK_QCOM_render_pass_shader_resolve
* Vulkan extension : @VK_QCOM_render_pass_shader_resolve@
... | null | https://raw.githubusercontent.com/achirkin/vulkan/b2e0568c71b5135010f4bba939cd8dcf7a05c361/vulkan-api/src-gen/Graphics/Vulkan/Ext/VK_QCOM_render_pass_shader_resolve.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE MagicHash #
# LANGUAGE Strict #
# LANGUAGE ViewPatterns #
|
supported: @vulkan@
author: @QCOM@
type: @device@
Extension number: @172@
# INLINE _VK_QCOM_RENDER_PASS_SHADER_RESOLVE_EXTENSION_NAME # | # OPTIONS_HADDOCK not - home #
# LANGUAGE PatternSynonyms #
module Graphics.Vulkan.Ext.VK_QCOM_render_pass_shader_resolve
* Vulkan extension : @VK_QCOM_render_pass_shader_resolve@
contact :
VK_QCOM_RENDER_PASS_SHADER_RESOLVE_SPEC_VERSION,
pattern VK_QCOM_RENDER_PASS_SHADER_RESOLVE_SPEC_VERSION,... |
728a75a16c503b09bfdfd374c44d4f82e23e5bc64a15c1dd7b0327586ae7feef | ZeusWPI/contests | caught.hs | import Control.Applicative ((<$>))
import Control.Monad (forM_, replicateM_)
import Data.Set (Set)
import qualified Data.Set as S
newtype C = C {unC :: Int}
circle :: Int -> Int -> ([C] -> [C]) -> ([C] -> [C]) -> Bool -> [C]
-> (Int, [C], ([C] -> [C]), Bool)
circle _ x re el e [] = (x, re [], el, e)
circle n x... | null | https://raw.githubusercontent.com/ZeusWPI/contests/d78aec91be3ce32a436d160cd7a13825d36bbf3a/2012-vpw/caught.hs | haskell | import Control.Applicative ((<$>))
import Control.Monad (forM_, replicateM_)
import Data.Set (Set)
import qualified Data.Set as S
newtype C = C {unC :: Int}
circle :: Int -> Int -> ([C] -> [C]) -> ([C] -> [C]) -> Bool -> [C]
-> (Int, [C], ([C] -> [C]), Bool)
circle _ x re el e [] = (x, re [], el, e)
circle n x... | |
d97dd861eecae5b97772b88fabd6db76b054cad124f248cf11ac5371a709333f | vereis/jarlang | erl_pp.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2017 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/vereis/jarlang/72105b79c1861aa6c4f51c3b50ba695338aafba4/src/erl/lib/stdlib/erl_pp.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 1996 - 2017 . 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(erl_pp).
Pretty printer for Erlang code in the same format as returned from
-export([form/1,form/2,
... |
51c1c47b3541949e85a10671638add982e6a8311a6ac10a2d07677cda24dd6eb | johnyob/dromedary | union_find.ml | (*****************************************************************************)
(* *)
Dromedary
(* *)
... | null | https://raw.githubusercontent.com/johnyob/dromedary/721e6ac3df867c54af669d5a68cd9536341a1910/lib/unifier/union_find.ml | ocaml | ***************************************************************************
... | Dromedary
, University of Cambridge
Copyright 2021 .
All rights reserved . This file is distributed under the terms of the MIT
open Base
This module implements an... |
b242b7683a4c712e56b273af0ba5049aed3c0e85456582881446667a75a2aee3 | antono/guix-debian | parallel.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013,2014 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 3 of the... | null | https://raw.githubusercontent.com/antono/guix-debian/85ef443788f0788a62010a942973d4f7714d10b4/gnu/packages/parallel.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2013,2014 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages parallel)
#:use-module (guix packages)
#:use-module (guix licenses)
#:use-... |
7dd4bb0214841b7c06b3265edb6ef01d33bdb8b0def35c558786730b8510ae36 | TrustInSoft/tis-interpreter | eval_non_linear.mli | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of Frama - C.
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/plugins/value/legacy/eval_non_linear.mli | ocaml | ************************************************************************
alternatives)
... | Modified by TrustInSoft
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Softwa... |
c0c386ad79beb8aa39f41c0a7b2c63513519d3d1c0dc4cd2af583f96138e175a | input-output-hk/ouroboros-network | TestBlock.hs | # LANGUAGE BangPatterns #
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveGeneric #-}
{-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DerivingVia #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE Flexibl... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/6fcd153ba865e5efc2c31b547ae07d84a7150f87/ouroboros-consensus-test/src/Test/Util/TestBlock.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DerivingVia #
# LANGUAGE GADTs #
# LANGUAGE PatternSynonyms #
# LANGUAGE UndecidableInstances #
... | # LANGUAGE BangPatterns #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables ... |
bda90e7f5e372b090bee8323b5ef67900af4625abaacfbec00f379b73b92e626 | mark-watson/haskell_tutorial_cookbook_examples | TestSparqlClient.hs | simple experiments with the excellent HSparql library
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Database.HSparql.Connection (BindingValue(Bound))
import Data.RDF hiding (triple)
import Database.HSparql.QueryGenerator
import Database.HSparql.Connection (selectQuery)
webBrowserSelect :: Query... | null | https://raw.githubusercontent.com/mark-watson/haskell_tutorial_cookbook_examples/0f46465b67d245fa3853b4e320d79b7d7234e061/SparqlClient/TestSparqlClient.hs | haskell | # LANGUAGE OverloadedStrings #
print sq1
print sq2
print sq3 | simple experiments with the excellent HSparql library
module Main where
import Database.HSparql.Connection (BindingValue(Bound))
import Data.RDF hiding (triple)
import Database.HSparql.QueryGenerator
import Database.HSparql.Connection (selectQuery)
webBrowserSelect :: Query SelectQuery
webBrowserSelect = do
... |
30e37f172281bfba6bcbb38bcdd636b72f372e1e17cf843d5361c32849738942 | mwotton/roboservant | Server.hs | {-# LANGUAGE RankNTypes #-}
# LANGUAGE TypeApplications #
# LANGUAGE PolyKinds #
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE Undec... | null | https://raw.githubusercontent.com/mwotton/roboservant/c61d4868cc1a7a0bb5d8f1c3996305c82da13879/src/Roboservant/Types/ReifiedApi/Server.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE GADTs #
| TODO improve this
_ ->
AnEndpoint :: Server endpoint -> Bundled endpoints -> Bundled (endpoint ': endpoints) | # LANGUAGE TypeApplications #
# LANGUAGE PolyKinds #
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE UndecidableInstances #
# LANGUAGE CPP #
# LANGUAGE DataK... |
20a36b9b4c143b81f23b0d20b082dbafe3bc07b22670d2002e563c30b7d7e864 | G-Corp/vice | vice_thumbnails_tests.erl | -module(vice_thumbnails_tests).
-include_lib("eunit/include/eunit.hrl").
hms_test_() ->
{setup,
fun() ->
vice:start(),
ok
end,
fun(_) ->
vice:stop(),
application:stop(poolgirl),
ok
end,
[
fun() ->
?assertEqual(
{error, 22.233},
vice:... | null | https://raw.githubusercontent.com/G-Corp/vice/de0fab6441e7be9fc807d85ca21899d1fc2b533a/test/vice_thumbnails_tests.erl | erlang | -module(vice_thumbnails_tests).
-include_lib("eunit/include/eunit.hrl").
hms_test_() ->
{setup,
fun() ->
vice:start(),
ok
end,
fun(_) ->
vice:stop(),
application:stop(poolgirl),
ok
end,
[
fun() ->
?assertEqual(
{error, 22.233},
vice:... | |
31c39d50ac68f44fa82dcb16c33ea2dc016938012d87f6398ae90b4ebb071421 | huangjs/cl | zsyr2k.lisp | ;;; Compiled by f2cl version:
( " f2cl1.l , v 1.215 2009/04/07 22:05:21 rtoy Exp $ "
" f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ "
" f2cl5.l , v 1.200 2009/01/19 02:38:17 rtoy Exp $ "
" f2cl6.l ,... | null | https://raw.githubusercontent.com/huangjs/cl/96158b3f82f82a6b7d53ef04b3b29c5c8de2dbf7/lib/maxima/share/lapack/blas/zsyr2k.lisp | lisp | Compiled by f2cl version:
Options: ((:prune-labels nil) (:auto-save t) (:relaxed-array-decls t)
(:coerce-assigns :as-needed) (:array-type ':array)
(:array-slicing t) (:declare-common nil)
(:float-format double-float)) | ( " f2cl1.l , v 1.215 2009/04/07 22:05:21 rtoy Exp $ "
" f2cl2.l , v 1.37 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl3.l , v 1.6 2008/02/22 22:19:33 rtoy Exp $ "
" f2cl4.l , v 1.7 2008/02/22 22:19:34 rtoy Exp $ "
" f2cl5.l , v 1.200 2009/01/19 02:38:17 rtoy Exp $ "
" f2cl6.l , v 1.48 2008/08/24 00:56:27 rt... |
cbc3e7db590fa39de59fddc6bb4e1312745c24b3dd498c5c430efb9ae255b5c0 | rtrusso/scp | preamble.scm | (need sasm/machdesc)
(define (nasm-x86-preamble)
(machine-description
;; preamble ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; directive
(instruction (input-pattern `(global-preamble))
(rewrite-rule ("bits 32")
("section .text")
... | null | https://raw.githubusercontent.com/rtrusso/scp/2051e76df14bd36aef81aba519ffafa62b260f5c/src/sasm/nasmx86/preamble.scm | scheme | preamble ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
directive
| (need sasm/machdesc)
(define (nasm-x86-preamble)
(machine-description
(instruction (input-pattern `(global-preamble))
(rewrite-rule ("bits 32")
("section .text")
("")))
(instruction (input-pattern `(data-preamble))
... |
ab74eec4351c905c4315cb2a6eec052a8c600acdf1fcbc89eb4ff29725d0a10b | pfdietz/ansi-test | tree-equal.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sat Jun 14 2003
Contains : Tests of TREE - EQUAL
(deftest tree-equal.1
(notnot-mv (tree-equal 'a 'a))
t)
(deftest tree-equal.2
(tree-equal 'a 'b)
nil)
(deftest tree-equal.3
(notnot-mv (tree-equal (list 'a 'b (list 'c 'd))
... | null | https://raw.githubusercontent.com/pfdietz/ansi-test/3f4b9d31c3408114f0467eaeca4fd13b28e2ce31/cons/tree-equal.lsp | lisp | -*- Mode: Lisp -*-
Keywords tests
Error tests | Author :
Created : Sat Jun 14 2003
Contains : Tests of TREE - EQUAL
(deftest tree-equal.1
(notnot-mv (tree-equal 'a 'a))
t)
(deftest tree-equal.2
(tree-equal 'a 'b)
nil)
(deftest tree-equal.3
(notnot-mv (tree-equal (list 'a 'b (list 'c 'd))
(list 'a 'b (list 'c 'd... |
1792a0240286a42d0202bc927f86cb50ef92a8e75f5789c003f2abea08811ea8 | kappamodeler/kappa | find_cycles.ml | open Tools
open Tools2
open Data_structures
open Pb_sig
open Error_handler
type algo = Exploration | Warshall
let algo = Warshall
let debug = false
let exit i =
frozen_unsafe None (Some "Complx") (Some "find_cycles.ml") None (Some (string_of_int i)) (fun () -> raise Exit)
type io = IN of (string*string) ... | null | https://raw.githubusercontent.com/kappamodeler/kappa/de63d1857898b1fc3b7f112f1027768b851ce14d/complx_rep/backend/contact_map/find_cycles.ml | ocaml |
Exploration
Exploration
let _ = print_string "X: " in
let _ = print_io x in
let _ = print_string "\nY: " in
let _ = print_io y in
let _ = print_newline () in
let _ = print_path (fst path) in
let _ = print_newline () in
let _ = print_newline () in | open Tools
open Tools2
open Data_structures
open Pb_sig
open Error_handler
type algo = Exploration | Warshall
let algo = Warshall
let debug = false
let exit i =
frozen_unsafe None (Some "Complx") (Some "find_cycles.ml") None (Some (string_of_int i)) (fun () -> raise Exit)
type io = IN of (string*string) ... |
04ae348516d23abd78ad67fc64e40dc16f26c93968c456918a636ffe9a79e12a | re-path/studio | views.cljs | (ns repath.studio.canvas-frame.views
(:require
[reagent.core :as ra]
[reagent.dom :as dom]
[reagent.dom.server :as server]
[re-frame.core :as rf]
[repath.studio.elements.views :refer [element-menu]]
[repath.studio.tools.base :as tools]
[repath.studio.mouse :as mouse]
[repath.studio.styles :as ... | null | https://raw.githubusercontent.com/re-path/studio/ea5b89f225cb448987f3b9752172720ee4226051/src/repath/studio/canvas_frame/views.cljs | clojure | We observe the frame to get its contentRect on resize.
This is a different browsing context inside an iframe.
We need to simulate the events to the parent window. | (ns repath.studio.canvas-frame.views
(:require
[reagent.core :as ra]
[reagent.dom :as dom]
[reagent.dom.server :as server]
[re-frame.core :as rf]
[repath.studio.elements.views :refer [element-menu]]
[repath.studio.tools.base :as tools]
[repath.studio.mouse :as mouse]
[repath.studio.styles :as ... |
19dea8b764f21b391be719916a3238508b3e0134bee93eb17d22ae163d6ce039 | mirage/bechamel | clock_windows.ml | external clock_windows_get_time : unit -> int64 = "clock_windows_get_time"
external clock_windows_init : unit -> unit = "clock_windows_init"
let () = clock_windows_init ()
let now () = clock_windows_get_time ()
| null | https://raw.githubusercontent.com/mirage/bechamel/7a0aebef3c2ec266db97385264be74274bdc4765/lib/monotonic_clock/clock_windows.ml | ocaml | external clock_windows_get_time : unit -> int64 = "clock_windows_get_time"
external clock_windows_init : unit -> unit = "clock_windows_init"
let () = clock_windows_init ()
let now () = clock_windows_get_time ()
| |
80b6bff42f27b3d281b7b5b15004996e02591b12f869459b17425253d50b7590 | kronkltd/jiksnu | registry.cljs | (ns jiksnu.registry)
(def pallete-color (or (some-> js/window .-themeColor) "blue"))
(def initial-plugins
["angular-clipboard"
"angularMoment"
"btford.markdown"
"cfp.hotkeys"
"geolocation"
"hljs"
"js-data"
"lfNgMdFileInput"
"ngMaterial"
"ngMdIcons"
"ngSanitize"
"ngWebSocket"
"ui.... | null | https://raw.githubusercontent.com/kronkltd/jiksnu/8c91e9b1fddcc0224b028e573f7c3ca2f227e516/src-cljs/jiksnu/registry.cljs | clojure | (ns jiksnu.registry)
(def pallete-color (or (some-> js/window .-themeColor) "blue"))
(def initial-plugins
["angular-clipboard"
"angularMoment"
"btford.markdown"
"cfp.hotkeys"
"geolocation"
"hljs"
"js-data"
"lfNgMdFileInput"
"ngMaterial"
"ngMdIcons"
"ngSanitize"
"ngWebSocket"
"ui.... | |
1faeee8a44a35466aac972b20b9ba5c1dc4cd1a0e872695e89e9988011711ab0 | dtqec/aether | dpu-helpers.lisp | process / dpu - helpers.lisp
;;;;
;;;; Defines helper functions, macros, and commands to be made available within
;;;; the body of DEFINE-PROCESS-UPKEEP.
(in-package #:aether)
;;;
;;; flets
;;;
(define-dpu-flet process-die ()
"PROCESS-DIE causes the current PROCESS to release its public mailbox and exit the pare... | null | https://raw.githubusercontent.com/dtqec/aether/5f81bf9f3663e0c90d260155f2ecf819ebf951a9/src/process/dpu-helpers.lisp | lisp |
Defines helper functions, macros, and commands to be made available within
the body of DEFINE-PROCESS-UPKEEP.
flets
macros
it's more like a busywaiting callback?
no finalization after finishing the receive
TODO: the pattern "block until some handle in a list is free" goes by the
name "select" t... | process / dpu - helpers.lisp
(in-package #:aether)
(define-dpu-flet process-die ()
"PROCESS-DIE causes the current PROCESS to release its public mailbox and exit the parent SIMULATION loop."
(setf active? nil))
(define-dpu-flet register ()
"Adds logging functionality to REGISTER."
(initialize-and-return (... |
aad4cb0a455616bc7f5b267cdca4650e7c43bb39183c0fe1eab5dfd1d507882e | abooij/sudbury | Runtime.hs | |
Module : Graphics . Sudbury . Protocol . Runtime
Description : Protocol data without docs : can project XML protocols to runtime protocols
Copyright : ( c ) , 2015 - 2017
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
Module : Graphics.Sudbury.Protoc... | null | https://raw.githubusercontent.com/abooij/sudbury/a9ab559728487d78469db73ecf516d145b6c21ec/Graphics/Sudbury/Protocol/Runtime.hs | haskell | |
Module : Graphics . Sudbury . Protocol . Runtime
Description : Protocol data without docs : can project XML protocols to runtime protocols
Copyright : ( c ) , 2015 - 2017
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
Module : Graphics.Sudbury.Protoc... | |
f53ac94dbc490c6af7a06e261c929a1ad88008bc5470fd91d76b6bfae48baec2 | OCamlPro/alt-ergo | satml_types.ml | (******************************************************************************)
(* *)
Alt - Ergo : The SMT Solver For Software Verification
Copyright ( C ) 2013 - 2018
(* ... | null | https://raw.githubusercontent.com/OCamlPro/alt-ergo/4463ed0b3c70f7b2bc16baaa1eff93e594205e15/src/lib/structures/satml_types.ml | ocaml | ****************************************************************************
This file is distributed under the terms of the license indicated
in the ... | Alt - Ergo : The SMT Solver For Software Verification
Copyright ( C ) 2013 - 2018
module ME = Expr.Map
module E = Expr
module Hs = Hstring
module type ATOM = sig
type var =
{ vid : int;
pa : atom;
na : atom;
mutable weight... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.