_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 |
|---|---|---|---|---|---|---|---|---|
9e53c07fd9b05e357e3dc5d91fe7ab1a73be0c1748323f6af06b4f7c3187d723 | fp-works/2019-winter-Haskell-school | TestJoinList.hs | import JoinList
import Sized
import Scrabble
import Buffer
import Control.Applicative (liftA2)
import Data.Monoid
-- need safe
import Safe
import Test.Hspec
import Test.QuickCheck
instance (Monoid m, Arbitrary a, Arbitrary m) => Arbitrary (JoinList m a) where
arbitrary = sized arbitraryJoinList
arbitraryJoinList... | null | https://raw.githubusercontent.com/fp-works/2019-winter-Haskell-school/823b67f019b9e7bc0d3be36711c0cc7da4eba7d2/cis194/week7/zhansongl/TestJoinList.hs | haskell | need safe | import JoinList
import Sized
import Scrabble
import Buffer
import Control.Applicative (liftA2)
import Data.Monoid
import Safe
import Test.Hspec
import Test.QuickCheck
instance (Monoid m, Arbitrary a, Arbitrary m) => Arbitrary (JoinList m a) where
arbitrary = sized arbitraryJoinList
arbitraryJoinList :: (Monoid m... |
53ab125ad665067020dc6ddcfee0ed03fcfba4416d2de6123717d0baf307775c | mbj/stratosphere | StoppingConditionProperty.hs | module Stratosphere.SageMaker.ModelBiasJobDefinition.StoppingConditionProperty (
StoppingConditionProperty(..), mkStoppingConditionProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import ... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/sagemaker/gen/Stratosphere/SageMaker/ModelBiasJobDefinition/StoppingConditionProperty.hs | haskell | module Stratosphere.SageMaker.ModelBiasJobDefinition.StoppingConditionProperty (
StoppingConditionProperty(..), mkStoppingConditionProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import ... | |
e612d3b950c7e1a8f2010369cf24c284f5cf0626234a612064c7ae8200087937 | unison-code/unison | InstructionTypeGen.hs | |
Copyright : Copyright ( c ) 2016 , RISE SICS AB
License : BSD3 ( see the LICENSE file )
Maintainer :
Copyright : Copyright (c) 2016, RISE SICS AB
License : BSD3 (see the LICENSE file)
Maintainer :
-}
Main authors :
< >
This file is part of Unison , see -code.github.io ... | null | https://raw.githubusercontent.com/unison-code/unison/9f8caf78230f956a57b50a327f8d1dca5839bf64/src/unison-specsgen/src/SpecsGen/InstructionTypeGen.hs | haskell | |
Copyright : Copyright ( c ) 2016 , RISE SICS AB
License : BSD3 ( see the LICENSE file )
Maintainer :
Copyright : Copyright (c) 2016, RISE SICS AB
License : BSD3 (see the LICENSE file)
Maintainer :
-}
Main authors :
< >
This file is part of Unison , see -code.github.io ... | |
23568497e2c39b181bca68b965f109efb2cd36fe9a093285274b0d99a343aa3d | yetanalytics/dave | common_test.cljc | (ns com.yetanalytics.dave.func.common-test
(:require
[clojure.test #?(:cljs :refer-macros
:clj :refer) [deftest is testing]]
[clojure.spec.alpha :as s]
[clojure.spec.test.alpha :as stest]
clojure.test.check.generators
[com.yetanalytics.dave.func.common :as common]
[com.yetanalyti... | null | https://raw.githubusercontent.com/yetanalytics/dave/7a71c2017889862b2fb567edc8196b4382d01beb/test/com/yetanalytics/dave/func/common_test.cljc | clojure | (ns com.yetanalytics.dave.func.common-test
(:require
[clojure.test #?(:cljs :refer-macros
:clj :refer) [deftest is testing]]
[clojure.spec.alpha :as s]
[clojure.spec.test.alpha :as stest]
clojure.test.check.generators
[com.yetanalytics.dave.func.common :as common]
[com.yetanalyti... | |
d7270b3c7bff80acb1a28655b488178d95b86bb4d1166a6a5319bf9a23ecdc3b | cubicle-model-checker/cubicle | polynome.ml | (**************************************************************************)
(* *)
Cubicle
(* *)
... | null | https://raw.githubusercontent.com/cubicle-model-checker/cubicle/00f09bb2d4bb496549775e770d7ada08bc1e4866/smt/polynome.ml | ocaml | ************************************************************************
... | Cubicle
Copyright ( C ) 2011 - 2014
and
Universite Paris - Sud 11
This file is distributed under the terms ... |
5e99010fb444c7f3b9fafcf832198ae028a946d1762100359cf621d19b7edacf | ShiiVa03/LI1 | Tarefa1_2019li1g050.hs | | Este módulo define do trabalho prático .
module Tarefa1_2019li1g050 where
import LI11920
import System.Random
-- * Testes
-- | Testes unitários da Tarefa 1.
--
Cada teste é um ( /número de ' Pista's/,/comprimento de cada ' Pista ' do ' aleatoriedades/ ) .
testesT1 :: [(Int,Int,Int)]
testesT1 = [(5,10,1... | null | https://raw.githubusercontent.com/ShiiVa03/LI1/d75ede3d319a14d7729d34c47daffe12906fe4dd/Tarefa1_2019li1g050.hs | haskell | * Testes
| Testes unitários da Tarefa 1.
| Função que determina o 'Piso'.
^ Gama
* Funções auxiliares da Tarefa 1 | | Este módulo define do trabalho prático .
module Tarefa1_2019li1g050 where
import LI11920
import System.Random
Cada teste é um ( /número de ' Pista's/,/comprimento de cada ' Pista ' do ' aleatoriedades/ ) .
testesT1 :: [(Int,Int,Int)]
testesT1 = [(5,10,1),(1,1,2),(10,10,12366),(5,5,6),(5,5,0),(1,10,13)]... |
86b7c7f47b66df316b58d7b836b11a049a53d63e9c7fc0e3bba4f57d25b88f65 | extend/elevators | e_graphic.erl | %%%----------------------------------------------------------------------
%%% File : e_graphic.erl
Author : >
%%% Purpose : Control process for the graphics of an elevator.
Created : 3 Aug 1999 by >
%%%----------------------------------------------------------------------
-module(e_graphic)... | null | https://raw.githubusercontent.com/extend/elevators/02276cc05da80017eea1691281fc062af62fa64a/src/e_graphic.erl | erlang | ----------------------------------------------------------------------
File : e_graphic.erl
Purpose : Control process for the graphics of an elevator.
----------------------------------------------------------------------
External exports
gen_fsm callbacks
--------------------------------------------------... | Author : >
Created : 3 Aug 1999 by >
-module(e_graphic).
-author('').
-vsn("1.0").
-behaviour(gen_fsm).
-export([start_link/3]).
-export([open/1, close/1, stop/1, move/2, set_controller/2]).
-export([get_floor/3]).
-export([init/1, open/2, closed/2, moving/2, stopping/2, handle_event/... |
dab87dd559c504451283ccf4f2bf4df56066cac755302f42637e1735ff9b2189 | shaobo-he/handbook-of-practical-logic-and-automated-reasoning-in-racket | formula-untyped.rkt | #lang racket/base
(require racket/match)
(require racket/set)
(provide atom-union)
;; grammar of formula
;; formula := #t
;; | #f
;; | (atom a)
;; | (not formula)
;; | (and formula formula)
;; | (or formula formula)
;; | (imp formula formula)
;; | (iff f... | null | https://raw.githubusercontent.com/shaobo-he/handbook-of-practical-logic-and-automated-reasoning-in-racket/1c292f533165ef5f3099185832768b9573ae370d/formula-untyped.rkt | racket | grammar of formula
formula := #t
| #f
| (atom a)
| (not formula)
| (and formula formula)
| (or formula formula)
| (imp formula formula)
| (iff formula formula)
| (forall symbol formula)
| (exists symbol formula) | #lang racket/base
(require racket/match)
(require racket/set)
(provide atom-union)
(define (overatoms fun fm b)
(match fm
[`(atom ,a) (fun a b)]
[`(not ,f) (overatoms fun f b)]
[`(,(or 'and 'or 'imp 'iff) ,f1 ,f2) (overatoms fun f1 (overatoms fun f2 b))]
[`(,(or 'forall 'exists) ,s ,f) (overatoms ... |
5fc9a6fb4931a4f970d7c4821b45053a282c132f2f3de0f46f8acd9f6f688b70 | thheller/shadow-cljs | builds.cljs | (ns shadow.cljs.ui.db.builds
(:require
[shadow.grove.db :as db]
[shadow.grove.events :as ev]
[shadow.grove.eql-query :as eql]
[shadow.cljs.model :as m]
[shadow.cljs.ui.db.env :as env]
[shadow.cljs.ui.db.relay-ws :as relay-ws]))
(defn forward-to-ws!
{::ev/handle
[::m/build-watch-compile!
... | null | https://raw.githubusercontent.com/thheller/shadow-cljs/3194818f071a64329e488561591e93fc96e463dc/src/main/shadow/cljs/ui/db/builds.cljs | clojure | FIXME: don't hardcode CLJ runtime id | (ns shadow.cljs.ui.db.builds
(:require
[shadow.grove.db :as db]
[shadow.grove.events :as ev]
[shadow.grove.eql-query :as eql]
[shadow.cljs.model :as m]
[shadow.cljs.ui.db.env :as env]
[shadow.cljs.ui.db.relay-ws :as relay-ws]))
(defn forward-to-ws!
{::ev/handle
[::m/build-watch-compile!
... |
0c97f89eeb059e892ab954aa16f1d7d75e1c1d191273996b2f1f99a37ebcdc29 | eccentric-j/clj-lineart | core.clj | (ns lineart.core
(:require
[clojure.string :as s]))
(def canvas-width 500)
(def canvas-height 100)
(def canvas-size (str canvas-width " " canvas-height))
(defn qs->hash-map
"
Parse the query string into a hash-map with keyword keys
Takes a string like \"bg=000000&fg=ffffff\"
Returns a hash-map like:
... | null | https://raw.githubusercontent.com/eccentric-j/clj-lineart/9f36f61c286309780f9edf6e392f722621961d78/src/lineart/core.clj | clojure | (ns lineart.core
(:require
[clojure.string :as s]))
(def canvas-width 500)
(def canvas-height 100)
(def canvas-size (str canvas-width " " canvas-height))
(defn qs->hash-map
"
Parse the query string into a hash-map with keyword keys
Takes a string like \"bg=000000&fg=ffffff\"
Returns a hash-map like:
... | |
3caec7d9ea01d15de87c80fbde928f047ca47f1558e4ea9853df837406f9d2c5 | ucsd-progsys/liquidhaskell | Split.hs | # LANGUAGE OverloadedStrings #
# LANGUAGE PartialTypeSignatures #
{-# LANGUAGE FlexibleContexts #-}
# OPTIONS_GHC -Wno - incomplete - uni - patterns #
--------------------------------------------------------------------------------
-- | Constraint Splitting --------------------------------------------------... | null | https://raw.githubusercontent.com/ucsd-progsys/liquidhaskell/efef712213416c8befb68c71800a169e85864a47/src/Language/Haskell/Liquid/Constraint/Split.hs | haskell | # LANGUAGE FlexibleContexts #
------------------------------------------------------------------------------
| Constraint Splitting ------------------------------------------------------
------------------------------------------------------------------------------
* Split Subtyping Constraints
* Split Well-for... | # LANGUAGE OverloadedStrings #
# LANGUAGE PartialTypeSignatures #
# OPTIONS_GHC -Wno - incomplete - uni - patterns #
module Language.Haskell.Liquid.Constraint.Split (
splitC
, splitW
, envToSub
, panicUnbound
) where
import Prelude hiding (error)
import Text.PrettyPrint.H... |
8066c9226df03a97a3ff34dc2a346382d132bc59922219841a55c493f35c5bdb | ThomasHintz/keep-the-records | amazon-s3-backup.scm | #!/usr/bin/csi
(use amazon-s3 send-grid srfi-19 shell)
(define *root* "/keep-the-records/")
(define ++ string-append)
(define (insert-file path)
(with-input-from-file path (lambda () (read-string))))
(print "loading/setting send-grid api keys")
(define api-user (insert-file (++ *root* "send-grid-user")))
(define... | null | https://raw.githubusercontent.com/ThomasHintz/keep-the-records/c20e648e831bed2ced3f2f74bfc590dc06b5f076/amazon-s3-backup.scm | scheme | #!/usr/bin/csi
(use amazon-s3 send-grid srfi-19 shell)
(define *root* "/keep-the-records/")
(define ++ string-append)
(define (insert-file path)
(with-input-from-file path (lambda () (read-string))))
(print "loading/setting send-grid api keys")
(define api-user (insert-file (++ *root* "send-grid-user")))
(define... | |
87df2a94071f8dc03e945d10ec20bb7598c4cb6c5e12d22975502734db9b384d | patricoferris/ppx_deriving_yaml | helpers.mli | open Ppxlib
val mkloc : 'a -> 'a Ppxlib.loc
val arg : int -> string
val suf_to : string
val suf_of : string
val mangle_suf : ?fixpoint:string -> string -> Longident.t -> Longident.t
val poly_fun : loc:location -> type_declaration -> expression -> expression
val ptuple : loc:location -> pattern list -> pattern
val etup... | null | https://raw.githubusercontent.com/patricoferris/ppx_deriving_yaml/f7e68abe062e57c97bded8e5111689391bba4c15/src/helpers.mli | ocaml | open Ppxlib
val mkloc : 'a -> 'a Ppxlib.loc
val arg : int -> string
val suf_to : string
val suf_of : string
val mangle_suf : ?fixpoint:string -> string -> Longident.t -> Longident.t
val poly_fun : loc:location -> type_declaration -> expression -> expression
val ptuple : loc:location -> pattern list -> pattern
val etup... | |
e84ccd016957b6b89a62bc13b67157b9a2fed2453754ad3878afe180c2bc28ed | pflanze/chj-schemelib | improper-length-test.scm | Copyright 2010 - 2018 by < >
;;; This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
;;; (at your option) any later version.
(require ;; ... | null | https://raw.githubusercontent.com/pflanze/chj-schemelib/59ff8476e39f207c2f1d807cfc9670581c8cedd3/improper-length-test.scm | scheme | This file is free software; you can redistribute it and/or modify
(at your option) any later version.
(cj-source-util improper-length) | Copyright 2010 - 2018 by < >
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
test)
(TEST
> (improper-length '())
0
> (improper-length '(1))
1
> (improper-length '(a b c))
3
> (improper-length '(a... |
7862a68d83da48c696ffed3e6988768d3a2fd0cf8e363eaf1e1c378ec70aabab | tjammer/raylib-ocaml | generate_c_rlgl.ml | let () =
print_endline "#include <rlgl.h>";
Cstubs.write_c Format.std_formatter ~prefix:Sys.argv.(1)
(module Raylib_rlgl.Description)
| null | https://raw.githubusercontent.com/tjammer/raylib-ocaml/fa2691a85f109209bbe6f05983b2fc7c5b590446/src/c/stubgen/generate_c_rlgl.ml | ocaml | let () =
print_endline "#include <rlgl.h>";
Cstubs.write_c Format.std_formatter ~prefix:Sys.argv.(1)
(module Raylib_rlgl.Description)
| |
cc31d75aac705ae500a7a63f95a6933baff0a89cdf8a0babddc7c45b5ce23082 | samply/blaze | spec.clj | (ns blaze.db.impl.index.spec
(:require
[clojure.spec.alpha :as s]))
(s/def :blaze.db.index.stats/total
nat-int?)
(s/def :blaze.db.index.stats/num-changes
nat-int?)
(s/def :blaze.db.index/stats
(s/keys :req-un [:blaze.db.index.stats/total :blaze.db.index.stats/num-changes]))
| null | https://raw.githubusercontent.com/samply/blaze/e84c106b5ca235600c20ba74fe8a2295eb18f350/modules/db/test/blaze/db/impl/index/spec.clj | clojure | (ns blaze.db.impl.index.spec
(:require
[clojure.spec.alpha :as s]))
(s/def :blaze.db.index.stats/total
nat-int?)
(s/def :blaze.db.index.stats/num-changes
nat-int?)
(s/def :blaze.db.index/stats
(s/keys :req-un [:blaze.db.index.stats/total :blaze.db.index.stats/num-changes]))
| |
de1308a9fe4e56cf5806725f426f77741751cc22a554c9342ff654aeddedb811 | sol/hspec-tutorial | AppSpec.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
module AppSpec (spec) where
import Test.Hspec hiding (pending)
import Test.Hspec.Wai
import Test.Hspec.Wai.QuickCheck
import Test.Hspec.Wai.JSON
import Data.ByteString
import Data.String
import ... | null | https://raw.githubusercontent.com/sol/hspec-tutorial/92ced065e0bfdd688f6e18bda74da53d270d8cda/test/AppSpec.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE QuasiQuotes #
module AppSpec (spec) where
import Test.Hspec hiding (pending)
import Test.Hspec.Wai
import Test.Hspec.Wai.QuickCheck
import Test.Hspec.Wai.JSON
import Data.ByteString
import Data.String
import App (app)
spec :: Spec
spec ... |
d07bcea6c178790b91eb22f50072ef582bf89d2d143c69f61a3a1f5fbf0b9601 | racket/gui | arrow-toggle-snip.rkt | #lang racket/base
(require racket/class
racket/gui/base)
(provide arrow-toggle-snip%)
;; arrow-toggle-snip% represents a togglable state, displayed as a right-facing
;; arrow (off or "closed") or a downward-facing arrow (on or "open").
;; The size of the arrow is determined by the style (and font) applied to... | null | https://raw.githubusercontent.com/racket/gui/d1fef7a43a482c0fdd5672be9a6e713f16d8be5c/gui-lib/mrlib/arrow-toggle-snip.rkt | racket | arrow-toggle-snip% represents a togglable state, displayed as a right-facing
arrow (off or "closed") or a downward-facing arrow (on or "open").
The size of the arrow is determined by the style (and font) applied to the
snip. The arrow is drawn inscribed in a square resting on the baseline, but
the snip reports its... | #lang racket/base
(require racket/class
racket/gui/base)
(provide arrow-toggle-snip%)
Paths and gradients , in terms of 100x100 box
(define (down-arrow-path scale yb)
(define (tx x) (* scale x))
(define (ty y) (+ yb (* scale y)))
(define p (new dc-path%))
(send* p
[move-to (tx 10) (ty 40)]
... |
6fc7dcb83ff8e21f07d5bfe112b7676ba7994caf0b7e17b83714ffb578e72beb | dennismckinnon/Ethereum-Contracts | Magnet-DB.lsp | Infohash Database manager with Membership structure
{
[[0x0]] 0x11 ;Admin member pointer
[[0x1]] 30 ;Number of segments per item
[[0x2]] 0x200 ;Member pointer
[[0x3]] 0x0 ;Number of members
[[0x4]] 0x1000 ;infohash list pointer
[[0x10]](caller) ;Set admin
[0x0] "A"
(call 0x11d11764cd7f6ecda172e0b72370e6ea7f75f... | null | https://raw.githubusercontent.com/dennismckinnon/Ethereum-Contracts/25b5e7037da382dd95a1376fad81f936f6610b36/Magnet%20DB/Magnet-DB.lsp | lisp | Admin member pointer
Number of segments per item
Member pointer
Number of members
infohash list pointer
Set admin
Admin
Normal member
Not a member stop
Admin suicide (Format: "kill")
Admin and say kill suicide + deregister
Register new admin (Format: "regadm" 0xMemberaddress)
Store the new member in then next admin slo... | Infohash Database manager with Membership structure
{
[0x0] "A"
(call 0x11d11764cd7f6ecda172e0b72370e6ea7f75f290 0 0 0 1 0 0)
}
{
You ca n't do anything if you are n't a member so check that first
(for ["i"] 0x10 (< @"i" @@0x0) ["i"](+ @"i" 1)
{
(when (= @@ @"i" (caller))
)
}
)
(unless @0x0
(for ["i"... |
24ea1f9bcdeb94ad415c007d96694dfbefdde01a08fa8278bbf99a17cba99f72 | spawnfest/eep49ers | wxIdleEvent.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2020 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/wx/src/gen/wxIdleEvent.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2008 - 2020 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(wxIdleEvent).
-include("wxe.hrl").
-export([getMode/0,moreRequested/1,requestMore/1,requestMore/2,setMode/1]... |
3811ef36be68f404346abca96d4a36201b774bd5d9d46c5e88d31c610273f5c9 | onedata/op-worker | nfs_helper_test_SUITE.erl | %%%-------------------------------------------------------------------
@author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
@doc Tests for NFS helper .
%%% @end
%%%-----... | null | https://raw.githubusercontent.com/onedata/op-worker/f220870d18ec6a6d7201ca3f32b5d3b2e401e291/test_distributed/nfs_helper_test_SUITE.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@end
-------------------------------------------------------------------
export for ct
tests
test_bases
===================================================================
T... | @author
( C ) 2021 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
@doc Tests for NFS helper .
-module(nfs_helper_test_SUITE).
-author("Bartek Kryza").
-include("modules/storage/helpers/helpers.hrl").
-include("modules/fslogic/fslogic_common.hrl").
-include_lib(... |
09a3a84976a0e4d9c5d17b1b116f3a7b44426c3f14d4a56ca9b8d13dfca811f6 | vikram/lisplibraries | swank-gray.lisp | ;;;; -*- Mode: lisp; indent-tabs-mode: nil -*-
;;;
swank-gray.lisp stream based IO redirection .
;;;
Created 2003
;;;
;;; This code has been placed in the Public Domain. All warranties
;;; are disclaimed.
;;;
(in-package :swank-backend)
(defclass slime-output-stream (fundamental-character-output-stream)
((ou... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/slime/swank-gray.lisp | lisp | -*- Mode: lisp; indent-tabs-mode: nil -*-
This code has been placed in the Public Domain. All warranties
are disclaimed.
We have to define an additional method for the sake of the C
depends.
default method would call STREAM-READ-CHAR-NO-HANG, so it is a bit
more efficient to define it directly.
| swank-gray.lisp stream based IO redirection .
Created 2003
(in-package :swank-backend)
(defclass slime-output-stream (fundamental-character-output-stream)
((output-fn :initarg :output-fn)
(buffer :initform (make-string 8000))
(fill-pointer :initform 0)
(column :initform 0)
(lock :initform (make-lo... |
f74b77a47e2b0c1a7702b444658120a1d6aac968003eca8789f237eb8761ccd1 | binsec/haunted | prover.mli | (**************************************************************************)
This file is part of BINSEC .
(* *)
Copyright ( C ) 2016 - 2019
CEA ( Co... | null | https://raw.githubusercontent.com/binsec/haunted/7ffc5f4072950fe138f53fe953ace98fff181c73/src/formula/prover.mli | ocaml | ************************************************************************
alternatives)
you can redistribute it an... | This file is part of BINSEC .
Copyright ( C ) 2016 - 2019
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Software
Foundation , ve... |
3f5339c6e801dd9e962c7718b59b49905513d4fab233f36dc21ad7080588f22f | alexandergunnarson/quantum | core.cljc | (ns quantum.test.core.type.core
(:require
[quantum.core.type.core :as this]
[quantum.core.test
:refer [deftest is testing]]))
#?(:clj
(deftest test|nth-elem-type|clj
(is (= "[D" (this/nth-elem-type|clj "[D" 0)))
(is (= 'double (this/nth-elem-type|clj "[D" 1)))
(is (= 'long (this/nth-elem-... | null | https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/test/quantum/test/core/type/core.cljc | clojure | (ns quantum.test.core.type.core
(:require
[quantum.core.type.core :as this]
[quantum.core.test
:refer [deftest is testing]]))
#?(:clj
(deftest test|nth-elem-type|clj
(is (= "[D" (this/nth-elem-type|clj "[D" 0)))
(is (= 'double (this/nth-elem-type|clj "[D" 1)))
(is (= 'long (this/nth-elem-... | |
949f09553e926d75cbb23ad01ee04fea8bcd9b9bc78c389cd09b7dfdc222b740 | tsdye/harris-matrix | package.lisp | package.lisp
(defpackage #:hm
(:use
:common-lisp
:cl-colors
:py-configparser
:alexandria
:inferior-shell)
(:export
:show-classifiable-attributes
:show-classifiers
:show-map
:write-default-configuration
:write-configuration
:reset-option
:set-input-file
:set-output-file
:... | null | https://raw.githubusercontent.com/tsdye/harris-matrix/9229fa7dfbfbfe23035ccfda8d89345d750e003f/src/package.lisp | lisp | package.lisp
(defpackage #:hm
(:use
:common-lisp
:cl-colors
:py-configparser
:alexandria
:inferior-shell)
(:export
:show-classifiable-attributes
:show-classifiers
:show-map
:write-default-configuration
:write-configuration
:reset-option
:set-input-file
:set-output-file
:... | |
b085a84e6c3edaedbf8186e6bb35175401f1ea6ba53ec9bc259f20e427245297 | tadeuzagallo/verve-lang | Main.hs | module Main where
import Compile
import Options
import Repl
import Runners
import System.Console.CmdArgs
options :: Options
options
= Options { dump_ir = def &= help "Dump the intermediate representation of the program"
, dump_bytecode = def &= help "Dump the bytecode representation of the program"
... | null | https://raw.githubusercontent.com/tadeuzagallo/verve-lang/c7db1f5d4bb399b6c2623dd2444a981b5aba1aa4/app/Main.hs | haskell | module Main where
import Compile
import Options
import Repl
import Runners
import System.Console.CmdArgs
options :: Options
options
= Options { dump_ir = def &= help "Dump the intermediate representation of the program"
, dump_bytecode = def &= help "Dump the bytecode representation of the program"
... | |
9998730a0a9583175864897077aa518fd801407befa62063fad8f0b2a8ad6e64 | emotiq/emotiq | node-0.0.1.lisp | (restas:define-module :route.node/0/0/1
(:nicknames :route.node/0/0
:route.node/0)
(:use :cl :emotiq-rest))
(in-package :route.node/0/0/1)
(restas:define-route %api
("/api/"
:content-type "text/html")
(as-html
(:html
(:body
(:h1 "Node API")
(:ul
(:li
(:... | null | https://raw.githubusercontent.com/emotiq/emotiq/9af78023f670777895a3dac29a2bbe98e19b6249/src/network/rest/node-0.0.1.lisp | lisp | (restas:define-module :route.node/0/0/1
(:nicknames :route.node/0/0
:route.node/0)
(:use :cl :emotiq-rest))
(in-package :route.node/0/0/1)
(restas:define-route %api
("/api/"
:content-type "text/html")
(as-html
(:html
(:body
(:h1 "Node API")
(:ul
(:li
(:... | |
f07661ea20e3377e2acad0a73b535d2dbcf05267dfddde858d3f12b654aea7a3 | serokell/ariadne | FeeEstimate.hs | -- | Calculate fee estimates for new transaction
module Ariadne.Wallet.Cardano.Kernel.FeeEstimate
( transactionInputs
, cardanoFee
) where
import qualified Text.Show (show)
import Crypto.Random (MonadRandom(..))
import qualified Data.ByteArray as ByteArray
import qualified Data.ByteString as ... | null | https://raw.githubusercontent.com/serokell/ariadne/5f49ee53b6bbaf332cb6f110c75f7b971acdd452/ariadne/cardano/src/Ariadne/Wallet/Cardano/Kernel/FeeEstimate.hs | haskell | | Calculate fee estimates for new transaction
| Special monad used to process the payments, which randomness is derived
from a fixed seed obtained from hashing the payees. This guarantees that
when we estimate the fees and later create a transaction, the coin selection
will always yield the same value, making the ... | module Ariadne.Wallet.Cardano.Kernel.FeeEstimate
( transactionInputs
, cardanoFee
) where
import qualified Text.Show (show)
import Crypto.Random (MonadRandom(..))
import qualified Data.ByteArray as ByteArray
import qualified Data.ByteString as B
import Data.Text.Buildable (Buildable(..))
impo... |
e46dbd19f01d68e5315378c8377ba2e3b22090ab935a4ac1e65690a0265f7cc1 | mpickering/apply-refact | Import12.hs | import A; import B; import A | null | https://raw.githubusercontent.com/mpickering/apply-refact/a4343ea0f4f9d8c2e16d6b16b9068f321ba4f272/tests/examples/Import12.hs | haskell | import A; import B; import A | |
2d4bde4218afb42fc9fb924104de75bb7800ce3cb6b4c7815af33f9dc451c4f2 | ympbyc/Carrot | carrot-compile.scm | #!/usr/local/bin/gosh
(add-load-path "../lib/" :relative)
(add-load-path "../compilers/" :relative)
(add-load-path "/usr/local/share/Carrot/2.2.0/lib/" :absolute)
(add-load-path "/usr/local/share/Carrot/2.2.0/compilers/" :absolute)
(use Util)
(use DataTypes)
(define (main args)
(let* ([compiler-name (cadr args)]... | null | https://raw.githubusercontent.com/ympbyc/Carrot/5ce3969b3833bcf1b466d808a74d0a03653ef6ab/bin/carrot-compile.scm | scheme | #!/usr/local/bin/gosh
(add-load-path "../lib/" :relative)
(add-load-path "../compilers/" :relative)
(add-load-path "/usr/local/share/Carrot/2.2.0/lib/" :absolute)
(add-load-path "/usr/local/share/Carrot/2.2.0/compilers/" :absolute)
(use Util)
(use DataTypes)
(define (main args)
(let* ([compiler-name (cadr args)]... | |
d9a6e6aa33a3f00f619f1e9d630e9c23d5c6735341cfe0a756f36c1d7eb6e809 | lispbuilder/lispbuilder | gfx-string-shaded.lisp |
(in-package :lispbuilder-sdl)
(defmethod _draw-string-shaded-*_ ((string string) (x integer) (y integer) (fg-color sdl:color) (bg-color sdl:color) justify (surface sdl:sdl-surface) (font gfx-bitmap-font))
(unless (default-font-p font)
(sdl:set-default-font font))
(let ((x-pos x))
(if (eq justify :right)
... | null | https://raw.githubusercontent.com/lispbuilder/lispbuilder/589b3c6d552bbec4b520f61388117d6c7b3de5ab/lispbuilder-sdl/sdl/gfx-string-shaded.lisp | lisp |
(in-package :lispbuilder-sdl)
(defmethod _draw-string-shaded-*_ ((string string) (x integer) (y integer) (fg-color sdl:color) (bg-color sdl:color) justify (surface sdl:sdl-surface) (font gfx-bitmap-font))
(unless (default-font-p font)
(sdl:set-default-font font))
(let ((x-pos x))
(if (eq justify :right)
... | |
4c72f91116b3f9d1e4e4a73cf6cae53c1bf93de683d2a1eee6b0552402c740e8 | donut-party/datapotato | 08.clj | (ns donut.datapotato-tutorial.08
"collect constraint"
(:require [donut.datapotato.core :as dc]
[malli.generator :as mg]))
(def User
[:map
[:id pos-int?]
[:favorite-ids [:vector pos-int?]]])
(def Topic
[:map
[:id pos-int?]])
(def potato-schema
{:user {:prefix :u
:genera... | null | https://raw.githubusercontent.com/donut-party/datapotato/4f325977ea3639d6e6a954b49382c771a9b18320/docs/tutorial/donut/datapotato_tutorial/08.clj | clojure | (ns donut.datapotato-tutorial.08
"collect constraint"
(:require [donut.datapotato.core :as dc]
[malli.generator :as mg]))
(def User
[:map
[:id pos-int?]
[:favorite-ids [:vector pos-int?]]])
(def Topic
[:map
[:id pos-int?]])
(def potato-schema
{:user {:prefix :u
:genera... | |
7cf5cf86f0629e99434e0687da7161aec4a475444975f2cb09eabec107d7d2a2 | Erlang-Openid/erljwt | erljwt_key.erl | -module(erljwt_key).
-include("erljwt.hrl").
-export([to_key_list/1, get_needed/3]).
-spec to_key_list(keys()) -> [key()].
to_key_list(Json) when is_binary(Json) ->
to_key_list(erljwt_util:safe_jsone_decode(Json));
to_key_list(#{keys := KeyList}) when is_list(KeyList) ->
KeyList;
to_key_list(#{kty := _} = K... | null | https://raw.githubusercontent.com/Erlang-Openid/erljwt/d2baeecd49c3dd6e41b8511bbf7a35ec995f06cf/src/erljwt_key.erl | erlang | -module(erljwt_key).
-include("erljwt.hrl").
-export([to_key_list/1, get_needed/3]).
-spec to_key_list(keys()) -> [key()].
to_key_list(Json) when is_binary(Json) ->
to_key_list(erljwt_util:safe_jsone_decode(Json));
to_key_list(#{keys := KeyList}) when is_list(KeyList) ->
KeyList;
to_key_list(#{kty := _} = K... | |
c9479dfba9514894340dc3ac32ad3ef9ffb97abe57eff2e634ea3e84322040ed | alphagov/govuk-guix | delayed-job.scm | (define-module (gds services delayed-job)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match)
#:use-module (guix gexp)
#:use-module (guix records)
#:use-module (guix packages)
#:use-module (gnu services shepherd)
#:use-module (gds services)
#:export (<delayed-job-config>
delayed-job-config... | null | https://raw.githubusercontent.com/alphagov/govuk-guix/dea8c26d2ae882d0278be5c745e23abb25d4a4e2/gds/services/delayed-job.scm | scheme | (define-module (gds services delayed-job)
#:use-module (srfi srfi-1)
#:use-module (ice-9 match)
#:use-module (guix gexp)
#:use-module (guix records)
#:use-module (guix packages)
#:use-module (gnu services shepherd)
#:use-module (gds services)
#:export (<delayed-job-config>
delayed-job-config... | |
47e0ff10e96c9684e2d965a9a17f299cf1fc15e955562de5863b633b1a3f34a8 | Mishio595/disml | role_id.ml | open Core
type t = [ `Role_id of Snowflake.t ] [@@deriving sexp]
let of_yojson a : (t, string) result =
match Snowflake.of_yojson a with
| Ok id -> Ok (`Role_id id)
| Error err -> Error err
let of_yojson_exn a : t = `Role_id (Snowflake.of_yojson_exn a)
let to_yojson (`Role_id id) = (Snowflake.t... | null | https://raw.githubusercontent.com/Mishio595/disml/cbb1e47a6d358eace03790c07a1b85641f4ca366/lib/models/id/role_id.ml | ocaml | open Core
type t = [ `Role_id of Snowflake.t ] [@@deriving sexp]
let of_yojson a : (t, string) result =
match Snowflake.of_yojson a with
| Ok id -> Ok (`Role_id id)
| Error err -> Error err
let of_yojson_exn a : t = `Role_id (Snowflake.of_yojson_exn a)
let to_yojson (`Role_id id) = (Snowflake.t... | |
5ec24fe6806ebf66d3d96900cbe6761d3aa78a4181c6815b045886a46ec01bbb | ktakashi/sagittarius-scheme | modular.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
;;; math/modular.scm - Modular arithmetic
;;;
Copyright ( c ) 2021 . 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 . Redi... | null | https://raw.githubusercontent.com/ktakashi/sagittarius-scheme/629ced3dc08fd1f8d97e58321d1f4130b8b5dc81/ext/crypto/math/modular.scm | scheme | coding : utf-8 ; -*-
math/modular.scm - Modular arithmetic
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 a... | Copyright ( c ) 2021 . All rights reserved .
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
OWNER OR ANY DIRECT , INDIRECT , INCIDENTAL ,
... |
a9e4d796fb753028901b34d44e5bf3f38a86be50d81cc2de2edad05cc14b8908 | JHU-PL-Lab/jaylang | convert.ml | open! Core
let bluejay_edesc_to_jay ~do_wrap bluejay_edesc =
let bluejay_ast_internal =
Bluejay.Bluejay_ast_internal.to_internal_expr_desc bluejay_edesc
in
let core_ast, _bluejay_jay_maps =
Bluejay.Bluejay_to_jay.transform_bluejay ~do_wrap bluejay_ast_internal.body
in
Bluejay.Bluejay_ast_internal.to_... | null | https://raw.githubusercontent.com/JHU-PL-Lab/jaylang/484b3876986a515fb57b11768a1b3b50418cde0c/src/dj-common/utils/convert.ml | ocaml | open! Core
let bluejay_edesc_to_jay ~do_wrap bluejay_edesc =
let bluejay_ast_internal =
Bluejay.Bluejay_ast_internal.to_internal_expr_desc bluejay_edesc
in
let core_ast, _bluejay_jay_maps =
Bluejay.Bluejay_to_jay.transform_bluejay ~do_wrap bluejay_ast_internal.body
in
Bluejay.Bluejay_ast_internal.to_... | |
9936e38f62a42aeb49c5619132d20742a56a5d4746ab5c31be824fb2dc759c81 | AndrasKovacs/ELTE-func-lang | Notes04.hs |
import Control.Monad (ap)
Maybe ismétlés , : mapM , sequence
do notáció
-- IO
további : replicateM , forever , filterM
-- Monad törvények
State monad
motiváció : Maybe : hibakódos hibakazelés ( sok zaj )
catch / throw ,
Maybe van
instance Monad Maybe ... | null | https://raw.githubusercontent.com/AndrasKovacs/ELTE-func-lang/88d41930999d6056bdd7bfaa85761a527cce4113/2020-21-2/ea/Notes04.hs | haskell | IO
Monad törvények
Monad : custom
Maybe : mellékhatás = Nothing propagálás mint kivétel
Just :: a -> Maybe a
bind :: Maybe a -> (a -> Maybe b) -> Maybe b
"monádikus" forma
sima függvény komp: (.) :: (b -> c) -> (a -> b) -> a -> c
(.) f g x = f (g x)
---------------------------------------... |
import Control.Monad (ap)
Maybe ismétlés , : mapM , sequence
do notáció
további : replicateM , forever , filterM
State monad
motiváció : Maybe : hibakódos hibakazelés ( sok zaj )
catch / throw ,
Maybe van
bind :: Maybe a -> (a -> Maybe b) -> Maybe b
bi... |
670eadec8fe6d536177932a9cfe01537370ee699d24bee2c559d132b33447bc4 | sadiqj/ocaml-esp32 | profile.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
(* ... | null | https://raw.githubusercontent.com/sadiqj/ocaml-esp32/33aad4ca2becb9701eb90d779c1b1183aefeb578/utils/profile.mli | ocaml | ************************************************************************
OCaml
Pierre... | Copyright 2015 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
type file = string
val reset : unit -> unit
val record_call : ?accumulate:bool -> string -> (unit -> 'a) -> 'a
* [ record_call pass f ] calls [ f ] and records its pro... |
46d9dbb13969d06223901867c71566731c21c88ce6ac6f9d29e2fb5807c92976 | smart-chain-fr/tokenomia | Plan.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE TupleSections #
# LANGUAGE NumericUnderscores #
# LANGUAGE NamedFieldPuns #
# LANGUAGE TypeApplications #
# LANGUAGE Flexib... | null | https://raw.githubusercontent.com/smart-chain-fr/tokenomia/dfb46829f0a88c559eddb3181e5320ed1a33601e/src/Tokenomia/ICO/Funds/Exchange/Plan.hs | haskell | # LANGUAGE OverloadedStrings #
(899957104-1379280)/8562147 | # LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE TupleSections #
# LANGUAGE NumericUnderscores #
# LANGUAGE NamedFieldPuns #
# LANGUAGE TypeApplications #
# LANGUAGE FlexibleInstances #
module Tokenomia.ICO... |
2f10c3f1386b582b079ec60954b8f1c9195d99ad2ae5459508b0485d875c04f5 | realgenekim/rss-reader-fulcro-demo | jib.clj | (ns jib
;(:require [clojure.tools.build.api :as b])
(:import
(com.google.cloud.tools.jib.api Jib
DockerDaemonImage
Containerizer
TarImage
RegistryImage
... | null | https://raw.githubusercontent.com/realgenekim/rss-reader-fulcro-demo/6eab011cfa9e24ef6cf670ad53ae101568e1df97/jib.clj | clojure | (:require [clojure.tools.build.api :as b])
we can't run distroless, because we need /bin/bash and entrypoint.sh, until we can figure out how
to set file modes to executable via jib
error while loading shared libraries: libz.so.1: cannot open shared object file: No such file or directory
(.wellKnownCredentialHelpers)... | (ns jib
(:import
(com.google.cloud.tools.jib.api Jib
DockerDaemonImage
Containerizer
TarImage
RegistryImage
ImageReference CredentialR... |
f5698d1b728c043061ee4f3623821ddd34495c1ac47e7d46baacbc1016274f46 | gogins/csound-extended-nudruz | all-in-one-orc.lisp | ;; An example Csound orchestra for Common Lisp to be used with the
;; csound.lisp or sb-csound.lisp foreign function interfaces for Csound.
(in-package :cm)
(defparameter all-in-one-orc #>qqq>
sr = 48000
ksmps = 64
nchnls = 2
0dbfs = 32768
iampdbfs init 32768
prints "Default amplitude at 0 dBFS: %9.4f\n", iampdbfs
i... | null | https://raw.githubusercontent.com/gogins/csound-extended-nudruz/4551d54890f4adbadc5db8f46cc24af8e92fb9e9/sources/all-in-one-orc.lisp | lisp | An example Csound orchestra for Common Lisp to be used with the
csound.lisp or sb-csound.lisp foreign function interfaces for Csound.
p1 p2 p3 p4 p5 p6 p7
Start Dur Amp Frqc U V
i 4 32 6 6000 6.00 3 2
p6
p7
Compute X and Y
p1 p2 p3 p4 p5 p6
i2 + 2 1200 6.01 0.25
Output envelope
This envelope loads the st... |
(in-package :cm)
(defparameter all-in-one-orc #>qqq>
sr = 48000
ksmps = 64
nchnls = 2
0dbfs = 32768
iampdbfs init 32768
prints "Default amplitude at 0 dBFS: %9.4f\n", iampdbfs
idbafs init dbamp(iampdbfs)
prints "dbA at 0 dBFS: %9.4f\n", idbafs
iheadroom init 6
prints "Headroom (dB): %9.4f\n", iheadroom
idbaheadroom i... |
2042d196b7d2d77a1905b4f693e9f7f99e966dfe1f3d5416fa40b9c35906f2f7 | dwayne/eopl3 | ex1.21.rkt | #lang racket
;(define (product sos1 sos2)
; (foldl append '() (map
; (lambda (s1)
( map ( lambda ( s2 ) ( list s2 ) ) sos2 ) )
; sos1)))
;(define (product sos1 sos2)
; (append-map
; (lambda (s1)
( map ( lambda ( s2 ) ( list s2 ) ) sos2 ) )
; ... | null | https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/01-ch1/racket/ex1.21.rkt | racket | (define (product sos1 sos2)
(foldl append '() (map
(lambda (s1)
sos1)))
(define (product sos1 sos2)
(append-map
(lambda (s1)
sos1)) | #lang racket
( map ( lambda ( s2 ) ( list s2 ) ) sos2 ) )
( map ( lambda ( s2 ) ( list s2 ) ) sos2 ) )
(define (product sos1 sos2)
(for*/list ([s1 sos1]
[s2 sos2])
(list s1 s2)))
(module+ test
(require rackunit)
(check-equal?
(list->set (product '(a b c) '... |
43c2d1ffe1b860c35bc3d90c367d7cb42fc528ba15c46ff7ba1b9ff769b0c7ac | milinda/ef | core.clj | (ns adder.test.core
(:use [adder.core])
(:use [clojure.test]))
(deftest replace-me ;; FIXME: write
(is false "No tests have been written."))
| null | https://raw.githubusercontent.com/milinda/ef/60901356e52eba33addfd509e909eaf8f0d2eab5/clojure-web/adder/test/adder/test/core.clj | clojure | FIXME: write | (ns adder.test.core
(:use [adder.core])
(:use [clojure.test]))
(is false "No tests have been written."))
|
1df67a698fced6774257b9b281bf1080b9d2af5499b852cb0f72bfc088f88f7e | singleheart/programming-in-haskell | countdown.hs | data Op
= Add
| Sub
| Mul
| Div
instance Show Op where
show Add = "+"
show Sub = "-"
show Mul = "*"
show Div = "/"
valid :: Op -> Int -> Int -> Bool
valid Add x y = x <= y
valid Sub x y = x > y
valid Mul x y = x /= 1 && y /= 1 && x <= y
valid Div x y = y /= 1 && x `mod` y == 0
apply :: Op -> Int -> I... | null | https://raw.githubusercontent.com/singleheart/programming-in-haskell/80c7efc0425babea3cd982e47e121f19bec0aba9/ch09/countdown.hs | haskell | data Op
= Add
| Sub
| Mul
| Div
instance Show Op where
show Add = "+"
show Sub = "-"
show Mul = "*"
show Div = "/"
valid :: Op -> Int -> Int -> Bool
valid Add x y = x <= y
valid Sub x y = x > y
valid Mul x y = x /= 1 && y /= 1 && x <= y
valid Div x y = y /= 1 && x `mod` y == 0
apply :: Op -> Int -> I... | |
fc1d2ed9a0bd556b03bd7414ac5e42330716133ba5a63a80fdc177ad9ecc7efb | smart-chain-fr/tokenomia | TxOutRef.hs | # LANGUAGE RecordWildCards #
# OPTIONS_GHC -Wno - orphans #
module Tokenomia.Common.TxOutRef
( showTxOutRef
, TxOutRef (..)
) where
import qualified Data.Text as T
import Ledger ( TxOutRef (..) )
import Tokenomia.Common.Serialise
instance ToCLI TxOutRef where
toCLI = T.pack . showTxOutRef
showTxOut... | null | https://raw.githubusercontent.com/smart-chain-fr/tokenomia/67b361e0bd8494ed0b1af701e28eb8b3e9211fc9/src/Tokenomia/Common/TxOutRef.hs | haskell | # LANGUAGE RecordWildCards #
# OPTIONS_GHC -Wno - orphans #
module Tokenomia.Common.TxOutRef
( showTxOutRef
, TxOutRef (..)
) where
import qualified Data.Text as T
import Ledger ( TxOutRef (..) )
import Tokenomia.Common.Serialise
instance ToCLI TxOutRef where
toCLI = T.pack . showTxOutRef
showTxOut... | |
b0a7e8e7c1bd0ba75061839b2921072c96141f798e02485f8e8c252adc7b4b63 | MinaProtocol/mina | graphql_basic_scalars.ml | *
This file defines basic graphql scalars in a shape usable by graphql_ppx for serialising .
It is meant to be used by backend graphql code .
It also includes basic round - trip testing facilities for GraphQL scalar types .
The [ graphql_lib ] library re - exports these basic scalars as well as o... | null | https://raw.githubusercontent.com/MinaProtocol/mina/b216c51c1935de1ede05135ac753ce1bad2620d8/src/lib/graphql_basic_scalars/graphql_basic_scalars.ml | ocaml | guard against negative wrap around behaviour from
the `integers` library
#L61 | *
This file defines basic graphql scalars in a shape usable by graphql_ppx for serialising .
It is meant to be used by backend graphql code .
It also includes basic round - trip testing facilities for GraphQL scalar types .
The [ graphql_lib ] library re - exports these basic scalars as well as o... |
a060fdd9f6ccb08e3952b3762888c3d0332ae1c39a0f0a16fdb6e30944fc4ed7 | nvim-treesitter/nvim-treesitter | highlights.scm | ; Preproc
(unique_id) @preproc
(top_level_annotation_body) @preproc
; Includes
[
"import"
"$import"
"embed"
] @include
(import_path) @string
; Builtins
[
(primitive_type)
"List"
] @type.builtin
; Typedefs
(type_definition) @type.definition
; Labels (@number, @number!)
(field_version) @label
; Metho... | null | https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/598b878a2b44e7e7a981acc5fc99bf8273cd1d0f/queries/capnp/highlights.scm | scheme | Preproc
Includes
Builtins
Typedefs
Labels (@number, @number!)
Methods
Fields
Properties
Parameters
Constants
Types
Attributes
@ ! -
Keywords
Literals
Misc
Comments |
(unique_id) @preproc
(top_level_annotation_body) @preproc
[
"import"
"$import"
"embed"
] @include
(import_path) @string
[
(primitive_type)
"List"
] @type.builtin
(type_definition) @type.definition
(field_version) @label
(annotation_definition_identifier) @method
(method_identifier) @method
(fiel... |
c45b7767ce510786712ea5ec2c49f3ac0a68c4a2e48b859670d222e90868ed1b | lnostdal/SymbolicWeb | reactive_paradigm.clj | (in-ns 'symbolicweb.core)
;;; Reactive programming
;;;;;;;;;;;;;;;;;;;;;;;;
;;
;;
(defn clear-observers [^Observable observable]
(ref-set (.observers observable) #{}))
(defn ^Observable mk-Observable [^Fn notify-observers-fn]
(Observable. (ref #{}) ;; OBSERVERS
notify-observers-fn))
(defn... | null | https://raw.githubusercontent.com/lnostdal/SymbolicWeb/d9600b286f70f88570deda57b05ca240e4e06567/src/symbolicweb/reactive_paradigm.clj | clojure | Reactive programming
OBSERVERS
* Allow circular references fully, which might lead to infinite loops in some cases; so it's not really "allowed" anyway.
* Allow circular refeneces "partially"; let it recurse up until some limit then, say, show a warning or similar.
* Disallow circular references.
thing... | (in-ns 'symbolicweb.core)
(defn clear-observers [^Observable observable]
(ref-set (.observers observable) #{}))
(defn ^Observable mk-Observable [^Fn notify-observers-fn]
notify-observers-fn))
(defn notify-observers [^Observable observable & args]
(apply (.notify-observers-fn observable) ob... |
4d4e339d1eb7aa5027c6aec0b7923abe754cf6789914b27ea382287d876d22fa | avsm/platform | class.mli | class type empty =
object
end
class type mutually =
object
end
and recursive =
object
end
class mutually' : mutually
and recursive' : recursive
class type virtual empty_virtual =
object
end
class virtual empty_virtual' : empty
class type ['a] polymorphic =
object
end
class ['a] polymorphic' : ['a] polymorphic
| null | https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/odoc.1.4.2/test/html/cases/class.mli | ocaml | class type empty =
object
end
class type mutually =
object
end
and recursive =
object
end
class mutually' : mutually
and recursive' : recursive
class type virtual empty_virtual =
object
end
class virtual empty_virtual' : empty
class type ['a] polymorphic =
object
end
class ['a] polymorphic' : ['a] polymorphic
| |
7d1b0ed2bbc067130a2f017ea80ba7f89720651f27c84fb1fb9023c57f548c27 | mbj/stratosphere | ActionProperty.hs | module Stratosphere.SES.ReceiptRule.ActionProperty (
module Exports, ActionProperty(..), mkActionProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.SES.ReceiptRule.AddHeaderActionProperty as Ex... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/ses/gen/Stratosphere/SES/ReceiptRule/ActionProperty.hs | haskell | # SOURCE #
# SOURCE #
# SOURCE #
# SOURCE #
# SOURCE #
# SOURCE #
# SOURCE # | module Stratosphere.SES.ReceiptRule.ActionProperty (
module Exports, ActionProperty(..), mkActionProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
data ActionProperty
= ActionProperty {a... |
37cf2b497a1ca31b06e589e96b4ad56a37344321f0371a7b69e199203cedb590 | bos/rwh | Expensive.hs | - snippet notQuiteRight -
import Control.Concurrent
notQuiteRight = do
mv <- newEmptyMVar
forkIO $ expensiveComputation_stricter mv
someOtherActivity
result <- takeMVar mv
print result
{-- /snippet notQuiteRight --}
{-- snippet expensiveComputation --}
expensiveComputation mv = do
let a = "this is "
... | null | https://raw.githubusercontent.com/bos/rwh/7fd1e467d54aef832f5476ebf5f4f6a898a895d1/examples/ch24/Expensive.hs | haskell | - /snippet notQuiteRight -
- snippet expensiveComputation -
- /snippet expensiveComputation - | - snippet notQuiteRight -
import Control.Concurrent
notQuiteRight = do
mv <- newEmptyMVar
forkIO $ expensiveComputation_stricter mv
someOtherActivity
result <- takeMVar mv
print result
expensiveComputation mv = do
let a = "this is "
b = "not really "
c = "all that expensive"
putMVar mv (a ++... |
2e7f003cecb02064f3d0a517d1a1e9a5f2bc8eb4077001c2f4d1b0b519809e24 | wargrey/graphics | grayscale.rkt | #lang typed/racket/base
(require "../digitama/stdio.rkt")
(require "../effect.rkt")
(define romedalen (read-bitmap (collection-file-path "romedalen.png" "bitmap" "tamer" "cairo") #:backing-scale 2.0))
romedalen
(bitmap-grayscale/lightness romedalen)
(bitmap-grayscale/average romedalen)
(bitmap-grayscale/luminosity r... | null | https://raw.githubusercontent.com/wargrey/graphics/50751297f244a01ac734099b9a1e9be97cd36f3f/bitmap/tamer/grayscale.rkt | racket | #lang typed/racket/base
(require "../digitama/stdio.rkt")
(require "../effect.rkt")
(define romedalen (read-bitmap (collection-file-path "romedalen.png" "bitmap" "tamer" "cairo") #:backing-scale 2.0))
romedalen
(bitmap-grayscale/lightness romedalen)
(bitmap-grayscale/average romedalen)
(bitmap-grayscale/luminosity r... | |
84df03f19c1b6e7341ab606deb3e4dafc1b07c3633da4b44b1391c669ff98b5f | pfdietz/ansi-test | define-symbol-macro.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sun Apr 20 12:55:05 2003
;;;; Contains: Tests of DEFINE-SYMBOL-MACRO
(deftest define-symbol-macro.error.1
(signals-error (funcall (macro-function 'define-symbol-macro))
program-error)
t)
(deftest define-symbol-macro.error.2
(signals-error ... | null | https://raw.githubusercontent.com/pfdietz/ansi-test/3f4b9d31c3408114f0467eaeca4fd13b28e2ce31/eval-and-compile/define-symbol-macro.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of DEFINE-SYMBOL-MACRO | Author :
Created : Sun Apr 20 12:55:05 2003
(deftest define-symbol-macro.error.1
(signals-error (funcall (macro-function 'define-symbol-macro))
program-error)
t)
(deftest define-symbol-macro.error.2
(signals-error (funcall (macro-function 'define-symbol-macro)
... |
207ecdcbfc3cbfaa6fd8bf1818e8e74eef552399ef87f0926e55baf7d5f53c1c | lispcast/clojurescript-test | core_test.cljs | (ns lab-notebook.core-test
(:require [cljs.test :refer-macros [async deftest is testing]]
[lab-notebook.core :refer [delete ajax-get]]))
(deftest delete-test
(is (= [] (delete [1] 0)))
(is (= [2] (delete [1 2] 0)))
(is (= [1 3] (delete [1 2 3] 1))))
(deftest ajax-get-test
(async done
(a... | null | https://raw.githubusercontent.com/lispcast/clojurescript-test/369c18df2f6f336f9bd37a67fb62406f0d63111b/cljs-test/lab_notebook/core_test.cljs | clojure | (ns lab-notebook.core-test
(:require [cljs.test :refer-macros [async deftest is testing]]
[lab-notebook.core :refer [delete ajax-get]]))
(deftest delete-test
(is (= [] (delete [1] 0)))
(is (= [2] (delete [1 2] 0)))
(is (= [1 3] (delete [1 2 3] 1))))
(deftest ajax-get-test
(async done
(a... | |
8b766ca1f44bfd4ab8ef93ce5b33bc48dc1b169082cd0a4114292016a3f119ad | marick/fp-oo | higher-order-functions-2.clj |
7
(def check-sum
(fn [sequence]
(apply + (map *
(range 1 (inc (count sequence)))
sequence))))
8
(def isbn?
(fn [candidate]
(zero? (rem (check-sum (reversed-digits candidate)) 11))))
| null | https://raw.githubusercontent.com/marick/fp-oo/434937826d794d6fe02b3e9a62cf5b4fbc314412/solutions/pieces/higher-order-functions-2.clj | clojure |
7
(def check-sum
(fn [sequence]
(apply + (map *
(range 1 (inc (count sequence)))
sequence))))
8
(def isbn?
(fn [candidate]
(zero? (rem (check-sum (reversed-digits candidate)) 11))))
| |
ed5d03b0f862689f35facf5abd7650338d67c079a3b7f8b9a88050075d0248b9 | 6502/JSLisp | calc.lisp | (defobject binop (precedence associativity f))
(defun val (e x)
(cond
Formula
((list? x) (val e (aref e (first x)))) ; Unboxing
(true x)))
(macrolet ((bop (precedence associativity f)
`(symbol-macrolet ((vx (val e x))
(vy (val e y)))
(... | null | https://raw.githubusercontent.com/6502/JSLisp/9a4aa1a9116f0cfc598ec9f3f30b59d99810a728/examples/calc.lisp | lisp | Unboxing | (defobject binop (precedence associativity f))
(defun val (e x)
(cond
Formula
(true x)))
(macrolet ((bop (precedence associativity f)
`(symbol-macrolet ((vx (val e x))
(vy (val e y)))
(new-binop ,precedence ',associativity (lambda (x y) (la... |
fef278412b8458c628bf01a19257f5af9c72a24f84e4ab3c09f04b594209cafe | haskus/packages | Line.hs | module Haskus.Maths.Geometry.Line
( Line (..)
, linePointNearest
, linePointOn
)
where
import Linear.V2
import Linear.Affine
import Linear.Metric
-- | A line
data Line a
= Line !a !a -- y = ax+b
| VLine !a -- { (a,y) }
deriving (Show,Eq,Ord)
-- | Get the point of the line nearest to the given ... | null | https://raw.githubusercontent.com/haskus/packages/40ea6101cea84e2c1466bc55cdb22bed92f642a2/haskus-maths/src/lib/Haskus/Maths/Geometry/Line.hs | haskell | | A line
y = ax+b
{ (a,y) }
| Get the point of the line nearest to the given point
P (V2 2.2 6.4)
>>> linePointOn l (linePointNearest l (P (V2 5 5)))
True
| Test if a point is one the line
>>> linePointOn (Line 2.0 3.0) (P (V2 5 5))
False
>>> linePointOn (Line 2.0 3.0) (P (V2 2 7))
True | module Haskus.Maths.Geometry.Line
( Line (..)
, linePointNearest
, linePointOn
)
where
import Linear.V2
import Linear.Affine
import Linear.Metric
data Line a
deriving (Show,Eq,Ord)
> > > linePointNearest ( VLine ( 2 : : Double ) ) ( P ( V2 5 5 ) )
P ( V2 2.0 5.0 )
> > > linePointNearest ( Line (... |
e641b1a379bc549538b9f7f480a332612e29afa170626b59df694cd76ff96338 | dwayne/eopl3 | parser.test.rkt | #lang racket
(require "./parser.rkt")
(require rackunit)
(check-equal?
(parse "1")
(a-program (const-exp 1)))
(check-equal?
(parse "x")
(a-program (var-exp 'x)))
(check-equal?
(parse "-(5, y)")
(a-program (diff-exp (const-exp 5) (var-exp 'y))))
(check-equal?
(parse "zero?(z)")
(a-program (zero?-exp (var-e... | null | https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/03-ch3/interpreters/racket/LET-3.8/parser.test.rkt | racket | #lang racket
(require "./parser.rkt")
(require rackunit)
(check-equal?
(parse "1")
(a-program (const-exp 1)))
(check-equal?
(parse "x")
(a-program (var-exp 'x)))
(check-equal?
(parse "-(5, y)")
(a-program (diff-exp (const-exp 5) (var-exp 'y))))
(check-equal?
(parse "zero?(z)")
(a-program (zero?-exp (var-e... | |
001b5f624e7233becede996945c6374c0564890b26f9eaf02ad48e3960a03359 | racket/racket7 | list.rkt | #lang racket/base
(require "write-with-max.rkt"
"mode.rkt"
"graph.rkt")
(provide print-list)
(define (print-list p who v mode o max-length graph config alt-list-prefix alt-list-constructor)
(define unquoted-pairs?
(and (eq? mode PRINT-MODE/UNQUOTED)
(not alt-list-constructor)
... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/io/print/list.rkt | racket | #lang racket/base
(require "write-with-max.rkt"
"mode.rkt"
"graph.rkt")
(provide print-list)
(define (print-list p who v mode o max-length graph config alt-list-prefix alt-list-constructor)
(define unquoted-pairs?
(and (eq? mode PRINT-MODE/UNQUOTED)
(not alt-list-constructor)
... | |
4a3e713650c5886dc5dbc66a4b4e3762404d92688c998d09d959ad82133c16b9 | kazu-yamamoto/cab | Run.hs | # LANGUAGE CPP #
module Run (run, toSwitch) where
import Data.List (intercalate)
import Distribution.Cab
#if MIN_VERSION_process(1,2,0)
import System.Process (callCommand)
#else
import Control.Monad (void)
import System.Cmd (system)
#endif
import Types
----------------------------------------------------------------... | null | https://raw.githubusercontent.com/kazu-yamamoto/cab/dd9e59877b08b476268000967340e86e72fbda45/src/Run.hs | haskell | --------------------------------------------------------------
--------------------------------------------------------------
-------------------------------------------------------------- | # LANGUAGE CPP #
module Run (run, toSwitch) where
import Data.List (intercalate)
import Distribution.Cab
#if MIN_VERSION_process(1,2,0)
import System.Process (callCommand)
#else
import Control.Monad (void)
import System.Cmd (system)
#endif
import Types
toSwitch :: Option -> Switch
toSwitch OptNoharm = SwNoharm... |
0e12217c448670e85a405034084d4d720fca1ee1c8766c53846183d2a50b2303 | yesodweb/yesod | Reps.hs | # LANGUAGE OverloadedStrings , TemplateHaskell , QuasiQuotes , TypeFamilies , MultiParamTypeClasses , ViewPatterns #
module YesodCoreTest.Reps
( specs
, Widget
, resourcesApp
) where
import Yesod.Core
import Test.Hspec
import Network.Wai
import Network.Wai.Test
import Data.ByteString.Lazy (ByteString)
... | null | https://raw.githubusercontent.com/yesodweb/yesod/c59993ff287b880abbf768f1e3f56ae9b19df51e/yesod-core/test/YesodCoreTest/Reps.hs | haskell | ^ http status code
^ expected body
^ accept header
^ expected body | # LANGUAGE OverloadedStrings , TemplateHaskell , QuasiQuotes , TypeFamilies , MultiParamTypeClasses , ViewPatterns #
module YesodCoreTest.Reps
( specs
, Widget
, resourcesApp
) where
import Yesod.Core
import Test.Hspec
import Network.Wai
import Network.Wai.Test
import Data.ByteString.Lazy (ByteString)
... |
dce7c7498088bf38fc3e4e101f20dee6eb36ce0ca0aadfa7dee32bc9333d7a2f | rjnw/sham | pat-stx.rkt | #lang racket
(require racket/syntax
(for-template racket syntax/parse))
(require "reqs.rkt"
"pat.rkt")
(provide (all-defined-out))
(struct cmplr:pat:stx:var cmplr:pat:tvar []
#:methods gen:stx
[(define (->syntax sv)
(match-define (cmplr:pat:stx:var id orig-id type) sv)
(if type
... | null | https://raw.githubusercontent.com/rjnw/sham/6e0524b1eb01bcda83ae7a5be6339da4257c6781/sham-sam/sham/sam/syntax/cmplr/pat-stx.rkt | racket | syntax-class directive ; #:with/#:when/#:attr ... | #lang racket
(require racket/syntax
(for-template racket syntax/parse))
(require "reqs.rkt"
"pat.rkt")
(provide (all-defined-out))
(struct cmplr:pat:stx:var cmplr:pat:tvar []
#:methods gen:stx
[(define (->syntax sv)
(match-define (cmplr:pat:stx:var id orig-id type) sv)
(if type
... |
0294fb09feda5f6038cc13bc51fc96b10ec7df4606b344b334b435abd8e6e636 | dongcarl/guix | transformations.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2016 , 2017 , 2019 , 2020 , 2021 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; ... | null | https://raw.githubusercontent.com/dongcarl/guix/82543e9649da2da9a5285ede4ec4f718fd740fcb/tests/transformations.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2016 , 2017 , 2019 , 2020 , 2021 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (test-transformations)
#:use-module (guix tests)
#:use-module (guix... |
3efcbde922c38a0936b41841c51bbe72702dab3a5052e898985d92df3aa7c9cc | racket/typed-racket | typed-provide.rkt | #lang racket/base
;; Test providing a value to an untyped context
(module a typed/racket/base
(provide f)
(define (f (x : (Boxof (Boxof Integer))))
(unbox (unbox x))))
(module b racket/base
(provide bbx)
(define bbx (box 0)))
(module c typed/racket/base/optional
(require (submod ".." a))
(require/ty... | null | https://raw.githubusercontent.com/racket/typed-racket/1dde78d165472d67ae682b68622d2b7ee3e15e1e/typed-racket-test/succeed/optional/typed-provide.rkt | racket | Test providing a value to an untyped context | #lang racket/base
(module a typed/racket/base
(provide f)
(define (f (x : (Boxof (Boxof Integer))))
(unbox (unbox x))))
(module b racket/base
(provide bbx)
(define bbx (box 0)))
(module c typed/racket/base/optional
(require (submod ".." a))
(require/typed (submod ".." b) (bbx (Boxof (Boxof Integer))... |
0401cff2f678a65ae3379f91cb54de68b2fbba72d5fddbd92c616529f7accd52 | marick/fp-oo | pattern.clj | (use 'patterned.sweet)
(defpatterned count-sequence
[so-far [ ] ] so-far
[so-far [head & tail] ] (count-sequence (inc so-far) tail))
| null | https://raw.githubusercontent.com/marick/fp-oo/434937826d794d6fe02b3e9a62cf5b4fbc314412/sources/pattern.clj | clojure | (use 'patterned.sweet)
(defpatterned count-sequence
[so-far [ ] ] so-far
[so-far [head & tail] ] (count-sequence (inc so-far) tail))
| |
1ee16ad75946eba89d222ca69c74b706e6bc04beeaab07b76e69e3dac571d910 | snoyberg/why-you-should-use-stm | exercise.hs | #!/usr/bin/env stack
-- stack --resolver lts-13.21 script
import Control.Applicative
import Control.Concurrent.Async
import Control.Concurrent.STM
import Data.Time
myThreadDelay :: Int -> IO ()
myThreadDelay micros = do
putStrLn "This isn't right..."
myTimeout :: Int -> IO a -> IO (Maybe a)
myTimeout micros action ... | null | https://raw.githubusercontent.com/snoyberg/why-you-should-use-stm/adf3366aebd6daf1dd702ed4cad1c2303d296afc/exercises/11-register-delay/exercise.hs | haskell | stack --resolver lts-13.21 script | #!/usr/bin/env stack
import Control.Applicative
import Control.Concurrent.Async
import Control.Concurrent.STM
import Data.Time
myThreadDelay :: Int -> IO ()
myThreadDelay micros = do
putStrLn "This isn't right..."
myTimeout :: Int -> IO a -> IO (Maybe a)
myTimeout micros action = do
putStrLn "Neither is this"
J... |
5573851b946bc0e1baf1332f9d34d8486ae8cae627d4dfcdf507b1f95b14f84c | bldl/magnolisp | test-names-2.rkt | #lang magnolisp/2014
(typedef int (#:annos foreign))
(function (equal? x y)
(#:annos (type (fn int int Bool)) foreign)
(begin-racket
(local-require (only-in racket/base equal?))
(equal? x y)))
(function (f x y) (#:annos export (type (fn int int Bool)))
(equal? x y))
(f 1 1)
(f 1 2)
| null | https://raw.githubusercontent.com/bldl/magnolisp/191d529486e688e5dda2be677ad8fe3b654e0d4f/tests/test-names-2.rkt | racket | #lang magnolisp/2014
(typedef int (#:annos foreign))
(function (equal? x y)
(#:annos (type (fn int int Bool)) foreign)
(begin-racket
(local-require (only-in racket/base equal?))
(equal? x y)))
(function (f x y) (#:annos export (type (fn int int Bool)))
(equal? x y))
(f 1 1)
(f 1 2)
| |
2c98e72dee9a46dd5a276909492e0bb3d5e018c1373c39ee0f81ea6b047cc154 | metabase/metabase | user.clj | (ns metabase-enterprise.audit-app.api.user
"`/api/ee/audit-app/user` endpoints. These only work if you have a premium token with the `:audit-app` feature."
(:require
[compojure.core :refer [DELETE]]
[metabase.api.common :as api]
[metabase.api.user :as api.user]
[metabase.models.pulse :refer [Pulse]]
... | null | https://raw.githubusercontent.com/metabase/metabase/6d7f778ef68761b9af943d07ed868d9d0f67f64a/enterprise/backend/src/metabase_enterprise/audit_app/api/user.clj | clojure | Alerts/DashboardSubscriptions
archive anything they created. | (ns metabase-enterprise.audit-app.api.user
"`/api/ee/audit-app/user` endpoints. These only work if you have a premium token with the `:audit-app` feature."
(:require
[compojure.core :refer [DELETE]]
[metabase.api.common :as api]
[metabase.api.user :as api.user]
[metabase.models.pulse :refer [Pulse]]
... |
ca88bbcf31f6fe2038b92beb35f7a539b6596ee9861a96ae0b6e1a834d309de2 | input-output-hk/plutus | RelativizedMap.hs | -- editorconfig-checker-disable-file
{-# LANGUAGE TypeFamilies #-}
# LANGUAGE UndecidableInstances #
module Data.RandomAccessList.RelativizedMap (RelativizedMap (..))where
import Data.Word
import Data.RandomAccessList.Class qualified as RAL
import Data.IntMap.Strict qualified as IM
import GHC.Exts (IsList)
... | null | https://raw.githubusercontent.com/input-output-hk/plutus/c8d4364d0e639fef4d5b93f7d6c0912d992b54f9/plutus-core/index-envs/src/Data/RandomAccessList/RelativizedMap.hs | haskell | editorconfig-checker-disable-file
# LANGUAGE TypeFamilies #
| A sequence implemented by a map from "levels" to values and a counter giving the "current" level.
# UNPACK # | # LANGUAGE UndecidableInstances #
module Data.RandomAccessList.RelativizedMap (RelativizedMap (..))where
import Data.Word
import Data.RandomAccessList.Class qualified as RAL
import Data.IntMap.Strict qualified as IM
import GHC.Exts (IsList)
deriving stock (Show, Eq)
deriving (IsList) via RAL.AsRAL (Relativi... |
de49923242ebebade02b1490d6c3b975b26e4a1537096a417d1165266b2a1189 | craigl64/clim-ccl | lucid-stream-functions.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Package : CLIM - UTILS ; Base : 10 ; Lowercase : Yes -*-
(in-package :clim-utils)
"Copyright (c) 1990, 1991, 1992 Symbolics, Inc. All rights reserved.
Portions copyright (c) 1989, 1990 International Lisp Associates."
;;; All of this is taken from the STREAM-DEFI... | null | https://raw.githubusercontent.com/craigl64/clim-ccl/301efbd770745b429f2b00b4e8ca6624de9d9ea9/utils/lucid-stream-functions.lisp | lisp | Syntax : ANSI - Common - Lisp ; Package : CLIM - UTILS ; Base : 10 ; Lowercase : Yes -*-
All of this is taken from the STREAM-DEFINITION-BY-USER proposal to
Lisp implementation yet supports this proposal, so we implement it
here in this separate package. This way we will be ready when some
Lisp implementation ado... |
(in-package :clim-utils)
"Copyright (c) 1990, 1991, 1992 Symbolics, Inc. All rights reserved.
Portions copyright (c) 1989, 1990 International Lisp Associates."
the X3J13 committee , made by of TI on 22 March 1989 . No
#+ignore
(eval-when (compile load eval)
(defparameter sym-list '("PEEK-CHAR" "READ-BYT... |
c9948104583027c6ca040d9d2b5b93037fce9e94d79b2042d65b6c7e91c131ab | VincentCordobes/prep | test.ml | open Prep
open ISO8601.Permissive
let drop_store () =
let store_path = try Sys.getenv "STORE_PATH" with Not_found -> "" in
if store_path <> "" && Sys.file_exists store_path then (
Fmt.pr "Removing existing store";
Sys.remove store_path)
let before_all () =
drop_store ();
Store.init ()
let () = before... | null | https://raw.githubusercontent.com/VincentCordobes/prep/104d8a0d406714b189917d6b05aa51a7e7f88393/test/test.ml | ocaml | when
then
when
then
when
then
when
then
when
then
should not move the card but still update the last reviewed
when
then
Should move the card a to the next box
when
then
when
then
should move the card at the end
when
then
Should not move the card
Partial match
partial match ... | open Prep
open ISO8601.Permissive
let drop_store () =
let store_path = try Sys.getenv "STORE_PATH" with Not_found -> "" in
if store_path <> "" && Sys.file_exists store_path then (
Fmt.pr "Removing existing store";
Sys.remove store_path)
let before_all () =
drop_store ();
Store.init ()
let () = before... |
9b9043f677967601ddb9125d743dea1ecaa83c12cbd50ae19f615df350b176c0 | CompSciCabal/SMRTYPRTY | exercises_2.1.rkt | #lang racket
provided from SICP
(define (gcd m n)
(cond ((< m n) (gcd n m))
((= n 0) m)
(else (gcd n (remainder m n)))))
(define (make-rat n d)
(let ((g (gcd n d)))
(cons (/ n g) (/ d g))))
(define (numer r)
(car r))
(define (denom r)
(cdr r))
(define (add-rat x y)
(make-rat (+ (* (n... | null | https://raw.githubusercontent.com/CompSciCabal/SMRTYPRTY/4a5550789c997c20fb7256b81469de1f1fce3514/sicp/v2/2.1/csaunders/exercises_2.1.rkt | racket | Design with wishful thinking
-- call the functions we want
-- define them when they are missing
vectors. This should allow rectangles of any orientation to work.
Granted, I'm not doing anything to verify that vh and vw are
perpendicular.
Implement required functions -- note: need to
add segment-length functio... | #lang racket
provided from SICP
(define (gcd m n)
(cond ((< m n) (gcd n m))
((= n 0) m)
(else (gcd n (remainder m n)))))
(define (make-rat n d)
(let ((g (gcd n d)))
(cons (/ n g) (/ d g))))
(define (numer r)
(car r))
(define (denom r)
(cdr r))
(define (add-rat x y)
(make-rat (+ (* (n... |
e14dd7b3eefd1d9b6d1f84abbe8692728f13ca20f9dfacd44339d496d5f2b132 | semperos/rankle | table_test.clj | (ns com.semperos.rankle.table-test
(:require [clojure.test :refer :all]
[com.semperos.rankle.table :refer :all]))
(deftest test-table-and-column-map
(let [data (mapv (fn [idx]
{:foo (* (inc idx) 15)
:barcel (nth ["alpha" "beta" "gamma" "delta" "epsilon"] id... | null | https://raw.githubusercontent.com/semperos/rankle/d898c144e33056d743848620f17564d88d87e874/test/com/semperos/rankle/table_test.clj | clojure | (ns com.semperos.rankle.table-test
(:require [clojure.test :refer :all]
[com.semperos.rankle.table :refer :all]))
(deftest test-table-and-column-map
(let [data (mapv (fn [idx]
{:foo (* (inc idx) 15)
:barcel (nth ["alpha" "beta" "gamma" "delta" "epsilon"] id... | |
b16e741a48aba671d437e94da04839dbeaf2dcff4c0c0c4b1c51f3de4c386276 | clojurecup2014/parade-route | zip.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; ... | null | https://raw.githubusercontent.com/clojurecup2014/parade-route/adb2e1ea202228e3da07902849dee08f0bb8d81c/Assets/Clojure/Internal/Plugins/clojure/zip.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) . All rights reserved .
see
(ns ^{:doc "Functional hierarchical zipper, with navigation, editing,
and enumeration. See Huet"
:author "Rich Hickey"}
clojure.zip
(:refer-clojure :exclude (replace remove next)))
(defn zipper
"Creates a new zipper structure.
branch? is a fn th... |
1423003e806e0ed120ea939e79e53120109284ff8dfa2403b57ee44da8d08cd9 | frenetic-lang/netcore-1.0 | ShortestPath.hs | module ShortestPath
where
import qualified Debug.Trace as Trace
import qualified Data.List as List
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Data.Maybe
import Frenetic.NetCore
import Frenetic.NetCore.Semantics
import Frenetic.Topo
import Frenetic.TopoParser
type Node = ... | null | https://raw.githubusercontent.com/frenetic-lang/netcore-1.0/976b08b740027e8ed19f2d55b1e77f663bee6f02/examples/ShortestPath.hs | haskell | Note that the default case below should never hapen
Shoudn't happen, all edges should exist
sample data from the net command of mininet
If the network could not be parsed, make an empty graph | module ShortestPath
where
import qualified Debug.Trace as Trace
import qualified Data.List as List
import qualified Data.Map as Map
import qualified Data.Set as Set
import qualified Data.Maybe
import Frenetic.NetCore
import Frenetic.NetCore.Semantics
import Frenetic.Topo
import Frenetic.TopoParser
type Node = ... |
2f7a8bc7e4cb0feab3d438697648db2f542a81c335fefb4a42584ec620da62f6 | samrushing/irken-compiler | t_tail.scm |
(define (+ a b)
(%%cexp (int int -> int) "%0+%1" a b))
(define (thing1 x)
(define (thing2)
(+ 10 x)
)
(thing2)
)
(thing1 5)
| null | https://raw.githubusercontent.com/samrushing/irken-compiler/690da48852d55497f873738df54f14e8e135d006/tests/t_tail.scm | scheme |
(define (+ a b)
(%%cexp (int int -> int) "%0+%1" a b))
(define (thing1 x)
(define (thing2)
(+ 10 x)
)
(thing2)
)
(thing1 5)
| |
0a6f11d7f845a60f7f73f7a9624adb2c19a97351149353a6e5d5a2ef535232d0 | ugglan/cljaws | sdb_test.clj | (ns cljaws.sdb-test
(:use (cljaws core sdb core-test helpers) :reload-all)
(:use [clojure.test]))
(def timeout-seconds 15)
(deftest list-domains-test
(let [domain-name (make-unique-name "domain")
domain-name2 (make-unique-name "domain")]
(with-aws :sdb
(create-domain domain-name)
(let [result ... | null | https://raw.githubusercontent.com/ugglan/cljaws/0df2312d61e6c7d52520479b3c103858c72e9f5b/test/cljaws/sdb_test.clj | clojure | commands should now autocreate domain if needed
implicit delete
explicit delete | (ns cljaws.sdb-test
(:use (cljaws core sdb core-test helpers) :reload-all)
(:use [clojure.test]))
(def timeout-seconds 15)
(deftest list-domains-test
(let [domain-name (make-unique-name "domain")
domain-name2 (make-unique-name "domain")]
(with-aws :sdb
(create-domain domain-name)
(let [result ... |
6d71714bb707db61b525b115dc2e1becdc4044043d50d70951c225d64fc2767b | pink-gorilla/webly | deps.cljs | {:npm-deps
{; fonts
"@fortawesome/fontawesome-free" "^5.14.0"
"get-google-fonts" "^1.2.2"
; tailwind
"tailwindcss" "2.1.2"
"autoprefixer" "^10.0.2" ; peer dependency of tailwind. actually needed?
"postcss" "^8.1.13" ; peer dependency of tailwind
;
}}
| null | https://raw.githubusercontent.com/pink-gorilla/webly/66f0e64bff60b85b1a8b4b1a2a1ef09e6ad50960/frontend/src/frontend/deps.cljs | clojure | fonts
tailwind
peer dependency of tailwind. actually needed?
peer dependency of tailwind
| {:npm-deps
"@fortawesome/fontawesome-free" "^5.14.0"
"get-google-fonts" "^1.2.2"
"tailwindcss" "2.1.2"
}}
|
77601b27ab2b4d5889163e4814e325f710aa30c494aef68d4e0ea61adb74c541 | agrafix/Spock | Spec.hs | module Main where
import Test.Hspec
import qualified Web.Spock.CsrfSpec
import qualified Web.Spock.Internal.SessionManagerSpec
import qualified Web.Spock.Internal.SessionVaultSpec
import qualified Web.Spock.SafeSpec
main :: IO ()
main = hspec $
do
Web.Spock.Internal.SessionVaultSpec.spec
Web.Spock.Internal.... | null | https://raw.githubusercontent.com/agrafix/Spock/6055362b54f2fae5418188c3fc2fc1659ca43e79/Spock/test/Spec.hs | haskell | module Main where
import Test.Hspec
import qualified Web.Spock.CsrfSpec
import qualified Web.Spock.Internal.SessionManagerSpec
import qualified Web.Spock.Internal.SessionVaultSpec
import qualified Web.Spock.SafeSpec
main :: IO ()
main = hspec $
do
Web.Spock.Internal.SessionVaultSpec.spec
Web.Spock.Internal.... | |
52789eebde00f233d9fc949651661207167e19d1192430540cdff2b82b54c6bc | ahjones/lein-rpm | core.clj | (ns plugin.test.core
(:use [plugin.core])
(:use [clojure.test]))
(deftest replace-me ;; FIXME: write
(is false "No tests have been written."))
| null | https://raw.githubusercontent.com/ahjones/lein-rpm/eca4d93690db41a2d7c8a7eeaf9df879476b5c6d/test/plugin/test/core.clj | clojure | FIXME: write | (ns plugin.test.core
(:use [plugin.core])
(:use [clojure.test]))
(is false "No tests have been written."))
|
57346291b6d3cac99921bb5f195d81f9884e9db756be3b60223765db56c7c658 | let-def/ttx | ttypes.mli | open Ttx_base
type ('a, 'b) binder = ('a, 'b) Binder.t
module Arg_label : sig
type t =
| Nolabel
| Labelled of string
| Optional of string
end
type arg_label = Arg_label.t
module Type_expr : sig
include INDEXABLE
type arg_label =
| Nolabel
| Labelled of string
| Optional of string
t... | null | https://raw.githubusercontent.com/let-def/ttx/0a50ba7253056d1202f108b67faf4d9cc78e020d/attic/attempt0/ttypes.mli | ocaml | Value descriptions
Type of the value
Regular value
Primitive
Instance variable (mutable ?)
Self
Ancestor
Variance
allow positive occurrences
allow negative occurrences
allow occurrences under a negative position
type is injective in this parameter
there is a positive occurrence
there is a neg... | open Ttx_base
type ('a, 'b) binder = ('a, 'b) Binder.t
module Arg_label : sig
type t =
| Nolabel
| Labelled of string
| Optional of string
end
type arg_label = Arg_label.t
module Type_expr : sig
include INDEXABLE
type arg_label =
| Nolabel
| Labelled of string
| Optional of string
t... |
ce4e42fe571f3de855feea5d7fbc3ceacc6452d7087dd1345bbead4af84c42bc | spawnfest/eep49ers | shell_default.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2016 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/stdlib/src/shell_default.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 1996 - 2016 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(shell_default).
-export([help/0,lc/1,c/1,c/2,c/3,nc/1,nl/1,l/1,i/0,pid/3,i/3,m/0,m/1,lm/0,mm/0,
m... |
fed48ca5f9fb333124424ace503859553aa94e4674839a721dcbfcd6c77daaec | aria42/infer | matrix_test.clj | (ns infer.matrix-test
(:use clojure.test
infer.matrix))
(deftest leave-out-columns
(is (= #{0 1 4}
(leave-out [2 3] (range 0 5)))))
(deftest inc-at-test
(let [A (fill 0 3 3)]
(inc-at A 0 0)
(is (= 1 (get-at A 0 0)))
(inc-at A 2 0 0)
(is (= 3 (get-at A 0 0)))))
(deftest ensure-vecs-test
... | null | https://raw.githubusercontent.com/aria42/infer/9849325a27770794b91415592a8706fd90777469/test/infer/matrix_test.clj | clojure | (deftest matrix-divide | (ns infer.matrix-test
(:use clojure.test
infer.matrix))
(deftest leave-out-columns
(is (= #{0 1 4}
(leave-out [2 3] (range 0 5)))))
(deftest inc-at-test
(let [A (fill 0 3 3)]
(inc-at A 0 0)
(is (= 1 (get-at A 0 0)))
(inc-at A 2 0 0)
(is (= 3 (get-at A 0 0)))))
(deftest ensure-vecs-test
... |
20e8aea76f334bbe05cba21a22f67311e493f86ea1507038e5b98626e9f931d8 | rrnewton/haskell-lockfree | Atomic.hs | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE DefaultSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE FlexibleInstances #
# LANGUAGE CPP #
module Data.Vector.Unboxed.Atomic
where
import Foreign.Storable (Storable, sizeOf)
import Data.Int
import Data.Word
import qualified Data.Vector.Primitive as P
-- T... | null | https://raw.githubusercontent.com/rrnewton/haskell-lockfree/87122157cbbc96954fcc575b4b110003d3e5c2f8/vector-atomics/Data/Vector/Unboxed/Atomic.hs | haskell | The specific MV_* constructors that we need are here:
------------------------------------------------------------------------------
| Vector types which are implemented as single MutableByteArray, and whose
elements are of an appropriate size to perform atomic memory operations on them.
----------------------------... | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE DefaultSignatures #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE FlexibleInstances #
# LANGUAGE CPP #
module Data.Vector.Unboxed.Atomic
where
import Foreign.Storable (Storable, sizeOf)
import Data.Int
import Data.Word
import qualified Data.Vector.Primitive as P
impo... |
a6b8a2efeed0d435725ca080cc4b37ded9db80ca90de9bf71c4634a004585c8d | DogLooksGood/holdem | router.cljs | (ns poker.events.router
(:require
[re-frame.core :as re-frame]
[reitit.frontend.easy :as rfe]
[reitit.frontend.controllers :as rfc]))
(re-frame/reg-fx :router/push-state
(fn [route]
(apply rfe/push-state route)))
(re-frame/reg-event-db :router/initialize-router
(fn [db _] (assoc db :current-... | null | https://raw.githubusercontent.com/DogLooksGood/holdem/bc0f93ed65cab54890c91f78bb95fe3ba020a41f/src/cljs/poker/events/router.cljs | clojure | (ns poker.events.router
(:require
[re-frame.core :as re-frame]
[reitit.frontend.easy :as rfe]
[reitit.frontend.controllers :as rfc]))
(re-frame/reg-fx :router/push-state
(fn [route]
(apply rfe/push-state route)))
(re-frame/reg-event-db :router/initialize-router
(fn [db _] (assoc db :current-... | |
e6953d2f788c2b6108dde6d75b48b9ca5deaa82cbc4238a59fd47dc484655ccf | bugczw/Introduction-to-Functional-Programming-in-OCaml | goodSignature.ml | module Naturals : sig
(* Invariant: A value of type t is a positive integer. *)
type t
val zero : t
val succ : t -> t
val pred : t -> t
end = struct
type t = int
let zero = 0
(* The functions maintain the invariant. *)
let succ n = if n = max_int then 0 else n + 1
let pred = function 0 -> 0 | n -> n... | null | https://raw.githubusercontent.com/bugczw/Introduction-to-Functional-Programming-in-OCaml/13c4d1f92e7479f8eb10ea5d4c43a598b6676d0f/OCaml_MOOC_W6_ALL/goodSignature.ml | ocaml | Invariant: A value of type t is a positive integer.
The functions maintain the invariant. | module Naturals : sig
type t
val zero : t
val succ : t -> t
val pred : t -> t
end = struct
type t = int
let zero = 0
let succ n = if n = max_int then 0 else n + 1
let pred = function 0 -> 0 | n -> n - 1
end;;
open Naturals
let rec add : t -> t -> t = fun x y ->
if x = zero then y else succ (add (pred ... |
2490d2ef2981fed71fba79910118eca210027b0d1b51c67a605e6423fabad1fa | ghc/testsuite | tcfail122.hs | # LANGUAGE RankNTypes , KindSignatures #
module ShouldFail where
-- There should be a kind error, when unifying (a b) against (c d)
foo = [ undefined :: forall a b. a b,
undefined :: forall (c:: (* -> *) -> *) (d :: * -> *). c d ]
| null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_fail/tcfail122.hs | haskell | There should be a kind error, when unifying (a b) against (c d) | # LANGUAGE RankNTypes , KindSignatures #
module ShouldFail where
foo = [ undefined :: forall a b. a b,
undefined :: forall (c:: (* -> *) -> *) (d :: * -> *). c d ]
|
0b5c5010c82961c7addcc7b61f7aabdb7c90ce06e339c1d9700722620097942c | alexandroid000/improv | GetMapActionFeedback.hs | {-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE TemplateHaskell #
module Ros.Nav_msgs.GetMapActionFeedback where
import qualified Prelude as P
import Prelude ((.), (+), (*))
import qualified Data.Typeable as T
import Control.Applicative
import Ros.Internal.Ro... | null | https://raw.githubusercontent.com/alexandroid000/improv/ef0f4a6a5f99a9c7ff3d25f50529417aba9f757c/roshask/msgs/Nav_msgs/Ros/Nav_msgs/GetMapActionFeedback.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE DeriveDataTypeable # | # LANGUAGE DeriveGeneric #
# LANGUAGE TemplateHaskell #
module Ros.Nav_msgs.GetMapActionFeedback where
import qualified Prelude as P
import Prelude ((.), (+), (*))
import qualified Data.Typeable as T
import Control.Applicative
import Ros.Internal.RosBinary
import Ros.Internal.Msg.MsgInfo
import qualified GHC.Generics a... |
56832e9d0166d97c8c4a2a906dc32471a0271044d6283b48abb5375193770785 | hypernumbers/hypernumbers | translator.erl | ( C ) 2009 - 2014 , Hypernumbers Ltd.
%%%-------------------------------------------------------------------
%%%
%%% LICENSE
%%%
%%% This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation versi... | null | https://raw.githubusercontent.com/hypernumbers/hypernumbers/281319f60c0ac60fb009ee6d1e4826f4f2d51c4e/lib/formula_engine-1.0/src/translator.erl | erlang | -------------------------------------------------------------------
LICENSE
This program is free software: you can redistribute it and/or modify
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICU... | ( C ) 2009 - 2014 , Hypernumbers Ltd.
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3
You should have received a copy of the GNU Affero General Public License
@private
-module(translator).
-export([do/1]).
do(Formula) ->
TODO : get fren... |
41091b814bb44a2b53c4bd69f24ca17e3ae0c130eba2e294dfd3c548d3c4dff0 | lilactown/react-clj | fiber.clj | (ns lilactown.react.fiber
(:require
[clojure.zip :as zip]))
;;
;; Types and protocols
;;
(defprotocol IRender
(render [c props] "Render a component, return a tree of immutable elements"))
(defrecord Element [type props key])
(defrecord FiberNode [alternate type props state children])
(defn element?
[x... | null | https://raw.githubusercontent.com/lilactown/react-clj/d315d59372dba28655d89a98b2523c36b3366d99/src/lilactown/react/fiber.clj | clojure |
Types and protocols
Hooks
Reconciliation
destructuring doesn't seem to fail if `_node` is actually a primitive
i.e. a string or number, so we can just check to see if `type` is
`nil` to know whether we are dealing with an actual element
example
| (ns lilactown.react.fiber
(:require
[clojure.zip :as zip]))
(defprotocol IRender
(render [c props] "Render a component, return a tree of immutable elements"))
(defrecord Element [type props key])
(defrecord FiberNode [alternate type props state children])
(defn element?
[x]
(= Element (type x)))
(... |
f99804b9060c0cfef9e7938016d3e2ea9c8683c34ea4df4ec85be95a95951ba1 | jdan/ocaml-web-framework | http.ml | module RequestBuffer = struct
let buffer_length = 1024
(* *)
let index_string s1 s2 =
let re = Str.regexp_string s2
in
try Str.search_forward re s1 0
with Not_found -> -1
let rec recv_until socket buffer needle =
(* TODO: We don't need to check the entire buffer, just
the character... | null | https://raw.githubusercontent.com/jdan/ocaml-web-framework/bfa2f240a9aecc4edbf02ab87a73cfd20da482a4/src/http.ml | ocaml |
TODO: We don't need to check the entire buffer, just
the characters we've added to the buffer
TODO: String.split_in_two
Debug! | module RequestBuffer = struct
let buffer_length = 1024
let index_string s1 s2 =
let re = Str.regexp_string s2
in
try Str.search_forward re s1 0
with Not_found -> -1
let rec recv_until socket buffer needle =
let index = index_string buffer needle in
if index > -1 then
let str = Stri... |
7ca6ab0bae7a9d039b67bb76a48efbe1ccf1534330956a3909a1182cd2c91ffb | OlafChitil/hat | Ident.hs | module Ident
( Ident(..)
, getIdentAt -- :: FileNode -> IO Ident
) where
import LowLevel (FileNode(..))
import System.IO.Unsafe (unsafePerformIO)
import Foreign.Ptr (Ptr)
import Foreign.Marshal.Alloc (free)
import Foreign.C.String (CString, peekCString)
foreign import ccall " malloc.h & fr... | null | https://raw.githubusercontent.com/OlafChitil/hat/8840a480c076f9f01e58ce24b346850169498be2/tools/Ident.hs | haskell | :: FileNode -> IO Ident
All possible relevant information about an identifier
------------------------------------------------------------------- | module Ident
( Ident(..)
) where
import LowLevel (FileNode(..))
import System.IO.Unsafe (unsafePerformIO)
import Foreign.Ptr (Ptr)
import Foreign.Marshal.Alloc (free)
import Foreign.C.String (CString, peekCString)
foreign import ccall " malloc.h & free " finaliserFree : : FunPtr ( Ptr a - > IO ( ) )
... |
06734d1ba8540d3d03b7ac3b7abcf65fd2fa7de91040130fa46333a54f3f8d66 | mathematical-systems/clml | iterate-test.lisp | ;;; Test cases for Iterate.
Copyright ( c ) 2003 < >
Copyright ( c ) 2004 - 2007 < >
;;; License:
;; Permission is hereby granted, free of charge, to any person
;; obtaining a copy of this software and associated documentation
files ( the " Software " ) , to deal in the Software without
;; restriction, in... | null | https://raw.githubusercontent.com/mathematical-systems/clml/918e41e67ee2a8102c55a84b4e6e85bbdde933f5/addons/iterate/iterate-test.lisp | lisp | Test cases for Iterate.
License:
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use, copy,
modify, merge, publish, distribute, sublicense, and/or sell copies
furnished to do so, sub... |
Copyright ( c ) 2003 < >
Copyright ( c ) 2004 - 2007 < >
files ( the " Software " ) , to deal in the Software without
of the Software , and to permit persons to whom the Software is
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRAN... |
b0e8be2d025b3a69ff36db3694085bc9a7dfd7bcc93c32aaf2a6ad56ad68c2a1 | kawasima/back-channeling | routing.cljs | (ns back-channeling.routing
(:require [om.core :as om :include-macros true]
[clojure.browser.net :as net]
[secretary.core :as sec :include-macros true]
[goog.events :as events]
[goog.History]
[goog.history.EventType :as HistoryEventType]
[goog.ne... | null | https://raw.githubusercontent.com/kawasima/back-channeling/05d06278cedc35e4e7866384c2903d3c903a19fc/src/cljs/back_channeling/routing.cljs | clojure | (ns back-channeling.routing
(:require [om.core :as om :include-macros true]
[clojure.browser.net :as net]
[secretary.core :as sec :include-macros true]
[goog.events :as events]
[goog.History]
[goog.history.EventType :as HistoryEventType]
[goog.ne... | |
f3478a033e87fb4c1ef5c24c9fa7a4a5b458ecd342eb25a2a8f47b3ab343e169 | Shimuuar/histogram-fill | Histogram.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators #
-- |
-- Module : Data.Histogram
Copyright : Copyright ( c ) 2009 , < >
-- License : BSD3
Maintainer : < >
-- Stability : experimental
--
-- Immutable histograms. This module exports the same API as
-- 'Data.Histogram.Ge... | null | https://raw.githubusercontent.com/Shimuuar/histogram-fill/3dff15027390cf64e7fc3fbaac34c28ffcdacbd6/histogram-fill/Data/Histogram.hs | haskell | # LANGUAGE GADTs #
|
Module : Data.Histogram
License : BSD3
Stability : experimental
Immutable histograms. This module exports the same API as
'Data.Histogram.Generic' but specialized to unboxed vectors. Please refer
to the aforementioned module for detailed documentation.
* Immutable histograms
** C... | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators #
Copyright : Copyright ( c ) 2009 , < >
Maintainer : < >
module Data.Histogram (
Histogram
, module Data.Histogram.Bin
, histogram
, histogramUO
, asList
, asVector
, readHistogram
, readFileHistogram
, bins
, histData
, u... |
4fe1032c546a1b79d7c1df8518903ddbe762ecd341fab46b7dbeed5942035683 | DaisukeBekki/lightblue | ProofTree.hs | module DTS.Alligator.ProofTree
(
prove,
settingDef,
settingDNE,
settingEFQ,
ProofMode(..),
Setting(..),
announce
) where
DTT
DTT
Arrowterm
import qualified Data.Text.Lazy as T -- text
import qualified Data.List as L -- base
import qualified DTS.Prover_daido.Judgement as J
import qua... | null | https://raw.githubusercontent.com/DaisukeBekki/lightblue/abdbf50c9418d64afb27b9e09c05b778dd4b98f9/src/DTS/Alligator/ProofTree.hs | haskell | text
base
^ var_context ex)[(DT.Con (T.pack "prop")),(DT.Con (T.pack "set")),(DT.Con (T.pack "prop"))]
^ sig_context ex)[((T.pack "prop"),DT.Type),((T.pack "set"),DT.Type)] , classic
term
notate_type = con_arrow arrow_type
^ origin
^ base
^ target
substAsInPiElim term [] = term
substAsInPiElim term [] = term... | module DTS.Alligator.ProofTree
(
prove,
settingDef,
settingDNE,
settingEFQ,
ProofMode(..),
Setting(..),
announce
) where
DTT
DTT
Arrowterm
import qualified DTS.Prover_daido.Judgement as J
import qualified Debug.Trace as D
import qualified Data.Text.Lazy.IO as T
import qualified Interface.HTML as ... |
5ced07485563839a5f99edebd3944bed52d8609d1c82268bb1b56d920498b155 | mgree/smoosh | test_arith.ml | open Test_prelude
open Smoosh_num
open Smoosh
open Os_symbolic
open Arith
open Printf
let string_of_token tkn : string =
match tkn with
TNum n -> "NUM " ^ (Nat_big_num.to_string n)
| TVar s -> "VAR " ^ s
| TPlus -> "PLUS"
| TMinus -> "MINUS"
| TTimes -> "TIMES"
| TDiv -> "DIV"
| TMod -> "MOD"
| TBi... | null | https://raw.githubusercontent.com/mgree/smoosh/84b1ff86f59573a2e4fd7e23edfa0cf9fdb45db9/src/test_arith.ml | ocaml | Arithmetic ops
Assignment operators
*********************************************************************
DRIVER *************************************************************
*********************************************************************
General eval tests
Type specific eval tests | open Test_prelude
open Smoosh_num
open Smoosh
open Os_symbolic
open Arith
open Printf
let string_of_token tkn : string =
match tkn with
TNum n -> "NUM " ^ (Nat_big_num.to_string n)
| TVar s -> "VAR " ^ s
| TPlus -> "PLUS"
| TMinus -> "MINUS"
| TTimes -> "TIMES"
| TDiv -> "DIV"
| TMod -> "MOD"
| TBi... |
d9669d0b0469bb3d60ad1867e0760acb59645355b18110367e5028566f04b358 | screenshotbot/screenshotbot-oss | test-single.lisp | (defpackage :util/tests/test-single
(:use #:cl
#:fiveam)
(:import-from #:util/single
#:deserialize
#:serialize)
(:import-from #:fiveam-matchers/core
#:equal-to
#:has-typep
#:assert-that)
(:local-nicknames (#:a #:alexandria))... | null | https://raw.githubusercontent.com/screenshotbot/screenshotbot-oss/a80bbf0bff1d64f165d38eafe0937dced0d3cc7e/src/util/tests/test-single.lisp | lisp | (defpackage :util/tests/test-single
(:use #:cl
#:fiveam)
(:import-from #:util/single
#:deserialize
#:serialize)
(:import-from #:fiveam-matchers/core
#:equal-to
#:has-typep
#:assert-that)
(:local-nicknames (#:a #:alexandria))... | |
4fdf6be355273b510b40d646e268a8f37abe651a1ae0da3efb378202a39c2d99 | tsloughter/kakapo | kakapo_broker_sup.erl | -module(kakapo_broker_sup).
-behaviour(supervisor).
%% API
-export([start_link/0]).
%% Supervisor callbacks
-export([init/1]).
%% ===================================================================
%% API functions
%% ===================================================================
start_link() ->
superviso... | null | https://raw.githubusercontent.com/tsloughter/kakapo/7f2062029a2a26825055ef19ebe8d043d300df6b/apps/kakapo_broker/src/kakapo_broker_sup.erl | erlang | API
Supervisor callbacks
===================================================================
API functions
===================================================================
===================================================================
Supervisor callbacks
================================================... | -module(kakapo_broker_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
init(_Args) ->
RestartStrategy = one_for_one,
MaxRestarts = 1000,
MaxSecondsBetweenRestarts = 3600,
SupFlags = {RestartStrateg... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.