_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 |
|---|---|---|---|---|---|---|---|---|
22f144f57a25873aa357308514699748fd0c3f4cacacf18ef1a38030314105b2 | dgiot/dgiot | emqx_types.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2018 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/dgiot/dgiot/c601555e45f38d02aafc308b18a9e28c543b6f2c/src/emqx_types.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2018 - 2022 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_types).
-include("emqx.hrl").
-include("emqx_mqtt.hrl").
-include("types.hrl").
-... |
15d2b12dd630b0db9f03e04883f9fa9cf79fe0a9b539fbfaa19bda2087f99ca9 | sealchain-project/sealchain | Constants.hs | module Pos.Infra.DHT.Constants
( enhancedMessageTimeout
, neighborsSendThreshold
, kademliaDumpInterval
, enhancedMessageBroadcast
) where
import Universum
-- | Minimum number of neighbours to send to.
neighborsSendThreshold :: (Integral a) => a
neighborsSendThreshold = 2
... | null | https://raw.githubusercontent.com/sealchain-project/sealchain/e97b4bac865fb147979cb14723a12c716a62e51e/infra/src/Pos/Infra/DHT/Constants.hs | haskell | | Minimum number of neighbours to send to.
| Broadcast to nodes whose were pinged at most @enhancedMessageTimeout@ seconds ago.
| Number of nodes from batch for enhanced bessage broadcast | module Pos.Infra.DHT.Constants
( enhancedMessageTimeout
, neighborsSendThreshold
, kademliaDumpInterval
, enhancedMessageBroadcast
) where
import Universum
neighborsSendThreshold :: (Integral a) => a
neighborsSendThreshold = 2
| Interval for dumping state of Kademlia in... |
0ff65283e6facca8c391395f32ae2ee6176e0e182157289094424e649f7429c8 | rabbitmq/rabbitmq-auth-backend-ldap | unit_SUITE.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(unit_SUITE).
-include_lib("common_test/i... | null | https://raw.githubusercontent.com/rabbitmq/rabbitmq-auth-backend-ldap/f0c0a7042e30e90c9287c33de3bfeeab8411c742/test/unit_SUITE.erl | erlang | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
-module(unit_SUITE).
-include_lib("common_test/include... | |
4b38ded82a5a9b7007231a213d03a82ecb1f23aebaead23c60b2740a7ecdfea7 | TrustInSoft/tis-kernel | Aorai.mli | (**************************************************************************)
(* *)
This file is part of .
(* *)
is a fork of Frama - C. Al... | null | https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/plugins/aorai/Aorai.mli | ocaml | ************************************************************************
... | This file is part of .
is a fork of Frama - C. All the differences are :
Copyright ( C ) 2016 - 2017
is released under GPLv2
This file is part of Aorai plug - in of Frama - C.
Copyright ( C ) 2007 - 2015 ... |
fd8ae7b5d3180605b220dc7e7132dd76d8793959a9324a64332ad019c7222667 | Ptival/chick | LocalContextOps.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE TemplateHaskell #
module Typing.LocalContextOps (
LocalContextOps(..),
addAssumption,
freshBinder,
getLocalContext,
interpretLocalContextOps,
lookupType,
withAssumption,
) where
import Polysemy
import Polysemy.Error
import Polys... | null | https://raw.githubusercontent.com/Ptival/chick/a5ce39a842ff72348f1c9cea303997d5300163e2/backend/lib/Typing/LocalContextOps.hs | haskell | type Checked = C.Term Variable
trace "Removing assumption"
| An infinite supply of valid identifiers | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE TemplateHaskell #
module Typing.LocalContextOps (
LocalContextOps(..),
addAssumption,
freshBinder,
getLocalContext,
interpretLocalContextOps,
lookupType,
withAssumption,
) where
import Polysemy
import Polysemy.Error
import Polys... |
0943afe44c047f1ead1033c1bdc52ad84ffa28b52beb66bae1ee0bc2100e0c65 | peterholko/pax_server | unit.erl | Author :
Created : Mar 1 , 2009
%% Description: TODO: Add description to unit
-module(unit).
-behaviour(gen_server).
%%
%% Include files
%%
-include("common.hrl").
-include("schema.hrl").
-include_lib("stdlib/include/qlc.hrl").
%%
%% Exported Functions
%%
-export([start/0, init/1, handle_call/3, handle_cast/2, ... | null | https://raw.githubusercontent.com/peterholko/pax_server/62b2ec1fae195ff915d19af06e56a7c4567fd4b8/src/unit.erl | erlang | Description: TODO: Add description to unit
Include files
Exported Functions
API Functions
Remove gear and material requirements for unit
====================================================================
Server functions
====================================================================
--------------... | Author :
Created : Mar 1 , 2009
-module(unit).
-behaviour(gen_server).
-include("common.hrl").
-include("schema.hrl").
-include_lib("stdlib/include/qlc.hrl").
-export([start/0, init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-export([create/4,
delete/1,
damag... |
c52550fda54c8f4f8dab2556f4551346cee809a327038caaee26cff130908ac3 | khigia/ocaml-anneal | walks.ml | let dichotomic_seq arr =
let len = Array.length arr in
let s = Seq.dichotomy_int 0 len in
Seq.map (fun idx -> arr.(idx)) (Seq.push_front 0 s)
let pair_permutation_seq x y =
let xs = Seq.of_array x in
let ys = Seq.of_array y in
let s = Seq.cart [xs;ys;] in
Seq.map (fun [i;j;] -> (i,j)) s
le... | null | https://raw.githubusercontent.com/khigia/ocaml-anneal/70ff50f1b4dc28875f1246822dbd1b8d1fbff912/walks.ml | ocaml | let dichotomic_seq arr =
let len = Array.length arr in
let s = Seq.dichotomy_int 0 len in
Seq.map (fun idx -> arr.(idx)) (Seq.push_front 0 s)
let pair_permutation_seq x y =
let xs = Seq.of_array x in
let ys = Seq.of_array y in
let s = Seq.cart [xs;ys;] in
Seq.map (fun [i;j;] -> (i,j)) s
le... | |
a3447b4ec6f39cb5b19e53233c9e7c40f800812fb0e1cdfd6e4ee6fd75c3ed10 | solita/mnt-teet | road_model.cljc | (ns teet.road.road-model
"Common utilities for manipulating road addresses")
(defn km->m [km]
(long (* km 1000)))
(defn m->km [m]
(/ m 1000.0))
(defn format-distance [m]
(str #?(:cljs (.toFixed (m->km m) 3)
:clj (printf "%.3f" (m->km m)))
" km"))
(defn parse-km [km]
#?(:cljs (js/parseFloa... | null | https://raw.githubusercontent.com/solita/mnt-teet/7a5124975ce1c7f3e7a7c55fe23257ca3f7b6411/app/common/src/cljc/teet/road/road_model.cljc | clojure | (ns teet.road.road-model
"Common utilities for manipulating road addresses")
(defn km->m [km]
(long (* km 1000)))
(defn m->km [m]
(/ m 1000.0))
(defn format-distance [m]
(str #?(:cljs (.toFixed (m->km m) 3)
:clj (printf "%.3f" (m->km m)))
" km"))
(defn parse-km [km]
#?(:cljs (js/parseFloa... | |
d173e7f829a40b7fcb0b2c017d5c683638ae0005906e74b2297c4f4160073d74 | jeapostrophe/adqc | calc.rkt | #lang racket/base
(require adqc
racket/port)
(define-simple-E-expander (C c)
(E (U8 (char->integer c))))
(define main
(F+ S32 ([S32 n1] [U8 op] [S32 n2])
(println
(cond [(= op (C #\+)) (+ n1 n2)]
[(= op (C #\-)) (- n1 n2)]
[(= op (C #\*)) (* n1 n2)]
[(=... | null | https://raw.githubusercontent.com/jeapostrophe/adqc/59030f17f603356786a2cf19b78e54ccb1181848/t/calc.rkt | racket | XXX type can be inferred here? | #lang racket/base
(require adqc
racket/port)
(define-simple-E-expander (C c)
(E (U8 (char->integer c))))
(define main
(F+ S32 ([S32 n1] [U8 op] [S32 n2])
(println
(cond [(= op (C #\+)) (+ n1 n2)]
[(= op (C #\-)) (- n1 n2)]
[(= op (C #\*)) (* n1 n2)]
[(=... |
6e660c99e05313c6de0d5f45f7725e7018190830367a1afe562a08d89c6d46a3 | dyzsr/ocaml-selectml | unbound_type_variables.ml | (* TEST
* expect
*)
type synonym = 'a -> 'a
[%%expect{|
Line 1, characters 15-17:
1 | type synonym = 'a -> 'a
^^
Error: The type variable 'a is unbound in this type declaration.
|}]
type record = { contents: 'a }
[%%expect{|
Line 1, characters 26-28:
1 | type record = { contents: 'a }
... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/testsuite/tests/typing-misc/unbound_type_variables.ml | ocaml | TEST
* expect
This type secretly has a type variable in it |
type synonym = 'a -> 'a
[%%expect{|
Line 1, characters 15-17:
1 | type synonym = 'a -> 'a
^^
Error: The type variable 'a is unbound in this type declaration.
|}]
type record = { contents: 'a }
[%%expect{|
Line 1, characters 26-28:
1 | type record = { contents: 'a }
^... |
98fd88b824dab8dc7c7b2abaf487c1f52a20ec8520cd892f0be8e8a3b91b2c03 | matterhorn-chat/matterhorn | Zipper.hs | module Matterhorn.Zipper
( Zipper
, fromList
, toList
, focus
, focusHeading
, left
, leftL
, right
, rightL
, findRight
, maybeFindRight
, updateListBy
, filterZipper
, maybeMapZipper
, isEmpty
, position
)
where
import Prelude ()
import Matterhorn.Prelude hiding ... | null | https://raw.githubusercontent.com/matterhorn-chat/matterhorn/56ddbc012685b1e3dc50feca716f63b5d810f37a/src/Matterhorn/Zipper.hs | haskell | A lens on the zipper moved to the left
A lens on the zipper moved to the right
Return the focus element
Return the heading value corresponding to the focused value, if any
element is in focus
Turn a list into a wraparound zipper, focusing on the head
Shift the focus until a given element is found, or return the
... | module Matterhorn.Zipper
( Zipper
, fromList
, toList
, focus
, focusHeading
, left
, leftL
, right
, rightL
, findRight
, maybeFindRight
, updateListBy
, filterZipper
, maybeMapZipper
, isEmpty
, position
)
where
import Prelude ()
import Matterhorn.Prelude hiding ... |
b8167380a3988b79e5f0961fc3ac3ed3a6a0b5628dce3146c1cfb95b94479923 | marigold-dev/pollinate | util_prop.ml | open Messages
module SUT = Pollinate.Util.Encoding
let pack_unpack =
QCheck2.Test.make ~count:1000 ~name:"unpack . pack returns the original value"
Generators.request_gen (fun random_request ->
let open Messages in
random_request
= SUT.unpack bin_read_request
@@ SUT.pack bin_writer_requ... | null | https://raw.githubusercontent.com/marigold-dev/pollinate/1dcc46fa95b5e063e37cddbf0c5e4caccfffaf66/test/util_prop.ml | ocaml | open Messages
module SUT = Pollinate.Util.Encoding
let pack_unpack =
QCheck2.Test.make ~count:1000 ~name:"unpack . pack returns the original value"
Generators.request_gen (fun random_request ->
let open Messages in
random_request
= SUT.unpack bin_read_request
@@ SUT.pack bin_writer_requ... | |
9a0a2dbbddf55c28b75ae6635ec896c1987f644640d26b3b57df53c567f1da6d | kowainik/smuggler | Dummy.hs | module Test.Dummy where
main :: IO ()
main = pure ()
| null | https://raw.githubusercontent.com/kowainik/smuggler/b2ddcdad06a270e0b956f2203f9bebcd72301c53/test/Test/Dummy.hs | haskell | module Test.Dummy where
main :: IO ()
main = pure ()
| |
e5787e8893a88eadfe41525fe594bb2cb40bfe16d87cc7ac6d93c6d9d69a6afb | nccgroup/pairing-bls12381 | Pairing_bls12381.hs | |
Module : Pairing_bls12381
Description : Pairing over the BLS12 - 381 elliptic curve
Copyright : ( c ) , NCC Group Plc , 2020
License : BSD-3
Maintainer :
Stability : experimental
Implements the BLS12 - 381 point generation and pairing calculation per
< -snark-curve/ > .
This c... | null | https://raw.githubusercontent.com/nccgroup/pairing-bls12381/617c555b2b94797528049ff9a02789cb39c0e1a9/Crypto/Pairing_bls12381.hs | haskell | | The field prime constant used in BLS12-381 is exported for reference.
Multiplicative inverse
Multiply by non-reducible polynomial
Fq1 is 'standard' single-element finite field
All fields inverse (incl 0) arrive here
Binary Extended Euclidean Algorithm (note that there are no divisions)
Fq2 is constructed with ... | |
Module : Pairing_bls12381
Description : Pairing over the BLS12 - 381 elliptic curve
Copyright : ( c ) , NCC Group Plc , 2020
License : BSD-3
Maintainer :
Stability : experimental
Implements the BLS12 - 381 point generation and pairing calculation per
< -snark-curve/ > .
This c... |
b60937169756701be772c2dde7b7a417ed7f0b82426ba6a91b15300b961a8dce | AshleyYakeley/Truth | Markdown.hs | module Pinafore.Markdown
( PlainText(..)
, RawMarkdown
, asRawMarkdown
, MarkdownText
, rawMarkdown
, tagMarkdown
, boldMarkdown
, italicMarkdown
, codeMarkdown
, Markdown
, paragraphMarkdown
, titleMarkdown
, indentMarkdown
, indentMarkdownN
) where
import P... | null | https://raw.githubusercontent.com/AshleyYakeley/Truth/53900d89022f68bffb08d5c07b4e783ab0a0542e/Pinafore/pinafore-language/lib/Pinafore/Markdown.hs | haskell | | CommonMark | module Pinafore.Markdown
( PlainText(..)
, RawMarkdown
, asRawMarkdown
, MarkdownText
, rawMarkdown
, tagMarkdown
, boldMarkdown
, italicMarkdown
, codeMarkdown
, Markdown
, paragraphMarkdown
, titleMarkdown
, indentMarkdown
, indentMarkdownN
) where
import P... |
98ca0155c9e3d529996f6b1befdac1af2b929e37e9632d10cb53c4b6624fe06a | zwizwa/erl_tools | ghcid.erl | %% Wrapper for ghcid.
%% - test output is not included in ghcid output file, so maybe just
%% write it to another file in the hs test.
-module(ghcid).
-export([start_link/1, handle/2, success/1, clean/1]).
%% There seems to be an issue: multiple instances are started.
start_link(#{ ghcid_cmd := Cmd, notify := ... | null | https://raw.githubusercontent.com/zwizwa/erl_tools/07645992e968c1456c9d0212f380afd1ffce4c1f/src/ghcid.erl | erlang | Wrapper for ghcid.
- test output is not included in ghcid output file, so maybe just
write it to another file in the hs test.
There seems to be an issue: multiple instances are started.
to the running process.
manifests as the folling error:
I've enabled console logging, so it should be easy to spot. The
g... |
-module(ghcid).
-export([start_link/1, handle/2, success/1, clean/1]).
start_link(#{ ghcid_cmd := Cmd, notify := {_M,_F,_A} } = Config) ->
{ok,
serv:start(
{handler,
fun() ->
Port = open_port({spawn, Cmd}, [use_stdio, binary, exit_status]),
maps:merge(
... |
3acf7e96714d361b9d9e6bdfd701099bc9d489f675e0ff57ceff99b0d928b68d | tsloughter/kuberl | kuberl_autoscaling_v1_api.erl | -module(kuberl_autoscaling_v1_api).
-export([create_namespaced_horizontal_pod_autoscaler/3, create_namespaced_horizontal_pod_autoscaler/4,
delete_collection_namespaced_horizontal_pod_autoscaler/2, delete_collection_namespaced_horizontal_pod_autoscaler/3,
delete_namespaced_horizontal_pod_autoscaler/4,... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_autoscaling_v1_api.erl | erlang | @doc
create a HorizontalPodAutoscaler
@doc
delete collection of HorizontalPodAutoscaler
@doc
delete a HorizontalPodAutoscaler
@doc
get available resources
@doc
list or watch objects of kind HorizontalPodAutoscaler
@doc
list or watch objects of kind HorizontalPodAutoscaler
@doc
partially update the ... | -module(kuberl_autoscaling_v1_api).
-export([create_namespaced_horizontal_pod_autoscaler/3, create_namespaced_horizontal_pod_autoscaler/4,
delete_collection_namespaced_horizontal_pod_autoscaler/2, delete_collection_namespaced_horizontal_pod_autoscaler/3,
delete_namespaced_horizontal_pod_autoscaler/4,... |
1345402a2ca475314fe2794458aa9fb7d40c2c790f7b8b19dbed2e4d4963a8f2 | typedclojure/typedclojure | typed__ann_form.clj | Copyright ( c ) , contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/1b3c9ef6786a792ae991c438ea8dca31175aa4a7/typed/clj.checker/src/typed/cljc/ext/clojure/core/typed__ann_form.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , contributors .
(ns ^:no-doc typed.cljc.ext.clojure.core.typed__ann-form
"Typing rules for clojure.core.typed ops."
(:require [clojure.core.typed.util-vars :as vs]
[typed.clj.checker.parse-unparse :as prs]
[typed.cljc.analyzer :as ana2]
[typed.cljc.ch... |
afe96174214a4bfc34c38f542678a9db0b61026b20c7ea98d2119a537b3d77eb | Bogdanp/racket-avro | container.rkt | #lang racket/base
(require racket/contract
"private/container.rkt")
(provide
(contract-out
[read-container (-> input-port? list?)]
[write-container (->* (string? list? output-port?)
(#:block-size exact-positive-integer?
#:compression (or/c 'none 'deflate)... | null | https://raw.githubusercontent.com/Bogdanp/racket-avro/59670c54c7814a30abe536f83e476e256866fff7/avro-lib/container.rkt | racket | #lang racket/base
(require racket/contract
"private/container.rkt")
(provide
(contract-out
[read-container (-> input-port? list?)]
[write-container (->* (string? list? output-port?)
(#:block-size exact-positive-integer?
#:compression (or/c 'none 'deflate)... | |
7f2cd89862c164b5028ab7b8558b5aa72f45c206bfec5e5f51d56099e91f73d4 | cbaggers/play-with-verts | play-with-verts.lisp | (in-package #:play-with-verts)
;;------------------------------------------------------------
(defvar *last-time* (get-internal-real-time))
(defun reset ()
(setf *things* nil)
(make-ground))
(defun game-step ()
(let* ((now (get-internal-real-time))
(delta (* (- now *last-time*) 0.001))
(delt... | null | https://raw.githubusercontent.com/cbaggers/play-with-verts/23585da47d5412f0b421e1e4685dc5bf43558e4c/play-with-verts.lisp | lisp | ------------------------------------------------------------
update camera
set the position of our viewport
render ALL THE *THINGS*
display what we have drawn
(skitter.sdl2:enable-background-joystick-events) | (in-package #:play-with-verts)
(defvar *last-time* (get-internal-real-time))
(defun reset ()
(setf *things* nil)
(make-ground))
(defun game-step ()
(let* ((now (get-internal-real-time))
(delta (* (- now *last-time*) 0.001))
(delta (if (> delta 0.16) 0.00001 delta)))
(setf *last-time* now... |
a63c47777476aba64654dc8b5ac9e81a84ddd38307617ff2fdb03e77eb32c4df | imrehg/ypsilon | style.scm | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gtk style)
(export gtk_style_apply_default_background
gtk_style_attach
gtk_style_copy
gtk_style_detach
... | null | https://raw.githubusercontent.com/imrehg/ypsilon/e57a06ef5c66c1a88905b2be2fa791fa29848514/sitelib/ypsilon/gtk/style.scm | scheme | GtkStyle* gtk_style_copy (GtkStyle* style)
[end] | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gtk style)
(export gtk_style_apply_default_background
gtk_style_attach
gtk_style_copy
gtk_style_detach
... |
b6ee4252c9415ceba5377356a858c9f853def4c050050ee78ecdb969a23334f6 | airalab/hs-web3 | HexString.hs | -- |
Module : Data . . HexString
Copyright : 2016 - 2021
-- License : Apache-2.0
--
-- Maintainer :
-- Stability : experimental
-- Portability : unportable
--
-- Hex string data type top level module.
--
module Data.ByteArray.HexString
( module Internal
, module Convert
) wh... | null | https://raw.githubusercontent.com/airalab/hs-web3/c03b86eb621f963886a78c39ee18bcec753f17ac/packages/hexstring/src/Data/ByteArray/HexString.hs | haskell | |
License : Apache-2.0
Maintainer :
Stability : experimental
Portability : unportable
Hex string data type top level module.
| Module : Data . . HexString
Copyright : 2016 - 2021
module Data.ByteArray.HexString
( module Internal
, module Convert
) where
import Data.ByteArray.HexString.Convert as Convert
import Data.ByteArray.HexString.Internal as Internal
|
39deb51f0b36545706daa9c21c3f757e5604b970ea5de2b7fe542e8b9722ac11 | kmi/irs | utilities.lisp | ;;; Mode: Lisp; Package: web-onto
Author :
The Open University
(in-package "WEB-ONTO")
(defvar *string-height* 12)
(defvar *large-characters-table*
'((#\a . 10) (#\b . 10) (#\c . 9) (#\d . 10) (#\e . 9) (#\f . 6) (#\g . 10)
(#\h . 10) (#\i . 5) (#\j . 6) (#\k . 11) (#\l . 5) (#\m . 15) (#\n . 10)
(... | null | https://raw.githubusercontent.com/kmi/irs/e1b8d696f61c6b6878c0e92d993ed549fee6e7dd/src/webonto/utilities.lisp | lisp | Mode: Lisp; Package: web-onto
(colour-name-to-rgb-string :green)
(colour-name-to-rgb-string :green)
(colour-name-to-rgb-string :Turquoise)
(colour-name-to-rgb-string :lightblue)
(colour-name-to-rgb-string :powderblue)
(colour-name-to-rgb-string :violet)
(colour-name-to-rgb-string :palevioletred)
(colour-name-to-rgb-st... |
Author :
The Open University
(in-package "WEB-ONTO")
(defvar *string-height* 12)
(defvar *large-characters-table*
'((#\a . 10) (#\b . 10) (#\c . 9) (#\d . 10) (#\e . 9) (#\f . 6) (#\g . 10)
(#\h . 10) (#\i . 5) (#\j . 6) (#\k . 11) (#\l . 5) (#\m . 15) (#\n . 10)
(#\o . 10) (#\p . 10) (#\q . 10) (#... |
68299ee213ae458343444cef51d97b7254e8cde03deb5985afb32d706cbcb993 | plow-technologies/ble | TypesSpec.hs | # OPTIONS_GHC -fno - warn - orphans #
module Bluetooth.TypesSpec (spec) where
import Data.Maybe (fromJust)
import Data.Proxy (Proxy (Proxy))
import Data.Tuple (swap)
import Data.Void (Void)
import DBus
import Lens.Micro
import Test.Hspec
import Test.QuickChe... | null | https://raw.githubusercontent.com/plow-technologies/ble/fc1c2ab91b5fe33e3636e7b75f76219ef01968b9/test/Bluetooth/TypesSpec.hs | haskell | * Utils
* Instances
# OVERLAPPABLE #
# OVERLAPPING # | # OPTIONS_GHC -fno - warn - orphans #
module Bluetooth.TypesSpec (spec) where
import Data.Maybe (fromJust)
import Data.Proxy (Proxy (Proxy))
import Data.Tuple (swap)
import Data.Void (Void)
import DBus
import Lens.Micro
import Test.Hspec
import Test.QuickChe... |
115525697b825f01d0c06582c93715505dcfed743c29ba589c909d371ad9ff2b | Pyons/aoc-util | utils_test.clj | (ns aoc-util.utils-test
(:require [clojure.test :refer [deftest are is testing]]
[aoc-util.utils :refer [dijkstra dijkstra-seq shortest-path numbers-from-str parse-int line-process]]))
(deftest str-to-int
(testing "String to Integer"
(are [x y] (= (parse-int x) y)
"" nil
"a" nil
"... | null | https://raw.githubusercontent.com/Pyons/aoc-util/3ae948df71d28467405d02b8bc3ba29a088c59e3/test/aoc_util/utils_test.clj | clojure | (ns aoc-util.utils-test
(:require [clojure.test :refer [deftest are is testing]]
[aoc-util.utils :refer [dijkstra dijkstra-seq shortest-path numbers-from-str parse-int line-process]]))
(deftest str-to-int
(testing "String to Integer"
(are [x y] (= (parse-int x) y)
"" nil
"a" nil
"... | |
d36a2b1baf6ce0e85d099258bc7c0f1a78f8d778dbe64c70d8a16ae9e46aff5b | obsidiansystems/rhyolite | AuthMapV.hs | {-| Description: Authenticated vessel container
-}
{-# Language PolyKinds #-}
{-# Language LambdaCase #-}
{-# Language DeriveGeneric #-}
{-# Language DeriveTraversable #-}
{-# Language TypeApplications #-}
{-# Language FlexibleInstances #-}
# Language GeneralizedNewtypeDeriving #
{-# Language StandaloneDeriving #-}
{-#... | null | https://raw.githubusercontent.com/obsidiansystems/rhyolite/43b4b040d3a370c6ec114b7b6001ddb9f8d42ce8/common/Rhyolite/Vessel/AuthMapV.hs | haskell | | Description: Authenticated vessel container
# Language PolyKinds #
# Language LambdaCase #
# Language DeriveGeneric #
# Language DeriveTraversable #
# Language TypeApplications #
# Language FlexibleInstances #
# Language StandaloneDeriving #
# Language TypeFamilies #
# Language UndecidableInstances #
# Language Scop... | # Language GeneralizedNewtypeDeriving #
module Rhyolite.Vessel.AuthMapV where
import Data.Set (Set)
import Control.Monad.Writer.Class (tell)
import Control.Monad.Trans.Class (lift)
import Data.These
import Data.Aeson
import Data.Constraint.Extras
import Data.Maybe
import qualified Data.Map.Monoidal as MMap
import qua... |
e767fabdc431179e487a66ace4f2c599b1920a25eca30969593b41e8b76e59b0 | mdgeorge4153/sorts | cyclesort.ml | let name = "cyclesort"
module Make (M : Sorts.SortMonad) = struct
module MU = Monad.Utils (M)
open M
open MU
*
# Sort an array in place and return the number of writes .
def cycleSort(array ):
writes = 0
# Loop through the array to find cycles to rotate .
for cycleStart in range(0 , len(array ) - 1... | null | https://raw.githubusercontent.com/mdgeorge4153/sorts/d5c3feacde70985443fe9c7ceb44037813e7786d/sorts/cyclesort.ml | ocaml | Loop through the array to find cycles to rotate.
Find where to put the item.
If the item is already there, this is not a cycle.
Otherwise, put the item there or right after any duplicates. | let name = "cyclesort"
module Make (M : Sorts.SortMonad) = struct
module MU = Monad.Utils (M)
open M
open MU
*
# Sort an array in place and return the number of writes .
def cycleSort(array ):
writes = 0
# Loop through the array to find cycles to rotate .
for cycleStart in range(0 , len(array ) - 1... |
4305e8f6263478cee3eba9fd820fc59dbb6d45526f13430fd5eeb6476ca60154 | simonmichael/hledger | Common.hs | --- * -*- outline-regexp:"--- \\*"; -*-
--- ** doc
In Emacs , use TAB on lines beginning with " -- * " to collapse / expand sections .
|
File reading / parsing utilities used by multiple readers , and a good
amount of the parsers for journal format , to avoid import cycles
when JournalReader imports other read... | null | https://raw.githubusercontent.com/simonmichael/hledger/fa70f160aef091fa672050adb704a1d88d14ea20/hledger-lib/Hledger/Read/Common.hs | haskell | - * -*- outline-regexp:"--- \\*"; -*-
- ** doc
- ** language
# LANGUAGE BangPatterns #
# LANGUAGE FlexibleContexts #
# LANGUAGE NoMonoLocalBinds #
# LANGUAGE OverloadedStrings #
# LANGUAGE Rank2Types #
# LANGUAGE RecordWildCards #
- ** exports
* parsing utilities
* parsers
** transaction ... | In Emacs , use TAB on lines beginning with " -- * " to collapse / expand sections .
|
File reading / parsing utilities used by multiple readers , and a good
amount of the parsers for journal format , to avoid import cycles
when JournalReader imports other readers .
Some of these might belong in Hledger . Re... |
b1450bb8f9b39c77d39dec9c7cb5b83b57d227c8cd9cb7b90468d4594c810e4d | hunt-framework/hunt | Client.hs | {-# LANGUAGE OverloadedStrings #-}
module Hunt.Client
( -- * Client
withBaseUrl
, huntBaseUrl
, runClientM
-- * API
Search
, search
, searchText
, search'
-- Completion
, complete
, completeText
, completeAll
-- Documents
, insertDoc, updateDoc, removeDoc
-- Eval
, eval
... | null | https://raw.githubusercontent.com/hunt-framework/hunt/d692aae756b7bdfb4c99f5a3951aec12893649a8/hunt-client/src/Hunt/Client.hs | haskell | # LANGUAGE OverloadedStrings #
* Client
* API
Completion
Documents
Eval
Weight
Select
Status
CLIENT
SEARCH
| Search for the given query and restrict the result by starting
COMPLETION
| Provide an unlimited number of completions.
DOCUMENTS
resulting @CmdResult@.
WEIGHT
| Search for documents satisfying ... | module Hunt.Client
withBaseUrl
, huntBaseUrl
, runClientM
Search
, search
, searchText
, search'
, complete
, completeText
, completeAll
, insertDoc, updateDoc, removeDoc
, eval
, getWeight
, select
, gcStatus, doctableStatus, indexStatus, contextStatus
) where
import ... |
7444c3a5a9e4cff21f7b5bdbab02ba6539d118dfdc3e22e8da1ae9f04631a208 | jitlogic/micrometer-clj | prometheus.clj | (ns io.resonant.micrometer.prometheus
(:require
[io.resonant.micrometer :refer [create-registry scrape to-duration]])
(:import
(io.micrometer.prometheus PrometheusConfig PrometheusMeterRegistry HistogramFlavor)))
(defmethod create-registry :prometheus [cfg]
(PrometheusMeterRegistry.
(reify Prometheus... | null | https://raw.githubusercontent.com/jitlogic/micrometer-clj/16918a1ef67f7e7e422a58ccd58742a1496cba26/src/io/resonant/micrometer/prometheus.clj | clojure | (ns io.resonant.micrometer.prometheus
(:require
[io.resonant.micrometer :refer [create-registry scrape to-duration]])
(:import
(io.micrometer.prometheus PrometheusConfig PrometheusMeterRegistry HistogramFlavor)))
(defmethod create-registry :prometheus [cfg]
(PrometheusMeterRegistry.
(reify Prometheus... | |
207a83c2cde2b930176a091241fe97ae69bce96929a6638143f962d1e3907012 | ciderpunx/57-exercises-for-programmers | P44ProductSearch.hs | # LANGUAGE DeriveGeneric , OverloadedStrings #
module P44ProductSearch where
import Data.Aeson
import GHC.Generics
import Data.Text (Text)
import Data.List (isInfixOf)
import qualified Data.ByteString.Lazy as B
import qualified Data.Text as T
import Library
-- TODO: add files back to JSON file if product not found
c... | null | https://raw.githubusercontent.com/ciderpunx/57-exercises-for-programmers/25958ab80cc3edc29756d3bddd2d89815fd390bf/src/P44ProductSearch.hs | haskell | TODO: add files back to JSON file if product not found | # LANGUAGE DeriveGeneric , OverloadedStrings #
module P44ProductSearch where
import Data.Aeson
import GHC.Generics
import Data.Text (Text)
import Data.List (isInfixOf)
import qualified Data.ByteString.Lazy as B
import qualified Data.Text as T
import Library
catalogueFile :: String
catalogueFile = "productCatalogue.... |
d956a24ec631f683573ffc7617930aad370cafd844d970892e3a710460d91188 | LeventErkok/sbv | Exceptions.hs | -----------------------------------------------------------------------------
-- |
-- Module : TestSuite.Basics.Exceptions
Copyright : ( c )
-- License : BSD3
-- Maintainer:
-- Stability : experimental
--
-- Test the exception mechanism
-------------------------------------------------------------------------... | null | https://raw.githubusercontent.com/LeventErkok/sbv/cfaa40b8c8ff8e1b7ff9ab71304654f6f531ba72/SBVTestSuite/TestSuite/Basics/Exceptions.hs | haskell | ---------------------------------------------------------------------------
|
Module : TestSuite.Basics.Exceptions
License : BSD3
Maintainer:
Stability : experimental
Test the exception mechanism
---------------------------------------------------------------------------
# OPTIONS_GHC -Wall -Werror #
Test... | Copyright : ( c )
# LANGUAGE ScopedTypeVariables #
module TestSuite.Basics.Exceptions(testsLocal, testsRemote) where
import Data.SBV.Control
import Utils.SBVTestFramework
import qualified Control.Exception as C
testsLocal :: TestTree
testsLocal =
testGroup "Basics.exceptions.local"
[ goldenCapturedIO "... |
3b763b3f12e9bc58b87d5b2c9dd6b2e202f1eba37fd59c33fb6df12605b0a09d | CIFASIS/QuickFuzz | ASN1.hs | # LANGUAGE TemplateHaskell #
# LANGUAGE FlexibleInstances #
# LANGUAGE IncoherentInstances #
# LANGUAGE DeriveGeneric #
module Test.QuickFuzz.Gen.Pki.ASN1 where
import Data.Default
import Data.ASN1.Types
import Data.ASN1.BitArray
import Data.ASN1.Encoding
import Data.ASN1.BinaryEncoding
import Time.Types
import Tes... | null | https://raw.githubusercontent.com/CIFASIS/QuickFuzz/a1c69f028b0960c002cb83e8145f039ecc0e0a23/src/Test/QuickFuzz/Gen/Pki/ASN1.hs | haskell | # LANGUAGE TemplateHaskell #
# LANGUAGE FlexibleInstances #
# LANGUAGE IncoherentInstances #
# LANGUAGE DeriveGeneric #
module Test.QuickFuzz.Gen.Pki.ASN1 where
import Data.Default
import Data.ASN1.Types
import Data.ASN1.BitArray
import Data.ASN1.Encoding
import Data.ASN1.BinaryEncoding
import Time.Types
import Tes... | |
914ad4d26b458d1a63a79c2791d20b20bf6ed280a384478218d282cebbcb008e | cannadayr/ebqn | ebqn_rt0.erl | -module(ebqn_rt0).
-include("schema.hrl").
-import(ebqn_core,[fn/1,r1/1,r2/1]).
-import(ebqn,[call/4]).
-export([right/3,left/3,greater/3,not_eq/3,greater_eq/3,join/3,fold/4]).
-export([fns/0]).
right(St0,X,_W) ->
{St0,X}.
left(St0,X,undefined) ->
{St0,X};
left(St0,X,W) ->
{St0,W}.
greater(St0,X,W) ->
... | null | https://raw.githubusercontent.com/cannadayr/ebqn/808058cd9f59d3b15695ab827328b9a0ece67961/src/ebqn_rt0.erl | erlang | -module(ebqn_rt0).
-include("schema.hrl").
-import(ebqn_core,[fn/1,r1/1,r2/1]).
-import(ebqn,[call/4]).
-export([right/3,left/3,greater/3,not_eq/3,greater_eq/3,join/3,fold/4]).
-export([fns/0]).
right(St0,X,_W) ->
{St0,X}.
left(St0,X,undefined) ->
{St0,X};
left(St0,X,W) ->
{St0,W}.
greater(St0,X,W) ->
... | |
36d9d23ea98035d8277bd2bd934f27fd6f9387a621233c4466fd1d1c2daadb51 | Apress/practical-ocaml | ch_14.mli | (** This interface file restricts the type information and functions that
can be accessed from outside the module *)
* { 6 Probability of spam functions }
(** returns a probability of spam from a given in_channel*)
val spam_prob_of_channel: in_channel -> float;;
(** returns a probability of spam from a given ... | null | https://raw.githubusercontent.com/Apress/practical-ocaml/c0f1e36283eb0e495ff8db7f2a88cadbf1a3d49e/Chapter14/ch_14.mli | ocaml | * This interface file restricts the type information and functions that
can be accessed from outside the module
* returns a probability of spam from a given in_channel
* returns a probability of spam from a given string
* returns a probability of spam from a given file
* All of these functions overwrite the ham/... |
* { 6 Probability of spam functions }
val spam_prob_of_channel: in_channel -> float;;
val spam_prob_of_string: string -> float;;
val spam_prob_of_file: string -> float;;
* { 6 Training Functions }
val train_ham: in_channel -> unit;;
val train_spam: in_channel -> unit;;
|
0c8c8a34350f3ee44250954517ca155261d3bb13773ca46c4e15e33689af478d | joergen7/cf_client | prop_cuneiform_lang.erl | %% -*- erlang -*-
%%
%% cf_client: Cuneiform client implementation
%%
Copyright 2015 - 2019 < >
%%
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 requi... | null | https://raw.githubusercontent.com/joergen7/cf_client/ac00cecc6b7c48d25c4bd97c4ce7f7d9798ada93/test/prop_cuneiform_lang.erl | erlang | -*- erlang -*-
cf_client: Cuneiform client implementation
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 impl... | Copyright 2015 - 2019 < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
2013 - 2020
-module( prop_cuneiform_lang ).
-include_lib( "proper/include/proper.hrl" ).
-include( "cuneiform_lang.hrl" ).
... |
b35bc5cf9b611c38141177a74a5d55fe53882945df2cb0f9c7ce9a29862dc59a | GaloisInc/semmc | Formula.hs | -- | This module exports all of the tools required for manipulating our
-- representation of formulas
--
-- Import this module unless you are implementing new functions in
@SemMC.Formula.*@ ; those modules only exist to keep module sizes down .
module SemMC.Formula
(
-- * SemMC.Formula.Formula
Parameterized... | null | https://raw.githubusercontent.com/GaloisInc/semmc/4dc4439720b3b0de8812a68f8156dc89da76da57/semmc/src/SemMC/Formula.hs | haskell | | This module exports all of the tools required for manipulating our
representation of formulas
Import this module unless you are implementing new functions in
* SemMC.Formula.Formula
* Use and manipulation
* Equivalence Checking
* Functions and libraries
* SemMC.Formula.Env
* SemMC.Formula.Printer | @SemMC.Formula.*@ ; those modules only exist to keep module sizes down .
module SemMC.Formula
(
ParameterizedFormula(..)
, Formula(..)
, formInputs
, formOutputs
, emptyFormula
, coerceFormula
, formStripIP
, Parameter(..)
, paramType
, WrappedOperand(..)
, LocationFuncInterp(..)
, instan... |
d407ce24a6f9816d20e8e6c17091cdd11019a80f8cd1f19ae6b0739012c59e0a | manuel-serrano/bigloo | gstghostpad.scm | ;*=====================================================================*/
;* .../project/bigloo/api/gstreamer/src/Llib/gstghostpad.scm */
;* ------------------------------------------------------------- */
* Author : * /
* Creation : We d Jan ... | null | https://raw.githubusercontent.com/manuel-serrano/bigloo/eb650ed4429155f795a32465e009706bbf1b8d74/api/gstreamer/src/Llib/gstghostpad.scm | scheme | *=====================================================================*/
* .../project/bigloo/api/gstreamer/src/Llib/gstghostpad.scm */
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
*===========================... | * Author : * /
* Creation : We d Jan 2 14:45:56 2008 * /
* Last change : Tue Nov 15 17:03:46 2011 ( serrano ) * /
* Copyright : 2008 - 11 * /
* ... |
0d954296cb72ae7433d37e109c412630703d15ea4783252c62a1eaec7e60e89f | cjdev/haskell-fundamentals | A_10_refactor_file_system.hs | # LANGUAGE DefaultSignatures #
{-# LANGUAGE GADTs #-}
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE OverloadedStrings #-}
module Maintainability.Prototypes.A_10_refactor_file_system
( main
) where
import Prelude hiding (putStrLn, readFile)
import qualified Data.Text as T
import qualified Data.Text.IO as T... | null | https://raw.githubusercontent.com/cjdev/haskell-fundamentals/03982d7b3ca140bfecc69fa4873fcc0e4fa54044/src/Maintainability/Prototypes/A_10_refactor_file_system.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
stack runhaskell src/Maintainability/Prototypes/A_10_refactor_file_system.hs hello-target.txt
| # LANGUAGE DefaultSignatures #
# LANGUAGE GeneralizedNewtypeDeriving #
module Maintainability.Prototypes.A_10_refactor_file_system
( main
) where
import Prelude hiding (putStrLn, readFile)
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Time.Clock as C
import qualified Sy... |
9fce15c8f229342a0e5efb7d3f5a9a1bf312ce43f3c45f7ffa842f6b0c80359c | bluelisp/hemlock | keytran.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
;;;
#+CMU (ext:file-comment
"$Header: /home/david/ph... | null | https://raw.githubusercontent.com/bluelisp/hemlock/47e16ba731a0cf4ffd7fb2110e17c764ae757170/unused/keytran.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
**********************************************************************
**********************************************************************
This file contains a default character translation mechanism for X11
more portable than writing our own translation based on ... | This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
#+CMU (ext:file-comment
"$Header: /home/david/phemlock/cvsroot/phemlock/unused/keytran.lisp,v 1.1 2004-07-09 13:39:13 gbaumann Exp $")
scan codes , , button codes , and modifi... |
4f8f30ec862349bb5678ffaf09f05c11cd39a842b8bfa7e4779f07f367829698 | dtgoitia/civil-autolisp | DeleteAlongPolyline.lsp | (defun c:xx ()
; Trigger
(DT:AutoLoadFileFromCivilTemp "DeleteAlongPolyline.lsp")
(c:DeleteAlongPolyline)
v0.0 - 2017.08.16 - First issue
Author :
Last revision : 2017.08.16
)
(defun c:DeleteAlongPolyline ( / ename entList )
Command version of DT : DeleteAlongPolyline
(if (setq ename (car (entsel "\n... | null | https://raw.githubusercontent.com/dtgoitia/civil-autolisp/72d68139d372c84014d160f8e4918f062356349f/Dump%20folder/DeleteAlongPolyline.lsp | lisp | Trigger
END progn
END if
Delete objects along ename polyline (using "F" mode selection)
Remove objects crossed by ename
END foreach
END progn
END if
END progn
END if | (defun c:xx ()
(DT:AutoLoadFileFromCivilTemp "DeleteAlongPolyline.lsp")
(c:DeleteAlongPolyline)
v0.0 - 2017.08.16 - First issue
Author :
Last revision : 2017.08.16
)
(defun c:DeleteAlongPolyline ( / ename entList )
Command version of DT : DeleteAlongPolyline
(if (setq ename (car (entsel "\nSelect polyl... |
a12c4276a83e4bbefd9db531aed6681413ae859b8386e56225bddd1b484be18b | mhjort/clj-lambda-utils | project.clj | (defproject clj-lambda "0.8.1"
:description "Clojure utilities for AWS Lambda deployment"
:url "-clj-lambda/library"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/data.json "0.2.6"]
[prismatic/sc... | null | https://raw.githubusercontent.com/mhjort/clj-lambda-utils/a58832422b4666a19d500cca694464c991386f84/library/project.clj | clojure | (defproject clj-lambda "0.8.1"
:description "Clojure utilities for AWS Lambda deployment"
:url "-clj-lambda/library"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[org.clojure/data.json "0.2.6"]
[prismatic/sc... | |
fb43914c1fd4a8975b7a1ce4994a9669ede36555d1abe700d27d9c8abcd12f93 | BU-CS320/Fall-2018 | Lang4.hs | module Lang4 where
import Prelude hiding (lookup)
import Data.Map(Map, lookup, insert, empty, fromList) -- for Env
-- We will now add let expressions to the abstract syntax tree.
Let makes a local assignment of the first Ast to the String
in the state and evaluates the second Ast in this environment a... | null | https://raw.githubusercontent.com/BU-CS320/Fall-2018/beec3ca88be5c5a62271a45c8053fb1b092e0af1/assignments/week7/hw/src/week5/Lang4.hs | haskell | for Env
We will now add let expressions to the abstract syntax tree.
| module Lang4 where
import Prelude hiding (lookup)
Let makes a local assignment of the first Ast to the String
in the state and evaluates the second Ast in this environment and returns
the result of the second Ast .
data Ast =
AstInt Integer
| Id String
| Plus Ast Ast
| Let S... |
acfb6a5fe8a4621cd445f45da326a005e09d3e4d6e12d02bdf5705a6274fc272 | mschuene/stratege | core.clj | (ns stratege.core
"strategy combinators for term rewriting over zippers"
(:refer-clojure :exclude [some replace repeat attempt])
(:require [clj-tuple :as t]
[clojure.core.match :as m]
[clojure.set :as set]
[fast-zip.core :as zip]
;[clojure.zip :as zip]
[... | null | https://raw.githubusercontent.com/mschuene/stratege/a1afcb11fac8b74372ddd40d963801921dc35348/src/stratege/core.clj | clojure | [clojure.zip :as zip]
a strategy takes a tuple of a binding map and a location together
with a continuation and calls it either with a new binding-map and
loc tuple (state) or with nil in case of failure. See the cps
namespace for utility functions to handle writing cps style thunk
returning functions that can be ... | (ns stratege.core
"strategy combinators for term rewriting over zippers"
(:refer-clojure :exclude [some replace repeat attempt])
(:require [clj-tuple :as t]
[clojure.core.match :as m]
[clojure.set :as set]
[fast-zip.core :as zip]
[clojure.tools.macro :as ctm]
... |
25f5a3acc98297b4e8a32200f7b60fb9d2be41a4d828aecd4acea15b94bce086 | massemanet/redbug | redbug_dtop.erl | %%%-------------------------------------------------------------------
%%% File : redbug_dtop.erl
Created : 5 Sep 2005
Created : 16 Dec 2003
Created : 5 Dec 2003 by Mats < qthmacr@duna283 >
Created : 8 Dec 2003 by Mats < qthmacr@duna283 >
Created : 18 Oct 2005 by Mats < locmacr@mwlx084 >
%%% Descr... | null | https://raw.githubusercontent.com/massemanet/redbug/14f6cf50d740d8e7a9226b98907bd66ea68390a0/src/redbug_dtop.erl | erlang | -------------------------------------------------------------------
File : redbug_dtop.erl
Description : top-like client for beam
-------------------------------------------------------------------
---------------------------
API
---------------------------
---------------------------
----------------------------... | Created : 5 Sep 2005
Created : 16 Dec 2003
Created : 5 Dec 2003 by Mats < qthmacr@duna283 >
Created : 8 Dec 2003 by Mats < qthmacr@duna283 >
Created : 18 Oct 2005 by Mats < locmacr@mwlx084 >
@private
-module(redbug_dtop).
-author('Mats Cronqvist').
-export([start/0,
stop/0,
sor... |
7a5aa2d3978c3c86f6cad1dc6ac54224728fb4fc7324993dba3b1657096e2b60 | iamFIREcracker/adventofcode | day15.lisp | (defpackage :aoc/2016/15 #.cl-user::*aoc-use*)
(in-package :aoc/2016/15)
(defun parse-disk (string)
(cl-ppcre:register-groups-bind ((#'parse-integer disk size time position))
("Disc #(\\d+) has (\\d+) positions; at time=(\\d+), it is at position (\\d+)." string)
(list disk size time position)))
(defun pos... | null | https://raw.githubusercontent.com/iamFIREcracker/adventofcode/ec66765d57e0ddcfd585640f533b863b23239bb4/src/2016/day15.lisp | lisp | (defpackage :aoc/2016/15 #.cl-user::*aoc-use*)
(in-package :aoc/2016/15)
(defun parse-disk (string)
(cl-ppcre:register-groups-bind ((#'parse-integer disk size time position))
("Disc #(\\d+) has (\\d+) positions; at time=(\\d+), it is at position (\\d+)." string)
(list disk size time position)))
(defun pos... | |
1f6d3c8583bb86a52e127723a8b2342d50b080ac752fba33298dc4687eb0ed29 | madnificent/jsown | writer.lisp | (in-package :jsown-tests)
(def-suite test-writers
:description "Tests the functionality the writer provides"
:in test-all)
(in-suite test-writers)
(test write
(is (string= (to-json '(:obj ("foo" . "bar")))
"{\"foo\":\"bar\"}")
"One string element")
(is (string= (to-js... | null | https://raw.githubusercontent.com/madnificent/jsown/744c4407bef58dfa876d9da0b5c0205d869e7977/tests/writer.lisp | lisp | (in-package :jsown-tests)
(def-suite test-writers
:description "Tests the functionality the writer provides"
:in test-all)
(in-suite test-writers)
(test write
(is (string= (to-json '(:obj ("foo" . "bar")))
"{\"foo\":\"bar\"}")
"One string element")
(is (string= (to-js... | |
7889f982421825e6bee4a46028a3e3d98e8db09c3267a17d4172df58bcad4848 | jordanthayer/ocaml-search | idastar_cr_model.ml | (** IDA* with controlled re-expansions model. *)
open Printf
let get_bin nbins bound f =
* [ get_bin nbins bound f ] get the appropriate bin as described in
the IDA*_CR paper .
the IDA*_CR paper. *)
(* This should find i s.t:
x(1 + i/100) < f(n) <= x(1 + (i + 1)/100), where x is the
bound. ... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/search/iterative/idastar_cr_model.ml | ocaml | * IDA* with controlled re-expansions model.
This should find i s.t:
x(1 + i/100) < f(n) <= x(1 + (i + 1)/100), where x is the
bound.
root node
root node
oob_f f; (* INSTRUMENTATION
else
expd_f f (* INSTRUMENTATION
let desired = b *. (float !expansions) in
print_oob_fs !iter_... |
open Printf
let get_bin nbins bound f =
* [ get_bin nbins bound f ] get the appropriate bin as described in
the IDA*_CR paper .
the IDA*_CR paper. *)
let rec do_get_bin i =
if i > nbins then
i
else
let p = (float i) in
let v = bound *. (1. +. p /. 100.) in
if v >= f the... |
e3d8d0ff71e189a4c14fceb0bcf9c0dc8d4713bf719700bc08560b07a5f0cb7a | benoitc/mochicow | mochicow_upgrade.erl | - width : 4;erlang - indent - level : 4;indent - tabs - mode : nil -*-
ex : ts=4 sw=4 et
%%%
This file is part of mochicow released under the MIT license .
%%% See the NOTICE for more information.
%%%
-module(mochicow_upgrade).
-behaviour(cowboy_sub_protocol).
-export([upgrade/4]).
-define(SAVE_BODY, mochiw... | null | https://raw.githubusercontent.com/benoitc/mochicow/901684759b63c9a3de152d81370d4d42b600a9c4/src/mochicow_upgrade.erl | erlang |
See the NOTICE for more information.
fix raw host | - width : 4;erlang - indent - level : 4;indent - tabs - mode : nil -*-
ex : ts=4 sw=4 et
This file is part of mochicow released under the MIT license .
-module(mochicow_upgrade).
-behaviour(cowboy_sub_protocol).
-export([upgrade/4]).
-define(SAVE_BODY, mochiweb_request_body).
upgrade(Req, Env, _Handler, Op... |
9f3401ea34f06e9cfd5e649e7ca640b9567569d1285698d0ebafa2363b3dc697 | Elzair/nazghul | dank-cave.scm | ;; Aka, reagent cave -- generate rare reagents here
(mk-dungeon-room
'p_dank_cave "Dank Cave"
(list
"rn rn rn rn rn rn rn rn r8 r8 r8 rn rn rn rn rn rn rn rn "
"rn rn rn rn r8 rn rn r4 .. .. .. r2 rn rn r8 rn rn rn rn "
"rn rn rn rc {{ ra rn rc {8 .. {8 ra rn rc {{ ra rn rn rn "
"rn rn rc {{ {{ {{ re {{ {{ {e... | null | https://raw.githubusercontent.com/Elzair/nazghul/8f3a45ed6289cd9f469c4ff618d39366f2fbc1d8/worlds/haxima-1.002/dank-cave.scm | scheme | Aka, reagent cave -- generate rare reagents here
reagents
monsters | (mk-dungeon-room
'p_dank_cave "Dank Cave"
(list
"rn rn rn rn rn rn rn rn r8 r8 r8 rn rn rn rn rn rn rn rn "
"rn rn rn rn r8 rn rn r4 .. .. .. r2 rn rn r8 rn rn rn rn "
"rn rn rn rc {{ ra rn rc {8 .. {8 ra rn rc {{ ra rn rn rn "
"rn rn rc {{ {{ {{ re {{ {{ {e {{ {{ re {{ {{ {{ ra rn rn "
"rn rc {{ {C %f {A {... |
81db0d80cda03a9ace4567baae0249e21a2a8f0e2bd450c70d447af776c61ef4 | clojurians-org/haskell-example | Route.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE EmptyCase #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE KindSignatures #
# LANGUAGE EmptyCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
# ... | null | https://raw.githubusercontent.com/clojurians-org/haskell-example/c96b021bdef52a121e04ea203c8c3e458770a25a/conduit-ui/common/src/Common/Route.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE OverloadedStrings #
You will probably want these imports for composing Encoders .
| Used to handle unparseable routes.
You can define any routes that will be handled specially by the backend here.
i.e. These do not serve the frontend, but do something different, such as serving s... | # LANGUAGE NoImplicitPrelude #
# LANGUAGE EmptyCase #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE TemplateHaskell #
# LANGUAGE KindSignatures #
# LANGUAGE EmptyCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE StandaloneDeriving #
module Common.Route where
imp... |
e58cbf221bca752b59651a5b58898c0500e10a6c803fc3fd5d540550ec2f0213 | morpheusgraphql/morpheus-graphql | Posts.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeFamilies #
module Domains.Posts.Posts where
import Data.Morpheus.Server.CodeGen.Internal
import Data.Morpheus.Server.Types
data Post m = Post
{ id :: m ID,
title :: m Text,
... | null | https://raw.githubusercontent.com/morpheusgraphql/morpheus-graphql/1d3ab7e3bc723e29ef8bd2a0c818a03ae82ce8ad/examples/code-gen/src/Domains/Posts/Posts.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE TypeFamilies #
module Domains.Posts.Posts where
import Data.Morpheus.Server.CodeGen.Internal
import Data.Morpheus.Server.Types
data Post m = Post
{ id :: m ID,
title :: m Text,
authorID :: m Text
}
deriving ... |
d56445eac88872d58a1e1d2516145c3c3e620da8ac89bf26f5256d651bed35ce | metrix-ai/deferred-folds | Unfoldr.hs | module DeferredFolds.Unfoldr
( module Exports,
)
where
import DeferredFolds.Defs.Unfoldr as Exports hiding (foldrAndContainer)
import DeferredFolds.Types as Exports (Unfoldr (..))
| null | https://raw.githubusercontent.com/metrix-ai/deferred-folds/41ad482be5b5abae9d20de1c949363b3025d760b/library/DeferredFolds/Unfoldr.hs | haskell | module DeferredFolds.Unfoldr
( module Exports,
)
where
import DeferredFolds.Defs.Unfoldr as Exports hiding (foldrAndContainer)
import DeferredFolds.Types as Exports (Unfoldr (..))
| |
3305373ef0821e19453fe42add7966e38727e57f8e5aa5bff9d40d2d72ef1459 | rurban/clisp | complete.lisp | ;;;; Command-line completion hook
(in-package "SYSTEM")
(defun ext:longest-common-prefix (vectors &key (test #'eql))
"Return the longest common prefix of all vectors in the list."
(do ((imax (reduce #'min vectors :key #'length))
(i 0 (1+ i)))
((or (= i imax)
(let ((e (aref (first vectors)... | null | https://raw.githubusercontent.com/rurban/clisp/75ed2995ff8f5364bcc18727cde9438cca4e7c2c/src/complete.lisp | lisp | Command-line completion hook
-----------------------------------------------------------------------------
Completing routine for the GNU Readline library.
Input: string (the input line), and the boundaries of the text to be
Output: a list of simple-strings. empty, when no meaningful completions.
otherwise, CDR = ... |
(in-package "SYSTEM")
(defun ext:longest-common-prefix (vectors &key (test #'eql))
"Return the longest common prefix of all vectors in the list."
(do ((imax (reduce #'min vectors :key #'length))
(i 0 (1+ i)))
((or (= i imax)
(let ((e (aref (first vectors) i)))
(dolist (v (res... |
2c11e7bafb4635bdfc44b935f890d6efa3eb8e3e990b43c03c1589252d272de5 | babashka/babashka | core_test.cljc | (ns integrant.core-test
(:require [clojure.spec.alpha :as s]
#?(:clj [clojure.test :refer :all]
:cljs [cljs.test :refer-macros [are deftest is testing]])
[integrant.core :as ig]
[weavejester.dependency :as dep]))
(def log (atom []))
(defmethod ig/prep-key ::p [_ v]
(merge {:a (ig... | null | https://raw.githubusercontent.com/babashka/babashka/bb84bd357e6bb8014b1e461a682b925839879cc8/test-resources/lib_tests/integrant/core_test.cljc | clojure | BB-TEST-PATCH: No *loaded-libs* in bb
BB-TEST-PATCH: No *loaded-libs* in bb
BB-TEST-PATCH: renamed due to conflict with clojure.test | (ns integrant.core-test
(:require [clojure.spec.alpha :as s]
#?(:clj [clojure.test :refer :all]
:cljs [cljs.test :refer-macros [are deftest is testing]])
[integrant.core :as ig]
[weavejester.dependency :as dep]))
(def log (atom []))
(defmethod ig/prep-key ::p [_ v]
(merge {:a (ig... |
b33c2a76a0eb0d0c9af4187398e9b6c62872cf522abc03707d303b610fcb9283 | BinaryAnalysisPlatform/bap | powerpc_compare_tests.ml | open Core_kernel[@@warning "-D"]
open Bap.Std
open OUnit2
open Powerpc_tests_helpers
type expected = LT | GT | EQ
* in IBM style , i.e. least significant byte
let print_bits lt gt eq =
let str = function
| None -> "unknown"
| Some x -> Word.to_string x in
printf "lt %s; gt %s; eq %s; \n" (str lt) (str... | null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/253afc171bbfd0fe1b34f6442795dbf4b1798348/lib_test/powerpc/powerpc_compare_tests.ml | ocaml | open Core_kernel[@@warning "-D"]
open Bap.Std
open OUnit2
open Powerpc_tests_helpers
type expected = LT | GT | EQ
* in IBM style , i.e. least significant byte
let print_bits lt gt eq =
let str = function
| None -> "unknown"
| Some x -> Word.to_string x in
printf "lt %s; gt %s; eq %s; \n" (str lt) (str... | |
d651e15fbbf2597b5b1107d5d6d007fe3938eadfc59f8c4a2380ab495053ce5e | igorhvr/bedlam | sc2.scm | ;"sc2.scm" Implementation of rev2 procedures eliminated in subsequent versions.
Copyright ( C ) 1991 , 1993
;
;Permission to copy this software, to modify it, to redistribute it,
;to distribute modified versions, and to use it for any purpose is
;granted, subject to the following restrictions and understandings.
;
... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/iasylum/slib/3b2/sc2.scm | scheme | "sc2.scm" Implementation of rev2 procedures eliminated in subsequent versions.
Permission to copy this software, to modify it, to redistribute it,
to distribute modified versions, and to use it for any purpose is
granted, subject to the following restrictions and understandings.
in full.
this software will be error-... | Copyright ( C ) 1991 , 1993
1 . Any copy made of this software must include this copyright notice
2 . I have made no warranty or representation that the operation of
3 . In conjunction with products arising from the use of this
(define (substring-move-left! string1 start1 end1 string2 start2)
(do ((i start... |
6e2d6f08d5cec29a98b156dc9d086e79f8a3a2767a58a56d855025a8d452848d | vbmithr/ocaml-bittrex-api | topkg.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2014 . All rights reserved .
Distributed under the BSD3 license , see license at the end of the file .
% % NAME%% release % % ---------------------------------------------------------------------------
Cop... | null | https://raw.githubusercontent.com/vbmithr/ocaml-bittrex-api/1f76a574b71586244fed469cf2e1230797cca3ed/pkg/topkg.ml | ocaml | Public api
* Build environment access
* [bool key] declares [key] as being a boolean key in the environment.
Specifing key=(true|false) on the command line becomes mandatory.
* [native] is [bool "native"].
* [native_dylink] is [bool "native-dynlink"]
* Exts defines sets of file extensions.
* [interface] i... | ---------------------------------------------------------------------------
Copyright ( c ) 2014 . All rights reserved .
Distributed under the BSD3 license , see license at the end of the file .
% % NAME%% release % % ---------------------------------------------------------------------------
Cop... |
041b24824916e56e29472994d61712848bf480fe29bed50eef1ba2e144fada57 | thma/lambda-ski | Spec.hs | this compiler pragma allows GHC to automatically discover all Hspec Test Specs .
module Spec where
| null | https://raw.githubusercontent.com/thma/lambda-ski/2912cb4f6e71d301c42c69a006d1aae2bb394696/test/Spec.hs | haskell | this compiler pragma allows GHC to automatically discover all Hspec Test Specs .
module Spec where
| |
3f02a3c9149083ef2675f3d71734969522ed58ab82e787e83521f6eca600ee5d | metabase/metabase | notify_test.clj | (ns metabase.api.notify-test
(:require
[clj-http.client :as http]
[clojure.java.jdbc :as jdbc]
[clojure.test :refer :all]
[metabase.driver.sql-jdbc.connection :as sql-jdbc.conn]
[metabase.http-client :as client]
[metabase.models.database :as database :refer [Database]]
[metabase.server.middleware... | null | https://raw.githubusercontent.com/metabase/metabase/9c57c76c44e8a653a1aaf8192dd51ebaee7e6162/test/metabase/api/notify_test.clj | clojure | set in :test but not in :dev
TODO - Consider generalizing this in the future. It was taken from `metabase.driver.postgres-test`
Perhaps if there's another instance where it is used put it somewhere common.
kill any open connections
" db-name])
create the DB
"
Create the initial table and sync it.
We can't add a... | (ns metabase.api.notify-test
(:require
[clj-http.client :as http]
[clojure.java.jdbc :as jdbc]
[clojure.test :refer :all]
[metabase.driver.sql-jdbc.connection :as sql-jdbc.conn]
[metabase.http-client :as client]
[metabase.models.database :as database :refer [Database]]
[metabase.server.middleware... |
ef8b1110998214156216d16e8ae9152fca4f553842e47d91cdc5eb68f2d360ad | LeventErkok/hArduino | Piezo.hs | -------------------------------------------------------------------------------------------------
-- |
Module : System . Hardware . Arduino . Parts . Piezo
Copyright : ( c )
-- License : BSD3
-- Maintainer :
-- Stability : experimental
--
-- Abstractions for piezo speakers.
--------------... | null | https://raw.githubusercontent.com/LeventErkok/hArduino/b568087b51b75babb1dc90d3f7a6e7b3c8d134b9/System/Hardware/Arduino/Parts/Piezo.hs | haskell | -----------------------------------------------------------------------------------------------
|
License : BSD3
Maintainer :
Stability : experimental
Abstractions for piezo speakers.
-----------------------------------------------------------------------------------------------
* Declaring a piezo s... | Module : System . Hardware . Arduino . Parts . Piezo
Copyright : ( c )
module System.Hardware.Arduino.Parts.Piezo(
Piezo, speaker
, Note(..), Duration(..)
, playNote, rest, silence
, playNotes
) where
import Data.Bits (shiftR, (.&.))
import Data.Maybe (fromMaybe)
import System.Ha... |
9a5a51ee8d7d25520e5be2e7355136f3008c92074f8006f95872b0c406e0fec3 | antono/guix-debian | build.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2012 , 2013 , 2014 < >
Copyright © 2013 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software ... | null | https://raw.githubusercontent.com/antono/guix-debian/85ef443788f0788a62010a942973d4f7714d10b4/guix/scripts/build.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2012 , 2013 , 2014 < >
Copyright © 2013 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (guix scripts build)
#:use-module (guix ui)
#:use-modu... |
3c5efbc84c0d3889f810c1e23cbdbac8c020d2f90e055ec7f2f719b70f5bef75 | williamthome/eel | eel_template_sup.erl | %%%-----------------------------------------------------------------------------
%%% @doc EEl template supervisor.
%%%
@author [ ]
%%% @end
%%%-----------------------------------------------------------------------------
-module(eel_template_sup).
-behaviour(supervisor).
%% API functions
-export([
start_lin... | null | https://raw.githubusercontent.com/williamthome/eel/7f933858c4346c5adacabd748b4ef6f8df832c26/src/eel_template_sup.erl | erlang | -----------------------------------------------------------------------------
@doc EEl template supervisor.
@end
-----------------------------------------------------------------------------
API functions
supervisor callbacks
Defines
=============================================================================
A... | @author [ ]
-module(eel_template_sup).
-behaviour(supervisor).
-export([
start_link/0,
start_child/2,
terminate_child/1
]).
-export([init/1]).
-define(SERVER, ?MODULE).
-spec start_link() -> supervisor:startlink_ret().
start_link() ->
InitArgs = [],
supervisor:start_link({local, ?SERVER... |
13a6689b9e6f40be9de41ddbced392c8bf6a9024f17e2eddf38b6c7d6b70001e | startalkIM/ejabberd | node_hometree.erl | %%%----------------------------------------------------------------------
%%% File : node_hometree.erl
Author :
%%% Purpose : Standard tree ordered node plugin
Created : 1 Dec 2007 by
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne
%%%
%%% This program is free software; you can redis... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/src/node_hometree.erl | erlang | ----------------------------------------------------------------------
File : node_hometree.erl
Purpose : Standard tree ordered node plugin
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 us... | Author :
Created : 1 Dec 2007 by
ejabberd , Copyright ( C ) 2002 - 2016 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
wit... |
a5ad834d49857e855e0f65bcd403eb06344c6f7fc859d27b6b60dba4f488c4e2 | juspay/fencer | Rules.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE DataKinds #
# LANGUAGE OverloadedLabels #
# LANGUAGE TypeApplications #
-- | Working with rate limiting rules.
module Fencer.Rules
( LoadRulesError(..)
, prettyPrintErrors
, showError
, loadRulesFromDirectory
, validatePotentialDomains
, constructRu... | null | https://raw.githubusercontent.com/juspay/fencer/db7c64ff848446d247dc8d59a1df5b50cdc104f6/lib/Fencer/Rules.hs | haskell | # LANGUAGE OverloadedStrings #
| Working with rate limiting rules.
| Pretty-print a 'LoadRulesError'.
| Read rate limiting rules from a directory, recursively. Files are
assumed to be YAML, but do not have to have a @.yml@ extension. If
any of directories below, including the main sub-directory, starts
with a dot... | # LANGUAGE DataKinds #
# LANGUAGE OverloadedLabels #
# LANGUAGE TypeApplications #
module Fencer.Rules
( LoadRulesError(..)
, prettyPrintErrors
, showError
, loadRulesFromDirectory
, validatePotentialDomains
, constructRuleTree
, applyRules
)
where
import BasePrelude
import Control.Ap... |
972b63abd3e5fa248e38afff94ddda37d62482c2b253d9a7d4d219d4187b65f1 | fbellomi/crossclj | annotate_methods.clj | Copyright ( c ) , Rich Hickey & contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be b... | null | https://raw.githubusercontent.com/fbellomi/crossclj/7630270ebe9ea3df89fe3d877b2571e6eae1062b/src/cloned/clojure/tools/analyzer/passes/jvm/annotate_methods.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , Rich Hickey & contributors .
(ns cloned.clojure.tools.analyzer.passes.jvm.annotate-methods
(:require [cloned.clojure.tools.analyzer.ast :refer [prewalk]]
[cloned.clojure.tools.analyzer.passes
[cleanup :refer [cleanup]]
[elide-meta :refer [elide-meta]]]
... |
fede12b9eb10199006984c149dda9c8aadc4fd62604f7bfe4a2eaa34bd7b282b | AccelerateHS/accelerate-io | Mutable.hs | # LANGUAGE BangPatterns #
{-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE GADTs #
{-# LANGUAGE MagicHash #-}
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE Standalo... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate-io/d62e543a1156b63b242387ca8348836efca744f4/accelerate-io-vector/src/Data/Array/Accelerate/IO/Data/Vector/Generic/Mutable.hs | haskell | # LANGUAGE CPP #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE MagicHash #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeSynonymInstances #
|
Module : Data.Array.Accelerate.IO.Data.Vector.Generic.Mutable
License : BSD3
Stability : exp... | # LANGUAGE BangPatterns #
# LANGUAGE FlexibleInstances #
# LANGUAGE GADTs #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeApplications #
Copyright : [ 2017 .. 2020 ] The Accelerate Team
Maintainer : < >
Portability : non - portable ( GHC extensions )
generic mu... |
81bdcd1fec9f841ca2482014681d26e37c0039c9018b5f5e57043529d0e26687 | verystable/warframe-autobuilder | MagazineMods.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
-- |
-- Module : Builder.Mods.PistolMods.AmmoMods
-- Maintainer :
-- Stability : experimental
--
-- Contains function that modify magazine size, applicable on secondary weapons.
module Builder.Mods.PistolMods.MagazineMods where
import ... | null | https://raw.githubusercontent.com/verystable/warframe-autobuilder/015e0bb6812711ea27071816d054cbaa1c65770b/src/Builder/Mods/PistolMods/MagazineMods.hs | haskell | # LANGUAGE OverloadedStrings #
|
Module : Builder.Mods.PistolMods.AmmoMods
Maintainer :
Stability : experimental
Contains function that modify magazine size, applicable on secondary weapons.
| Primed Slip Magazine [+55% Magazine Size]
| Slip Magazine [+30% Magazine Size] | # LANGUAGE NoImplicitPrelude #
module Builder.Mods.PistolMods.MagazineMods where
import ClassyPrelude
import Control.Lens ( (^.) )
import GenericFunctions.GenericFunctions
import Types.GenericWeapon
taintedClip1 :: GenericWeapon -> GenericWeapon -> GenericWe... |
01caab13f249aa03105aef5be11763a705afefc7dc8a2bfcc9bec118d1d7494e | fjames86/frpc2 | server.lisp | Copyright ( c ) 2016 < >
This code is licensed under the MIT license .
(in-package #:frpc2)
(defun find-rpc-handler (programs msg)
(let ((pg (call-body-program (xunion-val (rpc-msg-body msg))))
(vs (call-body-version (xunion-val (rpc-msg-body msg))))
(pc (call-body-proc (xunion-val (rpc-msg-b... | null | https://raw.githubusercontent.com/fjames86/frpc2/6b7ec2c7d57a0918ecc3755af75ff183e24d7e85/server.lisp | lisp | allow provider to modify call
reset the block and encode reply msg
encode the result
allow the provider to modify the result
xdr decoding error, reply with a garbage args reply
some generic accept error
the handler signalled an authentication error, encode that sort of reply
some other sort of error, encode a ... | Copyright ( c ) 2016 < >
This code is licensed under the MIT license .
(in-package #:frpc2)
(defun find-rpc-handler (programs msg)
(let ((pg (call-body-program (xunion-val (rpc-msg-body msg))))
(vs (call-body-version (xunion-val (rpc-msg-body msg))))
(pc (call-body-proc (xunion-val (rpc-msg-b... |
c6ad4c1b8529d6c76dc1843cbe17de3981a3211a51543e5f2c5d822486456976 | benoitc/cbt | cbt_btree_copy.erl | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an " A... | null | https://raw.githubusercontent.com/benoitc/cbt/49b99e56f406f918739adde152e8a4908e755521/src/cbt_btree_copy.erl | erlang | use this file except in compliance with the License. You may obtain a copy of
the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations... | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
-module(cbt_btree_copy).
-export([copy/3]).
-include("cbt.hrl").
-define(CHUNK_THRESHOLD, 16#4ff).
-record(acc, {
btree,
ref,
mod,
befor... |
f43d2ea50dd4b06231f02e523d5bdc4fd7ea2cc225af7f1829156fd6dd840c9a | janestreet/learn-ocaml-workshop | problem.ml | open! Base
Recall : In OCaml , functions are values , so we can pass them in as arguments
to other functions ( higher order functions ) .
As we 've seen before , in order to represent a function in a signature , we
wrap its type in parenthesis , with arrows separating arguments .
Remember [ add... | null | https://raw.githubusercontent.com/janestreet/learn-ocaml-workshop/1ba9576b48b48a892644eb20c201c2c4aa643c32/02-exercises/20-anonymous_functions/problem.ml | ocaml | Now, let's define a function called [map_option]. [map_option] takes a
function and an option.
If the option has a value of [None], [map_option] returns [None].
If the option has a value of [Some x], the function is called on x, and
wrapped up in a [Some].
It may seem unintuitive, but this kind of fu... | open! Base
Recall : In OCaml , functions are values , so we can pass them in as arguments
to other functions ( higher order functions ) .
As we 've seen before , in order to represent a function in a signature , we
wrap its type in parenthesis , with arrows separating arguments .
Remember [ add... |
10ab9f9323361dbbfa8a3f9cdebfafb4530aa774d1f5e96abf5c9a8e4a5e11d1 | evincarofautumn/kitten | Literal.hs | |
Module : Kitten . Literal
Description : Representations of literal values
Copyright : ( c ) , 2016
License : MIT
Maintainer :
Stability : experimental
Portability : GHC
Module : Kitten.Literal
Description : Representations of literal values
Copyright : (c) Jon Purdy, 2016
... | null | https://raw.githubusercontent.com/evincarofautumn/kitten/a5301fe24dbb9ea91974abee73ad544156ee4722/lib/Kitten/Literal.hs | haskell | # LANGUAGE OverloadedStrings #
Float literals compar equality regardless of bits.
Note [Float Literals]:
Floating-point literals are represented as a pair of an arbitrary-precision
integer significand and exponent, so that:
Float a b c
chosen to avoid loss of precision until the token is converted into a m... | |
Module : Kitten . Literal
Description : Representations of literal values
Copyright : ( c ) , 2016
License : MIT
Maintainer :
Stability : experimental
Portability : GHC
Module : Kitten.Literal
Description : Representations of literal values
Copyright : (c) Jon Purdy, 2016
... |
96ca5be4616ec2b011590395aa39753e1ebfe736c5a35f36595fd4fb8625c1f3 | Swirrl/table2qb | components_test.clj | (ns table2qb.pipelines.components-test
(:require [clojure.data.json :as json]
[clojure.java.io :as io]
[clojure.test :refer :all]
[grafter-2.rdf4j.repository :as repo]
[table2qb.csv :refer [reader]]
[table2qb.pipelines.components :refer :all]
[ta... | null | https://raw.githubusercontent.com/Swirrl/table2qb/b01611506b7f90aaa15c1a5227d0faabd922db3e/test/table2qb/pipelines/components_test.clj | clojure | (ns table2qb.pipelines.components-test
(:require [clojure.data.json :as json]
[clojure.java.io :as io]
[clojure.test :refer :all]
[grafter-2.rdf4j.repository :as repo]
[table2qb.csv :refer [reader]]
[table2qb.pipelines.components :refer :all]
[ta... | |
1b97cc1f29df03034993462221a1c19bebf3ea8960cacb3ef26685065c5f26dc | walmartlabs/lacinia | resolve.clj | Copyright ( c ) 2017 - present Walmart , Inc.
;
Licensed under the Apache License , Version 2.0 ( the " License " )
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; -2.0
;
; Unless required by applicable law or agreed to in writing, software
dist... | null | https://raw.githubusercontent.com/walmartlabs/lacinia/c3f079fcf22fb7fe3e4c5be6bb97dd7ed8abec05/src/com/walmartlabs/lacinia/resolve.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright ( c ) 2017 - present Walmart , Inc.
Licensed under the Apache License , Version 2.0 ( the " License " )
distributed under the License is distributed on an " AS IS " BASIS ,
(ns com.walmartlabs.lacinia.resolve
"Complex results for field resolver functions.
Resolver functions may return a value dire... |
ad28b45c3c12a47a94529c41122b2c160360362c2421b7d30c433258099d8a03 | tiensonqin/lymchat | auth.clj | (ns api.handler.admin.auth
(:require [api
[schemas :refer :all]
[util :refer [app-auth? doc production?]]]
[api.db
[user :as user]
[util :refer [default-db]]]
[api.services.slack :refer [error]]
[api.handler.util :refer [admin-tok... | null | https://raw.githubusercontent.com/tiensonqin/lymchat/824026607d30c12bc50afb06f677d1fa95ff1f2f/api/src/api/handler/admin/auth.clj | clojure | (ns api.handler.admin.auth
(:require [api
[schemas :refer :all]
[util :refer [app-auth? doc production?]]]
[api.db
[user :as user]
[util :refer [default-db]]]
[api.services.slack :refer [error]]
[api.handler.util :refer [admin-tok... | |
2e9e7760a1ba85bdb0ad5a6739aa52486d82cac76a6f15969e69df28cb9d1203 | robert-strandh/SICL | packages.lisp | (cl:in-package #:common-lisp-user)
(defpackage #:cleavir-literals
(:use #:common-lisp)
(:export #:make-load-form-using-client
#:with-fresh-similarity-table
#:load-time-literal
#:allocate-lexical-location
#:convert-initialization-form
#:convert-creation-form
... | null | https://raw.githubusercontent.com/robert-strandh/SICL/697450bb03e3052fef0b9eb7011d72473f337394/Code/Cleavir/CST-to-AST/Literals/packages.lisp | lisp | (cl:in-package #:common-lisp-user)
(defpackage #:cleavir-literals
(:use #:common-lisp)
(:export #:make-load-form-using-client
#:with-fresh-similarity-table
#:load-time-literal
#:allocate-lexical-location
#:convert-initialization-form
#:convert-creation-form
... | |
6cae8bba72fc0cae56aff0ffa713b9b73eb04aed75d67783762976c5e71af5d2 | betaveros/bcodex | Unicode.hs | # LANGUAGE ViewPatterns #
module Text.Bcodex.Unicode (
fullwidth, halfwidth, circled, uncircled,
officialUnicodeSmallCaps, hackySmallCaps, unSmallCaps) where
import Control.Arrow (second)
import Data.Char (chr, ord)
import Data.Tuple (swap)
import qualified Data.Map as Map
fullwidth :: Char -> Char
fullwidth ... | null | https://raw.githubusercontent.com/betaveros/bcodex/90fadbf8215efa932212ae95fb5573df835f0c90/Text/Bcodex/Unicode.hs | haskell | CYRILLIC SMALL LETTER GHE WITH STROKE
LATIN SMALL LETTER O WITH OGONEK
LATIN SMALL LETTER S (itself) | # LANGUAGE ViewPatterns #
module Text.Bcodex.Unicode (
fullwidth, halfwidth, circled, uncircled,
officialUnicodeSmallCaps, hackySmallCaps, unSmallCaps) where
import Control.Arrow (second)
import Data.Char (chr, ord)
import Data.Tuple (swap)
import qualified Data.Map as Map
fullwidth :: Char -> Char
fullwidth ... |
09661d88a28c9250f2dc7bb55fa9021dc2eb8f9867ae6fc80e8067982e8fecb7 | dyzsr/ocaml-selectml | full_int.ml | (* TEST *)
Ensure that a bound which is negative on 31 - bit OCaml but positive on 32 - bit
OCaml produces the same result on 64 - bit OCaml .
OCaml produces the same result on 64-bit OCaml. *)
let bound = 0x6FFFFFFF in
31 - bit integers
print_endline "6beb775a"
32 or 64 - bit integers
let s = Random... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/testsuite/tests/lib-random/full_int.ml | ocaml | TEST |
Ensure that a bound which is negative on 31 - bit OCaml but positive on 32 - bit
OCaml produces the same result on 64 - bit OCaml .
OCaml produces the same result on 64-bit OCaml. *)
let bound = 0x6FFFFFFF in
31 - bit integers
print_endline "6beb775a"
32 or 64 - bit integers
let s = Random.State.make... |
df9bf1ae5a3bdabf7c8709a1b66ad3fc7e31bd877ba64195269997bf7e0c4100 | futurice/haskell-mega-repo | Logo.hs | {-# LANGUAGE TemplateHaskell #-}
module Futurice.Logo (
makeLogo,
makeLogoBS,
) where
import Codec.Picture (Image, Pixel8, PixelRGBA8 (..),
decodeImage, encodePng, mixWithAlpha,
pixelMap, convertRGBA8)
import ... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/2647723f12f5435e2edc373f6738386a9668f603/futurice-logo/src/Futurice/Logo.hs | haskell | # LANGUAGE TemplateHaskell #
^ Disk colour
^ disk colour | module Futurice.Logo (
makeLogo,
makeLogoBS,
) where
import Codec.Picture (Image, Pixel8, PixelRGBA8 (..),
decodeImage, encodePng, mixWithAlpha,
pixelMap, convertRGBA8)
import Codec.Picture.Types (prom... |
a8f0d0891d56ecbf3be9798df5eebc8752f890a57bffa7873da72efc7e8108c5 | ckirkendall/The-Great-Todo | security.clj | (ns cinjug1.security
(:require [clj-crypto.core :as crypto]
[noir.cookies :as cookie]
[noir.fetch.remotes :as rem]
[noir.request :as req]
[ring.util.codec :as codec]))
(def secret "secret")
(def tok-name :secure-tok)
(def session-timeout (* 1000 60 15))
(defn fail [m... | null | https://raw.githubusercontent.com/ckirkendall/The-Great-Todo/34847d6280e9451c6204abb0d2f4c62b2acf55dc/src/cinjug1/security.clj | clojure | (ns cinjug1.security
(:require [clj-crypto.core :as crypto]
[noir.cookies :as cookie]
[noir.fetch.remotes :as rem]
[noir.request :as req]
[ring.util.codec :as codec]))
(def secret "secret")
(def tok-name :secure-tok)
(def session-timeout (* 1000 60 15))
(defn fail [m... | |
199021c0b9fa85613fd1aa006bffa4ceab54604881f289960ce05d0ce2d9ffed | ocaml-multicore/tezos | client_proto_stresstest_commands.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2021 Nomadic Labs < >
(* ... | null | https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_alpha/lib_client_commands/client_proto_stresstest_commands.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2021 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 AN... |
727210cedd721bbd712b30a5bb5637debc06da6a70fbe51dd39648f91ba30bba | YoshikuniJujo/test_haskell | Exception.hs | # OPTIONS_GHC -Wall -fno - warn - tabs #
module Gpu.Vulkan.Exception (
MultiResult(..)
) where
import Gpu.Vulkan.Exception.Middle
| null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/85e1ce63dc14d4fa3d323f7c9076d354bb57e5d8/themes/gui/vulkan/try-my-vulkan-snd/src/Gpu/Vulkan/Exception.hs | haskell | # OPTIONS_GHC -Wall -fno - warn - tabs #
module Gpu.Vulkan.Exception (
MultiResult(..)
) where
import Gpu.Vulkan.Exception.Middle
| |
ab917262d6f6f68925476c94d1af53e9b42dbeefd56e0e7e575bed8531fdbd60 | hraberg/mimir | well.clj | (ns mimir.well
(:use [clojure.set :only (intersection map-invert rename-keys difference union join)]
[clojure.tools.logging :only (debug info warn error spy)]
[clojure.walk :only (postwalk postwalk-replace)]
[mimir.match :only (filter-walk maybe-singleton-coll match all-vars *match-var?* defau... | null | https://raw.githubusercontent.com/hraberg/mimir/c96db8cd4a46ba90c2c90d78c2dabba8f5ac23a8/src/mimir/well.clj | clojure | This is not thread safe.
(r/mapcat #(% wm {}))
(fold-into vector) | (ns mimir.well
(:use [clojure.set :only (intersection map-invert rename-keys difference union join)]
[clojure.tools.logging :only (debug info warn error spy)]
[clojure.walk :only (postwalk postwalk-replace)]
[mimir.match :only (filter-walk maybe-singleton-coll match all-vars *match-var?* defau... |
40030201d244c54b7c88ee1f54cf3b342b35c02d346fbddb4ba476cffd662757 | samrushing/irken-compiler | timetest.scm | ;; -*- Mode: Irken -*-
(include "lib/basis.scm")
(include "lib/map.scm")
(require-ffi 'libc)
(require-ffi 'posix)
note : timezone.tz_dsttime is not really useful , since the DST rules
;; are complex and variable.
(define (gettimeofday)
(let ((tv (malloc (struct timeval)))
(tz (malloc (struct timezone))... | null | https://raw.githubusercontent.com/samrushing/irken-compiler/690da48852d55497f873738df54f14e8e135d006/ffi/tests/timetest.scm | scheme | -*- Mode: Irken -*-
are complex and variable.
(posix/gettimeofday tv (%c-cast void tz))
-day-number-from-an-unix-timestamp-in-a-math-way
#civil_from_days
math. hence the +3/-9 adjustment to 'm'. |
(include "lib/basis.scm")
(include "lib/map.scm")
(require-ffi 'libc)
(require-ffi 'posix)
note : timezone.tz_dsttime is not really useful , since the DST rules
(define (gettimeofday)
(let ((tv (malloc (struct timeval)))
(tz (malloc (struct timezone))))
(posix/gettimeofday tv tz)
(let ((result
... |
62b85d69441dda00983a337b81f3cf4f92b8262232922f03a0c287ef3aefa3a6 | philnguyen/soft-contract | ex-12.rkt | #lang racket
(define (carnum? p) (number? (car p)))
(provide/contract
[carnum? (->i ([p cons?]) (res (p) (and/c boolean? (λ (a) (equal? a (number? (car p)))))))])
| null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/octy/ex-12.rkt | racket | #lang racket
(define (carnum? p) (number? (car p)))
(provide/contract
[carnum? (->i ([p cons?]) (res (p) (and/c boolean? (λ (a) (equal? a (number? (car p)))))))])
| |
7fc5413314a6af2d1e12f46ca520c5462a936243f89f796c3c2456ed5d84004e | rizo/snowflake-os | PCI.ml |
(* PCI Bus *)
open Asm
open Int32
module R = struct
let port = 0xCF8
let data = 0xCFC
end
type device_id = int32
type device =
{
id : device_id;
vendor : int;
device : int;
resources : resource array;
request_line : int;
b : int;
d : int;
f : int;
}
and resource =
| Em... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/kernel/PCI.ml | ocaml | PCI Bus
done |
open Asm
open Int32
module R = struct
let port = 0xCF8
let data = 0xCFC
end
type device_id = int32
type device =
{
id : device_id;
vendor : int;
device : int;
resources : resource array;
request_line : int;
b : int;
d : int;
f : int;
}
and resource =
| Empty
| IO of i... |
5a7fa1aba1bfbf6dcd2419eb12e8a931ae3754c6c73ac45e3b066362fd3f7417 | tolysz/ghcjs-stack | DistDirLayout.hs | # LANGUAGE RecordWildCards #
-- |
--
The layout of the .\/dist\/ directory where cabal keeps all of it 's state
-- and build artifacts.
--
module Distribution.Client.DistDirLayout where
import System.FilePath
import Distribution.Package
( PackageId )
import Distribution.Compiler
import Distribution.Simple... | null | https://raw.githubusercontent.com/tolysz/ghcjs-stack/83d5be83e87286d984e89635d5926702c55b9f29/special/cabal-next/cabal-install/Distribution/Client/DistDirLayout.hs | haskell | |
and build artifacts.
| The layout of the project state directory. Traditionally this has been
called the @dist@ directory.
| The dist directory, which is the root of where cabal keeps all its
state including the build artifacts from each package we build.
| The directory under dist where we keep the build... | # LANGUAGE RecordWildCards #
The layout of the .\/dist\/ directory where cabal keeps all of it 's state
module Distribution.Client.DistDirLayout where
import System.FilePath
import Distribution.Package
( PackageId )
import Distribution.Compiler
import Distribution.Simple.Compiler (PackageDB(..))
import Dis... |
2000600cdfa5dd6ec780ff6983b5413b3b233f3fa135c6a6e85383c087d9926c | heyoka/faxe | c_python.erl | %%% Date: 05.01.17 - 14:11
Ⓒ 2017 heyoka
%%% @doc
%%% rules for python callback classes
%%% * Callback class must be in a module with the lowercased name of the class ie:
%%% module: "double", class: "Double"
* python callback class must be a subclass of the class Faxe from module faxe
%%% * 'abstract' methods to... | null | https://raw.githubusercontent.com/heyoka/faxe/635dcf0598784e0dfb17c12c84d0541d6af71d59/apps/faxe/src/components/c_python.erl | erlang | Date: 05.01.17 - 14:11
@doc
rules for python callback classes
* Callback class must be in a module with the lowercased name of the class ie:
module: "double", class: "Double"
* 'abstract' methods to implement are:
options() -> return a list of tuples // static
handle_point(self, point_data) -> point... | Ⓒ 2017 heyoka
* python callback class must be a subclass of the class Faxe from module faxe
init(self , args ) - > gets the object and a list of dicts with args from options ( )
handle_batch(self , batch_data ) - > batch_data is a list of dicts ( points )
* to emit data the method self.emit(data ) h... |
4196df92d2f65b01fa08de3db22c28ce414b5b649c996a0e16698aecb2ca6860 | andersfugmann/amqp-client | amqp.ml | include Amqp_client_lwt
let () =
Lwt_log.default :=
Lwt_log.channel
~close_mode:`Keep
~channel:Lwt_io.stdout
();
Lwt_log_core.append_rule "*" Lwt_log_core.Debug;
| null | https://raw.githubusercontent.com/andersfugmann/amqp-client/e6e92225b91742fa8777a02ad9b59a1dde45e752/lwt/test/amqp.ml | ocaml | include Amqp_client_lwt
let () =
Lwt_log.default :=
Lwt_log.channel
~close_mode:`Keep
~channel:Lwt_io.stdout
();
Lwt_log_core.append_rule "*" Lwt_log_core.Debug;
| |
995a9cd89a84ff8edf22e9c5a8f5555128df325e337696bf7c1a7ac54aff7c92 | adaliu-gh/htdp | 397-401.rkt | ;;=====================
397
(define WRONG "WRONG")
(define-struct employee [name no rate])
(define-struct punch [no time])
(define-struct wage [name money])
;; e.x.
(define one-loe (list (make-employee "Adam" "012" 40.34) (make-employee "Eve" "013" 50.23)))
(define one-lop (list (make-punch "012" 34) (make-punch "01... | null | https://raw.githubusercontent.com/adaliu-gh/htdp/a0fca8af2ae8bdcef40d56f6f45021dd92df2995/19-24%20Intertwined%20Data/397-401.rkt | racket | =====================
e.x.
[List-of Employee] [List-of Punch] -> [List-of Wage]
[List-of Employee] Punch -> Wage
===============================
[List-of Number] [List-of Number] -> Number
================================
returns a random item from the list
[List-of String] [List-of [List-of String]] -> [List-of ... | 397
(define WRONG "WRONG")
(define-struct employee [name no rate])
(define-struct punch [no time])
(define-struct wage [name money])
(define one-loe (list (make-employee "Adam" "012" 40.34) (make-employee "Eve" "013" 50.23)))
(define one-lop (list (make-punch "012" 34) (make-punch "013" 43)))
(check-expect (wages*.... |
87dc31d22852b81b15657a7170b78fe3d11e555e95b767177160dc671bc340c7 | michaelklishin/monger | util.clj | This source code is dual - licensed under the Apache License , version
2.0 , and the Eclipse Public License , version 1.0 .
;;
;; The APL v2.0:
;;
;; ----------------------------------------------------------------------------------
Copyright ( c ) 2011 - 2018 , , and the ClojureWerkz Team
;;
Licensed unde... | null | https://raw.githubusercontent.com/michaelklishin/monger/84170f7c51973e3d789736cdeb3cd8ad013071c3/src/clojure/monger/util.clj | clojure |
The APL v2.0:
----------------------------------------------------------------------------------
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 CONDIT... | This source code is dual - licensed under the Apache License , version
2.0 , and the Eclipse Public License , version 1.0 .
Copyright ( c ) 2011 - 2018 , , and the ClojureWerkz Team
distributed under the License is distributed on an " AS IS " BASIS ,
The EPL v1.0 :
Copyright ( c ) 2011 - 2018 , , ... |
299781969ceff8a3110257c18fe74e47de25d2e9be605d6a4540486784a5c139 | tisnik/clojure-examples | core_test.clj | ;
( C ) Copyright 2016 , 2020 , 2021
;
; 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:
;
(ns describe-topics.core-test... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/a5f9d6119b62520b05da64b7929d07b832b957ab/kafka-describe-topics/test/describe_topics/core_test.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 2016 , 2020 , 2021
-v10.html
(ns describe-topics.core-test
(:require [clojure.test :refer :all]
[describe-topics.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
|
f58daafb5853454c5fe9d8160d46032f3695501514b525306d229fca7583be26 | fukamachi/qlot | github.lisp | (defpackage #:qlot/tests/distify/github
(:use #:cl
#:rove
#:qlot/distify/github)
(:import-from #:qlot/source
#:make-source)
(:import-from #:qlot/utils/tmp
#:tmp-directory))
(in-package #:qlot/tests/distify/github)
(defparameter *tmp-directory* (tmp-directory))
(se... | null | https://raw.githubusercontent.com/fukamachi/qlot/bddae911be756b8ca327d84bbcae24bef70c6659/tests/distify/github.lisp | lisp | (defpackage #:qlot/tests/distify/github
(:use #:cl
#:rove
#:qlot/distify/github)
(:import-from #:qlot/source
#:make-source)
(:import-from #:qlot/utils/tmp
#:tmp-directory))
(in-package #:qlot/tests/distify/github)
(defparameter *tmp-directory* (tmp-directory))
(se... | |
f561072729e6fdab6db4e1a7ac9faf68742ee8edb23c10b05c8ec1ff3171a3e5 | ztellman/penumbra | render_to_texture.clj | Copyright ( c ) . All rights reserved .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by... | null | https://raw.githubusercontent.com/ztellman/penumbra/db43d01c280305beab26d1004ae78b1777ab3fc7/test/example/opengl/render_to_texture.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) . All rights reserved .
(ns example.opengl.render-to-texture
(:use [penumbra opengl])
(:require [penumbra.app :as app]
[penumbra.data :as data]))
(defn textured-quad []
(push-matrix
(translate -0.5 -0.5 0.5)
(normal 0 0 -1)
(draw-quads
(texture 1 1) (vertex 1 ... |
321b6dffddf25cc7ef25f69a0ea591ee2f501c9e060a3daeb84260d139073e9d | valpackett/microformats2-parser | Parser.hs | # LANGUAGE Trustworthy , NoImplicitPrelude , UnicodeSyntax , OverloadedStrings , CPP #
module Data.Microformats2.Parser (
Mf2ParserSettings (..)
, HtmlContentMode (..)
, parseMf2
, extractProperty
-- * HTML parsing stuff (from html-conduit, xml-lens)
, documentRoot
, parseLBS
, sinkDoc
) where
import P... | null | https://raw.githubusercontent.com/valpackett/microformats2-parser/eb55df250d4ab77180507aba6879141fc3680b42/library/Data/Microformats2/Parser.hs | haskell | * HTML parsing stuff (from html-conduit, xml-lens)
we have to do all of this because multiple elements can become multiple properties (with overlap) | # LANGUAGE Trustworthy , NoImplicitPrelude , UnicodeSyntax , OverloadedStrings , CPP #
module Data.Microformats2.Parser (
Mf2ParserSettings (..)
, HtmlContentMode (..)
, parseMf2
, extractProperty
, documentRoot
, parseLBS
, sinkDoc
) where
import Prelude.Compat
import Data.Microformats2.Parser... |
ff911b4270f22c9e36285cf17bacea471b74abbfea2c40aa27cf4a072c51cbd3 | mikelevins/categories | function.scm | ;;;; ***********************************************************************
;;;; FILE IDENTIFICATION
;;;;
;;;; Name: function.scm
;;;; Project: Categories
;;;; Purpose: the Categories object system
;;;; Author: mikel evins
Copyright : 2013 by mikel evins
;;;;
;;;; *******************... | null | https://raw.githubusercontent.com/mikelevins/categories/66e3861071e4d88b7b27421a78ab497e1fb5fa0c/0.4/src/function.scm | scheme | ***********************************************************************
FILE IDENTIFICATION
Name: function.scm
Project: Categories
Purpose: the Categories object system
Author: mikel evins
*********************************************************************** | Copyright : 2013 by mikel evins
(define (make-function)
(let ((methods '(metadata)))
(lambda params params)))
(define (function-metadata fn)
(cond ((##interp-procedure? fn)
(##vector-ref (##interp-procedure-rte fn) 1))
((##closure? fn)
(##closure-ref fn 1))
(else
... |
f360de34729e7b2348c11910e10db932b8268afa39a0b2f5deb24b64ecb37910 | yuanqing/code-problems | test.ml | open Tree_traversal
open OUnit2
let x =
Node (0,
Node (1,
Node (3,
Empty,
Empty
),
Node (4,
Empty,
Node (7,
Empty,
Empty
)
)
),
Node (2,
Node (5,
Node (8,
Empty,
Empty
),
... | null | https://raw.githubusercontent.com/yuanqing/code-problems/30eb34ad616146306cddc50594a47deff111f341/src/tree_traversal/test.ml | ocaml | open Tree_traversal
open OUnit2
let x =
Node (0,
Node (1,
Node (3,
Empty,
Empty
),
Node (4,
Empty,
Node (7,
Empty,
Empty
)
)
),
Node (2,
Node (5,
Node (8,
Empty,
Empty
),
... | |
51f834f02400e8276357db041dcb7ec359254d01bc8ccf3675649488bf3ff2ed | cl-axon/shop2 | operators.lisp | (in-package :shop2-user)
(defdomain umt-translog-operators
(
(:operator (!!assert ?g)
()
()
?g)
(:operator (!!delete-truck ?truck)
()
((typevp ?truck truck))
())
(:operator (!!delete-tcenter ?locat... | null | https://raw.githubusercontent.com/cl-axon/shop2/9136e51f7845b46232cc17ca3618f515ddcf2787/tests/umt-domain/operators.lisp | lisp | (in-package :shop2-user)
(defdomain umt-translog-operators
(
(:operator (!!assert ?g)
()
()
?g)
(:operator (!!delete-truck ?truck)
()
((typevp ?truck truck))
())
(:operator (!!delete-tcenter ?locat... | |
a7cc6cdf478744c3e1d68727c8b97c4ae66bbd2d0b0d324199387c88b780c626 | fulcro-legacy/fulcro-lein-template | client.cljs | (ns {{name}}.client
(:require [fulcro.client :as fc]
[{{name}}.ui.root :as root]
[fulcro.client.network :as net]
[fulcro.client.data-fetch :as df]))
(defonce SPA (atom nil))
(defn mount []
(reset! SPA (fc/mount @SPA root/Root "app")))
(defn start []
(mount))
(def secured-re... | null | https://raw.githubusercontent.com/fulcro-legacy/fulcro-lein-template/41195fc3b5e4054ee8b0cfff379bbadb006be046/resources/leiningen/new/fulcro/src/main/app/client.cljs | clojure | The CSRF token is embedded via server_components/html.clj
This ensures your client can talk to a CSRF-protected server.
See middleware.clj to see how the token is embedded into the HTML | (ns {{name}}.client
(:require [fulcro.client :as fc]
[{{name}}.ui.root :as root]
[fulcro.client.network :as net]
[fulcro.client.data-fetch :as df]))
(defonce SPA (atom nil))
(defn mount []
(reset! SPA (fc/mount @SPA root/Root "app")))
(defn start []
(mount))
(def secured-re... |
1cce9310e706d42218e1dbaa73ca7164dc99e509ce90528cde12043565890354 | arttuka/reagent-material-ui | snackbar_unstyled.cljs | (ns reagent-mui.base.snackbar-unstyled
"Imports @mui/base/SnackbarUnstyled as a Reagent component.
Original documentation is at -unstyled/ ."
(:require [reagent.core :as r]
["@mui/base/SnackbarUnstyled" :as MuiSnackbarUnstyled]))
(def snackbar-unstyled (r/adapt-react-class (.-default MuiSnackbarUnst... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/core/reagent_mui/base/snackbar_unstyled.cljs | clojure | (ns reagent-mui.base.snackbar-unstyled
"Imports @mui/base/SnackbarUnstyled as a Reagent component.
Original documentation is at -unstyled/ ."
(:require [reagent.core :as r]
["@mui/base/SnackbarUnstyled" :as MuiSnackbarUnstyled]))
(def snackbar-unstyled (r/adapt-react-class (.-default MuiSnackbarUnst... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.