_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 |
|---|---|---|---|---|---|---|---|---|
6b3206567b490df72b3ec22f68d8edca10b4a1b0ace84cf2a375739071231ba2 | PrecursorApp/precursor | stripe.clj | (ns pc.stripe
(:require [cheshire.core :as json]
[clj-http.client :as http]
[clj-time.core :as time]
[clj-time.coerce]
[clojure.set :as set]
[clojure.tools.logging :as log]
[pc.profile :as profile]
[pc.utils :as utils]
[pc... | null | https://raw.githubusercontent.com/PrecursorApp/precursor/30202e40365f6883c4767e423d6299f0d13dc528/src/pc/stripe.clj | clojure | Prerequisites:
clj-http: -http
Stripe API: | (ns pc.stripe
(:require [cheshire.core :as json]
[clj-http.client :as http]
[clj-time.core :as time]
[clj-time.coerce]
[clojure.set :as set]
[clojure.tools.logging :as log]
[pc.profile :as profile]
[pc.utils :as utils]
[pc... |
6dc1a8b0d537c35a5de0e6bbf0035c15af330b3c224486e54808c16d6833f239 | linearray/mealstrom | CommonDefs.hs | |
Module : CommonDefs
Description : Some things that sometimes come in handy .
Copyright : ( c ) , 2016
License : MIT
Maintainer :
Module : CommonDefs
Description : Some things that sometimes come in handy.
Copyright : (c) Max Amanshauser, 2016
License : MIT
Maintainer :
-}
m... | null | https://raw.githubusercontent.com/linearray/mealstrom/802bc8c06734d447c1193359a6a853da9c578176/test/CommonDefs.hs | haskell | |Don't ever use this in production :^) | |
Module : CommonDefs
Description : Some things that sometimes come in handy .
Copyright : ( c ) , 2016
License : MIT
Maintainer :
Module : CommonDefs
Description : Some things that sometimes come in handy.
Copyright : (c) Max Amanshauser, 2016
License : MIT
Maintainer :
-}
m... |
192a94a00dfb7c5e0487b934c58abdf2fb8395054bbf8a874f3c5bcde2de1dfd | ocsigen/ocsigenserver | ocsigen_parseconfig.ml | Ocsigen
*
* Module ocsigen_parseconfig.ml
* Copyright ( C ) 2005 - 2008 , ,
*
* 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 , with linking exception ;
*... | null | https://raw.githubusercontent.com/ocsigen/ocsigenserver/d468cf464dcc9f05f820c35f346ffdbe6b9c7931/src/server/ocsigen_parseconfig.ml | ocaml | ****************************************************************
* Config file parsing
ll
Multiple server not supported any more
nouveau at the end
default = "*:*"
Extract a default hostname from the "host" field if no default is
provided
default site for host
We do not reload extensions
The evaluati... | Ocsigen
*
* Module ocsigen_parseconfig.ml
* Copyright ( C ) 2005 - 2008 , ,
*
* 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 , with linking exception ;
*... |
2b6a1b7208435c4d89cbb617c1549dbfe204e64a2f5f6302f3bd8432b4ca4503 | simplegeo/erlang | erl_internal_SUITE.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1999 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/simplegeo/erlang/15eda8de27ba73d176c7eeb3a70a64167f50e2c4/lib/stdlib/test/erl_internal_SUITE.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 1999 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(erl_internal_SUITE).
-export([all/... |
eb187c877cb84700f9070e9563bc57b427e0c71d0f470555f5e07362c6898279 | haskell-compat/deriving-compat | Internal.hs | # LANGUAGE CPP #
|
Module : Data . Bounded . Deriving . Internal
Copyright : ( C ) 2015 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Portability : Template Haskell
Exports functions to mechanically derive ' Bounded ' instances .
Note : this is an internal modul... | null | https://raw.githubusercontent.com/haskell-compat/deriving-compat/23e62c003325258e925e6c2fe7e46fafdeaf199a/src/Data/Bounded/Deriving/Internal.hs | haskell | * 'Bounded'
-----------------------------------------------------------------------------
Code generation
-----------------------------------------------------------------------------
| Generates a 'Bounded' instance declaration for the given data type or data
family instance.
requiring a 'Bounded' instance).
req... | # LANGUAGE CPP #
|
Module : Data . Bounded . Deriving . Internal
Copyright : ( C ) 2015 - 2017
License : BSD - style ( see the file LICENSE )
Maintainer :
Portability : Template Haskell
Exports functions to mechanically derive ' Bounded ' instances .
Note : this is an internal modul... |
40d5bc28b354b0ed31e90cff80bdf09469e6c20fc9c80ba9fca58b4c6424a936 | metosin/kekkonen | project.clj | (defproject sample "0.1.0-SNAPSHOT"
:description "Hello World with Kekkonen"
:dependencies [[org.clojure/clojure "1.7.0"]
[http-kit "2.1.19"]
[metosin/kekkonen "0.5.3-SNAPSHOT"]]
:repl-options {:init-ns sample.handler})
| null | https://raw.githubusercontent.com/metosin/kekkonen/5a38c52af34a0eb0f19d87e9f549e93e6d87885f/examples/hello-world/project.clj | clojure | (defproject sample "0.1.0-SNAPSHOT"
:description "Hello World with Kekkonen"
:dependencies [[org.clojure/clojure "1.7.0"]
[http-kit "2.1.19"]
[metosin/kekkonen "0.5.3-SNAPSHOT"]]
:repl-options {:init-ns sample.handler})
| |
edc5a262a0180ee2bbc103b7d40c1b84566c93a3f64bea077645ffe1c78ae904 | oblivia-simplex/roper | ropush-gad.lisp | (in-package :ropush)
(use-package :phylostructs)
(use-package :unicorn)
(use-package :hatchery)
(defmacro def-gadget-inspector (field-symbol &rest return-types)
(let ((name (intern (format nil "!GADGET-~A" field-symbol)))
(accessor-symbol (intern (format nil "GAD-~A" field-symbol))))
`(progn
(defparamet... | null | https://raw.githubusercontent.com/oblivia-simplex/roper/7714ccf677359126ca82446843030fac89c6655a/lisp/roper/ropush-gad.lisp | lisp | SPECIAL OPS
halt
num
STANDARD OPS
Some operations that seek data from the unicorn ;;;
these can be used as scratch space in runs
* Autoconstruction:
Load untyped stacks with parents
Load :womb code into :code
run :womb code
child is whatever is left in :womb at the end.
-- we can just use :womb for either x... | (in-package :ropush)
(use-package :phylostructs)
(use-package :unicorn)
(use-package :hatchery)
(defmacro def-gadget-inspector (field-symbol &rest return-types)
(let ((name (intern (format nil "!GADGET-~A" field-symbol)))
(accessor-symbol (intern (format nil "GAD-~A" field-symbol))))
`(progn
(defparamet... |
91494792b41ac096b5c99f2a94d6c63664b2e7de7f71efb01555adc3d183bb24 | brendanhay/terrafomo | Lens.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE UndecidableInstances #
|
This module defines the libraries internal notion of lenses and getters which
correspond to Terraform 's notion of arguments and attributes , respectively .
' HasField ' instances are specialized to ' Data . Functor . Identity ' and ' Cons... | null | https://raw.githubusercontent.com/brendanhay/terrafomo/387a0e9341fb9cd5543ef8332dea126f50f1070e/terrafomo/src/Terrafomo/Lens.hs | haskell | * Fields
* Provider
* Resource
* Lifecycle
* Lenses
* Getters
* Generator Specific
| Override provider-specific configuration. If 'Nothing' is specified, the
default provider for the current stage will be used.
| Adds an explicit dependency upon another resource's state reference. The
dependencies will alway... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE UndecidableInstances #
|
This module defines the libraries internal notion of lenses and getters which
correspond to Terraform 's notion of arguments and attributes , respectively .
' HasField ' instances are specialized to ' Data . Functor . Identity ' and ' Cons... |
41bdd3ae81453926abbe8d5b6bea9a721a83b1a50714e642a63c68a12721a26c | didier-wenzek/ocaml-kafka | kafka_async.ml | open Core
open Async
let pending_table = Int.Table.create ~size:(8 * 1024)
type 'a response = ('a, Kafka.error * string) result
type producer = {
handler : Kafka.handler;
pending_msg : unit Ivar.t Int.Table.t;
stop_poll : unit Ivar.t;
}
type consumer = {
handler : Kafka.handler;
start_poll : unit Ivar.t;
... | null | https://raw.githubusercontent.com/didier-wenzek/ocaml-kafka/eeda6d44eab69a9a024e2e476673c4a53d248cf8/lib_async/kafka_async.ml | ocaml | open Core
open Async
let pending_table = Int.Table.create ~size:(8 * 1024)
type 'a response = ('a, Kafka.error * string) result
type producer = {
handler : Kafka.handler;
pending_msg : unit Ivar.t Int.Table.t;
stop_poll : unit Ivar.t;
}
type consumer = {
handler : Kafka.handler;
start_poll : unit Ivar.t;
... | |
42019efa31ae34eeec0f56107e4b67d17c72979c9b83fd1d9b0500a8123c8a26 | digital-asset/ghc | T14048b.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE TypeFamilies #
module T14048b where
import Data.Kind
data family Foo :: Constraint
| null | https://raw.githubusercontent.com/digital-asset/ghc/323dc6fcb127f77c08423873efc0a088c071440a/testsuite/tests/typecheck/should_fail/T14048b.hs | haskell | # LANGUAGE ConstraintKinds # | # LANGUAGE TypeFamilies #
module T14048b where
import Data.Kind
data family Foo :: Constraint
|
85b2b6a5d59ea9c8bd265da89363a498672e661469fe9affa88e66bdfa25e115 | ghcjs/jsaddle-dom | VTTRegion.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.VTTRegion
(newVTTRegion, getTrack, setId, getId, setWidth, getWidth,
setHeight, getHeight, setRegionAnchorX... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/VTTRegion.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/VTTRegion.id Mozilla VTTRegion.id documentation>
| <-US/docs/Web/API/VTTRegion.id Mozilla VTTRegion.id documentation>
| <-US/docs/Web/API/VTTRegion.regionAnchorX Mozilla VTTRegion.regionAnchorX document... | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.VTTRegion
(newVTTRegion, getTrack, setId, getId, setWidth, getWidth,
setHeight, getHeight, setRegionAnchorX, getRegionAnchorX,
setRegionAnchorY, getRegionAnchorY, setViewportAnchorX,
getView... |
396527aae59e2aa9736d7ff004622c7b3485f372a68cabddc5b0dbcb9fa7b6e7 | janestreet/resource_cache | import.ml | open! Core
include Int.Replace_polymorphic_compare
module Rpc = Async_rpc_kernel.Rpc
| null | https://raw.githubusercontent.com/janestreet/resource_cache/e0693f18ad1c66a822a0487e9385a7240dcac99e/src/import.ml | ocaml | open! Core
include Int.Replace_polymorphic_compare
module Rpc = Async_rpc_kernel.Rpc
| |
104edb6d882025e6f13e5ea8ad3a4a7e1e14b6f52a525b21789f4fa6b9bc6e36 | MaskRay/99-problems-ocaml | 18.ml | let rec drop n = function
| [] -> []
| h::t as l -> if n <= 0 then l else drop (n-1) t
let rec take n = function
| [] -> []
| h::t -> if n <= 0 then [] else h :: take (n-1) t
let slice xs b e = take (e-b+1) (drop (b-1) xs)
| null | https://raw.githubusercontent.com/MaskRay/99-problems-ocaml/652604f13ba7a73eee06d359b4db549b49ec9bb3/11-20/18.ml | ocaml | let rec drop n = function
| [] -> []
| h::t as l -> if n <= 0 then l else drop (n-1) t
let rec take n = function
| [] -> []
| h::t -> if n <= 0 then [] else h :: take (n-1) t
let slice xs b e = take (e-b+1) (drop (b-1) xs)
| |
056adc0e3daa31fc0277a5388d8ce93e25360105bbf84956da519e3bd3c7490e | sneeuwballen/zipperposition | bool_selection.ml |
open Logtk
let section = Util.Section.make ~parent:Const.section "bool_sel"
module Lit = Literal
module Pos = Position
module PB = Pos.Build
module BIn = Builtin
module T = Term
(* context sign *)
let pos_ctx = 1
let neg_ctx = pos_ctx lsl 1
let under_equiv_ctx = neg_ctx lsl 1
let sgn_ctx_mask = pos_ctx lor neg_ctx ... | null | https://raw.githubusercontent.com/sneeuwballen/zipperposition/e6105458f9812b38b229d89f407b7f232ccb5c9e/src/prover/bool_selection.ml | ocaml | context sign
direct argument
Zipperposition interprets argument positions
inverted, so we need to convert
them before calling PositionBuilder
avoid computing the set of vars for t
avoid computing the set of vars for t
if t is app_var then return the term itself, but do not recurse
reversing the argu... |
open Logtk
let section = Util.Section.make ~parent:Const.section "bool_sel"
module Lit = Literal
module Pos = Position
module PB = Pos.Build
module BIn = Builtin
module T = Term
let pos_ctx = 1
let neg_ctx = pos_ctx lsl 1
let under_equiv_ctx = neg_ctx lsl 1
let sgn_ctx_mask = pos_ctx lor neg_ctx lor under_equiv_ctx... |
676e8e51ea1a7638a78bf7ac18bd025ea86dd52cc607a666a87960b3f978917f | Incanus3/ExiL | rete-debug.lisp | (in-package :exil-rete)
;; DEBUG:
; uses mop - probably not portable
(defun method-defined-p (name object)
(compute-applicable-methods (ensure-generic-function name) (list object)))
(defun map-rete% (fun rete)
(mapcar fun (rete-nodes rete)))
(defmethod map-rete ((funname symbol) (rete rete))
(map-rete% (lambda... | null | https://raw.githubusercontent.com/Incanus3/ExiL/de0f7c37538cecb7032cc1f2aa070524b0bc048d/src/rete/rete-debug.lisp | lisp | DEBUG:
uses mop - probably not portable | (in-package :exil-rete)
(defun method-defined-p (name object)
(compute-applicable-methods (ensure-generic-function name) (list object)))
(defun map-rete% (fun rete)
(mapcar fun (rete-nodes rete)))
(defmethod map-rete ((funname symbol) (rete rete))
(map-rete% (lambda (node)
(when (method-defined-p funna... |
8c263f1ac7dfb08febcf8b96fc83e8490f971d6d92801692213d4c672c5ad9b6 | lspector/Clojush | novelty.clj | (ns clojush.pushgp.selection.novelty
(:use [clojush random util globals])
(:require [clojure.math.numeric-tower :as math]))
(defn select-individuals-for-novelty-archive
"Returns a number of individuals to be added to the novelty archive. Number
of indviduals are :individuals-for-novelty-archive-per-generation... | null | https://raw.githubusercontent.com/lspector/Clojush/685b991535607cf942ae1500557171a0739982c3/src/clojush/pushgp/selection/novelty.clj | clojure | This is here, instead of below, for speed reasons
Handles equal behaviors, including if both are :no-stack-item
If one has :no-stack-item and the other does not, give max difference
(levenshtein-distance b1 b2)
SYNCHRONIZE
Novelty-by-case for novelty meta-errors | (ns clojush.pushgp.selection.novelty
(:use [clojush random util globals])
(:require [clojure.math.numeric-tower :as math]))
(defn select-individuals-for-novelty-archive
"Returns a number of individuals to be added to the novelty archive. Number
of indviduals are :individuals-for-novelty-archive-per-generation... |
b3a11a35a5baa14ffad9ab5f598160871dc170bfc67370e137e665cc7f415ac9 | malcolmreynolds/GSLL | exponential-power.lisp | Regression test EXPONENTIAL - POWER for GSLL , automatically generated
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST EXPONENTIAL-POWER
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
(LIST 0.09469475592777954d0 -0.06229680875327071d0
1.183985538537803d0 0.5187626019237904d0
0.7053564314063956d0 -0.90333038445698... | null | https://raw.githubusercontent.com/malcolmreynolds/GSLL/2f722f12f1d08e1b9550a46e2a22adba8e1e52c4/tests/exponential-power.lisp | lisp | Regression test EXPONENTIAL - POWER for GSLL , automatically generated
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST EXPONENTIAL-POWER
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
(LIST 0.09469475592777954d0 -0.06229680875327071d0
1.183985538537803d0 0.5187626019237904d0
0.7053564314063956d0 -0.90333038445698... | |
fcfaa469fc904b441824c40e80d028b8371edfccaef96bad5be3c5464a9cfcc0 | Chris00/ocaml-bwrap | bwrap.mli | (** This module launches processes isolated from the main environment
using sandboxing technology. *)
type conf
* Sandbox configuration .
You can create one using the functions below .
Example : [ conf ( ) | > mount " /usr " ] .
You can create one using the functions below.
Example: [conf() |> m... | null | https://raw.githubusercontent.com/Chris00/ocaml-bwrap/63865229dff482f5f0b07fe0aaf3ef667e21a536/src/bwrap.mli | ocaml | * This module launches processes isolated from the main environment
using sandboxing technology.
* Configuration with all sharing disabled and an empty environment.
* Create a configuration with all sharing disabled, mounting in
read-only mode /bin, /usr, /lib, /lib32 and /lib64 (if they exist)
and on tmpfs ... |
type conf
* Sandbox configuration .
You can create one using the functions below .
Example : [ conf ( ) | > mount " /usr " ] .
You can create one using the functions below.
Example: [conf() |> mount "/usr"]. *)
val bare : conf
val conf : ?uid: int -> ?gid: int -> unit -> conf
val share_user : b... |
5ca938da19c305ac5d7516ca05de60774158cfd9ed81b89831042e1656eb9580 | johnwhitington/ocamli | example01.ml | let rec insert x l =
match l with
[] -> [x]
| h::t ->
if x <= h
then x :: h :: t
else h :: insert x t
let rec sort l =
match l with
[] -> []
| h::t -> insert h (sort t)
| null | https://raw.githubusercontent.com/johnwhitington/ocamli/28da5d87478a51583a6cb792bf3a8ee44b990e9f/OCaml%20from%20the%20Very%20Beginning/Chapter%205/example01.ml | ocaml | let rec insert x l =
match l with
[] -> [x]
| h::t ->
if x <= h
then x :: h :: t
else h :: insert x t
let rec sort l =
match l with
[] -> []
| h::t -> insert h (sort t)
| |
8b67d77e1b45e342e6b9aca845e05bda2d625b08a048ce7903e529ca5e5d6945 | polyvios/locksmith | lockalloc.ml |
*
* Copyright ( c ) 2004 - 2007 ,
* Polyvios Pratikakis < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
*
* 1... | null | https://raw.githubusercontent.com/polyvios/locksmith/3a9d60ed9c801d65fbb79e9aa6e7dec68f6289e3/src/lockalloc.ml | ocaml | *************************************************************************** |
*
* Copyright ( c ) 2004 - 2007 ,
* Polyvios Pratikakis < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
*
* 1... |
3dd41dd248642a730b0ec62b0bd6fea9cce1db5458f50476581c72068141fcfc | f-me/carma-public | Util.hs | {-|
Various string helpers used during export process.
-}
module Carma.SAGAI.Util
( padLeft
, padRight
, parseTimestamp
, fvIdent
)
where
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as B8
import Data.Functor
import Data.Time.Clock
import Data.Time.Format
impo... | null | https://raw.githubusercontent.com/f-me/carma-public/82a9f44f7d919e54daa4114aa08dfec58b01009b/tools/sagai-exporter/src/Carma/SAGAI/Util.hs | haskell | |
Various string helpers used during export process.
| Return string required to pad input up to provided length. Length
is calculated using bytes. If input is already not less than
required length, return empty string.
^ Required result length.
^ Padding symbol.
^ Input string.
| Pad input using 'genericPad'... |
module Carma.SAGAI.Util
( padLeft
, padRight
, parseTimestamp
, fvIdent
)
where
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as B8
import Data.Functor
import Data.Time.Clock
import Data.Time.Format
import System.Locale
import Data.Model as Model
genericPad ::... |
88cc83225dcbf7faea9cc64d6fb222a23609f708b6dd486b31758df41041af52 | ritschmaster/caveman2-widgets | util.lisp | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
This file is a part of the - widgets project .
;;
Copyright ( c ) 2016 ( )
LICENSE :
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(in-package :cl-user)
(defpackage caveman2-widgets.util
(:... | null | https://raw.githubusercontent.com/ritschmaster/caveman2-widgets/b58d6115b848ac7192299cbf3767e9eac414dc38/src/util.lisp | lisp |
deleting the standard classes: | This file is a part of the - widgets project .
Copyright ( c ) 2016 ( )
LICENSE :
(in-package :cl-user)
(defpackage caveman2-widgets.util
(:use :cl
:moptilities
:caveman2)
(:export
:+translate+
:*automatically-set-languages*
:*language-key-in-session*
:*application-root*
... |
305aac6653844d92f75a1feeb049e8ce3cb90a5144e2334308f8f5abd41f97d7 | weblocks-framework/weblocks | quickform.lisp |
(in-package :weblocks)
(export '(quickform make-quickform quickform-satisfies))
(defwidget quickform (dataform)
((satisfies :accessor quickform-satisfies
:initform nil
:initarg :satisfies
:documentation "A function that corresponds to the value
of 'satisfies'... | null | https://raw.githubusercontent.com/weblocks-framework/weblocks/fe96152458c8eb54d74751b3201db42dafe1708b/src/widgets/quickform.lisp | lisp |
(in-package :weblocks)
(export '(quickform make-quickform quickform-satisfies))
(defwidget quickform (dataform)
((satisfies :accessor quickform-satisfies
:initform nil
:initarg :satisfies
:documentation "A function that corresponds to the value
of 'satisfies'... | |
44369f6c11b32c7d78b831256f1068e3a346b52467de5977d1abae0cadc2a311 | themetaschemer/malt | B-layer-fns.rkt | #lang racket
(require "../base.rkt")
(require "A-core.ss")
(define line
(λ (xs)
(λ (theta)
(+ (* (ref theta 0) xs) (ref theta 1)))))
(define quad
(λ (x)
(λ (theta)
(let ((a (ref theta 0))
(b (ref theta 1))
(c (ref theta 2)))
(+ (* a (sqr x))
(+ (* b ... | null | https://raw.githubusercontent.com/themetaschemer/malt/78a04063a5a343f5cf4332e84da0e914cdb4d347/malted/B-layer-fns.rkt | racket | #lang racket
(require "../base.rkt")
(require "A-core.ss")
(define line
(λ (xs)
(λ (theta)
(+ (* (ref theta 0) xs) (ref theta 1)))))
(define quad
(λ (x)
(λ (theta)
(let ((a (ref theta 0))
(b (ref theta 1))
(c (ref theta 2)))
(+ (* a (sqr x))
(+ (* b ... | |
25040570e20f122f94fcb84ab97bfa3167f08ba7e66a35e9dce3dc4608001e5e | pink-gorilla/webly | undertow.clj |
;{luminus/ring-undertow-adapter "1.2.0"}
;undertow
;[ring.adapter.undertow :refer [run-undertow]]
;[shadow.cljs.devtools.server :as shadow-server]
; -framework/ring-undertow-adapter
#_(defn run-undertow-server [ring-handler port host api]
(require '[ring.adapter.undertow :refer [run-undertow]])
(let... | null | https://raw.githubusercontent.com/pink-gorilla/webly/d449a506e6101afc16d384300cdebb7425e3a7f3/webserver/src/modular/webserver/undertow.clj | clojure | {luminus/ring-undertow-adapter "1.2.0"}
undertow
[ring.adapter.undertow :refer [run-undertow]]
[shadow.cljs.devtools.server :as shadow-server]
-framework/ring-undertow-adapter
run-undertow (resolve)
:allow-null-path-info true
:join? false
(shadow-server/start!)
(shadow-server/stop!) |
#_(defn run-undertow-server [ring-handler port host api]
(require '[ring.adapter.undertow :refer [run-undertow]])
conn (init-ws! :undertow)]
(info "Starting Undertow web server at port " port " ..")
(run-undertow ring-handler {:port port
:host host
: web... |
99049c4df193dc67ae2061596599caff24dd446f1df68c18eaa0202537d37490 | comby-tools/comby | test_c_separators_alpha.ml | open Core
open Rewriter
open Test_helpers
include Test_alpha
let run source match_template rewrite_template =
C.first ~configuration match_template source
|> function
| Ok result ->
Rewrite.all ~source ~rewrite_template [result]
|> (fun x -> Option.value_exn x)
|> (fun { rewritten_source; _ } -> r... | null | https://raw.githubusercontent.com/comby-tools/comby/7b401063024da9ddc94446ade27a24806398d838/test/common/test_c_separators_alpha.ml | ocaml | open Core
open Rewriter
open Test_helpers
include Test_alpha
let run source match_template rewrite_template =
C.first ~configuration match_template source
|> function
| Ok result ->
Rewrite.all ~source ~rewrite_template [result]
|> (fun x -> Option.value_exn x)
|> (fun { rewritten_source; _ } -> r... | |
fe186c76067e0d881efb89d241b136ea5c974d65c385ceadbbaa1b55382d9ab1 | takikawa/racket-ppa | info.rkt | (module info setup/infotab (#%module-begin (define collection (quote multi)) (define version "8.6") (define deps (quasiquote ("racket-lib" ("racket" #:version (unquote version))))) (define implies (quote (core))) (define pkg-desc "Racket libraries that are currently always available") (define pkg-authors (quote (mflatt... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/5f2031309f6359c61a8dfd1fec0b77bbf9fb78df/share/pkgs/base/info.rkt | racket | (module info setup/infotab (#%module-begin (define collection (quote multi)) (define version "8.6") (define deps (quasiquote ("racket-lib" ("racket" #:version (unquote version))))) (define implies (quote (core))) (define pkg-desc "Racket libraries that are currently always available") (define pkg-authors (quote (mflatt... | |
7c0117c94acd4f53f50fe760669138cf828dafc473218d5843df4f62097fbe1c | bevuta/pepa | search.cljs | (ns pepa.search
(:require [pepa.search.parser :as parser]
[pepa.api :as api]
[clojure.string :as s]
[om.core :as om]
[cljs.core.match]
[cljs.core.async :as async])
(:require-macros [cljs.core.match.macros :refer [match]]
[cljs.core.asyn... | null | https://raw.githubusercontent.com/bevuta/pepa/0a9991de0fd1714515ca3def645aec30e21cd671/src-cljs/pepa/search.cljs | clojure | {:pre [(= Search (type search))]}
TODO: We might want to introduce a search-result-cache.
NOTE: We keep the old results here
Store search in the app state | (ns pepa.search
(:require [pepa.search.parser :as parser]
[pepa.api :as api]
[clojure.string :as s]
[om.core :as om]
[cljs.core.match]
[cljs.core.async :as async])
(:require-macros [cljs.core.match.macros :refer [match]]
[cljs.core.asyn... |
808e548dbda71bb204ecd3e1c7c0d00368de617132b32d6a15b8ebbb32f44d1f | Opetushallitus/ataru | modal.cljs | (ns ataru.virkailija.views.modal
(:require [ataru.cljs-util :as cljs-util]))
(defn modal
[close-handler content]
[:div.virkailija-modal__backdrop
[:div.virkailija-modal__container
[:div.virkailija-modal__close-link-container
[:button.virkailija-close-button
{:on-click close-handler}
[:i.z... | null | https://raw.githubusercontent.com/Opetushallitus/ataru/2d8ef1d3f972621e301a3818567d4e11219d2e82/src/cljs/ataru/virkailija/views/modal.cljs | clojure | (ns ataru.virkailija.views.modal
(:require [ataru.cljs-util :as cljs-util]))
(defn modal
[close-handler content]
[:div.virkailija-modal__backdrop
[:div.virkailija-modal__container
[:div.virkailija-modal__close-link-container
[:button.virkailija-close-button
{:on-click close-handler}
[:i.z... | |
aa2bdd654eb842d9e033453b7003df7ee483a5404b478e246ab8a59d0b2c80f4 | nasa/Common-Metadata-Repository | collection_query_resolver.clj | (ns cmr.search.services.query-walkers.collection-query-resolver
"Defines protocols and functions to resolve collection query conditions"
(:require [cmr.search.models.query :as qm]
[cmr.common-app.services.search.query-model :as cqm]
[cmr.common-app.services.search.group-query-conditions :as ... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/cc56dd75c4c78c07e4a4d209bdd1759c39265964/search-app/src/cmr/search/services/query_walkers/collection_query_resolver.clj | clojure |
This is where the real merging happens. Collection queries at the same level in an AND or OR
can be merged together.
and operation
Use collection ids in the context to modify the condition that's executed.
The collection ids in the context is an empty set. This query can match
nothing.
It's possible that man... | (ns cmr.search.services.query-walkers.collection-query-resolver
"Defines protocols and functions to resolve collection query conditions"
(:require [cmr.search.models.query :as qm]
[cmr.common-app.services.search.query-model :as cqm]
[cmr.common-app.services.search.group-query-conditions :as ... |
fa861c0a383279b6102fc5288718e277f444542d8c3cd62052307c3168065f51 | lambdaclass/riak_core_tutorial | key_value_SUITE.erl | -module(key_value_SUITE).
-include_lib("common_test/include/ct.hrl").
-compile(export_all).
all() ->
[ping_test, key_value_test, coverage_test].
This is needed because the ct_slave is being deprecated in OTP 25 ,
and will be removed in OTP 27 . Its replacement is the peer module .
-if(?OTP_RELEASE >= 25).
... | null | https://raw.githubusercontent.com/lambdaclass/riak_core_tutorial/45245d92e080032696e6cee1dbe5741abd7a986d/test/key_value_SUITE.erl | erlang | Need to set the code path so the same modules are available in the slave
Arguments to set up the node
which starts a peer node following Common Tests'
conventions.
set the required environment for riak core
start the rc_example app
get from any of the nodes
test reset and delete
clear, should contain no keys a... | -module(key_value_SUITE).
-include_lib("common_test/include/ct.hrl").
-compile(export_all).
all() ->
[ping_test, key_value_test, coverage_test].
This is needed because the ct_slave is being deprecated in OTP 25 ,
and will be removed in OTP 27 . Its replacement is the peer module .
-if(?OTP_RELEASE >= 25).
... |
f3269cad7ec70e0830fddf4ec7fcb15bda582f5b969f9f0c5e2cfda79f59a2f9 | pepeiborra/term | Env.hs | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
module Control.Monad.Env where
import Control.Monad.List (ListT)
import Control.Monad.RWS (RWST)
import Control.Monad.Reader (ReaderT)
import Control.Monad.State (StateT)
import Control.Monad.Writ... | null | https://raw.githubusercontent.com/pepeiborra/term/7644e0f8fbc81754fd5255602dd1f799adcd5938/Control/Monad/Env.hs | haskell | | A monad for computations in an environment
| Fixpoint recursive lookup of a variable in the environment
| Fixpoint recursive lookup and mapping of variables in a term
------------------------------
------------------------------ | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeFamilies #
module Control.Monad.Env where
import Control.Monad.List (ListT)
import Control.Monad.RWS (RWST)
import Control.Monad.Reader (ReaderT)
import Control.Monad.State (StateT)
import Control.Monad.Writ... |
7c102f931f16903d1beb37740046839f61994fa165b769744db8c96ea14658af | atolab/yaks-common | yaks_types.mli | open Yaks_common_errors
module Path = Apero.Path
module Selector : sig
type t
val of_string : string -> t
(** [of_string s] validate the format of the string [s] as a selector and returns a Selector if valid.
If the validation fails, an [YException] is raised. *)
val of_string_opt : string -> ... | null | https://raw.githubusercontent.com/atolab/yaks-common/39d95312ffeb7cc354ff2965872f6669222eb0ba/lib/yaks_types.mli | ocaml | * [of_string s] validate the format of the string [s] as a selector and returns a Selector if valid.
If the validation fails, an [YException] is raised.
* [of_string_opt s] validate the format of the string [s] as a selector and returns some Selector if valid.
If the validation fails, None is returned.
* ... | open Yaks_common_errors
module Path = Apero.Path
module Selector : sig
type t
val of_string : string -> t
val of_string_opt : string -> t option
val to_string : t -> string
val of_path : ?predicate:string -> ?properties:string -> ?fragment:string -> Path.t -> t
val with_path : Path.t -> t -> t
... |
b7dd2b572ee0907c8611483f68f7ea644b6dfdcb1a2f496512b53b212db07375 | Clozure/ccl-tests | oneplus.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Mon Sep 1 19:53:34 2003
Contains : Tests of 1 +
(in-package :cl-test)
(compile-and-load "numbers-aux.lsp")
(deftest 1+.error.1
(signals-error (1+) program-error)
t)
(deftest 1+.error.2
(signals-error (1+ 0 0) program-error)
t)
(deftest 1+.error.3
... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/oneplus.lsp | lisp | -*- Mode: Lisp -*-
Complex numbers | Author :
Created : Mon Sep 1 19:53:34 2003
Contains : Tests of 1 +
(in-package :cl-test)
(compile-and-load "numbers-aux.lsp")
(deftest 1+.error.1
(signals-error (1+) program-error)
t)
(deftest 1+.error.2
(signals-error (1+ 0 0) program-error)
t)
(deftest 1+.error.3
(signals-error (1+ 0 nil... |
917546397b0ccc3de9d3ad7aa4eaad8171655e8c7e935311bd370bd44fe54b46 | uim/uim | viqr.scm | ;;;
Copyright ( c ) 2003 - 2013 uim Project
;;;
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
1 . Redistributions of source code must retain the above copyright
;;; notice, t... | null | https://raw.githubusercontent.com/uim/uim/d1ac9d9315ff8c57c713b502544fef9b3a83b3e5/scm/viqr.scm | scheme |
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the following disclaimer in the
documen... | Copyright ( c ) 2003 - 2013 uim Project
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
3 . Neither the name of authors nor the names of its contributors
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTOR... |
a07d0c62b73ffa62e1b6e28fab4600b486af94c6866a6aada602c7a8316b1ad8 | ghcjs/jsaddle-dom | EventTargetClosures.hs | module JSDOM.EventTargetClosures
( EventName(..)
, SaferEventListener(..)
, eventNameString
, unsafeEventName
, unsafeEventNameAsync
, eventListenerNew
, eventListenerNewSync
, eventListenerNewAsync
, eventListenerRelease) where
import Control.Applicative ((<$>))
import JSDOM.Types
import Language.Ja... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/EventTargetClosures.hs | haskell | {-# INLINE fromJSVal #-} | module JSDOM.EventTargetClosures
( EventName(..)
, SaferEventListener(..)
, eventNameString
, unsafeEventName
, unsafeEventNameAsync
, eventListenerNew
, eventListenerNewSync
, eventListenerNewAsync
, eventListenerRelease) where
import Control.Applicative ((<$>))
import JSDOM.Types
import Language.Ja... |
dfb406caefec8c31a45d54629181a2f80867d6402a5ca47dcad17ace054eff7a | racket/scribble | lang.rkt | #lang racket/base
(require scribble/doclang
scribble/core
scribble/base
scribble/sigplan
scribble/latex-prefix
racket/list
"../private/defaults.rkt"
(for-syntax racket/base))
(provide (except-out (all-from-out scribble/doclang) #%module-begin)
(all... | null | https://raw.githubusercontent.com/racket/scribble/beb2d9834169665121d34b5f3195ddf252c3c998/scribble-lib/scribble/sigplan/lang.rkt | racket | Skip intraline whitespace to find options:
The docs for the times.sty package suggests that it should not be used
so maybe we want to disable it permanently (or replace it with something else).
Read here for more:
-archive/macros/latex/required/psnfss/psnfss2e.pdf
re-defines commands. | #lang racket/base
(require scribble/doclang
scribble/core
scribble/base
scribble/sigplan
scribble/latex-prefix
racket/list
"../private/defaults.rkt"
(for-syntax racket/base))
(provide (except-out (all-from-out scribble/doclang) #%module-begin)
(all... |
a7380f713995fe7765040d405852a2cb8cf6ea890cc98e0886eae5b5afc49b9e | NorfairKing/the-notes | BayesianNetwork.hs | module Probability.BayesianNetwork where
import Notes
import GraphTheory.Terms
import Probability.ConditionalProbability.Macro
import Probability.Independence.Terms
import Probability.ProbabilityMeasure.Macro
import Probability.RandomVariable.Macro
import ... | null | https://raw.githubusercontent.com/NorfairKing/the-notes/ff9551b05ec3432d21dd56d43536251bf337be04/src/Probability/BayesianNetwork.hs | haskell | module Probability.BayesianNetwork where
import Notes
import GraphTheory.Terms
import Probability.ConditionalProbability.Macro
import Probability.Independence.Terms
import Probability.ProbabilityMeasure.Macro
import Probability.RandomVariable.Macro
import ... | |
f67fa58bd31c030e9c9dfffba1ac99d8b251c4cd7ee5191d9edb03d003800cd6 | lispnik/cl-http | exports.lisp | -*- Mode : lisp ; Syntax : ansi - common - lisp ; Package : http ; Base : 10 -*-
(in-package :HTTP)
Make minimum CL - HTTP export for LispWorks UNIX .
;;; This file must be loaded after the default configuration file
;;;-------------------------------------------------------------------
;;;
;;; LW EXPORTS
;;;
... | null | https://raw.githubusercontent.com/lispnik/cl-http/84391892d88c505aed705762a153eb65befb6409/lw/examples/exports.lisp | lisp | Syntax : ansi - common - lisp ; Package : http ; Base : 10 -*-
This file must be loaded after the default configuration file
-------------------------------------------------------------------
LW EXPORTS
export lw-specific sources. |
(in-package :HTTP)
Make minimum CL - HTTP export for LispWorks UNIX .
(export-url #u"/cl-http/sources/lw/-read-me-.text"
:text-file
:pathname (pathname "http:lw;-read-me-.text")
:expiration `(:interval ,(* 15. 60.))
:keywords '(:cl-http :documentation :lisp-works)
... |
a80d43a10fe18c7073f9dddce9f8ce83970bed4fcaa0327681aa85efcddf5ca7 | sneeuwballen/zipperposition | Rewrite.ml |
This file is free software , part of Zipperposition . See file " license " for more details .
* { 1 Rewriting on Terms }
module T = Term
module Fmt = CCFormat
let section = Util.Section.make "rewrite"
let stat_term_rw = Util.mk_stat "rw.steps_term"
let prof_term_rw = ZProf.make "rw.term"
let stat_lit_rw = Util.mk... | null | https://raw.githubusercontent.com/sneeuwballen/zipperposition/333c4a5b0f8a726f414db901a77ca30921178da5/src/core/Rewrite.ml | ocaml | do we rewrite literals of the form [t = u]?
arguments
[length args]
list of clauses
set of rewrite rules.
invariant: all these rules have [term_head = defined_id]
or are equations of type [tau] with [head tau = defined_id]
metadata on positions
* Annotation on IDs that are defined.
ID, number ... |
This file is free software , part of Zipperposition . See file " license " for more details .
* { 1 Rewriting on Terms }
module T = Term
module Fmt = CCFormat
let section = Util.Section.make "rewrite"
let stat_term_rw = Util.mk_stat "rw.steps_term"
let prof_term_rw = ZProf.make "rw.term"
let stat_lit_rw = Util.mk... |
e9f597e7a3dbf4a092855c1e74627b7089662a8f8db38d0fe866f4157925dd84 | tweag/ormolu | infix-out.hs | data Foo a b = a `Foo` b
| null | https://raw.githubusercontent.com/tweag/ormolu/34bdf62429768f24b70d0f8ba7730fc4d8ae73ba/data/examples/declaration/data/infix-out.hs | haskell | data Foo a b = a `Foo` b
| |
0a5ad6f74d644895e2bd1890a373052c622a3f0c8356aeb6382bfcba6f1b7cac | bgusach/exercises-htdp2e | ex-363-to-377.rkt | #lang htdp/isl+
(require test-engine/racket-tests)
(require 2htdp/abstraction)
(require 2htdp/image)
(require 2htdp/universe)
(require racket/string)
# # # Data definitions
An Xexpr.v0 ( short for X - expression ) is a one - item list :
; (cons Symbol '())
An Xexpr.v1 is a list :
( cons Symbol [ List ... | null | https://raw.githubusercontent.com/bgusach/exercises-htdp2e/c4fd33f28fb0427862a2777a1fde8bf6432a7690/4-intertwined-data/ex-363-to-377.rkt | racket | (cons Symbol '())
An Xexpr.v2 is a list:
– (cons Symbol [List-of Xexpr.v2])
– (cons Symbol (cons [List-of Attribute] [List-of Xexpr.v2]))
(cons Symbol (cons String '()))
An Xexpr.v2 is a (cons Symbol XE-Body)
An XE-Body (short for XML expression body)
is one of:
- [List-of Xexpr.v2]
- '(cons [List-of Att... | #lang htdp/isl+
(require test-engine/racket-tests)
(require 2htdp/abstraction)
(require 2htdp/image)
(require 2htdp/universe)
(require racket/string)
# # # Data definitions
An Xexpr.v0 ( short for X - expression ) is a one - item list :
An Xexpr.v1 is a list :
( cons Symbol [ List - of Xexpr.v1 ] )
... |
31a53408ec577d12c5f0deb1e0652040dcf697b6b60fc7f4aa8c2ea3d9dbf8ad | stil4m/project-typo | side_bar.cljs | (ns ui.components.side-bar
(:require [ui.util.routing :as route-util]
[re-frame.core :refer [dispatch]]
[ui.core.routes :as routes]))
(defn leave-channel
[channel]
(fn [e]
(.preventDefault e)
(.stopPropagation e)
(dispatch [:leave-channel channel])))
(defn create-channel
[n... | null | https://raw.githubusercontent.com/stil4m/project-typo/4e343934175f429c8b7870814d569f776203d461/client/ui_src/ui/components/side_bar.cljs | clojure | (ns ui.components.side-bar
(:require [ui.util.routing :as route-util]
[re-frame.core :refer [dispatch]]
[ui.core.routes :as routes]))
(defn leave-channel
[channel]
(fn [e]
(.preventDefault e)
(.stopPropagation e)
(dispatch [:leave-channel channel])))
(defn create-channel
[n... | |
7e1fa0dfd4e59085bf1f840a8ea5e818ff4030490334a7750c6cace512e1c5c8 | returntocorp/semgrep | Analyze_rule.mli | (* A prefilter is a pair containing a function
* that when applied to the content of a file will return whether
* or not we should process the file. False means that we can
* skip the file (or more accurately, it means we can skip this rule
* for this file, and if there are no more rules left for this target file,
... | null | https://raw.githubusercontent.com/returntocorp/semgrep/70af5900482dd15fcce9b8508bd387f7355a531d/src/optimizing/Analyze_rule.mli | ocaml | A prefilter is a pair containing a function
* that when applied to the content of a file will return whether
* or not we should process the file. False means that we can
* skip the file (or more accurately, it means we can skip this rule
* for this file, and if there are no more rules left for this target file,
*... | type prefilter = Semgrep_prefilter_t.formula * (string -> bool)
This function analyzes a rule and returns optionaly a prefilter .
*
* The return prefilter relies on a formula of
* regexps that we try to extract from the rule . For example , with :
* pattern - either : foo ( )
* pattern - either ... |
917124633e8b68d03fc2085f9a076f31fb8bbe00ca93ab2ada81fd09b9f611a4 | debug-ito/greskell | Util.hs | -- |
-- Module: Network.Greskell.WebSocket.Util
-- Description: Common utility
Maintainer : < >
--
-- __Internal module__.
module Network.Greskell.WebSocket.Util
( slurp
, drain
) where
import Data.Monoid ((<>))
import qualified Data.Vector as V
slurp :: Monad m => m (Maybe a) -> m (V.Vecto... | null | https://raw.githubusercontent.com/debug-ito/greskell/ff21b8297a158cb4b5bafcbb85094cef462c5390/greskell-websocket/src/Network/Greskell/WebSocket/Util.hs | haskell | |
Module: Network.Greskell.WebSocket.Util
Description: Common utility
__Internal module__. | Maintainer : < >
module Network.Greskell.WebSocket.Util
( slurp
, drain
) where
import Data.Monoid ((<>))
import qualified Data.Vector as V
slurp :: Monad m => m (Maybe a) -> m (V.Vector a)
slurp act = go mempty
where
go got = do
mres <- act
case mres of
Nothing ->... |
ace1ba121e3082f8bd0f0107d96878c6acc7e978c88782acc27dde7d0b058c9a | racket/data | gvector.rkt | #lang racket/base
;; written by ryanc
(require (for-syntax racket/base
syntax/contract
syntax/for-body)
racket/serialize
racket/contract/base
racket/dict
racket/vector
racket/struct)
(define DEFAULT-CAPACITY 10)
(define (make-gvect... | null | https://raw.githubusercontent.com/racket/data/1fe6cb389ad9a817c6abaff2d8f5ef407b5a16a2/data-lib/data/gvector.rkt | racket | written by ryanc
SLOW!
This does (n - index) redundant copies on resize, but that
happens rarely and I prefer the simpler code.
Shrink when vector length is > SHRINK-ON-FACTOR * #elements
... unless it would shrink to less than SHRINK-MIN
Shrink by SHRINK-BY-FACTOR
SLOW!
creates a snapshot vector
constructs a... | #lang racket/base
(require (for-syntax racket/base
syntax/contract
syntax/for-body)
racket/serialize
racket/contract/base
racket/dict
racket/vector
racket/struct)
(define DEFAULT-CAPACITY 10)
(define (make-gvector #:capacity [capac... |
23a025e95367b3350120393856c32ac2cef53e41935c24180b86bc7bcec0d199 | danielsz/system-websockets | not_found.clj | (ns demo.middleware.not-found
(:require [compojure.response :as compojure]
[ring.util.response :as response]))
(defn wrap-not-found
[handler error-response]
(fn [request]
(or (handler request)
(-> (compojure/render error-response request)
(response/content-type "text/html")
... | null | https://raw.githubusercontent.com/danielsz/system-websockets/70eb6713eaf0d6380894c8fac4d049c3076cb2fd/src/clj/demo/middleware/not_found.clj | clojure | (ns demo.middleware.not-found
(:require [compojure.response :as compojure]
[ring.util.response :as response]))
(defn wrap-not-found
[handler error-response]
(fn [request]
(or (handler request)
(-> (compojure/render error-response request)
(response/content-type "text/html")
... | |
5d8f73ffc48162726496153fc36165494561e8d69fb25f0654986c82c61cd48b | helins/dsim.cljc | dev.cljc | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns dvlopt.dsim.dev
"For daydreaming in the REPL."
(:require [cognitect.transit :as transit]
[dvlopt.dsim ... | null | https://raw.githubusercontent.com/helins/dsim.cljc/ed11e8c93c5382aae79f76bb2ae52e03c8b3a9fc/src/dev/dvlopt/dsim/dev.cljc | clojure | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns dvlopt.dsim.dev
"For daydreaming in the REPL."
(:require [cognitect.transit :as transit]
[dvlopt.dsim ... | |
6f0b2e21fa923e2d4c48a51b99774917cbe43c8ea5fd1bc5acecf93cbdfc0317 | MinaProtocol/mina | rocks_options.ml | open Ctypes
open Foreign
open Rocks_common
module Cache =
struct
type nonrec t = t
let t = t
let get_pointer = get_pointer
let create_no_gc =
(* extern rocksdb_cache_t* rocksdb_cache_create_lru(size_t capacity); *)
foreign
"rocksdb_cache_create_lru"
(Views.int_to_size_t ... | null | https://raw.githubusercontent.com/MinaProtocol/mina/aacd011df47a11412e57251b9ffb197cfad9b888/src/external/ocaml-rocksdb/rocks_options.ml | ocaml | extern rocksdb_cache_t* rocksdb_cache_create_lru(size_t capacity);
extern void rocksdb_cache_destroy(rocksdb_cache_t* cache);
extern void rocksdb_block_based_options_set_block_size(
rocksdb_block_based_table_options_t* options, size_t block_size);
extern void rocksdb_block_based_options_set_block_size_devi... | open Ctypes
open Foreign
open Rocks_common
module Cache =
struct
type nonrec t = t
let t = t
let get_pointer = get_pointer
let create_no_gc =
foreign
"rocksdb_cache_create_lru"
(Views.int_to_size_t @-> returning t)
let destroy =
make_destroy t "rocksdb_cache_destroy... |
662c62096dfa6554ae07738de80d7d14ede0c40d5f67d8e0f032f6e116425ed7 | ParaPhrase/skel | sk_farm_emitter.erl | %%%----------------------------------------------------------------------------
@author < >
2012 University of St Andrews ( See LICENCE )
@headerfile " skel.hrl "
%%%
%%% @doc This module contains the emitter logic of a Farm skeleton.
%%%
%%% A task farm has the most basic kind of stream parallelism - inputs ... | null | https://raw.githubusercontent.com/ParaPhrase/skel/bf55de94e64354592ea335f4375f4b40607baf43/src/sk_farm_emitter.erl | erlang | ----------------------------------------------------------------------------
@doc This module contains the emitter logic of a Farm skeleton.
A task farm has the most basic kind of stream parallelism - inputs are
The emitter takes inputs off the skeleton's input stream and assigns each
@end
---------------------... | @author < >
2012 University of St Andrews ( See LICENCE )
@headerfile " skel.hrl "
sent to one of ` n ' replicas of the inner skeleton for processing .
one to one of the input streams of the ' n ' inner skeletons .
-module(sk_farm_emitter).
-export([
start/1
]).
-include("skel.hrl").
-... |
133e400d9e3bd7f37494536492dc12942e673ca74254d789d80239344ae8047c | bgamari/bayes-stack | DumpCI.hs | {-# LANGUAGE OverloadedStrings #-}
import Data.Monoid
import Data.Foldable
import Data.List
import Data.Function (on)
import Options.Applicative
import qualified Data.Map as M
import qualified Data.Set as S
import qualified Data.ByteString as BS
import qualified Data... | null | https://raw.githubusercontent.com/bgamari/bayes-stack/020df7bb7263104fdea254e57d6c7daf7806da3e/network-topic-models/DumpCI.hs | haskell | # LANGUAGE OverloadedStrings # |
import Data.Monoid
import Data.Foldable
import Data.List
import Data.Function (on)
import Options.Applicative
import qualified Data.Map as M
import qualified Data.Set as S
import qualified Data.ByteString as BS
import qualified Data.Text.Lazy.IO as TL
import qualifie... |
a90b157498d9732028be31a24a638602af9fcd12e741d00e597d828df406db6b | GaloisInc/mistral | Link.hs | # LANGUAGE FlexibleContexts #
module Mistral.CodeGen.Link where
import Mistral.Schedule.Static ( staticSchedule )
import Mistral.Driver
import Mistral.ModuleSystem.Prelude ( prelude )
import Mistral.ModuleSystem.Interface ( Iface(..) )
import Mistral.TypeCheck.AST
import Mistral.Utils.PP
import qualified Data.Set as... | null | https://raw.githubusercontent.com/GaloisInc/mistral/3464ab332d73c608e64512e822fe2b8a619ec8f3/src/Mistral/CodeGen/Link.hs | haskell | | Link a module into a program. The module is expected to have a `main`
schedule, which will be used as the entry point to the whole program.
| Load all module dependencies.
skip the prelude | # LANGUAGE FlexibleContexts #
module Mistral.CodeGen.Link where
import Mistral.Schedule.Static ( staticSchedule )
import Mistral.Driver
import Mistral.ModuleSystem.Prelude ( prelude )
import Mistral.ModuleSystem.Interface ( Iface(..) )
import Mistral.TypeCheck.AST
import Mistral.Utils.PP
import qualified Data.Set as... |
11758023b0b292d901e179c8d19884df5472c026b5df60e627f87e520d71657f | wedesoft/sfsim25 | scale_elevation.clj | (ns sfsim25.scale-elevation
"Convert large elevation image into lower resolution image with half the width and height."
(:require [clojure.math :refer (sqrt round)]
[sfsim25.util :refer (slurp-shorts spit-shorts)]))
(defn scale-elevation
"Program to scale elevation images"
[input-data output-data]
... | null | https://raw.githubusercontent.com/wedesoft/sfsim25/f7e610b523093d00c65ecd9d53dab8c2153eca0f/src/sfsim25/scale_elevation.clj | clojure | (ns sfsim25.scale-elevation
"Convert large elevation image into lower resolution image with half the width and height."
(:require [clojure.math :refer (sqrt round)]
[sfsim25.util :refer (slurp-shorts spit-shorts)]))
(defn scale-elevation
"Program to scale elevation images"
[input-data output-data]
... | |
379fcc57c20dd2caf20bb51e25967ef3c572283f344722094006886f03813c33 | codereport/SICP-2020 | geoffrey_viola_solutions.rkt | #lang racket
(require rackunit)
(require rnrs/mutable-pairs-6)
(require compatibility/mlist)
(require racket/set)
(define (pair-or-mpair x)
(or (pair? x) (mpair? x)))
(define (car-or-mcar x)
(cond ((pair? x) (car x))
((mpair? x) (mcar x))
(error "neither pair nor mpair")))
(define (cdr-or-mcdr x... | null | https://raw.githubusercontent.com/codereport/SICP-2020/2d1e60048db89678830d93fcc558a846b7f57b76/Chapter%203.3%20Solutions/geoffrey_viola_solutions.rkt | racket | infinite
From book
My code
doubly linked list {item, next, prev} | #lang racket
(require rackunit)
(require rnrs/mutable-pairs-6)
(require compatibility/mlist)
(require racket/set)
(define (pair-or-mpair x)
(or (pair? x) (mpair? x)))
(define (car-or-mcar x)
(cond ((pair? x) (car x))
((mpair? x) (mcar x))
(error "neither pair nor mpair")))
(define (cdr-or-mcdr x... |
57a2cc05e47cd6c6bfdf6c29b2f3bdd1f9cc70e9c6761847339ccf2293131ddf | devaspot/brace | jxat_ctx.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2011 ,
%%% @doc
%%%
%%% @end
Created : 29 Dec 2011 by < >
%%%-------------------------------------------------------------------
-module(jxat_ctx).
%% API
-include_lib("eunit/include/eunit.hrl").
%%%============... | null | https://raw.githubusercontent.com/devaspot/brace/8494573efef63f4b2f39dd36e8c651a487223f20/test/jxat_ctx.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
===================================================================
Tests
=================================================================== | @author < >
( C ) 2011 ,
Created : 29 Dec 2011 by < >
-module(jxat_ctx).
-include_lib("eunit/include/eunit.hrl").
test1_test() ->
{ok, Ctx} = 'joxa-cmp-ctx':'start-context'([{attrs, [{foo, bar}]},
{annots, ec_dictionary:new(ec_dict)}]),
?asser... |
14a8b4f90408f85be8ba88e0faa3a61d9872160756d5060d097feea8c6d6b040 | input-output-hk/ouroboros-network | Egress.hs | {-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TypeFamilies #
module Network.Mux.Egress
( muxer
-- $egress
-- $servicingsSemantics
, EgressQueue
, TranslocationServiceRequest (..)
... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/a8c9cfc8636172e519f7522fac04b5f6e476037b/network-mux/src/Network/Mux/Egress.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE RankNTypes #
$egress
$servicingsSemantics
$servicingsSemantics
= Desired Servicing Semantics
== /Constructing Fairness/
In this context we are defining fairness as:
- no starvation
- when presented with equal demand (from a selection of mini
... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE NamedFieldPuns #
# LANGUAGE TypeFamilies #
module Network.Mux.Egress
( muxer
, EgressQueue
, TranslocationServiceRequest (..)
, Wanton (..)
) where
import Control.Monad
import qualified Data.ByteString.Lazy as BL
import Con... |
e1f9b0bd2a88379a5a9080e92eb0ed3ef76faa022e920ba106cc975538461373 | triffon/fp-2022-23 | 03-flip.rkt | #lang racket
(define (flip f)
(lambda (x y) (f y x))) | null | https://raw.githubusercontent.com/triffon/fp-2022-23/2fca66b8c82dca3063b0b6b55a41e4d54defdaee/exercises/inf2/03/03-flip.rkt | racket | #lang racket
(define (flip f)
(lambda (x y) (f y x))) | |
1e44df2dc02b1773e86b7aa97fbddb3c9b3eaca0561810adb8081e5d8e5e6abc | static-analysis-engineering/codehawk | bCHDisassembleVLEInstruction.ml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/87db5929b4e589511d644f84defd1b0a722a05b9/CodeHawk/CHB/bchlibpower32/bCHDisassembleVLEInstruction.ml | ocaml | chutil
bchlib
bchlibpower32
se_rfdi
< 0>< 0>< 0><11> se_rfmci
se_rfmci
se_not rX
se_neg rX
se_mflr rX
se_mtrl rX
< 0>< 0><10><rx> se_mfctr
se_mfctr rX
se_mtctr rX
< 0>< 0><12><rx> se_extzb
se_extzb rX
< 0>< 0><13><rx> se_extsb
se_extsb rX
< 0>< 0><14><rx> se_extzh
se_extzh... | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... |
66eec899595dc51fb0879642976a12522cc140c8439c054447468c35e329eb7b | polytypic/f-omega-mu | Diagnostic.ml | open Rea
open StdlibPlus
open FomPPrint
open FomSource
(* *)
module Kind = struct
include FomAST.Kind
include FomPP.Kind
end
module Label = struct
include FomAST.Label
include FomPP.Label
end
module Exp = struct
module Var = struct
include FomAST.Exp.Var
include FomPP.Exp.Var
end
end
type t = L... | null | https://raw.githubusercontent.com/polytypic/f-omega-mu/bf176d4b1dd7808399a41206876103a5192ef075/src/main/FomDiag/Diagnostic.ml | ocaml |
Syntax errors
Source errors
Kind errors
Type errors | open Rea
open StdlibPlus
open FomPPrint
open FomSource
module Kind = struct
include FomAST.Kind
include FomPP.Kind
end
module Label = struct
include FomAST.Label
include FomPP.Label
end
module Exp = struct
module Var = struct
include FomAST.Exp.Var
include FomPP.Exp.Var
end
end
type t = Loc.t *... |
c3f39d250545ec4adb9032ab9d4cf70544cd039de4f8c028c3edcf194d432c79 | anmonteiro/ocaml-h2 | eio_get.ml | open H2
module Client = H2_eio.Client
let response_handler ~on_eof response response_body =
Format.eprintf "Response: %a@." Response.pp_hum response;
let rec read_response () =
Body.Reader.schedule_read
response_body
~on_eof
~on_read:(fun bigstring ~off ~len ->
Format.eprintf "heh ni... | null | https://raw.githubusercontent.com/anmonteiro/ocaml-h2/5a71d3acbfb081024b1412eb2f867cfd4db9d10e/examples/eio/eio_get.ml | ocaml | open H2
module Client = H2_eio.Client
let response_handler ~on_eof response response_body =
Format.eprintf "Response: %a@." Response.pp_hum response;
let rec read_response () =
Body.Reader.schedule_read
response_body
~on_eof
~on_read:(fun bigstring ~off ~len ->
Format.eprintf "heh ni... | |
18f783609063690570899ffda8f88c5e4ff2d197505c8e87713883a8f4f120b7 | marick/fp-oo | add-and-a-solution.clj | (def add
(fn [this other]
(Point (+ (:x this) (:x other))
(+ (:y this) (:y other)))))
(def add
(fn [this other]
(shifted this (:x other) (:y other))))
(def a
Requires two arguments .
(type arg1 arg2)))
(def a
(fn [type & args]
(apply type args)))
(def Trian... | null | https://raw.githubusercontent.com/marick/fp-oo/434937826d794d6fe02b3e9a62cf5b4fbc314412/from-old-tutorial/add-and-a-solution.clj | clojure | (def add
(fn [this other]
(Point (+ (:x this) (:x other))
(+ (:y this) (:y other)))))
(def add
(fn [this other]
(shifted this (:x other) (:y other))))
(def a
Requires two arguments .
(type arg1 arg2)))
(def a
(fn [type & args]
(apply type args)))
(def Trian... | |
e3af78c4dee04182a41c96fadb5a9865e7e93a5671b26fc1ce13d401b7c9fe6c | polyfy/polylith | core.clj | (ns se.example.user.core)
(defn hello [name]
(str "Hello " name "!!"))
| null | https://raw.githubusercontent.com/polyfy/polylith/febea3d8a9b30a60397594dda3cb0f25154b8d8d/examples/doc-example/components/user/src/se/example/user/core.clj | clojure | (ns se.example.user.core)
(defn hello [name]
(str "Hello " name "!!"))
| |
fd0b0d0f82ab4f84dbae6bcad0d0a78778726c180154430a4515c49285a60188 | TristeFigure/dance | project.clj | (defproject dance "0.2.0-SNAPSHOT"
:description "Advanced tree walking in Clojure"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.0"]
[arity "0.2.0"]
[weaving "0.1.5"]
[threading "0.3.4"]... | null | https://raw.githubusercontent.com/TristeFigure/dance/5e83eea9312776901964a201104d54cec464e6cc/project.clj | clojure | TODO: for shuriken.debug. Backport.
TODO: for the `lay` macro | (defproject dance "0.2.0-SNAPSHOT"
:description "Advanced tree walking in Clojure"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.0"]
[arity "0.2.0"]
[weaving "0.1.5"]
[threading "0.3.4"]... |
326a2b83b661f9970c921df6fe52c3c0daaf8df0e1a1ccc153a9f5134df424ee | biscuit-auth/biscuit-haskell | Example.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE QuasiQuotes #-}
module Auth.Biscuit.Example where
import Data.ByteString (ByteString)
import Data.Functor (($>))
import Data.Maybe (fromMaybe)
import Data.Text (Text)
import Data.Time (getCurrent... | null | https://raw.githubusercontent.com/biscuit-auth/biscuit-haskell/4e8f26e38c71b9f0dadbf27117047b2116eaa641/biscuit/src/Auth/Biscuit/Example.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE QuasiQuotes # | module Auth.Biscuit.Example where
import Data.ByteString (ByteString)
import Data.Functor (($>))
import Data.Maybe (fromMaybe)
import Data.Text (Text)
import Data.Time (getCurrentTime)
import Auth.Biscuit
privateKey' :: SecretKey
private... |
03b21a0bbd68e08b19fc9c2766c87ae5128e36cc750cded2d9ae4373d9b9ef8e | sgbj/MaximaSharp | f2cl-package.lisp | ;; f2cl0.l
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Copyright ( c ) University of Waikato ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
, New Zealand 1992 - 95 - all rights reserved ; ; ; ; ; ; ; ; ; ; ; ; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/src/numerical/f2cl-package.lisp | lisp | f2cl0.l
; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
; ; ; ; ; ; ; ; ; ; ; ;
Constants
User-settable runtime options
Types
Intrinsic functions
other functions
Main routines
-------------------------------------------------------------------------
end of f2cl0.l
$Log: f2cl-package.lisp,v $
code... |
(in-package :common-lisp-user)
(defpackage :f2cl-lib
(:use :cl)
(:documentation "The package holding all symbols used by the Fortran to Lisp library")
(:nicknames :fortran-to-lisp-library)
(:export
#:%false% #:%true%
#:*check-array-bounds*
#:*stop-signals-error-p*
#:integer4 #:integer2 #:integer1 ... |
7953c17503acbe3ae54397fa6645292b77e0f67a1f2294a00968eb79e1e91e0a | uw-unsat/serval | noop.rkt | #lang rosette/safe
(require
serval/lib/unittest
serval/riscv/interp
(prefix-in riscv: serval/riscv/objdump)
(prefix-in noop: "generated/racket/test/noop.asm.rkt")
)
(define (check-noop-riscv)
(define cpu (riscv:init-cpu))
(riscv:interpret-objdump-program cpu noop:instructions)
(check-true (vc-true? (vc)... | null | https://raw.githubusercontent.com/uw-unsat/serval/be11ecccf03f81b8bd0557acf8385a6a5d4f51ed/test/noop.rkt | racket | #lang rosette/safe
(require
serval/lib/unittest
serval/riscv/interp
(prefix-in riscv: serval/riscv/objdump)
(prefix-in noop: "generated/racket/test/noop.asm.rkt")
)
(define (check-noop-riscv)
(define cpu (riscv:init-cpu))
(riscv:interpret-objdump-program cpu noop:instructions)
(check-true (vc-true? (vc)... | |
db0288262682a229ea980bdcafa9558f78498f065dacc21264a8e8900cb63222 | grzm/uri-template | impl.clj | (ns com.grzm.uri-template.impl
(:require
[clojure.string :as str])
(:import
(java.net URLEncoder)
(java.nio.charset StandardCharsets)))
(set! *warn-on-reflection* true)
;;
;;
;;
;;
;;
;;
;;
Internet Engineering Task Force ( IETF )
Request for Comments : 6570 ... | null | https://raw.githubusercontent.com/grzm/uri-template/cb817cfa6eda2b20ca9834b687f543b1927c025d/src/com/grzm/uri_template/impl.clj | clojure |
MITRE
D. Orchard
URI Template
Abstract
range of Uniform Resource Identifiers through variable expansion.
This specification defines the UR... | (ns com.grzm.uri-template.impl
(:require
[clojure.string :as str])
(:import
(java.net URLEncoder)
(java.nio.charset StandardCharsets)))
(set! *warn-on-reflection* true)
Internet Engineering Task Force ( IETF )
Request for Comments : 6570 ... |
bc4fa9bdb2f9159acf905172ec613cb99e6266e8c0d5c097f261253445e3116c | daypack-dev/daypack-lib | test_utils.ml | module Print_utils = struct
let small_nat = QCheck.Print.int
let int64 = Int64.to_string
let int64_set s =
s |> Daypack_lib.Int64_set.to_seq |> List.of_seq |> QCheck.Print.list int64
let int64_int64_option =
QCheck.Print.pair Int64.to_string (QCheck.Print.option Int64.to_string)
let int64_int64_op... | null | https://raw.githubusercontent.com/daypack-dev/daypack-lib/63fa5d85007eca73aa6c51874a839636dd0403d3/tests/test_utils.ml | ocaml | $ | module Print_utils = struct
let small_nat = QCheck.Print.int
let int64 = Int64.to_string
let int64_set s =
s |> Daypack_lib.Int64_set.to_seq |> List.of_seq |> QCheck.Print.list int64
let int64_int64_option =
QCheck.Print.pair Int64.to_string (QCheck.Print.option Int64.to_string)
let int64_int64_op... |
e0bdadfae3215f8bbf19e873dbdf38401a85689f860c860d379094419366e6f7 | lambdageek/unbound-generics | Embed.hs | {-# OPTIONS_HADDOCK show-extensions #-}
-- |
Module : Unbound . Generics . LocallyNameless . Embed
Copyright : ( c ) 2014 ,
-- License : BSD3 (See LICENSE)
Maintainer :
-- Stability : experimental
--
The pattern @'Embed ' t@ contains a term
# LANGUAGE DeriveGeneric , TypeFamilies #
module Unboun... | null | https://raw.githubusercontent.com/lambdageek/unbound-generics/04fe1ba015adccc6965bbeb814bb22357ff91829/src/Unbound/Generics/LocallyNameless/Embed.hs | haskell | # OPTIONS_HADDOCK show-extensions #
|
License : BSD3 (See LICENSE)
Stability : experimental
embedded terms do not bind names along with the rest of the
pattern. For examples, see the tutorial or examples directories.
it is safe to manipulate directly. To create and destruct
(You may also use the... | Module : Unbound . Generics . LocallyNameless . Embed
Copyright : ( c ) 2014 ,
Maintainer :
The pattern @'Embed ' t@ contains a term
# LANGUAGE DeriveGeneric , TypeFamilies #
module Unbound.Generics.LocallyNameless.Embed where
import Control.Applicative (pure, (<$>))
import Control.DeepSeq (NFData(... |
1cab99ea7755dd3deb63db575d57cb49f9a2b9088dd93dc010a94d0e1ada47c4 | heraldry/heraldicon | account.cljs | (ns heraldicon.frontend.account
(:require
[heraldicon.frontend.language :refer [tr]]
[heraldicon.frontend.library.user :as library.user]
[heraldicon.frontend.user.session :as session]
[re-frame.core :as rf]))
(defn not-logged-in []
[:div {:style {:padding "15px"}}
[tr :string.user.message/need-to-be... | null | https://raw.githubusercontent.com/heraldry/heraldicon/4a4d7c860fbe5bed8b0a16acef428b186e27199b/src/heraldicon/frontend/account.cljs | clojure | (ns heraldicon.frontend.account
(:require
[heraldicon.frontend.language :refer [tr]]
[heraldicon.frontend.library.user :as library.user]
[heraldicon.frontend.user.session :as session]
[re-frame.core :as rf]))
(defn not-logged-in []
[:div {:style {:padding "15px"}}
[tr :string.user.message/need-to-be... | |
729af34609b7ca3d5098601748b3a3d9db76e5effc7186aa1c531e527229f4fb | TempusMUD/cl-tempus | act-informative.lisp | (in-package #:tempus)
(defun show-room-obj (object ch stream count)
(let ((non-blank-ldesc (string/= (line-desc-of object) "")))
(when (or non-blank-ldesc (immortalp ch))
(princ "&g" stream)
(if non-blank-ldesc
(princ (line-desc-of object) stream)
(format stream "~a exists here."
... | null | https://raw.githubusercontent.com/TempusMUD/cl-tempus/c5008c8d782ba44373d89b77c23abaefec3aa6ff/src/actions/act-informative.lisp | lisp | Describe soilage
Show alignment flags
You don't see yourself in creature lists
You don't see hiding or sneaking people in other rooms
You might see creatures with infravision
You don't see creatures that you can't see (duh)
... and you don't see utility mobs unless you're immortal
You might not see hiding creat... | (in-package #:tempus)
(defun show-room-obj (object ch stream count)
(let ((non-blank-ldesc (string/= (line-desc-of object) "")))
(when (or non-blank-ldesc (immortalp ch))
(princ "&g" stream)
(if non-blank-ldesc
(princ (line-desc-of object) stream)
(format stream "~a exists here."
... |
592c5df4810939047f30f39947cf9e030ea0406aa83c02c6895bff3be3746ac4 | hmac/kite | ExpandExports.hs | module ExpandExports
( expandExports
) where
-- Given a module, makes all exports explicit by enumerating the top level decls
-- (unless the module already specifies an export list).
import Syn
expandExports :: Module -> Module
expandExports modul | not (null (moduleExports modul)) = modul
... | null | https://raw.githubusercontent.com/hmac/kite/f58758f20310e23cb50eb41537ec04bfa820cc90/src/ExpandExports.hs | haskell | Given a module, makes all exports explicit by enumerating the top level decls
(unless the module already specifies an export list). | module ExpandExports
( expandExports
) where
import Syn
expandExports :: Module -> Module
expandExports modul | not (null (moduleExports modul)) = modul
| otherwise = modul { moduleExports = topLevelDecls modul }
topLevelDecls :: Module -> [(RawName, [RawName])]
topLevelDecls modul... |
a03eafa0f1c9cd18b8b5985e3e2b9cade9215b20e5769be7dc3dbedb3d45742e | Eventuria/demonstration-gsd | Event.hs | # LANGUAGE DuplicateRecordFields #
# LANGUAGE DeriveGeneric #
module Eventuria.Libraries.CQRS.Write.Aggregate.Events.Event where
import Data.Aeson
import Data.Time
import Data.Map
import GHC.Generics
import Eventuria.Libraries.CQRS.Write.Aggregate.Ids.AggregateId
import Eventuria.Libraries.CQRS.Write.Aggregate.Event... | null | https://raw.githubusercontent.com/Eventuria/demonstration-gsd/5c7692b310086bc172d3fd4e1eaf09ae51ea468f/src/Eventuria/Libraries/CQRS/Write/Aggregate/Events/Event.hs | haskell | # LANGUAGE DuplicateRecordFields #
# LANGUAGE DeriveGeneric #
module Eventuria.Libraries.CQRS.Write.Aggregate.Events.Event where
import Data.Aeson
import Data.Time
import Data.Map
import GHC.Generics
import Eventuria.Libraries.CQRS.Write.Aggregate.Ids.AggregateId
import Eventuria.Libraries.CQRS.Write.Aggregate.Event... | |
94bc426ba1c58598ae2999e76c25e01c80aee749974a730675fe66e118002fde | audreyt/openafp | ER.hs |
module OpenAFP.Records.AFP.ER where
import OpenAFP.Types
import OpenAFP.Internals
data ER = ER {
er_Type :: !N3
,er_ :: !N3
,er :: !AStr
} deriving (Show, Typeable)
| null | https://raw.githubusercontent.com/audreyt/openafp/178e0dd427479ac7b8b461e05c263e52dd614b73/src/OpenAFP/Records/AFP/ER.hs | haskell |
module OpenAFP.Records.AFP.ER where
import OpenAFP.Types
import OpenAFP.Internals
data ER = ER {
er_Type :: !N3
,er_ :: !N3
,er :: !AStr
} deriving (Show, Typeable)
| |
90473908961bd667bc4b32fa5dc606a556c8e4407e5dec0b15c150f2f668516c | BinaryAnalysisPlatform/bap-plugins | draw.ml | open Core_kernel
open Bap.Std
open Graphlib.Std
open Color
open Polymorphic_compare
let left_justify =
String.concat_map ~f:(fun c ->
if c = '\n' then "\\l" else Char.to_string c)
* filter html and turn into html align left
let format =
String.concat_map ~f:(function
| '<' -> "<"
| '>' -> "... | null | https://raw.githubusercontent.com/BinaryAnalysisPlatform/bap-plugins/2e9aa5c7c24ef494d0e7db1b43c5ceedcb4196a8/uaf-checker/debugger/draw.ml | ocaml | * grep from the start of a tid to t a newline, and color that. | open Core_kernel
open Bap.Std
open Graphlib.Std
open Color
open Polymorphic_compare
let left_justify =
String.concat_map ~f:(fun c ->
if c = '\n' then "\\l" else Char.to_string c)
* filter html and turn into html align left
let format =
String.concat_map ~f:(function
| '<' -> "<"
| '>' -> "... |
32108f458aadb62128fe656eed320fbea548da03ada30189e79c3e52ab5ff90b | open-company/open-company-web | refresh_button.cljs | (ns oc.web.components.ui.refresh-button
(:require [rum.core :as rum]
[oc.web.lib.utils :as utils]
[oc.web.actions.user :as user-actions]))
(rum/defc refresh-button < rum/static
[{:keys [click-cb message button-copy visible class-name] :or {message "New updates available"
... | null | https://raw.githubusercontent.com/open-company/open-company-web/dfce3dd9bc115df91003179bceb87cca1f84b6cf/src/main/oc/web/components/ui/refresh_button.cljs | clojure | (ns oc.web.components.ui.refresh-button
(:require [rum.core :as rum]
[oc.web.lib.utils :as utils]
[oc.web.actions.user :as user-actions]))
(rum/defc refresh-button < rum/static
[{:keys [click-cb message button-copy visible class-name] :or {message "New updates available"
... | |
0e0765c669606fe9bc29acaf7ecabae630ba2e1ac99b1595a17bd35a130e87a8 | mlabs-haskell/plutus-pioneer-program | Homework1.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeOperators #-}
mo... | null | https://raw.githubusercontent.com/mlabs-haskell/plutus-pioneer-program/b50b196d57dc35559b7526fe17b49dd2ba4790bc/code/week02/src/Week02/Homework1.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeOperators #
Implement the instance! | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
module Week02.Homework1 where
import Control.Monad hiding (fmap)
import Data.Map as Map
import Data.... |
ff2a186c28e2c59aed222f990f5557c1de489c1f5e01f7f3553aebbb5f8a5bd2 | slindley/effect-handlers | FileIx.hs | # LANGUAGE
DataKinds , PolyKinds , TypeOperators , RankNTypes , GADTs ,
FlexibleInstances , UndecidableInstances , ScopedTypeVariables ,
NoMonomorphismRestriction
#
DataKinds, PolyKinds, TypeOperators, RankNTypes, GADTs,
FlexibleInstances, UndecidableInstances, ScopedTypeVariables,
NoMo... | null | https://raw.githubusercontent.com/slindley/effect-handlers/39d0d09582d198dd6210177a0896db55d92529f4/ix/FileIx.hs | haskell | :: (State -> *) -> (State -> *)
pattern FOpen s k = Do (InL (V s :& k)) | # LANGUAGE
DataKinds , PolyKinds , TypeOperators , RankNTypes , GADTs ,
FlexibleInstances , UndecidableInstances , ScopedTypeVariables ,
NoMonomorphismRestriction
#
DataKinds, PolyKinds, TypeOperators, RankNTypes, GADTs,
FlexibleInstances, UndecidableInstances, ScopedTypeVariables,
NoMo... |
75db3a1f6b5d093d407b6e639a7498ced6cc835824ee97e46e892570d755d0d3 | AshleyYakeley/Truth | EntityStorer.hs | module Pinafore.Base.Storable.EntityStorer
( Predicate(..)
, FieldStorer(..)
, ConstructorStorer(..)
, EntityStorer(..)
, StorerMode(..)
, entityStorerToEntity
) where
import Pinafore.Base.Anchor
import Pinafore.Base.Entity
import Pinafore.Base.KnowShim
import Pinafore.Base.Literal
import S... | null | https://raw.githubusercontent.com/AshleyYakeley/Truth/81bd7564de6a3f647c631a248802028bd472a28c/Pinafore/pinafore-base/lib/Pinafore/Base/Storable/EntityStorer.hs | haskell | module Pinafore.Base.Storable.EntityStorer
( Predicate(..)
, FieldStorer(..)
, ConstructorStorer(..)
, EntityStorer(..)
, StorerMode(..)
, entityStorerToEntity
) where
import Pinafore.Base.Anchor
import Pinafore.Base.Entity
import Pinafore.Base.KnowShim
import Pinafore.Base.Literal
import S... | |
8b9310b0b5c2d32cf48d4aed24af701a62c4b026846419b4e3f4a6ad6ce3c7eb | iburzynski/haskell-setup | FizzBuzz.hs | module FizzBuzz where
main :: IO ()
main = do
mapM_ (putStrLn . fizzBuzz) [1 .. 100]
fizzBuzz :: Int -> String
fizzBuzz x
| divis3 x && divis5 x = "FizzBuzz"
| divis3 x = "Fizz"
| divis5 x = "Buzz"
| otherwise = show x
where
divisible m n = n `mod` m == 0
divis3 = divisible 3
divis5 = divisibl... | null | https://raw.githubusercontent.com/iburzynski/haskell-setup/57724c2ff229fdff24c9ca4a02ce600ab05b420c/FizzBuzz.hs | haskell | module FizzBuzz where
main :: IO ()
main = do
mapM_ (putStrLn . fizzBuzz) [1 .. 100]
fizzBuzz :: Int -> String
fizzBuzz x
| divis3 x && divis5 x = "FizzBuzz"
| divis3 x = "Fizz"
| divis5 x = "Buzz"
| otherwise = show x
where
divisible m n = n `mod` m == 0
divis3 = divisible 3
divis5 = divisibl... | |
9e6558fae2a7d3523b44be3bfc03dd97a171480c38f8eb6c711f1689315c7b6f | janestreet/async_udp | test_async_udp.ml | open Core
open Poly
open Async
open Expect_test_helpers_core
open! Import
open Async_udp
module _ = struct
open Private.Ready_iter
module _ = struct
open Ok
let%test_unit _ =
List.iter all ~f:(fun t ->
let i = to_int t in
[%test_result: t] ~expect:t (of_int_exn i);
[%test_re... | null | https://raw.githubusercontent.com/janestreet/async_udp/ef7588b3fcd90af8b7134734b63f759b41bc0b9d/test/test_async_udp.ml | ocaml | We don't close the socket or stop the loop in this test (yet).
Queue up some packets and check that they're received all at once. There's a tiny
element of faith in assuming they'll be queued rather than dropped and that they're
delivered in order. | open Core
open Poly
open Async
open Expect_test_helpers_core
open! Import
open Async_udp
module _ = struct
open Private.Ready_iter
module _ = struct
open Ok
let%test_unit _ =
List.iter all ~f:(fun t ->
let i = to_int t in
[%test_result: t] ~expect:t (of_int_exn i);
[%test_re... |
c07b0ffa7ce1c470af5547880e85a205a5c7a814b655658c44ebf7fde9aff270 | owlbarn/actor | actor_mapre.mli |
* Actor - Parallel & Distributed Engine of Owl System
* Copyright ( c ) 2016 - 2018 < >
* Actor - Parallel & Distributed Engine of Owl System
* Copyright (c) 2016-2018 Liang Wang <>
*)
Data Parallel : Map - Reduce module
val init : string -> string -> unit
val map : ('a -> 'b) -> string -> string
v... | null | https://raw.githubusercontent.com/owlbarn/actor/878f4588f4ee235994bbc4e77648858bb562bdd2/lib/actor_mapre.mli | ocaml | experimental functions
* TODO: sample function |
* Actor - Parallel & Distributed Engine of Owl System
* Copyright ( c ) 2016 - 2018 < >
* Actor - Parallel & Distributed Engine of Owl System
* Copyright (c) 2016-2018 Liang Wang <>
*)
Data Parallel : Map - Reduce module
val init : string -> string -> unit
val map : ('a -> 'b) -> string -> string
v... |
45096d12228de2fe5db6c12f77a6076c71c0adac46c971b7dc7f25fa4a9ee8c1 | anwarmamat/cmsc330spring19-public | smallCTypes.ml | type data_type =
| Int_Type
| Bool_Type
type expr =
| ID of string
| Int of int
| Bool of bool
| Add of expr * expr
| Sub of expr * expr
| Mult of expr * expr
| Div of expr * expr
| Pow of expr * expr
| Greater of expr * expr
| Less of expr * expr
| GreaterEqual of expr * expr
| LessEqual ... | null | https://raw.githubusercontent.com/anwarmamat/cmsc330spring19-public/98af1e8efc3d8756972731eaca19e55fe8febb69/project5/src/smallCTypes.ml | ocaml | For parser termination
True sequencing instead of lists
Here the expr must be an id but students don't know polymorphic variants
Print the result of an expression | type data_type =
| Int_Type
| Bool_Type
type expr =
| ID of string
| Int of int
| Bool of bool
| Add of expr * expr
| Sub of expr * expr
| Mult of expr * expr
| Div of expr * expr
| Pow of expr * expr
| Greater of expr * expr
| Less of expr * expr
| GreaterEqual of expr * expr
| LessEqual ... |
89476d2134789a44102cdfc9340f18b0e2538749ec2e5802afe91abfa8ef0d0d | biocaml/biocaml | gff.mli | * GFF files .
Versions 2 and 3 are supported . The only difference is the
delimiter used for tag - value pairs in the attribute list : [ 3 ] uses
an equal sign , and [ 2 ] uses a space . Version [ 3 ] also has
additional requirements , e.g. the [ feature ] must be a sequence
ontology term... | null | https://raw.githubusercontent.com/biocaml/biocaml/ac619539fed348747d686b8f628e80c1bb8bfc59/lib/unix/gff.mli | ocaml | * The items being output by the parser.
* The errors of the [Gff] module.
* The possible parsing errors.
* The union of all the errors of this module.
* The exception raised by the [*_exn] functions.
* Like [in_channel_to_item_stream] but use exceptions for errors
(raised within [Stream.next]).
* {2 [To_strin... | * GFF files .
Versions 2 and 3 are supported . The only difference is the
delimiter used for tag - value pairs in the attribute list : [ 3 ] uses
an equal sign , and [ 2 ] uses a space . Version [ 3 ] also has
additional requirements , e.g. the [ feature ] must be a sequence
ontology term... |
a1ae8c158c0334f1f64f5e7ff01fc25c518ed46db044e3b5baecc5da1104e43c | camllight/camllight | leave.ml | #open "sys";;
#open "unix";;
let main () =
let hh = int_of_string (sub_string command_line.(1) 0 2)
and mm = int_of_string (sub_string command_line.(1) 2 2) in
let now = localtime(time()) in
let delay = (hh - now.tm_hour) * 3600 + (mm - now.tm_min) * 60 in
if delay <= 0 then begin
print_string "Hey! That... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/contrib/libunix/Examples/leave.ml | ocaml | #open "sys";;
#open "unix";;
let main () =
let hh = int_of_string (sub_string command_line.(1) 0 2)
and mm = int_of_string (sub_string command_line.(1) 2 2) in
let now = localtime(time()) in
let delay = (hh - now.tm_hour) * 3600 + (mm - now.tm_min) * 60 in
if delay <= 0 then begin
print_string "Hey! That... | |
9778801ff1cc506ecea07373b42b6e0c2cb7c53af6326e3de54b5144c782f603 | PacktWorkshops/The-Clojure-Workshop | utils_test_check.clj | (ns coffee-app.utils-test-check
(:require [coffee-app.utils :refer :all]
[clojure.test.check :as tc]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop]
[clojure.test.check.clojure-test :refer [defspec]]))
(defspec display-order-test-check 1000
(prop/fo... | null | https://raw.githubusercontent.com/PacktWorkshops/The-Clojure-Workshop/3d309bb0e46a41ce2c93737870433b47ce0ba6a2/Chapter10/Activity10.01/coffee-app/test/coffee_app/utils_test_check.clj | clojure | (ns coffee-app.utils-test-check
(:require [coffee-app.utils :refer :all]
[clojure.test.check :as tc]
[clojure.test.check.generators :as gen]
[clojure.test.check.properties :as prop]
[clojure.test.check.clojure-test :refer [defspec]]))
(defspec display-order-test-check 1000
(prop/fo... | |
c3f4f8b7d9315bb8babb942464d16e44f05b98a09001c498278e6fcc276737e2 | arcadia-unity/ArcadiaGodot | 3D.clj | (ns arcadia.3D
(:import
[Godot Node GD SceneTree Spatial Vector3 KinematicBody]))
(defn ^Vector3 translation [^Spatial o]
(.origin (.GetGlobalTransform o)))
(defn ^Vector3 local-translation [^Spatial o]
(.Translation o))
(defn ^Vector3 translation! [ o ^Vector3 v]
(let [tx (.GetGlobalTransform o)]
... | null | https://raw.githubusercontent.com/arcadia-unity/ArcadiaGodot/d9881c8132c46f21efde4eb4eb9a534d808cdb20/Source/arcadia/3D.clj | clojure | (ns arcadia.3D
(:import
[Godot Node GD SceneTree Spatial Vector3 KinematicBody]))
(defn ^Vector3 translation [^Spatial o]
(.origin (.GetGlobalTransform o)))
(defn ^Vector3 local-translation [^Spatial o]
(.Translation o))
(defn ^Vector3 translation! [ o ^Vector3 v]
(let [tx (.GetGlobalTransform o)]
... | |
4d5b06138af1e92067f9a774000dbe1e8a46da9ce80cb689dbe39883040bd8e4 | metaocaml/ber-metaocaml | els.ml | (* TEST
* toplevel
*)
Adapted from : An Expressive Language of Signatures
by , and
by Norman Ramsey, Kathleen Fisher and Paul Govereau *)
module type VALUE = sig
a Lua value
the state of a Lua interpreter
type usert (* a user-defined value *)
end;;
module type CORE0 = sig
module V : VALUE
... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/typing-signatures/els.ml | ocaml | TEST
* toplevel
a user-defined value
apply function f in state s to list of args |
Adapted from : An Expressive Language of Signatures
by , and
by Norman Ramsey, Kathleen Fisher and Paul Govereau *)
module type VALUE = sig
a Lua value
the state of a Lua interpreter
end;;
module type CORE0 = sig
module V : VALUE
val setglobal : V.state -> string -> V.value -> unit
five mor... |
32a8c6092a39d753413ba750639e5edc2da0bdd7c5ec8711124ae4f6572a7cd7 | fabiodomingues/clj-depend | foo.clj | (ns module1.controller.foo
(:require [module1.logic.foo :as logic.foo]))
| null | https://raw.githubusercontent.com/fabiodomingues/clj-depend/3f4564cdb62816e8571a8dc7f11bc0f50e112af5/test-resources/without-violations-for-modular-structure/src/module1/controller/foo.clj | clojure | (ns module1.controller.foo
(:require [module1.logic.foo :as logic.foo]))
| |
33f4967451311266cc623df06f15aa8febf251b497c1019ac19025473b2ef441 | intermine/bluegenes | devhome.cljs | (ns bluegenes.pages.developer.devhome
(:require [re-frame.core :as re-frame :refer [subscribe dispatch]]
[bluegenes.pages.developer.events :as events]
[bluegenes.pages.developer.subs :as subs]
[bluegenes.pages.developer.icons :as icons]
[clojure.string :refer [blank?]]
... | null | https://raw.githubusercontent.com/intermine/bluegenes/417ea23b2d00fdca20ce4810bb2838326a09010e/src/cljs/bluegenes/pages/developer/devhome.cljs | clojure | The usual way you'd destroy state is with an event handler
specifically for this, but since this is a "debugging" feature,
and we want to reload the page after, will just do it directly. | (ns bluegenes.pages.developer.devhome
(:require [re-frame.core :as re-frame :refer [subscribe dispatch]]
[bluegenes.pages.developer.events :as events]
[bluegenes.pages.developer.subs :as subs]
[bluegenes.pages.developer.icons :as icons]
[clojure.string :refer [blank?]]
... |
7aeca8783959369514677deb43622e046c457a9f43e346e6e79258b78e76378b | ludat/conferer | Source.hs | -- |
Copyright : ( c ) 2019
-- License: MPL-2.0
Maintainer : < >
-- Stability: stable
-- Portability: portable
--
-- Public API module for Source related features
module Conferer.Source
( Source(..)
, IsSource(..)
, SourceCreator
, module Conferer.Key
) where
import Conferer.Key
import Conferer.Co... | null | https://raw.githubusercontent.com/ludat/conferer/3c2d794a0e109626abb314e802971121dac7d7f9/packages/conferer/src/Conferer/Source.hs | haskell | |
License: MPL-2.0
Stability: stable
Portability: portable
Public API module for Source related features | Copyright : ( c ) 2019
Maintainer : < >
module Conferer.Source
( Source(..)
, IsSource(..)
, SourceCreator
, module Conferer.Key
) where
import Conferer.Key
import Conferer.Config.Internal.Types
import Conferer.Source.Internal
|
162c8b29c58496e8a719debb49e1f9a7ce5b84c0b4bcb87fb3ac6207abd663af | gadfly361/rid3 | b01_make_elem.cljs | (ns rid3.b01-make-elem
(:require
[reagent.core :as reagent]
[rid3.core :as rid3 :refer [rid3->]]
[rid3.basics-util :as util]
))
(def cursor-key :b01-make-elem)
(def height 100)
(def width 100)
(defn example [app-state]
(let [viz-ratom (reagent/cursor app-state [cursor-key])]
(fn [app-state]
... | null | https://raw.githubusercontent.com/gadfly361/rid3/cae79fdbee3b5aba45e29b589425f9a17ef8613b/src/basics/rid3/b01_make_elem.cljs | clojure | This is required to, at a minimum, set the dimensions of
your svg. Think of your `svg` as a whiteboard that you are
going to draw stuff on
Think of pieces as the things you are drawing on your
whiteboard. | (ns rid3.b01-make-elem
(:require
[reagent.core :as reagent]
[rid3.core :as rid3 :refer [rid3->]]
[rid3.basics-util :as util]
))
(def cursor-key :b01-make-elem)
(def height 100)
(def width 100)
(defn example [app-state]
(let [viz-ratom (reagent/cursor app-state [cursor-key])]
(fn [app-state]
... |
35a06c3c7d96ba9fd33aa15a29cb6c37762c037c2b00a0a7c192b9f67b116f75 | bdeket/rktsicm | multimin.rkt | #lang racket/base
(provide (all-defined-out))
(require (only-in "../../rkt/glue.rkt" if false write-line
fix:= fix:+)
"../../general/list-utils.rkt"
"../../kernel-intr.rkt"
"unimin.rkt"
"../extrapolate/re.rkt"
)
bdk ; ; start original file
;;;; MULTIMIN... | null | https://raw.githubusercontent.com/bdeket/rktsicm/225a43bc3d9953f9dbbdbfb2fa4a50028a7a41ce/rktsicm/sicm/numerics/optimize/multimin.rkt | racket | ; start original file
MULTIMIN.SCM -- n-dimensional minimization routines
Nelder-Mead downhill simplex algorithm.
We have a function, f, defined on points in n-space.
The central idea -- We have a simplex of n+1 vertices where f is
known. We want to deform the simplex until it sits on the minimum.
A simplex is... | #lang racket/base
(provide (all-defined-out))
(require (only-in "../../rkt/glue.rkt" if false write-line
fix:= fix:+)
"../../general/list-utils.rkt"
"../../kernel-intr.rkt"
"unimin.rkt"
"../extrapolate/re.rkt"
)
9/22/89 ( gjs ) reduce->a - reduce
... |
6a98ba7de66e615f7336c690aa8f68bd4d77fe148ee2c0adb84c74e94f8ab662 | mortuosplango/frankentone | simplegp.clj | original author : ( ) 20111018
;; based on /
(ns frankentone.genetic.simplegp
(:use [frankentone utils ugens]
[frankentone.genetic analysis simplegp-functions utils])
(:require [incanter core charts stats])
(:import [edu.emory.mathcs.jtransforms.fft FloatFFT_1D]))
(def ^:dynamic random-functions
... | null | https://raw.githubusercontent.com/mortuosplango/frankentone/6602e9623c23f3543b9f779fea7851a043ad7fca/src/frankentone/genetic/simplegp.clj | clojure | based on /
We can now generate and evaluate random small programs, as with:
To help write mutation and crossover functions we'll write a utility
function that injects something into an expression and another that
extracts something from an expression.
Now the mutate and crossover functions are easy to write:
We ... | original author : ( ) 20111018
(ns frankentone.genetic.simplegp
(:use [frankentone utils ugens]
[frankentone.genetic analysis simplegp-functions utils])
(:require [incanter core charts stats])
(:import [edu.emory.mathcs.jtransforms.fft FloatFFT_1D]))
(def ^:dynamic random-functions
(list
{ :fn... |
c1d78effa657738919b24be91d6a31bf1d67c4b9ba0a5f7410688baf421577d5 | tiensonqin/lymchat | util.clj | (ns api.db.util
(:require [hikari-cp.core :refer [make-datasource]]
[environ-plus.core :refer [env]]
[clj-time
[coerce :refer [to-sql-time]]
[core :refer [now]]]
[clojure.java.jdbc :as j]
[taoensso.carmine :as car]
[api.util :refer ... | null | https://raw.githubusercontent.com/tiensonqin/lymchat/824026607d30c12bc50afb06f677d1fa95ff1f2f/api/src/api/db/util.clj | clojure | id
empty
map, equal relations
non-nested vector
vector | (ns api.db.util
(:require [hikari-cp.core :refer [make-datasource]]
[environ-plus.core :refer [env]]
[clj-time
[coerce :refer [to-sql-time]]
[core :refer [now]]]
[clojure.java.jdbc :as j]
[taoensso.carmine :as car]
[api.util :refer ... |
374e693b95dc5c24726d2884f831c719d2e27e497fdbb2f86ca86562ca52fec1 | esumii/min-caml | emit.ml | open Asm
external gethi : float -> int32 = "gethi"
external getlo : float -> int32 = "getlo"
let stackset = ref S.empty (* すでにSaveされた変数の集合 (caml2html: emit_stackset) *)
( caml2html : emit_stackmap )
let save x =
stackset := S.add x !stackset;
if not (List.mem x !stackmap) then
stackmap := !stackmap @ [x]
l... | null | https://raw.githubusercontent.com/esumii/min-caml/8860b6fbc50786a27963aff1f7639b94c244618a/x86/emit.ml | ocaml | すでにSaveされた変数の集合 (caml2html: emit_stackset)
関数呼び出しのために引数を並べ替える(register shuffling) (caml2html: emit_shuffle)
remove identical moves
find acyclic moves
no acyclic moves; resolve a cyclic move
末尾かどうかを表すデータ型 (caml2html: emit_dest)
命令列のアセンブリ生成 (caml2html: emit_g)
各命令のアセンブリ生成 (caml2html: emit_gprime)
[XXX] u... | open Asm
external gethi : float -> int32 = "gethi"
external getlo : float -> int32 = "getlo"
( caml2html : emit_stackmap )
let save x =
stackset := S.add x !stackset;
if not (List.mem x !stackmap) then
stackmap := !stackmap @ [x]
let savef x =
stackset := S.add x !stackset;
if not (List.mem x !stackmap... |
d23e37d5e72859bf8d2e99bd1f82a7cc58cd9e4f4b2defe4841fe6239944d954 | mirage/ocaml-openflow | lldp.mli |
* Copyright ( c ) 2011 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/mirage/ocaml-openflow/dcda113745e8edc61b5508eb8ac2d1e864e1a2df/lib/lldp.mli | ocaml | * LLDP basic message tbl types
* [parse_lldp_tlvs bits] extract an lldp packet from a raw packet |
* Copyright ( c ) 2011 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... |
7ffc6fa3aeee240808db6b0e4819202f735c710a4481cd9f1d7ec816d4e687bb | tlaplus/tlapm | ext.ml |
* ext.ml --- extensions to standard libraries
*
*
* Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation
* ext.ml --- extensions to standard libraries
*
*
* Copyright (C) 2008-2010 INRIA and Microsoft Corporation
*)
module Option = struct
let iter : ('a -> unit) -> 'a option -> unit =
... | null | https://raw.githubusercontent.com/tlaplus/tlapm/158386319f5b6cd299f95385a216ade2b85c9f72/src/util/ext.ml | ocaml |
* The functions in this module are tail recursive. This is
* needed because the lists that occur at runtime can get very large.
|
* ext.ml --- extensions to standard libraries
*
*
* Copyright ( C ) 2008 - 2010 INRIA and Microsoft Corporation
* ext.ml --- extensions to standard libraries
*
*
* Copyright (C) 2008-2010 INRIA and Microsoft Corporation
*)
module Option = struct
let iter : ('a -> unit) -> 'a option -> unit =
... |
c24ad96c642381305895053c8c862699ac55be74d613711266f19deed95f1fb1 | xapi-project/xenvm | pvremove.ml | LVM compatible bits and pieces
open Cmdliner
open Xenvm_common
open Lwt
open Lvm
module Pv_IO = Pv.Make(Block)
let pvremove copts undo filenames =
let open Xenvm_common in
Lwt_main.run (
IO.FromResult.all (
Lwt_list.map_s
(fun filename ->
with_block filename
(fun device ... | null | https://raw.githubusercontent.com/xapi-project/xenvm/401754dfb05376b5fc78c9290453b006f6f38aa1/xenvm/pvremove.ml | ocaml | LVM compatible bits and pieces
open Cmdliner
open Xenvm_common
open Lwt
open Lvm
module Pv_IO = Pv.Make(Block)
let pvremove copts undo filenames =
let open Xenvm_common in
Lwt_main.run (
IO.FromResult.all (
Lwt_list.map_s
(fun filename ->
with_block filename
(fun device ... | |
916ac53b94fde6bea3f588531a88da31e3faef264d3337b1de16d2b9b91e5ef7 | andyarvanitis/purescript-native | Common.hs | -- | Common code generation utility functions
module CodeGen.IL.Common where
import Prelude.Compat
import Control.Monad.Supply.Class (MonadSupply, freshName)
import Data.Char
import Data.Maybe (maybe)
import Data.Monoid ((<>))
import Data.Text (Text)
import qualified Data.Text as T
import Language.PureScript.Crash
i... | null | https://raw.githubusercontent.com/andyarvanitis/purescript-native/1410c211aea993c63827f2f0ebd1b39bbde55c6f/src/CodeGen/IL/Common.hs | haskell | | Common code generation utility functions
| Convert an 'Ident' into a valid IL identifier:
* Alphanumeric characters are kept unmodified.
* Reserved IL identifiers are wrapped with '_'.
| Attempts to find a human-readable name for a symbol, if none has been specified returns the
ordinal value.
lowercase sa... | module CodeGen.IL.Common where
import Prelude.Compat
import Control.Monad.Supply.Class (MonadSupply, freshName)
import Data.Char
import Data.Maybe (maybe)
import Data.Monoid ((<>))
import Data.Text (Text)
import qualified Data.Text as T
import Language.PureScript.Crash
import Language.PureScript.Names
import qualif... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.