_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 |
|---|---|---|---|---|---|---|---|---|
3eb41c0662663455b8ae249484e653f250757026f9e1967ae91989244a1fb26b | xebia/VisualReview | analysis.clj | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Copyright 2015 Xebia B.V.
;
Licensed under the Apache License , Version 2.0 ( the " License " )
; you may not use this file except in compliance with the License.
; You may obtain a copy of the License at
;
; -2.0
;
; Unless requir... | null | https://raw.githubusercontent.com/xebia/VisualReview/c74c18ff73cbf11ece23203cb7a7768e626a03e2/src/main/clojure/com/xebia/visualreview/service/analysis.clj | clojure |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing per... | Copyright 2015 Xebia B.V.
Licensed under the Apache License , Version 2.0 ( the " License " )
distributed under the License is distributed on an " AS IS " BASIS ,
(ns com.xebia.visualreview.service.analysis
(:require [com.xebia.visualreview.util :refer :all]
[com.xebia.visualreview.service.persiste... |
9ffa48ce49b70558f02ec32b40e9cd3b8dd1484b960e4c6c42367a93ef2c9c55 | alanzplus/EOPL | a8.rkt | #lang racket
(provide ack-reg-driver)
(provide depth-reg-driver)
(provide fact-reg-driver)
(provide pascal-reg-driver)
(provide fib)
(provide fib-ramp-driver)
(provide bi-tramp-driver)
(define ack-reg-driver
(letrec ([m* 'uninit]
[n* 'uninit]
[k* 'uninit]
[v* 'uninit]
[emp... | null | https://raw.githubusercontent.com/alanzplus/EOPL/d7b06392d26d93df851d0ca66d9edc681a06693c/Indiana-CS311/a8-Registerization/a8.rkt | racket | #lang racket
(provide ack-reg-driver)
(provide depth-reg-driver)
(provide fact-reg-driver)
(provide pascal-reg-driver)
(provide fib)
(provide fib-ramp-driver)
(provide bi-tramp-driver)
(define ack-reg-driver
(letrec ([m* 'uninit]
[n* 'uninit]
[k* 'uninit]
[v* 'uninit]
[emp... | |
828809eafa313bd1cccdd9d21e7adf85dd50b56dee6bfa029d4f0f421e5952de | Decentralized-Pictures/T4L3NT | long_test.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2021 Nomadic Labs < >
(* ... | null | https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/tezt/long_tests/long_test.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2021 Nomadic Labs < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN AN... |
c7436bb99364952d88189f455ac3e8d86d8324980cf1624eea657b13af4ac447 | ericclack/overtone-loops | semiquavers.clj | (ns overtone-loops.proto.semiquavers
(:use [overtone.live]
[overtone.inst.piano]
[overtone-loops.loops]
[overtone-loops.samples]))
(set-up)
;; Patterns ------------------------------------------------------------
;; Instruments
;; Function to play piano notes
(defn fpiano
[anote]
... | null | https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/src/overtone_loops/proto/semiquavers.clj | clojure | Patterns ------------------------------------------------------------
Instruments
Function to play piano notes
Patterns ------------------------------------------------------------
(cymbal-closed)
---------------------------------------------------------------------
all play for only a few phrases
Play these wi... | (ns overtone-loops.proto.semiquavers
(:use [overtone.live]
[overtone.inst.piano]
[overtone-loops.loops]
[overtone-loops.samples]))
(set-up)
(defn fpiano
[anote]
(piano :note (note anote)
:vel 70
:sustain 0.2
:decay 0.1))
1 ... |
58964ef3b577b5db8715c47ec21e0bee03e12d7ed8c9e5924e44cb93505bad11 | Cantido/clj-bittorrent | tcp.clj | (ns clj-bittorrent.net.tcp
"Functions for creating a threaded TCP server.
Yanked from -server"
(:require [clojure.java.io :as io])
(:import [java.net InetAddress
ServerSocket
SocketException
Socket]))
(defn- server-socket
^ServerSocket [server]
... | null | https://raw.githubusercontent.com/Cantido/clj-bittorrent/5fea93e318f9d07e4bbee6aced12e10ae0f46f2a/src/clj_bittorrent/net/tcp.clj | clojure | (ns clj-bittorrent.net.tcp
"Functions for creating a threaded TCP server.
Yanked from -server"
(:require [clojure.java.io :as io])
(:import [java.net InetAddress
ServerSocket
SocketException
Socket]))
(defn- server-socket
^ServerSocket [server]
... | |
a354665df2cb72d4e8ca33893dcc5d290708b45451c66c6ae270966fe08240cf | NetComposer/nkpacket | nkpacket_dns.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2019 . All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the... | null | https://raw.githubusercontent.com/NetComposer/nkpacket/4d74ab31b20ba7a1449f1f72c1c51829f18d2d5c/src/nkpacket_dns.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2019 . All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
@doc NkPACKET DNS cache an... |
ba57d9cabece2709357bb73bbb8704a90e1a058c7ba05fb890736ebb0dd5f421 | kupl/LearnML | patch.ml | type lambda = V of var | P of (var * lambda) | C of (lambda * lambda)
and var = string
let rec __s3 (__s4 : lambda) : string list =
match __s4 with
| V __s5 -> [ __s5 ]
| P (__s6, __s7) ->
List.filter (fun (__s8 : string) -> not (__s6 = __s8)) (__s3 __s7)
| C (__s9, __s10) -> __s3 __s9 @ __s3 __s10
le... | null | https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/lambda/sub74/patch.ml | ocaml | type lambda = V of var | P of (var * lambda) | C of (lambda * lambda)
and var = string
let rec __s3 (__s4 : lambda) : string list =
match __s4 with
| V __s5 -> [ __s5 ]
| P (__s6, __s7) ->
List.filter (fun (__s8 : string) -> not (__s6 = __s8)) (__s3 __s7)
| C (__s9, __s10) -> __s3 __s9 @ __s3 __s10
le... | |
40f9a04b76712b944b4d60aa58fc49da023718e8920551121320cd5e4ed4c02b | gheber/kenzo | cat-init.lisp | ;;; FILES FILES FILES FILES FILES FILES FILES FILES FILES FILES
;;; FILES FILES FILES FILES FILES FILES FILES FILES FILES FILES
;;; FILES FILES FILES FILES FILES FILES FILES FILES FILES FILES
(IN-PACKAGE "COMMON-LISP-USER")
( DEFUN common - graphics - user::npppp ( )
;;; (in-... | null | https://raw.githubusercontent.com/gheber/kenzo/48e2ea398b80f39d3b5954157a7df57e07a362d7/archive/Kenzo-8/cat-init.lisp | lisp | FILES FILES FILES FILES FILES FILES FILES FILES FILES FILES
FILES FILES FILES FILES FILES FILES FILES FILES FILES FILES
FILES FILES FILES FILES FILES FILES FILES FILES FILES FILES
(in-package :user))
|
(IN-PACKAGE "COMMON-LISP-USER")
( DEFUN common - graphics - user::npppp ( )
(DEFUN KENZO-VERSION ()
(format t "~%*** Kenzo-Version 8 ***~2%")
(values))
(PROCLAIM '(OPTIMIZE (speed 3) (safety 1) (space 0) (debug 0)))
(DEFCONSTANT +FILE-LIST+
'("macros"
"various"
"classes"
... |
04bddf28e211a44e58b636f89e8eec3d443bbfc9c7cfbb981cc75b75d8a04926 | technomancy/leiningen | utils.clj | (ns leiningen.core.utils
(:require [clojure.java.io :as io]
[clojure.java.shell :as sh]
[clojure.string :as str])
(:import (com.hypirion.io RevivableInputStream)
(clojure.lang LineNumberingPushbackReader)
(java.io ByteArrayOutputStream PrintStream File FileDescriptor
... | null | https://raw.githubusercontent.com/technomancy/leiningen/24fb93936133bd7fc30c393c127e9e69bb5f2392/leiningen-core/src/leiningen/core/utils.clj | clojure | whyyyyy does .mkdirs fail silently ugh
(io/file nil) returns nil, so we mimic a similar API instead of failing eagerly on nil inputs.
The ordering on map-vals and filter-vals may seem strange, but it helps out
if you want to do stuff like (update m :foo map-vals f extra-args)
# Git
This is very similar to the rea... | (ns leiningen.core.utils
(:require [clojure.java.io :as io]
[clojure.java.shell :as sh]
[clojure.string :as str])
(:import (com.hypirion.io RevivableInputStream)
(clojure.lang LineNumberingPushbackReader)
(java.io ByteArrayOutputStream PrintStream File FileDescriptor
... |
05aeb9f51678686409d62157147fdba22865b802b6d457d3866bda9d57bf92a0 | ddssff/refact-global-hse | FoldM.hs | -- | 'foldModule' is a utility function used to implement the clean, split, and merge operations.
# LANGUAGE BangPatterns , CPP , FlexibleContexts , FlexibleInstances , ScopedTypeVariables , StandaloneDeriving #
# OPTIONS_GHC -Wall -fno - warn - orphans #
module FoldM
( foldModuleM
, foldHeaderM
, foldExpor... | null | https://raw.githubusercontent.com/ddssff/refact-global-hse/519a017009cae8aa1a3db1b46eb560d76bd9895d/old/FoldM.hs | haskell | | 'foldModule' is a utility function used to implement the clean, split, and merge operations.
setSpanStart :: SrcLoc -> SrcSpan -> SrcSpan
whitespace in the suffix string of a declaration, we want them in
the prefix string of the following declaration where possible.
We reached the end of ss1, so the segment from... | # LANGUAGE BangPatterns , CPP , FlexibleContexts , FlexibleInstances , ScopedTypeVariables , StandaloneDeriving #
# OPTIONS_GHC -Wall -fno - warn - orphans #
module FoldM
( foldModuleM
, foldHeaderM
, foldExportsM
, foldImportsM
, foldDeclsM
, echoM
, echo2M
, ignoreM
, ignore2M
... |
84f46c5221763aa91f0212c12dbbc449beee3bffcba9750635a60fedd82bce0f | theobat/massalia | UtilsGQL.hs | {-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE NoImplicitPrelude #
# LANGUAGE TypeFamilies #
{-# LANGUAGE TypeSynonymInstances #-}
# LANGUAGE FlexibleInstances #
-- |
Module : Massalia . UtilsGQL
-- Description : A standard interface for query arguments... | null | https://raw.githubusercontent.com/theobat/massalia/66d65c3431132091107d07e041f33c907f9d08cb/src/Massalia/UtilsGQL.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings #
# LANGUAGE TypeSynonymInstances #
|
Description : A standard interface for query arguments (including pagination).
TEXT
The filtered is for a simple filter,
| A filter applied __around__ the union of unionFilter effects
| The limit in the query
| The off... | # LANGUAGE DeriveGeneric #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE TypeFamilies #
# LANGUAGE FlexibleInstances #
Module : Massalia . UtilsGQL
module Massalia.UtilsGQL
Paginated(..),
defaultPaginated,
OrderByWay (..),
OrderingBy (..),
NullsOrder (..),
)
where
import Data.Morpheus.Types ... |
844ee4c215a23d4996b9f6e3002b04cd20ce57ccda441353382161afcfa05824 | noss/erlang-gettext | gettext_server.erl | %%%-------------------------------------------------------------------
%%% File : gettext_server.erl
Author : < >
Desc . : Internationalization support .
Created : 28 Oct 2003 by < >
%%%-------------------------------------------------------------------
-module(gettext_server).
-behaviour(gen_serve... | null | https://raw.githubusercontent.com/noss/erlang-gettext/c895be9dcc6fc699b2e1e8bd731ccee4f78b1cdc/src/gettext_server.erl | erlang | -------------------------------------------------------------------
File : gettext_server.erl
-------------------------------------------------------------------
--------------------------------------------------------------------
Include files
--------------------------------------------------------------------
-... | Author : < >
Desc . : Internationalization support .
Created : 28 Oct 2003 by < >
-module(gettext_server).
-behaviour(gen_server).
-export([start_link/0, start_link/1, start_link/2,
start/0, start/1, start/2]).
-export([custom_dir/0]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2... |
14af9e893fcef8404ea4f722d791859af3c0ab2033539ac2d4108eccdf0e53fc | erlangonrails/devdb | transaction_api.erl | Copyright 2007 - 2010 fuer Informationstechnik Berlin
%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
% you may not use this file except in compliance with the License.
% You may obtain a copy of the License at
%
% -2.0
%
% Unless required by applicable law or agreed to i... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/scalaris/src/transstore/transaction_api.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language go... | Copyright 2007 - 2010 fuer Informationstechnik Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
Author : < >
Created : 17 Sep 2007 by < >
-module(transaction_api).
-author('').
-vsn('$Id: transa... |
157a5227cd5e6fecc40004704cf15d9dca8673bb7edd8058e9f2bdec05d3bdf7 | fakedata-haskell/fakedata | OnePiece.hs | # LANGUAGE TemplateHaskell #
{-# LANGUAGE OverloadedStrings #-}
module Faker.JapaneseMedia.OnePiece where
import Data.Text
import Faker
import Faker.Internal
import Faker.Provider.OnePiece
import Faker.TH
$(generateFakeField "onePiece" "characters")
$(generateFakeField "onePiece" "seas")
$(generateFakeField "onePi... | null | https://raw.githubusercontent.com/fakedata-haskell/fakedata/e6fbc16cfa27b2d17aa449ea8140788196ca135b/src/Faker/JapaneseMedia/OnePiece.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TemplateHaskell #
module Faker.JapaneseMedia.OnePiece where
import Data.Text
import Faker
import Faker.Internal
import Faker.Provider.OnePiece
import Faker.TH
$(generateFakeField "onePiece" "characters")
$(generateFakeField "onePiece" "seas")
$(generateFakeField "onePiece" "islands")
$(generateFakeFiel... |
3d1a0b914ec2cddf0be198ba470cc64982ed38aa54edda8c4bfca1e4fc4fc4ee | sKabYY/palestra | gcd.scm | (load "machine.scm")
(define gcd-machine
(make-machine
'(a b t)
(list (list 'rem remainder) (list '= =))
'(test-b
(test (op =) (reg b) (const 0))
(branch (label gcd-done))
(assign t (op rem) (reg a) (reg b))
(assign a (reg b))
(assign b (reg t))
(goto (label test... | null | https://raw.githubusercontent.com/sKabYY/palestra/0906cc3a1fb786093a388d5ae7d59120f5aae16c/old1/sicp/5/gcd.scm | scheme | (load "machine.scm")
(define gcd-machine
(make-machine
'(a b t)
(list (list 'rem remainder) (list '= =))
'(test-b
(test (op =) (reg b) (const 0))
(branch (label gcd-done))
(assign t (op rem) (reg a) (reg b))
(assign a (reg b))
(assign b (reg t))
(goto (label test... | |
7b1bfb400157ef000ea4a2952682d49de7d7ff535d1e2a837f4f4100f647139c | mirage/ocaml-git | smart.ml | let ( <.> ) f g x = f (g x)
module Capability = Capability
include struct
open Protocol
module Proto_request = Proto_request
module Advertised_refs = Advertised_refs
module Want = Want
module Result = Result
module Negotiation = Negotiation
module Shallow = Shallow
module Commands = Commands
module ... | null | https://raw.githubusercontent.com/mirage/ocaml-git/37c9ef41944b5b19117c34eee83ca672bb63f482/src/not-so-smart/smart.ml | ocaml | let ( <.> ) f g x = f (g x)
module Capability = Capability
include struct
open Protocol
module Proto_request = Proto_request
module Advertised_refs = Advertised_refs
module Want = Want
module Result = Result
module Negotiation = Negotiation
module Shallow = Shallow
module Commands = Commands
module ... | |
235da00383cffcf71d6404174400facb9f5735bbd446089677413ea00972ea04 | travisbrady/flajolet | topk.ml |
* Reads lines on stdin and then prints the top 5 most common strings
* to stdout along with their count
* Similar to :
* cat somefile.txt | sort | uniq -c | sort -nr
* Reads lines on stdin and then prints the top 5 most common strings
* to stdout along with their count
* Similar to:
* cat som... | null | https://raw.githubusercontent.com/travisbrady/flajolet/a6c530bf1dd73b9fa8b7185d84a5e20458a3d8af/examples/topk.ml | ocaml |
* Reads lines on stdin and then prints the top 5 most common strings
* to stdout along with their count
* Similar to :
* cat somefile.txt | sort | uniq -c | sort -nr
* Reads lines on stdin and then prints the top 5 most common strings
* to stdout along with their count
* Similar to:
* cat som... | |
e895d72199f2812acb72d7675ab4e550f94ab38f15a63bed1641b4e641abc835 | racket/handin | web-status-server.rkt | #lang racket/base
(require racket/list
racket/path
racket/file
racket/date
racket/match
net/uri-codec
web-server/servlet
web-server/compat/0/coerce
web-server/compat/0/http/response-structs
handin-server/private/md5
handin-server... | null | https://raw.githubusercontent.com/racket/handin/a01b9cce0c2397d3e1049d4e6932b48b51e65b13/handin-server/web-status-server.rkt | racket | `look-for' can be a username as a string (will find "bar+foo" for "foo"), or
a regexp that should match the whole directory name (used with "^solution"
below)
must be rooted in a submission directory (why build-path instead
of using `path'? -- because path will have a trailing slash)
Make sure the user is allowed... | #lang racket/base
(require racket/list
racket/path
racket/file
racket/date
racket/match
net/uri-codec
web-server/servlet
web-server/compat/0/coerce
web-server/compat/0/http/response-structs
handin-server/private/md5
handin-server... |
01b2a05e83d171e4d09265eba59efbae3e2f6fc46487eec8e0c8f80059fde97d | dmvianna/haskellbook | Ch08Ex.hs | module Arith4 where
roundTrip :: (Show a, Read b) => a -> b
roundTrip = read . show
main = do
print (roundTrip 4 :: Int)
print (id 4)
incTimes :: (Eq a, Num a) => a -> a -> a
incTimes 0 n = n
incTimes times n = 1 + (incTimes (times - 1) n)
applyTimes :: (Eq a, Num a) => a -> (b -> b) -> b -> b
applyTimes 0 f b ... | null | https://raw.githubusercontent.com/dmvianna/haskellbook/b1fdce66283ccf3e740db0bb1ad9730a7669d1fc/src/Ch08Ex.hs | haskell | module Arith4 where
roundTrip :: (Show a, Read b) => a -> b
roundTrip = read . show
main = do
print (roundTrip 4 :: Int)
print (id 4)
incTimes :: (Eq a, Num a) => a -> a -> a
incTimes 0 n = n
incTimes times n = 1 + (incTimes (times - 1) n)
applyTimes :: (Eq a, Num a) => a -> (b -> b) -> b -> b
applyTimes 0 f b ... | |
6c5ad936655f84c8a18d28fe0eac5574bb265982323219b690c7d857ec9ce32b | sgbj/MaximaSharp | expintegral.lisp | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
Exponential Integrals
;;;
This file contains the following Maxima User functions :
;;;
;;; $expintegral_e (n,z) - Exponential Integral En(z)
$ expintegral_e1 ( z ) - Exponential Integral E1(z )
$ expintegral_ei ( z ) - ... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/src/expintegral.lisp | lisp |
$expintegral_e (n,z) - Exponential Integral En(z)
$expintegral_li (z) - Logarithmic Integral Li(z)
$expint (x) - Exponential Integral E1(x) (depreciated)
expintegral_li, expintegral_trig, expintegral_hyp
for positive integers in terms of Ei
The followi... | Exponential Integrals
This file contains the following Maxima User functions :
$ expintegral_e1 ( z ) - Exponential Integral E1(z )
$ expintegral_ei ( z ) - Exponential Integral Ei(z )
$ expintegral_si ( z ) - Exponential Integral Si(z )
$ expintegral_ci ( z ) - Exponential Integral Ci(z )
$ ... |
e4b697fe4cc7a86cae7262a2da37cb9a29c048eca1a26c8807f5edeeca850e2e | sentenai/reinforce | PendulumV0.hs | --------------------------------------------------------------------------------
-- |
Module : Environment . Gym . ClassicControl . PendulumV0
-- Copyright : (c) Sentenai 2017
-- License : BSD3
Maintainer :
-- Stability : experimental
--
-- The inverted pendulum swingup problem is a classic problem in... | null | https://raw.githubusercontent.com/sentenai/reinforce/03fdeea14c606f4fe2390863778c99ebe1f0a7ee/reinforce-environments-gym/src/Environments/Gym/ClassicControl/PendulumV0.hs | haskell | ------------------------------------------------------------------------------
|
Copyright : (c) Sentenai 2017
License : BSD3
Stability : experimental
The inverted pendulum swingup problem is a classic problem in the control
literature. In this version of the problem, the pendulum starts in a random
positi... | Module : Environment . Gym . ClassicControl . PendulumV0
Maintainer :
# LANGUAGE FlexibleInstances #
# LANGUAGE DeriveGeneric #
# LANGUAGE InstanceSigs #
module Environments.Gym.ClassicControl.PendulumV0
( Action(..)
, I.Runner
, State(..)
, Environment
, EnvironmentT
, Environments.Gym.Classic... |
01d1d90cfb17703021b345f6a9b2e84170856de2b9414fb34dea1c6b9efd43e8 | cognitect-labs/day-of-datomic-cloud | query-executing.clj | Copyright ( c ) Cognitect , Inc. 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... | null | https://raw.githubusercontent.com/cognitect-labs/day-of-datomic-cloud/b1684c8d131942f0451185288ed65bc51ee2b81d/doc-examples/query-executing.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 ) Cognitect , Inc. All rights reserved .
(require '[datomic.client.api :as d])
(def client-cfg (read-string (slurp "config.edn")))
(def client (d/client client-cfg))
(def conn (d/connect client {:db-name "mbrainz-1968-1973"}))
(def db (d/db conn))
(def query '[:find ?e
:in $ ?name
... |
a812a5d42f733728afe4d4d9a032f14436fdbd9efdf8a7cd5d4bda78e1ee4da2 | gentoo-haskell/haskell-updater | Output.hs | |
Module : Main
Description : The haskell - updater executable
License : or later
Fancy output facility .
Module : Main
Description : The haskell-updater executable
License : GPL-2 or later
Fancy output facility.
-}
module Output (
pkgListPrintL... | null | https://raw.githubusercontent.com/gentoo-haskell/haskell-updater/3157ba41ea1793f844218a87b32bcc9f041c028b/Output.hs | haskell | output mode (chattiness)
Print a list of packages, with a description of what they are. | |
Module : Main
Description : The haskell - updater executable
License : or later
Fancy output facility .
Module : Main
Description : The haskell-updater executable
License : GPL-2 or later
Fancy output facility.
-}
module Output (
pkgListPrintL... |
d7a1f77c11ef8305ca41dc7dcc34297315b9b56af9517e0e2b834b94d778af3c | thegeez/w3a | test.clj | (ns net.thegeez.w3a.test
(:require [clojure.edn :as edn]
[com.stuartsierra.component :as component]
[io.pedestal.http :as http]
[io.pedestal.interceptor :as interceptor]
[io.pedestal.log :as log]
[io.pedestal.test :as test]
[net.cgrand.enlive-htm... | null | https://raw.githubusercontent.com/thegeez/w3a/186e507389628f20381d155d91058a1804d421e3/src/net/thegeez/w3a/test.clj | clojure | make ring mock not munge edn
allow to find the csrf-token to use in testing
pedestal blows up when it can't figure out scheme /
host etc, which is missing as jetty is not running
on a page
only check the query string as well
when specified by user | (ns net.thegeez.w3a.test
(:require [clojure.edn :as edn]
[com.stuartsierra.component :as component]
[io.pedestal.http :as http]
[io.pedestal.interceptor :as interceptor]
[io.pedestal.log :as log]
[io.pedestal.test :as test]
[net.cgrand.enlive-htm... |
82348d8cd459a09e84b26f9cc1825b3818aa3fb2097d067f82d7d6a2ae1ec061 | VisionsGlobalEmpowerment/webchange | scene.cljs | (ns webchange.interpreter.renderer.state.scene
(:require
[re-frame.core :as re-frame]
[webchange.interpreter.renderer.state.db :refer [path-to-db]]
[webchange.interpreter.renderer.scene.components.wrapper-interface :as w]
[webchange.logger.index :as logger]))
(re-frame/reg-event-fx
::init
(fn [{:... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/8411352df79289cf755083fe1dab9424d8eb7da6/src/cljs/webchange/interpreter/renderer/state/scene.cljs | clojure | Change object events
Actions matching the template:
'handler-name = "set-" + param-name'
(e.g. ':set-text' wrapper method for ':text' param)
should be handled by 'generic-handler'
Here should be defined only actions with different params
(e.g. ':set-filter' wrapper method for ':brightness' param)
Remove check w... | (ns webchange.interpreter.renderer.state.scene
(:require
[re-frame.core :as re-frame]
[webchange.interpreter.renderer.state.db :refer [path-to-db]]
[webchange.interpreter.renderer.scene.components.wrapper-interface :as w]
[webchange.logger.index :as logger]))
(re-frame/reg-event-fx
::init
(fn [{:... |
a9efa3237b70969903ceab6cfcc32aee96925213bc5a1ba63910b74b690111a0 | parapluu/Concuerror | processes_leader.erl | -module(processes_leader).
-export([test/0]).
-export([scenarios/0]).
%%------------------------------------------------------------------------------
scenarios() -> [{test, inf, optimal}].
%%------------------------------------------------------------------------------
test() ->
group_leader(S = self(), self())... | null | https://raw.githubusercontent.com/parapluu/Concuerror/152a5ccee0b6e97d8c3329c2167166435329d261/tests/suites/basic_tests/src/processes_leader.erl | erlang | ------------------------------------------------------------------------------
------------------------------------------------------------------------------ | -module(processes_leader).
-export([test/0]).
-export([scenarios/0]).
scenarios() -> [{test, inf, optimal}].
test() ->
group_leader(S = self(), self()),
W = fun W(0) -> ok;
W(N) -> spawn_monitor(fun () -> W(N - 1) end)
end,
W(2),
[exit(P, kill)
|| P <- processes(),
P =/= S,
{... |
988bca7efb2bb6387d96cfd00ab24e2c1fc743f9606b2cb88a8802456b8b360b | digikar99/dense-arrays | aref.lisp | (cl:in-package :dense-arrays)
(define-compiler-macro array= (array1 array2 &key (test '(function equalp)) &environment env)
;; Turns out merely inlining functions is not sufficient to "preserve"
;; the type declarations; so, we use a compiler macro. See
;; -type-propagation-in-common-lisp-inlined-functions-wit... | null | https://raw.githubusercontent.com/digikar99/dense-arrays/f4f2a65c5eb2562caaad88d440136c71c79d754c/optim/aref.lisp | lisp | Turns out merely inlining functions is not sufficient to "preserve"
the type declarations; so, we use a compiler macro. See
-type-propagation-in-common-lisp-inlined-functions-without-compiler-macr
for some details
TODO: These can be optimized slightly, given that AREF and AREF* are now separate.
The fact that w... | (cl:in-package :dense-arrays)
(define-compiler-macro array= (array1 array2 &key (test '(function equalp)) &environment env)
(with-gensyms (array1-sym array2-sym)
`(let ((,array1-sym ,array1)
(,array2-sym ,array2))
(declare (type ,(primary-form-type array1 env) ,array1-sym)
(type... |
90c509237e09d16b03df7ec7093bbbd780e6b7a008095b4061e93746d685e47d | rbkmoney/erlang_capi_v2 | capi_client_invoice_templates.erl | -module(capi_client_invoice_templates).
-export([create/2]).
-export([get_template_by_id/2]).
-export([update/3]).
-export([delete/2]).
-export([create_invoice/3]).
-export([get_invoice_payment_methods/2]).
-type context() :: capi_client_lib:context().
-spec create(context(), map()) -> {ok, term()} | {error, term()}... | null | https://raw.githubusercontent.com/rbkmoney/erlang_capi_v2/438d0a603475c57dddade8c419f0d70fdf86438d/apps/capi_client/src/capi_client_invoice_templates.erl | erlang | -module(capi_client_invoice_templates).
-export([create/2]).
-export([get_template_by_id/2]).
-export([update/3]).
-export([delete/2]).
-export([create_invoice/3]).
-export([get_invoice_payment_methods/2]).
-type context() :: capi_client_lib:context().
-spec create(context(), map()) -> {ok, term()} | {error, term()}... | |
20935bfb7e763109bead14faa35cdd7b45909fb153992e53514cc26e48b03692 | gvolpe/shopping-cart-haskell | Main.hs | # LANGUAGE RecordWildCards #
module Main where
import Control.Monad.Managed ( with )
import Domain.Cart ( CartExpiration(..) )
import Http.Clients.Payments ( mkPaymentClient )
import Http.Server ( runServer )
import ... | null | https://raw.githubusercontent.com/gvolpe/shopping-cart-haskell/6acc339808d382094ea5302a8e5544dddc209bac/app/Main.hs | haskell | # LANGUAGE RecordWildCards #
module Main where
import Control.Monad.Managed ( with )
import Domain.Cart ( CartExpiration(..) )
import Http.Clients.Payments ( mkPaymentClient )
import Http.Server ( runServer )
import ... | |
deb612b8b79454151e19f0bf5672f1af91575b32caa53ff04701d3b5308163d5 | 1HaskellADay/1HAD | Exercise.hs | module HAD.Y2014.M03.D25.Exercise
( Board
, board
, getList
) where
import Data.List (groupBy)
import Test.QuickCheck
-- Preamble
-- $setup
-- >>> import Control.Applicative ((<$>), (<*>))
-- >>> import Data.List (group)
-- A board is a "square list of list"
-- The "square" form, is ensure by the constructo... | null | https://raw.githubusercontent.com/1HaskellADay/1HAD/3b3f9b7448744f9b788034f3aca2d5050d1a5c73/exercises/HAD/Y2014/M03/D25/Exercise.hs | haskell | Preamble
$setup
>>> import Control.Applicative ((<$>), (<*>))
>>> import Data.List (group)
A board is a "square list of list"
The "square" form, is ensure by the constructor (board)
| Exercise
The external list length is equal to the length of each internal lists
| module HAD.Y2014.M03.D25.Exercise
( Board
, board
, getList
) where
import Data.List (groupBy)
import Test.QuickCheck
newtype Board a = Board {getList :: [[a]]}
deriving (Eq, Show, Read)
Build an Arbitrary instance for Board of any given size
prop > ( 1== ) . length . group . ( flip ( :) < * > length... |
98a5e2cc33ba3a80a424aaab5eb4955f901818f516f5c2d5bfbb94a66b57bad6 | OCADml/OSCADml | OSCADml.ml | * { 1 OpenSCAD DSL }
module Scad = Scad
(** {2 Configuration Types}
These modules are provided at the top-level as convenient namespaces for
the configuration types taken as parameters to their corresponding model
building functions in {!module:Scad}. *)
module Color = Color
module Text = Text
(** {1 U... | null | https://raw.githubusercontent.com/OCADml/OSCADml/d2f64a3f6454ff37a3c725b619c6a89252af789d/lib/OSCADml.ml | ocaml | * {2 Configuration Types}
These modules are provided at the top-level as convenient namespaces for
the configuration types taken as parameters to their corresponding model
building functions in {!module:Scad}.
* {1 Utilities} | * { 1 OpenSCAD DSL }
module Scad = Scad
module Color = Color
module Text = Text
module Export = Export
module Debug = Debug
|
ef635c0212ab0232fcafdb834348d2f0b3b88ea52cf705b1a39753bc0b2b5392 | roehst/tapl-implementations | core.mli | module Core
Core typechecking and evaluation functions
Core typechecking and evaluation functions
*)
open Syntax
open Support.Error
val typeof : context -> term -> ty
val subtype : context -> ty -> ty -> bool
val tyeqv : context -> ty -> ty -> bool
type store
val emptystore : store
val shiftstore : int ... | null | https://raw.githubusercontent.com/roehst/tapl-implementations/23c0dc505a8c0b0a797201a7e4e3e5b939dd8fdb/fullfsubref/core.mli | ocaml | module Core
Core typechecking and evaluation functions
Core typechecking and evaluation functions
*)
open Syntax
open Support.Error
val typeof : context -> term -> ty
val subtype : context -> ty -> ty -> bool
val tyeqv : context -> ty -> ty -> bool
type store
val emptystore : store
val shiftstore : int ... | |
cb5c0a24e5e24957b781953ee1077981785bfa0be9b548f0b0d7bb67f5467b16 | public-law/nevada-revised-statutes-parser | NRSParser.hs | {-# LANGUAGE OverloadedStrings #-}
module NRSParser where
import BasicPrelude
import qualified Data.HashMap.Lazy as HM
import System.FilePath
import ChapterFile ( ChapterMap )
import Data.Time
import HtmlUtil ( Htm... | null | https://raw.githubusercontent.com/public-law/nevada-revised-statutes-parser/88a886debdab6ce5bd6cf5819c846cec1ffb9220/src/NRSParser.hs | haskell | # LANGUAGE OverloadedStrings # |
module NRSParser where
import BasicPrelude
import qualified Data.HashMap.Lazy as HM
import System.FilePath
import ChapterFile ( ChapterMap )
import Data.Time
import HtmlUtil ( Html
... |
b09177bc5515400d47340e676c9840ae442d0fd54720b4c71b4ecfc52b02588f | numcl/numcl | sbcl-environment.lisp |
(in-package :cl-user)
(deftype check (tag &environment env)
(format t "~&~5a : ~a" tag (if env t nil))
t)
(defun f (a b c)
(declare (type (check :f1)))
(declare (type (check :f2) a))
(declare (type fixnum b))
(let ((d 0))
(declare (type fixnum d))
(declare (type (check f3) b))
(print (list a... | null | https://raw.githubusercontent.com/numcl/numcl/3dcdb0e24a33943d6c3a188ecbb0c78003bf975c/memos/sbcl-environment.lisp | lisp | ((type-r:array-subtype element-type)
element-type)
(_
t)))
(defun g (a b)
(declare (type (array fixnum) a)) ; assume this declaration is generated by macro
(declare (type (element-type-of a) b))
a)
didn't work |
(in-package :cl-user)
(deftype check (tag &environment env)
(format t "~&~5a : ~a" tag (if env t nil))
t)
(defun f (a b c)
(declare (type (check :f1)))
(declare (type (check :f2) a))
(declare (type fixnum b))
(let ((d 0))
(declare (type fixnum d))
(declare (type (check f3) b))
(print (list a... |
3e5f33155e6365e324aa2ea5901c00c154f7a36f0f8884db16efb5763dbf2104 | astrada/ocaml-extjs | ext_dom_Element.ml | class type t =
object('self)
inherit Ext_dom_AbstractElement.t
method autoBoxAdjust : bool Js.t Js.prop
method originalDisplay : Js.js_string Js.t Js.prop
method addClsOnClick : Js.js_string Js.t -> _ Js.callback Js.optdef ->
_ Js.t Js.optdef -> 'self Js.t Js.meth
method addClsOnFocus : Js.js_string Js... | null | https://raw.githubusercontent.com/astrada/ocaml-extjs/77df630a75fb84667ee953f218c9ce375b3e7484/lib/ext_dom_Element.ml | ocaml | class type t =
object('self)
inherit Ext_dom_AbstractElement.t
method autoBoxAdjust : bool Js.t Js.prop
method originalDisplay : Js.js_string Js.t Js.prop
method addClsOnClick : Js.js_string Js.t -> _ Js.callback Js.optdef ->
_ Js.t Js.optdef -> 'self Js.t Js.meth
method addClsOnFocus : Js.js_string Js... | |
2315afd77e720e2c92bff62ae5ffb9138a7574e154f2f7a3ce4a131d9c1fa0f5 | probprog/anglican | beaver_data.clj | (ns anglib.beaver-data
"Beaver data from R")
;; Record field accessors for beaver datasets
(def beaver-day #(nth % 0))
(def beaver-time #(nth % 1))
(def beaver-temperature #(nth % 2))
(def beaver-activity #(nth % 3))
(def beaver1
"beaver1 from R datasets"
[[346 840 36.33 0]
[346 850 36.34 0]
[346 900 36... | null | https://raw.githubusercontent.com/probprog/anglican/ab6111d7fa8f68f42ea046feab928ca3eedde1d7/src/anglib/beaver_data.clj | clojure | Record field accessors for beaver datasets | (ns anglib.beaver-data
"Beaver data from R")
(def beaver-day #(nth % 0))
(def beaver-time #(nth % 1))
(def beaver-temperature #(nth % 2))
(def beaver-activity #(nth % 3))
(def beaver1
"beaver1 from R datasets"
[[346 840 36.33 0]
[346 850 36.34 0]
[346 900 36.35 0]
[346 910 36.42 0]
[346 920 36.55 ... |
2035f3820dbb76c70b6aa0651a7348650ce0635a25da96a109b483a3adc85ad5 | avsm/mirage-duniverse | topkg_install.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... | null | https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/topkg/src/topkg_install.ml | ocaml | We don't care about order
Install fields
comment
hack, recover a field from a field function...
all the .mllib modules if unspecified
comment
Dummy codec
we don't care | ---------------------------------------------------------------------------
Copyright ( c ) 2016 . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
% % NAME%% % % ---------------------------------------------------------------------------
Copyright (c) ... |
30da9b68edb7bf78186730d15162f37f7efc1256185c64dd14ac61a570f0ad7b | rowangithub/DOrder | recHanoi02.ml |
* recHanoi.c
*
* Created on : 17.07.2013
* Author :
* recHanoi.c
*
* Created on: 17.07.2013
* Author: Stefan Wissert
*)
(*
* This function returns the optimal amount of steps,
* needed to solve the problem for n-disks
*)
let rec hanoi n =
let result =
if (n = 1) then 1
... | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/recursive/recHanoi02.ml | ocaml |
* This function returns the optimal amount of steps,
* needed to solve the problem for n-disks
|
* recHanoi.c
*
* Created on : 17.07.2013
* Author :
* recHanoi.c
*
* Created on: 17.07.2013
* Author: Stefan Wissert
*)
let rec hanoi n =
let result =
if (n = 1) then 1
else 2 * (hanoi (n-1)) + 1 in
result
let main () =
let n = Random.int 32 in
if (n < 1 || n ... |
bcdc5e4b248de3fd733430d5ce45dfafa68a7221811a288959efcf7765b3732e | oliyh/superlifter | api.cljc | (ns superlifter.api
(:require [superlifter.core :as core]
[promesa.core :as prom]
#?(:clj [urania.core :as u])))
(defn unwrap
([p] (unwrap identity p))
([f p]
(if (prom/promise? p)
(prom/then p f)
(prom/resolved (f p)))))
#?(:clj (defmacro def-fetcher [sym bindings do-fetch-... | null | https://raw.githubusercontent.com/oliyh/superlifter/d0baf9538f1dac712415323a2f2a6578c181bd97/src/superlifter/api.cljc | clojure | (ns superlifter.api
(:require [superlifter.core :as core]
[promesa.core :as prom]
#?(:clj [urania.core :as u])))
(defn unwrap
([p] (unwrap identity p))
([f p]
(if (prom/promise? p)
(prom/then p f)
(prom/resolved (f p)))))
#?(:clj (defmacro def-fetcher [sym bindings do-fetch-... | |
5331d04b90388918bcd79ee49b654ded17dcef1fe9b32dc00a1447b13c042ea9 | input-output-hk/project-icarus-importer | BlockIndex.hs | -- | Operations with block index db.
module Pos.DB.BlockIndex
( getHeader
, getTipHeader
, putHeadersIndex
, deleteHeaderIndex
) where
import Universum
import Data.ByteArray (convert)
import qualified Database.RocksDB as Rocks
import Pos.Core (BlockHe... | null | https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/db/Pos/DB/BlockIndex.hs | haskell | | Operations with block index db.
| Get 'BlockHeader' corresponding to tip.
| Writes batch of headers into the block index db.
| Deletes header from the index db.
--------------------------------------------------------------------------
Keys
------------------------------------------------------------------------... |
module Pos.DB.BlockIndex
( getHeader
, getTipHeader
, putHeadersIndex
, deleteHeaderIndex
) where
import Universum
import Data.ByteArray (convert)
import qualified Database.RocksDB as Rocks
import Pos.Core (BlockHeader, HeaderHash, headerHash)
import ... |
b535366fd7bfa8f7aad045a81a6812ef4c775dd6844beaa8c114e5fd2de44be5 | futurice/clojure-workshop | 17_runtime_polymorphism.clj | (ns koans.17-runtime-polymorphism
(:require [koan-engine.core :refer :all]))
(defn hello
([] "Hello World!")
([a] (str "Hello, you silly " a "."))
([a & more] (str "Hello to this group: "
(apply str
(interpose ", " (cons a more)))
"!")))
(defmult... | null | https://raw.githubusercontent.com/futurice/clojure-workshop/c1e64a03e1115289898838d4f19f727bc51e2b34/materials/section-1/src/koans/17_runtime_polymorphism.clj | clojure | "Some functions can be used in different ways - with no arguments"
(= __ (hello))
(= __ (hello "world"))
"Or with many arguments"
(= __
"Multimethods allow more complex dispatching"
"Animals have different names"
"Different methods are used depending on the dispatch function result"
"You may use a default meth... | (ns koans.17-runtime-polymorphism
(:require [koan-engine.core :refer :all]))
(defn hello
([] "Hello World!")
([a] (str "Hello, you silly " a "."))
([a & more] (str "Hello to this group: "
(apply str
(interpose ", " (cons a more)))
"!")))
(defmult... |
0ed75a975658d276383cc20b27a7ed8a2f757a4a3a156f683b97325381c411c8 | full-spectrum/influxdb-client | java_time.clj | (ns influxdb.java-time
(:require [influxdb.convert :as convert]
[java-time]))
(defmethod convert/->nano java.time.Instant
[^java.time.Instant inst]
(+ (* (.getEpochSecond inst) 1000000000) (.getNano inst)))
| null | https://raw.githubusercontent.com/full-spectrum/influxdb-client/24ae1e146ac839cd02ace79b9ca89b3937c4fbad/src/influxdb/java_time.clj | clojure | (ns influxdb.java-time
(:require [influxdb.convert :as convert]
[java-time]))
(defmethod convert/->nano java.time.Instant
[^java.time.Instant inst]
(+ (* (.getEpochSecond inst) 1000000000) (.getNano inst)))
| |
173c9b89d847484a93dd29cdafa9cb2f76324e525688ebed1501bf17c5cf62a1 | LuisThiamNye/chic | ui3.clj | (ns chic.ui.ui3
(:require
[chic.debug :as debug]
[chic.util :as util :refer [<- inline<- loop-zip loopr]]
[chic.util.impl.analyzer :as util.ana]
[chic.windows :as windows]
[clojure.data]
[clojure.string :as str]
[clojure.tools.analyzer.ast :as ana.ast]
[clojure.tools.analyzer.passes :a... | null | https://raw.githubusercontent.com/LuisThiamNye/chic/813633a689f9080731613f788a295604d4d9a510/src/chic/ui/ui3.clj | clojure | When existing interface is invalid
fn form with destructured let
ana of enclosed map.
_ (when (and (empty? input-deps) (empty? field-deps)) | (ns chic.ui.ui3
(:require
[chic.debug :as debug]
[chic.util :as util :refer [<- inline<- loop-zip loopr]]
[chic.util.impl.analyzer :as util.ana]
[chic.windows :as windows]
[clojure.data]
[clojure.string :as str]
[clojure.tools.analyzer.ast :as ana.ast]
[clojure.tools.analyzer.passes :a... |
b61acd8a9d968cd9aa26c0e84ff63132b232db76bc70a56771413701e9745471 | NalaGinrut/artanis | utils.scm | -*- indent - tabs - mode : nil ; coding : utf-8 -*-
;; Copyright (C) 2013,2014,2015,2016,2017,2018
" Mu Lei " known as " NalaGinrut " < >
Artanis is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License and GNU
Lesser General Public License pub... | null | https://raw.githubusercontent.com/NalaGinrut/artanis/3412d6eb5b46fde71b0965598ba085bacc2a6c12/artanis/utils.scm | scheme | coding : utf-8 -*-
Copyright (C) 2013,2014,2015,2016,2017,2018
any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License and GNU Lesser General Public License
for more details.
and GNU Lesser ... | " Mu Lei " known as " NalaGinrut " < >
Artanis is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License and GNU
Lesser General Public License published by the Free Software
Foundation , either version 3 of the License , or ( at your option )
A... |
64abbcf7e10de6830fc91c2c7dbe614e226b721998f71622f695bc2926289e99 | alexandergunnarson/quantum | qualify.cljc | (ns quantum.untyped.core.qualify
"Functions related to qualification (name, namespace, etc.) and unqualification
of nameables."
(:require
[clojure.string :as str]
[fipp.ednize]
[quantum.untyped.core.core :as ucore]
[quantum.untyped.core.ns :as uns]
[quantum.untyped.core.type.pred... | null | https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/src-untyped/quantum/untyped/core/qualify.cljc | clojure | ===== QUALIFICATION ===== ;;
===== IDENTS ===== ;; | (ns quantum.untyped.core.qualify
"Functions related to qualification (name, namespace, etc.) and unqualification
of nameables."
(:require
[clojure.string :as str]
[fipp.ednize]
[quantum.untyped.core.core :as ucore]
[quantum.untyped.core.ns :as uns]
[quantum.untyped.core.type.pred... |
9d70f4b4cac789cd3bfc064155968657dd462bfcf7e4f73adc73e7655999c403 | s-cerevisiae/leetcode-racket | 1006-clumsy-factorial.rkt | #lang racket
(define/contract (clumsy n)
(-> exact-integer? exact-integer?)
(for/fold ([stack (list n)]
#:result (apply + stack))
([x (in-range (- n 1) 0 -1)]
[op (in-cycle '(* / + -))])
(match* (op stack)
[('* (cons y ys))
(cons (* y x) ys)]
[('/ (cons ... | null | https://raw.githubusercontent.com/s-cerevisiae/leetcode-racket/e610464f05d23c2306c4cd8a0c74b5f1c401e96f/1006-clumsy-factorial.rkt | racket | #lang racket
(define/contract (clumsy n)
(-> exact-integer? exact-integer?)
(for/fold ([stack (list n)]
#:result (apply + stack))
([x (in-range (- n 1) 0 -1)]
[op (in-cycle '(* / + -))])
(match* (op stack)
[('* (cons y ys))
(cons (* y x) ys)]
[('/ (cons ... | |
5025a0536846a8e825a1962f017ffc468b394d77870d015c2f3dee8ceb441c6e | xxyzz/SICP | Exercise_3_72.rkt | #lang racket/base
(require racket/stream)
(require racket/list)
(define (merge-weighted s1 s2 weight)
(cond [(stream-empty? s1) s2]
[(stream-empty? s2) s1]
[else
(let* ([s1car (stream-first s1)]
[s2car (stream-first s2)]
[weight-result (- (weight s1car) (weigh... | null | https://raw.githubusercontent.com/xxyzz/SICP/e26aea1c58fd896297dbf5406f7fcd32bb4f8f78/3_Modularity_Objects_and_State/3.5_Streams/Exercise_3_72.rkt | racket | !! | #lang racket/base
(require racket/stream)
(require racket/list)
(define (merge-weighted s1 s2 weight)
(cond [(stream-empty? s1) s2]
[(stream-empty? s2) s1]
[else
(let* ([s1car (stream-first s1)]
[s2car (stream-first s2)]
[weight-result (- (weight s1car) (weigh... |
901387ae96f915c437f029c4376216e32a12f5be33def098148608bd6d603922 | ivanjovanovic/sicp | e-3.26.scm | Exercise 3.26 .
;
; To search a table as implemented above, one needs to scan
; through the list of records. This is basically the unordered list
representation of section 2.3.3 . For large tables , it may be more efficient
; to structure the table in a different manner. Describe a table implementation
; where the ... | null | https://raw.githubusercontent.com/ivanjovanovic/sicp/a3bfbae0a0bda414b042e16bbb39bf39cd3c38f8/3.3/e-3.26.scm | scheme |
To search a table as implemented above, one needs to scan
through the list of records. This is basically the unordered list
to structure the table in a different manner. Describe a table implementation
where the (key, value) records are organized using a binary tree, assuming
that keys can be ordered in some way ... | Exercise 3.26 .
representation of section 2.3.3 . For large tables , it may be more efficient
( Compare exercise 2.66 of chapter 2 . )
(load "../helpers.scm")
from 2.3-binary-trees.scm we take already defined elements
(define (make-tree entry left right) (list entry left right))
(define (entry tree) (car tre... |
86274bae22e7aa71888271222bf1f705eb5c241bf6e3b9eb64689bca916a93f5 | sydow/ireal | IntegerInterval.hs | module Data.Number.IReal.IntegerInterval where
import Data.Number.IReal.Powers
import Data.Bits
data IntegerInterval = I (Integer, Integer) deriving Show -- (lower,upper)
-- make sure interval is not too thin
upto :: Integer -> Integer -> IntegerInterval
l `upto` u = I (l, max u (l+2))
midI, radI, lowerI, upperI :... | null | https://raw.githubusercontent.com/sydow/ireal/c06438544c711169baac7960540202379f9294b1/Data/Number/IReal/IntegerInterval.hs | haskell | (lower,upper)
make sure interval is not too thin | module Data.Number.IReal.IntegerInterval where
import Data.Number.IReal.Powers
import Data.Bits
upto :: Integer -> Integer -> IntegerInterval
l `upto` u = I (l, max u (l+2))
midI, radI, lowerI, upperI :: IntegerInterval -> Integer
midI (I (l,u)) = shift (l+u) (-1)
radI (I (l,u)) = shift (u-l+1) (-1)
lowerI (I (l,_)... |
68ac786efa629a090a03d157a805ad53884fd3757c626420d44f5c6f741e22f9 | EarnestResearch/honeycomb-haskell | Spec.hs | import qualified ApiSpec
import qualified HoneycombSpec
import Test.Hspec
import qualified TraceSpec
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "Api" ApiSpec.spec
describe "Honeycomb" HoneycombSpec.spec
describe "Trace" TraceSpec.spec
| null | https://raw.githubusercontent.com/EarnestResearch/honeycomb-haskell/0cb643a637e1b23eecded845970e6a973f8385cf/honeycomb/test/Spec.hs | haskell | import qualified ApiSpec
import qualified HoneycombSpec
import Test.Hspec
import qualified TraceSpec
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "Api" ApiSpec.spec
describe "Honeycomb" HoneycombSpec.spec
describe "Trace" TraceSpec.spec
| |
7a8398abf6c4d7acd767c9a74a0283441acc756f111f88c253abfab41b1477d7 | google-research/dex-lang | Err.hs | Copyright 2021 Google LLC
--
-- Use of this source code is governed by a BSD-style
-- license that can be found in the LICENSE file or at
-- -source/licenses/bsd
module Err (Err (..), Errs (..), ErrType (..), Except (..), ErrCtx (..),
SrcPosCtx, SrcTextCtx, SrcPos,
Fallible (..), Catchable (.... | null | https://raw.githubusercontent.com/google-research/dex-lang/d73f60dd359de6b0a06a706afc7429ee1a11bc7d/src/lib/Err.hs | haskell |
Use of this source code is governed by a BSD-style
license that can be found in the LICENSE file or at
-source/licenses/bsd
=== core API ===
Int is the offset in the source file
We have this in its own class because StateT can't implement it
# INLINE addErrCtx #
# INLINE addErrCtx #
# INLINE runFallibleM #
=== ... | Copyright 2021 Google LLC
module Err (Err (..), Errs (..), ErrType (..), Except (..), ErrCtx (..),
SrcPosCtx, SrcTextCtx, SrcPos,
Fallible (..), Catchable (..), catchErrExcept,
FallibleM (..), HardFailM (..), CtxReader (..),
runFallibleM, runHardFail, throw, throwErr,
... |
c1edfffecb057aa1a114dd2e727aafbc97fec78c32e90734ea4e1f5b430ad357 | mwand/eopl3 | lang.scm | (module lang (lib "eopl.ss" "eopl")
;; grammar for modules with abstract types
;; based on CHECKED.
(provide (all-defined-out))
;;;;;;;;;;;;;;;; grammatical specification ;;;;;;;;;;;;;;;;
(define the-lexical-spec
'((whitespace (whitespace) skip)
(comment ("%" (arbno (not #\ne... | null | https://raw.githubusercontent.com/mwand/eopl3/b50e015be7f021d94c1af5f0e3a05d40dd2b0cbf/chapter8/abstract-types-lang/lang.scm | scheme | grammar for modules with abstract types
based on CHECKED.
grammatical specification ;;;;;;;;;;;;;;;;
new expression:
new types
no changes in grammar below here
sllgen boilerplate ;;;;;;;;;;;;;;;;
syntactic tests and observers ;;;;;;;;;;;;;;;;
for types
for module definitions
maybe-lookup-module-in-list : S... | (module lang (lib "eopl.ss" "eopl")
(provide (all-defined-out))
(define the-lexical-spec
'((whitespace (whitespace) skip)
(comment ("%" (arbno (not #\newline))) skip)
(identifier
(letter (arbno (or letter digit "_" "-" "?")))
symbol)
(number (digit (arbn... |
e1f21dbf39f8bceadcb38c68d1751dfab4d62e63c6e64420a2d9fd7da6983f13 | Holmusk/elm-street | Ast.hs | | AST representing structure of Elm types . Haskell generic representation is
converted to this AST which later is going to be pretty - printed .
converted to this AST which later is going to be pretty-printed.
-}
module Elm.Ast
( ElmDefinition (..)
, ElmRecord (..)
, ElmType (..)
, ... | null | https://raw.githubusercontent.com/Holmusk/elm-street/09b201e085d8f0b31ecf8cbf8481f9b7b9d8406e/src/Elm/Ast.hs | haskell | | Elm data type definition.
^ Name of the record
^ List of fields
| Wrapper for name of the type.
^ Name of the data type
^ List of type variables; currently only phantom variables
^ List of constructors
^ Name of the constructor
^ Fields of the constructor
| Gets the list of the constructor names.
| Primiti... | | AST representing structure of Elm types . Haskell generic representation is
converted to this AST which later is going to be pretty - printed .
converted to this AST which later is going to be pretty-printed.
-}
module Elm.Ast
( ElmDefinition (..)
, ElmRecord (..)
, ElmType (..)
, ... |
558834f5628a5b8019835e8eca28781dd42168c4730e1b30f64cf6717512cd19 | zenspider/schemers | exercise.5.35.scm | #!/usr/bin/env csi -s
(require rackunit)
Exercise 5.35
;; What expression was compiled to produce the code
shown in * Note Figure 5 - 18 : : ?
;;
* Figure 5.18 :* An example of compiler output . See * Note Exercise
5 - 35 : : .
;;
( assign ( op make - compiled - procedure ) ( label entry16 )
;; ... | null | https://raw.githubusercontent.com/zenspider/schemers/2939ca553ac79013a4c3aaaec812c1bad3933b16/sicp/ch_5/exercise.5.35.scm | scheme | What expression was compiled to produce the code
(reg env))
entry16
(assign env (op compiled-procedure-env) (reg proc))
(assign env
(assign proc (op lookup-variable-value) (const +) (reg env))
(save continue)
(save proc)
... | #!/usr/bin/env csi -s
(require rackunit)
Exercise 5.35
shown in * Note Figure 5 - 18 : : ?
* Figure 5.18 :* An example of compiler output . See * Note Exercise
5 - 35 : : .
( assign ( op make - compiled - procedure ) ( label entry16 )
( goto ( label after - lambda15 ) )
( ... |
c7aaa9960678d12b1dbd1b5f3e5b4ff5c51b1cd90c80f35f06269a46481e594e | static-analysis-engineering/codehawk | bCHDwarfTest.ml | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Unit Testing Framework
Author : Adapted from : ( )
------------------------------------------------------------------------------
... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/e8fed9f226abe38578768968279c8242eb21fea9/CodeHawk/CHT/CHB_tests/bchlibelf_tests/txbchlibelf/bCHDwarfTest.ml | ocaml | chutil
bchlib
bchlibelf
tchlib
bchlib
tbchlibelf | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Unit Testing Framework
Author : Adapted from : ( )
------------------------------------------------------------------------------
... |
1e8d3c43bee15c157d7e835e98ba28f905a26099da806d5bf8d482881002c7fb | tonsky/advent-of-code | main.clj | (ns advent-of-code.year2021.main)
(defn solve-day [day]
(let [ns (symbol (str "advent-of-code.year2021.day" day))]
(require ns)
(println "Day" day)
(print "├ part 1: ")
(flush)
(println ((ns-resolve ns 'part1)))
(print "└ part 2: ")
(flush)
(println ((ns-resolve ns 'part2)))
(prin... | null | https://raw.githubusercontent.com/tonsky/advent-of-code/4b468df0df84f0fd5caf466c54fcbbb3d783bf71/src/advent_of_code/year2021/main.clj | clojure | (ns advent-of-code.year2021.main)
(defn solve-day [day]
(let [ns (symbol (str "advent-of-code.year2021.day" day))]
(require ns)
(println "Day" day)
(print "├ part 1: ")
(flush)
(println ((ns-resolve ns 'part1)))
(print "└ part 2: ")
(flush)
(println ((ns-resolve ns 'part2)))
(prin... | |
38b82d72ccee5c6f23f268681d8918e183d0f5a329f39b4a5815c72a1fe7cdd8 | gonimo/gonimo | STM.hs | module Utils.STM where
import Control.Concurrent.STM
import Control.Exception
import Gonimo.Server.Error (ServerError (TransactionTimeout))
import Utils.Constants
gTimeoutSTM :: Exception e => Int -> STM (Maybe a) -> e -> IO a
| retries to execute an ' STM ' action for for... | null | https://raw.githubusercontent.com/gonimo/gonimo/f4072db9e56f0c853a9f07e048e254eaa671283b/back/src/Utils/STM.hs | haskell | or | module Utils.STM where
import Control.Concurrent.STM
import Control.Exception
import Gonimo.Server.Error (ServerError (TransactionTimeout))
import Utils.Constants
gTimeoutSTM :: Exception e => Int -> STM (Maybe a) -> e -> IO a
| retries to execute an ' STM ' action for for... |
11cd1f9c486239ee70811a8ec421325394e8c3102f5c62b4a3325be39dc8ebe9 | andreabedini/foliage | HackageSecurity.hs | # LANGUAGE FlexibleContexts #
module Foliage.HackageSecurity
( module Foliage.HackageSecurity,
module Hackage.Security.Server,
module Hackage.Security.TUF.FileMap,
module Hackage.Security.Key.Env,
module Hackage.Security.Util.Path,
module Hackage.Security.Util.Some,
)
where
import Control.Mona... | null | https://raw.githubusercontent.com/andreabedini/foliage/35096a57378484c8ed9d887f56b10d0f39c1f6ab/app/Foliage/HackageSecurity.hs | haskell | # LANGUAGE FlexibleContexts #
module Foliage.HackageSecurity
( module Foliage.HackageSecurity,
module Hackage.Security.Server,
module Hackage.Security.TUF.FileMap,
module Hackage.Security.Key.Env,
module Hackage.Security.Util.Path,
module Hackage.Security.Util.Some,
)
where
import Control.Mona... | |
8358de94786d90300d90596bc666c928bbf5d8eb71eac32649dda9a606948e6a | GillianPlatform/Gillian | exceptions.ml | exception Impossible of string
exception Unsupported of string
| null | https://raw.githubusercontent.com/GillianPlatform/Gillian/1c8d65120c04ef87cda689a9d41268e25b5ffa7e/GillianCore/utils/exceptions.ml | ocaml | exception Impossible of string
exception Unsupported of string
| |
390a1ab3098c6ab84819ca4fcf5caccd8d31289849a1dfdbfcd51affa2a36d5f | sbtourist/clamq | project.clj | (defproject clamq/clamq-runner "0.5-SNAPSHOT"
:description "Clojure APIs for Message Queues"
:dependencies [[org.slf4j/slf4j-api "1.6.1"]
[org.slf4j/slf4j-simple "1.6.1"]
[clamq/clamq-activemq "0.5-SNAPSHOT"]
[clamq/clamq-rabbitmq "0.5-SNAPSHOT"]]
:aot [clamq.runner.ma... | null | https://raw.githubusercontent.com/sbtourist/clamq/34a6bbcb7a2a431ea629aa5cfbc687ef31f860f2/clamq-runner/project.clj | clojure | (defproject clamq/clamq-runner "0.5-SNAPSHOT"
:description "Clojure APIs for Message Queues"
:dependencies [[org.slf4j/slf4j-api "1.6.1"]
[org.slf4j/slf4j-simple "1.6.1"]
[clamq/clamq-activemq "0.5-SNAPSHOT"]
[clamq/clamq-rabbitmq "0.5-SNAPSHOT"]]
:aot [clamq.runner.ma... | |
4cde37c92676a594953bc74c30dd7d582e78cc9c76b45967d4e1f8cb5b9cea97 | mzp/coq-ruby | hipattern.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/tactics/hipattern.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
i
i
Match terms [(eq A t u)] or [(i... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
i $ I d : hipattern.mli 117... |
31d40fb00080bddd07410b306caca48be7307725d63c6be134d90bde897cb16a | jiangpengnju/htdp2e | structure_in_the_world.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-reader.ss" "lang")((modname structure_in_the_world) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repe... | null | https://raw.githubusercontent.com/jiangpengnju/htdp2e/d41555519fbb378330f75c88141f72b00a9ab1d3/fixed-size-data/adding-structure/structure_in_the_world.rkt | racket | about the language level of this file in a form that our tools can easily process.
we must use a collection of structures to represent the word state data.
piece of infromation.
Consider a space invader game, in which a UFO descends along a straight vertical
line and some tank moves horizontally at the bottom of a... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-reader.ss" "lang")((modname structure_in_the_world) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #f #t none #f () #f)))
When a world program must track two different a... |
ae2a07d399d793b37b35f03e053ce73f70b160152374e68ab2d3f6730effc974 | formal-land/coq-of-ocaml | signatureShape.ml | open SmartPrint
* The shape of a signature to simplify comparisons . Two signatures are
considered similar if they have the same shape . The shape only contains the
names of values and sub - module at the top - level of the module . Basically ,
shapes are sets of strings .
considered similar if th... | null | https://raw.githubusercontent.com/formal-land/coq-of-ocaml/19fe7cf51722da9453cb7ce43724e774e7c9d040/src/signatureShape.ml | ocaml | We sort the elements of the shape to have a canonical representation. | open SmartPrint
* The shape of a signature to simplify comparisons . Two signatures are
considered similar if they have the same shape . The shape only contains the
names of values and sub - module at the top - level of the module . Basically ,
shapes are sets of strings .
considered similar if th... |
2e88b2f554b6f83b6e51ac94a421de78a977950f79c078a38d32f47258016dd0 | fused-effects/fused-effects | Writer.hs | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
{-# OPTIONS_GHC -Wno-unrecognised-pragmas #-}
# HLINT ignore " Eta reduce " #
module Writer
( tests
, gen0
, genN
, test
) where
import Control.Arrow ((&&&))
import qualif... | null | https://raw.githubusercontent.com/fused-effects/fused-effects/85f4b7499789a1750eb9a8d35ea09933b0d7a97b/test/Writer.hs | haskell | # LANGUAGE RankNTypes #
# OPTIONS_GHC -Wno-unrecognised-pragmas # | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# HLINT ignore " Eta reduce " #
module Writer
( tests
, gen0
, genN
, test
) where
import Control.Arrow ((&&&))
import qualified Control.Carrier.Writer.Church as C.Writer.Church
import qualified Cont... |
f4bbd446d70238c1a532791c24c7c0e6a30cd85a4930ba3ff1fb352af7a76d7c | ebresafegaga/tina | shell.ml | open Syntax
open Runtime
open Backend
open Typing
module P = Parsing.ParserEntry
let eval source =
let syntax = source |> Lexing.from_string |> P.parse in
let ty =
syntax |> Typecheck.handle_toplevel |> Ctx.pp_ctx |> String.concat "\n"
in
let term = syntax (* |> DesugarEffect.handle_toplevel*) |> Eval.pr... | null | https://raw.githubusercontent.com/ebresafegaga/tina/66fa8daa66c0c6e65260bbea3e8e2ddcc2f9d2d0/shell/shell.ml | ocaml | |> DesugarEffect.handle_toplevel | open Syntax
open Runtime
open Backend
open Typing
module P = Parsing.ParserEntry
let eval source =
let syntax = source |> Lexing.from_string |> P.parse in
let ty =
syntax |> Typecheck.handle_toplevel |> Ctx.pp_ctx |> String.concat "\n"
in
Printf.sprintf "%s \n %s" term ty
let eval source =
match eval ... |
289f8e5c7ace1baea3f4fea1f7c7522dce023790116f5c2f0a8a80f6c7e6d248 | fyquah/hardcaml_zprize | test_barrett_reduction.mli | open Hardcaml
module Make (M : sig
val bits : int
val output_bits : int
end) : sig
include module type of Field_ops_lib.Barrett_reduction.With_interface (M)
val test
: debug:bool
-> test_cases:Z.t list
-> config:Field_ops_lib.Barrett_reduction.Config.t
-> sim:Cyclesim.With_interface(I)(O).t
... | null | https://raw.githubusercontent.com/fyquah/hardcaml_zprize/7eb1bd214908fa801781db33287eaf12691715f8/libs/field_ops/test/test_barrett_reduction.mli | ocaml | open Hardcaml
module Make (M : sig
val bits : int
val output_bits : int
end) : sig
include module type of Field_ops_lib.Barrett_reduction.With_interface (M)
val test
: debug:bool
-> test_cases:Z.t list
-> config:Field_ops_lib.Barrett_reduction.Config.t
-> sim:Cyclesim.With_interface(I)(O).t
... | |
49ab6f2e0810bd1e01951c55ee6ebed419a7282855d902cd3f31fa2d9cd735f7 | txyyss/Project-Euler | Euler106.hs | Let S(A ) represent the sum of elements in set A of size n. We shall
call it a special sum set if for any two non - empty disjoint
-- subsets, B and C, the following properties are true:
-- S(B) != S(C); that is, sums of subsets cannot be equal.
If B contains more elements than C then S(B ) > S(C ) .
-- For thi... | null | https://raw.githubusercontent.com/txyyss/Project-Euler/d2f41dad429013868445c1c9c1c270b951550ee9/Euler106.hs | haskell | subsets, B and C, the following properties are true:
S(B) != S(C); that is, sums of subsets cannot be equal.
For this problem we shall assume that a given set contains n
rule.
obtained need to be tested for equality?
see analysis here:
-euler-106-minimum-comparisons-special-sum-sets/ | Let S(A ) represent the sum of elements in set A of size n. We shall
call it a special sum set if for any two non - empty disjoint
If B contains more elements than C then S(B ) > S(C ) .
strictly increasing elements and it already satisfies the second
Surprisingly , out of the 25 possible subset pairs that... |
f7add9d1c7bb4dd9c74118b06a0949cafb8c74f570ac6d462d65a012bbd4d703 | reflectionalist/S9fES | appendb.scm | Scheme 9 from Empty Space , Function Library
By , 2010
; Placed in the Public Domain
;
; (append! list ...) ==> unspecific
; (append! list ... object) ==> unspecific
;
APPEND ! is like , but appends the LISTs destructively .
; It destroys all but the last object passed to it and returns
; an unspec... | null | https://raw.githubusercontent.com/reflectionalist/S9fES/0ade11593cf35f112e197026886fc819042058dd/lib/appendb.scm | scheme | Placed in the Public Domain
(append! list ...) ==> unspecific
(append! list ... object) ==> unspecific
It destroys all but the last object passed to it and returns
an unspecific value. The append!ed list will be stored in the
first LIST, which should be bound to a symbol or it will not
'().
Exampl... | Scheme 9 from Empty Space , Function Library
By , 2010
APPEND ! is like , but appends the LISTs destructively .
be accessible after the operation . The first LIST may not be
( append ! a ( list 4 5 6 ) ' end )
(define (append! . a*)
(letrec
((append2!
(lambda (a b)
(con... |
2e5ed1f72f7447ba13b46ec3299f21b059a70f916ef6c551fb03c3c00c81e32d | stritzinger/opcua | opcua_nodeset_parser.erl | %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%%% @doc OPCUA Node Set parser.
%%%
%%% Parse OPCUA Node Set files and generate internal database format.
%%%
%%% @end
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
-module(opcua_nodeset_parser).
TODO ... | null | https://raw.githubusercontent.com/stritzinger/opcua/a9802f829f80e6961871653f4d3c932f9496ba99/src/opcua_nodeset_parser.erl | erlang |
@doc OPCUA Node Set parser.
Parse OPCUA Node Set files and generate internal database format.
@end
%
- When opcua_space has been updated to handle the generation of all the
metadata dynamically (subtypes, type definition...), use a space and
store it.
- The namespace handling is probably wrong, check h... | -module(opcua_nodeset_parser).
- Properly parse XML values from the NodeSet XML file .
e.g. Variables like EnumValues ( ) should have a value .
-include_lib("kernel/include/logger.hrl").
-include_lib("xmerl/include/xmerl.hrl").
-include("opcua.hrl").
-include("opcua_internal.hrl").
-export([parse/0]).
... |
7008b6a1a0497347b8db0d88787024384c4f2d1a42f5ee49d7b679f037daa6f1 | josefs/Gradualizer | nonempty_list_match_in_head_nonexhaustive.erl | -module(nonempty_list_match_in_head_nonexhaustive).
-export([f/1]).
-type t() :: {} | [t()].
-spec f(t()) -> ok.
f(_A = [_|_]) -> ok.
| null | https://raw.githubusercontent.com/josefs/Gradualizer/3cda2e5aa1b1313b3e02fce67986fcda3ab9a02c/test/should_fail/nonempty_list_match_in_head_nonexhaustive.erl | erlang | -module(nonempty_list_match_in_head_nonexhaustive).
-export([f/1]).
-type t() :: {} | [t()].
-spec f(t()) -> ok.
f(_A = [_|_]) -> ok.
| |
f15d3b1b3837996f507e041fb746097dbe61e907bc17a9e696907959c6d78780 | Rober-t/apxr_run | scape_test.erl | -module(scape_test).
-include_lib("eunit/include/eunit.hrl").
%% runners
scape_test_() ->
{setup,
fun setup/0,
fun cleanup/1,
[
fun scape_subtest/0
]}.
%% tests
scape_subtest() ->
% start
utils:random_seed(),
scape:start_link(1.0, 1.0, 50.0, 50.0, flatland),
AgentIds = [{agent, rand:unifo... | null | https://raw.githubusercontent.com/Rober-t/apxr_run/9c62ab028af7ff3768ffe3f27b8eef1799540f05/test/scape_test.erl | erlang | runners
tests
start
enter
sense
actuate
sense
actuate
sense
actuate
sense
actuate
sense
actuate
query_area
leave
helpers
exit(SecPid, normal),
ets:delete(scape_names_pids),
ets:delete(ids_sids_loc),
ets:delete(qt),
application:stop(shards). | -module(scape_test).
-include_lib("eunit/include/eunit.hrl").
scape_test_() ->
{setup,
fun setup/0,
fun cleanup/1,
[
fun scape_subtest/0
]}.
scape_subtest() ->
utils:random_seed(),
scape:start_link(1.0, 1.0, 50.0, 50.0, flatland),
AgentIds = [{agent, rand:uniform() - 0.5} || _<- lists:seq(1... |
58d2b98ad9f2c8c37227280737e336c2507333cc76d80b5efbabfe2fff3a6e3c | samply/blaze | spec.clj | (ns blaze.db.kv.rocksdb.impl.spec
(:require
[clojure.spec.alpha :as s])
(:import
[org.rocksdb ColumnFamilyHandle WriteBatchInterface]))
(s/def :blaze.db.kv.rocksdb.impl/column-family-handle
#(instance? ColumnFamilyHandle %))
(s/def :blaze.db.kv.rocksdb.impl/write-batch
#(instance? WriteBatchInterfac... | null | https://raw.githubusercontent.com/samply/blaze/281ca0f35c845ed6e7b7f37fe2d4b9a060b065ca/modules/rocksdb/test/blaze/db/kv/rocksdb/impl/spec.clj | clojure | (ns blaze.db.kv.rocksdb.impl.spec
(:require
[clojure.spec.alpha :as s])
(:import
[org.rocksdb ColumnFamilyHandle WriteBatchInterface]))
(s/def :blaze.db.kv.rocksdb.impl/column-family-handle
#(instance? ColumnFamilyHandle %))
(s/def :blaze.db.kv.rocksdb.impl/write-batch
#(instance? WriteBatchInterfac... | |
480476f82cd0753a0181e129732a9f2547f2e7fdf9a0e38dcb8ada9d835c6416 | ComputerScienceHouse/csh-eval | Members.hs |
Module : CSH.Eval . Frontend . Members
Description : The route handler for the members page
Copyright : , , , Computer Science House 2015
License : MIT
Maintainer :
Stability : Provisional
Portability : POSIX
DOCUMENT THIS !
Module : CSH.Eval.Frontend.Members
Descriptio... | null | https://raw.githubusercontent.com/ComputerScienceHouse/csh-eval/d2d4bac07bfbfcdb58aa01694d422f326bd3d414/src/CSH/Eval/Frontend/Members.hs | haskell | # LANGUAGE QuasiQuotes #
# LANGUAGE TypeFamilies #
# LANGUAGE OverloadedStrings #
# LANGUAGE ViewPatterns #
| The handler for the members listing page
| The handler for a single member's page |
Module : CSH.Eval . Frontend . Members
Description : The route handler for the members page
Copyright : , , , Computer Science House 2015
License : MIT
Maintainer :
Stability : Provisional
Portability : POSIX
DOCUMENT THIS !
Module : CSH.Eval.Frontend.Members
Descriptio... |
f2ee58e72b43c43cdf8e7552b99de3c4e1defff54c15a82b97c4c9b80fb0cd10 | untangled-web/untangled-client | routing.cljs | (ns untangled.client.routing
(:require-macros untangled.client.routing)
(:require [untangled.client.mutations :as m]
untangled.client.core
om.next
om.dom
[untangled.client.logging :as log]))
(def routing-tree-key ::routing-tree)
(def routers-table :untangled.client.r... | null | https://raw.githubusercontent.com/untangled-web/untangled-client/d9b350db3a5e19910692ee70281d8c156fd3a3f9/src/untangled/client/routing.cljs | clojure | NOTE: needed in macro, but hand-coded | (ns untangled.client.routing
(:require-macros untangled.client.routing)
(:require [untangled.client.mutations :as m]
untangled.client.core
om.next
om.dom
[untangled.client.logging :as log]))
(def routing-tree-key ::routing-tree)
(defn make-route
"Make a route name... |
b0280d9a1fcebd8177f358ef00bed6220066a3432630bdb8acbe23c6d6c1ea89 | thma/PolysemyCleanArchitecture | InterfaceAdaptersKVSAcidStateSpec.hs | module InterfaceAdaptersKVSAcidStateSpec where
import Control.Exception
import Control.Monad.Cont (liftIO)
import Data.Function ((&))
import Data . List ( isSuffixOf )
import qualified Data.Map.Strict as M
import... | null | https://raw.githubusercontent.com/thma/PolysemyCleanArchitecture/beaf8b5a029707856cef7ff54ea03f2927f1021c/test/InterfaceAdaptersKVSAcidStateSpec.hs | haskell | Testing the KVS AcidState implementation
| Takes a program with effects and handles each effect till it gets reduced to IO a.
use the variable config as source for (Input Config) effect
ignore all traces
Helper functions for interpreting all effects in IO
| helper function to clean the test data files
time after... | module InterfaceAdaptersKVSAcidStateSpec where
import Control.Exception
import Control.Monad.Cont (liftIO)
import Data.Function ((&))
import Data . List ( isSuffixOf )
import qualified Data.Map.Strict as M
import... |
87bd7a6bf1e467804cfca831a35c4a582915e58158a834aa7df2d5df93a59273 | FlowForwarding/loom | icontrol_app.erl | -module(icontrol_app).
-behaviour(application).
%% Application callbacks
-export([start/2, stop/1]).
%% ===================================================================
%% Application callbacks
%% ===================================================================
start(_StartType, _StartArgs) ->
icontrol_su... | null | https://raw.githubusercontent.com/FlowForwarding/loom/86a9c5aa8b7d4776062365716c9a3dbbf3330bc5/icontrol/apps/icontrol/src/icontrol_app.erl | erlang | Application callbacks
===================================================================
Application callbacks
=================================================================== | -module(icontrol_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
icontrol_sup:start_link().
stop(_State) ->
ok.
|
73506d316678f3fd3accaf7ebdbbd99a7e48c3be38e09951726d92764eb07ffa | ddssff/cabal-debian | DiffOutput.hs | -----------------------------------------------------------------------------
-- |
Module : Data . Algorithm .
Copyright : ( c ) 2008 - 2011 , 2011
License : BSD 3 Clause
-- Maintainer :
-- Stability : experimental
-- Portability : portable
Author : ( ) and JP Moresmau... | null | https://raw.githubusercontent.com/ddssff/cabal-debian/763270aed987f870762e660f243451e9a34e1325/test-data/diff/input/src/Data/Algorithm/DiffOutput.hs | haskell | ---------------------------------------------------------------------------
|
Maintainer :
Stability : experimental
Portability : portable
Generates a string output that is similar to diff normal mode
---------------------------------------------------------------------------
| pretty print the difference... | Module : Data . Algorithm .
Copyright : ( c ) 2008 - 2011 , 2011
License : BSD 3 Clause
Author : ( ) and JP Moresmau ( )
module Data.Algorithm.DiffOutput where
import Data.Algorithm.Diff
import Text.PrettyPrint
import Data.Char
import Data.List
import Data.Monoid (mappend)
... |
7396099e4c89ac831f67e5430820228a99a11cb030cd8daf96d5cdc1118a6204 | deadtrickster/prometheus.cl | package.lisp | (in-package #:cl-user)
(defpackage #:prometheus.test.support
(:use #:cl #:alexandria #:prove)
(:export #:error-class-exists
#:is-error-report
#:error-report-test
#:with-fresh-registry))
| null | https://raw.githubusercontent.com/deadtrickster/prometheus.cl/60572b793135e8ab5a857d47cc1a5fe0af3a2d53/t/support/package.lisp | lisp | (in-package #:cl-user)
(defpackage #:prometheus.test.support
(:use #:cl #:alexandria #:prove)
(:export #:error-class-exists
#:is-error-report
#:error-report-test
#:with-fresh-registry))
| |
3dbd35017af6e6a9b3bbacdc7b213fbb21e9a11bf4b9e62793d24d7b977314f0 | lvh/caesium | binding.clj | (ns caesium.binding
"**DANGER** These are the low-level bindings to libsodium, using
jnr-ffi. They are probably not what you want; instead, please look at
the [[caesium.crypto.box]], [[caesium.crypto.secretbox]],
[[caesium.crypto.generichash]], [[caesium.crypto.sign]] et cetera,
namespaces."
(:require [clo... | null | https://raw.githubusercontent.com/lvh/caesium/ff85b7a967e927f45bd37661609ea514c1b4a6c2/src/caesium/binding.clj | clojure | instead, please look at
| (ns caesium.binding
"**DANGER** These are the low-level bindings to libsodium, using
the [[caesium.crypto.box]], [[caesium.crypto.secretbox]],
[[caesium.crypto.generichash]], [[caesium.crypto.sign]] et cetera,
namespaces."
(:require [clojure.string :as s]
[clojure.math.combinatorics :as c]
... |
6df4f579b5b9db370fb7a63cfabff138a7aa76751469514578e3eac119b96044 | thelema/ocaml-community | builtini_bindtags.ml | ##ifdef CAMLTK
let cCAMLtoTKbindings = function
| WidgetBindings v1 -> cCAMLtoTKwidget widget_any_table v1
| TagBindings v1 -> TkToken v1
;;
(* this doesn't really belong here *)
let cTKtoCAMLbindings s =
if String.length s > 0 && s.[0] = '.' then
WidgetBindings (cTKtoCAMLwidget s)
else TagBindings s
;;
... | null | https://raw.githubusercontent.com/thelema/ocaml-community/ed0a2424bbf13d1b33292725e089f0d7ba94b540/otherlibs/labltk/builtin/builtini_bindtags.ml | ocaml | this doesn't really belong here
this doesn't really belong here | ##ifdef CAMLTK
let cCAMLtoTKbindings = function
| WidgetBindings v1 -> cCAMLtoTKwidget widget_any_table v1
| TagBindings v1 -> TkToken v1
;;
let cTKtoCAMLbindings s =
if String.length s > 0 && s.[0] = '.' then
WidgetBindings (cTKtoCAMLwidget s)
else TagBindings s
;;
##else
let cCAMLtoTKbindings = functi... |
36e917c550ef04dc2ff6a14e6db556f6b0346a32cb2434d1ed4ab7d5c5afc856 | clj-kondo/clj-kondo | main_test.clj | (ns clj-kondo.main-test
(:require
[cheshire.core :as cheshire]
[clj-kondo.core :as clj-kondo]
[clj-kondo.main :refer [main]]
[clj-kondo.test-utils :as tu :refer
[lint! assert-submaps assert-submap submap?
make-dirs rename-path remove-dir assert-submaps2]]
[clojure.edn :as edn]
[clojure.java... | null | https://raw.githubusercontent.com/clj-kondo/clj-kondo/41243e234d12e0de5f54994796d6727290785a1f/test/clj_kondo/main_test.clj | clojure | using it in syntax quote should mark private var as used
this doesn't use the private var, it only uses the ns alias
this does use the private var
More info on this: -06-15-clojurescript-case-constants.html
Each argument is followed by its spec.
private function is used
type mismatch ignored
dropping the 'linti... | (ns clj-kondo.main-test
(:require
[cheshire.core :as cheshire]
[clj-kondo.core :as clj-kondo]
[clj-kondo.main :refer [main]]
[clj-kondo.test-utils :as tu :refer
[lint! assert-submaps assert-submap submap?
make-dirs rename-path remove-dir assert-submaps2]]
[clojure.edn :as edn]
[clojure.java... |
4b57c5943ba4e68b2bb4a559801c903bde532174ff7d4d3ffb8100f20203df63 | kappelmann/eidi2_repetitorium_tum | ha5.mli | val superfib : int -> int
val inv_cantor : int -> int * int
val is_insert : (int -> int -> bool) -> int -> int list -> int list
val insertion_sort : int list -> (int -> int -> bool) -> int list
val scale_apply : int list -> (int -> int) list -> int list
type person = { name : string; age : int; }
type tree = Node of tr... | null | https://raw.githubusercontent.com/kappelmann/eidi2_repetitorium_tum/1d16bbc498487a85960e0d83152249eb13944611/additional_exercises/2016_17/Blatt%205%20L%C3%B6sungen/ocaml/ha5.mli | ocaml | val superfib : int -> int
val inv_cantor : int -> int * int
val is_insert : (int -> int -> bool) -> int -> int list -> int list
val insertion_sort : int list -> (int -> int -> bool) -> int list
val scale_apply : int list -> (int -> int) list -> int list
type person = { name : string; age : int; }
type tree = Node of tr... | |
3f62e58de26e011296f4ce9cbd384192b22a9e0c2aa2529ff2dbea2e82a71f0b | malcolmreynolds/GSLL | landau.lisp | distribution
, Sat Sep 30 2006
Time - stamp : < 2009 - 05 - 24 20:08:47EDT landau.lisp >
$ Id$
(in-package :gsl)
;;; /usr/include/gsl/gsl_randist.h
(defmfun sample
((generator random-number-generator) (type (eql 'landau)) &key)
"gsl_ran_landau"
(((mpointer generator) :pointer))
:definition :meth... | null | https://raw.githubusercontent.com/malcolmreynolds/GSLL/2f722f12f1d08e1b9550a46e2a22adba8e1e52c4/random/landau.lisp | lisp | /usr/include/gsl/gsl_randist.h
Examples and unit test | distribution
, Sat Sep 30 2006
Time - stamp : < 2009 - 05 - 24 20:08:47EDT landau.lisp >
$ Id$
(in-package :gsl)
(defmfun sample
((generator random-number-generator) (type (eql 'landau)) &key)
"gsl_ran_landau"
(((mpointer generator) :pointer))
:definition :method
:c-return :double
"A rand... |
7359ed3c7c102b386c6eacaa97fbb10b953c64760d5ca08a3f665e8083bc59fb | graninas/Hydra | Interpreter.hs | module Hydra.Core.CliHandlers.Interpreter where
import Hydra.Prelude
import qualified Data.Map as Map
import qualified Hydra.Core.CliHandlers.Language as L
import qualified Hydra.Core.Lang.Language as L
type Handlers a = IORef (Map.Map String (L.LangL a))
interpretCliHandlerL :: Handlers a -> L.CliHandle... | null | https://raw.githubusercontent.com/graninas/Hydra/60d591b1300528f5ffd93efa205012eebdd0286c/lib/hydra-free/src/Hydra/Core/CliHandlers/Interpreter.hs | haskell | module Hydra.Core.CliHandlers.Interpreter where
import Hydra.Prelude
import qualified Data.Map as Map
import qualified Hydra.Core.CliHandlers.Language as L
import qualified Hydra.Core.Lang.Language as L
type Handlers a = IORef (Map.Map String (L.LangL a))
interpretCliHandlerL :: Handlers a -> L.CliHandle... | |
418e48e24538fea8acb2e0f90be5f2476c9d43ce351ee5bfd390bff3884c90de | dmillett/political-canvas | ordinance.clj | (ns political-canvas.law.example.ordinance
(:require [political-canvas.shared.example.ward :as local]))
;;
; This is an example of a local ordinance that restricts nightime urban
; lighting to reduce light polution, yet maintain pedestrian safety.
;
; Allow for versioning of laws and ordinances with source control (... | null | https://raw.githubusercontent.com/dmillett/political-canvas/ec59a065b832277ec06f80e67977eee196a6a194/src/political_canvas/law/example/us/local/ordinance.clj | clojure |
This is an example of a local ordinance that restricts nightime urban
lighting to reduce light polution, yet maintain pedestrian safety.
Allow for versioning of laws and ordinances with source control (git)
where authors/sponsors own commit history (no forced updates!) | (ns political-canvas.law.example.ordinance
(:require [political-canvas.shared.example.ward :as local]))
(def clean_urban_lighting
"An example local ordinance which targets excessive urban lighting."
{:type "LOCAL-ORDINANCE"
:district local/ward1
:summary "To reduce urban light pollution while maintaining ... |
b2f90faa6d96091e67358231f44ae4bd667e6af6334d49091ef0d7275fd517c7 | faylang/fay | StringForcing.hs | module StringForcing where
import FFI
main = do
let s1 = "alma"
let s2 = s1 ++ map id s1
putStrLn s1
putStrLn s2
| null | https://raw.githubusercontent.com/faylang/fay/8455d975f9f0db2ecc922410e43e484fbd134699/tests/StringForcing.hs | haskell | module StringForcing where
import FFI
main = do
let s1 = "alma"
let s2 = s1 ++ map id s1
putStrLn s1
putStrLn s2
| |
4157af1c3ffc5a94cb21d3a39ccd2a2e92d01eebb4f10ee02c2778170806a5f8 | crategus/cl-cffi-gtk | gtk.drawing-area.lisp | ;;; ----------------------------------------------------------------------------
;;; gtk.drawing-area.lisp
;;;
The documentation of this file is taken from the GTK+ 3 Reference Manual
Version 3.24 and modified to document the Lisp binding to the GTK library .
;;; See <>. The API documentation of the Lisp binding is... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/ba198f7d29cb06de1e8965e1b8a78522d5430516/gtk/gtk.drawing-area.lisp | lisp | ----------------------------------------------------------------------------
gtk.drawing-area.lisp
See <>. The API documentation of the Lisp binding is
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License for Lisp
License, or (at your ... | The documentation of this file is taken from the GTK+ 3 Reference Manual
Version 3.24 and modified to document the Lisp binding to the GTK library .
available from < -cffi-gtk/ > .
Copyright ( C ) 2009 - 2011
Copyright ( C ) 2011 - 2021
as published by the Free Software Foundation , either version 3 of ... |
0a18b4761c444288c64333b9d676a3199d3518fc9ca6722108051213ab98efe8 | kadena-io/chainweaver | Repl.hs | # LANGUAGE DataKinds #
# LANGUAGE ExtendedDefaultRules #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecursiveDo #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
-- |
Copyright : ... | null | https://raw.githubusercontent.com/kadena-io/chainweaver/5d40e91411995e0a9a7e782d6bb2d89ac1c65d52/frontend/src/Frontend/UI/Repl.hs | haskell | # LANGUAGE OverloadedStrings #
|
License : BSD-style (see the file LICENSE)
----------------------------------------------------------------------------
----------------------------------------------------------------------------
---------------------------------------------------------------------------- | # LANGUAGE DataKinds #
# LANGUAGE ExtendedDefaultRules #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecursiveDo #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
Copyright : ( C ) 2020 - 2022 Kadena
module Fronte... |
4b619a4a299ede79007023ecea0582f298329ebec1635ba65d7fc2af931a8468 | PrincetonUniversity/lucid | DockerUtils.ml | (* parse command line arguments for docker. Return:
spec: spec file
main: main source file
include: other source file
include: other source file
...
*)
open Batteries
open Dpt
let cfg = Cmdline.cfg
let find_spec_file dpt_file =
if not (String.ends_with dpt_file ".dpt")
then None
else (
let jso... | null | https://raw.githubusercontent.com/PrincetonUniversity/lucid/ae9fd967225486b1ac848f7318c08e7379832b61/src/bin/DockerUtils.ml | ocaml | parse command line arguments for docker. Return:
spec: spec file
main: main source file
include: other source file
include: other source file
...
| open Batteries
open Dpt
let cfg = Cmdline.cfg
let find_spec_file dpt_file =
if not (String.ends_with dpt_file ".dpt")
then None
else (
let json_name = String.rchop ~n:4 dpt_file ^ ".json" in
if Sys.file_exists json_name
then (
if not cfg.interactive
then Console.report @@ "Auto-detected ... |
bc227e716b302a03ff62ddfcf34f49cf150e6601785ab6ed6fb8b610766cd809 | dedbox/racket-algebraic | macro.rkt | #lang racket/base
(require algebraic/pretty
algebraic/private
racket/contract/base
racket/pretty
racket/syntax
syntax/parse
syntax/transformer
(for-template racket/base)
(for-syntax algebraic/product
algebraic/private
... | null | https://raw.githubusercontent.com/dedbox/racket-algebraic/706b2d01ab735a01e372c33da49995339194e024/algebraic/macro.rkt | racket | composite data
#(patt ...)
#&patt
bindings
algebraic data
Π
(Π patt ...)
pattern aliases
pattern guards
Racket structs
(struct-id [field-id patt] ...)
(struct-id patt ...)
unquoted lists
----------------------------------------------------------------------------
--------------------------------------... | #lang racket/base
(require algebraic/pretty
algebraic/private
racket/contract/base
racket/pretty
racket/syntax
syntax/parse
syntax/transformer
(for-template racket/base)
(for-syntax algebraic/product
algebraic/private
... |
6adc0cb1ad9f422c1e47d510ea3a99f0cbd600e367ee44512e24e392203be5c4 | input-output-hk/cardano-ledger | Merkle.hs | {-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE UndecidableInstances #
-- | Merkle tree implementation.
--
-- See <>.
module Cardano.Chain.Common.Merkle (
* MerkleRo... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger/b9aa1ad1728c0ceeca62657ec94d6d099896c052/eras/byron/ledger/impl/src/Cardano/Chain/Common/Merkle.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings #
| Merkle tree implementation.
See <>.
* MerkleTree
* MerkleNode
want. It would be great if we could write
used unqualified. The hiding in fact makes it clearer for the human reader
what's going on.
-------------------------------------------------------... | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE UndecidableInstances #
module Cardano.Chain.Common.Merkle (
* MerkleRoot
MerkleRoot (..),
MerkleTree (..),
mtRoot,
mkMerkleTree,
mkMerkleTreeDecoded,
MerkleNode (..),
m... |
eed673fd4087ddedd2d76891cb9c06f92e61cc053b8148992ef9873a4ee91e75 | DSiSc/why3 | bigInt.mli | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
(* ... | null | https://raw.githubusercontent.com/DSiSc/why3/8ba9c2287224b53075adc51544bc377bc8ea5c75/src/util/bigInt.mli | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
General Public License version 2.1 , with the special exception
* Wrapper for big nums , implemented either with 's [ Nums ] or [ ZArith ]
type t
val compare : t -> t ... |
7308109604436c0fee16ef13cd0ca73d1b64be528bf61ebaba656bc86ed6ea1d | ijvcms/chuanqi_dev | robot_cross.erl | %%%-------------------------------------------------------------------
@author yubing
( C ) 2016 , < COMPANY >
%%% @doc
%%%
%%% @end
Created : 30 . 五月 2016 16:57
%%%-------------------------------------------------------------------
-module(robot_cross).
-include("gameconfig_config.hrl").
-include("record.hrl").... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/business/cross/robot_cross.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
初始化机器人账号信息
执行事件
登陆记录
登出记录
添加机器人
检测是否可以生成机器人
添加机器人
删除机器人
检测玩家是否机器人
检测玩家是否机器人 | @author yubing
( C ) 2016 , < COMPANY >
Created : 30 . 五月 2016 16:57
-module(robot_cross).
-include("gameconfig_config.hrl").
-include("record.hrl").
-include("cache.hrl").
-include("common.hrl").
-include("proto.hrl").
-include("config.hrl").
-export([
init/0,
check_robot/1,
login_out/1,
check_robot/3,
... |
59191dbe7888968d301d17c1ba6d8ed7b915fa2edbaceb00ba7f3f0ff035a9f9 | plasma-umass/compsci631 | Compiler_util.mli | (** Support code for writing a simple compiler. *)
type id = string [@@deriving show]
type op2 =
| LT
| GT
| Eq
| Add
| Sub
| Mul
| Div
| Mod
[@@deriving show]
type const =
| Int of int
| Bool of bool
[@@deriving show]
type exp =
| Id of id
| Const of const
| Op2 of op2 * exp * exp
|... | null | https://raw.githubusercontent.com/plasma-umass/compsci631/d71d866460cac0659f31276cfb79afedc211481a/lib/Compiler_util.mli | ocaml | * Support code for writing a simple compiler.
* Atomic expressions.
* Binding forms.
* Expressions in A-normal form. |
type id = string [@@deriving show]
type op2 =
| LT
| GT
| Eq
| Add
| Sub
| Mul
| Div
| Mod
[@@deriving show]
type const =
| Int of int
| Bool of bool
[@@deriving show]
type exp =
| Id of id
| Const of const
| Op2 of op2 * exp * exp
| If of exp * exp * exp
| Let of id * exp * exp
... |
96735a3b9dcab4e0d81da247a041f38e01e5b22bfeebfe16039a46ca49749427 | gfngfn/otfed | decodeTtf.ml |
open Basic
open Value
open DecodeBasic
open DecodeOperation.Open
module Maxp = DecodeTtfMaxp
let d_loca_short (gid : glyph_id) : ((int * int) option) decoder =
let open DecodeOperation in
(* The position is set to the beginning of a `loca` table. *)
d_skip (gid * 2) >>= fun () ->
d_uint16 >>= fun half1 ->
... | null | https://raw.githubusercontent.com/gfngfn/otfed/3c6d8ea0b05fc18a48cb423451da7858bf73d1d0/src/decodeTtf.ml | ocaml | The position is set to the beginning of a `loca` table.
The position is set to the beginning of a `loca` table.
The position is set to the beginning of a `loca` table.
`num_points`: the total number of points. |
open Basic
open Value
open DecodeBasic
open DecodeOperation.Open
module Maxp = DecodeTtfMaxp
let d_loca_short (gid : glyph_id) : ((int * int) option) decoder =
let open DecodeOperation in
d_skip (gid * 2) >>= fun () ->
d_uint16 >>= fun half1 ->
d_uint16 >>= fun half2 ->
if half1 = half2 then
return N... |
5ef629980be46118425b3fede1a6392c98ce5eb245bd0fa22e2a66040cb5bade | monadbobo/ocaml-core | wait_test.ml | open Core.Std
open Async.Std
open Qtest_lib.Std
let fast_child () = Unix.fork_exec ~prog:"/bin/true" ~args:[] ()
let slow_child () =
let prog = "/bin/sleep" in
Unix.fork_exec ~prog ~args:[ prog; "1" ] ()
;;
let raises_echild f =
try ignore (f ()); false with
| Unix.Unix_error (Unix.ECHILD, _, _) -> true
;... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/async/lib_test/wait_test.ml | ocaml | Clear wait-status for any children spawned by previous tests. | open Core.Std
open Async.Std
open Qtest_lib.Std
let fast_child () = Unix.fork_exec ~prog:"/bin/true" ~args:[] ()
let slow_child () =
let prog = "/bin/sleep" in
Unix.fork_exec ~prog ~args:[ prog; "1" ] ()
;;
let raises_echild f =
try ignore (f ()); false with
| Unix.Unix_error (Unix.ECHILD, _, _) -> true
;... |
396ae7b48343875292b301e8279fce5739b59ec83b4d36ae7d4447b0d7580a1f | achirkin/vulkan | VK_EXT_queue_family_foreign.hs | # OPTIONS_HADDOCK not - home #
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE MagicHash #-}
# LANGUAGE PatternSynonyms #
{-# LANGUAGE Strict #-}
{-# LANGUAGE ViewPatterns #-}
module Graphics.Vulkan.Ext.VK_EXT_queue_family_foreign
* Vulkan extension : @VK_EXT_queue_family_foreign@
-- |
... | null | https://raw.githubusercontent.com/achirkin/vulkan/b2e0568c71b5135010f4bba939cd8dcf7a05c361/vulkan-api/src-gen/Graphics/Vulkan/Ext/VK_EXT_queue_family_foreign.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE MagicHash #
# LANGUAGE Strict #
# LANGUAGE ViewPatterns #
|
supported: @vulkan@
author: @EXT@
type: @device@
Extension number: @127@
Required extensions: 'VK_KHR_external_memory'.
** Required extensions: 'VK_KHR_external_memory'.
# INLINE _VK_EXT_Q... | # OPTIONS_HADDOCK not - home #
# LANGUAGE PatternSynonyms #
module Graphics.Vulkan.Ext.VK_EXT_queue_family_foreign
* Vulkan extension : @VK_EXT_queue_family_foreign@
contact : @Chad Versace @chadversary@
VK_EXT_QUEUE_FAMILY_FOREIGN_SPEC_VERSION,
pattern VK_EXT_QUEUE_FAMILY_FOREIGN_SPEC_VERSION,
... |
6888c8a702f9fc4d64ec670ef1b278ee23ba28e6411836f5bb8558e27f161293 | lpgauth/shackle | shackle_queue.erl | -module(shackle_queue).
-include("shackle_internal.hrl").
-compile(inline).
-compile({inline_size, 512}).
%% internal
-export([
add/5,
clear/2,
delete/1,
new/1,
remove/3,
table_name/1
]).
%% internal
-spec add(table(), server_id(), external_request_id(), cast(), reference()) ->
ok.
add(T... | null | https://raw.githubusercontent.com/lpgauth/shackle/a498ef0fde4808fa71fd5fe1404543475aaf7043/src/shackle_queue.erl | erlang | internal
internal
private | -module(shackle_queue).
-include("shackle_internal.hrl").
-compile(inline).
-compile({inline_size, 512}).
-export([
add/5,
clear/2,
delete/1,
new/1,
remove/3,
table_name/1
]).
-spec add(table(), server_id(), external_request_id(), cast(), reference()) ->
ok.
add(Table, ServerId, ExtReque... |
ed6c3f34fd227b531ef6fa17af429ba67c38d881ac240fa30f669db96c278094 | inaka/erlang_guidelines | record_placement.erl | -module(record_placement).
-export([good/0, bad/0]).
-record(good, { this_record :: any()
, appears :: any()
, before :: any()
, the_functions :: any()}).
good() -> [#good{}].
-record(bad, { this_record :: any()
, appears :: any()
... | null | https://raw.githubusercontent.com/inaka/erlang_guidelines/7a802a23a08d120db7e94115b4600b26194dd242/src/record_placement.erl | erlang | -module(record_placement).
-export([good/0, bad/0]).
-record(good, { this_record :: any()
, appears :: any()
, before :: any()
, the_functions :: any()}).
good() -> [#good{}].
-record(bad, { this_record :: any()
, appears :: any()
... | |
9c1194cca88a342e951ce9ee7ebec913dd75d73ff22e292d9aaf45f1988117af | eshamster/watson | export.lisp | (defpackage :watson/t/definer/export
(:use #:cl
#:rove
#:watson/definer/export)
(:import-from #:watson/env/environment
#:with-cloned-wenvironment
#:wsymbol-export
#:intern.wat)
(:import-from #:watson/env/reserved-word
#:|export|
... | null | https://raw.githubusercontent.com/eshamster/watson/0525f4a657298cec74121162c3cd3dec953c7a25/t/definer/export.lisp | lisp | (defpackage :watson/t/definer/export
(:use #:cl
#:rove
#:watson/definer/export)
(:import-from #:watson/env/environment
#:with-cloned-wenvironment
#:wsymbol-export
#:intern.wat)
(:import-from #:watson/env/reserved-word
#:|export|
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.