_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 |
|---|---|---|---|---|---|---|---|---|
381ed92d6672321d3ce5968fabb4328c3219f9cb86392c1f3bf8efafd8925244 | Idorobots/spartan | gen.rkt | #lang racket
;; Generators
(require "../src/compiler/utils/utils.rkt")
(require "../src/compiler/utils/set.rkt")
(require "../src/compiler/ast.rkt")
(require (only-in "../src/compiler/passes/bindings.rkt"
compute-complexity))
(provide (all-defined-out))
(define (sample gen rand)
(if (procedure? ... | null | https://raw.githubusercontent.com/Idorobots/spartan/ef3b032906655585d284f1c9a33a58f1e35cb180/test/gen.rkt | racket | Generators
NOTE To avoid generating huge objects. | #lang racket
(require "../src/compiler/utils/utils.rkt")
(require "../src/compiler/utils/set.rkt")
(require "../src/compiler/ast.rkt")
(require (only-in "../src/compiler/passes/bindings.rkt"
compute-complexity))
(provide (all-defined-out))
(define (sample gen rand)
(if (procedure? gen)
(ge... |
cfebdb95e1677d97dd33e7f0976792cf6f3a455b341d8907eacafe8eb5064ebf | alanzplus/EOPL | 1.33.rkt | #lang eopl
(require "1.31.rkt")
(define mark-leaves-with-red-depth
(lambda (tree)
(auxi tree 0)))
(define auxi
(lambda (tree red-depth)
(cond
((null? tree) '())
((leaf? tree) (leaf red-depth))
((eqv? (contents-of tree) 'red)
(interior-node
(contents-of tree)
... | null | https://raw.githubusercontent.com/alanzplus/EOPL/d7b06392d26d93df851d0ca66d9edc681a06693c/EOPL/ch1/1.33.rkt | racket | #lang eopl
(require "1.31.rkt")
(define mark-leaves-with-red-depth
(lambda (tree)
(auxi tree 0)))
(define auxi
(lambda (tree red-depth)
(cond
((null? tree) '())
((leaf? tree) (leaf red-depth))
((eqv? (contents-of tree) 'red)
(interior-node
(contents-of tree)
... | |
a930e00bfc54b6236e0b307f9dde9cd10c2c5dbe3da2b975560f3efe52992a58 | tonymorris/fp-course | Alternative.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE InstanceSigs #
# LANGUAGE RebindableSyntax #
module Course.Alternative where
import Course.Applicative
import Course.Core
import Course.Functor
import Course.List
import Course.Optional
import Course.Parser
import qualified Prelude as P(fmap, ... | null | https://raw.githubusercontent.com/tonymorris/fp-course/cc5f5070de355e9b0b13b32316e27d1efc951ef0/src/Course/Alternative.hs | haskell | These laws are not checked by the compiler. These laws are given as:
* The law of left identity
* The law of right identity
* The law of associativity
`∀u v w. u <|> (v <|> w) = (u <|> v) <|> w`
You may notice that these are the same laws as Monoid. An alternative
can be considered a "monoid on applicative... | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE InstanceSigs #
# LANGUAGE RebindableSyntax #
module Course.Alternative where
import Course.Applicative
import Course.Core
import Course.Functor
import Course.List
import Course.Optional
import Course.Parser
import qualified Prelude as P(fmap, ... |
24af4fc9ce27da8634a29c9fed39db4b952ac3f8a73f89971b44aa48c9805f51 | hauleth/enough | enough_SUITE.erl | -module(enough_SUITE).
-export([all/0]).
-export([
pings_back/1,
get_pid/1,
get_ref/1,
overload/1,
stopping/1,
kill_on_choked/1
]).
-include_lib("stdlib/include/assert.hrl").
-include_lib("common_test/include/ct.hrl").
-include_lib("syntax_tools/include/merl.hrl").
all() ->
[
pin... | null | https://raw.githubusercontent.com/hauleth/enough/9192c78343f59711ed9e26589b1f6350bcc815d5/test/enough_SUITE.erl | erlang | -module(enough_SUITE).
-export([all/0]).
-export([
pings_back/1,
get_pid/1,
get_ref/1,
overload/1,
stopping/1,
kill_on_choked/1
]).
-include_lib("stdlib/include/assert.hrl").
-include_lib("common_test/include/ct.hrl").
-include_lib("syntax_tools/include/merl.hrl").
all() ->
[
pin... | |
1dc3788f4b2c9e4ed96272df1ba0deb8640f7aa198503f6fcc8591e3cc73c56a | srid/neuron | Util.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE TupleSections #
# LANGUAGE ViewPatterns #
# LANGUAGE NoImplicitPrelude #
TODO Review and delete what 's unused in this module
module Text.Pandoc.Util
( getFirstParagraphText,
setTitl... | null | https://raw.githubusercontent.com/srid/neuron/1f127b8343dbe05e057688988b289066df1cdedb/src/Text/Pandoc/Util.hs | haskell | # LANGUAGE OverloadedStrings #
| This is set to Nothing for autolinks
TODO: Move to pandoc-link-context
If this element is absent, then create it using the given text inline.
Either way, apply the given `id` attribute to the title H1 (so as to
distinguish it from other headings). And return the title plainify'ie... | # LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE TupleSections #
# LANGUAGE ViewPatterns #
# LANGUAGE NoImplicitPrelude #
TODO Review and delete what 's unused in this module
module Text.Pandoc.Util
( getFirstParagraphText,
setTitleH1,
ensureTitleH1,
deleteT... |
ba7575bfa286b29a13064cc036ace640bd3a87513a4e8712658e77492b69e271 | wotbrew/relic | prop_test.cljc | (ns com.wotbrew.relic.prop-test
(:require [clojure.test :refer [deftest is testing]]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop]
[com.wotbrew.relic :as rel]
[clojure.test.check :as tc]
[com.wotbrew.relic.impl.util :as u]
... | null | https://raw.githubusercontent.com/wotbrew/relic/ba930e934372c407c089733bfa6c902a664a5f6e/test/com/wotbrew/relic/prop_test.cljc | clojure | no sort check for now, even sort has only a partially deterministic order
| (ns com.wotbrew.relic.prop-test
(:require [clojure.test :refer [deftest is testing]]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop]
[com.wotbrew.relic :as rel]
[clojure.test.check :as tc]
[com.wotbrew.relic.impl.util :as u]
... |
0b86d2adb1b55bc171d2aa4004f1ab894034234f7721d91793a1fe11f603ff36 | mauricioszabo/repl-tooling | pinkie.cljs | (ns repl-tooling.editor-integration.renderer.pinkie
(:require [promesa.core :as p]
[clojure.string :as str]
[reagent.core :as r]
[repl-tooling.ui.pinkie :as pinkie]
[pinkgorilla.ui.jsrender :as jsrender]
["highlight.js" :as highlight]
["commonmar... | null | https://raw.githubusercontent.com/mauricioszabo/repl-tooling/1cea9b411cc118d71266cb8e035e146325baf410/src/repl_tooling/editor_integration/renderer/pinkie.cljs | clojure | (ns repl-tooling.editor-integration.renderer.pinkie
(:require [promesa.core :as p]
[clojure.string :as str]
[reagent.core :as r]
[repl-tooling.ui.pinkie :as pinkie]
[pinkgorilla.ui.jsrender :as jsrender]
["highlight.js" :as highlight]
["commonmar... | |
322e8f3ca57635dc6c0e35e51405b6f48ba3b30069bd2290df21d4e2007a2028 | Drup/adtr | path.ml |
let rec hcf a b = if b = 0 then a else hcf b (a mod b)
type t = [] | (::) of single * t
and single =
| Word of word
| Monome of monome
and monome = {
index : Index.t ;
word : word ;
}
and word = char list
and char = Any | Field of Field.field
type path = t
let rec vars : t -> _ = function
| [] -> Id.Set.e... | null | https://raw.githubusercontent.com/Drup/adtr/a2d1cb8473522a52e475fd1261892cf363f215aa/src/path.ml | ocaml | * [as_monome w] expresses [w] as a monome:
Either w = r^i or w is not a power.
*
* The length of a path, as a linear form
* Computation of D_m, the polyhedron of the domain of a paths.
Both are empty
w1, w don't conflict f == 0 w1 ++ rest1 == rest2
-------------------------------------... |
let rec hcf a b = if b = 0 then a else hcf b (a mod b)
type t = [] | (::) of single * t
and single =
| Word of word
| Monome of monome
and monome = {
index : Index.t ;
word : word ;
}
and word = char list
and char = Any | Field of Field.field
type path = t
let rec vars : t -> _ = function
| [] -> Id.Set.e... |
119b9c4db74e0c45877e5d185c371f0412808a887a6aa65eb5f47556036f8ae4 | ghc/packages-dph | Stream.hs | # LANGUAGE FlexibleContexts #
module Stream where
import Data.Vector.Generic as G
import Data.Vector.Generic.Base as G
import Data.Vector.Fusion.Stream.Monadic as S
import Data.Vector.Fusion.Stream.Size as S
import Data.Vector.Fusion.Util as S
import qualified Data.Vector.Generic.Ne... | null | https://raw.githubusercontent.com/ghc/packages-dph/64eca669f13f4d216af9024474a3fc73ce101793/dph-test/fusion/Stream.hs | haskell | ------------------------------------------------------------------
| Like 'stream' but something else in the context knows how long it is.
We just keep returning elements and don't check for the end-of-vector
condition.
# INLINE get #
# RULES "swallow/new/unstream"
forall s
. swallow (new (New.unstream s... | # LANGUAGE FlexibleContexts #
module Stream where
import Data.Vector.Generic as G
import Data.Vector.Generic.Base as G
import Data.Vector.Fusion.Stream.Monadic as S
import Data.Vector.Fusion.Stream.Size as S
import Data.Vector.Fusion.Util as S
import qualified Data.Vector.Generic.Ne... |
290c00b68c160b3808e615370b46524dd3b7b43ad5f34a4468eea645767215a4 | triffon/fp-2019-20 | 02--count-digits.rkt | #lang racket
(require rackunit)
(require rackunit/text-ui)
# # # Задача 2
Напишете функция ` count - digits ` , цяло число ( което може да е отрицателно ) .
(define (count-digits-rec n)
(if (< n 0)
Функцията ` - ` , приложена само над един аргумент , .
Тук ако n е отрицателно , .
Така си под... | null | https://raw.githubusercontent.com/triffon/fp-2019-20/7efb13ff4de3ea13baa2c5c59eb57341fac15641/exercises/computer-science-2/02--recursive-and-iterative-processes/solutions/02--count-digits.rkt | racket | защото `count-digits-iter` не връща нищо.
(define count-digits count-digits-rec) | #lang racket
(require rackunit)
(require rackunit/text-ui)
# # # Задача 2
Напишете функция ` count - digits ` , цяло число ( което може да е отрицателно ) .
(define (count-digits-rec n)
(if (< n 0)
Функцията ` - ` , приложена само над един аргумент , .
Тук ако n е отрицателно , .
Така си под... |
1dc72aa5cce196cbee1423ee64554eaee6a6815d949112e3a4aef9d8458252a4 | kayhide/wakame | Functions.hs | # LANGUAGE DuplicateRecordFields #
module Wakame.Examples.Functions where
import Prelude
import GHC.Generics
import Wakame
-- * Data types which is used in this module
data Point = Point { x :: Double, y :: Double }
deriving (Eq, Show, Generic)
data Position = Position { x :: !Double, y :: !Double }
deriving ... | null | https://raw.githubusercontent.com/kayhide/wakame/4d16ecf2221655300b5db588c2775cfc0b8d92cd/test/examples/Wakame/Examples/Functions.hs | haskell | * Data types which is used in this module
| Review of @Generic@
`from` function converts a data to its generic representation.
>>> from pt
You can construct a representation value by hand.
From the representation value, `to` function converts back to @Point@.
>>> to rep :: Point
Since @Position@ has the sam... | # LANGUAGE DuplicateRecordFields #
module Wakame.Examples.Functions where
import Prelude
import GHC.Generics
import Wakame
data Point = Point { x :: Double, y :: Double }
deriving (Eq, Show, Generic)
data Position = Position { x :: !Double, y :: !Double }
deriving (Eq, Show, Generic)
data Point3d = Point3d {... |
3992598e5b47a65dcd150b509d3053029ace70742735d4edc4de8bd9323116e3 | cojna/iota | SternBrocot.hs | {-# LANGUAGE BangPatterns #-}
module Math.SternBrocot where
sternBrocot :: (Frac -> Ordering) -> Frac
sternBrocot approx = go (0 :/ 1) (1 :/ 0)
where
go l@(lp :/ lq) r@(rp :/ rq) = case approx m of
LT -> go m r
GT -> go l m
EQ -> m
where
!m = (lp + rp) :/ (lq + rq)
data Frac = !... | null | https://raw.githubusercontent.com/cojna/iota/6d2ad5b71b1b50bca9136d6ed84f80a0b7713d7c/src/Math/SternBrocot.hs | haskell | # LANGUAGE BangPatterns # |
module Math.SternBrocot where
sternBrocot :: (Frac -> Ordering) -> Frac
sternBrocot approx = go (0 :/ 1) (1 :/ 0)
where
go l@(lp :/ lq) r@(rp :/ rq) = case approx m of
LT -> go m r
GT -> go l m
EQ -> m
where
!m = (lp + rp) :/ (lq + rq)
data Frac = !Int :/ !Int deriving (Eq)
ins... |
6d40adff1cab6bd9623b8f264c4b7b63a1863a00ebf2d0a8de344daed6af06be | bosco/p2p | calc.erl | %%% This file has general calculation functions in it
-module(calc).
-export([cookie/0, id/0, best_peers/1, distance/2]).
-include("p2p.hrl").
%%% Gives us a random number we can use in our request strings
%%% to make sure servers are responding to us
cookie() ->
rand:uniform(?max_cookie).
Gives a random hash c... | null | https://raw.githubusercontent.com/bosco/p2p/54e5d4261777057a5d0e04040b1861e9b276fc0d/calc.erl | erlang | This file has general calculation functions in it
Gives us a random number we can use in our request strings
to make sure servers are responding to us
This gives you a list of the best peer IDs we could have in our Peers tree
your Peer tree should be the size of your hash in bits |
-module(calc).
-export([cookie/0, id/0, best_peers/1, distance/2]).
-include("p2p.hrl").
cookie() ->
rand:uniform(?max_cookie).
Gives a random hash converted to a 160 bit integer
id() ->
<<Id:?id_size/integer>> = crypto:hash(sha, crypto:rand_bytes(20)),
Id.
Tells you the distance between two peers . Uses X... |
089b3adc4f40bac82d2b30c622b8c81fff443cf266d6e9de751027e3c776a1d0 | ushitora-anqou/alqo | room.erl | -module(room).
-behaviour(gen_server).
-include("game.hrl").
-export([
create_one/1,
start_link/1,
exists/1,
register_as_player/1,
attack/5,
stay/2,
state_to_json/2,
get_num_players/1,
choose_attacker_card/3
]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, code_cha... | null | https://raw.githubusercontent.com/ushitora-anqou/alqo/9900172d765100dec40c00a7aec3c2dc971956f1/src/room.erl | erlang | Room should be created AFTER room state is set
Reply error if game has already finished
Private functions
Send event game_started
Send each hand
Send attacked event
Send game_finished event if game has finished
Send stayed event
Send attacker_card_chosen event
Need explicitly choosing | -module(room).
-behaviour(gen_server).
-include("game.hrl").
-export([
create_one/1,
start_link/1,
exists/1,
register_as_player/1,
attack/5,
stay/2,
state_to_json/2,
get_num_players/1,
choose_attacker_card/3
]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, code_cha... |
af0271b6cc65b743ef30a2e0a12bca3b5fa5385eae99f87a7489b798fff95fab | SecPriv/webspec | uuid.mli | (********************************************************************************)
Copyright ( c ) 2022
(* *)
(* Permission is hereby granted, free of charge, to any person obtaining a *)
(* copy of this software and associated doc... | null | https://raw.githubusercontent.com/SecPriv/webspec/b7ff6b714b3a4b572c108cc3136506da3d263eff/verifier/src/uuid.mli | ocaml | ******************************************************************************
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
th... | Copyright ( c ) 2022
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 ACTION OF CONTRACT... |
73dacc4838d14f85266799154138bbd1e5cd723c0e7f1b9e1bc6c6d1cff9f3aa | noloop/cacau | runner-test.lisp | (in-package #:noloop.cacau-test)
(r-test
:test-runner-create-test-sync
(lambda (r-done)
(let* ((runner-instance (make-runner))
(suite-root (suite-root runner-instance)))
(add-child suite-root
(create-test runner-instance
:test-1
... | null | https://raw.githubusercontent.com/noloop/cacau/ba0fb36a284ded884f1dab0bd3f0f41ec14e3038/t/functional/runner-test.lisp | lisp | (in-package #:noloop.cacau-test)
(r-test
:test-runner-create-test-sync
(lambda (r-done)
(let* ((runner-instance (make-runner))
(suite-root (suite-root runner-instance)))
(add-child suite-root
(create-test runner-instance
:test-1
... | |
2336c642dd7904fbcf290095319828feedd41955bc22942c30ad7ea855ce5b9c | joearms/music_experiments | midi_player.erl | -module(midi_player).
-compile(export_all).
test() ->
midi_event_gen:start(external),
%% play("jerusalem.mid"),
play("rach-pc1-1.mid"),
true.
test1() ->
midi_event_gen:start(internal),
play("jerusalem.mid"),
%% play("rach-pc1-1.mid"),
true.
play(F) ->
L = midi_parser:parse_fi... | null | https://raw.githubusercontent.com/joearms/music_experiments/3c0db01d03571599a3506fcb1a001d0b8dd205d9/midi_mac_driver/midi_player.erl | erlang | play("jerusalem.mid"),
play("rach-pc1-1.mid"),
Name = midi_sounds:sound_name(K),
change delta for next event | -module(midi_player).
-compile(export_all).
test() ->
midi_event_gen:start(external),
play("rach-pc1-1.mid"),
true.
test1() ->
midi_event_gen:start(internal),
play("jerusalem.mid"),
true.
play(F) ->
L = midi_parser:parse_file(F),
Tmap = make_tempo_map(L),
[_,_|L0] = L,
L1... |
e946cca84604a99546b8624b2a634b47cc5852358e07237bbeeb4df1e10b194c | sg2342/mirage-block-ccm | block_ccm.ml | open Lwt.Infix
module Make(BLOCK : Mirage_block.S) = struct
type key = { key : Mirage_crypto.Cipher_block.AES.CCM16.key;
nonce_len : int
}
type t = { raw : BLOCK.t;
k : key;
sector_len : int;
sectors : int64;
... | null | https://raw.githubusercontent.com/sg2342/mirage-block-ccm/4885a61ed9affee29ffd3c19a46772ef51d0cb60/lib/block_ccm.ml | ocaml | * Call [fn sector page] for each page in each buffer. | open Lwt.Infix
module Make(BLOCK : Mirage_block.S) = struct
type key = { key : Mirage_crypto.Cipher_block.AES.CCM16.key;
nonce_len : int
}
type t = { raw : BLOCK.t;
k : key;
sector_len : int;
sectors : int64;
... |
cf0694c34f37374e3edfdb027c80c63d082757ac79ad98b32a83595c0e05c4e2 | rtoy/ansi-cl-tests | ba-aux.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Mon May 30 06:45:08 2005
;;;; Contains: Aux. files for beyond-ansi tests
(in-package :ba-test)
(defun function-name-p (x)
(or (symbolp x)
(and (consp x)
(eql (car x) 'setf)
(consp (cdr x))
(symbolp (cadr x))
(nul... | null | https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/beyond-ansi/ba-aux.lsp | lisp | -*- Mode: Lisp -*-
Contains: Aux. files for beyond-ansi tests | Author :
Created : Mon May 30 06:45:08 2005
(in-package :ba-test)
(defun function-name-p (x)
(or (symbolp x)
(and (consp x)
(eql (car x) 'setf)
(consp (cdr x))
(symbolp (cadr x))
(null (cddr x)))))
(defun symbol-or-function-p (x)
(or (symbolp x)
... |
f6df61bde17acd16f30de0640b024c3e3f649f36c391d522356232942db36f51 | plumatic/grab-bag | tags.clj | (ns domain.docs.tags
"Namespace for 'tags' on docs. Tags can be manually added by users in rich remove, by admins
through the tagger interface, or by automated systems (presumably generalizing from admin
tags)."
(:refer-clojure :exclude [conj])
(:use plumbing.core)
(:require
[schema.core :as s]
[sc... | null | https://raw.githubusercontent.com/plumatic/grab-bag/a15e943322fbbf6f00790ce5614ba6f90de1a9b5/lib/domain/src/domain/docs/tags.clj | clojure |
free text
make coax happy
offensive, other, malformed, misclassified, low-quality
Tag semantics
Tags as attribute hierarchies, like type=article;content=news
content=news' becomes [['type' 'article'] ['content' 'news']].
Working with type:tag as strings, e.g.user:offensive | (ns domain.docs.tags
"Namespace for 'tags' on docs. Tags can be manually added by users in rich remove, by admins
through the tagger interface, or by automated systems (presumably generalizing from admin
tags)."
(:refer-clojure :exclude [conj])
(:use plumbing.core)
(:require
[schema.core :as s]
[sc... |
a22f7e198ba195b85541117f871ad1e0a6b2470854cc749455f89289981b0339 | icicle-lang/icicle-ambiata | EvalCommutes.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
{-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - missing - signatures #
module Icicle.Test.Avalanche.EvalCommutes where
import Icicle.Test.Arbitrary
import Icicle.Test.Arbitrary.NanEq ((=~=))
import Icicle.Core.Pro... | null | https://raw.githubusercontent.com/icicle-lang/icicle-ambiata/9b9cc45a75f66603007e4db7e5f3ba908cae2df2/icicle-compiler/test/Icicle/Test/Avalanche/EvalCommutes.hs | haskell | # LANGUAGE OverloadedStrings #
We need a way to differentiate stream variables from scalars
A well typed core program evaluates to a value in avalanche
going to core doesn't affect value | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
# OPTIONS_GHC -fno - warn - missing - signatures #
module Icicle.Test.Avalanche.EvalCommutes where
import Icicle.Test.Arbitrary
import Icicle.Test.Arbitrary.NanEq ((=~=))
import Icicle.Core.Program.Check
import qualified Icicle.... |
4a9cf4eafa58c57b016d1e5710f1723d66107b92f14162bba6261b15834737da | ghcjs/ghcjs | T9577_A.hs | # LANGUAGE MagicHash #
module T9577_A where
import GHC.Exts (Ptr(..), Addr#)
foo = Ptr "foo"#
| null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/codeGen/T9577_A.hs | haskell | # LANGUAGE MagicHash #
module T9577_A where
import GHC.Exts (Ptr(..), Addr#)
foo = Ptr "foo"#
| |
c85b7f30c635613350e03e1e5ff4d14c9a4ba056b3a774a7b67fad27798d973c | jixiuf/helloerlang | param_child_param_1.erl | -module(param_child_param_1,[A,B]).
-export([show/0]).
-extends(param_parent).
%%测试: 一个parameter module 继承另一个 parameter module
注意子module 两个参数 ,
show()->
io:format("~p:~p,~p~n",[?MODULE,A,B])
.
%%
%% ()11> A=param_child_param_1:new(cat).
%% {param_parent,cat}
%% ()12> A:show().
%% name is :cat
这里的show... | null | https://raw.githubusercontent.com/jixiuf/helloerlang/3960eb4237b026f98edf35d6064539259a816d58/extend_test/src/param_child_param_1.erl | erlang | 测试: 一个parameter module 继承另一个 parameter module
()11> A=param_child_param_1:new(cat).
{param_parent,cat}
()12> A:show().
name is :cat
{param_child_param_1,cat,dog}
()14> B:show().
?MODULE:cat,dog | -module(param_child_param_1,[A,B]).
-export([show/0]).
-extends(param_parent).
注意子module 两个参数 ,
show()->
io:format("~p:~p,~p~n",[?MODULE,A,B])
.
这里的show , 调用的是param_parent : show/0
( > B = param_child_param_1 : new(cat , dog ) .
证明 一个parameter module 可以继承另一个 parameter module
|
9232c2708a5ef1e975e5d3adcbf42ed75308278f1ed65cae219ee3e063988e2e | synduce/Synduce | bal_2.ml | * @synduce -NB
type 'a clist =
| CNil
| Single of 'a
| Concat of 'a clist * 'a clist
type 'a list =
| Nil
| Cons of 'a * 'a list
let rec fbal = function
| Nil -> 0, 0, true
| Cons (hd, tl) ->
let cnt, min_cnt, bal = fbal tl in
let cnt2 = if hd then cnt + 1 else cnt - 1 in
cnt2, min min_cnt ... | null | https://raw.githubusercontent.com/synduce/Synduce/d453b04cfb507395908a270b1906f5ac34298d29/benchmarks/constraints/ensures/bal_2.ml | ocaml | * @synduce -NB
type 'a clist =
| CNil
| Single of 'a
| Concat of 'a clist * 'a clist
type 'a list =
| Nil
| Cons of 'a * 'a list
let rec fbal = function
| Nil -> 0, 0, true
| Cons (hd, tl) ->
let cnt, min_cnt, bal = fbal tl in
let cnt2 = if hd then cnt + 1 else cnt - 1 in
cnt2, min min_cnt ... | |
86158bca71a3b1bb99c058b8dd8e964209b375fbe6f82b1702f441239e6e0d45 | tweag/capability | Sink.hs | -- | Defines a capability for computations that produce a stream of values
-- as part of their execution.
--
-- Programs producing streams of data are common. Examples: emitting events on
-- input, or emitting events whenever certain conditions are observed. streams
-- are similar to Python generators.
--
-- The 'HasSi... | null | https://raw.githubusercontent.com/tweag/capability/65271a22ff9c173579f889dc033231f80453b185/src/Capability/Sink.hs | haskell | | Defines a capability for computations that produce a stream of values
as part of their execution.
Programs producing streams of data are common. Examples: emitting events on
input, or emitting events whenever certain conditions are observed. streams
are similar to Python generators.
The 'HasSink' capability e... |
# LANGUAGE KindSignatures #
# LANGUAGE MagicHash #
# LANGUAGE PolyKinds #
module Capability.Sink
module Capability.Sink.Internal.Class
, HasSink'
, TypeOf
, module Capability.Sink.Internal.Strategies
, module Capability.Accessors
) where
import Capability.Sink.Internal.Class
import Capability.Sink.Inte... |
bd404056c0d66cbb4151d5c955385350ee0d504a0c7db3bda39ca80db85f412f | returntocorp/ocaml-tree-sitter-core | Possessive_matcher.ml | (*
"Possessive" regexp matcher.
This is a simple pattern matcher that performs no backtracking,
and therefore can't match arbitrary regular expressions.
*)
type node = string
type nodes = node list
type exp =
| Simple of string
| End
| Repeat of exp
| Alt of (string * exp) * (string * exp)
| Seq o... | null | https://raw.githubusercontent.com/returntocorp/ocaml-tree-sitter-core/28f750bb894ea4c0a7f6b911e568ab9d731cc0b5/src/run/lib/Possessive_matcher.ml | ocaml |
"Possessive" regexp matcher.
This is a simple pattern matcher that performs no backtracking,
and therefore can't match arbitrary regular expressions.
|
type node = string
type nodes = node list
type exp =
| Simple of string
| End
| Repeat of exp
| Alt of (string * exp) * (string * exp)
| Seq of exp * exp
type result =
| Simple of string
| End
| Repeat of result list
| Alt of (string * result)
| Seq of (result * result)
let rec parse (exp : exp)... |
1df2c061d59517ff700943fb2a9f8530a3d1d6ee396a670b9ed9a2f35eccc4a9 | antifuchs/sbcl | gtn.lisp | This file contains the pass in the compiler . allocates
;;;; the TNs that hold the values of lexical variables and determines
;;;; the calling conventions and passing locations used in function
;;;; calls.
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This softw... | null | https://raw.githubusercontent.com/antifuchs/sbcl/789bf105edca031aff991ad16a5fd207812336a0/src/compiler/gtn.lisp | lisp | the TNs that hold the values of lexical variables and determines
the calling conventions and passing locations used in function
calls.
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
We ma... | This file contains the pass in the compiler . allocates
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB!C")
(defun gtn-analyze (component)
(setf (comp... |
f633d8c39ab3f1b4511e953335be88133f1c6bf2b0c9197144b32519316c2ad2 | atlas-engineer/nyxt | package.lisp | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(uiop:define-package :theme
(:use :cl)
(:import-from :serapeum #:export-always)
(:import-from :class-star #:define-class))
| null | https://raw.githubusercontent.com/atlas-engineer/nyxt/aa27fc47314046062d6f4e7ef5d8c95a62c2858f/libraries/theme/package.lisp | lisp | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(uiop:define-package :theme
(:use :cl)
(:import-from :serapeum #:export-always)
(:import-from :class-star #:define-class))
| |
6cd1ad4986a11859bf9cf12980a727b792034b3569de84634a7fea426a50f144 | tqtezos/minter-sdk | AllowlistedFA2.hs | | Tests on the allowlisted FA2 english auction contract .
module Test.EnglishAuction.AllowlistedFA2 where
import Prelude hiding (swap)
import Test.Tasty (TestTree, testGroup)
import GHC.Exts (fromList)
import Lorentz.Contracts.Spec.FA2Interface (OperatorParam(..), UpdateOperator(..), theTokenId)
import Lorentz.Val... | null | https://raw.githubusercontent.com/tqtezos/minter-sdk/127072de4cd8349b118c32666529e5805991dee8/packages/minter-contracts/test-hs/Test/EnglishAuction/AllowlistedFA2.hs | haskell | In this contract only admin can create auctions
FA2 that is used as money we buy for in auction
Check that storage updates work | | Tests on the allowlisted FA2 english auction contract .
module Test.EnglishAuction.AllowlistedFA2 where
import Prelude hiding (swap)
import Test.Tasty (TestTree, testGroup)
import GHC.Exts (fromList)
import Lorentz.Contracts.Spec.FA2Interface (OperatorParam(..), UpdateOperator(..), theTokenId)
import Lorentz.Val... |
eabf0efd41c5cbf47d404cd2fd00377045a6c0ddc246079a7388636abf575108 | nomeata/free-theorems-static-webui | Haskell98.hs | # LANGUAGE FlexibleContexts #
-- | Defines a function to parse a string into a list of declarations.
This module is based on the \'haskell - src\ ' package most probably included
with every compiler .
module Language.Haskell.FreeTheorems.Parser.Haskell98 (parse) where
import Control.Monad (foldM, liftM, ... | null | https://raw.githubusercontent.com/nomeata/free-theorems-static-webui/44149706c2b809734ab3848047e314359bc59ccb/free-theorems/src/Language/Haskell/FreeTheorems/Parser/Haskell98.hs | haskell | | Defines a function to parse a string into a list of declarations.
----- Main parser function --------------------------------------------------
| Parses a string to a list of declarations.
That parser supports only Haskell98 and a few extensions. Especially, it
does not support explicit quantification of typ... | # LANGUAGE FlexibleContexts #
This module is based on the \'haskell - src\ ' package most probably included
with every compiler .
module Language.Haskell.FreeTheorems.Parser.Haskell98 (parse) where
import Control.Monad (foldM, liftM, liftM2)
import Control.Monad.Error (throwError)
import Control.Monad.Wr... |
4749bf02d1dc37309777373e507e829465f32799b62b788753215f26207526b6 | RefactoringTools/HaRe | ComplexPatIn1AST.hs | module ComplexPatIn1 where
main :: Int
main = foo 3
foo :: Int -> Int
foo x
= (h + (let tup@(h, t)
= head $ (zip [1 .. x] [3 .. 15])
in t)) +
(snd tup)
where
t :: Int
h :: Int
tup :: (Int, Int)
tup@(h, t) = head $ (zip [1 .. x] [3 .. ... | null | https://raw.githubusercontent.com/RefactoringTools/HaRe/ef5dee64c38fb104e6e5676095946279fbce381c/old/testing/unfoldDef/ComplexPatIn1AST.hs | haskell | module ComplexPatIn1 where
main :: Int
main = foo 3
foo :: Int -> Int
foo x
= (h + (let tup@(h, t)
= head $ (zip [1 .. x] [3 .. 15])
in t)) +
(snd tup)
where
t :: Int
h :: Int
tup :: (Int, Int)
tup@(h, t) = head $ (zip [1 .. x] [3 .. ... | |
ec10fabfbd2cd0e4ec0c841afa166620d42df08e8b4a52fb1bf8ef9ff5cd0ab7 | mwand/5010-examples | 09-1-basics.rkt | #lang racket
(require "extras.rkt")
(require rackunit)
examples from Lesson 9.1
(define Interface1<%>
(interface ()
foo ; -> Int
bar ; Int -> Int
baz ; Int -> Int
))
(define Class1%
(class* object% (Interface1<%>)
(init-field x y r) ;; x,y,r : Int
(s... | null | https://raw.githubusercontent.com/mwand/5010-examples/ac24491ec2e533d048e11087ccc30ff1c087c218/09-1-basics.rkt | racket | -> Int
Int -> Int
Int -> Int
x,y,r : Int
required magic
foo : -> Int
bar : Int -> Int
baz : Int -> Int
a, b, c : Int
foo : -> Int
bar : Int -> Int
baz : Int -> Int
a, b, c : Int
add a new field, initialized to -a
foo : -> Int
(define/public (foo) (+ a b))
bar : Int -> Int
baz : Int -... | #lang racket
(require "extras.rkt")
(require rackunit)
examples from Lesson 9.1
(define Interface1<%>
(interface ()
))
(define Class1%
(class* object% (Interface1<%>)
(define/public (foo) (+ x y))
(define/public (bar n) (+ r n))
(define/public (baz n)
... |
d1e38068d65301d48541f4e006846bb9ea75875f7a3182f9d8e23882387329a5 | racket/redex | pict.rkt | #lang racket/base
(require racket/contract
racket/draw
racket/class
racket/match
racket/pretty
racket/set
(only-in racket/list drop-right last partition add-between
splitf-at remove-duplicates)
pict
redex/priva... | null | https://raw.githubusercontent.com/racket/redex/4c2dc96d90cedeb08ec1850575079b952c5ad396/redex-pict-lib/redex/private/pict.rkt | racket |
;;;; ; ;;
... | #lang racket/base
(require racket/contract
racket/draw
racket/class
racket/match
racket/pretty
racket/set
(only-in racket/list drop-right last partition add-between
splitf-at remove-duplicates)
pict
redex/priva... |
0dcbdf03a309447b9276f02f029c17da3784637c8a93201a1897eabfd46edead | namenu/bootcamp-maze | generator.cljc | (ns maze.generator
(:require [maze.seq.binary-tree :refer [binary-tree]]
[maze.seq.sidewinder :refer [sidewinder]]
[maze.seq.aldous-broder :refer [aldous-broder]]
[maze.seq.wilson :refer [wilson]]
[maze.seq.hunt-and-kill :refer [hunt-and-kill]]
[maze.seq.rec... | null | https://raw.githubusercontent.com/namenu/bootcamp-maze/0558ba6b624bc0b6a5312415972398401396c4cf/src/maze/generator.cljc | clojure | (ns maze.generator
(:require [maze.seq.binary-tree :refer [binary-tree]]
[maze.seq.sidewinder :refer [sidewinder]]
[maze.seq.aldous-broder :refer [aldous-broder]]
[maze.seq.wilson :refer [wilson]]
[maze.seq.hunt-and-kill :refer [hunt-and-kill]]
[maze.seq.rec... | |
b303077e912b6b2148a17560c0a9b427248d7a19dbe314e63b74e2ea46717a7c | tisnik/clojure-examples | core.clj | ;
( C ) Copyright 2016 , 2020 , 2021
;
; All rights reserved. This program and the accompanying materials
; are made available under the terms of the Eclipse Public License v1.0
; which accompanies this distribution, and is available at
-v10.html
;
; Contributors:
;
(ns stream-pipe-3.core
(:re... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/a5f9d6119b62520b05da64b7929d07b832b957ab/kafka-stream-pipe-3/src/stream_pipe_3/core.clj | clojure |
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
Contributors:
spuštění kolony | ( C ) Copyright 2016 , 2020 , 2021
-v10.html
(ns stream-pipe-3.core
(:require [jackdaw.admin :as ja]
[jackdaw.client :as jc]
[jackdaw.client.log :as jl]
[jackdaw.serdes.json]
[jackdaw.streams :as j]
[clojure.pprint :as pp]
[cl... |
1cab59f034caa51a78de2abd19c4605d54275d3b26a3186c5856f8f37b074094 | grin-compiler/ghc-wpc-sample-programs | Options.hs | |
Module : . Options
Description : Compiler options for .
License : : The Idris Community .
Module : Idris.Options
Description : Compiler options for Idris.
License : BSD3
Maintainer : The Idris Community.
-}
# LANGUAGE DeriveDataTypeable , DeriveFunctor , DeriveGeneric , PatternGu... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/idris-1.3.3/src/Idris/Options.hs | haskell | only for the really primitive stuff!
^ REPL TCP port
^ Automatically adjust terminal width
^ Automatically issue "solve" tactic in old-style interactive prover
^ Don't show deprecation warnings for old-style tactics
^ Allow pattern variables to be capitalized
| How wide is the console?
^ Have pretty-printer ass... | |
Module : . Options
Description : Compiler options for .
License : : The Idris Community .
Module : Idris.Options
Description : Compiler options for Idris.
License : BSD3
Maintainer : The Idris Community.
-}
# LANGUAGE DeriveDataTypeable , DeriveFunctor , DeriveGeneric , PatternGu... |
7d947f4755e8879bf5844efa3cd46d73e28495ceb6c36b2d1a4f228c5f62c88a | namenu/advent-of-code | day18.clj | (ns aoc.year2022.day18
(:require [aoc.cube :as cube]
[aoc.util :refer [ordered-pairs]]
[aoc.graph :as graph]
[clojure.string :as str]))
(defn parse-input [input]
(let [parse-xyz (fn [s]
(->> (str/split s #",")
(mapv parse-long)))]
... | null | https://raw.githubusercontent.com/namenu/advent-of-code/2371d3a5f648adae9c2e3e154ffe060787833355/2022/clojure/src/aoc/year2022/day18.clj | clojure | (ns aoc.year2022.day18
(:require [aoc.cube :as cube]
[aoc.util :refer [ordered-pairs]]
[aoc.graph :as graph]
[clojure.string :as str]))
(defn parse-input [input]
(let [parse-xyz (fn [s]
(->> (str/split s #",")
(mapv parse-long)))]
... | |
0fdf95f8a8ae00ca18d896e4e0754b8eb012f5a4dcee28299ebaabbf47895baa | haskell-gi/haskell-gi | LoadSave.hs | module LoadSave(saveLabyrinth, loadLabyrinth) where
import Control.Exception(IOException,try)
import qualified System.Directory as Directory
import qualified System.IO as IO
import qualified System.FilePath as Path
import qualified Data.ByteString.Lazy as LazyByteString
import qualified Data.ByteString as ByteStri... | null | https://raw.githubusercontent.com/haskell-gi/haskell-gi/253a34ba08b968b62f9ed3d199d943551b5fe6aa/cairo/examples/hlabyrinth/src/LoadSave.hs | haskell | module LoadSave(saveLabyrinth, loadLabyrinth) where
import Control.Exception(IOException,try)
import qualified System.Directory as Directory
import qualified System.IO as IO
import qualified System.FilePath as Path
import qualified Data.ByteString.Lazy as LazyByteString
import qualified Data.ByteString as ByteStri... | |
e5e8d246c64ab2774a418acb2dcd622f8cd9b68431b46ff05a010c57afd78821 | FranklinChen/hugs98-plus-Sep2006 | HenkParser.hs | ----------------------------------------------------------------
the
Copyright 2000 , Jan - Willem Roorda and
----------------------------------------------------------------
module HenkParser where
import Text.ParserCombinators.Parsec
import qualified Text.ParserCombinators.Parsec.Token as P
import Text.Parse... | null | https://raw.githubusercontent.com/FranklinChen/hugs98-plus-Sep2006/54ab69bd6313adbbed1d790b46aca2a0305ea67e/packages/parsec/examples/Henk/HenkParser.hs | haskell | --------------------------------------------------------------
--------------------------------------------------------------
--------------------------------------------------------------
anonymous variables are any identifiers starting with "_"
unknown types (those that need to be inferred) can explicitly
be giv... | the
Copyright 2000 , Jan - Willem Roorda and
module HenkParser where
import Text.ParserCombinators.Parsec
import qualified Text.ParserCombinators.Parsec.Token as P
import Text.ParserCombinators.Parsec.Language
import HenkAS
the
instead of grammar : " var : " as in the paper ,
sequences as in \ , |~... |
1c391f229331592f79f8baefa5828c520400c19636b9c4ed6dec0fae28f78358 | conal/TypeCompose | Partial.hs | {-# LANGUAGE TypeSynonymInstances #-}
# OPTIONS_GHC -Wall #
# OPTIONS_GHC -fno - warn - orphans #
----------------------------------------------------------------------
-- |
-- Module : Data.Partial
Copyright : ( c ) Conal Elliott 2007
-- License : BSD3
--
-- Maintainer :
-- Stability : experim... | null | https://raw.githubusercontent.com/conal/TypeCompose/5100cd68b68382b6b65c8c0598a3f34dc9481db3/src/Data/Partial.hs | haskell | # LANGUAGE TypeSynonymInstances #
--------------------------------------------------------------------
|
Module : Data.Partial
License : BSD3
Maintainer :
Stability : experimental
Portability : portable
A monoid 'Partial' of partial values. See the [Teaser] and [Solution] blog
posts.
... | # OPTIONS_GHC -Wall #
# OPTIONS_GHC -fno - warn - orphans #
Copyright : ( c ) Conal Elliott 2007
module Data.Partial
(
Partial, PartialX, valp, pval
, pUnElt, pUnArg, pUnRes, pUnSrc
) where
import Prelude hiding (zip,unzip)
import Data.Monoid
import Control.Arrow
import Control.Compose (FunAble(..),... |
4a0477c49d4236c06f9ae775ca3bb79d0405711392e4713f4610d842c0bfb016 | athensresearch/athens | page.cljs | (ns athens.views.pages.page
(:require
["/components/Page/Page" :refer [PageNotFound]]
[athens.common-db :as common-db]
[athens.db :as db]
[athens.reactive :as reactive]
[athens.router :as router]
[athens.views.blocks.c... | null | https://raw.githubusercontent.com/athensresearch/athens/91a9ab1fc59941dbaefee5445815e9cbe7d681f4/src/cljs/athens/views/pages/page.cljs | clojure | (ns athens.views.pages.page
(:require
["/components/Page/Page" :refer [PageNotFound]]
[athens.common-db :as common-db]
[athens.db :as db]
[athens.reactive :as reactive]
[athens.router :as router]
[athens.views.blocks.c... | |
522f4af17b61f47a7f284c8e462194ff2d7c4609c918902293255d1e98202bfb | Functional-AutoDiff/STALINGRAD | backprop-R-ikarus.scm | ;;; Representation for weights:
list with one element for each layer following the input ;
each such list has one element for each unit in that layer ;
;;; which consists of a bias, followed by the weights for each
;;; unit in the previous layer.
;;; Basic MLP
(define (sum-activities activities)
(lambda (bia... | null | https://raw.githubusercontent.com/Functional-AutoDiff/STALINGRAD/8a782171872d5caf414ef9f8b9b0efebaace3b51/examples/examples2009/backprop-R-ikarus.scm | scheme | Representation for weights:
which consists of a bias, followed by the weights for each
unit in the previous layer.
Basic MLP
Optimization of the sort used with MLPs and backpropagation,
Scaled structure subtraction
Gradient minimize f starting at w0 for n iterations via
returns the last f(w)
XOR network |
(define (sum-activities activities)
(lambda (bias-ws)
(let ((bias (first bias-ws)) (ws (rest bias-ws)))
((reduce d+ bias) (map d* ws activities)))))
(define (sum-layer activities ws-layer)
(map (sum-activities activities) ws-layer))
(define (sigmoid x) (d/ 1 (d+ (dexp (d- 0 x)) 1)))
(define (forward-pass ws... |
1f63cee47a0a72547e6fb70007cffbc8059a87b89e227530603630a51f4b26e9 | dolotech/erlang_server | mod_luck.erl | %%----------------------------------------------------
排行榜服务
%%
$ Id$
%%
%% @author Rolong<>
%%----------------------------------------------------
-module(mod_luck).
-behaviour(gen_server).
-export([
start_link/0
,update_luck_id/0
,update_rank/0
, update_luck_list/0
%% ,update_luck... | null | https://raw.githubusercontent.com/dolotech/erlang_server/44ea3693317f60e18b19c9ddfa179307cbd646d7/src/mod/mod_luck.erl | erlang | ----------------------------------------------------
@author Rolong<>
----------------------------------------------------
,update_luck_week_list/0
排行榜数据
角色ID
角色名字
--- 对外接口 ---
新建连接
--- 服务器内部实现 ---
获取期号
获取排名列表
?INFO("week_rank_list",[]),
更新排行榜
更新排行榜
幸运星 期号
期号
% 更新总排行榜
set_rank_f... | 排行榜服务
$ Id$
-module(mod_luck).
-behaviour(gen_server).
-export([
start_link/0
,update_luck_id/0
,update_rank/0
, update_luck_list/0
,get_luck_id/0
]
).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-include("common.hrl").
-define(SER... |
daab740c1b21614aedb8fd7f253a65f8e957a97df7c411b06e0e0b0a26c74540 | Apress/practical-webdev-haskell | AuthSpec.hs | module Adapter.Redis.AuthSpec where
import ClassyPrelude
import Test.Hspec
import qualified Database.Redis as R
import Adapter.Redis.Auth
spec :: Spec
spec = beforeAll initDB $
describe "findUserIdBySessionId" $ do
it "should return Nothing if session is invalid" $
runTestApp (findUserIdBySessionId "inval... | null | https://raw.githubusercontent.com/Apress/practical-webdev-haskell/17b90c06030def254bb0497b9e357f5d3b96d0cf/11/test/Adapter/Redis/AuthSpec.hs | haskell | module Adapter.Redis.AuthSpec where
import ClassyPrelude
import Test.Hspec
import qualified Database.Redis as R
import Adapter.Redis.Auth
spec :: Spec
spec = beforeAll initDB $
describe "findUserIdBySessionId" $ do
it "should return Nothing if session is invalid" $
runTestApp (findUserIdBySessionId "inval... | |
cb8a6344ba8740de28aadafd02de076e870b29cce38a4982635c423c318e0776 | mbj/stratosphere | FeatureActivationsProperty.hs | module Stratosphere.MediaLive.Channel.FeatureActivationsProperty (
FeatureActivationsProperty(..), mkFeatureActivationsProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/medialive/gen/Stratosphere/MediaLive/Channel/FeatureActivationsProperty.hs | haskell | module Stratosphere.MediaLive.Channel.FeatureActivationsProperty (
FeatureActivationsProperty(..), mkFeatureActivationsProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere... | |
362efc0cd9db53dbeba324a4396615c481a85b9aba54803b8e5cea0812689072 | metabase/metabase | pulse_test.clj | (ns metabase-enterprise.sandbox.api.pulse-test
"Tests that would logically be included in `metabase.api.pulse-test` but are separate as they are enterprise only."
(:require
[clojure.test :refer :all]
[metabase-enterprise.test :as met]
[metabase.integrations.slack]
[metabase.test :as mt]))
(comment meta... | null | https://raw.githubusercontent.com/metabase/metabase/b1298421ac2d7b157bb3578ac1679a0da6ba8f9f/enterprise/backend/test/metabase_enterprise/sandbox/api/pulse_test.clj | clojure | so the Setting exists | (ns metabase-enterprise.sandbox.api.pulse-test
"Tests that would logically be included in `metabase.api.pulse-test` but are separate as they are enterprise only."
(:require
[clojure.test :refer :all]
[metabase-enterprise.test :as met]
[metabase.integrations.slack]
[metabase.test :as mt]))
(deftest seg... |
04b30a11a4303c329e4913a8f66bc33e3cc0920383d459e580985fe52e8fa3c2 | adacapo21/plutusPioneerProgram | swap-client.hs | {-# LANGUAGE NumericUnderscores #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
module Main
( main
) where
import Control.Concurrent
import Control.Exception
import Control.Monad.IO.Class (MonadIO (..))
import Data.Aeson (Result (..), fr... | null | https://raw.githubusercontent.com/adacapo21/plutusPioneerProgram/298b71148394cbbe9a0246ff2aab5001b277d63b/week06/app/swap-client.hs | haskell | # LANGUAGE NumericUnderscores #
# LANGUAGE OverloadedStrings #
getFunds function needs to get information out of the server. | # LANGUAGE ScopedTypeVariables #
module Main
( main
) where
import Control.Concurrent
import Control.Exception
import Control.Monad.IO.Class (MonadIO (..))
import Data.Aeson (Result (..), fromJSON)
import Data.Monoid (Last (..))
import ... |
49999a553b8a9db7f482a347ced1cc83a8d73fe9f87be841288024f834505b6e | BinaryAnalysisPlatform/bap | bap_types.ml | (** Bap base types.
This library introduces base types for Binary Analysis Platform.
*)
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap_common_types
open Bap_knowledge
* This module is included into [ Bap . Std ] , you need to open it
specifically if you 're developing inside BAP
specifica... | null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/cbdf732d46c8e38df79d9942fc49bcb97915c657/lib/bap_types/bap_types.ml | ocaml | * Bap base types.
This library introduces base types for Binary Analysis Platform.
* A definition for a regular type, and a handy module,
that can create regular types out of thin air.
* Target architecture.
* Typed and always fresh variables.
* Sizes of expression operands
* Address representation.
... |
open Core_kernel[@@warning "-D"]
open Regular.Std
open Bap_common_types
open Bap_knowledge
* This module is included into [ Bap . Std ] , you need to open it
specifically if you 're developing inside BAP
specifically if you're developing inside BAP *)
module Std = struct
module Integer = Integer
module... |
25411044e805bb64f1295a8114bf785800c8e01225ab63ac1fb470d55aa1d4e3 | digitallyinduced/ihp-blog-example-app | Show.hs | module Web.View.Posts.Show where
import Web.View.Prelude
import qualified Text.MMark as MMark
data ShowView = ShowView { post :: Include "comments" Post }
instance View ShowView where
html ShowView { .. } = [hsx|
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href... | null | https://raw.githubusercontent.com/digitallyinduced/ihp-blog-example-app/9c44c48c9c0088421b517cd3ac76d208e92feacc/Web/View/Posts/Show.hs | haskell | module Web.View.Posts.Show where
import Web.View.Prelude
import qualified Text.MMark as MMark
data ShowView = ShowView { post :: Include "comments" Post }
instance View ShowView where
html ShowView { .. } = [hsx|
<nav>
<ol class="breadcrumb">
<li class="breadcrumb-item"><a href... | |
92cb19749db64202f5e371f83530458966a478e04f760dc0d402b24fa5158a0b | mfoemmel/erlang-otp | xmerl_sax_parser.erl | %%--------------------------------------------------------------------
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance wi... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/xmerl/src/xmerl_sax_parser.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. Se... | Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
Description : XML SAX parse API module .
... |
5e7450af12cffdbc7a821a012dba62bc8e96fdff07951237934dad9bcdc807b5 | sbcl/sbcl | target-unicode.lisp | ;;;; Unicode functions
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and is
;;;; provid... | null | https://raw.githubusercontent.com/sbcl/sbcl/fc686aef1c38ac4cea1897f545a06c339f67eca9/src/code/target-unicode.lisp | lisp | Unicode functions
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
Unicode property access
This ECASE gets optimized into parallel arrays,
and does not depend on jump tables
If we see :CM ... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB-UNICODE")
(eval-when (:compile-toplevel)
(defun plist-to-alist (list)
(loop for (key value) on list by... |
27a9d79ead74d911e698b130442e76142276ed1f5822ea7cb59717ee38a7e7a3 | ralsei/sawzall | combining-join-test.rkt | #lang racket
(require rackunit
sawzall
"test-data.rkt"
"util.rkt")
(define left-join-1 (left-join woodland1 woodland2 "site"))
(define left-join-1-result
(row-df [day catch site habitat]
#f #f "a" "meadow"
1 12 "b" "grassland"
2 24 "b" "gra... | null | https://raw.githubusercontent.com/ralsei/sawzall/ce8df364e9a6f5a18ec9c293bf5a8a49a0e608d2/sawzall-test/combining-join-test.rkt | racket | join by multiple variables | #lang racket
(require rackunit
sawzall
"test-data.rkt"
"util.rkt")
(define left-join-1 (left-join woodland1 woodland2 "site"))
(define left-join-1-result
(row-df [day catch site habitat]
#f #f "a" "meadow"
1 12 "b" "grassland"
2 24 "b" "gra... |
e71ee93c90457f192ec43cc71e1bc712e8c965877dffd646adb1ca462c11f2e8 | erlang-ls/erlang_ls | generated_file_by_tag.erl | This file is @generated
-module(generated_file_by_tag).
-export([main/0]).
main() ->
ok.
| null | https://raw.githubusercontent.com/erlang-ls/erlang_ls/9eed7d4e865b6ad8a653cb495944bda53bf82db1/apps/els_lsp/test/els_indexer_SUITE_data/generated_file_by_tag.erl | erlang | This file is @generated
-module(generated_file_by_tag).
-export([main/0]).
main() ->
ok.
| |
828de68d6f3fedb940a9d33adca7ffe9fd9dc0ffa1807ed162966f422f5b4cc9 | technomancy/leiningen | uberjar.clj | (ns leiningen.test.uberjar
(:require [leiningen.uberjar :refer :all]
[clojure.test :refer :all]
[clojure.java.io :as io]
[clojure.java.shell :refer [sh]]
[clojure.xml :as xml]
[leiningen.test.helper :refer [unmemoize
... | null | https://raw.githubusercontent.com/technomancy/leiningen/24fb93936133bd7fc30c393c127e9e69bb5f2392/test/leiningen/test/uberjar.clj | clojure | not a namespaced map | (ns leiningen.test.uberjar
(:require [leiningen.uberjar :refer :all]
[clojure.test :refer :all]
[clojure.java.io :as io]
[clojure.java.shell :refer [sh]]
[clojure.xml :as xml]
[leiningen.test.helper :refer [unmemoize
... |
c537161f7c41e6560ced3ee22b5f108ad77bc7fa9b1241a14d140893dd3aab14 | jyh/metaprl | fol_implies.mli | (*
* Implication.
*)
extends Fol_type
prec prec_implies
prec prec_lambda
prec prec_apply
declare implies{'A; 'B}
declare lambda{x. 'b['x]}
declare apply{'f; 'a}
(*
* -*-
* Local Variables:
* Caml-master: "pousse"
* End:
* -*-
*)
| null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/fol/fol_implies.mli | ocaml |
* Implication.
* -*-
* Local Variables:
* Caml-master: "pousse"
* End:
* -*-
|
extends Fol_type
prec prec_implies
prec prec_lambda
prec prec_apply
declare implies{'A; 'B}
declare lambda{x. 'b['x]}
declare apply{'f; 'a}
|
10a075176bbd2aa488a761b077ac59977472c8ed33311c313a9c8611a8e5cd0c | number571/Haskell | diffie-hellman.hs | {-# LANGUAGE MultiWayIf #-}
module Main where
check :: Integer -> Integer -> Bool
check p q = if
| q ^ (p-1) `mod` p == 1 -> True
| q ^ (p-1) `mod` p /= 1 -> False
main :: IO()
main = do
if check p q
then print "q ^ (p-1) mod p == 1"
else error "q ^ (p-1) mod p /= 1"
print [priv_A, pr... | null | https://raw.githubusercontent.com/number571/Haskell/7da2676c2604706d43791dc89c0ca8c9842aea48/Cryptography/diffie-hellman.hs | haskell | # LANGUAGE MultiWayIf # | module Main where
check :: Integer -> Integer -> Bool
check p q = if
| q ^ (p-1) `mod` p == 1 -> True
| q ^ (p-1) `mod` p /= 1 -> False
main :: IO()
main = do
if check p q
then print "q ^ (p-1) mod p == 1"
else error "q ^ (p-1) mod p /= 1"
print [priv_A, priv_B]
where
p = ... |
8bdb0bb071048faeaea24bac8b9c1d3093d95898491ab88e57b980c78565fd57 | xray-tech/xorc-xray | oam.clj | (ns re.stage.oam
(:require [clojure.java.io :as io]
[integrant.core :as ig]
[qbits.alia.uuid :as uuid]
[re.boundary.programs :as programs]
[re.boundary.states :as states]
[re.utils :as utils]))
(defmethod ig/init-key :re.stage.oam/run [_ {:keys [oam]}]
{:... | null | https://raw.githubusercontent.com/xray-tech/xorc-xray/ee1c841067207c5952473dc8fb1f0b7d237976cb/src/re/stage/oam.clj | clojure | (ns re.stage.oam
(:require [clojure.java.io :as io]
[integrant.core :as ig]
[qbits.alia.uuid :as uuid]
[re.boundary.programs :as programs]
[re.boundary.states :as states]
[re.utils :as utils]))
(defmethod ig/init-key :re.stage.oam/run [_ {:keys [oam]}]
{:... | |
0ed710d97b9136146765cdc0c94465ba98625c6b51cd7cb0cf12f7d1f835abd1 | google/ormolu | simple.hs | module Main where
-- | Documentation.
data family GMap k :: Type -> Type
| null | https://raw.githubusercontent.com/google/ormolu/ffdf145bbdf917d54a3ef4951fc2655e35847ff0/data/examples/declaration/type-families/data-family/simple.hs | haskell | | Documentation. | module Main where
data family GMap k :: Type -> Type
|
e77cb5cfae5115d3fa8b28856a181ebbb0598b95bb2557f8eca198a93576aafb | lspector/Clojush | ackermann.clj | ;; ackermann.clj
, , 2017
;;
Tries to come up with ( )
using the first 22 elements of the sequence . function , is one of the simplest examples
;; of a total computable function that is not primitive recursive.
;;
(ns clojush.problems.software.ackermann
(:use [clojush.pushgp.pushgp]
[clojush.pu... | null | https://raw.githubusercontent.com/lspector/Clojush/685b991535607cf942ae1500557171a0739982c3/src/clojush/problems/software/ackermann.clj | clojure | ackermann.clj
of a total computable function that is not primitive recursive.
Boolean ERC
end input instructions
or are too big to be represented in a normal machine. | , , 2017
Tries to come up with ( )
using the first 22 elements of the sequence . function , is one of the simplest examples
(ns clojush.problems.software.ackermann
(:use [clojush.pushgp.pushgp]
[clojush.pushstate]
[clojush.interpreter]
[clojush.random]
clojush.instructions... |
8914c9a164539683550bfd695e86b11214750105c23a8f462a2c57466f5850ac | flipstone/haskell-for-beginners | 2_the_monad_typeclass.hs | -- Use Monad functions to wrap these
-- values in the Maybe monad.
--
foo = undefined "foo" :: Maybe String
one = undefined 1 :: Maybe Integer
threes = undefined [3,3,3] :: Maybe [Integer]
-- Use >>=, return, and the values above
-- to calculate the following values
--
oof = undefined
two = undefined
-- Re-define y... | null | https://raw.githubusercontent.com/flipstone/haskell-for-beginners/e586a1f3ef08f21d5181171fe7a7b27057391f0b/problems/chapter_12/2_the_monad_typeclass.hs | haskell | Use Monad functions to wrap these
values in the Maybe monad.
Use >>=, return, and the values above
to calculate the following values
Re-define your byTwo and byFour functions
from the previous section, but use the
Monads.
Perform the same calculations as in the previous
section | foo = undefined "foo" :: Maybe String
one = undefined 1 :: Maybe Integer
threes = undefined [3,3,3] :: Maybe [Integer]
oof = undefined
two = undefined
to make them work for all
byTwo :: Monad m => Integer -> m Integer
byTwo = undefined
byFour :: Monad m => Integer -> m Integer
byFour = undefined
calculations... |
6f16a4abf9cd898006aabfcbd6a8cf3218e801595319d3b4b31d70cd5bd35e0d | jrm-code-project/LISP-Machine | foo-ops.lisp |
(defvar *new-ops* '
(:UPDATE-RQB-VALID-PAGES :SETUP-NEXT-OUTPUT-BUFFER
:SETUP-BUFFER-FOR-APPEND
:SET-OUTPUT-POINTER-BASE
:SET-MAP-FOR-APPEND
:SET-BUFFER-POINTER-TO-END
... | null | https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/gjcx/foo-ops.lisp | lisp |
(defvar *new-ops* '
(:UPDATE-RQB-VALID-PAGES :SETUP-NEXT-OUTPUT-BUFFER
:SETUP-BUFFER-FOR-APPEND
:SET-OUTPUT-POINTER-BASE
:SET-MAP-FOR-APPEND
:SET-BUFFER-POINTER-TO-END
... | |
2182022e3459590a4f1af6aec6466853a5b848fde18ee2bb5fc9e74082792512 | CicadaBank/bips | bip39.clj | Copyright © 2022 CicadaBank
;; Permission is hereby granted, free of charge, to any person obtaining a copy of
;; this software and associated documentation files (the "Software"), to deal in
the Software without restriction , including without limitation the rights to
;; use, copy, modify, merge, publish, distrib... | null | https://raw.githubusercontent.com/CicadaBank/bips/98e69dc32277d32143514bac27b8bfab8a574f64/src/bips/bip39.clj | clojure | 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 copies of
subject to the following conditions:
The above copyright notice and this per... | Copyright © 2022 CicadaBank
the Software without restriction , including without limitation the rights to
the Software , and to permit persons to whom the Software is furnished to do so ,
copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EX... |
23841dd259ea0c13933b746e034906b63aee8c24688221d33d678c7d8d567a8d | ktakashi/sagittarius-scheme | prng.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
;;; sagittarius/crypto/random/prng.scm - Pseudo random generator
;;;
Copyright ( c ) 2022 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met... | null | https://raw.githubusercontent.com/ktakashi/sagittarius-scheme/be6f19788f67251b5bc154034591a0d60c52098c/ext/crypto/sagittarius/crypto/random/prng.scm | scheme | coding : utf-8 ; -*-
sagittarius/crypto/random/prng.scm - Pseudo random generator
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
... | Copyright ( c ) 2022 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
#!nounbound
(library (sagittarius crypto random prn... |
0405ee65496653c39d78e5a8e0bd07c240a86551a37844373b1b6bcf01db86c3 | comby-tools/comby | configuration.ml | open! Core
open! Import
include Patdiff_kernel.Configuration
module On_disk = struct
module Affix = struct
(* Simply a prefix or a suffix. Might come with an associated style. *)
type t =
{ text : string option [@sexp.option]
; style : Format.Style.t list option [@sexp.option]
}
[@@de... | null | https://raw.githubusercontent.com/comby-tools/comby/fa71ea540855ba5bd48d948dd8c8ff034714348d/lib/app/vendored/patdiff/lib/src/configuration.ml | ocaml | Simply a prefix or a suffix. Might come with an associated style.
Lines
Padding for prefixes: They should all be the same length.
Words
Header
Final
prints errors to stderr
Load config file if it exists, use default if not
specified file
~/.patdiff exists
load prints warnings to stderr. This is de... | open! Core
open! Import
include Patdiff_kernel.Configuration
module On_disk = struct
module Affix = struct
type t =
{ text : string option [@sexp.option]
; style : Format.Style.t list option [@sexp.option]
}
[@@deriving quickcheck, sexp]
let blank = { text = None; style = None }
l... |
5c7db58bcc5a64740c1a9d60fd2385238f7dccff5ef01c67893c016126921961 | uxbox/uxbox-old | core.cljs | (ns ^:figwheel-always uxbox.core
(:require
[uxbox.ui :as ui]
[uxbox.ui.navigation :as nav]
[uxbox.data.db :as db]
[hodgepodge.core :refer [local-storage]]))
(enable-console-print!)
(def $el (.getElementById js/document "app"))
(defn start!
[location]
(let [conn (db/create)
storage... | null | https://raw.githubusercontent.com/uxbox/uxbox-old/9c3c3c406a6c629717cfc40e3da2f96df3bdebf7/src/frontend/uxbox/core.cljs | clojure | (ns ^:figwheel-always uxbox.core
(:require
[uxbox.ui :as ui]
[uxbox.ui.navigation :as nav]
[uxbox.data.db :as db]
[hodgepodge.core :refer [local-storage]]))
(enable-console-print!)
(def $el (.getElementById js/document "app"))
(defn start!
[location]
(let [conn (db/create)
storage... | |
e554dc9e9d9182ea951480c72bef4f87dc49319d8ba18ab43455157814745d9b | zcaudate-me/lein-repack | graph.clj | (ns leiningen.repack.manifest.graph
(:require [vinyasa.maven.file :refer [*sep*]]
[vinyasa.maven :as maven]))
(defn resolve-with-ns [x dependencies project]
(or (->> dependencies
(map #(if (maven/resolve-with-deps x % :repositories
korra assumes
... | null | https://raw.githubusercontent.com/zcaudate-me/lein-repack/1eb542d66a77f55c4b5625783027c31fd2dddfe5/src/leiningen/repack/manifest/graph.clj | clojure | repositories is a
collection of pairs | (ns leiningen.repack.manifest.graph
(:require [vinyasa.maven.file :refer [*sep*]]
[vinyasa.maven :as maven]))
(defn resolve-with-ns [x dependencies project]
(or (->> dependencies
(map #(if (maven/resolve-with-deps x % :repositories
korra assumes
map , accepts a
... |
855777012ce85c8ab4ef093269032149b010d08589feb28181bd7f80b2a43d38 | zotonic/zotonic | filter_log_format_stack.erl | -module(filter_log_format_stack).
-export([
log_format_stack/2
]).
log_format_stack(undefined, _Context) ->
undefined;
log_format_stack(Stack, Context) ->
S1 = z_html:escape(Stack),
S2 = re:replace(
S1,
"^((.*)@)?(.*)?$",
"<b>\\2</b> <small class='text-muted'>\\3</small>",
... | null | https://raw.githubusercontent.com/zotonic/zotonic/852f627c28adf6e5212e8ad5383d4af3a2f25e3f/apps/zotonic_mod_logging/src/filters/filter_log_format_stack.erl | erlang | -module(filter_log_format_stack).
-export([
log_format_stack/2
]).
log_format_stack(undefined, _Context) ->
undefined;
log_format_stack(Stack, Context) ->
S1 = z_html:escape(Stack),
S2 = re:replace(
S1,
"^((.*)@)?(.*)?$",
"<b>\\2</b> <small class='text-muted'>\\3</small>",
... | |
4c0c00670d38dce2dde01d7a34ed4e91db5d309b6ae2c4a6616f226586885eb4 | egri-nagy/lambdago | policy.clj | (ns lgo.analysis.policy
"Functions for working with KataGo's policy output table."
(:require [clojure.string :refer [join]]
[clojure.math.numeric-tower :as math]
[lgo.stats :refer [normalize
KL-divergence]]))
converting from GTP coordinates to KataGo 's policy table... | null | https://raw.githubusercontent.com/egri-nagy/lambdago/a34906d0ba033bcc0961e606312df4302ca86d25/src/lgo/analysis/policy.clj | clojure | ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
policy comparison by KL-divergence ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
shall we do this or not?
HIT RATE ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
gets the policy entry
associating numbers to policy entries
cause it's sorted
| (ns lgo.analysis.policy
"Functions for working with KataGo's policy output table."
(:require [clojure.string :refer [join]]
[clojure.math.numeric-tower :as math]
[lgo.stats :refer [normalize
KL-divergence]]))
(defn policy-table-index
"Converting a GTP? move to a pol... |
e0b181eed18e4be402cb7163b800d05b007723f52a453e3dcb3c1948bc537fab | granule-project/granule | Def.hs | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DataKinds #
# LANGUAGE StandaloneDeriving #
# LANGUAGE UndecidableInstances #
# LANGUAGE RecordWildCards #
module Language.Granule.Syntax.Def where
... | null | https://raw.githubusercontent.com/granule-project/granule/e6d8314b0e444eafe33a689e041a15590dcc69dd/frontend/src/Language/Granule/Syntax/Def.hs | haskell | # LANGUAGE DeriveDataTypeable #
| Top-level ASTs
| Comprise a list of data type declarations and a list
| of expression definitions
| where `v` is the type of values and `a` annotations
map from names to the module hiding them
| Function definitions
| A list of equations
| Single equation of a function
| Data ... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
# LANGUAGE FlexibleContexts #
# LANGUAGE DeriveGeneric #
# LANGUAGE DataKinds #
# LANGUAGE StandaloneDeriving #
# LANGUAGE UndecidableInstances #
# LANGUAGE RecordWildCards #
module Language.Granule.Syntax.Def where
import Data.List ((\\), delete)
impo... |
75482664b23e9a6ef732860c25d83a13ee5dd0280c57e3df52ba3e6780bf8025 | barrel-db/hlc | hlc.erl | %-*- mode: 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 /.
%%
%%
%% @doc
hlc
%%
implements the Hybrid Logical Clock outlined in
" Logical Physical Clocks and Consistent Sna... | null | https://raw.githubusercontent.com/barrel-db/hlc/2f6a430e7403a24bf132658f047fec7c3d2f0a8f/src/hlc.erl | erlang | -*- mode: erlang -*-
@doc
Distributed Databases", available online at
-reports/2014-04.pdf.
An hybrid logical clock is available as a linked process. Objects of this
type model causality while maintaining a relation to physical time.
Roughly speaking, timestamps consist of the largest wall clock time amo... | 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 /.
hlc
implements the Hybrid Logical Clock outlined in
" Logical Physical Clocks and Consistent Snapshots in Globally
-module(hlc).
We do ... |
424127595b0ab969148ae1d84a2995efcae98cb705add8e6809ae65090846b0a | zehaochen19/vanilla-lang | Examples.hs | {-# LANGUAGE OverloadedStrings #-}
module Vanilla.Examples where
import Vanilla.Syntax.Cons
import Vanilla.Syntax.Decl
import Vanilla.Syntax.Expr
import Vanilla.Syntax.Program
import Vanilla.Syntax.Type
-- | Data types
-- | List declaration
listDec :: Declaration
listDec =
Declaration
"List"
["A"]
[ C... | null | https://raw.githubusercontent.com/zehaochen19/vanilla-lang/d1e2bbd3125151ce2c0ddc20f735d3a55aeb6bc8/src/Vanilla/Examples.hs | haskell | # LANGUAGE OverloadedStrings #
| Data types
| List declaration
| Nat declaration
| Bool declaration
| Unit declaration
| Product delaration
| Sum declaration
> ( TVar " B " -- > TVar " B " ) )
The continuation monad
> TVar " R " ) -- > TVar " R " ) )
> TVar " R " ) -- > TVar " A " )
polymorphic let
> TVar ... |
module Vanilla.Examples where
import Vanilla.Syntax.Cons
import Vanilla.Syntax.Decl
import Vanilla.Syntax.Expr
import Vanilla.Syntax.Program
import Vanilla.Syntax.Type
listDec :: Declaration
listDec =
Declaration
"List"
["A"]
[ Constructor "Nil" [],
Constructor "Cons" [TVar "A", tdata' "List" [T... |
e50e9bf06934b744e6018cd6dac7cc5040c2c5cfd23de8bebbe8c24aa17f3dfb | max-au/lambda | lambda_app.erl | %% @doc
%% Lambda application callback module.
%% @end
-module(lambda_app).
-compile(warn_missing_spec).
-author("").
-export([
start/2,
stop/1
]).
-behaviour(application).
-spec start(normal, []) -> {ok, pid()} | {error, {already_started, pid()}}.
start(normal, []) ->
lambda_sup:start_link().
-spec st... | null | https://raw.githubusercontent.com/max-au/lambda/53d9ab894156f5b15bbf1ad774449bb877588144/src/lambda_app.erl | erlang | @doc
Lambda application callback module.
@end | -module(lambda_app).
-compile(warn_missing_spec).
-author("").
-export([
start/2,
stop/1
]).
-behaviour(application).
-spec start(normal, []) -> {ok, pid()} | {error, {already_started, pid()}}.
start(normal, []) ->
lambda_sup:start_link().
-spec stop(undefined) -> ok.
stop(undefined) ->
ok.
|
a8fad8435cee7acd869d14617a9b4b144974d6651d654f4f1184860921ec3ec3 | Rhywun/get-programming-with-haskell | Lesson17.hs | module Lesson17 where
import Data.List
import Data.Semigroup ( Semigroup
, (<>)
)
-- Consider this
-- Can we do better?
ct1 :: String
ct1 = "this" ++ " " ++ "is" ++ " " ++ "a" ++ " " ++... | null | https://raw.githubusercontent.com/Rhywun/get-programming-with-haskell/b9cf06f725b2ef038d69ed49f7d2900f55e98ca3/Unit03/Lesson17.hs | haskell | Consider this
Can we do better?
Intro to composability - combining functions
3
3
minimum' "electric" -- 'c'
maximum' "electric" -- 't'
True
False
True
False
QC1
True
True
Combining like types: Semigroups
5
5
No, because division can return a Double.
Guards
Red <> Yellow -- Orange
Red <... | module Lesson17 where
import Data.List
import Data.Semigroup ( Semigroup
, (<>)
)
ct1 :: String
ct1 = "this" ++ " " ++ "is" ++ " " ++ "a" ++ " " ++ "bit" ++ " " ++ "much"
ct1' = mconca... |
b76c03c6803417eacc02508d7dcba94673672d0146e4fad7b1cfa63a34d3e139 | samply/blaze | impl_test.clj | (ns blaze.fhir.spec.impl-test
(:require
[blaze.fhir.spec.impl :as impl]
[blaze.fhir.spec.impl-spec]
[blaze.fhir.spec.impl.specs :as specs]
[blaze.fhir.spec.impl.util-spec]
[blaze.fhir.spec.impl.xml :as xml]
[blaze.fhir.spec.impl.xml-spec]
[blaze.fhir.spec.type :as type]
[blaze.fhir.str... | null | https://raw.githubusercontent.com/samply/blaze/6441a0a2f988b8784ed555c1d20f634ef2df7e4a/modules/fhir-structure/test/blaze/fhir/spec/impl_test.clj | clojure | (ns blaze.fhir.spec.impl-test
(:require
[blaze.fhir.spec.impl :as impl]
[blaze.fhir.spec.impl-spec]
[blaze.fhir.spec.impl.specs :as specs]
[blaze.fhir.spec.impl.util-spec]
[blaze.fhir.spec.impl.xml :as xml]
[blaze.fhir.spec.impl.xml-spec]
[blaze.fhir.spec.type :as type]
[blaze.fhir.str... | |
6de945e65c1925f6c6f0975fe2104d5cbbd699ad9ac8d9337fef13b3319791e3 | haskell/aeson | UnescapePure.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE CPP #
{-# LANGUAGE MultiWayIf #-}
module Data.Aeson.Parser.UnescapePure
( unescapeText
) where
import Control.Exception (throwIO, try)
import Data.Bits (shiftL, shiftR, (.&.), (.|.))
import Data.ByteString ... | null | https://raw.githubusercontent.com/haskell/aeson/84bd935eee4f9cd26fdbc70b365f974c4caadc0d/src-pure/Data/Aeson/Parser/UnescapePure.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE MultiWayIf #
-----------------------------------------------------------------------------
unescapeTextIO
-----------------------------------------------------------------------------
This function is generated using staged-streams
See: -streams-unicode/src/Unicode/JSON.hs
we... | # LANGUAGE CPP #
module Data.Aeson.Parser.UnescapePure
( unescapeText
) where
import Control.Exception (throwIO, try)
import Data.Bits (shiftL, shiftR, (.&.), (.|.))
import Data.ByteString (ByteString)
import Data.Text ... |
41eeb282dcea09d8a0adae1a8c1eb20f0f346b94bf300b1e0715c4d1c0f8f896 | basho-labs/riak_explorer | re_sup.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2015 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may ob... | null | https://raw.githubusercontent.com/basho-labs/riak_explorer/3d06ca2b14a57ed2850e56efc280d7e5b5f4bbbc/src/re_sup.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2015 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
-module... |
8b527f6ba31f5dadbe2b9c93b57ce954f4a26b934d57c3880a53ff77d827c959 | ragkousism/Guix-on-Hurd | utils.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2012 , 2013 , 2014 , 2015 , 2016 < >
Copyright © 2014 < >
Copyright © 2016 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public Licen... | null | https://raw.githubusercontent.com/ragkousism/Guix-on-Hurd/e951bb2c0c4961dc6ac2bda8f331b9c4cee0da95/tests/utils.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2012 , 2013 , 2014 , 2015 , 2016 < >
Copyright © 2014 < >
Copyright © 2016 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (test-utils)
#:us... |
7855d6dd334bb78ff0267ac74416c0fa416d2dccd284531464a3d0255459d9a5 | LaurentMazare/ocaml-torch | finetuning.ml | Finetuning an ImageNet trained model .
This is based on the PyTorch tutorial " Finetuning Torchvision Models " .
The final accuracy is ~94 % .
The ants and bees dataset can be found at the following link .
Network weights can be found here :
-torch/releases/download/v0.1-u... | null | https://raw.githubusercontent.com/LaurentMazare/ocaml-torch/a82b906a22c7c23138af16fab497a08e5167d249/examples/pretrained/finetuning.ml | ocaml | Precompute the last layer of the pre-trained model on the whole dataset.
Compute the cross-entropy loss.
Compute the validation error. | Finetuning an ImageNet trained model .
This is based on the PyTorch tutorial " Finetuning Torchvision Models " .
The final accuracy is ~94 % .
The ants and bees dataset can be found at the following link .
Network weights can be found here :
-torch/releases/download/v0.1-u... |
e6af8ef020a38d240e25d3cbe47496e3721dc6fb0908b663085c8409067165e9 | nervous-systems/kvlt | middleware.cljc | (ns kvlt.middleware
(:require [#?(:clj clojure.edn :cljs cljs.reader) :as edn]
[kvlt.middleware.util :as util #? (:clj :refer :cljs :refer-macros) [defmw]]
[kvlt.util #? (:clj :refer :cljs :refer-macros) [with-doc-examples!]]
[kvlt.platform.util :as platform.util]
[cloj... | null | https://raw.githubusercontent.com/nervous-systems/kvlt/26fe43eb9de6d7cc7ad8a466953fa0ffe09889ca/src/kvlt/middleware.cljc | clojure | serious business | (ns kvlt.middleware
(:require [#?(:clj clojure.edn :cljs cljs.reader) :as edn]
[kvlt.middleware.util :as util #? (:clj :refer :cljs :refer-macros) [defmw]]
[kvlt.util #? (:clj :refer :cljs :refer-macros) [with-doc-examples!]]
[kvlt.platform.util :as platform.util]
[cloj... |
26ecbe11971d05249db547bd057a60a3a6a836ff7cedccf2914d1e868ce98625 | coalton-lang/coalton | dyadic.lisp | ;;; dyadic.lisp
;;;
;;; Dyadic rationals meant for implementing big floats
;;; It is not exported into the math package as it is a niche numeric type
(coalton-library/utils::defstdlib-package #:coalton-library/math/dyadic
(:use
#:coalton
#:coalton-library/builtin
#:coalton-library/classes
#:coa... | null | https://raw.githubusercontent.com/coalton-lang/coalton/66b504fe662ca56a1fd7e0cbb4b046c3182fa8a8/library/math/dyadic.lisp | lisp | dyadic.lisp
Dyadic rationals meant for implementing big floats
It is not exported into the math package as it is a niche numeric type |
(coalton-library/utils::defstdlib-package #:coalton-library/math/dyadic
(:use
#:coalton
#:coalton-library/builtin
#:coalton-library/classes
#:coalton-library/math/arith
#:coalton-library/math/integral
#:coalton-library/math/real)
(:local-nicknames
(#:bits #:coalton-library/bits))... |
da6fc34e797c6a5828eb020e9855818348be8f2ec9297d913e616b049bbd3479 | benoitc/opencouch | couch_event_sup.erl | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an " A... | null | https://raw.githubusercontent.com/benoitc/opencouch/fef7be42f37515a6f73e2dfbab74fea75188e415/src/couch_event_sup.erl | erlang | use this file except in compliance with the License. You may obtain a copy of
the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations... | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
The purpose of this module is to allow event handlers to particpate in Erlang
handler fails . The process , when shutdown , deregisters the event handle... |
e1a9fe37db8a404b9c354a8faaa0650a787afe01eaded308f5f6f1821f326a53 | qkrgud55/ocamlmulti | quicksort.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/qkrgud55/ocamlmulti/74fe84df0ce7be5ee03fb4ac0520fb3e9f4b6d1f/testsuite/tests/misc-unsafe/quicksort.ml | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ I d : quicksort.ml 11156 2011 - 07 ... |
3b7a1f2c2b349069fe1d5432b3e9a2ec5cde029a958a49d33d150f40486fc98f | erlangonrails/devdb | erlydtl_functional_tests.erl | %%%-------------------------------------------------------------------
%%% File: erlydtl_tests.erl
@author < > [ ]
@author < >
2008 ,
%%% @doc ErlyDTL test suite
%%% @end
%%%
%%% The MIT License
%%%
Copyright ( c ) 2007
%%%
%%% Permission is hereby granted, free of charge, to an... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/erlydtl/src/tests/erlydtl_functional_tests.erl | erlang | -------------------------------------------------------------------
File: erlydtl_tests.erl
@doc ErlyDTL test suite
@end
The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use,... | @author < > [ ]
@author < >
2008 ,
Copyright ( c ) 2007
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED... |
e2e63ede9bba33da9db6b59c6de03001f8b840805e52295755aa7049649c2df4 | wireless-net/erlang-nommu | erl_expand_records_SUITE.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2005 - 2012 . 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 Pub... | null | https://raw.githubusercontent.com/wireless-net/erlang-nommu/79f32f81418e022d8ad8e0e447deaea407289926/lib/stdlib/test/erl_expand_records_SUITE.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 2005 - 2012 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(erl_expand_records_SUITE).
-ifde... |
8664aa985b39638961c474c8bc3e53101164082cd4ab0b5cacdf9c692221b29e | TerrorJack/ghc-alter | hGetChar001.hs | import System.IO
main = do
hSetBuffering stdout NoBuffering
putStr "Enter an integer: "
x1 <- readLine
putStr "Enter another integer: "
x2 <- readLine
putStr ("Their sum is " ++ show (read x1 + read x2 :: Int) ++ "\n")
where readLine = do
eof <- isEOF
if eof then return [] else do
... | null | https://raw.githubusercontent.com/TerrorJack/ghc-alter/db736f34095eef416b7e077f9b26fc03aa78c311/ghc-alter/boot-lib/base/tests/IO/hGetChar001.hs | haskell | import System.IO
main = do
hSetBuffering stdout NoBuffering
putStr "Enter an integer: "
x1 <- readLine
putStr "Enter another integer: "
x2 <- readLine
putStr ("Their sum is " ++ show (read x1 + read x2 :: Int) ++ "\n")
where readLine = do
eof <- isEOF
if eof then return [] else do
... | |
324b8be2d751b1825a842df594051453e50828a95129f8622ae010210f936afc | quephird/saml-test | routes.clj | (ns saml-test.routes
(:require [taoensso.timbre :as timbre :refer [log info trace debug warn error]]
[compojure.core :refer [defroutes routes GET POST]]
[saml20-clj.routes :as saml-routes]
[saml20-clj.sp :as saml-sp]
[saml20-clj.shared :as saml-shared]
[saml... | null | https://raw.githubusercontent.com/quephird/saml-test/e561e1423d8cc36264b7e4318e6e6100760f11b1/src/saml_test/routes.clj | clojure | (debug (":secret-key-spec: %s" (:secret-key-spec mutables))) | (ns saml-test.routes
(:require [taoensso.timbre :as timbre :refer [log info trace debug warn error]]
[compojure.core :refer [defroutes routes GET POST]]
[saml20-clj.routes :as saml-routes]
[saml20-clj.sp :as saml-sp]
[saml20-clj.shared :as saml-shared]
[saml... |
7d2aad601a9efd42715565136247c2ad33dd1ce3f8b829cbd579e02a66bf9a26 | aryx/lfs | lfs_persistent.mli |
There are multiple libraries to make LFS data structures persistent :
* - GDBM
* - berkeley DB
* - QDBM .
*
* Some of those libaries support " transactions " by exporting funtions such as commit / abort .
* Those functions must then be used by callers such as that will need
* to commit or... | null | https://raw.githubusercontent.com/aryx/lfs/b931530c7132b77dfaf3c99d452dc044fce37589/lfs_real/lfs_persistent.mli | ocaml | only for transactions |
There are multiple libraries to make LFS data structures persistent :
* - GDBM
* - berkeley DB
* - QDBM .
*
* Some of those libaries support " transactions " by exporting funtions such as commit / abort .
* Those functions must then be used by callers such as that will need
* to commit or... |
41dbedefb665ecc4f89f1d47858b0eb546d7dce4bb61feeb175c8ab424c5e7e0 | josephwilk/musical-creativity | sorcerer.clj | (ns musical-creativity.allusion.sorcerer
(:require [musical-creativity.util :refer :all]
[musical-creativity.events :as events]))
(def *choices* '(chopin-1 bach-1 bach-2 bach-3 bach-4 beethoven-1 beethoven-2 boccherini-1 chausson-1 schumann-1))
(def chopin-1 '((0 59 1000 1 64)(1000 64 1500 1 64)(2500 63... | null | https://raw.githubusercontent.com/josephwilk/musical-creativity/c2e6aab2a26d69ee2e51f4fad84fa3a71805e6ca/src/musical_creativity/allusion/sorcerer.clj | clojure | (ns musical-creativity.allusion.sorcerer
(:require [musical-creativity.util :refer :all]
[musical-creativity.events :as events]))
(def *choices* '(chopin-1 bach-1 bach-2 bach-3 bach-4 beethoven-1 beethoven-2 boccherini-1 chausson-1 schumann-1))
(def chopin-1 '((0 59 1000 1 64)(1000 64 1500 1 64)(2500 63... | |
6bf24dc577c98a67556a237879045cbfd19677b95894a4f7ed01fd60ea48bb71 | khmelevskii/emotion-cljs | core.clj | (ns emotion.core
(:require
[emotion.util :as util]))
(defmacro defcss
"Create Emotion css."
([sym css]
(let [css (util/map->camel-map css)]
`(def ~sym
(emotion.core/create-css ~css))))
([sym props & css]
(let [props-sym (gensym "props")]
`(defn ~sym [~props-sym]
(let [{:keys ... | null | https://raw.githubusercontent.com/khmelevskii/emotion-cljs/4baaccfa19c0808e11f3a8e838f62ac6382b8860/src/emotion/core.clj | clojure | (ns emotion.core
(:require
[emotion.util :as util]))
(defmacro defcss
"Create Emotion css."
([sym css]
(let [css (util/map->camel-map css)]
`(def ~sym
(emotion.core/create-css ~css))))
([sym props & css]
(let [props-sym (gensym "props")]
`(defn ~sym [~props-sym]
(let [{:keys ... | |
77f6cecd18b1a384adc47b052329c6e770a9ab6532d2ed7ff1d870a2d19c6aff | fizruk/miso-aframe | Scene.hs | {-# LANGUAGE OverloadedStrings #-}
module Miso.AFrame.Core.Scene where
import Miso.AFrame.Core.Types
import Miso.AFrame.Core.Internal.Utils
scene :: Entity action
scene = node_ "a-scene"
| null | https://raw.githubusercontent.com/fizruk/miso-aframe/eb608e86fd71f01b397cde04124ff3a949e843be/src/Miso/AFrame/Core/Scene.hs | haskell | # LANGUAGE OverloadedStrings # | module Miso.AFrame.Core.Scene where
import Miso.AFrame.Core.Types
import Miso.AFrame.Core.Internal.Utils
scene :: Entity action
scene = node_ "a-scene"
|
37ed4aca4bd74b540d5941a244b8c5e59284bd42bc016bf1fb8e38541bcec720 | emqx/emqx | emqx_shared_sub_SUITE.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2018 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy o... | null | https://raw.githubusercontent.com/emqx/emqx/dbc10c2eed3df314586c7b9ac6292083204f1f68/apps/emqx/test/emqx_shared_sub_SUITE.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2018 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(emqx_shared_sub_SUITE).
-compile(export_all).
-compile(nowarn_export_all).
-include_li... |
15089fce17304d0758fff19b7023cf4cfeaf44fc1b3d188a926f7d276c70d2d3 | Kalimehtar/gtk-cffi | file-chooser.lisp | (in-package :gtk-cffi)
(defclass file-chooser (object)
())
(defcenum file-chooser-action
:open :save :select-folder :create-folder)
(defslots file-chooser
filename :string
action file-chooser-action
local-only :boolean
select-multiple :boolean
show-hidden :boolean
do-overwrite-confirmation :boolean
... | null | https://raw.githubusercontent.com/Kalimehtar/gtk-cffi/fbd8a40a2bbda29f81b1a95ed2530debfe2afe9b/gtk/file-chooser.lisp | lisp | (in-package :gtk-cffi)
(defclass file-chooser (object)
())
(defcenum file-chooser-action
:open :save :select-folder :create-folder)
(defslots file-chooser
filename :string
action file-chooser-action
local-only :boolean
select-multiple :boolean
show-hidden :boolean
do-overwrite-confirmation :boolean
... | |
dfe49147549689c80c7fe8a1ea3478f905a661267068bc43372106d3762dab6e | athos/genuine-highlighter | rendering_rules.clj | (ns genuine-highlighter.rendering-rules)
(defn- maybe [x & args]
(when-not (nil? x)
(apply x args)))
(defn compose-rules [r1 r2]
(fn [type]
(fn [part]
(fn [x v]
(let [app (fn [r v] (-> r (maybe type) (maybe part) (maybe x v)))
v (or (app r1 v) v)]
(or (app r2 v) v))))... | null | https://raw.githubusercontent.com/athos/genuine-highlighter/2c7f6a996373a44125f5597b7444dfb18376bc5b/src/genuine_highlighter/rendering_rules.clj | clojure | (ns genuine-highlighter.rendering-rules)
(defn- maybe [x & args]
(when-not (nil? x)
(apply x args)))
(defn compose-rules [r1 r2]
(fn [type]
(fn [part]
(fn [x v]
(let [app (fn [r v] (-> r (maybe type) (maybe part) (maybe x v)))
v (or (app r1 v) v)]
(or (app r2 v) v))))... | |
70ef66ba4cf8724c7539708173d72fb59aaebea18a2c8f22b69384395d56e914 | KingoftheHomeless/in-other-words | ListenPrim.hs | # LANGUAGE CPP #
module Control.Effect.Type.ListenPrim
( -- * Effects
ListenPrim(..)
-- * Threading utilities
, threadListenPrim
, threadListenPrimViaClass
) where
import Control.Monad.Trans
import Control.Monad.Trans.Reader (ReaderT)
import Control.Monad.Trans.Except (ExceptT)
import qualified Control... | null | https://raw.githubusercontent.com/KingoftheHomeless/in-other-words/9c864c81beb4fdf71d363b6962db5c90275c57ef/src/Control/Effect/Type/ListenPrim.hs | haskell | * Effects
* Threading utilities
| A primitive effect that may be used for
interpreters of connected 'Control.Effect.Writer.Tell' and
'Control.Effect.Writer.Listen' effects.
This combines 'Control.Effect.Writer.Tell' and
'Control.Effect.Writer.Listen'. This may be relevant if there
are monad transformers that m... | # LANGUAGE CPP #
module Control.Effect.Type.ListenPrim
ListenPrim(..)
, threadListenPrim
, threadListenPrimViaClass
) where
import Control.Monad.Trans
import Control.Monad.Trans.Reader (ReaderT)
import Control.Monad.Trans.Except (ExceptT)
import qualified Control.Monad.Trans.State.Strict as SSt
import qualif... |
b5b3afc309855343b28d22937cdc6541ee459aadaf6b55c765051c78954781ad | davisp/couchdb | couch_replicator_job_sup.erl | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an " A... | null | https://raw.githubusercontent.com/davisp/couchdb/b0420f9006915149e81607615720f32f21c76725/src/couch_replicator/src/couch_replicator_job_sup.erl | erlang | use this file except in compliance with the License. You may obtain a copy of
the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations... | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
-module(couch_replicator_job_sup).
-behaviour(supervisor).
-export([init/1, start_link/0]).
-include("couch_db.hrl").
start_link() ->
supervisor:start... |
34583d0af3f9d36b363b245c27dd2dff276b329268bf153b28569a3ebad87202 | fourier/ppath | ppath.lisp | (defpackage ppath
(:use :cl :alexandria)
(:export
abspath
basename
commonprefix
dirname
exists
lexists
expanduser
expandvars
getatime
getmtime
getctime
getsize
isabs
isfile
isdir
islink
ismount
join
normcase
normpath
realpath
relpath
#-windows sam... | null | https://raw.githubusercontent.com/fourier/ppath/eb1a8173b4d1d691ea9a7699412123462f58c3ce/src/ppath.lisp | lisp | (defpackage ppath
(:use :cl :alexandria)
(:export
abspath
basename
commonprefix
dirname
exists
lexists
expanduser
expandvars
getatime
getmtime
getctime
getsize
isabs
isfile
isdir
islink
ismount
join
normcase
normpath
realpath
relpath
#-windows sam... | |
def2095dc8aef96181703034416a213d61adeb9ad09e3c2917ad11a03ca5c021 | ahrefs/devkit | extArg.ml |
open Printf
open Prelude
include Arg
let describe t name = function
| "" -> sprintf "<%s> %s" t name
| s when s.[0] = ' ' -> sprintf "<%s>%s" t s
| s -> s
let make_arg x =
fun name var desc ->
"-"^name,
x#store var,
sprintf "%s (default: %s)" (describe x#kind name desc) (x#show var)
let test_int f =... | null | https://raw.githubusercontent.com/ahrefs/devkit/559c2df8f6eacb091e0eac38f508c45b6567bdd8/extArg.ml | ocaml |
"-"^name,
Arg.Set_int var,
sprintf "%s (default: %i)" (describe "int" name desc) !var
let arg_str name ?desc var =
"-"^name,
Arg.Set_string var,
sprintf "%s (default: %s)" (describe "string" name desc) !var
|
open Printf
open Prelude
include Arg
let describe t name = function
| "" -> sprintf "<%s> %s" t name
| s when s.[0] = ' ' -> sprintf "<%s>%s" t s
| s -> s
let make_arg x =
fun name var desc ->
"-"^name,
x#store var,
sprintf "%s (default: %s)" (describe x#kind name desc) (x#show var)
let test_int f =... |
e2bb7bfaa40b92dee65ed41d5579317978d910f980df758d1b26d68cdc57a933 | mvdcamme/meta-tracing-JIT | trace-graph.scm | (module trace-graph racket
(provide make-graph-file)
(require racket/string)
(require "file-outputting.scm")
(define BASE_GRAPH_FILE "graph.gv")
(struct trace-files (guard-trace-files label-trace-files mp-tail-trace-files) #:transparent)
(struct label-trace-info (id node-name) #:transparent)
... | null | https://raw.githubusercontent.com/mvdcamme/meta-tracing-JIT/640af917e473f3793ab12791dcb2c80f617b8a0d/trace-graph.scm | scheme | (module trace-graph racket
(provide make-graph-file)
(require racket/string)
(require "file-outputting.scm")
(define BASE_GRAPH_FILE "graph.gv")
(struct trace-files (guard-trace-files label-trace-files mp-tail-trace-files) #:transparent)
(struct label-trace-info (id node-name) #:transparent)
... | |
01debda10592504e62132426aa0e663b004d3ac8cc6e270111209e4cc5d80cbd | cl-fui/subtext | simplestream.lisp | (in-package :subtext)
;;------------------------------------------------------------------------------
;; simplestream - an unbuffered output stream
;;
(defclass simplestream (tb
trivial-gray-streams:fundamental-character-output-stream)
()
(:metaclass gobject-class))
;;==========================================... | null | https://raw.githubusercontent.com/cl-fui/subtext/28cfc31007664552257bd4d04370f7365030ab2e/src/gtk/simplestream.lisp | lisp | ------------------------------------------------------------------------------
simplestream - an unbuffered output stream
==============================================================================
------------------------------------------------------------------------------
(format t "line-col~&")
-------------... | (in-package :subtext)
(defclass simplestream (tb
trivial-gray-streams:fundamental-character-output-stream)
()
(:metaclass gobject-class))
(defmethod trivial-gray-streams:stream-write-char ((stream simplestream) char)
(let ((s (format nil "~C" char)))
(with-slots (iter anchor ) stream
(%gtb-get-iter-... |
06f40d2724ec7ae0f359efbfbfa260ae194b5256f09a824b48e1cedc0d5faf90 | imandra-ai/ocaml-opentelemetry | status_types.ml | [@@@ocaml.warning "-27-30-39"]
type status = {
code : int32;
message : bytes;
details : bytes list;
}
let rec default_status
?code:((code:int32) = 0l)
?message:((message:bytes) = Bytes.create 0)
?details:((details:bytes list) = [])
() : status = {
code;
message;
details;
}
| null | https://raw.githubusercontent.com/imandra-ai/ocaml-opentelemetry/62d1a9cec785186966e880c91c4c109875b0dd62/src/status_types.ml | ocaml | [@@@ocaml.warning "-27-30-39"]
type status = {
code : int32;
message : bytes;
details : bytes list;
}
let rec default_status
?code:((code:int32) = 0l)
?message:((message:bytes) = Bytes.create 0)
?details:((details:bytes list) = [])
() : status = {
code;
message;
details;
}
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.