_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
87e128b7e5b095d0e60e0eaad79605ec97354568e2829488e7c18c1a38d6a3f8
ubf/ubf-jsonrpc
ubf_jsonrpc.erl
-module(ubf_jsonrpc). -include_lib("ubf/include/ubf.hrl"). -export([rpc_v11_req_encode_print/3]). -export([rpc_v11_req_encode/3, rpc_v11_req_encode/4]). -export([rpc_v11_req_decode_print/3]). -export([rpc_v11_req_decode/3, rpc_v11_req_decode/4]). -export([rpc_v11_res_encode_print/4]). -export([rpc_v11_res_encode/4]...
null
https://raw.githubusercontent.com/ubf/ubf-jsonrpc/5cae67c1668d4c3b645a3025143e0b90343480dc/src/ubf_jsonrpc.erl
erlang
Links: -rpc.org/wd/JSON-RPC-1-1-WD-20060807.html -rpc.org/wiki/specification -projects.org/Public/news/ejson/view -archive/erlang-questions/200511/msg00193.html / Other Links: -schema-proposal/ json-rpc * Renamed request to Procedure Call (capitalization significant). * Renamed ...
-module(ubf_jsonrpc). -include_lib("ubf/include/ubf.hrl"). -export([rpc_v11_req_encode_print/3]). -export([rpc_v11_req_encode/3, rpc_v11_req_encode/4]). -export([rpc_v11_req_decode_print/3]). -export([rpc_v11_req_decode/3, rpc_v11_req_decode/4]). -export([rpc_v11_res_encode_print/4]). -export([rpc_v11_res_encode/4]...
99201bd08673bf984817fee62a545487d557d45d35350b897438f7de870eb90f
alxlit/autoclave
html_test.clj
(ns autoclave.html-test "Adapted from the OWASP HTML Sanitizer test suite." (:require [autoclave.core :refer :all] [clojure.test :refer [deftest is]] [clojure.string :as string])) ;;;; HtmlPolicyBuilderTest.java (def example (str "<h1 id='foo'>Header</h1>\n" "<p onclick='alert(42)...
null
https://raw.githubusercontent.com/alxlit/autoclave/6bcc149e4de954ba61e171aa3bb241beef948277/test/autoclave/html_test.clj
clojure
HtmlPolicyBuilderTest.java direction:rtl;font-weight:bold\">" starts-with-b filter. hence attr-count=2.
(ns autoclave.html-test "Adapted from the OWASP HTML Sanitizer test suite." (:require [autoclave.core :refer :all] [clojure.test :refer [deftest is]] [clojure.string :as string])) (def example (str "<h1 id='foo'>Header</h1>\n" "<p onclick='alert(42)'>Paragraph 1<script>evil()</scr...
21af97c4a3468d134cc23a9fdafcf78397b17dc6c09d22e5ab8360c08937282c
jepsen-io/knossos
linear.clj
(ns knossos.linear "An implementation of the linear algorithm from " (:require [clojure.math.combinatorics :as combo] [clojure.core.reducers :as r] [clojure.set :as set] [clojure.tools.logging :refer [info warn error]] [clojure.pprint :refer [cl-format]] ...
null
https://raw.githubusercontent.com/jepsen-io/knossos/1cb706f979c1712add47f0519d9e1dcb85635635/src/knossos/linear.clj
clojure
Transitions between configurations Exploring the automaton Record this point We can skip this execution; it'll appear in some other config's jit-linearizations (info :dup config) Trivial case: record this configuration. Take all pending ops from the configuration *except* the final one, try linearizing that op,...
(ns knossos.linear "An implementation of the linear algorithm from " (:require [clojure.math.combinatorics :as combo] [clojure.core.reducers :as r] [clojure.set :as set] [clojure.tools.logging :refer [info warn error]] [clojure.pprint :refer [cl-format]] ...
a626593d5aeaef2c52709ac324478ff20daee75b9d9e18272f68bcd8265f601e
dnaeon/clingon
test-command.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/5f847ed07904628194441f93208a072ec7174bd6/tests/test-command.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...
c26d3bfa80421c7d24881d58fe1b24f4d4592f9dbc1454f9bd82466fff897ba1
craigfe/sink
type_eq.ml
type ('a, 'b) t = Refl : ('a, 'a) t let cast (type a b) (Refl : (a, b) t) (x : a) : b = x type ('a, 'b) eq = ('a, 'b) t module Id = struct type _ w = .. module type T = sig type a type _ w += W : a w end type 'a t = (module T with type a = 'a) let hash (type a) ((module T) : a t) = Poly.hash T.W...
null
https://raw.githubusercontent.com/craigfe/sink/c5431edfa1b06f1a09845a481c4afcb3e92f0667/src/sink/type_eq.ml
ocaml
type ('a, 'b) t = Refl : ('a, 'a) t let cast (type a b) (Refl : (a, b) t) (x : a) : b = x type ('a, 'b) eq = ('a, 'b) t module Id = struct type _ w = .. module type T = sig type a type _ w += W : a w end type 'a t = (module T with type a = 'a) let hash (type a) ((module T) : a t) = Poly.hash T.W...
1013e619f19e69c14a8ecf395aa92f65b1e8687f92a2a2f733997dfbc6fc747f
eugeneia/erlangen
kernel.lisp
kernel : Erlangen kernel executable for standalone use or use as an ;;;; “inferior Lisp.” (require :asdf) (asdf:load-system :erlangen) (push (lambda () (use-package '(:erlangen :erlangen.management) :cl-user)) *lisp-startup-functions*) (gc) (save-application "bin/erlangen-kernel" :prepend-kernel t)...
null
https://raw.githubusercontent.com/eugeneia/erlangen/204166b33833c49841617bbc6ecfaf4dd77cf6d8/build/kernel.lisp
lisp
“inferior Lisp.”
kernel : Erlangen kernel executable for standalone use or use as an (require :asdf) (asdf:load-system :erlangen) (push (lambda () (use-package '(:erlangen :erlangen.management) :cl-user)) *lisp-startup-functions*) (gc) (save-application "bin/erlangen-kernel" :prepend-kernel t)
a99331c2da3b7760c1735ff42c1ca1878f7108050b23f3be5590667d428d16b9
namin/biohacker
interactive-ex.lisp
(setq *ltms* (create-ltms "Explain Example")) (setq x (tms-create-node *ltms* "x" :ASSUMPTIONP t) y (tms-create-node *ltms* "y") z (tms-create-node *ltms* "z") r (tms-create-node *ltms* "r")) (add-formula *ltms* `(:OR ,x ,y)) (add-formula *ltms* `(:OR (:NOT ,y) ,z)) (add-formula *ltms* `(:OR (:NOT ,z)...
null
https://raw.githubusercontent.com/namin/biohacker/6b5da4c51c9caa6b5e1a68b046af171708d1af64/BPS/ltms/interactive-ex.lisp
lisp
(setq *ltms* (create-ltms "Explain Example")) (setq x (tms-create-node *ltms* "x" :ASSUMPTIONP t) y (tms-create-node *ltms* "y") z (tms-create-node *ltms* "z") r (tms-create-node *ltms* "r")) (add-formula *ltms* `(:OR ,x ,y)) (add-formula *ltms* `(:OR (:NOT ,y) ,z)) (add-formula *ltms* `(:OR (:NOT ,z)...
c68ce8c3716a982057e89f1a20f1a8aebfdcdcfbd0996c17e9486db3a80bf61c
ToTal/total
typing.ml
(** Type inference. *) open Syntax open Ctx (** [equal ctx e1 e2] determines whether [e1] and [e2] are equal expressions. *) let rec equal ctx e1' e2' = let (e1, l1) = Norm.whnf ctx e1' in let (e2, l2) = Norm.whnf ctx e2' in Print.debug "equal e1=@[%t@]@ e2=@[%t@]" (Print.expr ctx (e1,l1)) (Print.expr ctx (e2,l...
null
https://raw.githubusercontent.com/ToTal/total/fa9c677c9110afd5fb423a4fe24eafff2fd08507/typing.ml
ocaml
* Type inference. * [equal ctx e1 e2] determines whether [e1] and [e2] are equal expressions. * [infer ctx e] infers the type of expression [e] in context [ctx]. TODO think about this * [infer_universe ctx t] infers the universe level of type [t] in context [ctx].
open Syntax open Ctx let rec equal ctx e1' e2' = let (e1, l1) = Norm.whnf ctx e1' in let (e2, l2) = Norm.whnf ctx e2' in Print.debug "equal e1=@[%t@]@ e2=@[%t@]" (Print.expr ctx (e1,l1)) (Print.expr ctx (e2,l2)) ; match e1, e2 with | Ann(e1', _), _ -> equal ctx e1' (e2, l2) | _, Ann(e2', _) -> e...
71df4aca68d7e72b8f8c92ea7c45121babac2f14e411b2eb86899ddda2a54638
dpiponi/Moodler
noteE.hs
selection >>= mapM_ (\x -> set x (0.1*4/12))
null
https://raw.githubusercontent.com/dpiponi/Moodler/a0c984c36abae52668d00f25eb3749e97e8936d3/Moodler/scripts/noteE.hs
haskell
selection >>= mapM_ (\x -> set x (0.1*4/12))
b4df9640518b29a2d372c17b1bd4976cd014fbcde131956a2018e4b0a3e2140d
bravit/hid-examples
ServerUtils.hs
# LANGUAGE TupleSections # # LANGUAGE ScopedTypeVariables # module ServerUtils (genServer, serveRPC, runSerialized) where import Data.Serialize import Data.ByteString (ByteString) import Control.Monad import Control.Monad.Catch import Network.Simple.TCP import Network.Connection import Network.Socket (PortNumber) im...
null
https://raw.githubusercontent.com/bravit/hid-examples/913e116b7ee9c7971bba10fe70ae0b61bfb9391b/ch12/rpc/lib/ServerUtils.hs
haskell
# LANGUAGE TupleSections # # LANGUAGE ScopedTypeVariables # module ServerUtils (genServer, serveRPC, runSerialized) where import Data.Serialize import Data.ByteString (ByteString) import Control.Monad import Control.Monad.Catch import Network.Simple.TCP import Network.Connection import Network.Socket (PortNumber) im...
710578c38b029a30225bda8e11e96b5547009f676a370433fe5dfab316210954
patricoferris/sesame
path.mli
(** {2 Path Mangling Utilities} *) val change_filename : ?keep_path:bool -> Fpath.t -> (string -> string) -> Fpath.t * [ change_file path rename ] changes the filename of [ path ] . The optional [ keep_path ] tells the function whether or not to keep the rest of the filepath or just return the modified f...
null
https://raw.githubusercontent.com/patricoferris/sesame/8521e2a086b49d0bc20f0fca705f07675c52e1ae/src/sesame/path.mli
ocaml
* {2 Path Mangling Utilities} * [last_dir_and_file] is useful for extracting the final directory and the filename from a path. This can be used for [dir/index.md -> dir/index.html] for example. * [drop_top_dir path] removes the top directory from [path], if there is none it just returns the path back to y...
val change_filename : ?keep_path:bool -> Fpath.t -> (string -> string) -> Fpath.t * [ change_file path rename ] changes the filename of [ path ] . The optional [ keep_path ] tells the function whether or not to keep the rest of the filepath or just return the modified filename [keep_path] tells the f...
1921b5be5294167c63a4d61849d65c04e76e3a89be22e824f2ddadf4e60804a9
soegaard/little-helper
test-all.scm
(display "\n\n\n****** test-leftist-heap.scm\n") (load "test-leftist-heap.scm") (display "\n\n\n****** test-list-set.scm\n") (load "test-list-set.scm") (display "\n\n\n****** test-red-black-tree-set.scm\n") (load "test-red-black-tree-set.scm") (display "\n\n\n****** test-list-bag.scm\n") (load "test-list-bag.scm...
null
https://raw.githubusercontent.com/soegaard/little-helper/26249c688e5adf1e2535c405c6289030eff561b4/planet/galore.plt/2/2/tests/test-all.scm
scheme
(display "\n\n\n****** test-leftist-heap.scm\n") (load "test-leftist-heap.scm") (display "\n\n\n****** test-list-set.scm\n") (load "test-list-set.scm") (display "\n\n\n****** test-red-black-tree-set.scm\n") (load "test-red-black-tree-set.scm") (display "\n\n\n****** test-list-bag.scm\n") (load "test-list-bag.scm...
3070b104f8aa3f990a01beaec663f5b6060080a633a3044eb4204dba9e6fe469
danr/hipspec
Unify.hs
# LANGUAGE DeriveFunctor , , , ScopedTypeVariables , ViewPatterns # module HipSpec.Unify where import HipSpec.Lang.Simple import Data.Foldable (Foldable) import Data.Traversable (Traversable) import Control.Applicative import Control.Unification import Control.Unification.IntVar import Control.Monad.Identity imp...
null
https://raw.githubusercontent.com/danr/hipspec/a114db84abd5fee8ce0b026abc5380da11147aa9/src/HipSpec/Unify.hs
haskell
return (toType t) > > ) = ArrTy > ) ) ) [ undefined ] ( " x " : : : list ) [ ] > a ) ) ) [ undefined ] ( " x " : : : ) [ ] > b -- > a ) ) ) ) [ undefined , undefined ] ( " x " : : : undefined ) [ ] ( " y " : : : undefined ) [ ] > b ) -- > list a -- > list b ) ) ) [ undefined , undefined ...
# LANGUAGE DeriveFunctor , , , ScopedTypeVariables , ViewPatterns # module HipSpec.Unify where import HipSpec.Lang.Simple import Data.Foldable (Foldable) import Data.Traversable (Traversable) import Control.Applicative import Control.Unification import Control.Unification.IntVar import Control.Monad.Identity imp...
0679a7c3d17b67096b46fde3e5fc5d06df8f5d1962da78efb9e3fb2e9ea2e45e
dking1286/joyful_clojure
logging.clj
(ns middleware.logging (:require [ring.logger] [taoensso.timbre :as timbre])) (defn- log-fn [{:keys [level throwable message]}] (if throwable (timbre/log level throwable message) (timbre/log level message))) (defn wrap-logging "Ring middleware that logs each request and response." [handl...
null
https://raw.githubusercontent.com/dking1286/joyful_clojure/fa4a17091eab2318b2901a17d0d1004539b6ba76/03_clojure_application_development/src/middleware/logging.clj
clojure
(ns middleware.logging (:require [ring.logger] [taoensso.timbre :as timbre])) (defn- log-fn [{:keys [level throwable message]}] (if throwable (timbre/log level throwable message) (timbre/log level message))) (defn wrap-logging "Ring middleware that logs each request and response." [handl...
c0a22dc7b545632ebcf30a2c4209689248407efa2fab74521b18f9f2350126f5
zotonic/zotonic
zotonic_app.erl
@author < > 2017 @doc Zotonic umbrella application ( empty , see ) Copyright 2017 %% Licensed under the Apache License , Version 2.0 ( the " License " ) ; %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% -2.0 %% %% Unless requir...
null
https://raw.githubusercontent.com/zotonic/zotonic/852f627c28adf6e5212e8ad5383d4af3a2f25e3f/src/zotonic_app.erl
erlang
you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing perm...
@author < > 2017 @doc Zotonic umbrella application ( empty , see ) Copyright 2017 Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(zotonic_app). -behaviour(application). -export([start/2, stop/1])....
09cb6389633571efe74b0be689244e050382583f4a21ac733ad243580639ff16
ocaml-omake/omake
omake_builtin_io_fun.ml
* \begin{doc } * \section{Higher - level IO functions } * * \subsection{Regular expressions } * \index{regular expressions } * * Many of the higher - level functions use regular expressions . * Regular expressions are defined by strings with syntax nearly identical * to \Cmd{awk}{1 } . * ...
null
https://raw.githubusercontent.com/ocaml-omake/omake/08b2a83fb558f6eb6847566cbe1a562230da2b14/src/builtin/omake_builtin_io_fun.ml
ocaml
Grep against a single line Open the file Eat options * Scanner options. * The arguments. * Awk the value. Get lexers for all the cases Split a line into words Select a case and run it Read the file a line at a time * Evaluate all the cases that match. * The arguments. * Awk the valu...
* \begin{doc } * \section{Higher - level IO functions } * * \subsection{Regular expressions } * \index{regular expressions } * * Many of the higher - level functions use regular expressions . * Regular expressions are defined by strings with syntax nearly identical * to \Cmd{awk}{1 } . * ...
b8bce6314fdbb2923d65bd3892580e14f51d7682a1a3c51094a004880792b2b3
grin-compiler/ghc-wpc-sample-programs
Helpers.hs
| Module : . . Helpers Description : Utilities for ' parser . License : : The Idris Community . Module : Idris.Parser.Helpers Description : Utilities for Idris' parser. License : BSD3 Maintainer : The Idris Community. -} # LANGUAGE ConstraintKinds , FlexibleContexts , MultiParamTy...
null
https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/idris-1.3.3/src/Idris/Parser/Helpers.hs
haskell
* The parser * Space * Basic parsers * Terminals * Names * Access * Warnings and errors * Highlighting * Indentation * Indented blocks * Miscellaneous | Parse a reserved identfier, highlighting it as a keyword * Space, comments and literals (token/lexing like parsers) | Checks if a charcter is end of lin...
| Module : . . Helpers Description : Utilities for ' parser . License : : The Idris Community . Module : Idris.Parser.Helpers Description : Utilities for Idris' parser. License : BSD3 Maintainer : The Idris Community. -} # LANGUAGE ConstraintKinds , FlexibleContexts , MultiParamTy...
33cdc06e75fb3f2f93164327a357bbb15c25d24c30c0cd9a5e91475cc54e8dda
clash-lang/clash-prelude
Examples.hs
| Copyright : © 2015 - 2016 , , 2017 , Google Inc. Licence : Creative Commons 4.0 ( CC BY 4.0 ) ( / ) Copyright : © 2015-2016, Christiaan Baaij, 2017 , Google Inc. Licence : Creative Commons 4.0 (CC BY 4.0) (/) -} # LANGUAGE NoImplicitPrelude , CPP , TemplateHaskell ...
null
https://raw.githubusercontent.com/clash-lang/clash-prelude/5645d8417ab495696cf4e0293796133c7fe2a9a7/src/Clash/Examples.hs
haskell
* Decoders and Encoders $decoders_and_encoders * Counters $counters * UART model $uart Uload the rx data Receive data only when rx is enabled Check if just received start of frame Star of frame detected, Proceed with rest of data Logic to sample at middle of data start storing the rx data Check if End of f...
| Copyright : © 2015 - 2016 , , 2017 , Google Inc. Licence : Creative Commons 4.0 ( CC BY 4.0 ) ( / ) Copyright : © 2015-2016, Christiaan Baaij, 2017 , Google Inc. Licence : Creative Commons 4.0 (CC BY 4.0) (/) -} # LANGUAGE NoImplicitPrelude , CPP , TemplateHaskell ...
b2294738bf7f6e64cfad612673cd5f2856f3413a64c4024e447df3679f4eb88f
webyrd/n-grams-for-synthesis
8.scm
Copyright ( C ) ( 1999 ) . All Rights Reserved . ;; Permission is hereby granted, free of charge, to any person ;; obtaining a copy of this software and associated documentation files ( the " Software " ) , to deal in the Software without ;; restriction, including without limitation the rights to use, copy, ;...
null
https://raw.githubusercontent.com/webyrd/n-grams-for-synthesis/b53b071e53445337d3fe20db0249363aeb9f3e51/datasets/srfi/srfi-146/srfi/8.scm
scheme
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies furnished to do so, subject to the following conditions: ...
Copyright ( C ) ( 1999 ) . All Rights Reserved . files ( the " Software " ) , to deal in the Software without of the Software , and to permit persons to whom the Software is included in all copies or substantial portions of the Software . THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KI...
c1395d94d496a39555cd22054c6b150399f939b37a1d5f281c30c1ac1371d45b
alaricsp/chicken-scheme
syntax-tests-2.scm
;;;; syntax-tests-2.scm - tests using extended syntax at runtime (require-library chicken-syntax) (eval '(define-record-type x (make x) x? (x get-x))) (assert (eq? 'yes (get-x (make 'yes))))
null
https://raw.githubusercontent.com/alaricsp/chicken-scheme/1eb14684c26b7c2250ca9b944c6b671cb62cafbc/tests/syntax-tests-2.scm
scheme
syntax-tests-2.scm - tests using extended syntax at runtime
(require-library chicken-syntax) (eval '(define-record-type x (make x) x? (x get-x))) (assert (eq? 'yes (get-x (make 'yes))))
382ef0eab04cfd84749cbd42046d1351c43c09dad381ef48f544d6645e355ed1
hugit-project/hugit
events.cljs
(ns hugit.events "Event handlers for re-frame dispatch events. Used to manage app db updates and side-effects. -frame/blob/master/docs/EffectfulHandlers.md" (:require [re-frame.core :as rf] [hugit.git :as git] [hugit.logs :refer [log] :as logs] [hugit.util :as u] ...
null
https://raw.githubusercontent.com/hugit-project/hugit/15c750ed633a229b517ffe0f3e8462197e0e3b06/src/hugit/events.cljs
clojure
TODO: implement
(ns hugit.events "Event handlers for re-frame dispatch events. Used to manage app db updates and side-effects. -frame/blob/master/docs/EffectfulHandlers.md" (:require [re-frame.core :as rf] [hugit.git :as git] [hugit.logs :refer [log] :as logs] [hugit.util :as u] ...
f016b0172467fed4d95c3d25d7fc723575842c98aefb2faeff250041d649d166
patrikja/AFPcourse
InsideTriangle.hs
---------------- If you would like to extend the Shape library to triangles , Barycentric coordinates is the key math needed . invariant : they sum to 1 barycentricCoordinates :: Vec -> Vec -> Vec -> Point -> Triple barycentricCoordinates (V x1 y1) (V x2 y2) (V x3 y3) (V x y) = let invDenom = 1 / ((y2 - y3) *...
null
https://raw.githubusercontent.com/patrikja/AFPcourse/1a079ae80ba2dbb36f3f79f0fc96a502c0f670b6/L2/src/InsideTriangle.hs
haskell
--------------
If you would like to extend the Shape library to triangles , Barycentric coordinates is the key math needed . invariant : they sum to 1 barycentricCoordinates :: Vec -> Vec -> Vec -> Point -> Triple barycentricCoordinates (V x1 y1) (V x2 y2) (V x3 y3) (V x y) = let invDenom = 1 / ((y2 - y3) * (x1 - x3) + (x3 ...
aefc2d48cdc76ca3e90446660b1c0e8cbf0d188381ff18c7cec57727559d77b4
otakar-smrz/elixir-fm
D.hs
module Elixir.Data.Sunny.Complex.D (section) where import Elixir.Lexicon lexicon = include section cluster_1 = cluster |> ['z','a','y','z','a','f','U','n'] <| [ _____ `noun` {- <zayzafUn> -} [ ['j','u','j','u','b','e'], unwords [ ['l','i','n','d','e','n'], ['t','r','e','e'] ]...
null
https://raw.githubusercontent.com/otakar-smrz/elixir-fm/fae5bab6dd53c15d25c1e147e7787b2c254aabf0/Haskell/ElixirFM/Elixir/Data/Sunny/Complex/D.hs
haskell
<zayzafUn> <sa'ir> <su'r> <sA'ir> <sa'al> <sA'al> <'as'al> <tasa''al> <tasA'al> <su'Al> <sa''Al> <mas'alaT> <musA'alaT> <tasA'ul> <sA'il> <sA'il> <mas'Ul> <mas'Ul> <mas'UlIyaT> <mutasA'il> <sa'im> <'as'am> <sa'im> <sa'Um> <sa'AmaT> <saba'> <saba'Iy> <sabbab> <tas...
module Elixir.Data.Sunny.Complex.D (section) where import Elixir.Lexicon lexicon = include section cluster_1 = cluster |> ['z','a','y','z','a','f','U','n'] <| [ cluster_2 = cluster |> "s ' r" <| [ `imperf` FCaL, `plural` HaFCAL, c...
1bc13cb22cfbce42f70de677172b944cb6b611cdd4173e3357ef9f69b4dcac64
plum-umd/c-strider
llvm.ml
Copyright ( c ) 2008 Intel Corporation * All rights reserved . * Redistribution and use in source and binary forms , with or without * modification , are permitted provided that the following conditions are * met : * * Redistributions of source code must retain the above copyright * notice , th...
null
https://raw.githubusercontent.com/plum-umd/c-strider/3d3a3743bc28456eb6d50e01805ce484ab3c04e6/tools/cil-1.3.7/src/ext/llvm.ml
ocaml
Generate LLVM code (as a doc string) for file 'f'. Currently x86+gcc specific, and missing bitfield support (plus a few minor gcc-specific features, see above) LLVM linkage for global 'vi' LLVM linkage for function 'vi' ignore(Pretty.eprintf "%a\n" (printExp plainCilPrinter) e); the docs imply that we should ...
Copyright ( c ) 2008 Intel Corporation * All rights reserved . * Redistribution and use in source and binary forms , with or without * modification , are permitted provided that the following conditions are * met : * * Redistributions of source code must retain the above copyright * notice , th...
9a34a10ad3bd79da4ff00c19fd3c5122bbd642b08af44e3122a5f10973d83739
acowley/Frames
TutorialUsers.hs
# LANGUAGE DataKinds , DeriveDataTypeable , GeneralizedNewtypeDeriving , MultiParamTypeClasses , OverloadedStrings , TemplateHaskell , TypeFamilies , TypeOperators # MultiParamTypeClasses, OverloadedStrings, TemplateHaskell, TypeFamilies, TypeOperators #-} module ...
null
https://raw.githubusercontent.com/acowley/Frames/aeca953fe608de38d827b8a078ebf2d329edae04/demo/TutorialUsers.hs
haskell
* Packed Representation Let's go all the way and support an efficient packed representation for our type. If you don't want to, or can't, provide an 'VU.Unbox' instance that uses a boxed vector for your type.
# LANGUAGE DataKinds , DeriveDataTypeable , GeneralizedNewtypeDeriving , MultiParamTypeClasses , OverloadedStrings , TemplateHaskell , TypeFamilies , TypeOperators # MultiParamTypeClasses, OverloadedStrings, TemplateHaskell, TypeFamilies, TypeOperators #-} module ...
53f23c5f41da54cc9a99f71589786fde5e05678bedc7a9c9364f2375ce1f1309
bufferswap/pngload
chunk-types.lisp
(in-package #:pngload) (defmacro define-chunk (type (png &key (buffer t)) &body body) (alexandria:with-gensyms (source chunk chunk-data) (let ((struct-name (alexandria:symbolicate 'chunk-data- type))) (destructuring-bind (slots . body) body `(progn (defstruct ,struct-name ,@slots) ...
null
https://raw.githubusercontent.com/bufferswap/pngload/5e25f0beadd4ee118098b3e88b77b7c465c25190/src/chunk-types.lisp
lisp
number or nil Extension chunks -osl.osuosl.org/pub/libpng/documents/pngextensions.html#Chunks TODO: Add user getter functions (remove below line when done) TODO: Add user getter functions (remove below line when done) TODO: Add user getter functions (remove below line when done) TODO: Add user getter functions (...
(in-package #:pngload) (defmacro define-chunk (type (png &key (buffer t)) &body body) (alexandria:with-gensyms (source chunk chunk-data) (let ((struct-name (alexandria:symbolicate 'chunk-data- type))) (destructuring-bind (slots . body) body `(progn (defstruct ,struct-name ,@slots) ...
7bd836b7ba15afaa1bdebe4bc3e8c29cc242546d735e8f8d498aec6a25b7d62e
markhibberd/traction
Traction.hs
# LANGUAGE NoImplicitPrelude # {-# LANGUAGE OverloadedStrings #-} # LANGUAGE TemplateHaskell # # LANGUAGE QuasiQuotes # module Test.Traction where import Control.Monad.IO.Class (MonadIO (..)) import Control.Monad.Morph (hoist, lift) import Data.Text (Text) import qualified Data.Text as T...
null
https://raw.githubusercontent.com/markhibberd/traction/62cee48dbc2cdcb222cc612cd848bfb35a09a3ff/test/Test/Traction.hs
haskell
# LANGUAGE OverloadedStrings # NOTE: intentional syntax error
# LANGUAGE NoImplicitPrelude # # LANGUAGE TemplateHaskell # # LANGUAGE QuasiQuotes # module Test.Traction where import Control.Monad.IO.Class (MonadIO (..)) import Control.Monad.Morph (hoist, lift) import Data.Text (Text) import qualified Data.Text as Text import Traction.Prel...
c7ff0a20c0bf68bf2d2439d472c615cdf93e61fb234a870384da8be146b77cdf
Fytex/ExciteBike-LI1
Tarefa6_2019li1g068.hs
| Module : Tarefa6_2019li1g068 Description : Módulo Haskell contendo as , relativas à Tarefa 6 do Projeto da Unidade Curricular de LI1 Copyright : Fytex ; Arkimedez Um módulo contendo definições com sucesso a Tarefa 6 . A Tarefa 6 consiste no ato de programar um ro'bot ' , um ' ' ....
null
https://raw.githubusercontent.com/Fytex/ExciteBike-LI1/ac544dc4a818181ff4bdf23f9164e14e8d26ab0c/Tarefa6_2019li1g068.hs
haskell
^ O identificador do 'Jogador' associado ao ro'bot'.
| Module : Tarefa6_2019li1g068 Description : Módulo Haskell contendo as , relativas à Tarefa 6 do Projeto da Unidade Curricular de LI1 Copyright : Fytex ; Arkimedez Um módulo contendo definições com sucesso a Tarefa 6 . A Tarefa 6 consiste no ato de programar um ro'bot ' , um ' ' ....
b70f856c33efe3e6670df582aac13e035fa22d955626f4677df9a75ca8ac6882
qfpl/reflex-workshop
FmapMaybe.hs
| Copyright : ( c ) 2018 , Commonwealth Scientific and Industrial Research Organisation License : : Stability : experimental Portability : non - portable Copyright : (c) 2018, Commonwealth Scientific and Industrial Research Organisation License : BSD3 Maintainer : Stability : experi...
null
https://raw.githubusercontent.com/qfpl/reflex-workshop/244ef13fb4b2e884f455eccc50072e98d1668c9e/src/Exercises/Events/Filtering/FmapMaybe.hs
haskell
# LANGUAGE OverloadedStrings #
| Copyright : ( c ) 2018 , Commonwealth Scientific and Industrial Research Organisation License : : Stability : experimental Portability : non - portable Copyright : (c) 2018, Commonwealth Scientific and Industrial Research Organisation License : BSD3 Maintainer : Stability : experi...
641ebc5ed648775df52476cfff907cb41de0eb833dbfb2aaef60cba8e443c791
EligiusSantori/L2Apf
attack_stop.scm
(module system racket/base (require "../../packet.scm") (provide game-server-packet/attack-stop) (define (game-server-packet/attack-stop buffer) (let ((s (open-input-bytes buffer))) (list (cons 'id (read-byte s)) (cons 'object-id (read-int32 #f s)) ) ) ) )
null
https://raw.githubusercontent.com/EligiusSantori/L2Apf/30ffe0828e8a401f58d39984efd862c8aeab8c30/packet/game/server/attack_stop.scm
scheme
(module system racket/base (require "../../packet.scm") (provide game-server-packet/attack-stop) (define (game-server-packet/attack-stop buffer) (let ((s (open-input-bytes buffer))) (list (cons 'id (read-byte s)) (cons 'object-id (read-int32 #f s)) ) ) ) )
1ec60758718f8c969890022b6c388075f233a4dd210b39aa104e3c2f9b992d25
scrintal/heroicons-reagent
user_minus.cljs
(ns com.scrintal.heroicons.mini.user-minus) (defn render [] [:svg {:xmlns "" :viewBox "0 0 20 20" :fill "currentColor" :aria-hidden "true"} [:path {:d "M11 5a3 3 0 11-6 0 3 3 0 016 0zM2.046 15.253c-.058.468.172.92.57 1.175A9.953 9.953 0 008 18c1.982 0 3.83-.578 5.384-1....
null
https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/mini/user_minus.cljs
clojure
(ns com.scrintal.heroicons.mini.user-minus) (defn render [] [:svg {:xmlns "" :viewBox "0 0 20 20" :fill "currentColor" :aria-hidden "true"} [:path {:d "M11 5a3 3 0 11-6 0 3 3 0 016 0zM2.046 15.253c-.058.468.172.92.57 1.175A9.953 9.953 0 008 18c1.982 0 3.83-.578 5.384-1....
d01abea4e23500bb950705f89ddea86a945e28c7978122d7f5806aa9a75341e5
pinterface/burgled-batteries
packages.lisp
(defpackage #:python-cffi.test (:use #:cl #:cl-quickcheck) (:import-from #:lift #:deftestsuite #:addtest) (:shadow #:assert) (:export #:run-tests))
null
https://raw.githubusercontent.com/pinterface/burgled-batteries/8ae3815a52fde36e68e54322cd7da2c42ec09f5c/t/packages.lisp
lisp
(defpackage #:python-cffi.test (:use #:cl #:cl-quickcheck) (:import-from #:lift #:deftestsuite #:addtest) (:shadow #:assert) (:export #:run-tests))
41d077ec1f15e4d71970bb4726588cfc726190f6f5df0216a37a39ea3d67b844
japonophile/synaptic
convolution.clj
(ns ^{:doc "synaptic - convolution layers" :author "Antoine Choppin"} synaptic.convolution (:require [clatrix.core :as m] [synaptic.conv :refer :all] [synaptic.net :refer :all] [synaptic.training :refer :all] [synaptic.util :as u]) (:gen-class)) Network ar...
null
https://raw.githubusercontent.com/japonophile/synaptic/2739c4f37cb37fb2a93589f985823a1fcd4d7eb9/src/synaptic/convolution.clj
clojure
Weight initialization Network outputs Training
(ns ^{:doc "synaptic - convolution layers" :author "Antoine Choppin"} synaptic.convolution (:require [clatrix.core :as m] [synaptic.conv :refer :all] [synaptic.net :refer :all] [synaptic.training :refer :all] [synaptic.util :as u]) (:gen-class)) Network ar...
5a545e72dfa58c271179d1457e51397dea02922d8a13c964f3c9d95194a60de7
input-output-hk/ouroboros-network
Node.hs
{-# LANGUAGE FlexibleContexts #-} # LANGUAGE GADTs # {-# LANGUAGE LambdaCase #-} # LANGUAGE NamedFieldPuns # # LANGUAGE QuantifiedConstraints # {-# LANGUAGE RankNTypes #-} {-# LANGUAGE ScopedTypeVariables #-} # LANGUAGE TupleSections # # LANGUAGE TypeApplic...
null
https://raw.githubusercontent.com/input-output-hk/ouroboros-network/2f09ddd9282916858ba5d6b4b340cddbaf050d7e/ouroboros-network/test/Test/Ouroboros/Network/Testnet/Simulation/Node.hs
haskell
# LANGUAGE FlexibleContexts # # LANGUAGE LambdaCase # # LANGUAGE RankNTypes # # LANGUAGE ScopedTypeVariables # * Tracing * Re-exports | Diffusion Simulator Arguments Contains all necessary randomly generated values needed to run diffusion in simulation. ^ 'randomBlockGenerationArgs'...
# LANGUAGE GADTs # # LANGUAGE NamedFieldPuns # # LANGUAGE QuantifiedConstraints # # LANGUAGE TupleSections # # LANGUAGE TypeApplications # # OPTIONS_GHC -Wno - incomplete - uni - patterns # module Test.Ouroboros.Network.Testnet.Simulation.Node ( SimArgs (..) , NodeArgs (..)...
80d1e87247b17b3ed1045c560d281b3db8fbf17b4ec6986e612a03ab674f227b
mekispeter/haskell2019spring
haskell_april29.hs
Functional Programming for Logicians 2019 Spring Code created in the April 29 session We solved a homework , and then did a bit of IO . Functional Programming for Logicians 2019 Spring Code created in the April 29 session We solved a homework, and then did a bit of IO. -} Homework 8 , exercis...
null
https://raw.githubusercontent.com/mekispeter/haskell2019spring/18fa81092cdc7a15c8ef92a2eff8274dfe79d00d/src/haskell_april29.hs
haskell
Now try: > funcTree <*> valTree this is here to explain what the id function does in the Applicative laws: Greeting the user: Returning the factorial of a value given by the user: Finally a little guessing game. We didn't finish this one. The present code is simpler than the one we made in the session. This ...
Functional Programming for Logicians 2019 Spring Code created in the April 29 session We solved a homework , and then did a bit of IO . Functional Programming for Logicians 2019 Spring Code created in the April 29 session We solved a homework, and then did a bit of IO. -} Homework 8 , exercis...
c233d129da4f75ab4e8f2a74a98d4f901b691262fc3df24be7133dfd60788080
basho/riak_test
ensemble_basic2.erl
%% ------------------------------------------------------------------- %% Copyright ( c ) 2013 - 2014 Basho Technologies , Inc. %% This file is provided to you under the Apache License , %% Version 2.0 (the "License"); you may not use this file except in compliance with the License . You may obtain %% a copy of...
null
https://raw.githubusercontent.com/basho/riak_test/8170137b283061ba94bc85bf42575021e26c929d/tests/ensemble_basic2.erl
erlang
------------------------------------------------------------------- Version 2.0 (the "License"); you may not use this file a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, KIND, either express or implied. See the License for the specific language governing permissio...
Copyright ( c ) 2013 - 2014 Basho Technologies , Inc. This file is provided to you under the Apache License , except in compliance with the License . You may obtain software distributed under the License is distributed on an " AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY -module(ensemble_basic2)...
ef988d91a6c87dc6eb6136616f62a01aa4a8f318137cd04118ed8c4560bf2e90
ConsumerDataStandardsAustralia/validation-prototype
AuthApi.hs
# LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE TypeOperators # module Web.ConsumerData.Au.Api.Types.Auth.AuthApi where import Crypto . JWT ( SignedJWT ) import Data.Text (Text) import GHC.Generics (Generic) -- import Servant.API ( ( :> ) , Qu...
null
https://raw.githubusercontent.com/ConsumerDataStandardsAustralia/validation-prototype/ff63338b77339ee49fa3e0be5bb9d7f74e50c28b/consumer-data-au-api-types/src/Web/ConsumerData/Au/Api/Types/Auth/AuthApi.hs
haskell
import Servant.API authorise :: route :- "authorise" , token :: route :- "token" :> Post '[WaargJSON] TokenResponse | Query paramter is required and a failed parse causes an error.
# LANGUAGE DataKinds # # LANGUAGE DeriveGeneric # # LANGUAGE TypeOperators # module Web.ConsumerData.Au.Api.Types.Auth.AuthApi where import Crypto . JWT ( SignedJWT ) import Data.Text (Text) import GHC.Generics (Generic) ( ( :> ) , QueryParam , QueryParam ...
4af81b840e212f3d57cb4dd063a08b781dd7e5c5c5674eb7248c7170b41111e5
racket/racket-lang-org
all.rkt
#lang racket/base (provide documentation planet) (require "docs.rkt" ; for the doc tweaking script "planet.rkt" "blog.rkt" ; these need to be copied to the service "git.rkt" ; / these are used on the "mailman.rkt" "dirlist.rkt" ; \ server directly ...
null
https://raw.githubusercontent.com/racket/racket-lang-org/88dada2ee769ada9afaf1e3ec1fb28b8ddf216db/stubs/all.rkt
racket
for the doc tweaking script these need to be copied to the service / these are used on the \ server directly
#lang racket/base (provide documentation planet) "wiki.rkt" "pkgs.rkt")
bc1d8300510ce14563674bc94540e4956f333a6c4a4bd65323c42cd7cb80c6c4
janestreet/memtrace_viewer_with_deps
thread_pool_cpu_affinity.mli
open! Core_kernel open! Import module Cpuset : sig include Validated.S with type raw := Int.Set.t include Equal.S with type t := t end type t = | Inherit | Cpuset of Cpuset.t [@@deriving sexp]
null
https://raw.githubusercontent.com/janestreet/memtrace_viewer_with_deps/5a9e1f927f5f8333e2d71c8d3ca03a45587422c4/vendor/core_kernel/thread_pool_cpu_affinity/src/thread_pool_cpu_affinity.mli
ocaml
open! Core_kernel open! Import module Cpuset : sig include Validated.S with type raw := Int.Set.t include Equal.S with type t := t end type t = | Inherit | Cpuset of Cpuset.t [@@deriving sexp]
e0548e2f98fa0f708a259f830a0d13909f5932da391ba32131af434d0379caff
mariari/Misc-Lisp-Scripts
state-test.lisp
(eval-when (:compile-toplevel :load-toplevel :execute) (use-package 'state) (use-package 'g)) (funcall (state-run (fmap #'1+ (>> (>>= sget (f:compose #'put #'1+)) (spure 8)))) [ 9 3 ] 2) (defun state-3-add-x (x) (>>= sget (lambda (orig) (>> (modify ...
null
https://raw.githubusercontent.com/mariari/Misc-Lisp-Scripts/acecadc75fcbe15e6b97e084d179aacdbbde06a8/data-structures/tests/state-test.lisp
lisp
(eval-when (:compile-toplevel :load-toplevel :execute) (use-package 'state) (use-package 'g)) (funcall (state-run (fmap #'1+ (>> (>>= sget (f:compose #'put #'1+)) (spure 8)))) [ 9 3 ] 2) (defun state-3-add-x (x) (>>= sget (lambda (orig) (>> (modify ...
6b5a695873da77fcb718eb1c557865bca0278a08ad2310402e3fcbc39ce75988
Ekdohibs/camlboot
std_miniml_prefix.ml
type bool = false | true type 'a option = None | Some of 'a
null
https://raw.githubusercontent.com/Ekdohibs/camlboot/506280c6e0813e0e794988151a8e46be55373ebc/miniml/interp/std_miniml_prefix.ml
ocaml
type bool = false | true type 'a option = None | Some of 'a
bad3d8473aecea2d1295cf0c776652d6dda1d7470671d880c251f1ef0f13204a
lgastako/polyeuler
EulerMain.hs
import System . TimeIt ( timeIt ) --import Test.BenchPress (bench) import ProjectEuler import System( getArgs ) -- TODO: Put in some timing stuff in the output. bench 50 $ do putStr ( show ( length ( take 500 primes ) ) ) bench 50 $ do putStr ( show ( length ( take 500 fast_primes ) ) ) solutions :: [Maybe Integer...
null
https://raw.githubusercontent.com/lgastako/polyeuler/bc76f5cd6c8aa1c8fd01ccea21aed14c10eacaf1/EulerMain.hs
haskell
import Test.BenchPress (bench) TODO: Put in some timing stuff in the output.
import System . TimeIt ( timeIt ) import ProjectEuler import System( getArgs ) bench 50 $ do putStr ( show ( length ( take 500 primes ) ) ) bench 50 $ do putStr ( show ( length ( take 500 fast_primes ) ) ) solutions :: [Maybe Integer] solutions = [Just euler1, Just euler2, Just euler3, ...
9f3165e2f0623df3b49bfc4509b2dd8631195a030a0088467ac6d49e6ed2b7f7
codereport/SICP-2020
cezarb_solutions.rkt
#lang racket (require rackunit) (require racket/trace) ;-- <BOOK> -- (module sicp-calculus racket (require racket/trace) (provide (all-defined-out)) (define (variable? x) (symbol? x)) (define (same-variable? v1 v2) (and (variable? v1) (variable? v2) (eq? v1 v2))) (define (addend s) (car s)) (define (...
null
https://raw.githubusercontent.com/codereport/SICP-2020/2d1e60048db89678830d93fcc558a846b7f57b76/Chapter%202.4%20Solutions/cezarb_solutions.rkt
racket
-- <BOOK> -- -- <BOOK> -- a) number? is a primitive, exp is not a tagged type b) c) d) only hash table access specific personnel files acme specific api globex specific api A generic record is a pair (specific-record, database) i.e. the record carries the database handle with it. test specific api merge comp...
#lang racket (require rackunit) (require racket/trace) (module sicp-calculus racket (require racket/trace) (provide (all-defined-out)) (define (variable? x) (symbol? x)) (define (same-variable? v1 v2) (and (variable? v1) (variable? v2) (eq? v1 v2))) (define (addend s) (car s)) (define (augend s) (cad...
5130ab5d5d48cb1a6ba7ba30c13f49a5504af9922a9bec719512bb9d392a3436
rtoy/ansi-cl-tests
nth-value.lsp
;-*- Mode: Lisp -*- Author : Created : Sat Oct 19 08:24:14 2002 Contains : Tests of NTH - VALUE (in-package :cl-test) (deftest nth-value.1 (nth-value 0 'a) a) (deftest nth-value.2 (nth-value 1 'a) nil) (deftest nth-value.3 (nth-value 0 (values)) nil) (deftest nth-value.4 (loop for i ...
null
https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/nth-value.lsp
lisp
-*- Mode: Lisp -*- Test that explicit calls to macroexpand in subforms are done in the correct environment Order of evaluation test Error tests
Author : Created : Sat Oct 19 08:24:14 2002 Contains : Tests of NTH - VALUE (in-package :cl-test) (deftest nth-value.1 (nth-value 0 'a) a) (deftest nth-value.2 (nth-value 1 'a) nil) (deftest nth-value.3 (nth-value 0 (values)) nil) (deftest nth-value.4 (loop for i from 0 to 19 col...
44e997182e9cebf4d359285e4a4dad57b2b9fc540ab489a41dec9de981c4794c
clojure-interop/java-jdk
XMLSignature$SignatureValue.clj
(ns javax.xml.crypto.dsig.XMLSignature$SignatureValue "A representation of the XML SignatureValue element as defined in the W3C Recommendation for XML-Signature Syntax and Processing. The XML Schema Definition is defined as: <element name=\"SignatureValue\" type=\"ds:SignatureValueType\"/> <complex...
null
https://raw.githubusercontent.com/clojure-interop/java-jdk/8d7a223e0f9a0965eb0332fad595cf7649d9d96e/javax.xml/src/javax/xml/crypto/dsig/XMLSignature%24SignatureValue.clj
clojure
false otherwise - `boolean`
(ns javax.xml.crypto.dsig.XMLSignature$SignatureValue "A representation of the XML SignatureValue element as defined in the W3C Recommendation for XML-Signature Syntax and Processing. The XML Schema Definition is defined as: <element name=\"SignatureValue\" type=\"ds:SignatureValueType\"/> <complex...
2ed3ccf7ced1470da64768095790a7f8e67d8ea6764ea948e85aebf9ced44359
subttle/regular
IntBase.hs
# LANGUAGE TypeFamilies # # LANGUAGE StandaloneDeriving # # LANGUAGE DeriveFunctor # # LANGUAGE DeriveFoldable # module IntBase where import Control.Applicative (Alternative (..)) import Control.Monad (ap) import Data.Fix (Fix (..)) import Data.Functor ((<&>)) import ...
null
https://raw.githubusercontent.com/subttle/regular/d9e0f99dd6014a587214c515143cdfa8339d04b8/src/IntBase.hs
haskell
case analysis (x + 1) * (y + 1) = xy + x + y + 1 (x - 1) * (y + 1) = xy + x - y - 1 (x + 1) * (y - 1) = xy - x + y - 1 (x - 1) * (y - 1) = xy - x - y + 1 (x + 1) - (y + 1) = x - y (monotonicity of addition) (x - 1) - (y - 1) = x - y (monotonicity of subtraction) N.B. this is not a bijection! TODO...
# LANGUAGE TypeFamilies # # LANGUAGE StandaloneDeriving # # LANGUAGE DeriveFunctor # # LANGUAGE DeriveFoldable # module IntBase where import Control.Applicative (Alternative (..)) import Control.Monad (ap) import Data.Fix (Fix (..)) import Data.Functor ((<&>)) import ...
bfa3b390bfa8bd699a5bd00ca5f407ed0326476019aa2402d10c0f894eb2e199
lpeterse/haskell-mqtt
Session.hs
# LANGUAGE DeriveGeneric # {-# LANGUAGE MultiWayIf #-} {-# LANGUAGE OverloadedStrings #-} # LANGUAGE TupleSections # -------------------------------------------------------------------------------- -- | -- Module : Network.MQTT.Broker.Session Copyright : ( c ) 2016 License : MIT...
null
https://raw.githubusercontent.com/lpeterse/haskell-mqtt/dd4eb856edd50439c6e73eda5878a5b6624e3eba/src/Network/MQTT/Broker/Session.hs
haskell
# LANGUAGE MultiWayIf # # LANGUAGE OverloadedStrings # ------------------------------------------------------------------------------ | Module : Network.MQTT.Broker.Session Maintainer : Stability : experimental ------------------------------------------------------------------------------ * Ses...
# LANGUAGE DeriveGeneric # # LANGUAGE TupleSections # Copyright : ( c ) 2016 License : MIT module Network.MQTT.Broker.Session ( Session () , SessionIdentifier (..) , ConnectionState (..) , wait , poll , reset , process , disconnect , terminate , enqueue , publish ,...
b829882a31f400542555c755bd5cd33d0dad3b26eeb6efc20d738cfe0503bf1d
johnlinvc/erruby
erruby_sup.erl
-module(erruby_sup). -behaviour(supervisor). %% API -export([start_link/0]). %% Supervisor callbacks -export([init/1]). %% Helper macro for declaring children of supervisor -define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}). %% ============================================================...
null
https://raw.githubusercontent.com/johnlinvc/erruby/60df66495a01f9dda08bd3f670bfe9dc0661a168/src/erruby_sup.erl
erlang
API Supervisor callbacks Helper macro for declaring children of supervisor =================================================================== API functions =================================================================== =================================================================== Supervisor callback...
-module(erruby_sup). -behaviour(supervisor). -export([start_link/0]). -export([init/1]). -define(CHILD(I, Type), {I, {I, start_link, []}, permanent, 5000, Type, [I]}). start_link() -> supervisor:start_link({local, ?MODULE}, ?MODULE, []). init([]) -> {ok, { {one_for_one, 5, 10}, []} }.
70d6031b902acf4b191cb3514e740ef63ff9f326c8506f98466d7745ee939902
fulcrologic/guardrails
noop.cljc
(ns com.fulcrologic.guardrails.noop " ALPHA. Same interface as `core`, but the items in this namespace are no-ops. This is useful for making cljs builds smaller by eliding spec internment that cannot be dead-code eliminated. You can use ns aliasing in shadow-cljs (or stock cljs compiler) config to alias any...
null
https://raw.githubusercontent.com/fulcrologic/guardrails/17b47a7869314efbffe5dbe0c0daea7c30ed9006/src/main/com/fulcrologic/guardrails/noop.cljc
clojure
TODO: clean >fn (no gspec)
(ns com.fulcrologic.guardrails.noop " ALPHA. Same interface as `core`, but the items in this namespace are no-ops. This is useful for making cljs builds smaller by eliding spec internment that cannot be dead-code eliminated. You can use ns aliasing in shadow-cljs (or stock cljs compiler) config to alias any...
c6bbc5263fe6336475908d35fb37a13e9729279c56fe4beaa0b67c07b1cf86f3
roman01la/minimax
program.clj
(ns minimax.renderer.program (:require [bgfx.core :as bgfx] [minimax.renderer.shader :as shader]) (:import (clojure.lang IDeref))) (set! *warn-on-reflection* true) (deftype Program [handle f-shader v-shader] IDeref (deref [this] handle)) (defn create [fs-path vs-path] (let [fsh (shader/create fs-...
null
https://raw.githubusercontent.com/roman01la/minimax/f371c199d55a2a219ed7cf5f2dd2e079be99f963/src/minimax/renderer/program.clj
clojure
(ns minimax.renderer.program (:require [bgfx.core :as bgfx] [minimax.renderer.shader :as shader]) (:import (clojure.lang IDeref))) (set! *warn-on-reflection* true) (deftype Program [handle f-shader v-shader] IDeref (deref [this] handle)) (defn create [fs-path vs-path] (let [fsh (shader/create fs-...
ae1bb1c6f2f70e196f13471ecbe17bf2a1bd75578659595fd5257e989fcd6636
ocaml-multicore/ocaml-tsan
weaktest.ml
(* TEST *) let debug = false;; open Printf;; module Hashed = struct type t = string list;; let equal x y = eprintf "equal: %s / %s\n" (List.hd x) (List.hd y); x = y ;; let hash x = Hashtbl.hash (List.hd x);; end;; module HT = Weak.Make (Hashed);; let tbl = HT.create 7;; let r = ref [];; let bunch...
null
https://raw.githubusercontent.com/ocaml-multicore/ocaml-tsan/f54002470cc6ab780963cc81b11a85a820a40819/testsuite/tests/weak-ephe-final/weaktest.ml
ocaml
TEST
let debug = false;; open Printf;; module Hashed = struct type t = string list;; let equal x y = eprintf "equal: %s / %s\n" (List.hd x) (List.hd y); x = y ;; let hash x = Hashtbl.hash (List.hd x);; end;; module HT = Weak.Make (Hashed);; let tbl = HT.create 7;; let r = ref [];; let bunch = if Arr...
e544594dd15155cc3b55ccb6b5ab05e7c54b022ec4d6d645345e92c4438f9ae9
themetaschemer/malt
C-tensor-ops.rkt
#lang racket (require "B-tensor-basics.ss") ;;—————————————————– ;; Shape, rank, size-of ;;—————————————————– (define shape (λ (t) (cond ((scalar? t) '()) (else (cons (tlen t) (shape (tref t 0))))))) (define rank (λ (t) (len (shape t)))) (define size-of (λ (s) (sized s 1))) (define size...
null
https://raw.githubusercontent.com/themetaschemer/malt/c847313ba65bf999e2d2932db91a4448a700bdbb/nested-tensors/tensors/C-tensor-ops.rkt
racket
—————————————————– Shape, rank, size-of —————————————————– —————————————————– Reshape a tensor —————————————————– into an idx into a tensor of shape st or vectors (recursively);
#lang racket (require "B-tensor-basics.ss") (define shape (λ (t) (cond ((scalar? t) '()) (else (cons (tlen t) (shape (tref t 0))))))) (define rank (λ (t) (len (shape t)))) (define size-of (λ (s) (sized s 1))) (define sized (λ (s a) (cond ((null? s) a) (else (sized (ref...
6b2400555049be821dfd398fcfc8b6b9acdc61c8343544b5d984a0b35feab8cf
gelisam/frp-zoo
Main.hs
# LANGUAGE LambdaCase , RecursiveDo # module Main where import Control.Applicative import FRP.Elerea.Simple import Graphics.Gloss.Interface.IO.Game hiding (Event) import Buttons import GlossInterface Utilities if_then_else :: Bool -> a -> a -> a if_then_else True t _ = t if_then_else False _ f = f fmapMaybe ::...
null
https://raw.githubusercontent.com/gelisam/frp-zoo/1a1704e4294b17a1c6e4b417a73e61216bad2321/elerea-example/Main.hs
haskell
a variant of where the newly-computed value is available during the tick in which FRP network Part 1: static version Input Behaviour Scenario 0: generate new graphs and switch to the latest one. Output Gloss event loop
# LANGUAGE LambdaCase , RecursiveDo # module Main where import Control.Applicative import FRP.Elerea.Simple import Graphics.Gloss.Interface.IO.Game hiding (Event) import Buttons import GlossInterface Utilities if_then_else :: Bool -> a -> a -> a if_then_else True t _ = t if_then_else False _ f = f fmapMaybe ::...
69cbd119c6790ba92cfb2d8f77c48938f0a47ce07f19d47b9933c61285d1910c
kaos/ecapnp
ecapnp_set.erl
%% Copyright 2013 , < > %% Licensed under the Apache License , Version 2.0 ( the " License " ) ; %% you may not use this file except in compliance with the License. %% You may obtain a copy of the License at %% %% -2.0 %% %% Unless required by applicable law or agreed to in writing, software dis...
null
https://raw.githubusercontent.com/kaos/ecapnp/f351c07730ba134b41b137dd6a6b93069a0908fc/src/ecapnp_set.erl
erlang
you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language gov...
Copyright 2013 , < > Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , 2013 , @author < > -module(ecapnp_set). -author("Andreas Stenius <>"). -export([root/1, root/2, field/2, field/3, fields/2, union/2])...
04042de8293ec30cc33f4ccde046b21e91f8511daf3c17e203a10600334bc09c
fragnix/fragnix
Control.Monad.State.Class.hs
# LANGUAGE Haskell98 , MultiParamTypeClasses , FunctionalDependencies , FlexibleInstances # # LINE 1 " Control / Monad / State / Class.hs " # # LANGUAGE CPP # # LANGUAGE UndecidableInstances # Search for UndecidableInstances to see why this is needed -----------------...
null
https://raw.githubusercontent.com/fragnix/fragnix/b9969e9c6366e2917a782f3ac4e77cce0835448b/tests/packages/application/Control.Monad.State.Class.hs
haskell
--------------------------------------------------------------------------- | License : BSD-style (see the file LICENSE) Maintainer : Stability : experimental Portability : non-portable (multi-param classes, functional dependencies) This module is inspired by the paper /Functional Progra...
# LANGUAGE Haskell98 , MultiParamTypeClasses , FunctionalDependencies , FlexibleInstances # # LINE 1 " Control / Monad / State / Class.hs " # # LANGUAGE CPP # # LANGUAGE UndecidableInstances # Search for UndecidableInstances to see why this is needed Module : ...
22d16854312a0335e464ca0811cf79760ecfde4ca8fb8c41dc82efc9c301cc59
ertugrulcetin/jme-clj
hello_input_system.clj
;; Please start your REPL with `+test` profile (ns examples.beginner-tutorials.hello-input-system "Clojure version of " (:require [jme-clj.core :refer :all]) (:import (com.jme3.input KeyInput MouseInput) (com.jme3.math ColorRGBA))) ;; for keeping internal *bindings* work, also the app. We need to ...
null
https://raw.githubusercontent.com/ertugrulcetin/jme-clj/167ef8f9e6396cc6e3c234290c5698c098fcad28/test/examples/beginner_tutorials/hello_input_system.clj
clojure
Please start your REPL with `+test` profile for keeping internal *bindings* work, also the app. We need to define listeners with `defn`. `def` should NOT be used! Using qualified keywords for inputs is highly recommended!
(ns examples.beginner-tutorials.hello-input-system "Clojure version of " (:require [jme-clj.core :refer :all]) (:import (com.jme3.input KeyInput MouseInput) (com.jme3.math ColorRGBA))) (defn on-action-listener [] (action-listener (fn [name pressed? tpf] (when (and (= name ::pause) (not p...
c54be9d84755a9cfcae8fa313a078f489b6ea1989ab5cfc063d06633aeb3d635
avsm/melange
deens.ml
* Copyright ( c ) 2005 < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVIDED " AS IS " AND THE AU...
null
https://raw.githubusercontent.com/avsm/melange/e92240e6dc8a440cafa91488a1fc367e2ba57de1/apps/deens/deens.ml
ocaml
Specialise dns packet to a smaller closure Space leaking hash table cache, always grows Weak cache, may be cleared out on every garbage collection as space is needed but does not leak space No caching, just return the evaluated result directly let c = Gc.get () in Read all the zone files ...
* Copyright ( c ) 2005 < > * * Permission to use , copy , modify , and distribute this software for any * purpose with or without fee is hereby granted , provided that the above * copyright notice and this permission notice appear in all copies . * * THE SOFTWARE IS PROVIDED " AS IS " AND THE AU...
780b5b2faccd9e110f234529e16cfbc81cc32502bf133560f65bafacf1a0403d
rtoy/ansi-cl-tests
loop3.lsp
;-*- Mode: Lisp -*- Author : Created : Sun Oct 27 08:36:36 2002 ;;;; Contains: Tests of FOR-ON-AS-LIST iteration control in LOOP (in-package :cl-test) (deftest loop.3.1 (loop for x on '(1 2 3) sum (car x)) 6) (deftest loop.3.2 (loop for x on '(1 2 3 4) do (when (evenp (car x)) (return x)...
null
https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/loop3.lsp
lisp
-*- Mode: Lisp -*- Contains: Tests of FOR-ON-AS-LIST iteration control in LOOP Tests of the 'AS' form Test that explicit calls to macroexpand in subforms are done in the correct environment
Author : Created : Sun Oct 27 08:36:36 2002 (in-package :cl-test) (deftest loop.3.1 (loop for x on '(1 2 3) sum (car x)) 6) (deftest loop.3.2 (loop for x on '(1 2 3 4) do (when (evenp (car x)) (return x))) (2 3 4)) (deftest loop.3.3 (loop for x on '(a b c . d) collect (car x)) (a b c...
38301eccfd7204fc7c024b863258f67382db5af06f39002869cb684b07c07c25
AccelerateHS/accelerate
Profile.hs
{-# LANGUAGE CPP #-} # LANGUAGE ForeignFunctionInterface # # LANGUAGE TemplateHaskell # # OPTIONS_GHC -fobject - code # {-# OPTIONS_HADDOCK hide #-} -- | -- Module : Data.Array.Accelerate.Debug.Internal.Profile Copyright : [ 2016 .. 2020 ] The Accelerate Team -- License : BS...
null
https://raw.githubusercontent.com/AccelerateHS/accelerate/80a9d9aa13609f895540d4859c0a8691cff6d2e3/src/Data/Array/Accelerate/Debug/Internal/Profile.hs
haskell
# LANGUAGE CPP # # OPTIONS_HADDOCK hide # | Module : Data.Array.Accelerate.Debug.Internal.Profile License : BSD3 Stability : experimental Embed some string data into the constant section and grab a pointer directly to it. XXX: This only allows us to track a single nursery, but ...
# LANGUAGE ForeignFunctionInterface # # LANGUAGE TemplateHaskell # # OPTIONS_GHC -fobject - code # Copyright : [ 2016 .. 2020 ] The Accelerate Team Maintainer : < > Portability : non - portable ( GHC extensions ) module Data.Array.Accelerate.Debug.Internal.Profile ( local_memory_alloc, lo...
4358b329c1cc7f532d5c4ffdba0e96d7277d32ce4e870fb9014ff06d429dc09b
bobzhang/fan
testindent.ml
let expand_quotation loc expander pos_tag quot = let open FanToken in let loc_name_opt = if quot.q_loc = "" then None else Some (quot.q_loc) in try expander loc loc_name_opt quot.q_contents with | FanLoc.Exc_located (_,QuotationError _) as exc -> raise exc | FanLoc.Exc_located (iloc,exc) -> le...
null
https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/todoml/test/printer/testindent.ml
ocaml
let expand_quotation loc expander pos_tag quot = let open FanToken in let loc_name_opt = if quot.q_loc = "" then None else Some (quot.q_loc) in try expander loc loc_name_opt quot.q_contents with | FanLoc.Exc_located (_,QuotationError _) as exc -> raise exc | FanLoc.Exc_located (iloc,exc) -> le...
9f237c1533b6848090973116de7fc5b622bc48cd99eaeabe5cdb876f282fca8d
BinRoot/Haskell-Data-Analysis-Cookbook
Main.hs
import Data.Graph import Data.List (tails) import Data.Array ((!)) -- Traversing a graph breadth-first main = do print $ breadth graph 1 breadth g i = bf [] [i] where bf :: [Int] -> [Int] -> [Int] bf seen forest | null forest = [] | otherwise = forest ++ ...
null
https://raw.githubusercontent.com/BinRoot/Haskell-Data-Analysis-Cookbook/f8c46987d78f4a6c1828b353c5f906b9314c2ef9/Ch06/Code05_breadth/Main.hs
haskell
Traversing a graph breadth-first
import Data.Graph import Data.List (tails) import Data.Array ((!)) main = do print $ breadth graph 1 breadth g i = bf [] [i] where bf :: [Int] -> [Int] -> [Int] bf seen forest | null forest = [] | otherwise = forest ++ bf (forest ++ seen) (c...
56eb1955b23661bf4481d0ca8fdb72a3f6bfbdafa2e015951a8e9bc5d63ab5d3
maximedenes/native-coq
arguments_renaming.mli
(************************************************************************) v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *...
null
https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/pretyping/arguments_renaming.mli
ocaml
********************************************************************** // * This file is distributed under the terms of the * GNU Lesser General Public License Version 2.1 ********************************************************************** * [Not_found] is raised is no names ...
v * The Coq Proof Assistant / The Coq Development Team < O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010 \VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * open Names open Libnames open...
3d09bb3cb1d6f3a348e160f9e53151a5e3ccfc6bca80a7da76fe3846324f1eb1
ProjectMAC/propagators
raa.scm
RAA ;;; Idea is to dismiss a hypothetical by denying the contrary... ;;; Want to stop worldview associated with contrary-premise ;;; if contrary premise finds a contradiction. Then want to ;;; reinstate the contrary belief in a new worldview if a ;;; reason for the contradiction is lost. (define (to-dismiss-hypo...
null
https://raw.githubusercontent.com/ProjectMAC/propagators/add671f009e62441e77735a88980b6b21fad7a79/explorations/raa.scm
scheme
Idea is to dismiss a hypothetical by denying the contrary... Want to stop worldview associated with contrary-premise if contrary premise finds a contradiction. Then want to reinstate the contrary belief in a new worldview if a reason for the contradiction is lost. worldview and schedule stupid! unused? bad! ...
RAA (define (to-dismiss-hypothetical hypothetical-premise) (hcell (hypothetical-cell hypothetical-premise)) (sign ((true) #t) ((false) #f) (else (error "Bad hypothetical sign")))) (contrary-premise (or (eq-get hypothetical-premise 'contrary-premise) (let ((cp (generate-un...
10b06a8e6da7c6ce493ceb49a0012e438bf94a41daab454fc241fe251ec3f289
expipiplus1/vulkan
RenderParams.hs
module VMA.RenderParams ( renderParams ) where import Data.Char ( isLower ) import Data.Generics.Uniplate.Data import qualified Data.HashSet as Set import qualified Data.Text as T import Data.Text.Extra ( lowerCa...
null
https://raw.githubusercontent.com/expipiplus1/vulkan/615f3350e71cccfe8f46129fbdb126b26cafe1e8/generate-new/vma/VMA/RenderParams.hs
haskell
^ Prefix ^ body ^ Nothing if 'body' didn't begin with 'prefix' TODO: Generate this automatically
module VMA.RenderParams ( renderParams ) where import Data.Char ( isLower ) import Data.Generics.Uniplate.Data import qualified Data.HashSet as Set import qualified Data.Text as T import Data.Text.Extra ( lowerCa...
752ce533410b4554630af02534a95de3ed38dbdbd3d26f1ef5e79b5098017dbb
azimut/shiny
inscore.lisp
(in-package :shiny) NOTE : all this is kind of flaky . As it works mostly with one voice ;; per score. And that won't change until all notes go to a common place ;; where they then can be converted into chords (events from different ;; sources happening at the same time). ;; And might be not even that will help for ...
null
https://raw.githubusercontent.com/azimut/shiny/774381a9bde21c4ec7e7092c7516dd13a5a50780/lib/inscore.lisp
lisp
per score. And that won't change until all notes go to a common place where they then can be converted into chords (events from different sources happening at the same time). And might be not even that will help for livecoding. As there is no time index or anything being send on a stream so, everything happens ser...
(in-package :shiny) NOTE : all this is kind of flaky . As it works mostly with one voice (defvar *oscout* nil) (defvar *window-name* "scene") (defvar *layer-name* "l") (defvar *bar-counter* (make-hash-table :test #'equal)) (defvar *meter* "4/4") (defvar *clef* "f") (defun inscore-reset (&optional (window-nam...
856e5006d8e36b722186d7f57d2275839d7e1d54dcc8de0d5cad9ced120a925b
timbod7/haskell-chart
TestParametric.hs
module TestParametric where import Graphics.Rendering.Chart import Data.Colour import Data.Colour.Names import Control.Lens import Data.Default.Class import Utils chart :: Double -> Renderable (LayoutPick Double Double Double) chart lwidth = layoutToRenderable layout where circle = [ (r a * sin (a*dr),r a * co...
null
https://raw.githubusercontent.com/timbod7/haskell-chart/8c5a823652ea1b4ec2adbced4a92a8161065ead6/chart-tests/tests/TestParametric.hs
haskell
module TestParametric where import Graphics.Rendering.Chart import Data.Colour import Data.Colour.Names import Control.Lens import Data.Default.Class import Utils chart :: Double -> Renderable (LayoutPick Double Double Double) chart lwidth = layoutToRenderable layout where circle = [ (r a * sin (a*dr),r a * co...
8910a43f9fee89960e07d0230ae3123d2b5d0113801f5dc89bd3bdad3956f0a6
project-oak/hafnium-verification
ConcurrencyModels.mli
* Copyright ( c ) Facebook , Inc. and its affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the ...
null
https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/concurrency/ConcurrencyModels.mli
ocaml
* simultaneously acquire a list of locks * simultaneously release a list of locks * simultaneously attempt to acquire a list of locks * mutex guard construction - clang only * lock underlying mutex via guard - clang only * lock underlying mutex if true via guard - clang only * unlock underlying mutex via guard - ...
* Copyright ( c ) Facebook , Inc. and its affiliates . * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree . * Copyright (c) Facebook, Inc. and its affiliates. * * This source code is licensed under the MIT license found in the ...
82572f26dc4fc566a6f2cf3ee61cfa2cfc60f7149903e3babd5e343639b1e990
toaq/zugai
Spec.hs
import Control.Monad import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.IO as T import Data.Either import Test.Hspec import Lex import Parse -- Don't run test sentences containing these words. bannedWords :: [Text] bannedWords = [ "about" , "cu" , "«Hello»" , "«I" , "keoru" ...
null
https://raw.githubusercontent.com/toaq/zugai/5870fe528a0c3d2db7f83bc4a124aaebd9e2e011/test/Spec.hs
haskell
Don't run test sentences containing these words.
import Control.Monad import Data.Text (Text) import qualified Data.Text as T import qualified Data.Text.IO as T import Data.Either import Test.Hspec import Lex import Parse bannedWords :: [Text] bannedWords = [ "about" , "cu" , "«Hello»" , "«I" , "keoru" , "re" , "should" , "the" ] main :: IO () mai...
9a9d9a5fd5bdcd3a736a8e543886f22d678b13b4a8be3de5191980ac02340373
berke/jsure
check.ml
(* Check *) open Conduit;; open Pffpsf;; open Ast;; open Source;; exception Error of string module SS = Set.Make(String);; module SM = Map.Make(String);; module PNM = Map.Make(struct type t = property_name let compare = compare end);; let max_depth = 5;; type t = | T_Function | T_Variable | T_Argument | T_U...
null
https://raw.githubusercontent.com/berke/jsure/f7c32e21602cd8d8f18e90a608cfc59b1172be57/check.ml
ocaml
Check ** is_supposedly_unused ** ** rex_options_rx ** ** ** check Show source... Create default objects ** dump_env ** ** treatment ** ** find ** ** assign ** ** finish_env ** See if this is a top-level assignment XXX Check labels XXX Check labels **
open Conduit;; open Pffpsf;; open Ast;; open Source;; exception Error of string module SS = Set.Make(String);; module SM = Map.Make(String);; module PNM = Map.Make(struct type t = property_name let compare = compare end);; let max_depth = 5;; type t = | T_Function | T_Variable | T_Argument | T_Undefined ;; ...
0db3666b228ee04faa28c9edf1d42fb9ce35a4604303f9351ffff34fafb316e8
AlexKnauth/lang-file
tuvalu.rkt
#lang reader "literal.rkt" Technology! System! Perfect!
null
https://raw.githubusercontent.com/AlexKnauth/lang-file/3b12137dbc7366b875f10f63dbc0e4e54aa3de85/lang-file-lib/lang-file/test/tuvalu.rkt
racket
#lang reader "literal.rkt" Technology! System! Perfect!
bccfd0830ad42814bff07fb9f3870902437f066a614f2e3b4b0a4675be055060
returntocorp/semgrep
Memory_limit.ml
* * Copyright ( C ) 2021 - 2023 r2c * * This library is free software ; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation , with the * special exception on linking described in file lice...
null
https://raw.githubusercontent.com/returntocorp/semgrep/e0d996ed1e4d76d0dafd34aec96bde3b718ac05e/libs/process_limits/Memory_limit.ml
ocaml
*************************************************************************** Prelude *************************************************************************** Avoid segfaults when the process runs out of memory. See also -limits/. *************************************************************************** ...
* * Copyright ( C ) 2021 - 2023 r2c * * This library is free software ; you can redistribute it and/or * modify it under the terms of the GNU Lesser General Public License * version 2.1 as published by the Free Software Foundation , with the * special exception on linking described in file lice...
ad398ac7377f1acb00826f62d1f9bd8be8e46f1ca8b962f061815be304104219
collaborativetrust/WikiTrust
prioq.mli
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/prioq.mli
ocaml
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 ...
582544ee21a66785272b72a3069b8b291694616bbc72767853c09225bbde548e
jamis/rtc-ocaml
chap04.ml
let draw_clock width height = let cx = width / 2 in let cy = height / 2 in let clr = RTCColor.build 1. 1. 1. in let twelve = RTCTuple.point 0. ((float_of_int cy) *. 0.8) 0. in let hour_inc = 2. *. Float.pi /. 12. in let rec loop canvas = function | 12 -> canvas | hour -> let tx = RTCTransfor...
null
https://raw.githubusercontent.com/jamis/rtc-ocaml/f5ba04e874ef0b54d100cdabfe9a67c2b80a643f/progs/chap04.ml
ocaml
let draw_clock width height = let cx = width / 2 in let cy = height / 2 in let clr = RTCColor.build 1. 1. 1. in let twelve = RTCTuple.point 0. ((float_of_int cy) *. 0.8) 0. in let hour_inc = 2. *. Float.pi /. 12. in let rec loop canvas = function | 12 -> canvas | hour -> let tx = RTCTransfor...
6fba5e5448421e911852487d159119df609289455c83a298bd8666489f4c80e2
rd--/hsc3
mrg2.help.hs
-- mrg2 ; defines a node indicating a multiple root graph. let l = out 0 (sinOsc ar 300 0 * 0.1) r = out 1 (sinOsc ar 900 0 * 0.1) in mrg2 l r mrg2 ; there is a leftmost rule , so that mrg nodes need not be terminal let l = sinOsc ar 300 0 * 0.1 r = out 1 (sinOsc ar 900 0 * 0.1) in mrg2 l r mrg2 ; the lef...
null
https://raw.githubusercontent.com/rd--/hsc3/60cb422f0e2049f00b7e15076b2667b85ad8f638/Help/Ugen/mrg2.help.hs
haskell
mrg2 ; defines a node indicating a multiple root graph. mrg2 ; the implementation is not thorough
let l = out 0 (sinOsc ar 300 0 * 0.1) r = out 1 (sinOsc ar 900 0 * 0.1) in mrg2 l r mrg2 ; there is a leftmost rule , so that mrg nodes need not be terminal let l = sinOsc ar 300 0 * 0.1 r = out 1 (sinOsc ar 900 0 * 0.1) in mrg2 l r mrg2 ; the leftmost node may be an mce node let l = sinOsc ar (mce2 300 4...
87229d9d2f4ea9fab5a7cdcde689b3dc13e48d408ca9fe96c6feabc39144fef7
jgm/gitit
ImgTex.hs
module ImgTex (plugin) where This plugin provides a clear math LaTeX output . ( * latex and dvipng executable must be in the path . ) like this : ~~~ { .dvipng } \nabla \times = \frac{1}{h_1 h_2 h_3 } \begin{vmatrix } h_1 e_1 & h_2 e_2 & h_3 e_3 \\ \frac{\partial}{\partial q_{1 } } & ...
null
https://raw.githubusercontent.com/jgm/gitit/e8c9d94be332e2f73de9b0eee222a2a09f191faf/plugins/ImgTex.hs
haskell
module ImgTex (plugin) where This plugin provides a clear math LaTeX output . ( * latex and dvipng executable must be in the path . ) like this : ~~~ { .dvipng } \nabla \times = \frac{1}{h_1 h_2 h_3 } \begin{vmatrix } h_1 e_1 & h_2 e_2 & h_3 e_3 \\ \frac{\partial}{\partial q_{1 } } & ...
461c47e8c8fb626d9b344243f149ededa75d251057eef20c79e56371b9b65cdc
patricoferris/ocaml-multicore-monorepo
overlap.mli
open Bigarray_compat val genarray : ('a, 'b, 'c) Genarray.t -> ('a, 'b, 'c) Genarray.t -> (int * int array * int array) option val array0 : ('a, 'b, 'c) Array0.t -> ('a, 'b, 'c) Array0.t -> bool val array1 : ('a, 'b, 'c) Array1.t -> ('a, 'b, 'c) Array1.t -> (int * int * int) option val array2 : ('a, 'b, 'c) Array2.t -...
null
https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/overlap/lib/overlap.mli
ocaml
open Bigarray_compat val genarray : ('a, 'b, 'c) Genarray.t -> ('a, 'b, 'c) Genarray.t -> (int * int array * int array) option val array0 : ('a, 'b, 'c) Array0.t -> ('a, 'b, 'c) Array0.t -> bool val array1 : ('a, 'b, 'c) Array1.t -> ('a, 'b, 'c) Array1.t -> (int * int * int) option val array2 : ('a, 'b, 'c) Array2.t -...
94143bd5133907336bb2269bfcb5f51fa4a9b17d09ad9258ce9a8def71f7e3d3
jixiuf/helloerlang
test.erl
-module(test). -export([main/0]). main()-> Dog = animal:new(dog), Dog:say(), Cat = animal:new(cat), Cat:say() .
null
https://raw.githubusercontent.com/jixiuf/helloerlang/3960eb4237b026f98edf35d6064539259a816d58/parameter_module_test/src/test.erl
erlang
-module(test). -export([main/0]). main()-> Dog = animal:new(dog), Dog:say(), Cat = animal:new(cat), Cat:say() .
b5293c554ca707a0443f90f9569b3cd421b1e57965a4272b0f9d1d25a9e02b00
LockedOn/graph-router
query.clj
(ns graph-router.query (:require [schema.core :as s] [graph-router.type :refer :all])) (declare parse-weave parse-function parse-keyword parse-map parse attribute-schema function-schema weave-schema attribute-list-schema context-schema query-schema) (def attribute-schema {:type (s...
null
https://raw.githubusercontent.com/LockedOn/graph-router/25062b1eeac2dbf3318c585a404f20b5b1a6ab6c/src/graph_router/query.clj
clojure
(ns graph-router.query (:require [schema.core :as s] [graph-router.type :refer :all])) (declare parse-weave parse-function parse-keyword parse-map parse attribute-schema function-schema weave-schema attribute-list-schema context-schema query-schema) (def attribute-schema {:type (s...
5bd9c0146e073c16bca5e95648557f677952fff655e3bbab4fbe4bf534093749
PapenfussLab/bioshake
Facets.hs
{-# LANGUAGE FlexibleContexts #-} # LANGUAGE FlexibleInstances # # LANGUAGE FunctionalDependencies # {-# LANGUAGE GADTs #-} # LANGUAGE MultiParamTypeClasses # {-# LANGUAGE StandaloneDeriving #-} {-# LANGUAGE TemplateHaskell #-} {-# LANGUAGE TypeOperators #-} # LANGUAGE...
null
https://raw.githubusercontent.com/PapenfussLab/bioshake/afeb7219b171e242b6e9bb9e99e2f80c0a099aff/Bioshake/Internal/Facets.hs
haskell
# LANGUAGE FlexibleContexts # # LANGUAGE GADTs # # LANGUAGE StandaloneDeriving # # LANGUAGE TemplateHaskell # # LANGUAGE TypeOperators # # LANGUAGE ViewPatterns # # OVERLAPPABLE # # OVERLAPPING # Filters out contigs
# LANGUAGE FlexibleInstances # # LANGUAGE FunctionalDependencies # # LANGUAGE MultiParamTypeClasses # # LANGUAGE UndecidableInstances # module Bioshake.Internal.Facets where import Bioshake import Bioshake.TH import Control.Monad import Control.Monad.Trans (lif...
e083a48a03f90edcb4a9fc8786891820f148958ec7b646a150ad9ab66f08297f
wardle/pc4
core.cljs
(ns eldrix.pc4-ward.refer.core (:require [cljs.spec.alpha :as s] [clojure.string :as str])) ;; these could be automatically generated from the FHIR specs, except that the specifications often have everything as optional ( e.g. cardinality 0 .. 1 ) . (s/def ::non-blank-string (s/and string? (complement ...
null
https://raw.githubusercontent.com/wardle/pc4/9e62b12fa2de66d3fe70fdccc134c58ec25771f2/pc4-ward/src/eldrix/pc4_ward/refer/core.cljs
clojure
these could be automatically generated from the FHIR specs, except that the
(ns eldrix.pc4-ward.refer.core (:require [cljs.spec.alpha :as s] [clojure.string :as str])) specifications often have everything as optional ( e.g. cardinality 0 .. 1 ) . (s/def ::non-blank-string (s/and string? (complement str/blank?))) (s/def :org.hl7.fhir.Identifier/system (s/or :non-blank-string ::...
7cd28d9fc8970ed8742899b11991da2e1789bbe5fb730d4719763d46180e991b
wargrey/w3s
datatype.rkt
#lang typed/racket/base (provide (all-defined-out)) (provide (rename-out [xml:attr-value*+>integer xml:attr-value*->natural])) (require racket/string) (require digimon/symbol) (require digimon/dimension) (require digimon/number) (require "grammar.rkt") (require "digicore.rkt") ;;; NOTE Normalizing the attributes...
null
https://raw.githubusercontent.com/wargrey/w3s/7af1e5d17160e6810c28b67484d7ee38bd7b9fb2/sgml/digitama/datatype.rkt
racket
NOTE These APIs are designed to manually normalizing, Thus, the input tokens are usually XML:String instances.
#lang typed/racket/base (provide (all-defined-out)) (provide (rename-out [xml:attr-value*+>integer xml:attr-value*->natural])) (require racket/string) (require digimon/symbol) (require digimon/dimension) (require digimon/number) (require "grammar.rkt") (require "digicore.rkt") Normalizing the attributes ' values...
e951d7b868c476f4faf88cdd2b896e993799bdc3106d78e057f3fbee4fcab2d0
facebook/duckling
Tests.hs
Copyright ( c ) 2016 - present , Facebook , Inc. -- All rights reserved. -- -- This source code is licensed under the BSD-style license found in the -- LICENSE file in the root directory of this source tree. module Duckling.Temperature.MN.Tests ( tests ) where import Data.String import Prelude import Test.Tasty ...
null
https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/tests/Duckling/Temperature/MN/Tests.hs
haskell
All rights reserved. This source code is licensed under the BSD-style license found in the LICENSE file in the root directory of this source tree.
Copyright ( c ) 2016 - present , Facebook , Inc. module Duckling.Temperature.MN.Tests ( tests ) where import Data.String import Prelude import Test.Tasty import Duckling.Dimensions.Types import Duckling.Temperature.MN.Corpus import Duckling.Testing.Asserts tests :: TestTree tests = testGroup "MN Tests" [ mak...
abaf855e599e5609beae043be3a4473b7d9e1e93198adbfd62f947eb0ed1bf2b
greggigon/my-personal-kanban-server
storage.clj
(ns mpk.storage (:import (java.security MessageDigest) (java.io File))) (def file-extension ".data") (defn md5 "Generate a md5 checksum for the given string" [token] (let [hash-bytes (doto (java.security.MessageDigest/getInstance "MD5") (.reset) (.update (.get...
null
https://raw.githubusercontent.com/greggigon/my-personal-kanban-server/1e6b8f293ca4541d4defff57b492152b4a9f6f0f/src/mpk/storage.clj
clojure
(ns mpk.storage (:import (java.security MessageDigest) (java.io File))) (def file-extension ".data") (defn md5 "Generate a md5 checksum for the given string" [token] (let [hash-bytes (doto (java.security.MessageDigest/getInstance "MD5") (.reset) (.update (.get...
da4241021915b766af6adb9e3ff541c80a774384f6925796f2a922466a5e2ccc
ocamllabs/ocaml-modular-implicits
env.ml
(***********************************************************************) (* *) (* OCaml *) (* *) , projet ...
null
https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/typing/env.ml
ocaml
********************************************************************* OCaml ...
, projet Cristal , INRIA Rocquencourt Copyright 1996 Institut National de Recherche en Informatique et en Automatique . All rights reserved . This file is distributed under the terms of the Q Public License version 1.0 . open Cmi_format open Config open Misc ...
9b6a5269a3b689b262236bf398a7a92336a07decfef4a742ff752f35cd196ec8
egison/egison-scheme
test-stream.scm
;; ;; Stream Egison Test ;; (load "./stream-egison.scm") ( 10 ) ( 10 ) (stream->list (match-all 10 Integer [,10 "OK"])) ; ("OK") ( ( 1 ( 2 3 ) ) ) ( ( ( ) ( 1 2 3 ) ) ( ( 1 ) ( 2 3 ) ) ( ( 1 2 ) ( 3 ) ) ) (stream->list (stream-take (match-all (stream-iota -1) (List Integer) [(join x y) `(,(stream->list x) ,y...
null
https://raw.githubusercontent.com/egison/egison-scheme/49188f4bcf91199a9e1d5142851a48ed2eb916e1/test/test-stream.scm
scheme
Stream Egison Test ("OK")
(load "./stream-egison.scm") ( 10 ) ( 10 ) ( ( 1 ( 2 3 ) ) ) ( ( ( ) ( 1 2 3 ) ) ( ( 1 ) ( 2 3 ) ) ( ( 1 2 ) ( 3 ) ) ) (stream->list (stream-take (match-all (stream-iota -1) (List Integer) [(join x y) `(,(stream->list x) ,y)]) 10)) ( ( ( ) ( 1 2 3 ) ) ( ( 1 ) ( 2 3 ) ) ( ( 1 2 ) ( 3 ) ) ) ( ( 0 1 ) ( 0 ...
b08375b67d1f3bda6617cb60501916a80d89f7c5b80cb4a99a83603b32ac563d
awslabs/s2n-bignum
bignum_modoptneg.ml
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved . * SPDX - License - Identifier : Apache-2.0 OR ISC * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 OR ISC *) (* =================================================================...
null
https://raw.githubusercontent.com/awslabs/s2n-bignum/824c15f908d7a343af1b2f378cfedd36e880bdde/x86/proofs/bignum_modoptneg.ml
ocaml
========================================================================= Optional modular negation of bignum. ========================================================================= *** print_literal_from_elf "x86/generic/bignum_modoptneg.o";; *** TEST (% rdi) (% rdi) X...
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved . * SPDX - License - Identifier : Apache-2.0 OR ISC * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved. * SPDX-License-Identifier: Apache-2.0 OR ISC *) let bignum_modoptneg_mc = define_assert_from_elf "bignum_modoptn...
53b69a18bdd7213989eb0da4e93ee4f70ab11ba11093657ef8b38852c8d1821c
boot-clj/boot
test.clj
(ns boot.test (:require [clojure.string :as string] [clojure.walk :as walk] [clojure.test :as test] [boot.core :as core] [boot.pod :as pod] [boot.util :as util] [boot.parallel :as parallel] [boot.from.io.aviso.exception :as ex]) (:import [java.lang InterruptedExceptio...
null
https://raw.githubusercontent.com/boot-clj/boot/64334b4d5744b1444634f4a5a5a52b3ae67dddeb/boot/core/src/boot/test.clj
clojure
-1.7.0/src/clj/clojure/test.clj#L532 ; ; Test Vars ;; seq of maps Public API ;; Individual report Summary Forcing execution of runcommands inside this task
(ns boot.test (:require [clojure.string :as string] [clojure.walk :as walk] [clojure.test :as test] [boot.core :as core] [boot.pod :as pod] [boot.util :as util] [boot.parallel :as parallel] [boot.from.io.aviso.exception :as ex]) (:import [java.lang InterruptedExceptio...
02a9f84048bd65ad34d5a223ec991193e15a982c0c590e785813f188554599fd
discus-lang/ddc
BoundT.hs
-- | Lifting and lowering level-1 deBruijn indices in code things. -- -- Level-1 indices are used for type variables. -- module DDC.Core.Transform.BoundT ( liftT, liftAtDepthT , MapBoundT(..)) where import DDC.Core.Exp.Annot.Exp import DDC.Type.Transform.BoundT instance Ord n => MapBoundT (...
null
https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-core/DDC/Core/Transform/BoundT.hs
haskell
| Lifting and lowering level-1 deBruijn indices in code things. Level-1 indices are used for type variables. ^ Number of levels to lift. ^ Current binding depth. ^ Lift exp indices in this thing. ^ Lifted, and how much to increase depth by
module DDC.Core.Transform.BoundT ( liftT, liftAtDepthT , MapBoundT(..)) where import DDC.Core.Exp.Annot.Exp import DDC.Type.Transform.BoundT instance Ord n => MapBoundT (Exp a) n where mapBoundAtDepthT f d xx = let down = mapBoundAtDepthT f d in case xx of XVar a u ...
150654f940d356666524cd87e86011a8c07f854fd96f7b27568980f9fe24a935
emqx/emqx
emqx_mgmt_sup.erl
%%-------------------------------------------------------------------- Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved . %% Licensed under the Apache License , Version 2.0 ( the " License " ) ; %% you may not use this file except in compliance with the License. %% You may obtain a copy o...
null
https://raw.githubusercontent.com/emqx/emqx/3587c4c04aaf681f32e80ed2ebe6aef60549bd4c/apps/emqx_management/src/emqx_mgmt_sup.erl
erlang
-------------------------------------------------------------------- you may not use this file except in compliance with the License. You may obtain a copy of the License at -2.0 Unless required by applicable law or agreed to in writing, software WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ...
Copyright ( c ) 2020 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved . Licensed under the Apache License , Version 2.0 ( the " License " ) ; distributed under the License is distributed on an " AS IS " BASIS , -module(emqx_mgmt_sup). -behaviour(supervisor). -export([start_link/0]). -export([init/1]). ...
377c1e7c36270f38e6cd94517e0c2b199d50fa0a1ebb435da87e35d47cc480d4
antoniogarrote/jobim
core.clj
(ns jobim-zeromq.test.core (:use [jobim-zeromq.core] :reload) (:use [clojure.test])) (deftest replace-me ;; FIXME: write (is false "No tests have been written."))
null
https://raw.githubusercontent.com/antoniogarrote/jobim/f041331d2c02cf38741e8604263bd08a3a1f11a5/jobim-zeromq/test/jobim_zeromq/test/core.clj
clojure
FIXME: write
(ns jobim-zeromq.test.core (:use [jobim-zeromq.core] :reload) (:use [clojure.test])) (is false "No tests have been written."))
0a47186bec3721d9bef4f424b6c08d318130201112c026e7b733cfda3b4236a6
kitlang/kit
TypeStructInit.hs
module Kit.Compiler.Typers.TypeExpression.TypeStructInit (typeStructInit) where import Control.Applicative import Control.Exception import Control.Monad import Data.List import Data.Maybe import Kit.Ast import Kit.Compiler.Binding import Kit.Compiler.Context import Kit.Compiler.Module import Kit.Compiler.Scope import ...
null
https://raw.githubusercontent.com/kitlang/kit/2769a7a8e51fe4466c50439d1a1ebdad0fb79710/src/Kit/Compiler/Typers/TypeExpression/TypeStructInit.hs
haskell
TODO: check for duplicate fields check for extra fields
module Kit.Compiler.Typers.TypeExpression.TypeStructInit (typeStructInit) where import Control.Applicative import Control.Exception import Control.Monad import Data.List import Data.Maybe import Kit.Ast import Kit.Compiler.Binding import Kit.Compiler.Context import Kit.Compiler.Module import Kit.Compiler.Scope import ...
9914c2f2f00d6c89926654d15310db75267216620a8774690e6e27d1c6039a71
haskus/haskus-system
Main.hs
import Haskus.System main :: IO () main = runSys <| do Initialize the terminal term <- defaultTerminal -- print a string on the standard output writeStrLn term "Hello World!" -- wait for a key to be pressed waitForKey term -- shutdown the computer void powerOff
null
https://raw.githubusercontent.com/haskus/haskus-system/38b3a363c26bc4d82e3493d8638d46bc35678616/haskus-system-examples/src/helloworld/Main.hs
haskell
print a string on the standard output wait for a key to be pressed shutdown the computer
import Haskus.System main :: IO () main = runSys <| do Initialize the terminal term <- defaultTerminal writeStrLn term "Hello World!" waitForKey term void powerOff
ec7347b6c2d165198d565a17c4d682280be57c9864f572fc4befbef49df0fc76
ahrefs/monorobot
common.ml
open Base module StringMap = struct type 'a t = 'a Map.M(String).t let empty : 'a t = Map.empty (module String) let to_list (l : 'a t) : (string * 'a) list = Map.to_alist l let of_list (m : (string * 'a) list) : 'a t = Map.of_alist_exn (module String) m let wrap = of_list let unwrap = to_list end module ...
null
https://raw.githubusercontent.com/ahrefs/monorobot/1eab7b5f3dcc397a17ab5f7a84c477dfd157472c/lib/common.ml
ocaml
open Base module StringMap = struct type 'a t = 'a Map.M(String).t let empty : 'a t = Map.empty (module String) let to_list (l : 'a t) : (string * 'a) list = Map.to_alist l let of_list (m : (string * 'a) list) : 'a t = Map.of_alist_exn (module String) m let wrap = of_list let unwrap = to_list end module ...
7c29c8d93877a29425a1898d0cc333f5898fcf8df9ce273e1d917bb10b885eb8
soulomoon/SICP
ch5-eceval-compiler.scm
;;;;EXPLICIT-CONTROL EVALUATOR FROM SECTION 5.4 OF ;;;; STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS ;;;; MODIFIED TO SUPPORT COMPILED CODE (AS IN SECTION 5.5.7) ;;;;Changes to basic evaluator machine are ( 1 ) some new eceval controller code for the driver and apply - dispatch ; ( 2 ) some additional machine...
null
https://raw.githubusercontent.com/soulomoon/SICP/1c6cbf5ecf6397eaeb990738a938d48c193af1bb/material/allcode/ch5-eceval-compiler.scm
scheme
EXPLICIT-CONTROL EVALUATOR FROM SECTION 5.4 OF STRUCTURE AND INTERPRETATION OF COMPUTER PROGRAMS MODIFIED TO SUPPORT COMPILED CODE (AS IN SECTION 5.5.7) Changes to basic evaluator machine are Explicit-control evaluator. support it needs (including the register-machine simulator) To resume the machine without re...
( 3 ) support for compiled code to call interpreted code ( exercise 5.47 ) -- ( new register and 1 new instruction at start ) ( 4 ) new startup aid start - eceval To use it , load " load-eceval-compiler.scm " , which loads this file and the To start , can use compile - and - go as in section 5.5.7 o...
811009b6b97158a4df95250e57417ebd049723aa1bd14bae5d49b45bbf6d5af2
exercism/haskell
Tests.hs
# OPTIONS_GHC -fno - warn - type - defaults # # LANGUAGE RecordWildCards # import Data.Bifunctor (bimap) import Data.Char (toLower) import Data.Foldable (for_) import GHC.Exts (fromList, toList) import Test.Hspec (Spec, describe, it, shouldMatchList) import Test.Hspec.Runner (configFastF...
null
https://raw.githubusercontent.com/exercism/haskell/f81ee7dc338294b3dbefb7bd39fc193546fcec26/exercises/practice/word-count/test/Tests.hs
haskell
Here we used `fromIntegral`, `fromList` and `toList` to generalize the tests, accepting any function that receives a string-like argumment and returns a type that can be converted to [(String, Integer)]. Also, the words are lower-cased before comparison and the output's order is ignored.
# OPTIONS_GHC -fno - warn - type - defaults # # LANGUAGE RecordWildCards # import Data.Bifunctor (bimap) import Data.Char (toLower) import Data.Foldable (for_) import GHC.Exts (fromList, toList) import Test.Hspec (Spec, describe, it, shouldMatchList) import Test.Hspec.Runner (configFastF...
7dc18e4b192f542df762f5817d84df33d6cd024ccbb929490c9e67defa67a986
input-output-hk/cardano-sl
Class.hs
{-# LANGUAGE ConstraintKinds #-} # LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # # LANGUAGE UndecidableInstances # module Pos.Core.Slotting.Class ( HasSlottingVar (..) , MonadSlotsData , MonadSlots (..) , SlottingVar , cloneSlottingVar ) where i...
null
https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/core/src/Pos/Core/Slotting/Class.hs
haskell
# LANGUAGE ConstraintKinds # variable has. | System start and slotting data | Type class providing information about current slot. | Blocking version of 'getCurrentSlot'. This function doesn't return until current slot is known. | This function tries to predict current slot as accurately as it can. If 'get...
# LANGUAGE FlexibleInstances # # LANGUAGE MultiParamTypeClasses # # LANGUAGE UndecidableInstances # module Pos.Core.Slotting.Class ( HasSlottingVar (..) , MonadSlotsData , MonadSlots (..) , SlottingVar , cloneSlottingVar ) where import Universum import ...
a1d532e2c3cf9235d8a8de2ec2910311482f04077e7816ab5ffb492faf5a7b80
hamler-lang/hamler
NetKernel.erl
%%--------------------------------------------------------------------------- %% | Module : NetKernel Copyright : ( c ) 2020 - 2021 EMQ Technologies Co. , Ltd. %% License : BSD-style (see the LICENSE file) %% Maintainer : , , %% Stability : experimental %% Portabili...
null
https://raw.githubusercontent.com/hamler-lang/hamler/3ba89dde3067076e112c60351b019eeed6c97dd7/lib/Control/Distributed/NetKernel.erl
erlang
--------------------------------------------------------------------------- | License : BSD-style (see the LICENSE file) Stability : experimental Portability : portable --------------------------------------------------------------------------- TODO:...
Module : NetKernel Copyright : ( c ) 2020 - 2021 EMQ Technologies Co. , Ltd. Maintainer : , , The NetKernel FFI module . -module('NetKernel'). -include("../../Foreign.hrl"). -export([ connectNode/1 , getTicktime/0 , monitorNodes/1 , monitorNodesO...
7640cf860db9b5cef238d741d3b3dd3808d2adcb5cda414b19b89a265ad0c408
cert-lv/pastelyzer
util.lisp
(defpackage #:pastelyzer.config.util (:use #:common-lisp) (:import-from #:alexandria #:when-let) (:local-nicknames (#:sink #:pastelyzer.config.sink) (#:filter #:pastelyzer.config.filter) (#:usr #:pastelyzer.config.user)) (:export #:parse-item-function ...
null
https://raw.githubusercontent.com/cert-lv/pastelyzer/278caeaafd5073300b5ee5bc9b801be5bd4f8637/src/config/util.lisp
lisp
XXX: Filters were not exactly designed for this...
(defpackage #:pastelyzer.config.util (:use #:common-lisp) (:import-from #:alexandria #:when-let) (:local-nicknames (#:sink #:pastelyzer.config.sink) (#:filter #:pastelyzer.config.filter) (#:usr #:pastelyzer.config.user)) (:export #:parse-item-function ...
a1ba27c49f8166232f9882b7c60b2182c3b7ea0cef8e469942555b9191146750
Frama-C/Frama-C-snapshot
sarif_gen.ml
(**************************************************************************) (* *) This file is part of Frama - C. (* *) Copyright ...
null
https://raw.githubusercontent.com/Frama-C/Frama-C-snapshot/639a3647736bf8ac127d00ebe4c4c259f75f9b87/src/plugins/markdown-report/sarif_gen.ml
ocaml
************************************************************************ alternatives) ...
This file is part of Frama - C. Copyright ( C ) 2007 - 2019 CEA ( Commissariat à l'énergie atomique et aux énergies Lesser General Public License as published by the Free Software Foundation , v...
8fdff9b4bae13395319f18067814f4b348e710b82c8e65f46f7b8b4b5566dafd
alvatar/spheres
bit-vector.scm
;;!!! Bit vectors ;; ;; Bit-vectors provide an abstract interface to bitwise operations ;; typically done with integers. They may in fact be implemented as ;; integers on implementations with bignums, or they may be implemented ;; by other means such as vectors which may be more efficient. These ;; vectors are meant ...
null
https://raw.githubusercontent.com/alvatar/spheres/568836f234a469ef70c69f4a2d9b56d41c3fc5bd/spheres/structure/bit-vector.scm
scheme
!!! Bit vectors Bit-vectors provide an abstract interface to bitwise operations typically done with integers. They may in fact be implemented as integers on implementations with bignums, or they may be implemented by other means such as vectors which may be more efficient. These vectors are meant to be used as ...
SRFI-33 bitwise operations : are allowed , but not required , to mutate their first argument only : (cond-expand (gambit (declare (fixnum))) (else (void))) these all return non - negative values in [ 0 .. 255 ] (define (byte-not x) (- #b11111111 x)) (define (byte-eqv a b) (byte-not (fxxor a b))) (d...