_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 |
|---|---|---|---|---|---|---|---|---|
8c6019b33be9760cc431fc3b1cabce97e4e58388a6b50e64fc18cef8c05fde12 | thheller/next-cljs | next_js.clj | (ns shadow.next-js
(:require
[clojure.java.io :as io]
[cljs.compiler :as cljs-comp]
[clojure.string :as str]))
(defn all-vars [state]
(for [[ns ns-info] (get-in state [:compiler-env :cljs.analyzer/namespaces])
ns-def (-> ns-info :defs vals)]
ns-def))
(defn create-pages
{:shadow.build/sta... | null | https://raw.githubusercontent.com/thheller/next-cljs/03cbc22732cac2d904f9b9f1fa7838317ff97675/src/main/shadow/next_js.clj | clojure | (ns shadow.next-js
(:require
[clojure.java.io :as io]
[cljs.compiler :as cljs-comp]
[clojure.string :as str]))
(defn all-vars [state]
(for [[ns ns-info] (get-in state [:compiler-env :cljs.analyzer/namespaces])
ns-def (-> ns-info :defs vals)]
ns-def))
(defn create-pages
{:shadow.build/sta... | |
94614e92cd72865d0ab08b02abcc8a686fc69276586ad8ee9a5c64cabbc0bd4f | eguven/erlsna | floyd_warshall.erl | -module(floyd_warshall).
-export([floyd_warshall/0]).
%%% Implementation of Floyd-Warshall algorithm
%% list of nodes, sorted (here, agent pids)
all_nodes() ->
%N = lists:sort(gatekeeper:all_agents(pid)),
%fun() -> N end.
lists:sort(gatekeeper:all_agents(pid)).
init dists for node , all infinity except ... | null | https://raw.githubusercontent.com/eguven/erlsna/ec82682db69f29cb0eeef65471773519f0176340/src/floyd_warshall.erl | erlang | Implementation of Floyd-Warshall algorithm
list of nodes, sorted (here, agent pids)
N = lists:sort(gatekeeper:all_agents(pid)),
fun() -> N end.
initialize distance list of a node including inexistent edges with weight
infinity, and return as tuple of tuples
agent outdegrees
fill in agents outdegrees
2D matrix lo... | -module(floyd_warshall).
-export([floyd_warshall/0]).
all_nodes() ->
lists:sort(gatekeeper:all_agents(pid)).
init dists for node , all infinity except self = 0
init_node_dists(AgentPid) ->
D1 = lists:foldl(fun(P,Acc) -> orddict:store(P,infinity,Acc) end,
orddict:new(), all_nodes()),
... |
bc27c534876e42b9814e03c6021206969ecb27af1ba7ef12aee907b71b0314c8 | zanderso/cil-template | tut4.ml |
open Cil
open Pretty
open Tututil
module L = List
type functions = {
mutable begin_loop : varinfo;
mutable end_loop : varinfo;
}
let dummyVar = makeVarinfo false "_tut_foo" voidType
let tutfuns = {
begin_loop = dummyVar;
end_loop = dummyVar;
}
let begin_loop_str = "tut_begin_loop"
let end_loo... | null | https://raw.githubusercontent.com/zanderso/cil-template/fc2a0548b2644c53c4840df2a09c1c90b2af2aee/src/tut4.ml | ocaml |
open Cil
open Pretty
open Tututil
module L = List
type functions = {
mutable begin_loop : varinfo;
mutable end_loop : varinfo;
}
let dummyVar = makeVarinfo false "_tut_foo" voidType
let tutfuns = {
begin_loop = dummyVar;
end_loop = dummyVar;
}
let begin_loop_str = "tut_begin_loop"
let end_loo... | |
4ed132e7dc5649d0b5a7b291dc28ea65f3976b7f8fa3e42925157a10fc56757a | den1k/vimsical | bench.cljc | (ns vimsical.vcs.bench)
;; (require '[criterium.core :refer [quick-bench]])
;; (require '[clojure.core.rrb-vector :as rrb])
;; ;;
;; ;; Vector insert RRB vs. PersistentVector
;; ;;
;; (let [n 1e5
;; coll (range n)
v ( )
;; r (rrb/vec coll)]
( letfn [ ( insert [ v v - insert subvec ... | null | https://raw.githubusercontent.com/den1k/vimsical/1e4a1f1297849b1121baf24bdb7a0c6ba3558954/dev/vcs/bench.cljc | clojure | (require '[criterium.core :refer [quick-bench]])
(require '[clojure.core.rrb-vector :as rrb])
;;
;; Vector insert RRB vs. PersistentVector
;;
(let [n 1e5
coll (range n)
r (rrb/vec coll)]
(let [split (rand-int n)
(cat-fn l v-insert r)))]
(println "RRB cat")
; E... | (ns vimsical.vcs.bench)
v ( )
( letfn [ ( insert [ v v - insert subvec - fn cat - fn ]
l ( subvec - fn v 0 split )
r ( subvec - fn v split n ) ]
( println " Vector concatvec " )
( insert v [: foo ] subvec ( comp vec concat ) ) )
|
e21414e0d627c35d9e2d9016f483c214a269f78284ee5a77ef2e1277093b97c4 | ghc/testsuite | T7453.hs |
module T7453 where
newtype Id a = Id { runId :: a }
-- cast1 :: a -> b
cast1 v = runId z
where z :: Id t
z = aux
where aux = Id v
: : a - > b
cast2 v = z ()
where z :: () -> t
z = aux
where aux = const v
-- cast3 :: a -> b
cast3 v = z
where z :: t
... | null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/typecheck/should_fail/T7453.hs | haskell | cast1 :: a -> b
cast3 :: a -> b |
module T7453 where
newtype Id a = Id { runId :: a }
cast1 v = runId z
where z :: Id t
z = aux
where aux = Id v
: : a - > b
cast2 v = z ()
where z :: () -> t
z = aux
where aux = const v
cast3 v = z
where z :: t
z = v
where aux = ... |
3dc86e89183a7880d196583b6266e512f93f580c22fb11ebecdeaca972116073 | basho/riak_core | riak_core_format.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2007 - 2012 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You... | null | https://raw.githubusercontent.com/basho/riak_core/762ec81ae9af9a278e853f1feca418b9dcf748a3/src/riak_core_format.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2007 - 2012 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
... |
c97b4ef4a4b6be5340188a556dc1ad89980b6c2f67dfec221f92b175b6df8c21 | walter-weinmann/ocparse | performance_compacted_special_SUITE.erl | %%%-------------------------------------------------------------------
%%% File : performance_compacted_special_SUITE.erl
%%% Description : Test Suite for rule: special.
%%%
Created : 28.11.2017
%%%-------------------------------------------------------------------
-module(performance_compacted_special_SU... | null | https://raw.githubusercontent.com/walter-weinmann/ocparse/37ae4215863b40b63b3b1376940b7a90b106c24e/test/generated/ct/performance_compacted_special_SUITE.erl | erlang | -------------------------------------------------------------------
File : performance_compacted_special_SUITE.erl
Description : Test Suite for rule: special.
-------------------------------------------------------------------
--------------------------------------------------------------------
COMMON TEST C... | Created : 28.11.2017
-module(performance_compacted_special_SUITE).
-export([
all/0,
end_per_suite/1,
init_per_suite/1,
suite/0,
test_compacted/1
]).
-include_lib("common_test/include/ct.hrl").
-include_lib("eunit/include/eunit.hrl").
suite() ->
[
{timetrap, {minutes, 10}}
... |
26d0904afbd8ccda0ea16815f4d005c08ea91084739b87c554f22f4b8c685235 | kindista/kindista | invitations.lisp | Copyright 2012 - 2015 CommonGoods Network , Inc.
;;;
;;;
This file is part of Kindista .
;;;
Kindista is free software : you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published
by the Free Software Foundation , either version 3 of the License , or
;;; (at... | null | https://raw.githubusercontent.com/kindista/kindista/60da1325e628841721200aa00e4de5f9687c0adb/src/features/invitations.lisp | lisp |
(at your option) any later version.
without even the implied warranty of MERCHANTABILITY or
FITNESS FOR A PARTICULAR PURPOSE. See the GNU Affero General Public
License for more details.
self invitations are verifications for alternate email addresses
only use on the live server or with test data
send group ... | Copyright 2012 - 2015 CommonGoods Network , Inc.
This file is part of Kindista .
Kindista is free software : you can redistribute it and/or modify it
under the terms of the GNU Affero General Public License as published
by the Free Software Foundation , either version 3 of the License , or
Kindista is distr... |
f734130a1b7c2d6c04bba551dde3a10271d95b54c760993c21eb8182d830357c | Clozure/ccl-tests | subseq.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sat Oct 12 19:41:14 2002
Contains : Tests on SUBSEQ
(in-package :cl-test)
(compile-and-load "subseq-aux.lsp")
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; subseq, on lists
(deftest subseq-list.1
(subseq '(a b c d e) 0 0)
nil)
(deftest subseq-list.2
(sub... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/subseq.lsp | lisp | -*- Mode: Lisp -*-
subseq, on lists
check that no structure is shared
subseq on vectors
subseq on strings
Other specialized vectors
Tests on bit vectors
Order of evaluation
Constant folding
Error cases | Author :
Created : Sat Oct 12 19:41:14 2002
Contains : Tests on SUBSEQ
(in-package :cl-test)
(compile-and-load "subseq-aux.lsp")
(deftest subseq-list.1
(subseq '(a b c d e) 0 0)
nil)
(deftest subseq-list.2
(subseq '(a b c) 0)
(a b c))
(deftest subseq-list.3
(subseq '(a b c) 1)
(b c))
(d... |
fd307eaef92823fad60e51057036c0cccc4a911664bfbde46495021877b0daf9 | Psi-Prod/Razzia | client_lwt_unix.ml | open Lwt.Syntax
let ( >>= ) = Lwt.( >>= )
let main () =
let* () =
match Razzia.make_request (Uri.of_string "gemini/") with
| Ok req -> (
Razzia_unix.get ~v6:Ipaddr.V6.Prefix.global_unicast_001 req >>= function
| Ok (Success { encoding = _; mime = Gemtext _; body }) ->
Lwt_fmt.pri... | null | https://raw.githubusercontent.com/Psi-Prod/Razzia/19b7dc7f7c828dd1857994577cfd3daa54c4cdb2/examples/client_lwt_unix.ml | ocaml | open Lwt.Syntax
let ( >>= ) = Lwt.( >>= )
let main () =
let* () =
match Razzia.make_request (Uri.of_string "gemini/") with
| Ok req -> (
Razzia_unix.get ~v6:Ipaddr.V6.Prefix.global_unicast_001 req >>= function
| Ok (Success { encoding = _; mime = Gemtext _; body }) ->
Lwt_fmt.pri... | |
a317aebf5cb18ebccd2a5b626d7fb27d75b40707f2631f8ebee1d5ab9985e14a | ConferOpenSource/refurb | Migrate.hs | {-# LANGUAGE Arrows #-}
# LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
module Refurb.Run.Migrate where
import ClassyPrelude hiding ((</>), defaultTimeLocale, getCurrentTime, formatTime)
import Composite.Record (Record, patte... | null | https://raw.githubusercontent.com/ConferOpenSource/refurb/a2bcfac387af7c9adec26d612bedcb306db9cb8f/src/Refurb/Run/Migrate.hs | haskell | # LANGUAGE Arrows #
# LANGUAGE OverloadedStrings #
|Helper which produces the standard prefix 'Doc' for a given migration: @migration key: @ with color.
from that status which migrations to apply. If the user requested execution of migrations, delegate to 'applyMigrations' to actually do the work.
|Given a pre-vette... | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE PatternSynonyms #
module Refurb.Run.Migrate where
import ClassyPrelude hiding ((</>), defaultTimeLocale, getCurrentTime, formatTime)
import Composite.Record (Record, pattern (:*:), pattern RNil)
import Control.Arrow (returnA)
impo... |
d2a2c6c01cb14f81e02cd5a119c993c873b648a2627fc0d0ec8f36ef00c58f55 | alvatar/spheres | os-io.scm | (##spheres-load core: testing)
(##spheres-load io)
| null | https://raw.githubusercontent.com/alvatar/spheres/568836f234a469ef70c69f4a2d9b56d41c3fc5bd/test/os-io.scm | scheme | (##spheres-load core: testing)
(##spheres-load io)
| |
27e843182ea8395baf42dc3dcff314f7d2a54b88bbce61ed9db3a8f3cfc34102 | circleci/stefon | util.clj | (ns stefon.util
(:require [clojure.java.io :as io]
[clojure.pprint :as pprint]))
(defn slurp-into [#^StringBuilder builder f]
"read file contents into an existing string builder"
(with-open [#^java.io.Reader r (io/reader f)]
(loop [c (.read r)]
(if (neg? c)
builder
(do
... | null | https://raw.githubusercontent.com/circleci/stefon/7c36114923ef7ec41316e22354d2e31217a1a416/stefon-core/src/stefon/util.clj | clojure | The following code is borrowed from me.raynes/fs with a few minor edits.
| (ns stefon.util
(:require [clojure.java.io :as io]
[clojure.pprint :as pprint]))
(defn slurp-into [#^StringBuilder builder f]
"read file contents into an existing string builder"
(with-open [#^java.io.Reader r (io/reader f)]
(loop [c (.read r)]
(if (neg? c)
builder
(do
... |
9828987dcad593cfac61208164237a1415f273ea1e20bef6df26da28f7e0b7b0 | launchdarkly/erlang-server-sdk | ldclient_update_null_server.erl | %%-------------------------------------------------------------------
%% @doc Null update server
@private
%% @end
%%-------------------------------------------------------------------
-module(ldclient_update_null_server).
-behaviour(gen_server).
%% Supervision
-export([start_link/1, init/1]).
%% Behavior callback... | null | https://raw.githubusercontent.com/launchdarkly/erlang-server-sdk/fabbcae4953020a0c93bce99e80c1729ebd447d5/src/ldclient_update_null_server.erl | erlang | -------------------------------------------------------------------
@doc Null update server
@end
-------------------------------------------------------------------
Supervision
Behavior callbacks
===================================================================
Supervision
=======================================... | @private
-module(ldclient_update_null_server).
-behaviour(gen_server).
-export([start_link/1, init/1]).
-export([code_change/3, handle_call/3, handle_cast/2, handle_info/2, terminate/2]).
-type state() :: #{}.
-ifdef(TEST).
-compile(export_all).
-endif.
-spec start_link(Tag :: atom()) ->
{ok, Pid :: pid()... |
d2d859e38805061dd2e345240d8e6a7cc855b834169530beff7ce84776c2e4e3 | guicho271828/eazy-opencl | 2-6-grovel-image.lisp | groveller file , TBP
5.3 Image objects
(in-package #:eazy-opencl.grovel)
#+darwin
(include "OpenCL/cl.h")
#-darwin
(include "CL/cl.h")
(cstruct image-format "cl_image_format"
(:channel-order "image_channel_order" :type #.(lispify "channel_order"))
(:channel-data-type "image_channel_data_type" :type #.(lispif... | null | https://raw.githubusercontent.com/guicho271828/eazy-opencl/ec3b2aae3a768bed738d825a0c7e2394a3d6622a/0.bindings-src/2-6-grovel-image.lisp | lisp | groveller file , TBP
5.3 Image objects
(in-package #:eazy-opencl.grovel)
#+darwin
(include "OpenCL/cl.h")
#-darwin
(include "CL/cl.h")
(cstruct image-format "cl_image_format"
(:channel-order "image_channel_order" :type #.(lispify "channel_order"))
(:channel-data-type "image_channel_data_type" :type #.(lispif... | |
bfdfa41e7e0e26cd10070e208f8e738244c112dc625c2c71f37aba75d12c590d | dschrempf/elynx | Options.hs | # LANGUAGE DeriveGeneric #
-- |
-- Module : TLynx.Examine.Options
-- Description : Tree analysis options
Copyright : 2021
License : GPL-3.0 - or - later
--
-- Maintainer :
-- Stability : unstable
-- Portability : portable
--
Creation date : Thu Aug 29 08:16:45 2019 .
module TLynx.Exam... | null | https://raw.githubusercontent.com/dschrempf/elynx/e1ba421f12788db37c80767df0663284b722cd51/tlynx/src/TLynx/Examine/Options.hs | haskell | |
Module : TLynx.Examine.Options
Description : Tree analysis options
Maintainer :
Stability : unstable
Portability : portable
| Arguments needed to examine phylogenetic trees.
| Command line parser. | # LANGUAGE DeriveGeneric #
Copyright : 2021
License : GPL-3.0 - or - later
Creation date : Thu Aug 29 08:16:45 2019 .
module TLynx.Examine.Options
( ExamineArguments (..),
examineArguments,
)
where
import Data.Aeson
import ELynx.Tools.Reproduction
import GHC.Generics
import Options.Applica... |
6507424b26094c828c090b59c0dbaca930dbd7e8c7f71e255fdc403d0ed109ab | PDP-10/panda | emouse.lisp | -*- Mode : LISP ; Package : USER ; Base : 10 ; : CPTFONT ; -*-
;;;
;;; Everyone should load indirect through this file.
;;;
The real source to the EMOUSE library is OZ : PS:<EMACS > EMOUSE.SOURCE
(LET ((EXT (COND ((STATUS FEATURE SYMBOLICS)
(IF (STATUS FEATURE 3600.) "BIN" "QBIN"))
(T "QFASL")))
... | null | https://raw.githubusercontent.com/PDP-10/panda/522301975c062914ea3d630a1daefde261ddf590/files/emacs/emouse.lisp | lisp | Package : USER ; Base : 10 ; : CPTFONT ; -*-
Everyone should load indirect through this file.
| The real source to the EMOUSE library is OZ : PS:<EMACS > EMOUSE.SOURCE
(LET ((EXT (COND ((STATUS FEATURE SYMBOLICS)
(IF (STATUS FEATURE 3600.) "BIN" "QBIN"))
(T "QFASL")))
(REL (COND ((STATUS FEATURE SYMBOLICS)
(FORMAT NIL "REL~D-" (SI:GET-RELEASE-VERSION)))
(T
(FORMAT NIL "SYS~D-" ... |
25303c231e1389ed28812dc114ab7a393c5baa43d677221764be2dbb0d823a6c | pallet/clj-jclouds | modules.clj | ;
Licensed to the Apache Software Foundation ( ASF ) under one or more
; contributor license agreements. See the NOTICE file distributed with
; this work for additional information regarding copyright ownership.
The ASF licenses this file to You under the Apache License , Version 2.0
( the " License " ) ; you ma... | null | https://raw.githubusercontent.com/pallet/clj-jclouds/dabb71487f7cc5398b7eaa07a8eb58400025259e/src/com/palletops/jclouds/modules.clj | clojure |
contributor license agreements. See the NOTICE file distributed with
this work for additional information regarding copyright ownership.
you may not use this file except in compliance with
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND... | Licensed to the Apache Software Foundation ( ASF ) under one or more
The ASF licenses this file to You under the Apache License , Version 2.0
the License . You may obtain a copy of the License at
distributed under the License is distributed on an " AS IS " BASIS ,
(defn compute-module
[]
(org.jclouds.com... |
cb9d49e9859d630a44d034aef92117b622a5ecfdbff0af0edde650379c803a0e | erlang/corba | interceptors_SUITE.erl | %%-----------------------------------------------------------------
%%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2004 - 2016 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a c... | null | https://raw.githubusercontent.com/erlang/corba/396df81473a386d0315bbba830db6f9d4b12a04f/lib/orber/test/interceptors_SUITE.erl | erlang | -----------------------------------------------------------------
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KI... | Copyright Ericsson AB 2004 - 2016 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(interceptors_SUITE).
-include_lib("common_test/include/ct.hrl").
-include_lib("orber/include/corba.hrl").
-... |
afa74cf2cc95e039c5ea5fa640313ea00c356c49861af69169f72f3dafcd21c1 | argp/bap | batLog.ml |
* BatLog - Simple Logging module
* Copyright ( C ) 2011 The Batteries Included Team
*
* This library 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 ; either
* version 2.1 of the Li... | null | https://raw.githubusercontent.com/argp/bap/2f60a35e822200a1ec50eea3a947a322b45da363/batteries/src/batLog.ml | ocaml | * Flags enable features in logging
* Print the current date as 2011/0628
* Print a generated string
is it better to call time in print_flag?
BatPrintf.fprintf !output "%a%s%s\n" (write_flags ?fp) !flags !prefix s
makes sure all output goes to a single channel when multi-threaded
These are threadsafe to get/s... |
* BatLog - Simple Logging module
* Copyright ( C ) 2011 The Batteries Included Team
*
* This library 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 ; either
* version 2.1 of the Li... |
cdeccc55ec906866dc80e1f23cfb53b516ccc4c5c2f13c13c9911a31033b36f8 | AndrasKovacs/setoidtt | ExceptBench.hs | # LANGUAGE KindSignatures #
# language MagicHash , UnboxedTuples , BangPatterns , ScopedTypeVariables ,
DeriveAnyClass , RankNTypes , DeriveFunctor , UnboxedSums ,
PatternSynonyms #
DeriveAnyClass, RankNTypes, DeriveFunctor, UnboxedSums,
PatternSynonyms #-}
-- be... | null | https://raw.githubusercontent.com/AndrasKovacs/setoidtt/621aef2c4ae5a6acb418fa1153575b21e2dc48d2/experiments/ExceptBench.hs | haskell | benchmarking various exception mechanisms
# inline callCC # | # LANGUAGE KindSignatures #
# language MagicHash , UnboxedTuples , BangPatterns , ScopedTypeVariables ,
DeriveAnyClass , RankNTypes , DeriveFunctor , UnboxedSums ,
PatternSynonyms #
DeriveAnyClass, RankNTypes, DeriveFunctor, UnboxedSums,
PatternSynonyms #-}
mod... |
0a6afc98fcde9bee1cfc8dd637fa89d7f670e55d5cf743423bc45bacc8bd4008 | GaloisInc/saw-script | Netgraph.hs | |
Module : . . Netgraph
Description : Translating graphs of Yosys cells into SAWCore
License : : sbreese
Stability : experimental
Module : SAWScript.Yosys.Netgraph
Description : Translating graphs of Yosys cells into SAWCore
License : BSD3
Maintainer : sbreese
Stability : ex... | null | https://raw.githubusercontent.com/GaloisInc/saw-script/2c5cffd498464f1dd2a9c92013a652c464163a2b/src/SAWScript/Yosys/Netgraph.hs | haskell | # Language TemplateHaskell #
# Language OverloadedStrings #
# Language ViewPatterns #
# Language LambdaCase #
# Language MultiWayIf #
# Language TupleSections #
# Language ScopedTypeVariables #
------------------------------------------------------------------------------
, _netgraphVertexFromKey :: Bitrep -> Maybe Gr... | |
Module : . . Netgraph
Description : Translating graphs of Yosys cells into SAWCore
License : : sbreese
Stability : experimental
Module : SAWScript.Yosys.Netgraph
Description : Translating graphs of Yosys cells into SAWCore
License : BSD3
Maintainer : sbreese
Stability : ex... |
0cb06725fc3fc0d314d591b166ad6d3cad1829b72beed404bb7d1f9087d0fdff | heraldry/heraldicon | options.cljs | (ns heraldicon.options
(:require
[clojure.walk :as walk]
[heraldicon.util.sanitize :as sanitize]))
(def ^:private option-types
#{:option.type/range
:option.type/choice
:option.type/boolean
:option.type/text})
(def manual-blazon
{:type :option.type/text
:default nil
:ui/label :string.opti... | null | https://raw.githubusercontent.com/heraldry/heraldicon/71126cfd7ba342dea0d1bb849be92cbe5290a6fd/src/heraldicon/options.cljs | clojure | and "group-name" as display-name
TODO: find better way to determine option leaf or branch | (ns heraldicon.options
(:require
[clojure.walk :as walk]
[heraldicon.util.sanitize :as sanitize]))
(def ^:private option-types
#{:option.type/range
:option.type/choice
:option.type/boolean
:option.type/text})
(def manual-blazon
{:type :option.type/text
:default nil
:ui/label :string.opti... |
663d04a5f54cb7a1805e40b9b8b8c8143c2e5c988caf93bad27b05b52856b63c | Glue42/gateway-modules | environment.cljc | (ns gateway.state.spec.environment
(:require [clojure.spec.alpha :as s]))
(s/def ::environment (s/keys :req-un [::local-ip ::os ::process-id ::start-time]))
| null | https://raw.githubusercontent.com/Glue42/gateway-modules/be48a132134b5f9f41fd6a6067800da6be5e6eca/common/src/gateway/state/spec/environment.cljc | clojure | (ns gateway.state.spec.environment
(:require [clojure.spec.alpha :as s]))
(s/def ::environment (s/keys :req-un [::local-ip ::os ::process-id ::start-time]))
| |
ca7ea95d3c5aa3e19e3b42a025ddfe4fbd748e43bd1dd3d85e15911dffed0ebb | jyh/metaprl | itt_vec_flat_bind.ml | doc <:doc<
@module[Itt_vec_bind]
Vector binder.
----------------------------------------------------------------
@begin[license]
Copyright (C) 2005 Mojave Group, Caltech
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
... | null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/itt/reflection/obsolete_flat/itt_vec_flat_bind.ml | ocaml | ***********************************************************************
* Definitions.
***********************************************************************
* Simple rewrites.
***********************************************************************
* Tactics.
| doc <:doc<
@module[Itt_vec_bind]
Vector binder.
----------------------------------------------------------------
@begin[license]
Copyright (C) 2005 Mojave Group, Caltech
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
... |
085836a84f08d891a505329afbffc7e8903d1a1df29e10ec4a51a13d52287f50 | pa-ba/compdata | Equality_Test.hs | module Data.Comp.Equality_Test where
import Data.Comp
import Data.Comp.Equality ()
import Data.Comp.Arbitrary ()
import Data.Comp.Show ()
import Test.Framework
import Test.Framework.Providers.QuickCheck2
import Test.Utils
--------------------------------------------------------------------------------
-- Test S... | null | https://raw.githubusercontent.com/pa-ba/compdata/5783d0e11129097e045cabba61643114b154e3f2/testsuite/tests/Data/Comp/Equality_Test.hs | haskell | ------------------------------------------------------------------------------
Test Suits
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Properties
-----------------------------------------------------------... | module Data.Comp.Equality_Test where
import Data.Comp
import Data.Comp.Equality ()
import Data.Comp.Arbitrary ()
import Data.Comp.Show ()
import Test.Framework
import Test.Framework.Providers.QuickCheck2
import Test.Utils
main = defaultMain [tests]
tests = testGroup "Equality" [
testProperty "prop_eq... |
3db2998daf8066ee3e8b6e97298465e979002408232053008ba364bc2551e997 | philnguyen/soft-contract | leftist-tree.rkt | #lang racket/base
(require racket/match
racket/function
racket/contract)
;; adapted from -leftist-tree/
(define (leftist-tree-write t out mode)
(cond [(leftist-tree-empty? t)
(fprintf out "#<leftist-tree [empty]>")]
[else
(fprintf out
"#<leftist-tree [c... | null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/leftist-tree.rkt | racket | adapted from -leftist-tree/
[xs '()])
xs))
undefined
undefined
undefined | #lang racket/base
(require racket/match
racket/function
racket/contract)
(define (leftist-tree-write t out mode)
(cond [(leftist-tree-empty? t)
(fprintf out "#<leftist-tree [empty]>")]
[else
(fprintf out
"#<leftist-tree [count=~a; min=~s]>"
... |
10aa05183f84989676264dd6271e068a4617ac1a2ea6949dcc3efb09435b647c | kaznum/programming_in_ocaml_exercise | fun_x_y.ml | let s x y z = x z (y z);;
let k x y = x;;
fun x y -> y;;
k (s k k) 1 3;;
| null | https://raw.githubusercontent.com/kaznum/programming_in_ocaml_exercise/6f6a5d62a7a87a1c93561db88f08ae4e445b7d4e/ex4.6/fun_x_y.ml | ocaml | let s x y z = x z (y z);;
let k x y = x;;
fun x y -> y;;
k (s k k) 1 3;;
| |
a93ad939de82f30e33b7d789b9b2f0a63c9763ba04e6527941145c41fadbb3c6 | OCamlPro/ocp-build | minUnix.ml | (**************************************************************************)
(* *)
(* Typerex Libraries *)
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/OCamlPro/ocp-build/56aff560bb438c12b2929feaf8379bc6f31b9840/libs/ocplib-unix/minUnix.ml | ocaml | ************************************************************************
Typerex Libraries
... | Copyright 2011 - 2017 OCamlPro SAS
the GNU Lesser General Public License version 2.1 , with the
open OcpCompat
external startup: unit -> unit = "minUnix_startup"
external cleanup: unit -> unit = "minUnix_cleanup"
let _ = startup(); at_exit cleanup
type os_type... |
4bfdfc2ab2ec388165d8f66f9350b3302e467917a5d9d05e12e6fc461127fa3f | Holmusk/servant-hmac-auth | Client.hs | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleContexts #
# LANGUAGE InstanceSigs #
-- | Servant client authentication.
module Servant.Auth.Hmac.Client (
* HMAC client settings
HmacSettings (..),
defaultHmacSettings,
* HMAC servant client
HmacClientM (..),
runHmacClient,
hmacClient,
) whe... | null | https://raw.githubusercontent.com/Holmusk/servant-hmac-auth/57f8b71413d7fc3f38e8a4b3958ae6c2526cea11/src/Servant/Auth/Hmac/Client.hs | haskell | | Servant client authentication.
^ Singing function that will sign all outgoing requests.
^ Secret key for signing function.
^ Function to call for every request after this request is signed.
Useful for debugging.
| Generates a set of client functions for an API.
--------------------------------------------------... | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleContexts #
# LANGUAGE InstanceSigs #
module Servant.Auth.Hmac.Client (
* HMAC client settings
HmacSettings (..),
defaultHmacSettings,
* HMAC servant client
HmacClientM (..),
runHmacClient,
hmacClient,
) where
import Control.Monad ((>=>))
imp... |
8abf22130840f027f04cfa87261db6ca89bbbd0b5a676f7c8ff7d2fce6762f8d | jgm/citeproc | Unicode.hs | # LANGUAGE CPP #
{-# LANGUAGE OverloadedStrings #-}
module Citeproc.Unicode
( Lang(..),
parseLang,
renderLang,
lookupLang,
toUpper,
toLower,
comp
)
where
import Text.Collate.Lang (Lang(..), parseLang, renderLang, lookupLang)
#ifdef MIN_VERSION_text_icu
import qualified Data.Text.ICU as ICU
i... | null | https://raw.githubusercontent.com/jgm/citeproc/e25809c0d783ff42bdb0661f13a8700d9cf6d716/src/Citeproc/Unicode.hs | haskell | # LANGUAGE OverloadedStrings #
default to Shifted variable weighting, unless a variable
weighting is explicitly specified with the ka keyword: | # LANGUAGE CPP #
module Citeproc.Unicode
( Lang(..),
parseLang,
renderLang,
lookupLang,
toUpper,
toLower,
comp
)
where
import Text.Collate.Lang (Lang(..), parseLang, renderLang, lookupLang)
#ifdef MIN_VERSION_text_icu
import qualified Data.Text.ICU as ICU
import qualified Data.Text.ICU.Colla... |
13c8b3c687ba80605afdc563a7557151fb4ed44e8190944ee92bb0b977cdbff4 | LeventErkok/sbvPlugin | T38.hs | {-# OPTIONS_GHC -fplugin=Data.SBV.Plugin #-}
module T36 where
import Data.SBV.Plugin
{-# ANN f theorem #-}
f :: Int -> Int -> Int -> Bool
f a b c = case arrange (a, (b, c)) of
((1, 2), (1, 4), 4) -> False
((d, e), (f, g), h) -> True
where arrange (x, (y, z)) = ((x, y), (x, z), z)
| null | https://raw.githubusercontent.com/LeventErkok/sbvPlugin/b6a6e94cd237a4f64f985783931bd7656e7a6a69/tests/T38.hs | haskell | # OPTIONS_GHC -fplugin=Data.SBV.Plugin #
# ANN f theorem # |
module T36 where
import Data.SBV.Plugin
f :: Int -> Int -> Int -> Bool
f a b c = case arrange (a, (b, c)) of
((1, 2), (1, 4), 4) -> False
((d, e), (f, g), h) -> True
where arrange (x, (y, z)) = ((x, y), (x, z), z)
|
dbc2b458e35a13e9a7664f41e8cbd5f87803219f16d90a7413f55b01b77856f7 | c-cube/poc-modular-io | IO_helpers.mli |
(** Functions purely in userland *)
open IO
val in_of_string : ?off:int -> ?len:int -> string -> In.t
(** An input channel reading from the string *)
val in_of_bytes : ?off:int -> ?len:int -> bytes -> In.t
(** An input channel reading from the bytes buffer *)
type filename = string
val with_in : filename -> (In.t... | null | https://raw.githubusercontent.com/c-cube/poc-modular-io/cfc40b78b519cb187d77d2f17c575320dbec1a0a/src/IO_helpers.mli | ocaml | * Functions purely in userland
* An input channel reading from the string
* An input channel reading from the bytes buffer
* Read from each stream, in order
* Write to all outputs simultaneously
* Input all the content into a string
* [read_at_most n ic] behaves like [ic] but stops after reading at
most [n] b... |
open IO
val in_of_string : ?off:int -> ?len:int -> string -> In.t
val in_of_bytes : ?off:int -> ?len:int -> bytes -> In.t
type filename = string
val with_in : filename -> (In.t -> 'a) -> 'a
val with_out : filename -> (Out.t -> 'a) -> 'a
val with_in_l : filename list -> (In.t list -> 'a) -> 'a
val out_of_buffer ... |
bfd252edfdac4a57199ad15eeebb90bbaaa618f9126f4afc87be7815c6160a70 | ormf/cm | ms.lisp | (in-package :cm)
Define MidiShare ports in 5065 ( Micro Express )
(defparameter *qt* 0) ; quicktime
(defparameter *jv* 2) ; jv-35
(defparameter *dk* 4) ; disklavier
open MidiShare connection and save the stream object in the
;; variable *ms* so we can use it later.
(defparameter *ms* (midishare-open))
;; ... | null | https://raw.githubusercontent.com/ormf/cm/26843eec009bd6c214992a8e67c49fffa16d9530/doc/404B-SoundSynth-AlgoComp/www-camil.music.uiuc.edu_16080/classes/404B/lisp/ms.lisp | lisp | quicktime
jv-35
disklavier
variable *ms* so we can use it later.
note that the value of *ms* is an actual stream object:
define a test process
dont reselect k
...
...
To do real time work we need to use real stream objects rather than
their string names. So start using the value of *ms* rather than
its nam... | (in-package :cm)
Define MidiShare ports in 5065 ( Micro Express )
open MidiShare connection and save the stream object in the
(defparameter *ms* (midishare-open))
*ms*
(defun simp (len lb ub rhy dur amp chan)
(process repeat len
output (new midi :time (now)
:keynum k
... |
d311d4b24e3987cd87aad6182979feb092d175ed95998b8a7a59e263797073f0 | riemann/riemann | pool.clj | (ns riemann.pool
"A generic thread-safe resource pool."
(:use clojure.tools.logging
[slingshot.slingshot :only [throw+]])
(:import [java.util.concurrent LinkedBlockingQueue TimeUnit]))
; THIS IS A MUTABLE STATE OF AFFAIRS. WHICH IS TO SAY, IT IS FUCKING TERRIBLE.
(defprotocol Pool
(grow [pool]
"Ad... | null | https://raw.githubusercontent.com/riemann/riemann/1649687c0bd913c378701ee0b964a9863bde7c7c/src/riemann/pool.clj | clojure | THIS IS A MUTABLE STATE OF AFFAIRS. WHICH IS TO SAY, IT IS FUCKING TERRIBLE.
if unspecified, 0.
if open throws or returns
client a message.
Destructuring bind could change nil to a, say, vector, and cause
unbalanced claim/release. | (ns riemann.pool
"A generic thread-safe resource pool."
(:use clojure.tools.logging
[slingshot.slingshot :only [throw+]])
(:import [java.util.concurrent LinkedBlockingQueue TimeUnit]))
(defprotocol Pool
(grow [pool]
"Adds an element to the pool.")
(claim [pool] [pool timeout]
Returns nil if... |
396a7743210a226d7b3b31b8bff4d9de5567c508bf6a1b0d0a3e17f835e88d69 | coq/coq | fake_ide.ml | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/e0de9db708817cc08efb20d65b9819d8f2b0ea68/test-suite/ide/fake_ide.ml | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
37b46b634ece7082e6114510ca018c4b2c3b7a4e3daf8a4a2ad475c6f5b7267f | uncomplicate/neanderthal | neanderthal_vs_nd4j_vol4.clj | (ns benchmarks.neanderthal-vs-nd4j-vol4
(:require [uncomplicate.commons.core :refer [with-release release]]
[uncomplicate.fluokitten.core :refer [fmap!]]
[uncomplicate.clojurecuda.core
:refer [init context device current-context current-context! synchronize!]]
[uncompl... | null | https://raw.githubusercontent.com/uncomplicate/neanderthal/5c76fb83eb43b7aa3307e6e90d5025e41750a00f/examples/benchmarks/src/benchmarks/neanderthal_vs_nd4j_vol4.clj | clojure | Nd4j on CUDA: | (ns benchmarks.neanderthal-vs-nd4j-vol4
(:require [uncomplicate.commons.core :refer [with-release release]]
[uncomplicate.fluokitten.core :refer [fmap!]]
[uncomplicate.clojurecuda.core
:refer [init context device current-context current-context! synchronize!]]
[uncompl... |
bb85597c68837c9ab9493dae7b5982f374f382203adc03d2e64474141bfd96e8 | danielvegamyhre/semantic-viz | Utils.hs | module Utils where
import System.Process
Extract middle element of 3 element tuple
snd3 :: (a,b,c) -> b
snd3 (_,y,_) = y
-- Merge 2 lists
merge :: [a] -> [a] -> [a]
merge xs [] = xs
merge [] ys = ys
merge (x:xs) (y:ys) = x : y : merge xs ys
-- Counts spaces
isSpace s = s == ' '
countNumSpaces str =... | null | https://raw.githubusercontent.com/danielvegamyhre/semantic-viz/9fe46b5c2e4267f9d0b95b387d361991d45f7d01/src/Utils.hs | haskell | Merge 2 lists
Counts spaces
Gets lines from input file containing wordnet output, and removes headers from top
Inputs lines of Wordnet output and returns pairs of words + number of leading spaces for that input line
split input lines on '=' character
get leading spaces on each line
measure number of leading spac... | module Utils where
import System.Process
Extract middle element of 3 element tuple
snd3 :: (a,b,c) -> b
snd3 (_,y,_) = y
merge :: [a] -> [a] -> [a]
merge xs [] = xs
merge [] ys = ys
merge (x:xs) (y:ys) = x : y : merge xs ys
isSpace s = s == ' '
countNumSpaces str = length (filter isSpace str)
Sp... |
2a57138d99d0c385ff7a41d6e37f1683f82eca7e9c09c3f74df217680f0486dd | tsloughter/kuberl | kuberl_v1_photon_persistent_disk_volume_source.erl | -module(kuberl_v1_photon_persistent_disk_volume_source).
-export([encode/1]).
-export_type([kuberl_v1_photon_persistent_disk_volume_source/0]).
-type kuberl_v1_photon_persistent_disk_volume_source() ::
#{ 'fsType' => binary(),
'pdID' := binary()
}.
encode(#{ 'fsType' := FsType,
'pdID' := P... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1_photon_persistent_disk_volume_source.erl | erlang | -module(kuberl_v1_photon_persistent_disk_volume_source).
-export([encode/1]).
-export_type([kuberl_v1_photon_persistent_disk_volume_source/0]).
-type kuberl_v1_photon_persistent_disk_volume_source() ::
#{ 'fsType' => binary(),
'pdID' := binary()
}.
encode(#{ 'fsType' := FsType,
'pdID' := P... | |
36dd23171dfd41fdea61ae2b48016127a44e9039e955d8f5ab24cd80755e6a7a | aiya000/haskell-examples | Main.hs | If you want to see Control . . Catch with IO ,
Please see /Control / Monad / Trans / Either / EitherT.hs
import Control.Exception (ArithException (..))
import Control.Monad.Catch
main :: IO ()
main = do
ten is alternative value
let Right x = 10 `safeDiv` 0 `catch` ten
print x
where
ten :: SomeExce... | null | https://raw.githubusercontent.com/aiya000/haskell-examples/a337ba0e86be8bb1333e7eea852ba5fa1d177d8a/Control/Monad/Catch/Main.hs | haskell | If you want to see Control . . Catch with IO ,
Please see /Control / Monad / Trans / Either / EitherT.hs
import Control.Exception (ArithException (..))
import Control.Monad.Catch
main :: IO ()
main = do
ten is alternative value
let Right x = 10 `safeDiv` 0 `catch` ten
print x
where
ten :: SomeExce... | |
bb28d57bc6c371e50e57e3684ee98a969921934e9001c9aeb593ccb76d864374 | input-output-hk/project-icarus-importer | Full.hs | # LANGUAGE TemplateHaskell #
| Full version of the wallet ( incremental , prefiltering , rollback )
module Wallet.Rollback.Full (
-- * State
Checkpoint(..)
, checkpointIncr
, checkpointExpected
, checkpointUtxo
, checkpointPending
, checkpointUtxoBalance
, State(..)
, stateCurrent
, stateChec... | null | https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/wallet-new/test/unit/Wallet/Rollback/Full.hs | haskell | * State
* Construction
----------------------------------------------------------------------------
----------------------------------------------------------------------------
-----------------------------------------------------------------------------}
-------------------------------------------------------------... | # LANGUAGE TemplateHaskell #
| Full version of the wallet ( incremental , prefiltering , rollback )
module Wallet.Rollback.Full (
Checkpoint(..)
, checkpointIncr
, checkpointExpected
, checkpointUtxo
, checkpointPending
, checkpointUtxoBalance
, State(..)
, stateCurrent
, stateCheckpoints
, sta... |
9aa24bb983cf2f195b4dcf768e1a90a3565eb02a23457f786b2bd02e1af55e14 | cabol/tcp_client | tcp_client_socket.erl | %%%-------------------------------------------------------------------
@author < >
%%% @doc
This module was takemn on 's Riak Erlang Client , specifically
%%% from module `riakc_pb_socket', and modified to work as just a
%%% generic socket client.
%%% @end
@see < a href=" / basho / riak - erlang - client">R... | null | https://raw.githubusercontent.com/cabol/tcp_client/cc6a3a5814175218d9249ea8f1b7c3636c52cba4/src/tcp_client_socket.erl | erlang | -------------------------------------------------------------------
@doc
from module `riakc_pb_socket', and modified to work as just a
generic socket client.
@end
-------------------------------------------------------------------
API
gen_server callbacks
==========================================================... | @author < >
This module was takemn on 's Riak Erlang Client , specifically
@see < a href=" / basho / riak - erlang - client">Riak Erlang Client</a >
-module(tcp_client_socket).
-behaviour(poolboy_worker).
-behaviour(gen_server).
API - Poolboy Callback
-export([start_link/1]).
-export([start_link/2, sta... |
4653e62b1bde0a9caf12f3c38eb7461313a02fc3c895a200acf8b8234d55f77a | mpickering/apply-refact | Lambda19.hs | f = foo (\x -> \x -> foo x x) | null | https://raw.githubusercontent.com/mpickering/apply-refact/a4343ea0f4f9d8c2e16d6b16b9068f321ba4f272/tests/examples/Lambda19.hs | haskell | f = foo (\x -> \x -> foo x x) | |
083921914cf50e9c183f6bcd0d11b1797ddf8dcae9463c74d776716291064685 | BillHallahan/G2 | UnionFind.hs | -- Based on:
-- A Persistent Union-Find Data Structure
by and
# OPTIONS_GHC -fno - warn - orphans -fno - full - laziness #
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE InstanceSigs #
module G2.Data.UnionFind ( UnionFind
, empty
, fromList
... | null | https://raw.githubusercontent.com/BillHallahan/G2/0683a633f9dad2cd5066d2515645fa79bb105401/src/G2/Data/UnionFind.hs | haskell | Based on:
A Persistent Union-Find Data Structure
# LANGUAGE DeriveDataTypeable #
# NOINLINE unionOfUFs #
Hack for compilation | by and
# OPTIONS_GHC -fno - warn - orphans -fno - full - laziness #
# LANGUAGE InstanceSigs #
module G2.Data.UnionFind ( UnionFind
, empty
, fromList
, toList
, toSet
, union
... |
18735690402f03771f113e59b8829e203b725ec1241d1c301d3f735fb74d7e93 | rotty/spells | operations.scm | ;;; operations.scm --- Unit tests for (spells operations)
Copyright ( C ) 2009 , 2011 < >
;; This program is free software, you can redistribute it and/or
modify it under the terms of the new - style BSD license .
You should have received a copy of the BSD license along with this
;; program. If not, see <>.... | null | https://raw.githubusercontent.com/rotty/spells/e237bfa3aa4cc5be111423093239a3b4a13c5fb1/tests/operations.scm | scheme | operations.scm --- Unit tests for (spells operations)
This program is free software, you can redistribute it and/or
program. If not, see <>.
Commentary:
Code: |
Copyright ( C ) 2009 , 2011 < >
modify it under the terms of the new - style BSD license .
You should have received a copy of the BSD license along with this
(import (rnrs base)
(rnrs lists)
(wak trc-testing)
(spells operations))
(define-test-suite ops-tests
"Operations")
(defi... |
c339e8d8aeea788144ec39b1f360cb357c069144e5a4062713c37d6d595e8fd6 | NetworkVerification/nv | compileBDDs.ml | open Nv_lang
open Syntax
open Cudd
(* BddMap plus the type of the values*)
type 'a t =
{ bdd : 'a Mtbdd.t
; key_ty_id : int
; val_ty_id : int
}
* * * Support for
Expression map cache used to avoid recompiling predicates . First
element of the value is the bdd , second one is the identifier used to l... | null | https://raw.githubusercontent.com/NetworkVerification/nv/aa48abcd1bf9d4b7167cfe83a94b44e446a636e8/src/lib/compile/compileBDDs.ml | ocaml | BddMap plus the type of the values
Helper function that canonicalizes (removing TLinks) types before generating an id | open Nv_lang
open Syntax
open Cudd
type 'a t =
{ bdd : 'a Mtbdd.t
; key_ty_id : int
; val_ty_id : int
}
* * * Support for
Expression map cache used to avoid recompiling predicates . First
element of the value is the bdd , second one is the identifier used to look it
up in the native BDDs module... |
2eee04438aff7d2658b230d1fcf22b114991df7da3ab76aee1cfe17af8476a34 | 0install/0install | default_ui.ml | Copyright ( C ) 2013 , the README file for details , or visit .
* See the README file for details, or visit .
*)
(** High-level helper functions *)
open General
open Support
open Support.Common
let make_ui config ~use_gui : Ui.ui_handler =
let use_gui =
match use_gui, config.dry_run with
| `Ye... | null | https://raw.githubusercontent.com/0install/0install/22eebdbe51a9f46cda29eed3e9e02e37e36b2d18/src/zeroinstall/default_ui.ml | ocaml | * High-level helper functions
[try_get_gui] will throw if use_gui is [Yes] and the GUI isn't available | Copyright ( C ) 2013 , the README file for details , or visit .
* See the README file for details, or visit .
*)
open General
open Support
open Support.Common
let make_ui config ~use_gui : Ui.ui_handler =
let use_gui =
match use_gui, config.dry_run with
| `Yes, true -> Safe_exn.failf "Can't us... |
f9699434cb6f5aed343207b1b6807c27276fb6f64a4ba0d81ca530532f99934f | np/mbox-tools | redact-mbox.hs | --------------------------------------------------------------------
-- |
-- Executable : redact-mbox
Copyright : ( c ) 2008 , 2009 , 2011
-- License : BSD3
--
Maintainer : < >
-- Stability : provisional
-- Portability:
--
--------------------------------------------------------------------
import Codec.Mbo... | null | https://raw.githubusercontent.com/np/mbox-tools/494848aa730e445d3227b6c57d3351aa8401cf4c/redact-mbox.hs | haskell | ------------------------------------------------------------------
|
Executable : redact-mbox
License : BSD3
Stability : provisional
Portability:
------------------------------------------------------------------
BEGIN MISSING
END MISSING
NOTE that the offset is not redacted | Copyright : ( c ) 2008 , 2009 , 2011
Maintainer : < >
import Codec.Mbox (Mbox(..),MboxMessage(..),parseMbox,showMbox)
import qualified Data.ByteString.Lazy as B (ByteString,readFile,writeFile)
import qualified Data.ByteString.Lazy.Char8 as C (mapAccumL,unpack,pack)
import Data.List (mapAccumL)
import Data.Cha... |
4430405616a00a50b62b6f370c4ed405947a31d1c6921c1a486ece8f0ba4c5ff | kaizhang/Taiji | Main.hs | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE ViewPatterns #
module Main where
import Bio.Pipeline.Instances ()
import Data.Version (showVersion)
import Paths_Tai... | null | https://raw.githubusercontent.com/kaizhang/Taiji/f6a050ba0ee6acb6077435566669279455cef350/Taiji/app/Main.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE TemplateHaskell #
# LANGUAGE ViewPatterns #
module Main where
import Bio.Pipeline.Instances ()
import Data.Version (showVersion)
import Paths_Taiji (version)
i... |
62814a3c3ec5b5656e83ef6dcb2cd14aae1f0b877c5789ce122c71191a52323e | bluddy/rails | pani_anim.ml | open Containers
(* Pani animations: interpret the code of the individual animations *)
let debug = false
let print_hex fmt = Format.fprintf fmt "0x%x"
type t = {
mutable read_ptr: int [@printer print_hex]; (* offset into buffer *)
mutable used: bool; (* not used: deleted *)
mutable pic_idx: int; (* -... | null | https://raw.githubusercontent.com/bluddy/rails/b2a8dd700fdcbdf36984ba50eb148000c1f0b32f/bin/anim/pani_anim.ml | ocaml | Pani animations: interpret the code of the individual animations
offset into buffer
not used: deleted
-1: no pic
Set a delay amount to add to total_delay each call
Push a counter at the top of the counter stack
Reset all
Must dispose of bytes
nop never advances | open Containers
let debug = false
let print_hex fmt = Format.fprintf fmt "0x%x"
type t = {
mutable x: int;
mutable y: int;
mutable counter_stack: int list;
mutable background: bool;
mutable update_fn : (unit -> unit) option;
other_anim_idx: int;
reset_x: int;
reset_y: int;
reset_delay: int;
muta... |
17d236f9b73900c59dc10ff9ae6bb01245af75d4706c0e9569226c0cb9b67a78 | plow-technologies/rescript-linter | Printer.ml | open Rescript_parser
let formatMessage ppf src ({loc; msg} : Location.error) =
Res_diagnostics_printing_utils.Super_location.setup_colors () ;
open a vertical box . Everything in our message is indented 2 spaces
Format.fprintf ppf " @[<v>@ , % a@ , % s@,@ ] " ( print ~message_kind:`error " We 've found a bug for... | null | https://raw.githubusercontent.com/plow-technologies/rescript-linter/8f7f144fb1b61f840a1269f2f55c5c6bd79706ad/lib/Printer.ml | ocaml | open Rescript_parser
let formatMessage ppf src ({loc; msg} : Location.error) =
Res_diagnostics_printing_utils.Super_location.setup_colors () ;
open a vertical box . Everything in our message is indented 2 spaces
Format.fprintf ppf " @[<v>@ , % a@ , % s@,@ ] " ( print ~message_kind:`error " We 've found a bug for... | |
7924f3df54578fb1a4d8d47acb964e1834a816ac6516c0f8643f03308d4c0ba4 | noinia/hgeometry | MainSDL.hs | {-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Lens
import Control.Monad (unless, when)
import Data.Ext
import Geometry
import Geometry.Polygon (SimplePolygon,outerBoundaryEdges)
import qualified Geometry.Polygon as Polygon
import Data.Ma... | null | https://raw.githubusercontent.com/noinia/hgeometry/89cd3d3109ec68f877bf8e34dc34b6df337a4ec1/hgeometry-web/old/MainSDL.hs | haskell | # LANGUAGE OverloadedStrings #
import qualified SDL.Primitive
SDL.showWindow w
How fast do we aim to render ?
SDL.Framerate.with fps (main' r)
SDL.destroyWindow w
draw on the texture
apply texture and show on screen
main' :: SDL.Renderer -> SDL.Framerate.Manager -> IO ()
where
loop' = do
e... | module Main where
import Control.Lens
import Control.Monad (unless, when)
import Data.Ext
import Geometry
import Geometry.Polygon (SimplePolygon,outerBoundaryEdges)
import qualified Geometry.Polygon as Polygon
import Data.Maybe (mapMaybe)
import qualified Dat... |
5a3db98b6c817b6fc32cfc8bdaa55770e4701ae25f056dd870b947a938ba7b76 | mfikes/fifth-postulate | ns466.cljs | (ns fifth-postulate.ns466)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | null | https://raw.githubusercontent.com/mfikes/fifth-postulate/22cfd5f8c2b4a2dead1c15a96295bfeb4dba235e/src/fifth_postulate/ns466.cljs | clojure | (ns fifth-postulate.ns466)
(defn solve-for01 [xs v]
(for [ndx0 (range 0 (- (count xs) 3))
ndx1 (range (inc ndx0) (- (count xs) 2))
ndx2 (range (inc ndx1) (- (count xs) 1))
ndx3 (range (inc ndx2) (count xs))
:when (= v (+ (xs ndx0) (xs ndx1) (xs ndx2) (xs ndx3)))]
(list (x... | |
dbcb84da57e76739b58f2a89e2d13df450f762c8e8abd2bb91f732b5f4cd20a6 | jumarko/clojure-experiments | symmetric_difference.clj | (ns four-clojure.symmetric-difference)
;;;
Write a function which returns a symmetric difference of two sets .
Symmetric difference is the set of items belonging to one but not both of two sets .
(defn symmetric-difference [s1 s2]
(set ( remove #(and (s1 %) (s2 %))
(concat s1 s2))))
(= (symmet... | null | https://raw.githubusercontent.com/jumarko/clojure-experiments/f0f9c091959e7f54c3fb13d0585a793ebb09e4f9/src/clojure_experiments/four_clojure/symmetric_difference.clj | clojure | (ns four-clojure.symmetric-difference)
Write a function which returns a symmetric difference of two sets .
Symmetric difference is the set of items belonging to one but not both of two sets .
(defn symmetric-difference [s1 s2]
(set ( remove #(and (s1 %) (s2 %))
(concat s1 s2))))
(= (symmetric-d... | |
41992620e37c76932a9696f4fbde8165dac65562f9f2e55998cb663c1fe8e3ee | HaskellForCats/HaskellForCats | 2014-0226funcCal.hs | -- module FuncCall where
Prelude > sqrt 5
2.23606797749979
Prelude > sqrt 25
5.0
Prelude > max 1.3 4
4.0
Prelude > max ( 5 + 2 ) ( sqrt 17 )
7.0
Prelude > ( 5 + 2 ) * ( 3 - 4 )
-7
Prelude > let square x = x * x
Prelude > square 3
9
Prelude > : t square
square : : a = > a - > a... | null | https://raw.githubusercontent.com/HaskellForCats/HaskellForCats/2d7a15c0cdaa262c157bbf37af6e72067bc279bc/MenaBeginning/001session/2014-0226funcCal.hs | haskell | module FuncCall where
let tells the ghc that we are creating something new , and not asking for something that is in it 's namespace .
let tells the ghc that we are creating something new, and not asking for something that is in it's namespace.
Ok, modules loaded: Main.
*Main> :q
Leaving GHCi.
Ok, modules loa... |
Prelude > sqrt 5
2.23606797749979
Prelude > sqrt 25
5.0
Prelude > max 1.3 4
4.0
Prelude > max ( 5 + 2 ) ( sqrt 17 )
7.0
Prelude > ( 5 + 2 ) * ( 3 - 4 )
-7
Prelude > let square x = x * x
Prelude > square 3
9
Prelude > : t square
square : : a = > a - > a
Prelude > : t square 3... |
29c523e611509e3314cc457a515e6b5047d43af695b351f9417cf8911bb940a9 | lotabout/axe | escape.rkt | #lang racket/base
(provide regex-escape-raw
pregexp-raw
regexp-raw)
(module+ test
(require rackunit))
;;; wrap-escape: helper function to escape backslash if "\\<char>" can be recognized by racket
;;; reader
;;;
;;; "\\d\\t" -> "\"\\\\d\\t\""
;;;
1 . " \\d " can not be parsed by racket reader ,... | null | https://raw.githubusercontent.com/lotabout/axe/234c2d1f6849f3719c3fc3c2354a4d257e53943b/escape.rkt | racket | wrap-escape: helper function to escape backslash if "\\<char>" can be recognized by racket
reader
"\\d\\t" -> "\"\\\\d\\t\""
It will later be passed for `read`
consume '\\'
leave it as it is
escape character '\'
escape the backslash('\') in a string for regexp
escape will parse the escapped character in a r... | #lang racket/base
(provide regex-escape-raw
pregexp-raw
regexp-raw)
(module+ test
(require rackunit))
1 . " \\d " can not be parsed by racket reader , thus escape its ' \ ' characters , into " \\\\d "
2 . " \\t " can be parsed by racket reader , keep it as original : " \\t "
3 . wrap the wh... |
567412b666497d41a44abc7a25afe918cd994691b92b7fcd7def1e4237b1180d | default-kramer/plisqin | tokens-custom-strict.rkt | #lang scribble/manual
@(begin
(provide custom-strict-docs)
(require scribble/example
"helpers.rkt"
(for-label "standard-label.rkt"))
(define (custom-strict-docs)
(nested (doc-val)
(doc-??)))
(define (doc-val)
@defform[(val x [type])]{
Here @(racket [type])... | null | https://raw.githubusercontent.com/default-kramer/plisqin/26421c7c42656c873c4e0a4fc7f48c0a3ed7770f/plisqin-doc/scribblings/tokens-custom-strict.rkt | racket | #lang scribble/manual
@(begin
(provide custom-strict-docs)
(require scribble/example
"helpers.rkt"
(for-label "standard-label.rkt"))
(define (custom-strict-docs)
(nested (doc-val)
(doc-??)))
(define (doc-val)
@defform[(val x [type])]{
Here @(racket [type])... | |
17e6386b308a4a3959045960a9a99fdc4188234d363c8820bce8d1d97a048132 | Workiva/eva | fressian.clj | Copyright 2015 - 2019 Workiva Inc.
;;
;; Licensed under the Eclipse Public License 1.0 (the "License");
;; you may not use this file except in compliance with the License.
;; You may obtain a copy of the License at
;;
;; -1.0.php
;;
;; Unless required by applicable law or agreed to in writing, software
dist... | null | https://raw.githubusercontent.com/Workiva/eva/b7b8a6a5215cccb507a92aa67e0168dc777ffeac/dev/src/eva/datastructures/test_version/fressian.clj | clojure |
Licensed under the Eclipse Public License 1.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-1.0.php
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either expre... | Copyright 2015 - 2019 Workiva Inc.
distributed under the License is distributed on an " AS IS " BASIS ,
(ns eva.datastructures.test-version.fressian
(:require [eva.datastructures.test-version.logic.nodes :as nodes]
[eva.datastructures.test-version.logic.buffer :as buffer]
[eva.datastructu... |
9a192b14ce6efc71cf5960d6d00a5a35e66a2160ac3ff2de1847655efc284f7e | Darkkey/erlamsa | erlamsa_cmanager.erl | Copyright ( c ) 2014 - 2020
%
% 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 use, copy, modify, merge, publish, distr... | null | https://raw.githubusercontent.com/Darkkey/erlamsa/f46dde549588d15789c2c38aec4a206560024987/src/erlamsa_cmanager.erl | erlang |
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, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions:
The above copyright notice ... | Copyright ( c ) 2014 - 2020
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 , EXPRESS ... |
b85f1f6daeb86af67fa9ed37ed3f64aae6ac266bfba907d9d873e0f648baaf33 | haskell/haskell-ide-engine | MainHie.hs | # LANGUAGE CPP #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RankNTypes #
module Main where
import qualified Control.Exception as E
import Control.Monad
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Yaml as Yaml
import HIE.Bios.T... | null | https://raw.githubusercontent.com/haskell/haskell-ide-engine/d84b84322ccac81bf4963983d55cc4e6e98ad418/app/MainHie.hs | haskell | # LANGUAGE OverloadedStrings #
---------------------------------------------------------------------
---------------------------------------------------------------------
plugins
---------------------------------------------------------------------
| This will be read from a configuration, eventually
, hareDesc... | # LANGUAGE CPP #
# LANGUAGE RankNTypes #
module Main where
import qualified Control.Exception as E
import Control.Monad
import qualified Data.Text as T
import qualified Data.Text.IO as T
import qualified Data.Yaml as Yaml
import HIE.Bios.Types
import Haskell.Ide.Eng... |
5cd9f962f5fe609dbb7eb2011bf8550b5c870b6af804c806e830643f849e4a3b | boot-clj/boot-new | edn.clj | (ns boot.generate.edn
(:require [boot.generate.file :as gen-file]
[boot.new.templates :as tmpl]))
(defn generate
"Generate a new edn file relative to the prefix."
[prefix ns-name & [body ext]]
(gen-file/generate prefix ns-name (str body) (or ext "edn")))
| null | https://raw.githubusercontent.com/boot-clj/boot-new/b614968036693285588fdb325fcf224011b16de7/src/boot/generate/edn.clj | clojure | (ns boot.generate.edn
(:require [boot.generate.file :as gen-file]
[boot.new.templates :as tmpl]))
(defn generate
"Generate a new edn file relative to the prefix."
[prefix ns-name & [body ext]]
(gen-file/generate prefix ns-name (str body) (or ext "edn")))
| |
9434c258a8b59230bf6fc3dda3708441c3ccd1e2aa06b01cd757b3812894adf9 | KenDickey/Crosstalk | simple-regression-testing.scm | #!r6rs
;;; FILE: "simple-regression-testing.sls"
;;; IMPLEMENTS: Simple [minded] Regression Test System
;;; LANGUAGE: R5RS Scheme with define-syntax/syntax-case
AUTHOR :
COPYRIGHT ( c ) 2005 , 2008 , 2016 by . All rights reserved .
;;;
;;;Permission is hereby granted, free of charge, to any person
;;;obtaining ... | null | https://raw.githubusercontent.com/KenDickey/Crosstalk/c4a315baf039e714980e14f5b07860632b9bd0e6/simple-regression-testing.scm | scheme | FILE: "simple-regression-testing.sls"
IMPLEMENTS: Simple [minded] Regression Test System
LANGUAGE: R5RS Scheme with define-syntax/syntax-case
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the right... | #!r6rs
AUTHOR :
COPYRIGHT ( c ) 2005 , 2008 , 2016 by . All rights reserved .
files ( the " Software " ) , to deal in the Software without
sell copies of the Software , and to permit persons to whom
the Software is furnished to do so , subject to the following
be included in all copies or substantial portions o... |
e6375dba938824c368f728bbfdb2c1b7e858aa4c9e35d24a40f43196196f350b | ucsd-progsys/dsolve | moreLabels.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, Kyot... | null | https://raw.githubusercontent.com/ucsd-progsys/dsolve/bfbbb8ed9bbf352d74561e9f9127ab07b7882c0c/stdlib/moreLabels.mli | ocaml | *********************************************************************
Objective Caml
... | , Kyoto University RIMS
Copyright 2001 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ I d : moreLabels.mli , v 1.12 2004/04/23... |
2e92caa5703dfdfc0ddaddb7f799da4bec4ce23e64c5fe3c25598c9a462ac511 | alexbs01/OCaml | power.mli | val power : int -> int -> int
val power' : int -> int -> int
val powerf : float -> int -> float
| null | https://raw.githubusercontent.com/alexbs01/OCaml/92a28522a8467d8ed87ef380b6175f1c21616f85/p04/power.mli | ocaml | val power : int -> int -> int
val power' : int -> int -> int
val powerf : float -> int -> float
| |
0b76ed521fd90c9b22ff4579d9a973c5f1ec49cd3a796b567a92b1f5c5c935a1 | vonzhou/LearnYouHaskellForGreatGood | random_str2.hs | import System.Random
main = do
gen <- getStdGen
putStrLn $ take 20 (randomRs ('a', 'z') gen)
gen2 <- getStdGen
putStrLn $ take 20 (randomRs ('a', 'z') gen2)
| null | https://raw.githubusercontent.com/vonzhou/LearnYouHaskellForGreatGood/439d848deac53ef6da6df433078b7f1dcf54d18d/chapter9/random_str2.hs | haskell | import System.Random
main = do
gen <- getStdGen
putStrLn $ take 20 (randomRs ('a', 'z') gen)
gen2 <- getStdGen
putStrLn $ take 20 (randomRs ('a', 'z') gen2)
| |
0e09564748c8aa7dbd7037984586dd48be1d4f217b64a608720b43467c06fa05 | jeromesimeon/Galax | norm_util.mli | (***********************************************************************)
(* *)
(* GALAX *)
(* XQuery Engine *)
(* ... | null | https://raw.githubusercontent.com/jeromesimeon/Galax/bc565acf782c140291911d08c1c784c9ac09b432/normalization/norm_util.mli | ocaml | *********************************************************************
GALAX
XQuery Engine
... | Copyright 2001 - 2007 .
$ I d : , v 1.35 2007/10/16 01:25:34
open Norm_context
open Xquery_common_ast
open Xquery_ast
open Xquery_core_ast
open Xquery_core_ast_annotation
open Xquery_type_core_ast
Core AST creation functions
val build_core_if :
norm_c... |
34c0b5311a6bde4e2407130c5db09fa9d6be0d00d2dc22e0dc1b76125455d8e7 | audreyt/openafp | TO.hs | module OpenAFP.Records.T.TO where
import OpenAFP.Types
import OpenAFP.Internals
data T_TO = T_TO {
t_to_Type :: !N1
,t_to :: !NStr
} deriving (Show, Typeable)
| null | https://raw.githubusercontent.com/audreyt/openafp/178e0dd427479ac7b8b461e05c263e52dd614b73/src/OpenAFP/Records/T/TO.hs | haskell | module OpenAFP.Records.T.TO where
import OpenAFP.Types
import OpenAFP.Internals
data T_TO = T_TO {
t_to_Type :: !N1
,t_to :: !NStr
} deriving (Show, Typeable)
| |
f5d244356a182e03be95658e65adb2849be91646781cf6ae9b0f78e63b30b101 | weavejester/intentions | core.cljc | (ns intentions.core
"Macros and functions for defining intentions."
#?(:clj (:require [clojure.tools.macro :as macro])))
(defn intent?
"Returns true if its argument is an intention."
[x]
(and (fn? x) (::state (meta x))))
(defn- dispatch-comparator [isa? prefers]
(fn [a b]
(cond
(or (isa? a b) (pr... | null | https://raw.githubusercontent.com/weavejester/intentions/8570013d447b57734ee1b90181b05ad565328318/src/intentions/core.cljc | clojure | (ns intentions.core
"Macros and functions for defining intentions."
#?(:clj (:require [clojure.tools.macro :as macro])))
(defn intent?
"Returns true if its argument is an intention."
[x]
(and (fn? x) (::state (meta x))))
(defn- dispatch-comparator [isa? prefers]
(fn [a b]
(cond
(or (isa? a b) (pr... | |
f667f79b9e85f0093159506964d697e3f07fdee7b09ce46306b173cea04b707b | zendesk/clj-headlights | t_utils.clj | (ns clj-headlights.t-utils
(:require [clj-headlights.utils :as utils])
(:use [clojure.test]))
(deftest normalize-key
(testing "turns dashes to underscores"
(is (= (utils/normalize-key "some-key_here") "some_key_here"))))
(deftest normalize-map
(testing "makes keyworded map into strings"
(is (= (utils/... | null | https://raw.githubusercontent.com/zendesk/clj-headlights/095ab05337c1a35583776a74137041ba9d783383/test/clj_headlights/t_utils.clj | clojure | (ns clj-headlights.t-utils
(:require [clj-headlights.utils :as utils])
(:use [clojure.test]))
(deftest normalize-key
(testing "turns dashes to underscores"
(is (= (utils/normalize-key "some-key_here") "some_key_here"))))
(deftest normalize-map
(testing "makes keyworded map into strings"
(is (= (utils/... | |
b3bf76cb8e54d17bffc0195b883de06a6689a1c86080fceea54f627f6fd8bbda | embecosm/cgen | utils-cgen.scm | CGEN Utilities .
Copyright ( C ) 2000 , 2002 , 2003 , 2009 , 2010 Red Hat , Inc.
This file is part of CGEN .
;; See file COPYING.CGEN for details.
;;
This file contains utilities specific to cgen .
Generic utilities should go in utils.scm .
;; True if text of sanitize markers are to be emitted.
;; This is a ... | null | https://raw.githubusercontent.com/embecosm/cgen/3fa8809c015376cd0e80018a655d372df3678bc6/cgen/utils-cgen.scm | scheme | See file COPYING.CGEN for details.
True if text of sanitize markers are to be emitted.
This is a debugging tool only, though it could have use in sanitized trees.
Utility to display command line invocation for debugging purposes.
Output double-quotes if string has a space for better
correspondence to how to spec... | CGEN Utilities .
Copyright ( C ) 2000 , 2002 , 2003 , 2009 , 2010 Red Hat , Inc.
This file is part of CGEN .
This file contains utilities specific to cgen .
Generic utilities should go in utils.scm .
(define include-sanitize-marker? #t)
(define (display-argv argv)
(let ((cep (current-error-port)))
(d... |
1d5ab42b8b613c7107e9081a93809fd95cef6e9f9dcabeac85b9ba6818feeb99 | atlas-engineer/nyxt | urls.lisp | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(in-package :nyxt)
(export-always 'url)
(defmethod url ((url quri:uri))
url)
(defmethod url ((url-string string))
(quri:uri url-string))
(defun string->url (url-string)
"Convert URL-STRING to its corresponding `quri... | null | https://raw.githubusercontent.com/atlas-engineer/nyxt/a1786f441b7c4976da88d7810c1692911e4115c2/source/urls.lisp | lisp | how to define the empty URL?
`sb-bsd-sockets:get-host-by-name' may signal a `ns-try-again-condition' which is
not an error, so we can't use `ignore-errors' here.
-use-domain-names/special-use-domain-names.xml
TODO: Remove when -tld/issues/2 is fixed.
`new-url-query' automatically falls back to HTTPS if it makes f... | SPDX - FileCopyrightText : Atlas Engineer LLC
SPDX - License - Identifier : BSD-3 - Clause
(in-package :nyxt)
(export-always 'url)
(defmethod url ((url quri:uri))
url)
(defmethod url ((url-string string))
(quri:uri url-string))
(defun string->url (url-string)
"Convert URL-STRING to its corresponding `quri... |
3643c5690e1054075a9b6fb128076854f58e231bda81646cc70be1c3ec144610 | jixiuf/helloerlang | utf8_to_latindb_SUITE.erl | %%%-------------------------------------------------------------------
File : Emysql / test / utf8_to_latindb_SUITE.erl
Descr : Suite # 5 : Test for UTF-8 connection to Latin-1 DB .
Author :
%%% Created : 03/26/2012 hd
%%% Requires : Erlang 14B (prior may not have ct_run)
%%%-----------------------... | null | https://raw.githubusercontent.com/jixiuf/helloerlang/3960eb4237b026f98edf35d6064539259a816d58/emysql-test/test/utf8_to_latindb_SUITE.erl | erlang | -------------------------------------------------------------------
Created : 03/26/2012 hd
Requires : Erlang 14B (prior may not have ct_run)
-------------------------------------------------------------------
Run from Emysql/:
make test
Results see:
test/index.html
----------------------------------... | File : Emysql / test / utf8_to_latindb_SUITE.erl
Descr : Suite # 5 : Test for UTF-8 connection to Latin-1 DB .
Author :
-module(utf8_to_latindb_SUITE).
-compile(export_all).
-include_lib("common_test/include/ct.hrl").
-record(hello_record, {hello_text}).
suite() ->
[{timetrap,{seconds,60}}].... |
7b4bd17826dfe50ade30616263431f45400a9761b2cf45d9cfe4a400d4fb35d3 | clojure-quant/infra-guix | printer.scm | (define-module (awb99 config printer)
#:export (service-printer))
(use-modules
(gnu packages cups)
(gnu services)
(gnu services cups))
printer : HP LJ Pro MFP M148fdw MFG Laser
; -linux-imaging-and-printing
; guix install hplip
HP LaserJet m14 - m17 , hpcups 3.21.10
(define service-printer
(service... | null | https://raw.githubusercontent.com/clojure-quant/infra-guix/28af74a350fb9d17d8ca6e2c13946d486e019a4b/modules/awb99/config/printer.scm | scheme | -linux-imaging-and-printing
guix install hplip | (define-module (awb99 config printer)
#:export (service-printer))
(use-modules
(gnu packages cups)
(gnu services)
(gnu services cups))
printer : HP LJ Pro MFP M148fdw MFG Laser
HP LaserJet m14 - m17 , hpcups 3.21.10
(define service-printer
(service cups-service-type
(cups-configuration
(defau... |
ed8b9aa9c0cd5fb702e24f53c41e67f03c91da6cfdca8a7d64026b45b5096960 | racket/macro-debugger | context.rkt | #lang racket/base
(require (for-syntax racket/base syntax/transformer)
racket/match
syntax/stx
"stx-util.rkt")
(provide sexpr-path?
empty-path
path-add-ref
path-add-car
path-add-cdr
path-add-cdrs
path-get
path-get-until
p... | null | https://raw.githubusercontent.com/racket/macro-debugger/d4e2325e6d8eced81badf315048ff54f515110d5/macro-debugger-text-lib/macro-debugger/model/context.rkt | racket | note: does not check well-formed
- 'car -- represents car
- PositiveInteger -- represents nth tail (n cdrs, n>0)
----
Removes a as a prefix of b (or returns #f if a is not a prefix of b).
path-reverse : Path -> Path | #lang racket/base
(require (for-syntax racket/base syntax/transformer)
racket/match
syntax/stx
"stx-util.rkt")
(provide sexpr-path?
empty-path
path-add-ref
path-add-car
path-add-cdr
path-add-cdrs
path-get
path-get-until
p... |
7465e78dfe27c6231b4df96debccfd3c3ec2ba335029d96f01c21e324c12f339 | takikawa/racket-ppa | run-pdflatex.rkt | #lang racket/base
(require racket/system racket/port)
(provide run-pdflatex run-dvipdf-latex run-xelatex run-lualatex)
(define (run-pdflatex file [notify void]) (run file notify 'pdflatex))
(define (run-dvipdf-latex file [notify void])
(parameterize ([function-name 'run-dvipdf-latex])
(run file notify 'dvipdf... | null | https://raw.githubusercontent.com/takikawa/racket-ppa/5f2031309f6359c61a8dfd1fec0b77bbf9fb78df/share/pkgs/scribble-lib/scribble/private/run-pdflatex.rkt | racket | * Label(s) may have changed. Rerun to get cross-references right.
a good path environment, so put likely candidates
for directories holding latex/pdflatex binaries
here so that the "scribble pdf" button is more | #lang racket/base
(require racket/system racket/port)
(provide run-pdflatex run-dvipdf-latex run-xelatex run-lualatex)
(define (run-pdflatex file [notify void]) (run file notify 'pdflatex))
(define (run-dvipdf-latex file [notify void])
(parameterize ([function-name 'run-dvipdf-latex])
(run file notify 'dvipdf... |
8a714b2f8b17ef0a7d6cda37217a5fa472ab4030135d0622943d02994a592339 | ideas-edu/ideas | Arith1.hs | -- Automatically generated from content dictionary arith1.ocd. Do not change.
module Ideas.Text.OpenMath.Dictionary.Arith1 where
import Ideas.Text.OpenMath.Symbol
| List of symbols defined in dictionary
arith1List :: [Symbol]
arith1List = [lcmSymbol, gcdSymbol, plusSymbol, unaryMinusSymbol, minusSymbol, t... | null | https://raw.githubusercontent.com/ideas-edu/ideas/f84907f92a8c407b7313f99e65a08d2646dc1565/src/Ideas/Text/OpenMath/Dictionary/Arith1.hs | haskell | Automatically generated from content dictionary arith1.ocd. Do not change.
| The symbol to represent the n-ary function to return the least common
multiple of its arguments.
| The symbol to represent the n-ary function to return the gcd (greatest
common divisor) of its arguments.
| The symbol representing an n-a... | module Ideas.Text.OpenMath.Dictionary.Arith1 where
import Ideas.Text.OpenMath.Symbol
| List of symbols defined in dictionary
arith1List :: [Symbol]
arith1List = [lcmSymbol, gcdSymbol, plusSymbol, unaryMinusSymbol, minusSymbol, timesSymbol, divideSymbol, powerSymbol, absSymbol, rootSymbol, sumSymbol, product... |
a86247ce7d63e4f29074039eb5fbaf3f4831d97e238e22be54bc97d90be52801 | racket/handin | info.rkt | #lang setup/infotab
(define scribblings '(("handin-server.scrbl" (multi-page))))
| null | https://raw.githubusercontent.com/racket/handin/a01b9cce0c2397d3e1049d4e6932b48b51e65b13/handin-server/scribblings/info.rkt | racket | #lang setup/infotab
(define scribblings '(("handin-server.scrbl" (multi-page))))
| |
46dd2b6a3cc0043ba5564e795b2bd81a6fa6e87b140049d9d3d3fc592bd81468 | cyga/real-world-haskell | WC.hs | -- file: ch01/WC.hs
-- lines beginning with "--" are comments.
main = interact wordCount
where wordCount input = show (length (lines input)) ++ "\n"
| null | https://raw.githubusercontent.com/cyga/real-world-haskell/4ed581af5b96c6ef03f20d763b8de26be69d43d9/ch01/WC.hs | haskell | file: ch01/WC.hs
lines beginning with "--" are comments. |
main = interact wordCount
where wordCount input = show (length (lines input)) ++ "\n"
|
3fe54b2df9371237dd837ca19fcfd25a8c140075963989777505e98cf77cf5be | aiju/lilith | util.ml | module H = Hashtbl
let locShow ((p1:Lexing.position),(p2:Lexing.position)) =
Format.sprintf "%s:%d-%d:%d-%d" p1.pos_fname p1.pos_lnum p2.pos_lnum p1.pos_cnum p2.pos_cnum
let error loc msg =
Format.fprintf (Format.err_formatter) "%s %s\n%!" (locShow loc) msg;
exit 1
let optionMap f x =
match x with
| Some x' -> ... | null | https://raw.githubusercontent.com/aiju/lilith/56a34309abb016d75c7aa25937f9350f337287d7/eva/util.ml | ocaml | module H = Hashtbl
let locShow ((p1:Lexing.position),(p2:Lexing.position)) =
Format.sprintf "%s:%d-%d:%d-%d" p1.pos_fname p1.pos_lnum p2.pos_lnum p1.pos_cnum p2.pos_cnum
let error loc msg =
Format.fprintf (Format.err_formatter) "%s %s\n%!" (locShow loc) msg;
exit 1
let optionMap f x =
match x with
| Some x' -> ... | |
edb1914d4478f4d3985071bd19c2fc79ce6046e9925870205751c17318acb30f | elastic/eui-cljs | icon_token_event.cljs | (ns eui.icon-token-event
(:require ["@elastic/eui/lib/components/icon/assets/tokenEvent.js" :as eui]))
(def tokenEvent eui/icon)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/icon_token_event.cljs | clojure | (ns eui.icon-token-event
(:require ["@elastic/eui/lib/components/icon/assets/tokenEvent.js" :as eui]))
(def tokenEvent eui/icon)
| |
f35c40c2e362bf3c34b417f69cdc2a14820b174bd40f56addc86915949d3e67d | ocaml-multicore/tezos | prevalidator_worker_state.mli | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
Copyright ( c... | null | https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/lib_shell_services/prevalidator_worker_state.mli | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
Copyright ( c ) 2018 - 2021 Nomadic Labs . < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , W... |
46e9504378172493e8e030a81b106c624915e721ef6bc1e71d7f287c34ff12eb | wangweihao/ProgrammingErlangAnswer | fileServer.erl | -module(fileServer).
-export([run/3]).
run(MM, ArgC, ArgS) ->
io:format("Ready go!~n"
"ArgC = ~p ArgS = ~p~n", [ArgC, ArgS]),
loop(MM).
loop(MM) ->
receive
{chan, MM, {putfile, Bin, Newname}} ->
Ret = file:write_file(Newname, Bin),
MM ! {send, Newname},
... | null | https://raw.githubusercontent.com/wangweihao/ProgrammingErlangAnswer/b145b5e6a19cb866ce5d2ceeac116d751f6e2b3d/14/partice/socket_dist/fileServer.erl | erlang | -module(fileServer).
-export([run/3]).
run(MM, ArgC, ArgS) ->
io:format("Ready go!~n"
"ArgC = ~p ArgS = ~p~n", [ArgC, ArgS]),
loop(MM).
loop(MM) ->
receive
{chan, MM, {putfile, Bin, Newname}} ->
Ret = file:write_file(Newname, Bin),
MM ! {send, Newname},
... | |
59540e5d53b3725ebe23c5c7d08362a01557d38e6a3e31c0b10e09b91fad8002 | clj-kondo/clj-kondo | hooks.clj | (ns hooks
(:require [clj-kondo.hooks-api :as api]))
(defn my-print [{:keys [node]}]
{:node (with-meta (api/list-node (list* (api/token-node 'clojure.core/println) (rest (:children node))))
{:clj-kondo/ignore [:discouraged-var]})})
| null | https://raw.githubusercontent.com/clj-kondo/clj-kondo/8e5f20c0328c3ec7610edc9b2241cc06977b1d86/corpus/issue-1980/.clj-kondo/hooks.clj | clojure | (ns hooks
(:require [clj-kondo.hooks-api :as api]))
(defn my-print [{:keys [node]}]
{:node (with-meta (api/list-node (list* (api/token-node 'clojure.core/println) (rest (:children node))))
{:clj-kondo/ignore [:discouraged-var]})})
| |
414e1bfdfef28b0932f568f6c04ff2d3bde2d3738c7eb41197f3080a34664e98 | full-spectrum/neo4clj | client_test.clj | (ns neo4clj.client-test
(:require [clojure.test :as t]
[neo4clj.client :as sut]
[neo4clj.test-utils :as test-utils]))
(t/deftest with-session
;; This test also tests the create-session and execute! function
(t/testing "Run cyphers in a Neo4j session"
(test-utils/with-db [conn {:initia... | null | https://raw.githubusercontent.com/full-spectrum/neo4clj/7dd2466da27cbeccd5494efe4ff20307d83d1153/neo4clj-core/test/neo4clj/client_test.clj | clojure | This test also tests the create-session and execute! function
This test also tests the begin-transaction, commit!, rollback and execute!
This test also tests the with-read function
This test also tests the with-write-conn function
Tests the creation of an fn to execute later | (ns neo4clj.client-test
(:require [clojure.test :as t]
[neo4clj.client :as sut]
[neo4clj.test-utils :as test-utils]))
(t/deftest with-session
(t/testing "Run cyphers in a Neo4j session"
(test-utils/with-db [conn {:initial-data ["CREATE (n:TestNode) RETURN n"]}]
(t/is (= [{"n" {:la... |
7633bb1bb30f6d77b114c85988c9f28bd8aa0cbd362bc0a5fc7b6498e1bb80b8 | essen/egs | egs_patch_files_db.erl | @author < >
2010 - 2011 .
@doc EGS patch files database and cache manager .
%%
This file is part of EGS .
%%
EGS is free software : you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation , either version 3 of the... | null | https://raw.githubusercontent.com/essen/egs/ceea04c3b438cee9a8470f2abc6297429bf347c5/apps/egs_patch/src/egs_patch_files_db.erl | erlang |
License, or (at your option) any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General Public License for more details.
API.
gen_server.
Use the module name for the server's name.
API.
gen_server.
The ... | @author < >
2010 - 2011 .
@doc EGS patch files database and cache manager .
This file is part of EGS .
EGS is free software : you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation , either version 3 of the
EGS... |
443e3d2dfb89d0b0e9785c3472b2020e359b31c2e3dc540b7af4f65bb420bb75 | derekmcloughlin/pearls | chap13d.hs | module Main
where
import Data.List
import Data.Array
import System.IO
import System.Environment
transform :: Ord a => [a] -> ([a], Int)
transform xs = (map last xss, position xs xss)
where
xss = sort (rots xs)
position xs xss = length (takeWhile (/= xs) xss)
rots :: [a] -> [[a]]
rots xs = t... | null | https://raw.githubusercontent.com/derekmcloughlin/pearls/42bc6ea0fecc105386a8b75789f563d44e05b772/chap13/chap13d.hs | haskell | call of `recreate` needs to be the length of the transformed string.
Note: because of the use of '\0', the type
of this function is restricted to character arrays only.
In GHCI:
:t transform'
| module Main
where
import Data.List
import Data.Array
import System.IO
import System.Environment
transform :: Ord a => [a] -> ([a], Int)
transform xs = (map last xss, position xs xss)
where
xss = sort (rots xs)
position xs xss = length (takeWhile (/= xs) xss)
rots :: [a] -> [[a]]
rots xs = t... |
7f20b7c809da379b91b2b27b5e2e086420dc9f317cbe85c3b6478bba000be3aa | helium/relcast | handler1.erl | -module(handler1).
-behavior(relcast).
-export([
init/1,
handle_command/2,
handle_message/3,
callback_message/3,
serialize/1,
deserialize/1,
restore/2
]).
-record(state, {
a :: atom(),
b :: atom(),
... | null | https://raw.githubusercontent.com/helium/relcast/1df12fdbfaf416eaeee2ae0bb55065cc380a2523/test/handler1.erl | erlang | -module(handler1).
-behavior(relcast).
-export([
init/1,
handle_command/2,
handle_message/3,
callback_message/3,
serialize/1,
deserialize/1,
restore/2
]).
-record(state, {
a :: atom(),
b :: atom(),
... | |
cb70cba17a64e83bc6fd9e9d3990b4d094859e50a7c6c54906b95721d1fe0233 | tsoding/HyperNerd | Command.hs | # LANGUAGE ViewPatterns #
{-# LANGUAGE TypeSynonymInstances #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE DeriveFunctor #
module Command where
import Data.Char
import qualified Data.Map as M
import Data.Maybe
import qualified Data.Text as T
import Reaction
import Safe
import Transport
data BuiltinCommand = Built... | null | https://raw.githubusercontent.com/tsoding/HyperNerd/5322580483c5c05179bc455a6f94566d398bccdf/src/Command.hs | haskell | # LANGUAGE TypeSynonymInstances #
# LANGUAGE OverloadedStrings # | # LANGUAGE ViewPatterns #
# LANGUAGE DeriveFunctor #
module Command where
import Data.Char
import qualified Data.Map as M
import Data.Maybe
import qualified Data.Text as T
import Reaction
import Safe
import Transport
data BuiltinCommand = BuiltinCommand
{ bcDescription :: T.Text
, bcGitHubLocation :: T.Text
, ... |
1bdbaafce73c09ce2d2ccce1b166c0941c4d203969f8018b9bac42746b7509aa | jesuswr/language-bender | AST.hs |
Module defining AST data types and related functions
Module defining AST data types and related functions
-}
module FrontEnd.AST where
import qualified FrontEnd.Utils as U
import Data.List as L
-- | Type Definition
32
32
8
8
| TArray { arrType :: Type, size :: Expr }
32
| TUnit
32
... | null | https://raw.githubusercontent.com/jesuswr/language-bender/03bca9e18dfeb4db67190c9ff13c7983489394e7/language-bender/src/FrontEnd/AST.hs | haskell | | Type Definition
| Declaration of new things
| Binary Operators
| Unary operators
| Possible expressions. Remember, everything its an expression
| Program data type
-------- < show instances > -----------
--------------------------------------- |
Module defining AST data types and related functions
Module defining AST data types and related functions
-}
module FrontEnd.AST where
import qualified FrontEnd.Utils as U
import Data.List as L
32
32
8
8
| TArray { arrType :: Type, size :: Expr }
32
| TUnit
32
| CustomTyp... |
73ff237e49585c9fdb6facfeaf1ed02bf933fb7464ac543fe9a6813991e0a572 | fpco/ide-backend | Script.hs | -----------------------------------------------------------------------------
-- |
-- Module : Distribution.Simple.Program.Script
Copyright : 2009
--
-- Maintainer :
-- Portability : portable
--
-- This module provides an library interface to the @hc-pkg@ program.
Currently only GHC and LHC have hc... | null | https://raw.githubusercontent.com/fpco/ide-backend/860636f2d0e872e9481569236bce690637e0016e/ide-backend/TestSuite/inputs/Cabal-1.14.0/Distribution/Simple/Program/Script.hs | haskell | ---------------------------------------------------------------------------
|
Module : Distribution.Simple.Program.Script
Maintainer :
Portability : portable
This module provides an library interface to the @hc-pkg@ program.
as appropriate for the given system.
| Generate a POSIX shell script that i... | Copyright : 2009
Currently only GHC and LHC have hc - pkg programs .
module Distribution.Simple.Program.Script (
invocationAsSystemScript,
invocationAsShellScript,
invocationAsBatchFile,
) where
import Distribution.Simple.Program.Run
( ProgramInvocation(..) )
import Distribution.Sys... |
6a51fe7cdfff9096224981cd8d34c451dc394db9c78b5434b3dbf80d5fa7bbb9 | fetburner/Coq2SML | doubleTypeInference.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/fetburner/Coq2SML/322d613619edbb62edafa999bff24b1993f37612/coq-8.4pl4/plugins/xml/doubleTypeInference.mli | ocaml | **********************************************************************
**********************************************************************
This file is distributed under the terms of the
... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
// * The HELM Proje... |
f97a8111b628067d35d3573195343010723ea48351873d6582424c4b91f8e948 | yogthos/mastodon-bot | mastodon_api_test.cljs | (ns mastodon-bot.mastodon-api-test
(:require
[cljs.test :refer-macros [deftest is testing run-tests]]
[clojure.spec.alpha :as s]
[mastodon-bot.mastodon-api :as sut]
))
(def intermediate-rss-item {:created-at #inst "2020-06-26T12:17:33.000-00:00"
:text "Taking Theatre Online wi... | null | https://raw.githubusercontent.com/yogthos/mastodon-bot/2aadf55a0dacd739f0e9b61499aff55f0b1e7beb/src/test/mastodon_bot/mastodon_api_test.cljs | clojure | (ns mastodon-bot.mastodon-api-test
(:require
[cljs.test :refer-macros [deftest is testing run-tests]]
[clojure.spec.alpha :as s]
[mastodon-bot.mastodon-api :as sut]
))
(def intermediate-rss-item {:created-at #inst "2020-06-26T12:17:33.000-00:00"
:text "Taking Theatre Online wi... | |
58cf267715f2477d20f2e2be1ba93a73eadad5eb1b1f94754a06796dcbc708e3 | erszcz/euc-2014 | privacy.erl | -module(privacy).
-compile([export_all]).
%%-include("../apps/ejabberd/include/mod_privacy.hrl").
-record(privacy, {us,
default = none,
lists = []}).
-define(MAX_ORDER, 5).
-define(MAX_LIST_SIZE, 5).
-define(LIST_NAME_MAGIC, 100000).
-define(MAX_LISTS, 5).
-define(ensure_type(X), case Type of binary -> lis... | null | https://raw.githubusercontent.com/erszcz/euc-2014/d44dfc36ec68e9adf67abcb8b0318587f97ae436/privacy.erl | erlang | -include("../apps/ejabberd/include/mod_privacy.hrl").
maybe someday
subscription -> ok;
group -> ok
TODO: add a list with name that can be determined from jid | -module(privacy).
-compile([export_all]).
-record(privacy, {us,
default = none,
lists = []}).
-define(MAX_ORDER, 5).
-define(MAX_LIST_SIZE, 5).
-define(LIST_NAME_MAGIC, 100000).
-define(MAX_LISTS, 5).
-define(ensure_type(X), case Type of binary -> list_to_binary(X); string -> X end).
-define(ensure_list(X)... |
9258b9a7b1ca5da644df6a62e4a85ce35312408d55e48ff97c166b360c83d25f | gregtatcam/imaplet-lwt | lazys.ml | open Core_replace
module Lazy_m : sig
include module type of Lazy
val of_fun : (unit -> 'a) -> 'a lazy_t
val of_val : 'a -> 'a lazy_t
end = struct
include Lazy
let of_fun = Lazy.from_fun
let of_val = Lazy.from_val
end
module Lazy_list : sig
type 'a t
val fold_left : f:('a -> 'b -> 'a) -> init:'a -> '... | null | https://raw.githubusercontent.com/gregtatcam/imaplet-lwt/d7b51253e79cffa97e98ab899ed833cd7cb44bb6/lib/parsemail/lazys.ml | ocaml | Cons | open Core_replace
module Lazy_m : sig
include module type of Lazy
val of_fun : (unit -> 'a) -> 'a lazy_t
val of_val : 'a -> 'a lazy_t
end = struct
include Lazy
let of_fun = Lazy.from_fun
let of_val = Lazy.from_val
end
module Lazy_list : sig
type 'a t
val fold_left : f:('a -> 'b -> 'a) -> init:'a -> '... |
f21733b29e025eae0de595ff5737f051b08804be06edef5c38eb7998772ab5eb | robert-strandh/Gsharp | utilities.lisp | (cl:in-package #:gsharp-utilities)
;;; Destructively insert the element in the list at the position
indicated . The position must be greater than or equal to zero and
;;; less than or equal to the length of the list.
(defun ninsert-element (element list position)
(if (zerop position)
(push element list)
... | null | https://raw.githubusercontent.com/robert-strandh/Gsharp/20b4a30ebf1e211bf421563278d425b3b06607e9/utilities.lisp | lisp | Destructively insert the element in the list at the position
less than or equal to the length of the list.
The 'direct-superclasses' argument to ensure-class is a list of
either classes or their names. Since we want to avoid duplicates,
we need an appropriate equivalence predicate:
Unicode utilities | (cl:in-package #:gsharp-utilities)
indicated . The position must be greater than or equal to zero and
(defun ninsert-element (element list position)
(if (zerop position)
(push element list)
(push element (cdr (nthcdr (1- position) list))))
list)
(defun class-equalp (c1 c2)
(when (symbolp c1) (s... |
d63fa03bbb3c4d0d44f962a5af223c2aa1707328faabbfc7b8a84b578634cf97 | patperry/hs-linear-algebra | Matrix.hs | # LANGUAGE ScopedTypeVariables #
module Matrix
where
import Driver
import Monadic
import qualified Data.Array as Array
import Data.Elem.BLAS
import Data.Matrix.Dense
import Data.Matrix.Dense.ST
import Data.Vector.Dense
import Data.Vector.Dense.ST
import Test.Matrix.Dense hiding ( matrix )
import qualified Test.... | null | https://raw.githubusercontent.com/patperry/hs-linear-algebra/887939175e03687b12eabe2fce5904b494242a1a/tests-old/Matrix.hs | haskell | # LANGUAGE ScopedTypeVariables #
module Matrix
where
import Driver
import Monadic
import qualified Data.Array as Array
import Data.Elem.BLAS
import Data.Matrix.Dense
import Data.Matrix.Dense.ST
import Data.Vector.Dense
import Data.Vector.Dense.ST
import Test.Matrix.Dense hiding ( matrix )
import qualified Test.... | |
8d5992135d506bcc892c731faf0693a698a2c247c2a06e50829aa7bdccb6ec3b | listx/listx_blog | rpn.hs | import Data.Char (isDigit)
data Term
= TermInt Integer
| TermOp (Integer -> Integer -> Integer)
evaluate :: String -> [Integer]
evaluate = evalTerms . map mkTerm . words
mkTerm :: String -> Term
mkTerm termStr = case termStr of
"+" -> TermOp (+)
"-" -> TermOp (-)
"*" -> TermOp (*)
_
| all isDigit ter... | null | https://raw.githubusercontent.com/listx/listx_blog/2c6685bae365c4d63818997f1ee74f158b35e29d/code/toy/rpn.hs | haskell | import Data.Char (isDigit)
data Term
= TermInt Integer
| TermOp (Integer -> Integer -> Integer)
evaluate :: String -> [Integer]
evaluate = evalTerms . map mkTerm . words
mkTerm :: String -> Term
mkTerm termStr = case termStr of
"+" -> TermOp (+)
"-" -> TermOp (-)
"*" -> TermOp (*)
_
| all isDigit ter... | |
f5ea8b1b7b28ff5161f212d660c2a273f57f31e83c6027c76571d044c4830e1b | huangz1990/real-world-haskell-cn | greyMap.hs | -- file: ch12/Barcode.hs
type Greymap = Array (Int,Int) Pixel
pixmapToGreymap :: Pixmap -> Greymap
pixmapToGreymap = fmap luminance | null | https://raw.githubusercontent.com/huangz1990/real-world-haskell-cn/f67b07dd846b1950d17ff941d650089fcbbe9586/code/ch12/greyMap.hs | haskell | file: ch12/Barcode.hs | type Greymap = Array (Int,Int) Pixel
pixmapToGreymap :: Pixmap -> Greymap
pixmapToGreymap = fmap luminance |
dd297fd8cf17d1c3bc7fe5cba198da300edeb221efcc0f8cf2a1bf80dc8da5df | martinklepsch/tenzing | app.cljs | (ns {{name}}.app)
(defn init []
(let [c (.. js/document (createElement "DIV"))]
(aset c "innerHTML" "<p>i'm dynamically created</p>")
(.. js/document (getElementById "container") (appendChild c))))
| null | https://raw.githubusercontent.com/martinklepsch/tenzing/d147f988128f3377be7d94c6cbf78d01d481c86e/resources/leiningen/new/tenzing/app.cljs | clojure | (ns {{name}}.app)
(defn init []
(let [c (.. js/document (createElement "DIV"))]
(aset c "innerHTML" "<p>i'm dynamically created</p>")
(.. js/document (getElementById "container") (appendChild c))))
| |
b4ec6c9a4de12c1e7c561814c464823ba3c71ab98565e74a9e197cfd221e7fc4 | jyp/MarXup | Core.hs | # LANGUAGE RecordWildCards #
module MarXup.PrettyPrint.Core(Doc(..),pretty,group,flatten,space,spacing,BoxTex(..)) where
import Data.Monoid
import MarXup (textual)
import MarXup.Latex
import MarXup.Tex
import MarXup.MultiRef
import Graphics.Diagrams.Core (BoxSpec (..))
import MarXup.Diagram.Tikz (showDistance)
import ... | null | https://raw.githubusercontent.com/jyp/MarXup/f9ff1d4aa076dd0844557001b61dff38c5a34a20/MarXup/PrettyPrint/Core.hs | haskell | True <=> when undone by group, do not insert a space
| Document "process"
Line, indented.
current indentation
total number of non-space tokens produced
tokens produced, in reverse order
rest of the input document to process
The ⟨filtering⟩ step takes all process states starting at the current
line, and discard... | # LANGUAGE RecordWildCards #
module MarXup.PrettyPrint.Core(Doc(..),pretty,group,flatten,space,spacing,BoxTex(..)) where
import Data.Monoid
import MarXup (textual)
import MarXup.Latex
import MarXup.Tex
import MarXup.MultiRef
import Graphics.Diagrams.Core (BoxSpec (..))
import MarXup.Diagram.Tikz (showDistance)
import ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.