_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 |
|---|---|---|---|---|---|---|---|---|
8974feea26ea1feab8b5fadf9debf2afe0f7f2216312c9fd50b7cfa7e30609e6 | fhur/regie | core_test.clj | (ns regie.core-test
(:require [clojure.test :refer :all]
[regie.core :refer [regie matches? regie-digits regie-lower-case-english-letters n-or-more]]))
(def random-seed 0xc0de)
(def random-string
"random-string [size]
Returns a random string of the given size. If no size is
given then a random siz... | null | https://raw.githubusercontent.com/fhur/regie/965cdae8ae63423ed5bea59fe267da949193d47a/test/regie/core_test.clj | clojure | (ns regie.core-test
(:require [clojure.test :refer :all]
[regie.core :refer [regie matches? regie-digits regie-lower-case-english-letters n-or-more]]))
(def random-seed 0xc0de)
(def random-string
"random-string [size]
Returns a random string of the given size. If no size is
given then a random siz... | |
8762519bc4027e2aff744aaf54614259483bed3cc2c453b01a1cd63f2c142b27 | avsm/mirage-duniverse | handshake_client.ml | open Nocrypto
open Utils
open Core
open State
open Handshake_common
open Config
let (<+>) = Cs.(<+>)
let default_client_hello config =
let host = match config.peer_name with
| None -> []
| Some x -> [`Hostname x]
in
let version = max_protocol_version config.protocol_versions in
let signature_algos... | null | https://raw.githubusercontent.com/avsm/mirage-duniverse/983e115ff5a9fb37e3176c373e227e9379f0d777/ocaml_modules/tls/lib/handshake_client.ml | ocaml | TODO: get rid of this...
TODO: respect cas, maybe multiple client certificates?
Tracing.cs ~tag:"master-secret" master_secret;
I'm pretty sure this can be an assert false | open Nocrypto
open Utils
open Core
open State
open Handshake_common
open Config
let (<+>) = Cs.(<+>)
let default_client_hello config =
let host = match config.peer_name with
| None -> []
| Some x -> [`Hostname x]
in
let version = max_protocol_version config.protocol_versions in
let signature_algos... |
c26b22ee7c0e01d4c4b354f8eea654c4bb16ec94a5a2e6d32d0b9c532a09d22e | igrishaev/pact | comp_future.clj | (ns pact.comp-future
(:refer-clojure :exclude [future])
(:require
[pact.core :as p])
(:import
java.util.function.Function
java.util.function.Supplier
java.util.concurrent.CompletableFuture))
(extend-protocol p/IPact
CompletableFuture
(-then [this func]
(.thenApply this (reify Function
... | null | https://raw.githubusercontent.com/igrishaev/pact/fe084b86bfb0d3d1f6bcfdff8fc3e5217d046fe9/src/pact/comp_future.clj | clojure | (ns pact.comp-future
(:refer-clojure :exclude [future])
(:require
[pact.core :as p])
(:import
java.util.function.Function
java.util.function.Supplier
java.util.concurrent.CompletableFuture))
(extend-protocol p/IPact
CompletableFuture
(-then [this func]
(.thenApply this (reify Function
... | |
4a5d3132ead879cf2808048844806e47e1568a19d21bce8f88a48632269d4281 | kumarshantanu/quiddity | core.cljc | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file LICENSE at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the ... | null | https://raw.githubusercontent.com/kumarshantanu/quiddity/834f8fe18194f1038909211e0e55464535f68c47/src/quiddity/core.cljc | 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 LICENSE at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this ... | Copyright ( c ) . All rights reserved .
(ns quiddity.core
"Core evaluation functions."
(:require
[quiddity.internal :as i])
#?(:clj (:import
[clojure.lang IDeref])))
(defn env-get
"Look up the given key in a collection of supplied maps, and return the value. Absence of the key in all m... |
123c7dfe4a85a5716fe50e4b6c943cd8554ca58ce08c7f81fa230e7cb65f7dd6 | litaocheng/erl-test | msgflood.erl | %%%
%%% server start:
$ erl -sname srv
%%% > msgflood:server(flood).
%%%
%%% client start:
%%% $ erl -sname client
> msgflood : client(srv@litao , flood ) .
%%%
-module(msgflood).
-compile([export_all]).
%% 启动server
server(Server) ->
true = is_alive(),
register(Server, spawn_link(?MODULE, srv_loop, [self()... | null | https://raw.githubusercontent.com/litaocheng/erl-test/893679fccb1c16dda45d40d2b9e12d78db991b8a/msgflood/msgflood.erl | erlang |
server start:
> msgflood:server(flood).
client start:
$ erl -sname client
启动server
启动client(节点内)
启动client(节点间)
Server ! <<"hello">>, | $ erl -sname srv
> msgflood : client(srv@litao , flood ) .
-module(msgflood).
-compile([export_all]).
server(Server) ->
true = is_alive(),
register(Server, spawn_link(?MODULE, srv_loop, [self()])),
io:format("Server ~p is running (from ~p)...~n", [Server, self()]),
receive
complete ->
... |
40b0f46a5dd1d7a8f322fe0a4090b010189001b0a52070b4404d96fa22cb4abe | haskell/hackage-server | Parsers.hs | # , OverloadedStrings , TupleSections #
module Distribution.Server.Features.Browse.Parsers
( Condition(..)
, DeprecatedOption(..)
, Filter(..)
, Operator(..)
, conditions
, condsToFiltersAndTerms
, filterOrSearchTerms
, operatorToFunction
, searchTerms
) where
import Prelude hiding (Ordering(..),... | null | https://raw.githubusercontent.com/haskell/hackage-server/a22f92d8df358707d7755630e61df9ab8ae7bba8/src/Distribution/Server/Features/Browse/Parsers.hs | haskell | Whether the 'not' operator can be used.
(used to prevent recursive parsing)
The search engine accepts terms with spaces or parenthesis in them also but
we do not allow that, just to keep this parser simple.
Average month length
Average year length | # , OverloadedStrings , TupleSections #
module Distribution.Server.Features.Browse.Parsers
( Condition(..)
, DeprecatedOption(..)
, Filter(..)
, Operator(..)
, conditions
, condsToFiltersAndTerms
, filterOrSearchTerms
, operatorToFunction
, searchTerms
) where
import Prelude hiding (Ordering(..),... |
6f7a9395cb1cefd50886a1de3f43af0ddf8b800017ade004f3fd484203e03b02 | huangz1990/SICP-answers | assertions.scm | ;;; ----------------------------------------------------------------------
Copyright 2007 - 2009 .
;;; ----------------------------------------------------------------------
;;; This file is part of Test Manager.
;;;
;;; Test Manager is free software; you can redistribute it and/or modify
it under the terms of t... | null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp2/code/test-manager/assertions.scm | scheme | ----------------------------------------------------------------------
----------------------------------------------------------------------
This file is part of Test Manager.
Test Manager is free software; you can redistribute it and/or modify
(at your option) any later version.
Test Manager is distributed ... | Copyright 2007 - 2009 .
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
(define (ensure-forced object)
(if (promise? object)
(force object)
... |
7b96a925904e84c9eb58222995e4bcece536a9e9701fc3f3270e089083228d4f | mwmitchell/flux | cloud.clj | (ns flux.cloud
(:import [org.apache.solr.client.solrj.impl CloudSolrClient$Builder]))
(defn create
([zk-hosts]
(CloudSolrClient$Builder. zk-hosts))
([zk-hosts default-collection]
(let [client (create zk-hosts)]
(.setDefaultCollection client default-collection)
client))) | null | https://raw.githubusercontent.com/mwmitchell/flux/855101681cf3c8953cd9607c2287a5b4c282a84e/src/flux/cloud.clj | clojure | (ns flux.cloud
(:import [org.apache.solr.client.solrj.impl CloudSolrClient$Builder]))
(defn create
([zk-hosts]
(CloudSolrClient$Builder. zk-hosts))
([zk-hosts default-collection]
(let [client (create zk-hosts)]
(.setDefaultCollection client default-collection)
client))) | |
eba384fee99614083a8502e55ceb735c033bb4f102fd129bf73e0b37c05a8aae | morpheusgraphql/morpheus-graphql | UnionType.hs | {-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TypeFamilies #
module Feature.Inference.UnionType
( api,
)
where
import Data.Morpheus.Server (interpreter)
import Data.Morpheus.Server.Resolvers (ResolverQ)
import Data.Morpheus.Server.Types
( GQLRequest,
... | null | https://raw.githubusercontent.com/morpheusgraphql/morpheus-graphql/0d7ec120df4ea3b1e030f64ed9820a8a66de7d6a/morpheus-graphql-server/test/Feature/Inference/UnionType.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE OverloadedStrings # | # LANGUAGE DeriveGeneric #
# LANGUAGE TypeFamilies #
module Feature.Inference.UnionType
( api,
)
where
import Data.Morpheus.Server (interpreter)
import Data.Morpheus.Server.Resolvers (ResolverQ)
import Data.Morpheus.Server.Types
( GQLRequest,
GQLResponse,
GQLType (..),
RootResolver (..),
Undefin... |
909cf2668114ffbe979aefe59b39f0ca6c471c5d3825bfbf55d60f84ab77fd2d | eholk/harlan | M9.scm | (library
(harlan middle languages M9)
(export M9 unparse-M9
M9.1 unparse-M9.1
M9.2 unparse-M9.2
M9.2.1 unparse-M9.2.1
M9.2.2 unparse-M9.2.2
M9.3 unparse-M9.3)
(import
(rnrs)
(nanopass)
(only (elegant-weapons helpers) binop? scalar-type? relop... | null | https://raw.githubusercontent.com/eholk/harlan/3afd95b1c3ad02a354481774585e866857a687b8/harlan/middle/languages/M9.scm | scheme | push e2 with type t onto e0 + e1
like begin, bit doesn't conflict with the existing | (library
(harlan middle languages M9)
(export M9 unparse-M9
M9.1 unparse-M9.1
M9.2 unparse-M9.2
M9.2.1 unparse-M9.2.1
M9.2.2 unparse-M9.2.2
M9.3 unparse-M9.3)
(import
(rnrs)
(nanopass)
(only (elegant-weapons helpers) binop? scalar-type? relop... |
aeabfdb2bc9dda970161edae76d4e73bc99214442f8e8e4e6c64a01fd6048f90 | nasa/Common-Metadata-Repository | config.clj | (ns cmr.metadata-db.config
"Contains functions to retrieve metadata db specific configuration"
(:require
[cmr.common.concepts :as concepts]
[cmr.common.config :as cfg :refer [defconfig]]
[cmr.oracle.config :as oracle-config]
[cmr.oracle.connection :as conn]
[cmr.message-queue.config :as rmq-conf]))
... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/ef1fdf1dd6e90a5e686a324a4c905e04ba0b8cad/metadata-db-app/src/cmr/metadata_db/config.clj | clojure | This value is set via profiles.clj in dev-system | (ns cmr.metadata-db.config
"Contains functions to retrieve metadata db specific configuration"
(:require
[cmr.common.concepts :as concepts]
[cmr.common.config :as cfg :refer [defconfig]]
[cmr.oracle.config :as oracle-config]
[cmr.oracle.connection :as conn]
[cmr.message-queue.config :as rmq-conf]))
... |
314c91dfae84221f9ed1773d6912989377d2ae3864ec98c734dbc99014167a65 | purescript/purescript | Layout.hs | -- |
-- ## High-Level Summary
--
-- This section provides a high-level summary of this file. For those who
-- know more about compiler-development, the below explanation is likely enough.
-- For everyone else, see the next section.
--
-- The parser itself is unaware of indentation, and instead only parses explicit
de... | null | https://raw.githubusercontent.com/purescript/purescript/10609242a269b4409fb7d4571fc905cd9fc999cb/src/Language/PureScript/CST/Layout.hs | haskell | |
## High-Level Summary
This section provides a high-level summary of this file. For those who
know more about compiler-development, the below explanation is likely enough.
For everyone else, see the next section.
The parser itself is unaware of indentation, and instead only parses explicit
This is convenient ... | delimiters which are inserted by this layout algorithm ( much like ) .
indentation rules . has a few problematic productions which make it
additional ( and somewhat contentious ) parser error side condition . PureScript
SomeType syntax in declarations ) , but it does have a few gotchas of it 's own .
comple... |
a0d88160250a032892e875cb21501191c916e42314fe3209eff62055ad021e7e | astrada/ocaml-extjs | ext_Error.ml | class type t =
object('self)
method toString : Js.js_string Js.t Js.meth
end
class type configs =
object('self)
end
class type events =
object
end
class type statics =
object
method ignore : bool Js.t Js.prop
method notify : bool Js.t Js.prop
method handle : 'self Js.t -> unit Js.meth
... | null | https://raw.githubusercontent.com/astrada/ocaml-extjs/77df630a75fb84667ee953f218c9ce375b3e7484/lib/ext_Error.ml | ocaml | class type t =
object('self)
method toString : Js.js_string Js.t Js.meth
end
class type configs =
object('self)
end
class type events =
object
end
class type statics =
object
method ignore : bool Js.t Js.prop
method notify : bool Js.t Js.prop
method handle : 'self Js.t -> unit Js.meth
... | |
7035b9eb615077cab7a95f406d87ffd396a74d5638ebc9f4a37dd535f8521fce | KMahoney/kuljet | QueryBuilder.hs | module Database.QueryBuilder
( Expression(..)
, Source(..)
, Query(..)
, Settings(..)
, Order(..)
, buildSqLite
, buildSqLiteExpression
, queryTable
, collectPlaceholders
, columnNames
, applyFilter
, applyOrder
, applyProject
, applyNatJoin
, applyJoin
, applyLimit
, toSql
) where
... | null | https://raw.githubusercontent.com/KMahoney/kuljet/01e32aefd9e59a914c87bde52d5d6660bdea283d/kuljet/src/Database/QueryBuilder.hs | haskell | module Database.QueryBuilder
( Expression(..)
, Source(..)
, Query(..)
, Settings(..)
, Order(..)
, buildSqLite
, buildSqLiteExpression
, queryTable
, collectPlaceholders
, columnNames
, applyFilter
, applyOrder
, applyProject
, applyNatJoin
, applyJoin
, applyLimit
, toSql
) where
... | |
d6fc2723934f9fd1da7b37613e0ee50372935adaa6ff2d7d6175774686b54e0e | haskell/win32 | Win32.hs | # LANGUAGE CPP #
|
Module : Media . Win32
Copyright : 2012 shelarcy
License : BSD - style
Maintainer :
Stability : Provisional
Portability : Non - portable ( Win32 API )
Multimedia API . TODO : provide more functions ...
Module :... | null | https://raw.githubusercontent.com/haskell/win32/e6c0c0f44f6dfc2f8255fc4a5017f4ab67cd0242/Media/Win32.hs | haskell | # LANGUAGE CPP #
|
Module : Media . Win32
Copyright : 2012 shelarcy
License : BSD - style
Maintainer :
Stability : Provisional
Portability : Non - portable ( Win32 API )
Multimedia API . TODO : provide more functions ...
Module :... | |
3bc01c9af418aabbb626a9cb1dc2d0a4556298d75845a8e58c076a1af9d432fb | haskell/cabal | Lib.hs | module Lib where
foreign import javascript foo :: IO ()
| null | https://raw.githubusercontent.com/haskell/cabal/78be2d51faf70f84d30e660af367c25ac23ed1c8/cabal-testsuite/PackageTests/JS/JsSources/srcJS/Lib.hs | haskell | module Lib where
foreign import javascript foo :: IO ()
| |
5d14cdc12135261d81aca15da7ffbbb52c9f44a940a38978504191c4857aac48 | ragkousism/Guix-on-Hurd | fpga.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2016 < >
Copyright © 2016 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; ei... | null | https://raw.githubusercontent.com/ragkousism/Guix-on-Hurd/e951bb2c0c4961dc6ac2bda8f331b9c4cee0da95/gnu/packages/fpga.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2016 < >
Copyright © 2016 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages fpga)
#:use-module ((guix licenses) #:prefix license:)
... |
84219ad534f7381311e034b4be49b5fdcfa332ef30ae0f5fab8b16af505c3d07 | clojupyter/clojupyter | unlink_actions.clj | (ns clojupyter.install.conda.unlink-actions
"The functions in this namespace are used to remove Clojupyter from an end-user machine on which
it is installed using `conda install`. Under normal circumstances it is never used by the user
directly, but is called by the Conda installer as part of the removal procedu... | null | https://raw.githubusercontent.com/clojupyter/clojupyter/b54b30b5efa115937b7a85e708a7402bd9efa0ab/src/clojupyter/install/conda/unlink_actions.clj | clojure | ----------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------- | (ns clojupyter.install.conda.unlink-actions
"The functions in this namespace are used to remove Clojupyter from an end-user machine on which
it is installed using `conda install`. Under normal circumstances it is never used by the user
directly, but is called by the Conda installer as part of the removal procedu... |
9fd3a6670c61fb44aa2fe115bb9757c3f4b74424395f9bc83231a35a1f846417 | alanforr/complex | bms.clj | (ns bms
(:require [criterium.core :as c])
(:use [complex.core]
[clojure.test]))
(def c1 (complex 1 2))
(def c2 (complex 2 4))
c1
c2
(c/bench (dotimes [_ 1000] (+ c1 c2)))
(c/bench (dotimes [_ 1000] (+ c1 c2 2)))
(c/bench (dotimes [_ 1000] (+ c1 c2 2 c1 c1 c1)))
(c/bench (dotimes [_ 1000] (+ c1 c2 2 c1 c1 ... | null | https://raw.githubusercontent.com/alanforr/complex/3cdd2d5c9c95454cc549b217acc368cc76f2416b/test/bms.clj | clojure | (ns bms
(:require [criterium.core :as c])
(:use [complex.core]
[clojure.test]))
(def c1 (complex 1 2))
(def c2 (complex 2 4))
c1
c2
(c/bench (dotimes [_ 1000] (+ c1 c2)))
(c/bench (dotimes [_ 1000] (+ c1 c2 2)))
(c/bench (dotimes [_ 1000] (+ c1 c2 2 c1 c1 c1)))
(c/bench (dotimes [_ 1000] (+ c1 c2 2 c1 c1 ... | |
c30058c0e08a2ecfb71688084bd66919ec53f8719f91d0e0019a30aa944442de | input-output-hk/cardano-sl | CLI.hs | {- | The module which contains parsing facilities for
the CLI options passed to this edge node.
-}
module Cardano.Wallet.Server.CLI where
import Universum
import Data.Time.Units (Minute)
import Data.Version (showVersion)
import Options.Applicative (Parser, auto, execParser... | null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/wallet/src/Cardano/Wallet/Server/CLI.hs | haskell | | The module which contains parsing facilities for
the CLI options passed to this edge node.
| The options parsed from the CLI when starting up this wallet node.
This umbrella data type includes the node-specific options for this edge node
plus the wallet backend specific options.
| DB-specific options.
^ W... | module Cardano.Wallet.Server.CLI where
import Universum
import Data.Time.Units (Minute)
import Data.Version (showVersion)
import Options.Applicative (Parser, auto, execParser, footerDoc,
fullDesc, header, help, helper, info, infoOption, long,
... |
a72e30c4199fab76b223b23e317260ff42b751b019b6a813d85919e33cbc4882 | mirage/xentropyd | writeBufferStream.mli |
* Copyright ( C ) Citrix Systems Inc.
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AN... | null | https://raw.githubusercontent.com/mirage/xentropyd/4705bb2f6c10ae84f842a5c39cd8a513ea8c761a/core/writeBufferStream.mli | ocaml | * [attach stream buffer] return a buffered READABLE layered on top of
[stream]. Data buffers read from here will be buffered, and only flushed
to the underlying stream when [advance] is called.
This call does not initialise [buffer].
* [create stream buffer] return a buffered READABLE layered on top... |
* Copyright ( C ) Citrix Systems Inc.
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AN... |
faab82f228a12cb5158037d16645efea3f5824c57beb54dccbb112c084730ef1 | nitrogen/NitrogenProject.com | website_config_handler.erl | Nitrogen Web Framework for Erlang
Copyright ( c ) 2008 - 2010
See MIT - LICENSE for licensing information .
-module (website_config_handler).
-include_lib ("nitrogen_core/include/wf.hrl").
-behaviour (config_handler).
-export ([
init/2,
finish/2,
get_value/4,
get_values/4
]).
init(_Config, _... | null | https://raw.githubusercontent.com/nitrogen/NitrogenProject.com/b4b3a0dbe17394608d2ee6eaa089e3ece1285075/src/website_config_handler.erl | erlang | Nitrogen Web Framework for Erlang
Copyright ( c ) 2008 - 2010
See MIT - LICENSE for licensing information .
-module (website_config_handler).
-include_lib ("nitrogen_core/include/wf.hrl").
-behaviour (config_handler).
-export ([
init/2,
finish/2,
get_value/4,
get_values/4
]).
init(_Config, _... | |
8c79099bac6f7fa1c9ed77b3112a58f3581e5977fda8602da9cb46acf83cfe39 | tek/chiasma | TmuxClient.hs | module Chiasma.Interpreter.TmuxClient where
import Conc (interpretAtomic)
import Data.Sequence ((|>))
import qualified Data.Text as Text
import Exon (exon)
import qualified Log as Log
import Path (Abs, File, Path, relfile, toFilePath)
import Polysemy.Process.Interpreter.Process (ProcessQueues)
import qualified Process... | null | https://raw.githubusercontent.com/tek/chiasma/777e53aa081b8db02ffc0b1442666def7561a59f/packages/chiasma/lib/Chiasma/Interpreter/TmuxClient.hs | haskell | module Chiasma.Interpreter.TmuxClient where
import Conc (interpretAtomic)
import Data.Sequence ((|>))
import qualified Data.Text as Text
import Exon (exon)
import qualified Log as Log
import Path (Abs, File, Path, relfile, toFilePath)
import Polysemy.Process.Interpreter.Process (ProcessQueues)
import qualified Process... | |
5183566ed92b4129e6ea6e099a07426591c0a6473f11f9c427f1c8ebfdc1f631 | funkywork/nightmare | parser.ml | MIT License
Copyright ( c ) 2023 funkywork
Permission is hereby granted , free of charge , to any person obtaining a copy
of this software and associated documentation files ( the " Software " ) , to deal
in the Software without restriction , including without limitation the rights
to... | null | https://raw.githubusercontent.com/funkywork/nightmare/05858823d01925cb8cb02a6b29ed8a223822a0e8/lib/service/parser.ml | ocaml | MIT License
Copyright ( c ) 2023 funkywork
Permission is hereby granted , free of charge , to any person obtaining a copy
of this software and associated documentation files ( the " Software " ) , to deal
in the Software without restriction , including without limitation the rights
to... | |
7ad5c099e7bdd5378f62cc4580ffe0d7d6ea1dfebed6cacd7b0fd0bf0c205cbf | xapi-project/xen-api | test_bios_strings.ml | (** This module tests the dmidecode processing
*)
open Bios_strings
let load_test_data file =
Xapi_stdext_unix.Unixext.string_of_file @@ "test_data/" ^ file
let baseboard_two_string = load_test_data "bios_baseboard_two.dmidecode"
let baseboard_two_record =
[
{
name= "Base Board Information"
; valu... | null | https://raw.githubusercontent.com/xapi-project/xen-api/e984d34bd9ff60d7224a841270db0fe1dfe42e7a/ocaml/tests/test_bios_strings.ml | ocaml | * This module tests the dmidecode processing
| open Bios_strings
let load_test_data file =
Xapi_stdext_unix.Unixext.string_of_file @@ "test_data/" ^ file
let baseboard_two_string = load_test_data "bios_baseboard_two.dmidecode"
let baseboard_two_record =
[
{
name= "Base Board Information"
; values=
[
("Manufacturer", "TestA Inc... |
dee228fad4bfc68731e24629da4ddd9a0b8ac7faecc4967a0fe513a16ff86b51 | racket/racket7 | search.rkt | #lang racket/base
(require "../common/range.rkt"
"regexp.rkt"
"lazy-bytes.rkt"
"interp.rkt"
"../analyze/must-string.rkt")
(provide search-match)
;; ------------------------------------------------------------
;; The driver iterates through the input (unless the pattern is
;; anchor... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/src/regexp/match/search.rkt | racket | ------------------------------------------------------------
The driver iterates through the input (unless the pattern is
anchored) to find a match
------------------------------------------------------------------
Checking for a must string (before iterating though the input) can
speed up a match failure by avoi... | #lang racket/base
(require "../common/range.rkt"
"regexp.rkt"
"lazy-bytes.rkt"
"interp.rkt"
"../analyze/must-string.rkt")
(provide search-match)
(define (search-match rx in pos start-pos end-pos state)
(define must-string (rx:regexp-must-string rx))
(cond
[(not (check-must-... |
ab22f382c1861f609400cd5b5841502fc3dda14c3eda4f4193955727e5a0962f | robert-stuttaford/bridge | edit.clj | (ns bridge.data.edit
(:require [bridge.data.datomic :as datomic]
[bridge.data.string :as data.string]
[clojure.spec.alpha :as s]
[clojure.string :as str]))
(require 'bridge.data.edit.spec)
(defmulti check-custom-validation
(fn [db {:field/keys [attr]}]
attr))
(defmethod ch... | null | https://raw.githubusercontent.com/robert-stuttaford/bridge/867d81354457c600cc5c25917de267a8e267c853/src/bridge/data/edit.clj | clojure | (ns bridge.data.edit
(:require [bridge.data.datomic :as datomic]
[bridge.data.string :as data.string]
[clojure.spec.alpha :as s]
[clojure.string :as str]))
(require 'bridge.data.edit.spec)
(defmulti check-custom-validation
(fn [db {:field/keys [attr]}]
attr))
(defmethod ch... | |
d116818bbc674df152eaff122867d819683a7dcbfb46d1361c6e912d6560d4e3 | OCamlPro/alt-ergo | arith.ml | (******************************************************************************)
(* *)
(* The Alt-Ergo theorem prover *)
Copyright ( C ) 2006 - 2013 ... | null | https://raw.githubusercontent.com/OCamlPro/alt-ergo/695466427b5c3d48e92e90485b12c130c2bce2c1/src/lib/reasoners/arith.ml | ocaml | ****************************************************************************
The Alt-Ergo theorem prover
... | Copyright ( C ) 2006 - 2013
... |
898f380ae8acf5ce1531f02d5bd584772645b09883855d6df2581f80bf293f0a | ftovagliari/ocamleditor | editor_dialog.ml |
OCamlEditor
Copyright ( C ) 2010 - 2014
This file is part of OCamlEditor .
OCamlEditor is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at y... | null | https://raw.githubusercontent.com/ftovagliari/ocamleditor/53284253cf7603b96051e7425e85a731f09abcd1/src/editor_dialog.ml | ocaml | * file_select
* confirm_close
* save_modified
* file_open |
OCamlEditor
Copyright ( C ) 2010 - 2014
This file is part of OCamlEditor .
OCamlEditor is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at y... |
cd4821f9a22ed1b075c67b3e8d724b441a5079b6810cceb9fcb99fc6b0af5e46 | ocsigen/eliomlang | el_desugar.ml | open Parsetree
open Ast_helper
module AM = Ast_mapper
module AC = Ast_convenience
open El_utils
(**
Replace shared expression by the equivalent pair.
[ [%share
let x = ... %s ... in
[%client ... %x ... ]
] ]
≡
[ let x = ... s ... in
[%client ... %x ... ]
,
[%client
... | null | https://raw.githubusercontent.com/ocsigen/eliomlang/42e55856574e058caca191e50edcb0023900b664/lib/el_desugar.ml | ocaml | *
Replace shared expression by the equivalent pair.
[ [%share
let x = ... %s ... in
[%client ... %x ... ]
] ]
≡
[ let x = ... s ... in
[%client ... %x ... ]
,
[%client
let x = ... %s ... in
... x ...
]
]
[%shared ... ]
| Pstr_module _
| Pstr_rec... | open Parsetree
open Ast_helper
module AM = Ast_mapper
module AC = Ast_convenience
open El_utils
module Shared = struct
type 'a t = { client : 'a ; server : 'a }
let server = object
inherit [_] Ppx_core.Ast_traverse.map_with_context as super
method! expression ctx expr = match expr with
| [%expr [... |
732756f6b28695cc12553d6a3e384d823742d2b94eb450e783dc2a8d20f8e044 | FreeProving/free-compiler | DefineDeclPass.hs | -- | This module contains passes for inserting data type, constructor and
-- type synonym declarations as well as function declarations into the
-- environment.
--
-- Subsequent passes can still modify entries added by this pass.
-- For example, which effects are used by which functions is determined
after ... | null | https://raw.githubusercontent.com/FreeProving/free-compiler/6931b9ca652a185a92dd824373f092823aea4ea9/src/lib/FreeC/Pass/DefineDeclPass.hs | haskell | | This module contains passes for inserting data type, constructor and
type synonym declarations as well as function declarations into the
environment.
Subsequent passes can still modify entries added by this pass.
For example, which effects are used by which functions is determined
= Specification
... | after this pass ( see " . EffectAnalysisPass " ) .
module FreeC.Pass.DefineDeclPass ( defineTypeDeclsPass, defineFuncDeclsPass ) where
import Data.Maybe ( fromJust )
import FreeC.Environment.Entry
import FreeC.Environment.Renamer
import FreeC.IR.Depe... |
e63dbe758b91670d3af518cef6ab555484cb02529b4f4a22fd7022aea2fe588c | markus-git/co-feldspar | Monad.hs | # language GADTs #
# language TypeOperators #
# language DataKinds #
{-# language ScopedTypeVariables #-}
{-# language TypeFamilies #-}
# language FlexibleInstances #
{-# language FlexibleContexts #-}
# language MultiParamTypeClasses #
# language PolyKinds #
# language GeneralizedNewtypeDeriving #
# language BangPatter... | null | https://raw.githubusercontent.com/markus-git/co-feldspar/bf598c803d41e03ed894bbcb490da855cce9250e/src/Feldspar/Verify/Monad.hs | haskell | # language ScopedTypeVariables #
# language TypeFamilies #
# language FlexibleContexts #
------------------------------------------------------------------------------
* Verification monad.
------------------------------------------------------------------------------
Based on -edsl/blob/master/src/Language/Embedded/... | # language GADTs #
# language TypeOperators #
# language DataKinds #
# language FlexibleInstances #
# language MultiParamTypeClasses #
# language PolyKinds #
# language GeneralizedNewtypeDeriving #
# language BangPatterns #
module Feldspar.Verify.Monad where
import Control.Monad.RWS.Strict
import Control.Monad.Except... |
778a6cebfa623e9ee83567561872de0b20027997749352693b264d3375dafc6b | sonyxperiadev/dataflow | RendererSpec.hs | module DataFlow.Graphviz.RendererSpec where
import Test.Hspec
import DataFlow.Graphviz
import DataFlow.Graphviz.Renderer
spec :: Spec
spec =
describe "renderGraphviz" $ do
it "renders digraph id" $
renderGraphviz (Digraph "g" []) `shouldBe` "digraph g {\n}\n"
it "renders digraph with a node stmt" $... | null | https://raw.githubusercontent.com/sonyxperiadev/dataflow/8bef5bd6bf96a918197e66ad9d675ff8cd2a4e33/test/DataFlow/Graphviz/RendererSpec.hs | haskell | module DataFlow.Graphviz.RendererSpec where
import Test.Hspec
import DataFlow.Graphviz
import DataFlow.Graphviz.Renderer
spec :: Spec
spec =
describe "renderGraphviz" $ do
it "renders digraph id" $
renderGraphviz (Digraph "g" []) `shouldBe` "digraph g {\n}\n"
it "renders digraph with a node stmt" $... | |
496ea4df42ddcc28e187145932606041551b62423db0a7cf3b5f4e840d1bb345 | pjotrp/guix | ebook.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2015 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 3 of the Lice... | null | https://raw.githubusercontent.com/pjotrp/guix/96250294012c2f1520b67f12ea80bfd6b98075a2/gnu/packages/ebook.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2015 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages ebook)
#:use-module ((guix licenses) #:select (gpl3 lgpl2.1+))
#:use-module (guix... |
dcbc2e8af52718e09b03fbb23366bddc029afa5d09fda727c03ecbf73cf7db55 | project-oak/hafnium-verification | cMethod_trans.ml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/clang/cMethod_trans.ml | ocaml | Gets the class name from a method signature found by clang, if search is successful
Get class name from a method call accorsing to the info given by the receiver kind
* Returns a list of the indices of expressions in [args] which point to const-typed values. Each
index is offset by [shift].
* Creates a proced... |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
54e0a9d4d771fbb96811beb01269b9934e63f03cb369de8cd02659ade7eb63ba | awslabs/s2n-bignum | bignum_double_sm2.ml |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
(* =================================================================... | null | https://raw.githubusercontent.com/awslabs/s2n-bignum/6b53f075a0e28e6b89db12301de5f59ec788855c/arm/proofs/bignum_double_sm2.ml | ocaml | =========================================================================
Doubling modulo p_sm2, the field characteristic for the CC SM2 curve.
=========================================================================
*** print_literal_from_elf "arm/sm2/bignum_double_sm2.o";;
***
---------------------------... |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
let bignum_double_sm2_mc = define_assert_from_elf "bignum_double_s... |
133ddb15fd65302d9c05898d1548cfa385c9a428ac365bc3b1322394631edbe1 | ocaml-multicore/reagents | offer.ml |
* Copyright ( c ) 2015 , < >
* Copyright ( c ) 2015 , < >
*
* Permission to use , copy , modify , and/or distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE S... | null | https://raw.githubusercontent.com/ocaml-multicore/reagents/6721db78b21028c807fb13d0af0aaf9407c662b5/lib/offer.ml | ocaml |
* Copyright ( c ) 2015 , < >
* Copyright ( c ) 2015 , < >
*
* Permission to use , copy , modify , and/or distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE S... | |
1ba9eda564e54c70f216ea422045b6740a55e9ddd38aad85a9b55ada3b9f0799 | callum-oakley/advent-of-code | 16.clj | (ns aoc.2016.16
(:require
[clojure.test :refer [deftest is]]))
(defn grow [data]
(into (conj data \0) (map {\0 \1 \1 \0}) (rseq data)))
(defn checksum [data]
(if (even? (count data))
(recur (mapv (fn [[a b]] (if (= a b) \1 \0)) (partition 2 data)))
data))
(defn part-* [disk seed]
(apply str
... | null | https://raw.githubusercontent.com/callum-oakley/advent-of-code/da5233fc0fd3d3773d35ee747fd837c59c2b1c04/src/aoc/2016/16.clj | clojure | (ns aoc.2016.16
(:require
[clojure.test :refer [deftest is]]))
(defn grow [data]
(into (conj data \0) (map {\0 \1 \1 \0}) (rseq data)))
(defn checksum [data]
(if (even? (count data))
(recur (mapv (fn [[a b]] (if (= a b) \1 \0)) (partition 2 data)))
data))
(defn part-* [disk seed]
(apply str
... | |
3836668860adabf68cef265a77aa378d772be18c2110876b82c75e0652265d20 | Holworth/SICP_Solutions | exercise2-36.rkt | #lang sicp
(define (reduce op init items)
(cond ((null? items) init)
(else (op (car items)
(reduce op init (cdr items))))))
(define (reduce-n op init seqs)
(if (null? (car seqs))
nil
(cons (reduce op (car init) (map (lambda (x) (car x)) seqs))
... | null | https://raw.githubusercontent.com/Holworth/SICP_Solutions/da4041d4c48a04df7c17ea840458d8044ae6c9fb/solutions/chap2/code/exercise2-36.rkt | racket | #lang sicp
(define (reduce op init items)
(cond ((null? items) init)
(else (op (car items)
(reduce op init (cdr items))))))
(define (reduce-n op init seqs)
(if (null? (car seqs))
nil
(cons (reduce op (car init) (map (lambda (x) (car x)) seqs))
... | |
0d8418a9a012a7b4f892d214dbb140334d508657aa282931a192ccbc9be4af5d | AdRoll/rebar3_format | m1.erl | %%
%% File: m1.erl
Author : Björn - Egil Dahlberg
Created : 2014 - 10 - 24
%%
-module(m1).
-export([foo/0,bar/1,baz/2]).
foo() ->
[m2:foo(),
m2:bar()].
bar(A) ->
[m2:foo(A),
m2:bar(A),
m2:record_update(3,m2:record())].
baz(A,B) ->
[m2:foo(A,B),
m2:bar(A,B)].
| null | https://raw.githubusercontent.com/AdRoll/rebar3_format/5ffb11341796173317ae094d4e165b85fad6aa19/test_app/src/otp_samples/m1.erl | erlang |
File: m1.erl
| Author : Björn - Egil Dahlberg
Created : 2014 - 10 - 24
-module(m1).
-export([foo/0,bar/1,baz/2]).
foo() ->
[m2:foo(),
m2:bar()].
bar(A) ->
[m2:foo(A),
m2:bar(A),
m2:record_update(3,m2:record())].
baz(A,B) ->
[m2:foo(A,B),
m2:bar(A,B)].
|
0294b17c588ad77ea353bdb967aebcc24af93f44c25550096d810b46a53656bf | EmileTrotignon/embedded_ocaml_templates | transform.mli | val force_mutual_recursion : Ast.struct_ -> Ast.struct_
| null | https://raw.githubusercontent.com/EmileTrotignon/embedded_ocaml_templates/1ddee779f0410820d9e9f03150e4ae73e1deb835/src/common/mocaml/transform.mli | ocaml | val force_mutual_recursion : Ast.struct_ -> Ast.struct_
| |
e5e6778667de29d50d7433d6cb3ca969feda38f8119979a99ddb4558bc2cd16a | facebookincubator/hsthrift | SocketChannel.hs | Copyright ( c ) Facebook , Inc. and its affiliates .
-- |
An implementation of a Thrift channel in Haskell using
-- 'Network.Socket'. Note that the wire format of messages is not
-- necessarily compatible with other transports, in particular you
ca n't mix and match SocketChannel clients / servers with
HeaderC... | null | https://raw.githubusercontent.com/facebookincubator/hsthrift/d3ff75d487e9d0c2904d18327373b603456e7a01/lib/Thrift/Channel/SocketChannel.hs | haskell | |
'Network.Socket'. Note that the wire format of messages is not
necessarily compatible with other transports, in particular you
* Socket channel types and API
* Utilities used by test servers
| Given a 'SocketConfig' that specifies where to find the
server we want to reach and what protocol it uses,
connec... | Copyright ( c ) Facebook , Inc. and its affiliates .
An implementation of a Thrift channel in Haskell using
ca n't mix and match SocketChannel clients / servers with
HeaderChannel clients / servers .
# LANGUAGE CPP #
module Thrift.Channel.SocketChannel
SocketChannel(..)
, SocketConfig(..)
, withSocket... |
97d5420368737aa98311861f4b40e92db0ca0eb38c03dd8875e8a63be7d9bfcc | ninjudd/cake | version_test.clj | (ns cake.tasks.version-test
(:use clojure.test helpers
[cake.file :only [file]])
(:require [clojure.java.io :as io]))
(comment
(defn version-wrap [f]
(cake "version" "0.1.0-SNAPSHOT")
(f)
(cake "version" "0.1.0-SNAPSHOT"))
(use-fixtures :once in-test-project)
(use-fixtures :each version-wrap)
(defn... | null | https://raw.githubusercontent.com/ninjudd/cake/3a1627120b74e425ab21aa4d1b263be09e945cfd/test/old/cake/tasks/version_test.clj | clojure | (ns cake.tasks.version-test
(:use clojure.test helpers
[cake.file :only [file]])
(:require [clojure.java.io :as io]))
(comment
(defn version-wrap [f]
(cake "version" "0.1.0-SNAPSHOT")
(f)
(cake "version" "0.1.0-SNAPSHOT"))
(use-fixtures :once in-test-project)
(use-fixtures :each version-wrap)
(defn... | |
c93ff235ecd1afe233096671415c34399f5a3b07b92dfdedaa5a272bc6f15c74 | GaloisInc/daedalus | Results.hs | {-# Language ImplicitParams #-}
module Results where
import Control.Monad(forM_)
import qualified Data.Text as Text
import qualified Data.Text.IO as Text
import qualified Data.Text.Encoding as Text
import qualified Data.Set as Set
import qualified Data.Map as Map
import qualified Data.ByteString as BS
import qualified... | null | https://raw.githubusercontent.com/GaloisInc/daedalus/3f180d29441960e35386654ec79a2b205bddc157/exe/Results.hs | haskell | # Language ImplicitParams #
| Show the results of running the interpreter.
Returns `True` if successful, or `False` on parse error
$$ "----" $$ RTS.ppInputTrace x
| Show some parsed values
| Show the value of the interpreter either pretty printed or in JSON
| Show the errors either pretty printed or in JSON
Note ... | module Results where
import Control.Monad(forM_)
import qualified Data.Text as Text
import qualified Data.Text.IO as Text
import qualified Data.Text.Encoding as Text
import qualified Data.Set as Set
import qualified Data.Map as Map
import qualified Data.ByteString as BS
import qualified Data.ByteString.Char8 as BS8
im... |
dc7adccd53754d6ddf521b42fac92b2a37b29374b668b2fc291c74a772ad6515 | escherize/data-desk | config.cljs | (ns data-desk.config)
(def debug?
^boolean goog.DEBUG)
| null | https://raw.githubusercontent.com/escherize/data-desk/db3a27ed7f63bbbaa573ae7ea103e35044a0625a/src/data_desk/config.cljs | clojure | (ns data-desk.config)
(def debug?
^boolean goog.DEBUG)
| |
eb1e09f967d65900c3a00880702aecf81b30cc323c90f713a6272e0425c44bb7 | williamleferrand/accretio | ys_react.ml |
* Accretio is an API , a sandbox and a runtime for social playbooks
*
* Copyright ( C ) 2015
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 o... | null | https://raw.githubusercontent.com/williamleferrand/accretio/394f855e9c2a6a18f0c2da35058d5a01aacf6586/library/client/ys_react.ml | ocaml | I still don't have a clear understanding of what happens here, gc-wise
hook ();
hook d;
mappers, experimental, will change *
super unsafe ... |
* Accretio is an API , a sandbox and a runtime for social playbooks
*
* Copyright ( C ) 2015
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU Affero General Public License as
* published by the Free Software Foundation , either version 3 o... |
1728344148e7d6e06dfd79f6f594c8ce96845457ec9930d2dc19534c5e78ce60 | McCLIM/McCLIM | menu-frame.lisp | ;;; ---------------------------------------------------------------------------
;;; License: LGPL-2.1+ (See file 'Copyright' for details).
;;; ---------------------------------------------------------------------------
;;;
( c ) copyright 1998,1999,2000 by ( )
( c ) copyright 2000 by Iban Hatchondo ( )
(... | null | https://raw.githubusercontent.com/McCLIM/McCLIM/7c890f1ac79f0c6f36866c47af89398e2f05b343/Core/clim-core/frames/menu-frame.lisp | lisp | ---------------------------------------------------------------------------
License: LGPL-2.1+ (See file 'Copyright' for details).
---------------------------------------------------------------------------
---------------------------------------------------------------------------
Menu frame class. This clas... | ( c ) copyright 1998,1999,2000 by ( )
( c ) copyright 2000 by Iban Hatchondo ( )
( c ) copyright 2000 by ( )
( c ) copyright 2000 , 2014 by ( )
( c ) copyright 2004 by < >
( c ) copyright 2019 , 2020 Jan Moringen < >
( c ) copyright 2021 < >
(in-package #:clim-internals)
(defclas... |
884c39dee5ca27d81f68edc3b31ea05c2c1cfd169c27e21cdf953e1b95165064 | melhadad/fuf | html.lisp | ;;; -*- Mode:Lisp; Syntax:Common-Lisp; Package: FUG5 -*-
;;; -----------------------------------------------------------------------
;;; File: html.l
;;; Description: Examples for using the HTML attribute
Author :
Created : 2 Jul 1996
;;; Modified:
Package : FUG5
;;; ----------... | null | https://raw.githubusercontent.com/melhadad/fuf/57bd0e31afc6aaa03b85f45f4c7195af701508b8/examples/html.lisp | lisp | -*- Mode:Lisp; Syntax:Common-Lisp; Package: FUG5 -*-
-----------------------------------------------------------------------
File: html.l
Description: Examples for using the HTML attribute
Modified:
-----------------------------------------------------------------------
This is all very straightfor... | Author :
Created : 2 Jul 1996
Package : FUG5
(in-package "FUG5")
(format t "~%These examples should only work with SURGE 2.0.~%~
They show how to use the HTML attribute in FUF.")
of the HTML tag alt to avoid confusion with FUF 's reserved keyword alt .
(def-test t422
"<A HREF=\"\"... |
ea8d6b31d898ce4dc28ea6a687dfb202617aa394d8bb8bed4563e266cd035e86 | soegaard/web-tutorial | control.rkt | #lang racket/base
;;;
;;; CONTROL
;;;
; The interface between the web-server in "server.rkt" and the control
; is the function `dispatch`. Each time the web-server receives an request
; it is passes on to `dispatch`.
(provide dispatch)
;; Imports
(require (for-syntax racket/base)
racket/match
rac... | null | https://raw.githubusercontent.com/soegaard/web-tutorial/511a03410a440ed32475484ae93483f4ddd6656c/listit3/control.rkt | racket |
CONTROL
The interface between the web-server in "server.rkt" and the control
is the function `dispatch`. Each time the web-server receives an request
it is passes on to `dispatch`.
Imports
authenticated cookies
Bindings
get-binding
Extract a binding from the request if present and then
apply convert... | #lang racket/base
(provide dispatch)
(require (for-syntax racket/base)
racket/match
racket/promise
racket/runtime-path
web-server/dispatch/extend
web-server/servlet-env
web-server/servlet
web-server/http/redirect
web-server/http/cookie
" con... |
4e56b43457358f792fbb310dff80f3f72e4997dbedb5cf5fa9d6fdf33badf610 | jdan/ocaml-web-framework | framework.ml | type req = Http.Request.request * Router.params
type res = Http.Response.response
type route = { meth: string ;
pattern: string ;
handler: req -> res -> res ;
}
type server = { routes: route list }
let create_server () = { routes = [] }
let not_found req res =
res
|> ... | null | https://raw.githubusercontent.com/jdan/ocaml-web-framework/bfa2f240a9aecc4edbf02ab87a73cfd20da482a4/src/framework.ml | ocaml | type req = Http.Request.request * Router.params
type res = Http.Response.response
type route = { meth: string ;
pattern: string ;
handler: req -> res -> res ;
}
type server = { routes: route list }
let create_server () = { routes = [] }
let not_found req res =
res
|> ... | |
9e68caf6fc9f95e0ae66b2c5e74037a54e71e8fb70b119865627510d053cb5a5 | nachivpn/nbe-edsl | GExp.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE TypeFamilies #
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE FlexibleInstances #
module GExp where
import Prelude hiding ((<>))
import Data.Constraint (Constraint)
import Text.PrettyPrint
import Text.PrettyPrint.HughesPJClass hiding (pPrintList)
import Contr... | null | https://raw.githubusercontent.com/nachivpn/nbe-edsl/f7fdec9e1b25c3d28c9dff9ddbd2294e479e4a34/src/GExp.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE ConstraintKinds #
------------
Expressions
------------
Type aliases
Primitive types
Primitive operations
Higher-order abstract syntax for expressions
`GExp c a` is an expression of type a, where
`c` is the constraint that all type variables in the def. are subject to
e.g., `GExp ... | # LANGUAGE TypeFamilies #
# LANGUAGE PatternSynonyms #
# LANGUAGE FlexibleInstances #
module GExp where
import Prelude hiding ((<>))
import Data.Constraint (Constraint)
import Text.PrettyPrint
import Text.PrettyPrint.HughesPJClass hiding (pPrintList)
import Control.Monad.State.Lazy
import Control.Monad.Except (Except... |
02941840c8e60b52df342d342ed538230414e1932cc739efcab2cfdfe6bd1972 | ephemient/aoc2018 | Day16.hs | |
Module : Day16
Description : < Day 16 : Chronal Classification >
Module: Day16
Description: < Day 16: Chronal Classification>
-}
# LANGUAGE FlexibleContexts , RecordWildCards , TypeApplications #
module Day16 (day16a, day16b) where
import Control.Arrow ((&&&))
import Control.Monad (fol... | null | https://raw.githubusercontent.com/ephemient/aoc2018/eb0d04193ccb6ad98ed8ad2253faeb3d503a5938/src/Day16.hs | haskell | |
Module : Day16
Description : < Day 16 : Chronal Classification >
Module: Day16
Description: < Day 16: Chronal Classification>
-}
# LANGUAGE FlexibleContexts , RecordWildCards , TypeApplications #
module Day16 (day16a, day16b) where
import Control.Arrow ((&&&))
import Control.Monad (fol... | |
d0d772ee998d90afb05c0451635b3cf485e28365c4b0d675adf6559083c158fe | ocaml-multicore/parafuzz | constpromote.ml | (* TEST
* hasunix
include unix
** bytecode
** native
*)
when run with the bytecode debug runtime , this test
used to trigger a bug where the constant [ 13 ]
remained unpromoted
used to trigger a bug where the constant [13]
remained unpromoted *)
let rec burn l =
if List.hd l > 14 then ()
else bu... | null | https://raw.githubusercontent.com/ocaml-multicore/parafuzz/6a92906f1ba03287ffcb433063bded831a644fd5/testsuite/tests/parallel/constpromote.ml | ocaml | TEST
* hasunix
include unix
** bytecode
** native
|
when run with the bytecode debug runtime , this test
used to trigger a bug where the constant [ 13 ]
remained unpromoted
used to trigger a bug where the constant [13]
remained unpromoted *)
let rec burn l =
if List.hd l > 14 then ()
else burn (l @ l |> List.map (fun x -> x + 1))
let () =
igno... |
60d1a9b43674e8e4c5f754a8eb41bad3b8ce934a1fc12ee162699a74172b1558 | braidchat/braid | helpers.clj | (ns braid.core.server.routes.helpers
(:require
[braid.chat.db.user :as user]
[ring.middleware.anti-forgery :as anti-forgery]))
(defn logged-in? [req]
(when-let [user-id (get-in req [:session :user-id])]
(user/user-id-exists? user-id)))
(defn current-user [req]
(when-let [user-id (get-in req [:session ... | null | https://raw.githubusercontent.com/braidchat/braid/2e44eb6e77f1d203115f9b9c529bd865fa3d7302/src/braid/core/server/routes/helpers.clj | clojure | (ns braid.core.server.routes.helpers
(:require
[braid.chat.db.user :as user]
[ring.middleware.anti-forgery :as anti-forgery]))
(defn logged-in? [req]
(when-let [user-id (get-in req [:session :user-id])]
(user/user-id-exists? user-id)))
(defn current-user [req]
(when-let [user-id (get-in req [:session ... | |
26e41911dcce772b1c03b91077bc31ba963716e0ef9d17bba141710a46cde1dc | input-output-hk/ouroboros-network | PeerGraph.hs | # LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -Wno - orphans #
# OPTIONS_GHC -Wno - incomplete - uni - patterns #
module Test.Ouroboros.Network.PeerSelection.PeerGraph
( PeerGraph (..)
, validPeerGraph
, allPeers
, firstGossipReachablePeers
, GovernorScripts (..)
, Gossi... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/679c7da2079a5e9972a1c502b6a4d6af3eb76945/ouroboros-network/test/Test/Ouroboros/Network/PeerSelection/PeerGraph.hs | haskell |
Mock environment types
traditional adjacency representation.
| For now the information associated with each node is just the gossip
script and connection script.
| The gossip script is the script we interpret to provide answers to gossip
requests that the governor makes. After each gossip request to a peer we... | # LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -Wno - orphans #
# OPTIONS_GHC -Wno - incomplete - uni - patterns #
module Test.Ouroboros.Network.PeerSelection.PeerGraph
( PeerGraph (..)
, validPeerGraph
, allPeers
, firstGossipReachablePeers
, GovernorScripts (..)
, Gossi... |
4319949c7e006d18465741078a9e94d3715e44a49751f35e5cfbc609d7099668 | TypedLambda/eresye | relatives.erl | %
% relatives.erl
%
% -------------------------------------------------------------------------
%
%%
ERESYE , an ERlang Expert SYstem Engine
%%
Copyright ( c ) 2005 - 2010 , ,
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provide... | null | https://raw.githubusercontent.com/TypedLambda/eresye/58c159e7fbe8ebaed52018b1a7761d534b4d6119/examples/relatives.erl | erlang |
relatives.erl
-------------------------------------------------------------------------
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the abo... | ERESYE , an ERlang Expert SYstem Engine
Copyright ( c ) 2005 - 2010 , ,
* Neither the name of , may be used
THIS SOFTWARE IS PROVIDED BY AND ` ` AS
ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
DAMAGES ( INCLUDING , BUT NOT LIMITED TO , PROCUREMENT OF SUBSTITUT... |
a056533822535f8ae5320536916a072f8afaaafddede4c72b5965075c74b3ae9 | walkable-server/realworld-fulcro | article.clj | (ns conduit.boundary.article
(:require [clojure.java.jdbc :as jdbc]
[clojure.set :refer [rename-keys]]
[clojure.string :as str]
[conduit.util :as util]
[duct.database.sql]))
(def remove-article-namespace
(util/remove-namespace "article" [:title :body :slug :descripti... | null | https://raw.githubusercontent.com/walkable-server/realworld-fulcro/91c73e3a27621b528906d12bc22971caa9ea8d13/src/conduit/boundary/article.clj | clojure | (ns conduit.boundary.article
(:require [clojure.java.jdbc :as jdbc]
[clojure.set :refer [rename-keys]]
[clojure.string :as str]
[conduit.util :as util]
[duct.database.sql]))
(def remove-article-namespace
(util/remove-namespace "article" [:title :body :slug :descripti... | |
8a11d79971a742f0dbe02b175195e02dae3d4d4a1964a1a61c4f2518a18447bb | sbcl/sbcl | print.lisp | ;;;; the printer
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and is
;;;; provided wit... | null | https://raw.githubusercontent.com/sbcl/sbcl/99687ae5df60f2a273ae9f6af281ef9e0b97bd0a/src/code/print.lisp | lisp | the printer
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
exported printer control variables
(set later when pretty-printer is initialized)
routines to print objects
Same as a call to (... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB-IMPL")
(defvar *print-readably* nil
"If true, all objects will be printed readably. If readable printing... |
fde6baee80dc402918f87e3680693b0410a391343cbae3892e61e2a40796a557 | xapi-project/message-switch | storage_skeleton_test.ml |
* Copyright ( C ) Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file LI... | null | https://raw.githubusercontent.com/xapi-project/message-switch/1d0d1aa45c01eba144ac2826d0d88bb663e33101/xapi-idl/storage/storage_skeleton_test.ml | ocaml | if this type-checks then the storage_skeleton is complete |
* Copyright ( C ) Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file LI... |
6b4d2369f3b642fee262108830d9fd6b30d11d56af85bcb02038c3cdfc55cea2 | crategus/cl-cffi-gtk | rtest-gtk-builder.lisp | (def-suite gtk-builder :in gtk-suite)
(in-suite gtk-builder)
(defvar *menus*
"<interface>
<menu id='app-menu'>
<section>
<item>
<attribute name='label' translatable='yes'>_New Window</attribute>
<attribute name='action'>app.new</attribute>
<attribute name='accel'><Primary>n<... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/7f5a09f78d8004a71efa82794265f2587fff98ab/test/rtest-gtk-builder.lisp | lisp | Primary>n</attribute>
Primary>q</attribute>
Primary>c</attribute>
Primary>v</attribute>
--- Types and Values -------------------------------------------------------
GtkBuilderError
Type check
Check the registered name
Check the type initializer
Check the parent
Check the children
Check the inter... | (def-suite gtk-builder :in gtk-suite)
(in-suite gtk-builder)
(defvar *menus*
"<interface>
<menu id='app-menu'>
<section>
<item>
<attribute name='label' translatable='yes'>_New Window</attribute>
<attribute name='action'>app.new</attribute>
</item>
</section>
<section>
... |
ddb982c07e783867a4922850cd690f2a8c16cdf5fcf8a0df792c34a28695f1bc | nandor/llir-ocaml | printlinear.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/nandor/llir-ocaml/9c019f15c444e30c825b1673cbe827e0497868fe/asmcomp/printlinear.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Format
open Mach
open Printmach
open Linear
let label ppf l =
Format.fprintf ppf "L%i" l
let in... |
f40c69b1b0dda1ab6511325bd4f782571d9335eadf4064b9b1f36d8a4a760f2c | clojure-interop/google-cloud-clients | CompletionStubSettings.clj | (ns com.google.cloud.talent.v4beta1.stub.CompletionStubSettings
"Settings class to configure an instance of CompletionStub.
The default instance has everything set to sensible defaults:
The default service address (jobs.googleapis.com) and default port (443) are used.
Credentials are acquired automatical... | null | https://raw.githubusercontent.com/clojure-interop/google-cloud-clients/80852d0496057c22f9cdc86d6f9ffc0fa3cd7904/com.google.cloud.talent/src/com/google/cloud/talent/v4beta1/stub/CompletionStubSettings.clj | clojure |
" | (ns com.google.cloud.talent.v4beta1.stub.CompletionStubSettings
"Settings class to configure an instance of CompletionStub.
The default instance has everything set to sensible defaults:
The default service address (jobs.googleapis.com) and default port (443) are used.
Credentials are acquired automatical... |
374c11a3b6f73f53a38bcf7684d6df53be79916fa0306c0eab0319ff44cf1c22 | yminer/libml | visitable.ml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
[ LibML - Machine Learning Library ]
Copyright ( C ) 2002 - 2003 LAGACHERIE
This program is free software ; you can redistribute it and/or
modify it under the te... | null | https://raw.githubusercontent.com/yminer/libml/1475dd87c2c16983366fab62124e8bbfbbf2161b/src/common/visitable.ml | ocaml | *
The visitable class.
*
The generic accept method.
| * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
[ LibML - Machine Learning Library ]
Copyright ( C ) 2002 - 2003 LAGACHERIE
This program is free software ; you can redistribute it and/or
modify it under the te... |
a3ab0ec8ad36bc6d6349ab32909950315b4b4cadc33c94cddd3672e70dbe5385 | gregtatcam/imaplet-lwt | smtp_client.ml |
* Copyright ( c ) 2013 - 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... | null | https://raw.githubusercontent.com/gregtatcam/imaplet-lwt/d7b51253e79cffa97e98ab899ed833cd7cb44bb6/utils/smtp_client.ml | ocaml | escape single dot |
* Copyright ( c ) 2013 - 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND... |
c601157f6d468e8fd3050a5314a58aa2bb17e25b2950d2ca081aa0275f555bba | erlcloud/erlcloud | erlcloud_ddb_util.erl | -*- mode : erlang;erlang - indent - level : 4;indent - tabs - mode : nil -*-
@author >
%% @doc
Helpers for using DynamoDB from Erlang .
%%
%% This is a higher layer API that augments the operations supported
%% by erlcloud_ddb2. The functions in this file do not map directly to
%% DynamoDB operations. Instea... | null | https://raw.githubusercontent.com/erlcloud/erlcloud/874181d01a9c62a5afbcf621c7704fda0f3023dc/src/erlcloud_ddb_util.erl | erlang | @doc
This is a higher layer API that augments the operations supported
by erlcloud_ddb2. The functions in this file do not map directly to
DynamoDB operations. Instead they will perform multiple operations
in order to implement functionality that isn't available directly
@end
DynamoDB Higher Layer API
--------... | -*- mode : erlang;erlang - indent - level : 4;indent - tabs - mode : nil -*-
@author >
Helpers for using DynamoDB from Erlang .
using the DynamoDB API .
-module(erlcloud_ddb_util).
-include("erlcloud.hrl").
-include("erlcloud_ddb2.hrl").
-include("erlcloud_aws.hrl").
-export([delete_all/2, delete_all/3,... |
be02ab0de99ab150e1f88a3d1a621dccb5c7fc5299c3ce545f73c7b5d73715fb | omelkonian/AlgoRhythm | ChaosPitches.hs | # language GADTs #
-- | An example implementation of a `Generate.Chaos` that generates music with
-- chaotic octave and pitch selection.
module Generate.Applications.ChaosPitches (
genChaosMusic
, chaos1
, bSolo
, chaos1Selector) where
import Music
import Utils.Vec
import Generate.Generate
import Control.... | null | https://raw.githubusercontent.com/omelkonian/AlgoRhythm/fdc1ccbae0b3d8a7635b24d37716123aba2d6c11/AlgoRhythm/src/Generate/Applications/ChaosPitches.hs | haskell | | An example implementation of a `Generate.Chaos` that generates music with
chaotic octave and pitch selection. | # language GADTs #
module Generate.Applications.ChaosPitches (
genChaosMusic
, chaos1
, bSolo
, chaos1Selector) where
import Music
import Utils.Vec
import Generate.Generate
import Control.Monad.State hiding (state)
import Generate.Chaos
| Generates ` Music ` with chaos function f x = 1 - 1.9521 * x^2 in ... |
c230d4ac76a8e5d01eefe82133cedb62bc463abee12e6ca8a450534931fdb4f0 | strojure/zizzmap | impl_test.clj | (ns strojure.zizzmap.impl-test
(:require [clojure.test :as test :refer [deftest testing]]
[strojure.zizzmap.impl :as impl])
(:import (clojure.lang IPersistentVector MapEntry)
(java.util Map)))
(set! *warn-on-reflection* true)
(declare thrown?)
#_(test/run-tests)
;;,,,,,,,,,,,,,,,,,,,,,,,,... | null | https://raw.githubusercontent.com/strojure/zizzmap/27940fd8dc80b2758bab6dc6eae18a84893fd26d/test/strojure/zizzmap/impl_test.clj | clojure | ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,
,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, | (ns strojure.zizzmap.impl-test
(:require [clojure.test :as test :refer [deftest testing]]
[strojure.zizzmap.impl :as impl])
(:import (clojure.lang IPersistentVector MapEntry)
(java.util Map)))
(set! *warn-on-reflection* true)
(declare thrown?)
#_(test/run-tests)
(def ^:private -e (impl/b... |
fbde12591e73b1cc9c1dbe294812004001b6c6fcfdd6317cf6b779b2b49693cc | rtoy/cmucl | boot-2008-05-cross-unicode-x86.lisp | Cross - compile script to add 16 - bit strings for Unicode support .
;;; Use as the cross-compile script for cross-build-world.sh.
(in-package :cl-user)
;;; Rename the X86 package and backend so that new-backend does the
;;; right thing.
(rename-package "X86" "OLD-X86" '("OLD-VM"))
(setf (c:backend-name c:*native-b... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/bootfiles/19e/boot-2008-05-cross-unicode-x86.lisp | lisp | Use as the cross-compile script for cross-build-world.sh.
Rename the X86 package and backend so that new-backend does the
right thing.
Features to add here
Features to remove from current *features* here
Things needed to cross-compile unicode changes.
Kill the any deftransforms
End changes for unicode
Compil... | Cross - compile script to add 16 - bit strings for Unicode support .
(in-package :cl-user)
(rename-package "X86" "OLD-X86" '("OLD-VM"))
(setf (c:backend-name c:*native-backend*) "OLD-X86")
(c::new-backend "X86"
'(:x86 :i486 :pentium
:stack-checking
:heap-overflow-check
:relative-package-names
... |
7a95663ae9d4bb50cf9ea4b3c65a55888c3aa0eb312fe9e35401866d100b0d3d | jwiegley/notes | FastNub.hs | module FastNub where
import Data.List (nub)
import Data.Set as Set
import Data.Time
fastNub :: Ord a => [a] -> [a]
fastNub = go Set.empty
where
go _ [] = []
go m (y:ys)
| Set.member y m = go m ys
| otherwise = y : go (Set.insert y m) ys
main :: IO ()
main = do
start <- getCurrentTi... | null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/gists/f719a3d41696d48f6005/gists/928ec32184aeb99492a3/FastNub.hs | haskell | module FastNub where
import Data.List (nub)
import Data.Set as Set
import Data.Time
fastNub :: Ord a => [a] -> [a]
fastNub = go Set.empty
where
go _ [] = []
go m (y:ys)
| Set.member y m = go m ys
| otherwise = y : go (Set.insert y m) ys
main :: IO ()
main = do
start <- getCurrentTi... | |
d5925b3f4256db96bf134a4b48e3a9378bad5746b04f87d5d1ea8c18c20ae850 | wargrey/w3s | whitespace.rkt | #lang typed/racket/base
(provide (all-defined-out))
(require sgml/xml)
(require "../digitama/stdin.rkt")
(require "../digitama/digicore.rkt")
(require "../digitama/normalize.rkt")
(require "../digitama/tokenizer.rkt")
(require "../digitama/tokenizer/port.rkt")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/wargrey/w3s/9483c427b45615dd9d4d450a63f7f81aaf98c780/sgml/tamer/whitespace.rkt | racket | #lang typed/racket/base
(provide (all-defined-out))
(require sgml/xml)
(require "../digitama/stdin.rkt")
(require "../digitama/digicore.rkt")
(require "../digitama/normalize.rkt")
(require "../digitama/tokenizer.rkt")
(require "../digitama/tokenizer/port.rkt")
(define tamer-xml:space : (-> Symbol [#:xml:space-fil... | |
73bbd38ae8392fbc426eeb8fdc2ed2704f114e60812bfeba29cccf73a79c4d6e | krisajenkins/BellRinger | Render.hs | module Render (rootView) where
import GHC.Exts (sortWith)
import HTML
import Data.Maybe
import Messages
import MarketData
import Prelude hiding (div,id,span)
import Virtual
marketDataGraph :: [Market] -> HTML
marketDataGraph rows =
svg (Size "100%" "200px")
(zipWith (curry f)
[(0 :: Int) ..]
... | null | https://raw.githubusercontent.com/krisajenkins/BellRinger/2cf4e4641862e478874c4414ac4050c4fd03641f/src/Render.hs | haskell | module Render (rootView) where
import GHC.Exts (sortWith)
import HTML
import Data.Maybe
import Messages
import MarketData
import Prelude hiding (div,id,span)
import Virtual
marketDataGraph :: [Market] -> HTML
marketDataGraph rows =
svg (Size "100%" "200px")
(zipWith (curry f)
[(0 :: Int) ..]
... | |
4a3e18cefe0cd20dd95a8c59ce796df52fa4a30acee89d8e858c68efaea8a5c4 | Stand-In-Language/stand-in-language | LLVM.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
module MemoryBench.LLVM where
import LLVM.AST hiding (Module)
import qualified LLVM.AST as AST
import LLVM.AST.AddrSpace
import ... | null | https://raw.githubusercontent.com/Stand-In-Language/stand-in-language/20c86eb506eeec07adb61dc7bfe23b0c21e6ab93/bench/MemoryBench/LLVM.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
module MemoryBench.LLVM where
import LLVM.AST hiding (Module)
import qualified LLVM.AST as AST
import LLVM.AST.AddrSpace
import LLVM.AST.CallingConvention
import ... |
b0cdd0d50f2ee04d59057ebca8ed5dfdb0e2de8f67f1a4336d5e2e375367665f | 8treenet/xy_server | gateway_server.erl | %%%--------------------------------------
%%% @Module : gateway_server
@Author : ys
@Email :
@Created :
%%% @Description: 网关服务器
%%%--------------------------------------
-module(gateway_server).
-behaviour(gen_server).
-export([start_link/1,init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2... | null | https://raw.githubusercontent.com/8treenet/xy_server/352679e01eb4a26433ccbec513fbd282307a33bd/src/gateway_server.erl | erlang | --------------------------------------
@Module : gateway_server
@Description: 网关服务器
--------------------------------------
====================================================================
API functions
====================================================================
======================================... | @Author : ys
@Email :
@Created :
-module(gateway_server).
-behaviour(gen_server).
-export([start_link/1,init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-export([]).
-record(state, {}).
@doc < a href=" / doc / man / gen_server.html#Module : : init/1</a >
-spec ini... |
33e6a109db673e1c3ea9662ad1039b0004763774e3b64770bd19f89da0960286 | herd/herdtools7 | semExtra.ml | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/6d781eb91debffdf56998171862a18e40908c3c5/herd/semExtra.ml | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2010 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
99d1bfd43f438ea4a0e4f4491f25b1513bd4a428966bd3eaf32e977e33fc5ecb | ZHaskell/stdio | Main.hs | # LANGUAGE QuasiQuotes #
# LANGUAGE FlexibleContexts #
# LANGUAGE DataKinds #
# LANGUAGE TypeApplications #
module Main (main) where
import Control.DeepSeq
import Criterion.Main
import qualified Data.ByteString as B
import qualified Data.List as List
import qualified Data.Vector.Unboxed as VU
impo... | null | https://raw.githubusercontent.com/ZHaskell/stdio/7887b9413dc9feb957ddcbea96184f904cf37c12/bench/data/Main.hs | haskell | $ List.reverse -- uncomment this reverse bench, useful for dev | # LANGUAGE QuasiQuotes #
# LANGUAGE FlexibleContexts #
# LANGUAGE DataKinds #
# LANGUAGE TypeApplications #
module Main (main) where
import Control.DeepSeq
import Criterion.Main
import qualified Data.ByteString as B
import qualified Data.List as List
import qualified Data.Vector.Unboxed as VU
impo... |
37e52b341dcd677e9b8cda945dc1ba4e0e1fabd3b0a29d4f05ead0a31312ab9e | Bodigrim/linear-builder | BenchText.hs | -- |
Copyright : ( c ) 2022
Licence : BSD3
Maintainer : < >
module BenchText (benchText) where
import qualified Data.ByteString as B
import qualified Data.ByteString.Builder as B
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import Data.Text.Builder.Linear.Buffer
import... | null | https://raw.githubusercontent.com/Bodigrim/linear-builder/946ede793abc757180e4c53dc14b6988e6ffc3c4/bench/BenchText.hs | haskell | | | Copyright : ( c ) 2022
Licence : BSD3
Maintainer : < >
module BenchText (benchText) where
import qualified Data.ByteString as B
import qualified Data.ByteString.Builder as B
import qualified Data.Text as T
import qualified Data.Text.Encoding as T
import Data.Text.Builder.Linear.Buffer
import Data... |
83a7d4397219d504e5c6fc6b3f24565a338aaf4a3614d97c139993bd6bb108e0 | jjtolton/libapl-clj | api.clj | (ns ^{:doc "This is a low level API one level above
the JNA bindings to provide a thin layer of indirection.
Contributors: Please use this rather than than the JNA bindings for
: manipulating APL memory space.
Application developers: Please be careful hooking into this directly.
... | null | https://raw.githubusercontent.com/jjtolton/libapl-clj/01e2bf7e0d20abd9f8f36c2d9fc829dd4082d455/src/libapl_clj/impl/api.clj | clojure | todo -- add initialization options, such as library location
todo -- important to understand GNU APL command context better
to make this more useful
todo -- what does this do...?
constructors
destructors
auxiliary | (ns ^{:doc "This is a low level API one level above
the JNA bindings to provide a thin layer of indirection.
Contributors: Please use this rather than than the JNA bindings for
: manipulating APL memory space.
Application developers: Please be careful hooking into this directly.
... |
49a9f70552909288af56d8ee26ba17f4b42fc0469e9a2e3bf15ab8674601bd25 | yuriy-chumak/ol | keyboard.scm | (define-library (lib keyboard)
(version 1.2)
(license MIT/LGPL3)
(description "keyboard support library")
(import
(otus lisp) (otus ffi))
(export
KEY_ENTER KEY_ESC KEY_TILDE
KEY_UP KEY_DOWN KEY_LEFT KEY_RIGHT
KEY_BACKSPACE KEY_TAB KEY_HOME KEY_END
KEY_1 KEY_2 KEY_3 KEY_4 KEY_5 KEY_6 KEY_7 KEY_... | null | https://raw.githubusercontent.com/yuriy-chumak/ol/c8cb6a11f16836b0e7b448f22250117b3c1470b6/libraries/lib/keyboard.scm | scheme | -us/windows/win32/inputdev/virtual-key-codes
/+/refs/heads/master/include/android/keycodes.h
todo: change to (fft* fft-char)) | (define-library (lib keyboard)
(version 1.2)
(license MIT/LGPL3)
(description "keyboard support library")
(import
(otus lisp) (otus ffi))
(export
KEY_ENTER KEY_ESC KEY_TILDE
KEY_UP KEY_DOWN KEY_LEFT KEY_RIGHT
KEY_BACKSPACE KEY_TAB KEY_HOME KEY_END
KEY_1 KEY_2 KEY_3 KEY_4 KEY_5 KEY_6 KEY_7 KEY_... |
aa4610a54421e6362e0d0847c8ed8f0a3c18be916006ee860fb7703aba03f5e8 | ChrisPenner/eve | EveSpec.hs | module EveSpec where
import Test.Hspec
spec :: Spec
spec = do
describe "Eve" $ do
it "runs tests" $
True `shouldBe` True
| null | https://raw.githubusercontent.com/ChrisPenner/eve/6081b1ff13229b93e5e5a4505fd23aa0a25c96b1/test/EveSpec.hs | haskell | module EveSpec where
import Test.Hspec
spec :: Spec
spec = do
describe "Eve" $ do
it "runs tests" $
True `shouldBe` True
| |
773d091953703c2c4582e71338741d24ea6acb4f7153e3c4065c996d183aa17b | uw-unsat/serval | x86.rkt | #lang racket/base
(require ffi/unsafe)
(provide (all-defined-out))
(require "const/x86.rkt"
"engine.rkt")
(define-cstruct _uc_x86_mmr ([selector _uint16] [base _uint64] [limit _uint32] [flags _uint32]))
(define-cstruct _uc_x86_msr ([rid _uint32] [value _uint64]))
(struct x86-engine (ptr mode)
#:methods... | null | https://raw.githubusercontent.com/uw-unsat/serval/be11ecccf03f81b8bd0557acf8385a6a5d4f51ed/serval/unicorn/x86.rkt | racket | #lang racket/base
(require ffi/unsafe)
(provide (all-defined-out))
(require "const/x86.rkt"
"engine.rkt")
(define-cstruct _uc_x86_mmr ([selector _uint16] [base _uint64] [limit _uint32] [flags _uint32]))
(define-cstruct _uc_x86_msr ([rid _uint32] [value _uint64]))
(struct x86-engine (ptr mode)
#:methods... | |
f0a668bf222c056c5153e0db3383af6fb3c10d50f884bea7fa7433e66c46702d | binaryage/chromex | memory.clj | (ns chromex.app.system.memory
"The chrome.system.memory API.
* available since Chrome 36
* "
(:refer-clojure :only [defmacro defn apply declare meta let partial])
(:require [chromex.wrapgen :refer [gen-wrap-helper]]
[chromex.callgen :refer [gen-call-helper gen-tap-all-events-call]]))
(dec... | null | https://raw.githubusercontent.com/binaryage/chromex/33834ba5dd4f4238a3c51f99caa0416f30c308c5/src/apps/chromex/app/system/memory.clj | clojure | -- convenience ------------------------------------------------------------------------------------------------------------
---------------------------------------------------------------------------------------------------------------------------
-- API TABLE --------------------------------------------------------... | (ns chromex.app.system.memory
"The chrome.system.memory API.
* available since Chrome 36
* "
(:refer-clojure :only [defmacro defn apply declare meta let partial])
(:require [chromex.wrapgen :refer [gen-wrap-helper]]
[chromex.callgen :refer [gen-call-helper gen-tap-all-events-call]]))
(dec... |
4e5da117717fa70533c7cacd945258d500ea97d8cdbbcf865457e454035bc005 | nikivazou/proof-combinators | Reverse.hs | {-@ LIQUID "--exactdc" @-}
{-@ LIQUID "--higherorder" @-}
module Reverse where
import LiquidHaskell.ProofCombinators
import Prelude hiding (reverse, (++), length)
{-@ measure length @-}
{-@ length :: [a] -> Nat @-}
length :: [a] -> Int
length [] = 0
length (_:xs) = 1 + length xs
{-@ infix : @-}
{-@ refle... | null | https://raw.githubusercontent.com/nikivazou/proof-combinators/0df3094cf361f29608fa0718be5050a4e8e8af9f/examples/Reverse.hs | haskell | @ LIQUID "--exactdc" @
@ LIQUID "--higherorder" @
@ measure length @
@ length :: [a] -> Nat @
@ infix : @
@ reflect reverse @
@ reverse :: is:[a] -> {os:[a] | length is == length os} @
@ infix ++ @
@ reflect ++ @
@ (++) :: xs:[a] -> ys:[a] -> {os:[a] | length os == length xs + length ys} @
@ singletonP :: x:a -> { ... |
module Reverse where
import LiquidHaskell.ProofCombinators
import Prelude hiding (reverse, (++), length)
length :: [a] -> Int
length [] = 0
length (_:xs) = 1 + length xs
reverse :: [a] -> [a]
reverse [] = []
reverse (x:xs) = reverse xs ++ [x]
(++) :: [a] -> [a] -> [a]
[] ++ ys = ys
(x:xs) ++ ys = x... |
4048f2b701c71fe41e9f390cec589b5c37cc5a14775c0808c1ccef8abb9c6286 | comby-tools/comby | test_c_style_comments_alpha.ml | open Core
open Rewriter
open Test_helpers
include Test_alpha
let all ?(configuration = configuration) template source =
C.all ~configuration ~template ~source ()
let%expect_test "rewrite_comments_1" =
let template = "replace this :[1] end" in
let source = "/* don't replace this () end */ do replace this () e... | null | https://raw.githubusercontent.com/comby-tools/comby/7b401063024da9ddc94446ade27a24806398d838/test/common/test_c_style_comments_alpha.ml | ocaml | open Core
open Rewriter
open Test_helpers
include Test_alpha
let all ?(configuration = configuration) template source =
C.all ~configuration ~template ~source ()
let%expect_test "rewrite_comments_1" =
let template = "replace this :[1] end" in
let source = "/* don't replace this () end */ do replace this () e... | |
5524d9dd31b33e30cf3581f471857f0469b87437749ae19b6cfcaebb35f6f8b7 | fujita-y/digamma | library.scm | Copyright ( c ) 2004 - 2022 Yoshikatsu Fujita / LittleWing Company Limited .
;;; See LICENSE file for terms and conditions of use.
(define scheme-library-paths (make-parameter '()))
(define scheme-library-exports (make-parameter (make-core-hashtable)))
(define scheme-library-versions (make-parameter (make-core-hasht... | null | https://raw.githubusercontent.com/fujita-y/digamma/31f1512de2d406448ba3a9c8c352c56f30eb99e4/heap/boot/macro/library.scm | scheme | See LICENSE file for terms and conditions of use. | Copyright ( c ) 2004 - 2022 Yoshikatsu Fujita / LittleWing Company Limited .
(define scheme-library-paths (make-parameter '()))
(define scheme-library-exports (make-parameter (make-core-hashtable)))
(define scheme-library-versions (make-parameter (make-core-hashtable)))
(define exact-nonnegative-integer? (lambda (o... |
43ed51070aba2f82dd052c0b720e8e18ec325884f8a9653f77e079ad996ad595 | roman/Haskell-Reactive-Extensions | ConcatTest.hs | module Rx.Observable.ConcatTest where
import Test.Hspec
import Test.HUnit
import Control.Concurrent.Async (async, wait)
import Control.Exception (ErrorCall (..), SomeException (..),
fromException)
import Data.Maybe ... | null | https://raw.githubusercontent.com/roman/Haskell-Reactive-Extensions/0faddbb671be7f169eeadbe6163e8d0b2be229fb/rx-core/test/Rx/Observable/ConcatTest.hs | haskell | ignores this because it is not subscribed to obs1 yet
outer is completed, but won't be done until inner sources
are completed
first elements emitted
this elements are emitted because innerSource2 completed
after this, the whole thing is completed | module Rx.Observable.ConcatTest where
import Test.Hspec
import Test.HUnit
import Control.Concurrent.Async (async, wait)
import Control.Exception (ErrorCall (..), SomeException (..),
fromException)
import Data.Maybe ... |
fc3cf0dd6dfe44a50f58399506dbcc08665e8b55e4f61dc288464b0194f352a6 | gafiatulin/codewars | Scrabble.hs | -- Scrabble Score
--
module Codewars.Exercise.Scrabble where
import Codewars.Exercise.Scrabble.Score (dict)
import Data.Char (toUpper)
import Data.Map.Lazy (findWithDefault, fromList)
scrabbleScore :: String -> Int
scrabbleScore str = sum $ map (\c -> findWithDefault 0 (toUpper c) (fromList dict)) str
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/7%20kyu/Scrabble.hs | haskell | Scrabble Score
|
module Codewars.Exercise.Scrabble where
import Codewars.Exercise.Scrabble.Score (dict)
import Data.Char (toUpper)
import Data.Map.Lazy (findWithDefault, fromList)
scrabbleScore :: String -> Int
scrabbleScore str = sum $ map (\c -> findWithDefault 0 (toUpper c) (fromList dict)) str
|
db5c6d729944797606c0f526fa978900485324f09e7cdd4499d4c87f24317734 | qitab/bazelisp | sbcl.lisp | Copyright 2015 - 2020 Google LLC
;;;
Use of this source code is governed by an MIT - style
;;; license that can be found in the LICENSE file or at
;;; .
Utilities for and their implementation in SBCL .
;;;
;; Default optimization settings.
# -dbg ( declaim ( optimize ( speed 3 ) ( safety 1 ) ) )
(eval-when... | null | https://raw.githubusercontent.com/qitab/bazelisp/8c601ed97b0eeab1c5f2f64c7a5978bbce9960ea/sbcl.lisp | lisp |
license that can be found in the LICENSE file or at
.
Default optimization settings.
to compile either of those from fresh upstream sources without some magic.
threading
This is not necessary, except for debugging and aesthetics.
Preserve source forms, assuming we want them if they exist.
Precompile generic ... | Copyright 2015 - 2020 Google LLC
Use of this source code is governed by an MIT - style
Utilities for and their implementation in SBCL .
# -dbg ( declaim ( optimize ( speed 3 ) ( safety 1 ) ) )
(eval-when (:compile-toplevel :load-toplevel :execute)
MD5 pulls in SB - ROTATE - BYTE which makes it impossible... |
a6ca859818646353fc6805ed12e0e75a62e526a9365e99964dcc9d6f9b31f891 | brendanhay/gogol | Delete.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/fffd4d98a1996d0ffd4cf64545c5e8af9c976cda/lib/services/gogol-sourcerepo/gen/Gogol/SourceRepo/Projects/Repos/Delete.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
Deletes a repo.
/See:/ <-repositories/docs/apis Cloud Source Repositories API Reference> for @sourcerepo.projects.repos.delete@.
* Resource
** Constructing a Request
'SourceRepoProjectsReposDelete' request conforms to.
| Del... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
e36327945f8d4301918e260f4f9c6cf53f01361d6bf15d8bfb02400a5f401608 | lukaszcz/coinduction | cUtils.ml | open Util
open Term
open Names
open Declarations
open Entries
(***************************************************************************************)
(* numbers from m up to but not including n *)
let range m n =
let rec go acc i j =
if i >= j then acc else go (i :: acc) (i + 1) j
in List.rev (go [] m n)
l... | null | https://raw.githubusercontent.com/lukaszcz/coinduction/b7437fe155a45f93042a5788dc62512534172dcd/src/cUtils.ml | ocaml | *************************************************************************************
numbers from m up to but not including n
*************************************************************************************
*************************************************************************************
*******************... | open Util
open Term
open Names
open Declarations
open Entries
let range m n =
let rec go acc i j =
if i >= j then acc else go (i :: acc) (i + 1) j
in List.rev (go [] m n)
let rec repl n x =
if n = 0 then
[]
else
x :: repl (n - 1) x
let rec take n lst =
if n > 0 then
match lst with
| []... |
2a331879e0388dadbbae4758e03d61cf4c6fba06b3e8ed3e77dfef489ac917d5 | sydow/ireal | Erf.hs | module Erf where
import Data.Number.IReal.IRealOperations
import Data.Number.IReal.IntegerInterval
import Data.Number.IReal.IReal
import Data.Number.IReal
To illustrate how to extend the library with e.g. special functions we provide here the example of
the error function erf and the complementary error function... | null | https://raw.githubusercontent.com/sydow/ireal/c06438544c711169baac7960540202379f9294b1/applications/Erf.hs | haskell | module Erf where
import Data.Number.IReal.IRealOperations
import Data.Number.IReal.IntegerInterval
import Data.Number.IReal.IReal
import Data.Number.IReal
To illustrate how to extend the library with e.g. special functions we provide here the example of
the error function erf and the complementary error function... | |
5923ca664f1b30f23cd094ace3e7032caae2c5d1e8d2966b36e0f87ef0ad32ad | cojna/iota | LastMinSpec.hs | # LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -Wno - orphans #
module Data.Monoid.LastMinSpec (main, spec) where
import Data.Coerce
import Data.Monoid.LastMin
import Data.Proxy
import Test.Prelude
import Test.Prop.Monoid
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "LastMin Int" $
monoidSp... | null | https://raw.githubusercontent.com/cojna/iota/a64e8c5e4dd4f92e5ed3fcd0413be94ef1108f9e/test/Data/Monoid/LastMinSpec.hs | haskell | # LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -Wno - orphans #
module Data.Monoid.LastMinSpec (main, spec) where
import Data.Coerce
import Data.Monoid.LastMin
import Data.Proxy
import Test.Prelude
import Test.Prop.Monoid
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "LastMin Int" $
monoidSp... | |
343c38a25910cf5e971c81fae702ff782f8cb72b7f99cfa8100f8aa9cb77a2c9 | disteph/cdsat | range.mli | type _ t [@@deriving show]
val init : 'a t
val pick : 'a t -> Q.t
val mem : Q.t -> 'a t -> bool
type 'a update =
| Range of 'a t
| FourierMotzkin of 'a*'a
| DisEqual of 'a*'a*'a
val upper_update : Q.t -> is_strict:bool -> 'a -> 'a t -> 'a update
val lower_update : Q.t -> is_strict:bool -> 'a -> 'a t ... | null | https://raw.githubusercontent.com/disteph/cdsat/1b569f3eae59802148f4274186746a9ed3e667ed/src/portfolio/pluginsTh.mld/LRA.mld/range.mli | ocaml | type _ t [@@deriving show]
val init : 'a t
val pick : 'a t -> Q.t
val mem : Q.t -> 'a t -> bool
type 'a update =
| Range of 'a t
| FourierMotzkin of 'a*'a
| DisEqual of 'a*'a*'a
val upper_update : Q.t -> is_strict:bool -> 'a -> 'a t -> 'a update
val lower_update : Q.t -> is_strict:bool -> 'a -> 'a t ... | |
f27040d7db5774570765ac2bd8488dc5112a4b5f7b680ae647239eafc0e848fa | arichiardi/sicp-clojure | 1_2_samples.clj | (ns sicp-clojure.1-2-samples
(:require [clojure.test :as t]
[clojure.math.numeric-tower :as m]
[sicp-clojure.utils :as u]))
;;; 1.2.2 Example: Counting change
(defn first-denomination [kinds-of-coins]
(cond (= kinds-of-coins 1) 1
(= kinds-of-coins 2) 5
(= kinds-of-coins 3)... | null | https://raw.githubusercontent.com/arichiardi/sicp-clojure/2dc128726406b12de3eaf38fea58dc469e3a60a6/src/sicp_clojure/1_2_samples.clj | clojure | 1.2.2 Example: Counting change
uncomment to evaluate
1.2.4 Exponentiation
Recursive
Iterative
If the smallest divisor is n itself, the number is prime.
as the other find-divisor easily causes stack overflows for big numbers. | (ns sicp-clojure.1-2-samples
(:require [clojure.test :as t]
[clojure.math.numeric-tower :as m]
[sicp-clojure.utils :as u]))
(defn first-denomination [kinds-of-coins]
(cond (= kinds-of-coins 1) 1
(= kinds-of-coins 2) 5
(= kinds-of-coins 3) 10
(= kinds-of-coins 4) 25
... |
039bef78ed3208178da5ab7d4fcaa3ecf60bdc842f8dcd789c7465f13989b3ad | matterandvoid-space/subscriptions | fulcro.clj | (ns space.matterandvoid.subscriptions.fulcro
(:require
[com.fulcrologic.fulcro.algorithm :as-alias fulcro.algo]
[com.fulcrologic.fulcro.algorithms.indexing :as fulcro.index]
[com.fulcrologic.fulcro.application :as fulcro.app]
[com.fulcrologic.fulcro.components :as c]
[com.fulcrologic.fulcro.render... | null | https://raw.githubusercontent.com/matterandvoid-space/subscriptions/686912827bae018a594088bc712d454b78fcdb2e/src/main/space/matterandvoid/subscriptions/fulcro.clj | clojure | []
(let [query-nodes (some-> class (rc/get-query) (eql/query->ast) :children)
query-nodes-by-key (into {}
(map (fn [n] [(:dispatch-key n) n]))
query-nodes)
{props :prop joins :join} (group-by :type query-nodes)
join-keys ... | (ns space.matterandvoid.subscriptions.fulcro
(:require
[com.fulcrologic.fulcro.algorithm :as-alias fulcro.algo]
[com.fulcrologic.fulcro.algorithms.indexing :as fulcro.index]
[com.fulcrologic.fulcro.application :as fulcro.app]
[com.fulcrologic.fulcro.components :as c]
[com.fulcrologic.fulcro.render... |
b9eae91f1051ca85c0aae313c6d8f2930e26f6c7f220d26aa39b17377500b6a1 | sheaf/acts | Act.hs | # LANGUAGE
CPP
, DeriveGeneric
, DeriveDataTypeable
, DerivingVia
, FlexibleInstances
, , MultiParamTypeClasses
, ScopedTypeVariables
, StandaloneDeriving
, TypeFamilies
, UndecidableInstances
#
CPP
, DeriveGeneric
, DeriveDataTypeable
, DerivingVia
, FlexibleIn... | null | https://raw.githubusercontent.com/sheaf/acts/ad365362867781973a962294a985ec95240198a2/src/Data/Act.hs | haskell | base
finitary
finite-typelits
groups
---------------------------------------------------------------
| A left __act__ (or left __semigroup action__) of a semigroup @s@ on @x@ consists of an operation
such that:
In case @s@ is also a 'Monoid', we additionally require:
The synonym @ act = (•) @ is also pr... | # LANGUAGE
CPP
, DeriveGeneric
, DeriveDataTypeable
, DerivingVia
, FlexibleInstances
, , MultiParamTypeClasses
, ScopedTypeVariables
, StandaloneDeriving
, TypeFamilies
, UndecidableInstances
#
CPP
, DeriveGeneric
, DeriveDataTypeable
, DerivingVia
, FlexibleIn... |
5f98312706a7e4206ca95bc35c9ac29649795e8b17044f356ba3e422c6a09da0 | apache/couchdb-rebar | xref_behavior.erl | -module(xref_behavior).
-behavior(gen_xref_behavior).
% behavior-defined callbacks don't require xref_ignore
-export([init/1, handle/1]).
init(_Args) -> ok.
handle(_Atom) -> next_event.
| null | https://raw.githubusercontent.com/apache/couchdb-rebar/8578221c20d0caa3deb724e5622a924045ffa8bf/inttest/xref_behavior/xref_behavior.erl | erlang | behavior-defined callbacks don't require xref_ignore | -module(xref_behavior).
-behavior(gen_xref_behavior).
-export([init/1, handle/1]).
init(_Args) -> ok.
handle(_Atom) -> next_event.
|
f3d486b3df6862f122dbf3e26cc1b1b8f5b44350cd711166a75427ad7fc33e3d | jadahl/mod_restful | mod_restful_mochijson2.erl | %%
%% This file contains parts of the json implementation from mochiweb. Copyright
%% information and license information follows.
%%
@author < >
2007 Mochi Media , Inc.
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this software and associated documentation files (the... | null | https://raw.githubusercontent.com/jadahl/mod_restful/3a4995e0facd29879a6c2949547177a1ac618474/src/mod_restful_mochijson2.erl | erlang |
This file contains parts of the json implementation from mochiweb. Copyright
information and license information follows.
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publis... | @author < >
2007 Mochi Media , Inc.
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ... |
41d0e82b0d034781bca27e19ea57e4294751eb516e2137399b6ea4b72adcab4e | dvingo/my-clj-utils | crux_pull.clj | (ns dv.crux-pull
(:require
[dv.crux-util :as cu]
[crux.api :as crux]
;[dv.crux-node :refer [crux-node]]
[datascript.pull-parser :as dpp]
[taoensso.timbre :as log])
(:import [datascript.pull_parser PullSpec]))
(def --log false)
(defmacro log
[& args]
(when --log `(log/info ~@args)))
(defn-... | null | https://raw.githubusercontent.com/dvingo/my-clj-utils/cccfe6419c088f9089836b6d9f2572dbf9d66a8a/src/main/dv/crux_pull.clj | clojure | [dv.crux-node :refer [crux-node]]
uses db
uses db
(fn [d] (.-v ^Datom d))
(fn [d] (.-e ^Datom d))
missing attr value
todo reverse
(log "REVERSE: attr-key: " attr-key)
(log "attr: " attr)
kvps is a transient map
uses db
(comment
(pull crux-node [[:user/id :as :hi]
{:habit/task [... | (ns dv.crux-pull
(:require
[dv.crux-util :as cu]
[crux.api :as crux]
[datascript.pull-parser :as dpp]
[taoensso.timbre :as log])
(:import [datascript.pull_parser PullSpec]))
(def --log false)
(defmacro log
[& args]
(when --log `(log/info ~@args)))
(defn- into!
[transient-coll items]
(redu... |
d22954e6232e40435ffc976c5f54987c34343e1f4f713b3addd6ae492cba46f3 | andorp/bead | RequestParams.hs | module Bead.View.RequestParams where
import Control.Monad (join)
import Data.String (IsString(..))
import Bead.Domain.Entities (Username(..))
import Bead.Domain.Relationships
import Bead.View.Dictionary (Language, languageCata)
import Bead.View.Fay.HookIds
import Bead.View.TemplateAndComponentNames
-- Request Paramet... | null | https://raw.githubusercontent.com/andorp/bead/280dc9c3d5cfe1b9aac0f2f802c705ae65f02ac2/src/Bead/View/RequestParams.hs | haskell | Request Parameter Name Constants
are key and value representing a parameter in
the GET or POST http request
Produces a string representing the key value pair
Values that can be converted into a request param,
only the value of the param is calculated
Values that can be converted into request param,
the name and... | module Bead.View.RequestParams where
import Control.Monad (join)
import Data.String (IsString(..))
import Bead.Domain.Entities (Username(..))
import Bead.Domain.Relationships
import Bead.View.Dictionary (Language, languageCata)
import Bead.View.Fay.HookIds
import Bead.View.TemplateAndComponentNames
assignmentKeyPara... |
757558947d7a7d74a4bbaf167d4a57f0bc92087e2eeb3ee2ae53d6934124fddf | chaoxu/fancy-walks | A.hs | {-# OPTIONS_GHC -O2 #-}
# LANGUAGE TupleSections #
import Data.List
import Data.Maybe
import Data.Char
import Data.Array
import Data.Int
import Data.Ratio
import Data.Bits
import Data.Function
import Data.Ord
import Control.Monad.State
import Control.Monad
import Control.Applicative
import Data.ByteString.Char8 (ByteS... | null | https://raw.githubusercontent.com/chaoxu/fancy-walks/952fcc345883181144131f839aa61e36f488998d/code.google.com/codejam/Code%20Jam%20Africa%20and%20Arabia%202011/Online%20Competition/A.hs | haskell | # OPTIONS_GHC -O2 # | # LANGUAGE TupleSections #
import Data.List
import Data.Maybe
import Data.Char
import Data.Array
import Data.Int
import Data.Ratio
import Data.Bits
import Data.Function
import Data.Ord
import Control.Monad.State
import Control.Monad
import Control.Applicative
import Data.ByteString.Char8 (ByteString)
import qualified ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.