_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 |
|---|---|---|---|---|---|---|---|---|
f10a31ee92192cf1d35e6e182da28136852bc238558365246bebbffebb0f7fd7 | mpieva/biohazard-tools | bam-rewrap.hs | -- Re-wrap alignments to obey the given length of the reference
-- sequence.
--
-- The idea is that a circular reference sequence has been extended
-- artificially to facilitate alignment. Now the declared length in the
-- header is wrong, and the alignments overhang the end. Here we split
those alignments into two... | null | https://raw.githubusercontent.com/mpieva/biohazard-tools/93959b6ad0dde2a760559fe82853ab78497f0452/src/bam-rewrap.hs | haskell | Re-wrap alignments to obey the given length of the reference
sequence.
The idea is that a circular reference sequence has been extended
artificially to facilitate alignment. Now the declared length in the
header is wrong, and the alignments overhang the end. Here we split
the sequence, then soft-mask out the i... | those alignments into two , one for the beginning , one for the end of
check the XA field . If it reports exactly one additional alignment ,
coordinates , we remove XA and set MAPQ to 37 .
import Bio.Bam
import Bio.Bam.Rmdup ( normalizeTo, wrapTo )
import Bio.Prelude
import Paths_biohazard_t... |
3f9a8ffa04d0b7cd8ec0f69626bb740cb3a99d86bcabaa42b0c76f647d89deaf | remixlabs/wasicaml | t062_fields3.ml | type r =
{ a : int;
b : float;
c : int
}
let f() =
let r1 = { a = 10; b = 11.0; c = 12 } in
Testprint.int "a" r1.a;
Testprint.float "b" r1.b;
Testprint.int "c" r1.c;
let r2 = { r1 with b = 13.0 } in
Testprint.int "a" r2.a;
Testprint.float "b" r2.b;
Testprint.int "c" r2.c
let () =
f()
| null | https://raw.githubusercontent.com/remixlabs/wasicaml/74ff72535aa8e49ab94a05d9c32c059ce264c1bb/test/t062_fields3.ml | ocaml | type r =
{ a : int;
b : float;
c : int
}
let f() =
let r1 = { a = 10; b = 11.0; c = 12 } in
Testprint.int "a" r1.a;
Testprint.float "b" r1.b;
Testprint.int "c" r1.c;
let r2 = { r1 with b = 13.0 } in
Testprint.int "a" r2.a;
Testprint.float "b" r2.b;
Testprint.int "c" r2.c
let () =
f()
| |
cbb63ccf5263eb6c18d63946049aa333a0d873b9ecca198556039409bae8ae55 | ocaml/ocamlbuild | external.ml | #use "internal_test_header.ml";;
#use "findlibonly_test_header.ml";;
#use "external_test_header.ml";;
let () = test "SyntaxFlag"
~options:[`use_ocamlfind; `package "camlp4.macro"; `syntax "camlp4o"]
~requirements:(package_exists "camlp4.macro")
~description:"-syntax for ocamlbuild"
~tree:[T.f "dummy.ml" ~conte... | null | https://raw.githubusercontent.com/ocaml/ocamlbuild/792b7c8abdbc712c98ed7e69469ed354b87e125b/testsuite/external.ml | ocaml | #use "internal_test_header.ml";;
#use "findlibonly_test_header.ml";;
#use "external_test_header.ml";;
let () = test "SyntaxFlag"
~options:[`use_ocamlfind; `package "camlp4.macro"; `syntax "camlp4o"]
~requirements:(package_exists "camlp4.macro")
~description:"-syntax for ocamlbuild"
~tree:[T.f "dummy.ml" ~conte... | |
33529410101e00a8b73d5b759e15ff54f8e8ee9ef4efd12d318739cd02692135 | BenjaminVanRyseghem/great-things-done | core.cljs | Copyright ( c ) 2015 , . All rights reserved .
; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( -1.0.php )
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; t... | null | https://raw.githubusercontent.com/BenjaminVanRyseghem/great-things-done/1db9adc871556a347426df842a4f5ea6b3a1b7e0/src/front/gtd/core.cljs | clojure | The use and distribution terms for this software are covered by the
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this notice, or any other, from this software.
Ens... | Copyright ( c ) 2015 , . All rights reserved .
Eclipse Public License 1.0 ( -1.0.php )
(ns gtd.core
(:require [gtd.app-menu :as app-menu]
[gtd.crypto :as crypto]
[gtd.db :as db]
[gtd.image-service :as image-service]
[gtd.import-db :as import-db]
[gtd... |
d3b1a29111b357330fbdcfe09df07fdfd09d6dff1e4df182d188d1b7bfb9c385 | typedclojure/typedclojure | utils.cljc | Copyright ( c ) , Rich Hickey & contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be b... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/1b3c9ef6786a792ae991c438ea8dca31175aa4a7/typed/cljc.analyzer/src/typed/cljc/analyzer/utils.cljc | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , Rich Hickey & contributors .
(ns typed.cljc.analyzer.utils
#?(:cljs (:require [cljs.analyzer :as cljs-ana]))
#?@(:cljs []
:default [(:import (clojure.lang IType IObj Var))]))
(defn into!
"Like into, but for transients"
[to from]
(reduce conj! to from))
(defn rseqv
"Same as (... |
f73bac12bd4c764f4efa9b3d804d066ced505521e71c70023cb07611b77bfda1 | racket/drracket | annotator.rkt | (module annotator scheme/base
(require (prefix-in kernel: syntax/kerncase)
gui-debugger/marks
mzlib/etc
(for-syntax scheme/base)
(only-in mzscheme [apply plain-apply])
)
(provide annotate-stx annotate-for-single-stepping)
(define (arglist-bindings arglist-s... | null | https://raw.githubusercontent.com/racket/drracket/2d7c2cded99e630a69f05fb135d1bf7543096a23/drracket/gui-debugger/annotator.rkt | racket | Returns a list of pairs `(,variable-name-stx ,variable-value). Each
item in the list is a shadowed instance of a variable with the given
annotate-for-single-stepping uses annotate-stx to create an annotated
of a single stepping debugger.
BREAK?, BREAK-BEFORE, BREAK-AFTER are inserted into the resulting syntax... | (module annotator scheme/base
(require (prefix-in kernel: syntax/kerncase)
gui-debugger/marks
mzlib/etc
(for-syntax scheme/base)
(only-in mzscheme [apply plain-apply])
)
(provide annotate-stx annotate-for-single-stepping)
(define (arglist-bindings arglist-s... |
1c1384073c6185e75f84c131304130181488e4b5485c822e8800a8042e6336d8 | silentsignal/sslproxy | pcap_writer.erl | -module(pcap_writer).
-record(pcap_fd, {io_dev}).
-export([open/3, write_packet/2, write_packet/3, write_packet/4, close/1]).
-define(MAGIC_NUMBER, 16#a1b2c3d4).
-define(VERSION_MAJOR, 2).
-define(VERSION_MINOR, 4).
open(Filename, SnapLength, DataLinkType)
when is_integer(SnapLength), is_integer(DataLinkType) ->
... | null | https://raw.githubusercontent.com/silentsignal/sslproxy/9ce8af9825049f3ff36b9ea5386c82b1e1e57dc0/pcap_writer.erl | erlang | -module(pcap_writer).
-record(pcap_fd, {io_dev}).
-export([open/3, write_packet/2, write_packet/3, write_packet/4, close/1]).
-define(MAGIC_NUMBER, 16#a1b2c3d4).
-define(VERSION_MAJOR, 2).
-define(VERSION_MINOR, 4).
open(Filename, SnapLength, DataLinkType)
when is_integer(SnapLength), is_integer(DataLinkType) ->
... | |
df0e9dbea8387209800ad3c20b4856ac246bcb771aa4938e77bc4a94284a6692 | rvantonder/hack_parallel | memory.ml | * Copyright ( c ) 2016 - present , Facebook , Inc.
Modified work Copyright ( c ) 2018 - 2019 Rijnard van Tonder
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree .
Modified work Copyright (c) 2018-2019 Rijnard van Tonder
This... | null | https://raw.githubusercontent.com/rvantonder/hack_parallel/c9d0714785adc100345835c1989f7c657e01f629/src/interface/memory.ml | ocaml | * Copyright ( c ) 2016 - present , Facebook , Inc.
Modified work Copyright ( c ) 2018 - 2019 Rijnard van Tonder
This source code is licensed under the MIT license found in the
LICENSE file in the root directory of this source tree .
Modified work Copyright (c) 2018-2019 Rijnard van Tonder
This... | |
7d3b3001ce8dcec1a05e53dbf4297a2b1a05e57ca22e0ad1bc68d31ec1b938a0 | andrewmcveigh/cljs-time | dce_compile_test.cljs | (ns cljs-time.dce-compile-test
(:require
;; [cljs-time.core :as time]
[cljs-time.format :as format]
))
( .log js / console ( time / date - time 2014 ) )
;; (+ 1 1)
( format / parse ( format / formatters : basic - date ) " 20140808 " )
;; (format/formatters :basic-date)
( def d1 ( format / parse ( fo... | null | https://raw.githubusercontent.com/andrewmcveigh/cljs-time/7f86226ef2bc5e1c8e00ab9c36096e76f84a73e1/compile/cljs_time/dce_compile_test.cljs | clojure | [cljs-time.core :as time]
(+ 1 1)
(format/formatters :basic-date)
(.log js/console d1)
(format/unparse (format/formatters :basic-date) d1)
(format/unparse (format/formatters :basic-date) d1) | (ns cljs-time.dce-compile-test
(:require
[cljs-time.format :as format]
))
( .log js / console ( time / date - time 2014 ) )
( format / parse ( format / formatters : basic - date ) " 20140808 " )
( def d1 ( format / parse ( format / formatters : basic - date ) " 20140808 " ) )
|
4beaa4a75ef4658f891af83a80352b03413838984d54de2b07b1485e6ad2d208 | mokus0/junkbox | Quine3.hs | import Data.Char
main = do
putStr (map chr src)
print src
-- src contains 'ord'-coded data of the whole program up to and including
-- "src = " in its definition. The rest is filled in by 'print src' above.
src :: [Int]
src = [105,109,112,111,114,116,32,68,97,116,97,46,67,104,97,114,10,10,109,97,105,110,32,6... | null | https://raw.githubusercontent.com/mokus0/junkbox/151014bbef9db2b9205209df66c418d6d58b0d9e/quine/Quine3.hs | haskell | src contains 'ord'-coded data of the whole program up to and including
"src = " in its definition. The rest is filled in by 'print src' above. | import Data.Char
main = do
putStr (map chr src)
print src
src :: [Int]
src = [105,109,112,111,114,116,32,68,97,116,97,46,67,104,97,114,10,10,109,97,105,110,32,61,32,100,111,10,32,32,32,32,112,117,116,83,116,114,32,40,109,97,112,32,99,104,114,32,115,114,99,41,10,32,32,32,32,112,114,105,110,116,32,115,114,99,10... |
91741c9af00ef3602098b4b0e37c541a66f1ed205527b238c058933b6c314a48 | sicmutils/sicmutils | connection_test.cljc | #_"SPDX-License-Identifier: GPL-3.0"
(ns sicmutils.calculus.connection-test
(:refer-clojure :exclude [+ - * /])
(:require [clojure.test :refer [is deftest testing use-fixtures]]
[sicmutils.abstract.function :as af]
[sicmutils.calculus.basis :as b]
[sicmutils.calculus.connection ... | null | https://raw.githubusercontent.com/sicmutils/sicmutils/f427fd073937faf62741fcdda6362f910ecda71f/test/sicmutils/calculus/connection_test.cljc | clojure | Thus, make simplified version.
Check answers from MTW p.213
t r theta phi
TODO: This one takes quite a while, so we only install this test
out. | #_"SPDX-License-Identifier: GPL-3.0"
(ns sicmutils.calculus.connection-test
(:refer-clojure :exclude [+ - * /])
(:require [clojure.test :refer [is deftest testing use-fixtures]]
[sicmutils.abstract.function :as af]
[sicmutils.calculus.basis :as b]
[sicmutils.calculus.connection ... |
dd4d19792f78f6b140943f3bd95988d9d2a69e2bd12212fae8a8d6f7997f3738 | bondy-io/bondy | bondy_admin_ready_http_handler.erl |
%% =============================================================================
%% bondy_admin_ready_http_handler.erl -
%%
Copyright ( c ) 2016 - 2022 Leapsight . All rights reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance wi... | null | https://raw.githubusercontent.com/bondy-io/bondy/a1267e7e5526db24f278e12315020753f3168b44/apps/bondy/src/bondy_admin_ready_http_handler.erl | erlang | =============================================================================
bondy_admin_ready_http_handler.erl -
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... |
Copyright ( c ) 2016 - 2022 Leapsight . 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(bondy_admin_ready_http_handler).
-include("http_api.hrl").
-export([init/2]).
init(Req0, Sta... |
5e5bb449230be830116dea04a4c3eb52b297ef61745c28fa1ac5e9ec38d6fb47 | clojure-interop/java-jdk | core.clj | (ns javax.xml.datatype.core
(:refer-clojure :only [require comment defn ->])
(:import ))
(require '[javax.xml.datatype.DatatypeConfigurationException])
(require '[javax.xml.datatype.DatatypeConstants$Field])
(require '[javax.xml.datatype.DatatypeConstants])
(require '[javax.xml.datatype.DatatypeFactory])
(require ... | null | https://raw.githubusercontent.com/clojure-interop/java-jdk/8d7a223e0f9a0965eb0332fad595cf7649d9d96e/javax.xml/src/javax/xml/datatype/core.clj | clojure | (ns javax.xml.datatype.core
(:refer-clojure :only [require comment defn ->])
(:import ))
(require '[javax.xml.datatype.DatatypeConfigurationException])
(require '[javax.xml.datatype.DatatypeConstants$Field])
(require '[javax.xml.datatype.DatatypeConstants])
(require '[javax.xml.datatype.DatatypeFactory])
(require ... | |
e36e010f37403f9906ab8b8da2a0c76d76330e988b2a9ec232aedbe3194dc26a | chumsley/jwacs | parse-javascript-yacc.lisp | ;;;; parse-javascript-yacc.lisp
;;;
;;; Use the cl-yacc package to parse javascript source text.
;;;
Copyright ( c ) 2005
;;; See LICENSE for full licensing details.
;;;
(in-package :jwacs)
(defun expand-hashtable-to-values (hashtable)
"Returns a list of all the values stored in a hashtable."
(let ((valuelist ... | null | https://raw.githubusercontent.com/chumsley/jwacs/c25adb3bb31fc2dc6e8c8a58346949ee400633d7/parse-javascript-yacc.lisp | lisp | parse-javascript-yacc.lisp
Use the cl-yacc package to parse javascript source text.
See LICENSE for full licensing details.
need to collect productions
(:print-derives-epsilon t)
(:print-states t)
(:print-goto-graph t)
(:print-lookaheads )
here we turn
into
(primary-expression
(... | Copyright ( c ) 2005
(in-package :jwacs)
(defun expand-hashtable-to-values (hashtable)
"Returns a list of all the values stored in a hashtable."
(let ((valuelist '()))
(maphash #'(lambda (k v)
(declare (ignore k))
(setf valuelist (cons v valuelist)))
hashtabl... |
c418ccbf249d10f86ece1101500ddafcbf019b644cbcc47c3fa68197db11f63f | ocaml-ppx/ocamlformat | unclosed_class6.ml | class c = (object end : object end
| null | https://raw.githubusercontent.com/ocaml-ppx/ocamlformat/9324ea439a77b4f3a31e9302b97ce1812cf8f17d/vendor/parser-recovery/test/expect/structure/unclosed_class6.ml | ocaml | class c = (object end : object end
| |
caaf3b6d819d27e6fe0e2577ef48b3fa495d8594a67f276490d6630ed8ce639b | tsloughter/kuberl | kuberl_v1_initializer.erl | -module(kuberl_v1_initializer).
-export([encode/1]).
-export_type([kuberl_v1_initializer/0]).
-type kuberl_v1_initializer() ::
#{ 'name' := binary()
}.
encode(#{ 'name' := Name
}) ->
#{ 'name' => Name
}.
| null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1_initializer.erl | erlang | -module(kuberl_v1_initializer).
-export([encode/1]).
-export_type([kuberl_v1_initializer/0]).
-type kuberl_v1_initializer() ::
#{ 'name' := binary()
}.
encode(#{ 'name' := Name
}) ->
#{ 'name' => Name
}.
| |
85b4f4b312042f51b3e24f35a086f96f2e2f8b43c0a145e98a7a6261d7fd1959 | zwizwa/staapl | rpn-macro.rkt | #lang racket/base
(require
"../rpn.rkt"
"../ns.rkt"
"../scat.rkt"
"op.rkt")
(provide macro
macro:
macro-push
macro->dictionary
)
;; Basic expression compilers. The code is right folded in rpn-lambda
;; (called from rpn-parse), so we use nested let expressions here.
(define-sy... | null | https://raw.githubusercontent.com/zwizwa/staapl/e30e6ae6ac45de7141b97ad3cebf9b5a51bcda52/coma/rpn-macro.rkt | racket | Basic expression compilers. The code is right folded in rpn-lambda
(called from rpn-parse), so we use nested let expressions here.
dictionary compiler
namespace
function = same as scat:
immediate
immediate program
anonymous compiler for recursive parse | #lang racket/base
(require
"../rpn.rkt"
"../ns.rkt"
"../scat.rkt"
"op.rkt")
(provide macro
macro:
macro-push
macro->dictionary
)
(define-syntax-rule (macro-push val p sub) (let ((p ((lit val) p))) sub))
(define-syntax-rule (macro . form) (ns (macro) . form))
(define-syntax-... |
6b67ee0324668e1a7b99981c4b0c73f39b286167a42ff591d178ffe298f87b03 | yzh44yzh/practical_erlang | worker.erl | -module(worker).
-behavior(gen_server).
-export([start_link/1, ping/1]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
TODO
| null | https://raw.githubusercontent.com/yzh44yzh/practical_erlang/c9eec8cf44e152bf50d9bc6d5cb87fee4764f609/12_supervisor/exercise/worker.erl | erlang | -module(worker).
-behavior(gen_server).
-export([start_link/1, ping/1]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
TODO
| |
cb65684f6932e254aa967f1d109ea1958fb6be5f3747b112fed3f44e5abd02ce | nodename/clevolution | cliskstring.clj | (ns clevolution.cliskstring
(:import (clojure.lang PersistentList)))
(defn make-with-arity
[arity f]
{:function f
:arity arity})
(defn replace-%
[expression child-expr]
(let [new-first (.replaceFirst ^String (first expression) "%"
(with-out-str (print child-expr)))]
... | null | https://raw.githubusercontent.com/nodename/clevolution/e0302d788826d6408076471a724fbe6352dddd82/src/clj/clevolution/cliskstring.clj | clojure | can't find mikera.util.Maths.java version that defines t(), needed for triangle-wave
[]
'triangle-wave)
also known as persistence
because their effects are not repeatable.
Our versions incorporate setting the corresponding seed
so that they will produce the same result whenever they are invoked.
(str "(ev-plas... | (ns clevolution.cliskstring
(:import (clojure.lang PersistentList)))
(defn make-with-arity
[arity f]
{:function f
:arity arity})
(defn replace-%
[expression child-expr]
(let [new-first (.replaceFirst ^String (first expression) "%"
(with-out-str (print child-expr)))]
... |
1e6a9871074a03191fd332efca14c3ec78bdd71438b822fd32319ec9a5ebaaea | takikawa/racket-ppa | scribble-lexer.rkt | #lang racket/base
(require "racket-lexer.rkt"
racket/contract
"lexer-contract.rkt"
racket/port)
(provide
(contract-out
[scribble-inside-lexer lexer*/c]
[scribble-lexer lexer*/c]
[make-scribble-inside-lexer (->* () (#:command-char (and/c char? (not/c (or/c #\] #\[)))) lexer*/c)]
[ma... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/26d6ae74a1b19258c9789b7c14c074d867a4b56b/share/pkgs/syntax-color-lib/syntax-color/scribble-lexer.rkt | racket | If we don't match rx:opener in a place where we might otherwise
match, and there is a "|" at that point, then a change later
could turn the non-match into a match, AND there could be
arbitrarily many Scheme tokens in between. So we carry the backup
position, use it as necessary (from places that might be betwe... | #lang racket/base
(require "racket-lexer.rkt"
racket/contract
"lexer-contract.rkt"
racket/port)
(provide
(contract-out
[scribble-inside-lexer lexer*/c]
[scribble-lexer lexer*/c]
[make-scribble-inside-lexer (->* () (#:command-char (and/c char? (not/c (or/c #\] #\[)))) lexer*/c)]
[ma... |
343c0606cd94242626ad7ed7ceb6d363200afaed4ce3fe1dcaa4461440e99b1a | vasyaod/parental-control | UsersConfigSpec.hs | module UsersConfigSpec where
import UsersConfig
import Config
import Test.Hspec
spec :: SpecWith ()
spec = describe "UsersConfig" $ do
it "should be read from file" $
do
config <- readUsersConfig' "./users-config.yml"
let userConf = head (users config)
return (login userConf)
... | null | https://raw.githubusercontent.com/vasyaod/parental-control/ec7c971b2d76a014a4f40cfd47a6defd08a73e42/schedule-daemon/test/UsersConfigSpec.hs | haskell | module UsersConfigSpec where
import UsersConfig
import Config
import Test.Hspec
spec :: SpecWith ()
spec = describe "UsersConfig" $ do
it "should be read from file" $
do
config <- readUsersConfig' "./users-config.yml"
let userConf = head (users config)
return (login userConf)
... | |
98d3887f2a1889203991fc813dd0db0863444c2f14d5330e769ce2c3fc455ea8 | baryluk/ex11 | example24.erl | -module(example24).
Copyright ( C ) 2004 by ( )
%% All rights reserved.
%% The copyright holder hereby grants the rights of usage, distribution
%% and modification of this software to everyone and for any purpose, as
%% long as this license and the copyright notice above are preserved and
%% not modified. There i... | null | https://raw.githubusercontent.com/baryluk/ex11/be8abc64ab9fb50611f93d6631fc33ffdee08fdb/widgets/example24.erl | erlang | All rights reserved.
The copyright holder hereby grants the rights of usage, distribution
and modification of this software to everyone and for any purpose, as
long as this license and the copyright notice above are preserved and
not modified. There is no warranty for this software.
A basic canvas | -module(example24).
Copyright ( C ) 2004 by ( )
started 2004 - 03 - 01 by ( )
-export([start/0]).
-import(sw, [xStart/1]).
-import(swCanvas, [newPen/4, draw/3, delete/2]).
-include("sw.hrl").
-define(bg, 16#ffffcc).
start() -> spawn(fun win/0).
win() ->
Display = xStart("3.2"),
Win = swTop... |
93a8103c1c1ebb01ed10dfba3b38594b89320cb0739466b415ccee5d9bce0367 | chefy-io/clojure-katas | bayesian.clj | (ns clojure-katas.bayesian
(:use incanter.core incanter.stats
incanter.io incanter.bayes incanter.charts))
(def critical-rating
($ :rating (read-dataset "./data/oscar_critical_rating.csv"
:header true)))
(def audience-rating
($ :rating (read-dataset "./data/oscar_audience_rating.csv"
... | null | https://raw.githubusercontent.com/chefy-io/clojure-katas/81efe02dfe5add9e10146e10dd2b34f072f7686e/src-answers/clojure_katas/optional/bayesian.clj | clojure | assume data | (ns clojure-katas.bayesian
(:use incanter.core incanter.stats
incanter.io incanter.bayes incanter.charts))
(def critical-rating
($ :rating (read-dataset "./data/oscar_critical_rating.csv"
:header true)))
(def audience-rating
($ :rating (read-dataset "./data/oscar_audience_rating.csv"
... |
747e58fea55cac393ca4b29b5ebfeb6205456facd2202cbf1119e14ec06c4377 | ocamllabs/vscode-ocaml-platform | custom_requests.mli | open Import
* Module to include custom requests to the language server , i.e. , requests
that are not originally in LSP but are customly added by a specific language
server .
If you want to add support for a custom request , add [ custom_request ] for
the custom request to the implementation o... | null | https://raw.githubusercontent.com/ocamllabs/vscode-ocaml-platform/acf500fde064639493b68d818a910fa258b8cc90/src/custom_requests.mli | ocaml | open Import
* Module to include custom requests to the language server , i.e. , requests
that are not originally in LSP but are customly added by a specific language
server .
If you want to add support for a custom request , add [ custom_request ] for
the custom request to the implementation o... | |
148ce6652feb5f64efea8f31c3b85a56195b2bcf81b28c3463cfe90292f7419b | offby1/anagrams | ports.scm | (module ports
mzscheme
(provide output-port
set-output-port!
status-port
set-status-port!)
(define output-port (current-output-port))
(define (set-output-port! p) (set! output-port p))
(define status-port (current-error-port))
(define (set-status-port! p) (set! status-port... | null | https://raw.githubusercontent.com/offby1/anagrams/0a7fbcff49a7dee6ed28333ecd354dd1fcff4bd6/scheme/drscheme/ports.scm | scheme | (module ports
mzscheme
(provide output-port
set-output-port!
status-port
set-status-port!)
(define output-port (current-output-port))
(define (set-output-port! p) (set! output-port p))
(define status-port (current-error-port))
(define (set-status-port! p) (set! status-port... | |
587aa4eb675adbbf29fc8cf9e2accf17357decf2771ad3b757303905b1ace72e | quchen/generative-art | Text.hs | module Draw.Text (
showTextAligned
, plotText
, PlotTextOptions (..)
, HAlign (..)
, VAlign (..)
, module Data.Default.Class
) where
import Data.Default.Class
import qualified Graphics.PlotFont as PF
import qualified Graphics.Rendering.Cairo as C
import Geometry
-- | Vertical alignment... | null | https://raw.githubusercontent.com/quchen/generative-art/bcd6d2e470848f5183fc1c01ea5e91ea31dc69e6/src/Draw/Text.hs | haskell | | Vertical alignment
| Horizontal alignment
is pretty wonky, you may have to sprinkle this with 'moveTo'/'moveToVec' or
'newPath'.
^ Horizontal alignment
^ Vertical alignment
^ Text
The text API is wonky, it kinda-sorta moves the pointer but not really.
newPath clears the path, so we get no leaks from the text... | module Draw.Text (
showTextAligned
, plotText
, PlotTextOptions (..)
, HAlign (..)
, VAlign (..)
, module Data.Default.Class
) where
import Data.Default.Class
import qualified Graphics.PlotFont as PF
import qualified Graphics.Rendering.Cairo as C
import Geometry
data VAlign = VTop | VC... |
859c4c4ddfc37251f4128ae0860e1320fc726c2009d57fbf23cb96b039c55854 | ckirkendall/ziad | brown.clj | (ns ziad.brown
(:require [cognitect.transit :as transit]
[clojure.java.io :as io]
[ziad.common :as common])
(:import [java.io File]))
(defn word-tokenizer [se] (re-seq #"\w+" se))
(defn sent-tokenizer [txt] (seq (. txt split "[\\.\\?\\;]\\s+")))
(defn brown-sent-tokenizer [txt]
(let [cle... | null | https://raw.githubusercontent.com/ckirkendall/ziad/0b5c832d38575b2d0c5ba833338f52e049ed5000/src/ziad/brown.clj | clojure | (ns ziad.brown
(:require [cognitect.transit :as transit]
[clojure.java.io :as io]
[ziad.common :as common])
(:import [java.io File]))
(defn word-tokenizer [se] (re-seq #"\w+" se))
(defn sent-tokenizer [txt] (seq (. txt split "[\\.\\?\\;]\\s+")))
(defn brown-sent-tokenizer [txt]
(let [cle... | |
299a58abdf4ad6483516219610f7865b8cfda69b272ac27213c7b9c2a6b234f9 | manuel-serrano/hop | arraybufferview.scm | ;*=====================================================================*/
* serrano / prgm / project / hop / hop / hopscript / arraybufferview.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/hop/2f687a900e00b527d6661d72e4a8522467718913/hopscript/arraybufferview.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
*=====================================================================*/
*---------------------------... | * serrano / prgm / project / hop / hop / hopscript / arraybufferview.scm * /
* Author : * /
* Creation : We d Jun 18 07:29:16 2014 * /
* Last change : Fri Nov 11 19:19:13 2022 ( serrano ) * /
* Cop... |
4d7fd2aa4d9ec07f64531264fffb25d19faf27a299bac404d192f12bb2213676 | sunshineclt/Racket-Helper | 3-SICP1.43.rkt | #lang racket
(define (square x) (* x x))
(define (inc x) (+ x 1))
(define (db x) (* x 2))
(define (repeated f n)
(define (rf i x)
(if(< i 1)
x
(rf (- i 1) (f x))))
(lambda (x)
(rf n x)))
((repeated square 2) 5)
((repeated inc 4) 6)
((repeated db 4) 6)
(display "********") (newline)
(define ... | null | https://raw.githubusercontent.com/sunshineclt/Racket-Helper/bf85f38dd8d084db68265bb98d8c38bada6494ec/%E5%BE%90%E7%8E%89%E9%BA%9F/%E4%BD%9C%E4%B8%9A2/3-SICP1.43.rkt | racket | #lang racket
(define (square x) (* x x))
(define (inc x) (+ x 1))
(define (db x) (* x 2))
(define (repeated f n)
(define (rf i x)
(if(< i 1)
x
(rf (- i 1) (f x))))
(lambda (x)
(rf n x)))
((repeated square 2) 5)
((repeated inc 4) 6)
((repeated db 4) 6)
(display "********") (newline)
(define ... | |
425100f9519b7be88692de5052db94eb4498c468208ccdce184a8bf1c4b3954f | ocaml/opam | opamDownload.mli | (**************************************************************************)
(* *)
Copyright 2012 - 2018 OCamlPro
Copyright 2012 INRIA
(* ... | null | https://raw.githubusercontent.com/ocaml/opam/074df6b6d87d4114116ea41311892b342cfad3de/src/repository/opamDownload.mli | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2012 - 2018 OCamlPro
Copyright 2012 INRIA
GNU Lesser General Public License version 2.1 , with the special
exception Download_fail of string option * string
* downloads a file from an URL , using Cur... |
598ba1c5e9103d5bd8900a4752e429c8cb8ba528a7d04671bfdbd9a8fc6914fb | den1k/vimsical | style.clj | (ns vimsical.frontend.auth.style)
(def auth
[:.auth
[:&.login
{:width :250px}
[:.form
{
;:display :flex
;:flex-direction :column
;:justify-content :space-between
:height :200px}
[:.cookie-and-forgot-pass
[:.cookie
[:.checkbox
{:margin "0 5px ... | null | https://raw.githubusercontent.com/den1k/vimsical/1e4a1f1297849b1121baf24bdb7a0c6ba3558954/src/frontend/vimsical/frontend/auth/style.clj | clojure | :display :flex
:flex-direction :column
:justify-content :space-between | (ns vimsical.frontend.auth.style)
(def auth
[:.auth
[:&.login
{:width :250px}
[:.form
{
:height :200px}
[:.cookie-and-forgot-pass
[:.cookie
[:.checkbox
{:margin "0 5px 0 0"}]]]
[:.login-button
{:height :45px}]]
[:.closed-beta
{:margin-top :40px}
... |
5c7eaafcf37855e3be6d1391afcecf1bd354d2651ae3f1a4729204b2fe4b598e | sig-gis/gridfire | spotting_test.clj | (ns gridfire.spotting-test
(:require [gridfire.spotting :as spotting]
[clojure.test :refer [deftest is testing]]))
(defn close-to-zero [d]
(< (Math/abs d) 0.000001))
(deftest deltas-axis-test
(testing "x-axis"
(testing "east"
(let [H (spotting/hypotenuse 10 10)]
(let [[dx dy] (fir... | null | https://raw.githubusercontent.com/sig-gis/gridfire/44aeaf56fceb01f61b21db6220d2cb562a92570b/test/gridfire/spotting_test.clj | clojure | (ns gridfire.spotting-test
(:require [gridfire.spotting :as spotting]
[clojure.test :refer [deftest is testing]]))
(defn close-to-zero [d]
(< (Math/abs d) 0.000001))
(deftest deltas-axis-test
(testing "x-axis"
(testing "east"
(let [H (spotting/hypotenuse 10 10)]
(let [[dx dy] (fir... | |
d752ab4e944c600bcb797ff1d1270116de5e5cbfe18973a68d811d5e80f6a188 | typedclojure/typedclojure | ns_deps_utils.clj | Copyright ( c ) , contributors .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by
;... | null | https://raw.githubusercontent.com/typedclojure/typedclojure/a60a354e2da1daa8a3407f66474c6ddee17928e4/typed/clj.checker/src/typed/cljc/checker/ns_deps_utils.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) , contributors .
(ns ^:no-doc ^:typed.clojure/ignore
typed.cljc.checker.ns-deps-utils
(:require [clojure.tools.namespace.parse :as ns-parse]
[clojure.tools.namespace.file :as ns-file]
[clojure.core.typed.coerce-utils :as coerce]
[clojure.core.typed.con... |
13bd5c2ba5c451f925906b34b41416065692f94f3e4c8472b7d9f49b2959b327 | serioga/clojure-benhcmarks | http_router.clj | (ns clojure-benchmarks.http-router
(:require
[criterium.core :as criterium]
[reitit.core :as reitit]
[sibiro.core :as sibiro]))
(set! *warn-on-reflection* true)
(def sibiro-routes
(sibiro/compile-routes [[:get "/api/1" nil]
[:get "/api/2" nil]
[:get... | null | https://raw.githubusercontent.com/serioga/clojure-benhcmarks/266caad3f5d4f9082d650a8dc1be1d6adb968fb8/src/clojure_benchmarks/http_router.clj | clojure | sibiro
reitit
sibiro
reitit | (ns clojure-benchmarks.http-router
(:require
[criterium.core :as criterium]
[reitit.core :as reitit]
[sibiro.core :as sibiro]))
(set! *warn-on-reflection* true)
(def sibiro-routes
(sibiro/compile-routes [[:get "/api/1" nil]
[:get "/api/2" nil]
[:get... |
4c365b572a5a8111a60f3076b8c7ef9ad99578a0d23aa956b3a93bc259e007a4 | astine/Sacraspot | csv.lisp | website csv.lisp - ( C ) 2009 - 2010
(in-package #:sacraspot)
;;; Some functions for parsing csv text
(defun parse-csv-stream (csv-stream)
"parses a csv stream into a list of lists, each sublist
corresponding to a row in the csv stream"
(declare (type stream csv-stream))
(let ((out-rows nil)
(row nil)
... | null | https://raw.githubusercontent.com/astine/Sacraspot/9cdce12e8b15b7a00e40c9150fbafa04034f17f0/csv.lisp | lisp | Some functions for parsing csv text | website csv.lisp - ( C ) 2009 - 2010
(in-package #:sacraspot)
(defun parse-csv-stream (csv-stream)
"parses a csv stream into a list of lists, each sublist
corresponding to a row in the csv stream"
(declare (type stream csv-stream))
(let ((out-rows nil)
(row nil)
(cell (make-string-output-stream))
(in... |
1258e8d58665b66dc033af1254858e8a9bf0a1d0a3c3c5f10002075a8b846fa0 | xmonad/xmonad-contrib | DynamicLog.hs | # LANGUAGE FlexibleContexts #
-----------------------------------------------------------------------------
-- |
-- Module : XMonad.Hooks.DynamicLog
Description : Send information about xmonad 's state to an X11 property or standard output .
Copyright : ( c ) < >
-- License : BSD3-style (see L... | null | https://raw.githubusercontent.com/xmonad/xmonad-contrib/feee11a0ba21cf3777bc59f559fe7a95cf3c118c/XMonad/Hooks/DynamicLog.hs | haskell | ---------------------------------------------------------------------------
|
Module : XMonad.Hooks.DynamicLog
License : BSD3-style (see LICENSE)
Stability : unstable
Portability : unportable
__Note:__ This module is a __compatibility wrapper__ for the following:
DynamicLog API is frozen and u... | # LANGUAGE FlexibleContexts #
Description : Send information about xmonad 's state to an X11 property or standard output .
Copyright : ( c ) < >
Maintainer : < >
* " XMonad . Hooks . StatusBar "
* " XMonad . Hooks . StatusBar . PP "
xmonad calls the logHook with every internal state update... |
5abb94673011a96d97bafe65a7d5fed9de986123744461ec36655e9f59726417 | rigetti/rpcq | messages.lisp | messages.lisp
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;; Copyright 2018 Rigetti Computing
;;;;
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 t... | null | https://raw.githubusercontent.com/rigetti/rpcq/fd482a50e8f33240ef424b3768fed0ed57495116/src/messages.lisp | lisp |
Copyright 2018 Rigetti Computing
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
li... | messages.lisp
distributed under the License is distributed on an " AS IS " BASIS ,
See the License for the specific language governing permissions and
(in-package #:rpcq)
(defmessage |ParameterSpec| ()
(
(|type|
:documentation "The parameter type, e.g., one of 'INTEGER', or 'FLOAT'."
... |
398918e007d6c675b24b482cd87ee6fb674f89b2d93cdc9ce8ee99b0bf43d31f | BinaryAnalysisPlatform/bap | ogre.mli | * OGRE - Open Generic Representation .
OGRE is a self - describing data storage . It is open for
extensibility , i.e. , adding new types of knowledge does n't break
the storage . It also has a well - specified open representation , so
that any tool written in any language ( or even a human itse... | null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap/253afc171bbfd0fe1b34f6442795dbf4b1798348/lib/ogre/ogre.mli | ocaml | * the document
* type information associated with an attribute
* a descriptor of an attribute.
Used to construct attribute values, and to query
documents. Created with [declare] function.
Note, that due to a value restriction, an attribute should be
defined as a function returning a type informati... | * OGRE - Open Generic Representation .
OGRE is a self - describing data storage . It is open for
extensibility , i.e. , adding new types of knowledge does n't break
the storage . It also has a well - specified open representation , so
that any tool written in any language ( or even a human itse... |
ef65ecc196b90783292ff0164e469d48e8d2c688cf0f71894c68a9fd37f3f912 | 2600hz/kazoo | kazoo_perf_maintenance.erl | %%%-----------------------------------------------------------------------------
( C ) 2017 - 2020 , 2600Hz
@doc Simple ( and mostly naive ) script that connects to a remote Erlang node ,
fetches memory and process statistics and prints them in a Sensu compatible way
%%% for metrics gathering (great for Graphite... | null | https://raw.githubusercontent.com/2600hz/kazoo/24519b9af9792caa67f7c09bbb9d27e2418f7ad6/core/kazoo_perf/src/kazoo_perf_maintenance.erl | erlang | -----------------------------------------------------------------------------
for metrics gathering (great for Graphite)
@end
-----------------------------------------------------------------------------
API
Internals | ( C ) 2017 - 2020 , 2600Hz
@doc Simple ( and mostly naive ) script that connects to a remote Erlang node ,
fetches memory and process statistics and prints them in a Sensu compatible way
@author
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL wa... |
37b7ddfe4b811c7ab254af45c979ff324a9c6bb1f9f2e981a9e25f7935b721fa | rmloveland/scheme48-0.53 | prim-io.scm | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
; I/O primitives
; See doc/io.txt for a description of Scheme 48's I/O system.
; Argument specs
(define open-input-port->
(input-type (lambda (x)
(and (port? x)
(port-has-status? x (enum port-status-options
open-for-input))))
... | null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/scheme/vm/prim-io.scm | scheme | I/O primitives
See doc/io.txt for a description of Scheme 48's I/O system.
Argument specs
Check SPEC type and then call OPEN-CHANNEL.
FETCH-STRING here avoids a type warning in the C code, but is not really
the right thing.
note that we're waiting
keep the result pending for a moment
WAIT? is ignored when writ... | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
(define open-input-port->
(input-type (lambda (x)
(and (port? x)
(port-has-status? x (enum port-status-options
open-for-input))))
no-coercion))
(define open-output-port->
(input-type (lambda (x)
(and (port? x)
(p... |
f50c79cf6570aa8b85e82a3938d1e4933831eef5b9f21aa416874475580f4bab | haskell-mafia/mafia | Package.hs | {-# LANGUAGE DoAndIfThenElse #-}
# LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE CPP #
module Mafia.Cabal.Package (
BuildTool(..)
, getBuildTools
, PackageType(..)
, getPackageId
, getPackageType
, getCabalFile
, find... | null | https://raw.githubusercontent.com/haskell-mafia/mafia/529440246ee571bf1473615e6218f52cd1e990ae/src/Mafia/Cabal/Package.hs | haskell | # LANGUAGE DoAndIfThenElse #
# LANGUAGE OverloadedStrings #
----------------------------------------------------------------------
| Given a file or directory path, try to find the .cabal file by searching
its parent directories.
----------------------------------------------------------------------
TODO We are ig... | # LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE CPP #
module Mafia.Cabal.Package (
BuildTool(..)
, getBuildTools
, PackageType(..)
, getPackageId
, getPackageType
, getCabalFile
, findCabalRoot
, SourcePackage(..)
, getSourcePackage
, SourcePac... |
978f8a8288237480506aac6b905062ee9d1060d20319e52f3a8a8c21b408a5c1 | uscensusbureau/citysdk | async.cljs | (ns configs.promised.async
(:require [cljs.core.async :as async]
[cljs.core.async.impl.protocols :as impl]
[cljs.core.async.impl.dispatch :as dispatch]
[configs.promised.core]))
(defn extend-promises-as-channels!
"If you want, you can globally extend Promise to act as a o... | null | https://raw.githubusercontent.com/uscensusbureau/citysdk/c19195fc1e7f03c384eb98a2f5bb7f2224a43a51/v2/src/configs/promised/async.cljs | clojure | `cljs.core.async.impl.dispatch/run` runs the handler in the next
run of the event loop, making it possible here for errors avoid
promises' error capturing. Otherwise, errors from the promise can
never escape `go` blocks.
return nil to say "we're waiting on the value"
| (ns configs.promised.async
(:require [cljs.core.async :as async]
[cljs.core.async.impl.protocols :as impl]
[cljs.core.async.impl.dispatch :as dispatch]
[configs.promised.core]))
(defn extend-promises-as-channels!
"If you want, you can globally extend Promise to act as a o... |
9968e359dd2fe0d7f5af7ed36a3ca324da96ca7efa90d6295f828a0f21f01228 | BillHallahan/G2 | Test42.hs | {-@ LIQUID "--short-names" @-}
{-@ LIQUID "--no-termination" @-}
{-@ LIQUID "--prune-unsorted" @-}
module Combined ( List
, prop_concat) where
import Prelude hiding (length, replicate, foldr, foldr1, map, concat, zipWith, repeat)
infixr 9 :+:
concat :: List (List a) -> List a
@ type TRUE = { v :... | null | https://raw.githubusercontent.com/BillHallahan/G2/21c648d38c380041a9036d0e375ec1d54120f6b4/tests_lh/test_files/Pos/Test42.hs | haskell | @ LIQUID "--short-names" @
@ LIQUID "--no-termination" @
@ LIQUID "--prune-unsorted" @
@ invariant {v:List a | 0 <= size v} @
@ l0 :: { r:List Int | size r == 0 } @
@ prop_concat :: TRUE @ |
module Combined ( List
, prop_concat) where
import Prelude hiding (length, replicate, foldr, foldr1, map, concat, zipWith, repeat)
infixr 9 :+:
concat :: List (List a) -> List a
@ type TRUE = { v : | v } @
data List a = Emp
| (:+:) a (List a)
deriving (Eq, Ord, Show)
... |
560101f2a6f7802ff30c884bf3476b8401612bac50d3118714c9f66c40fde741 | ucsd-progsys/dsolve | ralist.ml | (* adapted from an example by Xi
* /~hwxi/DML/DML/examples/ralist.dml
*)
type 'a rlist =
| Nil
| One of 'a
| Even of 'a rlist * 'a rlist
| Odd of 'a * 'a rlist * 'a rlist
let rec sz l =
match l with
| Nil -> 0
| One x -> 1
| Even (l1, l2) -> (sz l1) + (sz l2)
| Odd (_, l1, l2) -> (1 + ... | null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/postests/ralist.ml | ocaml | adapted from an example by Xi
* /~hwxi/DML/DML/examples/ralist.dml
|
type 'a rlist =
| Nil
| One of 'a
| Even of 'a rlist * 'a rlist
| Odd of 'a * 'a rlist * 'a rlist
let rec sz l =
match l with
| Nil -> 0
| One x -> 1
| Even (l1, l2) -> (sz l1) + (sz l2)
| Odd (_, l1, l2) -> (1 + (sz l1) + (sz l2))
let rec cons x xs =
match xs with
| Nil -> (One ... |
b57fcb87512905bd5f7751f8855c193c2f7ea03bcd3360d5b51650fa071f25eb | finnishtransportagency/harja | urakat_test.clj | (ns harja.palvelin.integraatiot.api.urakat-test
(:require [clojure.test :refer [deftest testing is use-fixtures]]
[harja.testi :refer :all]
[harja.palvelin.integraatiot.api.urakat :as api-urakat]
[harja.palvelin.integraatiot.api.tyokalut :as api-tyokalut]
[com.stuartsie... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/625ff738578e07798a155ffaf3d5bba2efaee7e2/test/clj/harja/palvelin/integraatiot/api/urakat_test.clj | clojure | "))))
Kouvolan seutu (EPSG:3067) | (ns harja.palvelin.integraatiot.api.urakat-test
(:require [clojure.test :refer [deftest testing is use-fixtures]]
[harja.testi :refer :all]
[harja.palvelin.integraatiot.api.urakat :as api-urakat]
[harja.palvelin.integraatiot.api.tyokalut :as api-tyokalut]
[com.stuartsie... |
f27e548dd800933b3707984b05d6de344cfdf2988d89f6027940fe8fe7e77c21 | collaborativetrust/WikiTrust | chdiff.ml |
Copyright ( c ) 2007 - 2008 The Regents of the University of California
All rights reserved .
Authors :
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 ... | null | https://raw.githubusercontent.com/collaborativetrust/WikiTrust/9dd056e65c37a22f67d600dd1e87753aa0ec9e2c/analysis/chdiff.ml | ocaml | * chdiff.ml : here we compare chunks of text, to trace text through
revisions, and to compute edit distances
so that we know what is going on
* This is the maximum number of matches for a word pair that we
track. If a word pair has more than this number of matches, we
disregard them all, as we classify t... |
Copyright ( c ) 2007 - 2008 The Regents of the University of California
All rights reserved .
Authors :
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 ... |
a7c685c058d86bd764ed573d1955115f612ef3108123e0fc1f308d235840cf0e | yetanalytics/dl4clj | early_stopping_trainer.clj | (ns ^{:doc "Interface for early stopping trainers.
see: "}
dl4clj.earlystopping.api.early-stopping-trainer
(:import [org.deeplearning4j.earlystopping.trainer IEarlyStoppingTrainer]
[org.deeplearning4j.earlystopping EarlyStoppingResult]
[org.deeplearning4j.spark.earlystopping SparkEarlyStopp... | null | https://raw.githubusercontent.com/yetanalytics/dl4clj/9ef055b2a460f1a6246733713136b981fd322510/src/dl4clj/earlystopping/api/early_stopping_trainer.clj | clojure |
local
spark
| (ns ^{:doc "Interface for early stopping trainers.
see: "}
dl4clj.earlystopping.api.early-stopping-trainer
(:import [org.deeplearning4j.earlystopping.trainer IEarlyStoppingTrainer]
[org.deeplearning4j.earlystopping EarlyStoppingResult]
[org.deeplearning4j.spark.earlystopping SparkEarlyStopp... |
e357430d941e178da89e52cea527c25fd644332b0eccbe2a3d5b13cf70863e72 | tolysz/ghcjs-stack | Targets.hs | # LANGUAGE CPP #
{-# LANGUAGE BangPatterns #-}
# LANGUAGE DeriveGeneric #
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.Client.Targets
Copyright : ( c ) 2011
-- License : BSD-like
--
-- Maintainer :
--
-- Handling for user-specified ta... | null | https://raw.githubusercontent.com/tolysz/ghcjs-stack/83d5be83e87286d984e89635d5926702c55b9f29/special/cabal/cabal-install/Distribution/Client/Targets.hs | haskell | # LANGUAGE BangPatterns #
---------------------------------------------------------------------------
|
Module : Distribution.Client.Targets
License : BSD-like
Maintainer :
Handling for user-specified targets
---------------------------------------------------------------------------
* User target... | # LANGUAGE CPP #
# LANGUAGE DeriveGeneric #
Copyright : ( c ) 2011
module Distribution.Client.Targets (
UserTarget(..),
readUserTargets,
PackageSpecifier(..),
pkgSpecifierTarget,
pkgSpecifierConstraints,
resolveUserTargets,
UserTargetProblem(..),
readUserTarget,
reportUserTargetProblems,
... |
d8a0a1117eac90609adfd8ba163772e5b39965421f8d3f0546ba04afe3409a8c | darkleaf/app-from-scratch | identity_test.clj | (ns app.identity-test
(:require
[app.identity :as sut]
[app.aggregate :as aggregate]
[app.post :as post]
[orchestra.spec.test :as st]
[clojure.test :as t]))
(defn- instrument-fixture [t]
(st/instrument)
(t))
(t/use-fixtures :once instrument-fixture)
(t/deftest identity-test
(let [post (post/ma... | null | https://raw.githubusercontent.com/darkleaf/app-from-scratch/f5ade8f90f20d6856ab4f5830264437f55027d96/sources/3-core/1-domain/2-aggregate-and-identity/test/app/identity_test.clj | clojure | (ns app.identity-test
(:require
[app.identity :as sut]
[app.aggregate :as aggregate]
[app.post :as post]
[orchestra.spec.test :as st]
[clojure.test :as t]))
(defn- instrument-fixture [t]
(st/instrument)
(t))
(t/use-fixtures :once instrument-fixture)
(t/deftest identity-test
(let [post (post/ma... | |
f25f95ebf0ecd43aa7000b4de2d7dfe8c5e39f7ca690da7633e39a84a3384ab6 | ucsd-progsys/liquidhaskell | Monad7.hs | {-@ LIQUID "--expect-any-error" @-}
module Monad7 () where
import Language.Haskell.Liquid.Prelude
@ type OList a = [ a]<{\fld v - > ( v > = fld ) } > @
@ gpp : : ( a , Monad m ) = > [ a ] - > m ( OList a ) @
gpp :: (Ord a, Monad m) => [a] -> m [a]
gpp ls = return $ reverse $ insertSort ls
@ insertSort : : ( a ) =... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/f46dbafd6ce1f61af5b56f31924c21639c982a8a/tests/neg/Monad7.hs | haskell | @ LIQUID "--expect-any-error" @ | module Monad7 () where
import Language.Haskell.Liquid.Prelude
@ type OList a = [ a]<{\fld v - > ( v > = fld ) } > @
@ gpp : : ( a , Monad m ) = > [ a ] - > m ( OList a ) @
gpp :: (Ord a, Monad m) => [a] -> m [a]
gpp ls = return $ reverse $ insertSort ls
@ insertSort : : ( a ) = > xs:[a ] - > OList a @
insertSort ... |
36763050271d0a53092c903bb943397d1582a6eb10407a574dbc5addb6461b91 | alexj136/HWhile | PureSyntax.hs | module PureSyntax where
import qualified Data.Map as M
import qualified Data.Set as S
import Data.List (intersperse)
-- Syntax definitions for while programs. The data types below match the
context - free grammar in book , page 32 . This module also contains
-- functions for printing syntax trees.
newtype Name ... | null | https://raw.githubusercontent.com/alexj136/HWhile/05fd675cbb5e71a2e779eaae7e8c738a3a50f46e/src/lib/PureSyntax.hs | haskell | Syntax definitions for while programs. The data types below match the
functions for printing syntax trees.
------------------------------------------------------------------------------
Name enumeration functions
------------------------------------------------------------------------------
-------------------------... | module PureSyntax where
import qualified Data.Map as M
import qualified Data.Set as S
import Data.List (intersperse)
context - free grammar in book , page 32 . This module also contains
newtype Name = Name (FilePath, String) deriving (Eq, Ord)
nameName :: Name -> String
nameName (Name (_, s)) = s
namePath :: ... |
9c47b236f7000901412a8df89df4e381ee4badb45d485e6ecc72802e58d92e39 | c089/haskell-craft3e | UseMonads.hs | module UseMonads where
import Control.Monad.Identity
instance Show a => Show (Identity a) where
show (Identity x) = show x
example1 = do { x <- [1,2]; y<-[3,4]; return (x+y)}
example2 = do { x <- Just 1; y<- Just 2; return (x+y)}
example3 = do { x <- Just 1; y<- Nothing; return (x+y)}
example4 = do { x <- Nothin... | null | https://raw.githubusercontent.com/c089/haskell-craft3e/869e382601cab50559c4473dfa9c7480f1acba58/UseMonads.hs | haskell | module UseMonads where
import Control.Monad.Identity
instance Show a => Show (Identity a) where
show (Identity x) = show x
example1 = do { x <- [1,2]; y<-[3,4]; return (x+y)}
example2 = do { x <- Just 1; y<- Just 2; return (x+y)}
example3 = do { x <- Just 1; y<- Nothing; return (x+y)}
example4 = do { x <- Nothin... | |
81b1d0f42dd557568a48247530d580c0454283dd11aae58bb9b5c89c5e79efdc | kim/opentracing | Batch.hs | {-|
Module: OpenTracing.Reporting.Batch
This module provides a trace reporter that groups recorded spans into batches
before sending them to their destination in bulk.
-}
# LANGUAGE LambdaCase #
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE St... | null | https://raw.githubusercontent.com/kim/opentracing/1e130d04efe49820a5658dae12c6f529f962f663/opentracing/OpenTracing/Reporting/Batch.hs | haskell | |
Module: OpenTracing.Reporting.Batch
This module provides a trace reporter that groups recorded spans into batches
before sending them to their destination in bulk.
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
| Options available to construct a batch reporter. Default options are
Default 5 second... | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE StrictData #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
module OpenTracing.Reporting.Batch
( BatchOptions
, batchOptions
, boptAtCapacity
, boptBatchSize
, boptErrorLog
, boptQueueSize
, ... |
c4a7518c3a00bac9972b7e50306f844a2d4dbddb58628fd4062c61a276c9f6f6 | ucsd-progsys/liquidhaskell | DupMeasure.hs | {-@ LIQUID "--expect-error-containing=Multiple specifications for `lenA`" @-}
module DupMeasure where
@ measure lenA : : [ a ] - > Int
lenA [ ] = 0
lenA ( x : xs ) = 1 + lenA xs
@
lenA [] = 0
lenA (x:xs) = 1 + lenA xs
@-}
@ measure lenA : : [ a ] - > Int
lenA [ ] = 0
... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/f46dbafd6ce1f61af5b56f31924c21639c982a8a/tests/errors/DupMeasure.hs | haskell | @ LIQUID "--expect-error-containing=Multiple specifications for `lenA`" @ | module DupMeasure where
@ measure lenA : : [ a ] - > Int
lenA [ ] = 0
lenA ( x : xs ) = 1 + lenA xs
@
lenA [] = 0
lenA (x:xs) = 1 + lenA xs
@-}
@ measure lenA : : [ a ] - > Int
lenA [ ] = 0
lenA ( x : xs ) = 1 + lenA xs
@
lenA [] = 0
lenA (x:xs) = 1 ... |
5059278bcae22f1dab7937a0fb411fbab7224f0dc5dab507bf7ce76054e9920b | lem-project/lem | workspace.lisp | (in-package :lem-language-server)
(define-request (execute-command-request "workspace/executeCommand")
(params lsp:execute-command-params)
(let ((command (lsp:execute-command-params-command params))
(arguments (lsp:execute-command-params-arguments params)))
(execute-command command arguments)))
| null | https://raw.githubusercontent.com/lem-project/lem/fffbe29af9c3956c38885d486924c3ef0515c9e5/lib/language-server/controller/workspace.lisp | lisp | (in-package :lem-language-server)
(define-request (execute-command-request "workspace/executeCommand")
(params lsp:execute-command-params)
(let ((command (lsp:execute-command-params-command params))
(arguments (lsp:execute-command-params-arguments params)))
(execute-command command arguments)))
| |
2a483b2bef2357b3dcd91b6a1b82c02825f395eef2eaed8787f674f6efae7da6 | dnaeon/clingon | greet.lisp | Copyright ( c ) 2021 Nikolov < >
;; All rights reserved.
;;
;; 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
;; notice, this list of co... | null | https://raw.githubusercontent.com/dnaeon/clingon/bb06197b2d0f05135106cd550f20bcf0678a6a6b/examples/demo/greet.lisp | lisp | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer
in this position and unchanged.
notice, this list of conditions and the fo... | Copyright ( c ) 2021 Nikolov < >
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
THIS SOFTWARE IS PROVIDED BY THE AUTHOR(S ) ` ` AS IS '' AND ANY EXPRESS OR
INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES... |
6c913409ab599664d589237f43b2322d6667b3c6a1f8571668b176e81e720a32 | eponai/sulolive | stream.cljc | (ns eponai.common.ui.stream
(:require
[eponai.common.ui.dom :as dom]
[om.next :as om :refer [defui]]
[eponai.common.shared :as shared]
[taoensso.timbre :refer [debug error info]]
[eponai.web.ui.stream.videoplayer :as video]
#?(:cljs [eponai.web.modules :as modules])
[eponai.common.ui.eleme... | null | https://raw.githubusercontent.com/eponai/sulolive/7a70701bbd3df6bbb92682679dcedb53f8822c18/src/eponai/common/ui/stream.cljc | clojure | (ns eponai.common.ui.stream
(:require
[eponai.common.ui.dom :as dom]
[om.next :as om :refer [defui]]
[eponai.common.shared :as shared]
[taoensso.timbre :refer [debug error info]]
[eponai.web.ui.stream.videoplayer :as video]
#?(:cljs [eponai.web.modules :as modules])
[eponai.common.ui.eleme... | |
02ea822dd06c29108661d2a277bae6a56423691d05d2f96eb7190bfb10825a78 | input-output-hk/project-icarus-importer | Monad.hs | {-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
module Mockable.Monad
( MonadMockable
) where
import Control.Exception.Safe (MonadMask)
import Mockable.Channel (Channel)
import Mo... | null | https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/networking/src/Mockable/Monad.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE FlexibleContexts #
| Bunch of Mockable-constraints. Intentionally doesn't contain some
avoided. | # LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
module Mockable.Monad
( MonadMockable
) where
import Control.Exception.Safe (MonadMask)
import Mockable.Channel (Channel)
import Mockable.Class (Mockable)
import Mockable.Concurrent (Async, Concurren... |
ad02786a943ddc7a31da57e199e87f02badf5d795354e8f74dfafb9fe52df57d | Licenser/lein-search | add.clj | (ns leiningen.add
"Interactively adds a dependency from clojars.
With one parameter it will add the latest stable of the corresponding version with two arguments it will take the second argument as version.
If the first parameter is --dev or -d it will work exactly as without --dev just that it will add a dev dep... | null | https://raw.githubusercontent.com/Licenser/lein-search/c45ebf6b94d20f3e916b710c91aef9eb1c79336c/src/leiningen/add.clj | clojure | (ns leiningen.add
"Interactively adds a dependency from clojars.
With one parameter it will add the latest stable of the corresponding version with two arguments it will take the second argument as version.
If the first parameter is --dev or -d it will work exactly as without --dev just that it will add a dev dep... | |
08f3dd7711e4f1913e62823132fda0ed9474a1c0fcd35d2cb7873447d092f73e | theodormoroianu/SecondYearCourses | a.hs | import Control.Monad
fact :: Integer -> Integer -> Integer
fact 0 ans = ans
fact n ans = fact (n - 1) (ans * n)
getColors :: IO [String]
getColors = forM [1..10] (\a -> do
print $ "What is your " ++ show a ++ "th favourite color?"
color <- getLine
return color)
printlines n =
sequence $ take n $ repe... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/99185b0e97119135e7301c2c7be0f07ae7258006/Haskell/Projects/a.hs | haskell | import Control.Monad
fact :: Integer -> Integer -> Integer
fact 0 ans = ans
fact n ans = fact (n - 1) (ans * n)
getColors :: IO [String]
getColors = forM [1..10] (\a -> do
print $ "What is your " ++ show a ++ "th favourite color?"
color <- getLine
return color)
printlines n =
sequence $ take n $ repe... | |
55280ff75d60c0c3c435f25ad594d6822e36db65eccb99b04b33c42f818ab67d | janestreet/bonsai | bonsai_chat_open_source_common.ml | module Room = Room
module Message = Message
module Protocol = Protocol
| null | https://raw.githubusercontent.com/janestreet/bonsai/99c9ca7c2e122e7499b2360dcf310cd09ae86216/examples/open_source/rpc_chat/common/bonsai_chat_open_source_common.ml | ocaml | module Room = Room
module Message = Message
module Protocol = Protocol
| |
7f8b3bd73b819244101e8916ad4fbaf1b191e2bf03ec7ff37f029a875d9b2e9f | ibdknox/Noir-blog | blog.clj | (ns noir-blog.views.blog
(:use noir.core
hiccup.core
hiccup.page-helpers)
(:require [noir-blog.models.post :as posts]
[noir-blog.views.common :as common]
[noir-blog.models.user :as user]
[noir.response :as resp]))
;; Page structure
(defpartial post-item [{:keys ... | null | https://raw.githubusercontent.com/ibdknox/Noir-blog/613798b5f4f9624793b71e6dfdca5efcaba6cf33/src/noir_blog/views/blog.clj | clojure | Page structure
Blog pages | (ns noir-blog.views.blog
(:use noir.core
hiccup.core
hiccup.page-helpers)
(:require [noir-blog.models.post :as posts]
[noir-blog.views.common :as common]
[noir-blog.models.user :as user]
[noir.response :as resp]))
(defpartial post-item [{:keys [perma-link title ... |
db0bc77c7d6bd2b8223c62242e44ea3287a6751d4dc03ab780c5bba94e5431d1 | bluelisp/hemlock | clx-ext.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
;;;
(ext:file-comment
"$Header: /home/david/phemlock... | null | https://raw.githubusercontent.com/bluelisp/hemlock/47e16ba731a0cf4ffd7fb2110e17c764ae757170/unused/clx-ext.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
**********************************************************************
**********************************************************************
OPEN-CLX-DISPLAY.
pw-- "unix" is a signal to the connect_to_inet C code
This is supposed to be faster on a local server.
... | This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
(ext:file-comment
"$Header: /home/david/phemlock/cvsroot/phemlock/unused/clx-ext.lisp,v 1.1 2004-07-09 13:39:12 gbaumann Exp $")
This file contains code to extend CLX in the CM... |
a41369104755eae6f867c42cefbcf0aec0a9575f1c8d1bb2289c8cf520f065d0 | graninas/Functional-Design-and-Architecture | Language.hs | {-# LANGUAGE GADTs #-}
module Framework.Logging.StructuredLogger.Language where
import Data.Text
import qualified Data.Map as Map
import Control.Monad.Free.Church
import Framework.Logging.Types
-- | Structured logger interface
data StructuredLoggerF next where
-- | Structured logging method to report specific mes... | null | https://raw.githubusercontent.com/graninas/Functional-Design-and-Architecture/f2e4462e09d79b36560a029ebda70cbac3813da3/Second-Edition-Manning-Publications/BookSamples/CH10/Section10p1/src/Framework/Logging/StructuredLogger/Language.hs | haskell | # LANGUAGE GADTs #
| Structured logger interface
| Structured logging method to report specific messages to services like Sentry. | module Framework.Logging.StructuredLogger.Language where
import Data.Text
import qualified Data.Map as Map
import Control.Monad.Free.Church
import Framework.Logging.Types
data StructuredLoggerF next where
LogStructured
:: Severity
-> LoggerName
-> Message
-> Map.Map FieldKey FieldValue
-> (() ... |
fd85876320b819b5a4b66edcef23f61eb067eea11d3901579931c34155f2d8fb | csabahruska/jhc-components | Lint.hs | module E.Lint(
transformProgram,
onerrNone,
lintCheckProgram,
dumpCore
) where
import Control.Exception
import Control.Monad
import Control.Monad.Trans
import Data.List as List
import Data.Maybe
import Support.Compat
import qualified Data.Set as Set
import Data.Monoid
import Doc.DocLike
import Doc... | null | https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/jhc-core/src/E/Lint.hs | haskell | all transformation routines assume they are being passed a correct program, and only check the output | module E.Lint(
transformProgram,
onerrNone,
lintCheckProgram,
dumpCore
) where
import Control.Exception
import Control.Monad
import Control.Monad.Trans
import Data.List as List
import Data.Maybe
import Support.Compat
import qualified Data.Set as Set
import Data.Monoid
import Doc.DocLike
import Doc... |
c6d431a6e44436fcfc35847d831386189186e0b6364bff911546da41d9a93f3f | fossas/fossa-cli | OciManifest.hs | module Container.Docker.OciManifest (
OciManifestV2 (..),
LayerKind (..),
OciManifestConfig (..),
OciManifestLayer (..),
NotSupportedManifestFmt (..),
toDockerManifest,
supportedManifestKinds,
blobEntries,
) where
import Container.Docker.Manifest (
ManifestJson (ManifestJson),
ManifestJsonImageEntr... | null | https://raw.githubusercontent.com/fossas/fossa-cli/be8839e734b813369c67183b286220a7f41a8481/src/Container/Docker/OciManifest.hs | haskell |
Image manifest retrieved from container registry.
Refer to:
-v2-2/
| Gets image artifacts blobs.
| Removes digest algorithm (if any)
>> removeDigestAlgorithm "sha256:digest" == "digest"
>> removeDigestAlgorithm "sha512:digest" == "digest"
>> removeDigestAlgorithm "sha256+b64u:digest" = "digest"
>> removeDi... | module Container.Docker.OciManifest (
OciManifestV2 (..),
LayerKind (..),
OciManifestConfig (..),
OciManifestLayer (..),
NotSupportedManifestFmt (..),
toDockerManifest,
supportedManifestKinds,
blobEntries,
) where
import Container.Docker.Manifest (
ManifestJson (ManifestJson),
ManifestJsonImageEntr... |
b337934a7f32e00fd51f5a228418efe0fdb51803d8b6091b19c82d2351b17e99 | racket/racket7 | side-effect.rkt | #lang racket/base
(require "../common/set.rkt"
"built-in-symbol.rkt"
"self-quoting.rkt"
"known.rkt"
"../host/correlate.rkt")
;; To support extraction of a bootstrapped version of the expander, we
;; need to be able to prune unused module content. Pruning is usefully
;; improved by a... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/expander/compile/side-effect.rkt | racket | To support extraction of a bootstrapped version of the expander, we
need to be able to prune unused module content. Pruning is usefully
improved by a simple analysis of whether a module body has any
side-effects.
See "known.rkt" for classifications of definitions and locals
compiled expression
number of expected... | #lang racket/base
(require "../common/set.rkt"
"built-in-symbol.rkt"
"self-quoting.rkt"
"known.rkt"
"../host/correlate.rkt")
(provide any-side-effects?)
(define (effects? e expected-results locals)
(any-side-effects? e expected-results
#:known-locals ... |
ca4a2918f92df59271f38b403f7c78f2d495f63da4efa48d9585f5eaf5bb1018 | ejgallego/coq-serapi | ser_notation_term.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2016
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/ejgallego/coq-serapi/bde3fcde6c1a5f0710a2db6fd8155c4afbb25266/serlib/ser_notation_term.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
************************************... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2016
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Copyright 2016 MINES ParisT... |
eab48459e5e309cf18f208dde15bd85e8535f3b6022c9c1da84104bd061caec1 | fortytools/holumbus | Merge.hs | -- ----------------------------------------------------------------------------
|
Module : Merge
Copyright : Copyright ( C ) 2008
License : MIT
Maintainer : ( )
Stability : experimental
Portability : portable
Version : 0.1
Merges two indexes and their documen... | null | https://raw.githubusercontent.com/fortytools/holumbus/4b2f7b832feab2715a4d48be0b07dca018eaa8e8/searchengine/examples/utilities/Merge.hs | haskell | ----------------------------------------------------------------------------
----------------------------------------------------------------------------
| Load indexes and merge. |
|
Module : Merge
Copyright : Copyright ( C ) 2008
License : MIT
Maintainer : ( )
Stability : experimental
Portability : portable
Version : 0.1
Merges two indexes and their document tables .
Module : Merge
Copyright : Copyright (C) 2008 Timo B. Hue... |
8988c05a48f4d676b7a3cdcb92fc7cf8340210cda86dfb50bbcca1ce623c5099 | rescript-lang/rescript-compiler | lam_exit_count.mli | Copyright ( C ) 2018 - Hongbo Zhang , Authors of ReScript
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) an... | null | https://raw.githubusercontent.com/rescript-lang/rescript-compiler/e60482c6f6a69994907b9bd56e58ce87052e3659/jscomp/core/lam_exit_count.mli | ocaml | Copyright ( C ) 2018 - Hongbo Zhang , Authors of ReScript
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) an... | |
cff56bedcb14a48fd60ed3d1c46217febe574d8b3b8f43d09deb9fbbe55d8a95 | CIFASIS/QuickFuzz | Html.hs | # LANGUAGE TemplateHaskell #
# LANGUAGE FlexibleInstances #
# LANGUAGE IncoherentInstances #
# LANGUAGE DeriveGeneric #
# LANGUAGE MultiParamTypeClasses #
module Test.QuickFuzz.Gen.Document.Html where
import Data.Default
import Test.QuickCheck hiding (shrink)
import qualified Data.ByteString.Lazy as L
import qualif... | null | https://raw.githubusercontent.com/CIFASIS/QuickFuzz/a1c69f028b0960c002cb83e8145f039ecc0e0a23/src/Test/QuickFuzz/Gen/Document/Html.hs | haskell | $(devShow ''AttributeAction) | # LANGUAGE TemplateHaskell #
# LANGUAGE FlexibleInstances #
# LANGUAGE IncoherentInstances #
# LANGUAGE DeriveGeneric #
# LANGUAGE MultiParamTypeClasses #
module Test.QuickFuzz.Gen.Document.Html where
import Data.Default
import Test.QuickCheck hiding (shrink)
import qualified Data.ByteString.Lazy as L
import qualif... |
a5f91a1a9323e279ea5c7979fab486a40f968631c044da565b9f71127c9c16a7 | bmeurer/ocaml-arm | array.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/bmeurer/ocaml-arm/43f7689c76a349febe3d06ae7a4fc1d52984fd8b/stdlib/array.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 GNU Library General Public License , with
$ Id$
external length : 'a array ->... |
815da9fd06545232c2cb8e32510906799b3c2947bea441e884062285e1c4a09d | tlaplus/tlapm | watch.ml | Copyright 2005 INRIA
open Printf;;
open Expr;;
open Llproof;;
open Namespace;;
module HE = Hashtbl.Make (Expr);;
let hyp_names = (HE.create 37 : string HE.t);;
let used = (Hashtbl.create 37 : (string, unit) Hashtbl.t);;
let test n = Hashtbl.mem used n;;
let add n = if not (test n) then Hashtbl.add used n ();;... | null | https://raw.githubusercontent.com/tlaplus/tlapm/b82e2fd049c5bc1b14508ae16890666c6928975f/zenon/watch.ml | ocaml | Copyright 2005 INRIA
open Printf;;
open Expr;;
open Llproof;;
open Namespace;;
module HE = Hashtbl.Make (Expr);;
let hyp_names = (HE.create 37 : string HE.t);;
let used = (Hashtbl.create 37 : (string, unit) Hashtbl.t);;
let test n = Hashtbl.mem used n;;
let add n = if not (test n) then Hashtbl.add used n ();;... | |
78b56425cf1b23188485a6d04ef8b3d28f2c2c22316c3beb93b0a2644fd501dd | sarabander/p2pu-sicp | polynomials.scm |
;; To install polynomial package, evaluate this file.
;; Let our polynomial be structured as:
;;
' ( polynomial < variable > < term_1 > < term_2 > .. < term_n > )
;;
;; where <variable> is the indeterminate, like 'x or 'y,
< term_1 > < term_2 > .. < term_n > are terms :
;; coeff[n] coeff[n-1] .. coef... | null | https://raw.githubusercontent.com/sarabander/p2pu-sicp/fbc49b67dac717da1487629fb2d7a7d86dfdbe32/2.5/generic-arithmetic/polynomials.scm | scheme | To install polynomial package, evaluate this file.
Let our polynomial be structured as:
where <variable> is the indeterminate, like 'x or 'y,
coeff[n] coeff[n-1] .. coeff[0] when dense,
(order coeff) (order coeff) .. when sparse.
internal procedures
representation of poly
representation of terms and ... |
' ( polynomial < variable > < term_1 > < term_2 > .. < term_n > )
< term_1 > < term_2 > .. < term_n > are terms :
(define (install-polynomial-package)
(define (make-poly variable term-list)
(cons variable term-list))
(define (variable p) (car p))
(define (variable? x) (symbol? x))
(define ... |
f8c7549d9a4d5ad2adcfff8eb85ce06e9b630d6787a2bcfd7d9bf7dd6e8dd1a7 | qgevans/geomyid | package.lisp | (defpackage geomyid
(:use #:common-lisp #:sb-ext #:sb-alien
#:sb-bsd-sockets #:alexandria
#:solipsism
#+sb-thread #:sb-thread)
(:export #:serve))
| null | https://raw.githubusercontent.com/qgevans/geomyid/e35b651ec8652e41348308fc4a39b1944a7aee74/package.lisp | lisp | (defpackage geomyid
(:use #:common-lisp #:sb-ext #:sb-alien
#:sb-bsd-sockets #:alexandria
#:solipsism
#+sb-thread #:sb-thread)
(:export #:serve))
| |
ebb1df2c0b2afb231ec40b499930baa24237c7f058e4dc3e05d1caa44c91fb6d | lvaruzza/cl-randist | dirichlet.lisp | (in-package :randist)
/ * The Dirichlet probability distribution of order K-1 is
;; p(\theta_1,...,\theta_K) d\theta_1 ... d\theta_K =
;; (1/Z) \prod_i=1,K \theta_i^{alpha_i - 1} \delta(1 -\sum_i=1,K \theta_i)
;; The normalization factor Z can be expressed in terms of gamma functions:
Z =... | null | https://raw.githubusercontent.com/lvaruzza/cl-randist/413204fa2b9e7f0431c0bc45367304af937494ff/dirichlet.lisp | lisp | p(\theta_1,...,\theta_K) d\theta_1 ... d\theta_K =
(1/Z) \prod_i=1,K \theta_i^{alpha_i - 1} \delta(1 -\sum_i=1,K \theta_i)
The normalization factor Z can be expressed in terms of gamma functions:
The K constants, \alpha_1,...,\alpha_K, must be positive. The K parameters,
The random variates... | (in-package :randist)
/ * The Dirichlet probability distribution of order K-1 is
Z = { \prod_i=1,K \Gamma(\alpha_i ) } / { \Gamma ( \sum_i=1,K \alpha_i ) }
\theta_1, ... ,\theta_K are nonnegative and sum to 1 .
See A.M. Law , , Simulation Modeling and Analysis ( 1991 ) .
< > ( 20... |
19bbc14ca76e84a8aa420b33a838554b604c3720c75eff5f499e2d1c1b53c938 | elaforge/karya | Integrate.hs | Copyright 2013
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
module Derive.C.Prelude.Integrate (
library, unwarp
) where
import qualified Data.Map as Map
import qualified Data.Maybe as Maybe
import qualified Data.Set as Set
import qualified Ut... | null | https://raw.githubusercontent.com/elaforge/karya/8ea15e6a5fb57e2f15f8c19836751e315f9c09f2/Derive/C/Prelude/Integrate.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
* block integrate
Only collect an integration if this is the top level block. Otherwise
I can get integrating blocks called from many places and who knows which
one is supposed to be integrated.
| If the b... | Copyright 2013
module Derive.C.Prelude.Integrate (
library, unwarp
) where
import qualified Data.Map as Map
import qualified Data.Maybe as Maybe
import qualified Data.Set as Set
import qualified Util.Seq as Seq
import qualified Derive.Call as Call
import qualified Derive.Call.BlockUtil as BlockUtil
import qua... |
9478bafcb3bbbc04af28058c91aeea6e5d147a963738fc8211d0695d0c1ec16e | aiya000/haskell-examples | poly_kind_equalities.hs | # LANGUAGE DataKinds #
{-# LANGUAGE GADTs #-}
# LANGUAGE KindSignatures #
# LANGUAGE PolyKinds #
# LANGUAGE TypeFamilies #
import Data.Proxy (Proxy(..))
import Data.Singletons (Sing, SingI(..))
data family HighEquality (x :: k) (y :: k)
data Foo = Bar | Baz
data instance Sing Bar = SBar
data instance Sing Baz = SBa... | null | https://raw.githubusercontent.com/aiya000/haskell-examples/a337ba0e86be8bb1333e7eea852ba5fa1d177d8a/Language/Haskell/Extension/TypeFamilies/poly_kind_equalities.hs | haskell | # LANGUAGE GADTs # | # LANGUAGE DataKinds #
# LANGUAGE KindSignatures #
# LANGUAGE PolyKinds #
# LANGUAGE TypeFamilies #
import Data.Proxy (Proxy(..))
import Data.Singletons (Sing, SingI(..))
data family HighEquality (x :: k) (y :: k)
data Foo = Bar | Baz
data instance Sing Bar = SBar
data instance Sing Baz = SBaz
instance SingI Bar w... |
5c156928c96316f377154b59aea63901d8cd02b259123910f09955fde8fef5e3 | mzp/scheme-abc | bitsOutTest.ml | open Base
open OUnit
open BitsOut
let ok x y =
assert_equal ~printer:Std.dump x @@ to_list y
let _ = begin "bitsOut.ml" >::: [
"empty" >:: begin fun () ->
ok [] @@ empty
end;
"put" >:: begin fun () ->
let t1 =
put empty ~width:1 ~bits:1 in
let t2 =
put t1 ~width:3 ~bits:1 in
ok [... | null | https://raw.githubusercontent.com/mzp/scheme-abc/2cb541159bcc32ae4d033793dea6e6828566d503/swflib/bitsOutTest.ml | ocaml | open Base
open OUnit
open BitsOut
let ok x y =
assert_equal ~printer:Std.dump x @@ to_list y
let _ = begin "bitsOut.ml" >::: [
"empty" >:: begin fun () ->
ok [] @@ empty
end;
"put" >:: begin fun () ->
let t1 =
put empty ~width:1 ~bits:1 in
let t2 =
put t1 ~width:3 ~bits:1 in
ok [... | |
9411c1fda60751d19e0e7702e89a78cbbdffa5ef2675cd4374865ee8de16d41f | tonyg/racket-stomp | test-packet.rkt | #lang racket/base
(module+ test
(require rackunit)
(require racket/port)
(require "packet.rkt")
(check-equal? (unescape-stomp-header "abc\\ndef") "abc\ndef")
(check-equal? (unescape-stomp-header "abc\\cdef") "abc:def")
(check-equal? (unescape-stomp-header "abc\\\\def") "abc\\def")
(check-equal? (unesca... | null | https://raw.githubusercontent.com/tonyg/racket-stomp/8ec9471362f42253df787c83dc3f241086be6b9f/stomp/test-packet.rkt | racket | #lang racket/base
(module+ test
(require rackunit)
(require racket/port)
(require "packet.rkt")
(check-equal? (unescape-stomp-header "abc\\ndef") "abc\ndef")
(check-equal? (unescape-stomp-header "abc\\cdef") "abc:def")
(check-equal? (unescape-stomp-header "abc\\\\def") "abc\\def")
(check-equal? (unesca... | |
fb9802703722cacfebc2fd88a34e81d974d4d52d0e3ee2b51a716161e0071215 | ku-fpg/kansas-lava | Proto.hs | # LANGUAGE ScopedTypeVariables , RecursiveDo , DoRec #
module Main where
import Language.KansasLava
import Language.KansasLava.Protocols
import Language.KansasLava.Utils
import Control.Monad.Fix
import Control.Monad
import System.IO
import Data.Word
import Data.Sized.Ix
import Data.Sized.Unsigned
import Control.Concu... | null | https://raw.githubusercontent.com/ku-fpg/kansas-lava/cc0be29bd8392b57060c3c11e7f3b799a6d437e1/examples/Proto.hs | haskell | print ("loop0",n) | # LANGUAGE ScopedTypeVariables , RecursiveDo , DoRec #
module Main where
import Language.KansasLava
import Language.KansasLava.Protocols
import Language.KansasLava.Utils
import Control.Monad.Fix
import Control.Monad
import System.IO
import Data.Word
import Data.Sized.Ix
import Data.Sized.Unsigned
import Control.Concu... |
8b14a29440f944a6702e595d0da649ee740f9d3bb2a62f03d79039aaddd8c621 | arsalan0c/cdp-hs | Snippets.hs | {-# LANGUAGE OverloadedStrings #-}
module CDP.Gen.Snippets where
import qualified Data.Text as T
domainLanguageExtensions :: T.Text
domainLanguageExtensions = T.unlines
[ "{-# LANGUAGE OverloadedStrings, RecordWildCards, TupleSections #-}"
, "{-# LANGUAGE ScopedTypeVariables #-}"
, "{-# LANGUAGE FlexibleC... | null | https://raw.githubusercontent.com/arsalan0c/cdp-hs/0fca3338d1b120385b571ea56ea066b7988d5036/gen/CDP/Gen/Snippets.hs | haskell | # LANGUAGE OverloadedStrings # | module CDP.Gen.Snippets where
import qualified Data.Text as T
domainLanguageExtensions :: T.Text
domainLanguageExtensions = T.unlines
[ "{-# LANGUAGE OverloadedStrings, RecordWildCards, TupleSections #-}"
, "{-# LANGUAGE ScopedTypeVariables #-}"
, "{-# LANGUAGE FlexibleContexts #-}"
, "{-# LANGUAGE Mu... |
3370790c3e5a5eeae348aa9997306698a038ab3e8588db6bb1dcb0e72e8413dc | Opetushallitus/ataru | application_hakukohde_2nd_component.cljs | (ns ataru.hakija.application-hakukohde-2nd-component
(:require [reagent.core :as r]
[re-frame.core :refer [dispatch subscribe]]
[ataru.application-common.components.button-component :as btn]
[ataru.util :as u]
[ataru.translations.translation-util :as translations]
... | null | https://raw.githubusercontent.com/Opetushallitus/ataru/7a99f1feca509bed2f7b7edaefc7f8d7a82b0e3d/src/cljs/ataru/hakija/application_hakukohde_2nd_component.cljs | clojure | (ns ataru.hakija.application-hakukohde-2nd-component
(:require [reagent.core :as r]
[re-frame.core :refer [dispatch subscribe]]
[ataru.application-common.components.button-component :as btn]
[ataru.util :as u]
[ataru.translations.translation-util :as translations]
... | |
43b456d35f36fdd692915f4e1612d5574cc82bae07423e3950298e8b6bcbaced | mejgun/haskell-tdlib | Stickers.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Data.Stickers where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.Sticker as Sticker
import qualified Utils as U
-- |
| Represents a list of stickers @stickers List of stickers
Stickers
{ -- |
stickers :: M... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/beb6635177d7626b70fd909b1d89f2156a992cd2/src/TD/Data/Stickers.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
| |
module TD.Data.Stickers where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified TD.Data.Sticker as Sticker
import qualified Utils as U
| Represents a list of stickers @stickers List of stickers
Stickers
stickers :: Maybe [Sticker.Sticker]
}
deriving (Eq)
instance S... |
a63a3b6e09b24bd35353f26d96625d3b1ee4c127936ef710fcc17b100ac9c203 | cabol/erlbus | ebus_common.erl | %%%-------------------------------------------------------------------
%%% @doc
%%% Common utilities.
%%% @end
%%%-------------------------------------------------------------------
-module(ebus_common).
%% API
-export([keyfind/2, keyfind/3, rand_elem/1]).
-export([build_name/1, build_name/2]).
-export([to_bin/1, to_a... | null | https://raw.githubusercontent.com/cabol/erlbus/050cb728ef09a0ad51c9297281602e362b5e233d/src/utils/ebus_common.erl | erlang | -------------------------------------------------------------------
@doc
Common utilities.
@end
-------------------------------------------------------------------
API
===================================================================
API
===================================================================
@doc
... | -module(ebus_common).
-export([keyfind/2, keyfind/3, rand_elem/1]).
-export([build_name/1, build_name/2]).
-export([to_bin/1, to_atom/1, to_int/1, to_float/1, to_list/1]).
-export([wait_until/1, wait_until/2, wait_until/3]).
@equiv keyfind(Key , TupleList , nil )
keyfind(Key, TupleList) ->
keyfind(Key, TupleList... |
2a42d4d5001f026d9da21ccd4037064c98fe1da9000b090e30a0528c6cd8c0cd | pascal-knodel/haskell-craft | E'6''8.hs | --
--
--
----------------
Exercise 6.8 .
----------------
--
--
--
module E'6''8 where
import Pictures ( Picture )
import Data.List ( transpose )
import Test.HUnit
example = fst
expected = snd
testRotate90_1_Data
= ( -- example (input):
[
".##.",
".#.#",
".###",
"####"
... | null | https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/_/links/E'6''8.hs | haskell |
--------------
--------------
example (input):
expected (output):
If picture is rectangular:
GHCi> runTestTT testRotate90_1
Other solution for "rotate90":
If picture is rectangular:
> [ start, (start - 1) .. stop ]
GHCi> runTestTT testRotate90'_1 | Exercise 6.8 .
module E'6''8 where
import Pictures ( Picture )
import Data.List ( transpose )
import Test.HUnit
example = fst
expected = snd
testRotate90_1_Data
[
".##.",
".#.#",
".###",
"####"
],
[
"#...",
"####",
"##.#",
"###."
]... |
3b974f091aa0483ebbcc5298133a851ec2cae7c0c03e8de94cf2331b4b5a62e5 | rmloveland/scheme48-0.53 | for-reify.scm | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
Things used by the expression returned by - STRUCTURES .
; Cf. link/reify.scm.
(define (operator name type-exp)
(get-operator name (sexp->type type-exp #t)))
(define (primop name)
(get-primop name))
(define (simple-interface names types)
(make-s... | null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/scheme/bcomp/for-reify.scm | scheme | Cf. link/reify.scm.
(lambda () '()) | Copyright ( c ) 1993 - 1999 by and . See file COPYING .
Things used by the expression returned by - STRUCTURES .
(define (operator name type-exp)
(get-operator name (sexp->type type-exp #t)))
(define (primop name)
(get-primop name))
(define (simple-interface names types)
(make-simple-interface #f
... |
3453891d6fbafd8c43d0dfd532ebca621e3d48c169f37b3833b071ead5a22810 | dmiller/clr.core.async | buffers.clj | Copyright ( c ) and contributors . All rights reserved .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are a... | null | https://raw.githubusercontent.com/dmiller/clr.core.async/bb861242531cdd6ba727283bf3ddee73db1e1c2d/src/clojure/clojure/core/async/impl/buffers.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not re... | Copyright ( c ) and contributors . All rights reserved .
Ported to by .
(ns ^{:skip-wiki true}
clojure.core.async.impl.buffers
(:require [clojure.core.async.impl.protocols :as impl])
(set! *warn-on-reflection* true)
LinkedList
impl/ABuffer
(full? [this]
.size
(remove! [this]
... |
9d8be0b267207c3c90af18ec4cf9e525210c5ae629755b78b4ad1f935c08893c | imrehg/ypsilon | volume.scm | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gtk volume)
(export gtk_volume_button_get_type
gtk_volume_button_new)
(import (rnrs) (ypsilon ffi))
(define lib-name
(... | null | https://raw.githubusercontent.com/imrehg/ypsilon/e57a06ef5c66c1a88905b2be2fa791fa29848514/sitelib/ypsilon/gtk/volume.scm | scheme | [end] | #!nobacktrace
Ypsilon Scheme System
Copyright ( c ) 2004 - 2009 Y.FUJITA / LittleWing Company Limited .
See license.txt for terms and conditions of use .
(library (ypsilon gtk volume)
(export gtk_volume_button_get_type
gtk_volume_button_new)
(import (rnrs) (ypsilon ffi))
(define lib-name
(... |
bb222801e04fa092fed00c30b30913fae7448aecc5acbc757a3f6f9946af6732 | samth/tr-tutorial | step5.rkt | #lang typed/racket
(require typed/net/url)
(require/typed xml [xexpr->string (Any -> String)])
(: serve : Integer -> Any)
(: accept-and-handle : TCP-Listener -> Any)
(: handle : Input-Port Output-Port -> Any)
(: dispatch : String -> Any)
(define (serve port-no)
(define main-cust (make-custodian))
(parameterize (... | null | https://raw.githubusercontent.com/samth/tr-tutorial/3457df465921274f410bfa0ec0a623410fb22b47/more/step5.rkt | racket | Watcher thread:
The `handle' function now parses the request into `req', and it
calls the new `dispatch' function to get the response, which is an
xexpr instead of a string.
Discard the rest of the header (up to blank line):
Send reply:
New: the `dispatch' function and `dispatch-table':
Parse the request as a U... | #lang typed/racket
(require typed/net/url)
(require/typed xml [xexpr->string (Any -> String)])
(: serve : Integer -> Any)
(: accept-and-handle : TCP-Listener -> Any)
(: handle : Input-Port Output-Port -> Any)
(: dispatch : String -> Any)
(define (serve port-no)
(define main-cust (make-custodian))
(parameterize (... |
72cb86cacedf217c18fa0474d164ce086db9fee237fa9da1a1f2daaa24115c2c | input-output-hk/rscoin-core | Methods.hs | {-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE Rank2Types #-}
# OPTIONS_GHC -fno - warn - missing - signatures #
-- | This module defines protocol methods to communicate with
different node types ( User , Bank , Mintette , Explorer ) .
module RSCoin.Core.Protocol.Me... | null | https://raw.githubusercontent.com/input-output-hk/rscoin-core/5b3fde8de1bdce71ee6ea0e8f1582ea28f451171/src/RSCoin/Core/Protocol/Methods.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE Rank2Types #
| This module defines protocol methods to communicate with
TODO: this module should provide more safety and expose better api
Note that you can't match arguments in datatype constructors,
they are used as 'tags' only.
| Create server method.
cal... | # LANGUAGE MultiParamTypeClasses #
# OPTIONS_GHC -fno - warn - missing - signatures #
different node types ( User , Bank , Mintette , Explorer ) .
module RSCoin.Core.Protocol.Methods
( WithResult
, Server
, Rpc.Client
, method
, Rpc.serve
, call
, execBank
, ex... |
95e8cf52ee1e46c43c571519b41afdd1a65b41c00e8ab25b8d95e4d34ce4a1a8 | rizo/snowflake-os | DAAP.ml |
module S = ExtString.String
let rec replace_all s f r = match S.replace s f r with
| false, n -> n
| _, n -> replace_all n f r
daap format : 4 - byte tag : 4 - byte length : length bytes data
type kind = Byte | Short | Int | Long | String | Date | Version | List
(* lookup table of types *)
let types... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/kernel/DAAP.ml | ocaml | lookup table of types |
module S = ExtString.String
let rec replace_all s f r = match S.replace s f r with
| false, n -> n
| _, n -> replace_all n f r
daap format : 4 - byte tag : 4 - byte length : length bytes data
type kind = Byte | Short | Int | Long | String | Date | Version | List
let types = [
"mstt", Int;
"miid",... |
d8666b3288931255c2b5645ea01fca4855309ea3da42e2a12d1d59e4aca8639e | samrocketman/home | noclayto-fade-animator.scm | ;
; The GIMP -- an image manipulation program
Copyright ( C ) 1995 and
;
Fade Animator script for GIMP 2.4
; Original author: noclayto <www.gimptalk.com>
;
; Tags: animation
;
; Author statement:
;
;; Will fade a layer to transparent.
;; This script is mainly for learning. Use at your own risk.
;
; ---------... | null | https://raw.githubusercontent.com/samrocketman/home/63a8668a71dc594ea9ed76ec56bf8ca43b2a86ca/dotfiles/.gimp/scripts/noclayto-fade-animator.scm | scheme |
The GIMP -- an image manipulation program
Original author: noclayto <www.gimptalk.com>
Tags: animation
Author statement:
Will fade a layer to transparent.
This script is mainly for learning. Use at your own risk.
--------------------------------------------------------------------
-----------------------... | Copyright ( C ) 1995 and
Fade Animator script for GIMP 2.4
Distributed by Gimp FX Foundry project
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public ... |
b1b6858542f33a2f9ff62a402c7bc20b5dfd6087c230900f476c5bbd80e63e20 | bmeurer/ocamljit2 | taku.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/bmeurer/ocamljit2/ef06db5c688c1160acc1de1f63c29473bcd0055c/testsuite/tests/misc/taku.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ Id$
let rec tak (x, y, z) =
if x... |
85cfc0b95476b4772140e02508b2ccbb1cb954c4979fa93d70b7ac7bc4824b2c | DarrenN/identikon | qbert.rkt | #lang racket
(provide draw-rules)
(require lang/posn
openssl/sha1
2htdp/image
sugar
identikon/utils)
; Constants
(define RHOMBUS-ANGLE 60)
(define HEX-TOP 200)
(define HEX-LEFT 80)
(define HEX-RIGHT 155)
(define ALPHA-MAX 50)
(define DEFAULT-ALPHA 255)
(define CANVAS-COLOR "white"... | null | https://raw.githubusercontent.com/DarrenN/identikon/d8908ee6955e69466270692599eb9076adc6a28b/rules/qbert.rkt | racket | Constants
Data structs
Generate a color with alphas from r g b list
Get width of rhombus from length of side
hex (offset row col point image)
Main draw function
Tests
rhombus-offset calculcation is correct | #lang racket
(provide draw-rules)
(require lang/posn
openssl/sha1
2htdp/image
sugar
identikon/utils)
(define RHOMBUS-ANGLE 60)
(define HEX-TOP 200)
(define HEX-LEFT 80)
(define HEX-RIGHT 155)
(define ALPHA-MAX 50)
(define DEFAULT-ALPHA 255)
(define CANVAS-COLOR "white")
(define BO... |
5535707cf5a01c4d8c04e595bb85878a33a91b6fe3ea60acdb8ad8e47b815d9d | google/ormolu | dot-singleline.hs | {-# OPTIONS_GHC -fplugin=RecordDotPreprocessor #-}
data Foo = Foo { bar :: Int }
mfoo = fmap (.bar) $ Nothing
bar = ( Foo 1).bar
fooplus f n = f{foo = f.bar + n}
fooplus' f n = f { foo = f.bar + n}
fooplus'' f n = f {foo = f.bar + n}
fooplus''' f n = f{ foo = f.bar + n}
| null | https://raw.githubusercontent.com/google/ormolu/ffdf145bbdf917d54a3ef4951fc2655e35847ff0/data/examples/declaration/value/function/record/dot-singleline.hs | haskell | # OPTIONS_GHC -fplugin=RecordDotPreprocessor # | data Foo = Foo { bar :: Int }
mfoo = fmap (.bar) $ Nothing
bar = ( Foo 1).bar
fooplus f n = f{foo = f.bar + n}
fooplus' f n = f { foo = f.bar + n}
fooplus'' f n = f {foo = f.bar + n}
fooplus''' f n = f{ foo = f.bar + n}
|
29329e8c8e9930d09f7ab240bc2bc8eed66fbf2cd7abf3504e38cda9211a7d5f | amnh/PCG | Trans.hs | -----------------------------------------------------------------------------
-- |
-- Module : Control.Evaluation.Trans
Copyright : ( c ) 2015 - 2021 Ward Wheeler
-- License : BSD-style
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
-- The 'Evaluation' type's monad t... | null | https://raw.githubusercontent.com/amnh/PCG/9341efe0ec2053302c22b4466157d0a24ed18154/lib/evaluation/src/Control/Evaluation/Trans.hs | haskell | ---------------------------------------------------------------------------
|
Module : Control.Evaluation.Trans
License : BSD-style
Maintainer :
Stability : provisional
Portability : portable
The 'Evaluation' type's monad transformer definition and types.
------------------------------------... | Copyright : ( c ) 2015 - 2021 Ward Wheeler
# LANGUAGE BangPatterns #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
This is needed due to the functional dependency in MonadReader .
# LANGUAGE UndecidableInstances #
module Control.Evaluation.Trans
( Evaluation()
, Eval... |
03c014886740e28352a4dd38194bfa1a57cb4045f8c80cd3e7e68f1b7ed42702 | ds-wizard/engine-backend | Detail_Documents_Preview_Settings_PUT.hs | module Wizard.Api.Handler.DocumentTemplateDraft.Detail_Documents_Preview_Settings_PUT where
import Servant
import Shared.Api.Handler.Common
import Shared.Model.Context.TransactionState
import Wizard.Api.Handler.Common
import Wizard.Api.Resource.DocumentTemplate.Draft.DocumentTemplateDraftDataChangeDTO
import Wizard.A... | null | https://raw.githubusercontent.com/ds-wizard/engine-backend/d392b751192a646064305d3534c57becaa229f28/engine-wizard/src/Wizard/Api/Handler/DocumentTemplateDraft/Detail_Documents_Preview_Settings_PUT.hs | haskell | module Wizard.Api.Handler.DocumentTemplateDraft.Detail_Documents_Preview_Settings_PUT where
import Servant
import Shared.Api.Handler.Common
import Shared.Model.Context.TransactionState
import Wizard.Api.Handler.Common
import Wizard.Api.Resource.DocumentTemplate.Draft.DocumentTemplateDraftDataChangeDTO
import Wizard.A... | |
6809373bffd7d23ca2d62ff0ee04195f4161f5a503e264e2bb390bea9d27ca2b | Mzk-Levi/texts | FreshM.hs | # LANGUAGE GeneralizedNewtypeDeriving #
--------------------------------------------------------------------------------
-- |
Module : Data . Comp . . Multi . FreshM
Copyright : ( c ) 2011 ,
-- License : BSD3
Maintainer : < >
-- Stability : experimental
Portability : non - por... | null | https://raw.githubusercontent.com/Mzk-Levi/texts/34916d6531af9bc39e50b596247ac2017d8cfdc3/compdata-param-master/src/Data/Comp/Param/Multi/FreshM.hs | haskell | ------------------------------------------------------------------------------
|
License : BSD3
Stability : experimental
This module defines a monad for generating fresh, abstract names, useful
e.g. for defining equality on terms.
--------------------------------------------------------------------------... | # LANGUAGE GeneralizedNewtypeDeriving #
Module : Data . Comp . . Multi . FreshM
Copyright : ( c ) 2011 ,
Maintainer : < >
Portability : non - portable ( GHC Extensions )
module Data.Comp.Param.Multi.FreshM
(
FreshM,
Name,
withName,
nameCoerce,
evalFreshM
... |
10c600a84be608b75c570ab4fd1ffdcb34d668dea7fb93d1c9c3d3246dbd569c | Soostone/hadron | HuntSzymanski.hs | # LANGUAGE FlexibleContexts #
-----------------------------------------------------------------------------
-- |
-- Module : Data.List.LCS.HuntSzymanski
Copyright : ( c ) 2005
-- License : BSD or GPL v2
--
-- Maintainer :
-- Stability : provisional
Portability : non - portable ( uses STU... | null | https://raw.githubusercontent.com/Soostone/hadron/d155ecbcdf0bb0dd442d6fc3e142bea75a312241/src/Data/List/LCS/HuntSzymanski.hs | haskell | ---------------------------------------------------------------------------
|
Module : Data.List.LCS.HuntSzymanski
License : BSD or GPL v2
Maintainer :
Stability : provisional
Derived from the description in \"String searching algorithms\" by
---------------------------------------------------... | # LANGUAGE FlexibleContexts #
Copyright : ( c ) 2005
Portability : non - portable ( uses STUArray )
This is an implementation of the - Szymanski LCS algorithm .
Graham A Stephen , ISBN 981021829X.
module Data.List.LCS.HuntSzymanski (
lcs
) where
import Data.Array (listArray, (!))
import Da... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.