_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 |
|---|---|---|---|---|---|---|---|---|
85b3ee7ed258ca9d3e0cd5f603983b38730b482a05e350ae6ba271cdcc9149bf | tol/webmine | core.clj | (ns webmine.core
(:require [clj-http.client :as client]))
;; From l.core
(defn maybe-comp [& fs]
(fn [x]
(reduce
#(if (not %1) %1 (%2 %1))
x (reverse fs))))
;; From infer.core
(defn best-by [compare keyfn coll]
(if (empty? coll) nil
(let [best-finder (fn [best next-elem]
(if (compare (... | null | https://raw.githubusercontent.com/tol/webmine/10da731028d7b9b65faf957087b0ec6812f60734/src/webmine/core.clj | clojure | From l.core
From infer.core
From infer.core
From infer.core
From l.fetcher
From l.core | (ns webmine.core
(:require [clj-http.client :as client]))
(defn maybe-comp [& fs]
(fn [x]
(reduce
#(if (not %1) %1 (%2 %1))
x (reverse fs))))
(defn best-by [compare keyfn coll]
(if (empty? coll) nil
(let [best-finder (fn [best next-elem]
(if (compare (keyfn best) (keyfn next-elem))
... |
5b04ad7a4b692fc7f89ecdedcad14d872c2e9a50243d195f18d1c74db654b9b6 | marcoheisig/sb-simd | packages.lisp | (cl:in-package #:common-lisp-user)
(defpackage #:sb-simd-test-suite
(:use #:common-lisp #:sb-simd-internals)
(:export
#:run-test-suite
#:define-test
#:is
#:signals
#:all-tests
#:check-package
#:run-tests
#:define-simple-simd-test
#:define-horizontal-test
#:define-aref-test))
| null | https://raw.githubusercontent.com/marcoheisig/sb-simd/6ce4f5aefa7be61f3575e7938c2a9ffae3b272ea/test-suite/packages.lisp | lisp | (cl:in-package #:common-lisp-user)
(defpackage #:sb-simd-test-suite
(:use #:common-lisp #:sb-simd-internals)
(:export
#:run-test-suite
#:define-test
#:is
#:signals
#:all-tests
#:check-package
#:run-tests
#:define-simple-simd-test
#:define-horizontal-test
#:define-aref-test))
| |
897c0941b07de8c67953e06b3008d8a93cac6d08e11a1cdde16086264ef3df5b | Th30n/cl-shake | gl.lisp | Copyright ( C ) 2016
;;;;
;;;; This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 of the License , or
;;;; (at your option) any later version.
;;;;
;;;; This program is distribu... | null | https://raw.githubusercontent.com/Th30n/cl-shake/03753dabe4a8dd3005cfb218eacf251f50073103/shake-gl/gl.lisp | lisp |
This program is free software; you can redistribute it and/or modify
either version 2 of the License , or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR... | Copyright ( C ) 2016
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License along
51 Franklin Street , Fifth Floor , Boston , USA .
(in-package #:shake-gl)
(eval-when (:compile-toplevel :load-toplevel :execute)
(defun fore... |
5badfde47db9b8b326e8a1f60b553f71b51392b993d629ac90781f9ff2139546 | spurious/sagittarius-scheme-mirror | r7rs.scm | -*- mode : scheme ; coding : utf-8 ; -*-
compat.scm : provides R7RS compatible procedures and macros
#!core
;; for unbound variable warning
(library (compat r7rs helper)
(export syntax-rules-transformer
;; we need to export them so that (compat r7rs) sees it.
NB : the rename is given from ( compat r7r... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/lib/compat/r7rs.scm | scheme | coding : utf-8 ; -*-
for unbound variable warning
we need to export them so that (compat r7rs) sees it.
identifiers belong to the library. if these are not
exported, then it raises unbound variable.
on chibi-scheme, identifier is either symbol or syntax
object. so we need to provide this.
syntax-rules d... | compat.scm : provides R7RS compatible procedures and macros
#!core
(library (compat r7rs helper)
(export syntax-rules-transformer
NB : the rename is given from ( compat r7rs ) and renamed
length* cons-source error check-length
format strip-syntactic-closures er-macro-transformer)
(import (renam... |
8bf1269058a862e5e781d060d5f4516994b3d4420ccdcdc10db1583ae524b46c | jrclogic/SMCDEL | DEMO_S5.hs | Note : This is a modified version of DEMO - S5 by .
For the original , see
module SMCDEL.Explicit.DEMO_S5 where
import Control.Arrow (first,second)
import Data.List (sortBy)
import SMCDEL.Internal.Help (apply,restrict,Erel,bl)
newtype Agent = Ag Int deriving (Eq,Ord,Show)
data DemoPrp = DemoP Int | DemoQ In... | null | https://raw.githubusercontent.com/jrclogic/SMCDEL/10bd5ba2f1f3cc85e4b0f23d5eddbb26f05df5bf/src/SMCDEL/Explicit/DEMO_S5.hs | haskell | | semantics: truth at a world in a model
| global truth in a model
| public announcement
| public announcement-whether
| safe substitutions
| public factual change | Note : This is a modified version of DEMO - S5 by .
For the original , see
module SMCDEL.Explicit.DEMO_S5 where
import Control.Arrow (first,second)
import Data.List (sortBy)
import SMCDEL.Internal.Help (apply,restrict,Erel,bl)
newtype Agent = Ag Int deriving (Eq,Ord,Show)
data DemoPrp = DemoP Int | DemoQ In... |
d9e616878112478d4aba83ec75eb618d492f7b3351e9bfdd02c87cd381ac382d | RefactoringTools/HaRe | SubPatternIn3_TokOut.hs | module SubPatternIn3 where
-- takes into account general type variables
-- within type implementation.
-- here T has its arguments instantiated within g
-- selecting 'b' should instantiate list patterns
-- selecting 'c' should give an error.
--
data T a b = C1 a b | C2 b
g :: Int -> T Int [Int] -> Int
g z (C1 b c) ... | null | https://raw.githubusercontent.com/RefactoringTools/HaRe/ef5dee64c38fb104e6e5676095946279fbce381c/old/testing/subIntroPattern/SubPatternIn3_TokOut.hs | haskell | takes into account general type variables
within type implementation.
here T has its arguments instantiated within g
selecting 'b' should instantiate list patterns
selecting 'c' should give an error.
| module SubPatternIn3 where
data T a b = C1 a b | C2 b
g :: Int -> T Int [Int] -> Int
g z (C1 b c) = b
g z (C2 x@[]) = hd x
g z (C2 x@(b_1 : b_2)) = hd x
g z (C2 x) = hd x
f :: [Int] -> Int
f x@[] = hd x + hd (tl x)
f x@(y:ys) = hd x + hd (tl x)
hd x = head x
tl x = tail x
|
f1f269f9eeefe27dc0fe45eb164dc0282a900169e3cbc0c4e380f36bdcd3ae40 | dvanhorn/oaam | 0cfa-prealloc.rkt | #lang racket
(provide aval^ widen)
(require "ast.rkt"
(except-in "data.rkt" get-cont)
"progs.rkt"
(for-syntax syntax/parse))
(define-syntax-rule (for/union guards body1 body ...)
(for/fold ([res (set)]) guards (set-union res (let () body1 body ...))))
(define-syntax-rule (for*/union guards... | null | https://raw.githubusercontent.com/dvanhorn/oaam/79bc68ecb79fef45474a948deec1de90d255f307/code/iswim/0cfa-prealloc.rkt | racket | + compilation phase
+ lazy non-determinism
+ specialized step & iterator
State^ = (cons (Set Conf) Store)
Global store
"Compiled" Machine
Compile away interpretive overhead of "ev" states
Expr -> Comp
State -> State^
Anything else is stuck
Anything else is stuck
ignore preprocessing
empty-environment-> ... | #lang racket
(provide aval^ widen)
(require "ast.rkt"
(except-in "data.rkt" get-cont)
"progs.rkt"
(for-syntax syntax/parse))
(define-syntax-rule (for/union guards body1 body ...)
(for/fold ([res (set)]) guards (set-union res (let () body1 body ...))))
(define-syntax-rule (for*/union guards... |
8e7a44c1ba55ba1ff22ffc60bfe7a073233a9561f6eb092df07da8d2b0ffd3b3 | xapi-project/xenopsd | device.mli |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | null | https://raw.githubusercontent.com/xapi-project/xenopsd/f4da21a4ead7c6a7082af5ec32f778faf368cf1c/xc/device.mli | ocaml | * the fallback profile in case an invalid profile string is provided to
[of_string]
* all available profiles
* Valid names for a profile, used to define valid values for
VM.platform.device-model
* [of_string profile_name] returns the profile of a profile name, and
[fallback] if an invalid name is p... |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... |
bfbc2026ea08e8d9b457bd68f3933de0bbdcd11edb205fde80b53a5238390748 | thheller/shadow-experiments | forms.cljs | (ns shadow.experiments.grove.ui.forms
(:require [shadow.experiments.grove.protocols :as gp]
[shadow.experiments.arborist.protocols :as ap]
[shadow.experiments.grove.components :as comp]))
(deftype FormInstance
[component-handle config ^:mutable state]
gp/IHook
(hook-init! [this]
(js... | null | https://raw.githubusercontent.com/thheller/shadow-experiments/e4822b8c8fb411b21dcefa39053bd05f60e441d6/src/main/shadow/experiments/grove/ui/forms.cljs | clojure | FIXME: return something thats easier to work with and as much data as possible
maybe pure data with meta reference to this, fields need this
dunno if we actually need to keep a reference
should return config, so it doesn't need a separate method
FIXME: should validation be done by the form or the field?
eager-sub... | (ns shadow.experiments.grove.ui.forms
(:require [shadow.experiments.grove.protocols :as gp]
[shadow.experiments.arborist.protocols :as ap]
[shadow.experiments.grove.components :as comp]))
(deftype FormInstance
[component-handle config ^:mutable state]
gp/IHook
(hook-init! [this]
(js... |
9fb6d80a5a68546ee9ef3e396eba573d891b80affa1c7822a2cf8966a99142ce | xapi-project/xen-api | main.ml | module Xfm = Xenctrlext.Xenforeignmemory
let usage_msg = "foreign-mapper <domid>"
let domid = ref None
let anon_fun param =
match !domid with None -> domid := Some (int_of_string param) | _ -> ()
let defer f = Fun.protect ~finally:f
let () =
Arg.parse [] anon_fun usage_msg ;
let the_domid = Option.get !domid... | null | https://raw.githubusercontent.com/xapi-project/xen-api/15812455c47dd62597d6d4312cdb06fb79bdf844/ocaml/xenforeign/main.ml | ocaml | module Xfm = Xenctrlext.Xenforeignmemory
let usage_msg = "foreign-mapper <domid>"
let domid = ref None
let anon_fun param =
match !domid with None -> domid := Some (int_of_string param) | _ -> ()
let defer f = Fun.protect ~finally:f
let () =
Arg.parse [] anon_fun usage_msg ;
let the_domid = Option.get !domid... | |
1ba35774fab28350afd0a31d3603093ef209e6f23cc9a7ed271e979ac165b2c8 | ygmpkk/house | Pen.hs | module Graphics.HGL.Win32.Pen
( Style(..)
, Pen
, createPen, deletePen, selectPen
) where
import Graphics.HGL.Win32.Types
import qualified System.Win32 as Win32
----------------------------------------------------------------
newtype Pen = Pen Win32.HPEN
data Style
= Solid
| Dash -- "-------"
| Dot -... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/libraries/HGL/Graphics/HGL/Win32/Pen.hs | haskell | --------------------------------------------------------------
"-------"
"......."
"_._._._"
"_.._.._"
--------------------------------------------------------------
--------------------------------------------------------------
The end
-------------------------------------------------------------- | module Graphics.HGL.Win32.Pen
( Style(..)
, Pen
, createPen, deletePen, selectPen
) where
import Graphics.HGL.Win32.Types
import qualified System.Win32 as Win32
newtype Pen = Pen Win32.HPEN
data Style
= Solid
| Null
| InsideFrame
createPen :: Style -> Int -> RGB -> IO Pen
deletePen :: Pen -> IO ()
select... |
6cb0d85e893e20b1652b30b935840ba78b325790b30bcc1e5d527b65e2b8fa54 | rootmos/loom | bridge_sup.erl | -module(bridge_sup).
-behaviour(gen_server).
-export([start_link/1]).
-export([init/1, handle_call/3, handle_cast/2]).
start_link(Args) ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [Args], []).
init(Port) ->
Pid = ar_bridge:start([], [loom:node()], Port),
ar_node:add_peers(loom:node(), Pid),
e... | null | https://raw.githubusercontent.com/rootmos/loom/5f68ef9a9a5350f14d70935bacec3287aca60f1f/apps/loom/src/bridge_sup.erl | erlang | -module(bridge_sup).
-behaviour(gen_server).
-export([start_link/1]).
-export([init/1, handle_call/3, handle_cast/2]).
start_link(Args) ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [Args], []).
init(Port) ->
Pid = ar_bridge:start([], [loom:node()], Port),
ar_node:add_peers(loom:node(), Pid),
e... | |
1a5bd9b7fe81becc34559ce6a30e45bdcd043affa26bc36898db2587702d126a | alesaccoia/festival_flinger | toksearch.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;
Centre for Speech Technology Research ; ;
University of Edinburgh , UK ; ;
;;; ... | null | https://raw.githubusercontent.com/alesaccoia/festival_flinger/87345aad3a3230751a8ff479f74ba1676217accd/examples/toksearch.scm | scheme |
;;
;
;
Copyright (c) 1996,1997 ;;
;
;;
Permission is hereby granted, free of charge, to use and distribute ;;
this softwar... |
(set! text_dir "/home/awb/data/text/")
the files in that databases . e.g. This expects / gutenberg.files
(set! db_names
books from gutenberg 21906570
books , documents etc 23090463
Time Magazine 1990 - 1994 6770175
Standard Reference libraries 3330448
WS... |
88068c6588bcd139e8872377ea6db9ca5c279067f316b384a69b52a08bf60340 | tweag/ormolu | lenses-out.hs | lenses =
Just $
M.fromList $
"type" .= ("user.connection" :: Text)
# "connection" .= uc
# "user" .= case name of
Just n -> Just $ object ["name" .= n]
Nothing -> Nothing
# []
foo =
a
& b .~ 2
& c .~ 3
wreq =
let opts =
defaults
& au... | null | https://raw.githubusercontent.com/tweag/ormolu/1f63136d047205f95b7d3c0f6aa34c34bb29ac7f/data/examples/declaration/value/function/infix/lenses-out.hs | haskell | lenses =
Just $
M.fromList $
"type" .= ("user.connection" :: Text)
# "connection" .= uc
# "user" .= case name of
Just n -> Just $ object ["name" .= n]
Nothing -> Nothing
# []
foo =
a
& b .~ 2
& c .~ 3
wreq =
let opts =
defaults
& au... | |
1408726426cd91176bb79bbe720e70cb37aa118808e0f6b3e72a120842fb9035 | Armael/ocaml-xkbcommon | xkbcommon.ml | type keysym = int
type keycode = int
module Keysyms = Keysyms
module Context = Context
module Rule_names = Rule_names
module Keymap = Keymap
module State = State
| null | https://raw.githubusercontent.com/Armael/ocaml-xkbcommon/af0cd8c938938db3e67b65ac13b6444102756ba0/lib/xkbcommon.ml | ocaml | type keysym = int
type keycode = int
module Keysyms = Keysyms
module Context = Context
module Rule_names = Rule_names
module Keymap = Keymap
module State = State
| |
696a4d4427f07f0a958a945d6f9f9d5606428e04c1a5aa35becb0c4f6eb857df | jafingerhut/thalia | core.match-0.2.0-project.clj | (defproject clojure.core.match "0.2.0"
:description "core.match 0.2.0"
:eval-in :leiningen
:source-paths [ "src/main/clojure" ]
: dependencies [ [ org.clojure/core.logic " 0.6.5 " ] ]
)
| null | https://raw.githubusercontent.com/jafingerhut/thalia/20c98eec8168ff72c5b3965cc048b817d34a4583/scripts/core.match-0.2.0-project.clj | clojure | (defproject clojure.core.match "0.2.0"
:description "core.match 0.2.0"
:eval-in :leiningen
:source-paths [ "src/main/clojure" ]
: dependencies [ [ org.clojure/core.logic " 0.6.5 " ] ]
)
| |
58bdfe731d827ea11b545af4d7f7f4685f7fe3c83c0af5677b4b4e7d6f2d530f | curaai/H-R-Tracing | Sphere.hs | module Hittable.Sphere
( Sphere(Sphere)
) where
import Data.Bool (bool)
import Data.Maybe (fromJust, isNothing)
import Hit (HitRange, HitRecord (HitRecord), Material)
import Hittable.Hittable (Hittable (..), isInRange)
import Ray ... | null | https://raw.githubusercontent.com/curaai/H-R-Tracing/ad4867763083994c0d482a3e73e5b3de97e20d5c/src/Hittable/Sphere.hs | haskell | module Hittable.Sphere
( Sphere(Sphere)
) where
import Data.Bool (bool)
import Data.Maybe (fromJust, isNothing)
import Hit (HitRange, HitRecord (HitRecord), Material)
import Hittable.Hittable (Hittable (..), isInRange)
import Ray ... | |
b7e3492e3e7bc12d1155f0027852d697dc209777c370b64171c614ee89aa8fa1 | shirok/Gauche | test.scm | ;;;
;;; gauche.test - test framework
;;;
Copyright ( c ) 2000 - 2022 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; 1. Redistributions of source code must retain the above copyr... | null | https://raw.githubusercontent.com/shirok/Gauche/e97efb5e54f9ab97746369b8ac748f338224c746/lib/gauche/test.scm | scheme |
gauche.test - test framework
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaime... | Copyright ( c ) 2000 - 2022 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
#!no-fold-case
( test - section " featu... |
3b003f82e0eb95cd975dd0cd382292e71cb4c41df81b7630259d3abe37fe88e0 | Liutos/Project-Euler | pro52.lisp | ;;; This is really a ugly program
(defun digit-chars (number)
(if (< number 10)
(list number)
(cons (rem number 10)
(digit-chars (/ (- number (rem number 10)) 10)))))
(defun same-elts (lst1 lst2)
(and (every (lambda (elt)
(member elt lst2 :test #'=))
lst1)
(every (lambda (elt)
(m... | null | https://raw.githubusercontent.com/Liutos/Project-Euler/dd59940099ae37f971df1d74c4b7c78131fd5470/pro52.lisp | lisp | This is really a ugly program | (defun digit-chars (number)
(if (< number 10)
(list number)
(cons (rem number 10)
(digit-chars (/ (- number (rem number 10)) 10)))))
(defun same-elts (lst1 lst2)
(and (every (lambda (elt)
(member elt lst2 :test #'=))
lst1)
(every (lambda (elt)
(member elt lst1 :test #'=))
... |
469049730f15de830231d3e743bdf3b29ba4343e68c0216828d39c7d3b1dca78 | boxuk/trello | util.clj |
(ns trello.test.util
(:use trello.util
midje.sweet))
(facts "about normalising requests"
(normalize-http-request "foo/bar") => "foo/bar"
(normalize-http-request "/foo/bar") => "foo/bar")
| null | https://raw.githubusercontent.com/boxuk/trello/9d9ea29568374d8e026081a0849bfab96ed2001e/test/trello/test/util.clj | clojure |
(ns trello.test.util
(:use trello.util
midje.sweet))
(facts "about normalising requests"
(normalize-http-request "foo/bar") => "foo/bar"
(normalize-http-request "/foo/bar") => "foo/bar")
| |
27d84aad72812db92208a7429c41eb66b438799c03fdb8196f1d3151b04f4648 | csabahruska/jhc-grin | Level.hs | # LANGUAGE TypeOperators , , DeriveFunctor , DeriveTraversable #
module Ty.Level where
import Util.Std
newtype TyLevel = TyLevel Int
deriving(Eq,Ord,Enum)
-- inhabits constructor
level(y ) = level(x ) + 1
data x ::: y = x ::: y
deriving(Eq,Ord,Functor,Traversable,Foldable,Show)
instance Show TyLevel wher... | null | https://raw.githubusercontent.com/csabahruska/jhc-grin/30210f659167e357c1ccc52284cf719cfa90d306/src/Ty/Level.hs | haskell | inhabits constructor
tyLevelOf is possibly not total
term itself may not carry a level with it. | # LANGUAGE TypeOperators , , DeriveFunctor , DeriveTraversable #
module Ty.Level where
import Util.Std
newtype TyLevel = TyLevel Int
deriving(Eq,Ord,Enum)
level(y ) = level(x ) + 1
data x ::: y = x ::: y
deriving(Eq,Ord,Functor,Traversable,Foldable,Show)
instance Show TyLevel where
showsPrec _ (TyLev... |
b484c9d6ee89e5ab4fafae00aa6fde5002d1bb88319b661db8a1cac3f243d3a4 | zwizwa/staapl | parse.rkt | #lang racket/base
(require
"../ns.rkt"
(for-syntax
racket/base
racket/pretty
"../ns-tx.rkt"
"parse-tx.rkt"))
(provide (all-defined-out))
An RPN transformer is a primitive taking arguments
;; W : code stack
;; D : dictionary (parser output)
;; K : parser continuation
RPN PARSER
;; (rpn-parse ... | null | https://raw.githubusercontent.com/zwizwa/staapl/e30e6ae6ac45de7141b97ad3cebf9b5a51bcda52/rpn/parse.rkt | racket | W : code stack
D : dictionary (parser output)
K : parser continuation
(rpn-parse (mk semantics ...) code ...)
The rpn syntax is currently implemented as a single transformer to
be able to get at the provided semantics macros through lexical
scope. (Previous implementation used compile-time paramters, whic... | #lang racket/base
(require
"../ns.rkt"
(for-syntax
racket/base
racket/pretty
"../ns-tx.rkt"
"parse-tx.rkt"))
(provide (all-defined-out))
An RPN transformer is a primitive taking arguments
RPN PARSER
* semantics for built - in in RPN language constructs .
(define-syntax (rpn-parse stx)
(... |
fb19271aa2b6dcd0dba1e0c1a0b5d67546617f4ea959ff5177d4358d8b40a160 | psilord/option-9 | perform-collide.lisp | (in-package :option-9)
#+option-9-debug (declaim (optimize (safety 3) (space 0) (speed 0) (debug 3)))
;; Primary method is both entities damage each other and one, both, or
;; neither may die.
(defmethod perform-collide ((collider collidable) (collidee collidable))
(damage collider collidee))
(defmethod perform-co... | null | https://raw.githubusercontent.com/psilord/option-9/44d96cbc5543ee2acbdcf45d300207ef175462bc/perform-collide.lisp | lisp | Primary method is both entities damage each other and one, both, or
neither may die.
an :append method for each class in the hierarchy to rebuild
the initialization list using the current values in the object.
This should assure I get a deep copy.
I should have a powerup such that the
charge of a shot can propog... | (in-package :option-9)
#+option-9-debug (declaim (optimize (safety 3) (space 0) (speed 0) (debug 3)))
(defmethod perform-collide ((collider collidable) (collidee collidable))
(damage collider collidee))
(defmethod perform-collide :after ((collider shot) (collidee collidable))
Depending on the charge shoot 1 - 5 ... |
0ea8f7d4ca3f11fbc9dc2cb3b0875d3ce99894bd357efb2a6b0e4424a04eae93 | racket/gui | collapsed-snipclass-helpers.rkt | #lang racket/base
(require racket/gui/base
racket/class)
(provide make-sexp-snipclass%)
(define (make-sexp-snipclass% sexp-snip%)
(class snip-class%
(define/override (read in)
(define left-bracket (integer->char (bytes-ref (send in get-bytes) 0)))
(define right-bracket (integer->char (bytes... | null | https://raw.githubusercontent.com/racket/gui/d1fef7a43a482c0fdd5672be9a6e713f16d8be5c/gui-lib/framework/private/collapsed-snipclass-helpers.rkt | racket | #lang racket/base
(require racket/gui/base
racket/class)
(provide make-sexp-snipclass%)
(define (make-sexp-snipclass% sexp-snip%)
(class snip-class%
(define/override (read in)
(define left-bracket (integer->char (bytes-ref (send in get-bytes) 0)))
(define right-bracket (integer->char (bytes... | |
52129914e6e07ec3fcbbd5700cf4936d9f5dcf84b551bf283c864f26a6050d0e | ocaml/ocaml | lambda.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml/ocaml/ce1a0a50266a9a0dc770967e12e076db055395c1/lambda/lambda.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Misc
open Asttypes
type compile_time_constant =
| Big_endian
| Word_size
| Int_size
| Max_w... |
3204704026a90a7ac1cab911fa1323f5ce08e6e2eda912b381efbcf8ccb5d925 | hedgehogqa/haskell-hedgehog-classes | Spec.hs | module Main (main) where
import Hedgehog.Classes
import Spec.Alternative
import Spec.Applicative
import Spec.Arrow
import Spec.Bifoldable
import Spec.Bifunctor
import Spec.Binary
import Spec.Bitraversable
import Spec.Bits
import Spec.Category
import Spec.Comonad
import Spec.Contravariant
import Spec.Enum
import Spec.... | null | https://raw.githubusercontent.com/hedgehogqa/haskell-hedgehog-classes/4d97b000e915de8ba590818f551bce7bd862e7d4/test/Spec.hs | haskell | ++ testIx | module Main (main) where
import Hedgehog.Classes
import Spec.Alternative
import Spec.Applicative
import Spec.Arrow
import Spec.Bifoldable
import Spec.Bifunctor
import Spec.Binary
import Spec.Bitraversable
import Spec.Bits
import Spec.Category
import Spec.Comonad
import Spec.Contravariant
import Spec.Enum
import Spec.... |
0eec9098fd7ebd5c09a4c404f9658d708682f3b5756113d5173f6e6c49d71a2a | fosskers/kanji | Kanji.hs | # LANGUAGE TupleSections #
-- |
-- Module : Data.Kanji
Copyright : ( c ) , 2015 - 2020
-- License : GPL3
Maintainer : < >
--
-- A library for analysing the density of Kanji in given texts,
-- according to their "Level" classification, as defined by the
Japan Kanji Aptitude Testing Foundation ( 日本漢字能力検定... | null | https://raw.githubusercontent.com/fosskers/kanji/93dd7d16d1a3690db36ca0ffbeb21e05083c42ea/lib/Data/Kanji.hs | haskell | |
Module : Data.Kanji
License : GPL3
A library for analysing the density of Kanji in given texts,
according to their "Level" classification, as defined by the
* Kanji
* Character Categories
* Levels
* Analysis
** Densities
-
| Percentage of appearance of each `CharCat` in the source text.
> elementar... | # LANGUAGE TupleSections #
Copyright : ( c ) , 2015 - 2020
Maintainer : < >
Japan Kanji Aptitude Testing Foundation ( 日本漢字能力検定協会 ) .
module Data.Kanji
(
Kanji
, kanji, _kanji
, allKanji
, isKanji, isHiragana, isKatakana
, CharCat(..)
, category
, Level(..)
, level
, percentSpread
, ... |
2ed73413fc20dc46101790bcd6b49ba143b7f1481711cb10e4a677ba34149f8a | wireapp/wire-server | Component.hs | -- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License... | null | https://raw.githubusercontent.com/wireapp/wire-server/d377ffd87066ed286e9cc19ec223190a1c8fd32b/libs/wire-api-federation/src/Wire/API/Federation/Component.hs | haskell | This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTI... | Copyright ( C ) 2022 Wire Swiss GmbH < >
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option ) any
You should have received a copy of the GNU Affero General Public License along
module Wire.API.Federation.Compo... |
9ffd22f54d9b58d4d239715db0d8c70ef1e838e68a03ea2a6185934da78e3b4e | acieroid/scala-am | stspaceCODE.scm | (define false #f)
(define true #t)
(define (create-stack eq-fnct)
(let ((content '()))
(define (empty?)
(null? content))
(define (push element)
(set! content (cons element content))
#t)
(define (pop)
(if (null? content)
#f
(let ((temp (car content)))
... | null | https://raw.githubusercontent.com/acieroid/scala-am/13ef3befbfc664b77f31f56847c30d60f4ee7dfe/test/R5RS/ad/stspaceCODE.scm | scheme | (define false #f)
(define true #t)
(define (create-stack eq-fnct)
(let ((content '()))
(define (empty?)
(null? content))
(define (push element)
(set! content (cons element content))
#t)
(define (pop)
(if (null? content)
#f
(let ((temp (car content)))
... | |
cfdf5daed81afbaf75689deb267b22a7cc54c269cefdb72c45f90474261a6c55 | maacl/websocket-test | form_helpers.clj | Copyright ( c ) . All rights reserved .
The use and distribution terms for this software are covered by the Eclipse
;; Public License 1.0 (-1.0.php) which
;; can be found in the file epl-v10.html at the root of this distribution. By
;; using this software in any fashion, you are agreeing to be bound by the
;; ter... | null | https://raw.githubusercontent.com/maacl/websocket-test/d79dfdf82762d566cd89b535c3dbede2788bb034/src/compojure/html/form_helpers.clj | clojure | Public License 1.0 (-1.0.php) which
can be found in the file epl-v10.html at the root of this distribution. By
using this software in any fashion, you are agreeing to be bound by the
terms of this license. You must not remove this notice, or any other, from
this software.
Global parameters for easy default values... | Copyright ( c ) . All rights reserved .
The use and distribution terms for this software are covered by the Eclipse
(ns compojure.html.form-helpers
"Functions for generating HTML forms and input fields."
(:use compojure.html.gen
compojure.control
compojure.str-utils
clojure.contrib.de... |
be76ca45a817a8464efb24e1a79dc0f79fb47ad96e4664e75497937078046f8d | qnikst/irc-simple | Parser.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
module Test.Protocol.Parser
( tests
) where
import Control.Lens
import Control.Applicative
import Data.Attoparsec.Text
import Data.Coerce
import Data.Monoid
import Data.String
import Protocol.Wire (message, toWire)... | null | https://raw.githubusercontent.com/qnikst/irc-simple/6deaec9c240b0e9023257b96e0328e883e0760a8/tests/Test/Protocol/Parser.hs | haskell | # LANGUAGE OverloadedStrings #
, testGroup "properties" testProp
, (":WiZ! NICK Kilroy",
mkTextCommand "JOIN" & prefix .~ (Just ":WiZ!") | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Test.Protocol.Parser
( tests
) where
import Control.Lens
import Control.Applicative
import Data.Attoparsec.Text
import Data.Coerce
import Data.Monoid
import Data.String
import Protocol.Wire (message, toWire)
import Protocol.Types
import quali... |
224ad9f75dca5fd4902c40947848ebf47d1f17b8e4c0cdc980812d952c676ca5 | derekslager/advent-of-code-2015 | day15.clj | (ns advent-of-code-2015.day15
(:require [clojure.java.io :as io]
[clojure.math.combinatorics :refer [selections]]))
(defn parse-input [resource]
(into [] (for [[_ ingredient props] (re-seq #"(\w+): (.*)" resource)]
[ingredient (into {} (for [[_ k v] (re-seq #"(\w+) (-?\d+)" props)]
... | null | https://raw.githubusercontent.com/derekslager/advent-of-code-2015/bbc589d29613c594178d9305741096f3688b05f2/src/advent_of_code_2015/day15.clj | clojure | (ns advent-of-code-2015.day15
(:require [clojure.java.io :as io]
[clojure.math.combinatorics :refer [selections]]))
(defn parse-input [resource]
(into [] (for [[_ ingredient props] (re-seq #"(\w+): (.*)" resource)]
[ingredient (into {} (for [[_ k v] (re-seq #"(\w+) (-?\d+)" props)]
... | |
8dd2e440a4d051bd9062b918576b830834b19bda0ec5bde1ad7bb0fc762495a7 | mikera/clojure-utils | vectors.clj | (ns mikera.cljutils.vectors
"Utility functions for working with Clojure persistent vectors"
(:use mikera.cljutils.error)
(:import [clojure.lang IPersistentVector]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(defn find-identical-position
"Searches a vector for an identical item an... | null | https://raw.githubusercontent.com/mikera/clojure-utils/92f7fd7a40c9cf22ab7004a304303e45ea4d4284/src/main/clojure/mikera/cljutils/vectors.clj | clojure | (ns mikera.cljutils.vectors
"Utility functions for working with Clojure persistent vectors"
(:use mikera.cljutils.error)
(:import [clojure.lang IPersistentVector]))
(set! *warn-on-reflection* true)
(set! *unchecked-math* :warn-on-boxed)
(defn find-identical-position
"Searches a vector for an identical item an... | |
421fe5e0ab3e62c114b9b63d2ac75b5c19702a8a71d9181e900d37620dc7e77b | hackwaly/ocamlearlybird | value_module.ml | *
* Copyright ( C ) 2021
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 of the
* License , or ( at your option ) any later version .
*
* Th... | null | https://raw.githubusercontent.com/hackwaly/ocamlearlybird/165174e3cc749ba416ec7ebfb4b521e5fac744db/src/debugger/inspect/value_module.ml | ocaml | *
* Copyright ( C ) 2021
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 of the
* License , or ( at your option ) any later version .
*
* Th... | |
9e016098e101e37ebfa3ccb7a0af1ea21bfd1983d7e9bd3d3adad6208d7ba38d | stedolan/malfunction | malfunction_compiler.ml | open Lambda
open Asttypes
open Malfunction
open Malfunction_parser
open Malfunction_compat
List.map , but guarantees left - to - right evaluation
let rec lrmap f = function
| [] -> []
| (x :: xs) -> let r = f x in r :: lrmap f xs
let lprim p args = Lprim (p, args, loc_none)
let lbind n exp body =
let id = fresh ... | null | https://raw.githubusercontent.com/stedolan/malfunction/69ec0755d540e0b44c40475d96b57ac27aaa19d0/src/malfunction_compiler.ml | ocaml | must be functions
Convert a list of possibly-overlapping intervals to a list of disjoint intervals
lower numbers more important
start position, end position, priority
sorted by start position then priority
the inactive list is a list of (endpoint, priority) pairs representing
intervals that we are curre... | open Lambda
open Asttypes
open Malfunction
open Malfunction_parser
open Malfunction_compat
List.map , but guarantees left - to - right evaluation
let rec lrmap f = function
| [] -> []
| (x :: xs) -> let r = f x in r :: lrmap f xs
let lprim p args = Lprim (p, args, loc_none)
let lbind n exp body =
let id = fresh ... |
de2cda38427421921c26ffec278825883b2e4999b5b89edfad16a5572d1748d7 | upenn-cis1xx/camelot | lexical.ml | open Canonical
open Check
* --------- Checks rules : lines that exceed 80 characters in a given file ------------
module LineLength : LEXICALCHECK = struct
type ctxt = Pctxt.file Pctxt.pctxt
let fix = "indenting to avoid exceeding the line limit"
let violation = "exceeding the 80 character line limit. Only s... | null | https://raw.githubusercontent.com/upenn-cis1xx/camelot/2d7e8db8abb8c1ad8187bfeb94499fe1746bb664/lib/style/lexical.ml | ocaml | open Canonical
open Check
* --------- Checks rules : lines that exceed 80 characters in a given file ------------
module LineLength : LEXICALCHECK = struct
type ctxt = Pctxt.file Pctxt.pctxt
let fix = "indenting to avoid exceeding the line limit"
let violation = "exceeding the 80 character line limit. Only s... | |
291e0f5c4c6bb6c1df37c8bb7650317a935015fae4edff6134f68bb019712375 | TheLortex/mirage-monorepo | migrate_408_407.ml | module From = Ast_408
module To = Ast_407
let migration_error loc missing_feature =
Location.raise_errorf ~loc
"migration error: %s is not supported before OCaml 4.08" missing_feature
let rec copy_toplevel_phrase :
From.Parsetree.toplevel_phrase -> To.Parsetree.toplevel_phrase = function
| From.Parsetree.... | null | https://raw.githubusercontent.com/TheLortex/mirage-monorepo/b557005dfe5a51fc50f0597d82c450291cfe8a2a/duniverse/ppxlib/astlib/migrate_408_407.ml | ocaml | and copy_type_exception :
From.Parsetree.type_exception -> To.Parsetree.type_exception =
fun
{ From.Parsetree.ptyexn_constructor = ptyexn_constructor;
From.Parsetree.ptyexn_loc = ptyexn_loc;
From.Parsetree.ptyexn_attributes = ptyexn_attributes }
->
{
To.Parsetree.ptyexn_const... | module From = Ast_408
module To = Ast_407
let migration_error loc missing_feature =
Location.raise_errorf ~loc
"migration error: %s is not supported before OCaml 4.08" missing_feature
let rec copy_toplevel_phrase :
From.Parsetree.toplevel_phrase -> To.Parsetree.toplevel_phrase = function
| From.Parsetree.... |
e29ac1ec0b0796208066c742e7d18e8e982b886cfb7862e4883fc61648187882 | AbstractMachinesLab/caramel | browse_misc.ml | { { { COPYING * (
This file is part of Merlin , an helper for ocaml editors
Copyright ( C ) 2013 - 2015 < frederic.bour(_)lakaban.net >
refis.thomas(_)gmail.com >
< simon.castellan(_)iuwt.fr >
Permission is hereby granted , free... | null | https://raw.githubusercontent.com/AbstractMachinesLab/caramel/7d4e505d6032e22a630d2e3bd7085b77d0efbb0c/vendor/ocaml-lsp-1.4.0/ocaml-lsp-server/vendor/merlin/src/analysis/browse_misc.ml | ocaml | Typemod.simplify_signature | { { { COPYING * (
This file is part of Merlin , an helper for ocaml editors
Copyright ( C ) 2013 - 2015 < frederic.bour(_)lakaban.net >
refis.thomas(_)gmail.com >
< simon.castellan(_)iuwt.fr >
Permission is hereby granted , free... |
67d21fe1ca78d5f4d3802a2bdac98580c3af82d7ca3f867e18b542e976be6bb2 | coccinelle/herodotos | engineTypes.ml | (**************************************************************************)
(* *)
Menhir
(* *)
, INRIA Ro... | null | https://raw.githubusercontent.com/coccinelle/herodotos/5da230a18962ca445ed2368bc21abe0a8402e00f/menhirLib/engineTypes.ml | ocaml | ************************************************************************
et en Automatique. All rig... | Menhir
, INRIA Rocquencourt
, PPS , Université Paris Diderot
Copyright 2005 - 2008 Institut National de Recherche en Informatique
under the terms of the GNU Library General Pu... |
8dd6e9278ec99a12ab2f7f84d0a1e909848c7b2e4351886e3565e3c5a1924e49 | basho/riak_test | ts_cluster_unicode.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2015 Basho Technologies , Inc.
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the Li... | null | https://raw.githubusercontent.com/basho/riak_test/8170137b283061ba94bc85bf42575021e26c929d/tests/ts_cluster_unicode.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2015 Basho Technologies , Inc.
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
with UTF-8 values
-module(ts_... |
05e2006ee6173fbfddf982014cf0b289d73b6984a54d0e6919da9268bf06d6a4 | clojure/core.typed | eval.clj | (ns clojure.core.typed.test.typed-load.eval
{:lang :core.typed}
(:require [clojure.core.typed :as t]))
(t/cast t/Int nil)
| null | https://raw.githubusercontent.com/clojure/core.typed/f5b7d00bbb29d09000d7fef7cca5b40416c9fa91/typed/checker.jvm/resources/clojure/core/typed/test/typed_load/eval.clj | clojure | (ns clojure.core.typed.test.typed-load.eval
{:lang :core.typed}
(:require [clojure.core.typed :as t]))
(t/cast t/Int nil)
| |
7fdef097ee259bb37b137077d162ba028f753cb1a2f98c7f7efb8052e92db7f0 | xapi-project/xen-api | main.ml |
* Copyright ( C ) Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file LI... | null | https://raw.githubusercontent.com/xapi-project/xen-api/8d17b53bc236e23aa1ec455137773f7367665d83/ocaml/xenopsd/cli/main.ml | ocaml | Help sections common to all commands
Options common to all commands
Commands |
* Copyright ( C ) Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file LI... |
89d8b5f5802aa9615d06d5eec2e6462a59b3fcfd5d1fde9d7228eeb476a3de32 | discus-lang/salt | Nat.hs |
module Salt.Core.Prim.Ops.Nat where
import Salt.Core.Prim.Ops.Base
import qualified Data.Text as T
primOpsNat
= [ PP { name = "nat'show"
, tsig = [TNat] :-> [TText]
, step = \[NVs [VNat n]] -> [VText $ T.pack $ show n]
, docs = "Convert nat to text." }
, PP { name = "nat'add"
... | null | https://raw.githubusercontent.com/discus-lang/salt/33c14414ac7e238fdbd8161971b8b8ac67fff569/src/salt/Salt/Core/Prim/Ops/Nat.hs | haskell |
module Salt.Core.Prim.Ops.Nat where
import Salt.Core.Prim.Ops.Base
import qualified Data.Text as T
primOpsNat
= [ PP { name = "nat'show"
, tsig = [TNat] :-> [TText]
, step = \[NVs [VNat n]] -> [VText $ T.pack $ show n]
, docs = "Convert nat to text." }
, PP { name = "nat'add"
... | |
7335447bee25693cc970acdc579de61f146e8075948e5d1f9cb7bd4f2df5fe04 | vgeddes/scheme-compiler | munch-syntax.scm |
(import-for-syntax matchable)
(import-for-syntax srfi-1)
;; convenience constructors (used in pattern match rules)
(define-syntax define-munch-rules
(lambda (e r c)
(let ((%let* (r 'let*))
(%let (r 'let))
(%if (r 'if))
(%cond (r 'cond))
(%else ... | null | https://raw.githubusercontent.com/vgeddes/scheme-compiler/a2ac2d15e96a06d6d50133f516f424856e055cab/munch-syntax.scm | scheme | convenience constructors (used in pattern match rules)
select-names
Find names (which are bound to nodes by 'match) which need to be expanded next by the maximal-munch algorithm
=> (op2)
compile-pattern
Transform high-level patterns into low-level 'match patterns
assign
binops
load
store
br
cmp
at... |
(import-for-syntax matchable)
(import-for-syntax srfi-1)
(define-syntax define-munch-rules
(lambda (e r c)
(let ((%let* (r 'let*))
(%let (r 'let))
(%if (r 'if))
(%cond (r 'cond))
(%else (r 'else))
(%define (r 'define))
... |
7a5a3a37753ffcff3a5f84b6f36c680358d009303eb1dc7d7f7fd4e889ec2c09 | 4clojure/4clojure | messages.clj | (ns foreclojure.messages)
(defn load-props [file]
(into {} (doto (java.util.Properties.)
(.load (-> (Thread/currentThread)
(.getContextClassLoader)
(.getResourceAsStream file))))))
(def err-msg-map (load-props "error-messages.properties"))
(defn e... | null | https://raw.githubusercontent.com/4clojure/4clojure/25dec057d9d6871ce52aee9e2c3de7efdab14373/src/foreclojure/messages.clj | clojure | (ns foreclojure.messages)
(defn load-props [file]
(into {} (doto (java.util.Properties.)
(.load (-> (Thread/currentThread)
(.getContextClassLoader)
(.getResourceAsStream file))))))
(def err-msg-map (load-props "error-messages.properties"))
(defn e... | |
f9d0aa53c8bc44fa024b20bb576d82053c99b42f20dd5b17638653b561a9c696 | FranklinChen/hugs98-plus-Sep2006 | Trans.hs | -----------------------------------------------------------------------------
-- |
Module : Control . . Trans
Copyright : ( c ) 2001 ,
( c ) Oregon Graduate Institute of Science and Technology , 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- St... | null | https://raw.githubusercontent.com/FranklinChen/hugs98-plus-Sep2006/54ab69bd6313adbbed1d790b46aca2a0305ea67e/packages/mtl/Control/Monad/Trans.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : portable
The MonadTrans class.
Inspired by the paper
/Functional Programming with Overloading and
... | Module : Control . . Trans
Copyright : ( c ) 2001 ,
( c ) Oregon Graduate Institute of Science and Technology , 2001
( < /~mpj/ > )
Advanced School of Functional Programming , 1995 .
module Control.Monad.Trans (
MonadTrans(..),
MonadIO(..),
) where
import Prelude
import ... |
21afa77906027ac5fd2797d04cb2652bf799efabc2054ebf9b7be1ee71096a5e | wdhowe/clojure-snippets | factorial.clj | ;; using iterative recursion to solve factorials
(defn factorial-iter
[count total]
(if (= count 1) total (factorial-iter (- count 1) (* total (- count 1)))))
(defn factorial [num] (factorial-iter num num))
(println (factorial 4))
| null | https://raw.githubusercontent.com/wdhowe/clojure-snippets/0c3247ce99a563312b549d03f080b8cf449b541d/iter_recur/factorial.clj | clojure | using iterative recursion to solve factorials |
(defn factorial-iter
[count total]
(if (= count 1) total (factorial-iter (- count 1) (* total (- count 1)))))
(defn factorial [num] (factorial-iter num num))
(println (factorial 4))
|
def3cbd79745111183f6f18b5fc0684c45459bb370620f686cd767bbb72700e8 | mgeorgoulopoulos/TetrisHaskellWeekend | Renderer.hs | -- Renderer - module that maps a game state into a gloss picture
module Renderer(render) where
import State
import Playfield
import Graphics.Gloss
-- Let's start with rendering an empty well.
-- Playfield dimensions
cellSize = 35
padding = (768 - (20 * cellSize)) `quot` 2
wellWidth = 10 * cellSize
w... | null | https://raw.githubusercontent.com/mgeorgoulopoulos/TetrisHaskellWeekend/7dc406852e7578fb009434de54e3d3eb5b4f90f0/Renderer.hs | haskell | Renderer - module that maps a game state into a gloss picture
Let's start with rendering an empty well.
Playfield dimensions
Colors
Convert from playfield coordinate to screen coordinate
Function that renders a single cell
Renders Well playfield to Picture
Game State renderer
|
module Renderer(render) where
import State
import Playfield
import Graphics.Gloss
cellSize = 35
padding = (768 - (20 * cellSize)) `quot` 2
wellWidth = 10 * cellSize
wellHeight = 20 * cellSize
wallWidth = wellWidth + 2 * padding
wallHeight = wellHeight + 2 * padding
wellColor = black
wallColor =... |
9f4f454147af780483ee8f1cd882f341eebebbf2a3f977ca60524a000b734b85 | GaloisInc/what4 | SMTLib2.hs | ------------------------------------------------------------------------
-- |
-- Module : What4.Protocol.SMTLib2
Description : Interface for solvers that consume SMTLib2
Copyright : ( c ) Galois , Inc 2014 - 2020
-- License : BSD3
Maintainer : < >
-- Stability : p... | null | https://raw.githubusercontent.com/GaloisInc/what4/98ae759128a5c3de947b59730806b110ec8c005d/what4/src/What4/Protocol/SMTLib2.hs | haskell | ----------------------------------------------------------------------
|
Module : What4.Protocol.SMTLib2
License : BSD3
Stability : provisional
an input language.
----------------------------------------------------------------------
# LANGUAGE GADTs #
# LANGUAGE MultiWayIf #
# LANGUAGE ... | Description : Interface for solvers that consume SMTLib2
Copyright : ( c ) Galois , Inc 2014 - 2020
Maintainer : < >
This module defines operations for producing SMTLib2 - compatible
queries useful for interfacing with solvers that accecpt SMTLib2 as
# LANGUAGE AllowAmbiguousTypes #
# ... |
3df1d42eb1a973ecca09133a7d2d282ecc8375aa1fbeaf887e3dbeb5c2277ca3 | xtdb/core2 | tpch_sql_test.clj | (ns core2.sql.tpch-sql-test
(:require [clojure.java.io :as io]
[clojure.test :as t]
[core2.sql :as sql]
core2.sql-test))
| null | https://raw.githubusercontent.com/xtdb/core2/3adeb391ca4dd73a3f79faba8024289376597d23/src/test/clojure/core2/sql/tpch_sql_test.clj | clojure | (ns core2.sql.tpch-sql-test
(:require [clojure.java.io :as io]
[clojure.test :as t]
[core2.sql :as sql]
core2.sql-test))
| |
ee868aebb7edfd0bdeb507e27393e628b22d8a2d15f83c702f7bccb1360e3439 | sbcl/sbcl | simd-pack.pure.lisp | ;;;; Potentially side-effectful tests of the simd-pack infrastructure.
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
While most of SBCL is derived from the CMU CL system , the test
;;;; files (like this one) were written from scratch after the fork
from CMU CL .
;... | null | https://raw.githubusercontent.com/sbcl/sbcl/968b251365ec6e2b0cee3e97df1145074e3a0980/tests/simd-pack.pure.lisp | lisp | Potentially side-effectful tests of the simd-pack infrastructure.
more information.
files (like this one) were written from scratch after the fork
This software is in the public domain and is provided with
absolutely no warranty. See the COPYING and CREDITS files for
more information.
Default
Want readably bu... |
This software is part of the SBCL system . See the README file for
While most of SBCL is derived from the CMU CL system , the test
from CMU CL .
#-sb-simd-pack (invoke-restart 'run-tests::skip-file)
(defun make-constant-packs ()
(values (sb-kernel:%make-simd-pack-ub64 1 2)
(sb-kernel:%make-simd-pack... |
85a8da46e76ba188040359362c5cc5015da798a1f599e37a6711358519e2c434 | pietervdvn/ALGT | ManualPreprocessor.hs | module Utils.ManualPreprocessor where
{- Takes variables, substitutes them in the manual -}
import System.Directory
import System.Process
import System.IO.Unsafe
import Control.Exception (evaluate)
import Utils.Utils
import Utils.Version
import Utils.ArgumentParser
import Utils.ToString
import Utils.PureIO hiding (w... | null | https://raw.githubusercontent.com/pietervdvn/ALGT/43a2811931be6daf1362f37cb16f99375ca4999e/src/Utils/ManualPreprocessor.hs | haskell | Takes variables, substitutes them in the manual
let animation = ["|","/","-","\\"]
++ reverse animations | module Utils.ManualPreprocessor where
import System.Directory
import System.Process
import System.IO.Unsafe
import Control.Exception (evaluate)
import Utils.Utils
import Utils.Version
import Utils.ArgumentParser
import Utils.ToString
import Utils.PureIO hiding (writeFile, readFile, putStrLn)
import Data.Map (Map)
im... |
df857e3dcd0c0de115ab70b638734d8174eb8d3cc063c760df73142efd347cc4 | fetburner/Coq2SML | big.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2014
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/fetburner/Coq2SML/322d613619edbb62edafa999bff24b1993f37612/coq-8.4pl4/plugins/extraction/big.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* To be linked with [nums.(cma|cmxa)... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2014
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* [ Big ] : a wrapper around ... |
376071ee762e0db07393a4c22eadc699c94978e9cda841167ff46bd9a6493d90 | racehub/liberator-friend | core.clj | (ns liberator-friend.core
"Core namespace for the liberator-friend post."
(:gen-class)
(:require [cemerick.friend.credentials :as creds]
[compojure.handler :refer [api]]
[compojure.core :as compojure :refer (GET defroutes)]
[liberator-friend.middleware.auth :as auth]
... | null | https://raw.githubusercontent.com/racehub/liberator-friend/ab096f94928ac7b12b4541bd840df678a1f746aa/src/liberator_friend/core.clj | clojure | ## Compojure Routes
## Server Lifecycle | (ns liberator-friend.core
"Core namespace for the liberator-friend post."
(:gen-class)
(:require [cemerick.friend.credentials :as creds]
[compojure.handler :refer [api]]
[compojure.core :as compojure :refer (GET defroutes)]
[liberator-friend.middleware.auth :as auth]
... |
68e03755607687414c071b170f99fb632291f2c145ae4ac05ac87514640aaa9e | nlsandler/nqcc | lex.mli | (* Convert C program into a list of tokens *)
val lex : string -> Tok.token list
(* Get string representation of a token *)
val tok_to_string: Tok.token -> string
| null | https://raw.githubusercontent.com/nlsandler/nqcc/c30e4c33ec7adfe9710edb948cda380b1fc01715/src/lex.mli | ocaml | Convert C program into a list of tokens
Get string representation of a token | val lex : string -> Tok.token list
val tok_to_string: Tok.token -> string
|
f51b07fc66774d2741f8ed6c3a302ad750cd72ded01b32f81e0a861d7a914d5c | PESchoenberg/g2q | example15.scm | #! /usr/local/bin/guile -s
!#
;; =============================================================================
;;
;; example15.scm
;;
;; swap fast ladder test.
;;
;; =============================================================================
;;
Copyright ( C ) 2018 - 2022 Pablo Edronkin ( pablo.edronkin at yahoo.... | null | https://raw.githubusercontent.com/PESchoenberg/g2q/8b971d9e5073ab9f1ccd1b7bbce07e95eb4fefee/examples/example15.scm | scheme | =============================================================================
example15.scm
swap fast ladder test.
=============================================================================
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser Genera... | #! /usr/local/bin/guile -s
!#
Copyright ( C ) 2018 - 2022 Pablo Edronkin ( pablo.edronkin at yahoo.com )
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU Lesser General Public License
(use-modules (g2q g2q0)
(g2q g2q1)
(g2q g2q2)
... |
59f132d10b6a81c471019970dde2194aec3a044ef557e080437f6cf3862b89f8 | active-group/active-clojure | figwheel_test_runner.cljs | (ns active.clojure.figwheel-test-runner
(:require [figwheel.main.testing :refer-macros [run-tests-async]]
[active.clojure.test-deps]))
(defn -main [& args]
(run-tests-async 10000))
| null | https://raw.githubusercontent.com/active-group/active-clojure/44050a1292fa610dde732d5fbfc42c37ad976d3a/dev/active/clojure/figwheel_test_runner.cljs | clojure | (ns active.clojure.figwheel-test-runner
(:require [figwheel.main.testing :refer-macros [run-tests-async]]
[active.clojure.test-deps]))
(defn -main [& args]
(run-tests-async 10000))
| |
39a346a399a581034ad58dc1d9e9ef4fe3f711fb24bb8a21815f2d1ad1524fa0 | NorfairKing/the-notes | ComputationalProblems.hs | module Cryptography.ComputationalProblems where
import Notes hiding (cyclic, inverse)
import Functions.Application.Macro
import Groups.Macro
import Groups.Terms
import Logic.PropositionalLogic.Macro
import ... | null | https://raw.githubusercontent.com/NorfairKing/the-notes/ff9551b05ec3432d21dd56d43536251bf337be04/src/Cryptography/ComputationalProblems.hs | haskell | module Cryptography.ComputationalProblems where
import Notes hiding (cyclic, inverse)
import Functions.Application.Macro
import Groups.Macro
import Groups.Terms
import Logic.PropositionalLogic.Macro
import ... | |
5cdea1942f2c6c8630686621f61d40c44d5f6793d47c960eb9e14a7a909e0031 | clash-lang/clash-compiler | T895.hs | module T895 where
import Clash.Prelude
topEntity :: Maybe (Vec 2 (Signed 8), Index 1)
topEntity = Just (pure 0, 0)
| null | https://raw.githubusercontent.com/clash-lang/clash-compiler/8e461a910f2f37c900705a0847a9b533bce4d2ea/tests/shouldwork/Vector/T895.hs | haskell | module T895 where
import Clash.Prelude
topEntity :: Maybe (Vec 2 (Signed 8), Index 1)
topEntity = Just (pure 0, 0)
| |
c17c142dddfd2cb067875097af24141f497ce4feadb02549288a5dc5a23af39e | TrustInSoft/tis-interpreter | non_linear_evaluation.ml | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of Frama - C.
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/plugins/value/engine/non_linear_evaluation.ml | ocaml | ************************************************************************
alternatives)
... | Modified by TrustInSoft
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Softwa... |
cfaffcfc1c17819d19653e520b111d66841da2fc0b566cd16b3d82ccc0616984 | tweag/asterius | T10296a.hs | -- A reduced version of the original test case
# LANGUAGE ForeignFunctionInterface #
import Control.Concurrent
import Control.Monad
import Foreign.C.Types
import Foreign.Ptr
main :: IO ()
main = do
mv <- newEmptyMVar
-- Fork a thread to continually dereference a stable pointer...
void $ forkIO $ f 1 10... | null | https://raw.githubusercontent.com/tweag/asterius/e7b823c87499656860f87b9b468eb0567add1de8/asterius/test/ghc-testsuite/rts/T10296a.hs | haskell | A reduced version of the original test case
Fork a thread to continually dereference a stable pointer...
...while we keep enlarging the stable pointer table
Each call to wrap creates a stable pointer |
# LANGUAGE ForeignFunctionInterface #
import Control.Concurrent
import Control.Monad
import Foreign.C.Types
import Foreign.Ptr
main :: IO ()
main = do
mv <- newEmptyMVar
void $ forkIO $ f 1 1000000 >> putMVar mv ()
f 65536 1
void $ takeMVar mv
where
f nWraps nApplies = replicateM_ nWraps $ do... |
843b4dc2646c3bc17e25f7c3ec875d717bfb86f4bc65bdef1947c885e9063559 | dakk/caravand-fullnode | helper.mli | open Yojson
open Unix
val send : Unix.file_descr -> string -> unit
val recv : Unix.file_descr -> string
val shutdown : Unix.file_descr -> unit
val listen : Unix.file_descr -> int -> int -> unit
module HTTP : sig
type met = GET | POST | DELETE | PUT
type req = {
uri : string list;
body : string;
body_js... | null | https://raw.githubusercontent.com/dakk/caravand-fullnode/72735bf380812aea32ba0d3d4aa671f741cdaecb/src/api/helper.mli | ocaml | open Yojson
open Unix
val send : Unix.file_descr -> string -> unit
val recv : Unix.file_descr -> string
val shutdown : Unix.file_descr -> unit
val listen : Unix.file_descr -> int -> int -> unit
module HTTP : sig
type met = GET | POST | DELETE | PUT
type req = {
uri : string list;
body : string;
body_js... | |
064de12e9e3af7c7151cebb0a74a97070f2eff80e870ab23c40436f312a96411 | racketscript/racketscript | ident-normalize.rkt | #lang racketscript/base
(define 0x 42)
(displayln 0x)
| null | https://raw.githubusercontent.com/racketscript/racketscript/f94006d11338a674ae10f6bd83fc53e6806d07d8/tests/basic/ident-normalize.rkt | racket | #lang racketscript/base
(define 0x 42)
(displayln 0x)
| |
673d2297c53c5df41908f21de60556091068a102ac1fa7c4f7ea0b624edb8485 | input-output-hk/project-icarus-importer | Common.hs | module Pos.Binary.Core.Common () where
import Universum
import Pos.Binary.Class (Bi (..), Cons (..), Field (..), deriveSimpleBi)
import Pos.Core.Common.Types (Coin (..), unsafeGetCoin)
import qualified Pos.Core.Common.Types as T
import qualified Pos.Data.Attributes as A
import ... | null | https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/core/src/Pos/Binary/Core/Common.hs | haskell | kind of boilerplate, but anyway that's what it was made for --
verbosity and clarity
--------------------------------------------------------------------------
Coin
--------------------------------------------------------------------------
Input | Bits to represent |
-----------------------... | module Pos.Binary.Core.Common () where
import Universum
import Pos.Binary.Class (Bi (..), Cons (..), Field (..), deriveSimpleBi)
import Pos.Core.Common.Types (Coin (..), unsafeGetCoin)
import qualified Pos.Core.Common.Types as T
import qualified Pos.Data.Attributes as A
import ... |
4641434e371860536cdc3948b2894b6fb5a43978ee0fe6987e270af8fe49b16c | tweag/inline-java | Streaming.hs | -- | Expose Java iterators as streams from the
-- < streaming> package.
# LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE ExistentialQuantification #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
# LANGUAGE RecursiveDo #
# LANGUAGE... | null | https://raw.githubusercontent.com/tweag/inline-java/a2daaa3cfc5cb172b6334bf5904d1a57025e709a/jvm-streaming/src/main/haskell/Language/Java/Streaming.hs | haskell | | Expose Java iterators as streams from the
< streaming> package.
# LANGUAGE OverloadedStrings #
Export only to get a FunPtr.
| Reflects a stream with no batching.
that they can be freed.
Call next once to initialize the iterator.
Given that we always register natives on the same class,
there is no point in reg... |
# LANGUAGE DataKinds #
# LANGUAGE FlexibleInstances #
# LANGUAGE ExistentialQuantification #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE QuasiQuotes #
# LANGUAGE RecursiveDo #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StaticPointers #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
#... |
3a121cf9b9bd18caa6a38c482a7abf8fa3f54c58c0b5ad416e160c600a99624e | tmattio/js-bindings | vscode_test_download.ml | [@@@js.dummy "!! This code has been generated by gen_js_api !!"]
[@@@ocaml.warning "-7-32-39"]
[@@@ocaml.warning "-7-11-32-33-39"]
open Es5
module AnonymousInterface0 =
struct
type t = Ojs.t
let rec t_of_js : Ojs.t -> t = fun (x2 : Ojs.t) -> x2
and t_to_js : t -> Ojs.t = fun (x1 : Ojs.t) -> x1
end
modul... | null | https://raw.githubusercontent.com/tmattio/js-bindings/f1d36bba378e4ecd5310542a0244dce9258b6496/lib/vscode-test/vscode_test_download.ml | ocaml | [@@@js.dummy "!! This code has been generated by gen_js_api !!"]
[@@@ocaml.warning "-7-32-39"]
[@@@ocaml.warning "-7-11-32-33-39"]
open Es5
module AnonymousInterface0 =
struct
type t = Ojs.t
let rec t_of_js : Ojs.t -> t = fun (x2 : Ojs.t) -> x2
and t_to_js : t -> Ojs.t = fun (x1 : Ojs.t) -> x1
end
modul... | |
235ac3997409503a9564e1bf4a01f2ee0558dd323fbe9b3c900a0b653af4041c | janestreet/core_profiler | reader.mli | open! Core
open Core_profiler.Std_offline
open Core_profiler
module Header : sig
(** A [Header.Item.t] is anything that is uniquely identified by a [Probe_id.t]. *)
module Item : sig
type single =
{ name : string
; spec : Probe_type.t
}
type group =
{ name : string
; points_... | null | https://raw.githubusercontent.com/janestreet/core_profiler/3d1c0e61df848f5f25f78d64beea92b619b6d5d9/offline_tool/lib/reader.mli | ocaml | * A [Header.Item.t] is anything that is uniquely identified by a [Probe_id.t].
* Get a group point's parent
* If [add_group] is specified and the id refers to a group point,
[group_name ^ add_group ^ group_point_name] is returned
* Conditions are ANDed, and default to true | open! Core
open Core_profiler.Std_offline
open Core_profiler
module Header : sig
module Item : sig
type single =
{ name : string
; spec : Probe_type.t
}
type group =
{ name : string
; points_spec : Probe_type.t
; children : Probe_id.t list
}
type group_point =
... |
907f828800e6922851b977ce1394941d7601a6dbc68889afe7fe2601c16b0e5d | clj-kafka/franzy | core_test.clj | (ns franzy.serialization.json.core-test
(:require [midje.sweet :refer :all]))
| null | https://raw.githubusercontent.com/clj-kafka/franzy/6c2e2e65ad137d2bcbc04ff6e671f97ea8c0e380/json/test/franzy/serialization/json/core_test.clj | clojure | (ns franzy.serialization.json.core-test
(:require [midje.sweet :refer :all]))
| |
8fb779a9a97a4320315d53f740667c3769dee4dc3fffe13395b0cd1237ea7eef | DanielG/ghc-mod | File_Redir_Lint.hs | # LANGUAGE CPP #
#ifndef NOTHING
module File where
func :: Num a => a -> a -> a
func a b = (*) a b
#else
INVALID
#endif
| null | https://raw.githubusercontent.com/DanielG/ghc-mod/391e187a5dfef4421aab2508fa6ff7875cc8259d/test/data/file-mapping/preprocessor/File_Redir_Lint.hs | haskell | # LANGUAGE CPP #
#ifndef NOTHING
module File where
func :: Num a => a -> a -> a
func a b = (*) a b
#else
INVALID
#endif
| |
38703c87e813b4d2fa29dbe0fc3f50b0d61a7ba113ee07ac0f0abd4ccac87309 | janestreet/core | comparator.ml | open! Import
module Comparator = Base.Comparator
type ('a, 'witness) t = ('a, 'witness) Comparator.t = private
{ compare : 'a -> 'a -> int
; sexp_of_t : 'a -> Base.Sexp.t
}
module type Base_mask = module type of Comparator with type ('a, 'b) t := ('a, 'b) t
include (Comparator : Base_mask)
module Stable = str... | null | https://raw.githubusercontent.com/janestreet/core/b0be1daa71b662bd38ef2bb406f7b3e70d63d05f/core/src/comparator.ml | ocaml | open! Import
module Comparator = Base.Comparator
type ('a, 'witness) t = ('a, 'witness) Comparator.t = private
{ compare : 'a -> 'a -> int
; sexp_of_t : 'a -> Base.Sexp.t
}
module type Base_mask = module type of Comparator with type ('a, 'b) t := ('a, 'b) t
include (Comparator : Base_mask)
module Stable = str... | |
3550863632ab2ec4bdd2b25a2651c6e2440ebd5ef4987ebf460f54e7b528ade5 | kapok-lang/kapok | kapok_dispatch.erl | %% Helper module for dispatching names(module/function/macro/var) and their references.
-module(kapok_dispatch).
-export([default_requires/0,
default_uses/0,
find_module/3,
find_local_macro/5,
find_remote_macro/6,
find_local_function/2,
find_imported_local_function/... | null | https://raw.githubusercontent.com/kapok-lang/kapok/4272f990fe495e595d2afe38605dbca560bbe072/lib/kapok/src/kapok_dispatch.erl | erlang | Helper module for dispatching names(module/function/macro/var) and their references.
get the original module name in case module is an alias or rename.
find local/remote macro/function
which is defined previously.
Original is declared in ns use clause.
Load all the import macros/functions from the specified modul... | -module(kapok_dispatch).
-export([default_requires/0,
default_uses/0,
find_module/3,
find_local_macro/5,
find_remote_macro/6,
find_local_function/2,
find_imported_local_function/3,
find_remote_function/4,
is_macro_loaded/3,
filter_fa/2,
... |
49cad82b43e4ca0eeba3f4ed3def58e8ebfe1b8f835fcc59b2d480413c49248c | vbmithr/ocaml-thrift-lib | TServerSocket.ml |
Licensed to the Apache Software Foundation ( ASF ) under one
or more contributor license agreements . See the NOTICE file
distributed with this work for additional information
regarding copyright ownership . The ASF licenses this file
to you under the Apache License , Version 2.0 ( the
" License " ) ;... | null | https://raw.githubusercontent.com/vbmithr/ocaml-thrift-lib/70669ce410e99389975384b46492f9a55281ca10/src/TServerSocket.ml | ocaml |
Licensed to the Apache Software Foundation ( ASF ) under one
or more contributor license agreements . See the NOTICE file
distributed with this work for additional information
regarding copyright ownership . The ASF licenses this file
to you under the Apache License , Version 2.0 ( the
" License " ) ;... | |
39660822cf8a4e538b0ffb1a5c0379aa2de14be8192f8bcbffc84dd324b7c5b1 | gregtatcam/imaplet-lwt | email_parse.ml |
* Copyright ( c ) 2013 - 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... | null | https://raw.githubusercontent.com/gregtatcam/imaplet-lwt/d7b51253e79cffa97e98ab899ed833cd7cb44bb6/lib/commands/email_parse.ml | ocaml | boundary
content compressed separately
parse the email message into MIME parts
* all headers are concat together and saved as a separate blob.
* attachments are saved each into a separate blob.
* all other content is concat together, along with a map that references
* all parts, their storage location, and their ... |
* Copyright ( c ) 2013 - 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... |
a68a8af607b3f0fd63f404f7023b7191dd20d08b9fce8841c98baf6074d7b93d | kit-ty-kate/labrys | pretyper.ml | Copyright ( c ) 2013 - 2017 The Labrys developers .
(* See the LICENSE file at the top-level directory. *)
open PretypedTree
module ForbiddenEnv = Ident.Name.Set
let ty_to_effects ty =
(fst ty, [ty])
let rec get_rec_ty ~name (loc, t) = match t with
| Annot (_, ty) ->
ty
| Let (_, _, t)
| LetRec (_, ... | null | https://raw.githubusercontent.com/kit-ty-kate/labrys/4a3e0c5dd45343b4de2e22051095b49d05772608/src/pre-typing/pretyper.ml | ocaml | See the LICENSE file at the top-level directory. | Copyright ( c ) 2013 - 2017 The Labrys developers .
open PretypedTree
module ForbiddenEnv = Ident.Name.Set
let ty_to_effects ty =
(fst ty, [ty])
let rec get_rec_ty ~name (loc, t) = match t with
| Annot (_, ty) ->
ty
| Let (_, _, t)
| LetRec (_, _, _, t) ->
get_rec_ty ~name t
| Abs ((name, ty... |
c350d1ec89ca7255f1f7059c36d263efce25d9bdd724bbfa35da0cfe90692414 | ocsigen/obrowser | inline_img.ml | open Js ;;
open Html ;;
let body = get_element_by_id "body" ;;
let h2 = ref 0 and h3 = ref 0 and h4 = ref 0 ;;
let imgs = ref [||]
let display_img idx =
let nb = Array.length !imgs in
let current = ref idx in
let vimg = img ~src:("pictures/" ^ (!imgs).(!current)) () in
let mask =
div ~style:"position: f... | null | https://raw.githubusercontent.com/ocsigen/obrowser/977c09029ea1e4fde4fb0bf92b4d893835bd9504/tutorial/inline_img.ml | ocaml | open Js ;;
open Html ;;
let body = get_element_by_id "body" ;;
let h2 = ref 0 and h3 = ref 0 and h4 = ref 0 ;;
let imgs = ref [||]
let display_img idx =
let nb = Array.length !imgs in
let current = ref idx in
let vimg = img ~src:("pictures/" ^ (!imgs).(!current)) () in
let mask =
div ~style:"position: f... | |
d7db473fa7138d325f69b261837d1ad0f60defa01fef513d8b0eb8055a7e9dbf | evilbinary/scheme-lib | subarray.scm | ;;;;"subarray.scm" Scheme array accessory procedures.
Copyright ( C ) 2002 and
;
;Permission to copy this software, to modify it, to redistribute it,
;to distribute modified versions, and to use it for any purpose is
;granted, subject to the following restrictions and understandings.
;
1 . Any copy made of this... | null | https://raw.githubusercontent.com/evilbinary/scheme-lib/6df491c1f616929caa4e6569fa44e04df7a356a7/packages/slib/subarray.scm | scheme | "subarray.scm" Scheme array accessory procedures.
Permission to copy this software, to modify it, to redistribute it,
to distribute modified versions, and to use it for any purpose is
granted, subject to the following restrictions and understandings.
in full.
this software will be error-free, and I am under no oblig... | Copyright ( C ) 2002 and
1 . Any copy made of this software must include this copyright notice
2 . I have made no warranty or representation that the operation of
3 . In conjunction with products arising from the use of this
(require 'array)
(require 'multiarg-apply)
@args array select @dots { }
an integ... |
3348b2c4499a6c4bce6a688adaccda800232e4fcf6d390e72e67dd0d2908d820 | ocurrent/ocaml-docs-ci | solver_pool.ml | let spawn_local ~jobs ?solver_dir () : Solver_api.Solver.t =
let p, c = Unix.(socketpair PF_UNIX SOCK_STREAM 0 ~cloexec:true) in
Unix.clear_close_on_exec c;
let solver_dir =
match solver_dir with None -> Fpath.to_string (Current.state_dir "solver") | Some x -> x
in
let cmd = ("", [| "ocaml-docs-ci-solver"... | null | https://raw.githubusercontent.com/ocurrent/ocaml-docs-ci/02fc49bf690ea298cbb034c1bd8c96c7a4c2e8d0/src/lib/solver_pool.ml | ocaml | let spawn_local ~jobs ?solver_dir () : Solver_api.Solver.t =
let p, c = Unix.(socketpair PF_UNIX SOCK_STREAM 0 ~cloexec:true) in
Unix.clear_close_on_exec c;
let solver_dir =
match solver_dir with None -> Fpath.to_string (Current.state_dir "solver") | Some x -> x
in
let cmd = ("", [| "ocaml-docs-ci-solver"... | |
c7178277ca8874275816af93156f7eb8885dafc5a35fad8a4ebbcb6ad24d690e | elastic/eui-cljs | icon_ml_create_advanced_job.cljs | (ns eui.icon-ml-create-advanced-job
(:require ["@elastic/eui/lib/components/icon/assets/ml_create_advanced_job.js" :as eui]))
(def mlCreateAdvancedJob eui/icon)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/icon_ml_create_advanced_job.cljs | clojure | (ns eui.icon-ml-create-advanced-job
(:require ["@elastic/eui/lib/components/icon/assets/ml_create_advanced_job.js" :as eui]))
(def mlCreateAdvancedJob eui/icon)
| |
c2aa33b0691af6864ed4ecd21f21160c2ae9f69ddaaf63d7af0c04e5b45a361a | brunjlar/protop | Transitivities.hs | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
{-# LANGUAGE GADTs #-}
# LANGUAGE TypeOperators #
module Protop.Core.Transitivities
( (:>)(..)
) where
import Data.Proxy (Proxy(..))
import Protop.Core.Proofs
import Protop.Core.Setoids
infixl 9 :>
data (:>) :: * -> * -> * where
(:>) ::... | null | https://raw.githubusercontent.com/brunjlar/protop/9f520aeb4dd9baf9ebed8751584e33e3a3e23df6/src/Protop/Core/Transitivities.hs | haskell | # LANGUAGE GADTs # | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
module Protop.Core.Transitivities
( (:>)(..)
) where
import Data.Proxy (Proxy(..))
import Protop.Core.Proofs
import Protop.Core.Setoids
infixl 9 :>
data (:>) :: * -> * -> * where
(:>) :: ( IsProof a
... |
1af1b97f6f5d21fbafa13cdbb57be67aeb0497ac7821970a2068dd217387fc28 | borgeby/jarl | http_client.cljs | (ns jarl.http-client)
(def request-fn #(throw (ex-info "not implemented yet" {})))
(defn send-request [_]
(throw (ex-info "not implemented yet" {})))
| null | https://raw.githubusercontent.com/borgeby/jarl/2659afc6c72afb961cb1e98b779beb2b0b5d79c6/core/src/main/cljs/jarl/http_client.cljs | clojure | (ns jarl.http-client)
(def request-fn #(throw (ex-info "not implemented yet" {})))
(defn send-request [_]
(throw (ex-info "not implemented yet" {})))
| |
cb9eb71013f31025c912751c82245ee24bf56fde0f8bfa715fb64e246f099555 | facebook/pyre-check | interface.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/pyre-check/fa38aa1180d4bb7d1c334c2846aca0ed14e22399/source/buck/interface.ml | ocaml | Force `buck` to hand back structured JSON output instead of plain text.
Mark the query as coming from `pyre` for `buck`, to make troubleshooting easier.
Build all python-related rules.
Certain Python-related rules are exposed as `configured_alias` which cannot be
picked up by the preceding query... |
* 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... |
e929586906e0e73762459c5380cbd185258245173e9cb627e48ef6e533e81ccd | BitGameEN/bitgamex | mod_kernel.erl | %%%------------------------------------
%%% @Module : mod_kernel
%%% @Description: 核心服务
%%%------------------------------------
-module(mod_kernel).
-behaviour(gen_server).
-export([start_link/0]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-include("common.... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/mod/mod_kernel.erl | erlang | ------------------------------------
@Module : mod_kernel
@Description: 核心服务
------------------------------------
初始ets表
初始dets表
================== 私有函数 =================
关闭DETS表
| -module(mod_kernel).
-behaviour(gen_server).
-export([start_link/0]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-include("common.hrl").
-include("record.hrl").
start_link() ->
gen_server:start_link({local,?MODULE}, ?MODULE, [], []).
init([]) ->
... |
2e62c44338585a514ef705403e8f82d351904404420c6166b190f424fc0c5d62 | sydow/ireal | Auxiliary.hs | module Data.Number.IReal.Auxiliary where
import GHC.Float
infix 1 `atDecimals`
-- Auxiliary functions and constants --------------------------------------------
-- | Base 2 logarithm of argument, rounded downwards.
lg2 :: Integer -> Int
lg2 = GHC.Float.integerLogBase 2
-- | Converts precisions from decimal to bin... | null | https://raw.githubusercontent.com/sydow/ireal/c06438544c711169baac7960540202379f9294b1/Data/Number/IReal/Auxiliary.hs | haskell | Auxiliary functions and constants --------------------------------------------
| Base 2 logarithm of argument, rounded downwards.
| Converts precisions from decimal to binary.
| Operator allowing function expecting binary precision to be applied to decimal ditto. | module Data.Number.IReal.Auxiliary where
import GHC.Float
infix 1 `atDecimals`
lg2 :: Integer -> Int
lg2 = GHC.Float.integerLogBase 2
dec2bits :: Int -> Int
dec2bits d = ceiling (fromIntegral d * logBase 2 10 :: Double)
atDecimals :: (Int -> a) -> Int -> a
atDecimals f = f . dec2bits
|
f7870dfa759b3ce7c6c22f62bf1b65ca5705c0fd615146edd5adb106b4dc7008 | ocaml/dune | log.ml | open Stdune
module Console = Dune_console
module File = struct
type t =
| Default
| No_log_file
| This of Path.t
| Out_channel of out_channel
end
type real = { oc : out_channel option }
let t = Fdecl.create Dyn.opaque
let verbose = ref false
let init ?(file = File.Default) () =
let oc =
mat... | null | https://raw.githubusercontent.com/ocaml/dune/b8fd9dffecfd1a102720ca2ab485e80fcee2cb65/src/dune_util/log.ml | ocaml | open Stdune
module Console = Dune_console
module File = struct
type t =
| Default
| No_log_file
| This of Path.t
| Out_channel of out_channel
end
type real = { oc : out_channel option }
let t = Fdecl.create Dyn.opaque
let verbose = ref false
let init ?(file = File.Default) () =
let oc =
mat... | |
c2369e4efb621c462c56a6a91003193f77c2599d8ec5c4fea6280bf838e5ba59 | montelibero-org/veche | User.hs | # LANGUAGE BlockArguments #
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DisambiguateRecordFields #
# LANGUAGE ImportQualifiedPost #
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
module Handler.User (getUserR, putUserR) where
import Import
imp... | null | https://raw.githubusercontent.com/montelibero-org/veche/f9104057c940880fd68bbbd5c752f6ca9118ff94/veche-web/src/Handler/User.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
input | # LANGUAGE BlockArguments #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DisambiguateRecordFields #
# LANGUAGE ImportQualifiedPost #
module Handler.User (getUserR, putUserR) where
import Import
import Data.Aeson (Value (Null, String))
import Data.Char (isAscii, isPrint)
import Data.Text qual... |
155f0960e0695b22f9e3a2c37def5a7bbf4980105e57455fd7b31c175c32bb65 | spurious/sagittarius-scheme-mirror | websocket.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
;;; rfc/websocket.scm - RFC 6455 Websocket
;;;
Copyright ( c ) 2010 - 2016 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; ... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/sitelib/rfc/websocket.scm | scheme | coding : utf-8 ; -*-
rfc/websocket.scm - RFC 6455 Websocket
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list o... | Copyright ( c ) 2010 - 2016 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
(library (rfc websocket)
make-websocket
... |
335c96835e5df9b44754291b2b571448dc6f11440ae694c5ca5363ffd83a8f13 | OCamlPro/scilint | tyxml_js_manip.ml | let doc = Dom_html.document
let window = Dom_html.window
let loc = Js.Unsafe.variable "location"
let alert s = window##alert (Js.string s)
let confirm s = Js.to_bool (window##confirm (Js.string s))
let js_log obj = Firebug.console##log (obj)
let js_debug obj = Firebug.console##debug (obj)
let js_error obj = Firebug.c... | null | https://raw.githubusercontent.com/OCamlPro/scilint/9d9ddd8e1630ddeae7f4f875bce62b2f65ec17d8/src/common/tyxml_js_manip.ml | ocaml | For workers... | let doc = Dom_html.document
let window = Dom_html.window
let loc = Js.Unsafe.variable "location"
let alert s = window##alert (Js.string s)
let confirm s = Js.to_bool (window##confirm (Js.string s))
let js_log obj = Firebug.console##log (obj)
let js_debug obj = Firebug.console##debug (obj)
let js_error obj = Firebug.c... |
e657688824521b72b35e52a359852be9f836764461b79cc995d5fe7179917dc8 | MrEbbinghaus/fulcro-material-ui-wrapper | data_display.cljc | (ns ^:deprecated material-ui.data-display
(:refer-clojure :exclude [list])
(:require
[com.fulcrologic.fulcro.algorithms.react-interop :as interop]
#?@(:cljs
[["@mui/material/Typography" :default Typography]
["@mui/material/Divider" :default Divider]
["@mui/material/Chip" :default C... | null | https://raw.githubusercontent.com/MrEbbinghaus/fulcro-material-ui-wrapper/058f1dd4b85542914f92f48a4010ea9ad497e48f/src/material_ui/data_display.cljc | clojure | (ns ^:deprecated material-ui.data-display
(:refer-clojure :exclude [list])
(:require
[com.fulcrologic.fulcro.algorithms.react-interop :as interop]
#?@(:cljs
[["@mui/material/Typography" :default Typography]
["@mui/material/Divider" :default Divider]
["@mui/material/Chip" :default C... | |
651dd6127fb5df258b97ce3e9c2b732c53bd7e7ae481676c44addde01e96ef16 | aprell/compiler-potpourri | optim.mli | open Control_flow
val optimize : ?dump:bool -> Cfg.t -> Ssa.Graph.t -> Cfg.t
| null | https://raw.githubusercontent.com/aprell/compiler-potpourri/a668b71f392abf1810a1f33f362a1d96bc5eebce/ssa/optim.mli | ocaml | open Control_flow
val optimize : ?dump:bool -> Cfg.t -> Ssa.Graph.t -> Cfg.t
| |
0d45fcf621c800ada9f813aede08e449fd8721c5b4958650669926986714b4be | anoma/juvix | Closure.hs | module Juvix.Compiler.Backend.C.Data.Closure where
import Juvix.Compiler.Backend.C.Data.Base
import Juvix.Compiler.Backend.C.Language
import Juvix.Compiler.Concrete.Data.Builtins (IsBuiltin (toBuiltinPrim))
import Juvix.Compiler.Internal.Extra (mkPolyType')
import Juvix.Compiler.Internal.Extra qualified as Micro
impor... | null | https://raw.githubusercontent.com/anoma/juvix/58a0f196da301ccf56e280ca4bd28abd35e0a75a/src/Juvix/Compiler/Backend/C/Data/Closure.hs | haskell | module Juvix.Compiler.Backend.C.Data.Closure where
import Juvix.Compiler.Backend.C.Data.Base
import Juvix.Compiler.Backend.C.Language
import Juvix.Compiler.Concrete.Data.Builtins (IsBuiltin (toBuiltinPrim))
import Juvix.Compiler.Internal.Extra (mkPolyType')
import Juvix.Compiler.Internal.Extra qualified as Micro
impor... | |
db442fe71a7b4b1fd5a8f1634699da30b285212ec2764f2c61feb5c103758772 | thepower/tpnode | tpic2.erl | -module(tpic2).
-export([childspec/0,certificate/0,cert/2,extract_cert_info/1, verfun/3,
node_addresses/0, alloc_id/0]).
-export([peers/0,peerstreams/0,cast/2,cast/3,call/2,call/3,cast_prepare/1]).
-include_lib("public_key/include/public_key.hrl").
-include("include/tplog.hrl").
alloc_id() ->
Node=nodekey:no... | null | https://raw.githubusercontent.com/thepower/tpnode/211eab8b35253057f69db3d1e10e68c2aa92aac8/apps/tpic2/src/tpic2.erl | erlang | {key, {'ECPrivateKey', DERKey}}
version = asn1_DEFAULT,
serialNumber,
signature,
issuer,
validity,
signature=Signature | -module(tpic2).
-export([childspec/0,certificate/0,cert/2,extract_cert_info/1, verfun/3,
node_addresses/0, alloc_id/0]).
-export([peers/0,peerstreams/0,cast/2,cast/3,call/2,call/3,cast_prepare/1]).
-include_lib("public_key/include/public_key.hrl").
-include("include/tplog.hrl").
alloc_id() ->
Node=nodekey:no... |
15a6afde8fd035b089db48e2654f4718f68fd0e9795fed80d2a9bfaf310e8169 | mcna/usocket | usocket.lisp | $ I d : usocket.lisp 680 2012 - 01 - 20 23:38:00Z hhubner $
;;;; $URL: svn-lisp.net/project/usocket/svn/usocket/tags/0.6.0.1/usocket.lisp $
;;;; See LICENSE for licensing information.
(in-package :usocket)
(defparameter *wildcard-host* #(0 0 0 0)
"Hostname to pass when all interfaces in the current system are to... | null | https://raw.githubusercontent.com/mcna/usocket/187e0ecd58ec0b2093d972e0eb607a50182a3efd/usocket.lisp | lisp | $URL: svn-lisp.net/project/usocket/svn/usocket/tags/0.6.0.1/usocket.lisp $
See LICENSE for licensing information.
Iff an external-format was passed to `socket-connect' or `socket-listen'
the stream is a flexi-stream. Otherwise the stream is implementation
specific."
implementation specific
the list of all usockets... | $ I d : usocket.lisp 680 2012 - 01 - 20 23:38:00Z hhubner $
(in-package :usocket)
(defparameter *wildcard-host* #(0 0 0 0)
"Hostname to pass when all interfaces in the current system are to be bound.")
(defparameter *auto-port* 0
"Port number to pass when an auto-assigned port number is wanted.")
(defconstan... |
28e3aacceeb1519871ff8cb9e137901aa2a19c8b2e8a71e7d6d76313b3d88833 | haroldcarr/learn-haskell-coq-ml-etc | Lib.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RankNTypes #
# LANGUAGE TypeApplications #
# LANGUAGE ScopedTypeVariables #
module Lib where
import qualified Crypto.Sodium.Hash
import qualified Crypto.Sodium.Init
import qualified Crypto... | null | https://raw.githubusercontent.com/haroldcarr/learn-haskell-coq-ml-etc/76c40f281c3ef873f9cd5ba4ea77a7e9dcfc9664/haskell/topic/cryptography/hc-lib-sodium/src/Lib.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE OverloadedStrings #
import qualified Crypto.Sodium.Encrypt.Symmetric.Stream
----------------------------------------------------------------------------
------------------------------------------------
Crypto.Sodium.Encrypt.Public
NOTE: if sk/pk reversed, compiler does no... | # LANGUAGE LambdaCase #
# LANGUAGE RankNTypes #
# LANGUAGE TypeApplications #
# LANGUAGE ScopedTypeVariables #
module Lib where
import qualified Crypto.Sodium.Hash
import qualified Crypto.Sodium.Init
import qualified Crypto.Sodium.Key
import qualified Crypto.Sodium.Mac
import qualified Crypto.So... |
2581cb7af4cf59c97f93500b0efa4427ecd55e47ba9aefb0a460dcacc6e0031a | jaspervdj/patat | Read.hs | -- | Read a presentation from disk.
{-# LANGUAGE BangPatterns #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
module Patat.Presentation.Read
( readPresentation
-- Exposed for testing mostly.
, readMetaSettings
) where
---------------------... | null | https://raw.githubusercontent.com/jaspervdj/patat/9e0d0ccde9afee07ea23521546c406033afeb4f9/lib/Patat/Presentation/Read.hs | haskell | | Read a presentation from disk.
# LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings #
Exposed for testing mostly.
------------------------------------------------------------------------------
------------------------------------------------------------------------------
-------------------------------------... | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
module Patat.Presentation.Read
( readPresentation
, readMetaSettings
) where
import Control.Monad.Except (ExceptT (..), runExceptT,
throwError)
import Control.Mon... |
7b3dff66a66e0c92c467bf6f504df634e3054f0958fd42a46ecd824092ed6efc | brunjlar/simple-plutus | Hash.hs | {-# LANGUAGE DerivingStrategies #-}
# LANGUAGE GeneralizedNewtypeDeriving #
module Plutus.Hash
( Hash
, hash
) where
import qualified Crypto.Hash as C
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
newtype Hash = Hash (C.Digest C.MD5)
deriving newtype... | null | https://raw.githubusercontent.com/brunjlar/simple-plutus/20fe63533cb5006e4dabce09ef02c3bd960fd3bb/src/Plutus/Hash.hs | haskell | # LANGUAGE DerivingStrategies # | # LANGUAGE GeneralizedNewtypeDeriving #
module Plutus.Hash
( Hash
, hash
) where
import qualified Crypto.Hash as C
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
newtype Hash = Hash (C.Digest C.MD5)
deriving newtype (Show, Eq, Ord)
hash :: Show a => a -> Has... |
a42d2297d889022b16e17db8169d1b7bf899f9ef861957b85351df4a5265b441 | MyDataFlow/ttalk-server | run_common_test.erl | -module(run_common_test).
-export([main/1, analyze/2]).
-define(CT_DIR, filename:join([".", "tests"])).
-define(CT_REPORT, filename:join([".", "ct_report"])).
%%
%% Entry
%%
-record(opts, {test,
spec,
cover,
preset = all}).
%% Accepted options formatted as:
{ opt_name... | null | https://raw.githubusercontent.com/MyDataFlow/ttalk-server/07a60d5d74cd86aedd1f19c922d9d3abf2ebf28d/test/ejabberd_tests/run_common_test.erl | erlang |
Entry
Accepted options formatted as:
"=" is an invalid character in option name or value.
Waiting for messages to be flushed
Waiting for messages to be flushed
Helpers
| -module(run_common_test).
-export([main/1, analyze/2]).
-define(CT_DIR, filename:join([".", "tests"])).
-define(CT_REPORT, filename:join([".", "ct_report"])).
-record(opts, {test,
spec,
cover,
preset = all}).
{ opt_name , , fun value_sanitizer/1 } .
-spec value_san... |
430e1ced0233c8cff50761a356c4aa17947580238aed1b863455c5021eed304b | thosmos/riverdb | dnd.cljs | (ns theta.ui.dnd
(:require
[com.fulcrologic.fulcro.dom :as dom]
[com.fulcrologic.fulcro.components :as comp :refer [defsc]]
[com.fulcrologic.fulcro.algorithms.react-interop :as interop]))
[ " react - beautiful - dnd " : refer [ DragDropContext ] ] ) )
;import * as React from 'react';
;import { Droppabl... | null | https://raw.githubusercontent.com/thosmos/riverdb/b47f01a938da26298ee7924c8b2b3a2be5371927/src/main/theta/ui/dnd.cljs | clojure | import * as React from 'react';
import { Droppable } from 'react-beautiful-dnd';
export default (props: any) =>
<Droppable droppableId={props.droppableId}>
{(provided: any) => (
<div className={props.className}
ref={provided.innerRef}
{...provided.dropp... | (ns theta.ui.dnd
(:require
[com.fulcrologic.fulcro.dom :as dom]
[com.fulcrologic.fulcro.components :as comp :refer [defsc]]
[com.fulcrologic.fulcro.algorithms.react-interop :as interop]))
[ " react - beautiful - dnd " : refer [ DragDropContext ] ] ) )
( def factory ( interop / react - factory ) )
( d... |
8d7c49e3b446d4311ad8dbeb3e8813ec125b0cc7a53a726c2a264bd71fe9e736 | jerrypnz/clj.tr069 | schema_test.clj | (ns clj.tr069.schema-test
(:use clojure.test
clj.tr069.schema
clj.tr069.databinding)
(:import (clj.tr069.schema Inform
Device
DeviceId
ParameterValueStruct)))
(def test-inform-object
{:device-id {:oui "09cafe"
... | null | https://raw.githubusercontent.com/jerrypnz/clj.tr069/5f3361490b3c69d43842e68f74cd92b6b90cd7cd/test/clj/tr069/schema_test.clj | clojure | (ns clj.tr069.schema-test
(:use clojure.test
clj.tr069.schema
clj.tr069.databinding)
(:import (clj.tr069.schema Inform
Device
DeviceId
ParameterValueStruct)))
(def test-inform-object
{:device-id {:oui "09cafe"
... | |
cd75dcf8a27869dbad8f207078720d3bc8412f8c08030d3ab9fc13227b14447c | stofel/ecldb | ecldb_ring.erl | %%
%% Hash ring module
%%
-module(ecldb_ring).
-include("../include/ecldb.hrl").
-export([
new/0,
ring_size/1,
add_domain/2, %% Add domain to ring
add_domain/3,
del_domain/2, %% Del domain from ring
del_domain/3,
list_domains/1,
list_nodes/1,
route/2, route/3,
, route_secon... | null | https://raw.githubusercontent.com/stofel/ecldb/2d707b3dad0212c417594c2f93cf1beefc5ee342/src/ecldb_ring.erl | erlang |
Hash ring module
Add domain to ring
Del domain from ring
% TODO
-export([new/2, new/3, insert/3, bulk_insert/2, append/3, find/2, foldl/3]).
-export([next/2, next_nth/3, first/1, last/1, delete/2, compact/1, cas/4, update/4]).
-export([merge/2, intersection/1, intersection/2]).
}}}
ADD & DEL {{{
add N domai... |
-module(ecldb_ring).
-include("../include/ecldb.hrl").
-export([
new/0,
ring_size/1,
add_domain/3,
del_domain/3,
list_domains/1,
list_nodes/1,
route/2, route/3,
r/2, r/3
]).
-compile({no_auto_import, [size/1]}).
Bisect exports { { {
-export([serialize/1 , deserialize/1 , from_... |
f22d12376b286a6d3e9c0be8a8f1afe1eb5a9812eca08c9174cae0073615217f | astampoulis/makam | myocamlbuild.ml | OASIS_START
OASIS_STOP
open Ocamlbuild_plugin;;
open Command;;
dispatch begin function
| After_rules ->
Ocamlbuild_js_of_ocaml.dispatcher After_rules ;
let parsers = [ A"-I"; A"+camlp4/Camlp4Parsers"] in
flag ["ocaml"; "compile"; "parsers"] (S parsers);
rule "Bootstrap PEG parser generation ... | null | https://raw.githubusercontent.com/astampoulis/makam/bf7ed7592c21e0439484d7464e659eca5be3b2f9/myocamlbuild.ml | ocaml | OASIS_START
OASIS_STOP
open Ocamlbuild_plugin;;
open Command;;
dispatch begin function
| After_rules ->
Ocamlbuild_js_of_ocaml.dispatcher After_rules ;
let parsers = [ A"-I"; A"+camlp4/Camlp4Parsers"] in
flag ["ocaml"; "compile"; "parsers"] (S parsers);
rule "Bootstrap PEG parser generation ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.