_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 |
|---|---|---|---|---|---|---|---|---|
5b4d16c7023997e73656b418cf09f0581d362a86feced1ebae96f5597dfc4bd5 | nineties-retro/sps | sps-strings-sps.scm |
(define (sps:byte-vector->string byte-vector start end)
(vector byte-vector start end))
(define (sps:string:length string)
(- (vector-ref string 2) (vector-ref string 1)))
(define (sps:string:ref string index)
(char->integer (string-ref (vector-ref string 0) (+ index (vector-ref string 1)))))
(define (sps:st... | null | https://raw.githubusercontent.com/nineties-retro/sps/bf15b415f4cdf5d6d69ae2f39c250db2090c0817/scm/sps-strings-sps.scm | scheme |
(define (sps:byte-vector->string byte-vector start end)
(vector byte-vector start end))
(define (sps:string:length string)
(- (vector-ref string 2) (vector-ref string 1)))
(define (sps:string:ref string index)
(char->integer (string-ref (vector-ref string 0) (+ index (vector-ref string 1)))))
(define (sps:st... | |
b2e5820c16f9eef1884cca8d3025dff36f4b9f68e3b89276f5a4517c91da7e32 | ijvcms/chuanqi_dev | map_20004.erl | -module(map_20004).
-export([
range/0,
data/0
]).
range() -> {72, 48}.
data() ->
{
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/map_data/map_20004.erl | erlang | -module(map_20004).
-export([
range/0,
data/0
]).
range() -> {72, 48}.
data() ->
{
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1},
{1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1,1... | |
5be82aacf08a27792a9278105dfdf345ecfedd029f3605eb829e07bde7acccab | yorodm/cl-rx | package.lisp | (in-package :cl-rx.util)
(macrolet
((package (package-name documentation &rest list)
`(defpackage ,package-name
(:documentation ,documentation)
(:use #:cl ,@list)
(:export
,@(loop for package in list
append (loop for symbol being the external-symbol... | null | https://raw.githubusercontent.com/yorodm/cl-rx/981e7526499575704cdc6a58bffc44339ae5a05d/src/package.lisp | lisp | (in-package :cl-rx.util)
(macrolet
((package (package-name documentation &rest list)
`(defpackage ,package-name
(:documentation ,documentation)
(:use #:cl ,@list)
(:export
,@(loop for package in list
append (loop for symbol being the external-symbol... | |
f0a3ed91a298c9c6f59ac859b761533b3e3595c7b4b061d34da5ae256b4c8626 | opencog/learn | gram-pairwise.scm | ;
; gram-pairwise.scm
;
Create clusters by merging two items at a time .
;
Copyright ( c ) 2017 , 2018 , 2019 , 2021 Linas Vepstas
;
; ---------------------------------------------------------------------
; OVERVIEW
; --------
; See `gram-classification.scm` and `gram-projective.scm` for an overview.
;
; start-clus... | null | https://raw.githubusercontent.com/opencog/learn/494598a963c1e145be26a2e0eae4854a8e71ae38/scm/attic/cluster/gram-pairwise.scm | scheme |
gram-pairwise.scm
---------------------------------------------------------------------
OVERVIEW
--------
See `gram-classification.scm` and `gram-projective.scm` for an overview.
start-cluster
-------------
merge-into-cluster
------------------
Merge item into an existing cluster.
merge-clusters
----... | Create clusters by merging two items at a time .
Copyright ( c ) 2017 , 2018 , 2019 , 2021 Linas Vepstas
Create a brand new cluster out of two items .
merge N items into a cluster , in one go . However , it 's a bit different
Copyright ( c ) 2017 , 2018 , 2019 , 2021 Linas Vepstas
The notes below descrbe or... |
38c54858b7744c6bb259e60d864c57e0c5b4086de4f66e2d173abf6cd4e344ba | rnons/HadouRex | State.hs | module Douban.FM.Player.HadouRex.State where
import System.IO.Unsafe (unsafePerformIO)
import System.IO (Handle)
import Control.Concurrent.MVar
import Network.HTTP.Headers (Header)
data HState = HState {
writeh :: MVar Handle,
readh :: MVar Handle,
status ... | null | https://raw.githubusercontent.com/rnons/HadouRex/f95529d26a5c192c70610afc79ac2ccaabaf0ea6/HadouRex/Douban/FM/Player/HadouRex/State.hs | haskell |
| The initial state
----------------------------------------------------------------------
state accessor functions
| Access a component of the state with a projection function
| Perform a (read-only) IO action on the state
| Modify the state with a pure function
-----------------------------------------------... | module Douban.FM.Player.HadouRex.State where
import System.IO.Unsafe (unsafePerformIO)
import System.IO (Handle)
import Control.Concurrent.MVar
import Network.HTTP.Headers (Header)
data HState = HState {
writeh :: MVar Handle,
readh :: MVar Handle,
status ... |
39f71e3a4ed932d55ec1ae83f66e3949a8a6344e33340b712d21552f85270b8f | Factual/riffle | utils.clj | (ns riffle.hadoop.utils
(:refer-clojure :exclude [partition comparator])
(:require
[clojure.tools.logging :as log]
[clojure.edn :as edn]
[primitive-math :as p]
[byte-streams :as bs]
[byte-transforms :as bt]
[riffle.write :as w]
[riffle.data.riffle :as r]
[riffle.data.utils :as u])
... | null | https://raw.githubusercontent.com/Factual/riffle/f102db1a96dd2de212d555154a231b76016c632a/riffle-hadoop/src/riffle/hadoop/utils.clj | clojure | (ns riffle.hadoop.utils
(:refer-clojure :exclude [partition comparator])
(:require
[clojure.tools.logging :as log]
[clojure.edn :as edn]
[primitive-math :as p]
[byte-streams :as bs]
[byte-transforms :as bt]
[riffle.write :as w]
[riffle.data.riffle :as r]
[riffle.data.utils :as u])
... | |
d16afd574e68e1d71467ff88c915b70bbde4bf5c9455832cff517a929618dc51 | meagtan/99-lisp-problems | p94.lisp | ;;;; Generating k-regular graphs with n nodes
(in-package #:99-lisp-problems)
;;; p94
(defun regular-graphs (n k)
"Return all non-isomorphic k-regular graphs with n nodes."
(remove-duplicates
(make-graphs k (range 1 n)) ;p22
:test #'isomorphic-p)) ;p85
(defun make-graphs (deg nodes &optional (nodes-left... | null | https://raw.githubusercontent.com/meagtan/99-lisp-problems/82bd35b1c161aaba37306332505700c26721296c/src/90-99%20misc/p94.lisp | lisp | Generating k-regular graphs with n nodes
p94
p22
p85
try to connect (car nodes-left) to every element of COMB |
(in-package #:99-lisp-problems)
(defun regular-graphs (n k)
"Return all non-isomorphic k-regular graphs with n nodes."
(remove-duplicates
(defun make-graphs (deg nodes &optional (nodes-left nodes) edges)
"Generate all (possibly isomorphic) k-regular graphs with the given nodes."
(if (null nodes-left)
p80
... |
36435aaad7a9803293da96c8debb1ac974d82f4a031987a752ae04a118ca95ba | erlang/otp | num_bif_SUITE.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1997 - 2021 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/erlang/otp/b0afc29474f9625aa0b466b6672e0bbcefd07535/erts/emulator/test/num_bif_SUITE.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 1997 - 2021 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(num_bif_SUITE).
-include_lib("common_test/include/ct.hrl").
integer_to_binary/1
-export([all/0, suite/0... |
ca0dfdc0692250ebef2edcb947b4f34ed4ad23e0e4b2f7e7265ea4883f706227 | obsidiansystems/beam-automigrate | TestUtils.hs | {-# Language OverloadedStrings #-}
module Database.Beam.AutoMigrate.TestUtils where
import Control.Exception (bracket)
import Data.Pool (withResource)
import Data.Typeable
import Database.PostgreSQL.Simple as Pg
import Gargoyle.PostgreSQL.Connect (withDb)
import Test.Tasty.Options
data ConnMethod = ConnMethod_Direct ... | null | https://raw.githubusercontent.com/obsidiansystems/beam-automigrate/2eae891814b0523c6c839a666eed19218985a89f/util/Database/Beam/AutoMigrate/TestUtils.hs | haskell | # Language OverloadedStrings #
| Connect to a database using gargoyle or connect directly to an already-running
postgresql instance | module Database.Beam.AutoMigrate.TestUtils where
import Control.Exception (bracket)
import Data.Pool (withResource)
import Data.Typeable
import Database.PostgreSQL.Simple as Pg
import Gargoyle.PostgreSQL.Connect (withDb)
import Test.Tasty.Options
data ConnMethod = ConnMethod_Direct Pg.ConnectInfo | ConnMethod_Gargoyl... |
94727be940b1b2604378ae954ec22dd391582818273ec284466b83b1fa932e5a | j-hannes/digestive-functors-snap-auth-example | Main.hs | ------------------------------------------------------------------------------
| This is an example showing how to use the snap auth snaplet together with
-- digestive functors to create a basic login functionality. This code is
-- available as project form in a structured filesystem as well as a
standalone version... | null | https://raw.githubusercontent.com/j-hannes/digestive-functors-snap-auth-example/119c7e725fb40b2bc3abfb1bd662eb9146ad8508/src/Main.hs | haskell | ----------------------------------------------------------------------------
digestive functors to create a basic login functionality. This code is
available as project form in a structured filesystem as well as a
structured version.
----------------------------------------------------------------------------
site... | | This is an example showing how to use the snap auth snaplet together with
standalone version where all code is kept in one file . This one is the
module Main
( main
) where
import Control.Exception
import qualified Data.Text as T
import System.IO
import Snap.Snaplet
import ... |
18a02b5e8a841c333b74c306fd3b9213249f87e6d0a2a15613a29595f298491e | sheyll/newtype-zoo | Next.hs | | Indicate that something is ` Next ` .
module NewtypeZoo.Next
( Next(Next)
, _theNext
, theNext
) where
import Control.DeepSeq (NFData)
import Control.Monad.Fix (MonadFix)
import Control.Monad.Zip (MonadZip)
import Data.Bits (Bits,FiniteBits)
import Da... | null | https://raw.githubusercontent.com/sheyll/newtype-zoo/0e67717cbcd9233d9c26b6aacb4c6f8bba6ef5f7/src/NewtypeZoo/Next.hs | haskell | # INLINE _theNext # | | Indicate that something is ` Next ` .
module NewtypeZoo.Next
( Next(Next)
, _theNext
, theNext
) where
import Control.DeepSeq (NFData)
import Control.Monad.Fix (MonadFix)
import Control.Monad.Zip (MonadZip)
import Data.Bits (Bits,FiniteBits)
import Da... |
041fcbfc32e30479bd7cece708127d45dbfd7cff2f14c16ceef40d67da4dce40 | ijvcms/chuanqi_dev | misc.erl | %% Author: ming
Created : 2012 - 12 - 2
%% Description: TODO: public interface
-module(misc).
%%
%% Include files
%%
-include("common.hrl").
-include("record.hrl").
%%
%% Exported Functions
%%
-export([
whereis_name/1,
get_player_pid/1,
register/3,
create_process_name/2,
is_process_alive/1,
player_process_nam... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/api/misc/misc.erl | erlang | Author: ming
Description: TODO: public interface
Include files
Exported Functions
API Functions
find process
注册进程名
创建进程名
进程是否存活
Local Functions
| Created : 2012 - 12 - 2
-module(misc).
-include("common.hrl").
-include("record.hrl").
-export([
whereis_name/1,
get_player_pid/1,
register/3,
create_process_name/2,
is_process_alive/1,
player_process_name/1,
fix_record/2,
get_node_type/0
]).
whereis_name({local, Atom}) ->
erlang:whereis(Atom);
whereis_... |
b2f774beea11fbe35f53276be157928c1292478f3ccc66d89c9729ef4214fac1 | SamirTalwar/advent-of-code | AOC_12_2.hs | {-# OPTIONS -Wall #-}
# LANGUAGE TupleSections #
import Data.Functor (($>))
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Text (Text)
import Helpers.Graph (Graph, (!))
import qualified Helpers.Graph as Graph
import Helpers.Parse
import Text.Parsec
data Cave = Start | End | Big String | Small Stri... | null | https://raw.githubusercontent.com/SamirTalwar/advent-of-code/f56d60c11cc03b0d87a4b0999fd8d97bce2d41b0/2021/AOC_12_2.hs | haskell | # OPTIONS -Wall # | # LANGUAGE TupleSections #
import Data.Functor (($>))
import Data.Set (Set)
import qualified Data.Set as Set
import Data.Text (Text)
import Helpers.Graph (Graph, (!))
import qualified Helpers.Graph as Graph
import Helpers.Parse
import Text.Parsec
data Cave = Start | End | Big String | Small String
deriving (Eq, Ord... |
74a814601b5e24016d50b13a2f32ca805d04b0456ef6c3a397471be3846be777 | y-taka-23/time-machine | EngineSpec.hs | module Control.Monad.TimeMachine.EngineSpec ( spec ) where
import Test.Hspec
import Test.HUnit (Assertion)
import Control.Monad.TimeMachine.Engine
import Control.Concurrent (threadDelay)
import Control.Monad.Trans (Mon... | null | https://raw.githubusercontent.com/y-taka-23/time-machine/c82f15d51d12b800438aa74401f42d39e0c472fe/test/Control/Monad/TimeMachine/EngineSpec.hs | haskell | module Control.Monad.TimeMachine.EngineSpec ( spec ) where
import Test.Hspec
import Test.HUnit (Assertion)
import Control.Monad.TimeMachine.Engine
import Control.Concurrent (threadDelay)
import Control.Monad.Trans (Mon... | |
f10a80fe221d330438c6bbbe71a947d12574d98a21ca76ff966feb7f22d6d137 | realworldocaml/book | scheduler_tests.ml | open Stdune
open! Dune_tests_common
open Dune_engine
open Fiber.O
let default =
{ Scheduler.Config.concurrency = 1
; display = { verbosity = Short; status_line = false }
; stats = None
; insignificant_changes = `React
; signal_watcher = `No
}
let go ?(timeout = 0.3) ?(config = default) f =
try
Sched... | null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/dune_/test/expect-tests/scheduler_tests.ml | ocaml | Wait for the scheduler to acknowledge the change | open Stdune
open! Dune_tests_common
open Dune_engine
open Fiber.O
let default =
{ Scheduler.Config.concurrency = 1
; display = { verbosity = Short; status_line = false }
; stats = None
; insignificant_changes = `React
; signal_watcher = `No
}
let go ?(timeout = 0.3) ?(config = default) f =
try
Sched... |
b398fa675563cd0aee889ad093e4e806d6cddeed553c93e3813c5e787817c323 | markus-git/hardware-edsl | Int.hs | {-# LANGUAGE TypeOperators #-}
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE DataKinds #-}
# LANGUAGE ScopedTypeVariables #
module Int where
import Language.VHDL (Mode(..))
import Language.Embedded.Hardware
import Control.Monad.Identity
import Control.Monad.Operational.Higher
import Data.ALaCarte... | null | https://raw.githubusercontent.com/markus-git/hardware-edsl/d0fde93ff57a8f5c2c37e273ff3a1d2a761fc5eb/examples/Int.hs | haskell | # LANGUAGE TypeOperators #
# LANGUAGE FlexibleContexts #
# LANGUAGE DataKinds #
------------------------------------------------------------------------------
* Example of a program that performs type casting.
------------------------------------------------------------------------------
| Command ... | # LANGUAGE ScopedTypeVariables #
module Int where
import Language.VHDL (Mode(..))
import Language.Embedded.Hardware
import Control.Monad.Identity
import Control.Monad.Operational.Higher
import Data.ALaCarte
import Data.Int
import Data.Word
import Text.PrettyPrint
import Prelude hiding (and, or, not)
type CMD =
... |
32397154d22ea335a2f286959395a47a0cf313342ce19b5cdf7dc9eb4928fa70 | cyverse-archive/DiscoveryEnvironmentBackend | c199_2015053001.clj | (ns facepalm.c199-2015053001
(:use [korma.core]
[kameleon.sql-reader :only [load-sql-file]]))
(def ^:private version
"The destination database version."
"1.9.9:20150530.01")
(defn- add-container-images-table
[]
(println "\t* adding container_images table")
(load-sql-file "tables/70_container_image... | null | https://raw.githubusercontent.com/cyverse-archive/DiscoveryEnvironmentBackend/7f6177078c1a1cb6d11e62f12cfe2e22d669635b/databases/de-database-schema/src/main/conversions/v1.9.9/c199_2015053001.clj | clojure | (ns facepalm.c199-2015053001
(:use [korma.core]
[kameleon.sql-reader :only [load-sql-file]]))
(def ^:private version
"The destination database version."
"1.9.9:20150530.01")
(defn- add-container-images-table
[]
(println "\t* adding container_images table")
(load-sql-file "tables/70_container_image... | |
1929bfeba311ee5f4cb65c634af1d3bf89f89a3576be4a11fba91c315d6a8bce | DanielG/ghc-mod | Types.hs | ghc - mod : Happy Haskell Hacking
Copyright ( C ) 2015 < dxld ÄT darkboxed DOT org >
--
-- This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
-- (... | null | https://raw.githubusercontent.com/DanielG/ghc-mod/391e187a5dfef4421aab2508fa6ff7875cc8259d/core/GhcMod/Caching/Types.hs | haskell |
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU Affero General... | ghc - mod : Happy Haskell Hacking
Copyright ( C ) 2015 < dxld ÄT darkboxed DOT org >
it under the terms of the GNU Affero General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU Affero General Public License
modu... |
df91605e6cdf8b8c167e5e714f345e2cd92f55c6cb8192d598c353a6e837287b | rauschma/reasonml-demo-iterators | Sequence.ml |
(* This file is free software, part of sequence. See file "license" for more details. *)
* { 1 Simple and Efficient Iterators }
(** Sequence abstract iterator type *)
type 'a t = ('a -> unit) -> unit
type 'a sequence = 'a t
(*$inject
let pp_ilist = Q.Print.(list int)
*)
type 'a equal = 'a -> 'a -> bool
type 'a ... | null | https://raw.githubusercontent.com/rauschma/reasonml-demo-iterators/d69ff758cb0f159814d60ad76157dffba3e14634/src/lib/sequence/Sequence.ml | ocaml | This file is free software, part of sequence. See file "license" for more details.
* Sequence abstract iterator type
$inject
let pp_ilist = Q.Print.(list int)
* Build a sequence from a iter function
$R
let seq = empty in
OUnit.assert_bool "empty" (is_empty seq);
OUnit.assert_bool "empty"
(try iter (fun... |
* { 1 Simple and Efficient Iterators }
type 'a t = ('a -> unit) -> unit
type 'a sequence = 'a t
type 'a equal = 'a -> 'a -> bool
type 'a hash = 'a -> int
let from_iter f = f
let rec from_fun f k = match f () with
| None -> ()
| Some x -> k x; from_fun f k
let empty _ = ()
let singleton x k = k x
let retu... |
2f2f010fe34f71fbd73d5f02d8c33cf567ecf901f21b39a89075ab144eb64198 | azimut/shiny | aisatsana.lisp | (in-package :shiny)
(defvar *notes* NIL)
(defvar *sing* NIL)
(defvar *quarter* NIL)
(defvar *mf* NIL)
(setf (bpm *tempo*) 64)
(setf *quarter* .23)
(setf *mf* "/home/sendai/Downloads/aisatsana_by_Aphex_Twin.mscz.mid")
(setf *notes*
(subseq (get-measures-pair *mf* 0 12 (* *quarter* 4) :seconds nil) 4))
... | null | https://raw.githubusercontent.com/azimut/shiny/774381a9bde21c4ec7e7092c7516dd13a5a50780/compositions/drafts/midifile/aisatsana.lisp | lisp | (in-package :shiny)
(defvar *notes* NIL)
(defvar *sing* NIL)
(defvar *quarter* NIL)
(defvar *mf* NIL)
(setf (bpm *tempo*) 64)
(setf *quarter* .23)
(setf *mf* "/home/sendai/Downloads/aisatsana_by_Aphex_Twin.mscz.mid")
(setf *notes*
(subseq (get-measures-pair *mf* 0 12 (* *quarter* 4) :seconds nil) 4))
... | |
2bae760c7ce2d7a61c6221c002116ea82d722231eaea9a01844c53210d4e9bd5 | dracula/nyxt | init.lisp | (in-package #:nyxt-user)
;; Import Files
(nyxt::load-lisp "~/.config/nyxt/statusline.lisp")
(nyxt::load-lisp "~/.config/nyxt/stylesheet.lisp")
| null | https://raw.githubusercontent.com/dracula/nyxt/2c79323b74375b3c36dd189994a0748abb8959d7/init.lisp | lisp | Import Files | (in-package #:nyxt-user)
(nyxt::load-lisp "~/.config/nyxt/statusline.lisp")
(nyxt::load-lisp "~/.config/nyxt/stylesheet.lisp")
|
a8e42ab0049050890ac03b25db43b1ae21118867ab9e1237a6753e10431a6245 | commercialhaskell/stack | Main.hs | import StackTest
main :: IO ()
main = do
stack ["build", "--stack-yaml", "stack1.yaml"]
stack ["build", "--stack-yaml", "stack2.yaml"]
| null | https://raw.githubusercontent.com/commercialhaskell/stack/255cd830627870cdef34b5e54d670ef07882523e/test/integration/tests/4215-missing-unregister/Main.hs | haskell | import StackTest
main :: IO ()
main = do
stack ["build", "--stack-yaml", "stack1.yaml"]
stack ["build", "--stack-yaml", "stack2.yaml"]
| |
455a68646048e07f2f612abe0765da4ba82b078da6c4098fdb76b5bd3bfac4c3 | ermine/sulci | common.ml |
* ( c ) 2004 - 2010
* (c) 2004-2010 Anastasia Gornostaeva
*)
let string_after s n =
if n = 0 then
s
else if String.length s = n then
""
else
String.sub s n (String.length s - n)
let is_prefix s1 s2 =
let len1 = String.length s1 in
let len2 = String.length s2 in
if len1 > len2 then
... | null | https://raw.githubusercontent.com/ermine/sulci/3ee4bd609b01e2093a6d37bf74579728d0a93b70/src/common.ml | ocaml | temp code |
* ( c ) 2004 - 2010
* (c) 2004-2010 Anastasia Gornostaeva
*)
let string_after s n =
if n = 0 then
s
else if String.length s = n then
""
else
String.sub s n (String.length s - n)
let is_prefix s1 s2 =
let len1 = String.length s1 in
let len2 = String.length s2 in
if len1 > len2 then
... |
493f9d86f3911dc0f6e652bd45d80b82e92e8f2802673c70bf47113e20517ad9 | cl-axon/shop2 | UMT2.lisp | (in-package :shop2-user)
(defun define-umt-domain ()
(let ((*define-silently* t)
(shop2::*ignore-singleton-variables* t))
(defdomain (UM-Translog-2 :redefine-ok t)
(
(:method (assert-goals (?goal . ?goals) ?out)
()
((assert-goals ?goals ((goal ?goal) . ?out))))
... | null | https://raw.githubusercontent.com/cl-axon/shop2/9136e51f7845b46232cc17ca3618f515ddcf2787/examples/UMT2/UMT2.lisp | lisp | (check-truck)
(check-tcenter)
(check-train)
(check-airplane)
(check-road-route)
(check-non-road-route)
top-level declare-method: used for top-level goal
CARRY DECLARE-METHODS - TOP LEVEL.
?origin (tcenter, not hub) -> ?destination (tcenter, not hub)
?origin (not tcenter) -> ?tcenter -> ?destination (tcenter)... | (in-package :shop2-user)
(defun define-umt-domain ()
(let ((*define-silently* t)
(shop2::*ignore-singleton-variables* t))
(defdomain (UM-Translog-2 :redefine-ok t)
(
(:method (assert-goals (?goal . ?goals) ?out)
()
((assert-goals ?goals ((goal ?goal) . ?out))))
... |
a4eaa48c4b45c30b93c4cb085f37431a14f0c8debd0c686978845e9d4bac97ce | BitGameEN/bitgamex | euler.erl | %% File : euler.erl
%% Purpose : Running complex lua with luerl
%% Use: erlc -I ../../src euler.erl && erl -pa ../../ebin -s euler run -s init stop -noshell
%% Or: make
-module(euler).
-export([run/0, run/2]).
run() ->
run("./problem_001.lua", 233168),
run("./problem_002.lua", 4613732),
run("./problem_003.lu... | null | https://raw.githubusercontent.com/BitGameEN/bitgamex/151ba70a481615379f9648581a5d459b503abe19/src/deps/luerl/examples/euler/euler.erl | erlang | File : euler.erl
Purpose : Running complex lua with luerl
Use: erlc -I ../../src euler.erl && erl -pa ../../ebin -s euler run -s init stop -noshell
Or: make |
-module(euler).
-export([run/0, run/2]).
run() ->
run("./problem_001.lua", 233168),
run("./problem_002.lua", 4613732),
run("./problem_003.lua", 29),
run("./problem_004.lua", 36863),
run("./problem_005.lua", 232792560),
run("./problem_006.lua", 25164150),
run("./problem_007.lua", 617),
run("./problem_0... |
220e5e2db468fc8dc2db03d987a8cbfb3b34ae99ef0f4d9093fb9d3fbaa2bbe4 | cmullaparthi/ibrowse | ibrowse_app.erl | %%%-------------------------------------------------------------------
%%% File : ibrowse_app.erl
Author : >
%%% Description :
%%%
Created : 15 Oct 2003 by >
%%%-------------------------------------------------------------------
-module(ibrowse_app).
-behaviour(application).
%%-----------------------... | null | https://raw.githubusercontent.com/cmullaparthi/ibrowse/24cb21f9ec97ab3b181617d966e180ef519c5eef/src/ibrowse_app.erl | erlang | -------------------------------------------------------------------
File : ibrowse_app.erl
Description :
-------------------------------------------------------------------
--------------------------------------------------------------------
Include files
--------------------------------------------------------... | Author : >
Created : 15 Oct 2003 by >
-module(ibrowse_app).
-behaviour(application).
-export([
start/2,
stop/1
]).
-export([
]).
Macros
Records
Returns : { ok , Pid } |
{ ok , Pid , State } |
start(_Type, _StartArgs) ->
case ibrowse_sup:start_link() o... |
8a44ed2e96ba757cea10de0e2f9d7b3b79767dab41f432e99837d878d3a58bbc | racket/racket-lang-org | pollen.rkt | #lang racket
(require pollen/decode
pollen/private/whitespace
sugar/list
sugar/unstable/string
txexpr
racket/runtime-path
racket/file)
(provide (all-defined-out))
(define rcon-blue "rgb(52.941176%,80.784314%,98.039216%)")
(define rcon-red "rgb(86.27451%,7.843137%,2... | null | https://raw.githubusercontent.com/racket/racket-lang-org/88dada2ee769ada9afaf1e3ec1fb28b8ddf216db/rcon/2018/pollen.rkt | racket | "http" catches both "http" and "https" prefixes
basic | #lang racket
(require pollen/decode
pollen/private/whitespace
sugar/list
sugar/unstable/string
txexpr
racket/runtime-path
racket/file)
(provide (all-defined-out))
(define rcon-blue "rgb(52.941176%,80.784314%,98.039216%)")
(define rcon-red "rgb(86.27451%,7.843137%,2... |
2619e40552eca7d2b7c30c26a6660e46f5519d9345dbf755a2da1bebb124f331 | hspec/mockery | Environment.hs | module Test.Mockery.Environment (
withEnvironment
, withModifiedEnvironment
) where
import Control.Exception.Base
import Control.Monad
import System.Environment.Compat
-- |
-- Run the given action within the specified environment.
--
-- Before executing the action, `withEnvironment` ba... | null | https://raw.githubusercontent.com/hspec/mockery/ea8dd887ec8e44afff53e039f0d82374050bac10/src/Test/Mockery/Environment.hs | haskell | |
Run the given action within the specified environment.
Before executing the action, `withEnvironment` backs up the current
environment, clears out the environment, and then applies the supplied
environment.
After the action has completed the original environment is restored.
__Note__: The environment is glob... | module Test.Mockery.Environment (
withEnvironment
, withModifiedEnvironment
) where
import Control.Exception.Base
import Control.Monad
import System.Environment.Compat
withEnvironment :: [(String, String)] -> IO a -> IO a
withEnvironment environment action = bracketEnvironment $ do
s... |
0356773a9925b800915590659ee2f6aba231f6f2fc420977599788d4fc33cc9c | aryx/xix | types.ml | Copyright 2016 , see copyright.txt
open Common
type symbol = string * scope
and scope =
| Public
| Private of int (* represents a unique filename, less: use filename? *)
increments by 1
type virt_pc = int
increments by 4 for ARM
type real_pc = int
32 bits
type addr = int
32 bits
type word = ... | null | https://raw.githubusercontent.com/aryx/xix/60ce1bd9a3f923e0e8bb2192f8938a9aa49c739c/linker/types.ml | ocaml | represents a unique filename, less: use filename?
before layout
the filename is for safe linking error report
todo: * Common.filename
after layout
offset to start of data section for ARM
less: could be (string, addr) Common.either too
todo: report also offending object files
less: could print the objec... | Copyright 2016 , see copyright.txt
open Common
type symbol = string * scope
and scope =
| Public
increments by 1
type virt_pc = int
increments by 4 for ARM
type real_pc = int
32 bits
type addr = int
32 bits
type word = int
32 bits
type offset = int
8 bits
type byte = char
type section =
| ... |
9642fae18e8ba80d650eeec507ce6d00e0c5fa6636464bf9c0823ba2a3f1b651 | bmeurer/ocaml-arm | syntax.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/bmeurer/ocaml-arm/43f7689c76a349febe3d06ae7a4fc1d52984fd8b/testsuite/tests/tool-lexyacc/syntax.ml | ocaml | *********************************************************************
OCaml
... | , 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$
type location =
Location ... |
c3a681be11a79e64367e21c880c962fc66757b27947517709f168fa2784bd9c0 | siraben/haoc-2021 | day8.hs | # LANGUAGE NoMonomorphismRestriction #
import Criterion.Main
import Data.Foldable
import Data.Function
import Data.List
import Data.Maybe
-- | Count the number of items in a container where the predicate is true.
countIf :: Foldable f => (a -> Bool) -> f a -> Int
countIf p = length . filter p . toList
f x = length x... | null | https://raw.githubusercontent.com/siraben/haoc-2021/9e2647a02f1e9b8830066f1a9f3b073bdbe92341/day8.hs | haskell | | Count the number of items in a container where the predicate is true. | # LANGUAGE NoMonomorphismRestriction #
import Criterion.Main
import Data.Foldable
import Data.Function
import Data.List
import Data.Maybe
countIf :: Foldable f => (a -> Bool) -> f a -> Int
countIf p = length . filter p . toList
f x = length x `elem` [2, 3, 4, 7]
lup = (fromJust .) . lookup
applyConstraint x ass = ... |
c38b9e9cb98f855c7680a527b5cbf3654600834a7bc33ba64ee4dffcf6dcee05 | kmi/irs | instances.lisp | Mode : Lisp ; Package :
(in-package CASHEW)
(defun cl-user::instantiate-workflow (wf)
(instantiate-workflow wf))
(defun instantiate-workflow (wf)
(let ((wfi (ocml::name (ocml::internal-define-anonymous-instance wf "" nil)))
(performs (ocml::setofall '?p `(ocml::has-perform ,wf ?p))))
(format t "in... | null | https://raw.githubusercontent.com/kmi/irs/e1b8d696f61c6b6878c0e92d993ed549fee6e7dd/src/cashew/instances.lisp | lisp | Package : |
(in-package CASHEW)
(defun cl-user::instantiate-workflow (wf)
(instantiate-workflow wf))
(defun instantiate-workflow (wf)
(let ((wfi (ocml::name (ocml::internal-define-anonymous-instance wf "" nil)))
(performs (ocml::setofall '?p `(ocml::has-perform ,wf ?p))))
(format t "instantiating ~s as ~s~%" wf ... |
65e24f1d9bd9568e7091e073a6b680de4d22824f10af5aacbb79fbe1c1a97b1c | gonzojive/elephant | bdb-collections.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Base : 10 -*-
;;;
;;; collections.lisp -- view Berkeley DBs as Lisp collections
;;;
Initial version 8/26/2004 by
;;; <>
;;;
;;; part of
;;;
Elephant : an object - oriented database for Common Lisp
;;;
Copyright ( c ) 2004 by and
;;; <> <>
;;;
Portions ... | null | https://raw.githubusercontent.com/gonzojive/elephant/b29a012ab75ccea2fc7fc4f1e9d5e821f0bd60bf/src/db-bdb/bdb-collections.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 -*-
collections.lisp -- view Berkeley DBs as Lisp collections
<>
part of
<> <>
Elephant users are granted the rights to distribute and use this software
(), also known as the LLGPL.
It would be nice if this were a macro or a function
that would allow all of i... | Initial version 8/26/2004 by
Elephant : an object - oriented database for Common Lisp
Copyright ( c ) 2004 by and
Portions Copyright ( c ) 2005 - 2007 by and
< common - lisp net > < ieslick common - lisp net >
as governed by the terms of the Lisp Lesser GNU Public License
(in-package :db-bdb)
(... |
bd69432b3c1259a3f1ac52112ee8bc0b84cf6fd119d6c74c549631250c604665 | foreverbell/project-euler-solutions | 12.hs | numOfDivisors x = length (filter (\d -> x `mod` d == 0) [1 .. x])
numOfTriDivisors x
| odd x = (numOfDivisors x) * (numOfDivisors ((x + 1) `div` 2))
| even x = (numOfDivisors (x `div` 2)) * (numOfDivisors (x + 1))
main = print ((n * (n + 1)) `div` 2)
where n = head (dropWhile (\x -> (numOfTriDivisors x... | null | https://raw.githubusercontent.com/foreverbell/project-euler-solutions/c0bf2746aafce9be510892814e2d03e20738bf2b/src/12.hs | haskell | numOfDivisors x = length (filter (\d -> x `mod` d == 0) [1 .. x])
numOfTriDivisors x
| odd x = (numOfDivisors x) * (numOfDivisors ((x + 1) `div` 2))
| even x = (numOfDivisors (x `div` 2)) * (numOfDivisors (x + 1))
main = print ((n * (n + 1)) `div` 2)
where n = head (dropWhile (\x -> (numOfTriDivisors x... | |
390c0b4e37db2faaa115bb11c96f5383569d4dcf7bd3460f4b30a7657dfa28cb | ocaml/opam | opamCudf_crowbar.ml | (**************************************************************************)
(* *)
Copyright 2019 INRIA
(* *)
(* All rights ... | null | https://raw.githubusercontent.com/ocaml/opam/074df6b6d87d4114116ea41311892b342cfad3de/src/crowbar/opamCudf_crowbar.ml | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2019 INRIA
GNU Lesser General Public License version 2.1 , with the special
open Cudf_types
open Cudf
open! Crowbar
open OpamCrowbar
let version = nice_int
let relop : relop gen = choose [
const `Eq;
const `Neq;
const `Geq;
con... |
dddc91ece63e321ee7646fec6e7bd99064ce3aa1d3f6e2174c70b577e7729b37 | tezos/tezos-mirror | slot_manager.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2022 Nomadic Labs , < >
(* ... | null | https://raw.githubusercontent.com/tezos/tezos-mirror/2e34c19183461d5445334143d2b8a264e5f4cef1/src/bin_dal_node/slot_manager.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2022 Nomadic Labs , < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN A... |
27c24d68b2a729ffc16140c3e11f742b32bc9cafe17818251f544ab58e90a563 | thedavidmeister/xoroshiro128 | prng.cljc | (ns xoroshiro128.prng
(:refer-clojure :exclude [next]))
; PRNG protocol
(defprotocol IPRNG
"A single, seedable state in a PRNG sequence"
(value [_] "The value of this state, as a long")
(next [_] "The next state in the sequence")
(seed [_] "A vector of the seed.")
(jump [_] "The jump function for this algorithm... | null | https://raw.githubusercontent.com/thedavidmeister/xoroshiro128/b4d5be3255e3fa8b78289aa5e7e8e41f14f71aca/src/xoroshiro128/prng.cljc | clojure | PRNG protocol | (ns xoroshiro128.prng
(:refer-clojure :exclude [next]))
(defprotocol IPRNG
"A single, seedable state in a PRNG sequence"
(value [_] "The value of this state, as a long")
(next [_] "The next state in the sequence")
(seed [_] "A vector of the seed.")
(jump [_] "The jump function for this algorithm."))
|
882febbf6627091ec35d54679d9fa6042b9ae49ab214ed8785ebe91c1caf6468 | clojurecup2014/parade-route | ns_libs.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound by
; ... | null | https://raw.githubusercontent.com/clojurecup2014/parade-route/adb2e1ea202228e3da07902849dee08f0bb8d81c/Assets/Clojure/Internal/Plugins/clojure/test_clojure/ns_libs.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 .
Author : ,
(ns clojure.test-clojure.ns-libs
(:use clojure.test))
(deftest test-alias
(is (thrown-with-msg? Exception #"No namespace: epicfail found" (alias 'bogus 'epicfail))))
(deftest test-require
(is (thrown? Exception (require :foo)))
... |
89633f3b7efd62ff33f64628aca2a37b390ffa22e5e0a417f0212121f56d9361 | exoscale/seql | params.clj | (ns ^:no-doc seql.params
"Functions to translate seql queries into input for
honeysql"
(:require [clojure.spec.alpha :as s]
[seql.coerce :as c]
[seql.schema :as schema]))
(defn- ^:no-doc find-selections
"Walks a field definition to find plain fields,
returns a flat lis... | null | https://raw.githubusercontent.com/exoscale/seql/7142132a5c364baf201936052095589489320e99/src/seql/params.clj | clojure | (ns ^:no-doc seql.params
"Functions to translate seql queries into input for
honeysql"
(:require [clojure.spec.alpha :as s]
[seql.coerce :as c]
[seql.schema :as schema]))
(defn- ^:no-doc find-selections
"Walks a field definition to find plain fields,
returns a flat lis... | |
44150921b63c2aa11bfc21ab608870c5e1feae7996db27cf0c7620847ac39344 | haskell-mafia/projector | Expect.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
module Test.Projector.Html.Expect where
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Disorder.Core.IO (testIO)
import Disorder.Jack
import P
import System.FilePath ((</>), (<.>))
i... | null | https://raw.githubusercontent.com/haskell-mafia/projector/6af7c7f1e8a428b14c2c5a508f7d4a3ac2decd52/projector-html/test/Test/Projector/Html/Expect.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE NoImplicitPrelude #
module Test.Projector.Html.Expect where
import qualified Data.Text as T
import qualified Data.Text.IO as T
import Disorder.Core.IO (testIO)
import Disorder.Jack
import P
import System.FilePath ((</>), (<.>))
import System.IO (FilePath... |
e50fcc15bea1d06d3cc15c00eaec35dde2ff7482dffcedf376b8ebdce30afe92 | clojure/tools.logging | test_logging.clj | (ns clojure.tools.test-logging
(:use clojure.test)
(:require
[clojure.set :as set]
[clojure.tools.logging :as log :refer :all]
[clojure.tools.logging.impl :as impl]
[clojure.tools.logging.test :as log-test :refer [logged?
matches]]))
(defn log-e... | null | https://raw.githubusercontent.com/clojure/tools.logging/31073fe1fbb0533f3c775fa667de70809f24b127/src/test/clojure/clojure/tools/test_logging.clj | clojure | (ns clojure.tools.test-logging
(:use clojure.test)
(:require
[clojure.set :as set]
[clojure.tools.logging :as log :refer :all]
[clojure.tools.logging.impl :as impl]
[clojure.tools.logging.test :as log-test :refer [logged?
matches]]))
(defn log-e... | |
d13a9e1ef6bf3f4e862f4d01366732839caaab33667904e083a010c2d4803f42 | thierry-martinez/stdcompat | scanf.mli | module Scanning :
sig
type in_channel
type scanbuf = in_channel
val stdin : in_channel
type file_name = string
val open_in : file_name -> in_channel
val open_in_bin : file_name -> in_channel
val close_in : in_channel -> unit
val from_file : file_name -> in_channel
val from_file_bin : string -> in_chan... | null | https://raw.githubusercontent.com/thierry-martinez/stdcompat/83d786cdb17fae0caadf5c342e283c3dcfee2279/interfaces/4.00/scanf.mli | ocaml | module Scanning :
sig
type in_channel
type scanbuf = in_channel
val stdin : in_channel
type file_name = string
val open_in : file_name -> in_channel
val open_in_bin : file_name -> in_channel
val close_in : in_channel -> unit
val from_file : file_name -> in_channel
val from_file_bin : string -> in_chan... | |
074e736e5bcff2ed802200e6fc5a921b2823c5a64f0c9e9712b9f8a114e4a03e | emillon/switch-builder | version_policy.mli | (** Pick just one a version for each package in a set. *)
type t
val always_latest : t
val override : OpamPackage.t -> t -> t
val apply :
t -> OpamPackage.Version.Set.t OpamPackage.Name.Map.t -> OpamPackage.Set.t
| null | https://raw.githubusercontent.com/emillon/switch-builder/bfe644f15b9a7b717532750dae7428783401d030/version_policy.mli | ocaml | * Pick just one a version for each package in a set. |
type t
val always_latest : t
val override : OpamPackage.t -> t -> t
val apply :
t -> OpamPackage.Version.Set.t OpamPackage.Name.Map.t -> OpamPackage.Set.t
|
698d5537c4aed5b41e10222bc24fc86536f59a402a6488ff22830f38e27f185b | nairobilug/nairobi-bot | Config.hs | {-# LANGUAGE OverloadedStrings #-}
module Bot.Data.Config (getConfig) where
import qualified Data.ByteString as BS
import System.Directory (doesFileExist)
import Bot.Types (Config)
import Control.Exception (catch)
import Data.Yaml
import System.IO.Error
fallbackConfig :: FilePath
fallbackConfig = "config.yaml"
-- F... | null | https://raw.githubusercontent.com/nairobilug/nairobi-bot/597651121bcca161e11541bf39abe9b88c7be047/src/Bot/Data/Config.hs | haskell | # LANGUAGE OverloadedStrings #
Falls back to a config.yaml file when it can't read the file passed
throw an IO Error as a result of a parseexception | module Bot.Data.Config (getConfig) where
import qualified Data.ByteString as BS
import System.Directory (doesFileExist)
import Bot.Types (Config)
import Control.Exception (catch)
import Data.Yaml
import System.IO.Error
fallbackConfig :: FilePath
fallbackConfig = "config.yaml"
getConfig :: FilePath -> IO Config
getC... |
667fcbfee98055ef7bc90dda6d7cde49510de0807142b3972484d001c8d9da2c | datacraft-dsc/starfish-clj | test_did.clj | (ns starfish.test-did
(:require [clojure.test :refer [is are testing deftest run-all-tests]])
(:require [starfish.core :refer :all]))
;;===================================
;; DID tests
(deftest test-did
(testing "did?"
(is (did? (did "did:op:123/456")))
(is (not (did? "did:op:123/456"))))
(testing ... | null | https://raw.githubusercontent.com/datacraft-dsc/starfish-clj/d199c0f7c96f5dd6941507556bc3070396eb3a04/src/test/clojure/starfish/test_did.clj | clojure | ===================================
DID tests | (ns starfish.test-did
(:require [clojure.test :refer [is are testing deftest run-all-tests]])
(:require [starfish.core :refer :all]))
(deftest test-did
(testing "did?"
(is (did? (did "did:op:123/456")))
(is (not (did? "did:op:123/456"))))
(testing "did id"
(is (= "123" (did-id "did:op:123/456")... |
2d5e2d207b91c692f7db01cce0c42398508e7cc8583a201e9bb806bd0e8320f4 | donut-party/system | state.clj | (ns donut.system.repl.state
(:require [clojure.tools.namespace.repl :as repl]))
(repl/disable-reload!)
(def system nil)
| null | https://raw.githubusercontent.com/donut-party/system/914f31851db98dc27d647ee1fb2d5bec4826288f/src/donut/system/repl/state.clj | clojure | (ns donut.system.repl.state
(:require [clojure.tools.namespace.repl :as repl]))
(repl/disable-reload!)
(def system nil)
| |
324f8c042ee9e343fa4b915c1a2b2e334de84aab7a79564021aee8e880073933 | circleci/rollcage | project.clj | (defproject circleci/rollcage
(format "1.0.%s" (or (System/getenv "CIRCLE_BUILD_NUM")
"0-SNAPSHOT"))
:description "A Clojure client for Rollbar"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:repositories [["releases" {:url ""
... | null | https://raw.githubusercontent.com/circleci/rollcage/6cdf17c454978235efdde1643ee28f7d26f7488d/project.clj | clojure | (defproject circleci/rollcage
(format "1.0.%s" (or (System/getenv "CIRCLE_BUILD_NUM")
"0-SNAPSHOT"))
:description "A Clojure client for Rollbar"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:repositories [["releases" {:url ""
... | |
61643170966475349d4e63b0fc601e9ba963ac8abee93fea89ca602784618e12 | mzp/scheme-abc | swfBaseOutTest.ml | open Base
open OUnit
open SwfType
open SwfBaseOut
let char c =
`Ui8 (Char.code c)
let ok_i x y =
assert_equal ~printer:Std.dump x @@ to_list [ y ]
let ok_b x y =
assert_equal ~printer:Std.dump (to_list x) (to_list y)
let _ = begin "swfBaseOut.ml" >::: [
"equality" >:: begin fun () ->
assert_equal (`Si8 ... | null | https://raw.githubusercontent.com/mzp/scheme-abc/2cb541159bcc32ae4d033793dea6e6828566d503/swflib/swfBaseOutTest.ml | ocaml | open Base
open OUnit
open SwfType
open SwfBaseOut
let char c =
`Ui8 (Char.code c)
let ok_i x y =
assert_equal ~printer:Std.dump x @@ to_list [ y ]
let ok_b x y =
assert_equal ~printer:Std.dump (to_list x) (to_list y)
let _ = begin "swfBaseOut.ml" >::: [
"equality" >:: begin fun () ->
assert_equal (`Si8 ... | |
2f6ca92efcd3d39b376c1afbced06d3f7a5a0e2b4353f9ca7f8884ad0183105a | resttime/cl-liballegro | display.lisp | (in-package :cl-liballegro)
;; Flags
(defbitfield display-flags
:windowed
:fullscreen
:opengl
:direct3d-internal
:resizable
:frameless
(:noframe 32)
:generate-expose-events
:opengl-3-0
:opengl-forward-compatible
:fullscreen-window
:minimized
:programmable-pipeline
:gtk-toplevel-internal
:... | null | https://raw.githubusercontent.com/resttime/cl-liballegro/0f8a3a77d5c81fe14352d9a799cba20e1a3a90b4/src/constants/display.lisp | lisp | Flags
Display Options
Importance
Display Orientation | (in-package :cl-liballegro)
(defbitfield display-flags
:windowed
:fullscreen
:opengl
:direct3d-internal
:resizable
:frameless
(:noframe 32)
:generate-expose-events
:opengl-3-0
:opengl-forward-compatible
:fullscreen-window
:minimized
:programmable-pipeline
:gtk-toplevel-internal
:maximized... |
b5f512fe90cac8ce1ad20115cbbd165c91016505cf68bef7cd60ef855229da59 | project-oak/hafnium-verification | RestartScheduler.ml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/backend/RestartScheduler.ml | ocaml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | |
9c27777757404557230244eaf605d44b5d5054c898718debfbc80fd9dcabd525 | eugmes/imp | Error.hs | module IMP.Parser.Error
( CustomError(..)
) where
import IMP.AST
import IMP.SourceLoc
import Text.Megaparsec.Error
import Text.Printf
import qualified Data.Text as T
data CustomError = EndMismatch (Located ID) ID
| RWordAsIdentifier T.Text
| IdentifierEndsWithPunctConn T.Text... | null | https://raw.githubusercontent.com/eugmes/imp/7bee4dcff146e041b0242b9e7054dfec4c04c84f/lib/IMP/Parser/Error.hs | haskell | TODO show location of subroutine head | module IMP.Parser.Error
( CustomError(..)
) where
import IMP.AST
import IMP.SourceLoc
import Text.Megaparsec.Error
import Text.Printf
import qualified Data.Text as T
data CustomError = EndMismatch (Located ID) ID
| RWordAsIdentifier T.Text
| IdentifierEndsWithPunctConn T.Text... |
e00b53cc349ca485166a607e75ab2f2a50dd858e05c3330111eeed89133d67e3 | clash-lang/clash-compiler | ResetGen.hs | module ResetGen where
import Clash.Explicit.Prelude
import Clash.Explicit.Testbench
topEntity
:: Clock System
-> Signal System (Bool, Bool)
topEntity clk = bundle (unsafeToHighPolarity r, unsafeToHighPolarity r')
where
r = resetGenN (SNat @3)
r' = holdReset clk enableGen (SNat @2) r
{-# NOINLINE topEnt... | null | https://raw.githubusercontent.com/clash-lang/clash-compiler/8e461a910f2f37c900705a0847a9b533bce4d2ea/tests/shouldwork/Signal/ResetGen.hs | haskell | # NOINLINE topEntity # | module ResetGen where
import Clash.Explicit.Prelude
import Clash.Explicit.Testbench
topEntity
:: Clock System
-> Signal System (Bool, Bool)
topEntity clk = bundle (unsafeToHighPolarity r, unsafeToHighPolarity r')
where
r = resetGenN (SNat @3)
r' = holdReset clk enableGen (SNat @2) r
testBench :: Signa... |
d7ee6c9be12a1b8b78852f0c118d4d27e7c3f3e967ede6e924372a038c05a602 | benoitc/upnp | upnp_app.erl | -module(upnp_app).
-behaviour(application).
-export([start/0]).
%% Application callbacks
-export([start/2, stop/1]).
start() ->
start_app_deps(upnp),
application:start(upnp).
%% ===================================================================
%% Application callbacks
%% =================================... | null | https://raw.githubusercontent.com/benoitc/upnp/75a526d8386f6cff4c2100f45cdb7664b775991e/src/upnp_app.erl | erlang | Application callbacks
===================================================================
Application callbacks
===================================================================
@spec ensure_started(Application :: atom()) -> ok
@doc Start the named application if not already started. | -module(upnp_app).
-behaviour(application).
-export([start/0]).
-export([start/2, stop/1]).
start() ->
start_app_deps(upnp),
application:start(upnp).
start(_StartType, _StartArgs) ->
upnp_sup:start_link().
stop(_State) ->
ok.
start_app_deps(App : : atom ( ) ) - > ok
@doc Start depedent appl... |
44e0867e39d8fd5e74941217a008e8687471fcea92efc18fde7a38e5f6425ddc | babashka/babashka-sql-pods | mssql_test.clj | (ns pod.babashka.mssql-test
(:require [clojure.test :refer :all]))
Nothing here until we figure out how to get an in - memory / test MSSQL DB
| null | https://raw.githubusercontent.com/babashka/babashka-sql-pods/d4fffdf698f9f654a76b303d5a7fa475bcfebdf6/test/pod/babashka/mssql_test.clj | clojure | (ns pod.babashka.mssql-test
(:require [clojure.test :refer :all]))
Nothing here until we figure out how to get an in - memory / test MSSQL DB
| |
f503920d6f5220bb27d05d9d9211eb820729b5331bff9c97bf8263c99f2cecf4 | grin-compiler/ghc-wpc-sample-programs | Jira.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
|
Module : Text . Pandoc . Readers . Org
Copyright : © 2019 - 2020 License : GNU GPL , version 2 or above
Maintainer : >
Conversion of jira wiki formatted plain text to ' Pandoc ' document .
Module : Text.Pa... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/pandoc-11df2a3c0f2b1b8e351ad8caaa7cdf583e1b3b2e/src/Text/Pandoc/Readers/Jira.hs | haskell | # LANGUAGE OverloadedStrings #
| Read Jira wiki markup.
Blocks
| Create a pandoc @'CodeBlock'@
| Create a pandoc @'Div'@
| Give textual representation of a color.
This relies on 'simpleTable' to sanitize the table.
| # LANGUAGE LambdaCase #
|
Module : Text . Pandoc . Readers . Org
Copyright : © 2019 - 2020 License : GNU GPL , version 2 or above
Maintainer : >
Conversion of jira wiki formatted plain text to ' Pandoc ' document .
Module : Text.Pandoc.Readers.Org
Copyright : ©... |
9b3134a5557c6930d947809cbdceedbd0c4f45920c80cf859c6e9b5970c9e3ef | clojure-interop/aws-api | core.clj | (ns com.amazonaws.services.iotevents.core
(:refer-clojure :only [require comment defn ->])
(:import ))
(require '[com.amazonaws.services.iotevents.AWSIoTEvents])
(require '[com.amazonaws.services.iotevents.AWSIoTEventsAsync])
(require '[com.amazonaws.services.iotevents.AWSIoTEventsAsyncClient])
(require '[com.amaz... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.iotevents/src/com/amazonaws/services/iotevents/core.clj | clojure | (ns com.amazonaws.services.iotevents.core
(:refer-clojure :only [require comment defn ->])
(:import ))
(require '[com.amazonaws.services.iotevents.AWSIoTEvents])
(require '[com.amazonaws.services.iotevents.AWSIoTEventsAsync])
(require '[com.amazonaws.services.iotevents.AWSIoTEventsAsyncClient])
(require '[com.amaz... | |
617bc7c45d072dd1031c9a9865250d3a5cfbbde8b02473f13da402fa48334d93 | bollu/koans | taglessfinal.hs | -- -final/index.html#course-oxford
| null | https://raw.githubusercontent.com/bollu/koans/0204e9bb5ef9c541fe161523acac3cacae5d07fe/taglessfinal.hs | haskell | -final/index.html#course-oxford | |
72171157ec645aa6b253ed5d82f7f100165ce00ebb8e8790bb65b6c5748b4b2b | chetmurthy/pa_ppx | test_extensible_variants.ml | let filemod = "Test_extensible_variants"
open OUnit2
module Pa_ppx_runtime = Pa_ppx_runtime_fat
open Pa_ppx_runtime
type json =
[ `Assoc of (string * json) list
| `Bool of bool
| `Float of float
| `Int of int
| `Intlit of string
| `List of json list
| `Null
| `String of string
| `Tuple of json list
... | null | https://raw.githubusercontent.com/chetmurthy/pa_ppx/7c662fcf4897c978ae8a5ea230af0e8b2fa5858b/tests-ounit2/test_extensible_variants.ml | ocaml | let filemod = "Test_extensible_variants"
open OUnit2
module Pa_ppx_runtime = Pa_ppx_runtime_fat
open Pa_ppx_runtime
type json =
[ `Assoc of (string * json) list
| `Bool of bool
| `Float of float
| `Int of int
| `Intlit of string
| `List of json list
| `Null
| `String of string
| `Tuple of json list
... | |
77d815a49796b32353b7fec1ad95d7b00b0416b4c9ba3c2bd21cd77521392d0d | racket/plai | lang-names.rkt | #lang racket/base
(provide PLAI-LANG COLLECT-LANG MUTATE-LANG WEB-LANG)
(define PLAI-LANG "PLAI Scheme")
(define COLLECT-LANG "GC Collector Scheme")
(define MUTATE-LANG "GC Mutator Scheme")
(define WEB-LANG "Web Application Scheme")
| null | https://raw.githubusercontent.com/racket/plai/164f3b763116fcfa7bd827be511650e71fa04319/plai-doc/scribblings/lang-names.rkt | racket | #lang racket/base
(provide PLAI-LANG COLLECT-LANG MUTATE-LANG WEB-LANG)
(define PLAI-LANG "PLAI Scheme")
(define COLLECT-LANG "GC Collector Scheme")
(define MUTATE-LANG "GC Mutator Scheme")
(define WEB-LANG "Web Application Scheme")
| |
24fc2cee5c681705e197b7e36d4839a158273d1c7851ce613320cd196b773595 | facebook/duckling | Rules.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
module Duckling.AmountOfMo... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/AmountOfMoney/HE/Rules.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings # | Copyright ( c ) 2016 - present , Facebook , Inc.
# LANGUAGE LambdaCase #
module Duckling.AmountOfMoney.HE.Rules
( rules
) where
import Data.Maybe
import Data.String
import Prelude
import Duckling.AmountOfMoney.Helpers
import Duckling.AmountOfMoney.Types
( Currency(..)
, AmountOfMoneyData(..)
)
import Du... |
59ed7d649ec8e70e3a85eecf0eec3d39c0c0f178e10fd25a8e90dd3681d5819b | astrada/ocaml-extjs | ext_AbstractPlugin.mli | * The AbstractPlugin class is the base class from wh ...
{ % < p > The AbstractPlugin class is the base class from which user - implemented plugins should inherit.</p >
< p > This class defines the essential API of plugins as used by Components by defining the following >
< ul >
< li><p><code > init</co... | null | https://raw.githubusercontent.com/astrada/ocaml-extjs/77df630a75fb84667ee953f218c9ce375b3e7484/lib/ext_AbstractPlugin.mli | ocaml | * {% <p>The destroy method is invoked by the owning Component at the time the Component is being destroyed.</p>
<p>The supplied implementation is empty. Subclasses should perform plugin cleanup in their own implementation of
this method.</p> %}
* {% <p>The base implementation just sets the plugin's <code>disabled... | * The AbstractPlugin class is the base class from wh ...
{ % < p > The AbstractPlugin class is the base class from which user - implemented plugins should inherit.</p >
< p > This class defines the essential API of plugins as used by Components by defining the following >
< ul >
< li><p><code > init</co... |
0802d41493a4747db613c6f8a82694eaaecf5161361984938d17c3d518802756 | eeng/shevek | recorder.cljs | (ns shevek.reflow.interceptors.recorder)
(defn recorder [interceptor & {:keys [events-to-keep] :or {events-to-keep 20}}]
(fn [db event]
(let [recorded-event {:timestamp (js/Date.)
:event (first event)}] ; Record only the name of the event for now. If we were to store the whole event wit... | null | https://raw.githubusercontent.com/eeng/shevek/7783b8037303b8dd5f320f35edee3bfbb2b41c02/src/cljs/shevek/reflow/interceptors/recorder.cljs | clojure | Record only the name of the event for now. If we were to store the whole event with its params we'd have to take care of hiding sensitive data. | (ns shevek.reflow.interceptors.recorder)
(defn recorder [interceptor & {:keys [events-to-keep] :or {events-to-keep 20}}]
(fn [db event]
(let [recorded-event {:timestamp (js/Date.)
(-> db
(update :last-events #(->> %1 (cons %2) (take events-to-keep) vec) recorded-event)
(interceptor even... |
46d1ca2193c83fcca09262fbb1ce5aa13d3444b14b8c5f70f78d360a780c72e9 | odis-labs/order | Order_magic.mli |
open Order
* Polymorphic { { : -perils-of-polymorphic-compare/ } " magic " }
functions for structural comparison .
{ [
open Order_magic
let ( ) =
assert ( ' A ' < ' Z ' ) ;
assert ( max " abc " " xyz " = " xyz " )
] }
{ b Warning :} The polymorphic functions in this ... | null | https://raw.githubusercontent.com/odis-labs/order/0dd9f19bd88520912a4b83d97f4189dc7e139637/src/Order_magic.mli | ocaml | * [a <> b] is [not (a = b)], {i i.e.}, the negation of {!(=)}.
* [equal a b] is equivalent to [a == b]. |
open Order
* Polymorphic { { : -perils-of-polymorphic-compare/ } " magic " }
functions for structural comparison .
{ [
open Order_magic
let ( ) =
assert ( ' A ' < ' Z ' ) ;
assert ( max " abc " " xyz " = " xyz " )
] }
{ b Warning :} The polymorphic functions in this ... |
52f2f428fff6ed918f6308d12aca2101a2787d2a8513f113cf7e60b563150cf1 | higherkindness/mu-haskell | ClientOptics.hs | # language DataKinds #
# language OverloadedLabels #
module Main where
import Data.Conduit
import qualified Data.Conduit.Combinators as C
import qualified Data.Text as T
import Mu.GRpc.Client.Optics
import System.Environment
import Schema
main :: IO ()
... | null | https://raw.githubusercontent.com/higherkindness/mu-haskell/e41ba786f556cfac962e0f183b36bf9ae81d69e4/examples/with-persistent/src/ClientOptics.hs | haskell | # language DataKinds #
# language OverloadedLabels #
module Main where
import Data.Conduit
import qualified Data.Conduit.Combinators as C
import qualified Data.Text as T
import Mu.GRpc.Client.Optics
import System.Environment
import Schema
main :: IO ()
... | |
6a66165ff3c3cef795a56ac82e21ae3d0edc3533b1d4774ba72941584c65d5d1 | eltex-ecss/chronica | chronica_cache.erl | -module(chronica_cache).
-include("chronica_int.hrl").
-include("chronica_config.hrl").
-include_lib("pt_scripts/include/pt_macro.hrl").
-include_lib("pt_lib/include/pt_lib.hrl").
-export(
[
load/2,
save/3
]).
load(CacheDir, ConfigHash) ->
Filename = cache_filename(CacheDir, ConfigHash),
case f... | null | https://raw.githubusercontent.com/eltex-ecss/chronica/bdc9f37797cd74215a02aabedf03b09005e9b21f/src/chronica_cache.erl | erlang | -module(chronica_cache).
-include("chronica_int.hrl").
-include("chronica_config.hrl").
-include_lib("pt_scripts/include/pt_macro.hrl").
-include_lib("pt_lib/include/pt_lib.hrl").
-export(
[
load/2,
save/3
]).
load(CacheDir, ConfigHash) ->
Filename = cache_filename(CacheDir, ConfigHash),
case f... | |
da02f81cb3a671c0134d643109445339dee9d314f8162607746ccbbb70336106 | malcolmreynolds/GSLL | random-number-generators.lisp | Regression test RANDOM - NUMBER - GENERATORS for GSLL , automatically generated
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST RANDOM-NUMBER-GENERATORS
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
(LIST 999 162 282 947 231 484 957 744 540 739 759))
(MULTIPLE-VALUE-LIST
(LET ((RNG (MAKE-RANDOM-NUMBER-GENERATOR... | null | https://raw.githubusercontent.com/malcolmreynolds/GSLL/2f722f12f1d08e1b9550a46e2a22adba8e1e52c4/tests/random-number-generators.lisp | lisp | Regression test RANDOM - NUMBER - GENERATORS for GSLL , automatically generated
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST RANDOM-NUMBER-GENERATORS
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
(LIST 999 162 282 947 231 484 957 744 540 739 759))
(MULTIPLE-VALUE-LIST
(LET ((RNG (MAKE-RANDOM-NUMBER-GENERATOR... | |
28e7e0910e3856ad18d2dca7e21c7edc0eec90c23ed56e2ec01e5bab1f8f4334 | janestreet/merlin-jst | nested_applications.ml | module type S = sig
type t
end
module Identity(X : S) : S = X
module Apply(Id : S -> S) = Id
module Simple = struct
type t
end
module M1 = Identity(Identity(Simple))
module M2 = Apply(Identity)(Simple)
type t1 = M1.t
type t2 = M2.t
module Alternative_apply(Id : S -> S)(X : S) = struct include Id(X) end
mod... | null | https://raw.githubusercontent.com/janestreet/merlin-jst/0152b4e8ef1b7cd0ddee2873aa1860a971585391/tests/test-dirs/locate/functors/f-nested_applications.t/nested_applications.ml | ocaml | module type S = sig
type t
end
module Identity(X : S) : S = X
module Apply(Id : S -> S) = Id
module Simple = struct
type t
end
module M1 = Identity(Identity(Simple))
module M2 = Apply(Identity)(Simple)
type t1 = M1.t
type t2 = M2.t
module Alternative_apply(Id : S -> S)(X : S) = struct include Id(X) end
mod... | |
fd9213958e7a4383d06925447eb41267290c7fa2d9fb1dc94a1274e959925f9e | anoma/juvix | Types.hs | module Juvix.Compiler.Internal.Translation.FromAbstract.Analysis.Termination.Error.Types where
import Juvix.Compiler.Abstract.Language
import Juvix.Data.PPOutput
import Juvix.Prelude
newtype NoLexOrder = NoLexOrder
{ _noLexOrderFun :: Name
}
deriving stock (Show)
makeLenses 'NoLexOrder
instance ToGenericError... | null | https://raw.githubusercontent.com/anoma/juvix/fab40c6c9932cc12592fbacc54fac1ddcd3b2228/src/Juvix/Compiler/Internal/Translation/FromAbstract/Analysis/Termination/Error/Types.hs | haskell | module Juvix.Compiler.Internal.Translation.FromAbstract.Analysis.Termination.Error.Types where
import Juvix.Compiler.Abstract.Language
import Juvix.Data.PPOutput
import Juvix.Prelude
newtype NoLexOrder = NoLexOrder
{ _noLexOrderFun :: Name
}
deriving stock (Show)
makeLenses 'NoLexOrder
instance ToGenericError... | |
de1c7f3bfb5306915aff0dd821f4e491866300cc26ef7a1055dc37f9e2582f7b | pascal-knodel/haskell-craft | E'7'10.hs | --
--
--
-----------------
Exercise 7.10 .
-----------------
--
--
--
module E'7'10 where
import E'7''8 ( elemNum )
import E'7''9 ( unique )
import Test.QuickCheck
prop_elemNum_unique :: Integer -> [Integer] -> Bool
prop_elemNum_unique integer integerList
= (elemNum integer (unique integerList)) `elem` [ 0... | null | https://raw.githubusercontent.com/pascal-knodel/haskell-craft/c03d6eb857abd8b4785b6de075b094ec3653c968/_/links/E'7'10.hs | haskell |
---------------
---------------
GHCi> quickCheck prop_elemNum_unique | Exercise 7.10 .
module E'7'10 where
import E'7''8 ( elemNum )
import E'7''9 ( unique )
import Test.QuickCheck
prop_elemNum_unique :: Integer -> [Integer] -> Bool
prop_elemNum_unique integer integerList
= (elemNum integer (unique integerList)) `elem` [ 0 , 1 ]
|
a26cb07b81797d1255722080f65ab84efa8c78d7f807db7376eba34cdbf0f1e7 | reborg/binpack | core_test.clj | (ns binpack.core-test
(:use [midje.sweet])
(:require [binpack.core :as k]))
(fact "verification on size of containers"
(k/exceeded? [[3 2 3] [3 7]] [10 10]) => falsey
(k/exceeded? [[3 2 3] [3 5]] [10 1]) => truthy)
(facts "conditional allocation"
(fact "room to allocate"
(k/add-fir... | null | https://raw.githubusercontent.com/reborg/binpack/6b47946236f45d272f3cdf03ce5437c35e340f82/test/binpack/core_test.clj | clojure | (ns binpack.core-test
(:use [midje.sweet])
(:require [binpack.core :as k]))
(fact "verification on size of containers"
(k/exceeded? [[3 2 3] [3 7]] [10 10]) => falsey
(k/exceeded? [[3 2 3] [3 5]] [10 1]) => truthy)
(facts "conditional allocation"
(fact "room to allocate"
(k/add-fir... | |
d92422db56617fca610207419bbe0f64035207b9c4565db6794a2a7db57b7fb8 | stamourv/feature-profile | structs.rkt | #lang racket
(provide (all-defined-out))
(struct feature (name key grouper analysis)
#:methods gen:custom-write
[(define (write-proc f port mode)
(write-string (format "#<feature: ~s>" (feature-name f))
port))])
(struct feature-report
(feature core-samples raw-sa... | null | https://raw.githubusercontent.com/stamourv/feature-profile/cc96e3aa8efe71c013f662c60e2b0d9231b27f97/structs.rkt | racket | #lang racket
(provide (all-defined-out))
(struct feature (name key grouper analysis)
#:methods gen:custom-write
[(define (write-proc f port mode)
(write-string (format "#<feature: ~s>" (feature-name f))
port))])
(struct feature-report
(feature core-samples raw-sa... | |
c8b7ff99e6e471903f97ee322c79979e903368121bb99a5ef6b2ebf13426bbd0 | BorjaEst/enn | cortex.erl | %%%-------------------------------------------------------------------
@doc The cortex is a NN synchronizing element . It needs to know
the Pid of every neural network element , so that it will know when
%%% all the outputs have received their control inputs, and that it’s
%%% time for the inputs to again gather an... | null | https://raw.githubusercontent.com/BorjaEst/enn/fa6c18913f3fb3e9391234c5e90cbcb432355bc0/src/cortex.erl | erlang | -------------------------------------------------------------------
all the outputs have received their control inputs, and that it’s
time for the inputs to again gather and fanout input data to the
neurons in the input layer.
@end
-------------------------------------------------------------------
TODO: To dele... | @doc The cortex is a NN synchronizing element . It needs to know
the Pid of every neural network element , so that it will know when
TODO : probably the fan_in fan_out function is not correct
-module(cortex).
-include_lib("math_constants.hrl").
-include_lib("enn_logger.hrl").
-include_lib("eunit/include/eunit.h... |
80cdc904d8997f77cb43e776fd899a3d2b91915916f68f005b802f0716dd7f2b | CloudI/CloudI | epgsql_wire.erl | %%% @doc
Interface to encoder / decoder for postgresql
< a href=" / docs / current / protocol - message - formats.html">wire - protocol</a >
%%%
%%% See also `include/epgsql_protocol.hrl'.
%%% @end
Copyright ( C ) 2009 - . All rights reserved .
%%% Copyright (C) 2011 - Anton Lebedevich. All rights reserved.
... | null | https://raw.githubusercontent.com/CloudI/CloudI/5008c3011cc0e7f86b7855023d186b43cb379326/src/external/cloudi_x_epgsql/src/epgsql_wire.erl | erlang | @doc
See also `include/epgsql_protocol.hrl'.
@end
Copyright (C) 2011 - Anton Lebedevich. All rights reserved.
Encoders for Client -> Server packets
-type packet_type(Exact) :: Exact. % TODO: uncomment when OTP-18 is dropped
@doc tries to extract single postgresql packet from TCP stream
@doc decode a single ... | Interface to encoder / decoder for postgresql
< a href=" / docs / current / protocol - message - formats.html">wire - protocol</a >
Copyright ( C ) 2009 - . All rights reserved .
-module(epgsql_wire).
-export([decode_message/1,
decode_error/1,
decode_strings/1,
decode_columns/3,
... |
1b2ad30cae6b36c9c2fd3428fca2b58d5d171ccabd703482a622e0b150cd54ae | ocaml/dune | rules.ml | open Import
module Action_builder = Action_builder0
module Id = Id.Make ()
module Dir_rules = struct
module Alias_spec = struct
type item =
| Deps of unit Action_builder.t
| Action of Rule.Anonymous_action.t Action_builder.t
type t = { expansions : (Loc.t * item) Appendable_list.t } [@@unboxed]... | null | https://raw.githubusercontent.com/ocaml/dune/4e83d1b80bd9a37de7e0d39d6f22873850314557/src/dune_engine/rules.ml | ocaml | open Import
module Action_builder = Action_builder0
module Id = Id.Make ()
module Dir_rules = struct
module Alias_spec = struct
type item =
| Deps of unit Action_builder.t
| Action of Rule.Anonymous_action.t Action_builder.t
type t = { expansions : (Loc.t * item) Appendable_list.t } [@@unboxed]... | |
77341927399d3c74a53075ff708eef19e751073b50885357278cbc578e168c6e | fakedata-haskell/fakedata | Color.hs | # LANGUAGE TemplateHaskell #
{-# LANGUAGE OverloadedStrings #-}
module Faker.Color where
import Data.Text
import Faker
import Faker.Internal
import Faker.Provider.Color
import Faker.TH
$(generateFakeField "color" "name")
| null | https://raw.githubusercontent.com/fakedata-haskell/fakedata/e6fbc16cfa27b2d17aa449ea8140788196ca135b/src/Faker/Color.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE TemplateHaskell #
module Faker.Color where
import Data.Text
import Faker
import Faker.Internal
import Faker.Provider.Color
import Faker.TH
$(generateFakeField "color" "name")
|
59747296509117931c0fe9d0ece984443c13fdc31a447505a98fc078b00f34ae | emqx/mria | mria_shards_sup.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2021 - 2023 EMQ Technologies Co. , Ltd. 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 o... | null | https://raw.githubusercontent.com/emqx/mria/fcec1873582c3a66c960da6c7f6d48ac73c64c13/src/mria_shards_sup.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 ... | Copyright ( c ) 2021 - 2023 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(mria_shards_sup).
-behaviour(supervisor).
-export([init/1, start_link/0, find_shard/1,... |
cd2926091afe3f7f860bc0c0002f393cd8c110dea27284f78452c73dcb4d5094 | geraud/access | HLint.hs | module Main (main) where
import Language.Haskell.HLint (hlint)
import System.Exit (exitFailure, exitSuccess)
arguments :: [String]
arguments =
[ "benchmark"
, "executable"
, "library"
, "test-suite"
]
main :: IO ()
main = do
hints <- hlint arguments
if null hints then exitSuccess else exi... | null | https://raw.githubusercontent.com/geraud/access/6dd65c97180953bf01cc47415a1aeee6d2590d65/test-suite/HLint.hs | haskell | module Main (main) where
import Language.Haskell.HLint (hlint)
import System.Exit (exitFailure, exitSuccess)
arguments :: [String]
arguments =
[ "benchmark"
, "executable"
, "library"
, "test-suite"
]
main :: IO ()
main = do
hints <- hlint arguments
if null hints then exitSuccess else exi... | |
7505b87d6c36a5dd52864a5f3545f72fad86999c54d3d50c03763b49ad7e4172 | zadean/xqerl | fn_codepoint_equal_SUITE.erl | -module('fn_codepoint_equal_SUITE').
-include_lib("common_test/include/ct.hrl").
-export([
all/0,
groups/0,
suite/0
]).
-export([
init_per_suite/1,
init_per_group/2,
end_per_group/2,
end_per_suite/1
]).
-export(['fn-codepoint-equal-1'/1]).
-export(['fn-codepoint-equal-2'/1]).
-export(['f... | null | https://raw.githubusercontent.com/zadean/xqerl/1a94833e996435495922346010ce918b4b0717f2/test/fn/fn_codepoint_equal_SUITE.erl | erlang | -module('fn_codepoint_equal_SUITE').
-include_lib("common_test/include/ct.hrl").
-export([
all/0,
groups/0,
suite/0
]).
-export([
init_per_suite/1,
init_per_group/2,
end_per_group/2,
end_per_suite/1
]).
-export(['fn-codepoint-equal-1'/1]).
-export(['fn-codepoint-equal-2'/1]).
-export(['f... | |
b6a0d3483eee0a9436c36b78ad39b29ef8cf275d9c9fc0a0db3d3926cf6d59d2 | crategus/cl-cffi-gtk | pango.vertical-text.lisp | ;;; ----------------------------------------------------------------------------
;;; pango.vertical-text.lisp
;;;
;;; The documentation of this file is taken from the Pango Reference Manual
Version 1.48 and modified to document the Lisp binding to the Pango library .
;;; See <>. The API documentation of the Lisp bind... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/22156e3e2356f71a67231d9868abcab3582356f3/pango/pango.vertical-text.lisp | lisp | ----------------------------------------------------------------------------
pango.vertical-text.lisp
The documentation of this file is taken from the Pango Reference Manual
See <>. The API documentation of the Lisp binding is
This program is free software: you can redistribute it and/or modify
it under the te... | Version 1.48 and modified to document the Lisp binding to the Pango library .
available from < -cffi-gtk/ > .
Copyright ( C ) 2020
as published by the Free Software Foundation , either version 3 of the
the GNU Lesser General Public License that clarifies the terms for use
GNU Lesser General Public License... |
2789225e11337ad086d9dc7782fa0bb02bce55f8503af8413eff210a85e4e5a6 | masatoi/cl-zerodl | conv.lisp | -*- coding : utf-8 ; mode : lisp -*-
(in-package :zerodl)
(ql:quickload :alexandria)
;; conv2d
(defparameter x (make-mat '(2 4 4)
:ctype :float
:initial-contents '(((1 2 3 0)
(0 1 2 3)
... | null | https://raw.githubusercontent.com/masatoi/cl-zerodl/5ba334423b5e5411fd0fff59af5f0cda16f67646/book/conv.lisp | lisp | mode : lisp -*-
conv2d
max-pooling
max-pool!
ydが後のレイヤーから入ってくるbackwardの入力
((-10.0 -16.0 -10.0 -30.0)
(-10.0 -44.0 -4.0 -68.0)
3次元データでできるか?
逆伝搬の具体例
convolve!はyの値を累積していく(yの初期化が必要)
derive-convolve!はxdとwdを累積していく
max-pool
一般的にstrideはpool-dimensionsサイズと合わせる
#<MAT 2x2x2 ... |
(in-package :zerodl)
(ql:quickload :alexandria)
(defparameter x (make-mat '(2 4 4)
:ctype :float
:initial-contents '(((1 2 3 0)
(0 1 2 3)
(3 0 1 2)
... |
e079119965f04eea62630c8b58a1c7c01344acde41695212437915d3e186c879 | proger/mod_pushoff | mod_pushoff.erl | %%%
Copyright ( C ) 2015
Copyright ( C ) 2016
%%%
%%% This program 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 2 of the
%%% License, or (at your option) any later version.
%%%
%... | null | https://raw.githubusercontent.com/proger/mod_pushoff/e3b78c62d026aba339143071a207083b1351164b/src/mod_pushoff.erl | erlang |
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General ... | Copyright ( C ) 2015
Copyright ( C ) 2016
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
with this program ; if not , write to the Free Software... |
2684cd1bd059bd40ff18399c52afa4c31784fb715df840bd1e92bb3d0c7ceb3e | fortytools/holumbus | Worker.hs | module Main
(
main
)
where
import Holumbus.MapReduce.Examples.MandelbrotSet.SimpleDMapReduceIO
import Holumbus.MapReduce.Examples.MandelbrotSet.DMandel
main :: IO ()
main = worker mandelMap mandelReduce [("Holumbus.MapReduce.Types",INFO)]
| null | https://raw.githubusercontent.com/fortytools/holumbus/4b2f7b832feab2715a4d48be0b07dca018eaa8e8/mapreduce/Examples2/Mandelbrot-set/Mandelbrot-set_2/Worker.hs | haskell | module Main
(
main
)
where
import Holumbus.MapReduce.Examples.MandelbrotSet.SimpleDMapReduceIO
import Holumbus.MapReduce.Examples.MandelbrotSet.DMandel
main :: IO ()
main = worker mandelMap mandelReduce [("Holumbus.MapReduce.Types",INFO)]
| |
2dd854e205b88eb18848af33b6a9c83e00fd013295cd0155293c862aa2a80150 | nvim-treesitter/nvim-treesitter | indents.scm | [
(function_definition)
(function_declaration)
(field)
(do_statement)
(method_index_expression)
(while_statement)
(repeat_statement)
(if_statement)
"then"
(for_statement)
(return_statement)
(table_constructor)
(arguments)
(return_statement)
] @indent
[
"end"
")"
"}"
] @indent_end
(re... | null | https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/783c74cefc21eda9602acc3f50409432c95c76b8/queries/lua/indents.scm | scheme | [
(function_definition)
(function_declaration)
(field)
(do_statement)
(method_index_expression)
(while_statement)
(repeat_statement)
(if_statement)
"then"
(for_statement)
(return_statement)
(table_constructor)
(arguments)
(return_statement)
] @indent
[
"end"
")"
"}"
] @indent_end
(re... | |
379f7f12f69c821d4e6bc9f09b51571e630716a23ddf78a401fcc35d7ceb2ec6 | PJK/haskell-pattern-matching | OracleSpec.hs | module OracleSpec (spec) where
import DataDefs
import Oracle
import Oracle.TestUtils
import Test.Hspec
import Test.QuickCheck
spec :: Spec
spec = do
describe "resolveTrivialTypeEqualities" $ do
it "leaves empty lists alone" $ do
resolveTrivialT... | null | https://raw.githubusercontent.com/PJK/haskell-pattern-matching/7ef4a45731beba92ee01614ae563df65be36e8ba/test/OracleSpec.hs | haskell | variable tuples | module OracleSpec (spec) where
import DataDefs
import Oracle
import Oracle.TestUtils
import Test.Hspec
import Test.QuickCheck
spec :: Spec
spec = do
describe "resolveTrivialTypeEqualities" $ do
it "leaves empty lists alone" $ do
resolveTrivialT... |
03c8efd4581e444e5608aca83baa2353ac95bce696470aec1352037621c284be | basho/riak_kv | riak_kv_get_fsm.erl | %% -------------------------------------------------------------------
%%
%% riak_get_fsm: coordination of Riak GET requests
%%
Copyright ( c ) 2007 - 2013 Basho Technologies , Inc. All Rights Reserved .
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use thi... | null | https://raw.githubusercontent.com/basho/riak_kv/fbb53630645e53af053228d526caa3c86f304066/src/riak_kv_get_fsm.erl | erlang | -------------------------------------------------------------------
riak_get_fsm: coordination of Riak GET requests
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 Lice... | Copyright ( c ) 2007 - 2013 Basho Technologies , Inc. All Rights Reserved .
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
... |
8bd3281ef3d1d7d98d84aa33b53f53376d5b5e441b8003bf9a122ecfa73f3e6d | techascent/tech.ml | classification.clj | (ns tech.v3.libs.smile.classification
"Namespace to require to enable a set of smile classification models."
(:require [tech.v3.datatype :as dtype]
[tech.v3.datatype.protocols :as dtype-proto]
[tech.v3.dataset :as ds]
[tech.v3.dataset.modelling :as ds-mod]
[tech.v3.da... | null | https://raw.githubusercontent.com/techascent/tech.ml/7f2cc506980a05f0f8c85f8b1ff0cde6b9451f54/src/tech/v3/libs/smile/classification.clj | clojure | :fld {:attributes #{:projection}
:datatypes #{:float64-array}
:name :fld
:options [{:name :L
:type :int32
:default -1}
{:name :tolerance
:type :float64
:default 1e-4}]}
:naive-bayes {:attributes #{:online :pr... | (ns tech.v3.libs.smile.classification
"Namespace to require to enable a set of smile classification models."
(:require [tech.v3.datatype :as dtype]
[tech.v3.datatype.protocols :as dtype-proto]
[tech.v3.dataset :as ds]
[tech.v3.dataset.modelling :as ds-mod]
[tech.v3.da... |
51556dcd734354a8475925e2633c0e767a04106a4ef398b8aa38d9e7eaca92f3 | sanel/hubris | project.clj | (defproject hubris "0.2.0"
:description "Hubris - HBase uber shell"
:license "EPL 1.0"
:url ""
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]
[org.apache.hbase/hbase "0.90.0"]
[org.apache.hadoop/hadoop-core "0.20.2"]]
:main... | null | https://raw.githubusercontent.com/sanel/hubris/e119f13a855b4ec86db8d8deb696f8dd59ceea17/project.clj | clojure | (defproject hubris "0.2.0"
:description "Hubris - HBase uber shell"
:license "EPL 1.0"
:url ""
:dependencies [[org.clojure/clojure "1.2.0"]
[org.clojure/clojure-contrib "1.2.0"]
[org.apache.hbase/hbase "0.90.0"]
[org.apache.hadoop/hadoop-core "0.20.2"]]
:main... | |
c529626f99dc7ecc31c936e7fe9cf9347d151d155599a134a0cf900b146330cd | billosys/sockets | client.clj | (ns examples.udp.quote-server.client
(:require
[clojure.java.io :as io]
[examples.common :as common]
[inet.address :as inet]
[sockets.datagram.packet :as packet]
[sockets.datagram.socket :as socket]))
(defn send-request
[sock port]
(socket/send sock
(-> (packet/create 1)
... | null | https://raw.githubusercontent.com/billosys/sockets/21a8949c6a0ed8c52ac590753e95354dc4629777/examples/src/examples/udp/quote_server/client.clj | clojure | (ns examples.udp.quote-server.client
(:require
[clojure.java.io :as io]
[examples.common :as common]
[inet.address :as inet]
[sockets.datagram.packet :as packet]
[sockets.datagram.socket :as socket]))
(defn send-request
[sock port]
(socket/send sock
(-> (packet/create 1)
... | |
0c1963489a41013a3cbcd9e618f2641c0353529cd2627c2d6b57d5c0279e67e4 | braidchat/braid | events.clj | (ns braid.chat.events
(:require
[braid.core.server.db :as db]
[braid.chat.db.group :as group]
[braid.chat.db.thread :as thread]
[braid.chat.db.user :as user]
[braid.core.server.sync-helpers :as sync-helpers]))
(defn user-join-group!
[user-id group-id]
(db/run-txns! (group/user-join-group-txn ... | null | https://raw.githubusercontent.com/braidchat/braid/5d916d555f7d7ba4f5d0a25052741cfb4f9b7b9f/src/braid/chat/events.clj | clojure | (ns braid.chat.events
(:require
[braid.core.server.db :as db]
[braid.chat.db.group :as group]
[braid.chat.db.thread :as thread]
[braid.chat.db.user :as user]
[braid.core.server.sync-helpers :as sync-helpers]))
(defn user-join-group!
[user-id group-id]
(db/run-txns! (group/user-join-group-txn ... | |
34da6f663bc2461d7bbacff7d201e977a5969a867fb030cd6e9ddcc01ba64d2c | BekaValentine/SimpleFP-v2 | ConSig.hs | {-# OPTIONS -Wall #-}
module Modular.Core.ConSig where
import Utils.ABT
import Utils.Names
import Utils.Plicity
import Utils.Pretty (pretty)
import Utils.Telescope
import Modular.Core.DeclArg
import Modular.Core.Term
data ConSig = ConSig [Plicity] (BindingTelescope (Scope TermF))
instance Show ConSig w... | null | https://raw.githubusercontent.com/BekaValentine/SimpleFP-v2/ae00ec809caefcd13664395b0ae2fc66145f6a74/src/Modular/Core/ConSig.hs | haskell | # OPTIONS -Wall # |
module Modular.Core.ConSig where
import Utils.ABT
import Utils.Names
import Utils.Plicity
import Utils.Pretty (pretty)
import Utils.Telescope
import Modular.Core.DeclArg
import Modular.Core.Term
data ConSig = ConSig [Plicity] (BindingTelescope (Scope TermF))
instance Show ConSig where
show (ConSig pl... |
942528d54610ad41700d68ef5bd92fb26883ef4158cd63b6c754fc0e7feb307b | Smoltbob/Caml-Est-Belle | print.ml | let x = 2+3 in
print_int x
| null | https://raw.githubusercontent.com/Smoltbob/Caml-Est-Belle/3d6f53d4e8e01bbae57a0a402b7c0f02f4ed767c/frontend/tests/passed/print.ml | ocaml | let x = 2+3 in
print_int x
| |
bae1bf143b22d0a73291126a519b5220b06dbe902db283a0be0fb7fcc3d47aa4 | OCamlPro/ocp-build | fileOS.ml | (**************************************************************************)
(* *)
(* Typerex Libraries *)
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/OCamlPro/ocp-build/56aff560bb438c12b2929feaf8379bc6f31b9840/libs/ocplib-file/fileOS.ml | ocaml | ************************************************************************
Typerex Libraries
... | Copyright 2011 - 2017 OCamlPro SAS
the GNU Lesser General Public License version 2.1 , with the
open OcpCompat
let win32 = (Sys.os_type = "Win32")
let dir_separator = if win32 then '\\' else '/'
let path_separator = if win32 then ';' else ':'
let dir_separator_st... |
b5a5944b5691982590a56607b9ba09dadfc751089ff0b45843dad56ccad1c35b | WorksHub/client | auth_popup.cljc | (ns wh.components.auth-popup
(:require [wh.components.button-auth :as button-auth]
[wh.components.icons :refer [icon]]
[wh.interop :as interop]
[wh.util :as util]))
(def auth-popup-id "auth-popup")
(defn build-sub-id
[s]
(str auth-popup-id "__" s))
(defn build-additional-con... | null | https://raw.githubusercontent.com/WorksHub/client/7f864db40f2b70eda1336d33ce1b216d34e37432/common/src/wh/components/auth_popup.cljc | clojure | (ns wh.components.auth-popup
(:require [wh.components.button-auth :as button-auth]
[wh.components.icons :refer [icon]]
[wh.interop :as interop]
[wh.util :as util]))
(def auth-popup-id "auth-popup")
(defn build-sub-id
[s]
(str auth-popup-id "__" s))
(defn build-additional-con... | |
39dd97bde04f19f557857bf0455dad26e36a9a49e6161f4e4ce2603ec6286c66 | skanev/playground | 16.scm | SICP exercise 1.16
;
; Design a procedure that evolves an iterative exponentiation process that uses
; successive squaring and uses a logarithmic number of steps, as does
; fast-expt.
;
; Hint: Using the observation that (b^(n/2))^2 = (b^2)^(n/2), keep along with
; the exponent n and the base b, an additional state v... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/01/16.scm | scheme |
Design a procedure that evolves an iterative exponentiation process that uses
successive squaring and uses a logarithmic number of steps, as does
fast-expt.
Hint: Using the observation that (b^(n/2))^2 = (b^2)^(n/2), keep along with
the exponent n and the base b, an additional state variable a, and define the
s... | SICP exercise 1.16
state to state . At the beginning of the process a is taken to be 1 , and the
(define (fast-expt base power)
(define (iter a b n)
(cond ((= n 0) a)
((even? n) (iter a (* b b) (/ n 2)))
(else (iter (* a b) b (- n 1)))))
(iter 1 base power))
|
3deb7119edf1c992e7fabdfc0f2e0cc5eb6ae6caf8f768dcbc43f51b5cc52a5d | haskellfoundation/error-message-index | StrictExtension.hs | {-# LANGUAGE Strict #-}
module StrictExtension where
data A = A
{ a :: Bool
, b :: Int
}
aBad :: A
aBad = A { a = True }
aAlsoBad :: A
aAlsoBad = A { b = 5 }
| null | https://raw.githubusercontent.com/haskellfoundation/error-message-index/6b80c2fe6d8d2941190bda587bcea6f775ded0a4/message-index/messages/GHC-95909/example2/before/StrictExtension.hs | haskell | # LANGUAGE Strict # |
module StrictExtension where
data A = A
{ a :: Bool
, b :: Int
}
aBad :: A
aBad = A { a = True }
aAlsoBad :: A
aAlsoBad = A { b = 5 }
|
d573ec6aa9be230bf10ace66070a6a1733f5f431713a955d10a76464df390ef4 | onaio/hatti | saved_charts.cljs | (ns hatti.views.saved-charts
(:require [hatti.views :refer [saved-charts-page]]
[om.core :as om :include-macros]
[sablono.core :as html :refer-macros [html]]))
(defmethod saved-charts-page :default
[_ _]
(reify
om/IRender
(render [_]
(html [:div.container "Placeholder"]))))
| null | https://raw.githubusercontent.com/onaio/hatti/7dc23c1c60b9fc46e1ff5b023eb6c794ebd04773/src/hatti/views/saved_charts.cljs | clojure | (ns hatti.views.saved-charts
(:require [hatti.views :refer [saved-charts-page]]
[om.core :as om :include-macros]
[sablono.core :as html :refer-macros [html]]))
(defmethod saved-charts-page :default
[_ _]
(reify
om/IRender
(render [_]
(html [:div.container "Placeholder"]))))
| |
1c870353f68a255f15a98b669a4f7473c120b54d4b2992284114f05d2a3abfa5 | nfrisby/coxswain | Col.hs | # LANGUAGE LambdaCase #
module Col where
import GHCAPI (Kind,Type,eqType)
import LowLevel (detCmpType)
import NormalForms
data ColumnNamePresence a =
Absent
|
Present !a
|
UnknownPresence
-- ^ The arguments are not determined enough to decide the
-- presence.
lookupCol :: (Kind,Kind,Col) -> ... | null | https://raw.githubusercontent.com/nfrisby/coxswain/bfd5777964a5b4ba64e1bcc4cf18df1c9d8fc558/coxswain/src/Col.hs | haskell | ^ The arguments are not determined enough to decide the
presence. | # LANGUAGE LambdaCase #
module Col where
import GHCAPI (Kind,Type,eqType)
import LowLevel (detCmpType)
import NormalForms
data ColumnNamePresence a =
Absent
|
Present !a
|
UnknownPresence
lookupCol :: (Kind,Kind,Col) -> [(Kind,Kind,Col)] -> ColumnNamePresence (Maybe (Type,Type))
lookupCol (_,_,col0)... |
9e3f3430e493f932c06117974864ba5cb26bf8490af315f80f836c177ffc06ad | zadean/xqerl | op_subtract_dayTimeDuration_from_date_SUITE.erl | -module('op_subtract_dayTimeDuration_from_date_SUITE').
-include_lib("common_test/include/ct.hrl").
-export([
all/0,
groups/0,
suite/0
]).
-export([
init_per_suite/1,
init_per_group/2,
end_per_group/2,
end_per_suite/1
]).
-export(['op-subtract-dayTimeDuration-from-date2args-1'/1]).
-expo... | null | https://raw.githubusercontent.com/zadean/xqerl/1a94833e996435495922346010ce918b4b0717f2/test/op/op_subtract_dayTimeDuration_from_date_SUITE.erl | erlang | -module('op_subtract_dayTimeDuration_from_date_SUITE').
-include_lib("common_test/include/ct.hrl").
-export([
all/0,
groups/0,
suite/0
]).
-export([
init_per_suite/1,
init_per_group/2,
end_per_group/2,
end_per_suite/1
]).
-export(['op-subtract-dayTimeDuration-from-date2args-1'/1]).
-expo... | |
430d66e3d96500fe3aa30369ca66ecf668f2c88fcb312418b69f413f60579fa5 | rd--/hsc3 | gcd.help.hs | -- gcd
let x = mouseX kr (-200) 200 Linear 0.2
y = mouseY kr (-200) 200 Linear 0.2
in sinOsc ar ((sinOsc kr 0.3 0 * 20) `gcdE` mce2 x y * 30 + 500) 0 * 0.1
-users/msg68916.html ( )
let a = lfSaw ar 0.02 0 * 300 + 1
b = lfSaw ar (1.24 + mce2 0 0.1) 0 * 200 + 1
in sinOsc ar (gcdE a b * 30 + 300) 0 * 0.1
-u... | null | https://raw.githubusercontent.com/rd--/hsc3/60cb422f0e2049f00b7e15076b2667b85ad8f638/Help/Ugen/gcd.help.hs | haskell | gcd | let x = mouseX kr (-200) 200 Linear 0.2
y = mouseY kr (-200) 200 Linear 0.2
in sinOsc ar ((sinOsc kr 0.3 0 * 20) `gcdE` mce2 x y * 30 + 500) 0 * 0.1
-users/msg68916.html ( )
let a = lfSaw ar 0.02 0 * 300 + 1
b = lfSaw ar (1.24 + mce2 0 0.1) 0 * 200 + 1
in sinOsc ar (gcdE a b * 30 + 300) 0 * 0.1
-users/ms... |
def722da202804eb612cdb68839467230386a71fdbeda279b1e8856efd436093 | haskell-works/hw-kafka-conduit | Sink.hs | module Kafka.Conduit.Sink
( module X
, kafkaSink, kafkaSinkAutoClose, kafkaSinkNoClose, kafkaBatchSinkNoClose
, commitOffsetsSink, flushThenCommitSink
) where
import Control.Monad (void)
import Control.Monad.IO.Class
import Control.Monad.Trans.Resource
import Data... | null | https://raw.githubusercontent.com/haskell-works/hw-kafka-conduit/a22a3985b0d0c0dac9a1cf52d600e9ed9ee481ea/src/Kafka/Conduit/Sink.hs | haskell | The producer will be closed when the Sink is closed.
The producer will NOT be closed automatically.
The producer will NOT be closed automatically.
| Creates a kafka producer for given properties and returns a Sink.
'kafkaSinkAutoClose' or 'kafkaSinkNoClose' can be used.
| Ignores incoming messages and commits of... | module Kafka.Conduit.Sink
( module X
, kafkaSink, kafkaSinkAutoClose, kafkaSinkNoClose, kafkaBatchSinkNoClose
, commitOffsetsSink, flushThenCommitSink
) where
import Control.Monad (void)
import Control.Monad.IO.Class
import Control.Monad.Trans.Resource
import Data... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.