_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 |
|---|---|---|---|---|---|---|---|---|
e41ad5bfc5f882e472f9babd57ad66c6133a2a82922748c7d607d6a0d086dea5 | TouchType/conf-er | conf_er.clj | Copyright ( c ) 2013 TouchType Ltd. All Rights Reserved .
(ns conf-er
"Global configuration utilities. This is intended to be very simple,
for top-level projects which only have one configuration file. Any
library projects using this should be good citizens and namespace
their keywords with ::keyword, so ... | null | https://raw.githubusercontent.com/TouchType/conf-er/21874eeec4c542b3bea96e8116fd6c24ab6dc767/src/conf_er.clj | clojure | Ensure that the config map has been requested at least once on load | Copyright ( c ) 2013 TouchType Ltd. All Rights Reserved .
(ns conf-er
"Global configuration utilities. This is intended to be very simple,
for top-level projects which only have one configuration file. Any
library projects using this should be good citizens and namespace
their keywords with ::keyword, so ... |
901b1d8425d5ada2668b50860e9c2e449e4fb3db3927f58934832d420e23b6b6 | pflanze/chj-schemelib | fixnum-more.scm | Copyright 2018 - 2020 by < >
;;; This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
;;; (at your option) any later version.
(require def... | null | https://raw.githubusercontent.com/pflanze/chj-schemelib/59ff8476e39f207c2f1d807cfc9670581c8cedd3/fixnum-more.scm | scheme | This file is free software; you can redistribute it and/or modify
(at your option) any later version. | Copyright 2018 - 2020 by < >
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
(require define-macro-star
(cj-gambit-sys max-fixnum min-fixnum)
cj-symbol
test)
(export (macros fixnum-nat... |
ec52f29b243165cce46094a1ebc19ac21abe3ec1bed2e9caab4947380693c664 | ont-app/vocabulary | wikidata.cljc | (ns ont-app.vocabulary.wikidata
{:doc "Wikidata-related vocabulary. Requiring this file should bring in all ns assocated with wikidata."
}
(:require
[ont-app.vocabulary.core :as voc]
))
(def sparql-endpoint
"The public SPARQL endpoint provided by WMF."
"")
(voc/put-ns-meta!
'ont-app.vocabulary.wikid... | null | https://raw.githubusercontent.com/ont-app/vocabulary/cc5ae55ab2ba19e86ed68be8f6b508782489d4b1/src/ont_app/vocabulary/wikidata.cljc | clojure | THESE NAMESPACES ARE RELATIVELY RARE
BUT SHOW UP IN #Full_list_of_prefixes
PREFIX wdtn: <-normalized/>
PREFIX wds: </>
PREFIX wdref: </>
PREFIX psv: </>
PREFIX psn: <-normalized/>
PREFIX pq: </>
PREFIX pqv: </>
PREFIX pqn: <-normalized/>
PREFIX pr: </>
PREFIX prv: </>
PREFIX prn: <-normalized/>
PREFIX w... | (ns ont-app.vocabulary.wikidata
{:doc "Wikidata-related vocabulary. Requiring this file should bring in all ns assocated with wikidata."
}
(:require
[ont-app.vocabulary.core :as voc]
))
(def sparql-endpoint
"The public SPARQL endpoint provided by WMF."
"")
(voc/put-ns-meta!
'ont-app.vocabulary.wikid... |
855bfb7bd3ee684485620b36f3742c538c2d281fb29b07e8a9266f4beff96256 | donaldsonjw/bigloo | evaluate_fsize.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / runtime / Eval / evaluate_fsize.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/donaldsonjw/bigloo/a4d06e409d0004e159ce92b9908719510a18aed5/runtime/Eval/evaluate_fsize.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* Compute the size of stack needed for an abstraction */
* of the space for free v... | * serrano / prgm / project / bigloo / runtime / Eval / evaluate_fsize.scm * /
* Author : * /
* Creation : Tue Feb 8 16:42:27 2011 * /
* Last change : Fri Nov 30 09:32:13 2012 ( serrano ) * /
* Cop... |
0288f9cab69134fd23f65dfed25503d8e23fbc3b95599db19ef943385550d6e2 | borkdude/tools | ls_jar.clj | #!/usr/bin/env bb
(ns ls-jar
(:require
[babashka.cli :as cli]
[clojure.java.io :as io]
[clojure.string :as str]))
(def spec [[:lib {:desc "Library as fully qualified symbol. Must be accompanied with --version."}]
[:version {:desc "Version"}]
[:jar {:desc "Jar file"}]])
(defn print-he... | null | https://raw.githubusercontent.com/borkdude/tools/4d37374e786058548f70d2f451927526a7342e17/ls_jar.clj | clojure | #!/usr/bin/env bb
(ns ls-jar
(:require
[babashka.cli :as cli]
[clojure.java.io :as io]
[clojure.string :as str]))
(def spec [[:lib {:desc "Library as fully qualified symbol. Must be accompanied with --version."}]
[:version {:desc "Version"}]
[:jar {:desc "Jar file"}]])
(defn print-he... | |
0b561b5e92f31e9df4111dd5de7369606c1ca133e6d042333c89b4bd931da678 | haskell/haskell-language-server | DestructDataFam.expected.hs | # LANGUAGE TypeFamilies #
data family Yo
data instance Yo = Heya Int
test :: Yo -> Int
test (Heya n) = _w0
| null | https://raw.githubusercontent.com/haskell/haskell-language-server/f3ad27ba1634871b2240b8cd7de9f31b91a2e502/plugins/hls-tactics-plugin/new/test/golden/DestructDataFam.expected.hs | haskell | # LANGUAGE TypeFamilies #
data family Yo
data instance Yo = Heya Int
test :: Yo -> Int
test (Heya n) = _w0
| |
9229d5e1abfc00bb64890d8e423204fe4ed14daddcacf6caf2b1f0eae033c074 | nikita-volkov/text-builder | Main.hs | module Main where
import qualified Data.ByteString as ByteString
import qualified Data.Text as A
import qualified Data.Text.Encoding as Text
import Test.QuickCheck.Instances
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import qualified Text.Builder as B
import Prelude hiding (choose)
main =
... | null | https://raw.githubusercontent.com/nikita-volkov/text-builder/cb33836f27ed1d27eae70b094ddea5f15f7877a3/test/Main.hs | haskell | module Main where
import qualified Data.ByteString as ByteString
import qualified Data.Text as A
import qualified Data.Text.Encoding as Text
import Test.QuickCheck.Instances
import Test.Tasty
import Test.Tasty.HUnit
import Test.Tasty.QuickCheck
import qualified Text.Builder as B
import Prelude hiding (choose)
main =
... | |
e44dd93af3fcecc9a25cecd6d2701fb603a7944f48d14ae0f648c55134d68c0b | tezos/tezos-mirror | p2p_test_utils.mli | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2020 Nomadic Labs , < >
(* ... | null | https://raw.githubusercontent.com/tezos/tezos-mirror/5cc73af9f7c6029c4db68fe58fba2fb3922eb6d6/src/lib_p2p/test/common/p2p_test_utils.mli | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2020 Nomadic Labs , < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN A... |
08ac3c49b7f540b4b1b3993b5c39b0cdf80db2abeda1a64cdf2fca92e704aed6 | jeannekamikaze/Spear | Utils.hs | module Spear.Math.Utils
(
Side(..)
, Face(..)
, orientation2d
, viewToWorld2d
)
where
import Spear.Math.Matrix4 as M4
import Spear.Math.Vector as V
data Side = L | R deriving (Eq, Show)
data Face = F | B deriving (Eq, Show)
-- | Return the signed area of the triangle defined by the... | null | https://raw.githubusercontent.com/jeannekamikaze/Spear/4ce19dca3441d1e079a66e2f3dc55b77a7f0898f/Spear/Math/Utils.hs | haskell | | Return the signed area of the triangle defined by the given points.
^ Point in view space
^ Inverse view matrix
^ Projection of the given point
| module Spear.Math.Utils
(
Side(..)
, Face(..)
, orientation2d
, viewToWorld2d
)
where
import Spear.Math.Matrix4 as M4
import Spear.Math.Vector as V
data Side = L | R deriving (Eq, Show)
data Face = F | B deriving (Eq, Show)
orientation2d :: Vector2 -> Vector2 -> Vector2 -> Float
o... |
e3100e33d5a1b5ce198302c07353f48c2f266a5e8706172c1808620ead5c8950 | luminus-framework/luminus-template | reitit.clj | (ns leiningen.new.reitit
(:require [leiningen.new.common :refer :all]))
(def reitit-assets
[["{{resource-path}}/docs/docs.md" "reitit/resources/docs.md"]
["{{backend-path}}/{{sanitized}}/routes/home.clj" "reitit/src/home.clj"]])
(defn reitit-features [[assets options :as state]]
(if (some #{"+reitit"} (:feat... | null | https://raw.githubusercontent.com/luminus-framework/luminus-template/e23c79868553ae18ff692e89f9491d3731cf1b06/src/leiningen/new/reitit.clj | clojure | (ns leiningen.new.reitit
(:require [leiningen.new.common :refer :all]))
(def reitit-assets
[["{{resource-path}}/docs/docs.md" "reitit/resources/docs.md"]
["{{backend-path}}/{{sanitized}}/routes/home.clj" "reitit/src/home.clj"]])
(defn reitit-features [[assets options :as state]]
(if (some #{"+reitit"} (:feat... | |
57cb400cada56dfb0cbdd009a88339f3e6be0084ce19e9246ed8395ea98677fb | igrishaev/book-sessions | web2.clj | (ns book.web
(:require
[ring.middleware.params :refer [wrap-params]]
[ring.middleware.keyword-params :refer [wrap-keyword-params]]
[ring.adapter.jetty :refer [run-jetty]]))
(def wrap-params+ (comp wrap-params wrap-keyword-params))
(defn app-naked [request]
{:status 200
:body (pr-str (:params request... | null | https://raw.githubusercontent.com/igrishaev/book-sessions/c62af1230e91b8ab9e4e456798e894d1b4145dfc/src/book/web2.clj | clojure | (ns book.web
(:require
[ring.middleware.params :refer [wrap-params]]
[ring.middleware.keyword-params :refer [wrap-keyword-params]]
[ring.adapter.jetty :refer [run-jetty]]))
(def wrap-params+ (comp wrap-params wrap-keyword-params))
(defn app-naked [request]
{:status 200
:body (pr-str (:params request... | |
acc212a8b1cdd4ae0430081eb70f4afea94d80572156d5b585979bfa62d600c7 | Xylios13/archigd | for-evaluation.rkt | #lang racket
(require "main.rkt")
(define (floors points levels)
(for ([lvl levels])
(slab points #:bottom-level lvl)))
(define (walls points levels)
(let* ((p1 (car points))
(p2 (car (cdr points)))
(wall-length (sqrt (+ (* (- (cx p2) (cx p1))
(- (cx p2) ... | null | https://raw.githubusercontent.com/Xylios13/archigd/2276679ae60858f80efdf286fdd9fb38663e2269/archicad/testing%20examples/for-evaluation.rkt | racket | (stairs "Stair Spiral 18"
(stairs "Stair Spiral 18" | #lang racket
(require "main.rkt")
(define (floors points levels)
(for ([lvl levels])
(slab points #:bottom-level lvl)))
(define (walls points levels)
(let* ((p1 (car points))
(p2 (car (cdr points)))
(wall-length (sqrt (+ (* (- (cx p2) (cx p1))
(- (cx p2) ... |
5ffe476d9ff212277566d70f4cdd956024daccacb56cd9c49ed20a081848be37 | c-cube/frog-utils | Html.ml |
(* This file is free software, part of frog-utils. See file "license" for more details. *)
* { 1 Simple wrapper for HTML }
include Tyxml.Html
type t = Html_types.div_content_fun elt
type html = t
* { 2 Encoding Records in HTML }
let to_string h =
Misc.Fmt.to_string (pp_elt()) h
module Record = struct
type t ... | null | https://raw.githubusercontent.com/c-cube/frog-utils/3f68c606a7abe702f9e22a0606080191a2952b18/src/lib/Html.ml | ocaml | This file is free software, part of frog-utils. See file "license" for more details.
TODO: same as record, but for full tables? |
* { 1 Simple wrapper for HTML }
include Tyxml.Html
type t = Html_types.div_content_fun elt
type html = t
* { 2 Encoding Records in HTML }
let to_string h =
Misc.Fmt.to_string (pp_elt()) h
module Record = struct
type t = (string * html) list
let start = []
let add s f l = (s, f) :: l
let add_with_ fun_ ... |
e6ba5c7f4369d09eab6023b2e80159fa5c97afcf4562708701ae00446bb6c98f | rtoy/ansi-cl-tests | compile.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Thu Oct 10 20:54:20 2002
;;;; Contains: Tests for COMPILE, COMPILED-FUNCTION-P, COMPILED-FUNCTION
(in-package :cl-test)
(deftest compile.1
(progn
(fmakunbound 'compile.1-fn)
(values
(eval '(defun compile.1-fn (x) x))
(compiled-function-p 'compi... | null | https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/compile.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests for COMPILE, COMPILED-FUNCTION-P, COMPILED-FUNCTION
Compile does not coalesce literal constants
Error tests | Author :
Created : Thu Oct 10 20:54:20 2002
(in-package :cl-test)
(deftest compile.1
(progn
(fmakunbound 'compile.1-fn)
(values
(eval '(defun compile.1-fn (x) x))
(compiled-function-p 'compile.1-fn)
(let ((x (compile 'compile.1-fn)))
(or (eqt x 'compile.1-fn)
(not... |
f15502c17e2758ef61051b0339673d2e792dab7e7b51dc33b8370f506d233983 | BitGameEN/bitgamex | cowboy_loop.erl | Copyright ( c ) 2011 - 2017 , < >
%%
%% Permission to use, copy, modify, and/or 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 AUTHOR DISC... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/deps/cowboy/src/cowboy_loop.erl | erlang |
Permission to use, copy, modify, and/or 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.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVE... | Copyright ( c ) 2011 - 2017 , < >
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
-module(cowboy_loop).
-behaviour(cowboy_sub_protocol)... |
c1838b962dfe775370c802f5f78bf106bc9ea7e212c3575f09559c65116b824f | input-output-hk/project-icarus-importer | Report.hs | module Statistics.Report
( reportTxFate
) where
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as M
import qualified Data.Set as S
import qualified Data.Text as T
import System.IO (hPutStrLn)
import Statistics.Block (TxFate (..))
import Types
import ... | null | https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/tools/src/post-mortem/Statistics/Report.hs | haskell | module Statistics.Report
( reportTxFate
) where
import Data.Map.Strict (Map)
import qualified Data.Map.Strict as M
import qualified Data.Set as S
import qualified Data.Text as T
import System.IO (hPutStrLn)
import Statistics.Block (TxFate (..))
import Types
import ... | |
9ed0a77f963b3219b53c5732a3f73c00d990f68f77ff8fb2c58cb3dc9414d185 | dparis/gen-phzr | bounds.cljs | (ns phzr.component.bounds
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser]))
(defn ->Bounds
"The Bounds component contains properties related to the bounds of the Game Object."
([]
(js/Phaser.Component.Bounds.)))
| null | https://raw.githubusercontent.com/dparis/gen-phzr/e4c7b272e225ac343718dc15fc84f5f0dce68023/out/component/bounds.cljs | clojure | (ns phzr.component.bounds
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser]))
(defn ->Bounds
"The Bounds component contains properties related to the bounds of the Game Object."
([]
(js/Phaser.Component.Bounds.)))
| |
1a4f59512cdcd7028f53bb131549a913194029c1ea8b167a201e7d2a3285d56a | learningclojurescript/code-examples | project.clj | (defproject schema-demo "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:min-lein-version "2.5.3"
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]
[prismatic/... | null | https://raw.githubusercontent.com/learningclojurescript/code-examples/fdbd0e35ae5a16d53f1f784a52c25bcd4e5a8097/chapter-7/schema-demo/project.clj | clojure | If no code is to be run, set :figwheel true for continued automagical reloading
This next build is an compressed minified build for
production. You can build this with:
:http-server-root "public" ;; default and assumes "resources"
; default
watch and update CSS
if you want to embed a ring handler into the figwhe... | (defproject schema-demo "0.1.0-SNAPSHOT"
:description "FIXME: write this!"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:min-lein-version "2.5.3"
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.170"]
[prismatic/... |
41fe655ab96f5e1532cea01f80fe344af65a8c729bc234e3ef8ee7304bf9b39a | hiroshi-unno/coar | z3interface.ml | open Core
open Z3
open Common
open Common.Ext
open Ast
open Ast.LogicOld
let verbose = false
module Debug = Debug.Make (val Debug.Config.(if verbose then enable else disable))
let validate = false
let validate_cfg = [ ("model_validate", "true"); ("well_sorted_check", "true") ]
(* let _ = Z3.set_global_param "smt.mac... | null | https://raw.githubusercontent.com/hiroshi-unno/coar/90a23a09332c68f380efd4115b3f6fdc825f413d/lib/Z3Smt/z3interface.ml | ocaml | let _ = Z3.set_global_param "smt.macro_finder" "true"
Hashtbl.Poly.clear cache;
* decoding
Debug.print @@ lazy (sprintf "look_up_func:%d :%s" (Z3.FuncDecl.get_id func) (Z3.FuncDecl.to_string func));
Debug.print @@ lazy (sprintf "search_sel %d =? %d :%s" id (Z3.FuncDecl.get_id z3_sel) (Z3.FuncDecl.to_string z3_s... | open Core
open Z3
open Common
open Common.Ext
open Ast
open Ast.LogicOld
let verbose = false
module Debug = Debug.Make (val Debug.Config.(if verbose then enable else disable))
let validate = false
let validate_cfg = [ ("model_validate", "true"); ("well_sorted_check", "true") ]
let mutex = Caml_threads.Mutex.create (... |
c6a5e49c080de1d0289f58ab826b5557f3e3ef59bf4bb1dede49c7ddfcb6f6f4 | ocamllabs/ocaml-modular-implicits | ast_helper.mli | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocamllabs/ocaml-modular-implicits/92e45da5c8a4c2db8b2cd5be28a5bec2ac2181f1/parsing/ast_helper.mli | ocaml | *********************************************************************
OCaml
... | , LexiFi
Copyright 2012 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 .
* Helpers to produce Parsetree fragments... |
698e71bce6dba64eba2071663995865448a1386381b7c654e5011f16bb9a049a | essdotteedot/distributed | distributed.mli | (** This module provides modules to create distribtued computations.
Distributed comutations are described using the {!module-type:Process}.
{!module-type:Process} provides a monadic interface to describe distributed computations.
@author essdotteedot <essdotteedot_at_gmail_dot_com>
@version 0.6.0
*)... | null | https://raw.githubusercontent.com/essdotteedot/distributed/bce5906d87b28afa3d7fca4b069753667045b749/src/distributed.mli | ocaml | * This module provides modules to create distribtued computations.
Distributed comutations are described using the {!module-type:Process}.
{!module-type:Process} provides a monadic interface to describe distributed computations.
@author essdotteedot <essdotteedot_at_gmail_dot_com>
@version 0.6.0
* T... |
* Some nomenclature :
- Node : A node corresponds to a operating system process . There can be many nodes on a
single machine .
- Process : A process corresponds to a light weight thread ( i.e. , user space cooperative threads ) .
There can be many processes on a single No... |
6a02032db9fe56799236533266ce084f7876d6534e49ab25f605db9b5b2b6379 | racket/gui | platform.rkt | #lang racket/base
(require "init.rkt"
"button.rkt"
"canvas.rkt"
"check-box.rkt"
"choice.rkt"
"clipboard.rkt"
"cursor.rkt"
"dialog.rkt"
"frame.rkt"
"gauge.rkt"
"group-panel.rkt"
"item.rkt"
"list-box.rkt"
... | null | https://raw.githubusercontent.com/racket/gui/1386c815512906250443e50212e0816717cc493b/gui-lib/mred/private/wx/gtk/platform.rkt | racket | #lang racket/base
(require "init.rkt"
"button.rkt"
"canvas.rkt"
"check-box.rkt"
"choice.rkt"
"clipboard.rkt"
"cursor.rkt"
"dialog.rkt"
"frame.rkt"
"gauge.rkt"
"group-panel.rkt"
"item.rkt"
"list-box.rkt"
... | |
99ce700d328bd07c3959fa27d43e62b18873997a6c8ffdafae33fcefd7b2003a | bzg/covid19-faq | test.clj | Copyright ( c ) 2020 DINUM , < >
SPDX - License - Identifier : EPL-2.0
;; License-Filename: LICENSES/EPL-2.0.txt
(ns covid19faq.test
(:require [clojure.test :refer :all]))
| null | https://raw.githubusercontent.com/bzg/covid19-faq/89a3a74c000cbb14624d5e1bdc0569fccd0b9e67/test/covid19faq/test.clj | clojure | License-Filename: LICENSES/EPL-2.0.txt | Copyright ( c ) 2020 DINUM , < >
SPDX - License - Identifier : EPL-2.0
(ns covid19faq.test
(:require [clojure.test :refer :all]))
|
07e01a2fceaea023d22a0a0facc4ad40fa9fb23b33e10281dd2ba948ef14025a | damn/cdq | body_render.clj | (ns game.components.body-render
(:require [game.debug-settings :as debug]
[game.utils.geom :as geom]
[engine.render :as color])
(:use utils.core
[game.utils.tilemap :only (screenpos-of-tilepos)]
(engine core input render)
(game settings mouseoverbody)
(game.co... | null | https://raw.githubusercontent.com/damn/cdq/5093dbdba91c445e403f53ce96ead05d5ed8262b/src/game/components/body_render.clj | clojure | (render-readable-text g x y :shift false (str (get-id body)))
(melee-debug-info g [x y] body)
(when-let [c (get-skill body :melee)]
The corner is at pixel x4 y4 where the body outline corner is
OR: current rendered image of body | (ns game.components.body-render
(:require [game.debug-settings :as debug]
[game.utils.geom :as geom]
[engine.render :as color])
(:use utils.core
[game.utils.tilemap :only (screenpos-of-tilepos)]
(engine core input render)
(game settings mouseoverbody)
(game.co... |
16ed09cc71cb80f397c37b311dda862b37637c9e0d10570d7e1674c2d3bb3d48 | jlouis/etorrent_core | etorrent_peer_send.erl | @author < >
%% @doc Handle outgoing messages to a peer
%% <p>This module handles all outgoing messaging for a peer. It
%% supports various API calls to facilitate this</p>
< p > Note that this module has two modes , < em > fast</em > and
< em > > . The fast mode outsources the packet encoding to the
%% C-lay... | null | https://raw.githubusercontent.com/jlouis/etorrent_core/7db7f4ef36c1d055812504f00df92c6a67c2e4af/src/etorrent_peer_send.erl | erlang | @doc Handle outgoing messages to a peer
<p>This module handles all outgoing messaging for a peer. It
supports various API calls to facilitate this</p>
C-layer, whereas the slow mode doesn't. The price to pay is that we
have a worse granularity on the rate calculations, so we only shift
into the fast gear when we ... | @author < >
< p > Note that this module has two modes , < em > fast</em > and
< em > > . The fast mode outsources the packet encoding to the
-module(etorrent_peer_send).
-behaviour(gen_server).
-include("etorrent_rate.hrl").
-export([start_link/3]).
-export([request/2,
piece/5,
cancel/4... |
655ea70b70d307a57f9d1cfe721ffc4718a8bff910dd85977d8b5f424c8a051a | tmfg/mmtis-national-access-point | company_test.clj | (ns ote.tasks.company-test
(:require [clojure.test :refer [deftest is testing use-fixtures]]
[ote.tasks.company :refer [update-one-csv! store-daily-company-stats]]
[ote.test :refer [system-fixture with-http-resource http-post sql-query sql-execute! *ote*]]
[ote.services.transport :... | null | https://raw.githubusercontent.com/tmfg/mmtis-national-access-point/a86cc890ffa1fe4f773083be5d2556e87a93d975/ote/test/clj/ote/tasks/company_test.clj | clojure | check that companies are stored
write new CSV data | (ns ote.tasks.company-test
(:require [clojure.test :refer [deftest is testing use-fixtures]]
[ote.tasks.company :refer [update-one-csv! store-daily-company-stats]]
[ote.test :refer [system-fixture with-http-resource http-post sql-query sql-execute! *ote*]]
[ote.services.transport :... |
a795cac8cb2384303481957e7efe3ec69be641fb3d72df462f65435e2a45ad89 | anuragsoni/http_async | server_bench.ml | open! Core
open! Async
open Http_async
let text =
Bigstring.of_string
"CHAPTER I. Down the Rabbit-Hole Alice was beginning to get very tired of sitting \
by her sister on the bank, and of having nothing to do: once or twice she had \
peeped into the book her sister was reading, but it had no pictures ... | null | https://raw.githubusercontent.com/anuragsoni/http_async/602889e33b92a842ce7a64dcc259270f529231e3/bench/server_bench.ml | ocaml | open! Core
open! Async
open Http_async
let text =
Bigstring.of_string
"CHAPTER I. Down the Rabbit-Hole Alice was beginning to get very tired of sitting \
by her sister on the bank, and of having nothing to do: once or twice she had \
peeped into the book her sister was reading, but it had no pictures ... | |
1b7b33e799d2d0fd31502efbe8ae253cd1f8f3e871cf18d04eac2da657bcdbf2 | Risto-Stevcev/bs-declaredom | Jsdom.ml | *
* Initializes mock window and document objects from JSDOM .
* Useful for reusing DOM code on the backend
* Initializes mock window and document objects from JSDOM.
* Useful for reusing DOM code on the backend
*)
let init: unit -> unit = [%raw fun () ->
"if (!global.document) {
var JSDOM = require('jsdom... | null | https://raw.githubusercontent.com/Risto-Stevcev/bs-declaredom/6e2eb1f0daa32a7253caadbdd6392f3371807c88/src/Jsdom.ml | ocaml | *
* Initializes mock window and document objects from JSDOM .
* Useful for reusing DOM code on the backend
* Initializes mock window and document objects from JSDOM.
* Useful for reusing DOM code on the backend
*)
let init: unit -> unit = [%raw fun () ->
"if (!global.document) {
var JSDOM = require('jsdom... | |
b7f643b813f6220f9f41fa3ebdc70ee0bd915552c96f529b1cc8ab400b65d6b3 | lexi-lambda/blackboard | unicode.rkt | #lang racket/base
(require racket/contract
racket/match)
(provide (contract-out
[char:minus char?]
[math-char-style/c flat-contract?]
[math-char (->* [char?]
[#:bold? any/c
#:italic? any/c
#:style m... | null | https://raw.githubusercontent.com/lexi-lambda/blackboard/cfc987e9bb3a357a10d23a44419bbe16215ea656/blackboard-lib/blackboard/private/unicode.rkt | racket | ----------------------------------------------------------------------------- | #lang racket/base
(require racket/contract
racket/match)
(provide (contract-out
[char:minus char?]
[math-char-style/c flat-contract?]
[math-char (->* [char?]
[#:bold? any/c
#:italic? any/c
#:style m... |
28f5a375d38468d560630ab1cff1f329691b2396036f07d893dc98c20877930e | uwplse/synapse | hd-sgn-test.rkt | #lang s-exp rosette
(require
"../opsyn/engine/metasketch.rkt" "../opsyn/engine/eval.rkt" "../opsyn/engine/util.rkt"
"../opsyn/bv/lang.rkt" "../benchmarks/hd/wcet.rkt" "../opsyn/engine/solver+.rkt"
"../opsyn/metasketches/iterator.rkt" "../opsyn/engine/search.rkt"
rackunit "test-runner.rkt")
(current-subproce... | null | https://raw.githubusercontent.com/uwplse/synapse/10f605f8f1fff6dade90607f516550b961a10169/test/hd-sgn-test.rkt | racket | #lang s-exp rosette
(require
"../opsyn/engine/metasketch.rkt" "../opsyn/engine/eval.rkt" "../opsyn/engine/util.rkt"
"../opsyn/bv/lang.rkt" "../benchmarks/hd/wcet.rkt" "../opsyn/engine/solver+.rkt"
"../opsyn/metasketches/iterator.rkt" "../opsyn/engine/search.rkt"
rackunit "test-runner.rkt")
(current-subproce... | |
f14333f64284601ad6f65e92d7832cef73dee7c14702a3109fafa1b9f0383613 | singleheart/programming-in-haskell | ex3.hs | instance Foldable Maybe where
-- fold :: Monoid a => Maybe a -> a
fold Nothing = mempty
fold (Just a) = a
-- foldMap :: Monoid b => (a -> b) -> Maybe a -> b
foldMap _ Nothing = mempty
foldMap f (Just a) = f a
-- foldr :: (a -> b -> b) -> b -> Maybe a -> b
foldr _ _ Nothing = mempty
... | null | https://raw.githubusercontent.com/singleheart/programming-in-haskell/80c7efc0425babea3cd982e47e121f19bec0aba9/ch14/ex3.hs | haskell | fold :: Monoid a => Maybe a -> a
foldMap :: Monoid b => (a -> b) -> Maybe a -> b
foldr :: (a -> b -> b) -> b -> Maybe a -> b
foldl :: (a -> b -> a) -> a -> Maybe b -> a
traverse :: Applicative f => (a -> f b) -> Maybe a -> f (Maybe b) | instance Foldable Maybe where
fold Nothing = mempty
fold (Just a) = a
foldMap _ Nothing = mempty
foldMap f (Just a) = f a
foldr _ _ Nothing = mempty
foldr f v (Just a) = f a v
foldl _ _ Nothing = mempty
foldl f v (Just b) = f v b
instance Traversable Maybe where
traverse g Nothin... |
28d4d424e7f3a22a20b13b5ad9bacbd0dcffa464ad30f74f80eda9dc6b48bf73 | music-suite/music-suite | Quality.hs | -- | Common interval quality.
module Music.Pitch.Common.Quality
( -- * Quality
Quality (..),
qualityTypes,
isStandardQuality,
isSimpleQuality,
HasQuality (..),
invertQuality,
isPerfect,
isMajor,
isMinor,
isAugmented,
isDiminished,
-- ** Quality type
QualityType (..... | null | https://raw.githubusercontent.com/music-suite/music-suite/7f01fd62334c66418043b7a2d662af127f98685d/src/Music/Pitch/Common/Quality.hs | haskell | | Common interval quality.
* Quality
** Quality type
** Quality to alteration | module Music.Pitch.Common.Quality
Quality (..),
qualityTypes,
isStandardQuality,
isSimpleQuality,
HasQuality (..),
invertQuality,
isPerfect,
isMajor,
isMinor,
isAugmented,
isDiminished,
QualityType (..),
expectedQualityType,
isValidQualityNumber,
Direction (... |
e96b0b9e274cd734814939e6a323358d14b43102f974e9950b055b7257f3567f | hammerlab/biokepi | vcfannotatepolyphen.ml | open Biokepi_run_environment
open Common
let run ~(run_with: Machine.t) ~reference_build ~vcf ~output_vcf =
let open KEDSL in
let vap_tool =
Machine.get_tool run_with Machine.Tool.Default.vcfannotatepolyphen
in
let whessdb = Machine.(get_reference_genome run_with reference_build)
|> Reference_genome.w... | null | https://raw.githubusercontent.com/hammerlab/biokepi/d64eb2c891b41bda3444445cd2adf4e3251725d4/src/bfx_tools/vcfannotatepolyphen.ml | ocaml | open Biokepi_run_environment
open Common
let run ~(run_with: Machine.t) ~reference_build ~vcf ~output_vcf =
let open KEDSL in
let vap_tool =
Machine.get_tool run_with Machine.Tool.Default.vcfannotatepolyphen
in
let whessdb = Machine.(get_reference_genome run_with reference_build)
|> Reference_genome.w... | |
e3fecee26a2701a5449b2c459ac220dfa3bb8fa0ddb2cf4737f8d8f73be9bf09 | facebook/flow | default_resolve.mli |
* Copyright ( c ) Meta Platforms , Inc. and 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) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/flow/8adaf30c6254e4a2a433ede255c16fa108296022/src/typing/default_resolve.mli | ocaml |
* Copyright ( c ) Meta Platforms , Inc. and 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) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | |
8ef8c4c9e92cc68540f121f52ae7e1bdd842a4a0bb23304062282a93c268d26e | B-Lang-org/bsc | Intervals.hs | # LANGUAGE CPP #
module Intervals(VSetInteger, vEmpty, vSing, vFromTo, vGetSing,
vCompRange, vUnion, vIntersect, vNull) where
#if defined(__GLASGOW_HASKELL__) && (__GLASGOW_HASKELL__ >= 804)
import Prelude hiding ((<>))
#endif
import PPrint
data IVal = IVal Integer Integer
deriving (Show, Eq)
i... | null | https://raw.githubusercontent.com/B-Lang-org/bsc/bd141b505394edc5a4bdd3db442a9b0a8c101f0f/src/comp/Intervals.hs | haskell | A set of values is represented as a list of ordered, non-overlapping intervals
only if no empty or [h,l] intervals
Complement within a range
(l,h) above i
(l,h) overlaps i
(l,h) contained in i
(l,h) below i
(l,h) contains i
(l,h) overlaps i
(l,h) above i
(l,h) overlaps i
(l,h) contained in i
(l,h) contains... | # LANGUAGE CPP #
module Intervals(VSetInteger, vEmpty, vSing, vFromTo, vGetSing,
vCompRange, vUnion, vIntersect, vNull) where
#if defined(__GLASGOW_HASKELL__) && (__GLASGOW_HASKELL__ >= 804)
import Prelude hiding ((<>))
#endif
import PPrint
data IVal = IVal Integer Integer
deriving (Show, Eq)
i... |
51132389bb214667d95f52682a73d16069c80d31703d148dce6ada41907ff74e | sethfowler/pygmalion | ForwardDeclarations.hs | # LANGUAGE QuasiQuotes #
module ForwardDeclarations (testForwardDeclarations) where
import Pygmalion.Test
import Pygmalion.Test.TH
testForwardDeclarations = runPygmalionTestWithFiles $
[ ("forward-declarations-before.cpp", [pygTest|
class is_forward_declared_not_defined_before { };
|]),
("forward-decl... | null | https://raw.githubusercontent.com/sethfowler/pygmalion/d58cc3411d6a17cd05c3b0263824cd6a2f862409/tests/ForwardDeclarations.hs | haskell | # LANGUAGE QuasiQuotes #
module ForwardDeclarations (testForwardDeclarations) where
import Pygmalion.Test
import Pygmalion.Test.TH
testForwardDeclarations = runPygmalionTestWithFiles $
[ ("forward-declarations-before.cpp", [pygTest|
class is_forward_declared_not_defined_before { };
|]),
("forward-decl... | |
1c1f914a5acafae98cc33fa71f48952488de2cbd483e86e230c8eebf510f15ae | mhuebert/yawn | root.cljs | (ns yawn.root
(:require ["react-dom/client" :as react:dom]
[applied-science.js-interop :as j]))
(defn find-or-create-element [id]
(if (or (string? id) (keyword? id))
(or
(js/document.getElementById (name id))
(-> (js/document.createElement "div")
(j/!set :id (name id))
(... | null | https://raw.githubusercontent.com/mhuebert/yawn/ac5059c7428300136e125104edd6a05b3c18382c/src/main/yawn/root.cljs | clojure | (ns yawn.root
(:require ["react-dom/client" :as react:dom]
[applied-science.js-interop :as j]))
(defn find-or-create-element [id]
(if (or (string? id) (keyword? id))
(or
(js/document.getElementById (name id))
(-> (js/document.createElement "div")
(j/!set :id (name id))
(... | |
a7edc18ad8cf4d829c5163e9601cdb2b47ed9430883840b1dddb4191d26a9352 | input-output-hk/ouroboros-network | Lift.hs | -- | Lifting functions for the various types used in 'HardForkState'
--
NOTE : These are internal and not exported in the toplevel @.State@ module .
module Ouroboros.Consensus.HardFork.Combinator.State.Lift (
* Lifting functions on @f@ to @Current @f@
lift
, liftM
) where
import Data.Functor.Iden... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/c82309f403e99d916a76bb4d96d6812fb0a9db81/ouroboros-consensus/src/Ouroboros/Consensus/HardFork/Combinator/State/Lift.hs | haskell | | Lifting functions for the various types used in 'HardForkState'
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-----------------------------------------------------------------------------} | NOTE : These are internal and not exported in the toplevel @.State@ module .
module Ouroboros.Consensus.HardFork.Combinator.State.Lift (
* Lifting functions on @f@ to @Current @f@
lift
, liftM
) where
import Data.Functor.Identity
import Ouroboros.Consensus.HardFork.Combinator.State.Typ... |
3b6a7533f2dcb588ad346948144cb19428866def929cc62e2a4276bdd4263d76 | rurban/clisp | koch.lisp | Draw snowflake
;;;
Copyright ( C ) 2005 , 2007 , 2008 by
This is Free Software , covered by the GNU GPL v2 +
;;; See
;;;
(in-package :clx-demos)
(defun koch-point (cx width/2 height/2 scale)
(list (round (+ width/2 (* scale width/2 (realpart cx))))
(round (+ height/2 (* scale height/2 (imagpart cx... | null | https://raw.githubusercontent.com/rurban/clisp/75ed2995ff8f5364bcc18727cde9438cca4e7c2c/modules/clx/new-clx/demos/koch.lisp | lisp |
See
init
done
q
h
remove old junk
remove old lines | Draw snowflake
Copyright ( C ) 2005 , 2007 , 2008 by
This is Free Software , covered by the GNU GPL v2 +
(in-package :clx-demos)
(defun koch-point (cx width/2 height/2 scale)
(list (round (+ width/2 (* scale width/2 (realpart cx))))
(round (+ height/2 (* scale height/2 (imagpart cx))))))
this as... |
0f47f04fefa416cb6593c9e61f1cb07ce594ce11caaea724436ad920d3ad2abe | cognitect-labs/vase | spec_test.clj | (ns com.cognitect.vase.spec-test
(:require [com.cognitect.vase.spec :as vase.spec]
[com.cognitect.vase :as vase]
[com.cognitect.vase.service-route-table :as srt]
[clojure.spec.alpha :as s]
[clojure.spec.test.alpha :as stest]
[clojure.test :refer :all]
... | null | https://raw.githubusercontent.com/cognitect-labs/vase/d882bc8f28e8af2077b55c80e069aa2238f646b7/test/com/cognitect/vase/spec_test.clj | clojure | (ns com.cognitect.vase.spec-test
(:require [com.cognitect.vase.spec :as vase.spec]
[com.cognitect.vase :as vase]
[com.cognitect.vase.service-route-table :as srt]
[clojure.spec.alpha :as s]
[clojure.spec.test.alpha :as stest]
[clojure.test :refer :all]
... | |
df93cb7c368544bd0e480b0d655a25adf186ab5710db1098084b81c4bce39636 | project-oak/hafnium-verification | cPredicates.ml |
* 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/al/cPredicates.ml | ocaml | (name, [param1,...,paramK])
an is a declaration whose name contains a regexp defined by re
is an objc interface with name expected_name
is an objc implementation with name expected_name
is an objc category interface with class name expected_name
is an objc category implementation with class name expected_nam... |
* 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
... |
dd1e49eaba8936103ea27737b49c5f1de66b4122baa74ea430e63b8616a46021 | AshleyYakeley/Truth | Editor.hs | module Changes.Core.UI.Editor where
import Changes.Core.Edit
import Changes.Core.Import
import Changes.Core.Lens
import Changes.Core.Model
import Changes.Core.UI.View.View
type Editing :: Type -> Type -> Type
data Editing update r = MkEditing
{ editingUpdate :: NonEmpty update -> EditContext -> View ()
, edit... | null | https://raw.githubusercontent.com/AshleyYakeley/Truth/b1db68e38496a88268fa9b9d02059c597b21af05/Changes/changes-core/lib/Changes/Core/UI/Editor.hs | haskell | module Changes.Core.UI.Editor where
import Changes.Core.Edit
import Changes.Core.Import
import Changes.Core.Lens
import Changes.Core.Model
import Changes.Core.UI.View.View
type Editing :: Type -> Type -> Type
data Editing update r = MkEditing
{ editingUpdate :: NonEmpty update -> EditContext -> View ()
, edit... | |
358c0c06d1736db6a13b8795dde3c44f9fe77e46816451cac6e896922c4c8063 | xmonad/xmonad-contrib | SwapWorkspaces.hs | # LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -fno - warn - missing - signatures #
module SwapWorkspaces where
import Instances
import Test.QuickCheck
import XMonad.StackSet
import XMonad.Actions.SwapWorkspaces
-- Ensures that no "loss of information" can happen from a swap.
prop_double_swap (ss :: T) = do
t1 <-... | null | https://raw.githubusercontent.com/xmonad/xmonad-contrib/1d7abb102f7668369586e5da13ef4842982fb8e5/tests/SwapWorkspaces.hs | haskell | Ensures that no "loss of information" can happen from a swap.
Degrade nicely when given invalid data.
This doesn't pass yet. Probably should.
t1 `tagMember` ss && not (t2 `tagMember` ss) ==>
ss == swapWorkspaces t1 t2 ss
Swap only modifies the workspaces tagged t1 and t2 -- leaves all others alone.
swapWithC... | # LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -fno - warn - missing - signatures #
module SwapWorkspaces where
import Instances
import Test.QuickCheck
import XMonad.StackSet
import XMonad.Actions.SwapWorkspaces
prop_double_swap (ss :: T) = do
t1 <- arbitraryTag ss
t2 <- arbitraryTag ss
let swap = swapWorkspa... |
85d76dcb358082eba02026055bfd13e070c1108624c16c4fda9190599d44cc29 | conscell/hugs-android | GHCPackageConfig.hs | # OPTIONS_GHC -cpp #
-----------------------------------------------------------------------------
-- |
-- Module : Distribution.GHCPackageConfig
Copyright : ( c ) The University of Glasgow 2004
--
-- Maintainer :
-- Stability : alpha
-- Portability : portable
--
Explanation : Performs registrati... | null | https://raw.githubusercontent.com/conscell/hugs-android/31e5861bc1a1dd9931e6b2471a9f45c14e3c6c7e/hugs/lib/hugs/packages/Cabal/Distribution/Simple/GHCPackageConfig.hs | haskell | ---------------------------------------------------------------------------
|
Module : Distribution.GHCPackageConfig
Maintainer :
Stability : alpha
Portability : portable
user files .
|return the file, whether it exists, and whether it's readable
|If the package file doesn't exist, we should try ... | # OPTIONS_GHC -cpp #
Copyright : ( c ) The University of Glasgow 2004
Explanation : Performs registration for GHC . Specific to
ghc - pkg . Creates a GHC package config file .
module Distribution.Simple.GHCPackageConfig (
GHCPackageConfig(..),
mkGHCPackageConfig,
defaultGHCPackageConfig,
showGHCPackag... |
b07ac40e76f0f11fa01764aaffb4e467d0a49df89d922609c1c40d00d9ba5f6f | kmi/irs | french-cities-kb.lisp | Mode : Lisp ; Package :
File created in WebOnto
(in-package "OCML")
(in-ontology french-cities-kb)
(def-class french-city (city)
((located-in-country :value france)))
(def-instance Bordeaux french-city)
(def-instance Brest french-city)
(def-instance Cherbourg french-city)
(def-instance Dijon french-city... | null | https://raw.githubusercontent.com/kmi/irs/e1b8d696f61c6b6878c0e92d993ed549fee6e7dd/ontologies/applications/french-cities-kb/french-cities-kb.lisp | lisp | Package : |
File created in WebOnto
(in-package "OCML")
(in-ontology french-cities-kb)
(def-class french-city (city)
((located-in-country :value france)))
(def-instance Bordeaux french-city)
(def-instance Brest french-city)
(def-instance Cherbourg french-city)
(def-instance Dijon french-city)
(def-instance Dunkerque ... |
9ac3daeda36e56c69d7610c88d1e058eb6fe99a69d4131c4b73cfdab1b079771 | gfngfn/SATySFi | myYojsonUtil.ml |
type json = Yojson.SafePos.json
module YS = Yojson.SafePos
exception MultipleDesignation of Range.t * string
exception MissingRequiredKey of Range.t * string
exception SyntaxError of string * string
module YojsonMap = Map.Make(String)
type assoc = Yojson.position * json YojsonMap.t
let syntax_error srcp... | null | https://raw.githubusercontent.com/gfngfn/SATySFi/9dbd61df0ab05943b3394830c371e927df45251a/src/myYojsonUtil.ml | ocaml |
type json = Yojson.SafePos.json
module YS = Yojson.SafePos
exception MultipleDesignation of Range.t * string
exception MissingRequiredKey of Range.t * string
exception SyntaxError of string * string
module YojsonMap = Map.Make(String)
type assoc = Yojson.position * json YojsonMap.t
let syntax_error srcp... | |
ac7e080b2a0cff52d6d9c72426e959ad285f8a098025625141c8bf5aa056b138 | NorfairKing/smos | GitHub.hs | module Smos.GitHub
( smosGitHub,
)
where
import Smos.GitHub.Command
import Smos.GitHub.OptParse
smosGitHub :: IO ()
smosGitHub = do
Instructions d sets <- getInstructions
case d of
DispatchList -> githubList sets
DispatchImport importSets -> githubImport sets importSets
| null | https://raw.githubusercontent.com/NorfairKing/smos/3b7021c22915ae16ae721c7da60d715e24f4e6bb/smos-github/src/Smos/GitHub.hs | haskell | module Smos.GitHub
( smosGitHub,
)
where
import Smos.GitHub.Command
import Smos.GitHub.OptParse
smosGitHub :: IO ()
smosGitHub = do
Instructions d sets <- getInstructions
case d of
DispatchList -> githubList sets
DispatchImport importSets -> githubImport sets importSets
| |
7d8d949c02dda2f492df12ac8e297d4122fa8d1773d5ddcae058f88622323448 | xapi-project/message-switch | updates.ml | (******************************************************************************)
(* Object update tracking *)
open Xapi_stdext_pervasives.Pervasiveext
module type INTERFACE = sig
val service_name : string
module Dynamic : sig
type id
val rpc_of_id : id... | null | https://raw.githubusercontent.com/xapi-project/message-switch/1d0d1aa45c01eba144ac2826d0d88bb663e33101/xapi-idl/lib/updates.ml | ocaml | ****************************************************************************
Object update tracking
Map of thing -> last update counter
Type for inner snapshot that we create when injecting a barrier
* This int is a token from outside.
* Snapshot of main map
*... |
open Xapi_stdext_pervasives.Pervasiveext
module type INTERFACE = sig
val service_name : string
module Dynamic : sig
type id
val rpc_of_id : id -> Rpc.t
end
end
module Updates =
functor
(Interface : INTERFACE)
->
struct
module UpdateRecorder =
functor
(Ord : Map.OrderedType)
... |
93bc286da4596dc308fe0203843f030170bfee196b903881d669483258818838 | fakedata-haskell/fakedata | DrivingLicense.hs | # LANGUAGE TemplateHaskell #
{-# LANGUAGE OverloadedStrings #-}
module Faker.DrivingLicense where
import Data.Text (Text)
import Faker (Fake(..))
import Faker.Provider.DrivingLicense
import Faker.TH
$(generateFakeFieldUnresolveds "drivingLicense" ["usa","alabama"])
$(generateFakeFieldUnresolveds "drivingLicense" ["... | null | https://raw.githubusercontent.com/fakedata-haskell/fakedata/ea938c38845b274e28abe7f4e8e342f491e83c89/src/Faker/DrivingLicense.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TemplateHaskell #
module Faker.DrivingLicense where
import Data.Text (Text)
import Faker (Fake(..))
import Faker.Provider.DrivingLicense
import Faker.TH
$(generateFakeFieldUnresolveds "drivingLicense" ["usa","alabama"])
$(generateFakeFieldUnresolveds "drivingLicense" ["usa","alaska"])
$(generateFakeFiel... |
4924e5c6a87919531f05a7eab531c240ce94839f797b6bcd7d8c605ec6f7f9f7 | egao1980/tesseract-capi | capi3.lisp | This file was automatically generated by SWIG ( ) .
;;; Version 4.0.2
;;;
;;; Do not make changes to this file unless you know what you are doing--modify
the SWIG interface file instead .
(defpackage #:tesseract-capi/v3
(:use #:cl #:cffi))
(in-package :tesseract-capi/v3)
SWIG wrapper code starts here
(cl:... | null | https://raw.githubusercontent.com/egao1980/tesseract-capi/36ee8ae3aa1170c78ddc75af7368514a86b43f4f/src/capi3.lisp | lisp | Version 4.0.2
Do not make changes to this file unless you know what you are doing--modify | This file was automatically generated by SWIG ( ) .
the SWIG interface file instead .
(defpackage #:tesseract-capi/v3
(:use #:cl #:cffi))
(in-package :tesseract-capi/v3)
SWIG wrapper code starts here
(cl:defmacro defanonenum (cl:&body enums)
"Converts anonymous enums to defconstants."
`(cl:progn ,@(c... |
4064ad1f201e8249f952ea0a821cf3656a2a9c1701003795bb02df59d86819c7 | ygmpkk/house | Int.hs | {-# OPTIONS -fno-implicit-prelude #-}
-----------------------------------------------------------------------------
-- |
-- Module : GHC.Int
Copyright : ( c ) The University of Glasgow 1997 - 2002
-- License : see libraries/base/LICENSE
--
-- Maintainer :
-- Stability : internal
Portability :... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/libraries/base/GHC/Int.hs | haskell | # OPTIONS -fno-implicit-prelude #
---------------------------------------------------------------------------
|
Module : GHC.Int
License : see libraries/base/LICENSE
Maintainer :
Stability : internal
---------------------------------------------------------------------------
# SOURCE #
-------... | Copyright : ( c ) The University of Glasgow 1997 - 2002
Portability : non - portable ( GHC Extensions )
The sized integral datatypes , ' Int8 ' , ' Int16 ' , ' Int32 ' , and ' Int64 ' .
#include "MachDeps.h"
module GHC.Int (
Int8(..), Int16(..), Int32(..), Int64(..))
where
import Data.Bits
impo... |
b53e0cb2cf4dfc436f12fb9ff356f3656513e8296dc4ace8a572aa4413eaf8ca | scrintal/heroicons-reagent | cursor_arrow_rays.cljs | (ns com.scrintal.heroicons.solid.cursor-arrow-rays)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M12 1.5a.75.75 0 01.75.75V4.5a.75.75 0 01-1.5 0V2.25A.75.75 0 0112 1.5zM... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/solid/cursor_arrow_rays.cljs | clojure | (ns com.scrintal.heroicons.solid.cursor-arrow-rays)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M12 1.5a.75.75 0 01.75.75V4.5a.75.75 0 01-1.5 0V2.25A.75.75 0 0112 1.5zM... | |
c596e8b6fab5d5bec3b123e66b13995ec171b22d85885f803ad66fc13441b6b6 | jameysharp/corrode | test.hs | import Control.Monad
import Control.Monad.Trans.Class
import Control.Monad.Trans.State.Lazy
import Data.Either
import Data.Foldable
import Data.Functor.Identity
import qualified Data.IntMap as IntMap
import qualified Data.Map as Map
import Data.List
import Language.Rust.Corrode.CFG
import Test.Tasty
import qualified Te... | null | https://raw.githubusercontent.com/jameysharp/corrode/34053342c2f1ca04f23ad94d67057f14e74d9fb9/tests/test.hs | haskell | import Control.Monad
import Control.Monad.Trans.Class
import Control.Monad.Trans.State.Lazy
import Data.Either
import Data.Foldable
import Data.Functor.Identity
import qualified Data.IntMap as IntMap
import qualified Data.Map as Map
import Data.List
import Language.Rust.Corrode.CFG
import Test.Tasty
import qualified Te... | |
3c729ba16be30b8fd818bfe4b18dcb3446ebac5d9f9a31eb38c9ae7eb5a86671 | erlyaws/yaws | binary_header.erl | -module(binary_header).
-export([out/1]).
out(_Arg) ->
Regression test for github issue 367 , where returning a binary
%% header with deflate on would cause a crash.
%%
[{status, 200},
{header, {content_type, <<"application/octet">>}},
{ehtml, {pre,[],<<"ABCDEFGHIJKLMNOPQRSTUVWXYZ\n">>}}].
| null | https://raw.githubusercontent.com/erlyaws/yaws/da198c828e9d95ca2137da7884cddadd73941d13/testsuite/deflate_SUITE_data/binary_header.erl | erlang | header with deflate on would cause a crash.
| -module(binary_header).
-export([out/1]).
out(_Arg) ->
Regression test for github issue 367 , where returning a binary
[{status, 200},
{header, {content_type, <<"application/octet">>}},
{ehtml, {pre,[],<<"ABCDEFGHIJKLMNOPQRSTUVWXYZ\n">>}}].
|
a72977d7a0a172215bd8973134f9bed59c5d85c6ebf8cf76a134becec00d1c6c | facebook/flow | checkContentsCommand.ml |
* Copyright ( c ) Meta Platforms , Inc. and 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) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/flow/b918b06104ac1489b516988707431d98833ce99f/src/commands/checkContentsCommand.ml | ocaml | *********************************************************************
flow check-contents command
*********************************************************************
pretty implies json
Return a successful exit code if there were only warnings. |
* Copyright ( c ) Meta Platforms , Inc. and 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) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
7b73a63d0331f3e8d0b2f8e34f3db193e93c3a4025869b2850927de369db5667 | gstew5/snarkl | Keccak.hs | # LANGUAGE RebindableSyntax , DataKinds #
module Keccak where
import qualified Data.Map.Strict as Map
import Data.Bits hiding (xor)
import Prelude hiding
( (>>)
, (>>=)
, (+)
, (-)
, (*)
, (/)
, (&&)
, not
, return
, fromRational
, negate
)
import qualified... | null | https://raw.githubusercontent.com/gstew5/snarkl/d6ce72b13e370d2965bb226f28a1135269e7c198/src/examples/Keccak.hs | haskell | | Array 'a'
Allocate local array variables [b], [c], [d].
\theta step
\iota step
round constants
rotate index 'i'
by 'n' (mod lane width)
test_full n
test_interp n
test_r1cs n
$ show
$ last (r1cs_clauses r1cs)
First compile to R1CS , then generate witness .
test_wit ... | # LANGUAGE RebindableSyntax , DataKinds #
module Keccak where
import qualified Data.Map.Strict as Map
import Data.Bits hiding (xor)
import Prelude hiding
( (>>)
, (>>=)
, (+)
, (-)
, (*)
, (/)
, (&&)
, not
, return
, fromRational
, negate
)
import qualified... |
98300d09d5512e3a047bf08cc23d68bc767431e65c280518bb007ba680de2f31 | haskell-tls/hs-tls | State.hs | {-# LANGUAGE Rank2Types #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE GeneralizedNewtypeDeriving #
-- |
Module : Network . TLS.State
-- License : BSD-style
Maintainer : < >
-- Stability : experimental
-- Portability : unknown
--
the State module contains calls related to state initialization ... | null | https://raw.githubusercontent.com/haskell-tls/hs-tls/c2fc6f308bb7144d99dfe8b5431144ab5bd49ceb/core/Network/TLS/State.hs | haskell | # LANGUAGE Rank2Types #
|
License : BSD-style
Stability : experimental
Portability : unknown
which is use by the Receiving module and the Sending module.
* random
RFC 5746
RFC 5746
RFC 5746
RFC 7301
TLS 1.3 | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE GeneralizedNewtypeDeriving #
Module : Network . TLS.State
Maintainer : < >
the State module contains calls related to state initialization / manipulation
module Network.TLS.State
( TLSState(..)
, TLSSt
, runTLSState
, newTLSState
, withT... |
a9c3d0b9830dba68c10a4779659c31bd92c3f7da46cfe424e6336840b536105f | clojurewerkz/money | json.clj | This source code is dual - licensed under the Apache License , version
2.0 , and the Eclipse Public License , version 1.0 .
;;
;; The APL v2.0:
;;
;; ----------------------------------------------------------------------------------
Copyright ( c ) 2012 - 2014 , , and the ClojureWerkz Team
;;
Licensed unde... | null | https://raw.githubusercontent.com/clojurewerkz/money/734b99e2c8d4617e69b20a68d1a1760262d7786f/src/clojure/clojurewerkz/money/json.clj | clojure |
The APL v2.0:
----------------------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDIT... | This source code is dual - licensed under the Apache License , version
2.0 , and the Eclipse Public License , version 1.0 .
Copyright ( c ) 2012 - 2014 , , and the ClojureWerkz Team
distributed under the License is distributed on an " AS IS " BASIS ,
The EPL v1.0 :
Copyright ( c ) 2012 - 2014 , , ... |
dd00db943f308633aa1b44e83c57796cee08ffb5dfed1677fbd98fda6a7cf29f | inria-parkas/sundialsml | nvector_parallel_top.ml | (* Automatically generated file - don't edit! See the Makefile. *)
Sundials_top.install_printers [
"Nvector_parallel.pp";
];;
| null | https://raw.githubusercontent.com/inria-parkas/sundialsml/0c46b0c6c067677af6ef8006260b9e697cc0562b/src/nvectors/nvector_parallel_top.ml | ocaml | Automatically generated file - don't edit! See the Makefile. | Sundials_top.install_printers [
"Nvector_parallel.pp";
];;
|
7cd5dab67b107d2029ed4c54b9fbfa07aac1c533324b4071a22d76681f4a9903 | yuriy-chumak/ol | math-extra.scm | ;;;
;;; Owl math module, things after basic arithmetic
;;;
; todo - /~carlp/PDF/complexity12.pdf
(define-library (owl math-extra)
(export
isqrt iroot iexpt
ilog ;; integer log a b
expt expt-mod
ncr npr
!
dlog dlog-simple
fib
histogram
bisect
... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/fa8fe7decb3c8995f391dd82c09190d665026b77/libraries/owl/math-extra.scm | scheme |
Owl math module, things after basic arithmetic
todo - /~carlp/PDF/complexity12.pdf
integer log a b
inv-mod mod-solve
r7rs
n → m r, m^2 + r = n
TEMP
SQUARE ROOTS (stub)
fixme, did not find a good integer sqrt algorithm which would
work with these numerals, so i rolled my own as a quick substitute
bench la... |
(define-library (owl math-extra)
(export
isqrt iroot iexpt
expt expt-mod
ncr npr
!
dlog dlog-simple
fib
histogram
bisect
rationalize
)
(import
(scheme core)
(scheme list)
(owl math)
(owl iff)
(owl list-extra)
(o... |
dfc0a3a43a1d4646d8f5d011d7aa432ef1ca2af51e6afb20e54d60943b5b8657 | district0x/district-registry | runner.cljs | (ns district-registry.tests.runner
(:require
[cljs.nodejs :as nodejs]
[cljs.test :refer [run-tests]]
[district-registry.shared.smart-contracts-dev :refer [smart-contracts]]
[district-registry.tests.smart-contracts.deployment-tests]
[district-registry.tests.smart-contracts.district-tests]
[district-r... | null | https://raw.githubusercontent.com/district0x/district-registry/c2dcf7978d2243a773165b18e7a76632d8ad724e/test/district_registry/tests/runner.cljs | clojure | (ns district-registry.tests.runner
(:require
[cljs.nodejs :as nodejs]
[cljs.test :refer [run-tests]]
[district-registry.shared.smart-contracts-dev :refer [smart-contracts]]
[district-registry.tests.smart-contracts.deployment-tests]
[district-registry.tests.smart-contracts.district-tests]
[district-r... | |
635472e6b8c7da5e87779b3196271b8d753b51cebae516c608e5b3b01ed59512 | haroldcarr/learn-haskell-coq-ml-etc | HW11_AParser.hs | module HW11_AParser (Parser, runParser, satisfy, char, posInt) where
import Control.Applicative
import Data.Char
newtype Parser a = Parser { runParser :: String -> Maybe (a, String) }
satisfy :: (Char -> Bool) -> Parser Char
satisfy p = Parser f
where
f [] = Nothing
f (x:xs)
| p... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/b4e83ec7c7af730de688b7376497b9f49dc24a0e/haskell/course/2014-06-upenn/cis194/src/HW11_AParser.hs | haskell | module HW11_AParser (Parser, runParser, satisfy, char, posInt) where
import Control.Applicative
import Data.Char
newtype Parser a = Parser { runParser :: String -> Maybe (a, String) }
satisfy :: (Char -> Bool) -> Parser Char
satisfy p = Parser f
where
f [] = Nothing
f (x:xs)
| p... | |
68dd7caee42e3054d3a39325b908e51a704c104664f92974a8a30634e4c918b4 | unclechu/xlib-keys-hack | Types.hs | Author :
License : -keys-hack/master/LICENSE
# LANGUAGE DeriveGeneric , DeriveAnyClass #
module Types
( type AlternativeModeState
, type AlternativeModeLevel (..)
, numberToAlternativeModeLevel
) where
import "base" GHC.Generics (type Generic)
import "data-default" Data.Default (type Defa... | null | https://raw.githubusercontent.com/unclechu/xlib-keys-hack/33b49a9b1fc4bc87bdb95e2bb632a312ec2ebad0/src/Types.hs | haskell | or temporarily (@False@) by holding a modifier. | Author :
License : -keys-hack/master/LICENSE
# LANGUAGE DeriveGeneric , DeriveAnyClass #
module Types
( type AlternativeModeState
, type AlternativeModeLevel (..)
, numberToAlternativeModeLevel
) where
import "base" GHC.Generics (type Generic)
import "data-default" Data.Default (type Defa... |
eb1272936ef3bb2601223efd307e1094abb55230103e286a49276517e6791cc0 | dreixel/regular | GArbitrary2.hs | {-# OPTIONS -fglasgow-exts #-}
module GArbitrary2 where
import Prelude hiding (sum)
import qualified Prelude
import Control.Monad
import Control.Applicative
import System.Random
import Test.QuickCheck
import Debug.Trace
import Generics.Regular
Just x `combM` Just y = Just (x+y)
Just x `combM` _ = Just x
_ ... | null | https://raw.githubusercontent.com/dreixel/regular/c8460ee827f1eb04dd31b873380ff9626a4a4220/examples/framework/GArbitrary2.hs | haskell | # OPTIONS -fglasgow-exts # |
module GArbitrary2 where
import Prelude hiding (sum)
import qualified Prelude
import Control.Monad
import Control.Applicative
import System.Random
import Test.QuickCheck
import Debug.Trace
import Generics.Regular
Just x `combM` Just y = Just (x+y)
Just x `combM` _ = Just x
_ `combM` Just y = Just y
Nothin... |
259599f3688e9ef2df818df4412de3935d4cb7ce524ed82b93dc16186d54f36a | spawnfest/eep49ers | fixtable_SUITE.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1999 - 2016 . 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 of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/stdlib/test/fixtable_SUITE.erl | erlang |
%CopyrightBegin%
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 lan... | Copyright Ericsson AB 1999 - 2016 . 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(fixtable_SUITE).
-export([all/0, suite/0,groups/0,init_per_suite/1, end_per_suite/1,
init_per_group/2,end... |
484caed8cc60eb2d2a719f8d926b7cd79ef2e9f94346be8a650b8f55be849cb5 | mbutterick/beautiful-racket | main.rkt | #lang br/quicklang
(module+ reader
(provide read-syntax))
(define (tokenize ip)
(for/list ([tok (in-port read ip)])
tok))
(define (parse tok)
(if (list? tok)
(map parse tok)
'taco))
(define (read-syntax src ip)
(define toks (tokenize ip))
(define parse-tree (parse toks))
(with-syntax ([(... | null | https://raw.githubusercontent.com/mbutterick/beautiful-racket/f0e2cb5b325733b3f9cbd554cc7d2bb236af9ee9/beautiful-racket-demo/quantum-taco-demo/main.rkt | racket | #lang br/quicklang
(module+ reader
(provide read-syntax))
(define (tokenize ip)
(for/list ([tok (in-port read ip)])
tok))
(define (parse tok)
(if (list? tok)
(map parse tok)
'taco))
(define (read-syntax src ip)
(define toks (tokenize ip))
(define parse-tree (parse toks))
(with-syntax ([(... | |
85e14d10501af9a527475bbacc745f005758facb2999f5d9acfeba788276f99d | bollu/koans | recursion-schemes.hs | Implementation of Bananas , Lenses and Barbed Wire
data Star a = Nil | Cons a (Star a) deriving (Show, Eq)
cata :: b -> (a -> b -> b) -> Star a -> b
cata b combine =
let h = \x -> case x of
Nil -> b
Cons a as -> combine a (h as)
in h
ana :: (b -> Bool) -> (b -> (a, b)) ->... | null | https://raw.githubusercontent.com/bollu/koans/0204e9bb5ef9c541fe161523acac3cacae5d07fe/recursion-schemes.hs | haskell | Implementation of Bananas , Lenses and Barbed Wire
data Star a = Nil | Cons a (Star a) deriving (Show, Eq)
cata :: b -> (a -> b -> b) -> Star a -> b
cata b combine =
let h = \x -> case x of
Nil -> b
Cons a as -> combine a (h as)
in h
ana :: (b -> Bool) -> (b -> (a, b)) ->... | |
e0c641f49c03bdabfe4d08262db6bc494c6b347d576c2b1c119e365cb43e9152 | stchang/parsack | main.rkt | #lang racket
(require "parsack.rkt")
(provide (all-from-out "parsack.rkt"))
| null | https://raw.githubusercontent.com/stchang/parsack/57b21873e8e3eb7ffbdfa253251c3c27a66723b1/parsack-lib/parsack/main.rkt | racket | #lang racket
(require "parsack.rkt")
(provide (all-from-out "parsack.rkt"))
| |
446b5b34c22b55a88c56c69634d1bec603c9bbd1281a01256fd51aef44ed3cfb | jafingerhut/clojure-benchmarks | revcomp.clj-10.clj | The Computer Language Benchmarks Game
;; /
contributed by
(ns revcomp
(:gen-class))
(set! *warn-on-reflection* true)
(def complement-dna-char-map
{\w \W, \W \W,
\s \S, \S \S,
\a \T, \A \T,
\t \A, \T \A,
\u \A, \U \A,
\g \C, \G \C,
\c \G, \C \G,
\y \R, \Y \... | null | https://raw.githubusercontent.com/jafingerhut/clojure-benchmarks/474a8a4823727dd371f1baa9809517f9e0b508d4/revcomp/revcomp.clj-10.clj | clojure | /
from beginning and end towards the middle
that, the line just read | The Computer Language Benchmarks Game
contributed by
(ns revcomp
(:gen-class))
(set! *warn-on-reflection* true)
(def complement-dna-char-map
{\w \W, \W \W,
\s \S, \S \S,
\a \T, \A \T,
\t \A, \T \A,
\u \A, \U \A,
\g \C, \G \C,
\c \G, \C \G,
\y \R, \Y \R,
... |
3922041919475589236a1c7e05ffaf5bb00b48ad7c0db6b8797f630b76cc8037 | lexi-lambda/hackett | info.rkt | #lang info
(define collection 'multi)
(define deps
'("base"
"hackett-lib"
["scribble-lib" #:version "1.16"]))
(define build-deps
'("at-exp-lib"
"racket-doc"))
| null | https://raw.githubusercontent.com/lexi-lambda/hackett/e90ace9e4a056ec0a2a267f220cb29b756cbefce/hackett-doc/info.rkt | racket | #lang info
(define collection 'multi)
(define deps
'("base"
"hackett-lib"
["scribble-lib" #:version "1.16"]))
(define build-deps
'("at-exp-lib"
"racket-doc"))
| |
aaa0a113f54413e6037f26e55f5aff581dbd05d5c8b0bfa7285dd642a15b5048 | BillHallahan/G2 | Reducer.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
{-# LANGUAGE GADTs #-}
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE UndecidableInstances #
module G2.Execution.Reducer ( Reducer (..)
, Ha... | null | https://raw.githubusercontent.com/BillHallahan/G2/cb302723b504c3d275d8503c3a8beae4ffc6f4b9/src/G2/Execution/Reducer.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE RankNTypes #
Reducers
Orderers
| Used when applying execution rules
Allows tracking extra information to control halting of rule application,
and to reorder states
cases is used for logging states
| Keeps track of type a's that have either been accepted or dropped
| Used by Reducer... | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE UndecidableInstances #
module G2.Execution.Reducer ( Reducer (..)
, Halter (..)
, Orderer (..... |
9a5ac5bcc7dbb901d0908722411fd0d04f3bffdac4d1bb4da7613977ea26c19e | input-output-hk/cardano-ledger | EraMapping.hs | # LANGUAGE DataKinds #
# LANGUAGE TypeFamilies #
module Test.Cardano.Ledger.Alonzo.EraMapping where
import Cardano.Ledger.Alonzo (AlonzoEra)
import Cardano.Ledger.Core (EraRule)
import Cardano.Protocol.TPraos.Rules.Tickn (TICKN)
import Test.Cardano.Ledger.EraBuffet (TestCrypto)
type instance EraRule "TICKN" (AlonzoE... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger/e02891020a990f5700797493b30aaa3c6d8330ee/eras/alonzo/test-suite/src/Test/Cardano/Ledger/Alonzo/EraMapping.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE TypeFamilies #
module Test.Cardano.Ledger.Alonzo.EraMapping where
import Cardano.Ledger.Alonzo (AlonzoEra)
import Cardano.Ledger.Core (EraRule)
import Cardano.Protocol.TPraos.Rules.Tickn (TICKN)
import Test.Cardano.Ledger.EraBuffet (TestCrypto)
type instance EraRule "TICKN" (AlonzoE... | |
b511d6f757d1a41403e21044bcdf2cc4db34df45e4f201299e124f374ab4953d | xldenis/MGC | PrimSpec.hs | module MGC.Parser.PrimSpec (spec) where
import MGC.Expectation
import Test.Hspec
import MGC.Parser.Prim
import Text.Parsec
import MGC.Syntax
import Control.Applicative ((<*))
spec :: Spec
spec = do
describe "literal" $ do
describe "int" $ do
it "parses octal 0" $ do
intLit `... | null | https://raw.githubusercontent.com/xldenis/MGC/caeb2d72d16fbbefeb5104d7133c537fea66ba21/test/MGC/Parser/PrimSpec.hs | haskell | module MGC.Parser.PrimSpec (spec) where
import MGC.Expectation
import Test.Hspec
import MGC.Parser.Prim
import Text.Parsec
import MGC.Syntax
import Control.Applicative ((<*))
spec :: Spec
spec = do
describe "literal" $ do
describe "int" $ do
it "parses octal 0" $ do
intLit `... | |
12d20614dfd83ef9586309b89b10413bed5c3b1adccd6e0a3a8db3205e13bedf | fbellomi/crossclj | gzip.clj | (ns crossclj.gzip
"Ring gzip compression."
(:require [clojure.java.io :as io])
(:import (java.io InputStream
Closeable
File
ByteArrayOutputStream)
(java.util.zip GZIPOutputStream)))
(defn- accepts-gzip?
[req]
(if-let [accepts (get-in req ... | null | https://raw.githubusercontent.com/fbellomi/crossclj/7630270ebe9ea3df89fe3d877b2571e6eae1062b/src/crossclj/gzip.clj | clojure | Be aggressive in supporting clients with mangled headers (due to
Set Vary to make sure proxies don't deliver the wrong content. | (ns crossclj.gzip
"Ring gzip compression."
(:require [clojure.java.io :as io])
(:import (java.io InputStream
Closeable
File
ByteArrayOutputStream)
(java.util.zip GZIPOutputStream)))
(defn- accepts-gzip?
[req]
(if-let [accepts (get-in req ... |
98bf05fde1a3810f8ec0ddac57bf4211be8a143d7b7c88314bc0bd01cdad6cd4 | Hans-Halverson/myte | io.ml | let chan_read_contents chan =
let rec read_line lines =
try
let line = input_line chan in
line :: read_line lines
with
| End_of_file -> List.rev lines
in
let lines = read_line [] in
let contents = String.concat "\n" lines in
contents
let file_read_lines file =
let file_in = open_in ... | null | https://raw.githubusercontent.com/Hans-Halverson/myte/04c91ff8b0d44e7f65acaf6c223401741a4c0143/src/common/io.ml | ocaml | let chan_read_contents chan =
let rec read_line lines =
try
let line = input_line chan in
line :: read_line lines
with
| End_of_file -> List.rev lines
in
let lines = read_line [] in
let contents = String.concat "\n" lines in
contents
let file_read_lines file =
let file_in = open_in ... | |
f16cec2df14d515f05e6df0dd5112dc2a03f5c12dd02704829249d72b5db369d | clj-commons/aleph | client_middleware_test.clj | (ns aleph.http.client-middleware-test
(:require
[aleph.http.client-middleware :as middleware]
[clojure.test :as t :refer [deftest is]])
(:import
(java.net URLDecoder)))
(deftest test-empty-query-string
(is (= "" (middleware/generate-query-string {})))
(is (= "" (middleware/generate-query-string {} "te... | null | https://raw.githubusercontent.com/clj-commons/aleph/b5ca4d1b16b701c9465101be937a8ccce5d95d0b/test/aleph/http/client_middleware_test.clj | clojure | see #page-5 | (ns aleph.http.client-middleware-test
(:require
[aleph.http.client-middleware :as middleware]
[clojure.test :as t :refer [deftest is]])
(:import
(java.net URLDecoder)))
(deftest test-empty-query-string
(is (= "" (middleware/generate-query-string {})))
(is (= "" (middleware/generate-query-string {} "te... |
9e0e383ab8f061fdadd78a9a4943177e3b44caa1a885b5e943bc1e1fc55a32c9 | wildarch/jepsen.rqlite | sequential.clj | (ns jepsen.rqlite.sequential
"A sequential consistency test.
Verify that client order is consistent with DB order by performing queries
(in four distinct transactions) like
A: insert x
A: insert y
B: read y
B: read x
A's process order enforces that x must be visible before y, so we should
always rea... | null | https://raw.githubusercontent.com/wildarch/jepsen.rqlite/f3430b4edc1aa0583d19e350b8cdd115fa187fb6/src/jepsen/rqlite/sequential.clj | clojure | -io/jepsen/blob/main/cockroachdb/src/jepsen/cockroach/sequential.clj | (ns jepsen.rqlite.sequential
"A sequential consistency test.
Verify that client order is consistent with DB order by performing queries
(in four distinct transactions) like
A: insert x
A: insert y
B: read y
B: read x
A's process order enforces that x must be visible before y, so we should
always rea... |
1074662355b6ef37cb1cef97ddcbefaf3ac73649c6e544a107f04a0572844d2d | chaitanyagupta/chronicity | utils.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*-
;;; utils.lisp
;;; See the LICENSE file for licensing information.
(cl:in-package #:chronicity-test)
(defmacro assert-datetime= (expected form)
(let ((value (gensym "RESULT-")))
`(let ((,value ,form))
(assert-true (and ,val... | null | https://raw.githubusercontent.com/chaitanyagupta/chronicity/5841d1548cad0ca6917d8e68933124a5af68f5ec/test/utils.lisp | lisp | Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*-
utils.lisp
See the LICENSE file for licensing information. |
(cl:in-package #:chronicity-test)
(defmacro assert-datetime= (expected form)
(let ((value (gensym "RESULT-")))
`(let ((,value ,form))
(assert-true (and ,value (datetime= ,expected ,value)) ,value))))
|
83357d34fdb0bb0e3633976a93ea44d21f10ea2c3ad0fccbba41238a1c13bfb6 | haskell-tools/haskell-tools | Exprs.hs | -- | Representation of Haskell expressions
module Language.Haskell.Tools.AST.Representation.Exprs where
import Language.Haskell.Tools.AST.Ann (Ann, AnnListG, AnnMaybeG)
import {-# SOURCE #-} Language.Haskell.Tools.AST.Representation.Binds (ULocalBind, ULocalBinds, URhsGuard)
import Language.Haskell.Tools.AST.Represent... | null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/ast/Language/Haskell/Tools/AST/Representation/Exprs.hs | haskell | | Representation of Haskell expressions
# SOURCE #
# SOURCE #
| Haskell expressions
^ A variable or a data constructor (@ a @)
^ An infix operator application (@ a + b @)
^ Prefix operator application (@ -x @)
^ Lambda expression (@ \a b -> a + b @)
^ nonempty
^ If expression (@ if a then b else c @)
^ Do-nota... | module Language.Haskell.Tools.AST.Representation.Exprs where
import Language.Haskell.Tools.AST.Ann (Ann, AnnListG, AnnMaybeG)
import Language.Haskell.Tools.AST.Representation.Literals (ULiteral)
import Language.Haskell.Tools.AST.Representation.Names (UStringNode, UName, UOperator)
import Language.Haskell.Tools.AST.Rep... |
76f991b1d9740d0a008fe1a1fec98286d3dab0304c7c8c4c4c649d2469b86b12 | callum-oakley/advent-of-code | 23.clj | (ns aoc.2020.23
(:require
[clojure.string :as str]
[clojure.test :refer [deftest is]]))
(defn parse [s]
(map #(- (int %) (int \0)) s))
(defn initial-state [cups]
{:next-cup (->> (partition 2 1 cups)
(concat [[0 nil] [(last cups) (first cups)]])
(sort-by first)
... | null | https://raw.githubusercontent.com/callum-oakley/advent-of-code/da5233fc0fd3d3773d35ee747fd837c59c2b1c04/src/aoc/2020/23.clj | clojure | ... current a b c d ... destination e ... | (ns aoc.2020.23
(:require
[clojure.string :as str]
[clojure.test :refer [deftest is]]))
(defn parse [s]
(map #(- (int %) (int \0)) s))
(defn initial-state [cups]
{:next-cup (->> (partition 2 1 cups)
(concat [[0 nil] [(last cups) (first cups)]])
(sort-by first)
... |
763da135d126c47529a6ef0b51a765e8dd2a5a649314361ca91051b71219fa53 | mbj/stratosphere | NotificationConfigurationProperty.hs | module Stratosphere.S3.Bucket.NotificationConfigurationProperty (
module Exports, NotificationConfigurationProperty(..),
mkNotificationConfigurationProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-}... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/s3/gen/Stratosphere/S3/Bucket/NotificationConfigurationProperty.hs | haskell | # SOURCE #
# SOURCE #
# SOURCE #
# SOURCE # | module Stratosphere.S3.Bucket.NotificationConfigurationProperty (
module Exports, NotificationConfigurationProperty(..),
mkNotificationConfigurationProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.R... |
ef3c5d4a860cfa7f43cd3b819fe4f790474bb8085a2825afec8df5a5dd3c16f9 | ijvcms/chuanqi_dev | word_map_config.erl | %%%-------------------------------------------------------------------
@author zhengsiying
%%% @doc
%%% 自动生成文件,不要手动修改
%%% @end
Created : 2016/10/12
%%%-------------------------------------------------------------------
-module(word_map_config).
-include("common.hrl").
-include("config.hrl").
-compile([export_al... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/config/word_map_config.erl | erlang | -------------------------------------------------------------------
@doc
自动生成文件,不要手动修改
@end
------------------------------------------------------------------- | @author zhengsiying
Created : 2016/10/12
-module(word_map_config).
-include("common.hrl").
-include("config.hrl").
-compile([export_all]).
get_list_conf() ->
[ word_map_config:get(X) || X <- get_list() ].
get_list() ->
[1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16].
get(1) ->
#word_map_conf{
id ... |
9c26a29d9747cd113b10e328e1f4b7645e6161f90d483062323eb43c18174506 | DavidAlphaFox/RabbitMQ | rabbit_mgmt_wm_parameter.erl | The contents of this file are subject to the Mozilla Public License
Version 1.1 ( the " License " ) ; you may not use this file except in
%% compliance with the License. You may obtain a copy of the License at
%% /
%%
Software distributed under the License is distributed on an " AS IS "
%% basis, WITH... | null | https://raw.githubusercontent.com/DavidAlphaFox/RabbitMQ/0a64e6f0464a9a4ce85c6baa52fb1c584689f49a/plugins-src/rabbitmq-management/src/rabbit_mgmt_wm_parameter.erl | erlang | compliance with the License. You may obtain a copy of the License at
/
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See the
License for the specific language governing rights and limitations
under the License.
--------------------------------------------------------------------
---... | The contents of this file are subject to the Mozilla Public License
Version 1.1 ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
The Original Code is RabbitMQ Management Plugin .
The Initial Developer of the Original Code... |
63496a7256b7437f35138c0a77ccbec943aa4c291f02c8af6932685dc4c6e76f | CryptoKami/cryptokami-core | Addresses.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeOperators #-}
module Cryptokami.Wallet.API.V1.Handlers.Addresses where
import Universum
import Pos.Crypto (emptyPassphrase)
import qualified Pos.Wallet.Web.Account as V0
import qualified Pos.Wallet.Web.Methods as V0
import Cryptoka... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/wallet-new/server/Cryptokami/Wallet/API/V1/Handlers/Addresses.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE TypeOperators #
| Verifies that an address is base58 decodable. | module Cryptokami.Wallet.API.V1.Handlers.Addresses where
import Universum
import Pos.Crypto (emptyPassphrase)
import qualified Pos.Wallet.Web.Account as V0
import qualified Pos.Wallet.Web.Methods as V0
import Cryptokami.Wallet.API.Request
import Cryptokami.Wallet.API.Response
... |
19de4d317a1133af2ea5f99272fb68414e28375dd75d8d5f59998c450757a76a | noinia/hgeometry | DivideAndConquer.hs | # LANGUAGE ScopedTypeVariables #
--------------------------------------------------------------------------------
-- |
Module : Algorithms . Geometry . ClosestPair . DivideAndConquer
Copyright : ( C )
-- License : see the LICENSE file
Maintainer :
--
Classical \(O(n\log n)\ ) time divi... | null | https://raw.githubusercontent.com/noinia/hgeometry/89cd3d3109ec68f877bf8e34dc34b6df337a4ec1/hgeometry/src/Algorithms/Geometry/ClosestPair/DivideAndConquer.hs | haskell | ------------------------------------------------------------------------------
|
License : see the LICENSE file
closest pair among a set of \(n\) points in \(\mathbb{R}^2\).
------------------------------------------------------------------------------
---------------------------------------------------------... | # LANGUAGE ScopedTypeVariables #
Module : Algorithms . Geometry . ClosestPair . DivideAndConquer
Copyright : ( C )
Maintainer :
Classical \(O(n\log n)\ ) time divide and conquer algorithm to compute the
module Algorithms.Geometry.ClosestPair.DivideAndConquer( closestPair
... |
c5641e7efb52ad008e66c89170a698b2df41ff42833dd8371533d15257603863 | mixphix/toolbox | Toolbox.hs | # LANGUAGE TypeApplications #
-- |
Module : Control . . Toolbox
Copyright : ( c ) 2021
-- License : BSD3 (see the file LICENSE)
-- Maintainer :
--
Utility functions on top of ' Control . Applicative ' and ' Control . ' .
--
This module re - exports the above modules , so modules need onl... | null | https://raw.githubusercontent.com/mixphix/toolbox/4136a8e4e2799679825a05aee49e2f21a4715c26/src/Control/Monad/Toolbox.hs | haskell | |
License : BSD3 (see the file LICENSE)
Maintainer :
* Functorial operators
* Applicative operators
** Lifted eliminators
* Monad operators
** Lifted eliminators
** Looping
* Re-exports
> ifA (Just False) (Just 1) Nothing == Nothing
> ifA (Just True) (Just 1) (Just undefined) == undefined
| A v... | # LANGUAGE TypeApplications #
Module : Control . . Toolbox
Copyright : ( c ) 2021
Utility functions on top of ' Control . Applicative ' and ' Control . ' .
This module re - exports the above modules , so modules need only import ' Control . . Toolbox ' .
module Control.Monad.Toolbox (
(<<$>... |
80c321c979b3a8066b7d06fe4184f74154045223bba2a2199a59385af381d679 | logicmoo/logicmoo_nlu | patrgram.lsp | ;;; % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% Example code from the book " Natural Language Processing in LISP " %
% published by %
% Copyright ( c ) 1989 , . %
;;; % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %... | null | https://raw.githubusercontent.com/logicmoo/logicmoo_nlu/c066897f55b3ff45aa9155ebcf799fda9741bf74/ext/nlp_book/lisp/patrgram.lsp | lisp | % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
patrgram.lsp [Chapter 7] simple PATR grammar
(C cat) = C | % Example code from the book " Natural Language Processing in LISP " %
% published by %
% Copyright ( c ) 1989 , . %
(setq rules
'((Rule (S -> NP VP)
(S cat) = S
(NP cat) = NP
(VP cat) = VP
(S slash) = (VP s... |
ccb059de45eadeecff8b2f5ec0162317a321d3463b66cfbe859d64ef5a033a66 | gelisam/frp-zoo | Main.hs | {-# LANGUAGE Arrows #-}
module
Main
where
import Prelude hiding (id, (.))
import Control.Category
import Control.Arrow
import Control.Monad
import Data.Functor ((<$))
import qualified Control.Arrow.Machine as P
import Graphics.Gloss
import qualified Graphics.Gloss.Interface.IO.Game as G
import Buttons
import Gl... | null | https://raw.githubusercontent.com/gelisam/frp-zoo/1a1704e4294b17a1c6e4b417a73e61216bad2321/machinecell-example/Main.hs | haskell | # LANGUAGE Arrows #
---------------------------
---------------------------
---------------------------
Higher order implementation
---------------------------
Every toggle event causes switch of counters, with every counter is newly created. |
module
Main
where
import Prelude hiding (id, (.))
import Control.Category
import Control.Arrow
import Control.Monad
import Data.Functor ((<$))
import qualified Control.Arrow.Machine as P
import Graphics.Gloss
import qualified Graphics.Gloss.Interface.IO.Game as G
import Buttons
import GlossInterface
mainArrow... |
4c7675329333eba6d1aa920ce6ceedd380caf949ef2d8cf516943aedea0e6368 | gtk2hs/gtk2hs | Binary.hs | # LANGUAGE CPP , ScopedTypeVariables #
--
( c ) The University of Glasgow 2002
--
Binary I / O library , with special tweaks for GHC
--
-- Based on the nhc98 Binary library, which is copyright
( c ) and , University of York , 1998 .
-- Under the terms of the license for that software, we must tell you
-- wher... | null | https://raw.githubusercontent.com/gtk2hs/gtk2hs/ce06bb7f79fc2fe8b259486032e602b1816bebcd/tools/c2hs/base/general/Binary.hs | haskell |
Based on the nhc98 Binary library, which is copyright
Under the terms of the license for that software, we must tell you
where you can obtain the original version of the Binary library, namely
type
class
type
closeBin,
for writing instances:
:: Binary a => FilePath -> IO a
:: Binary a => FilePath -> ModuleN... | # LANGUAGE CPP , ScopedTypeVariables #
( c ) The University of Glasgow 2002
Binary I / O library , with special tweaks for GHC
( c ) and , University of York , 1998 .
/
module Binary
openBinIO, openBinIO_,
openBinMem,
seekBin,
tellBin,
castBin,
writeBinMem,
readBinMem,
isEOF... |
14b600fe9eec451f2347c44ebf479bb853c1bff151970e43265b005fed580b36 | haskell-suite/haskell-src-exts | IndentedWhereBlock.hs | module Graph where
countryLookUp :: String -> Graph -> Maybe Int
countryLookUp country graph = indexOf country graph where
indexOf :: String -> Graph -> Maybe Int
indexOf _ Empty = Nothing
| null | https://raw.githubusercontent.com/haskell-suite/haskell-src-exts/84a4930e0e5c051b7d9efd20ef7c822d5fc1c33b/tests/examples/IndentedWhereBlock.hs | haskell | module Graph where
countryLookUp :: String -> Graph -> Maybe Int
countryLookUp country graph = indexOf country graph where
indexOf :: String -> Graph -> Maybe Int
indexOf _ Empty = Nothing
| |
6c71c5610e704538f3083a43b40637b5748c83366f1a34071ec0b62841d69ee3 | sacerdot/CovidMonitoring | luoghi.erl | -module(luoghi).
-export([start/0, luogo/0, init_luogo/1, visit_place/2]).
-import(utils, [sleep/1, set_subtract/2, make_probability/1, check_service/1]).
%%%%%%%%%%%%%%%%%%%%%%%%%%% PROTOCOLLO DI INIZIALIZZAZIONE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
init_luogo(Prob) ->
PidServer = check_service(server),
... | null | https://raw.githubusercontent.com/sacerdot/CovidMonitoring/fe969cd51869bbe6479da509c9a6ab21d43e6d11/BartoliniFapohundaGuerra/src/luoghi.erl | erlang | PROTOCOLLO DI INIZIALIZZAZIONE %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
PidOldUser can die
% % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % % %
% % % % % % % % % % % % % % % % % % % % % % % % % % % % ... | -module(luoghi).
-export([start/0, luogo/0, init_luogo/1, visit_place/2]).
-import(utils, [sleep/1, set_subtract/2, make_probability/1, check_service/1]).
init_luogo(Prob) ->
PidServer = check_service(server),
PidServer ! {ciao, da, luogo, self()},
link(PidServer),
process_flag(trap_exit, true),
PidServer ! ... |
c1ba1e99c9988211d0131c004729095b3719a7c14eb2ae98ef6a91c902578c89 | luisgabriel/erl-chat-server | chat_server.erl | -module(chat_server).
-export([start/1, pre_loop/1]).
start(Port) ->
controller:start(),
tcp_server:start(?MODULE, Port, {?MODULE, pre_loop}).
pre_loop(Socket) ->
case gen_tcp:recv(Socket, 0) of
{ok, Data} ->
io:format("Data: ~p~n", [binary_to_list(Data)]),
Message = binar... | null | https://raw.githubusercontent.com/luisgabriel/erl-chat-server/fcc972fec727e7a9f1bb9a82a99a34262860f59a/src/chat_server.erl | erlang | -module(chat_server).
-export([start/1, pre_loop/1]).
start(Port) ->
controller:start(),
tcp_server:start(?MODULE, Port, {?MODULE, pre_loop}).
pre_loop(Socket) ->
case gen_tcp:recv(Socket, 0) of
{ok, Data} ->
io:format("Data: ~p~n", [binary_to_list(Data)]),
Message = binar... | |
203c8ba44083a5396f9154b85283b25d03338a4406b2f817d76991633c075b56 | symbiont-io/detsys-testkit | Random.hs | module Lec05.Random where
import Data.IORef
import System.Random (StdGen, setStdGen, getStdGen, mkStdGen, randomR, randomIO)
import qualified System.Random
------------------------------------------------------------------------
data Random = Random
{ rGetStdGen :: IO StdGen
, rSetStdGen :: StdGen -> IO ()
}
... | null | https://raw.githubusercontent.com/symbiont-io/detsys-testkit/96a66b307a2481f85a9c75977b23f35d9b1054db/doc/advanced-testing-mini-course/src/Lec05/Random.hs | haskell | ----------------------------------------------------------------------
#Examples | module Lec05.Random where
import Data.IORef
import System.Random (StdGen, setStdGen, getStdGen, mkStdGen, randomR, randomIO)
import qualified System.Random
data Random = Random
{ rGetStdGen :: IO StdGen
, rSetStdGen :: StdGen -> IO ()
}
newtype Seed = Seed { unSeed :: Int }
realRandom :: IO Random
realRandom... |
548fdd456aeb9f36a766c7d9f73cc734cd5435160cf911c5de626a0672c32fcb | jordwalke/rehp | annot_parser.mli |
(* The type of tokens. *)
type token =
| TWeakdef
| TVersion
| TVNum of (string)
| TSemi
| TRequires
| TProvides
| TOTHER of (string)
| TIdent of (string)
| TComma
| TA_Shallow
| TA_Pure
| TA_Object_literal
| TA_Mutator
| TA_Mutable
| TA_Const
| RPARENT
| LT
| LPARENT
| LE
| G... | null | https://raw.githubusercontent.com/jordwalke/rehp/f122b94f0a3f06410ddba59e3c9c603b33aadabf/compiler/lib/annot_parser.mli | ocaml | The type of tokens.
This exception is raised by the monolithic API functions.
The monolithic API. |
type token =
| TWeakdef
| TVersion
| TVNum of (string)
| TSemi
| TRequires
| TProvides
| TOTHER of (string)
| TIdent of (string)
| TComma
| TA_Shallow
| TA_Pure
| TA_Object_literal
| TA_Mutator
| TA_Mutable
| TA_Const
| RPARENT
| LT
| LPARENT
| LE
| GT
| GE
| EQ
| EOL
... |
b757e0cbb982ff044af2b567ddfaf300b42b5428e1a6bbdccfa2107d7b31dbd7 | frex-project/metaocaml-frex | monoids.mli | module S : Aux.Sig with module Ops := Algebra.Monoid_ops
module Coproduct_monoid (A : S.Algebra) (B : S.Algebra) :
S.COPRODUCT with module A.T = A.T with module B.T = B.T
module Free_monoid (A : Algebra.TYPE) :
Algebra.MONOID with type t = A.t list
module PS_monoid (A : Algebra.MONOID)
(C : Algebra.MONOID wi... | null | https://raw.githubusercontent.com/frex-project/metaocaml-frex/e249551a41bd6a8af1a95d77bf9946822a19e3b0/lib/monoids.mli | ocaml | module S : Aux.Sig with module Ops := Algebra.Monoid_ops
module Coproduct_monoid (A : S.Algebra) (B : S.Algebra) :
S.COPRODUCT with module A.T = A.T with module B.T = B.T
module Free_monoid (A : Algebra.TYPE) :
Algebra.MONOID with type t = A.t list
module PS_monoid (A : Algebra.MONOID)
(C : Algebra.MONOID wi... | |
cc539ae019bed589f1f39e1e56e8ef018683351c86e24e67021271f472503798 | joedevivo/chatterbox | h2_connection.erl | -module(h2_connection).
-include("http2.hrl").
-behaviour(gen_statem).
Start / Stop API
-export([
start_client/2,
start_client/5,
start_client_link/2,
start_client_link/5,
start_ssl_upgrade_link/5,
start_server_link/3,
become/1,
become/2,
... | null | https://raw.githubusercontent.com/joedevivo/chatterbox/c0506c707bd10d2d2071647f53e188b9740041f2/src/h2_connection.erl | erlang | HTTP Operations
gen_statem callbacks
gen_statem states
prim_inet:async_accept is dope. It says just hang out here and
wait for a message that a client has connected. That message
looks like:
No timeout here, it's just a listener
The listen state only exists to wait around for new prim_inet
connections
If anyth... | -module(h2_connection).
-include("http2.hrl").
-behaviour(gen_statem).
Start / Stop API
-export([
start_client/2,
start_client/5,
start_client_link/2,
start_client_link/5,
start_ssl_upgrade_link/5,
start_server_link/3,
become/1,
become/2,
... |
42c34acbc44c2d7434d6dce55aac1fef2de8952e467fd02d2d70a68be7d94040 | geoffder/olm-ml | session.ml | open Core
open Helpers
open Helpers.ResultInfix
module Message : sig
type t = private PreKey of string | Message of string
val ciphertext : t -> string
val is_pre_key : t -> bool
val to_size : t -> Unsigned.size_t
val to_string : t -> string
val create : string -> int -> (t, [> `ValueError of strin... | null | https://raw.githubusercontent.com/geoffder/olm-ml/6ab791c5f4cacb54cf8939d78bd2a6820ec136b3/olm/lib/session.ml | ocaml | max len fun destroys
This lives in Account in the official API example, but that would be a cyclic
* dependency, so I have moved it here. | open Core
open Helpers
open Helpers.ResultInfix
module Message : sig
type t = private PreKey of string | Message of string
val ciphertext : t -> string
val is_pre_key : t -> bool
val to_size : t -> Unsigned.size_t
val to_string : t -> string
val create : string -> int -> (t, [> `ValueError of strin... |
ee0a61f9e8745bde830356fcc4ca43e8ba7e8f6196e575b426afc35bc5687f3f | dedbox/racket-template | lang.rkt | Copyright 2020 < >
;;
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -2.0
;;
;; Unless required by applicable law or agreed to in writing, software
distributed under t... | null | https://raw.githubusercontent.com/dedbox/racket-template/7e8cd438cdc168b74b1a23721d3410be330de209/lang.rkt | racket |
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 per... | Copyright 2020 < >
distributed under the License is distributed on an " AS IS " BASIS ,
#lang racket/base
(require racket/base template)
(provide (except-out (all-from-out racket/base) #%module-begin)
(all-from-out template)
(rename-out [template-module-begin #%module-begin]))
|
d7333f9f247a49b77e40487602e5b5a03cafdf148fcf13537297c7811b4ce3e0 | elastic/eui-cljs | sorting.cljs | (ns eui.services.sorting
(:require ["@elastic/eui/lib/services/breakpoint/_sorting.js" :as eui]))
(def sortMapByLargeToSmallValues eui/sortMapByLargeToSmallValues)
(def sortMapBySmallToLargeValues eui/sortMapBySmallToLargeValues)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/88737a49699cdd2fd578acff3ad32e97b2b2e798/src/eui/services/sorting.cljs | clojure | (ns eui.services.sorting
(:require ["@elastic/eui/lib/services/breakpoint/_sorting.js" :as eui]))
(def sortMapByLargeToSmallValues eui/sortMapByLargeToSmallValues)
(def sortMapBySmallToLargeValues eui/sortMapBySmallToLargeValues)
| |
86034d57115468714181fc455b94eac6caa708473b3b3e2ea6e02bd9d716afb5 | egri-nagy/kigen | T8conjreps.clj | ;; Finding all conjugacy class representative transformations of the full
transformation semigroup Tn .
;; Exploiting the fact that the maximal conjrep is of the form
[ 1 2 3 .. n-1 0 ]
;; (for the cyclic permutation of n points) we enumerate all transformations
;; lexicographically, odometer style.
recreating in... | null | https://raw.githubusercontent.com/egri-nagy/kigen/5248499fab9d8af05d7d0b07626d0676dfe580c9/experiments/DIAGSGPS/T8conjreps.clj | clojure | Finding all conjugacy class representative transformations of the full
Exploiting the fact that the maximal conjrep is of the form
(for the cyclic permutation of n points) we enumerate all transformations
lexicographically, odometer style.
not to forget the maximal conjrep
checking:
should produce
this can be s... | transformation semigroup Tn .
[ 1 2 3 .. n-1 0 ]
recreating integer sequence
(require '[kigen.transf :as t])
m is the maximal available digit , e.g. 1 for binary , 9 for decimal
(defn nxt
"Returns the next vector in lexicographic ordering.
Leftmost is the most significant digit.
Replacing the the first... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.