_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 |
|---|---|---|---|---|---|---|---|---|
f45139cad481f311bd29a535ccd81ca5ec089e488ccf5488ebe95fce4ec11038 | deobald/sicp-clojure | ex2_27.clj | (ns sec2_2.ex2_27
(:use clojure.test))
(defn deep-reverse [x]
(cond (nil? x) nil
(not (seq? x)) x
:default (map deep-reverse (reverse x))))
(deftest should-reverse-items-in-sub-lists-as-well-as-the-list-itself
(is (= '((4 3) (2 1)) (deep-reverse '((1 2) (3 4))))))
(run-all-tests #"ex.*")
| null | https://raw.githubusercontent.com/deobald/sicp-clojure/fc24e5114604e7a0510dab779bbff962aac7ee7e/src/sec2_2/ex2_27.clj | clojure | (ns sec2_2.ex2_27
(:use clojure.test))
(defn deep-reverse [x]
(cond (nil? x) nil
(not (seq? x)) x
:default (map deep-reverse (reverse x))))
(deftest should-reverse-items-in-sub-lists-as-well-as-the-list-itself
(is (= '((4 3) (2 1)) (deep-reverse '((1 2) (3 4))))))
(run-all-tests #"ex.*")
| |
45ee7543db1d91985a0ec5c52e841007c4ab1db7997600f3d5aa9c5958cda988 | randomseed-io/bankster | importer.clj | (ns io.randomseed.bankster.util.importer
^{:doc "Bankster library, import-export operations."
:author "Paweł Wilk"
:added "1.0.0"}
(:require [clojure.java.io :as io]
[clojure.data.csv :as csv]
[clojure.string :as s... | null | https://raw.githubusercontent.com/randomseed-io/bankster/15fc1de1889a760a5fc3d1180c91ee5878b81c47/src/io/randomseed/bankster/util/importer.clj | clojure |
Pathnames and URIs.
Transformation rules.
Readers generator.
High-level operations.
| (ns io.randomseed.bankster.util.importer
^{:doc "Bankster library, import-export operations."
:author "Paweł Wilk"
:added "1.0.0"}
(:require [clojure.java.io :as io]
[clojure.data.csv :as csv]
[clojure.string :as s... |
6d64a9786490ed2edbd882b59f39292298b94b1340ace7548712fde8b7809f16 | nubank/ordnungsamt | core_test.clj | (ns ordnungsamt.core-test
(:require [clojure.test :refer :all]
[ordnungsamt.core :as core]))
(deftest test-filter-opt-in
(let [filter (#'core/filter-opt-in "serviceA")]
(testing "passes if the service is in the opt-in"
(is (true? (filter {:opt-in #{"serviceA" "serviceB"}}))))
(testing "p... | null | https://raw.githubusercontent.com/nubank/ordnungsamt/e11379b914f652264a5e2b5860fe3447342c9e06/test/unit/ordnungsamt/core_test.clj | clojure | (ns ordnungsamt.core-test
(:require [clojure.test :refer :all]
[ordnungsamt.core :as core]))
(deftest test-filter-opt-in
(let [filter (#'core/filter-opt-in "serviceA")]
(testing "passes if the service is in the opt-in"
(is (true? (filter {:opt-in #{"serviceA" "serviceB"}}))))
(testing "p... | |
1936a5d82f10c3f710f883e36f06710eeeff4e9d22574fafa49c28a5e4c6e0e5 | graninas/Hydra | PerfFree.hs | {-# LANGUAGE PackageImports #-}
# LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE ScopedTypeVariables #
module PerfFree where
import Control.Monad
import Hydra.Prelude
import qualified "hydra-free" Hydra.Language as L
import qualified "hydra-free" Hydra.Runtime... | null | https://raw.githubusercontent.com/graninas/Hydra/60d591b1300528f5ffd93efa205012eebdd0286c/app/PerfTestApp/src/PerfFree.hs | haskell | # LANGUAGE PackageImports #
# LANGUAGE FlexibleContexts #
Tail-rec
Not tail-rec | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE ScopedTypeVariables #
module PerfFree where
import Control.Monad
import Hydra.Prelude
import qualified "hydra-free" Hydra.Language as L
import qualified "hydra-free" Hydra.Runtime as R
import qualified "hydra-free" Hydra.Interpreters as R
import ... |
71eb7f241c3936ce4329d42ffa6f4b1d52b42e9adbe5a0ebed422d53f8297df2 | quchen/prettyprinter | Panic.hs | module Prettyprinter.Render.Util.Panic (
panicUncaughtFail,
panicUnpairedPop,
panicSimpleDocTreeConversionFailed,
panicInputNotFullyConsumed,
panicPeekedEmpty,
panicPoppedEmpty,
) where
| Raise a hard ' error ' if there is a ' . SFail ' in a
' . SimpleDocStream ' .
panicUncaughtFail :: vo... | null | https://raw.githubusercontent.com/quchen/prettyprinter/11e8bf12aed2f698e619c3a8c07eca3af4da1aed/prettyprinter/src/Prettyprinter/Render/Util/Panic.hs | haskell | | Raise a hard 'error' when an annotation terminator is encountered in an
unannotated region.
| Raise a hard generic 'error' when the
| Raise a hard 'error' when the »to
without consuming the full input. | module Prettyprinter.Render.Util.Panic (
panicUncaughtFail,
panicUnpairedPop,
panicSimpleDocTreeConversionFailed,
panicInputNotFullyConsumed,
panicPeekedEmpty,
panicPoppedEmpty,
) where
| Raise a hard ' error ' if there is a ' . SFail ' in a
' . SimpleDocStream ' .
panicUncaughtFail :: vo... |
63d8547c05535c9e51b76c902920e999b7476664095aeb4d1fbddde63d755eb5 | perkss/tinklj | aws_kms_client.clj | (ns tinklj.keysets.integration.aws-kms-client
(:import (com.google.crypto.tink.integration.awskms AwsKmsClient)
(com.google.crypto.tink KmsClients)
(java.util Optional)))
(defn aws-kms-client
([^String uri ^String credential-path]
(let [opUri (if (or (nil? uri) (clojure.string/blank? uri))... | null | https://raw.githubusercontent.com/perkss/tinklj/6bf0be72d5b7757319c4bcdf2ad6d7ae8155dbab/src/tinklj/keysets/integration/aws_kms_client.clj | clojure | (ns tinklj.keysets.integration.aws-kms-client
(:import (com.google.crypto.tink.integration.awskms AwsKmsClient)
(com.google.crypto.tink KmsClients)
(java.util Optional)))
(defn aws-kms-client
([^String uri ^String credential-path]
(let [opUri (if (or (nil? uri) (clojure.string/blank? uri))... | |
856824c12b082595299f0522746713a0ca708922443ccc55856f0ce9daf2831d | radian628/lispsmos | another-test.lisp |
(= a 0)
(-> a (+ a 1)) | null | https://raw.githubusercontent.com/radian628/lispsmos/d876f7e81129c1990ea1007dadb04cf5d1641d9d/test/internal/old/another-test.lisp | lisp |
(= a 0)
(-> a (+ a 1)) | |
07f0916baad0dbecb95a57a3a744cd24f6895e7099a8378fa1163e9466c5bb84 | olieidel/correlate | project.clj | (defproject correlate "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.9.0"]
[org.clojure/data.csv "0.1.4"]
[org.clojure/data.xml "0.0.8"]
... | null | https://raw.githubusercontent.com/olieidel/correlate/6f2e09fe67e223cc43e0bf7d4287f2de849848ff/project.clj | clojure | (defproject correlate "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.9.0"]
[org.clojure/data.csv "0.1.4"]
[org.clojure/data.xml "0.0.8"]
... | |
d6bfb96afe135c5d39f7dda404546ae55b8818873c9f34d9b72e4da53f349f91 | semaj/mini-tcp-haskell | 3700send.hs | module Main where
import TCP
import Control.Monad (unless, forever, when, void)
import Network.Socket
import Data.Time
import Data.Maybe
import Data.List.Split
import Data.List
import Control.Exception
import System.IO
import System.Environment
import Control.Concurrent
import System.Exit
import Debug.Trace
---- Clien... | null | https://raw.githubusercontent.com/semaj/mini-tcp-haskell/55eb08bc536c2ce7e4765a0a5acdd23cf4bdca88/3700send.hs | haskell | -- Client specific code
state of the client
we've sent it, waiting for ack (Segment sent, time sent)
what to send on the next clientloop
last sequence number acked by server (starts at 0)
unused (unlimited)
-- Client Functions
remove acked (this should be delete)
this is definitely inefficient
get the nacks out... | module Main where
import TCP
import Control.Monad (unless, forever, when, void)
import Network.Socket
import Data.Time
import Data.Maybe
import Data.List.Split
import Data.List
import Control.Exception
import System.IO
import System.Environment
import Control.Concurrent
import System.Exit
import Debug.Trace
data CSta... |
272acbd8042a4c14a007328539303cf3d96e3d04ac631f8a6c6e90197cde3cd4 | rabbitmq/rabbitmq-management | rabbit_mgmt_wm_rebalance_queues.erl | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
%%
Copyright ( c ) 2007 - 2020 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(rabbit_mgmt_wm_rebalance_queues).
-expor... | null | https://raw.githubusercontent.com/rabbitmq/rabbitmq-management/543906f01ccd0344aff648f21bb6b5156b2a2ca2/src/rabbit_mgmt_wm_rebalance_queues.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(rabbit_mgmt_wm_rebalance_queues).
-export([ini... |
02525a8fd3dfda22d9b92a79c0578bcd9e6e489f7e5380cc2089d0e4c097c21f | xapi-project/xen-api | xapi_pvs_site.ml |
* Copyright ( C ) 2016 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in fi... | null | https://raw.githubusercontent.com/xapi-project/xen-api/48cc1489fff0e344246ecf19fc1ebed6f09c7471/ocaml/xapi/xapi_pvs_site.ml | ocaml | This module implements methods for the PVS_site class
Check there are no running proxies.
Check there are no servers.
* set the PVS UUID of [self] |
* Copyright ( C ) 2016 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in fi... |
1d1d96916cbd5c3fa13dc6e7e916d401eed8afa27d973bc3875c97fa9dd095d9 | scarvalhojr/haskellbook | section26.5.hs |
# LANGUAGE InstanceSigs #
import Data.Char (intToDigit, isHexDigit)
newtype StateT s m a = StateT { runStateT :: s -> m (a,s) }
1 .
instance (Functor m) => Functor (StateT s m) where
fmap :: (a -> b) -> StateT s m a -> StateT s m b
fmap f (StateT smas) = StateT $ (fmap . fmap) f' smas
where f' (a, s) = (... | null | https://raw.githubusercontent.com/scarvalhojr/haskellbook/6016a5a78da3fc4a29f5ea68b239563895c448d5/chapter26/section26.5.hs | haskell | -
Just ("aa",11),Just ("bb",12),Just ("cc",13),Just ("dd",14),
Just ("ee",15),Just ("ff",16),Nothing,Nothing]
y2' == y'
True
y3' == y2'
True |
# LANGUAGE InstanceSigs #
import Data.Char (intToDigit, isHexDigit)
newtype StateT s m a = StateT { runStateT :: s -> m (a,s) }
1 .
instance (Functor m) => Functor (StateT s m) where
fmap :: (a -> b) -> StateT s m a -> StateT s m b
fmap f (StateT smas) = StateT $ (fmap . fmap) f' smas
where f' (a, s) = (... |
6faff72fbad6b51e0d7dcd175551d4eee4cb6877d045ca8c4c92ffc9fa452ba3 | cgrand/enlivez | bench.cljs | (ns enlivez.q.bench
(:require
[datascript.core :as d]
[enlivez.q :as q]))
(let [db (d/db-with (d/empty-db {:book/title {:db/index true}
:book/author {:db/index true}})
[{:book/title "Les Misérables" :book/author "Hugo" :book/lang "fr"}
{:book/title "Mob... | null | https://raw.githubusercontent.com/cgrand/enlivez/01059ceb0463ced9cf35617208467048f7a77d0f/src/enlivez/q/bench.cljs | clojure | (ns enlivez.q.bench
(:require
[datascript.core :as d]
[enlivez.q :as q]))
(let [db (d/db-with (d/empty-db {:book/title {:db/index true}
:book/author {:db/index true}})
[{:book/title "Les Misérables" :book/author "Hugo" :book/lang "fr"}
{:book/title "Mob... | |
97f2eaecd8fc8ab9f3a0f00aa9874ab14e26c64a7f969c200de66d7a6478eb02 | chetmurthy/poly-protobuf | test13_ml.ml | module T = Test13_types
module Pb = Test13_pb
module Pp = Test13_pp
let decode_ref_data () = T.({
p2 = {
empty = ();
sub = Sub_empty;
};
p1 = {
l = [Empty; Int 1l; Empty; Int 2l];
};
})
let mode = Test_util.parse_args ()
let () =
match mode with
| Test_util.Decode ->
Test_util... | null | https://raw.githubusercontent.com/chetmurthy/poly-protobuf/1f80774af6472fa30ee2fb10d0ef91905a13a144/tests/testdata/integration-tests/test13_ml.ml | ocaml | module T = Test13_types
module Pb = Test13_pb
module Pp = Test13_pp
let decode_ref_data () = T.({
p2 = {
empty = ();
sub = Sub_empty;
};
p1 = {
l = [Empty; Int 1l; Empty; Int 2l];
};
})
let mode = Test_util.parse_args ()
let () =
match mode with
| Test_util.Decode ->
Test_util... | |
23ba225256d9abbc92770160823e48f3fee07654cde9fa084321c2cc52c4e039 | mzp/coq-ide-for-ios | miniml.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ide-for-ios/4cdb389bbecd7cdd114666a8450ecf5b5f0391d3/CoqIDE/coq-8.2pl2/plugins/extraction/miniml.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
Convention: outmost lambda/product ... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
i $ I d : miniml.mli 13733 20... |
acf3773ed0e8c34df37deff491c4701fb17092bbbcd535bfea18ff30ce75cdeb | jaredly/reason-language-server | envaux.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/jaredly/reason-language-server/ce1b3f8ddb554b6498c2a83ea9c53a6bdf0b6081/ocaml_typing/407/envaux.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
OCaml port by and
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Env
type error =
Module_not_found of Path.t
e... |
1836f06bfb9111ece535eaf4da534fed5638fbea7c8a0967da3c7798aec65167 | haskell/hackage-server | PkgSearch.hs | # LANGUAGE OverloadedStrings , NamedFieldPuns #
module Distribution.Server.Features.Search.PkgSearch (
PkgSearchEngine,
initialPkgSearchEngine,
) where
import Distribution.Server.Features.Search.SearchEngine
import Distribution.Server.Features.Search.ExtractNameTerms
import Distribution.Server.Features.Sear... | null | https://raw.githubusercontent.com/haskell/hackage-server/8095dc0c1b5ee6dd1cc0863e0c171d1f19bef01c/src/Distribution/Server/Features/Search/PkgSearch.hs | haskell | we don't need to use extraStems here because the index is inflated by it already.
Extra stems that tend to occur with software packages
-----------------
Main experiment
print " reading file "
evaluate ( length mostFreq + length pkgs )
print " done "
print [ avgFieldLength ctx s | s < - [ ... | # LANGUAGE OverloadedStrings , NamedFieldPuns #
module Distribution.Server.Features.Search.PkgSearch (
PkgSearchEngine,
initialPkgSearchEngine,
) where
import Distribution.Server.Features.Search.SearchEngine
import Distribution.Server.Features.Search.ExtractNameTerms
import Distribution.Server.Features.Sear... |
2ceabb9cc350fff902d940af5fb351c8c34b9bb10ea3b7aa2e3ecb13e2d92200 | MarcKaufmann/congame | relax.rkt | #lang racket/base
(require
(for-syntax racket/base)
racket/contract
racket/list
koyo/haml
marionette
(except-in forms form)
congame/components/formular
congame/components/resource
congame/components/study
(prefix-in config: congame/config)
(prefix-in bot: (submod congame/components/bot actions)))
(provide
... | null | https://raw.githubusercontent.com/MarcKaufmann/congame/809c7320a4463b3032d6c9765d71bc21764d523b/congame-pjb-studies/relax.rkt | racket | Directory resource
(.info
Has to be called in a runtime context with `current-participant-id`
FIXME: Add a special error message to get for better error handling. | #lang racket/base
(require
(for-syntax racket/base)
racket/contract
racket/list
koyo/haml
marionette
(except-in forms form)
congame/components/formular
congame/components/resource
congame/components/study
(prefix-in config: congame/config)
(prefix-in bot: (submod congame/components/bot actions)))
(provide
... |
64e95da627a3d166258c7c0a01265bcf6f9297475a66af936538c01621ae7efb | opencog/learn | connector-merge-cons.scm | ;
connector-merge-cons.scm
Unit test for merging of Connectors - single connector ; 2 - cluster
;
Tests merging of two words into a single word - class .
; The focus here is to make sure that that when the words to
; be merged also appear in Connectors, that those are merged
; correctly, too. This triggers some e... | null | https://raw.githubusercontent.com/opencog/learn/e00a803620491a7df4fc0d6b3dda2879a9dcb8cb/tests/merge/connector-merge-cons.scm | scheme |
2 - cluster
The focus here is to make sure that that when the words to
be merged also appear in Connectors, that those are merged
correctly, too. This triggers some extra merge logic, beyond
the basic case.
---------------------------------------------------------------
This is similar to the "simple start-c... | connector-merge-cons.scm
Tests merging of two words into a single word - class .
Created May 2021
(use-modules (opencog) (opencog matrix))
(use-modules (opencog nlp))
(use-modules (opencog learn))
(use-modules (opencog test-runner))
(use-modules (srfi srfi-64))
(opencog-test-runner)
(load "connector-setup.scm... |
c0e80e79562fe94ea286a3f21385cb7009f2025a840b0bfd24ce47cf2782f4eb | sg2342/mirage-block-ccm | block_ccm.mli | module Make (B: Mirage_block.S) : sig
type error = [ Mirage_block.error | `Block of B.error | `DecryptError ]
type write_error = [ Mirage_block.write_error | `Block of B.write_error ]
include Mirage_block.S
with type error := error
and type write_error := write_error
val connect : ?nonce_len:int ->... | null | https://raw.githubusercontent.com/sg2342/mirage-block-ccm/4885a61ed9affee29ffd3c19a46772ef51d0cb60/lib/block_ccm.mli | ocaml | module Make (B: Mirage_block.S) : sig
type error = [ Mirage_block.error | `Block of B.error | `DecryptError ]
type write_error = [ Mirage_block.write_error | `Block of B.write_error ]
include Mirage_block.S
with type error := error
and type write_error := write_error
val connect : ?nonce_len:int ->... | |
08f56292c74d4bb06e3f5250d27ae5171f5ed0c33120eadfbda40f64dd382293 | takikawa/tr-pfds | pairing.rkt | #lang typed/racket
(provide (rename-out [heap-map map]
[heap-ormap ormap] [heap-andmap andmap])
fold filter remove Heap empty?
heap merge insert find-min/max delete-min/max sorted-list
build-heap)
(struct: (A) Tree ([elem : A]
[heaps : (Listof (IntH... | null | https://raw.githubusercontent.com/takikawa/tr-pfds/a08810bdfc760bb9ed68d08ea222a59135d9a203/pfds/heap/pairing.rkt | racket | An empty heap
Checks for empty
Insers an element into the heap
Helper for merge
A helper for delete-min/max
Deletes an element of the heap
Similar to list filter function
Similar to list remove function
similar to list map function. apply is expensive so using case-lambda
in order to saperate the more common ... | #lang typed/racket
(provide (rename-out [heap-map map]
[heap-ormap ormap] [heap-andmap andmap])
fold filter remove Heap empty?
heap merge insert find-min/max delete-min/max sorted-list
build-heap)
(struct: (A) Tree ([elem : A]
[heaps : (Listof (IntH... |
77f434448591083469bfc5fce66fa82d3fa9c3aebc8e3d173eb8854793f5408a | OCADml/OCADml | path.ml | module type S = sig
type vec
type line
type t = vec list
(** {1 Construction / Conversion} *)
* [ of_list l ]
Construct a path from a list of points [ l ] ( no - op ) .
Construct a path from a list of points [l] (no-op). *)
val of_list : vec list -> t
* [ of_seq s ]
Construct a pat... | null | https://raw.githubusercontent.com/OCADml/OCADml/14cfc751a158d5a2f53a79e71fe9bb46a0886df7/lib/path.ml | ocaml | * {1 Construction / Conversion}
* [to_list t]
Convert the path [t] to a list of points (no-op).
* [to_seq t]
Convert the path [t] to a sequence of points.
* [to_array t]
Convert the path [t] to a array of points.
* [length ?closed path]
Calculate the length (total travel distance) of the... | module type S = sig
type vec
type line
type t = vec list
* [ of_list l ]
Construct a path from a list of points [ l ] ( no - op ) .
Construct a path from a list of points [l] (no-op). *)
val of_list : vec list -> t
* [ of_seq s ]
Construct a path from a sequence of points [ s ] .
... |
0f2b5212ef3654e4325ec1e06108d32f35bc8f3a3ddfa8a7ba45de54ebf3ba1b | 40ants/reblocks | app.lisp | (uiop:define-package #:reblocks/doc/app
(:use #:cl)
(:import-from #:40ants-doc
#:defsection)
(:import-from #:reblocks/app
#:defapp
#:app
#:get-registered-apps
#:get-autostarting-apps
#:get-current
#:get... | null | https://raw.githubusercontent.com/40ants/reblocks/2283d23a44252a59b5d7bef066869d9f1e950460/src/doc/app.lisp | lisp | TODO: probably, we should move these to a separate documentation chapter
about the "rendering flow". | (uiop:define-package #:reblocks/doc/app
(:use #:cl)
(:import-from #:40ants-doc
#:defsection)
(:import-from #:reblocks/app
#:defapp
#:app
#:get-registered-apps
#:get-autostarting-apps
#:get-current
#:get... |
0a109c8edce351973692fc6c2b7c20c761b97cf6f9a797bb5ae28958fab401bf | mathematical-systems/clml | lfm.lisp | Latent Feature Model using Indian Buffet Process
(defpackage :nonparametric.lfm
(: nicknames : )
(:use :cl :nonpara.stat :hjs.util.meta
:hjs.util.matrix :hjs.util.vector
:nonparametric.dpm)
(:export :ibp
:ibp-row
:ibp-distribution
:lfm
:lfm-row
:row-weight
:lfm-distri... | null | https://raw.githubusercontent.com/mathematical-systems/clml/918e41e67ee2a8102c55a84b4e6e85bbdde933f5/nonparametric/lfm.lisp | lisp | assume (point-cluster customer) is adarray
try to add new row
extend array related to tables
this is all to do for rotation
passed customer is <struct point> !!
sample from conditional distribution
edit std
edit std
construct z+
should make new cluster
hypers-sampling -- test implementation | Latent Feature Model using Indian Buffet Process
(defpackage :nonparametric.lfm
(: nicknames : )
(:use :cl :nonpara.stat :hjs.util.meta
:hjs.util.matrix :hjs.util.vector
:nonparametric.dpm)
(:export :ibp
:ibp-row
:ibp-distribution
:lfm
:lfm-row
:row-weight
:lfm-distri... |
aef906701916cc514f586e2897d891c51d48103beb460251165f2a79a6bc7ec8 | s-expressionists/Cleavir | conditions.lisp | (in-package #:cleavir-bir)
(define-condition unused-variable (conditions:origin
conditions:program-style-warning)
((%variable :initarg :variable :reader variable)))
(define-condition type-conflict (conditions:program-warning)
((%derived-type :initarg :derived-type :reader derive... | null | https://raw.githubusercontent.com/s-expressionists/Cleavir/560dfb6b883d8d688872e1a37393ea2779879704/BIR/conditions.lisp | lisp | not the source code. So this is NOT a program-error.
Similarly, this indicates a problem in the verifier itself. | (in-package #:cleavir-bir)
(define-condition unused-variable (conditions:origin
conditions:program-style-warning)
((%variable :initarg :variable :reader variable)))
(define-condition type-conflict (conditions:program-warning)
((%derived-type :initarg :derived-type :reader derive... |
7e32e3988da2aed15ba5e91127c52ad7b23d9e8141e8cb0e82eb8a9fea58b91f | fluentpython/lispy | chap5c.scm | $ I d : chap5c.scm , v 4.0 1995/07/10 06:51:25
;;;(((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
;;; This file is part of the files that accompany the book:
LISP Implantation Semantique Programmation ( InterEditions , France )
By Christian Queinnec < >
;;; Newest version may be... | null | https://raw.githubusercontent.com/fluentpython/lispy/6b995c398e2d100fc3fc292e34ba1a00c0ae9b5a/references/LiSP-2ndEdition-2006Dec11/src/chap5c.scm | scheme | (((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
This file is part of the files that accompany the book:
Newest version may be retrieved from:
Check the README file before using this file.
(((((((((((((((((((((((((((((((( L i S P ))))))))))))))))))))))))))))))))
Scheme denotation with dynam... | $ I d : chap5c.scm , v 4.0 1995/07/10 06:51:25
LISP Implantation Semantique Programmation ( InterEditions , France )
By Christian Queinnec < >
( IP 128.93.2.54 ) ftp.inria.fr : INRIA / Projects / icsla / Books / LiSP*.tar.gz
f Fun : ( ... ) * DynEnv * Cont * Store - > Val
Cons : ... |
04a55d4e353d973f2f3ea78573de5604462c70212a569147b1166cd33c177408 | potatosalad/erlang-jose | jose_jwe_alg_dir_props.erl | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
%% vim: ts=4 sw=4 ft=erlang noet
-module(jose_jwe_alg_dir_props).
-include_lib("proper/include/proper.hrl").
% -compile(export_all).
base64url_binary() ->
?LET(Binary,
binary(),
jose_jwa_base64url:encode(Binary)).
binar... | null | https://raw.githubusercontent.com/potatosalad/erlang-jose/43d3db467f909bbc932bd663ddcb1af93180dfd3/test/property_test/jose_jwe_alg_dir_props.erl | erlang | vim: ts=4 sw=4 ft=erlang noet
-compile(export_all). | -*- mode : erlang ; tab - width : 4 ; indent - tabs - mode : 1 ; st - rulers : [ 70 ] -*-
-module(jose_jwe_alg_dir_props).
-include_lib("proper/include/proper.hrl").
base64url_binary() ->
?LET(Binary,
binary(),
jose_jwa_base64url:encode(Binary)).
binary_map() ->
?LET(List,
list({base64url_binary(), base64... |
9dd39f3c262cadfd3a8b7f229cfae875203228fd6afe150900745dc9c76e35a3 | Decentralized-Pictures/T4L3NT | registerer.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
(* ... | null | https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/src/lib_protocol_compiler/registerer.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETH... |
066af017d914d3902722fb662976e21fee6105abe71f332a3c17b3728b2fea2f | tmhedberg/xmonad.hs | xmonad.hs | {-# LANGUAGE DeriveDataTypeable, FlexibleContexts #-}
# OPTIONS_GHC -fno - warn - missing - signatures -fno - warn - type - defaults #
# OPTIONS_GHC -fno - warn - unused - binds #
import Control.Applicative ((<*>), pure)
import Control.Monad
import Data.Char
import qualified Data.Map as M
import qualified Data.Set a... | null | https://raw.githubusercontent.com/tmhedberg/xmonad.hs/6e05aa6f15ed8a75ab67fb142f1d83d53ae56f00/xmonad.hs | haskell | # LANGUAGE DeriveDataTypeable, FlexibleContexts #
Key codes
Color definitions
List of X11 window classes which should never steal focus
List of X11 window classes which should always float
Misc constants
Scratchpads
General configuration
> doFullFloat)
> doF focusDown | c <- noStealFocusWins]
> doFloat | c <- al... |
# OPTIONS_GHC -fno - warn - missing - signatures -fno - warn - type - defaults #
# OPTIONS_GHC -fno - warn - unused - binds #
import Control.Applicative ((<*>), pure)
import Control.Monad
import Data.Char
import qualified Data.Map as M
import qualified Data.Set as S
import qualified System.Environment as Env
import... |
41cbce14f8f46ad9d4ba208f8d2e86d517432dd57cbc57f617cd8599c833c83e | moby/vpnkit | test_dns.ml | open Lwt.Infix
open Slirp_stack
let src =
let src = Logs.Src.create "dns" ~doc:"Test the DNS forwarder" in
Logs.Src.set_level src (Some Logs.Debug);
src
module Log = (val Logs.src_log src : Logs.LOG)
let pp_ips = Fmt.(list ~sep:(any ", ") Ipaddr.pp)
let pp_ip4s = Fmt.(list ~sep:(any ", ") Ipaddr.V4.pp)
let ru... | null | https://raw.githubusercontent.com/moby/vpnkit/6039eac025e0740e530f2ff11f57d6d990d1c4a1/src/hostnet_test/test_dns.ml | ocaml | drop duplicates | open Lwt.Infix
open Slirp_stack
let src =
let src = Logs.Src.create "dns" ~doc:"Test the DNS forwarder" in
Logs.Src.set_level src (Some Logs.Debug);
src
module Log = (val Logs.src_log src : Logs.LOG)
let pp_ips = Fmt.(list ~sep:(any ", ") Ipaddr.pp)
let pp_ip4s = Fmt.(list ~sep:(any ", ") Ipaddr.V4.pp)
let ru... |
d37aa2ba6de873af6ad9abc4ca1a616382f6a1f24d98bf016bccf5d47257fd67 | michaelklishin/neocons | helpers.clj | Copyright ( c ) 2011 - 2015 , , and The ClojureWerkz
Team
;;
;; 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 agreei... | null | https://raw.githubusercontent.com/michaelklishin/neocons/30f30e95686a01f7a34082600bc1221877c2acbd/src/clojure/clojurewerkz/neocons/rest/helpers.clj | clojure |
The use and distribution terms for this software are covered by the
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice, or any other, from this software.
A... | Copyright ( c ) 2011 - 2015 , , and The ClojureWerkz
Team
Eclipse Public License 1.0 ( -1.0.php )
(ns clojurewerkz.neocons.rest.helpers
(:import [java.net URI URL]))
(defn extract-id
[^String location]
(let [url (URL. location)]
(Long/valueOf ^String (first (re-seq #"\d+$" (.getPath url))))))
... |
122ba82ed5f9e9f3bab16d511e26cc0f893803ad3def5d1f01db1b9d741ac7b8 | antoniogarrote/clj-s4 | project.clj | (defproject clj-s4 "0.2.1.2-SNAPSHOT"
:description "A library to build Yahoo S4 applications using Clojure"
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]
[org.springframework/spring "2.5.6"]
[bcel/bcel "5.1"]
[h... | null | https://raw.githubusercontent.com/antoniogarrote/clj-s4/5d41b327682a532e4ed4672a139676adbc775714/project.clj | clojure | (defproject clj-s4 "0.2.1.2-SNAPSHOT"
:description "A library to build Yahoo S4 applications using Clojure"
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]
[org.springframework/spring "2.5.6"]
[bcel/bcel "5.1"]
[h... | |
515eca6f37a8e764c0c06f53c857dd7abcec0d52facf73f81eaf1cfc293c3da0 | mishadoff/project-euler | problem041.clj | (ns project-euler
(:use [clojure.contrib.lazy-seqs :only (primes)])
(:use [clojure.contrib.combinatorics :only (lex-permutations)]))
(defn is-prime? [prime]
(if (= 1 prime) false
(not-any? #(zero? (rem prime %)) (take-while #(<= (* % %) prime) primes))))
(defn all-pandigital-perm []
(sort (reduce concat (... | null | https://raw.githubusercontent.com/mishadoff/project-euler/45642adf29626d3752227c5a342886b33c70b337/src/project_euler/problem041.clj | clojure | (ns project-euler
(:use [clojure.contrib.lazy-seqs :only (primes)])
(:use [clojure.contrib.combinatorics :only (lex-permutations)]))
(defn is-prime? [prime]
(if (= 1 prime) false
(not-any? #(zero? (rem prime %)) (take-while #(<= (* % %) prime) primes))))
(defn all-pandigital-perm []
(sort (reduce concat (... | |
0a1f20b870db70448b2a53ef1abd4677d3aefd3f653a70d501d8ccefc15cfa6e | stil4m/project-typo | transitions.cljs | (ns ui.main.transitions
(:require [cljs-uuid-utils.core :as uuid]))
(defn set-as-current-channel
[db [channel]]
(let [db-with-current (assoc db :current-channel (:id channel))]
(if (get-in db-with-current [:channels (:id channel)])
(assoc-in db-with-current [:channels (:id channel) :unread] 0)
db... | null | https://raw.githubusercontent.com/stil4m/project-typo/4e343934175f429c8b7870814d569f776203d461/client/ui_src/ui/main/transitions.cljs | clojure | (ns ui.main.transitions
(:require [cljs-uuid-utils.core :as uuid]))
(defn set-as-current-channel
[db [channel]]
(let [db-with-current (assoc db :current-channel (:id channel))]
(if (get-in db-with-current [:channels (:id channel)])
(assoc-in db-with-current [:channels (:id channel) :unread] 0)
db... | |
756fba9049e828875155cea092753a37aa2ac472610c28284292e7b13bc675e6 | jedisct1/siphash-erlang | siphash_tests.erl | -module(siphash_tests).
-include_lib("eunit/include/eunit.hrl").
check_vector({Key, Data, Expected}) ->
Found = siphash:hash24(Key, Data),
?assert(Found =:= Expected).
check_vectors_test_() ->
fun () ->
Vectors = [
{<<"aON1dHrq90SbG8Hx">>, <<"v7LyiwuCrB7EgAibPve6Yg2gLmggxE6j7ocR37EudrH_P9XX2rQK">>, ... | null | https://raw.githubusercontent.com/jedisct1/siphash-erlang/47f58016fdc0e2631da9747c18cbaf97eed7932d/test/siphash_tests.erl | erlang | -module(siphash_tests).
-include_lib("eunit/include/eunit.hrl").
check_vector({Key, Data, Expected}) ->
Found = siphash:hash24(Key, Data),
?assert(Found =:= Expected).
check_vectors_test_() ->
fun () ->
Vectors = [
{<<"aON1dHrq90SbG8Hx">>, <<"v7LyiwuCrB7EgAibPve6Yg2gLmggxE6j7ocR37EudrH_P9XX2rQK">>, ... | |
3e0b62b9dc2c46d60abbde20daa7548bd19b77b4d3420d971a5b9cea979c606b | ogaml/ogaml | image.ml | open OgamlMath
exception Image_error of string
type t = {width : int; height : int; data : Bytes.t}
let clamp f a b = min b (max f a)
let convert c = Char.chr (int_of_float (c *. 255.))
let inverse c = (float_of_int (Char.code c)) /. 255.
external stbi_load_from_file : string -> (string * int * int) option = "cam... | null | https://raw.githubusercontent.com/ogaml/ogaml/5e74597521abf7ba2833a9247e55780eabfbab78/src/graphics/texture/image.ml | ocaml | open OgamlMath
exception Image_error of string
type t = {width : int; height : int; data : Bytes.t}
let clamp f a b = min b (max f a)
let convert c = Char.chr (int_of_float (c *. 255.))
let inverse c = (float_of_int (Char.code c)) /. 255.
external stbi_load_from_file : string -> (string * int * int) option = "cam... | |
dbb9d02d1390a8dd6e3bcd0b0f5d46326320feca47834c7c45eaca0ab7ce4e24 | NorfairKing/dekking | Typeclass.hs | # LANGUAGE DefaultSignatures #
module Typeclass where
class ExampleClass a where
exampleString :: a -> String
default exampleString :: Show a => a -> String
exampleString = show
instance ExampleClass Int where
exampleString = show
instance ExampleClass Double
main :: IO ()
main = do
putStrLn $ exampleStr... | null | https://raw.githubusercontent.com/NorfairKing/dekking/3d3989e38584aff844cc22032bbc8a61fc53f465/e2e-test/syntax/src/Typeclass.hs | haskell | # LANGUAGE DefaultSignatures #
module Typeclass where
class ExampleClass a where
exampleString :: a -> String
default exampleString :: Show a => a -> String
exampleString = show
instance ExampleClass Int where
exampleString = show
instance ExampleClass Double
main :: IO ()
main = do
putStrLn $ exampleStr... | |
bab10c32290610b51a53731972d53ab33368c91d7e8e94bf9fc00a26efa66136 | dradtke/Lisp-Text-Editor | bind-cl-ppcre.lisp | (in-package #:metabang.bind.developer)
(defmethod bind-generate-bindings
((kind (eql :re)) variable-form value-form
body declarations remaining-bindings)
;; (:re "re" vars)
(bind (((regex &rest vars) variable-form)
(gok (gensym "ok"))
(gblock (gensym "block"))
((:values vars ignores) (bind-fix-nils ... | null | https://raw.githubusercontent.com/dradtke/Lisp-Text-Editor/b0947828eda82d7edd0df8ec2595e7491a633580/quicklisp/dists/quicklisp/software/metabang-bind-20120208-git/dev/bind-cl-ppcre.lisp | lisp | (:re "re" vars)
simple but doesn't execute inner code if no bindings found
which isn't very bind-like
(:re "re" vars)
doesn't handle ignores
(:re "re" vars) | (in-package #:metabang.bind.developer)
(defmethod bind-generate-bindings
((kind (eql :re)) variable-form value-form
body declarations remaining-bindings)
(bind (((regex &rest vars) variable-form)
(gok (gensym "ok"))
(gblock (gensym "block"))
((:values vars ignores) (bind-fix-nils vars)))
`((let ((... |
6814704797efe37fc4122f085235b91298a556a7233404aeb1b5dac27c35d1b3 | phronmophobic/dewey | util.clj | (ns com.phronemophobic.dewey.util
(:require
[clojure.string :as str]
[clojure.edn :as edn]
[clojure.java.shell :as sh]
[clojure.java.io :as io]
[slingshot.slingshot :refer [try+ throw+]])
(:import
java.nio.file.Files
java.io.PushbackReader
java.util.zip.GZIPInputStream
java.util.zip.GZIPO... | null | https://raw.githubusercontent.com/phronmophobic/dewey/6142e046ef12b496acb1defbdf7bbf27d3ac9e43/src/com/phronemophobic/dewey/util.clj | clojure | (ns com.phronemophobic.dewey.util
(:require
[clojure.string :as str]
[clojure.edn :as edn]
[clojure.java.shell :as sh]
[clojure.java.io :as io]
[slingshot.slingshot :refer [try+ throw+]])
(:import
java.nio.file.Files
java.io.PushbackReader
java.util.zip.GZIPInputStream
java.util.zip.GZIPO... | |
eabd5fc9a036a25720446eca5fda61b27cafb0bc1bad25a93c525625819793c4 | pflanze/chj-schemelib | ringbuffer.scm | Copyright 2018 by < >
;;; This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
;;; (at your option) any later version.
;; A mutated (vecto... | null | https://raw.githubusercontent.com/pflanze/chj-schemelib/59ff8476e39f207c2f1d807cfc9670581c8cedd3/ringbuffer.scm | scheme | This file is free software; you can redistribute it and/or modify
(at your option) any later version.
A mutated (vector based) ring buffer that overflows into (deletes)
the oldest entries.
clone
XX really that complex? Really return #t for empty buffers?
release for gc
^ store (Nothing) and then simplify ... | Copyright 2018 by < >
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
(require easy
Maybe
test
local-test)
(def (ringbuffer:inc wp len)
(let ((wp* (inc wp)))
(if (= wp* len)
0
... |
d01026a1b7b43313ec17c146a0a9382cae88228e038f12465b4d0d58c7dcd6f0 | zgbjgg/dasherl | dasherl_dependencies.erl | % This module is a helper to build all dash dependencies used into a
% callback decorator as a single record (erlang term).
-module(dasherl_dependencies).
-include("dasherl_dependencies.hrl").
% core
-export([input/2, output/2]).
input(Component, Event) ->
#dasherl_input_dependency{component=Component, event=E... | null | https://raw.githubusercontent.com/zgbjgg/dasherl/78c0345bded3ef263d276774fcb308976056d227/src/dasherl_dependencies.erl | erlang | This module is a helper to build all dash dependencies used into a
callback decorator as a single record (erlang term).
core |
-module(dasherl_dependencies).
-include("dasherl_dependencies.hrl").
-export([input/2, output/2]).
input(Component, Event) ->
#dasherl_input_dependency{component=Component, event=Event}.
output(Component, Event) ->
#dasherl_output_dependency{component=Component, event=Event}.
|
bb70c9d834ea5de8af9dca9c199af75308d2cb169df20424a4507a217c70b216 | haskell-mafia/mismi | Arbitrary.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - orphans #
module Test.Mismi.SQS.Core.Arbitrary where
import Data.Text as T
import Mismi.Kernel.Data
import Mismi.SQS.Core.Data
import P
import Test.Mismi.Kernel.Arbitrary (... | null | https://raw.githubusercontent.com/haskell-mafia/mismi/f6df07a52c6c8b1cf195b58d20ef109e390be014/mismi-sqs-core/test/Test/Mismi/SQS/Core/Arbitrary.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - orphans #
module Test.Mismi.SQS.Core.Arbitrary where
import Data.Text as T
import Mismi.Kernel.Data
import Mismi.SQS.Core.Data
import P
import Test.Mismi.Kernel.Arbitrary ()
import Test.QuickCheck
... |
51b6434d5145c60b51ab97c4fe5fb9790a6d7bf84e4bca040646b9827f3f8fcb | racket/plot | snip-overlay-renderers.rkt | #lang racket
(require plot racket/gui/base racket/draw rackunit)
Refactoring done as part of # 49 changed the number of init fields for the
;; 2d-plot-area%, but didn't update the overlay-renderer plot area. This unit
;; test exists to ensure that the overlay plot area is created at least once
;; during the testing... | null | https://raw.githubusercontent.com/racket/plot/c4126001f2c609e36c3aa12f300e9c673ab1a806/plot-test/plot/tests/PRs/snip-overlay-renderers.rkt | racket | 2d-plot-area%, but didn't update the overlay-renderer plot area. This unit
test exists to ensure that the overlay plot area is created at least once
during the testing process, and any initialization problems are caught
early.
An additional bug was found where the `set-overlay-renderers` would only
accept a fla... | #lang racket
(require plot racket/gui/base racket/draw rackunit)
Refactoring done as part of # 49 changed the number of init fields for the
(define snip-overlay-renderers
(test-suite
"snip-overlay-renderers"
(test-case "snip-overlay-renderers"
(define tl (new frame% [label "hello"] [width 800] [height... |
632d0d4b6567302fc10069c741704073de6f761f70518350c00f28d6c8577e88 | manuel-serrano/hop | scheme-date.scm | ;*=====================================================================*/
* serrano / prgm / project / hop / hop / js2scheme / scheme - date.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/hop/481cb10478286796addd2ec9ee29c95db27aa390/js2scheme/scheme-date.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* Scheme code generation of JavaScript Date functions. */
*===========================... | * serrano / prgm / project / hop / hop / js2scheme / scheme - date.scm * /
* Author : * /
* Creation : Thu Oct 5 05:47:06 2017 * /
* Last change : Tue Mar 10 16:09:42 2020 ( serrano ) * /
* C... |
115194513bf35dcb5208ee1755f2b8bc3ca4fe4e2bdd1348684e29e277fb9334 | portkey-cloud/aws-clj-sdk | shield.clj | (ns portkey.aws.shield (:require [portkey.aws]))
(def
endpoints
'{"us-east-1"
{:credential-scope {:service "shield", :region "us-east-1"},
:ssl-common-name "Shield.us-east-1.amazonaws.com",
:endpoint "-east-1.amazonaws.com",
:signature-version :v4}})
(comment TODO support "json")
| null | https://raw.githubusercontent.com/portkey-cloud/aws-clj-sdk/10623a5c86bd56c8b312f56b76ae5ff52c26a945/src/portkey/aws/shield.clj | clojure | (ns portkey.aws.shield (:require [portkey.aws]))
(def
endpoints
'{"us-east-1"
{:credential-scope {:service "shield", :region "us-east-1"},
:ssl-common-name "Shield.us-east-1.amazonaws.com",
:endpoint "-east-1.amazonaws.com",
:signature-version :v4}})
(comment TODO support "json")
| |
4e8995978a8c2ccf9930552d8bffb9bc26862b7fe70447d56fc453187ac835e1 | wireless-net/erlang-nommu | wxShowEvent.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2013 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Publi... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/wx/src/gen/wxShowEvent.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitatio... | Copyright Ericsson AB 2008 - 2013 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
@doc See external documentation : < a hr... |
7f9f4d8abcbbd80c9a950a98de8bd2a42f452fb93043515c68b01da24653c9d3 | ocaml-multicore/ocaml-tsan | nativeint.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-multicore/ocaml-tsan/ae9c1502103845550162a49fcd3f76276cdfa866/stdlib/nativeint.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
external neg: nativeint -> nativeint = "%nativeint_neg"
external add: nativeint -> nativeint -> nativein... |
ab1dac75600de7fe9e3b1813409b25231d54b03a24f2b9a40e8fb8d83c665c1f | deepfire/holotype | Derivatives.hs | {-# LANGUAGE Arrows #-}
# LANGUAGE DataKinds #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE GADTs #-}
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE RecordW... | null | https://raw.githubusercontent.com/deepfire/holotype/d33052f588b74616560b81616ffc4a0142f8a617/proto/Derivatives.hs | haskell | # LANGUAGE Arrows #
# LANGUAGE GADTs #
# LANGUAGE MultiWayIf #
# LANGUAGE RankNTypes #
# LANGUAGE TypeSynonymInstances #
Base imports
External imports
Local imports
| 'StructureName' enumerates a closed universe of types and associated literals.
= Graph
| Dag
| Structure
elect_presenter ∷ StructureName → Eng... | # LANGUAGE DataKinds #
# LANGUAGE ExistentialQuantification #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeFamilies #
#... |
5fc58df3b21ec07dd5b2edeb9aac1417f68841ebd43d27c06fb276ca2ae18b3f | kkazuo/horned_worm | main.ml | open Core
open Horned_worm
let app =
choose
[ meth `GET >=> choose
[ path "/" >=> text "hello, world"
; path "/cookie" >=> use_cookie >=> begin
let key = "test" in
fun next ctx ->
let v = Option.value Http_context.(cookie ctx ~key)
~default:... | null | https://raw.githubusercontent.com/kkazuo/horned_worm/c2f0902ceeae691173b2f6ba787c2122c715121e/bin/main.ml | ocaml | open Core
open Horned_worm
let app =
choose
[ meth `GET >=> choose
[ path "/" >=> text "hello, world"
; path "/cookie" >=> use_cookie >=> begin
let key = "test" in
fun next ctx ->
let v = Option.value Http_context.(cookie ctx ~key)
~default:... | |
732dee20acc16859b7a3d7c4d14075cabc8544416a3e3d6042e91cad63ead4d8 | avsm/eeww | stack.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/avsm/eeww/4d65720b5dd51376842ffe5c8c220d5329c1dc10/boot/ocaml/stdlib/stack.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
* Last - in first - out stacks .
This module implements stacks ( LIFOs ) , with in - place modifica... |
1568fe589959535acd041e5b820ec83df8fe3b13503c861343c0b2a743f31a0b | pveber/biotk | vg_text.ml | (* code adapted from vecho.ml in vg library *)
---------------------------------------------------------------------------
Copyright ( c ) 2013 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
----------------------------------------------------------------... | null | https://raw.githubusercontent.com/pveber/biotk/9e6fe7fc6fcda7fd91d4d637b66db5961a4a247e/lib/croquis/vg_text.ml | ocaml | code adapted from vecho.ml in vg library
let otfm_err_str err =
Format.flush_str_formatter ()
Font information
glyph maps
uchar maps
The font bytes.
Maps unicode scalar values to glyphs.
Maps glyph to advances in em space.
Number of units per em. | ---------------------------------------------------------------------------
Copyright ( c ) 2013 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 2013 Daniel C. Bün... |
0d96eb2472dfefdabdd1c14b41e662866d1f480914640301d10fc7d35730597f | mirage/mirage-fs-unix | kvro_fs_unix.mli |
* Copyright ( c ) 2013 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS... | null | https://raw.githubusercontent.com/mirage/mirage-fs-unix/4cc532a81264e53ce29e0fcb7259408d9f1a2aeb/src/kvro_fs_unix.mli | ocaml |
* Copyright ( c ) 2013 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS... | |
04786b0dbcfa2341cc494ea64cfb8ca2300d0c7c50735579998ab0dc1be0d83b | janestreet/universe | mib_monad.ml | module Mib(IO : Io_intf.S) : Mib_intf.S with module IO := IO = struct
module Mib = Netsnmp_raw.Mib
let netsnmp_init_mib () = IO.wrap Mib.netsnmp_init_mib ()
let shutdown_mib () = IO.wrap Mib.shutdown_mib ()
let add_mibdir dir = IO.wrap Mib.add_mibdir dir
let read_objid oid_s = IO.wrap Mib.read_objid oid_s
... | null | https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/netsnmp/src/raw_monad/mib_monad.ml | ocaml | module Mib(IO : Io_intf.S) : Mib_intf.S with module IO := IO = struct
module Mib = Netsnmp_raw.Mib
let netsnmp_init_mib () = IO.wrap Mib.netsnmp_init_mib ()
let shutdown_mib () = IO.wrap Mib.shutdown_mib ()
let add_mibdir dir = IO.wrap Mib.add_mibdir dir
let read_objid oid_s = IO.wrap Mib.read_objid oid_s
... | |
a82f7581f7620697760d393489290b282dd6b97f053af1c8ec4b6a5a7e7d0c35 | erlang/rebar3 | rebar_issue1_sup.erl | %%%-------------------------------------------------------------------
%% @doc rebar_issue1 top level supervisor.
%% @end
%%%-------------------------------------------------------------------
-module(rebar_issue1_sup).
-behaviour(supervisor).
%% API
-export([start_link/0]).
%% Supervisor callbacks
-export([init/1]... | null | https://raw.githubusercontent.com/erlang/rebar3/048412ed4593e19097f4fa91747593aac6706afb/apps/rebar/test/rebar_xref_SUITE_data/recursive/apps/rebar_issue1/src/rebar_issue1_sup.erl | erlang | -------------------------------------------------------------------
@doc rebar_issue1 top level supervisor.
@end
-------------------------------------------------------------------
API
Supervisor callbacks
====================================================================
API functions
==========================... |
-module(rebar_issue1_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(SERVER, ?MODULE).
start_link() ->
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
Child : : { Id , StartFunc , Restart , Shutdown , Type , Modules }
init([]) ->
{ok, { {one_for_all, 0, 1}, []}... |
33c2bad6fa90f13e4448533c951ba1153e01a246d901c277514e631e535682d8 | tezos/tezos-mirror | daemon.mli | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2020 Nomadic Labs < >
(* ... | null | https://raw.githubusercontent.com/tezos/tezos-mirror/31b4edf42ba936e2d8e25df7bf77b3b4d4fb5009/tezt/lib_tezos/daemon.mli | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2020 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... |
75a34c89038ea7c0da6a01eeebbc305119a98eba1f84d4463a01b9b00742c893 | AccelerateHS/accelerate-examples | Backpermute.hs | # LANGUAGE TypeOperators #
module Backpermute where
import Util
import Random
import Control.Monad
import Control.Exception
import System.Random.MWC
import Data.Array.Unboxed
import Data.Array.Accelerate as Acc
import Prelude as P
-- Tests
-- -----
reverseAcc :: Vector Float -> Acc (Vector Float)
re... | null | https://raw.githubusercontent.com/AccelerateHS/accelerate-examples/a973ee423b5eadda6ef2e2504d2383f625e49821/examples/icebox/tests/primitives/Backpermute.hs | haskell | Tests
-----
Main
----
| # LANGUAGE TypeOperators #
module Backpermute where
import Util
import Random
import Control.Monad
import Control.Exception
import System.Random.MWC
import Data.Array.Unboxed
import Data.Array.Accelerate as Acc
import Prelude as P
reverseAcc :: Vector Float -> Acc (Vector Float)
reverseAcc xs = Acc.... |
ef93789de5d07709729b71c98a4fad7ad2ab557f430184c05df84e1fe5c4914c | Clojure2D/clojure2d-examples | ray.clj | (ns rt4.the-next-week.ch04b.ray
(:require [fastmath.vector :as v]
[fastmath.core :as m]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/use-primitive-operators)
(defprotocol RayProto
(at [ray t]))
(defrecord Ray [origin direction ^double time]
RayProto
(at [_ t] (v/ad... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/ead92d6f17744b91070e6308157364ad4eab8a1b/src/rt4/the_next_week/ch04b/ray.clj | clojure | (ns rt4.the-next-week.ch04b.ray
(:require [fastmath.vector :as v]
[fastmath.core :as m]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(m/use-primitive-operators)
(defprotocol RayProto
(at [ray t]))
(defrecord Ray [origin direction ^double time]
RayProto
(at [_ t] (v/ad... | |
33f2f866af4c1de000368a1d443ab1ea9e854583213ce41ef13cfa227abd3c81 | mirage/mirage-tcpip | tcpip_stack_socket.ml |
* Copyright ( c ) 2014 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS... | null | https://raw.githubusercontent.com/mirage/mirage-tcpip/4bae5497c5ef76c1dc3532bb0e4d6ad466051c50/src/stack-unix/tcpip_stack_socket.ml | ocaml |
* Copyright ( c ) 2014 Anil Madhavapeddy < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS... | |
1114e9858d0cdd006dbc0d992a83442919b4507b093474bd4318122653c38a0f | ocsigen/ojwidgets | ojw_active_set.ml | module type T = sig
class type item = object
inherit Dom_html.element
method enable : unit Js.meth
method disable : unit Js.meth
end
class type item' = object
inherit item
method _enable : (#item Js.t, unit -> unit) Js.meth_callback Js.prop
method _disable : (#item Js.t, unit -> unit) J... | null | https://raw.githubusercontent.com/ocsigen/ojwidgets/4be2233980bdd1cae187c749bd27ddbfff389880/src/base/ojw_active_set.ml | ocaml | module type T = sig
class type item = object
inherit Dom_html.element
method enable : unit Js.meth
method disable : unit Js.meth
end
class type item' = object
inherit item
method _enable : (#item Js.t, unit -> unit) Js.meth_callback Js.prop
method _disable : (#item Js.t, unit -> unit) J... | |
50e809f5d40afd14133970b122cc0c431ceefb5c1e7221a689cef769de9455b2 | ndantam/sycamore | util.lisp | ;;;; -*- Lisp -*-
;;;;
Copyright ( c ) 2012 , Georgia Tech Research Corporation
;;;; All rights reserved.
;;;;
Author(s ): < >
Georgia Tech Humanoid Robotics Lab
Under Direction of Prof.
;;;;
;;;; This file is provided under the following "BSD-style" License:
;;;;
;;;; Redistribution and use in source a... | null | https://raw.githubusercontent.com/ndantam/sycamore/78d1e21c815f198225cbd7d2b3576eab412aaa83/src/util.lisp | lisp | -*- Lisp -*-
All rights reserved.
This file is provided under the following "BSD-style" License:
Redistribution and use in source and binary forms, with or
without modification, are permitted provided that the following
conditions are met:
* Redistributions of source code must retain the above
c... | Copyright ( c ) 2012 , Georgia Tech Research Corporation
Author(s ): < >
Georgia Tech Humanoid Robotics Lab
Under Direction of Prof.
CONTRIBUTORS " AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES ,
DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMA... |
eb6344b26ff7907e8873eb3ed4f81a4f17de1bfd5c3f8d2964421904188afe97 | neongreen/haskell-ex | Expr.hs | module Expr where
data Expr
= Number Int
| Add Expr Expr
| Sub Expr Expr
| Mul Expr Expr
| Div Expr Expr
showExpr :: Expr -> String
showExpr expr = case expr of
Number n -> if n < 0 then "(" ++ show n ++ ")" else show n
Add a b -> showExpr a ++ "+" ++ showExpr b
Sub a b -> showExpr a ++ "-" ++ form... | null | https://raw.githubusercontent.com/neongreen/haskell-ex/345115444fdf370a43390fd942e2851b9b1963ad/week3/expr/alviprofluvium/Expr.hs | haskell | module Expr where
data Expr
= Number Int
| Add Expr Expr
| Sub Expr Expr
| Mul Expr Expr
| Div Expr Expr
showExpr :: Expr -> String
showExpr expr = case expr of
Number n -> if n < 0 then "(" ++ show n ++ ")" else show n
Add a b -> showExpr a ++ "+" ++ showExpr b
Sub a b -> showExpr a ++ "-" ++ form... | |
27bae89518609fa4f32d869d4e83306c10324f39b3095d3db9d09c171e2b5d44 | agda/agda | Issue2306.hs | #!/usr/bin/env runhaskell
# LANGUAGE RecordWildCards #
import System.Directory
import RunAgda
file = "Issue2306.agda"
firstCode = unlines
[ "B : Set"
, "B = ?"
]
secondCode = unlines
[ "A : Set"
, "A = ?"
] ++
... | null | https://raw.githubusercontent.com/agda/agda/f50c14d3a4e92ed695783e26dbe11ad1ad7b73f7/test/interaction/Issue2306.hs | haskell | Create the file.
Edit the file.
Check what the type of the goal is. | #!/usr/bin/env runhaskell
# LANGUAGE RecordWildCards #
import System.Directory
import RunAgda
file = "Issue2306.agda"
firstCode = unlines
[ "B : Set"
, "B = ?"
]
secondCode = unlines
[ "A : Set"
, "A = ?"
] ++
... |
8254bec90a870870dbac23e8b40965fad4ec3e60339968d2caecab28ea8aac56 | pmundkur/flowcaml | pat_context.ml | (**************************************************************************)
(* *)
(* *)
, Projet C... | null | https://raw.githubusercontent.com/pmundkur/flowcaml/ddfa8a37e1cb60f42650bed8030036ac313e048a/src-flowcaml/types/pat_context.ml | ocaml | ************************************************************************
et en Automatique. All ri... |
, Projet Cristal , INRIA Rocquencourt
Copyright 2002 , 2003 Institut National de Recherche en Informatique
under the terms of the Q Public License version 1.0 .
$ I d : pat_context.ml , v 1.3 2003/06/... |
1190c83727adc019519ff271ebbb26dad17593bb5c68ad8520c55fb5a63b7032 | glv2/cl-monero-tools | asm-sbcl-x86-64.lisp | ;;;; This file is part of monero-tools
Copyright 2018
Distributed under the GNU GPL v3 or later .
;;;; See the file LICENSE for terms of use and distribution.
#+(and sbcl x86-64)
(defpackage :monero-tools-vm
(:use :cl :sb-c :sb-assem :sb-vm)
(:shadow #:ea)
(:import-from :sb-vm
#:descripto... | null | https://raw.githubusercontent.com/glv2/cl-monero-tools/ab972ac3a7c5489cf23e3bdaa5d390d5cff1732b/monero-tools/crypto/asm-sbcl-x86-64.lisp | lisp | This file is part of monero-tools
See the file LICENSE for terms of use and distribution. | Copyright 2018
Distributed under the GNU GPL v3 or later .
#+(and sbcl x86-64)
(defpackage :monero-tools-vm
(:use :cl :sb-c :sb-assem :sb-vm)
(:shadow #:ea)
(:import-from :sb-vm
#:descriptor-reg
#:double-reg
#:unsigned-reg
#:unsigned-num
... |
39ec7dbe4ebd159099d2db419c5540027bfb82f0a9ca8e24ff2def0a70217d0e | alpacaaa/quad-ci | Core.hs | module Core where
import qualified Codec.Serialise as Serialise
import qualified Data.Aeson as Aeson
import qualified Data.Time.Clock.POSIX as Time
import qualified Docker
import RIO
import qualified RIO.List as List
import qualified RIO.Map as Map
import qualified RIO.NonEmpty as NonEmpty
import qualified RIO.Text as... | null | https://raw.githubusercontent.com/alpacaaa/quad-ci/99175d3d0da5c03de22e3b20ae3b6ded79e40b57/src/Core.hs | haskell | ////// LOGS | module Core where
import qualified Codec.Serialise as Serialise
import qualified Data.Aeson as Aeson
import qualified Data.Time.Clock.POSIX as Time
import qualified Docker
import RIO
import qualified RIO.List as List
import qualified RIO.Map as Map
import qualified RIO.NonEmpty as NonEmpty
import qualified RIO.Text as... |
4b65a28b8578571c90af5845e7542cbed91393b0b82285773859d08fb5f63792 | froggey/Mezzano | defstruct.lisp | DEFSTRUCT .
This needs to be redone with CLOS in mind .
(in-package :mezzano.internals)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defun parse-defstruct-options (name-and-options)
(let ((name nil)
(suppress-constructors nil)
(constructors '())
(predicate-name t)
(c... | null | https://raw.githubusercontent.com/froggey/Mezzano/8552452b83aad4460a8dbcb5a778b24bdb79c8b5/system/defstruct.lisp | lisp | Standard options.
(:constructor)
Empty option, ignored.
(:constructor name)
A constructor with an explicit name and default argument list.
Disable the constructor.
(:predicate)
Empty option, ignored.
(:predicate name)
(:copier)
Empty option, ignored.
(:copier name)
(:conc-name &optional name)
(:print-obj... | DEFSTRUCT .
This needs to be redone with CLOS in mind .
(in-package :mezzano.internals)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defun parse-defstruct-options (name-and-options)
(let ((name nil)
(suppress-constructors nil)
(constructors '())
(predicate-name t)
(c... |
fb56449b02e9702b09aadb0f80b6530637db5dd49083cb2e2dc6a0c5c8bd3f1a | helium/blockchain-core | blockchain_state_channel_rejection_v1.erl | %%%-------------------------------------------------------------------
%% @doc
= = Blockchain State Channel Rejection = =
%% @end
%%%-------------------------------------------------------------------
-module(blockchain_state_channel_rejection_v1).
-export([
new/1,
encode/1, decode/1
]).
-include("blockchai... | null | https://raw.githubusercontent.com/helium/blockchain-core/ac1299a1254ff562e8f0e98fd8eff4cc55f7c54a/src/state_channel/v1/blockchain_state_channel_rejection_v1.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
------------------------------------------------------------------
------------------------------------------------------------------ | = = Blockchain State Channel Rejection = =
-module(blockchain_state_channel_rejection_v1).
-export([
new/1,
encode/1, decode/1
]).
-include("blockchain.hrl").
-include_lib("helium_proto/include/blockchain_state_channel_v1_pb.hrl").
-ifdef(TEST).
-include_lib("eunit/include/eunit.hrl").
-endif.
-type rejec... |
2bef6529024f5e41f0b1c5881e68048d9e862d4a395b71ff13f467ee95f84a92 | okeuday/pqueue | pqueue3.erl | -*-Mode : erlang;coding : utf-8;tab - width:4;c - basic - offset:4;indent - tabs - mode:()-*-
ex : set utf-8 sts=4 ts=4 sw=4 et nomod :
%%%
%%%------------------------------------------------------------------------
%%% @doc
%%% ==A Large Priority Queue.==
%%% This priority queue implementation depends on layere... | null | https://raw.githubusercontent.com/okeuday/pqueue/32bb6233e1eda782c09ca19905115abcb810d33f/src/pqueue3.erl | erlang |
------------------------------------------------------------------------
@doc
==A Large Priority Queue.==
This priority queue implementation depends on layered tuples, so that tuple
access times can be exploited for quick in/out priority queue operations
to avoid the slowness within the priority queue used by
()... | -*-Mode : erlang;coding : utf-8;tab - width:4;c - basic - offset:4;indent - tabs - mode:()-*-
ex : set utf-8 sts=4 ts=4 sw=4 et nomod :
when using 64 or more total priorities . This implementation was created
both RabbitMQ and
MIT License
Copyright ( c ) 2011 - 2020 < mjtruog at protonmail dot com >
... |
63bafe348c9680b35a743aa85b08f9043d0e74d6fbd3cad13874437fa220df20 | tonyg/racket-something | shape.rkt | #lang something // -*- sth -*-
require
something/infix
for-syntax something/base
only-in racket/math pi
racket/class
racket/draw
racket/gui/base
def-operator -> 900 left { receiver message: message receiver }
def-syntax def-protocol stx
syntax-case stx (block)
_ protocol-name (block (method arg ...... | null | https://raw.githubusercontent.com/tonyg/racket-something/4a00a9a6d37777f5aab4f28b03c53555b87e21d7/examples/shape.rkt | racket | #lang something // -*- sth -*-
require
something/infix
for-syntax something/base
only-in racket/math pi
racket/class
racket/draw
racket/gui/base
def-operator -> 900 left { receiver message: message receiver }
def-syntax def-protocol stx
syntax-case stx (block)
_ protocol-name (block (method arg ...... | |
cd9bafe7e03755185cd393f626fb0751cba36a66126944471d6bf38eeeab975b | deadpendency/deadpendency | DetermineDependencies.hs | # LANGUAGE TemplateHaskell #
module DD.Effect.DetermineDependencies.DetermineDependencies
( DetermineDependencies (..),
determineDependencies,
)
where
import Control.Effect.TH
import DD.Effect.DetermineDependencies.Model.DetermineDependenciesRequest
import DD.Effect.DetermineDependencies.Model.DetermineDepend... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/dependency-determiner/src/DD/Effect/DetermineDependencies/DetermineDependencies.hs | haskell | # LANGUAGE TemplateHaskell #
module DD.Effect.DetermineDependencies.DetermineDependencies
( DetermineDependencies (..),
determineDependencies,
)
where
import Control.Effect.TH
import DD.Effect.DetermineDependencies.Model.DetermineDependenciesRequest
import DD.Effect.DetermineDependencies.Model.DetermineDepend... | |
178ce373f787dead5e4633a3e138280c8e5ef98e85ebf5d2c31d5438d2bc6ee7 | MaskRay/CamlFeatherweight | location.ml | let input_chan = ref stdin
let output_loc oc input seek (pos1,pos2) =
let rec move_to pos topos line line_pos =
if pos >= topos then
pos, line, line_pos
else
try
let c = input() in
if c = '\n' then
move_to (pos+1) topos (line+1) (pos+1)
else
move_to (po... | null | https://raw.githubusercontent.com/MaskRay/CamlFeatherweight/989319a830dcf1ae30a4b4ccefb59f73bf966363/location.ml | ocaml | let input_chan = ref stdin
let output_loc oc input seek (pos1,pos2) =
let rec move_to pos topos line line_pos =
if pos >= topos then
pos, line, line_pos
else
try
let c = input() in
if c = '\n' then
move_to (pos+1) topos (line+1) (pos+1)
else
move_to (po... | |
f14dbf97bddfe522218f7a1d9939234fd411a5ed1b8bb8f58eb4629126c8681e | mzp/coq-ruby | translate.ml | open Names;;
open Sign;;
open Util;;
open Term;;
open Pp;;
open Libobject;;
open Library;;
open Vernacinterp;;
open Tacmach;;
open Pfedit;;
open Parsing;;
open Evd;;
open Evarutil;;
open Xlate;;
open Vtp;;
open Ascent;;
open Environ;;
open Proof_type;;
(*translates a formula into a centaur-tree --> FORMULA *)
let tra... | null | https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/contrib/interface/translate.ml | ocaml | translates a formula into a centaur-tree --> FORMULA
translates a named_context into a centaur-tree --> PREMISES_LIST
this code is inspired from printer.ml (function pr_named_context_of)
translates an int list into a centaur-tree --> SIGNED_INT_LIST
translates a path and a goal into a centaur-tree --> RULE | open Names;;
open Sign;;
open Util;;
open Term;;
open Pp;;
open Libobject;;
open Library;;
open Vernacinterp;;
open Tacmach;;
open Pfedit;;
open Parsing;;
open Evd;;
open Evarutil;;
open Xlate;;
open Vtp;;
open Ascent;;
open Environ;;
open Proof_type;;
let translate_constr at_top env c =
xlate_formula (Constrextern... |
db16d948540ee0e6404e943f5f6ce309bcb3807eb3f451c506e32a1b7d3339cb | grin-compiler/ghc-wpc-sample-programs | TCP.hs | {-# LANGUAGE TypeSynonymInstances #-}
-----------------------------------------------------------------------------
-- |
-- Module : Network.TCP
-- Copyright : See LICENSE file
License : BSD
--
-- Maintainer : Ganesh Sittampalam <>
-- Stability : experimental
-- Portability : non-portable (not t... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/HTTP-4000.3.14/Network/TCP.hs | haskell | # LANGUAGE TypeSynonymInstances #
---------------------------------------------------------------------------
|
Module : Network.TCP
Copyright : See LICENSE file
Maintainer : Ganesh Sittampalam <>
Stability : experimental
Portability : non-portable (not tested)
for internal use by the @Network.H... | License : BSD
Some utility functions for working with the Haskell @network@ package . Mostly
module Network.TCP
( Connection
, EndPoint(..)
, openTCPPort
, isConnectedTo
, openTCPConnection
, socketConnection
, isTCPConnectedTo
, HandleStream
, HStream(..)
, StreamHooks... |
f1767209befb5700857c978db5b1cd6291deea77ec20fd4237fcfaee00a009f4 | stritzinger/opcua | opcua_keychain_ets.erl | -module(opcua_keychain_ets).
-behavior(opcua_keychain).
%%% INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-include("opcua.hrl").
-include("opcua_internal.hrl").
-include_lib("public_key/include/public_key.hrl").
%%% EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%... | null | https://raw.githubusercontent.com/stritzinger/opcua/225f5edc11a3a1f335d4a33e25d5d365a7b46a1f/src/opcua_keychain_ets.erl | erlang | INCLUDES %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
EXPORTS %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
API functions
Behaviour opcua_keychain callback functions
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %... | -module(opcua_keychain_ets).
-behavior(opcua_keychain).
-include("opcua.hrl").
-include("opcua_internal.hrl").
-include_lib("public_key/include/public_key.hrl").
-export([new/0, new/1]).
-export([init/1]).
-export([shareable/1]).
-export([lookup/3]).
-export([info/2]).
-export([certificate/3]).
-export([public_... |
2407816ba323040bebfdcd44f2e62863e2e9732ee6ec39aab9783f45324816c6 | sebastiaanvisser/ghc-goals | Dep.hs | module Dep where
test :: [(Char, Integer)]
test = undefined $ zip "Monkey!" [1..]
| null | https://raw.githubusercontent.com/sebastiaanvisser/ghc-goals/cf256c99c4b7e3b569bab3e6c10f0903a7c1eac4/tests/Dep.hs | haskell | module Dep where
test :: [(Char, Integer)]
test = undefined $ zip "Monkey!" [1..]
| |
1fd20797f9a190565f3b78f67bc0945ea3c11d91e5fcc07dce613dbd92e76df0 | roswell/roswell | use-asdf.lisp | (defpackage :roswell.use.asdf
(:use :cl :roswell.util))
(in-package :roswell.use.asdf)
(defun asdf (impl version &rest r)
(declare (ignore r impl))
(cond
((null version)
(let ((s *error-output*)
(asdf (config "asdf.version")))
(format s (if (zerop (length asdf))
"A... | null | https://raw.githubusercontent.com/roswell/roswell/0107dfb54393aff1a776deb79d58f67f642135cb/lisp/use-asdf.lisp | lisp | (defpackage :roswell.use.asdf
(:use :cl :roswell.util))
(in-package :roswell.use.asdf)
(defun asdf (impl version &rest r)
(declare (ignore r impl))
(cond
((null version)
(let ((s *error-output*)
(asdf (config "asdf.version")))
(format s (if (zerop (length asdf))
"A... | |
742bbaaf0aa1007a882e3005ae272e9842c86fe037cd60a2a62de571160ed799 | realworldocaml/book | dune_file.mli | * Representation and parsing of Dune files
open Import
module Lint : sig
type t = Preprocess.Without_instrumentation.t Preprocess.Per_module.t
val no_lint : t
end
type for_ =
| Executable
| Library of Wrapped.t option
module Lib_deps : sig
type nonrec t = Lib_dep.t list
val of_pps : Lib_name.t list ->... | null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/dune_/src/dune_rules/dune_file.mli | ocaml | * [preprocess] and [preprocessor_deps] fields
* Check if the buildable has any foreign stubs or archives.
* Full public name
* Package it is part of
* Check if the library has any foreign stubs or archives.
* The list of all foreign archives, including the foreign stubs archive.
* The [lib*.a] files of all foreig... | * Representation and parsing of Dune files
open Import
module Lint : sig
type t = Preprocess.Without_instrumentation.t Preprocess.Per_module.t
val no_lint : t
end
type for_ =
| Executable
| Library of Wrapped.t option
module Lib_deps : sig
type nonrec t = Lib_dep.t list
val of_pps : Lib_name.t list ->... |
d34a420b98a51ed354275fcf2fd0592e61ef254d43dd6b2d4f83bdc041c7d6eb | DeaR/xl-git | version.lisp | -*- mode : lisp ; package : xl - git ; encoding : shift_jis -*-
@name xl - git / version.lisp
@description A front - end for git in xyzzy .
;; @namespace /
;; @author DeaR
@timestamp < 2012 - 05 - 23 16:05:38 DeaR >
Copyright ( c ) 2012 DeaR < >
;;
;; Permission is hereby granted, free of... | null | https://raw.githubusercontent.com/DeaR/xl-git/ae9da0ee87f45f51569bd31c475f622ebc32e42b/site-lisp/xl-git/version.lisp | lisp | package : xl - git ; encoding : shift_jis -*-
@namespace /
@author DeaR
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copie... |
@name xl - git / version.lisp
@description A front - end for git in xyzzy .
@timestamp < 2012 - 05 - 23 16:05:38 DeaR >
Copyright ( c ) 2012 DeaR < >
the Software without restriction , including without limitation the rights to
the Software , and to permit persons to whom the Software is furni... |
af1ade38670a564a2ae5f930b57c3b9a4b131c8feabe7cecd8d3f94499382217 | tnelson/Forge | testing-test.rkt | #lang forge/core
(sig A)
(test my-test #:preds [(some A)]
#:scope ([A 1 4])
#:expect sat)
(check my-check #:preds [(some A)]
#:scope ([A 1 4]))
| null | https://raw.githubusercontent.com/tnelson/Forge/1687cba0ebdb598c29c51845d43c98a459d0588f/forge/example/forge-core/testing-test.rkt | racket | #lang forge/core
(sig A)
(test my-test #:preds [(some A)]
#:scope ([A 1 4])
#:expect sat)
(check my-check #:preds [(some A)]
#:scope ([A 1 4]))
| |
bcf3045707857447aa3e275522d83215346f7b2c75691e881a3aa297c875009c | froggey/Mezzano | constructor.lisp | (in-package :mezzano.clos)
(defmacro with-before-and-after-methods ((applicable-methods &rest apply-arguments) &body body)
`(progn
;; Before methods.
,@(loop
for method in (remove-if-not #'before-method-p applicable-methods)
collect `(apply ',(method-fast-function method '() '()) ,@appl... | null | https://raw.githubusercontent.com/froggey/Mezzano/f0eeb2a3f032098b394e31e3dfd32800f8a51122/system/clos/constructor.lisp | lisp | Before methods.
After methods.
This could bail out & just return the effective method.
Allocate the instance.
Slots can be bound early by :before methods on initialize-instance or shared-initialize.
See 7.1.5 Shared-Initialize
TODO: It would be nice to use the &KEY machinery for this.
Many initargs for this slo... | (in-package :mezzano.clos)
(defmacro with-before-and-after-methods ((applicable-methods &rest apply-arguments) &body body)
`(progn
,@(loop
for method in (remove-if-not #'before-method-p applicable-methods)
collect `(apply ',(method-fast-function method '() '()) ,@apply-arguments))
(mult... |
a588be8ec764295601ad60d1df546b9d4c7956b505cb6958391adaee3fefe7eb | pingles/bandit | project.clj | (defproject bandit/bandit "0.2.1-SNAPSHOT"
:description "Multi-armed bandit testing"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:plugins [[lein-sub "0.3.0"]]
:min-lein-version "2.0.0"
:sub ["bandit-core" "bandit-simulate" "bandit-ring"])
| null | https://raw.githubusercontent.com/pingles/bandit/795666f3938e28f389691094bb1e07e4202290f6/project.clj | clojure | (defproject bandit/bandit "0.2.1-SNAPSHOT"
:description "Multi-armed bandit testing"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:plugins [[lein-sub "0.3.0"]]
:min-lein-version "2.0.0"
:sub ["bandit-core" "bandit-simulate" "bandit-ring"])
| |
9e2b8d49118634b0ee85731988893caa85579bd79db0cda0778f15fdf112933b | generateme/fastmath | protocols.clj | (ns fastmath.protocols
"Set of protocols for fastmath.
Includes:
* random generator protocol
* distribution protocols
* vector protocol"
(:refer-clojure :exclude [abs]))
(defprotocol RNGProto
"Defines set of random functions for different RNGs or distributions returning primitive values."
(irandom [r... | null | https://raw.githubusercontent.com/generateme/fastmath/6a828ce7edbdf24490e50353e3d5d7e3a7dc01b0/src/fastmath/protocols.clj | clojure | vector | (ns fastmath.protocols
"Set of protocols for fastmath.
Includes:
* random generator protocol
* distribution protocols
* vector protocol"
(:refer-clojure :exclude [abs]))
(defprotocol RNGProto
"Defines set of random functions for different RNGs or distributions returning primitive values."
(irandom [r... |
aa7f4f94d135168231bbb70a73fdb6e61bfd5a9b87320c425118a500afac8c8f | lambdaisland/cljbox2d | clojure2d.clj | (ns lambdaisland.cljbox2d.clojure2d
"Glue code to enable drawing via `clojure2d` library.
The main difference from `quil` is that `canvas` context should be provided explicitely.
Contract for a custom `draw` function should accept a canvas as the last parameter."
(:require [lambdaisland.cljbox2d :as b]
... | null | https://raw.githubusercontent.com/lambdaisland/cljbox2d/a82a6dd7a5cdb86bfa8ef81ff4d8a82cf9f5709f/src/lambdaisland/cljbox2d/clojure2d.clj | clojure | Vec2 is not seqable... | (ns lambdaisland.cljbox2d.clojure2d
"Glue code to enable drawing via `clojure2d` library.
The main difference from `quil` is that `canvas` context should be provided explicitely.
Contract for a custom `draw` function should accept a canvas as the last parameter."
(:require [lambdaisland.cljbox2d :as b]
... |
d1fa830b8b8ca1d1d3344bebdc908f19278707f2613e965acccdd31bccf07c4b | haskell-numerics/hmatrix | Expint.hs | # LANGUAGE CPP #
------------------------------------------------------------
-- |
Module : Numeric . GSL.Special .
Copyright : ( c ) 2006 - 11
-- License : GPL
Maintainer : ( aruiz at um dot es )
-- Stability : provisional
-- Portability : uses ffi
--
-- Wrappers for selected funct... | null | https://raw.githubusercontent.com/haskell-numerics/hmatrix/2694f776c7b5034d239acb5d984c489417739225/packages/special/lib/Numeric/GSL/Special/Expint.hs | haskell | ----------------------------------------------------------
|
License : GPL
Stability : provisional
Portability : uses ffi
Wrappers for selected functions described at:
<>
---------------------------------------------------------- | # LANGUAGE CPP #
Module : Numeric . GSL.Special .
Copyright : ( c ) 2006 - 11
Maintainer : ( aruiz at um dot es )
module Numeric.GSL.Special.Expint(
expint_E1_e
, expint_E1
, expint_E2_e
, expint_E2
, expint_En_e
, expint_En
, expint_E1_scaled_e
, expint_E1_scaled
, expint_E2_scaled_e
, e... |
29174d08b462ac1457af11d1eebd68704bb05c901a96f137944b5fcde8b66939 | ChillkroeteTTS/fischer | prometheus_reporter.clj | (ns fischer.reporter.prometheus-reporter
(:require [com.stuartsierra.component :as cp]
[de.otto.goo.goo :as goo]
[fischer.reporter.prediction-reporter :as r]
[compojure.core :as cpj]
[ring.util.response :as resp]))
(defonce ad_gauge (goo/register-gauge! :fischer/anomal... | null | https://raw.githubusercontent.com/ChillkroeteTTS/fischer/2f479ac0d410f536f5bd89659d7f69113422784a/src/clj/fischer/reporter/prometheus_reporter.clj | clojure | (ns fischer.reporter.prometheus-reporter
(:require [com.stuartsierra.component :as cp]
[de.otto.goo.goo :as goo]
[fischer.reporter.prediction-reporter :as r]
[compojure.core :as cpj]
[ring.util.response :as resp]))
(defonce ad_gauge (goo/register-gauge! :fischer/anomal... | |
c1ae64c6463e33fc5e9eecf8515ab4361045b6b738327b6ec7f79e73b04014ed | ceejsmith/distributed-erlang | server_http.erl | -module(server_http).
-export([start/0]).
This server only stays alive for one connection , but this is OK for demonstration in a modern
browser , since HTTP 1.1 keeps the connection open for multiple requests .
start() ->
{ok, Listen} = gen_tcp:listen(2345, [ binary
, ... | null | https://raw.githubusercontent.com/ceejsmith/distributed-erlang/1664c21e6d28a11497ac64bc3534b2a73734b545/server_http.erl | erlang | -module(server_http).
-export([start/0]).
This server only stays alive for one connection , but this is OK for demonstration in a modern
browser , since HTTP 1.1 keeps the connection open for multiple requests .
start() ->
{ok, Listen} = gen_tcp:listen(2345, [ binary
, ... | |
4fe495677a807b96ff9d232023cbab456703d5d5763809d5b938941ec005da8b | mbj/stratosphere | ManagedRuleGroupConfigProperty.hs | module Stratosphere.WAFv2.WebACL.ManagedRuleGroupConfigProperty (
module Exports, ManagedRuleGroupConfigProperty(..),
mkManagedRuleGroupConfigProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Strat... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/wafv2/gen/Stratosphere/WAFv2/WebACL/ManagedRuleGroupConfigProperty.hs | haskell | # SOURCE #
# SOURCE # | module Stratosphere.WAFv2.WebACL.ManagedRuleGroupConfigProperty (
module Exports, ManagedRuleGroupConfigProperty(..),
mkManagedRuleGroupConfigProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.Resourc... |
fa9a39bc0049ef73c7d3ff4578fb7483cf5905b951f7f57b4eec630a856944e5 | jpmonettas/flow-storm-debugger | build.clj | (ns build
(:require [clojure.tools.build.api :as b]
[clojure.string :as str]
[clojure.java.io :as io]
[rewrite-clj.zip :as z]
[clojure.spec.alpha :as s]))
(def flow-storm-ns-tag "FLOWNS")
(def class-dir "target/classes")
(defn clean [_]
(b/delete {:path "target"}))
... | null | https://raw.githubusercontent.com/jpmonettas/flow-storm-debugger/571b3727412efd7879d4d30ee3be459248de38d3/build.clj | clojure | Assumes `zloc` is pointing to a (:require ...) or (:import ...) form
kind of hacky, but the inst api needs a couple of defs to be modified
find (def debugger-trace-processor-ns 'flow-storm.debugger.trace-processor)
find (def debugger-main-ns 'flow-storm.debugger.main)
go back to ns form
kind of hacky, but the dbg... | (ns build
(:require [clojure.tools.build.api :as b]
[clojure.string :as str]
[clojure.java.io :as io]
[rewrite-clj.zip :as z]
[clojure.spec.alpha :as s]))
(def flow-storm-ns-tag "FLOWNS")
(def class-dir "target/classes")
(defn clean [_]
(b/delete {:path "target"}))
... |
24ca434e994f36fb36456381f281ce617909e3134af0349e235ec3f41a5aba3b | CarlosMChica/HaskellBook | chapterExercises.hs | module ChapterExercises where
stops = "pbtdkg"
vowels = "aeiou"
stopVowelStop :: [(Char, Char, Char)]
stopVowelStop = [(s, v, s') | s <- stops , v <- vowels , s' <- stops]
stopVowelStop' :: [(Char, Char, Char)]
stopVowelStop' = [(s, v, s') | s <- stops , v <- vowels , s' <- stops , s == 'p']
nouns = ["house", "tabl... | null | https://raw.githubusercontent.com/CarlosMChica/HaskellBook/86f82cf36cd00003b1a1aebf264e4b5d606ddfad/chapter10/chapterExercises.hs | haskell | module ChapterExercises where
stops = "pbtdkg"
vowels = "aeiou"
stopVowelStop :: [(Char, Char, Char)]
stopVowelStop = [(s, v, s') | s <- stops , v <- vowels , s' <- stops]
stopVowelStop' :: [(Char, Char, Char)]
stopVowelStop' = [(s, v, s') | s <- stops , v <- vowels , s' <- stops , s == 'p']
nouns = ["house", "tabl... | |
e6fc9ec194575dd1565317ca6972d7c49f2f651252fb6bac9d43756cabb57561 | helium/erlang-libp2p | libp2p_swarm.erl | -module(libp2p_swarm).
-export([start/1, start/2, stop/1, is_stopping/1, swarm/1, tid/1,
opts/1, name/1, pubkey_bin/1, p2p_address/1, keys/1,
network_id/2, network_id/1,
store_peerbook/2, peerbook/1, peerbook_pid/1, cache/1, sessions/1,
dial/3, dial/5, connect/2, connect/4,
... | null | https://raw.githubusercontent.com/helium/erlang-libp2p/98b997faccd4bfefa092d2e42c7676231996f87a/src/libp2p_swarm.erl | erlang | @doc Starts a swarm with a given name. This starts a swarm with no
listeners. The swarm name is used to distinguish the data folder
for the swarm from other started swarms on the same node.
a swarm with no listeners. The options can be used to configure and
control behavior of various subsystems of the swarm.
@do... | -module(libp2p_swarm).
-export([start/1, start/2, stop/1, is_stopping/1, swarm/1, tid/1,
opts/1, name/1, pubkey_bin/1, p2p_address/1, keys/1,
network_id/2, network_id/1,
store_peerbook/2, peerbook/1, peerbook_pid/1, cache/1, sessions/1,
dial/3, dial/5, connect/2, connect/4,
... |
759920d79a6e1cebe06128d44d63b901ba83e1989aae7e01fbe5fe92bb8e205f | jeapostrophe/exp | terminate-unless.rkt | #lang racket/base
(define (kill-unless-sema-after-secs t sema secs)
(thread
(λ ()
(sync sema
(handle-evt (alarm-evt (+ (current-inexact-milliseconds)
(* 1000 secs)))
(λ _
(kill-thread t)))))))
(module+ main
(de... | null | https://raw.githubusercontent.com/jeapostrophe/exp/43615110fd0439d2ef940c42629fcdc054c370f9/terminate-unless.rkt | racket | xxx do stuff | #lang racket/base
(define (kill-unless-sema-after-secs t sema secs)
(thread
(λ ()
(sync sema
(handle-evt (alarm-evt (+ (current-inexact-milliseconds)
(* 1000 secs)))
(λ _
(kill-thread t)))))))
(module+ main
(de... |
eb9b85f857a7d7e097643c4d3d1fbefafdef0e539c963e52b6a6ff5ff27e200b | skanev/playground | 07.scm | SICP exercise 2.07
;
's program is incomplete because she has not specified the
; implementation of the interval abstraction. Here is a definition of the
; interval constructor:
;
; (define (make-interval a b) (cons a b))
;
; Define selectors upper-bound and lower-bound to complete the implementation.
(define (ma... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/02/07.scm | scheme |
implementation of the interval abstraction. Here is a definition of the
interval constructor:
(define (make-interval a b) (cons a b))
Define selectors upper-bound and lower-bound to complete the implementation. | SICP exercise 2.07
's program is incomplete because she has not specified the
(define (make-interval a b)
(cons a b))
(define (upper-bound interval)
(cdr interval))
(define (lower-bound interval)
(car interval))
|
b8b612a0a449f564737ddf08de08e9fc797fe40ff6fd66682b60322e0fa64a4a | tmattio/js-bindings | node_os.mli | [@@@ocaml.warning "-7-11-32-33-39"]
[@@@js.implem [@@@ocaml.warning "-7-11-32-33-39"]]
open Es2020
open Node_globals
module AnonymousInterface0 : sig
type t
val t_to_js : t -> Ojs.t
val t_of_js : Ojs.t -> t
val get_encoding : t -> BufferEncoding.t [@@js.get "encoding"]
val set_encoding : t -> BufferEnc... | null | https://raw.githubusercontent.com/tmattio/js-bindings/ca3bd6a12db519c8de7f41b303f14cf70cfd4c5f/lib/node/node_os.mli | ocaml | FIXME: unknown type '{ [key in Signals]: number; }' | [@@@ocaml.warning "-7-11-32-33-39"]
[@@@js.implem [@@@ocaml.warning "-7-11-32-33-39"]]
open Es2020
open Node_globals
module AnonymousInterface0 : sig
type t
val t_to_js : t -> Ojs.t
val t_of_js : Ojs.t -> t
val get_encoding : t -> BufferEncoding.t [@@js.get "encoding"]
val set_encoding : t -> BufferEnc... |
be05c1743e579c5b2e2ce840468c7de7897a127c6399579c6b678496fc9e1f74 | quil-lang/quilc | perm.lisp | ;;;; perm.lisp
;;;;
Author : ( in collab with )
;;;;
(in-package #:cl-quil.clifford)
;;; This files deals with the permutation group representation of the
Clifford group .
;;;
;;; The permutation group representation is a direct consequence of
the definition of the group . Namely , the group
is the set ... | null | https://raw.githubusercontent.com/quil-lang/quilc/3f3260aaa65cdde25a4f9c0027959e37ceef9d64/src/clifford/perm.lisp | lisp | perm.lisp
This files deals with the permutation group representation of the
The permutation group representation is a direct consequence of
-i*P, +I, -I!
{I, -I} U { p : p has phase +i or -i }.
these in the integer representation of a Pauli.
The 2*(2 + i) and x/2 - 2 are to convert in/out from integers
... | Author : ( in collab with )
(in-package #:cl-quil.clifford)
Clifford group .
the definition of the group . Namely , the group
is the set of unitaries which stabilize the Pauli group under
conjugation . As such , we can just look at how a group
element permutes the group , and construct an isomorph... |
9f415060888e36dab4c11873465e295e1f7e5f46d08b08db6df0d403fb28ff4f | nuprl/gradual-typing-performance | heatmap.rkt | #lang racket/base
Construct a " heatmap " from the lattice data
(require racket/class
racket/cmdline
racket/draw
racket/match
racket/math
racket/vector
data/bit-vector
math/number-theory
math/statistics
pict
unstable/gui/pict)... | null | https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/tools/heatmap.rkt | racket | some of this code stolen from lattice code
tried a reciprocal scale here, looked too "smushed" at high end
we can't plot speedups with this, so cap it
FIXME: that is misleading, so we should think about how to do that
FIXME: proportions are sometimes bigger than 1 due to log, is the
reciprocal scale better... | #lang racket/base
Construct a " heatmap " from the lattice data
(require racket/class
racket/cmdline
racket/draw
racket/match
racket/math
racket/vector
data/bit-vector
math/number-theory
math/statistics
pict
unstable/gui/pict)... |
c56ff8ca239fec5f436a7887a9abb5dd2e066973beb6f11fc6f8de23fe40dda6 | cryptosense/pkcs11 | pkcs11_CK_ATTRIBUTE_SET.mli | val set_access_error : Pkcs11_CK_ATTRIBUTE.t -> unit
* Functions to populate a CK_ATTRIBUTE.t in the way of getAttributeValue .
Populate the given t with the given value .
- if value is none , then ulValueLen will be -1 .
- if value exist but buffer is too small , ulValueLen will be value size
... | null | https://raw.githubusercontent.com/cryptosense/pkcs11/93c39c7a31c87f68f0beabf75ef90d85a782a983/driver/pkcs11_CK_ATTRIBUTE_SET.mli | ocaml | val set_access_error : Pkcs11_CK_ATTRIBUTE.t -> unit
* Functions to populate a CK_ATTRIBUTE.t in the way of getAttributeValue .
Populate the given t with the given value .
- if value is none , then ulValueLen will be -1 .
- if value exist but buffer is too small , ulValueLen will be value size
... | |
3043861a71123f4f490276b96462bd4d008d8f849a8b66d5fa144d708124b912 | arttuka/reagent-material-ui | broadcast_on_personal_rounded.cljs | (ns reagent-mui.icons.broadcast-on-personal-rounded
"Imports @mui/icons-material/BroadcastOnPersonalRounded as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def ... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/icons/reagent_mui/icons/broadcast_on_personal_rounded.cljs | clojure | (ns reagent-mui.icons.broadcast-on-personal-rounded
"Imports @mui/icons-material/BroadcastOnPersonalRounded as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def ... | |
08134b80e031cd6d9b4041df9f369c55689223acdca17da3a83a23b44df298e8 | startalkIM/ejabberd | ejabberd_config.erl | %%%----------------------------------------------------------------------
%%% File : ejabberd_config.erl
Author : < >
%%% Purpose : Load config file
Created : 14 Dec 2002 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne
%%%
%%% This program is free software; you can redistribute it a... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/src/ejabberd_config.erl | erlang | ----------------------------------------------------------------------
File : ejabberd_config.erl
Purpose : Load config file
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITH... | Author : < >
Created : 14 Dec 2002 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
... |
e9e921939b3faf5e9889e86c5bcc18a5ef65f378ea3dbe25991713695ade0b98 | jchavarri/rebind | docstrings.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/jchavarri/rebind/ccfa1725ff5b16574daf4d0044c49dbf719aa105/vendor/ocaml/parsing/docstrings.ml | ocaml | *********************************************************************
OCaml
... |
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
open Location
Docstrings
A docst... |
b11ea87ef9795313af152aee26bc5001cf470f4272e92622f0d5dfebd3a4999a | SnootyMonkey/clj-json-ld | context.clj | (ns clj-json-ld.unit.context
"
Test the context processing as defined here: -ld-api/#context-processing-algorithm
"
(:require [clojure.string :as s]
[midje.sweet :refer :all]
[clj-json-ld.json-ld :as json-ld]
[clj-json-ld.context :refer (update-with-local-context)]
... | null | https://raw.githubusercontent.com/SnootyMonkey/clj-json-ld/3505dbfaeb331c3535d6891a9551e72282e64696/test/clj_json_ld/unit/context.clj | clojure | 14.x
(fact "and the term's prefix has a term definition in the local context"
(update-with-local-context active-context {"a" {"@id" "a:a"}}) => | (ns clj-json-ld.unit.context
"
Test the context processing as defined here: -ld-api/#context-processing-algorithm
"
(:require [clojure.string :as s]
[midje.sweet :refer :all]
[clj-json-ld.json-ld :as json-ld]
[clj-json-ld.context :refer (update-with-local-context)]
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.