_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 |
|---|---|---|---|---|---|---|---|---|
fe0e9d302588762c6ec314be2ed66b1c8454c11cdfad92fdff0b157e84a2317a | deadpendency/deadpendency | MavenLatestReleaseTime.hs | module DF.Effect.FetchRegistryRepoInfo.Backend.LanguageRegistryFiles.Maven.MavenLatestReleaseTime
( MavenLatestReleaseTime (..),
fetchLatestReleaseTime,
)
where
import Common.Parsing.Megaparsec
import DF.Effect.FetchRegistryRepoInfo.Backend.LanguageRegistryFiles.Internal
import DF.Effect.FetchRegistryRepoInfo.... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/dependency-fetcher/src/DF/Effect/FetchRegistryRepoInfo/Backend/LanguageRegistryFiles/Maven/MavenLatestReleaseTime.hs | haskell | -core/5.4.9.Final/
seems the trailing slash is actually important ie. -databind/2.12.2
-connector-java/8.0.31/
fallback to .asc files as in some cases the latest release will not have a pom or jar.. | module DF.Effect.FetchRegistryRepoInfo.Backend.LanguageRegistryFiles.Maven.MavenLatestReleaseTime
( MavenLatestReleaseTime (..),
fetchLatestReleaseTime,
)
where
import Common.Parsing.Megaparsec
import DF.Effect.FetchRegistryRepoInfo.Backend.LanguageRegistryFiles.Internal
import DF.Effect.FetchRegistryRepoInfo.... |
3e18881bb37b132a89c2138bbe2595f0d327a0c495a58a23a68f6bbd68f49084 | flavioc/cl-hurd | io-revoke.lisp |
(in-package :hurd-translator)
(def-io-interface :io-revoke ((file port))
(with-lookup protid file
(let ((this-node (get-node protid))
(bucket (port-bucket *translator*)))
(cond
((is-owner-p this-node (get-user protid))
(bucket-iterate bucket
(lambda (por... | null | https://raw.githubusercontent.com/flavioc/cl-hurd/982232f47d1a0ff4df5fde2edad03b9df871470a/translator/interfaces/io-revoke.lisp | lisp |
(in-package :hurd-translator)
(def-io-interface :io-revoke ((file port))
(with-lookup protid file
(let ((this-node (get-node protid))
(bucket (port-bucket *translator*)))
(cond
((is-owner-p this-node (get-user protid))
(bucket-iterate bucket
(lambda (por... | |
3920b133e416e5dcb0b95af99ed407ce533ba6cb4a3dec4e690b6f62c8d13ceb | thiago-negri/DuDuHoX | Animation.hs | module DuDuHoX.OpenGL.Animation where
import qualified Graphics.Rendering.OpenGL as GL
newtype Animation = Animation [Frame]
type Frame = (Sprite, Duration)
type Duration = Time
^ Seconds
type Sprite = (GL.TextureObject, Dimension)
type Dimension = (Width, Height)
type Width = Int
type Height = Int
animate :: Anim... | null | https://raw.githubusercontent.com/thiago-negri/DuDuHoX/34942751c807ce69cd20d1a1a6fde4d6520460a4/src/DuDuHoX/OpenGL/Animation.hs | haskell | module DuDuHoX.OpenGL.Animation where
import qualified Graphics.Rendering.OpenGL as GL
newtype Animation = Animation [Frame]
type Frame = (Sprite, Duration)
type Duration = Time
^ Seconds
type Sprite = (GL.TextureObject, Dimension)
type Dimension = (Width, Height)
type Width = Int
type Height = Int
animate :: Anim... | |
cff07190da447ffb26cd7731d65bf0a45ae1293f286635e5197dc3b2850b5139 | craff/simple_httpd | gentags.ml |
adapted from -tags ( MIT licensed )
let pf = Printf.printf
let spf = Printf.sprintf
let void = [
"area";
"base";
"br";
"col";
"embed";
"hr";
"img";
"input";
"link";
"menuitem";
"meta";
"param";
"source";
"track";
"wbr";
]
let normal = [
"a";
"abbr";
"address";
"area";
"arti... | null | https://raw.githubusercontent.com/craff/simple_httpd/2683094688b4e0acac5590c50a72f2d6a49e0cca/src/gen/gentags.ml | ocaml | * Output for HTML combinators.
This output type is used to produce a string reasonably efficiently from
a tree of combinators.
* An attribute, i.e. a key/value pair
* A html element. It is represented by its output function, so we
can directly print it.
* Element without children.
* Element with childr... |
adapted from -tags ( MIT licensed )
let pf = Printf.printf
let spf = Printf.sprintf
let void = [
"area";
"base";
"br";
"col";
"embed";
"hr";
"img";
"input";
"link";
"menuitem";
"meta";
"param";
"source";
"track";
"wbr";
]
let normal = [
"a";
"abbr";
"address";
"area";
"arti... |
a9a40478a6c62bb0da0a177f6dd4d18bc25eb9579b2747e0ca37f5a2dc876bed | biocaml/biocaml | iset.ml | Copyright 2003 . distributed with LGPL
Modified by < >
Modified by < >
Copyright 2003 . distributed with LGPL
Modified by < >
module Int = Int
open CFStream
module BatAvlTree = struct
type 'a tree = Empty | Node of 'a tree * 'a * 'a tree * int (* height *)
let empty = Empty
let is_empty... | null | https://raw.githubusercontent.com/biocaml/biocaml/ac619539fed348747d686b8f628e80c1bb8bfc59/lib/unix/iset.ml | ocaml | height
FIXME: this is nlog n because of the left nesting of appends
merge left
merge right | Copyright 2003 . distributed with LGPL
Modified by < >
Modified by < >
Copyright 2003 . distributed with LGPL
Modified by < >
module Int = Int
open CFStream
module BatAvlTree = struct
let empty = Empty
let is_empty = function Empty -> true | Node _ -> false
let singleton_tree x = Node (... |
227e3c7ad2f8738cbf95fe2dd22510a84cf95a966c09dd0adbd284eb7143d387 | rzezeski/try-try-try | rts_vnode.erl | -module(rts_vnode).
-behaviour(riak_core_vnode).
-include("rts.hrl").
-export([start_vnode/1,
init/1,
terminate/2,
handle_command/3,
is_empty/1,
delete/1,
handle_handoff_command/3,
handoff_starting/2,
handoff_cancelled/1,
handoff_finished... | null | https://raw.githubusercontent.com/rzezeski/try-try-try/c5d99f29fb3380f8653efdd1aa6a8f52143a9717/2011/riak-core-the-vnode/rts/src/rts_vnode.erl | erlang | API
Sample command: respond to a ping | -module(rts_vnode).
-behaviour(riak_core_vnode).
-include("rts.hrl").
-export([start_vnode/1,
init/1,
terminate/2,
handle_command/3,
is_empty/1,
delete/1,
handle_handoff_command/3,
handoff_starting/2,
handoff_cancelled/1,
handoff_finished... |
11adde98fea8c4118b677d785302b23060e3720507ea25a307c4b64c6b96134e | SimulaVR/godot-haskell | RegExMatch.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.RegExMatch
(Godot.Core.RegExMatch.get_end,
G... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/RegExMatch.hs | haskell | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.RegExMatch
(Godot.Core.RegExMatch.get_end,
G... | |
6fd221769de879f70065cef25cdf6a601fcf5f7cf8263e01e00fd9c72c93df88 | tcsprojects/ocaml-sat-solvers | pseudosatwrapper.mli | open Satwrapper;;
class pseudoSolverFactory: object inherit solverFactory
method description: string
method identifier: string
method short_identifier: string
method copyright: string
method url: string
method new_timed_instance: Timing.timetable -> abstractSolver
method new_instance: abstractSolver
end
val ge... | null | https://raw.githubusercontent.com/tcsprojects/ocaml-sat-solvers/2c36605fb3e38a1bee41e079031ab5b173794910/src/pseudosat/pseudosatwrapper.mli | ocaml | open Satwrapper;;
class pseudoSolverFactory: object inherit solverFactory
method description: string
method identifier: string
method short_identifier: string
method copyright: string
method url: string
method new_timed_instance: Timing.timetable -> abstractSolver
method new_instance: abstractSolver
end
val ge... | |
9645a41f98948b73033c15d3067244366a8b2dc09530355a5cfed09b5ec3d986 | ariesteam/aries | repl_utils.clj | Copyright 2010
;;;
This file is part of clj - span .
;;;
;;; clj-span 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 later version.
;;;
;;;... | null | https://raw.githubusercontent.com/ariesteam/aries/b3fafd4640f4e7950fff3791bc4ea4c06ee4dcdf/plugins/org.integratedmodelling.aries.core/bindings/clojure/clj_span/repl_utils.clj | clojure |
clj-span is free software: you can redistribute it and/or modify
or (at your option) any later version.
clj-span 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 Public Lic... | Copyright 2010
This file is part of clj - span .
it under the terms of the GNU General Public License as published
by the Free Software Foundation , either version 3 of the License ,
You should have received a copy of the GNU General Public License
along with clj - span . If not , see < / > .
This nam... |
2f9b6ebbb6d87ee172715a78e783d24a52f16d4473c12a4e4d154de6cd27b635 | simplegeo/erlang | lib.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/simplegeo/erlang/15eda8de27ba73d176c7eeb3a70a64167f50e2c4/lib/stdlib/src/lib.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 1996 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(lib).
-export([flush_receive/0, er... |
bf0d377d9758a4ecc4a45e17002b793187b8eb2287e0f01a76f5b14c41a0e75a | nonguix/nonguix | messaging.scm | SPDX - License - Identifier : GPL-3.0 - or - later
Copyright © 2021 , 2022 PantherX OS Team < >
Copyright © 2022 , 2023 < >
Copyright © 2022 < >
(define-module (nongnu packages messaging)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages compression)
#:... | null | https://raw.githubusercontent.com/nonguix/nonguix/8c0a857cebd1d06f3ef1b61689e33060151885fa/nongnu/packages/messaging.scm | scheme | Use the more standard lib directory for everything.
Remove unneeded files.
Fix the .desktop file binary location.
not working?
Use the more standard lib directory for everything.
Remove unneeded files.
Fix the .desktop file binary location.
doesn't work?
Use the more standard lib directory for everything.
nam... | SPDX - License - Identifier : GPL-3.0 - or - later
Copyright © 2021 , 2022 PantherX OS Team < >
Copyright © 2022 , 2023 < >
Copyright © 2022 < >
(define-module (nongnu packages messaging)
#:use-module (gnu packages base)
#:use-module (gnu packages bash)
#:use-module (gnu packages compression)
#:... |
81c25f71fe8c0e6eecfcae7d2516c9eab3746ca0aea593c725ad937e60452471 | adamwalker/clash-riscv | Decode.hs | # LANGUAGE ScopedTypeVariables #
module Core.Decode where
import Clash.Prelude
import Data.Bool
import Core.ALU
--
--Extract parts of the instruction
--
opcode :: BitVector 32 -> BitVector 7
opcode = slice d6 d0
rOp1 :: BitVector 32 -> BitVector 7
rOp1 = slice d31 d25
rs2 :: BitVector 32 -> BitVector 5
rs2 = sli... | null | https://raw.githubusercontent.com/adamwalker/clash-riscv/84a90731a07c3427695b4926d7159f9e9902c1a1/src/Core/Decode.hs | haskell |
Extract parts of the instruction
I type immediate
U type immediate
UJ type immediate
S type immediate
ALU operation decoding
Control signal decoding
Does the instruction actually use r1
Does the instruction actually use r2
A memory write only happens for store instructions
The instruction results in a register... | # LANGUAGE ScopedTypeVariables #
module Core.Decode where
import Clash.Prelude
import Data.Bool
import Core.ALU
opcode :: BitVector 32 -> BitVector 7
opcode = slice d6 d0
rOp1 :: BitVector 32 -> BitVector 7
rOp1 = slice d31 d25
rs2 :: BitVector 32 -> BitVector 5
rs2 = slice d24 d20
rs1 :: BitVector 32 -> BitVec... |
ea300f3057f9261e093a756802e1f9797950579285084287efe7c42e31528b7a | 1Jajen1/Brokkr | TH.hs | # LANGUAGE DataKinds #
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
{-# LANGUAGE MultiWayIf #-}
# LANGUAGE MagicHash #
module Block.Internal.TH (
generateBlockStatePatterns
, genPaletteMapping
) where
import Data.Text ( Text )
import Data.ByteString ( ByteString )
import Data.Aeson
import Data.Maybe
imp... | null | https://raw.githubusercontent.com/1Jajen1/Brokkr/04aa75433186e461feb7437c3694ace0204c54f8/data/src/Block/Internal/TH.hs | haskell | # LANGUAGE MultiWayIf #
Quick check if we have no hash collisions
We will probably run into one at some point, but that's for future me to worry about
cardinalities and is precomputed at compile time and is the product of the cardinalities of each property that follows this one
cardinalities and prevCardinalities... | # LANGUAGE DataKinds #
# LANGUAGE RecordWildCards #
# LANGUAGE TemplateHaskell #
# LANGUAGE MagicHash #
module Block.Internal.TH (
generateBlockStatePatterns
, genPaletteMapping
) where
import Data.Text ( Text )
import Data.ByteString ( ByteString )
import Data.Aeson
import Data.Maybe
import qualified Block.Internal... |
e71035acb286cb06fee6a8629b078cae31385b98251f88e871d27d196a5fdb02 | raptazure/experiments | Common.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE TemplateHaskell #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
-- | Common handler functions.
module Handler.Common where
import Data.FileEmbed (embedFile)
import Import
-- These handlers embed files in the executable at comp... | null | https://raw.githubusercontent.com/raptazure/experiments/c48263980d1ce22ee9407ff8dcf0cf5091b01c70/haskell/yesodapp/src/Handler/Common.hs | haskell | # LANGUAGE OverloadedStrings #
| Common handler functions.
These handlers embed files in the executable at compile time to avoid a
runtime dependency, and for efficiency. | # LANGUAGE NoImplicitPrelude #
# LANGUAGE TemplateHaskell #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
module Handler.Common where
import Data.FileEmbed (embedFile)
import Import
getFaviconR :: Handler TypedContent
cache for a month
return $ TypedContent "image/x-icon"
... |
4a5be34ad5289177a0f5d7f4ac68c02b0600c8a1d9377b52fb138ac4f34d1f63 | cs136/seashell | http-dispatchers.rkt | #lang racket/base
Seashell 's backend server .
Copyright ( C ) 2013 - 2015 The Seashell Maintainers .
;;
;; 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 3 of the License , o... | null | https://raw.githubusercontent.com/cs136/seashell/17cc2b0a6d2cdac270d7168e03aa5fed88f9eb02/src/collects/seashell/backend/http-dispatchers.rkt | racket |
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
See also 'ADDITIONAL TERMS' at the end of the included LICENSE file.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTAB... | #lang racket/base
Seashell 's backend server .
Copyright ( C ) 2013 - 2015 The Seashell Maintainers .
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
(requ... |
886a390832abedd6f0509627c6a2e296d3be7b731ac63e5a8c9e8ffbf664e51d | project-oak/hafnium-verification | interproc.mli |
* Copyright ( c ) 2009 - 2013 , Monoidics ltd .
* 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) 2009-2013, Monoidics ltd.
* Copyright (c) Facebook, In... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/biabduction/interproc.mli | ocaml | * Interprocedural Analysis
* Run the biabduction analysis on the given procedure |
* Copyright ( c ) 2009 - 2013 , Monoidics ltd .
* 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) 2009-2013, Monoidics ltd.
* Copyright (c) Facebook, In... |
0bb4b83db21004e277f043c36bc9fd5eb8946427989682cf8896db7741da1b52 | disco-framework/disco | pw_app.erl | -module(pw_app).
-behavior(application).
-export([start/2,
stop/1]).
-export([solve/4,
printer/0]).
-define(PROVIDERS, [provider_a, provider_b]).
start(_Type, _Args) ->
Numbers = parse_line(io:get_line([])),
Target = parse_line(io:get_line([])),
PrinterPid = spawn(?MODULE, printer, []... | null | https://raw.githubusercontent.com/disco-framework/disco/f55f35d46d43ef5f4fa1466bdf8d662f5f01f30f/priv/countdown2/workers/pwb_72/src/pw_app.erl | erlang | ']).
-define(OPS, ['<+>', '/', '<*>', '+', '<->']).
', A, B) -> A rem B /= 0.
', A, B) -> A rem B.
TODO: try depth-first
provider empty
try to switch to another provider
just block, so the printer process has time to finish | -module(pw_app).
-behavior(application).
-export([start/2,
stop/1]).
-export([solve/4,
printer/0]).
-define(PROVIDERS, [provider_a, provider_b]).
start(_Type, _Args) ->
Numbers = parse_line(io:get_line([])),
Target = parse_line(io:get_line([])),
PrinterPid = spawn(?MODULE, printer, []... |
f2feac36520802be45ab13ab7ba676229e69414174f499bdf84c79562c15e0c0 | lspitzner/brittany | Test93.hs | func = x
describe "infix op" $ do
| null | https://raw.githubusercontent.com/lspitzner/brittany/a15eed5f3608bf1fa7084fcf008c6ecb79542562/data/Test93.hs | haskell | func = x
describe "infix op" $ do
| |
2c19472b179df8cb5fefbd104695399fe5319b7c8c4ef11f6f4c5a250b165fb9 | ezyang/reflex-backpack | Reflex.hs | # LANGUAGE CPP #
| This module exports all of the commonly - used functionality of Reflex ; if
you are just getting started with Reflex , this is probably what you want .
module Reflex
( module X
) where
import Reflex.Basics as X
import Reflex.EventWriter as X
import Reflex.Dynamic as X
#ifdef USE_TEMPLATE_HAS... | null | https://raw.githubusercontent.com/ezyang/reflex-backpack/247898fde872d8909392ebe2539f4623c7449067/Reflex.hs | haskell | # LANGUAGE CPP #
| This module exports all of the commonly - used functionality of Reflex ; if
you are just getting started with Reflex , this is probably what you want .
module Reflex
( module X
) where
import Reflex.Basics as X
import Reflex.EventWriter as X
import Reflex.Dynamic as X
#ifdef USE_TEMPLATE_HAS... | |
bf4e5d3aada8b873ac840ca546ddef0d667bc7740490a3be3862203d93bb2433 | luontola/varjocafe | settings_test.clj | (ns varjocafe.settings-test
(:use midje.sweet
varjocafe.testutil)
(:require [varjocafe.settings :as settings]
[clojure.java.io :as io])
(:import (java.util.concurrent TimeUnit)))
(fact "#read-properties-file"
(with-silent-logger
(settings/read-properties-file (io/file "no-such-f... | null | https://raw.githubusercontent.com/luontola/varjocafe/cb4c68dce0ef5dd2031ba379dd63b63e8b9433b7/test/varjocafe/settings_test.clj | clojure | (ns varjocafe.settings-test
(:use midje.sweet
varjocafe.testutil)
(:require [varjocafe.settings :as settings]
[clojure.java.io :as io])
(:import (java.util.concurrent TimeUnit)))
(fact "#read-properties-file"
(with-silent-logger
(settings/read-properties-file (io/file "no-such-f... | |
1235c73d56ab37cbe67b77f17cc8f33ae78ed17278eeada7381c9077352abbac | BinRoot/Haskell-Data-Analysis-Cookbook | Main.hs | module Main where
-- Reads a file as input
main :: IO ()
main = do
input <- readFile "input.txt"
print $ countWords input
-- Counts the number of words per line
countWords input = map (length.words) (lines input)
| null | https://raw.githubusercontent.com/BinRoot/Haskell-Data-Analysis-Cookbook/f8c46987d78f4a6c1828b353c5f906b9314c2ef9/Ch01/Code01_txt/Main.hs | haskell | Reads a file as input
Counts the number of words per line | module Main where
main :: IO ()
main = do
input <- readFile "input.txt"
print $ countWords input
countWords input = map (length.words) (lines input)
|
23269c8e75bacae34dc181a54c6e83954c177c73146608209e739cac50e3126c | project-oak/hafnium-verification | reachingDefs.mli |
* 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/checkers/reachingDefs.mli | ocaml | * Map var -> its reaching definition |
* 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
... |
cad9721dd836531ba639fdc5d1ab7b52a242dc511865c20cf7b78bc8fd278786 | VisionsGlobalEmpowerment/webchange | website.clj | (ns webchange.auth.website
(:require [buddy.hashers :as hashers]
[webchange.db.core :refer [*db*] :as db]
[webchange.common.hmac-sha256 :as sign]
[clojure.tools.logging :as log]
[clj-http.client :as http]
[config.core :refer [env]]
[buddy.auth :a... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/54c32bdf58a2ad0a2d160966720250232033220e/src/clj/webchange/auth/website.clj | clojure | (ns webchange.auth.website
(:require [buddy.hashers :as hashers]
[webchange.db.core :refer [*db*] :as db]
[webchange.common.hmac-sha256 :as sign]
[clojure.tools.logging :as log]
[clj-http.client :as http]
[config.core :refer [env]]
[buddy.auth :a... | |
91ed9e32acf3b8f5cae52d824425508aeafbeb0082f0adda54ce1e0dfde1330b | egobrain/equery | tree_m.erl | -module(tree_m).
-export([schema/0]).
schema() ->
#{
fields => #{
id => #{type => serial},
parentId => #{type => integer, required => true},
value => #{type => varchar}
},
table => <<"tree">>
}.
| null | https://raw.githubusercontent.com/egobrain/equery/448c89dede0b19fc22f50a31063f0bb24d8fdf9c/test/tree_m.erl | erlang | -module(tree_m).
-export([schema/0]).
schema() ->
#{
fields => #{
id => #{type => serial},
parentId => #{type => integer, required => true},
value => #{type => varchar}
},
table => <<"tree">>
}.
| |
825eade1e43125f940c6de4966a710c07d92a0b21b9457eb18ad48f5d46a4941 | TheAlgorithms/Haskell | InsertionSort.hs | module Sorts.InsertionSort where
listToSort = [13, 2, 3, 14, 17, 4, 1, 5, 16, 12, 9, 10, 15, 8, 7, 11, 18, 19, 6, 20]
insertionSort:: (Ord a) => [a] -> [a]
insertionSort [] = [] -- Empty list is empty
Singleton lists are trivially sorted .
insertionSort (x:xs) = insert x (insertionSort xs)
Assumes that the secon... | null | https://raw.githubusercontent.com/TheAlgorithms/Haskell/9dcabef99fb8995a760ff25a9e0d659114c0b9d3/src/Sorts/InsertionSort.hs | haskell | Empty list is empty | module Sorts.InsertionSort where
listToSort = [13, 2, 3, 14, 17, 4, 1, 5, 16, 12, 9, 10, 15, 8, 7, 11, 18, 19, 6, 20]
insertionSort:: (Ord a) => [a] -> [a]
Singleton lists are trivially sorted .
insertionSort (x:xs) = insert x (insertionSort xs)
Assumes that the second argument is an alread - sorted list ,
and... |
1fcdc29d2a0af36c2adb9e705f56200f5d41f64863feb701fac660c9ca4f18e7 | semmons99/clojure-euler | prob-057.clj | problem 057 ; ; ; ; ; ; ; ; ; ;
(defn numerator [r]
(bigint (first (.split (str r) "/"))))
(defn denominator [r]
(bigint (last (.split (str r) "/"))))
(defn num-digits [n]
(count (rest (.split (str n) ""))))
(defn more-digits [r]
(let [nd (num-digits (numerator r))
dd (num-digits (denominator r))]
... | null | https://raw.githubusercontent.com/semmons99/clojure-euler/3480bc313b9df7f282dadf6e0b48d96230f1bfc1/prob-057.clj | clojure | ; ; ; ; ; ; ; ; ; | (defn numerator [r]
(bigint (first (.split (str r) "/"))))
(defn denominator [r]
(bigint (last (.split (str r) "/"))))
(defn num-digits [n]
(count (rest (.split (str n) ""))))
(defn more-digits [r]
(let [nd (num-digits (numerator r))
dd (num-digits (denominator r))]
(cond
(> nd dd) :numerat... |
9beb56ca70bba75c5a75b5b42d9d46a93f14dbe5582984f928e7bcfde2bc6991 | igrep/typesafe-precure | Profiles.hs | # OPTIONS_GHC -fno - warn - missing - signatures #
{-# LANGUAGE OverloadedStrings #-}
module ACME.PreCure.Textbook.DeliciousParty.Profiles where
import Data.String (IsString, fromString)
import ACME.PreCure.Index.Types
girls :: [Girl]
girls =
[ mkGirl "Yui Nagomi" "和実 ゆい"
, mkGi... | null | https://raw.githubusercontent.com/igrep/typesafe-precure/727efe419008cd63ab04a7b8d491f94d781e2339/src/ACME/PreCure/Textbook/DeliciousParty/Profiles.hs | haskell | # LANGUAGE OverloadedStrings #
["CreamyFleuret"]
[ "プリキュア!フィナーレブーケ!"
] | # OPTIONS_GHC -fno - warn - missing - signatures #
module ACME.PreCure.Textbook.DeliciousParty.Profiles where
import Data.String (IsString, fromString)
import ACME.PreCure.Index.Types
girls :: [Girl]
girls =
[ mkGirl "Yui Nagomi" "和実 ゆい"
, mkGirl "Kokone Fuwa" "芙羽 ここね"
, mkGi... |
fb1b48c8f950abdbe331dd59328786c5b22e03c6311155077aaaf6d5f4419084 | blajzer/dib | C.hs | Copyright ( c ) 2010 - 2018
-- See LICENSE for license information.
-- | A builder for C/C++ code.
module Dib.Builders.C (
CTargetInfo(CTargetInfo, outputName, targetName, srcDir, outputLocation, compiler, linker, archiver, inFileOption, outFileOption, commonCompileFlags, cCompileFlags, cxxCompileFlags, linkFlag... | null | https://raw.githubusercontent.com/blajzer/dib/750253c972668bb0d849239f94b96050bae74f2a/src/Dib/Builders/C.hs | haskell | See LICENSE for license information.
| A builder for C/C++ code.
| The record type that is used to pass configuration info for the C builder.
| The name of the output file.
| The directory containing the source for this target.
| The compiler executable.
| The linker executable.
| The archiver executable.
| Th... | Copyright ( c ) 2010 - 2018
module Dib.Builders.C (
CTargetInfo(CTargetInfo, outputName, targetName, srcDir, outputLocation, compiler, linker, archiver, inFileOption, outFileOption, commonCompileFlags, cCompileFlags, cxxCompileFlags, linkFlags, archiverFlags, includeDirs, extraCompileDeps, extraLinkDeps, exclusi... |
b6aef56136c226e3b41cedda5e5c5a583c59c36980f2a148fc0a1fcf43cc67f7 | borkdude/quickblog | api.clj | (ns quickblog.api
{:org.babashka/cli
{:spec
{
;; Blog metadata
:blog-title
{:desc "Title of the blog"
:ref "<title>"
:default "quickblog"
:require true
:group :blog-metadata}
:blog-author
{:desc "Author's name"
:ref "<name>"
:default "Quick Blogger"... | null | https://raw.githubusercontent.com/borkdude/quickblog/a011122f1654206aa9a5d411010807d319ea0ad8/src/quickblog/api.clj | clojure | Blog metadata
Optional metadata
Input directories
Output directories
Caching
Social sharing
Command-specific opts
Add filter for tag page links; see:
#filters
Delete tags pages for removed tags
Generate index page with last `num-index-posts` posts
Generate archive page with links to all posts
Generate atom... | (ns quickblog.api
{:org.babashka/cli
{:spec
{
:blog-title
{:desc "Title of the blog"
:ref "<title>"
:default "quickblog"
:require true
:group :blog-metadata}
:blog-author
{:desc "Author's name"
:ref "<name>"
:default "Quick Blogger"
:require true
... |
ad2823b950680cf5c8b1f31306c46aab023fac843543c1e57c6167a9bd3c1b12 | jwiegley/notes | Challenge.hs | module Challenge where
import Data.IORef
foo n i = do
r <- newIORef n
return $ \i -> atomicModifyIORef r (\x -> (x,x+i))
| null | https://raw.githubusercontent.com/jwiegley/notes/24574b02bfd869845faa1521854f90e4e8bf5e9a/haskell/Challenge.hs | haskell | module Challenge where
import Data.IORef
foo n i = do
r <- newIORef n
return $ \i -> atomicModifyIORef r (\x -> (x,x+i))
| |
4b53bdc2ef65df343b6274f3169edaab8e5b16565544d92f92b738a0d7529b1a | janestreet/memtrace_viewer_with_deps | perfect_hash.ml | open Core_kernel
open Poly
This is not intended as a realistic candidate hash function since it allocates when
hashing , but as some kind of ` perfect ' baseline against which other hash functions can
be compared and judged .
It is a perfect hash in the sense that it produces no collisions of interme... | null | https://raw.githubusercontent.com/janestreet/memtrace_viewer_with_deps/5a9e1f927f5f8333e2d71c8d3ca03a45587422c4/vendor/ppx_hash/runtime-lib/test/perfect_hash.ml | ocaml | open Core_kernel
open Poly
This is not intended as a realistic candidate hash function since it allocates when
hashing , but as some kind of ` perfect ' baseline against which other hash functions can
be compared and judged .
It is a perfect hash in the sense that it produces no collisions of interme... | |
22d116a086b11f9cf688de01b3065390c7321e2e571e2410898d1998c9d7861b | simonmar/par-tutorial | KMeansCommon.hs | {-# LANGUAGE DeriveDataTypeable #-}
module KMeansCommon where
import Data.List (foldl')
import Data.Typeable (Typeable)
import Data.Data (Data)
import qualified Data.ByteString.Char8 as B
import Data.Binary
import Control.DeepSeq
data Vector = Vector {-#UNPACK#-}!Double {-#UNPACK#-}!Double deriving (Show,Read,Typeabl... | null | https://raw.githubusercontent.com/simonmar/par-tutorial/f9061ea177800eb4ed9660bcabc8d8d836e1c73c/code/kmeans/KMeansCommon.hs | haskell | # LANGUAGE DeriveDataTypeable #
#UNPACK#
#UNPACK#
#UNPACK#
#UNPACK#
#UNPACK#
#UNPACK#
default should be fine
| module KMeansCommon where
import Data.List (foldl')
import Data.Typeable (Typeable)
import Data.Data (Data)
import qualified Data.ByteString.Char8 as B
import Data.Binary
import Control.DeepSeq
instance Binary Vector where put (Vector a b) = put a>>put b
get = do a<-get
... |
1cc5667c1889214cbb6078616ac7f3b6e5fe794247fba0f5bd7ad337b9b25707 | mpickering/apply-refact | Bracket4.hs | yes = foo (bar) | null | https://raw.githubusercontent.com/mpickering/apply-refact/a4343ea0f4f9d8c2e16d6b16b9068f321ba4f272/tests/examples/Bracket4.hs | haskell | yes = foo (bar) | |
9650b1012ddd2f87516af61373f66b39b3a66ec901031d6ae35f1f316d6e9493 | NetComposer/nksip | ipv6_test_client3.erl | %% -------------------------------------------------------------------
%%
%% ipv6_test: IPv6 Tests and RFC5118 Torture Tests
%%
Copyright ( c ) 2013 . 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 complianc... | null | https://raw.githubusercontent.com/NetComposer/nksip/7fbcc66806635dc8ecc5d11c30322e4d1df36f0a/test/callbacks/ipv6_test_client3.erl | erlang | -------------------------------------------------------------------
ipv6_test: IPv6 Tests and RFC5118 Torture Tests
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 ) 2013 . 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
-module(ipv6_test_client3).
... |
24ef8871d750c3af146d87a5d337d22d9410ea40342e918f0a767eb4e11fcd76 | yurug/ocaml4.04.0-copatterns | lexer.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/yurug/ocaml4.04.0-copatterns/b3ec6a3cc203bd2cde3b618546d29e10f1102323/parsing/lexer.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
val init : unit -> unit
val token: Lexing.lexbuf -> Parser.token
val skip_hash_bang: Lexing.lexbuf -> un... |
5ff16e5eb1c27aa752173112a5a3e2e0923ac66d65a344c61422fb751681ebb1 | bozsahin/cogs542 | hw1.ccg.lisp | (DEFPARAMETER *CCG-GRAMMAR*
'(((KEY 1) (PHON OKCUNUN) (MORPH N)
(SYN
(((BCAT S) (FEATS NIL)) (DIR FS) (MODAL ALL)
(((BCAT S) (FEATS NIL)) (DIR BS) (MODAL ALL)
((BCAT NP) (FEATS ((CASE NOM)))))))
(SEM (LAM P (P "OKCU"))) (PARAM 1.0))
((KEY 2) (PHON VUR) (MORPH V)
(SYN
((((... | null | https://raw.githubusercontent.com/bozsahin/cogs542/3093fe6dc720405096af2e18d7ed9edd5f2ef47d/ccglab-examples/hw1/hw1.ccg.lisp | lisp | (DEFPARAMETER *CCG-GRAMMAR*
'(((KEY 1) (PHON OKCUNUN) (MORPH N)
(SYN
(((BCAT S) (FEATS NIL)) (DIR FS) (MODAL ALL)
(((BCAT S) (FEATS NIL)) (DIR BS) (MODAL ALL)
((BCAT NP) (FEATS ((CASE NOM)))))))
(SEM (LAM P (P "OKCU"))) (PARAM 1.0))
((KEY 2) (PHON VUR) (MORPH V)
(SYN
((((... | |
bd0bf33e4efb8954ca1beb7772a41cd0d19260b4360f2c26d15666e8204f10ba | LaurentMazare/tensorflow-ocaml | mnist_dcgan.ml | Deep Convolutional Generative Adverserial Networks trained on the MNIST dataset .
open Base
open Tensorflow
open Tensorflow_core
module O = Ops
let image_dim = Mnist_helper.image_dim
let latent_dim = 100
let batch_size = 256
let learning_rate = 1e-5
let batches = 10 ** 8
(* No need to keep running averages as this ... | null | https://raw.githubusercontent.com/LaurentMazare/tensorflow-ocaml/52c5f1dec1a8b7dc9bc6ef06abbc07da6cd90d39/examples/gan/mnist_dcgan.ml | ocaml | No need to keep running averages as this is only used in training mode.
* [create_generator rand_input] creates a Generator network taking as
input [rand_input]. This returns both the network and the variables
that it contains.
Create a placeholder for random latent data used by the generator and for the ac... | Deep Convolutional Generative Adverserial Networks trained on the MNIST dataset .
open Base
open Tensorflow
open Tensorflow_core
module O = Ops
let image_dim = Mnist_helper.image_dim
let latent_dim = 100
let batch_size = 256
let learning_rate = 1e-5
let batches = 10 ** 8
let batch_norm xs =
let nb_dims = Node.sha... |
92e7ea16ef4e5e407ad82d85d54d6fd4f5d58e94ea43df5d265a9fc1cf9f77ac | Metaxal/MrEd-Designer | templates.rkt | #lang racket
(require racket/gui/base
"misc.rkt"
"mred-id.rkt"
"mred-plugin.rkt"
"code-generation.rkt"
"template-load.rkt"
)
(module+ test
(require rackunit))
(define template-dir (build-path "templates"))
;; Dictionary of (template-file . template-name)
(defin... | null | https://raw.githubusercontent.com/Metaxal/MrEd-Designer/220833b738a1d46fbe309ea124ef61b825e42e68/mred-designer/templates.rkt | racket | Dictionary of (template-file . template-name)
We should make a class for templates !
Avoid loading several times...
Call this function to set the template-dict to the correct value
or to update it (e.g., if the directory structure has changed)
it may be a directory
writes the code that will be executed
write th... | #lang racket
(require racket/gui/base
"misc.rkt"
"mred-id.rkt"
"mred-plugin.rkt"
"code-generation.rkt"
"template-load.rkt"
)
(module+ test
(require rackunit))
(define template-dir (build-path "templates"))
(define/provide template-dict #f)
(define/provide (temp... |
6ba3ee8accc8ebd0aaa23b9bb5a6c31aa4b85766388e67ae599fdfbb300df3be | backtracking/mlpost | mlpost_dot.mli | open Mlpost
* Place figures , boxes or boxlikes with graphviz
module Dot : sig
module Make (B : Signature.Boxlike) : sig
type node
type edge = node * node
val mknode : B.t -> node
(** creates an abstract node from a boxlike *)
val place :
?orient:[ `TB | `LR | `BT | `RL ] ->
node l... | null | https://raw.githubusercontent.com/backtracking/mlpost/bd4305289fd64d531b9f42d64dd641d72ab82fd5/contrib/dot/mlpost_dot.mli | ocaml | * creates an abstract node from a boxlike | open Mlpost
* Place figures , boxes or boxlikes with graphviz
module Dot : sig
module Make (B : Signature.Boxlike) : sig
type node
type edge = node * node
val mknode : B.t -> node
val place :
?orient:[ `TB | `LR | `BT | `RL ] ->
node list ->
edge list ->
B.t list * Path.t l... |
a0a647cd4ce2d9ff0e397887da2c463d5ba7a868872070bd5151591ae336c489 | clj-commons/useful | config_test.clj | (ns flatland.useful.config-test
(:use clojure.test flatland.useful.config))
(deftest reading
(is (= '{size 1} (read-config "config1.clj")))
(is (thrown-with-msg? java.io.FileNotFoundException #"Cannot find config resource config3.clj"
(read-config "config3.clj")))
(is (= nil (read-config "config3.clj... | null | https://raw.githubusercontent.com/clj-commons/useful/dc5cdebf8983a2e2ea24ec8951fbb4dfb037da45/test/flatland/useful/config_test.clj | clojure | (ns flatland.useful.config-test
(:use clojure.test flatland.useful.config))
(deftest reading
(is (= '{size 1} (read-config "config1.clj")))
(is (thrown-with-msg? java.io.FileNotFoundException #"Cannot find config resource config3.clj"
(read-config "config3.clj")))
(is (= nil (read-config "config3.clj... | |
b4cd0cb2c173cbbad381bedadbf1e01b879d13caf2768e1d51394d37454d4c12 | achirkin/vulkan | VK_KHR_device_group_creation.hs | # OPTIONS_GHC -fno - warn - missing - pattern - synonym - signatures #
# OPTIONS_GHC -fno - warn - orphans #
# OPTIONS_HADDOCK not - home #
{-# LANGUAGE CPP #-}
{-# LANGUAGE DataKinds #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE ForeignFunctionInterface #
{-# LANGUAGE MagicH... | null | https://raw.githubusercontent.com/achirkin/vulkan/b2e0568c71b5135010f4bba939cd8dcf7a05c361/vulkan-api/src-gen/Graphics/Vulkan/Ext/VK_KHR_device_group_creation.hs | haskell | # LANGUAGE CPP #
# LANGUAGE DataKinds #
# LANGUAGE MagicHash #
# LANGUAGE PatternSynonyms #
# LANGUAGE Strict #
# LANGUAGE TypeFamilies #
# LANGUAGE ViewPatterns #
|
supported: @vulkan@
author: @KHR@
type: @ins... | # OPTIONS_GHC -fno - warn - missing - pattern - synonym - signatures #
# OPTIONS_GHC -fno - warn - orphans #
# OPTIONS_HADDOCK not - home #
# LANGUAGE FlexibleInstances #
# LANGUAGE ForeignFunctionInterface #
module Graphics.Vulkan.Ext.VK_KHR_device_group_creation
* Vulkan extension : @VK_KHR_device_group_cre... |
16ff665762ed09a2a6643204505196c2112fd61fcc9e38af8f9b2f2d4fd20c4c | Plutonomicon/plutarch-plutus | PLamSpec.hs | module Plutarch.PLamSpec (spec) where
import Data.ByteString (ByteString)
import PlutusCore qualified as PLC
import Plutarch.Prelude
import Plutarch.Test
import Plutarch.Unsafe (punsafeBuiltin)
import Test.Hspec
spec :: Spec
spec = do
describe "plam" . pgoldenSpec $ do
"id" @| plam id
"flip.const" @| plam ... | null | https://raw.githubusercontent.com/Plutonomicon/plutarch-plutus/9b83892057f2aaaed76e3af6193ad1ae242244cc/plutarch-test/tests/Plutarch/PLamSpec.hs | haskell | > PInteger :--> PInteger))
> PInteger :--> PInteger)) | module Plutarch.PLamSpec (spec) where
import Data.ByteString (ByteString)
import PlutusCore qualified as PLC
import Plutarch.Prelude
import Plutarch.Test
import Plutarch.Unsafe (punsafeBuiltin)
import Test.Hspec
spec :: Spec
spec = do
describe "plam" . pgoldenSpec $ do
"id" @| plam id
"flip.const" @| plam ... |
5a213d985e815cdc74f1af46c20feb7316ef735c433468d0129d858576005806 | jaked/froc | main.ml | open OUnit
let tests = "Froc" >::: [
Sa.tests
]
;;
OUnit.run_test_tt_main tests
| null | https://raw.githubusercontent.com/jaked/froc/6068a1fab883ed9254bfeb53a1f9c15e8af0bb20/test/froc/main.ml | ocaml | open OUnit
let tests = "Froc" >::: [
Sa.tests
]
;;
OUnit.run_test_tt_main tests
| |
d17bd1a77f8c52c65ecc3f6c3dd846a384179965e40709b5034a94bb67646a65 | ghc/packages-dph | Tuple.hs | {-# OPTIONS_HADDOCK hide #-}
# LANGUAGE CPP #
#include "fusion-phases.h"
-- | PRepr instance for tuples
-- and PD wrappers for other functions defined in D.A.P.PArray.PData.Tuple.
module Data.Array.Parallel.PArray.PRepr.Tuple
( PRepr
, ziplPA)
where
import Data.Array.Parallel.PArray.Types
import Data... | null | https://raw.githubusercontent.com/ghc/packages-dph/64eca669f13f4d216af9024474a3fc73ce101793/dph-lifted-vseg/Data/Array/Parallel/PArray/PRepr/Tuple.hs | haskell | # OPTIONS_HADDOCK hide #
| PRepr instance for tuples
and PD wrappers for other functions defined in D.A.P.PArray.PData.Tuple.
Tuple2 --------------------------------------------------------------------
# INLINE_PA toArrPRepr #
# INLINE_PA fromArrPRepr #
# INLINE_PA toArrPReprs #
# INLINE_PA fromArrPReprs #
| Lift... | # LANGUAGE CPP #
#include "fusion-phases.h"
module Data.Array.Parallel.PArray.PRepr.Tuple
( PRepr
, ziplPA)
where
import Data.Array.Parallel.PArray.Types
import Data.Array.Parallel.PArray.PRepr.Base
import Data.Array.Parallel.PArray.PData.Base
import Data.Array.Parallel.PArray.PData.Tuple2
import Data.... |
7842fc1abc2419119008580e3df808d9e0666fd32cb44387bf3dd6dd2a6a950a | mejgun/haskell-tdlib | EncryptedCredentials.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Data.EncryptedCredentials where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
-- |
| Contains encrypted Telegram Passport data credentials @data The encrypted credentials @hash The decrypted data hash @secret Se... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/beb6635177d7626b70fd909b1d89f2156a992cd2/src/TD/Data/EncryptedCredentials.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
|
|
| |
module TD.Data.EncryptedCredentials where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
| Contains encrypted Telegram Passport data credentials @data The encrypted credentials @hash The decrypted data hash @secret Secret for data decryption , encrypted with the... |
64b8e0714e760592d290e583b3a0d71bc71308b826ba292a7f2f1616179097f3 | Helium4Haskell/helium | MaximalMunch2.hs | ---- This is comment
-- This too
(-->) x y = x + y -- but this is an operator
main = 3
| null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/simple/parser/MaximalMunch2.hs | haskell | -- This is comment
This too
>) x y = x + y -- but this is an operator |
main = 3
|
a219a1749dabb83d7eab75f8a842703bdf45059ec9a67fb90a4f7a4c7e303809 | ddmcdonald/sparser | 1st-loader.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
copyright ( c ) 2014 - 2022 -- all rights reserved
;;;
File : " 1st - loader "
Module : " : kinds : "
version : June 2022
;; Initiated 3/28/14 to allow the upper-model file to be decomposed
;; into more managable pieces.
4/14/14 mo... | null | https://raw.githubusercontent.com/ddmcdonald/sparser/8505847d9b5607b76876abede0f969ccc5dfddd1/Sparser/code/s/grammar/model/core/kinds/1st-loader.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
Initiated 3/28/14 to allow the upper-model file to be decomposed
into more managable pieces. | copyright ( c ) 2014 - 2022 -- all rights reserved
File : " 1st - loader "
Module : " : kinds : "
version : June 2022
4/14/14 moved in files from ISR .
Added time 2/1/16 .
(in-package :sparser)
(gload "kinds;processes")
(gload "kinds;things")
(gload "kinds;predicate")
(gload "kinds;att... |
6bf2d1267189d4ae295884035e50f95282b62d7158962245e8048340176b4a33 | khibino/haskell-relational-record | Birthday.hs | # LANGUAGE TemplateHaskell , MultiParamTypeClasses , FlexibleInstances #
module Birthday where
import DataSource (definePgConTable)
$(definePgConTable "EXAMPLE" "birthday"
[''Eq, ''Show])
| null | https://raw.githubusercontent.com/khibino/haskell-relational-record/759b3d7cea207e64d2bd1cf195125182f73d2a52/doc/slide/Haskell-Day-201609/Birthday.hs | haskell | # LANGUAGE TemplateHaskell , MultiParamTypeClasses , FlexibleInstances #
module Birthday where
import DataSource (definePgConTable)
$(definePgConTable "EXAMPLE" "birthday"
[''Eq, ''Show])
| |
4e734c46ca2ab3b35e1ac66cbaaaf0447b8dae83a48c0ea89ec043008a6b9667 | HJianBo/sserl | sserl_tabv.erl | %%-----------------------------------------------------------------------
%% @doc for review saved data
%%
%% @end
%%-----------------------------------------------------------------------
-module(sserl_tabv).
-include("sserl.hrl").
-export([traffic_counter/0, traffic_counter/1,
traffic/0, traffic/1]).
traffic_c... | null | https://raw.githubusercontent.com/HJianBo/sserl/9e42930caf8bfe90ae9ed2edac2e0672f7e5e55e/apps/sserl/src/sserl_tabv.erl | erlang | -----------------------------------------------------------------------
@doc for review saved data
@end
----------------------------------------------------------------------- | -module(sserl_tabv).
-include("sserl.hrl").
-export([traffic_counter/0, traffic_counter/1,
traffic/0, traffic/1]).
traffic_counter() ->
TCs = mnesia:dirty_match_object(traffic_counter4day, #traffic_counter4day{_='_'}),
io:format("traffic_counter4day, ~p records~n", [length(TCs)]),
io:format("~p~n", [TCs]).
tr... |
883dc1ca4b34b95bf7e9842198ee899961085cf42081c9586f236655e4877479 | neilprosser/mr-maestro | validators_test.clj | (ns maestro.validators-test
(:require [bouncer.core :as b]
[maestro
[environments :as environments]
[validators :refer :all]]
[midje.sweet :refer :all])
(:import clojure.lang.ExceptionInfo))
(fact "that allowed-instances throws up if we provide an unknown virtualis... | null | https://raw.githubusercontent.com/neilprosser/mr-maestro/469790fd712262016729c1d83d4b4e11869237a2/test/maestro/validators_test.clj | clojure | (ns maestro.validators-test
(:require [bouncer.core :as b]
[maestro
[environments :as environments]
[validators :refer :all]]
[midje.sweet :refer :all])
(:import clojure.lang.ExceptionInfo))
(fact "that allowed-instances throws up if we provide an unknown virtualis... | |
aed5c9595173aeda81ac620808ffa1d437b776078f3d53523786ba7b8db2eb75 | babashka/babashka | test_utils.clj | (ns babashka.test-utils
(:require
[babashka.fs :as fs]
[babashka.impl.classpath :as cp]
[babashka.impl.common :as common]
[babashka.main :as main]
[babashka.process :as p]
[clojure.string :as str]
[clojure.test :as test :refer [*report-counters*]]
[clojure.tools.reader.reader-types :as r]
[... | null | https://raw.githubusercontent.com/babashka/babashka/72dbf53df715c8561f1315d0d55fcd4d7e992bdd/test/babashka/test_utils.clj | clojure | flush stderr | (ns babashka.test-utils
(:require
[babashka.fs :as fs]
[babashka.impl.classpath :as cp]
[babashka.impl.common :as common]
[babashka.main :as main]
[babashka.process :as p]
[clojure.string :as str]
[clojure.test :as test :refer [*report-counters*]]
[clojure.tools.reader.reader-types :as r]
[... |
9644b6dd7497166df0201c43121a5327ae87fd58d3761ce41c8455bc784c378e | alexdong/ansi-common-lisp-exercises | henley.lisp | (defparameter *words* (make-hash-table :size 10000))
(defconstant maxword 100)
(defun read-text (pathname)
(with-open-file (s pathname :direction :input)
(let ((buffer (make-string maxword))
(pos 0))
(do ((c (read-char s nil :eof)
(read-char s nil :eof)))
((eql c :eof))
(if (or (alpha... | null | https://raw.githubusercontent.com/alexdong/ansi-common-lisp-exercises/03b05a23027d62e8724177b2c56dd58065c1f18f/henley.lisp | lisp | (defparameter *words* (make-hash-table :size 10000))
(defconstant maxword 100)
(defun read-text (pathname)
(with-open-file (s pathname :direction :input)
(let ((buffer (make-string maxword))
(pos 0))
(do ((c (read-char s nil :eof)
(read-char s nil :eof)))
((eql c :eof))
(if (or (alpha... | |
cba3ebbfbe9e28bb92eba9914ea16c4e215d4dca62889ddae089b0031221f7e0 | roelvandijk/numerals | TestData.hs | |
[ @ISO639 - 1@ ] -
[ @ISO639 - 2@ ] -
[ @ISO639 - 3@ ] one
[ @Native name@ ] : ka
[ @English name@ ] Oneida
[@ISO639-1@] -
[@ISO639-2@] -
[@ISO639-3@] one
[@Native name@] Onʌyotaʔa:ka
[@English name@] Oneida
-}
module Text.Numeral.Langu... | null | https://raw.githubusercontent.com/roelvandijk/numerals/b1e4121e0824ac0646a3230bd311818e159ec127/src-test/Text/Numeral/Language/ONE/TestData.hs | haskell | ------------------------------------------------------------------------------
Imports
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Test data
---------------------------------------------------------------... | |
[ @ISO639 - 1@ ] -
[ @ISO639 - 2@ ] -
[ @ISO639 - 3@ ] one
[ @Native name@ ] : ka
[ @English name@ ] Oneida
[@ISO639-1@] -
[@ISO639-2@] -
[@ISO639-3@] one
[@Native name@] Onʌyotaʔa:ka
[@English name@] Oneida
-}
module Text.Numeral.Langu... |
6e6f148d3440eaf82996317839ad881af0d28b6d0ec6ca6518cfd623e03da840 | Twinside/Rasterific | Arbitrary.hs | # OPTIONS_GHC -fno - warn - orphans #
module Arbitrary( randomTests ) where
import Control.DeepSeq
import Test.QuickCheck
import Codec.Picture
import Graphics.Rasterific
import Graphics.Rasterific.Texture
instance Arbitrary a => Arbitrary (V2 a) where
arbitrary = V2 <$> arbitrary <*> arbitrary
instance Arbitrary... | null | https://raw.githubusercontent.com/Twinside/Rasterific/709e2828d6378aa82f133a881665f2fa951e0204/exec-src/Arbitrary.hs | haskell | # OPTIONS_GHC -fno - warn - orphans #
module Arbitrary( randomTests ) where
import Control.DeepSeq
import Test.QuickCheck
import Codec.Picture
import Graphics.Rasterific
import Graphics.Rasterific.Texture
instance Arbitrary a => Arbitrary (V2 a) where
arbitrary = V2 <$> arbitrary <*> arbitrary
instance Arbitrary... | |
2faeb7d54b6e3f096c82f14886422fe75c1df96b87efa3b71c63cfaa7cb71df4 | bhauman/advent-of-clojure | day01.clj | (ns advent-2017.day01
(:require [clojure.java.io :as io]))
(def data (mapv
(comp read-string str)
(slurp (io/resource "2017/day01"))))
(defn count-em [d]
(->> (partition 2 1 (conj (vec d) (first d)))
(filter (partial apply =))
(map first)
(apply +)))
(comment
(count-e... | null | https://raw.githubusercontent.com/bhauman/advent-of-clojure/856763baf45bf7bf452ffd304dc1b89f9bc879a6/src/advent-2017/day01.clj | clojure | (ns advent-2017.day01
(:require [clojure.java.io :as io]))
(def data (mapv
(comp read-string str)
(slurp (io/resource "2017/day01"))))
(defn count-em [d]
(->> (partition 2 1 (conj (vec d) (first d)))
(filter (partial apply =))
(map first)
(apply +)))
(comment
(count-e... | |
d03e61d9d35218367f7865b637f7b53a4597e4a3b6257657a15af291e4523537 | fpco/ide-backend | GHC.hs | module Distribution.Simple.Program.GHC (
GhcOptions(..),
GhcMode(..),
GhcOptimisation(..),
GhcDynLinkMode(..),
ghcInvocation,
renderGhcOptions,
runGHC,
) where
import Distribution.Simple.GHC.ImplInfo ( getImplInfo, GhcImplInfo(..) )
import Distribution.Package
import Distribution.Packa... | null | https://raw.githubusercontent.com/fpco/ide-backend/860636f2d0e872e9481569236bce690637e0016e/ide-backend/TestSuite/inputs/Cabal-1.22.0.0/Distribution/Simple/Program/GHC.hs | haskell |
override other stuff.
and so can be overridden by other stuff.
---------------------
Inputs and outputs
| The main input files; could be .hs, .hi, .c, .o, depending on mode.
make@ mode .
| Location for dynamic output file in 'GhcStaticAndDynamic' mode;
the @ghc -dyno@ flag.
the @ghc -i@ flag (@-i@ on it's own w... | module Distribution.Simple.Program.GHC (
GhcOptions(..),
GhcMode(..),
GhcOptimisation(..),
GhcDynLinkMode(..),
ghcInvocation,
renderGhcOptions,
runGHC,
) where
import Distribution.Simple.GHC.ImplInfo ( getImplInfo, GhcImplInfo(..) )
import Distribution.Package
import Distribution.Packa... |
56ba93f7dfefad8ae9a2196dec0f9ce67f991a6650533964b6f7661571facf2d | bgamari/bayes-stack | Gibbs.hs | # LANGUAGE TypeFamilies , FlexibleInstances , FlexibleContexts ,
ExistentialQuantification , GADTs , CPP #
ExistentialQuantification, GADTs, CPP #-}
module BayesStack.Gibbs ( UpdateUnit(..)
, WrappedUpdateUnit(..)
) where
import Control.DeepS... | null | https://raw.githubusercontent.com/bgamari/bayes-stack/020df7bb7263104fdea254e57d6c7daf7806da3e/BayesStack/Gibbs.hs | haskell | # LANGUAGE TypeFamilies , FlexibleInstances , FlexibleContexts ,
ExistentialQuantification , GADTs , CPP #
ExistentialQuantification, GADTs, CPP #-}
module BayesStack.Gibbs ( UpdateUnit(..)
, WrappedUpdateUnit(..)
) where
import Control.DeepS... | |
bbeaae6cb9050a146641e4a68e71bec372257c5b26242c56c619b68da9d45ca3 | copton/ocram | Main.hs | module Main where
import Reactive.Banana
import Control.Concurrent (threadDelay)
import Control.Monad (when)
main :: IO ()
main = do
(ah, fire) <- newAddHandler
let
createNetwork = do
eCommand <- fromAddHandler ah
reactimate $ handle <$> eCommand
handle n = print n >> when (n == 1) (fire 3)
... | null | https://raw.githubusercontent.com/copton/ocram/c7166eab0187868a52a61017c6d3687e5a1a6162/try/frp/time/Main.hs | haskell | module Main where
import Reactive.Banana
import Control.Concurrent (threadDelay)
import Control.Monad (when)
main :: IO ()
main = do
(ah, fire) <- newAddHandler
let
createNetwork = do
eCommand <- fromAddHandler ah
reactimate $ handle <$> eCommand
handle n = print n >> when (n == 1) (fire 3)
... | |
ad9d78470d5c67ab7c17a8baea4f454c40d1337475a4cf76f282fe97ea7f3a5c | marick/suchwow | metadata.clj | (ns such.metadata
"Convenience functions for working with metadata. Intended to be used with
`(:require [such.metadata :as meta])`."
(:refer-clojure :exclude [merge assoc get contains?]))
(defn get
"Equivalent to `(get (meta o) k)` or `(get (meta o) k default)`."
([o k default]
(clojure.core/get (meta o... | null | https://raw.githubusercontent.com/marick/suchwow/111cd4aa21ee23552742701bfe52e593b65fb0f8/src/such/metadata.clj | clojure | (ns such.metadata
"Convenience functions for working with metadata. Intended to be used with
`(:require [such.metadata :as meta])`."
(:refer-clojure :exclude [merge assoc get contains?]))
(defn get
"Equivalent to `(get (meta o) k)` or `(get (meta o) k default)`."
([o k default]
(clojure.core/get (meta o... | |
85868129e4e95725b2f3b7b0d72c451c38231a4c036dcfdd3409e13442fc2c61 | matijapretnar/eff | value.ml | open Utils
open Language
type value =
| Const of Const.t
| Tuple of value list
| Record of value Type.Field.Map.t
| Variant of Type.Label.t * value option
| Closure of closure
| TypeCoercionClosure of (Type.ct_ty -> value)
| DirtCoercionClosure of (Type.ct_dirt -> value)
| Handler of (result -> result)... | null | https://raw.githubusercontent.com/matijapretnar/eff/0b0ec7a83e7db4d040ed8fdfc1ac6e3c0f344be1/src/05-backends/runtime/value.ml | ocaml | open Utils
open Language
type value =
| Const of Const.t
| Tuple of value list
| Record of value Type.Field.Map.t
| Variant of Type.Label.t * value option
| Closure of closure
| TypeCoercionClosure of (Type.ct_ty -> value)
| DirtCoercionClosure of (Type.ct_dirt -> value)
| Handler of (result -> result)... | |
263d32a36dabccfda43731a0f6f5ece769e14349573a1e87bff0f1bd0b75c7f3 | jgm/HeX | Standard.hs | {-# LANGUAGE OverloadedStrings, ScopedTypeVariables, PackageImports #-}
module Text.HeX.Standard ( defaults ) where
import Text.HeX
import qualified Text.HeX.Standard.Generic as Generic
import qualified Text.HeX.Standard.Html as Html
import qualified Text.HeX.Standard.LaTeX as LaTeX
import qualified Text.HeX.Math.Math... | null | https://raw.githubusercontent.com/jgm/HeX/5bab503606e01c453555545493c43c00398ca408/Text/HeX/Standard.hs | haskell | # LANGUAGE OverloadedStrings, ScopedTypeVariables, PackageImports # | module Text.HeX.Standard ( defaults ) where
import Text.HeX
import qualified Text.HeX.Standard.Generic as Generic
import qualified Text.HeX.Standard.Html as Html
import qualified Text.HeX.Standard.LaTeX as LaTeX
import qualified Text.HeX.Math.MathML as MathML
import qualified Text.HeX.Math.LaTeX as LaTeXMath
defaults... |
fb08d56bb431d54dca3cde959583648a9556e7a59e629ece756b4f48f50598b9 | ujamjar/hardcaml-llvmsim | test_fifo.ml | open HardCaml
module Seq = Signal.Make_seq(struct
let reg_spec = Signal.Seq.r_sync
let ram_spec = Signal.Seq.r_none
end)
module Fifo = struct
open Signal.Comb
let bits = 4
module I = struct
type 'a t = { clear : 'a[@bits 1]; wr : 'a[@bits 1]; d : 'a[@bits bits]; rd : 'a[@bits 1]; }[@@deriving hardcaml]
end
... | null | https://raw.githubusercontent.com/ujamjar/hardcaml-llvmsim/dc0e1a67bdf18a7ccf05035c042ec46fa7f4296b/test/test_fifo.ml | ocaml | open HardCaml
module Seq = Signal.Make_seq(struct
let reg_spec = Signal.Seq.r_sync
let ram_spec = Signal.Seq.r_none
end)
module Fifo = struct
open Signal.Comb
let bits = 4
module I = struct
type 'a t = { clear : 'a[@bits 1]; wr : 'a[@bits 1]; d : 'a[@bits bits]; rd : 'a[@bits 1]; }[@@deriving hardcaml]
end
... | |
0370bd76c9c5c7c30bd87e72646f1983d1f5105921e69848c4403ea16bb7f9c3 | esl/esl-rabbitmq-client | esl_rabbitmq_client_msg_handler.erl | -module(esl_rabbitmq_client_msg_handler).
-behaviour(gen_server).
-include_lib("amqp_client/include/amqp_client.hrl").
%% API
-export([start_link/1]).
%% `gen_server' behaviour callbacks
-export([ init/1
, handle_call/3
, handle_info/2
, handle_cast/2
, code_change/3
, terminat... | null | https://raw.githubusercontent.com/esl/esl-rabbitmq-client/0bcd0ff7ca4cf1a982c7a9d2d1fdf29f0a82ac8f/src/esl_rabbitmq_client_msg_handler.erl | erlang | API
`gen_server' behaviour callbacks
=============================================================================
API
=============================================================================
=============================================================================
`gen_server' behaviour callbacks
====... | -module(esl_rabbitmq_client_msg_handler).
-behaviour(gen_server).
-include_lib("amqp_client/include/amqp_client.hrl").
-export([start_link/1]).
-export([ init/1
, handle_call/3
, handle_info/2
, handle_cast/2
, code_change/3
, terminate/2
]).
-type state() :: #{client_... |
7c4b7b32cff8c7967b8fccf02a67478a594ed69594457967267ea4f3a5a7ced5 | spechub/Hets | ProverTools.hs | |
Module : ./Common / ProverTools.hs
Description : Check for availability of provers
Copyright : ( c ) , and Uni Bremen 2008
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : provisional
Portability : portable
check for provers
Module : ... | null | https://raw.githubusercontent.com/spechub/Hets/65413446b056dfc965a75e9076eaf78b2ec550e7/Common/ProverTools.hs | haskell | ^ file name
^ Environment Variable
| Checks if a file exists in PATH
| Checks if a file exists
^ file name
^ Environment Variable
^ environment Variable
^ jar file name
^ default path
^ environment Variable
^ jar file name
| environment variable for HETS_OWL_TOOLS
| check for the jar file under HETS_OWL_TO... | |
Module : ./Common / ProverTools.hs
Description : Check for availability of provers
Copyright : ( c ) , and Uni Bremen 2008
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : provisional
Portability : portable
check for provers
Module : ... |
91e4bf69b2bfe8940e4269a8db25bae485bab9020424495773b15632d14fc353 | haskell-opengl/OpenGLRaw | FramebufferBlit.hs | # LANGUAGE PatternSynonyms #
--------------------------------------------------------------------------------
-- |
-- Module : Graphics.GL.EXT.FramebufferBlit
Copyright : ( c ) 2019
-- License : BSD3
--
Maintainer : < >
-- Stability : stable
-- Portability : portable
--
----------------... | null | https://raw.githubusercontent.com/haskell-opengl/OpenGLRaw/57e50c9d28dfa62d6a87ae9b561af28f64ce32a0/src/Graphics/GL/EXT/FramebufferBlit.hs | haskell | ------------------------------------------------------------------------------
|
Module : Graphics.GL.EXT.FramebufferBlit
License : BSD3
Stability : stable
Portability : portable
------------------------------------------------------------------------------
* Extension Support
* Enums
* Functio... | # LANGUAGE PatternSynonyms #
Copyright : ( c ) 2019
Maintainer : < >
module Graphics.GL.EXT.FramebufferBlit (
glGetEXTFramebufferBlit,
gl_EXT_framebuffer_blit,
pattern GL_DRAW_FRAMEBUFFER_BINDING_EXT,
pattern GL_DRAW_FRAMEBUFFER_EXT,
pattern GL_READ_FRAMEBUFFER_BINDING_EXT,
pattern GL_REA... |
5cbd6037401fd53bb20c2787aa3c1219b508e181a39bb2d381b129d5f6c9127d | dhall-lang/dhall-to-cabal | Util.hs | # language ViewPatterns #
module DhallToCabal.Util
( relativeTo
)
where
import System.FilePath
( dropTrailingPathSeparator, joinPath, normalise, splitDirectories, takeDirectory )
-- | Like 'System.FilePath.makeRelative', but will introduce @..@
-- segments (and hence will misbehave in the presence of symlink... | null | https://raw.githubusercontent.com/dhall-lang/dhall-to-cabal/d16c510b87e966c3031e07b1810d152b051bc0d8/lib/DhallToCabal/Util.hs | haskell | | Like 'System.FilePath.makeRelative', but will introduce @..@
segments (and hence will misbehave in the presence of symlinks).
If the path being relativised is identical to the root path, then
this will return the empty string.
^ The path to be relative to. Note that the final file-name is
a directory.
^ The p... | # language ViewPatterns #
module DhallToCabal.Util
( relativeTo
)
where
import System.FilePath
( dropTrailingPathSeparator, joinPath, normalise, splitDirectories, takeDirectory )
relativeTo
:: FilePath
ignored : @foo / bar@ is relative to @foo/@ , even if @foo / bar@ is
-> FilePath
-> FilePath
relati... |
90ab819276692c93c63e738e810fb9551a23cddef6b9c52d5a8a03881eb1d178 | JHU-PL-Lab/jaylang | McCarthy9102.ml |
let rec bot _ = bot ()
let fail _ = assert false
let rec mc91_1030 mc91_without_checking_1058 prev_set_flag_mc91_1049 s_prev_mc91_n_1048 n_1031 =
let u = if prev_set_flag_mc91_1049 then
if (111 * 1) + (-s_prev_mc91_n_1048) > (111 * 1) + (-n_1031) &&
(111 * 1) + (-n_1031) >= 0 th... | null | https://raw.githubusercontent.com/JHU-PL-Lab/jaylang/484b3876986a515fb57b11768a1b3b50418cde0c/benchmark/cases/mochi_origin/termination/McCarthy9102.ml | ocaml |
let rec bot _ = bot ()
let fail _ = assert false
let rec mc91_1030 mc91_without_checking_1058 prev_set_flag_mc91_1049 s_prev_mc91_n_1048 n_1031 =
let u = if prev_set_flag_mc91_1049 then
if (111 * 1) + (-s_prev_mc91_n_1048) > (111 * 1) + (-n_1031) &&
(111 * 1) + (-n_1031) >= 0 th... | |
da7a7a25dde104b33b3ca74877cef42791b6a1e38dbc64395d26146f4b528bc3 | Mathieu-Desrochers/Schemings | http-client.scm | (import srfi-1)
(import srfi-4)
(import srfi-13)
(import (chicken condition))
(import (chicken format))
(declare (unit http-client))
(declare (uses curl))
(declare (uses http-client-intern))
;; encapsulates an http client request
(define-typed-record http-client-request
(method string)
(url string)
(username ... | null | https://raw.githubusercontent.com/Mathieu-Desrochers/Schemings/a7c322ee37bf9f43b696c52fc290488aa2dcc238/sources/units/http-client.scm | scheme | encapsulates an http client request
encapsulates an http client response
initializes the http client unit
url encodes a string
performs an http client request
set the method options
set the url
set the username and password
set the headers
set the body
perform the request
get the response code
make the htt... | (import srfi-1)
(import srfi-4)
(import srfi-13)
(import (chicken condition))
(import (chicken format))
(declare (unit http-client))
(declare (uses curl))
(declare (uses http-client-intern))
(define-typed-record http-client-request
(method string)
(url string)
(username (or string false))
(password (or stri... |
c065e17973658fca68fb3ea195afc41e0f71ce620d1d93a97e9d42fef5f676a3 | MATRIXKOO/test_for_sicp | e1_15.scm.rkt | #lang sicp
(define (cube x) (* x x x))
(define (p x) (- (* 3 x) (* 4 (cube x))))
(define (sine angle)
(if (not (> (abs angle) 0.1))
angle
(p (sine (/ angle 3.0)))))
5times
; n(log(3)a) | null | https://raw.githubusercontent.com/MATRIXKOO/test_for_sicp/9772d67fd43ee919c4ba85c1d584d9875745f8ba/Chapter1/e1_15.scm.rkt | racket | n(log(3)a) | #lang sicp
(define (cube x) (* x x x))
(define (p x) (- (* 3 x) (* 4 (cube x))))
(define (sine angle)
(if (not (> (abs angle) 0.1))
angle
(p (sine (/ angle 3.0)))))
5times
|
8b53672f41140f6822829bbabc6fb89f158bc5c8740a5bd9ad0ebd608ac57f08 | nasa/Common-Metadata-Repository | routes.clj | (ns cmr.bootstrap.api.routes
"Defines the HTTP URL routes for the application."
(:require
[cmr.acl.core :as acl]
[cmr.bootstrap.api.bulk-index :as bulk-index]
[cmr.bootstrap.api.bulk-migration :as bulk-migration]
[cmr.bootstrap.api.fingerprint :as fingerprint]
[cmr.bootstrap.api.rebalancing :as rebal... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/5bed3637580e2ad6e0b0ecda4c90845171ffeb8a/bootstrap-app/src/cmr/bootstrap/api/routes.clj | clojure | generating pluralized endpoints for each generic document type & converting to singular in call
Start rebalancing
Get counts of rebalancing data
Complete reindexing
Add routes for accessing caches
db migration route
Add routes for checking health of the application | (ns cmr.bootstrap.api.routes
"Defines the HTTP URL routes for the application."
(:require
[cmr.acl.core :as acl]
[cmr.bootstrap.api.bulk-index :as bulk-index]
[cmr.bootstrap.api.bulk-migration :as bulk-migration]
[cmr.bootstrap.api.fingerprint :as fingerprint]
[cmr.bootstrap.api.rebalancing :as rebal... |
0ff53e6da764422fccf592c3ce123d2e94dea2a87f4f09c068ed8ee7df6e0043 | astrada/rxocaml | rxObserver.ml | Internal module ( see Rx . Observer )
*
* Implementation based on :
* #Rx.NET/Source/System.Reactive.Core/Observer.Extensions.cs
*
* Implementation based on:
* #Rx.NET/Source/System.Reactive.Core/Observer.Extensions.cs
*)
let create
?(on_completed = fun () -> ())
?(on_error = fun e -> raise e... | null | https://raw.githubusercontent.com/astrada/rxocaml/6a4ea758108a07a8da129ba1555a260604f79091/src/rxObserver.ml | ocaml | Original implementation:
* #Rx.NET/Source/System.Reactive.Core/Reactive/ObserverBase.cs
Original implementation:
* #Rx.NET/Source/System.Reactive.Core/Reactive/Internal/SynchronizedObserver.cs
Original implementation:
* #Rx.NET/Source/System.Reactive.Core/Reactive/Internal/AsyncLockObserver.cs
| Internal module ( see Rx . Observer )
*
* Implementation based on :
* #Rx.NET/Source/System.Reactive.Core/Observer.Extensions.cs
*
* Implementation based on:
* #Rx.NET/Source/System.Reactive.Core/Observer.Extensions.cs
*)
let create
?(on_completed = fun () -> ())
?(on_error = fun e -> raise e... |
13ca8f524140d6edd568c0afdb4aef92e490cf5b4b1185bea392bd84ca1fe344 | mejgun/haskell-tdlib | StickerType.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Data.StickerType where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
-- | Describes type of a sticker
data StickerType
= -- | The sticker is a regular sticker
StickerTypeRegular
| The sticker is a mask in ... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/cf563ece2c2270b2079e233c73cbc7dfd2f70281/src/TD/Data/StickerType.hs | haskell | # LANGUAGE OverloadedStrings #
|
| Describes type of a sticker
| The sticker is a regular sticker
| The sticker is a custom emoji to be used inside message text and caption |
module TD.Data.StickerType where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
data StickerType
StickerTypeRegular
| The sticker is a mask in WEBP format to be placed on photos or videos
StickerTypeMask
StickerTypeCustomEmoji
deriving (Eq)
instan... |
dde1e0210223503c9b2101d8486e1e58cf691bc0a8dc84a41b19e31209837bf5 | ygmpkk/house | Reader.hs | -----------------------------------------------------------------------------
-- |
Module : Control . . Reader
Copyright : ( c ) 2001 ,
( c ) Oregon Graduate Institute of Science and Technology , 2001
-- License : BSD-style (see the file libraries/base/LICENSE)
--
-- Maintainer :
-- St... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/libraries/base/Control/Monad/Reader.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style (see the file libraries/base/LICENSE)
Maintainer :
Stability : experimental
Portability : non-portable (multi-param classes, functional dependencies)
Declaration of the Monoid class,and instances for l... | Module : Control . . Reader
Copyright : ( c ) 2001 ,
( c ) Oregon Graduate Institute of Science and Technology , 2001
( < /~mpj/ > )
Advanced School of Functional Programming , 1995 .
module Control.Monad.Reader (
MonadReader(..),
asks,
Reader(..),
mapReader,
withReader,
Re... |
bd0aa594507445d0631276073a0ead87d1c0f4310bbbe9d4c46b6dc8942f0c8e | symbiont-io/detsys-testkit | Storage.hs | # LANGUAGE DeriveGeneric #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
module Ldfi.Storage where
import Control.Arrow (second)
import Control.Exception
import Data.Aeson (decode)
import qualified Data.Binary.Builder as BB
import Data.Hashable (Hashable)
import Data.List (groupBy, intercalate)
... | null | https://raw.githubusercontent.com/symbiont-io/detsys-testkit/29a3a0140730420e4c5cc8db23df6fdb03f9302c/src/ldfi/src/Ldfi/Storage.hs | haskell | # LANGUAGE OverloadedStrings #
----------------------------------------------------------------------
XXX: Fault?
TODO(stevan): What exactly do we need to store? Previous faults are no longer
interesting. | # LANGUAGE DeriveGeneric #
# LANGUAGE ScopedTypeVariables #
module Ldfi.Storage where
import Control.Arrow (second)
import Control.Exception
import Data.Aeson (decode)
import qualified Data.Binary.Builder as BB
import Data.Hashable (Hashable)
import Data.List (groupBy, intercalate)
import Data.Map (Map)
import qualif... |
d93befce75a36c8b1fe0652b45b360e1069f8cd2aa3141f73efd2d0f429af343 | inaka/elvis_core | pass_max_function_length_elvis_attr.erl | -module(pass_max_function_length_elvis_attr).
-export([f5/1, f10/1, f15/1]).
-elvis([{elvis_style, max_function_length, #{ max_length => 15,
count_comments => true,
count_whitespace => true }}]).
1
2
3
5
1
2
3
... | null | https://raw.githubusercontent.com/inaka/elvis_core/468bd3498f1782fd74ef3d8eb1b36217b0b76c11/test/examples/pass_max_function_length_elvis_attr.erl | erlang | -module(pass_max_function_length_elvis_attr).
-export([f5/1, f10/1, f15/1]).
-elvis([{elvis_style, max_function_length, #{ max_length => 15,
count_comments => true,
count_whitespace => true }}]).
1
2
3
5
1
2
3
... | |
71e245d02507fd2e469d458f85b74c4ac28b2ab93f529038b8479cff6af31b8a | dbuenzli/uuseg | test.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2014 The uuseg programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c)... | null | https://raw.githubusercontent.com/dbuenzli/uuseg/fc4530bce6873a28a7e2deea9bd34ec415d496b3/test/test.ml | ocaml | Grrrr.
Grrrrr.
Conformance data decoding
parses a code point value.
×
÷
Conformance tests of line breaking algorithm implement a tailoring
that we don't implement. Here are the tests break according
to that tailoring.
éa | ---------------------------------------------------------------------------
Copyright ( c ) 2014 The uuseg programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c)... |
19eb08198201d736dde19ce5fdfa99925da4fb46ff19c0557038a3147001cdc0 | zenspider/schemers | exercise.3.71.scm | #lang racket/base
Exercise 3.71
Numbers that can be expressed as the sum of two
cubes in more than one way are sometimes called " Ramanujan
numbers " , in honor of the mathematician Ramanujan.(6 )
;; Ordered streams of pairs provide an elegant solution to the
;; problem of computing these numbers. To find a... | null | https://raw.githubusercontent.com/zenspider/schemers/2939ca553ac79013a4c3aaaec812c1bad3933b16/sicp/ch_3/exercise.3.71.scm | scheme | Ordered streams of pairs provide an elegant solution to the
problem of computing these numbers. To find a number that can be
only generate the stream of pairs of integers (i,j) weighted | #lang racket/base
Exercise 3.71
Numbers that can be expressed as the sum of two
cubes in more than one way are sometimes called " Ramanujan
numbers " , in honor of the mathematician Ramanujan.(6 )
written as the sum of two cubes in two different ways , we need
according to the sum i^3 + j^3 ( see * Note ... |
ce330f967842d5995f6086b5fcd28dfddf02d02ecd13f06220c5d1515292868f | w3ntao/sicp-solution | 2-37.rkt | #lang racket
(define nil '())
(define (accumulate op initial sequence)
(if (null? sequence)
initial
(op (car sequence)
(accumulate op initial (cdr sequence)))))
(define (dot-product v w);both v and w are vectors
(accumulate + 0 (map * v w)))
(define (matrix-*-vector m v)
(map (lambda (x)... | null | https://raw.githubusercontent.com/w3ntao/sicp-solution/00be3a7b4da50bb266f8a2db521a24e9f8c156be/chap-2/2-37.rkt | racket | both v and w are vectors
(dot-product test-vec test-vec)
(matrix-*-vector test-matrix test-vec)
(transpose matrix-2)
(map * (list 1 2 3) (list 1 2 3)) | #lang racket
(define nil '())
(define (accumulate op initial sequence)
(if (null? sequence)
initial
(op (car sequence)
(accumulate op initial (cdr sequence)))))
(accumulate + 0 (map * v w)))
(define (matrix-*-vector m v)
(map (lambda (x)
(dot-product x v))
m))
(define (... |
51a4dc4057edbfbcf448d4ec7e13f1c9d8546e0a4bc3b932594d84c56d428f85 | melisgl/mgl | optimize.lisp | (in-package :mgl-opt)
(defsection @mgl-opt (:title "Gradient Based Optimization")
"We have a real valued, differentiable function F and the task is to
find the parameters that minimize its value. Optimization starts
from a single point in the parameter space of F, and this single
point is updated iteratively b... | null | https://raw.githubusercontent.com/melisgl/mgl/27a2552632a6a9330c1a133e519e676d9c6ca714/src/optimize.lisp | lisp | steps make it difficult to go the other way easily. | (in-package :mgl-opt)
(defsection @mgl-opt (:title "Gradient Based Optimization")
"We have a real valued, differentiable function F and the task is to
find the parameters that minimize its value. Optimization starts
from a single point in the parameter space of F, and this single
point is updated iteratively b... |
8ba15bc3350e1bc77960ac074d27b5dc781b8e5eaf0c1dac64757f52ba018564 | osteele/cl-spec | bdd.lisp | Author :
;;; Source:
ows 2008 - 01 - 05 -- fixed compiler errors and warnings
ows 2008 - 01 - 08 -- eval - > funcall , to capture lexical scope
(in-package #:cl-spec)
Utilities
(eval-when (:compile-toplevel :load-toplevel :execute)
(defmethod obj->string ((s string))
s)
(defmethod obj->string ((s... | null | https://raw.githubusercontent.com/osteele/cl-spec/d83b8a89d55771691e439e2fb910ce202dbd6abe/bdd.lisp | lisp | Source:
Conditions
This happens when matcher-class doesn't actually name
e.g. (= > 1 should = 1 ) instead of
am I crazy?
| Author :
ows 2008 - 01 - 05 -- fixed compiler errors and warnings
ows 2008 - 01 - 08 -- eval - > funcall , to capture lexical scope
(in-package #:cl-spec)
Utilities
(eval-when (:compile-toplevel :load-toplevel :execute)
(defmethod obj->string ((s string))
s)
(defmethod obj->string ((s symbol))
... |
f02ab0547c3e3b5bf1f3265a0de3e69a0286d35afe25ee179d42998b00fa3374 | Plutonomicon/plutarch-plutus | Gen.hs | # OPTIONS_GHC -Wno - orphans #
-- | Generator helpers
module Plutarch.Test.Property.Gen (
genRational,
genInteger,
genList,
bsOfLength,
) where
import Control.Monad (MonadPlus, liftM2, mfilter)
import Data.List (nub, sortOn)
import Data.Ratio ((%))
import Hedgehog (MonadGen)
import Hedgehog.Gen qualified as ... | null | https://raw.githubusercontent.com/Plutonomicon/plutarch-plutus/9b83892057f2aaaed76e3af6193ad1ae242244cc/plutarch-test/Plutarch/Test/Property/Gen.hs | haskell | | Generator helpers
--------------- Arbitrary instances for several ApiTypes -----------------------
List of unique token names.
List of unique currency symbols. | # OPTIONS_GHC -Wno - orphans #
module Plutarch.Test.Property.Gen (
genRational,
genInteger,
genList,
bsOfLength,
) where
import Control.Monad (MonadPlus, liftM2, mfilter)
import Data.List (nub, sortOn)
import Data.Ratio ((%))
import Hedgehog (MonadGen)
import Hedgehog.Gen qualified as Gen
import Hedgehog.Ran... |
fe77471692aed8f93bb7401ad5088faed50f2d45a844fc92c01254cfd5aa66e8 | anton-k/sharc-timbre | Types.hs | module Types where
-- primitives
type Hz = Double
type Db = Double
type PitchName = String
data Pitch = Pitch
{ pitchFund :: Hz
, pitchKeyNum :: Int
, pitchName :: PitchName
} deriving (Show)
-- sharc db
type Sharc = [Instr]
data Instr = Instr
{ instrId :: String
, instrNa... | null | https://raw.githubusercontent.com/anton-k/sharc-timbre/14be260021c02f31905b3e63269f582030a45c8d/tools/Types.hs | haskell | primitives
sharc db
| Harmonic is repesented with number in the spectrum, phase (-pi, pi), and amplitude
(given in decibels relative to the amplitude of the loudest harmonic for that note)
-------------------------------------------------
ranges
-------------------------------------------------
Track legend | module Types where
type Hz = Double
type Db = Double
type PitchName = String
data Pitch = Pitch
{ pitchFund :: Hz
, pitchKeyNum :: Int
, pitchName :: PitchName
} deriving (Show)
type Sharc = [Instr]
data Instr = Instr
{ instrId :: String
, instrName :: String
, ins... |
423fda693072d4ac2b6213b1103921e215e8052eb57891833a5292ed19e9fa95 | grin-compiler/ghc-wpc-sample-programs | Native.hs | {-# LANGUAGE OverloadedStrings #-}
|
Module : Text . Pandoc . Readers . Native
Copyright : Copyright ( C ) 2011 - 2020
License : GNU GPL , version 2 or above
Maintainer : < >
Stability : alpha
Portability : portable
Conversion of a string representation of a p... | null | https://raw.githubusercontent.com/grin-compiler/ghc-wpc-sample-programs/0e3a9b8b7cc3fa0da7c77fb7588dd4830fb087f7/pandoc-11df2a3c0f2b1b8e351ad8caaa7cdf583e1b3b2e/src/Text/Pandoc/Readers/Native.hs | haskell | # LANGUAGE OverloadedStrings #
The input may be a full pandoc document, a block list, a block,
an inline list, or an inline. Thus, for example,
will be treated as if it were
> Pandoc nullMeta [Plain [Str "hi"]]
^ String to parse (assuming @'\n'@ line endings) | |
Module : Text . Pandoc . Readers . Native
Copyright : Copyright ( C ) 2011 - 2020
License : GNU GPL , version 2 or above
Maintainer : < >
Stability : alpha
Portability : portable
Conversion of a string representation of a pandoc type ( @Pandoc@ ,
@[Block]@... |
e39a8260edaa4f1b420bf3aba6c91c512c1c97ddd681b792dc4c6c4072481de3 | ChrisTitusTech/gimphelp | 210_sketch_sketch-drawing.scm | 210_sketch_sketch-drawing.scm
last modified / tested by [ gimphelp.org ]
05/11/2019 on GIMP 2.10.10
;==================================================
;
; Installation:
; This script should be placed in the user or system-wide script folder.
;
; Windows 7/10
C:\Program Files\GIMP 2\share\gimp\2.0\scripts
; o... | null | https://raw.githubusercontent.com/ChrisTitusTech/gimphelp/fdbc7e3671ce6bd74cefd83ecf7216e5ee0f1542/gimp_scripts-2.10/210_sketch_sketch-drawing.scm | scheme | ==================================================
Installation:
This script should be placed in the user or system-wide script folder.
Windows 7/10
or
Linux
/home/yourname/.config/GIMP/2.10/scripts
or
Linux system-wide
/usr/share/gimp/2.0/scripts
==================================================
... | 210_sketch_sketch-drawing.scm
last modified / tested by [ gimphelp.org ]
05/11/2019 on GIMP 2.10.10
C:\Program Files\GIMP 2\share\gimp\2.0\scripts
C:\Users\YOUR - NAME\AppData\Roaming\GIMP\2.10\scripts
it under the terms of the GNU General Public License as published by
the Free Software Foundatio... |
a3173f4f732d481edc25f4d57f36c65d9f4aac09d5c71851867545b40ac3c0b2 | herbelin/coq-hh | safe_marshal.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/herbelin/coq-hh/296d03d5049fea661e8bdbaf305ed4bf6d2001d2/lib/safe_marshal.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
********************************************************************** | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
let uuencode s =
let nor... |
a3c9ad4a1e7ecc6d239d87d16e1000a749306896fea9785f8ce163764e5d503e | awakesecurity/spectacle | Diehard.hs | # LANGUAGE OverloadedLabels #
module Specifications.Diehard where
import Language.Spectacle
( Action,
ActionType (ActionUF),
Fairness (Unfair),
Modality (Always),
Specification (Specification),
Temporal,
TemporalType (PropG),
interaction,
plain,
prime,
specInit,
specNext,... | null | https://raw.githubusercontent.com/awakesecurity/spectacle/70501d0dc8b7fbefe1b52afff405c65e663fbf4e/test/integration/Specifications/Diehard.hs | haskell | -------------------------------------------------------------------------------------------------
------------------------------------------------------------------------------------------------- | # LANGUAGE OverloadedLabels #
module Specifications.Diehard where
import Language.Spectacle
( Action,
ActionType (ActionUF),
Fairness (Unfair),
Modality (Always),
Specification (Specification),
Temporal,
TemporalType (PropG),
interaction,
plain,
prime,
specInit,
specNext,... |
951dbec2e18571187ad56d4e53a6c0b74b1df303053beeaea10eb991e7a50bdd | aharisu/Gauche-CV | save.scm | (use cv)
(let* ([src (cv-load-image "data/image/items.jpg")]
[gray (make-image (slot-ref src 'width)
(slot-ref src 'height)
IPL_DEPTH_8U 1)])
(cv-cvt-color src gray CV_BGR2GRAY)
(cv-set-image-roi gray (make-cv-rect 0 0
... | null | https://raw.githubusercontent.com/aharisu/Gauche-CV/5e4c51501431c72270765121ea4d92693f11d60b/sample/save.scm | scheme | (use cv)
(let* ([src (cv-load-image "data/image/items.jpg")]
[gray (make-image (slot-ref src 'width)
(slot-ref src 'height)
IPL_DEPTH_8U 1)])
(cv-cvt-color src gray CV_BGR2GRAY)
(cv-set-image-roi gray (make-cv-rect 0 0
... | |
c4634d9607d1c7d1bb680658b14a73e5cf9d75b494dcdbbc92c7e932727c380b | otto-de-legacy/oscillator | dsl.clj | (ns de.otto.oscillator.graphite.dsl
(:require [clojure.string :as cs]))
(defn aliaz [target name]
(str "alias(" target ",\"" name "\")"))
(defn sum-series [target]
(str "sumSeries(" target ")"))
(defn max-series [& targets]
(str "maxSeries(" (cs/join "," targets) ")"))
(defn group [& targets]
(str "group(... | null | https://raw.githubusercontent.com/otto-de-legacy/oscillator/c1ddf409a70cb91329f0039b95c7bc12289922e2/src/de/otto/oscillator/graphite/dsl.clj | clojure | (ns de.otto.oscillator.graphite.dsl
(:require [clojure.string :as cs]))
(defn aliaz [target name]
(str "alias(" target ",\"" name "\")"))
(defn sum-series [target]
(str "sumSeries(" target ")"))
(defn max-series [& targets]
(str "maxSeries(" (cs/join "," targets) ")"))
(defn group [& targets]
(str "group(... | |
1bf9470c14e31361811d07bad5e8e5ffe3d186f4b19f2dcb1fce025731cbee9b | stepcut/plugins | B.hs | module B where
resource = "i'm in b"
| null | https://raw.githubusercontent.com/stepcut/plugins/52c660b5bc71182627d14c1d333d0234050cac01/testsuite/load/thiemann2/prog/B.hs | haskell | module B where
resource = "i'm in b"
| |
6f4f9c255b47e4b69b87251b4ffdf2c0aff643b82088e5e58cdaa8b950e12cb6 | sjl/coding-math | ballistics.lisp | (in-package #:coding-math.2d.ballistics)
;;;; Config
(defparameter *demo* nil)
(defparameter *width* 600)
(defparameter *height* 400)
(defparameter *center-x* (/ *width* 2))
(defparameter *center-y* (/ *height* 2))
;;;; Drawing
(defparameter *gun-pen* (make-pen :stroke (gray 0.0) :fill (gray 0.0)))
(defparameter *b... | null | https://raw.githubusercontent.com/sjl/coding-math/8e2add14d033da41cb3ac0aac63ad67edb4dd66a/src/2d/ballistics.lisp | lisp | Config
Drawing
Game
Mouse
Keyboard
Run
(defparameter *demo* (make-instance 'game)) | (in-package #:coding-math.2d.ballistics)
(defparameter *demo* nil)
(defparameter *width* 600)
(defparameter *height* 400)
(defparameter *center-x* (/ *width* 2))
(defparameter *center-y* (/ *height* 2))
(defparameter *gun-pen* (make-pen :stroke (gray 0.0) :fill (gray 0.0)))
(defparameter *ball-pen* (make-pen :strok... |
6d960554747865a5595d8f422ec6147de3453df9451ea345b1d98e8bbb0a63ab | daypack-dev/telltime | from_now_cmd.ml | open Cmdliner
let expr_arg =
let doc = "Duration expression" in
Arg.(required & pos 0 (some string) None & info [] ~docv:"EXPR" ~doc)
let run (duration_expr : string) : unit =
match Timere_parse.duration duration_expr with
| Error msg -> print_endline msg
| Ok duration ->
let duration_in_seconds = Timer... | null | https://raw.githubusercontent.com/daypack-dev/telltime/44397926939dfc27da600903a471219cd1ff1c47/src/from_now_cmd.ml | ocaml | open Cmdliner
let expr_arg =
let doc = "Duration expression" in
Arg.(required & pos 0 (some string) None & info [] ~docv:"EXPR" ~doc)
let run (duration_expr : string) : unit =
match Timere_parse.duration duration_expr with
| Error msg -> print_endline msg
| Ok duration ->
let duration_in_seconds = Timer... | |
9ed9085a62cca87d66d27d5cc18f1c18ff2b64d05e5aff3db101d37df9ef186c | brianium/yoose | spec.clj | (ns brianium.yoose.spec
(:require [clojure.spec.alpha :as s]
[brianium.yoose :as yoose]))
(s/def ::use-case yoose/use-case?)
(s/def ::pull-handler (s/fspec :args (s/cat :x any?)))
(s/def ::port-value (complement nil?))
(s/fdef yoose/push!
:args (s/cat :use-case ::use-case :value ::port-value)
... | null | https://raw.githubusercontent.com/brianium/yoose/c4f2892798cbdfef726ce221723c9397108e472e/src/brianium/yoose/spec.clj | clojure | (ns brianium.yoose.spec
(:require [clojure.spec.alpha :as s]
[brianium.yoose :as yoose]))
(s/def ::use-case yoose/use-case?)
(s/def ::pull-handler (s/fspec :args (s/cat :x any?)))
(s/def ::port-value (complement nil?))
(s/fdef yoose/push!
:args (s/cat :use-case ::use-case :value ::port-value)
... | |
91c29b6312b2afa4b41939f6aa93927643e3e9d8c9b27863554f01cb2fc860e7 | metabase/toucan | phone_number.clj | (ns toucan.test-models.phone-number
(:require [toucan.models :as models]))
(models/defmodel PhoneNumber :phone_numbers
models/IModel
(primary-key [_] :number))
| null | https://raw.githubusercontent.com/metabase/toucan/29a921750f3051dce350255cfbd33512428bc3f8/test/toucan/test_models/phone_number.clj | clojure | (ns toucan.test-models.phone-number
(:require [toucan.models :as models]))
(models/defmodel PhoneNumber :phone_numbers
models/IModel
(primary-key [_] :number))
| |
595b7b42a46d0157ad20ed757f31d11775de52afbec9fa724b9a199b48dfecc7 | GrammaticalFramework/gf-core | Interpreter.hs | module GF.Command.Interpreter (
CommandEnv(..),mkCommandEnv,
interpretCommandLine,
getCommandOp
) where
import GF.Command.CommandInfo
import GF.Command.Abstract
import GF.Command.Parse
import PGF.Internal(Expr(..))
import GF.Infra.UseIO(putStrLnE)
import Control.Monad(when)
import qualified Data.Map as Map
imp... | null | https://raw.githubusercontent.com/GrammaticalFramework/gf-core/9b4f2dd18b64b770aaebfa1885085e8e3447f119/src/compiler/GF/Command/Interpreter.hs | haskell | mkCommandEnv :: PGFEnv -> CommandEnv
| macro definition applications: replace ?i by (exps !! i)
| return the trees to be sent in pipe, and the output possibly printed
| analyse command parse tree to a uniform datastructure, normalizing comm name
- the env is needed for macro lookup
report error?
use piped
ignore ... | module GF.Command.Interpreter (
CommandEnv(..),mkCommandEnv,
interpretCommandLine,
getCommandOp
) where
import GF.Command.CommandInfo
import GF.Command.Abstract
import GF.Command.Parse
import PGF.Internal(Expr(..))
import GF.Infra.UseIO(putStrLnE)
import Control.Monad(when)
import qualified Data.Map as Map
imp... |
66861030bea7e2cdb8ac73abfaa01b73c6f17d3a903c5d23a3512c2e93f97e63 | jebberjeb/specviz | spec.cljc | (ns specviz.spec
"Analyze clojure.spec specs."
(:require
[clojure.spec.alpha :as s]))
(defn registered?
"Returns true if `x` is the keyword of a registered spec?"
[x]
(some? (s/get-spec x)))
(defn depends-on*
[names spec-form]
(cond (coll? spec-form)
(doseq [s spec-form] (depends-on* names s... | null | https://raw.githubusercontent.com/jebberjeb/specviz/89d3ff269232dc21d1d1be226dd0bc10388ec68f/src/specviz/spec.cljc | clojure | (ns specviz.spec
"Analyze clojure.spec specs."
(:require
[clojure.spec.alpha :as s]))
(defn registered?
"Returns true if `x` is the keyword of a registered spec?"
[x]
(some? (s/get-spec x)))
(defn depends-on*
[names spec-form]
(cond (coll? spec-form)
(doseq [s spec-form] (depends-on* names s... | |
1dfd73acc12602e3858e4165ec21c0b6e3054c3d89d112a11c972559364e80a8 | facebook/duckling | SK.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. An additional grant
of patent rights can be found in the PATENTS file in the same directory .
module Duckl... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/Dimensions/SK.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. An additional grant | Copyright ( c ) 2016 - present , Facebook , Inc.
of patent rights can be found in the PATENTS file in the same directory .
module Duckling.Dimensions.SK
( allDimensions
) where
import Duckling.Dimensions.Types
allDimensions :: [Seal Dimension]
allDimensions =
[ Seal Numeral
]
|
bf0f18503625b85c0f2be6c7e48bb944bf8ed596c042fe3087619d9925a75192 | Raynes/conch | conch.clj | (ns me.raynes.conch
(:require [me.raynes.conch.low-level :as conch]
[clojure.java.io :as io]
[clojure.string :as string])
(:import java.util.concurrent.LinkedBlockingQueue))
(def ^:dynamic *throw*
"If set to false, exit codes are ignored. If true (default),
throw exceptions for non-zer... | null | https://raw.githubusercontent.com/Raynes/conch/3acbfe564173aa7d6d0ef46d69f17f8e9993db75/src/me/raynes/conch.clj | clojure | Return a byte (convert from unsigned value)
Return a char | (ns me.raynes.conch
(:require [me.raynes.conch.low-level :as conch]
[clojure.java.io :as io]
[clojure.string :as string])
(:import java.util.concurrent.LinkedBlockingQueue))
(def ^:dynamic *throw*
"If set to false, exit codes are ignored. If true (default),
throw exceptions for non-zer... |
b7d1b10c8370868979c1ad1998d5b900031faad51ff6e173b16e32490d86678e | Leapsight/plum_db | plum_db_dvvset.erl | %%-------------------------------------------------------------------
%%
%% File: plum_db_dvvset.erl
%%
@author < >
@author < >
%
The MIT License ( MIT )
Copyright ( C ) 2013
%%
%% Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
associate... | null | https://raw.githubusercontent.com/Leapsight/plum_db/76f4d5113ed26cce4b38ce504f6965a2bcda95ed/src/plum_db_dvvset.erl | erlang | -------------------------------------------------------------------
File: plum_db_dvvset.erl
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and
including without limitation the rights to use, copy, modify, merge, publish, distribute,
furnished to do so, subjec... | @author < >
@author < >
The MIT License ( MIT )
Copyright ( C ) 2013
associated documentation files ( the " Software " ) , to deal in the Software without restriction ,
sublicense , and/or sell copies of the Software , and to permit persons to whom the Software is
substantial portions of ... |
78e8c31ac0831793b55d7a856f4c39dd22d32b9ae8b334104cc142918c3c49bb | GregorySchwartz/too-many-cells | Differential.hs | TooManyCells . Differential . Differential
Functions for finding the differential between groups of cells .
Gregory W. Schwartz
Functions for finding the differential between groups of cells.
-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE PackageImports #-}
# LANGUAGE Qua... | null | https://raw.githubusercontent.com/GregorySchwartz/too-many-cells/358391c358006e8728beb57c3947fef91ce8ca66/src/TooManyCells/Differential/Differential.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings #
# LANGUAGE PackageImports #
Remote
Local
We flip row and column because cells are columns here
Here the columns should be observations.
| Get the indices and statuses for a list of groups of nodes.
| Get the indices and statuses for a list of groups of node... | TooManyCells . Differential . Differential
Functions for finding the differential between groups of cells .
Gregory W. Schwartz
Functions for finding the differential between groups of cells.
-}
# LANGUAGE QuasiQuotes #
module TooManyCells.Differential.Differential
( scToTwoD
, getDEGraph
, g... |
a612590ceb069e77269c1f02587795e3ab0e50048d6fffe018b0602a67a39ea6 | gregr/racket-misc | cursor-monad.rkt | #lang racket/base
(provide
with-cursor
with-cursor*
:::^
:::^*
:::@
:::@?
:::.
:::=
:::~
:::@*
:::@?*
:::.*
:::=*
:::~*
)
(require
"cursor.rkt"
"either.rkt"
"monad.rkt"
"state-monad.rkt"
racket/function
racket/match
)
(module+ test
(require rackunit))
(define-syntax with... | null | https://raw.githubusercontent.com/gregr/racket-misc/0a5c9d4875288795e209d06982b82848c989d08b/cursor-monad.rkt | racket | #lang racket/base
(provide
with-cursor
with-cursor*
:::^
:::^*
:::@
:::@?
:::.
:::=
:::~
:::@*
:::@?*
:::.*
:::=*
:::~*
)
(require
"cursor.rkt"
"either.rkt"
"monad.rkt"
"state-monad.rkt"
racket/function
racket/match
)
(module+ test
(require rackunit))
(define-syntax with... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.