_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 |
|---|---|---|---|---|---|---|---|---|
808c49c5b154df49fc4614a3ac9f2b570ef52c73027d1ad34678c67ebd86cbb0 | degree9/material-hl | checkbox.cljs | (ns material-hl.checkbox
(:require [hoplon.core :as hl]
[material-hl.core :as core]
[hoplon.svg :as svg]))
(def ^:dynamic *dark* nil)
(hl/defelem checkbox [attr kids]
(let [dark (:dark attr *dark*)]
(hl/div
(core/assoc-class attr
{:mdc-checkbox true
:... | null | https://raw.githubusercontent.com/degree9/material-hl/01d50358293679c1ee9f65d2aa4f0b91863ea278/src/material_hl/checkbox.cljs | clojure | (ns material-hl.checkbox
(:require [hoplon.core :as hl]
[material-hl.core :as core]
[hoplon.svg :as svg]))
(def ^:dynamic *dark* nil)
(hl/defelem checkbox [attr kids]
(let [dark (:dark attr *dark*)]
(hl/div
(core/assoc-class attr
{:mdc-checkbox true
:... | |
e811a697d36a2bac4df4d9c4286f4248572b7082374f82174dc7344bed87dd87 | janestreet/ecaml | input_event.mli | (** [(Info-goto-node "(elisp)Input Events")] *)
open! Core
open! Import
include Input_event0_intf.Input_event0_public with type t = Input_event0.t
* [ create_exn string ] is a specialized version of [ Key_sequence.create ] that raises
unless [ string ] denotes a key sequence of length one .
[ ( describe ... | null | https://raw.githubusercontent.com/janestreet/ecaml/7c16e5720ee1da04e0757cf185a074debf9088df/src/input_event.mli | ocaml | * [(Info-goto-node "(elisp)Input Events")]
* [(describe-function 'event-basic-type)]
[(Info-goto-node "(elisp)Classifying Events")]
* [(describe-function 'event-modifiers)]
[(Info-goto-node "(elisp)Classifying Events")]
* [(describe-function 'recent-keys)]
[(Info-goto-node "(elisp)Recording Input")]
* [... |
open! Core
open! Import
include Input_event0_intf.Input_event0_public with type t = Input_event0.t
* [ create_exn string ] is a specialized version of [ Key_sequence.create ] that raises
unless [ string ] denotes a key sequence of length one .
[ ( describe - function ' ) ]
[ ( Info - goto - node "... |
ea36929a7639415eba336c844c7ea85c011d3f26003450afd781d656b6058196 | xapi-project/xcp-rrdd | rrdd_shared.ml |
* Copyright ( C ) Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file LI... | null | https://raw.githubusercontent.com/xapi-project/xcp-rrdd/f810004ae88d308043b73365a959562302b1d4b5/bin/rrdd/rrdd_shared.ml | ocaml | Whether to enable all non-default datasources
The time between each monitoring loop.
Timestamp of the last monitoring loop end.
The mutex that protects the last_loop_end_time against data corruption.
* Cache memory/target values
* Pool secret.
These are purely for xenrt testing.
RRDs
* Helper function - p... |
* Copyright ( C ) Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file LI... |
0c451111b40b3d12a0276098bdc7917799b66d525ce8d41d4b9e60cf6edf9401 | kadena-io/chainweb-node | Sync.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE NumericUnderscores #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
module Chainweb.Test.Mempool.Sync (tests) where
------------------------------------------------------------------------------
import qualified Control.Concurrent.... | null | https://raw.githubusercontent.com/kadena-io/chainweb-node/731ce2bae1040070af0b84be92b1ffb77e9a247a/test/Chainweb/Test/Mempool/Sync.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings #
----------------------------------------------------------------------------
----------------------------------------------------------------------------
----------------------------------------------------------------------------
expect remote to deliver transa... | # LANGUAGE NumericUnderscores #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
module Chainweb.Test.Mempool.Sync (tests) where
import qualified Control.Concurrent.Async as Async
import Control.Concurrent.MVar
import Control.Monad (void, when)
import Control.Monad.IO.Class (liftIO)
import Control.Monad.Tran... |
42a1c636741050791f139ee8ec7ae920b6f500c97eb04c5616dfcbade651000f | simedw/Kandidat | Pretty.hs | # LANGUAGE NoMonomorphismRestriction #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
module Parser.Pretty.Pretty where
import Unsafe.Coerce
import Stg.AST
import Stg.Types
import Stg.Stack
import Text.PrettyPrint.ANSI.Leijen
data Syntax t = Syntax
{ equal :: Doc
, operator :: String -> D... | null | https://raw.githubusercontent.com/simedw/Kandidat/fbf68edf5b003aba2ce13dac32ee1b94172d57d8/src/Parser/Pretty/Pretty.hs | haskell | x -> text (show (unsafeCoerce x :: Cont String)) | # LANGUAGE NoMonomorphismRestriction #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
module Parser.Pretty.Pretty where
import Unsafe.Coerce
import Stg.AST
import Stg.Types
import Stg.Stack
import Text.PrettyPrint.ANSI.Leijen
data Syntax t = Syntax
{ equal :: Doc
, operator :: String -> D... |
b14276c55f19275b52b2b9af1ba15b50888d2718fd43bb7dc8b36fbb07bb840f | zeniuseducation/poly-euler | core_test.clj | (ns alfa.core-test
(:require [clojure.test :refer :all]
[alfa.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| null | https://raw.githubusercontent.com/zeniuseducation/poly-euler/734fdcf1ddd096a8730600b684bf7398d071d499/Alfa/test/alfa/core_test.clj | clojure | (ns alfa.core-test
(:require [clojure.test :refer :all]
[alfa.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
| |
9f89ea9371dfce35d52847d3160ad7af7e68a2cb73b4c952581f30a9c14d98bb | ocurrent/ocurrent-deployer | s.ml | module type T = sig
type build_info
type deploy_info
val build :
build_info ->
?additional_build_args:string list Current.t ->
Current_github.Repo_id.t ->
Current_git.Commit_id.t Current.t -> unit Current.t
val name : deploy_info -> string
* A unique service name to use in the Slack notificati... | null | https://raw.githubusercontent.com/ocurrent/ocurrent-deployer/e60eb1677ec70c8b9e1b28ef312eff97368f3b4c/src/s.ml | ocaml | module type T = sig
type build_info
type deploy_info
val build :
build_info ->
?additional_build_args:string list Current.t ->
Current_github.Repo_id.t ->
Current_git.Commit_id.t Current.t -> unit Current.t
val name : deploy_info -> string
* A unique service name to use in the Slack notificati... | |
2edf7329f4eb37335b33cfcc6107e444565f25fd65db91bc2cad16d3c8a4576c | siclait/6.824-cljlabs-2020 | sequential.clj | (ns map-reduce.sequential
"MapReduce code for 6.824 2020 Lab 1."
(:require [clojure.java.io :as io]
[clojure.string :as string]
[clojure.tools.cli :as cli]
[map-reduce.plugin :as plugin]
[map-reduce.plugin crash indexer mtiming nocrash rtiming wc]
[map-red... | null | https://raw.githubusercontent.com/siclait/6.824-cljlabs-2020/0c7ad7ae07d7617b1eb7240080c65f1937ca8a2d/map-reduce/src/map_reduce/sequential.clj | clojure | read each input file,
pass it to Map,
accumulate the intermediate Map output.
a big difference from real MapReduce is that all the
call Reduce on each distinct key in intermediate[],
and print the result to mr-out-0. | (ns map-reduce.sequential
"MapReduce code for 6.824 2020 Lab 1."
(:require [clojure.java.io :as io]
[clojure.string :as string]
[clojure.tools.cli :as cli]
[map-reduce.plugin :as plugin]
[map-reduce.plugin crash indexer mtiming nocrash rtiming wc]
[map-red... |
4a9bb80123d13ad37b278b030249cd2b406321bb0460bd775cb1c0c50c881bed | aloiscochard/codec-jvm | Attr.hs | {-# LANGUAGE OverloadedStrings #-}
module Codec.JVM.Attr where
import Data.ByteString (ByteString)
import Data.Binary.Put (Put, putByteString, putWord8, runPut)
import Data.Foldable (traverse_)
import Data.IntMap.Strict (IntMap)
import Data.Text (Text)
import Data.List (foldl')
import qualified Data.ByteString as BS
... | null | https://raw.githubusercontent.com/aloiscochard/codec-jvm/2e5b73a3eb35620ae49216c8c12f0bec82bcbe26/src/Codec/JVM/Attr.hs | haskell | # LANGUAGE OverloadedStrings #
TODO Exception table
| -4.html#jvms-4.7.4
Offsets are absolute (the delta conversion happen during serialization) | module Codec.JVM.Attr where
import Data.ByteString (ByteString)
import Data.Binary.Put (Put, putByteString, putWord8, runPut)
import Data.Foldable (traverse_)
import Data.IntMap.Strict (IntMap)
import Data.Text (Text)
import Data.List (foldl')
import qualified Data.ByteString as BS
import qualified Data.ByteString.La... |
273e3f9ebb1a2abef949b51f73828877089869519da4791e890f04db21c9ec92 | tanakh/ICFP2011 | Base.hs | module LTG.Base (
Card(..),
cards,
cardName,
nameToCard,
) where
import Data.Vector (Vector, fromList)
data Card = I | Zero | Succ | Dbl | Get | Put | S | K | Inc | Dec | Attack | Help | Copy | Revive | Zombie
deriving (Eq, Show)
cards :: Vector Card
cards = fromList [I , Zero , Succ , Dbl , Get ,... | null | https://raw.githubusercontent.com/tanakh/ICFP2011/db0d670cdbe12e9cef4242d6ab202a98c254412e/ai/LTG/Base.hs | haskell | module LTG.Base (
Card(..),
cards,
cardName,
nameToCard,
) where
import Data.Vector (Vector, fromList)
data Card = I | Zero | Succ | Dbl | Get | Put | S | K | Inc | Dec | Attack | Help | Copy | Revive | Zombie
deriving (Eq, Show)
cards :: Vector Card
cards = fromList [I , Zero , Succ , Dbl , Get ,... | |
07080a17d40b5c8ee069cc90728379fd2f100b14ab16553fe3cab22b4a99ed55 | nominolo/lambdachine | Jit0009.hs | # LANGUAGE NoImplicitPrelude , BangPatterns , MagicHash #
-- RUN: %bc_vm_chk
CHECK : @Result@ IND - > GHC.Bool . True`con_info
module Bc.Jit0009 where
import GHC.Prim
import GHC.Types
import GHC.Base
-- A trace that forces the register allocator to spill.
-- tail recursive
loop :: Int# -> Int# -> Int
loop 0# x = I... | null | https://raw.githubusercontent.com/nominolo/lambdachine/49d97cf7a367a650ab421f7aa19feb90bfe14731/tests/Bc/Jit0009.hs | haskell | RUN: %bc_vm_chk
A trace that forces the register allocator to spill.
tail recursive
not tail recursive
loop2 n x | trace (show (I# n, I# x)) False = undefined | # LANGUAGE NoImplicitPrelude , BangPatterns , MagicHash #
CHECK : @Result@ IND - > GHC.Bool . True`con_info
module Bc.Jit0009 where
import GHC.Prim
import GHC.Types
import GHC.Base
loop :: Int# -> Int# -> Int
loop 0# x = I# x
loop n x =
let !a = x +# 23#
!b = a *# 2#
!c = b +# 123#
!d = c +# 75... |
9cb2f2932567519141937512f817ef36426383a7e6495c0ff3876493ee0dbe0c | strange/erlang_v8_lib | erlang_v8_lib_pool.erl | -module(erlang_v8_lib_pool).
-behaviour(gen_server).
-export([start_link/1]).
-export([claim/0]).
-export([release/1]).
-export([eval/2]).
-export([call/3]).
-export([init/1]).
-export([handle_call/3]).
-export([handle_cast/2]).
-export([handle_info/2]).
-export([terminate/2]).
-export([code_change/3]).
-record(st... | null | https://raw.githubusercontent.com/strange/erlang_v8_lib/fe9a3e6c1eb87c3d8a0df61ff6410cc1adb0c773/src/erlang_v8_lib_pool.erl | erlang | Rand = random:uniform(NVMs),
The app has probably not been loaded properly yet. Attempt to
achieve the same effect by loading the priv dir relative to a
module with the same name as the app. This is a terrible idea
for several reasons, but the system will be replaced soon
anyway. | -module(erlang_v8_lib_pool).
-behaviour(gen_server).
-export([start_link/1]).
-export([claim/0]).
-export([release/1]).
-export([eval/2]).
-export([call/3]).
-export([init/1]).
-export([handle_call/3]).
-export([handle_cast/2]).
-export([handle_info/2]).
-export([terminate/2]).
-export([code_change/3]).
-record(st... |
c366cb8906c1fd2ee485871e5184981e98b8b4f833556572d8fdd97513b02b75 | kumarshantanu/cambium | util.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file LICENSE at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; the ... | null | https://raw.githubusercontent.com/kumarshantanu/cambium/8e0bce44f6bc9a37adb4182f1a9e65ef9ddf4152/cambium.core/src/cambium/codec/util.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file LICENSE at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove this ... | Copyright ( c ) . All rights reserved .
(ns cambium.codec.util
(:require
[clojure.edn :as edn]))
(defn as-str
"Turn given argument into string."
^String [^Object x]
(cond
(instance?
clojure.lang.Named x) (if-let [^String the-ns (namespace x)]
(let [^StringBu... |
2e78dc0df98e671e32c4189e84ab85b5fe030bda542baededd6afb61f48097e9 | ryanpbrewster/haskell | 075.hs | -- 075.hs
- It turns out that 12 cm is the smallest length of wire that can be bent to
- form an integer sided right angle triangle in exactly one way , but there are
- many more examples .
-
- 12 cm : ( 3,4,5 )
- 24 cm : ( 6,8,10 )
- 30 cm : ( 5,12,13 )
- 36 cm : ( 9,12,15 )
- 40 cm : ( 8,15... | null | https://raw.githubusercontent.com/ryanpbrewster/haskell/6edd0afe234008a48b4871032dedfd143ca6e412/project-euler/src/Old/075.hs | haskell | 075.hs |
- It turns out that 12 cm is the smallest length of wire that can be bent to
- form an integer sided right angle triangle in exactly one way , but there are
- many more examples .
-
- 12 cm : ( 3,4,5 )
- 24 cm : ( 6,8,10 )
- 30 cm : ( 5,12,13 )
- 36 cm : ( 9,12,15 )
- 40 cm : ( 8,15,17 )
-... |
0aa35daab252d30c7679d768ed045b4c6c9fd74f732d09530e0df16c70d8188a | NorfairKing/tickler | TicklesSpec.hs | {-# LANGUAGE OverloadedStrings #-}
module Tickler.Web.Server.Handler.TicklesSpec where
import Test.Syd.Yesod
import TestImport
import Tickler.Client
import Tickler.Web.Server.Foundation
import Tickler.Web.Server.TestUtils
spec :: Spec
spec = do
ticklerWebServerSpec $
describe "Tickles" $ do
it "gets a 20... | null | https://raw.githubusercontent.com/NorfairKing/tickler/1b0c05dc1d32847596bd3ffe4f93d094e1f6382a/tickler-web-server-gen/test/Tickler/Web/Server/Handler/TicklesSpec.hs | haskell | # LANGUAGE OverloadedStrings # |
module Tickler.Web.Server.Handler.TicklesSpec where
import Test.Syd.Yesod
import TestImport
import Tickler.Client
import Tickler.Web.Server.Foundation
import Tickler.Web.Server.TestUtils
spec :: Spec
spec = do
ticklerWebServerSpec $
describe "Tickles" $ do
it "gets a 200 for a logged-in user" $
w... |
2e9d97ab7950a2c07240d75c95c912040fa18cf0877a03f9319d94979ffa0fd4 | coq/coq | libnames.mli | (************************************************************************)
(* * 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/f227d8ed33a5ba2343de962f404b0b094dcc86a3/library/libnames.mli | 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... |
ec496b8b31c4b33d6710e1f2c740686dc243020b4893d1ae1cfee3016bc286fe | ocaml-multicore/ocaml-tsan | printf.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
and ... | null | https://raw.githubusercontent.com/ocaml-multicore/ocaml-tsan/ae9c1502103845550162a49fcd3f76276cdfa866/stdlib/printf.mli | ocaml | ************************************************************************
OCaml
... | and , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
val fprintf : out_channel -> ('a, out_channel, unit) format -> 'a
* [ ... argN ] formats the arguments
[ ... |
63eefe78cf038166f480b5230444cd973245823bb92c2248d4790b371a450c5b | NetComposer/nksip | nksip_parse_sipmsg.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2019 . All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the... | null | https://raw.githubusercontent.com/NetComposer/nksip/7fbcc66806635dc8ecc5d11c30322e4d1df36f0a/src/nksip_parse_sipmsg.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2019 . All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
@private SIP message parsi... |
0327070b5d1f11fde4efe0c4a6de79cc402b9e355a6ff47621944260b93b46f8 | NicklasBoto/funQ | Core.hs | {-# LANGUAGE OverloadedLists #-}
{-# LANGUAGE BlockArguments #-}
# OPTIONS_HADDOCK not - home #
{-|
Module : Core
Description : Core language
Stability : experimental
The core language operations.
-}
module Lib.Core (
-- * QBit manipulation
new
, measure
-- * Control f... | null | https://raw.githubusercontent.com/NicklasBoto/funQ/9444da05273be215a66044b976d031229d8832fc/src/Lib/Core.hs | haskell | # LANGUAGE OverloadedLists #
# LANGUAGE BlockArguments #
|
Module : Core
Description : Core language
Stability : experimental
The core language operations.
* QBit manipulation
* Control functions
* Distribution functions
* Bit
| Create new `QBit` from a bit.
| Performs a measurement operat... | # OPTIONS_HADDOCK not - home #
module Lib.Core (
new
, measure
, controlbit
, (===)
, dist
, ndist
, Data.Bit.Bit
) where
import Lib.QM ( QM, QBit(Ptr), io, put, get, modify, run, getState )
import Lib.Internal.Core ( findQbitProb1, remImpossibleStates, Prob, appendState, ... |
178cce51f63d031639faf57b379615730776874c2dca370861d2a1b05d9e0a78 | tommaisey/aeon | coin-gate.help.scm | ;; (coin-gate prob in)
;; When it receives a trigger, it tosses a coin, and either passes the
;; trigger or doesn't.
(let ((f (t-rand 300 400 (Coingate 0.8 (impulse kr 10 0)))))
(audition (out 0 (mul (sin-osc ar f 0) 0.2))))
(let* ((p 0.2)
(t (mul (impulse ar 20 0) (add (sin-osc kr 0.5 0) 1)))
(t* (t... | null | https://raw.githubusercontent.com/tommaisey/aeon/80744a7235425c47a061ec8324d923c53ebedf15/libs/third-party/sc3/rsc3/help/ugen/noise/coin-gate.help.scm | scheme | (coin-gate prob in)
When it receives a trigger, it tosses a coin, and either passes the
trigger or doesn't. |
(let ((f (t-rand 300 400 (Coingate 0.8 (impulse kr 10 0)))))
(audition (out 0 (mul (sin-osc ar f 0) 0.2))))
(let* ((p 0.2)
(t (mul (impulse ar 20 0) (add (sin-osc kr 0.5 0) 1)))
(t* (t-exp-rand (Mce 1000 1000) 12000 t))
(i (lambda () (Coingate (+ p (rand 0 0.1)) (mul t 0.5))))
(s (lambd... |
73a35f37b76470104487dbcadb45d3b813f2700a70088f2277b79f5a182b7413 | ohpauleez/lein-pedestal | war.clj | (ns leiningen.pedestal.war
(:require [clojure.data.xml :as xml]
[clojure.java.io :as io]
[leiningen.core.main :refer (leiningen-version)])
(:import (java.io ByteArrayInputStream
FileOutputStream)
(java.util.jar Manifest
JarEntry
... | null | https://raw.githubusercontent.com/ohpauleez/lein-pedestal/250fa7e2cce57b40159058fdee38fa35d1ef42eb/src/leiningen/pedestal/war.clj | clojure | web.xml construction
--------------------
We need to do `or` to prevent a premature exit
Manifest construction
---------------------
War construction
----------------- | (ns leiningen.pedestal.war
(:require [clojure.data.xml :as xml]
[clojure.java.io :as io]
[leiningen.core.main :refer (leiningen-version)])
(:import (java.io ByteArrayInputStream
FileOutputStream)
(java.util.jar Manifest
JarEntry
... |
b9f30aabe5ed08f69f74c065b085c8c68c7d16e1dfa3dd108fe721fe880221e3 | lilactown/helix-todo-mvc | storage.cljs | (ns todo-mvc.storage
(:require [cljs.reader :as reader]
[helix.hooks :as hooks]))
(defn get-storage [key]
(when-let [v (.getItem js/window.localStorage key)]
(reader/read-string v)))
(defn set-storage [key val]
(.setItem js/window.localStorage key (pr-str val)))
(defn use-persisted-reducer
([... | null | https://raw.githubusercontent.com/lilactown/helix-todo-mvc/bd1be0be6388264b70329817348c6cda616b6fdd/src/todo_mvc/storage.cljs | clojure | (ns todo-mvc.storage
(:require [cljs.reader :as reader]
[helix.hooks :as hooks]))
(defn get-storage [key]
(when-let [v (.getItem js/window.localStorage key)]
(reader/read-string v)))
(defn set-storage [key val]
(.setItem js/window.localStorage key (pr-str val)))
(defn use-persisted-reducer
([... | |
2f4c5895e729150ce812ed82bfb4636406d289cf5e4fdb0bc16389b9f264bec5 | sigscale/5g-ngap | ngap_sup.erl | ngap_sup.erl
%%% vim: ts=3
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2020 SigScale Global Inc.
%%% @end
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the L... | null | https://raw.githubusercontent.com/sigscale/5g-ngap/e4de7891a757d9587314d02f9e5598d51f8e7f5a/src/ngap_sup.erl | erlang | vim: ts=3
@end
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific langua... | ngap_sup.erl
2020 SigScale Global Inc.
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(ngap_sup).
-copyright('Copyright (c) 2020 SigScale Global Inc.').
-behaviour(supervisor).
-export([init/1]).
-spec init(A... |
fd9532049ea6080291d675008d267a2e9be9b2c1bd753886221eb572c719d28f | ktakashi/sagittarius-scheme | wrap.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
;;; crypto/wrap.scm - RFC 3394 AES Key Wrap Algorithm
;;;
Copyright ( c ) 2017 . All rights reserved .
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;... | null | https://raw.githubusercontent.com/ktakashi/sagittarius-scheme/ed1d5e34e3df5e6f1c1240b190ab959de5041455/ext/crypto/crypto/wrap.scm | scheme | coding : utf-8 ; -*-
crypto/wrap.scm - RFC 3394 AES Key Wrap Algorithm
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer.
notice, this list of ... | Copyright ( c ) 2017 . All rights reserved .
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
OWNER OR ANY DIRECT , INDIRECT , INCIDENTAL ,
... |
9dc606e36eb316277bb4bac8a0590ffe86b471445d94ef7b1dcbe0a1e10cb7f9 | Chris00/ocaml-cairo | tips_font.ml | (* This file is part of the tutorial
/
*)
open Cairo
let () =
let alphabet = "AbCdEfGhIjKlMnOpQrStUvWxYz" in
let surface = Cairo.Image.create Cairo.Image.ARGB32 ~w:780 ~h:30 in
let cr = Cairo.create surface in
Examples are in 26.0 x 1.0 coordinate space
Cairo.scale cr 30. 30.;
Cairo.set_font_size cr 0.... | null | https://raw.githubusercontent.com/Chris00/ocaml-cairo/202674a8d0c533b689ceacdb523ca167611e1b4c/examples/tips_font.ml | ocaml | This file is part of the tutorial
/
Drawing code goes here
Write output |
open Cairo
let () =
let alphabet = "AbCdEfGhIjKlMnOpQrStUvWxYz" in
let surface = Cairo.Image.create Cairo.Image.ARGB32 ~w:780 ~h:30 in
let cr = Cairo.create surface in
Examples are in 26.0 x 1.0 coordinate space
Cairo.scale cr 30. 30.;
Cairo.set_font_size cr 0.8;
Cairo.set_source_rgb cr 0.0 0.0 0.0;
... |
b4cb69c1941804a138b354a1a2d920a21276c7db69a09dcaaf1e0f51285c8e0a | composewell/streaming-benchmarks | ListTransformer.hs | -- |
Module : Benchmarks . ListTransformer
Copyright : ( c ) 2018
--
License : MIT
-- Maintainer :
module Benchmarks.ListTransformer where
import Benchmarks.Common (value, maxValue)
import Control.Monad (void, (>=>))
import Control.Monad.Trans.Class (lift)
import Prelude
(Monad, Int, (+... | null | https://raw.githubusercontent.com/composewell/streaming-benchmarks/256af0b1102dd720bb329147b6c3f952054ba062/Benchmarks/ListTransformer.hs | haskell | |
Maintainer :
-----------------------------------------------------------------------------
Benchmark ops
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Stream generation and elimination
----------------... | Module : Benchmarks . ListTransformer
Copyright : ( c ) 2018
License : MIT
module Benchmarks.ListTransformer where
import Benchmarks.Common (value, maxValue)
import Control.Monad (void, (>=>))
import Control.Monad.Trans.Class (lift)
import Prelude
(Monad, Int, (+), id, ($), (.), return, f... |
03a2e8b04f5144982fe981cda668f9491d5fdf0c5491f579093224f736e2ad28 | sharplispers/montezuma | req-excl-scorer.lisp | (in-package #:montezuma)
(defclass req-excl-scorer (scorer)
((req-scorer :initarg :req-scorer)
(excl-scorer :initarg :excl-scorer)
(first-time-p :initform T)))
(defmethod next? ((self req-excl-scorer))
(with-slots (first-time-p excl-scorer req-scorer) self
(when first-time-p
(when (not (next? excl... | null | https://raw.githubusercontent.com/sharplispers/montezuma/ee2129eece7065760de4ebbaeffaadcb27644738/src/search/req-excl-scorer.lisp | lisp | (in-package #:montezuma)
(defclass req-excl-scorer (scorer)
((req-scorer :initarg :req-scorer)
(excl-scorer :initarg :excl-scorer)
(first-time-p :initform T)))
(defmethod next? ((self req-excl-scorer))
(with-slots (first-time-p excl-scorer req-scorer) self
(when first-time-p
(when (not (next? excl... | |
a3a724ee252026c4da7bea7b53548d0a85b31c61ffb4268b1baeefd9bcc6b375 | clingen-data-model/genegraph | rocksdb_test.clj | (ns genegraph.rocksdb-test
(:require [genegraph.rocksdb :as sut]
[clojure.test :refer :all]))
(def test-db-name "test_rocks_instance")
(deftest rocksdb-function-test
(sut/rocks-destroy! test-db-name)
(with-open [db (sut/open test-db-name)]
(testing "single value key"
(sut/rocks-put! db "ke... | null | https://raw.githubusercontent.com/clingen-data-model/genegraph/624f649fb354842b7d62a106b022928eb05eb1ae/test/genegraph/rocksdb_test.clj | clojure | (ns genegraph.rocksdb-test
(:require [genegraph.rocksdb :as sut]
[clojure.test :refer :all]))
(def test-db-name "test_rocks_instance")
(deftest rocksdb-function-test
(sut/rocks-destroy! test-db-name)
(with-open [db (sut/open test-db-name)]
(testing "single value key"
(sut/rocks-put! db "ke... | |
10f234ae82f1f79ee78ed4af3d128df9839f21f63ab3b50542e2341fd2cc91ad | elaforge/karya | BlockUtil_test.hs | Copyright 2013
-- This program is distributed under the terms of the GNU General Public
-- License 3.0, see COPYING or -3.0.txt
module Derive.Call.BlockUtil_test where
import qualified Data.Map as Map
import qualified Derive.Args as Args
import qualified Derive.Call as Call
import qualified Derive.Call.CallTest a... | null | https://raw.githubusercontent.com/elaforge/karya/8ea15e6a5fb57e2f15f8c19836751e315f9c09f2/Derive/Call/BlockUtil_test.hs | haskell | This program is distributed under the terms of the GNU General Public
License 3.0, see COPYING or -3.0.txt
The pitch signal gets truncated so it doesn't look like the note's decay
wants to change pitch.
the performer to clip at the end time.
Also works if the pitch track is above. | Copyright 2013
module Derive.Call.BlockUtil_test where
import qualified Data.Map as Map
import qualified Derive.Args as Args
import qualified Derive.Call as Call
import qualified Derive.Call.CallTest as CallTest
import qualified Derive.Derive as Derive
import qualified Derive.DeriveTest as DeriveTest
import quali... |
6d18e729ef36061c7ef66e370cb65b9bfedb8b1b55ff2eb889b2005e03b5e601 | deadpendency/deadpendency | VisualBasicNetProject.hs | module DD.Effect.DetermineDependencies.Backend.LanguageFiles.DotNet.VisualBasicNetProject
( VisualBasicNetProjectInput (..),
)
where
import Common.Model.Dependency.Basic.BasicDependency
import Common.Model.Dependency.File.DependenciesFileType
import Common.Model.Ecosystem.ProgrammingLanguage
import DD.Effect.Deter... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/dependency-determiner/src/DD/Effect/DetermineDependencies/Backend/LanguageFiles/DotNet/VisualBasicNetProject.hs | haskell | module DD.Effect.DetermineDependencies.Backend.LanguageFiles.DotNet.VisualBasicNetProject
( VisualBasicNetProjectInput (..),
)
where
import Common.Model.Dependency.Basic.BasicDependency
import Common.Model.Dependency.File.DependenciesFileType
import Common.Model.Ecosystem.ProgrammingLanguage
import DD.Effect.Deter... | |
0309849119f7098acc688098420e3ee46062392f4d81861b437316ea7718f344 | awakesecurity/spectacle | Bag.hs | -- |
-- Module : Data.Bag
Copyright : ( c ) Arista Networks , 2022 - 2023
License : Apache License 2.0 , see LICENSE
--
-- Stability : stable
Portability : non - portable ( GHC extensions )
--
A @'Bag'@ of @'Node'@s .
--
@since 0.1.0.0
module Data.Bag
( Bag (None, Some),
empty,
... | null | https://raw.githubusercontent.com/awakesecurity/spectacle/430680c28b26dabb50f466948180eb59ba72fc8e/src/Data/Bag.hs | haskell | |
Module : Data.Bag
Stability : stable
---------------------------------------------------------------------------------------------------------------------
@
Bag a ~ Maybe [a]
@
@since 1.0.0
| An empty @'Bag'.
# INLINE (<*>) #
# INLINE (<>) #
# INLINE CONLIKE mempty #
# INLINE foldMap #
# INLINE... | Copyright : ( c ) Arista Networks , 2022 - 2023
License : Apache License 2.0 , see LICENSE
Portability : non - portable ( GHC extensions )
A @'Bag'@ of @'Node'@s .
@since 0.1.0.0
module Data.Bag
( Bag (None, Some),
empty,
cons,
singleton,
)
where
import Data.Kind (Type)
import ... |
099c64ef4a22bda78c849fc21357de13161089fa67a3b040283860fda64af50a | CafeOBJ/cafeobj | bflags.lisp | -*-Mode : LISP ; Package : CHAOS ; ; Syntax : Common - lisp -*-
;;;
Copyright ( c ) 2000 - 2015 , . All rights reserved .
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; * Redistributions of sou... | null | https://raw.githubusercontent.com/CafeOBJ/cafeobj/261e3a50407f568272321378df370e5cf7492aaf/chaos/primitives/bflags.lisp | lisp | Package : CHAOS ; ; Syntax : Common - lisp -*-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following... | Copyright ( c ) 2000 - 2015 , . All rights reserved .
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
(in-package :chaos)
#-:chaos-debug
(declaim (optimize (speed 3) (safety 0) #-GCL (debug 0)))
#+:chaos-debug
(declaim (optim... |
3a478cea69bdb4cd63d54ffa4bffc6ae885cc0d524692797437d1486fe960abf | clojure/tools.reader | default_data_readers.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; ... | null | https://raw.githubusercontent.com/clojure/tools.reader/d721510c37eb4d28247dd90c07c3c9a7dc3820ed/src/main/clojure/clojure/tools/reader/default_data_readers.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) . All rights reserved .
(ns ^:skip-wiki clojure.tools.reader.default-data-readers
(:import [java.util Calendar Date GregorianCalendar TimeZone]
[java.sql Timestamp]))
(defmacro ^:private fail
[msg]
`(throw (RuntimeException. ~msg)))
(defmacro ^:private verify
([test msg] `... |
247f2c89f9d589bdbf3a737ba2408dad2fed2ebb5f4060e090945ec07bd47e37 | stathissideris/positano | user.clj | (ns user
(:require [clojure.tools.namespace.repl :as ns-tools]))
(defn load-dev []
(require 'dev)
(in-ns 'dev)
nil)
(def dev load-dev)
(defn fix []
(ns-tools/refresh-all))
| null | https://raw.githubusercontent.com/stathissideris/positano/ca5126714b4bcf108726d930ab61a875759214ae/dev/user.clj | clojure | (ns user
(:require [clojure.tools.namespace.repl :as ns-tools]))
(defn load-dev []
(require 'dev)
(in-ns 'dev)
nil)
(def dev load-dev)
(defn fix []
(ns-tools/refresh-all))
| |
c78832af019b1b9ffa2fde286986d78c2ceb5f6ab796e880afa0c8b3910d0843 | souenzzo/souenzzo.github.io | main_test.clj | (ns ipfs.main-test
(:require [clojure.test :refer [deftest]]
[ipfs.main :as ipfs]
[midje.sweet :refer [fact =>]])
(:import (java.io OutputStream)))
(set! *warn-on-reflection* true)
(deftest hello
(let []
(fact
(ipfs/write "hello")
=> {})))
| null | https://raw.githubusercontent.com/souenzzo/souenzzo.github.io/30a811c4e5633ad07bba1d58d19eb091dac222e9/ipfs/test/ipfs/main_test.clj | clojure | (ns ipfs.main-test
(:require [clojure.test :refer [deftest]]
[ipfs.main :as ipfs]
[midje.sweet :refer [fact =>]])
(:import (java.io OutputStream)))
(set! *warn-on-reflection* true)
(deftest hello
(let []
(fact
(ipfs/write "hello")
=> {})))
| |
a020c0407cc5bdc1848c52fed816ba488ca0ee32149ae1ebe94a474b6d0ca734 | vikram/lisplibraries | usocket.lisp | $ I d : usocket.lisp 518 2010 - 01 - 13 07:01:21Z ctian $
;;;; $URL: svn-lisp.net/project/usocket/svn/usocket/trunk/usocket.lisp $
;;;; See LICENSE for licensing information.
(in-package :usocket)
(defparameter *wildcard-host* #(0 0 0 0)
"Hostname to pass when all interfaces in the current system are to be bound... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/usocket-svn/usocket.lisp | lisp | $URL: svn-lisp.net/project/usocket/svn/usocket/trunk/usocket.lisp $
See LICENSE for licensing information.
Iff an external-format was passed to `socket-connect' or `socket-listen'
the stream is a flexi-stream. Otherwise the stream is implementation
specific."
implementation specific
the list of all usockets
maps ... | $ I d : usocket.lisp 518 2010 - 01 - 13 07:01:21Z ctian $
(in-package :usocket)
(defparameter *wildcard-host* #(0 0 0 0)
"Hostname to pass when all interfaces in the current system are to be bound.")
(defparameter *auto-port* 0
"Port number to pass when an auto-assigned port number is wanted.")
(defconstant ... |
bf1c2c55cb85780460129a4b4abd805bf838f0d75ff19819eb3e6faa68352795 | Oblosys/proxima | Scanner.hs | module Scanner where
import CommonTypes
import LayLayerTypes
import LayLayerUtils
import DocTypes_Generated (Node (..))
tokenize :: Int -> Maybe Node -> Presentation doc Node clip ->
(Presentation doc Node clip, LayoutMap, Int)
-- tokenize _ pres = (pres, []) -- skip tokenize
tokenize ... | null | https://raw.githubusercontent.com/Oblosys/proxima/f154dff2ccb8afe00eeb325d9d06f5e2a5ee7589/invEditor/Scanner.hs | haskell | tokenize _ pres = (pres, []) -- skip tokenize
tokenize is tricky. The information for the token that is being built is threaded through the computation
although these are just inherited, not threaded
What happens if new pres id's are used. This would greatly simplify the scanning process
when integrating... | module Scanner where
import CommonTypes
import LayLayerTypes
import LayLayerUtils
import DocTypes_Generated (Node (..))
tokenize :: Int -> Maybe Node -> Presentation doc Node clip ->
(Presentation doc Node clip, LayoutMap, Int)
tokenize i loc (ParsingP id pres) = let (lc, layout, id, str, to... |
b05c7c9e6ac8e1a50dedd6c0cd2d40313f8beda77e603518ee8d9f512e476147 | massemanet/gtknode | treeview.erl | %%%-------------------------------------------------------------------
%%% File : treeview.erl
Author : Mats < locmacr@mwlx084 >
%%% Description : treeview demo
%%%
Created : 21 Nov 2006 by Mats < locmacr@mwlx084 >
%%%-------------------------------------------------------------------
-module(treeview).
-exp... | null | https://raw.githubusercontent.com/massemanet/gtknode/69493096cea0948aa591868d824a5d8e769250fd/priv/examples/treeview/treeview.erl | erlang | -------------------------------------------------------------------
File : treeview.erl
Description : treeview demo
-------------------------------------------------------------------
| Author : Mats < locmacr@mwlx084 >
Created : 21 Nov 2006 by Mats < locmacr@mwlx084 >
-module(treeview).
-export([start/0,stop/0]).
-export([list_insert/2,tree_insert/2]).
-import(filename,[dirname/1,join/1]).
-import(lists,[flatten/1,foldl/3]).
-record(ld,{col_list1,col_list2,col_tree1,col_tree2,tree_store,list... |
df00fc9dbd8ba54a6d317a7c000fde176c843768acc415c60fe0a52588f3630c | bawolk/hsp | Process.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
module Process
( process
, renumberPipe
)
where
import Language.Haskell.Interpreter
hiding ( name )
import qualified Data.HashMap.Strict as H
... | null | https://raw.githubusercontent.com/bawolk/hsp/586c5bc12243341c2a80ef5caea3588bf6a6afd4/src/Process.hs | haskell | # LANGUAGE OverloadedStrings #
puts function in IO monad
say $ show toks
keep history only if history is used in the pipeline
say cmdexpr
say t
fio6 not implemented | # LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
module Process
( process
, renumberPipe
)
where
import Language.Haskell.Interpreter
hiding ( name )
import qualified Data.HashMap.Strict as H
( ... |
7bea366d8247d36927bd694ea7ecb1286ac26974dc163fd66b56b6a1a7cb5557 | finkel-lang/finkel | simpl.hs | import Data.Maybe -- Haskell
| null | https://raw.githubusercontent.com/finkel-lang/finkel/c3c7729d5228bd7e0cf76e8ff05fe2f79a0ec0a2/doc/include/language-syntax/import/simpl.hs | haskell | Haskell | |
db50b2bc4d8569f99b34ba584b56b2f4fc1c51803354ebf1b5e3b7879b63ecec | ndmitchell/catch | Eq.hs |
module Hite.Eq() where
import Hite.Type
import List
compareUnordered :: (Eq a, Ord b) => (a -> b) -> [a] -> [a] -> Bool
compareUnordered f xs ys =
(length xs == length ys) &&
and (zipWith (==) (sortBy g xs) (sortBy g ys))
where
g a b = f a `compare` f b
instance Eq Hite where
(Hit... | null | https://raw.githubusercontent.com/ndmitchell/catch/5d834416a27b4df3f7ce7830c4757d4505aaf96e/src/Hite/Eq.hs | haskell |
module Hite.Eq() where
import Hite.Type
import List
compareUnordered :: (Eq a, Ord b) => (a -> b) -> [a] -> [a] -> Bool
compareUnordered f xs ys =
(length xs == length ys) &&
and (zipWith (==) (sortBy g xs) (sortBy g ys))
where
g a b = f a `compare` f b
instance Eq Hite where
(Hit... | |
6ea77b0d0b35d98e3ff32475e6b015d233c96605160695350891b06c549ff9cb | idream-build/idream | FileLogic.hs | -- | idream-specific constants and path manipulation functions.
module Idream.FileLogic
( workDir
, buildDirName
, buildDir
, outputDirName
, outputDir
, fetchDirName
, fetchDir
, installDirName
, installDir
, pkgBuildDir
, pkgOutputDir
, pkgInstallDir
, repoFetchDir
, projFileName
, pkgFi... | null | https://raw.githubusercontent.com/idream-build/idream/61af6ef68abe6d4f9b67c10f1a3efde9bd93827b/src/Idream/FileLogic.hs | haskell | | idream-specific constants and path manipulation functions.
NOTE: all these functions return a path relative to root of a project!
| Work directory that idream uses to store build artifacts + more in.
| Directory that is used for storing build artifacts of a specific package.
| Directory that is used for storing ... | module Idream.FileLogic
( workDir
, buildDirName
, buildDir
, outputDirName
, outputDir
, fetchDirName
, fetchDir
, installDirName
, installDir
, pkgBuildDir
, pkgOutputDir
, pkgInstallDir
, repoFetchDir
, projFileName
, pkgFileName
, pkgSetFileName
) where
import Idream.Prelude
impor... |
a122f74cd4bacb6c67dd2d018045582289eb73167d3507e8aac7202ed16b4c00 | derektmueller/algorithms-in-haskell | DigraphSpec.hs | module DigraphSpec where
import Test.QuickCheck
import Test.Hspec
import Digraph
import qualified AdjacencyList as AL
import TopSort
describe_digraph =
describe "Digraph" $ do
describe "mkDigraph" $ do
describe "when the edges specified are empty" $ do
it "returns a graph with the specified edges... | null | https://raw.githubusercontent.com/derektmueller/algorithms-in-haskell/e6b8555d83d30f5b94d3c1c90865c8e881c96a0e/test/DigraphSpec.hs | haskell | module DigraphSpec where
import Test.QuickCheck
import Test.Hspec
import Digraph
import qualified AdjacencyList as AL
import TopSort
describe_digraph =
describe "Digraph" $ do
describe "mkDigraph" $ do
describe "when the edges specified are empty" $ do
it "returns a graph with the specified edges... | |
27fb294786427565364ddd60049df2d492626445fb4240b6e6c8e33c84a8d542 | larcenists/larceny | trav2.scm | TRAV2 -- Benchmark which creates and traverses a tree structure .
( 981119 / lth ) Changed illegal use of , @ to use CONS instead .
(define (make-node)
(vector 'node '() '() (snb) #f #f #f #f #f #f #f))
(define (node-parents node) (vector-ref node 1))
(define (node-sons node) (vector-ref node 2))
(define (no... | null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/test/Stress/src/trav2.scm | scheme | to initialize, call: (init-traverse)
to run traverse, call: (run-traverse) | TRAV2 -- Benchmark which creates and traverses a tree structure .
( 981119 / lth ) Changed illegal use of , @ to use CONS instead .
(define (make-node)
(vector 'node '() '() (snb) #f #f #f #f #f #f #f))
(define (node-parents node) (vector-ref node 1))
(define (node-sons node) (vector-ref node 2))
(define (no... |
fa3bcda176c1df20e4d2be4653e0fce408249dd8e797624917b9106d8ca189ee | typelead/etlas | GetOpt.hs | -----------------------------------------------------------------------------
-- |
Module : Distribution .
Copyright : ( c ) 2002 - 2005
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- Portability : portable
--
This is a fork of " System . Console . " w... | null | https://raw.githubusercontent.com/typelead/etlas/bbd7c558169e1fda086e759e1a6f8c8ca2807583/etlas-cabal/Distribution/GetOpt.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Portability : portable
* Treat "cabal --flag command" as "cabal command --flag" e.g.
"cabal -v configure" to mean "cabal configure -v" For flags that a... | Module : Distribution .
Copyright : ( c ) 2002 - 2005
This is a fork of " System . Console . " with the following changes :
If you want to take on the challenge of merging this with the GetOpt
module Distribution.GetOpt (
*
getOpt, getOpt',
usageInfo,
ArgOrder(..),
OptDescr(..),
... |
ffc5132c357f0337e884bed84de1e89e3e5583b2c224eda11e1cb98a63481410 | tamarit/edd | edd_zoom_lib.erl | Copyright ( C ) 2013 < >
%%%
This file is part of Erlang Declarative Debugger .
%%%
Erlang Declarative Debugger is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the... | null | https://raw.githubusercontent.com/tamarit/edd/867f287efe951bec6a8213743a218b86e4f5bbf7/src/edd_zoom_lib.erl | erlang |
(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 General Public License for more details.
-----------------------------------------------------------------------------
@version 0.1
@... | Copyright ( C ) 2013 < >
This file is part of Erlang Declarative Debugger .
Erlang Declarative Debugger is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License... |
fa7e4c7471f499cb232318aa0708926208a7cdd63a96f797800e5e23c8fe1694 | Holmusk/three-layer | App.hs | module Lib.App
( module Lib.App.Env
, module Lib.App.Error
, module Lib.App.Monad
) where
import Lib.App.Env
import Lib.App.Error
import Lib.App.Monad
| null | https://raw.githubusercontent.com/Holmusk/three-layer/1b58ec102f206681b66a584ca4a7d18f2eb4ef81/src/Lib/App.hs | haskell | module Lib.App
( module Lib.App.Env
, module Lib.App.Error
, module Lib.App.Monad
) where
import Lib.App.Env
import Lib.App.Error
import Lib.App.Monad
| |
7ca963fc6c7b346ca765cf7f779e254cd4cc874700d2b558a65315a559e1ea0c | eugenehr/erlyconv | erlyconv.erl | Copyright 2016 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
... | null | https://raw.githubusercontent.com/eugenehr/erlyconv/76db0148326fa533a9b20a6716121eeab7a7f7dc/src/erlyconv.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 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 ,
@author < >
-module(erlyconv).
-author("Eugene Khrustalev <>").
-export([to_unicode/2, from_unicode/2]).
-spec to_unicode(CP,... |
809c182f1effb535d425c986e69060dc0d56d6575140a1f4dd47320abe498b03 | sol/hpack | Git.hs | module Hpack.Syntax.Git (
isValidRef
) where
import Imports
import Data.Char (chr)
import System.FilePath.Posix
-scm.com/docs/git-check-ref-format
isValidRef :: String -> Bool
isValidRef ref =
not (null ref)
&& not (any (isSuffixOf ".lock") components)
&& not (any (isPrefix... | null | https://raw.githubusercontent.com/sol/hpack/f1aa0c48eb696d66be8c1bcf68528253eab09178/src/Hpack/Syntax/Git.hs | haskell | module Hpack.Syntax.Git (
isValidRef
) where
import Imports
import Data.Char (chr)
import System.FilePath.Posix
-scm.com/docs/git-check-ref-format
isValidRef :: String -> Bool
isValidRef ref =
not (null ref)
&& not (any (isSuffixOf ".lock") components)
&& not (any (isPrefix... | |
4b80e5f116ccfb90881ac2a49e27956be9ea31b624704e3440a9f1f6c1c0c517 | ml4tp/tcoq | nativevalues.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/ml4tp/tcoq/7a78c31df480fba721648f277ab0783229c8bece/kernel/nativevalues.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
* This module defines the representa... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2017
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Term
open Names
open CErr... |
213598f174adb4e98c13690badea2f157798c7b4f19f30a0d3db21c0e2d9015f | litaocheng/erlips | egeoip.erl | @author < >
2006
%% @doc Geolocation by IP address.
-module(egeoip).
-author('').
-include("erlips.hrl").
-behaviour(gen_server).
%-compile(export_all).
%% record access API
-export([get/2]).
-export([record_fields/0]).
%% gen_server based API
-export([start/0, start/1, stop/0, lookup/1, lookup_pl/1,
... | null | https://raw.githubusercontent.com/litaocheng/erlips/192ef13c1d6de0cbb81ec5d6ca8b21bb6c0c806c/src/egeoip.erl | erlang | @doc Geolocation by IP address.
-compile(export_all).
record access API
gen_server based API
gen_server callbacks
in-process API
useful utility functions
little benchmark function
geoip record API
@type geoip_atom() = country_code | country_code3 | country_name |
region | city | postal_co... | @author < >
2006
-module(egeoip).
-author('').
-include("erlips.hrl").
-behaviour(gen_server).
-export([get/2]).
-export([record_fields/0]).
-export([start/0, start/1, stop/0, lookup/1, lookup_pl/1,
reload/0, reload/1, filename/0]).
-export([init/1, handle_call/3, handle_cast/2, terminate/2, c... |
ba75edbdb46c64b3498185bc8ad944a98aaa3b89f734f23bda9eadbcd7390e9b | huangz1990/SICP-answers | 32-sum.scm | ;;; 32-sum.scm
(load "32-rec-accumulate.scm")
(define (sum term a next b)
(accumulate +
0
term
a
next
b))
| null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp1/code/32-sum.scm | scheme | 32-sum.scm |
(load "32-rec-accumulate.scm")
(define (sum term a next b)
(accumulate +
0
term
a
next
b))
|
1b6818974eeb0b0ed3b3541630ef2b2c8158763f84ba1cd317eaf15e531715cb | phantomics/seed | contact.lisp | ;;;; contact.lisp
(in-package #:seed.contact)
(define-easy-handler (seed-grow :uri "/portal") ()
(setf (content-type*) "text/plain")
(let ((request-type (hunchentoot:request-method hunchentoot:*request*)))
(cond ((eq :get request-type)
"Not available.")
((eq :post request-type)
(let* ((input (let (... | null | https://raw.githubusercontent.com/phantomics/seed/f128969c671c078543574395d6b23a1a5f2723f8/seed.contact/contact.lisp | lisp | contact.lisp
(rest (assoc :content-type (headers-in*)))))))
native Lisp code is passed directly through and read
(print (list :in input))
only allow the use of functions that are exported in the portal package
the package string is always at the head of the argument list |
(in-package #:seed.contact)
(define-easy-handler (seed-grow :uri "/portal") ()
(setf (content-type*) "text/plain")
(let ((request-type (hunchentoot:request-method hunchentoot:*request*)))
(cond ((eq :get request-type)
"Not available.")
((eq :post request-type)
(cond ((string= mime-type "applicati... |
0f34b87bb1e75b61f0166e2773d30744cb26dcb3581fb8cd58749d693364b59b | jaredloomis/andromeda | GLSL.hs | # LANGUAGE FlexibleInstances #
module Andromeda.Simple.GLSL where
import Data.Vec ((:.)(..), Vec2, Vec3, Vec4)
import Andromeda.Simple.Util
class GLSL a where
toGLSL :: a -> String
instance GLSL Int where
toGLSL = (++".0") . show
instance GLSL Word where
toGLSL = show
instance GLSL Float where
toG... | null | https://raw.githubusercontent.com/jaredloomis/andromeda/502dfa6703eca9717c7cde0c93959fa0a83e77ed/src/Andromeda/Simple/GLSL.hs | haskell | -------------------------------
Dummy instances for 'Typed' --
------------------------------- | # LANGUAGE FlexibleInstances #
module Andromeda.Simple.GLSL where
import Data.Vec ((:.)(..), Vec2, Vec3, Vec4)
import Andromeda.Simple.Util
class GLSL a where
toGLSL :: a -> String
instance GLSL Int where
toGLSL = (++".0") . show
instance GLSL Word where
toGLSL = show
instance GLSL Float where
toG... |
bab4b307366df711825660dcae1d9b2bb7c59f737802fabfc9a36dacd7eb0b96 | manuel-serrano/hop | dom.scm | ;*=====================================================================*/
* serrano / prgm / project / hop / hop / hopscript / dom.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/hop/481cb10478286796addd2ec9ee29c95db27aa390/hopscript/dom.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
*=====================================================================*/
*---------------------------... | * serrano / prgm / project / hop / hop / hopscript / dom.scm * /
* Author : * /
* Creation : Fri Jun 19 13:51:54 2015 * /
* Last change : Thu May 7 13:59:44 2020 ( serrano ) * /
* Cop... |
db674822032c7e0490e7961f454bd07985458b25feef1bde24c6402d5f81e53f | Perry961002/SICP | exe2.71-and-2.72.scm | { a1 , a2 , ... , an } 2^n -1
; / \
{ a1 , a2 , ... , } 2^(n-1)-1 an 2^(n-1 )
; : :
; : :
; : :
; {a1, a2, a3} 7 a4 8
; / \
{ a1,a2 } 3 a3 4
; / \
a1 1 a2 2
)
对最不频... | null | https://raw.githubusercontent.com/Perry961002/SICP/89d539e600a73bec42d350592f0ac626e041bf16/Chap2/exercise/exe2.71-and-2.72.scm | scheme | / \
: :
: :
: :
{a1, a2, a3} 7 a4 8
/ \
/ \ | { a1 , a2 , ... , an } 2^n -1
{ a1 , a2 , ... , } 2^(n-1)-1 an 2^(n-1 )
{ a1,a2 } 3 a3 4
a1 1 a2 2
)
对最不频繁的字符需要(n-1)个二进制位 , 编码每一位都需要执行一次symbol过程,复杂度是O(n^2 ) |
f6809d12bed7d849ea08e12210c763e251857054f03ce07a13688561a373ea69 | vonzhou/LearnYouHaskellForGreatGood | DiffList.hs |
newtype DiffList a = DiffList {getDiffList :: [a] -> [a]}
toDiffList :: [a] -> DiffList a
toDiffList xs = DiffList (xs ++)
fromDiffList :: DiffList a -> [a]
fromDiffList (DiffList f) = f []
instance Monoid (DiffList a) where
mempty = DiffList (\xs -> [] ++ xs)
(DiffList f) `mappend` (DiffList g) = DiffList (\xs... | null | https://raw.githubusercontent.com/vonzhou/LearnYouHaskellForGreatGood/439d848deac53ef6da6df433078b7f1dcf54d18d/chapter14/DiffList.hs | haskell |
newtype DiffList a = DiffList {getDiffList :: [a] -> [a]}
toDiffList :: [a] -> DiffList a
toDiffList xs = DiffList (xs ++)
fromDiffList :: DiffList a -> [a]
fromDiffList (DiffList f) = f []
instance Monoid (DiffList a) where
mempty = DiffList (\xs -> [] ++ xs)
(DiffList f) `mappend` (DiffList g) = DiffList (\xs... | |
a4531233e6987df4438828380f97a3a4ffd4a25a5d88e8651f41eefe9b75c900 | edicl/cl-who | tests.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : CL - WHO - TEST ; Base : 10 -*-
$ Header : /usr / local / cvsrep / cl - who / test / tests.lisp , v 1.5 2009/01/26 11:10:52 edi Exp $
Copyright ( c ) 2008 - 2009 , Dr. . All rights reserved .
;;; Redistribution and use in source and binary forms, with or wi... | null | https://raw.githubusercontent.com/edicl/cl-who/0d3826475133271ee8c590937136c1bc41b8cbe0/test/tests.lisp | lisp | Syntax : COMMON - LISP ; Package : CL - WHO - TEST ; Base : 10 -*-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions a... | $ Header : /usr / local / cvsrep / cl - who / test / tests.lisp , v 1.5 2009/01/26 11:10:52 edi Exp $
Copyright ( c ) 2008 - 2009 , Dr. . All rights reserved .
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
(in-packa... |
d673af021e4b3de97115dc065acb5a58fa4f749f063a0c022047a4541f5857bf | flavioc/cl-hurd | io-restrict-auth.lisp |
(in-package :hurd-translator)
(def-io-interface :io-restrict-auth ((file port)
(new-port port-pointer)
(new-port-type :pointer)
(uids :pointer)
(nuids msg-type-number)
... | null | https://raw.githubusercontent.com/flavioc/cl-hurd/982232f47d1a0ff4df5fde2edad03b9df871470a/translator/interfaces/io-restrict-auth.lisp | lisp |
(in-package :hurd-translator)
(def-io-interface :io-restrict-auth ((file port)
(new-port port-pointer)
(new-port-type :pointer)
(uids :pointer)
(nuids msg-type-number)
... | |
02b04060ea7677c55b5cdc9671e487978bf7f6a73ea4caed50b7d1673781b8eb | jumarko/clojure-experiments | 049_slit_sequence.clj | (ns four-clojure.49-slit-sequence)
;;;
Write a function which will split a sequence into two parts .
;; let's cheat by using `split-at`
(defn split-sequence
"Splits a sequence into two parts"
[split-idx coll]
(split-at split-idx coll))
;; now do the real work
(defn split-sequence
"Splits a sequence into t... | null | https://raw.githubusercontent.com/jumarko/clojure-experiments/f0f9c091959e7f54c3fb13d0585a793ebb09e4f9/src/clojure_experiments/four_clojure/049_slit_sequence.clj | clojure |
let's cheat by using `split-at`
now do the real work | (ns four-clojure.49-slit-sequence)
Write a function which will split a sequence into two parts .
(defn split-sequence
"Splits a sequence into two parts"
[split-idx coll]
(split-at split-idx coll))
(defn split-sequence
"Splits a sequence into two parts"
[split-idx coll]
[(take split-idx coll) (drop spli... |
9969fb7b299b7453261867dacfc513e233c3f4337b9c64c326bdf92299a9378e | l29ah/hatexmpp3 | TByteVector.hs | module TByteVector
( TByteVector
, newTByteVector
, append
, read
) where
import Control.Concurrent.STM
import Control.Monad
import Data.ByteString as B hiding (append)
import Data.Text as T hiding (append)
import Data.Text.Encoding
import Data.Vector.Unboxed.Mutable (IOVector)
import qualified Data.Vector.Unboxe... | null | https://raw.githubusercontent.com/l29ah/hatexmpp3/9d3e25c6acf4c0978a2c1d88b3572ad20b1c228d/TByteVector.hs | haskell | module TByteVector
( TByteVector
, newTByteVector
, append
, read
) where
import Control.Concurrent.STM
import Control.Monad
import Data.ByteString as B hiding (append)
import Data.Text as T hiding (append)
import Data.Text.Encoding
import Data.Vector.Unboxed.Mutable (IOVector)
import qualified Data.Vector.Unboxe... | |
7ee88ae357a561a893a9ba51991b3d58ce4a2c1baff826417c7e6765314146fd | MaskRay/OJHaskell | 76.hs | import Data.Array
n = 100
a = listArray ((0,0),(n,n)) [f i j | i <- [0..n], j <- [0..n]]
where f 0 _ = 1
f _ 0 = 0
f i j
| i >= j = a!(i,j-1) + a!(i-j,min (i-j) j)
| otherwise = 0
main = print $ a!(n,n-1) | null | https://raw.githubusercontent.com/MaskRay/OJHaskell/ba24050b2480619f10daa7d37fca558182ba006c/Project%20Euler/76.hs | haskell | import Data.Array
n = 100
a = listArray ((0,0),(n,n)) [f i j | i <- [0..n], j <- [0..n]]
where f 0 _ = 1
f _ 0 = 0
f i j
| i >= j = a!(i,j-1) + a!(i-j,min (i-j) j)
| otherwise = 0
main = print $ a!(n,n-1) | |
3ed5e3941ffad6232129836ea3f6a58adda7cf03dc1be9ae8dee2ae9566891f3 | Millak/my-guix | mars.scm | Copyright © 2020 , 2022 Efraim < >
;;;
;;; This file is an addendum to GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 3 of the License , or ( at
;;; your option) any ... | null | https://raw.githubusercontent.com/Millak/my-guix/482b0c65da45ffaf87688b6cebc90b36a9d95716/wip/mars.scm | scheme |
This file is an addendum to GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A P... | Copyright © 2020 , 2022 Efraim < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (wip mars)
#:use-module ((guix licenses) #:prefix license:)
#:use-module (guix dow... |
57a0e7c36cc2aba4095f6c6e48edc14528df95ac39809c738bfac8f1de378a8b | brendanhay/gogol | Types.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE Tupl... | null | https://raw.githubusercontent.com/brendanhay/gogol/8cbceeaaba36a3c08712b2e272606161500fbe91/lib/gogol-core/src/Gogol/Types.hs | haskell | # LANGUAGE OverloadedStrings #
|
Stability : provisional
| An OAuth2 scope.
| An OAuth2 access token.
| An OAuth2 refresh token.
| A client identifier.
| A service identifier.
| An opaque client secret.
chaining to hide internal types from the user.
| A general Amazonka error.
# MINIMAL _Error #
| An error... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE KindSignatures #
# LANGUAGE LambdaCase #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TupleSections #
# LANGUAGE TypeFamilies... |
2c526f41d67c69ea4fcfc747e1cab758f35989f172830895949ef5f3ee769607 | puppetlabs/puppetdb | catalog_inputs.clj | (ns puppetlabs.puppetdb.testutils.catalog-inputs
(:require [cheshire.core :as json]
[puppetlabs.puppetdb.utils :as utils]
[puppetlabs.puppetdb.command :refer [process-command!]]
[puppetlabs.puppetdb.command.constants :refer [command-names]]
[puppetlabs.puppetdb.testutil... | null | https://raw.githubusercontent.com/puppetlabs/puppetdb/b3d6d10555561657150fa70b6d1e609fba9c0eda/test/puppetlabs/puppetdb/testutils/catalog_inputs.clj | clojure | For now, the tests expect all the non-input fields to be unique
among these test hosts, and for there to be no optional fields. | (ns puppetlabs.puppetdb.testutils.catalog-inputs
(:require [cheshire.core :as json]
[puppetlabs.puppetdb.utils :as utils]
[puppetlabs.puppetdb.command :refer [process-command!]]
[puppetlabs.puppetdb.command.constants :refer [command-names]]
[puppetlabs.puppetdb.testutil... |
bf820835c14ee2295517395f1db57db82a06e62d019ae33cebdf52839eb07c33 | richmit/mjrcalc | use-geo.lisp | ;; -*- Mode:Lisp; Syntax:ANSI-Common-LISP; Coding:us-ascii-unix; fill-column:158 -*-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;; @file use-geo.lisp
@author < >
@brief Geograph... | null | https://raw.githubusercontent.com/richmit/mjrcalc/96f66d030034754e7d3421688ff201f4f1db4833/use-geo.lisp | lisp | -*- Mode:Lisp; Syntax:ANSI-Common-LISP; Coding:us-ascii-unix; fill-column:158 -*-
@file use-geo.lisp
@std Common Lisp
@see tst-geo.lisp
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
and/or o... | @author < >
@brief Geographic and cartographic computations.@EOL
@parblock
Copyright ( c ) 1997,2006,2008,2013,2015 , < > All rights reserved .
1 . Redistributions of source code must retain the above copyright notice , this list of conditions , and the following disclaimer .
2 . Redi... |
f6e257eb1b0977f55ecc95d5b34cc9a92078f11743c67ffabfd8eb617988ccc9 | diagrams/diagrams-cairo | BezParam.hs | # LANGUAGE NoMonomorphismRestriction #
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
t :: Trail V2 Double
t = (polygonPath with {sides = 3, orientation = OrientToX})
[v1,v2] = trailOffsets t
seg = Cubic v1 v1 (v1 ^+^ v2)
s :: Trail V2 Double
s = fromSegments [seg]
pts = map ((origin .+^) . (seg `a... | null | https://raw.githubusercontent.com/diagrams/diagrams-cairo/533e4f4f18f961543bb1d78493c750dec45fd4a3/test/BezParam.hs | haskell | s1 = (strokeT $ s <> (rotateBy (1/3) s) <> (rotateBy (2/3) s))
# centerXY | # LANGUAGE NoMonomorphismRestriction #
import Diagrams.Prelude
import Diagrams.Backend.Cairo.CmdLine
t :: Trail V2 Double
t = (polygonPath with {sides = 3, orientation = OrientToX})
[v1,v2] = trailOffsets t
seg = Cubic v1 v1 (v1 ^+^ v2)
s :: Trail V2 Double
s = fromSegments [seg]
pts = map ((origin .+^) . (seg `a... |
7beb326d82e87bd1016c03fc331d6006278b6a258f76ef7748cf0a37a8c52630 | juxt/joplin | database.clj | (ns joplin.jdbc.database
(:require [clojure.set :as set]
[joplin.core :refer :all]
[ragtime.jdbc :refer [map->SqlDatabase load-resources load-directory]]
[ragtime.protocols :refer [DataStore]]))
(defn- append-uri [target]
(let [uri {:connection-uri (:url (:db target))}]
(-> ... | null | https://raw.githubusercontent.com/juxt/joplin/d190f883c47b11efafc5154237a80d36af0087d3/joplin.jdbc/src/joplin/jdbc/database.clj | clojure | ============================================================================
SQL driven sql migrations, ragtime style
============================================================================ | (ns joplin.jdbc.database
(:require [clojure.set :as set]
[joplin.core :refer :all]
[ragtime.jdbc :refer [map->SqlDatabase load-resources load-directory]]
[ragtime.protocols :refer [DataStore]]))
(defn- append-uri [target]
(let [uri {:connection-uri (:url (:db target))}]
(-> ... |
753375f48463b89cee548bcda5edd523f6d56b6c8070d1a45c05d4ac0b1ad283 | ocaml/oasis-db | Index.ml |
open Lwt
open XHTML.M
open Eliom_services
open Eliom_parameters
open Eliom_sessions
open Eliom_predefmod.Xhtml
open ODBGettext
open ODBPkgVer
open CalendarLib
open Template
open Common
open Feeds
let upload_chart ~ctxt () =
begin
let fst_date =
let month_ago =
Calendar.rem
(Calendar.no... | null | https://raw.githubusercontent.com/ocaml/oasis-db/f8b19d431102b5c5b7dced00a5242a5366ad263f/src/web/Index.ml | ocaml | TODO: activate when offline
img
~alt:"Package uploads graph"
~src:(mk_static_uri sp ["chart-upload.png"])
();
|
open Lwt
open XHTML.M
open Eliom_services
open Eliom_parameters
open Eliom_sessions
open Eliom_predefmod.Xhtml
open ODBGettext
open ODBPkgVer
open CalendarLib
open Template
open Common
open Feeds
let upload_chart ~ctxt () =
begin
let fst_date =
let month_ago =
Calendar.rem
(Calendar.no... |
d88a664fc39fdaa03dc5b6cb32399f34c30ecd7d2fc7a1b4a3ec5442b240f557 | ocaml-multicore/tezos | tez_repr.mli | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
Copyright ( c... | null | https://raw.githubusercontent.com/ocaml-multicore/tezos/e4fd21a1cb02d194b3162ab42d512b7c985ee8a9/src/proto_012_Psithaca/lib_protocol/tez_repr.mli | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
Copyright ( c ) 2020 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 " , WITH... |
395d159407d9639ba70f15bebb54a30ccc5f017323155a1605ff435d6c7b83c0 | earl-ducaine/cl-garnet | read.lisp | (defpackage :elisp
(:use :common-lisp)
(:export while
short-pi))
(in-package :elisp)
(defparameter unrch nil)
(defclass buffer-text ()
((dotloc :initarg :dotloc :initform nil :accessor dotloc)
(p1 :initarg :p1 :initform nil :accessor p1)
(p2 :initarg :p2 :initform nil :accessor p2)
(size1... | null | https://raw.githubusercontent.com/earl-ducaine/cl-garnet/f0095848513ba69c370ed1dc51ee01f0bb4dd108/src/contrib/garnet-desktop-lab/read.lisp | lisp | (defpackage :elisp
(:use :common-lisp)
(:export while
short-pi))
(in-package :elisp)
(defparameter unrch nil)
(defclass buffer-text ()
((dotloc :initarg :dotloc :initform nil :accessor dotloc)
(p1 :initarg :p1 :initform nil :accessor p1)
(p2 :initarg :p2 :initform nil :accessor p2)
(size1... | |
e1a1e73a10c7813c47518271f9a7e2127cbf1b33dc340698eafa5b9f5e6a96c3 | grin-compiler/ghc-wpc-sample-programs | Block.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
|
Module : Tests . Readers . Org . Block
Copyright : © 2014 - 2020 License : GNU GPL , version 2 or above
Maintainer : >
Stability : alpha
Portability : portable
Tests parsing of org blocks .
... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/pandoc-11df2a3c0f2b1b8e351ad8caaa7cdf583e1b3b2e/test/Tests/Readers/Org/Block.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE NoImplicitPrelude #
|
Module : Tests . Readers . Org . Block
Copyright : © 2014 - 2020 License : GNU GPL , version 2 or above
Maintainer : >
Stability : alpha
Portability : portable
Tests parsing of org blocks .
Module : Tests.Readers.Org.Blo... |
dfb9757695a32fd27fb3f8686354194a3bedc3919be91a3b91178bd37d921f8b | meta-ex/ignite | squares.clj | (ns meta-ex.viz.squares
(:use quil.core))
Modified version of by
;;
(defn- red-yellow-blue-or-white []
([[255 20 200] [255 255 0] [0 0 255] [0 0 0] [20 20 20] [20 20 20 ]] (int (random 6))))
(defn- generate-positions-and-widths [n]
(let [ws (for [c (range n)] (random 400))]
(map #(vector %1 %2) (re... | null | https://raw.githubusercontent.com/meta-ex/ignite/b9b1ed7ae2fa01d017c23febabb714a6389a98dd/src/meta_ex/viz/squares.clj | clojure |
(background 0) | (ns meta-ex.viz.squares
(:use quil.core))
Modified version of by
(defn- red-yellow-blue-or-white []
([[255 20 200] [255 255 0] [0 0 255] [0 0 0] [20 20 20] [20 20 20 ]] (int (random 6))))
(defn- generate-positions-and-widths [n]
(let [ws (for [c (range n)] (random 400))]
(map #(vector %1 %2) (reduct... |
6252f587f785eeae5bd3ea824c22f962951ba4d1c3dcccbbaf9a3edfc3969e4d | nickmi11er/tinkoff-invest-haskell | MarketDataStream.hs | # OPTIONS_GHC -Wno - incomplete - patterns #
module Invest.Service.MarketDataStream(
marketDataStream,
subscribeOrderBook,
unsubscribeOrderBook,
close,
wait
) where
import Control.Concurrent (forkIO, newChan,
... | null | https://raw.githubusercontent.com/nickmi11er/tinkoff-invest-haskell/043c9fa096aa50cc9bf6ae75ac84a80c31e1c7ff/sdk/src/Invest/Service/MarketDataStream.hs | haskell | OrderBook --
Candles --
Trades --
Info --
Last Price -- | # OPTIONS_GHC -Wno - incomplete - patterns #
module Invest.Service.MarketDataStream(
marketDataStream,
subscribeOrderBook,
unsubscribeOrderBook,
close,
wait
) where
import Control.Concurrent (forkIO, newChan,
... |
32ecd484e182cf67bcf1f65ce1d2e5a1dc1a35e0667fc47d5aab8733a491d006 | kriyative/clojurejs | test_rhino.clj | (ns clojurejs.util.test-rhino
"Utility functions to help testing clojurejs."
(:use [clojurejs.js :only [js]])
(:import (org.mozilla.javascript Context ScriptableObject NativeArray
NativeObject NativeJavaObject Scriptable)))
(def ^{:private true} *scope* nil)
(def ^{:private tru... | null | https://raw.githubusercontent.com/kriyative/clojurejs/2339b57835e884f12f0c13ae1f3036c50f1846b3/test/clojurejs/util/test_rhino.clj | clojure | (ns clojurejs.util.test-rhino
"Utility functions to help testing clojurejs."
(:use [clojurejs.js :only [js]])
(:import (org.mozilla.javascript Context ScriptableObject NativeArray
NativeObject NativeJavaObject Scriptable)))
(def ^{:private true} *scope* nil)
(def ^{:private tru... | |
bcb2e2b21a9079125fe393035773e99e557930586fac17f0cfdd04df62d8ae54 | schemedoc/implementation-metadata | ps3i.scm | (title "PS3I")
(long-title "Persistent Server-Side Scheme Interpreter")
(tagline "multi-user, multi-threaded, servlet R4RS implementation in Java")
(based-on "jaja")
(homepage-url "")
(person "Christian Queinnec")
(academy "Université Paris 6")
(features
jvm
r4rs)
| null | https://raw.githubusercontent.com/schemedoc/implementation-metadata/6280d9c4c73833dc5bd1c9bef9b45be6ea5beb68/schemes/ps3i.scm | scheme | (title "PS3I")
(long-title "Persistent Server-Side Scheme Interpreter")
(tagline "multi-user, multi-threaded, servlet R4RS implementation in Java")
(based-on "jaja")
(homepage-url "")
(person "Christian Queinnec")
(academy "Université Paris 6")
(features
jvm
r4rs)
| |
2d7948ac77348fe0a26244f99468c524a7254b670b61786d73c5de083c74f30b | tommaisey/aeon | pvcollect.help.scm | ( pvcollect chain numframes func tobin zeroothers )
;; Process each bin of an fft chain separately.
;; pvcollect applies function func to each bin of an fft chain. func
;; should be a function that takes magnitude, phase, index as inputs
;; and returns a resulting [magnitude, phase].
The " index " is the intege... | null | https://raw.githubusercontent.com/tommaisey/aeon/80744a7235425c47a061ec8324d923c53ebedf15/libs/third-party/sc3/rsc3/help/ugen/fft/pvcollect.help.scm | scheme | Process each bin of an fft chain separately.
pvcollect applies function func to each bin of an fft chain. func
should be a function that takes magnitude, phase, index as inputs
and returns a resulting [magnitude, phase].
can optionally ignore the phase and only return a single
(magnitude) value, in which case the... | ( pvcollect chain numframes func tobin zeroothers )
The " index " is the integer bin number , starting at 0 for DC . You
zeroothers is set to 1 then bins outside of the range being
(define no-op
(lambda (m p _)
(list m p)))
(define rand-phase
(lambda (m p _)
(list m (rand 0 3.14))))
(define n... |
c8710c4012bdbb7342cdfedb2fa4f95ad296509cc3975b6dc9fdc1286951c5c6 | bmeurer/ocaml-experimental | opttoploop.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/bmeurer/ocaml-experimental/fe5c10cdb0499e43af4b08f35a3248e5c1a8b541/toplevel/opttoploop.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ Id$
open Path
open Lexing
open Fo... |
aa6cdd9e513ced1aca96c009b2696375f698e55f91c3363d5ad45f7c78bf568f | iagon-tech/proof-of-burn-cardano | Main.hs | # LANGUAGE TypeApplications #
module Main where
import qualified Plutus.PAB.Effects.Contract.Builtin as Builtin
import Plutus.PAB.Run (runWith)
import Contracts
main :: IO ()
main = runWith (Builtin.handleBuiltin @Contracts)
| null | https://raw.githubusercontent.com/iagon-tech/proof-of-burn-cardano/fc7738f85d64cf134405c16549f43a36473e8a52/app/plutus-burner-pab/Main.hs | haskell | # LANGUAGE TypeApplications #
module Main where
import qualified Plutus.PAB.Effects.Contract.Builtin as Builtin
import Plutus.PAB.Run (runWith)
import Contracts
main :: IO ()
main = runWith (Builtin.handleBuiltin @Contracts)
| |
975b267903a0bd766435ffa01e5dd0b8c7c5b32e6bfbdc1e0017e9e637ea0235 | antono/guix-debian | xlockmore.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 3 of the Lice... | null | https://raw.githubusercontent.com/antono/guix-debian/85ef443788f0788a62010a942973d4f7714d10b4/gnu/packages/xlockmore.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2013 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages xlockmore)
#:use-module (guix packages)
#:use-module (guix download)
#:use-modu... |
09f836d5670c81b47bb3bea365496fefbdcdbf9314300c06032a741512b47d05 | jyp/MarXup | Main.hs | import Text.ParserCombinators.Parsek.Position
import System.Environment
import Data.DList hiding (foldr, map)
import MarXupParser
import qualified Literate as Lit
import Output
import Config
rHaskells :: [Haskell] -> Doc
rHaskells xs = mconcat $ map rHaskell xs
rHaskell :: Haskell -> DList Char
rHaskell (HaskChunk s... | null | https://raw.githubusercontent.com/jyp/MarXup/f9ff1d4aa076dd0844557001b61dff38c5a34a20/Main.hs | haskell | Local Variables:
End: | import Text.ParserCombinators.Parsek.Position
import System.Environment
import Data.DList hiding (foldr, map)
import MarXupParser
import qualified Literate as Lit
import Output
import Config
rHaskells :: [Haskell] -> Doc
rHaskells xs = mconcat $ map rHaskell xs
rHaskell :: Haskell -> DList Char
rHaskell (HaskChunk s... |
97d95b42d5f216c02b9b3d0a3d6734fabd74b3232d7bb9c80fdd31131f673ab9 | haskell-tools/haskell-tools | Create.hs | -- | Public interface for the modules that can be used to generate parts the AST.
module Language.Haskell.Tools.Rewrite.Create
( module Language.Haskell.Tools.Rewrite.Create.Modules
, module Language.Haskell.Tools.Rewrite.Create.Decls
, module Language.Haskell.Tools.Rewrite.Create.Binds
, module Language.Haske... | null | https://raw.githubusercontent.com/haskell-tools/haskell-tools/b1189ab4f63b29bbf1aa14af4557850064931e32/src/rewrite/Language/Haskell/Tools/Rewrite/Create.hs | haskell | | Public interface for the modules that can be used to generate parts the AST. | module Language.Haskell.Tools.Rewrite.Create
( module Language.Haskell.Tools.Rewrite.Create.Modules
, module Language.Haskell.Tools.Rewrite.Create.Decls
, module Language.Haskell.Tools.Rewrite.Create.Binds
, module Language.Haskell.Tools.Rewrite.Create.Types
, module Language.Haskell.Tools.Rewrite.Create.Kin... |
b261c97051a93f61a94b4d43ef0d3abda727845847698158294d0e4fff3edf03 | gwkkwg/cl-containers | package-container.lisp | (in-package #:containers)
(defclass* package-container (iteratable-container-mixin
abstract-container)
((packages nil ir)
(exported-symbols-only-p t ia) ; :external
(present-symbols-only-p t ia) ; :internal or :external
))
(defmethod (setf packages) ((value sy... | null | https://raw.githubusercontent.com/gwkkwg/cl-containers/3d1df53c22403121bffb5d553cf7acb1503850e7/dev/package-container.lisp | lisp | :external
:internal or :external
it's gonna cons | (in-package #:containers)
(defclass* package-container (iteratable-container-mixin
abstract-container)
((packages nil ir)
))
(defmethod (setf packages) ((value symbol) (container package-container))
(setf (packages container) (list value)))
(defmethod (setf packages) ((value... |
2c2a42e9b9d2a6e2b537a1d02138c62ee3e146abd46f00cca05c23cb6d065c3b | matt-noonan/justified-containers | Justified.hs | {-# LANGUAGE DeriveTraversable #-}
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE RoleAnnotations #-}
# LANGUAGE ScopedTypeVariables #
-- |
-- Module : Data.Map.Justified
Copyright : ( c ) 2017
-- License : BSD-style
-- Maintainer :
-- Portability : portable
--
-- = Description
--
-- Ha... | null | https://raw.githubusercontent.com/matt-noonan/justified-containers/38233a7faf0e953654ea380ea762b998765148e9/src/Data/Map/Justified.hs | haskell | # LANGUAGE DeriveTraversable #
# LANGUAGE RankNTypes #
# LANGUAGE RoleAnnotations #
|
Module : Data.Map.Justified
License : BSD-style
Maintainer :
Portability : portable
= Description
Have you ever /known/ that a key could be found in a certain map? Were you tempted to
reach for ... | # LANGUAGE ScopedTypeVariables #
Copyright : ( c ) 2017
@'lookup'@ should give @'Just ' v@ ? ( and did shifting requirements ever make the impossible
" Data . Map . Justified " provides a zero - cost @newtype@ wrapper around " Data . Map " 's . Map . Map'@ that enables you
to separate the /proof that a ... |
2713769417bbc385ff526cffe6cd94a26e6613ffbd7a54248572623a00dedd75 | runtimeverification/haskell-backend | Main.hs | {-# OPTIONS_GHC -Wno-unused-top-binds #-}
-- Added for outputFileName
module Main (main) where
import Control.Concurrent.MVar
import Control.Monad.Catch (
SomeException,
fromException,
handle,
throwM,
)
import Control.Monad.Extra (whenJust)
import GlobalMain
import Kore.BugReport
import Kore.Exec (
... | null | https://raw.githubusercontent.com/runtimeverification/haskell-backend/4e9b76ab1f8bd35aabe64e0b0c51ee7d1e243327/kore/app/repl/Main.hs | haskell | # OPTIONS_GHC -Wno-unused-top-binds #
Added for outputFileName
| Represents a file name along with its module name passed.
| Options for the kore repl.
| Environment variable name for extra arguments
save-run-output flag is only available\ |
module Main (main) where
import Control.Concurrent.MVar
import Control.Monad.Catch (
SomeException,
fromException,
handle,
throwM,
)
import Control.Monad.Extra (whenJust)
import GlobalMain
import Kore.BugReport
import Kore.Exec (
proveWithRepl,
)
import Kore.IndexedModule.MetadataToolsBuilder q... |
6a1ec32b3b0e216bdfa3fd2ad7e114b672254f6ed82a014c027deb9f40ff7803 | YoshikuniJujo/funpaala | typingGame1.hs | import Data.Traversable (for)
import Data.Maybe (catMaybes)
import Data.List (genericLength)
import Data.Char (isSpace)
import Data.Time (getCurrentTime, diffUTCTime)
import Text.Read (readMaybe)
import System.IO (IOMode(..), withFile, hGetLine, hIsEOF)
import System.Environment (getArgs)
doWhile :: Monad m => m (Mayb... | null | https://raw.githubusercontent.com/YoshikuniJujo/funpaala/5366130826da0e6b1180992dfff94c4a634cda99/samples/39_learn_io/typingGame1.hs | haskell | import Data.Traversable (for)
import Data.Maybe (catMaybes)
import Data.List (genericLength)
import Data.Char (isSpace)
import Data.Time (getCurrentTime, diffUTCTime)
import Text.Read (readMaybe)
import System.IO (IOMode(..), withFile, hGetLine, hIsEOF)
import System.Environment (getArgs)
doWhile :: Monad m => m (Mayb... | |
82a8c6d9aac5a1a7e4657e06e51266ee5560c24e7d69a925e7b85c8f8bc844da | learningclojurescript/code-examples | test.cljs | (ns piggieback-project.test)
(defn test-fn [your-name]
(js/alert (+ "Hello from Piggieback, Weasel and Cider, Dear" your-name)))
| null | https://raw.githubusercontent.com/learningclojurescript/code-examples/fdbd0e35ae5a16d53f1f784a52c25bcd4e5a8097/chapter-1/piggieback_project/src/piggieback_project/test.cljs | clojure | (ns piggieback-project.test)
(defn test-fn [your-name]
(js/alert (+ "Hello from Piggieback, Weasel and Cider, Dear" your-name)))
| |
aa30961804191ae8facdcf28bae19e1d88dbd23a425684dd31e3e972f7bb35a7 | crategus/cl-cffi-gtk | rtest-gdk-events.lisp | (def-suite gdk-events :in gdk-suite)
(in-suite gdk-events)
(defvar *verbose-gdk-events* nil)
;;; GDK_CURRENT_TIME
(test +gdk-current-time+
(is (= 0 +gdk-current-time+)))
;;; GDK_PRIORITY_EVENTS
;;; GDK_PRIORITY_REDRAW
(test +gdk-priority-redraw+
(is (= 120 +gdk-priority-redraw+)))
;;; GDK_EVENT... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/7f5a09f78d8004a71efa82794265f2587fff98ab/test/rtest-gdk-events.lisp | lisp | GDK_CURRENT_TIME
GDK_PRIORITY_EVENTS
GDK_PRIORITY_REDRAW
GDK_EVENT_PROPAGATE
GDK_EVENT_STOP
GDK_BUTTON_PRIMARY
GDK_BUTTON_SECONDARY
--- Functions --------------------------------------------------------------
gdk_events_pending
Install an event handler to inspect the main loop
L... | (def-suite gdk-events :in gdk-suite)
(in-suite gdk-events)
(defvar *verbose-gdk-events* nil)
(test +gdk-current-time+
(is (= 0 +gdk-current-time+)))
(test +gdk-priority-redraw+
(is (= 120 +gdk-priority-redraw+)))
(test +gdk-event-propagate+
(is-false +gdk-event-propagate+))
(test +gdk-event-stop+
(is-... |
760de7fbf257b30a7dc292e78db3b40b6980587e7fd326c4417011dcd2faa8b5 | rfindler/lindenmayer | wierd-not-really-tree-looking-thing.rkt | #lang lindenmayer racket
## axiom ##
A
## rules ##
A → F(1)[+A][-A]
F(s) → F(s*R)
## variables ##
R=1.5
n=10
============================================================
(require lindenmayer/turtle)
(provide (all-from-out lindenmayer/turtle) A)
(define (A state . args) state)
| null | https://raw.githubusercontent.com/rfindler/lindenmayer/2ef7b4535d8ae1eb7cc2e16e2b630c30a4b9a34d/examples/wierd-not-really-tree-looking-thing.rkt | racket | #lang lindenmayer racket
## axiom ##
A
## rules ##
A → F(1)[+A][-A]
F(s) → F(s*R)
## variables ##
R=1.5
n=10
============================================================
(require lindenmayer/turtle)
(provide (all-from-out lindenmayer/turtle) A)
(define (A state . args) state)
| |
eda188aaff1b62b8ec70fed73310e63e850e85f03ead117b09418dc6bb4a3177 | paulrzcz/hquantlib | America.hs | module QuantLib.Currencies.America
( module QuantLib.Currencies.America
) where
import QuantLib.Currency
-- | Canadian dollar
cad :: Currency
cad = Currency {
cName = "Canadian dollar",
cCode = "CAD",
cIsoCode = 124,
cFracsPerUnit = 100
... | null | https://raw.githubusercontent.com/paulrzcz/hquantlib/7689b93fa9724b44755148b104ec6c6916d241c3/src/QuantLib/Currencies/America.hs | haskell | | Canadian dollar | module QuantLib.Currencies.America
( module QuantLib.Currencies.America
) where
import QuantLib.Currency
cad :: Currency
cad = Currency {
cName = "Canadian dollar",
cCode = "CAD",
cIsoCode = 124,
cFracsPerUnit = 100
}
| U.S. doll... |
d2d825998072dece31ba5701e791ab00605f97e255acb2ef5dde5dcd06fe4fd7 | dyzsr/ocaml-selectml | nondep.ml | (* TEST
* expect
*)
module F(X : sig type t end) = struct
let f (_ : X.t) = ()
end;;
[%%expect{|
module F : functor (X : sig type t end) -> sig val f : X.t -> unit end
|}]
module M = F(struct type t = T end);;
[%%expect{|
Line 1, characters 11-35:
1 | module M = F(struct type t = T end);;
^^^^^^^^... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/875544110abb3350e9fb5ec9bbadffa332c270d2/testsuite/tests/typing-modules/nondep.ml | ocaml | TEST
* expect
|
module F(X : sig type t end) = struct
let f (_ : X.t) = ()
end;;
[%%expect{|
module F : functor (X : sig type t end) -> sig val f : X.t -> unit end
|}]
module M = F(struct type t = T end);;
[%%expect{|
Line 1, characters 11-35:
1 | module M = F(struct type t = T end);;
^^^^^^^^^^^^^^^^^^^^^^^^
Error:... |
2c97cb686fd4181c6f8bfaff693bead911cd2166a7b6ae71112b92ceb1a05c16 | techascent/tech.ml | xgboost_test.clj | (ns tech.v3.libs.xgboost-test
(:require [clojure.test :refer [deftest is]]
[tech.v3.dataset :as ds]
[tech.v3.dataset.column-filters :as cf]
[tech.v3.dataset.modelling :as ds-mod]
[tech.v3.datatype :as dtype]
[tech.v3.datatype.functional :as dfn]
... | null | https://raw.githubusercontent.com/techascent/tech.ml/254b9ae92e0c5ea898a912860d40b4787d4624d8/test/tech/v3/libs/xgboost_test.clj | clojure | (ns tech.v3.libs.xgboost-test
(:require [clojure.test :refer [deftest is]]
[tech.v3.dataset :as ds]
[tech.v3.dataset.column-filters :as cf]
[tech.v3.dataset.modelling :as ds-mod]
[tech.v3.datatype :as dtype]
[tech.v3.datatype.functional :as dfn]
... | |
9c6795e3e5b38294d180d35d168871040af7a7dd96c724e71e4039aa7954ea9d | miniclip/poolgirl | poolgirl_app_sup.erl | @private
-module(poolgirl_app_sup).
-behaviour(supervisor).
%% API.
-export([start_link/0,
start_child/2]).
%% supervisor.
-export([init/1]).
%% API.
-spec start_link() -> {ok, pid()}.
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
start_child(PoolArgs, WorkerArgs) ->
supe... | null | https://raw.githubusercontent.com/miniclip/poolgirl/ed4be1f106c6e5903a9365ecc0e5ea99757c82f1/src/poolgirl_app_sup.erl | erlang | API.
supervisor.
API.
supervisor. | @private
-module(poolgirl_app_sup).
-behaviour(supervisor).
-export([start_link/0,
start_child/2]).
-export([init/1]).
-spec start_link() -> {ok, pid()}.
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
start_child(PoolArgs, WorkerArgs) ->
supervisor:start_child(poolgirl_app... |
4e571fa54fb2a99a4f2740ff3468ef6ad2768cdee72a44f0eaf66cb24633c7ac | REPROSEC/dolev-yao-star | Spec_P256.ml | open Prims
let (prime : Prims.pos) = Spec_P256_Definitions.prime256
let (aCoordinateP256 : Prims.int) = (Prims.of_int (-3))
let (bCoordinateP256 : Prims.nat) =
(Prims.parse_int "41058363725152142129326129780047268409114441015993725554835256314039467401291")
let (basePoint : Spec_P256_Definitions.point_nat_prime) =
... | null | https://raw.githubusercontent.com/REPROSEC/dolev-yao-star/d97a8dd4d07f2322437f186e4db6a1f4d5ee9230/concrete/hacl-star-snapshot/ml/Spec_P256.ml | ocaml | open Prims
let (prime : Prims.pos) = Spec_P256_Definitions.prime256
let (aCoordinateP256 : Prims.int) = (Prims.of_int (-3))
let (bCoordinateP256 : Prims.nat) =
(Prims.parse_int "41058363725152142129326129780047268409114441015993725554835256314039467401291")
let (basePoint : Spec_P256_Definitions.point_nat_prime) =
... | |
77c850061936812a3ce819102a76961d37b3c6a61ebe7cf47d574a7f2c80ff38 | byorgey/AoC | 09.hs | #!/usr/bin/env stack
stack --resolver lts-19.28 script --package containers --package split --package mtl
import Control.Arrow ((>>>))
import Control.Monad.State
import Data.Set (Set)
import qualified Data.Set as S
main = interact $
readInput >>> applyAll ... | null | https://raw.githubusercontent.com/byorgey/AoC/09b68b6b8a0fd959d91957ba88e28675ba29c274/2022/09/09.hs | haskell | resolver lts-19.28 script --package containers --package split --package mtl
---------------------------------------------------------- | #!/usr/bin/env stack
import Control.Arrow ((>>>))
import Control.Monad.State
import Data.Set (Set)
import qualified Data.Set as S
main = interact $
readInput >>> applyAll [solveA,solveB] >>> map show >>> unlines
type Input = [Move]
data Move = Move { dir ::... |
6dee6268851793fd8cc6726630d4c3e047365e46dd94b0cd42a41fa68a65957d | 10Pines/pdepreludat | BetterErrors.hs | module BetterErrors where
import Prelude
import GHC.TypeLits
--- Para funciones
type ErrorNumeroXFuncion = Text "Estás usando una función como un número o un número como una función."
type ErrorOrdenableXFuncion = Text "Las funciones no se pueden ordenar ni comparar."
type ErrorEnumerableXFuncion = Text "Las funcione... | null | https://raw.githubusercontent.com/10Pines/pdepreludat/375b3e6c368fa6828dd744511dafdcd2bbe6fab4/src/BetterErrors.hs | haskell | - Para funciones
-Para listas
Errores entre enteros y fraccionales | module BetterErrors where
import Prelude
import GHC.TypeLits
type ErrorNumeroXFuncion = Text "Estás usando una función como un número o un número como una función."
type ErrorOrdenableXFuncion = Text "Las funciones no se pueden ordenar ni comparar."
type ErrorEnumerableXFuncion = Text "Las funciones no son enumerable... |
9e8e8cc34f8d455e2b68db89a3a88b93b2a07165bea72f4d0d8fe5c1f81542aa | iamaleksey/oserl | smpp_req_tab.erl | Copyright ( C ) 2009 ,
%%% All rights reserved.
%%%
%%% Redistribution and use in source and binary forms, with or without
%%% modification, are permitted provided that the following conditions are met:
%%%
%%% o Redistributions of source code must retain the above copyright notice,
%%% this list of conditions ... | null | https://raw.githubusercontent.com/iamaleksey/oserl/b254c68225b98384738c7a7ff9ddb53caa35c075/src/smpp_req_tab.erl | erlang | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
o Redistributions of source code must retain the above copyright notice,
this list of conditions and the following disclaimer.
o Redistributions ... | Copyright ( C ) 2009 ,
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT HOLDER OR
LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY ,... |
d9f04138282a1a475fea5ebe05c6a38d535f85e2729f9f9bbeeb981e263bae1d | hrvolapeter/security-log | ObjectReference.hs | {-# LANGUAGE OverloadedStrings #-}
module Analyses.ObjectReference
( analyse
) where
import Data.Incident
import Data.Log
import Data.Text
import Data.Text.Encoding (encodeUtf8)
import Data.Text.Internal.Builder (toLazyText)
import Data.Text.Lazy... | null | https://raw.githubusercontent.com/hrvolapeter/security-log/3434c18934ac3698a90f90c20b6fd3ba4761ebeb/src/Analyses/ObjectReference.hs | haskell | # LANGUAGE OverloadedStrings # |
module Analyses.ObjectReference
( analyse
) where
import Data.Incident
import Data.Log
import Data.Text
import Data.Text.Encoding (encodeUtf8)
import Data.Text.Internal.Builder (toLazyText)
import Data.Text.Lazy (toStrict)
import ... |
aeee3449873dcf39f8cd302ea4d940e2163f074960d3b806ba648a9b8c9e2f39 | heroku/logplex | logplex_redis_reader_sup.erl | -module(logplex_redis_reader_sup).
-behaviour(supervisor).
-export([start_link/0,
start_child/1,
remove_child/1,
init/1
]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
start_child(Spec) ->
supervisor:start_child(?MODULE, Spec).
remove_child(Pid) ... | null | https://raw.githubusercontent.com/heroku/logplex/fc520c44cf4687726d5d51464d3264ddc6abb0ba/src/logplex_redis_reader_sup.erl | erlang | -module(logplex_redis_reader_sup).
-behaviour(supervisor).
-export([start_link/0,
start_child/1,
remove_child/1,
init/1
]).
start_link() ->
supervisor:start_link({local, ?MODULE}, ?MODULE, []).
start_child(Spec) ->
supervisor:start_child(?MODULE, Spec).
remove_child(Pid) ... | |
308c47c3662d01885480b75edd7539da5cb3fe1886b22dfe500cd9f513f46e50 | avsm/platform | opamRepositoryBackend.ml | (**************************************************************************)
(* *)
(* Copyright 2015 OCamlPro *)
(* *)
(* All righ... | null | https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/opam-client.2.0.5%2Bdune/src/repository/opamRepositoryBackend.ml | ocaml | ************************************************************************
Copyright 2015 OCamlPro
All rights reserved. This ... | GNU Lesser General Public License version 2.1 , with the special
open OpamTypes
let log = OpamConsole.log "REPO_BACKEND"
let slog = OpamConsole.slog
type update =
| Update_full of dirname
| Update_patch of filename
| Update_empty
| Update_err of exn
module type S = sig
val name: OpamUrl.backend
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.