_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 |
|---|---|---|---|---|---|---|---|---|
aaac49b26b0c9048acc0dc4e1647b8720e6a446253118e20fdaf53cbabf00e0a | andrejbauer/plzoo | machine.ml | * A simple machine with a program , RAM , program counter and a stack pointer . The program
is an array of instructions . The stack grows downwards . Arithmetical and boolean
operations operate on the stack .
is an array of instructions. The stack grows downwards. Arithmetical and boolean
operations ope... | null | https://raw.githubusercontent.com/andrejbauer/plzoo/ae6041c65baf1eebf65a60617819efeb8dcd3420/src/comm/machine.ml | ocaml | * The machine instructions.
no operation
pop from stack and store in the given location
push from given location onto stack
push integer constant onto stack
addition
subtraction
multiplication
division
remainder
equal
less than
conjunction
disjunction
negation
relative jump
pop from stac... | * A simple machine with a program , RAM , program counter and a stack pointer . The program
is an array of instructions . The stack grows downwards . Arithmetical and boolean
operations operate on the stack .
is an array of instructions. The stack grows downwards. Arithmetical and boolean
operations ope... |
b45b76667426a33fdbc0591b815e71de9f63dde590526317b2c2ea5272858ac1 | exoscale/clojure-kubernetes-client | v1_stateful_set_update_strategy.clj | (ns clojure-kubernetes-client.specs.v1-stateful-set-update-strategy
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1-rolling-update-stateful-set-strategy :refer :all]
)
(:import (java.io File)))
(declare v1-stateful-set-upda... | null | https://raw.githubusercontent.com/exoscale/clojure-kubernetes-client/79d84417f28d048c5ac015c17e3926c73e6ac668/src/clojure_kubernetes_client/specs/v1_stateful_set_update_strategy.clj | clojure | (ns clojure-kubernetes-client.specs.v1-stateful-set-update-strategy
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1-rolling-update-stateful-set-strategy :refer :all]
)
(:import (java.io File)))
(declare v1-stateful-set-upda... | |
210efc6a178cdc577b6c786a3c7a3309876d1de4a5561109c5c482fdfdd7241f | janestreet/sexp | main_to_csv.ml | open Core
open Sexp_app
let myprotect f x =
try Some (f x) with
| _ -> None
;;
let main ~two_pass_processing ~view_atoms_as_strings ~delimiter:sep =
let sexps =
let channel = Lexing.from_channel In_channel.stdin in
Lazy_list.build ~seed:() ~f:(fun () ->
match myprotect Sexp.scan_sexp channel with
... | null | https://raw.githubusercontent.com/janestreet/sexp/2414e8f11fadff4a33fff87bd79fb614ee7642f3/bin/main_to_csv.ml | ocaml | open Core
open Sexp_app
let myprotect f x =
try Some (f x) with
| _ -> None
;;
let main ~two_pass_processing ~view_atoms_as_strings ~delimiter:sep =
let sexps =
let channel = Lexing.from_channel In_channel.stdin in
Lazy_list.build ~seed:() ~f:(fun () ->
match myprotect Sexp.scan_sexp channel with
... | |
3611a195151e16ef327749f1efbf676a52517a8c0d2a5401f7a69259bc7d4de4 | mmontone/gestalt | dlist.lisp | (in-package :dlist)
(defstruct (dlist
(:print-function print-dlist))
head
tail)
(defun print-dlist (dlist stream &rest args)
(declare (ignore args))
(print-unreadable-object (dlist stream :identity t :type t)
(format stream "~A" (dlist-elements dlist))))
(defstruct (dlink
(:print-function pri... | null | https://raw.githubusercontent.com/mmontone/gestalt/fd019c0ca03b4efc73b9ddd3db1e3ed211233428/deps/util/dlist.lisp | lisp | (in-package :dlist)
(defstruct (dlist
(:print-function print-dlist))
head
tail)
(defun print-dlist (dlist stream &rest args)
(declare (ignore args))
(print-unreadable-object (dlist stream :identity t :type t)
(format stream "~A" (dlist-elements dlist))))
(defstruct (dlink
(:print-function pri... | |
f69d577a297e26cf2b6df785645c683ba96a002970eef1f420f9cf6e842095c8 | aphyr/mastodon-utils | project.clj | (defproject com.aphyr/mastodon-utils "0.1.0-SNAPSHOT"
:description "Utilities for working with Mastodon"
:url "-utils"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:dependencies [[cheshire "5.11.0"]
[clj-http "3.12.3"]
[do... | null | https://raw.githubusercontent.com/aphyr/mastodon-utils/0c9a4557d1c5bd205b570f9f37a4b2078e5c79c8/project.clj | clojure | (defproject com.aphyr/mastodon-utils "0.1.0-SNAPSHOT"
:description "Utilities for working with Mastodon"
:url "-utils"
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:dependencies [[cheshire "5.11.0"]
[clj-http "3.12.3"]
[do... | |
318ac07605c04841ddde81f120327487ef0629803da0a92024f559cceed51795 | lgandersen/edgedns | edge_core_sup.erl | %%%
Copyright ( c ) 2016 . All rights reserved .
%%% Use of this source code is governed by a BSD-style
%%% license that can be found in the LICENSE file.
%%%
-module(edge_core_sup).
-behaviour(supervisor).
%% API.
-export([start_link/0]).
%% Supervisor callbacks.
-export([init/1]).
%% From supervisor.
-type sta... | null | https://raw.githubusercontent.com/lgandersen/edgedns/6f1d414eed5ec412b934d3a82a694597fdee4649/apps/edge_core/src/edge_core_sup.erl | erlang |
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file.
API.
Supervisor callbacks.
From supervisor. | Copyright ( c ) 2016 . All rights reserved .
-module(edge_core_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-type start_link_err() :: {already_started, pid()} | shutdown | term().
-type start_link_ret() :: {ok, pid()} | ignore | {error, start_link_err()}.
-define(CHILD(I, Type), {I,... |
506848849a6bf52a9de1042f17dab86dc0fbae1f7da3bbaf6d62454cb6975c3e | GaloisInc/ivory | Prim.hs | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
--
-- Prim.hs --- I/O register primitives.
--
Copyright ( C ) 2013 , Galois , Inc.
All Rights Reserved .
--
module Ivory.HW.Prim where
import Ivory.Language
hw_moduledef :: ModuleDef
hw_moduledef = do
incl ioRegReadU8
incl ioRegWriteU8
incl ioRegReadU16
i... | null | https://raw.githubusercontent.com/GaloisInc/ivory/53a0795b4fbeb0b7da0f6cdaccdde18849a78cd6/ivory-hw/src/Ivory/HW/Prim.hs | haskell |
Prim.hs --- I/O register primitives.
| # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
Copyright ( C ) 2013 , Galois , Inc.
All Rights Reserved .
module Ivory.HW.Prim where
import Ivory.Language
hw_moduledef :: ModuleDef
hw_moduledef = do
incl ioRegReadU8
incl ioRegWriteU8
incl ioRegReadU16
incl ioRegWriteU16
incl ioRegReadU32
incl ioRe... |
6bff187811c071108a16a839f1de497eba8cd33c12c936042e34d22710c45ad9 | keechma/keechma-pipelines | core.cljs | (ns keechma.pipelines.core
(:refer-clojure :exclude [swap! reset!])
(:require [keechma.pipelines.runtime :as runtime])
(:require-macros [keechma.pipelines.core :refer [pipeline!]]))
(def make-pipeline runtime/make-pipeline)
(def start! runtime/start!)
(def stop! runtime/stop!)
(def has-pipeline? runtime/has-pipe... | null | https://raw.githubusercontent.com/keechma/keechma-pipelines/09ae26e5f435401e420c3869dec8e77da74ef7d0/src/keechma/pipelines/core.cljs | clojure | (ns keechma.pipelines.core
(:refer-clojure :exclude [swap! reset!])
(:require [keechma.pipelines.runtime :as runtime])
(:require-macros [keechma.pipelines.core :refer [pipeline!]]))
(def make-pipeline runtime/make-pipeline)
(def start! runtime/start!)
(def stop! runtime/stop!)
(def has-pipeline? runtime/has-pipe... | |
9ed1d1ae0d5261b9abe4fc5f0a4f5b4575c3949734e1979b69d5c99ad075fc76 | georgjz/raylib-gambit-scheme | raylib-consts.scm |
; ▄████████ ▄██████▄ ███▄▄▄▄ ▄████████ ███
; ███ ███ ███ ███ ███▀▀▀██▄ ███ ███ ▀█████████▄
█ █ █ █ ▀ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ ▀ ▀ █ █ █ ▀ ▀ █ █
; ███ ███ ███ ███ ███ ███ ███ ▀
; ███ ███ ███ ███ ███ ▀███████████ █... | null | https://raw.githubusercontent.com/georgjz/raylib-gambit-scheme/df7ea6db54a3196d13c66dac4909c64cea6e5a88/src/raylibbinding/raylib-consts.scm | scheme | ▄████████ ▄██████▄ ███▄▄▄▄ ▄████████ ███
███ ███ ███ ███ ███▀▀▀██▄ ███ ███ ▀█████████▄
███ ███ ███ ███ ███ ███ ███ ▀
███ ███ ███ ███ ███ ▀███████████ ███
███ █▄ ███ ███ ███ ███ ███ ███
███ ███ ███ ███ ██... |
█ █ █ █ ▀ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ █ ▀ ▀ █ █ █ ▀ ▀ █ █
These are the constants and enums defined in .
(define KEY_APOSTROPHE 39)
(define KEY_COMMA 44)
(define KEY_MINUS 45)
(define KEY_PERIOD ... |
eb67122c4b4af519eb9b67b61d1185325f4e3c5b84474e3f036f68befee35323 | kupl/LearnML | original.ml | exception Problem
type aexp =
| Const of int
| Var of string
| Power of (string * int)
| Times of aexp list
| Sum of aexp list
let rec diff ((e : aexp), (x : string)) : aexp =
match e with
| Const _ -> Const 0
| Var y -> if x = y then Const 1 else Const 0
| Power (y, n) ->
if x = y then Times ... | null | https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/diff/sub126/original.ml | ocaml | exception Problem
type aexp =
| Const of int
| Var of string
| Power of (string * int)
| Times of aexp list
| Sum of aexp list
let rec diff ((e : aexp), (x : string)) : aexp =
match e with
| Const _ -> Const 0
| Var y -> if x = y then Const 1 else Const 0
| Power (y, n) ->
if x = y then Times ... | |
22ab3d56089c0a3ec199780d311d0849f8d625fe4e0dfbc1fa3b465bd579e205 | tiensonqin/lymchat-exp | storage.cljs | (ns lymchat.storage
(:refer-clojure :exclude [update])
(:require [lymchat.core-async-storage :as s]
[re-frame.core :refer [dispatch]]
[cljs.core.async :refer [<!]]
[re-frame.db :refer [app-db]]
[lymchat.util :as util]
[cljs-time.core :as t]
[cl... | null | https://raw.githubusercontent.com/tiensonqin/lymchat-exp/425a0738b11632119be08b5a59f12244f5df1575/src/lymchat/storage.cljs | clojure | all reads from memory, synchronous
all writes to both memory (synchronous) and storage (asynchronous)
delete messages
delete conversation
update conversation
TODO delete messages
debug | (ns lymchat.storage
(:refer-clojure :exclude [update])
(:require [lymchat.core-async-storage :as s]
[re-frame.core :refer [dispatch]]
[cljs.core.async :refer [<!]]
[re-frame.db :refer [app-db]]
[lymchat.util :as util]
[cljs-time.core :as t]
[cl... |
5ef3b93d5e95a2452944b8cbed1e110636fc6a207cba93642094b3e431584cf5 | knightsc/sandbox_profiles | sbpl.scm | Sandbox Profile Language stub
;;; This stub is loaded before the sandbox profile is evaluated. When version
is called , the SBPL prelude and the appropriate SBPL version library are
;;; loaded. Combined with functions defined in the scheme interpreter by
;;; sbpl_parser.c, these implement the profile language.
... | null | https://raw.githubusercontent.com/knightsc/sandbox_profiles/9eb25aecbf1e6e77cba64ead53e0dc31ee97c48d/sbpl.scm | scheme | This stub is loaded before the sandbox profile is evaluated. When version
loaded. Combined with functions defined in the scheme interpreter by
sbpl_parser.c, these implement the profile language. | Sandbox Profile Language stub
is called , the SBPL prelude and the appropriate SBPL version library are
(define (version n)
(case n
(( 1) (%version-1))
(else (error "unsupported version" n)))
(set! version
(lambda (o)
(if (not (= n o))
(error "only one version may be sp... |
88338d935f9128863a2e221e4e5c68308eacf079d4f2976cec8900931dc00de8 | Decentralized-Pictures/T4L3NT | mockup.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
(* ... | null | https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/src/proto_010_PtGRANAD/lib_client/mockup.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETH... |
f86e4b2f73720b5d25cf74a7e1d83c50d1404e877c59cd42c86ed484e08d0d04 | tisnik/clojure-examples | project.clj | ;
( C ) Copyright 2020
;
; All rights reserved. This program and the accompanying materials
; are made available under the terms of the Eclipse Public License v1.0
; which accompanies this distribution, and is available at
-v10.html
;
; Contributors:
;
(defproject kafka-repl "0.1.0-SNAPSHOT"
:... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/0e8ea0e19bd2c2672bbfd63db7c9efb73c816654/kafka-repl/project.clj | clojure |
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
Contributors:
| ( C ) Copyright 2020
-v10.html
(defproject kafka-repl "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "EPL-2.0 OR GPL-2.0-or-later WITH Classpath-exception-2.0"
:url "-2.0/"}
:dependencies [[org.clojure/clojure "1.10.1"]
[fundingc... |
4593521b04966f17d3da8199dfd0148e45dc6fe12967716540421ea7eb2d8b09 | mlesniak/game | Main.hs | | Simulation of balls using the Chipmunk library .
--
, ball and border are the important functions ; and probably
the call to step in line 63 .
--
module Main where
import Control.Concurrent
import Control.Monad
import Graphics.UI.GLUT hiding (position, Position, scale)
import Physics.Hipmunk hiding (Positio... | null | https://raw.githubusercontent.com/mlesniak/game/63847b04b6fafdef0a805351f47e4bada85e8b40/Main.hs | haskell |
Physics intialization.
Enabling performance information display.
Create outside borders.
here until the user is finished (by releasing the mouse button).
provides handlers for frame drawing, key and mouse events. It's not
important for the physic simulation.
The FrameHandler is called for every frame, i.e. fps... | | Simulation of balls using the Chipmunk library .
, ball and border are the important functions ; and probably
the call to step in line 63 .
module Main where
import Control.Concurrent
import Control.Monad
import Graphics.UI.GLUT hiding (position, Position, scale)
import Physics.Hipmunk hiding (Position)
imp... |
9ab7a46bdbff0bcfef83dbd8a748d13fd2c36205df3097b4b2c3c62277ccd33b | kaznum/programming_in_ocaml_exercise | gui.ml | open Tk
open MySupport
open Board
let c_height = 1
let c_width = 2
let defcol = `White
let pushcol = `Blue
let selcol = `Color "#ffdfdf"
let color_of_state = function
Pressed -> pushcol
| NotPressed -> defcol
let relief_of_state = function
Pressed -> `Sunken
| NotPressed -> `Ridge
let toggle = functio... | null | https://raw.githubusercontent.com/kaznum/programming_in_ocaml_exercise/6f6a5d62a7a87a1c93561db88f08ae4e445b7d4e/ch16/gui.ml | ocaml | 操作
全マスをクリア
quit
正誤をlabelに表示
widget作成
1行を作成
縦方向のラベルのリスト
横方向のラベルとマス目のリスト
幅と高さの計算
main | open Tk
open MySupport
open Board
let c_height = 1
let c_width = 2
let defcol = `White
let pushcol = `Blue
let selcol = `Color "#ffdfdf"
let color_of_state = function
Pressed -> pushcol
| NotPressed -> defcol
let relief_of_state = function
Pressed -> `Sunken
| NotPressed -> `Ridge
let toggle = functio... |
a18dce8d73b5ab3ea7bb6627816e957eba8354a71e04bb6ccc53b44ad4660f0f | zwizwa/staapl | piklab.rkt | #lang racket/base
(require (lib "process.rkt")) ;; system
Interface to piklab - prog
(provide (all-defined-out))
(define piklab-firmware (make-parameter "/home/tom/firmware/icd2"))
(define piklab-device (make-parameter "18F1220"))
(define piklab-port (make-parameter "usb"))
(define piklab-self-po... | null | https://raw.githubusercontent.com/zwizwa/staapl/e30e6ae6ac45de7141b97ad3cebf9b5a51bcda52/port/piklab.rkt | racket | system
--debug | #lang racket/base
Interface to piklab - prog
(provide (all-defined-out))
(define piklab-firmware (make-parameter "/home/tom/firmware/icd2"))
(define piklab-device (make-parameter "18F1220"))
(define piklab-port (make-parameter "usb"))
(define piklab-self-powered (make-parameter "false"))
(define... |
ba32291a0f38ff0f04ae9b57eb29f71e5034695bf3103362dbc1973832db65fd | rorra/rorracasts_erlang | dynamic.erl | -module(dynamic).
-behaviour(supervisor).
%% API
-export([start_link/0, add_child/1, remove_child/1]).
%% Supervisor callbacks
-export([init/1]).
-define(SERVER, ?MODULE).
%%%===================================================================
%%% API functions
%%%===================================================... | null | https://raw.githubusercontent.com/rorra/rorracasts_erlang/399b88475b69a21e7e17f72089d38b917a4eb01b/028-otp-application/src/dynamic.erl | erlang | API
Supervisor callbacks
===================================================================
API functions
===================================================================
===================================================================
Supervisor callbacks
====================================================... | -module(dynamic).
-behaviour(supervisor).
-export([start_link/0, add_child/1, remove_child/1]).
-export([init/1]).
-define(SERVER, ?MODULE).
start_link() ->
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
add_child(Nombre) ->
Child = #{id => Nombre,
start => {info, start_link, [Nombre]},
... |
936864dfcbc94f173a7f314b3e37a0507fbda89cf6dee033119915865ff44f87 | borkdude/jet | patches.clj | (ns jet.patches
"Don't load this namespace unless you're building a native image."
(:require [com.rpl.specter.impl]
[jet.specter :as js]))
;; (alter-var-root #'eval (constantly nil))
;; (alter-var-root #'require (constantly nil))
;; (alter-var-root #'resolve (constantly nil))
;; (alter-var-root #'requi... | null | https://raw.githubusercontent.com/borkdude/jet/9bad90e1d9e0714b5c842cbb1247f716b98d4431/src/jet/patches.clj | clojure | (alter-var-root #'eval (constantly nil))
(alter-var-root #'require (constantly nil))
(alter-var-root #'resolve (constantly nil))
(alter-var-root #'requiring-resolve (constantly nil))
Note, when using direct linking we need to patch more vars than this | (ns jet.patches
"Don't load this namespace unless you're building a native image."
(:require [com.rpl.specter.impl]
[jet.specter :as js]))
(alter-var-root #'com.rpl.specter.impl/closed-code (constantly js/closed-code))
(println "Patches applied")
|
b84500117ed257590c63afd5017a0fbe8bd2848bf00dba7cef5332938713af04 | erlangonrails/devdb | exmpp_client_muc.erl | Copyright ProcessOne 2006 - 2010 . 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 Public License along with this s... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/exmpp-0.9.5/src/client/exmpp_client_muc.erl | erlang |
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the Licens... | Copyright ProcessOne 2006 - 2010 . 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 "
@author >
@doc Helper functions for... |
fd7d94b3ce3c0071baff8be549f1db9d62a02a14e15c86a05c5a9f2bdbfa6530 | rudymatela/express | show.hs | Copyright ( c ) 2017 - 2021 .
-- Distributed under the 3-Clause BSD licence (see the file LICENSE).
import Test
import Data.Express.Utils.List
main :: IO ()
main = mainTest tests 5040
tests :: Int -> [Bool]
tests n =
[ True
-- showing expressions
, show zero == "0 :: Int"
, show two == "2 :: Int"
, s... | null | https://raw.githubusercontent.com/rudymatela/express/d19d34b1cfd65089465d10fc8d2c7e4e6c45fa0d/test/show.hs | haskell | Distributed under the 3-Clause BSD licence (see the file LICENSE).
showing expressions
showing holes --
A type --
B type --
[A] type -- | Copyright ( c ) 2017 - 2021 .
import Test
import Data.Express.Utils.List
main :: IO ()
main = mainTest tests 5040
tests :: Int -> [Bool]
tests n =
[ True
, show zero == "0 :: Int"
, show two == "2 :: Int"
, show minusOne == "-1 :: Int"
, show (one -+- two -*- three) == "1 + 2 * 3 :: Int"
, show (... |
e0a7f2e2f15f3236572efdd033e4cd8575b48915d7092abd3a5a20e3a9e6229f | brendanhay/gogol | DropDatabase.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-spanner/gen/Gogol/Spanner/Projects/Instances/Databases/DropDatabase.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
* Resource
** Constructing a Request
| A resource alias for @spanner.projects.instances.databases.dropDatabase@ method which the
'SpannerProjectsInstancesDatabasesDropDatabase' request conforms to.
/See:/ 'newSpannerProjects... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
9ef250d6f9faaa66069a2dba0160de77bad5e49d834d2d9be29280d8793055b5 | herbelin/coq-hh | environ.ml | open Util
open Names
open Univ
open Term
open Declarations
type globals = {
env_constants : constant_body Cmap_env.t;
env_inductives : mutual_inductive_body Mindmap_env.t;
env_inductives_eq : kernel_name KNmap.t;
env_modules : module_body MPmap.t;
env_modtypes : module_type_body MPmap.t}
type stratificatio... | null | https://raw.githubusercontent.com/herbelin/coq-hh/296d03d5049fea661e8bdbaf305ed4bf6d2001d2/checker/environ.ml | ocaml | Rel context
Named context
A local const is evaluable if it is defined
Global constants
A global const is evaluable if it is defined and not opaque
Mutual Inductives
Modules | open Util
open Names
open Univ
open Term
open Declarations
type globals = {
env_constants : constant_body Cmap_env.t;
env_inductives : mutual_inductive_body Mindmap_env.t;
env_inductives_eq : kernel_name KNmap.t;
env_modules : module_body MPmap.t;
env_modtypes : module_type_body MPmap.t}
type stratificatio... |
475b8adecb80074ecb5f7cf65e4f2b949c5afb48364fc917530787e01d70fd53 | racket/web-server | mime-types-test.rkt | #lang racket/base
(require rackunit
(only-in mzlib/file make-temporary-file)
racket/runtime-path
racket/path
web-server/http
web-server/private/mime-types)
(provide mime-types-tests)
(define test-file (make-temporary-file))
(with-output-to-file test-file
(lambda ()
(p... | null | https://raw.githubusercontent.com/racket/web-server/f718800b5b3f407f7935adf85dfa663c4bba1651/web-server-test/tests/web-server/private/mime-types-test.rkt | racket | #lang racket/base
(require rackunit
(only-in mzlib/file make-temporary-file)
racket/runtime-path
racket/path
web-server/http
web-server/private/mime-types)
(provide mime-types-tests)
(define test-file (make-temporary-file))
(with-output-to-file test-file
(lambda ()
(p... | |
9d0ceb839271dc8c7ac24e309f8f81ad62d88b8a3d9f760054a8b5c27e8f2ed4 | cardmagic/lucash | netconst.scm | Magic Numbers for Networking
Copyright ( c ) 1994 by . See file COPYING .
;;; magic numbers not from header file
;;; but from man page
;;; why can't unix make up its mind
(define shutdown/receives 0)
(define shutdown/sends 1)
(define shutdown/sends+receives 2)
;;;-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-... | null | https://raw.githubusercontent.com/cardmagic/lucash/0452d410430d12140c14948f7f583624f819cdad/reference/scsh-0.6.6/scsh/irix/netconst.scm | scheme | magic numbers not from header file
but from man page
why can't unix make up its mind
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
BELOW THIS POINT ARE BITS FROM:
<sys/socket.h>
<sys/un.h>
<netinet/in.h>
<netinet/tcp.h>
<netdb.h>
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-... | Magic Numbers for Networking
Copyright ( c ) 1994 by . See file COPYING .
(define shutdown/receives 0)
(define shutdown/sends 1)
(define shutdown/sends+receives 2)
ADDRESS FAMILIES -- < sys / socket.h >
internetwork : UDP , TCP , etc .
PROTOCOL FAMILIES -- < sys / socket.h >
internetwork : UDP , TCP... |
6942bed7a79a74a351df32859e3c243c779392d509a02a61d1db03550f3e95a4 | abdulapopoola/SICPBook | Ex2.17.scm | #lang planet neil/sicp
(define (last-pair list1)
(if (null? (cdr list1))
list1
(last-pair (cdr list1))))
(last-pair (list 23 72 149 34))
| null | https://raw.githubusercontent.com/abdulapopoola/SICPBook/c8a0228ebf66d9c1ddc5ef1fcc1d05d8684f090a/Chapter%202/2.2/Ex2.17.scm | scheme | #lang planet neil/sicp
(define (last-pair list1)
(if (null? (cdr list1))
list1
(last-pair (cdr list1))))
(last-pair (list 23 72 149 34))
| |
41b9f89cc014c1edbe0e7c911ea564f0abf8ba73d43eb672d246afa6d9bd4880 | boxuk/finder | opts.clj |
(ns ^{:doc "This namespace deals with the query options like order, limit and offset"}
finder.opts
(:require [clojure.string :as string]))
(defn- ^{:doc "Destructures a name/value vector and returns a single order clause as
a string. ie. 'name desc'"}
to-order-clause [[col dir]]
(format "%s %s" (name col)
... | null | https://raw.githubusercontent.com/boxuk/finder/1d5e7d6de7a85e1bdb37e5b8e6b9636454ccb9c6/src/finder/opts.clj | clojure | Public
------ |
(ns ^{:doc "This namespace deals with the query options like order, limit and offset"}
finder.opts
(:require [clojure.string :as string]))
(defn- ^{:doc "Destructures a name/value vector and returns a single order clause as
a string. ie. 'name desc'"}
to-order-clause [[col dir]]
(format "%s %s" (name col)
... |
8a44718a6867f08e6579cd7a6ba02698e1e0572ac90d51d9e466e25e0e8ee3c0 | janestreet/incr_map | map_operations.ml | open Core
open Import
module Without_stabilize = struct
type ('key, 'data) t =
[ `Add of 'key * 'data [@quickcheck.weight 10.]
| `Remove of 'key [@quickcheck.weight 4.]
]
[@@deriving quickcheck, sexp_of]
let apply t map =
match t with
| `Add (key, data) -> Map.set map ~key ~data
| `Remov... | null | https://raw.githubusercontent.com/janestreet/incr_map/b56e7d8b1299d77790e3bc72e2aeeca74afd04fe/test/map_operations.ml | ocaml | open Core
open Import
module Without_stabilize = struct
type ('key, 'data) t =
[ `Add of 'key * 'data [@quickcheck.weight 10.]
| `Remove of 'key [@quickcheck.weight 4.]
]
[@@deriving quickcheck, sexp_of]
let apply t map =
match t with
| `Add (key, data) -> Map.set map ~key ~data
| `Remov... | |
76175de4865c48d4a7278853065ebaf040abb96d9aa6d206c39245cf66919ec2 | monadbobo/ocaml-core | heap.mli | * Min - heap implementation , adapted from CLR .
* { 6 Exceptions }
(** Raised when [top] or [pop] is called on an empty heap. *)
exception Empty
(** {6 Types} *)
(** Type of heaps *)
type 'el t
(** Type of heap elements (they can be efficiently removed) *)
type 'el heap_el
* { 6 Functions on heap elements }
... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/lib/heap.mli | ocaml | * Raised when [top] or [pop] is called on an empty heap.
* {6 Types}
* Type of heaps
* Type of heap elements (they can be efficiently removed)
* [heap_el_is_valid heap_el] @return [true] iff heap element is member
of a heap.
* [heap_el_get_el heap_el] @return the element associated with the heap
element.
... | * Min - heap implementation , adapted from CLR .
* { 6 Exceptions }
exception Empty
type 'el t
type 'el heap_el
* { 6 Functions on heap elements }
val heap_el_is_valid : 'el heap_el -> bool
val heap_el_get_el : 'el heap_el -> 'el
* { 6 Information on heap values }
val length : 'el t -> int
val is_empty : ... |
0f81287845d4a64d2f4e082fce79fd10560bd02e565778e7bd71d92c1eca72bc | samoht/dog | dog_watch.ml |
* Copyright ( c ) 2015 < >
*
* 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 " AND THE AU... | null | https://raw.githubusercontent.com/samoht/dog/6472e52615d704073e51290b6eeadea61f2535be/src/dog_watch.ml | ocaml |
* Copyright ( c ) 2015 < >
*
* 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 " AND THE AU... | |
8b86c94a5e2f9e457c42a6c1a00eaf263791ea60eeff2376b11c589f5c20d69b | cljfx/cljfx | list_view.clj | (ns cljfx.ext.list-view
(:require [cljfx.lifecycle :as lifecycle]
[cljfx.ext.multiple-selection-model :as ext.multiple-selection-model])
(:import [javafx.scene.control ListView]))
(set! *warn-on-reflection* true)
(def with-selection-props
"Extension lifecycle providing selection-related props to lis... | null | https://raw.githubusercontent.com/cljfx/cljfx/ec3c34e619b2408026b9f2e2ff8665bebf70bf56/src/cljfx/ext/list_view.clj | clojure | (ns cljfx.ext.list-view
(:require [cljfx.lifecycle :as lifecycle]
[cljfx.ext.multiple-selection-model :as ext.multiple-selection-model])
(:import [javafx.scene.control ListView]))
(set! *warn-on-reflection* true)
(def with-selection-props
"Extension lifecycle providing selection-related props to lis... | |
6ae52fa88ce36ebea33c31fe42e85fe2d675a93fd88b4cf0729881a4cceb6640 | tolitius/obiwan | dev.clj | (ns dev
(:require [clj-http.client :as http]
[jsonista.core :as json]
[clojure.string :as s]
[clojure.java.io :as io]
[clojure.repl :refer :all]
[clojure.pprint :refer [pprint]]
[yang.lang :as y]
[spec :as rspec]
[obiwan.c... | null | https://raw.githubusercontent.com/tolitius/obiwan/623d6d55b15151bbe637422c023572d83f9a57a5/dev/dev.clj | clojure | TODO: add as a hook on building a jar
repl
search core
aggregate shtuff
:results
{"country" "UKRAINE", "num_users" "2"}]}
:results
; 11:00
{"num_users" "1",
; 10:00
; 12:00
:results
; 12:00
; 11:00
{"num_users" "1",
; 10:00
suggestions | (ns dev
(:require [clj-http.client :as http]
[jsonista.core :as json]
[clojure.string :as s]
[clojure.java.io :as io]
[clojure.repl :refer :all]
[clojure.pprint :refer [pprint]]
[yang.lang :as y]
[spec :as rspec]
[obiwan.c... |
a5189e93391e4c986457e72ad14532d135bf0541c7f602a244663d5b8e7277d1 | ConsenSysMesh/Fae | TX.hs | |
Module : Blockchain . Fae . Internal . TX
Description : Transaction interpreter
Copyright : ( c ) , 2017 - 2018
License : MIT
Maintainer :
Stability : experimental
This module provides the function that interprets transactions given as
source code . The interpreter enables the following extens... | null | https://raw.githubusercontent.com/ConsenSysMesh/Fae/3ff023f70fa403e9cef80045907e415ccd88d7e8/src/Blockchain/Fae/Internal/TX.hs | haskell | * Types
| This is the data type that identifies a transaction in a block; the
actual transaction function is only known at the time of interpretation.
| Helpful for printing strings without the surrounding quotes.
| Helpful for eliminating a 'Data.ByteString' dependency in the
'interpretImportedValue' interpreter... | |
Module : Blockchain . Fae . Internal . TX
Description : Transaction interpreter
Copyright : ( c ) , 2017 - 2018
License : MIT
Maintainer :
Stability : experimental
This module provides the function that interprets transactions given as
source code . The interpreter enables the following extens... |
c82699c3676cdacd77035c2af919010b42ca6e3772acb9e4788bcc49dccacd38 | gfour/gic | addsx.hs | result :: Int
result = f sq 10 ;
sq :: Int -> Int
sq c = c * c ;
add :: Int -> Int -> Int
add a b = a + b ;
f :: (Int -> Int) -> Int -> Int
f s x = if (x <= 0) then s x else f (add (s x)) (x-1)
| null | https://raw.githubusercontent.com/gfour/gic/d5f2e506b31a1a28e02ca54af9610b3d8d618e9a/Examples/Data/addsx.hs | haskell | result :: Int
result = f sq 10 ;
sq :: Int -> Int
sq c = c * c ;
add :: Int -> Int -> Int
add a b = a + b ;
f :: (Int -> Int) -> Int -> Int
f s x = if (x <= 0) then s x else f (add (s x)) (x-1)
| |
411b8a82446abb836ff8477fab7723465333b2ea9ac3293f5a43b43d84b0401b | rtoy/cmucl | boot17.lisp | ;; Boot file for adding *runtime-features*
(in-package :sys)
(defvar *runtime-features* nil) | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/bootfiles/18e/boot17.lisp | lisp | Boot file for adding *runtime-features* | (in-package :sys)
(defvar *runtime-features* nil) |
1beb0012e21c297f1c9dbbafd612b777ff227f5135f41f91d2c96961f1938c1a | oxidizing/sihl | email_mariadb.ml | let services =
[ Sihl.Database.Migration.MariaDb.register []
; Sihl_email.Template.MariaDb.register ()
; Sihl_email.Smtp.register ()
]
;;
module Test = Email.Make (Sihl_email.Smtp) (Sihl_email.Template.MariaDb)
let () =
Sihl.Configuration.read_string "DATABASE_URL_TEST_MARIADB"
|> Option.value ~default:"m... | null | https://raw.githubusercontent.com/oxidizing/sihl/439d60b7af290070be0237ffe4dfb7d34aceb4e0/sihl-email/test/email_mariadb.ml | ocaml | let services =
[ Sihl.Database.Migration.MariaDb.register []
; Sihl_email.Template.MariaDb.register ()
; Sihl_email.Smtp.register ()
]
;;
module Test = Email.Make (Sihl_email.Smtp) (Sihl_email.Template.MariaDb)
let () =
Sihl.Configuration.read_string "DATABASE_URL_TEST_MARIADB"
|> Option.value ~default:"m... | |
c0532689ad2119c0bda3535adc3f87c293bf657ff37fc624b578dd1093e35ad7 | yzhs/ocamlllvm | pparse.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet Cri... | null | https://raw.githubusercontent.com/yzhs/ocamlllvm/45cbf449d81f2ef9d234968e49a4305aaa39ace2/src/driver/pparse.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 2002 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ Id$
open Format
exception Error
let pr... |
f1ce2d00d9552f03ea3dc5a014be7eb76317db24f2dc1fdad20f851e3741732e | txyyss/Project-Euler | Euler086.hs | A spider , S , sits in one corner of a cuboid room , measuring 6 by 5
by 3 , and a fly , F , sits in the opposite corner . By travelling on
-- the surfaces of the room the shortest "straight line" distance from
S to F is 10 and the path is shown on the diagram .
However , there are up to three " shortest " pat... | null | https://raw.githubusercontent.com/txyyss/Project-Euler/d2f41dad429013868445c1c9c1c270b951550ee9/Euler086.hs | haskell | the surfaces of the room the shortest "straight line" distance from
length.
By considering all cuboid rooms with integer dimensions, up to a
which the shortest route has integer length when M=100, and this is | A spider , S , sits in one corner of a cuboid room , measuring 6 by 5
by 3 , and a fly , F , sits in the opposite corner . By travelling on
S to F is 10 and the path is shown on the diagram .
However , there are up to three " shortest " path candidates for any
given cuboid and the shortest route does n't alw... |
000e33af12c64863d82275e9469d88322f5c4f7b9e7eda92adac998dedb3266e | mbutterick/beautiful-racket | main.rkt | #lang br/quicklang
(require brag/support "grammar.rkt" xml)
(provide (all-from-out br/quicklang) (all-defined-out) xexpr?)
(module+ reader
(provide read-syntax))
(define-lex-abbrev xml-reserved
(:or "<" "/>" "</" ">" "<!--" "-->" "=" "\""))
(define tokenize
(lexer
[(:+ whitespace) (token 'SP " ")]
["&... | null | https://raw.githubusercontent.com/mbutterick/beautiful-racket/f0e2cb5b325733b3f9cbd554cc7d2bb236af9ee9/beautiful-racket-demo/xmlish-demo/main.rkt | racket | #lang br/quicklang
(require brag/support "grammar.rkt" xml)
(provide (all-from-out br/quicklang) (all-defined-out) xexpr?)
(module+ reader
(provide read-syntax))
(define-lex-abbrev xml-reserved
(:or "<" "/>" "</" ">" "<!--" "-->" "=" "\""))
(define tokenize
(lexer
[(:+ whitespace) (token 'SP " ")]
["&... | |
4d40c0452bf315bc1f1785688a0b8eb1f731b50399806cbfc7748454032e709d | jherrlin/guitar-theory-training | scales.cljs | (ns v2.se.jherrlin.music-theory.webapp.scales
(:require
[clojure.set :as set]
[clojure.string :as str]
[re-frame.core :as re-frame]
[reitit.frontend.easy :as rfe]
[se.jherrlin.music-theory :as music-theory]
[v2.se.jherrlin.music-theory.definitions :as definitions]
[v2.se.jherrlin.music-theory.int... | null | https://raw.githubusercontent.com/jherrlin/guitar-theory-training/e97fa342c061954799f26aeb680fc721efd3017e/src/v2/se/jherrlin/music_theory/webapp/scales.cljs | clojure | Links to keys
Links to scales
Highlight tones
Scale name
Intervals
Scale on fretboard
Chords to scale | (ns v2.se.jherrlin.music-theory.webapp.scales
(:require
[clojure.set :as set]
[clojure.string :as str]
[re-frame.core :as re-frame]
[reitit.frontend.easy :as rfe]
[se.jherrlin.music-theory :as music-theory]
[v2.se.jherrlin.music-theory.definitions :as definitions]
[v2.se.jherrlin.music-theory.int... |
db0131987c4884ae37eda87b83ce10ef469fb4b1dea70e0170477eedb07f9b30 | dalaing/little-languages | Value.hs | module Term.Eval.Value where
import Data.Foldable (asum)
import Term
valueTmInt :: Term
-> Maybe Term
valueTmInt (TmInt i) =
Just $ TmInt i
valueTmInt _ =
Nothing
valueRules :: [Term -> Maybe Term]
valueRules =
[valueTmInt]
value :: Term
-> Maybe Term
value tm =
asum .
map ($ tm) $
... | null | https://raw.githubusercontent.com/dalaing/little-languages/9f089f646a5344b8f7178700455a36a755d29b1f/code/old/unityped/i/src/Term/Eval/Value.hs | haskell | module Term.Eval.Value where
import Data.Foldable (asum)
import Term
valueTmInt :: Term
-> Maybe Term
valueTmInt (TmInt i) =
Just $ TmInt i
valueTmInt _ =
Nothing
valueRules :: [Term -> Maybe Term]
valueRules =
[valueTmInt]
value :: Term
-> Maybe Term
value tm =
asum .
map ($ tm) $
... | |
5306a0b55b3f6c86b444ffabe90048b4ceace970a629f7744d6e2c1bb66954ee | discus-lang/ddc | Initialize.hs |
-- | Adding code to initialise the runtime system.
module DDC.Core.Salt.Transform.Initialize
(initializeModule)
where
import DDC.Core.Salt.Compounds
import DDC.Core.Salt.Runtime
import DDC.Core.Salt.Name
import DDC.Core.Module
import DDC.Core.Exp.Annot
import Data.List
---------------------------------------... | null | https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-core-salt/DDC/Core/Salt/Transform/Initialize.hs | haskell | | Adding code to initialise the runtime system.
-------------------------------------------------------------------------------------------------
entry point that initialises the runtime system and calls the real main function.
--------------------------------------------------------------------------------------... |
module DDC.Core.Salt.Transform.Initialize
(initializeModule)
where
import DDC.Core.Salt.Compounds
import DDC.Core.Salt.Runtime
import DDC.Core.Salt.Name
import DDC.Core.Module
import DDC.Core.Exp.Annot
import Data.List
| If this it the Main module , then insert a main function for the posix
Returns Not... |
187163bb34533cd3685e8060b8a87c47ca835757d6c3e9e0c15ad8235add79d9 | lambdabot/IOSpec | Echo.hs | Note that the Prelude and Test . IOSpec . Teletype both export
functions called and . To begin with , we hide the
-- definitions in the prelude and work with the pure specification.
import Prelude hiding (getChar, putChar)
import qualified Prelude (putStrLn)
import qualified Data.Stream as Stream
import Test.IOS... | null | https://raw.githubusercontent.com/lambdabot/IOSpec/76235f77942ab7672f70fca4b9e133ef667606a4/examples/Echo.hs | haskell | definitions in the prelude and work with the pure specification.
The echo function, as we have always known it
It should echo any character entered at the teletype. This is
the behaviour we would expect echo to have. The Output data type
behaviour of a teletype interaction.
the teletype.
withInput runs an Effe... | Note that the Prelude and Test . IOSpec . Teletype both export
functions called and . To begin with , we hide the
import Prelude hiding (getChar, putChar)
import qualified Prelude (putStrLn)
import qualified Data.Stream as Stream
import Test.IOSpec hiding (putStrLn)
import Test.QuickCheck
import Data.Char (ord)
... |
f7d1dbe53d09c5dca87d05e730b45fc90e3ab0fbdfb8efc83ba69817a9f1cd58 | lilyball/projecteuler-ocaml | prob5.ml | open Misc
open Big_int
module Int = struct
type t = int
let compare = compare
end
module IntMap = Map.Make(Int)
let prime_factor_map n =
let factors = List.map int_of_big_int (prime_factors (big_int_of_int n)) in
let mapincr map key =
IntMap.add key (try succ (IntMap.find key map) with Not_found -> 1) ma... | null | https://raw.githubusercontent.com/lilyball/projecteuler-ocaml/a88ed8355b565ad0726cfcac4916d2b80512da7a/prob5.ml | ocaml | open Misc
open Big_int
module Int = struct
type t = int
let compare = compare
end
module IntMap = Map.Make(Int)
let prime_factor_map n =
let factors = List.map int_of_big_int (prime_factors (big_int_of_int n)) in
let mapincr map key =
IntMap.add key (try succ (IntMap.find key map) with Not_found -> 1) ma... | |
456b7c2b72040810cb34ef4274ee1c097cb9ee101260b5048baece3f04ad9746 | noprompt/meander | epsilon.cljc | (ns ^:no-doc meander.syntax.specs.epsilon
#?(:clj
(:require [clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as s.gen]
[meander.util.epsilon :as m.util])
:cljs
(:require [cljs.spec.alpha :as s]
[cljs.spec.gen.alpha :as s.gen]
[meander.util.... | null | https://raw.githubusercontent.com/noprompt/meander/8c0e9457befea5eee71a94a6d8726ed5916875dc/src/meander/syntax/specs/epsilon.cljc | clojure | Every AST node has, at least, the key `:tag`, the value of which is
a `keyword?`.
Some nodes may have an `::original-form` key, the value of which is
`any?`. This key is populated by forms which have been expanded
during `parse` and then subsequently parsed into an AST node.
--------------------------------------... | (ns ^:no-doc meander.syntax.specs.epsilon
#?(:clj
(:require [clojure.spec.alpha :as s]
[clojure.spec.gen.alpha :as s.gen]
[meander.util.epsilon :as m.util])
:cljs
(:require [cljs.spec.alpha :as s]
[cljs.spec.gen.alpha :as s.gen]
[meander.util.... |
1ddccf8327ac4637164571776f9560979a7e5d839601df4560f88dc682e3ed02 | fpco/ide-backend | PrettyPrint.hs | -----------------------------------------------------------------------------
-- |
Module : Distribution . PackageDescription . PrettyPrint
Copyright : 2010
-- License : BSD3
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
-- Pretty printing for cabal files
--
--... | null | https://raw.githubusercontent.com/fpco/ide-backend/860636f2d0e872e9481569236bce690637e0016e/ide-backend/TestSuite/inputs/Cabal-1.22.0.0/Distribution/PackageDescription/PrettyPrint.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD3
Maintainer :
Stability : provisional
Portability : portable
Pretty printing for cabal files
---------------------------------------------------------------------------
| Recompile with false for regression te... | Module : Distribution . PackageDescription . PrettyPrint
Copyright : 2010
module Distribution.PackageDescription.PrettyPrint (
writeGenericPackageDescription,
showGenericPackageDescription,
) where
import Data.Monoid (Monoid(mempty))
import Distribution.PackageDescription
( Benchma... |
613371890b727e3cff03a250fd5108e7611b683429f0eeedd14fbf9f4e172bbc | ghc/nofib | Csg.hs |
- ( The Solid Modeller , written in Haskell )
-
- Copyright 1990,1991,1992,1993 Duncan Sinclair
-
- Permissiom to use , copy , modify , and distribute this software for any
- purpose and without fee is hereby granted , provided that the above
- copyright notice and this permission notice appea... | null | https://raw.githubusercontent.com/ghc/nofib/f34b90b5a6ce46284693119a06d1133908b11856/gc/fulsom/Csg.hs | haskell | no is returned when there is "no" change to the csg.
conflate matrices together and into planes planes... |
- ( The Solid Modeller , written in Haskell )
-
- Copyright 1990,1991,1992,1993 Duncan Sinclair
-
- Permissiom to use , copy , modify , and distribute this software for any
- purpose and without fee is hereby granted , provided that the above
- copyright notice and this permission notice appea... |
87832b9a77670e392314d3ac276b9b72f9542c945d097e4ea0dc24fc62b32734 | igorhvr/bedlam | srfi-89-code.scm | ;------------------------------------------------------------------------------
Macro expander for define * .
(define-macro (define* pattern . body)
(if (pair? pattern)
`(define ,(car pattern)
(lambda* ,(cdr pattern) ,@body))
`(define ,pattern ,@body)))
Macro expander for lambda * .
(defi... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/iasylum/srfi-89-code.scm | scheme | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
Procedures needed at expansion time.
"alist" is a list of pairs of the form "(keyword . value)"
The result is a perfect hash-table represented as a vector of
... |
Macro expander for define * .
(define-macro (define* pattern . body)
(if (pair? pattern)
`(define ,(car pattern)
(lambda* ,(cdr pattern) ,@body))
`(define ,pattern ,@body)))
Macro expander for lambda * .
(define-macro (lambda* formals . body)
(define (parse-formals formals)
(define ... |
9cc1ef9d33d2d0c9db8facafdb178fe12603c51cde231c89b2427d0595544de9 | onaio/milia | organization.cljc | (ns milia.api.organization
(:refer-clojure :exclude [update])
(:require [milia.api.http :refer [parse-http]]
[milia.utils.remote :refer [make-url]]
#?(:cljs [cljs.core.async :refer [put!]])))
(def internal-members-team-name "members")
(def owners-team-name "Owners")
(def editor-role "edit... | null | https://raw.githubusercontent.com/onaio/milia/718ac4d2952417d1db845bf17ea54663ac7fa6a8/src/milia/api/organization.cljc | clojure | (ns milia.api.organization
(:refer-clojure :exclude [update])
(:require [milia.api.http :refer [parse-http]]
[milia.utils.remote :refer [make-url]]
#?(:cljs [cljs.core.async :refer [put!]])))
(def internal-members-team-name "members")
(def owners-team-name "Owners")
(def editor-role "edit... | |
5b6539c40ecbfd9c7a1bdf2f96558cc88ab77e27e0ce9d6b4acee082f152e900 | mage2tv/magento-cache-clean | fingerprint_file.cljs | (ns magento.fingerprint-file
(:require [file.system :as fs]
[clojure.string :as string]))
(defn windowsify [path]
(string/replace path "/" "\\\\"))
(defn path-pattern [path-pattern]
(re-pattern (cond-> path-pattern
(fs/win?) windowsify)))
(defn- match-name? [path-pattern file]
(an... | null | https://raw.githubusercontent.com/mage2tv/magento-cache-clean/cb494a37c694617854c372811106f14e9b71e631/src/magento/fingerprint_file.cljs | clojure | because of htmlContent blocks
section names list in head | (ns magento.fingerprint-file
(:require [file.system :as fs]
[clojure.string :as string]))
(defn windowsify [path]
(string/replace path "/" "\\\\"))
(defn path-pattern [path-pattern]
(re-pattern (cond-> path-pattern
(fs/win?) windowsify)))
(defn- match-name? [path-pattern file]
(an... |
1eac6b9b3e02f21ce3cd4c0238427afc5fcb0f9f31fde531478fb5e9bdcd65e6 | zack-bitcoin/verkle | fq.erl | -module(fq).
-export([
det_pow/2,
mul/2,
add/2,
neg/1,
sub/2, %inverse/1,
inv/1,
square/1,
pow/2,
short_pow/2,
encode/1, decode/1,
encode_extended/1, decode_extended/1,
setup/1,
test/1,
ctest/... | null | https://raw.githubusercontent.com/zack-bitcoin/verkle/46bf69f17170a71829f9243faea06ee42f224687/src/crypto/fq.erl | erlang | inverse/1,
e_mul/2,
-(121665/121666)
16295367250680780974490674513165176452449235426866156013048779062215315747161
defined in C.
This is the finite field on top of BLS12-381
uses montgomery notation for faster modular multiplication.
r*r rem q
r*r*r rem q
todo. binary:encode_unsigned(X, little) is probably faster.
rev... | -module(fq).
-export([
det_pow/2,
mul/2,
add/2,
neg/1,
inv/1,
square/1,
pow/2,
short_pow/2,
encode/1, decode/1,
encode_extended/1, decode_extended/1,
setup/1,
test/1,
ctest/1,
reverse_bytes/1,... |
3f348b086cf496409a429761067eac7a7dae3ec81e7629bc79b022e238852134 | juxt/apex | http_test.clj | Copyright © 2020 , JUXT LTD .
(ns juxt.apex.http.http-test
(:require
[ring.mock.request :refer [request]]
[juxt.apex.alpha.http.core :as http]
[clojure.test :refer [deftest is]]
[juxt.apex.alpha.http.header-names :refer [wrap-headers-normalize-case]]))
(comment
(let [h (->
(http/handler
... | null | https://raw.githubusercontent.com/juxt/apex/cb4c0016d817ebb03d4f84e572ca71edd84ed79d/modules/http/test/juxt/apex/http/http_test.clj | clojure | Copyright © 2020 , JUXT LTD .
(ns juxt.apex.http.http-test
(:require
[ring.mock.request :refer [request]]
[juxt.apex.alpha.http.core :as http]
[clojure.test :refer [deftest is]]
[juxt.apex.alpha.http.header-names :refer [wrap-headers-normalize-case]]))
(comment
(let [h (->
(http/handler
... | |
f35766817ed66cb56970e35815483b17798e53cfd587b339b0964292b170f648 | tlehman/sicp-exercises | ex-1.20.scm | Exercise 1.20 : The process that a procedure generates is of course
; dependent on the rules used by the interpreter.
;
; As an example, consider the iterative gcd procedure:
;(define (remainder a b) `(remainder ,a ,b))
(define (gcd a b)
(if (and (number? b) (= b 0))
a
`(gcd ,b (remainder ,a ,b)))... | null | https://raw.githubusercontent.com/tlehman/sicp-exercises/57151ec07d09a98318e91c83b6eacaa49361d156/ex-1.20.scm | scheme | dependent on the rules used by the interpreter.
As an example, consider the iterative gcd procedure:
(define (remainder a b) `(remainder ,a ,b))
In normal order evaluation, use the substitution method to illustrate the execution of:
Do the same for applicative order evaluation, compare the number of
times remai... | Exercise 1.20 : The process that a procedure generates is of course
(define (gcd a b)
(if (and (number? b) (= b 0))
a
`(gcd ,b (remainder ,a ,b))))
(gcd 206 40)
(gcd 40 (remainder 206 40))
(gcd (remainder 206 40) (remainder 40 (remainder 206 40)))
(gcd (remainder 40 (remainder 206 40))
(re... |
d3b437c1ba278d597c971214faf3eea63c44ab03c3725d4034d3a4731f123105 | lpw25/ocaml-typed-effects | stackoverflow.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/lpw25/ocaml-typed-effects/79ea08b285c1fd9caf3f5a4d2aa112877f882bea/testsuite/tests/runtime-errors/stackoverflow.ml | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 2001 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
let rec f x =
if not (x = 0 || x = 10... |
4b67ab743a697f576e98244ed45c51da07601f5fd6d1d881cd56149ee454b16e | processone/ejabberd | ejabberd_regexp.erl | %%%----------------------------------------------------------------------
%%% File : ejabberd_regexp.erl
Author :
%%% Purpose : Frontend to Re OTP module
Created : 8 Dec 2011 by
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2023 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/o... | null | https://raw.githubusercontent.com/processone/ejabberd/c103182bc7e5b8a8ab123ce02d1959a54e939480/src/ejabberd_regexp.erl | erlang | ----------------------------------------------------------------------
File : ejabberd_regexp.erl
Purpose : Frontend to Re OTP module
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
... | Author :
Created : 8 Dec 2011 by
ejabberd , Copyright ( C ) 2002 - 2023 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
with this pro... |
e69e2eace1dc0e398dce979dc8e4c52e15ad30d5e32ba7f464a839a1ded8ca1d | logseq/logseq | graph_parser_test.cljs | (ns logseq.graph-parser-test
(:require [cljs.test :refer [deftest testing is are]]
[clojure.string :as string]
[logseq.graph-parser :as graph-parser]
[logseq.db :as ldb]
[logseq.db.default :as default-db]
[logseq.graph-parser.block :as gp-block]
... | null | https://raw.githubusercontent.com/logseq/logseq/a4a5758afcb59436301f704b88638153ff1352aa/deps/graph-parser/test/logseq/graph_parser_test.cljs | clojure | Test page properties and block properties
Create Block properties from given page ones
has expected refs
ignore string values
pre-block/page has expected refs
block has expected refs | (ns logseq.graph-parser-test
(:require [cljs.test :refer [deftest testing is are]]
[clojure.string :as string]
[logseq.graph-parser :as graph-parser]
[logseq.db :as ldb]
[logseq.db.default :as default-db]
[logseq.graph-parser.block :as gp-block]
... |
3299ea8f2bed05bc05a48075b86693f003b090344d8235958c2686c0c0e46ebd | ghc/testsuite | T7545.hs | # LANGUAGE RankNTypes , InstanceSigs #
module T7545 where
class C a where
f :: a -> b
instance C (a -> b) where
f :: x
f = undefined
| null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_fail/T7545.hs | haskell | # LANGUAGE RankNTypes , InstanceSigs #
module T7545 where
class C a where
f :: a -> b
instance C (a -> b) where
f :: x
f = undefined
| |
328da2445096abe3a7fc8bbbebfb72d8ab849d902d99b3434ff43b7981ad7a60 | minoki/pandoc-aozora-ruby | TextCompat.hs | # LANGUAGE TypeFamilies #
module TextCompat where
import Data.String
import qualified Data.Text as T
class TextLike s where
toString :: s -> String
instance a ~ Char => TextLike [a] where
toString = id
instance TextLike T.Text where
toString = T.unpack
| null | https://raw.githubusercontent.com/minoki/pandoc-aozora-ruby/b33e8121b6ce211fd4dc1d792ac78d01ce4fa300/src/TextCompat.hs | haskell | # LANGUAGE TypeFamilies #
module TextCompat where
import Data.String
import qualified Data.Text as T
class TextLike s where
toString :: s -> String
instance a ~ Char => TextLike [a] where
toString = id
instance TextLike T.Text where
toString = T.unpack
| |
371eab3a777b10557f21e4f1d97d196157f4ce6bea67208e34b0f3f54098cfd5 | ha-mo-we/Racer | owlapi-synonyms.lisp | (in-package owlapi)
;;;
;;;----------------------------------------------
Automatically Generated
Version : 2.0 , Build : 2013 - 03 - 07
Date : March 07 2013 , 13:05
;;;----------------------------------------------
;;;
(progn
(owlapi-defun (owlapi-write-xml-ontology-file)
... | null | https://raw.githubusercontent.com/ha-mo-we/Racer/d690841d10015c7a75b1ded393fcf0a33092c4de/source/owlapi-synonyms.lisp | lisp |
----------------------------------------------
----------------------------------------------
| (in-package owlapi)
Automatically Generated
Version : 2.0 , Build : 2013 - 03 - 07
Date : March 07 2013 , 13:05
(progn
(owlapi-defun (owlapi-write-xml-ontology-file)
(&rest common-lisp-user::args)
(apply #'|OWLAPI-writeXMLOntologyFile| common-lisp-user::args))
(... |
b2ca53a36723f38e67513bdc9d5d92ce35482d52f6e9c4d964205d7598fd4bbb | well-typed/generics-sop | SOP.hs | # LANGUAGE PolyKinds , UndecidableInstances #
# OPTIONS_GHC -fno - warn - unused - binds #
| Main module of @sop - core@
module Data.SOP (
-- * n-ary datatypes
NP(..)
, NS(..)
, SOP(..)
, unSOP
, POP(..)
, unPOP
-- * Combinators
-- ** Constructing products
, HPure(..)
* * products
, h... | null | https://raw.githubusercontent.com/well-typed/generics-sop/39a3badb10e11efc4f907db557f998412ffc1b2a/sop-core/src/Data/SOP.hs | haskell | * n-ary datatypes
* Combinators
** Constructing products
** Application
** Lifting / mapping
** Constructing sums
deprecated export
deprecated export
** Comparison
** Collapsing
** Folding and sequencing
** Expanding sums to products
** Transformation of index lists and coercions
** Partial operations
* ... | # LANGUAGE PolyKinds , UndecidableInstances #
# OPTIONS_GHC -fno - warn - unused - binds #
| Main module of @sop - core@
module Data.SOP (
NP(..)
, NS(..)
, SOP(..)
, unSOP
, POP(..)
, unPOP
, HPure(..)
* * products
, hd
, tl
, Projection
, projections
, shiftProjection
, type (-.->)(..... |
530681e8930da7272beb91f65ee2c473e62c8027b9bcba1b6e730d366ba2c70f | exoscale/pithos | system.clj | (ns io.pithos.system)
(defprotocol SystemDescriptor
(regions [this])
(bucketstore [this])
(keystore [this])
(reporters [this])
(service [this])
(service-uri [this]))
(defn system-descriptor
[config]
(reify
SystemDescriptor
(regions [this] (:regions config))
(bucketstore [this] (:bucketstor... | null | https://raw.githubusercontent.com/exoscale/pithos/54790f00fbfd330c6196d42e5408385028d5e029/src/io/pithos/system.clj | clojure | (ns io.pithos.system)
(defprotocol SystemDescriptor
(regions [this])
(bucketstore [this])
(keystore [this])
(reporters [this])
(service [this])
(service-uri [this]))
(defn system-descriptor
[config]
(reify
SystemDescriptor
(regions [this] (:regions config))
(bucketstore [this] (:bucketstor... | |
eb6f87e1159071b69b37593edbbccea4d2ffbc4e8d579d1233968b7a880c9e53 | brownplt/LambdaS5 | components.ml | (**************************************************************************)
(* *)
: a generic graph library for OCaml
Copyright ( C ) 2004 - 2010
, and
(* ... | null | https://raw.githubusercontent.com/brownplt/LambdaS5/f0bf5c7baf1daa4ead4e398ba7d430bedb7de9cf/src/ocamlgraph-1.8.1/src/components.ml | ocaml | ************************************************************************
This software is free software; you can redistribute it and/or
described in file LICENSE.... | : a generic graph library for OCaml
Copyright ( C ) 2004 - 2010
, and
modify it under the terms of the GNU Library General Public
License version 2.1 , with the special exception on linking
$ I d :... |
5c0050656c78ee48e63794fab8dcdd3adda16f238f126fa5b93e0b26ed2bf338 | input-output-hk/ouroboros-network | TestEnv.hs | {-# LANGUAGE LambdaCase #-}
# LANGUAGE RecordWildCards #
| A @tasty@ command - line option for enabling nightly tests
module Test.Util.TestEnv (
TestEnv (..)
, askTestEnv
, defaultMainWithTestEnv
, defaultTestEnvConfig
) where
import Data.Proxy (Proxy (..))
import Options.Applica... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/31f2d871d2655b48a81c69f0f7365c08e10eb0df/ouroboros-consensus-test/src/Test/Util/TestEnv.hs | haskell | # LANGUAGE LambdaCase #
| 'defaultMain' extended with 'iohkTestEnvIngredient'
| Set the appropriate options for the test environment
| Test configurations for test environment
| Default set of tests for each environment
| An 'Option' that indicates the environment in which to run tests.
Set of choices for te... | # LANGUAGE RecordWildCards #
| A @tasty@ command - line option for enabling nightly tests
module Test.Util.TestEnv (
TestEnv (..)
, askTestEnv
, defaultMainWithTestEnv
, defaultTestEnvConfig
) where
import Data.Proxy (Proxy (..))
import Options.Applicative (metavar)
import T... |
7ff19b7185cb9fb572dfb96b323caab9e2814c76391d13427a7b45898bbf79fa | manuel-serrano/hop | source_map.scm | ;*=====================================================================*/
* serrano / prgm / project / hop/3.0.x / scheme2js / source_map.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation : ... | null | https://raw.githubusercontent.com/manuel-serrano/hop/481cb10478286796addd2ec9ee29c95db27aa390/scheme2js/source_map.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* JavaScript source map generation */
*===========================... | * serrano / prgm / project / hop/3.0.x / scheme2js / source_map.scm * /
* Author : * /
* Creation : Fri Jul 26 17:18:45 2013 * /
* Last change : Fri Jul 11 09:17:57 2014 ( serrano ) * /
* Copyri... |
9757583313de566f2a06a13e47395528345258a5b2f026e885adbfada15aaff5 | ovotech/clj-gcp | core_test.clj | (ns clj-gcp.integration.pub-sub.core-test
(:require [cheshire.core :as json]
[clj-gcp.pub-sub.utils :as mqu]
[clj-gcp.pub-sub.admin :as sut-admin]
[clj-gcp.pub-sub.core :as sut]
[clj-gcp.test-utils :as tu]
[clojure.string :as string]
[clojure.tes... | null | https://raw.githubusercontent.com/ovotech/clj-gcp/1a82e9c9711a21995141e102e7ef81e9e77dc739/test/clj_gcp/integration/pub_sub/core_test.clj | clojure | (ns clj-gcp.integration.pub-sub.core-test
(:require [cheshire.core :as json]
[clj-gcp.pub-sub.utils :as mqu]
[clj-gcp.pub-sub.admin :as sut-admin]
[clj-gcp.pub-sub.core :as sut]
[clj-gcp.test-utils :as tu]
[clojure.string :as string]
[clojure.tes... | |
4d4ef745e84d412aefbc92000ff11da73e28714ac33d7ab4680645b5ff57fed7 | adamwalker/clash-riscv | Replacement.hs | {-# LANGUAGE ScopedTypeVariables, GADTs #-}
module Cache.Replacement where
import Clash.Prelude
import Cache.PseudoLRUTree
type ReplacementFunc dom indexBits ways
= Signal dom (BitVector indexBits) --Index being looked up in the current cycle
-> Signal dom Bool --Hit in next cycle
-> ... | null | https://raw.githubusercontent.com/adamwalker/clash-riscv/84a90731a07c3427695b4926d7159f9e9902c1a1/src/Cache/Replacement.hs | haskell | # LANGUAGE ScopedTypeVariables, GADTs #
Index being looked up in the current cycle
Hit in next cycle
Way that was hit (if any) in the next cycle
Way to replace in the current cycle |
module Cache.Replacement where
import Clash.Prelude
import Cache.PseudoLRUTree
type ReplacementFunc dom indexBits ways
randomReplacement :: HiddenClockReset dom gated sync => ReplacementFunc dom indexBits 2
randomReplacement _ _ _ = bitCoerce <$> toReplace
where
toReplace = register False $ not <$> toRepl... |
92a8d05079543bc7a49bfdaebda7710355aeb6fa5f0dcb4842422308d9f434f0 | ekoontz/dag-unify | project.clj | (defproject dag_unify "1.11.1-SNAPSHOT"
:description "Unification of Directed Acyclic Graphs"
:url "-unify"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.11.1"]
[org.clojure/tools.logging "1.2.4"]])
| null | https://raw.githubusercontent.com/ekoontz/dag-unify/a2b4642032a308d37518fa41479a0d6c2956acc7/project.clj | clojure | (defproject dag_unify "1.11.1-SNAPSHOT"
:description "Unification of Directed Acyclic Graphs"
:url "-unify"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.11.1"]
[org.clojure/tools.logging "1.2.4"]])
| |
7eeef03ca2a7ee108af33e13be3b11522ef848903b5e26600070c15e0129ad11 | uwplse/rake | visitor.rkt | #lang rosette/safe
(require
rosette/lib/destruct
rake/halide/ir/types)
(provide (rename-out [visit halide:visit]))
;; Infer the length of vector generated by the expression
(define (visit expr handler)
(destruct expr
;; Abstract expressions
[(abstr-halide-expr orig-expr abstr-vals) (handler (abstr-hali... | null | https://raw.githubusercontent.com/uwplse/rake/0fb9b46ae8ac64f95a4c0e89060ffdb043229a5b/rake/halide/ir/visitor.rkt | racket | Infer the length of vector generated by the expression
Abstract expressions
Constructors
Type Casts
Shuffles
Base case | #lang rosette/safe
(require
rosette/lib/destruct
rake/halide/ir/types)
(provide (rename-out [visit halide:visit]))
(define (visit expr handler)
(destruct expr
[(abstr-halide-expr orig-expr abstr-vals) (handler (abstr-halide-expr orig-expr (visit abstr-vals handler)))]
[(x32 sca) (handler (x32 (vis... |
5facfae67fe1f258244fbaa2cf40a22c14e26d94d69eb106e62974c69778b553 | alexandroid000/improv | Listener.hs | module Listener (main) where
import Ros.Node
import Lens.Family (view)
import qualified Ros.Std_msgs.String as S
showMsg :: S.String -> IO ()
showMsg = putStrLn . ("I heard " ++) . view S._data
main = runNode "listener" $ runHandler showMsg =<< subscribe "chatter"
| null | https://raw.githubusercontent.com/alexandroid000/improv/ef0f4a6a5f99a9c7ff3d25f50529417aba9f757c/roshask/Examples/PubSub/src/Listener.hs | haskell | module Listener (main) where
import Ros.Node
import Lens.Family (view)
import qualified Ros.Std_msgs.String as S
showMsg :: S.String -> IO ()
showMsg = putStrLn . ("I heard " ++) . view S._data
main = runNode "listener" $ runHandler showMsg =<< subscribe "chatter"
| |
4b98ef95a17d83593ab1d3195b4251d92cd586b2f3787d3abde14f7e64f45a02 | abhimanyuma/Academic-Material | Diff.hs | module Diff where
import Root
import Sim
eval (F "diff" [a,V b]) = diff a (V b)
--Basic rules
diff (C _) (V _) = C 0
diff (V a) (V b) = if a==b then C 1
else C 0
diff (F f [C _]) (V _) = C 0
diff (F "sin" [V a]) (V b) = if a==b then F "cos" [V a]
else C 0
diff (F "cos" [V a]) (V b) = if a==... | null | https://raw.githubusercontent.com/abhimanyuma/Academic-Material/6badf113084c20d0d9259fc08a71e56528b168e4/Functional%20Programming/Project%20-%20Madskell/src/Diff.hs | haskell | Basic rules
diff (F "invsech" [V a]) (V b)
The fog rule
The Chain Rule
diff (F "cos" [a]) (V a) = F "-" [F "sin" [a]]
diff (F "tan" [a]) (V a) = F "sec2" [a]
diff (F "cot" [a]) (V a) = F "cosec2" [a]
diffy [a,(F "." []), b] = [ a, (F "." []) , diff b , (F "+" []) , b , (F "." []) , diff a]
for handli... | module Diff where
import Root
import Sim
eval (F "diff" [a,V b]) = diff a (V b)
diff (C _) (V _) = C 0
diff (V a) (V b) = if a==b then C 1
else C 0
diff (F f [C _]) (V _) = C 0
diff (F "sin" [V a]) (V b) = if a==b then F "cos" [V a]
else C 0
diff (F "cos" [V a]) (V b) = if a==b then F "-" [... |
c00805bc495dd2c7ed7248a92076ffc0f8979745dc861780851c9afeec08c39d | Reisen/pixel | GenerateTypes.hs | module Commands.GenerateTypes
( commandGenerateTypes
, generateTypes
) where
import Protolude
import Commands.Types ( Options(..), GenerateTypesOptions(..) )
import Data.Text as T ( lines, isInfixOf, unlines, replace )
import Data.Text.IO ( writeFile )
import Options.Applica... | null | https://raw.githubusercontent.com/Reisen/pixel/9096cc2c5b909049cdca6d14856ffc1fc99d81b5/src/app/Commands/GenerateTypes.hs | haskell | ------------------------------------------------------------------------------
Drop Header Lines (HACK: We don't really want headers ever)
------------------------------------------------------------------------------
Define primitives used for optparse | module Commands.GenerateTypes
( commandGenerateTypes
, generateTypes
) where
import Protolude
import Commands.Types ( Options(..), GenerateTypesOptions(..) )
import Data.Text as T ( lines, isInfixOf, unlines, replace )
import Data.Text.IO ( writeFile )
import Options.Applica... |
0ca4874c251c748719befcb99fd4f5057ad6981a09912bf18771ab0862e6a259 | VERIMAG-Polyhedra/VPL | DomainFunctors.mli | open ASAtomicCond
open ASCond
open ASTerm
open BinInt
open BinNums
open CstrC
open Datatypes
open Debugging
open DomainInterfaces
open FMapPositive
open ImpureConfig
open Itv
open LinTerm
open LinearizeBackend
open MSetPositive
open NumC
open PredTrans
open ProgVar
open Ring_polynom_AddOn
open String0
open ZNone
open Z... | null | https://raw.githubusercontent.com/VERIMAG-Polyhedra/VPL/cd78d6e7d120508fd5a694bdb01300477e5646f8/ocaml/extracted/DomainFunctors.mli | ocaml | singleton inductive, whose constructor was raw_build_cdac | open ASAtomicCond
open ASCond
open ASTerm
open BinInt
open BinNums
open CstrC
open Datatypes
open Debugging
open DomainInterfaces
open FMapPositive
open ImpureConfig
open Itv
open LinTerm
open LinearizeBackend
open MSetPositive
open NumC
open PredTrans
open ProgVar
open Ring_polynom_AddOn
open String0
open ZNone
open Z... |
8921bad95b1a8473cab0f7a1fd3a19d8f548ab14799598ded8afb3bd4260f837 | obsidiansystems/dependent-map | Typeable.hs | # LANGUAGE Trustworthy #
module Data.Dependent.Map.Typeable where
import Data.Dependent.Map.Internal
import Data.Typeable
instance (Typeable1 k, Typeable1 f) => Typeable (DMap k f) where
typeOf ds = mkTyConApp dMapCon [typeOfK, typeOfF]
where
typeOfK = typeOf1 $ (undefined :: DMap k f -> k a) ... | null | https://raw.githubusercontent.com/obsidiansystems/dependent-map/26677886eced970d661a5a7356ba4fe221c0324c/src/Data/Dependent/Map/Typeable.hs | haskell | # LANGUAGE Trustworthy #
module Data.Dependent.Map.Typeable where
import Data.Dependent.Map.Internal
import Data.Typeable
instance (Typeable1 k, Typeable1 f) => Typeable (DMap k f) where
typeOf ds = mkTyConApp dMapCon [typeOfK, typeOfF]
where
typeOfK = typeOf1 $ (undefined :: DMap k f -> k a) ... | |
5aa23491a82258a91c287159ba189133a0fb286dd52fa0e2992d89ed83dd1d97 | DaveWM/willa | experiment.clj | (ns willa.experiment
(:require [loom.graph :as l]
[loom.alg :as lalg]
[willa.core :as w]
[clojure.math.combinatorics :as combo]
[willa.utils :as wu])
(:import (org.apache.kafka.streams.kstream JoinWindows TimeWindows SessionWindows)))
(defn join-kstream-results [lef... | null | https://raw.githubusercontent.com/DaveWM/willa/7d927e2f012b147a5810ba36c07683c4459f5f22/src/willa/experiment.clj | clojure | treat topics as streams | (ns willa.experiment
(:require [loom.graph :as l]
[loom.alg :as lalg]
[willa.core :as w]
[clojure.math.combinatorics :as combo]
[willa.utils :as wu])
(:import (org.apache.kafka.streams.kstream JoinWindows TimeWindows SessionWindows)))
(defn join-kstream-results [lef... |
519042fb32480d2b8de21861cc1c3f285d83a3da6518283fed5e84dc1d2d0a59 | fiddlerwoaroof/lisp-sandbox | gemini-client.lisp | (defpackage :gemini.client
(:use :cl))
(in-package :gemini.client)
(defun ssl-connection (host port)
(flexi-streams:make-flexi-stream
(comm:open-tcp-stream host port :ssl-ctx t)
:external-format :utf-8))
(defun crlf (s)
(princ #\return s)
(princ #\newline s))
(defun request (uri s)
(puri:render-uri u... | null | https://raw.githubusercontent.com/fiddlerwoaroof/lisp-sandbox/38ff817c95af35db042faf760b477675264220d2/gemini-client.lisp | lisp | (defpackage :gemini.client
(:use :cl))
(in-package :gemini.client)
(defun ssl-connection (host port)
(flexi-streams:make-flexi-stream
(comm:open-tcp-stream host port :ssl-ctx t)
:external-format :utf-8))
(defun crlf (s)
(princ #\return s)
(princ #\newline s))
(defun request (uri s)
(puri:render-uri u... | |
108bdd8477f164653560a2cfedbf3aa657a868666d4168bf45f89ce4a86cf3a8 | abdulapopoola/SICPBook | Ex1.32.scm | #lang planet neil/sicp
;;HELPER methods
(define (cube x) (* x x x))
(define (inc x) (+ x 1))
(define (identity x) x)
;;This is the reduce/accumulate concept from func programming
Version
(define (accumulate combiner null-value term a next b)
(if (> a b)
null-value
(accumulate combiner (combiner (term a... | null | https://raw.githubusercontent.com/abdulapopoola/SICPBook/c8a0228ebf66d9c1ddc5ef1fcc1d05d8684f090a/Chapter%201/1.3/Ex1.32.scm | scheme | HELPER methods
This is the reduce/accumulate concept from func programming
RECURSIVE Version of accumulate
Sum of cubes
Beauty of this involves passing in the cube function to the sum function
which in turn relies on the accumulate function to succeed
Sum using iterative accumulate
Sum using recursive accumulate
Exam... | #lang planet neil/sicp
(define (cube x) (* x x x))
(define (inc x) (+ x 1))
(define (identity x) x)
Version
(define (accumulate combiner null-value term a next b)
(if (> a b)
null-value
(accumulate combiner (combiner (term a) null-value)
term (next a) next b)))
(define (accumulate2 ... |
0981d95c00ba8d2f1bba542cf65c377500f2d34b5e2394054316a7818caaeaff | marick/Midje | arglists.clj | (ns ^{:doc "Parsing function argument lists"}
midje.parsing.other.arglists
(:require [midje.config :as config]
[midje.emission.levels :as levels]
[midje.parsing.util.core :refer :all]
[midje.util.exceptions :refer [user-error]]
[midje.util.pile :as pile]
[... | null | https://raw.githubusercontent.com/marick/Midje/2b9bcb117442d3bd2d16446b47540888d683c717/src/midje/parsing/other/arglists.clj | clojure | Print levels (keywords)
Metadata filters
Keyword options with 0 or more arguments. | (ns ^{:doc "Parsing function argument lists"}
midje.parsing.other.arglists
(:require [midje.config :as config]
[midje.emission.levels :as levels]
[midje.parsing.util.core :refer :all]
[midje.util.exceptions :refer [user-error]]
[midje.util.pile :as pile]
[... |
cef2119e64e7809f7a4cebf5f7e3260bf1c166b3e01a6d967e3f1308334505a1 | fjvallarino/monomer | Spacer.hs | |
Module : . Widgets . Singles . Spacer
Copyright : ( c ) 2018
License : BSD-3 - Clause ( see the LICENSE file )
Maintainer :
Stability : experimental
Portability : non - portable
Spacer is used for adding a fixed space between two widgets .
@
hstack [
label \"Username\ " ... | null | https://raw.githubusercontent.com/fjvallarino/monomer/f693af605997227f692c1d796dfba3ade7d5ad4f/src/Monomer/Widgets/Singles/Spacer.hs | haskell | * Configuration
* Constructors
|
Configuration options for spacer widget:
- 'width': the max width for spacer, the reference for filler.
- 'resizeFactor': flexibility to have more or less spaced assigned.
| Creates a spacer widget.
| Creates a spacer widget. Accepts config.
| Creates a filler widget.
| Creates... | |
Module : . Widgets . Singles . Spacer
Copyright : ( c ) 2018
License : BSD-3 - Clause ( see the LICENSE file )
Maintainer :
Stability : experimental
Portability : non - portable
Spacer is used for adding a fixed space between two widgets .
@
hstack [
label \"Username\ " ... |
deaef015dcf1d063d279662314e88041b3984bdf54978f0598330f3c113fb99a | onaio/milia | images.cljc | (ns milia.utils.images
(:require [chimera.urls :refer [url]]
[milia.utils.remote :refer [thumbor-server]]))
(defn resize-image
"Return a URL for this image resized."
([image-url edge-px]
(resize-image image-url edge-px edge-px))
([image-url width-px height-px]
(resize-image image-url width-px... | null | https://raw.githubusercontent.com/onaio/milia/c68b612bd640aa2499e4ac2f907a7ef793d0820a/src/milia/utils/images.cljc | clojure | (ns milia.utils.images
(:require [chimera.urls :refer [url]]
[milia.utils.remote :refer [thumbor-server]]))
(defn resize-image
"Return a URL for this image resized."
([image-url edge-px]
(resize-image image-url edge-px edge-px))
([image-url width-px height-px]
(resize-image image-url width-px... | |
01df8348336d0ce0f65c51cf656ec76f9560f6275667c3878c2657a4fd8eaec5 | blindglobe/clocc | split-sequence.lisp | ;;;; SPLIT-SEQUENCE
;;;
This code was based on in
;;; <URL:>;
;;;
;;; changes include:
;;;
;;; * altering the behaviour of the :from-end keyword argument to
;;; return the subsequences in original order, for consistency with
CL : REMOVE , CL : SUBSTITUTE et al . (: from - end being non - NIL only
;;; affects the... | null | https://raw.githubusercontent.com/blindglobe/clocc/a50bb75edb01039b282cf320e4505122a59c59a7/src/defsystem-4/src/utilities/split-sequence.lisp | lisp | SPLIT-SEQUENCE
<URL:>;
changes include:
* altering the behaviour of the :from-end keyword argument to
return the subsequences in original order, for consistency with
affects the answer if :count is less than the number of
subsequences, by analogy with the above-referenced functions).
* changing the :maximum... | This code was based on in
CL : REMOVE , CL : SUBSTITUTE et al . (: from - end being non - NIL only
with CL : REMOVE , CL : SUBSTITUTE , and so on .
* The second return value is now an index rather than a copy of a
CL : SUBSEQ for continued processing .
functions and the CL : POSITION functions .
- > ... |
f8c46f24dd61a2f66b1bd865a4ddef2e0239dc6a3ce2bf79497ea5fe568b0a4b | akabe/ocaml-crf | crf_eval.ml | --- A library for conditional random field ( CRF ) in OCaml
Copyright ( C ) 2015 < >
This program is free software ; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation ; either version 3 of the License , o... | null | https://raw.githubusercontent.com/akabe/ocaml-crf/ced26bcce559b1eda307f7a8961ac9e52905882f/lib/crf_eval.ml | ocaml | prediction | --- A library for conditional random field ( CRF ) in OCaml
Copyright ( C ) 2015 < >
This program is free software ; you can redistribute it and/or modify it under
the terms of the GNU General Public License as published by the Free Software
Foundation ; either version 3 of the License , o... |
c4839893330a69a3c6a64cb9e5b161520eff4d88ad49301aa5b51e0ec5c71c5f | INRIA/zelus | zmatching.ml | (***********************************************************************)
(* *)
(* *)
(* Zelus, a synchronous language for hybrid systems *)
(* ... | null | https://raw.githubusercontent.com/INRIA/zelus/685428574b0f9100ad5a41bbaa416cd7a2506d5e/compiler/typing/zmatching.ml | ocaml | *********************************************************************
Zelus, a synchronous language for hybrid systems
... | ( c ) 2020 Paris ( see the file )
Automatique . All rights reserved . This file is distributed under
the terms of the INRIA Non - Commercial License Agreement ( see the
A generic pattern - matching verifier based on paper at JFLA
Author : 2009 ... |
f23b65552753a2d85abd6364bfbce482e48c885f65a28781af931bef9cbce75c | qfpl/reflex-workshop | Routing.hs | |
Copyright : ( c ) 2018 , Commonwealth Scientific and Industrial Research Organisation
License : :
Stability : experimental
Portability : non - portable
Copyright : (c) 2018, Commonwealth Scientific and Industrial Research Organisation
License : BSD3
Maintainer :
Stability : experi... | null | https://raw.githubusercontent.com/qfpl/reflex-workshop/244ef13fb4b2e884f455eccc50072e98d1668c9e/src/UI/Routing.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE GADTs # | |
Copyright : ( c ) 2018 , Commonwealth Scientific and Industrial Research Organisation
License : :
Stability : experimental
Portability : non - portable
Copyright : (c) 2018, Commonwealth Scientific and Industrial Research Organisation
License : BSD3
Maintainer :
Stability : experi... |
048dd0838edaca218958095df843472f6081b0a9bd89ced3b0cd1ce07dd03dfa | ygmpkk/house | HuttonMeijerWallace.hs | ----------------------------------------------------------------------------
A LIBRARY OF MONADIC PARSER COMBINATORS
29th July 1996
University of Nottingham University of Utrecht
This 1.3 script defines a l... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/libraries/HaXml/src/Text/ParserCombinators/HuttonMeijerWallace.hs | haskell | --------------------------------------------------------------------------
----------------------------------------------------------------------------
---------------------------------------------------------------------------
----------------------------------------------------------------------------
-------------... |
A LIBRARY OF MONADIC PARSER COMBINATORS
29th July 1996
University of Nottingham University of Utrecht
This 1.3 script defines a library of parser combinators , and is taken
from sections 1 - 6 of our artic... |
abc5371b9fd0763e1ba0b431966341c3528eed3f00c70f67fd6a9548e9de36d9 | DOBRO/uef-lib | uef_crypt.erl | Copyright ( c ) 2019 - 2022 , < > . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in w... | null | https://raw.githubusercontent.com/DOBRO/uef-lib/765d28837584bcfced1aae5d5f831972ec0254bb/src/uef_crypt.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permi... | Copyright ( c ) 2019 - 2022 , < > . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(uef_crypt).
-export([md5_hex/1]).
md5_hex/1
-spec md5_hex(IoData :: iodata()) -> Binary :: binary().... |
e60d58930ba37f2e6989a0d817e3202659a5355fc1d854d38163d4c6665a76e4 | simplex-chat/simplexmq | M20220101_initial.hs | # LANGUAGE QuasiQuotes #
module Simplex.Messaging.Agent.Store.SQLite.Migrations.M20220101_initial where
import Database.SQLite.Simple (Query)
import Database.SQLite.Simple.QQ (sql)
m20220101_initial :: Query
m20220101_initial =
[sql|
CREATE TABLE servers (
host TEXT NOT NULL,
port TEXT NOT NULL,
key_hash BLO... | null | https://raw.githubusercontent.com/simplex-chat/simplexmq/69a5896dac4505ca2a570f080cf96167afdee535/src/Simplex/Messaging/Agent/Store/SQLite/Migrations/M20220101_initial.hs | haskell | x3dh keys are not saved on the sending side (the side accepting the connection)
ratchet is initially empty on the receiving side (the side offering the connection) | # LANGUAGE QuasiQuotes #
module Simplex.Messaging.Agent.Store.SQLite.Migrations.M20220101_initial where
import Database.SQLite.Simple (Query)
import Database.SQLite.Simple.QQ (sql)
m20220101_initial :: Query
m20220101_initial =
[sql|
CREATE TABLE servers (
host TEXT NOT NULL,
port TEXT NOT NULL,
key_hash BLO... |
3ee5ea12b13b186d79f1a06d4428b4b904c14a130d3ce62146647a43524186b3 | lspector/Clojush | median.clj | ;; median.clj
,
;;
;; Problem Source:
C. Le Goues et al . , " The ManyBugs and for Automated Repair of C Programs , "
in IEEE Transactions on Software Engineering , vol . 41 , no . 12 , pp . 1236 - 1256 , Dec. 1 2015 .
doi : 10.1109 / TSE.2015.2454513
;;
Given 3 integers , print their median .
;;
... | null | https://raw.githubusercontent.com/lspector/Clojush/685b991535607cf942ae1500557171a0739982c3/src/clojush/problems/software/median.clj | clojure | median.clj
Problem Source:
Atom generators
end input instructions
A list of data domains for the median problem. Each domain is a vector containing
should be used as training and testing cases respectively. Each "set" of
inputs is either a list or a function that, when called, will create a
random element of... | ,
C. Le Goues et al . , " The ManyBugs and for Automated Repair of C Programs , "
in IEEE Transactions on Software Engineering , vol . 41 , no . 12 , pp . 1236 - 1256 , Dec. 1 2015 .
doi : 10.1109 / TSE.2015.2454513
Given 3 integers , print their median .
input stack has the 3 integers
(ns cloju... |
c4d9ddad6ef03e7a6936bc39118d283596ed04ab826ff1c3e467146b88f6ab77 | noinia/hgeometry | SSSP.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
module SSSP (ssspMulti) where
import Control.Lens ((^.))
import Reanimate (Animation, animate, curveS, fadeOutE, fork, fromToS, mkAnimation,
mkCircle, mkGroup, mkLine,... | null | https://raw.githubusercontent.com/noinia/hgeometry/89cd3d3109ec68f877bf8e34dc34b6df337a4ec1/hgeometry-showcase/src/SSSP.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE RankNTypes # | # LANGUAGE ScopedTypeVariables #
module SSSP (ssspMulti) where
import Control.Lens ((^.))
import Reanimate (Animation, animate, curveS, fadeOutE, fork, fromToS, mkAnimation,
mkCircle, mkGroup, mkLine, newSpriteA', newSpriteSVG, newSpriteSVG_,
ove... |
ef908f79a2d1afa83f1529f74c45cc566e79d427e5f833552a0ad02780ab4fb1 | bos/rwh | rms.hs | {-- snippet rootMeanSquare --}
rootMeanSquare :: [Double] -> Double
rootMeanSquare xs = sqrt (sum (map square xs) / fromIntegral (length xs))
where square x = x * x
{-- /snippet rootMeanSquare --}
rootMeanSquare_explicit xs = sqrt (meanSquare xs 0 0)
where meanSquare [] i ms = ms / fromIntegral i
... | null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch05/rms.hs | haskell | - snippet rootMeanSquare -
- /snippet rootMeanSquare -
- snippet rootMeanSquare_foldl -
- /snippet rootMeanSquare_foldl - | rootMeanSquare :: [Double] -> Double
rootMeanSquare xs = sqrt (sum (map square xs) / fromIntegral (length xs))
where square x = x * x
rootMeanSquare_explicit xs = sqrt (meanSquare xs 0 0)
where meanSquare [] i ms = ms / fromIntegral i
meanSquare (x:xs) i ms = meanSquare xs (i+1) (ms + x**2)
roo... |
3d27ef78d31f5b34d2d27db138d87bd3c65b4c7fcf346aeb73abf39d95c1e7ef | noloop/eventbus | eventbus.lisp | (in-package #:noloop.eventbus)
(defun make-eventbus ()
"Return eventbus instance."
(make-hash-table :test 'eq))
(defun get-listener-count-of-event (eventbus event-name)
"Return length listeners of event. Return nil if event nonexistent."
(length (gethash event-name eventbus)))
(defun get-all-listeners-of-eve... | null | https://raw.githubusercontent.com/noloop/eventbus/92c1fa3846ba0e3cc9e6d7605d765379c8658d84/src/eventbus.lisp | lisp | (in-package #:noloop.eventbus)
(defun make-eventbus ()
"Return eventbus instance."
(make-hash-table :test 'eq))
(defun get-listener-count-of-event (eventbus event-name)
"Return length listeners of event. Return nil if event nonexistent."
(length (gethash event-name eventbus)))
(defun get-all-listeners-of-eve... | |
e1104ef0f82b6d4b9cd8a881e3744673e661c1f789816bdf50f2dbe49a1cb904 | qfpl/reflex-workshop | CounterText.hs | |
Copyright : ( c ) 2018 , Commonwealth Scientific and Industrial Research Organisation
License : :
Stability : experimental
Portability : non - portable
Copyright : (c) 2018, Commonwealth Scientific and Industrial Research Organisation
License : BSD3
Maintainer :
Stability : experi... | null | https://raw.githubusercontent.com/qfpl/reflex-workshop/244ef13fb4b2e884f455eccc50072e98d1668c9e/src/Exercises/Behaviors/Querying/CounterText.hs | haskell | |
Copyright : ( c ) 2018 , Commonwealth Scientific and Industrial Research Organisation
License : :
Stability : experimental
Portability : non - portable
Copyright : (c) 2018, Commonwealth Scientific and Industrial Research Organisation
License : BSD3
Maintainer :
Stability : experi... | |
85bab6db11a0285051c52998c1969f5f68533970069e5cf168bfc6260fa09ba8 | gedge-platform/gedge-platform | cuttlefish_vmargs.erl | -module(cuttlefish_vmargs).
-export([stringify/1]).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
%% @doc turns a proplist into a list of strings suitable for vm.args files
-spec stringify([{any(), string()}]) -> [string()].
stringify(VMArgsProplist) ->
[ stringify_line(K, V) || {K, V} <- VMArgs... | null | https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/cuttlefish/src/cuttlefish_vmargs.erl | erlang | @doc turns a proplist into a list of strings suitable for vm.args files | -module(cuttlefish_vmargs).
-export([stringify/1]).
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
-spec stringify([{any(), string()}]) -> [string()].
stringify(VMArgsProplist) ->
[ stringify_line(K, V) || {K, V} <- VMArgsProplist ].
stringify_line(K, V) when is_list(V) ->
lists:flatten(io_li... |
c64b01268bc30cdc1a18acc5287988729269ee6c0b71645d83a013d2e71ca5b6 | yzhs/ocamlllvm | translclass.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet Cri... | null | https://raw.githubusercontent.com/yzhs/ocamlllvm/45cbf449d81f2ef9d234968e49a4305aaa39ace2/src/bytecomp/translclass.mli | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ I d : translclass.mli 7372 2006 - 04 -... |
fb684b181262826b3fba8ff71f6ee4b7c7ea9c6dc15e949735df8acb40624815 | atolab/apero-core | ordered.ml | module type Comparable = sig
type t
val compare : t -> t -> int
val equal : t -> t -> bool
end
module Ordered = struct
module type S = sig
include Comparable
module Infix : sig
val (=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : ... | null | https://raw.githubusercontent.com/atolab/apero-core/6e8b9bb8383de641396463fb4e5685b7f135755c/lib/ordered.ml | ocaml | module type Comparable = sig
type t
val compare : t -> t -> int
val equal : t -> t -> bool
end
module Ordered = struct
module type S = sig
include Comparable
module Infix : sig
val (=) : t -> t -> bool
val (>) : t -> t -> bool
val (>=) : t -> t -> bool
val (<) : ... | |
ba3e003faeae6052c776dca41d9592af52dff15280e28db8abb067fdee5a7346 | sarabander/p2pu-sicp | 2.27.scm |
(define (reverse-list lst)
(if (null? lst)
empty
(append (reverse-list (cdr lst)) (list (car lst)))))
(define (deep-reverse1 lst)
(if (pair? lst)
(append (deep-reverse1 (cdr lst))
(list (deep-reverse1 (car lst))))
lst))
(define (deep-reverse2 lst)
(if (pair? lst)... | null | https://raw.githubusercontent.com/sarabander/p2pu-sicp/fbc49b67dac717da1487629fb2d7a7d86dfdbe32/2.2/2.27.scm | scheme |
(define (reverse-list lst)
(if (null? lst)
empty
(append (reverse-list (cdr lst)) (list (car lst)))))
(define (deep-reverse1 lst)
(if (pair? lst)
(append (deep-reverse1 (cdr lst))
(list (deep-reverse1 (car lst))))
lst))
(define (deep-reverse2 lst)
(if (pair? lst)... | |
942b32b144d5193b9b17420dfe3120fb545a431965c6a698b9e7393ee73e81f6 | ocaml-multicore/tezos | configuration.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2022 Nomadic Labs , < >
(* ... | null | https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_alpha/bin_sc_rollup_client/configuration.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2022 Nomadic Labs , < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN A... |
413c418cbffe12d61e4cfbad66491ff75e1d87169dde8a7bcc8498177f330665 | redbadger/karma-tracker | events_repository.clj | (ns karma-tracker.events-repository
(:require [monger.core :as mongo]
[monger.collection :as collection]
[monger.query :as q]
monger.joda-time
[clj-time.core :refer [with-time-at-start-of-day] :as t]
[clj-time.coerce :refer [to-date-time]]
[clj-t... | null | https://raw.githubusercontent.com/redbadger/karma-tracker/c5375f32f4cd0386f6bb1560d979b79bceea19e2/src/karma_tracker/events_repository.clj | clojure | (ns karma-tracker.events-repository
(:require [monger.core :as mongo]
[monger.collection :as collection]
[monger.query :as q]
monger.joda-time
[clj-time.core :refer [with-time-at-start-of-day] :as t]
[clj-time.coerce :refer [to-date-time]]
[clj-t... | |
983765d05ed2745d823da376382f32c0e7aa2e00bbab4aba3365f7a8952df256 | amnh/PCG | ParEnabledNode.hs | # LANGUAGE BangPatterns , DeriveGeneric #
module PackingPar.ParEnabledNode (ParEnabledNode (..),
(B..&.)) where
-- | imports
import Control.DeepSeq
import qualified Data.Bits as B
import Data.Either
import Data.List
import Data.Maybe
import qualified Dat... | null | https://raw.githubusercontent.com/amnh/PCG/3a1b6bdde273ed4dc09717623986e1144b006904/prototype/PackingPar/ParEnabledNode.hs | haskell | | imports
| Define the data type:
All cardinalities except for the "infinite" type are from the stored table
| Make the instance
| And function: throws errors for different length bits, and of any empty node returns an empty
:: A.Vector A.Word16
:: A.Vector A.Word16 | # LANGUAGE BangPatterns , DeriveGeneric #
module PackingPar.ParEnabledNode (ParEnabledNode (..),
(B..&.)) where
import Control.DeepSeq
import qualified Data.Bits as B
import Data.Either
import Data.List
import Data.Maybe
import qualified Data.Vector a... |
32985ad974a08c2532995c4e64420a7101b1b0325da1166d25ac132f2e50b4bb | mbutterick/sugar | stub.rkt | #lang racket/base
(require (for-syntax racket/base racket/syntax))
(provide (all-defined-out))
(begin-for-syntax
(require racket/string racket/format)
(define (make-prefix caller-stx)
(string-join (map ~a (list (syntax-source caller-stx) (syntax-line caller-stx))) ":" #:after-last ":")))
(define-syntax (defin... | null | https://raw.githubusercontent.com/mbutterick/sugar/990b0b589274a36a58e27197e771500c5898b5a2/sugar/unstable/stub.rkt | racket | #lang racket/base
(require (for-syntax racket/base racket/syntax))
(provide (all-defined-out))
(begin-for-syntax
(require racket/string racket/format)
(define (make-prefix caller-stx)
(string-join (map ~a (list (syntax-source caller-stx) (syntax-line caller-stx))) ":" #:after-last ":")))
(define-syntax (defin... | |
608cfcabca4f43a50bb5e78217d2663e632d43ea4b9fddc045b01846736a7c26 | defaultxr/cl-patterns | event.lisp | ;;;; t/event.lisp - tests for `event' and related functionality.
;;; TODO:
;; FIX: add more
(in-package #:cl-patterns/tests)
(in-suite cl-patterns-tests)
(test event
"Test event functionality"
(is (= 1
(event-value (event :dur 0 :sustain 1) :sustain))
"event returns the wrong sustain when sustain... | null | https://raw.githubusercontent.com/defaultxr/cl-patterns/e4bcdcf1dff29dcdf83de79ade4412896753a027/t/event.lisp | lisp | t/event.lisp - tests for `event' and related functionality.
TODO:
FIX: add more |
(in-package #:cl-patterns/tests)
(in-suite cl-patterns-tests)
(test event
"Test event functionality"
(is (= 1
(event-value (event :dur 0 :sustain 1) :sustain))
"event returns the wrong sustain when sustain is provided and dur is 0")
(is (= 0.8
(event-value (event) :sustain))
"eve... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.