_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 |
|---|---|---|---|---|---|---|---|---|
65dd1179da2daff4c7cf585d505ffba087cc86b8000d5492058353d7f67f1a6c | clojure/tools.analyzer.jvm | core_test.clj | (ns clojure.tools.analyzer.jvm.core-test
(:refer-clojure :exclude [macroexpand-1])
(:require [clojure.tools.analyzer :as ana]
[clojure.tools.analyzer.jvm :as ana.jvm]
[clojure.tools.analyzer.env :as env]
[clojure.tools.analyzer.passes.elide-meta :refer [elides elide-meta]]
... | null | https://raw.githubusercontent.com/clojure/tools.analyzer.jvm/f00d92317307c3e9e326fd99d337292925dc9db1/src/test/clojure/clojure/tools/analyzer/jvm/core_test.clj | clojure | line/column info | (ns clojure.tools.analyzer.jvm.core-test
(:refer-clojure :exclude [macroexpand-1])
(:require [clojure.tools.analyzer :as ana]
[clojure.tools.analyzer.jvm :as ana.jvm]
[clojure.tools.analyzer.env :as env]
[clojure.tools.analyzer.passes.elide-meta :refer [elides elide-meta]]
... |
82a6e95417a3296870573522dc71764f703928e20694207633cec17d3b091a0d | luksamuk/opengames | snake.lisp | ;;;; cl-snake
;;;; A snake clone.
Copyright © 2013 - 2018
;;;;
Licensed under the MIT License .
;;;; Permission is hereby granted, free of charge, to any person obtaining a copy of
;;;; this software and associated documentation files (the "Software"), to deal in
the Software without restriction , incl... | null | https://raw.githubusercontent.com/luksamuk/opengames/6f4b229c6f16e3f274624c120ffee8efc2650831/cl-snake/snake.lisp | lisp | cl-snake
A snake clone.
Permission is hereby granted, free of charge, to any person obtaining a copy of
this software and associated documentation files (the "Software"), to deal in
use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
subject to the following conditions:
Th... | Copyright © 2013 - 2018
Licensed under the MIT License .
the Software without restriction , including without limitation the rights to
the Software , and to permit persons to whom the Software is furnished to do so ,
copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS ... |
e8ca16c363facba06ea398e517440c075835f5d70557e4f723a6ee2e045d5d7f | ghc/testsuite | T5625.hs | module Main where
main = do { let a = \x -> seq undefined (+1)
; print $ (a `seq` a [] `seq` id) [0] }
| null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/simplCore/should_run/T5625.hs | haskell | module Main where
main = do { let a = \x -> seq undefined (+1)
; print $ (a `seq` a [] `seq` id) [0] }
| |
78466c569a198fa365c998c2e553dd124781b8fe7b44c5ca228d9b9a452c229f | Helium4Haskell/helium | Overlap5.hs |
main :: [Bool] -> ()
main (True : _) = ()
main [True, False] = ()
main _ = ()
| null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/test/staticwarnings/Overlap5.hs | haskell |
main :: [Bool] -> ()
main (True : _) = ()
main [True, False] = ()
main _ = ()
| |
ef4f4a3ab16092cff35d784574f2dfed884393813374fa9924a4c85d0689c0cc | cyverse-archive/DiscoveryEnvironmentBackend | users.clj | (ns metadactyl.service.users
(:use [metadactyl.util.conversions :only [remove-nil-vals]])
(:require [kameleon.queries :as kq]
[metadactyl.persistence.users :as up]))
(defn by-id
[{:keys [ids]}]
{:users (mapv remove-nil-vals (up/by-id ids))})
(defn authenticated
[{:keys [username]}]
(remove-nil... | null | https://raw.githubusercontent.com/cyverse-archive/DiscoveryEnvironmentBackend/7f6177078c1a1cb6d11e62f12cfe2e22d669635b/services/metadactyl-clj/src/metadactyl/service/users.clj | clojure | (ns metadactyl.service.users
(:use [metadactyl.util.conversions :only [remove-nil-vals]])
(:require [kameleon.queries :as kq]
[metadactyl.persistence.users :as up]))
(defn by-id
[{:keys [ids]}]
{:users (mapv remove-nil-vals (up/by-id ids))})
(defn authenticated
[{:keys [username]}]
(remove-nil... | |
fe91ec77ac02d3660fd682709d37f1969688ac28861c0ff33ef8879d11b467f6 | mpickering/apply-refact | Test14.hs | type Ann_Test = Int | null | https://raw.githubusercontent.com/mpickering/apply-refact/a4343ea0f4f9d8c2e16d6b16b9068f321ba4f272/tests/examples/Test14.hs | haskell | type Ann_Test = Int | |
b9dab9773ddfc7ec194ad3a3de8b6c908f627760d4606e9d09594620891c5c06 | pedestal/samples | user.clj | (defn dev
[]
(require 'dev)
(in-ns 'dev)
#_(dev/start)) | null | https://raw.githubusercontent.com/pedestal/samples/caaf04afe255586f8f4e1235deeb0c1904179355/server-sent-events/dev/user.clj | clojure | (defn dev
[]
(require 'dev)
(in-ns 'dev)
#_(dev/start)) | |
f357897ef8b5729b5a6bd026e483d4ba9b302ac938b35a64e3a86f084fa9b4bf | afainer/cleven | shader.lisp | Copyright ( c ) 2015 - 2016 , < >
;;;
;;; Permission is hereby granted, free of charge, to any person obtaining
;;; a copy of this software and associated documentation files (the
" Software " ) , to deal in the Software without restriction , including
;;; without limitation the rights to use, copy, modify, merg... | null | https://raw.githubusercontent.com/afainer/cleven/24e3102f01c4f18152b2618c994aa7b6a7598755/shader.lisp | lisp |
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
without limitation the rights to use, copy, modify, merge, publish,
the following conditions:
The above copyright notice and this permission notice shall be
EXPRESS OR IMPLIED, ... | Copyright ( c ) 2015 - 2016 , < >
" Software " ) , to deal in the Software without restriction , including
distribute , sublicense , and/or sell copies of the Software , and to
permit persons to whom the Software is furnished to do so , subject to
included in all copies or substantial portions of the Softw... |
fc20adcc6dd8c5efe46fd1e210ad61ad3c7bc8cd704d5904377a69996d9ea251 | rtoy/cmucl | ops.lisp | ;
;************************************************************************
;
VPS2 -- Interpreter for
;
;
;
This Common Lisp version of is in the public domain . It is based
in part on based on a implementation done by
at Carnegie - Mellon University , which was placed in the public domain by
the aut... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/contrib/ops/ops.lisp | lisp |
************************************************************************
This code is made available is, and without warranty of any kind by the
Allows ^ , { , and } operators to be right next to another symbol. | VPS2 -- Interpreter for
This Common Lisp version of is in the public domain . It is based
in part on based on a implementation done by
at Carnegie - Mellon University , which was placed in the public domain by
the author in accordance with CMU policies . This version has been
modified by , , ... |
fcb44cd82aec3c6711557d7a42007acdcd3d719eb6d8bdfbf40486bd9c96bcd9 | inhabitedtype/ocaml-aws | cancelExportTask.ml | open Types
open Aws
type input = CancelExportTaskMessage.t
type output = ExportTask.t
type error = Errors_internal.t
let service = "rds"
let signature_version = Request.V4
let to_http service region req =
let uri =
Uri.add_query_params
(Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_of service r... | null | https://raw.githubusercontent.com/inhabitedtype/ocaml-aws/b6d5554c5d201202b5de8d0b0253871f7b66dab6/libraries/rds/lib/cancelExportTask.ml | ocaml | open Types
open Aws
type input = CancelExportTaskMessage.t
type output = ExportTask.t
type error = Errors_internal.t
let service = "rds"
let signature_version = Request.V4
let to_http service region req =
let uri =
Uri.add_query_params
(Uri.of_string (Aws.Util.of_option_exn (Endpoints.url_of service r... | |
57d318afc1505e4d98784b9ee044ba95915e326a0bd14ba2f637c9dcc0d59ac9 | Verites/verigraph | GXLPreProcessing.hs | module XML.GPRReader.GXLPreProcessing
( processTypeGraph
, processRuleGraph
, ElementCondition (..)
, NodeId
, NodeTypeId
, EdgeId
, EdgeTypeId
, EdgeType
, ProcessedNode
, ProcessedEdge
, ProcessedTypeGraph
) where
import Data.List (delete, isPrefixOf, partition)
impo... | null | https://raw.githubusercontent.com/Verites/verigraph/754ec08bf4a55ea7402d8cd0705e58b1d2c9cd67/src/library/XML/GPRReader/GXLPreProcessing.hs | haskell | rule types
type graph types
process type graph | module XML.GPRReader.GXLPreProcessing
( processTypeGraph
, processRuleGraph
, ElementCondition (..)
, NodeId
, NodeTypeId
, EdgeId
, EdgeTypeId
, EdgeType
, ProcessedNode
, ProcessedEdge
, ProcessedTypeGraph
) where
import Data.List (delete, isPrefixOf, partition)
impo... |
3b35f209dda8febac3a96e9e68ab82e60a10c9164d033bd1a2c441be8e75e65f | tsloughter/kuberl | kuberl_v2beta2_pods_metric_source.erl | -module(kuberl_v2beta2_pods_metric_source).
-export([encode/1]).
-export_type([kuberl_v2beta2_pods_metric_source/0]).
-type kuberl_v2beta2_pods_metric_source() ::
#{ 'metric' := kuberl_v2beta2_metric_identifier:kuberl_v2beta2_metric_identifier(),
'target' := kuberl_v2beta2_metric_target:kuberl_v2beta2_met... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v2beta2_pods_metric_source.erl | erlang | -module(kuberl_v2beta2_pods_metric_source).
-export([encode/1]).
-export_type([kuberl_v2beta2_pods_metric_source/0]).
-type kuberl_v2beta2_pods_metric_source() ::
#{ 'metric' := kuberl_v2beta2_metric_identifier:kuberl_v2beta2_metric_identifier(),
'target' := kuberl_v2beta2_metric_target:kuberl_v2beta2_met... | |
5102365f7ddb8d79cba3be142ee726554cbd627c28fd1aecf6551ef03bccd498 | eslick/cl-registry | smtp.lisp | (in-package :registry)
(defvar *inhibit-smtp* nil)
(defvar *smtp-host* nil)
(defvar *smtp-authentication* '(:unknown))
(defparameter *lamsight-reply-to* "")
(defparameter *ilr-reply-to* "")
(defun site-email-smtp-host ()
(or *smtp-host*
(setq *smtp-host* (get-site-config-param :email-smtp-host))
(err... | null | https://raw.githubusercontent.com/eslick/cl-registry/d4015c400dc6abf0eeaf908ed9056aac956eee82/src/plugins/email/smtp.lisp | lisp | We should rely only on the email admin address set in site config
We can fall back on known addresses for Registry applications
(log-message :email :debug "Inhibited mail with subject ~s to ~s" subject
addresses)
EMAIL-TO-USERS-P config param value is one of: NIL, T, a user class, or list of user classe... | (in-package :registry)
(defvar *inhibit-smtp* nil)
(defvar *smtp-host* nil)
(defvar *smtp-authentication* '(:unknown))
(defparameter *lamsight-reply-to* "")
(defparameter *ilr-reply-to* "")
(defun site-email-smtp-host ()
(or *smtp-host*
(setq *smtp-host* (get-site-config-param :email-smtp-host))
(err... |
4c26c6a8f43041abe21d890076165a8cc73e5f651870bfd2b1529e0d9ea880d0 | DerekCuevas/interview-cake-clj | list.clj | (ns reverse-linked-list.list
(:gen-class))
(defn node [value]
{:value value :next nil})
(defn insert [head value]
(if (empty? head)
(node value)
(assoc (node value) :next head)))
(defn coll->list [coll]
(reduce insert {} (reverse coll)))
| null | https://raw.githubusercontent.com/DerekCuevas/interview-cake-clj/f17d3239bb30bcc17ced473f055a9859f9d1fb8d/reverse-linked-list/src/reverse_linked_list/list.clj | clojure | (ns reverse-linked-list.list
(:gen-class))
(defn node [value]
{:value value :next nil})
(defn insert [head value]
(if (empty? head)
(node value)
(assoc (node value) :next head)))
(defn coll->list [coll]
(reduce insert {} (reverse coll)))
| |
751d80f4053d654f1816067469d0ee2cbdd39bfbe15e076b411e0b464635f98d | wdhowe/clojure-snippets | queue.clj | ;; Protocol and Functions for creating queues.
;; Supports creating an immutable queue, `queue` or atom based queue, `aqueue.
(defprotocol persistent-queue
"Persistent queue protocol."
(-enqueue [q items] "Add an item or items to the rear of the queue.")
(dequeue [q] "Removes an item from the front of the queue.... | null | https://raw.githubusercontent.com/wdhowe/clojure-snippets/d24365e1576d577be20fb5f3700609ea9ab75cdc/data_structures/queue.clj | clojure | Protocol and Functions for creating queues.
Supports creating an immutable queue, `queue` or atom based queue, `aqueue. |
(defprotocol persistent-queue
"Persistent queue protocol."
(-enqueue [q items] "Add an item or items to the rear of the queue.")
(dequeue [q] "Removes an item from the front of the queue.")
(front [q] "Get the front item from the queue.")
(rear [q] "Get the item from the rear of the queue."))
(extend-protoc... |
32b10a800456b5578c73766859d842745efeb64108747d1aa3fdd9bbf346f4b1 | deadpendency/deadpendency | NuGetSpec.hs | # OPTIONS_GHC -fno - warn - orphans #
module Effect.FetchRegistryRepoInfo.Backend.LanguageRegistryFiles.NuGetSpec (spec) where
import Common.Model.Dependency.DependencyName
import Common.Model.Dependency.Registry.DependencyRegistryInfo
import Common.Model.Dependency.Registry.RegistryAlivenessStatus
import Common.Mode... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/dependency-fetcher/test/Effect/FetchRegistryRepoInfo/Backend/LanguageRegistryFiles/NuGetSpec.hs | haskell | # OPTIONS_GHC -fno - warn - orphans #
module Effect.FetchRegistryRepoInfo.Backend.LanguageRegistryFiles.NuGetSpec (spec) where
import Common.Model.Dependency.DependencyName
import Common.Model.Dependency.Registry.DependencyRegistryInfo
import Common.Model.Dependency.Registry.RegistryAlivenessStatus
import Common.Mode... | |
55942705e81356874acc8aaaaf8467cc3f742cab744289820db6bcb40d4e8a86 | armedbear/abcl | compile-file.lisp | ;;; compile-file.lisp
;;;
Copyright ( C ) 2004 - 2006
$ Id$
;;;
;;; This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License
as published by the Free Software Foundation ; either version 2
of the License , or ( at your option ) any later versi... | null | https://raw.githubusercontent.com/armedbear/abcl/ab3912a5e231ef7dbe67db9c6e4be635042845bc/src/org/armedbear/lisp/compile-file.lisp | lisp | compile-file.lisp
This program is free software; you can redistribute it and/or
either version 2
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public Licen... | Copyright ( C ) 2004 - 2006
$ Id$
modify it under the terms of the GNU General Public License
of the License , or ( at your option ) any later version .
You should have received a copy of the GNU General Public License
Foundation , Inc. , 59 Temple Place - Suite 330 , Boston , MA 02111 - 1307 , USA .
(... |
d1708aa1f8f7b6e3fb70d787ad890779054f2af4a2b0ca10c2b536afc599c6f0 | namin/logically | picalc.clj | (ns logically.nominal.picalc
(:refer-clojure :exclude [==])
(:use [clojure.core.logic :exclude [is] :as l]
[clojure.core.logic.nominal :exclude [fresh hash] :as nom])
)
Inspired by The pi - calculus operational semantics example of alphaProlog
;; /
(defn symbolo [x]
(predc x symbol? `symbol?))
(defn ... | null | https://raw.githubusercontent.com/namin/logically/49e814e04ff0f5f20efa75122c0b869e400487ac/src/logically/nominal/picalc.clj | clojure | / | (ns logically.nominal.picalc
(:refer-clojure :exclude [==])
(:use [clojure.core.logic :exclude [is] :as l]
[clojure.core.logic.nominal :exclude [fresh hash] :as nom])
)
Inspired by The pi - calculus operational semantics example of alphaProlog
(defn symbolo [x]
(predc x symbol? `symbol?))
(defn nomo ... |
bf54e8546d27d78838fd92dd48f27fda47eebb86ddac982c19aed58375555507 | lmj/lparallel | slet.lisp | Copyright ( c ) 2014 , . All rights reserved .
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; * Redistributions of source code must retain the above copyright
;;; notice, this list of c... | null | https://raw.githubusercontent.com/lmj/lparallel/9c11f40018155a472c540b63684049acc9b36e15/src/slet.lisp | lisp |
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Redistributions in binary... | Copyright ( c ) 2014 , . All rights reserved .
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
HOLDER OR FOR ANY DIRECT , INDIRECT , INCIDENTAL ,
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT
THEORY OF LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR T... |
454e8f0b7983bee75302f1b655fa5e13f97c694ced331798f3d296312ee5944e | PrincetonUniversity/lucid | Preprocess.ml | open Batteries
open CoreSyntax
open InterpCore
open InterpState
open Collections
type t =
{ events : (event_sort * ty list) Env.t
; externs : ty Env.t
; extern_funs : IdSet.t
}
let empty =
{ events = Env.empty
; externs =
Env.singleton
(Id Builtins.recirc_id)
(SyntaxToCore.translate_... | null | https://raw.githubusercontent.com/PrincetonUniversity/lucid/99d39519e81826c5f9e66dfd5d897dd33422944e/src/lib/midend/interpreter/Preprocess.ml | ocaml | Remove and process declarations which we can/must do beforehand --
extern/event declarations, and precompute size values | open Batteries
open CoreSyntax
open InterpCore
open InterpState
open Collections
type t =
{ events : (event_sort * ty list) Env.t
; externs : ty Env.t
; extern_funs : IdSet.t
}
let empty =
{ events = Env.empty
; externs =
Env.singleton
(Id Builtins.recirc_id)
(SyntaxToCore.translate_... |
78fc336da91ee3c5bcfed4f5a94f09d30503c211a331633e1b6e4df06f6c6e8e | janestreet/universe | pre_sexp.ml | Sexp : Module for handling S - expressions ( I / O , etc . )
open Format
open Bigarray
module Sexplib = Sexplib0
module Conv = Sexplib.Sexp_conv
(* conv.ml depends on us so we can only use this module *)
include Type
type bigstring = (char, int8_unsigned_elt, c_layout) Array1.t
include (
Sexplib.Sexp :
mod... | null | https://raw.githubusercontent.com/janestreet/universe/b6cb56fdae83f5d55f9c809f1c2a2b50ea213126/sexplib/src/pre_sexp.ml | ocaml | conv.ml depends on us so we can only use this module
Output of S-expressions to I/O-channels
Output of S-expressions to file
The temp file functions in the OCaml Filename module do not support
permissions. But opening a file with given permissions is different
from opening it and chmoding it to these perm... | Sexp : Module for handling S - expressions ( I / O , etc . )
open Format
open Bigarray
module Sexplib = Sexplib0
module Conv = Sexplib.Sexp_conv
include Type
type bigstring = (char, int8_unsigned_elt, c_layout) Array1.t
include (
Sexplib.Sexp :
module type of struct
include Sexplib.Sexp
end
with ty... |
ac98ff770db6e9d6b744db913cf4f5be31a902cc901236cce2bcc682f2fed174 | andersfugmann/amqp-client | queue_test.ml | open Amqp
open Thread
let uniq s =
Printf.sprintf "%s_%d_%s" (Filename.basename Sys.argv.(0)) (Unix.getpid ()) s
let handler var { Message.message = (_, body); _ } = Ivar.fill var body; return ()
let test =
let port = Sys.getenv_opt "AMQP_PORT" |> function Some port -> Some (int_of_string port) | None -> None in... | null | https://raw.githubusercontent.com/andersfugmann/amqp-client/2932a69510af550e9e156ed479f4fca7daee31cc/async/test/queue_test.ml | ocaml | open Amqp
open Thread
let uniq s =
Printf.sprintf "%s_%d_%s" (Filename.basename Sys.argv.(0)) (Unix.getpid ()) s
let handler var { Message.message = (_, body); _ } = Ivar.fill var body; return ()
let test =
let port = Sys.getenv_opt "AMQP_PORT" |> function Some port -> Some (int_of_string port) | None -> None in... | |
20f8fb3b731bbf1564ae8989a291b8c9ad5ce0c1ac6c4551b5510d93ab95b9e4 | davidkellis/stocktrader_clojure | buyandhold.clj | (ns buyandhold
(:use net.jeffhui.mongodb
strategyutils
[pricehistory :only (price-close price-close-seq load-price-histories price-history-contains? enough-price-history?)]
[portfolio :only (buy-amap sell-all hold-shares?)]
[schedule :only (soonest-scheduled-time weekday-hours)]
... | null | https://raw.githubusercontent.com/davidkellis/stocktrader_clojure/804cc2e94eb83c6fa9e6979eab37780722cf4b06/buyandhold.clj | clojure | adjusted-start-dt start-dt
ph-date-span (interval-between adjusted-start-dt end-dt)
ph-files (filter #(price-history-contains? % ph-date-span) filenames)
ph-files filenames
just to be safe
(print-results trial-set-result-pairs)
(insert-docs trial-set-result-pairs)))
Only run the application automatically if run... | (ns buyandhold
(:use net.jeffhui.mongodb
strategyutils
[pricehistory :only (price-close price-close-seq load-price-histories price-history-contains? enough-price-history?)]
[portfolio :only (buy-amap sell-all hold-shares?)]
[schedule :only (soonest-scheduled-time weekday-hours)]
... |
312dad4f4327c97b2709553040c56a08f0a853afc1fb0a315e18d7fdde17322b | clojurewerkz/statistiker | distribution.clj | (ns clojurewerkz.statistiker.distribution
(:import [org.apache.commons.math3.distribution
NormalDistribution
LogNormalDistribution
MultivariateNormalDistribution
PoissonDistribution
BinomialDistribution
ChiSquaredDistribution
Exponent... | null | https://raw.githubusercontent.com/clojurewerkz/statistiker/f056f68c975cf3d6e0f1c8212aef9114d4eb657c/src/clj/clojurewerkz/statistiker/distribution.clj | clojure | (ns clojurewerkz.statistiker.distribution
(:import [org.apache.commons.math3.distribution
NormalDistribution
LogNormalDistribution
MultivariateNormalDistribution
PoissonDistribution
BinomialDistribution
ChiSquaredDistribution
Exponent... | |
2b2da543b80e4da90b8712c7dea1746106dc80361482dbae405c7decf654ffcc | atdixon/me.untethr.nostr-relay | app.clj | (ns me.untethr.nostr.app
(:require
[clojure.java.io :as io]
[clojure.tools.logging :as log]
[me.untethr.nostr.common :as common]
[me.untethr.nostr.conf :as conf]
[me.untethr.nostr.crypt.crypt :as crypt]
[me.untethr.nostr.extra :as extra]
[me.untethr.nostr.fulfill :as fulfill]
[me.untet... | null | https://raw.githubusercontent.com/atdixon/me.untethr.nostr-relay/33be020d03c468e19a91a1900662c034b4e94a5f/src/me/untethr/nostr/app.clj | clojure | important: req-id may be null
careful here! we're stitching the json ourselves b/c we have the raw event:
important: req-id may be null
@see -protocol/nips/blob/master/20.md
success
these are otherwise producing too many logs
completely unexpected but here to protect outgoing-messages tally
but if they do, shou... | (ns me.untethr.nostr.app
(:require
[clojure.java.io :as io]
[clojure.tools.logging :as log]
[me.untethr.nostr.common :as common]
[me.untethr.nostr.conf :as conf]
[me.untethr.nostr.crypt.crypt :as crypt]
[me.untethr.nostr.extra :as extra]
[me.untethr.nostr.fulfill :as fulfill]
[me.untet... |
ecd04bc942f938ab055da12d24c99aed7dfa45cc3279edbe38f4aab6cc7708cd | fourmolu/fourmolu | specialize-four-out.hs | foo :: (Num a) => a -> a
foo = id
{-# SPECIALIZE foo :: Int -> Int #-}
{-# SPECIALIZE INLINE foo :: Float -> Float #-}
# SPECIALIZE NOINLINE [ 2 ] bar : : Int - > Int #
bar :: (Num a) => a -> a
bar = id
baz :: (Num a) => a -> a
baz = id
{-# SPECIALIZE [~2] baz ::
Int ->
Int
#-}
{-# SPECIALIZE fits13Bits ... | null | https://raw.githubusercontent.com/fourmolu/fourmolu/f47860f01cb3cac3b973c5df6ecbae48bbb4c295/data/examples/declaration/signature/specialize/specialize-four-out.hs | haskell | # SPECIALIZE foo :: Int -> Int #
# SPECIALIZE INLINE foo :: Float -> Float #
# SPECIALIZE [~2] baz ::
Int ->
Int
#
# SPECIALIZE fits13Bits :: Int -> Bool, Integer -> Bool # | foo :: (Num a) => a -> a
foo = id
# SPECIALIZE NOINLINE [ 2 ] bar : : Int - > Int #
bar :: (Num a) => a -> a
bar = id
baz :: (Num a) => a -> a
baz = id
# SPECIALIZE fits13Bits : :
Int - >
Bool
, Integer - > Bool
#
Int ->
Bool
, Integer -> Bool
#-}
fits13Bits :: (Integral a) =>... |
ef83699c2320dbfbe99483ec91eecee80b48241de3d6c842de2e01b4e712721e | ocaml/odoc | compile.mli |
* Copyright ( c ) 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/ocaml/odoc/92b3f1dcc136bceb0a53f8baff5e462800b18b17/src/odoc/compile.mli | ocaml | * Produces .odoc files out of [.cm{i,t,ti}] or .mld files. |
* Copyright ( c ) 2014 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... |
1a28e78141be5b67d5b5039f3011f0c30ffd90955e6e3b30ac476a6746b08ffb | EligiusSantori/L2Apf | party_invite.scm | (module logic racket/base
(require
"../packet/game/client/ask_join_party.scm"
(only-in "../system/connection.scm" send-packet)
)
(provide party-invite)
(define (party-invite cn name [loot 'finder])
(send-packet cn (game-client-packet/ask-join-party name loot))
)
)
| null | https://raw.githubusercontent.com/EligiusSantori/L2Apf/30ffe0828e8a401f58d39984efd862c8aeab8c30/api/party_invite.scm | scheme | (module logic racket/base
(require
"../packet/game/client/ask_join_party.scm"
(only-in "../system/connection.scm" send-packet)
)
(provide party-invite)
(define (party-invite cn name [loot 'finder])
(send-packet cn (game-client-packet/ask-join-party name loot))
)
)
| |
d193b9d5ebd90fb7372d7032e76bd02178f0ed462a9d50995dc0cd3f68ef3865 | ocsigen/tuto | server.ml | open Eliom_content.Html5.D
open Common
open Lwt
module My_app =
Eliom_registration.App (
struct
let application_name = "graffiti"
end)
let rgb_from_string color = (* color is in format "#rrggbb" *)
let get_color i =
(float_of_string ("0x"^(String.sub color (1+2*i) 2))) /. 255.
in
try get_col... | null | https://raw.githubusercontent.com/ocsigen/tuto/0ab40bc09851b6f106d20258866df7d6bc179ad3/tutos/7.0/manual/files/tutorial/chapter3/multigraffiti/server.ml | ocaml | color is in format "#rrggbb"
Set thickness of brush
Apply the ink
Output a PNG in a string
we add an int parameter for the browser not to cache the image:
at least for chrome, there is no way to force the browser to
reload the image without leaving the application
create a new bus and image_str... | open Eliom_content.Html5.D
open Common
open Lwt
module My_app =
Eliom_registration.App (
struct
let application_name = "graffiti"
end)
let get_color i =
(float_of_string ("0x"^(String.sub color (1+2*i) 2))) /. 255.
in
try get_color 0, get_color 1, get_color 2 with | _ -> 0.,0.,0.
let launch... |
c89f5bf63be4f29401bd98a1dc098bd2e7ba7e633342ee8d7c3decf0997e5094 | fulcro-legacy/fulcro-tutorial | E_UI_Queries_and_State.cljs | (ns fulcro-tutorial.E-UI-Queries-and-State
(:require-macros [cljs.test :refer [is]])
(:require [fulcro.client.primitives :as prim]
[fulcro.client.impl.parser :as p]
[fulcro-tutorial.queries.query-editing :as qe]
[fulcro.client.dom :as dom]
[cljs.reader :as r]
... | null | https://raw.githubusercontent.com/fulcro-legacy/fulcro-tutorial/fe9bcd19908d4e24e723954e3804ceccfd07e989/src/tutorial/fulcro_tutorial/E_UI_Queries_and_State.cljs | clojure | or in lambda form (fn [] [:db/id :person/name])
or in lambda form (fn [] [:person/by-id id]) | (ns fulcro-tutorial.E-UI-Queries-and-State
(:require-macros [cljs.test :refer [is]])
(:require [fulcro.client.primitives :as prim]
[fulcro.client.impl.parser :as p]
[fulcro-tutorial.queries.query-editing :as qe]
[fulcro.client.dom :as dom]
[cljs.reader :as r]
... |
07ed8d893ff89a088428c93f152cd8bfcf410925a3cff51b3a5274a6d8b979fa | yitzchak/common-lisp-jupyter | overrides.lisp | (in-package #:jupyter/common-lisp)
#+sbcl
(sb-ext:without-package-locks
(defun sb-impl::inspect (object)
(let ((*standard-input* *query-io*)
(*standard-output* *query-io*))
(funcall sb-impl::*inspect-fun* object *query-io* *query-io*))))
| null | https://raw.githubusercontent.com/yitzchak/common-lisp-jupyter/a1dc775e4116ab61b34530fe33f3e27291d937f4/src/cl-jupyter/overrides.lisp | lisp | (in-package #:jupyter/common-lisp)
#+sbcl
(sb-ext:without-package-locks
(defun sb-impl::inspect (object)
(let ((*standard-input* *query-io*)
(*standard-output* *query-io*))
(funcall sb-impl::*inspect-fun* object *query-io* *query-io*))))
| |
0ca951ddbb92a35913814ccf867fecd7be53fc6071851bde6ac909e87304a0fe | zkat/chanl | queues.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Base : 10 ; indent - tabs - mode : nil -*-
;;;;
Copyright © 2009 ,
;;;;
;;;; Simple Queues
;;;;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; The functions in this file are dangerous. Good compilers wil... | null | https://raw.githubusercontent.com/zkat/chanl/3a0ad5b9ae31b3874ac91c541fd997123c2e03db/src/queues.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 ; indent - tabs - mode : nil -*-
Simple Queues
The functions in this file are dangerous. Good compilers will generate code that will
do VERY funky shit when called incorrectly. Calls to these functions should be hidden
behind safe code that never passes arguments o... | Copyright © 2009 ,
Unlike the standard queue implementation which you find in CL code ( push to the tail of
This one matters for performance , but not THAT much :
(in-package :chanl)
(define-condition queue-condition (error)
((queue :reader queue-condition-queue :initarg :queue))
(:report (lambda ... |
252b69450d075360ec1ce28535fe1dba136258f700dd5648582a78fa9e25a0e8 | hyperfiddle/electric | laziness.clj | (defnode persons [db needle & [sort-order]]
(sort (or sort-order <)
(datomic.api/q '[:find [?e ...] :in $ ?needle :where
[?e :person/email ?email]
[(clojure.string/includes? ?email ?needle)]]
db (or needle ""))))
(defnode render-persons... | null | https://raw.githubusercontent.com/hyperfiddle/electric/1c6c3891cbf13123fef8d33e6555d300f0dac134/scratch/dustin/y2021/photon/laziness.clj | clojure | eductions are lazy and not memoized
L: dynamic vars are broken
D,G: make lazy things in an eager lang is broken | (defnode persons [db needle & [sort-order]]
(sort (or sort-order <)
(datomic.api/q '[:find [?e ...] :in $ ?needle :where
[?e :person/email ?email]
[(clojure.string/includes? ?email ?needle)]]
db (or needle ""))))
(defnode render-persons... |
2071d262f01d730735a82e9ca7fdcd75da82978f99a3279d0273339167b181b2 | REMath/mit_16.399 | variables.ml | (* variables.ml *)
open Symbol_Table
type variable = Symbol_Table.variable
let number_of_variables = number_of_variables
let for_all_variables = for_all_variables
let print_variable = print_variable
let map_variables = map_variables
let string_of_variable = string_of_variable
| null | https://raw.githubusercontent.com/REMath/mit_16.399/3f395d6a9dfa1ed232d307c3c542df3dbd5b614a/project/Generic-FW-BW-REL-Abstract-Interpreter/variables.ml | ocaml | variables.ml | open Symbol_Table
type variable = Symbol_Table.variable
let number_of_variables = number_of_variables
let for_all_variables = for_all_variables
let print_variable = print_variable
let map_variables = map_variables
let string_of_variable = string_of_variable
|
61bbff459acb209e867572aabe26aca3468c33d812f2653783da55838f0a4ea8 | google/codeworld | Color.hs | {-# LANGUAGE PackageImports #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RebindableSyntax #
# LANGUAGE ViewPatterns #
# LANGUAGE NoImplicitPrelude #
Copyright 2020 The CodeWorld Authors . All rights reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file e... | null | https://raw.githubusercontent.com/google/codeworld/77b0863075be12e3bc5f182a53fcc38b038c3e16/codeworld-base/src/Internal/Color.hs | haskell | # LANGUAGE PackageImports #
| A color.
Colors can be described in several ways:
'orange', 'purple', 'pink', 'black', 'white', 'brown', and
'gray'.
'dark', 'bright', 'dull', 'translucent', and 'mixed'.
Note that transparency is included in a color. Common color
colors, but 'RGBA' and the 'translucent... | # LANGUAGE PatternSynonyms #
# LANGUAGE RebindableSyntax #
# LANGUAGE ViewPatterns #
# LANGUAGE NoImplicitPrelude #
Copyright 2020 The CodeWorld Authors . All rights reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the Lic... |
7788d1493604e261a9c7ca01986461c6c3f78be011ba36c2b2a51f2482d9c649 | helium/packet-purchaser | pp_console_ws_manager.erl | %%%-------------------------------------------------------------------
%% @doc
%% == Packet Purchaser Console WS Manager ==
%%
%% - Gets the console token with a backoff
%% - Starts websocket connection when token is received successfully
%%
%% @end
%%%-------------------------------------------------------------------... | null | https://raw.githubusercontent.com/helium/packet-purchaser/51fd632e19953beaba7a01bcbe3748a399fb3161/src/apis/pp_console_ws_manager.erl | erlang | -------------------------------------------------------------------
@doc
== Packet Purchaser Console WS Manager ==
- Gets the console token with a backoff
- Starts websocket connection when token is received successfully
@end
-------------------------------------------------------------------
------------------... | -module(pp_console_ws_manager).
-behavior(gen_server).
-export([
start_link/1,
get_token/0,
start_ws/0,
restart_ws/0
]).
gen_server Function Exports
-export([
init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
handle_continue/2,
terminate/2,
code_change/3
]).
-define(... |
c99a8c4876a286369141bad21ae8350989bf760fc2d9d2eea21c4c04f368ef10 | discus-lang/ddc | VT100.hs | {-# OPTIONS -fno-warn-missing-signatures #-}
| Generation of VT100 terminal control codes .
module DDC.War.Interface.VT100
( Color(..), codeOfColor
, Mode (..), codeOfMode
, ModeState (..), modeStateInit, applyMode
, eraseDisplay
, eraseLin... | null | https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-tools/src/ddc-war/DDC/War/Interface/VT100.hs | haskell | # OPTIONS -fno-warn-missing-signatures #
Color ----------------------------------------------------------------------
| VT100 / ANSI colors
| Control code offset for rendering colors.
Mode -----------------------------------------------------------------------
| Rendering mode commands.
| Control codes for render... | | Generation of VT100 terminal control codes .
module DDC.War.Interface.VT100
( Color(..), codeOfColor
, Mode (..), codeOfMode
, ModeState (..), modeStateInit, applyMode
, eraseDisplay
, eraseLine
, setCursorPos
, moveCursor... |
9823117e837c65737ec14cb149f7739a0fbc697305c14da4083940a5073ee2ba | commercialhaskell/stack | Main.hs | import StackTest
import System.Directory
import Control.Exception (catch, IOException)
main :: IO ()
main = do
removeFileIgnore "stack.yaml"
createDirectory "unreachabledir" `catch` \(e :: IOException) -> pure ()
setPermissions "unreachabledir" emptyPermissions
stack ["init"]
| null | https://raw.githubusercontent.com/commercialhaskell/stack/80429690da92c634cb129f99f1507dbc47a70d45/test/integration/tests/skip-unreachable-dirs/Main.hs | haskell | import StackTest
import System.Directory
import Control.Exception (catch, IOException)
main :: IO ()
main = do
removeFileIgnore "stack.yaml"
createDirectory "unreachabledir" `catch` \(e :: IOException) -> pure ()
setPermissions "unreachabledir" emptyPermissions
stack ["init"]
| |
5215e4b6dec03ded2ad65cf453c16344dd5b989753d5f26a5fb967c6e2d2bdf1 | pdfkit/pdfkit-clj | project.clj | (defproject pdfkit-clj "0.1.7"
:description "Generates PDFs using wkhtmltopdf"
:url "-inc/pdfkit-clj"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[enlive "1.1.2"]
[clj-http "3.7.0"]
[clj-ti... | null | https://raw.githubusercontent.com/pdfkit/pdfkit-clj/0b024ad22ba60bda8907ba4e67b321c356f82cb9/project.clj | clojure | (defproject pdfkit-clj "0.1.7"
:description "Generates PDFs using wkhtmltopdf"
:url "-inc/pdfkit-clj"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[enlive "1.1.2"]
[clj-http "3.7.0"]
[clj-ti... | |
bb4368c3f4d4f70fdec963a9f3930d01f68e15e94d8def973673828334baaf32 | EwenG/replique | ns_mappings_cljs_test2.cljs | (ns replique.compliment.ns-mappings-cljs-test2
(:require [goog.object]))
(def ff2 "ff2")
(goog.object/get #js {:e "e"} "e")
(comment
(goog.object/get #js {:e "e"} :e)
)
| null | https://raw.githubusercontent.com/EwenG/replique/38fbc2f824a7bb95d491f845cfdda8da61b089c5/test/replique/compliment/ns_mappings_cljs_test2.cljs | clojure | (ns replique.compliment.ns-mappings-cljs-test2
(:require [goog.object]))
(def ff2 "ff2")
(goog.object/get #js {:e "e"} "e")
(comment
(goog.object/get #js {:e "e"} :e)
)
| |
5427aba73349e3b6e0382ab18667bf2bab87390d7616dea7edd66f452aa9dc2b | mcorbin/meuse | crate_version.clj | (ns meuse.db.actions.crate-version
(:require [meuse.db.actions.crate :as crate-db]
[meuse.db.queries.crate-version :as crate-version-queries]
[meuse.log :as log]
[meuse.message :refer [yanked?->msg]]
[exoscale.ex :as ex]
[next.jdbc :as jdbc]))
(defn update-... | null | https://raw.githubusercontent.com/mcorbin/meuse/d2b74543fce37c8cde770ae6f6097cabb509a804/src/meuse/db/actions/crate_version.clj | clojure | (ns meuse.db.actions.crate-version
(:require [meuse.db.actions.crate :as crate-db]
[meuse.db.queries.crate-version :as crate-version-queries]
[meuse.log :as log]
[meuse.message :refer [yanked?->msg]]
[exoscale.ex :as ex]
[next.jdbc :as jdbc]))
(defn update-... | |
a617d6e66ab979b0649fddd98c928a80820adb1bdcc64f18738f059fcd38914f | GaloisInc/daedalus | DFA.hs | {-# Language GADTs #-}
module Daedalus.ParserGen.LL.DFA
( LinDFAState(..)
, DFA(..)
, DFATransition(..)
, AmbiguityDetection(..)
, lookupLinDFAState
, createAbortDFA
, createDFA
, getFinalStates
, showDFA
, lookupDFA
, DDA(..)
, getFinalStatesDDA
, computeHasFullResolutionDDA
, lookaheadDep... | null | https://raw.githubusercontent.com/GaloisInc/daedalus/25c7c4d3ae0df8094ae804ec3c735f552c757f49/src/Daedalus/ParserGen/LL/DFA.hs | haskell | # Language GADTs #
import Debug.Trace
# UNPACK #
Invariant: the state qState is already member of state mappings.
",q" ++ showSlkCfgWithAut _aut (Closure.lastCfg (dstEntry entry)) ++
The algorithm is a limited form of transitive closure computation
It starts attempting `closureDataDependentOnDFAState` and if not
... |
module Daedalus.ParserGen.LL.DFA
( LinDFAState(..)
, DFA(..)
, DFATransition(..)
, AmbiguityDetection(..)
, lookupLinDFAState
, createAbortDFA
, createDFA
, getFinalStates
, showDFA
, lookupDFA
, DDA(..)
, getFinalStatesDDA
, computeHasFullResolutionDDA
, lookaheadDepth
, revAppend
, pr... |
b63570e95e993c9274bba46deecd94c99376c18aae304a56d4eba36632173ff4 | danr/hipspec | PropT28.hs | module PropT28 where
import Prelude(Bool(..))
import Zeno
-- Definitions
True && x = x
_ && _ = False
False || x = x
_ || _ = True
not True = False
not False = True
-- Nats
data Nat = S Nat | Z
(+) :: Nat -> Nat -> Nat
Z + y = y
(S x) + y = S (x + y)
(*) :: Nat -> Nat -> Nat
Z * _ = Z
(S x) * y = y + (x... | null | https://raw.githubusercontent.com/danr/hipspec/a114db84abd5fee8ce0b026abc5380da11147aa9/testsuite/prod/zeno_version/PropT28.hs | haskell | Definitions
Nats
Lists
Theorem | module PropT28 where
import Prelude(Bool(..))
import Zeno
True && x = x
_ && _ = False
False || x = x
_ || _ = True
not True = False
not False = True
data Nat = S Nat | Z
(+) :: Nat -> Nat -> Nat
Z + y = y
(S x) + y = S (x + y)
(*) :: Nat -> Nat -> Nat
Z * _ = Z
(S x) * y = y + (x * y)
(==),(/=) :: Nat... |
19c4c1b5c30412ec5faa659aa5d1c396a72c2d57c9406275c2b2da743e691daf | nuvla/api-server | data_record_key.clj | (ns sixsq.nuvla.server.resources.data-record-key
"
A `data-record-key` resource provides semantic information concerning a key
that appears in `data-record` resources. This resource is intended to provide
information that helps humans understand the information provided in a
`data-record` resource.
The `name` and `d... | null | https://raw.githubusercontent.com/nuvla/api-server/e4f0535e2e39e5042094fc20bfb811d2a9c75ad5/code/src/sixsq/nuvla/server/resources/data_record_key.clj | clojure |
multimethods for validation and operations
CRUD operations
initialization
| (ns sixsq.nuvla.server.resources.data-record-key
"
A `data-record-key` resource provides semantic information concerning a key
that appears in `data-record` resources. This resource is intended to provide
information that helps humans understand the information provided in a
`data-record` resource.
The `name` and `d... |
c702f48a8cd7b079a0f16103ce58bc4de07555e04d4fe117b748b16224c43635 | Metaxal/bazaar | information-theory.rkt | #lang racket/base
(require define2
(rename-in (only-in racket/base log) [log ln])
math/flonum
racket/contract
racket/function
racket/list)
(provide (all-defined-out) ln)
(module+ test (require rackunit))
(define log (thunk* (error "log should not be used. Use ln or log2 ... | null | https://raw.githubusercontent.com/Metaxal/bazaar/2968178aa62288c8ff41018a42dd306afb458046/information-theory.rkt | racket | Prefix-code for the integers:
encode x from an interval
the code length is -log2(1/(max-min+1))
encode x with a variable length | #lang racket/base
(require define2
(rename-in (only-in racket/base log) [log ln])
math/flonum
racket/contract
racket/function
racket/list)
(provide (all-defined-out) ln)
(module+ test (require rackunit))
(define log (thunk* (error "log should not be used. Use ln or log2 ... |
3b1b0fd9a670cd147a26157be8efa260f240291e44cbc4e79d14d51b1ed90324 | aowens-21/racket-formatting | 99-conds.rkt | #lang racket/base
(require custom-syntax-format/example-forms)
(writeln
(my-cond (#t
(string-append "hello " #;(s-expr comment)
comment 3
(my-cond (else "world"))))
(else (+ 2 3
4)
'|not-h
er
e|)))
| null | https://raw.githubusercontent.com/aowens-21/racket-formatting/00c456066d75ed25dfccaa9bcbf6ffcdfa543849/custom-syntax-format/tests/custom-syntax-format/file-level/99-conds.rkt | racket | (s-expr comment) | #lang racket/base
(require custom-syntax-format/example-forms)
(writeln
(my-cond (#t
comment 3
(my-cond (else "world"))))
(else (+ 2 3
4)
'|not-h
er
e|)))
|
005b9a18d7c51691d2ca595ae5535166aaaf3bf8a95ba810ae055f5879df4f8c | NoRedInk/haskell-libraries | Terminal.hs | module Internal.Terminal (write, read, red, blue, green, magenta, yellow, cyan, lightBlue, black, white, reset, underline, italic, newline, indent, message, header, blank, paragraphs) where
import Basics
import qualified Data.Text
import List (List)
import qualified Text
import qualified Prelude as P
-- |
write :: Te... | null | https://raw.githubusercontent.com/NoRedInk/haskell-libraries/7af1e05549e09d519b08ab49dff956b5a97d4f7e/nri-prelude/src/Internal/Terminal.hs | haskell | |
|
CHARACTERS
MESSAGE
PARAGRAPHS | module Internal.Terminal (write, read, red, blue, green, magenta, yellow, cyan, lightBlue, black, white, reset, underline, italic, newline, indent, message, header, blank, paragraphs) where
import Basics
import qualified Data.Text
import List (List)
import qualified Text
import qualified Prelude as P
write :: Text.Te... |
c8847bb781d418b2f6bf6c872398ad4b2b36fbe8c7edf9d44a10316d801b93d8 | kowainik/smuggler | Main.hs | module Main where
import Data.Bool (Bool (False, True), bool)
import Data.List (sort)
import Data.Maybe (fromMaybe, maybe)
main :: IO ()
main = do
let foo = fromMaybe bool Nothing
print $ (foo undefined undefined undefined :: Int)
print True
-- main = parseFile
| null | https://raw.githubusercontent.com/kowainik/smuggler/b2ddcdad06a270e0b956f2203f9bebcd72301c53/app/Main.hs | haskell | main = parseFile | module Main where
import Data.Bool (Bool (False, True), bool)
import Data.List (sort)
import Data.Maybe (fromMaybe, maybe)
main :: IO ()
main = do
let foo = fromMaybe bool Nothing
print $ (foo undefined undefined undefined :: Int)
print True
|
e18eeb94093fb4dbf8ccd06a49a11e0210f2c4455d9d58eed9a3f712f73d97ca | graninas/The-Amoeba-World | Common.hs | module Amoeba.Middleware.Parsing.Common where
import Amoeba.Middleware.Parsing.ParsecFacade
symbols = "!@#$%^&*()`~-_=+[]{};'\\:\"|,./<>?"
quote = char '"'
underscore = char '_'
trueSpace = char ' ' <|> tab
trueSpaces = many trueSpace
stringConstant :: GenParser Char st String
stringConstant = between quote quote (m... | null | https://raw.githubusercontent.com/graninas/The-Amoeba-World/a147cd4dabf860bec8a6ae1c45c02b030916ddf4/src/Amoeba/Middleware/Parsing/Common.hs | haskell | module Amoeba.Middleware.Parsing.Common where
import Amoeba.Middleware.Parsing.ParsecFacade
symbols = "!@#$%^&*()`~-_=+[]{};'\\:\"|,./<>?"
quote = char '"'
underscore = char '_'
trueSpace = char ' ' <|> tab
trueSpaces = many trueSpace
stringConstant :: GenParser Char st String
stringConstant = between quote quote (m... | |
3bc550036a89fae349f4e3747f3ca0e3b1a2870d87ce295edb01c4c8277be15c | jdevuyst/comprehend | tools_test.clj | (ns comprehend.tools-test
(:require [clojure.test :refer :all]
[comprehend.tools :as ct]))
(def VarType comprehend.engine.Var)
(deftest all-tests
(testing "fixpoints"
(is (= (ct/fixpoint [x 1]
(if (>= x 1000)
x
(* 2 x)))
... | null | https://raw.githubusercontent.com/jdevuyst/comprehend/3b6a7fc933abc04885e68e5c2bcda4932c545ed2/test/comprehend/tools_test.clj | clojure | (ns comprehend.tools-test
(:require [clojure.test :refer :all]
[comprehend.tools :as ct]))
(def VarType comprehend.engine.Var)
(deftest all-tests
(testing "fixpoints"
(is (= (ct/fixpoint [x 1]
(if (>= x 1000)
x
(* 2 x)))
... | |
4d89c970c40b587dd45f25281c1979962bd2afaebc02c883f580cfccf2e63cac | marcoheisig/Typo | type-specifier-ntype.lisp | (in-package #:typo.ntype)
(defmethod type-specifier-ntype (type-specifier)
(multiple-value-bind (expansion expansionp)
(introspect-environment:typexpand-1 type-specifier)
(if expansionp
(type-specifier-ntype expansion)
(find-primitive-ntype type-specifier))))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/marcoheisig/Typo/303e21c38b1773f7d6f87eeb7f03617c286c4a44/code/ntype/type-specifier-ntype.lisp | lisp |
Class as Type Specifiers
Retain the ntype as long as the class exists.
Compound Type Specifiers
Set Theoretic Type Specifiers
Number Type Specifiers
A known lower bound.
Any other valid case
Signed Integers
Unsigned Integers
Array Type Specifiers
Miscellaneous Compound Type Specifiers
Populate the Cac... | (in-package #:typo.ntype)
(defmethod type-specifier-ntype (type-specifier)
(multiple-value-bind (expansion expansionp)
(introspect-environment:typexpand-1 type-specifier)
(if expansionp
(type-specifier-ntype expansion)
(find-primitive-ntype type-specifier))))
(defvar *atomic-type-spe... |
db8e9bb3bcf0f0fc6fb231460760f2b9c8f8810cbdd363020ec7467ae6afb923 | dbuenzli/remat | browser.ml | ---------------------------------------------------------------------------
Copyright 2012 . All rights reserved .
Distributed under the BSD3 license , see license at the end of the file .
% % NAME%% release % % ---------------------------------------------------------------------------
Copyright... | null | https://raw.githubusercontent.com/dbuenzli/remat/28d572e77bbd1ad46bbfde87c0ba8bd0ab99ed28/src-remat/browser.ml | ocaml | split into prefix, postfix, date, page
"Jan";"Feb";"Mar";"Apr";"May";"Jun";"Jul";"Aug";"Sep";"Oct";"Nov";"Dec" | ---------------------------------------------------------------------------
Copyright 2012 . All rights reserved .
Distributed under the BSD3 license , see license at the end of the file .
% % NAME%% release % % ---------------------------------------------------------------------------
Copyright... |
f0ce61f0176d5a89463084759a370555e07ea34d839017ea4f613def9f997a1e | aryx/lfs | ioplugins.ml | open Common
open Lfs
(*****************************************************************************)
(* Purpose *)
(*****************************************************************************)
(* file to plugins, kind of 'eval' as in scheme *)
(*********************************************************************... | null | https://raw.githubusercontent.com/aryx/lfs/b931530c7132b77dfaf3c99d452dc044fce37589/lfs_real/ioplugins.ml | ocaml | ***************************************************************************
Purpose
***************************************************************************
file to plugins, kind of 'eval' as in scheme
***************************************************************************
Types
***************************... | open Common
open Lfs
type idfile = objet
let (uninteract_logic_old: filename -> logic) = fun file ->
fun (Prop s1) (Prop s2) ->
log2 ("logic called:" ^ file ^ ":" ^ s1 ^ ":" ^ s2);
let chan = Unix.open_process_in
in
let x =
match (try input_line chan with End_of_file -> "no output") w... |
cc9c3c0ed88825ae0630bd111def453e9b4d1fa9dbdf32b741abc21d581cf7fc | mwmitchell/flux | update.clj | (ns src.flux.update
(:require [flux.update :refer :all]
[midje.sweet :refer :all]))
(fact "create-doc"
(class (create-doc {:id 1})) => org.apache.solr.common.SolrInputDocument)
| null | https://raw.githubusercontent.com/mwmitchell/flux/855101681cf3c8953cd9607c2287a5b4c282a84e/test/src/flux/update.clj | clojure | (ns src.flux.update
(:require [flux.update :refer :all]
[midje.sweet :refer :all]))
(fact "create-doc"
(class (create-doc {:id 1})) => org.apache.solr.common.SolrInputDocument)
| |
5c6fdfb927779ed5c005d4843589260fae1e47ab81f64a3f3955eaad89c47cb7 | logseq/logseq | editor_test.cljs | (ns frontend.handler.editor-test
(:require [frontend.handler.editor :as editor]
[clojure.test :refer [deftest is testing are]]
[frontend.state :as state]
[frontend.util.cursor :as cursor]))
(deftest extract-nearest-link-from-text-test
(testing "Page, block and tag links"
(is... | null | https://raw.githubusercontent.com/logseq/logseq/350323ad19cc9a55ecb890e576abdcee289b9d16/src/test/frontend/handler/editor_test.cljs | clojure | Default to some commands matching which matches default behavior for most
completion scenarios
Reset editor action in order to test result
Default cursor pos to end of line
Ignore as none of its behaviors are tested
Reset state
Reset editor action in order to test result
Default cursor pos to end of line
ignor... | (ns frontend.handler.editor-test
(:require [frontend.handler.editor :as editor]
[clojure.test :refer [deftest is testing are]]
[frontend.state :as state]
[frontend.util.cursor :as cursor]))
(deftest extract-nearest-link-from-text-test
(testing "Page, block and tag links"
(is... |
004b0645d0c805716fa9c34386d7840472a4ff6c31b5078dc83c8e13ea7ea40c | manuel-serrano/hop | hop.scm | ;*=====================================================================*/
* serrano / prgm / project / hop / hop / hopc / hop.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/hop/7e8ff299947366dbbdf5af0b808257389425c34b/hopc/hop.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* Hop specific utilities */
*===========================... | * serrano / prgm / project / hop / hop / hopc / hop.scm * /
* Author : * /
* Creation : Fri Jun 3 11:52:52 2022 * /
* Last change : Tue Aug 16 09:49:11 2022 ( serrano ) * /
* Cop... |
d62a532f5cae1702926f82a4cbdc48369f3574e7c6a2ab8d1bbbf63c43242cac | the-dr-lazy/cascade | CreateExisting.hs | |
Module : Test . Cascade . Api . StateMachine . Command . User . CreateExisting
Description : ! ! ! INSERT MODULE SHORT DESCRIPTION ! ! !
Copyright : ( c ) 2020 - 2021 Cascade
License : MPL 2.0
Maintainer : < > ( the-dr-lazy.github.io )
Stability : Stable
Portability : POSIX
! ! ... | null | https://raw.githubusercontent.com/the-dr-lazy/cascade/014a5589a2763ce373e8c84a211cddc479872b44/cascade-api/test/Test/Cascade/Api/StateMachine/Command/User/CreateExisting.hs | haskell | |
Module : Test . Cascade . Api . StateMachine . Command . User . CreateExisting
Description : ! ! ! INSERT MODULE SHORT DESCRIPTION ! ! !
Copyright : ( c ) 2020 - 2021 Cascade
License : MPL 2.0
Maintainer : < > ( the-dr-lazy.github.io )
Stability : Stable
Portability : POSIX
! ! ... | |
c1c6381de34ad34a83e57070f5ddd16cbc4cc8b5b4b697f5ddb5599dbd345654 | jbowles/artifact | core.clj | (ns artifact.test.core
(:use [artifact.core])
(:use [clojure.test]))
(deftest replace-me ;; FIXME: write
(is false "No tests have been written."))
| null | https://raw.githubusercontent.com/jbowles/artifact/0c093f5ac4480328fd2a2f42a74cc97ca463f8be/test/artifact/test/core.clj | clojure | FIXME: write | (ns artifact.test.core
(:use [artifact.core])
(:use [clojure.test]))
(is false "No tests have been written."))
|
eb014624c9af1ced0f40c029068d6d4d98337e5ee562925929e415f8ea33f840 | pgourlain/vscode_erlang | vscode_lsp_app_sup.erl | -module(vscode_lsp_app_sup).
-export([init/1, start_link/1, start_sup_socket/1, start_sup_doc/0, start_sup_config/0, start_sup_help/0, start_child/1]).
start_link(VsCodePort) ->
supervisor:start_link({local, ?MODULE}, ?MODULE, VsCodePort).
init(VsCodePort) ->
SocketSpec = socket_spec(VsCodePort),
DocSpec... | null | https://raw.githubusercontent.com/pgourlain/vscode_erlang/0af7641f1f4bcfb587094154d9c18a02fdb437e6/apps/erlangbridge/src/vscode_lsp_app_sup.erl | erlang | permanent, infinity, supervisor, [gen_lsp_doc_sup]}. | -module(vscode_lsp_app_sup).
-export([init/1, start_link/1, start_sup_socket/1, start_sup_doc/0, start_sup_config/0, start_sup_help/0, start_child/1]).
start_link(VsCodePort) ->
supervisor:start_link({local, ?MODULE}, ?MODULE, VsCodePort).
init(VsCodePort) ->
SocketSpec = socket_spec(VsCodePort),
DocSpec... |
8cb7b221e8e4b50bb178a9b6696f9127762630dd225ca5b660147a0049945af5 | nevrome/currycarbon | Main-currycarbon.hs | {-# LANGUAGE OverloadedStrings #-}
import Currycarbon.CLI.RunCalibrate (runCalibrate,
CalibrateOptions (..))
import Currycarbon.Parsers
import Currycarbon.Types
import Currycarbon.Utils
import Paths_currycarbo... | null | https://raw.githubusercontent.com/nevrome/currycarbon/95f06eb50a674844ee2801db7de92abc945624d6/src-executables/Main-currycarbon.hs | haskell | # LANGUAGE OverloadedStrings #
* CLI interface configuration
This module contains the necessary code to configure the currycarbon CLI interface
data types
CLI interface configuration
check stdout encoding for the CLI plot
prepare input parsing
** Input parsing functions
$inputParsing
These functions define... |
import Currycarbon.CLI.RunCalibrate (runCalibrate,
CalibrateOptions (..))
import Currycarbon.Parsers
import Currycarbon.Types
import Currycarbon.Utils
import Paths_currycarbon (version)
impor... |
87be2b761da50c5e280c9fc01e3236ee1eff974ed49e311b12beee9a65d86a0c | 97jaz/gregor | day.rkt | #lang racket/base
(require racket/contract/base
racket/match
"../../generics.rkt"
"../../core/structs.rkt"
"../../core/ymd.rkt"
"../ast.rkt"
"../parse-state.rkt"
"../l10n/numbers.rkt")
(provide (struct-out Day))
(define (day-fmt ast t loc)
(match ast
... | null | https://raw.githubusercontent.com/97jaz/gregor/91d71c6082fec4197aaf9ade57aceb148116c11c/gregor-lib/gregor/private/pattern/ast/day.rkt | racket | #lang racket/base
(require racket/contract/base
racket/match
"../../generics.rkt"
"../../core/structs.rkt"
"../../core/ymd.rkt"
"../ast.rkt"
"../parse-state.rkt"
"../l10n/numbers.rkt")
(provide (struct-out Day))
(define (day-fmt ast t loc)
(match ast
... | |
2f4d7d90b04eb60a74308cacfe58130a3b3270398174e4f3fbd34749209e0bac | kjellwinblad/yaemep | yaemep_SUITE.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB and ( ,
) 2019 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by... | null | https://raw.githubusercontent.com/kjellwinblad/yaemep/b75bedda414776373926a526e2a5e6c3ccace62d/test/yaemep_SUITE.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB and ( ,
) 2019 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(yaemep_SUITE).
Erlang / OTP repository
-export([all/0, init_per_testcase/2, end_per_testcase/2])... |
72740c9c279b5e3095a8879146d4ee6d465ad1482087f8043568d998fc3fb733 | emil0r/ez-web | sidemenu.clj | (ns ez-web.test.sidemenu
(:require [ez-web.sidemenu :refer [sidemenu]]
[hiccup.core :refer [html]]
[midje.sweet :refer :all]))
(fact
"Get a sidemenu"
(html (sidemenu "/foo/bar"
[["/" "Home"]
["/foo" "Foo"
["/foo/bar" "Bar"]
... | null | https://raw.githubusercontent.com/emil0r/ez-web/8c1d9762824bcdac9b1e3afaf02fdd290c13b595/test/ez_web/test/sidemenu.clj | clojure | (ns ez-web.test.sidemenu
(:require [ez-web.sidemenu :refer [sidemenu]]
[hiccup.core :refer [html]]
[midje.sweet :refer :all]))
(fact
"Get a sidemenu"
(html (sidemenu "/foo/bar"
[["/" "Home"]
["/foo" "Foo"
["/foo/bar" "Bar"]
... | |
24d6de929cf50649e28b642a4608bf7e0a5a7317549f74391d6d2c7d9c10ce5c | mdedwards/slippery-chicken | exercises.lsp | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; File: exercises.lsp
;;;
Class Hierarchy : None
;;;
Version : 1.0
;;;
;;; Project: slippery chicken (algorithmic composition)
;;;
;;; Purpose: Lisp example code to accompany exercises.html
;;... | null | https://raw.githubusercontent.com/mdedwards/slippery-chicken/c1c11fadcdb40cd869d5b29091ba5e53c5270e04/doc/examples/exercises.lsp | lisp |
File: exercises.lsp
Project: slippery chicken (algorithmic composition)
Purpose: Lisp example code to accompany exercises.html
****
This file is part of slippery-chicken
slippery-chicken is free software; you can redistribute it
... | Class Hierarchy : None
Version : 1.0
Author :
Creation date : 23rd November 2012
$ $ Last modified : 19:32:05 Tue Feb 26 2019 CET
SVN ID : $ I d : exercises.lsp 5791 2016 - 05 - 24 16:20:03Z medward2 $
Licence : Copyright ( c ) 2012
Public Lic... |
edf9609cd20b87dcb0a1d66791cdde9719fa7df10ae252f348d993dcb5508205 | esumii/min-caml | toomanyargs.ml | (* thanks to *)
exactly one more arguments than registers ; does not copmile
let x = 42 in
let rec f y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 y18 y19 y20 y21 y22 y23 y24 y25 y26 = print_int x in
f 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
| null | https://raw.githubusercontent.com/esumii/min-caml/8860b6fbc50786a27963aff1f7639b94c244618a/test/PowerPC/toomanyargs.ml | ocaml | thanks to | exactly one more arguments than registers ; does not copmile
let x = 42 in
let rec f y1 y2 y3 y4 y5 y6 y7 y8 y9 y10 y11 y12 y13 y14 y15 y16 y17 y18 y19 y20 y21 y22 y23 y24 y25 y26 = print_int x in
f 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26
|
e661db1fb6dba1d891a567904b350a5650f0225d05646de68a958cb7165931e3 | stumpwm/stumpwm | group.lisp | Copyright ( C ) 2003 - 2008
;;
This file is part of stumpwm .
;;
stumpwm is free software ; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 2 , or ( at your option )
;; any later version.
stumpwm is ... | null | https://raw.githubusercontent.com/stumpwm/stumpwm/fff2508fd54b4035b0d80bafbd75a13f1756130f/group.lisp | lisp |
you can redistribute it and/or modify
either version 2 , or ( at your option )
any later version.
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
along with this software; see the file COPY... | Copyright ( C ) 2003 - 2008
This file is part of stumpwm .
it under the terms of the GNU General Public License as published by
stumpwm is distributed in the hope that it will be useful ,
You should have received a copy of the GNU General Public License
(in-package #:stumpwm)
(export '(current-group g... |
02a8e306790f4d0e4f7514500947d46107798a2d1d867e6483fcfaf7f7108d60 | input-output-hk/cardano-ledger | Size.hs | {-# LANGUAGE MultiWayIf #-}
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
module Test.Cardano.Chain.Block.Size (
tests,
)
where
import Cardano.Chain.Block
import Cardano.Ledger.Binary hiding (label)
import Cardano.Prelude
import qualifie... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger/49a84725c4c2ecabc80f6dac215881bc23920962/eras/byron/ledger/impl/test/Test/Cardano/Chain/Block/Size.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
we can assume that lo ≤ size ≤ hi
Header
ABoundaryHeader
ABlockOrBoundaryHdr
Tests
| # LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
module Test.Cardano.Chain.Block.Size (
tests,
)
where
import Cardano.Chain.Block
import Cardano.Ledger.Binary hiding (label)
import Cardano.Prelude
import qualified Data.ByteString as BS
import Data.String (IsString (..))
impo... |
ef9bb92e5b0d3adcc6e77122b9b21c5e127d4838eb034475ec0c6f29622ab4c1 | lnostdal/SymbolicWeb | database_json.clj | (in-ns 'symbolicweb.core)
;;; TODO:
;;
* PostgreSQL 9.2 + supports a native JSON type ; might be useful here .
;;
;; * Related perhaps: ..seems interesting; haven't thought about this closely though.
(defn db-db-to-json-transformer "DB --> SW"
[m]
(let [js (into {} (map (fn [[k v]]
... | null | https://raw.githubusercontent.com/lnostdal/SymbolicWeb/d9600b286f70f88570deda57b05ca240e4e06567/src/symbolicweb/database_json.clj | clojure | TODO:
might be useful here .
* Related perhaps: ..seems interesting; haven't thought about this closely though.
Observe each existing field in store.
Readding the field to the store will trigger an update.
Observe field value itself.
see # 28 .
Readding the field to the store will trigger an update.
TODO: I... | (in-ns 'symbolicweb.core)
(defn db-db-to-json-transformer "DB --> SW"
[m]
(let [js (into {} (map (fn [[k v]]
[k (vm v)])
(json-parse (:value m))))]
(doseq [[k v] js]
(vm-observe v nil false (fn [_ _ _]
(vm-alter ((:ke... |
c1080b773daa52c9cdac1ea978beadd4ae5744cc01503a09a7508a1731301bf2 | ua-parser/uap-clj | common_spec.clj | (ns uap-clj.common-spec
(:require [clojure.java.io :as io :refer [resource]]
[clj-yaml.core :refer [parse-string]])
(:import [org.yaml.snakeyaml LoaderOptions]))
(def ^:const unknown-ua "Unknown new useragent in the wild/v0.1.0")
(defn default-codepoint-limit
[]
(let [options (LoaderOptions.)]
... | null | https://raw.githubusercontent.com/ua-parser/uap-clj/9898849c672550312c6877789522efbf500faf1d/spec/uap_clj/common_spec.clj | clojure | (ns uap-clj.common-spec
(:require [clojure.java.io :as io :refer [resource]]
[clj-yaml.core :refer [parse-string]])
(:import [org.yaml.snakeyaml LoaderOptions]))
(def ^:const unknown-ua "Unknown new useragent in the wild/v0.1.0")
(defn default-codepoint-limit
[]
(let [options (LoaderOptions.)]
... | |
de9c14328f8300f3b3ce81f6027d884d43c3f84bc072bae559ffc290f4b0edd2 | examachine/fiat-shamir-zkp | lowlife.ml | open Nat
open Bn
open Cryptokit
open Cryptokit.Random
module Random = Cryptokit.Random
(* Conversions between nats and strings *)
let bytes_per_digit = length_of_digit / 8
let nat_of_bytes s =
let l = String.length s in
if l = 0 then make_nat 1 else begin
let n = make_nat ((l + bytes_per_digit - 1) / bytes_... | null | https://raw.githubusercontent.com/examachine/fiat-shamir-zkp/00ee7baafe47c3e726c8de311c605b4d4a0a26b8/lowlife.ml | ocaml | Conversions between nats and strings
adjust low digit of n if requested
adjust high digit of n so that it is exactly numbits long
done
Generate random odd number
Precompute moduli with small primes
Search from n
arithmetic overflow in incrementing delta
overflow in adding delta to n
Make sure p >= q ... | open Nat
open Bn
open Cryptokit
open Cryptokit.Random
module Random = Cryptokit.Random
let bytes_per_digit = length_of_digit / 8
let nat_of_bytes s =
let l = String.length s in
if l = 0 then make_nat 1 else begin
let n = make_nat ((l + bytes_per_digit - 1) / bytes_per_digit) in
let tmp = create_nat 2 in... |
fe6bdb846c968e1062e1e8bdb7fb2266ad88c7554c79f1b37a2612b15bc8612d | typeable/compaREST | Report.hs | module Data.OpenApi.Compare.Report
( generateReport,
CheckerOutput (..),
ReportInput (..),
segregateIssues,
ReportStatus (..),
Pandoc,
ReportConfig (..),
ReportTreeStyle (..),
ReportMode (..),
)
where
import Control.Monad.Free hiding (unfoldM)
import Data.Aeson (ToJSON)
import Data.... | null | https://raw.githubusercontent.com/typeable/compaREST/5727f6bf83ce59a81293837e593822c4a66fcc0b/src/Data/OpenApi/Compare/Report.hs | haskell | | forward and backward 'Unsupported' (assumed to be the same anyway)
| All changes that could be breaking are unsupported – we don't know if
there actually are any breaking changes.
Extract this pattern if more cases like this arise | module Data.OpenApi.Compare.Report
( generateReport,
CheckerOutput (..),
ReportInput (..),
segregateIssues,
ReportStatus (..),
Pandoc,
ReportConfig (..),
ReportTreeStyle (..),
ReportMode (..),
)
where
import Control.Monad.Free hiding (unfoldM)
import Data.Aeson (ToJSON)
import Data.... |
8bc37a5edbddbce5a5c1d4504f9c7de60839dd16ca8c0f4df5b579fe3afc3e95 | facebook/duckling | Rules.hs | Copyright ( c ) 2016 - present , Facebook , Inc.
-- All rights reserved.
--
-- This source code is licensed under the BSD-style license found in the
-- LICENSE file in the root directory of this source tree.
{-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
module Duckling.Temperatu... | null | https://raw.githubusercontent.com/facebook/duckling/72f45e8e2c7385f41f2f8b1f063e7b5daa6dca94/Duckling/Temperature/Rules.hs | haskell | All rights reserved.
This source code is licensed under the BSD-style license found in the
LICENSE file in the root directory of this source tree.
# LANGUAGE GADTs #
# LANGUAGE OverloadedStrings # | Copyright ( c ) 2016 - present , Facebook , Inc.
# LANGUAGE LambdaCase #
module Duckling.Temperature.Rules
( rules
) where
import Data.String
import Prelude
import Duckling.Dimensions.Types
import Duckling.Temperature.Helpers
import Duckling.Temperature.Types (TemperatureData (..))
import Duckling.Types
impo... |
e577b64057e22dcd366e3de20f1a6c86bb565c20f00dd5cf34ce733a565dd6bb | shayan-najd/QFeldspar | Prelude.hs | module Examples.ImageProcessing.Prelude where
import Prelude
import QFeldspar.QDSL
lenV :: Qt (Vec a -> Word32)
lenV = [|| \ (Vec l _ixf) -> l ||]
indV :: Qt (Vec a -> Word32 -> a)
indV = [|| \ (Vec _l ixf) -> ixf ||]
type Pixel = (Word32,(Word32,Word32))
mkPixel :: Qt (Word32 -> Word32 -> Word32 -> Pixel)
mkPixel... | null | https://raw.githubusercontent.com/shayan-najd/QFeldspar/ed60ce02794a548833317388f6e82e2ab1eabc1c/Examples/ImageProcessing/Prelude.hs | haskell | non-empty image | module Examples.ImageProcessing.Prelude where
import Prelude
import QFeldspar.QDSL
lenV :: Qt (Vec a -> Word32)
lenV = [|| \ (Vec l _ixf) -> l ||]
indV :: Qt (Vec a -> Word32 -> a)
indV = [|| \ (Vec _l ixf) -> ixf ||]
type Pixel = (Word32,(Word32,Word32))
mkPixel :: Qt (Word32 -> Word32 -> Word32 -> Pixel)
mkPixel... |
4797a97c35c167dfd3d63744d7e2ab5a53bbc1c6502686f2d4295da068f320e7 | greglook/cljstyle | var_test.clj | (ns cljstyle.format.var-test
(:require
[cljstyle.format.var :as var]
[cljstyle.test-util]
[clojure.test :refer [deftest testing is]]))
(deftest var-defs
(testing "undocumented"
(is (rule-reformatted?
var/format-defs {}
"(def foo 123)"
"(def foo 123)")
... | null | https://raw.githubusercontent.com/greglook/cljstyle/1f58e2e7af4c193aa77ad0695f6c2b9ac2c5c5ec/test/cljstyle/format/var_test.clj | clojure | (ns cljstyle.format.var-test
(:require
[cljstyle.format.var :as var]
[cljstyle.test-util]
[clojure.test :refer [deftest testing is]]))
(deftest var-defs
(testing "undocumented"
(is (rule-reformatted?
var/format-defs {}
"(def foo 123)"
"(def foo 123)")
... | |
3863d6a5a53d552fb8282dda6557f81390c5304f777ee2547c69cd6432803d3f | gelisam/magic-typelevel-elem | Benchmark.hs | #!/usr/bin/env cabal
cabal :
build - depends : base
, directory
, filepath
, text
, time
, typed - process
build-depends: base
, directory
, filepath
, text
, time
, typed-pr... | null | https://raw.githubusercontent.com/gelisam/magic-typelevel-elem/20cbc511bbef6b0670bfb6cea23fc3995389cfb9/Benchmark.hs | haskell | "/..." (root of the repo)
"/.../benchmark-cases"
["no-magic", ...]
"no-magic"
"/.../benchmark-cases/no-magic"
"/.../benchmark-cases/no-magic/app/Main.hs"
"/.../benchmark-cases/no-magic/app/Main.hs.prefix"
stack build
warm the cache
run the benchmark | #!/usr/bin/env cabal
cabal :
build - depends : base
, directory
, filepath
, text
, time
, typed - process
build-depends: base
, directory
, filepath
, text
, time
, typed-pr... |
2e06247f94a0720834f3748158dbd8b29f7e5373328afbad54c67c00030bf882 | lilactown/punk | interceptors.cljc | (ns frame.interceptors
(:require
[frame.loggers :refer [console]]
[frame.interop :refer [empty-queue debug-enabled?]]
[clojure.set :as set]))
(def mandatory-interceptor-keys #{:id :after :before})
(defn interceptor?
[m]
(and (map? m)
(= mandatory-interceptor-keys (-> m keys set))))
(defn -... | null | https://raw.githubusercontent.com/lilactown/punk/0c6e529429837c00958d41e09fd672f49778dedf/frame/src/frame/interceptors.cljc | clojure | -- Effect Helpers -----------------------------------------------------------------------------
-- Execute Interceptor Chain ------------------------------------------------------------------
future interceptors
next interceptor to call
already completed interceptors
only used in tests, probably a hack, remove ... | (ns frame.interceptors
(:require
[frame.loggers :refer [console]]
[frame.interop :refer [empty-queue debug-enabled?]]
[clojure.set :as set]))
(def mandatory-interceptor-keys #{:id :after :before})
(defn interceptor?
[m]
(and (map? m)
(= mandatory-interceptor-keys (-> m keys set))))
(defn -... |
c9eef8e36227d55994f3d340f34cd4d7e5bad6c17da46bb8110763a2504053f2 | mcorbin/tour-of-clojure | util.clj | (ns tourofclojure.pages.util
(:require [hiccup.element :refer [link-to]]))
(defn navigation-block
[previous next]
[:center
[:p
(if previous
(link-to {} (str "/pages/" previous) "Précédent")
"")
" - "
(if next
(link-to {} (str "/pages/" next) "Suivant")
"")
" -... | null | https://raw.githubusercontent.com/mcorbin/tour-of-clojure/57f97b68ca1a8c96904bfb960f515217eeda24a6/src/tourofclojure/pages/util.clj | clojure | (ns tourofclojure.pages.util
(:require [hiccup.element :refer [link-to]]))
(defn navigation-block
[previous next]
[:center
[:p
(if previous
(link-to {} (str "/pages/" previous) "Précédent")
"")
" - "
(if next
(link-to {} (str "/pages/" next) "Suivant")
"")
" -... | |
9019c44735241ac392b06c785a15504a7b817e895f560c38261b1c50f9a0f4c2 | iand675/datadog | Metrics.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE GeneralizedNewtypeDeriving #
module Network.Datadog.Metrics
( Series (..)
, Metric (..)
, MetricPoints (..)
, sendMetrics
, series
, HasName(..)
, HasPoints(..)
, HasTags(..)
, HasHost(..)
, AsMetricPoints(..)
) where
import Control.Monad (void)
import... | null | https://raw.githubusercontent.com/iand675/datadog/0419b9dfc32581a2e27316786c23df452c7bd475/src/Network/Datadog/Metrics.hs | haskell | # LANGUAGE OverloadedStrings #
| Wall clock time
^ metric
^ hostname
^ tags
^ metric
^ hostname
^ tags | # LANGUAGE GeneralizedNewtypeDeriving #
module Network.Datadog.Metrics
( Series (..)
, Metric (..)
, MetricPoints (..)
, sendMetrics
, series
, HasName(..)
, HasPoints(..)
, HasTags(..)
, HasHost(..)
, AsMetricPoints(..)
) where
import Control.Monad (void)
import Data.Aeson hiding (Series)
import ... |
73bc8fa02d232d5a7398dc24f7fee997518d7fd46e18c2c3255a5902091ac41a | reborg/clojure-essential-reference | 4.clj | (quot 38. 4)
9.0 | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/OperationsonNumbers/quot%2Cremandmod/4.clj | clojure | (quot 38. 4)
9.0 | |
23287612e5ae0cc8ba1752d4f2c3c7ed8f14062dbee9c304553d4de0003ba990 | symbiont-io/detsys-testkit | StmTest.hs | module StuntDouble.Transport.StmTest where
import Test.HUnit
import StuntDouble
------------------------------------------------------------------------
unit_stmTransport :: IO ()
unit_stmTransport = do
t <- stmTransport
let e = Envelope RequestKind (RemoteRef "from" 0) (InternalMessage "msg")
... | null | https://raw.githubusercontent.com/symbiont-io/detsys-testkit/29a3a0140730420e4c5cc8db23df6fdb03f9302c/src/runtime-prototype/test/StuntDouble/Transport/StmTest.hs | haskell | ---------------------------------------------------------------------- | module StuntDouble.Transport.StmTest where
import Test.HUnit
import StuntDouble
unit_stmTransport :: IO ()
unit_stmTransport = do
t <- stmTransport
let e = Envelope RequestKind (RemoteRef "from" 0) (InternalMessage "msg")
(RemoteRef "a" 1) 0 (LogicalTime (NodeName "x") 0)
transportSend t e
... |
d02b86df14c082b5a3ddef4d2e28127163c1fb899f96c50f07b23833edb94eae | emiflake/Advent-of-Code-2019 | Solution.hs | # LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
module Solution where
import qualified Data.Text as T
import Common
import Test.Hspec
import Data.List
import Data.List.Split
import Control.Monad.Writer
import Control.Monad.State
import Debug.Trace
import qualified Data.Map.Strict as Map
import Data.Map.Strict ... | null | https://raw.githubusercontent.com/emiflake/Advent-of-Code-2019/f48328c223ea51288523cb616f8e7a01a603b223/Day09/haskell/src/Solution.hs | haskell | Offset | # LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
module Solution where
import qualified Data.Text as T
import Common
import Test.Hspec
import Data.List
import Data.List.Split
import Control.Monad.Writer
import Control.Monad.State
import Debug.Trace
import qualified Data.Map.Strict as Map
import Data.Map.Strict ... |
d639bfaee31c4103407e7b6ebf51256ed6bb6b329b76a5d6a1af8b7d0fec5112 | graninas/Functional-Design-and-Architecture | Main.hs | module Main where
import Data.IORef
import Data.Text
import System.IO.Unsafe (unsafePerformIO)
import Control.Exception (bracket)
import qualified Framework.Logging.Types as Log
import qualified Framework.Logging.Logger.Language as Log
import qualified Framework.Logging.Logger.Config as Cfg
import qualified Framework... | null | https://raw.githubusercontent.com/graninas/Functional-Design-and-Architecture/17c555a35dd884415a4aeedf1e1ba1416dc35cb1/Second-Edition-Manning-Publications/BookSamples/CH10/Section10p1/src/Main.hs | haskell | # NOINLINE staticLoggerRef # | module Main where
import Data.IORef
import Data.Text
import System.IO.Unsafe (unsafePerformIO)
import Control.Exception (bracket)
import qualified Framework.Logging.Types as Log
import qualified Framework.Logging.Logger.Language as Log
import qualified Framework.Logging.Logger.Config as Cfg
import qualified Framework... |
fd385eaa9d787b0a36fa03e6b5b8cc455f97c08360de74bae28072c6002f8ba9 | schemeorg-community/index.scheme.org | srfi.88.scm | (((name . "keyword?") (signature lambda (obj) boolean?) (tags pure predicate))
((name . "keyword->string")
(signature lambda ((keyword? keyword)) string?)
(tags pure predicate))
((name . "string->keyword")
(signature lambda ((string? string)) keyword?)
(tags pure predicate)))
| null | https://raw.githubusercontent.com/schemeorg-community/index.scheme.org/32e1afcfe423a158ac8ce014f5c0b8399d12a1ea/types/srfi.88.scm | scheme | (((name . "keyword?") (signature lambda (obj) boolean?) (tags pure predicate))
((name . "keyword->string")
(signature lambda ((keyword? keyword)) string?)
(tags pure predicate))
((name . "string->keyword")
(signature lambda ((string? string)) keyword?)
(tags pure predicate)))
| |
516cac03a23b3757a583cba4d8fc8525f4c781f1bb1180bdae9e858ec3c6dea6 | beders/rough-cljs | example.cljs | (ns example
(:require [reagent.core :as reagent :refer [atom]]
[reagent.dom :as rdom]
[rough-cljs.core :refer [Rough]]
))
(def logo [[:path "M 127.999,0 C 57.423,0 0,57.423 0,128.001 0,198.585 57.423,256.005 127.999,256.005 198.577,256.005 256,198.585 256,128.001 256,57.423 198.57... | null | https://raw.githubusercontent.com/beders/rough-cljs/50f6d296b2f4f4ffdff1cb618726cac6bee2e4a8/src/main/example.cljs | clojure | init is called ONCE when the page loads
this is called in the index.html and must be exported
so it is available even in :advanced release builds
stop is called before any code is reloaded
this is controlled by :before-load in the config | (ns example
(:require [reagent.core :as reagent :refer [atom]]
[reagent.dom :as rdom]
[rough-cljs.core :refer [Rough]]
))
(def logo [[:path "M 127.999,0 C 57.423,0 0,57.423 0,128.001 0,198.585 57.423,256.005 127.999,256.005 198.577,256.005 256,198.585 256,128.001 256,57.423 198.57... |
00eb026cbb33f4787d8c87646e5dbff1187db5dead7bfcf9f25aa6e2d3176993 | lep/jassbot | web.hs | import Jassbot.Search
import Jassbot.DB
import Jassbot.Signature
import Data.Binary (decodeFileOrFail)
import System.Directory
import System.IO (hPutStrLn, stderr)
import System.IO.Error
import System.Exit
import System.FilePath ((</>))
import System.Environment
import Control.Concurrent (forkFinally)
import qualif... | null | https://raw.githubusercontent.com/lep/jassbot/21df33516e40f641df9c171e2e28980568ef3f64/web.hs | haskell | We do this by hand as compiling aeson
takes too much memory on my VPS.
adapted from -3.1.2.5/docs/Network-Socket.html | import Jassbot.Search
import Jassbot.DB
import Jassbot.Signature
import Data.Binary (decodeFileOrFail)
import System.Directory
import System.IO (hPutStrLn, stderr)
import System.IO.Error
import System.Exit
import System.FilePath ((</>))
import System.Environment
import Control.Concurrent (forkFinally)
import qualif... |
d766b9008c251e97694ebe5eb319dd2924a968dcb07de5a749f1ae8cc2396958 | vereis/jarlang | challengeErlang.erl | -module(challengeErlang).
-export([primeFactorsOf1806046/0,primeFactorsOf/1,
emailAddressValidationTest/0,emailAddressValidation/1,
multiThreadHelloWorld/0,r/0,r/1,
tree/0,tree/1]).
multiThreadHelloWorld()->
r().
Print " Hello World " with each character printed from a separate thread .
%
r()->r("Hello World\n... | null | https://raw.githubusercontent.com/vereis/jarlang/72105b79c1861aa6c4f51c3b50ba695338aafba4/doc/misc/sample_erlang/challengeErlang.erl | erlang |
Print an ascii-art christmas tree.
Prime Factors of a number
Validate an Email Address without using regular expressions or similar. | -module(challengeErlang).
-export([primeFactorsOf1806046/0,primeFactorsOf/1,
emailAddressValidationTest/0,emailAddressValidation/1,
multiThreadHelloWorld/0,r/0,r/1,
tree/0,tree/1]).
multiThreadHelloWorld()->
r().
Print " Hello World " with each character printed from a separate thread .
r()->r("Hello World\n")... |
ebd319f92602ae1b0d90729f488d64cc85e12abb07925dff24b53f79b1d6c3b8 | Shinmera/shootman | objects.lisp | (in-package #:org.shirakumo.fraf.shootman)
(define-pool shootman
:base :shootman)
(define-asset (shootman 32x) mesh
((make-rectangle 32 32)))
(define-asset (shootman 16x) mesh
((make-rectangle 16 16)))
(define-shader-subject base-entity (sprite-subject located-entity axis-rotated-entity)
((vel :initarg ... | null | https://raw.githubusercontent.com/Shinmera/shootman/cb54e0ce46c6450e5f6701928bafdeb94307c9e4/objects.lisp | lisp | (in-package #:org.shirakumo.fraf.shootman)
(define-pool shootman
:base :shootman)
(define-asset (shootman 32x) mesh
((make-rectangle 32 32)))
(define-asset (shootman 16x) mesh
((make-rectangle 16 16)))
(define-shader-subject base-entity (sprite-subject located-entity axis-rotated-entity)
((vel :initarg ... | |
66f0e0f2720927054d786215b7c9b92ef1ba632cca388dcde8243983238d4ea3 | racket/handin | hooker.rkt | #lang racket/base
(require "config.rkt" "logger.rkt" "reloadable.rkt")
(provide hook)
(define hook-file #f)
(define hook-proc #f)
(define (hook what alist)
(let ([file (get-conf 'hook-file)])
(when file
(unless (equal? file hook-file)
(set! hook-file file)
(set! hook-proc (auto-reload-pr... | null | https://raw.githubusercontent.com/racket/handin/a01b9cce0c2397d3e1049d4e6932b48b51e65b13/handin-server/private/hooker.rkt | racket | #lang racket/base
(require "config.rkt" "logger.rkt" "reloadable.rkt")
(provide hook)
(define hook-file #f)
(define hook-proc #f)
(define (hook what alist)
(let ([file (get-conf 'hook-file)])
(when file
(unless (equal? file hook-file)
(set! hook-file file)
(set! hook-proc (auto-reload-pr... | |
f8e19a868651e12e4e91a05a5412c3f266ea42b3325162151a5a82f8953855ca | AnOctopus/haskell-minithesis | Main.hs | module Main where
import Relude
import qualified Relude.Unsafe as Unsafe
import TestCase
import Examples
main :: IO ()
main = do
printResult . pure $ Unsafe.head $ notable `filter`checkSome example [0..100]
printResult . pure $ Unsafe.head $ notable `filter`checkSome example2 [0..100]
printResult . pure $... | null | https://raw.githubusercontent.com/AnOctopus/haskell-minithesis/933c9ab762468d7eaca716e4d609a0b1b850a322/app/Main.hs | haskell | module Main where
import Relude
import qualified Relude.Unsafe as Unsafe
import TestCase
import Examples
main :: IO ()
main = do
printResult . pure $ Unsafe.head $ notable `filter`checkSome example [0..100]
printResult . pure $ Unsafe.head $ notable `filter`checkSome example2 [0..100]
printResult . pure $... | |
2f7697ddc433f331a2a68636ae7c890db92b45ee566ed30a6cede4ed6b688472 | rm-hull/clustering | word_similarities.clj | The MIT License ( MIT )
;;
Copyright ( c ) 2016
;;
;; Permission is hereby granted, free of charge, to any person obtaining a copy
;; of this software and associated documentation files (the "Software"), to deal
in the Software without restriction , including without limitation the rights
;; to use, copy, modif... | null | https://raw.githubusercontent.com/rm-hull/clustering/7dc159081422e325d660e05f4604bcb01647cc74/test/clustering/examples/word_similarities.clj | clojure |
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions:
The above copyright notice... | The MIT License ( MIT )
Copyright ( c ) 2016
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KI... |
afe554106e879b6b0fadb9e7d9239a8e9f80cf7d0c7d37b2bf5757d694eb2ed8 | manuel-serrano/hop | private.scm | ;*=====================================================================*/
* serrano / prgm / project / hop / hop / hopscript / private.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/hop/9e78b40b23ff1f491b25b8cc963eddc148f94712/hopscript/private.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* Private (i.e., not exported by the lib) utilitary functions */
*===========================... | * serrano / prgm / project / hop / hop / hopscript / private.scm * /
* Author : * /
* Creation : Tue Oct 8 08:10:39 2013 * /
* Last change : Thu Feb 24 18:13:02 2022 ( serrano ) * /
* Cop... |
37f9f9baee9ea4e8fc741652744e44e4ec14e725d14f6ba96f1d6212669f8b14 | thelema/ocaml-community | big_int.ml | (***********************************************************************)
(* *)
(* OCaml *)
(* *)
, projet Crista... | null | https://raw.githubusercontent.com/thelema/ocaml-community/ed0a2424bbf13d1b33292725e089f0d7ba94b540/otherlibs/num/big_int.ml | ocaml | *********************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ Id$
open Int_misc
open Nat
type big_int =
... |
173b0466485e0be5678030a064be5417924e87fc04e08c29508054ec72ef5974 | spell-music/temporal-music-notation | test.hs | import Temporal.Music
type ChordType = [Tone N12]
majCh, minCh :: ChordType
majCh = [0, 4, 7]
minCh = [0, 3, 7]
arpeggi :: Tone P12 -> ChordType -> Score12 ()
arpeggi baseNote chordType = line $ map return $ pchs
where pchs = map ((+ baseNote) . (chordType !! )) [0, 1, 2, 1, 2, 1]
harmony = line $ map return
... | null | https://raw.githubusercontent.com/spell-music/temporal-music-notation/48e556e59e08c845aac40ea101266b144eab31c5/test.hs | haskell | import Temporal.Music
type ChordType = [Tone N12]
majCh, minCh :: ChordType
majCh = [0, 4, 7]
minCh = [0, 3, 7]
arpeggi :: Tone P12 -> ChordType -> Score12 ()
arpeggi baseNote chordType = line $ map return $ pchs
where pchs = map ((+ baseNote) . (chordType !! )) [0, 1, 2, 1, 2, 1]
harmony = line $ map return
... | |
7ea68a9f6e8abb0a2864b1c309453761567f81533eb1e1aadcd4f7a5abd39080 | vouillon/osm | debug.ml | OSM tools
* Copyright ( C ) 2013
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at your opti... | null | https://raw.githubusercontent.com/vouillon/osm/a42d1bcc82a4ad73c26c81ac7a75f9f1c7470344/generic/debug.ml | ocaml | OSM tools
* Copyright ( C ) 2013
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , with linking exception ;
* either version 2.1 of the License , or ( at your opti... | |
86dc316c3898894e2074766ddb796db40ff3c3f87d2319aba93866e8673d9069 | input-output-hk/cardano-wallet | Text.hs | -- |
Copyright : © 2018 - 2020 IOHK
-- License: Apache-2.0
--
-- Utility functions for converting time values to and from text.
module Data.Time.Text
(
-- * Conversion to and from text
utcTimeToText
, utcTimeFromText
-- * Time format specification
, TimeFormat (..)
-- * Time for... | null | https://raw.githubusercontent.com/input-output-hk/cardano-wallet/80756f919d7811219e23632bbe59214e0f5e25f5/lib/wallet/src/Data/Time/Text.hs | haskell | |
License: Apache-2.0
Utility functions for converting time values to and from text.
* Conversion to and from text
* Time format specification
* Time formats
* Time format families
| Convert the specified time value to text, using the specified time format.
| Attempt to use each of the specified time formats... | Copyright : © 2018 - 2020 IOHK
module Data.Time.Text
(
utcTimeToText
, utcTimeFromText
, TimeFormat (..)
, iso8601BasicUtc
, iso8601BasicLocal
, iso8601ExtendedUtc
, iso8601ExtendedLocal
, iso8601
, iso8601Basic
, iso8601Extended
) where
import Prelude
import C... |
6400f08b3a0ce6f26a815f36137ffa2d5d08ee7b42f5ab9e670496431a208fef | weyrick/roadsend-php | c-fcgi-bindings.scm | ;; ***** BEGIN LICENSE BLOCK *****
Roadsend PHP Compiler Runtime Libraries
Copyright ( C ) 2007 Roadsend , Inc.
;;
;; This program is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public License
as published by the Free Software Foundation ; either version 2.... | null | https://raw.githubusercontent.com/weyrick/roadsend-php/d6301a897b1a02d7a85bdb915bea91d0991eb158/webconnect/fastcgi/c-fcgi-bindings.scm | scheme | ***** BEGIN LICENSE BLOCK *****
This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public License
either version 2.1
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MER... | Roadsend PHP Compiler Runtime Libraries
Copyright ( C ) 2007 Roadsend , Inc.
of the License , or ( at your option ) any later version .
GNU Lesser General Public License for more details .
You should have received a copy of the GNU Lesser General Public License
Foundation , Inc. , 51 Franklin Street , Fifth... |
5d91416b558f23177be91f7affcca41e2820f26ab670a523b215ef7f8e516107 | jepsen-io/jepsen | generator.clj | (ns jepsen.generator
"# In a Nutshell
Generators tell Jepsen what to do during a test. Generators are purely
functional objects which support two functions: `op` and `update`. `op`
produces operations for Jepsen to perform: it takes a test and context
object, and yields:
- nil if the generator is exhauste... | null | https://raw.githubusercontent.com/jepsen-io/jepsen/2c17e3253bd4459da07bf551a80d57f98e9d3f42/jepsen/src/jepsen/generator.clj | clojure | I've done my best to make
no more juggling gen/seq
their arguments are all
this approach
pure generators provide a regular
the semantics may evolve over
I just haven't written it yet.
it also
known op
unsure
exhausted
why do we
if
it ignores updates and always yields nil for
that generator is used until... | (ns jepsen.generator
"# In a Nutshell
Generators tell Jepsen what to do during a test. Generators are purely
functional objects which support two functions: `op` and `update`. `op`
produces operations for Jepsen to perform: it takes a test and context
object, and yields:
- nil if the generator is exhauste... |
7694a2cef60f096c62df533d497236a337e98c3a79a0b4c52e8c3afc2fe95011 | dyoo/whalesong | test-get-dependencies.rkt | #lang racket
(require "../make/get-dependencies.rkt"
"../get-module-bytecode.rkt"
"../parser/parse-bytecode.rkt"
"../compiler/lexical-structs.rkt"
racket/path
racket/runtime-path
rackunit)
(printf "test-get-dependencies.rkt\n")
(define-runtime-path get-dependenci... | null | https://raw.githubusercontent.com/dyoo/whalesong/636e0b4e399e4523136ab45ef4cd1f5a84e88cdc/whalesong/tests/test-get-dependencies.rkt | racket | #lang racket
(require "../make/get-dependencies.rkt"
"../get-module-bytecode.rkt"
"../parser/parse-bytecode.rkt"
"../compiler/lexical-structs.rkt"
racket/path
racket/runtime-path
rackunit)
(printf "test-get-dependencies.rkt\n")
(define-runtime-path get-dependenci... | |
8c6b12d72dd859ba061588e34bcb81d654606423427cb91d8d1eb86085a353a9 | ahrefs/atd | bucklespec_bs.expected.ml | (* Auto-generated from "bucklespec.atd" *)
[@@@ocaml.warning "-27-32-33-35-39"]
type recurse = Bucklespec_t.recurse = { recurse_items: recurse list }
type mutual_recurse1 = Bucklespec_t.mutual_recurse1 = {
mutual_recurse2: mutual_recurse2
}
and mutual_recurse2 = Bucklespec_t.mutual_recurse2 = {
mutual_recurse1: ... | null | https://raw.githubusercontent.com/ahrefs/atd/1f2b3bcc54d14159a5e25e9b23b5c9bed163721c/atdgen/test/bucklescript/bucklespec_bs.expected.ml | ocaml | Auto-generated from "bucklespec.atd" | [@@@ocaml.warning "-27-32-33-35-39"]
type recurse = Bucklespec_t.recurse = { recurse_items: recurse list }
type mutual_recurse1 = Bucklespec_t.mutual_recurse1 = {
mutual_recurse2: mutual_recurse2
}
and mutual_recurse2 = Bucklespec_t.mutual_recurse2 = {
mutual_recurse1: mutual_recurse1
}
type variant2 = Bucklesp... |
1cc36ce9bcc0798f653f98cedc4da815bf18d2c2dd03d014963ea595c1d17494 | ygmpkk/house | Create.hs | -- #hide
-----------------------------------------------------------------------------
-- |
-- Module : Control.Create
Copyright : ( c ) 2002
-- License : BSD-style
--
-- Maintainer :
-- Stability : provisional
-- Portability : portable
--
-- Control.Create contains all control creation func... | null | https://raw.githubusercontent.com/ygmpkk/house/1ed0eed82139869e85e3c5532f2b579cf2566fa2/ghc-6.2/libraries/ObjectIO/Graphics/UI/ObjectIO/Control/Create.hs | haskell | #hide
---------------------------------------------------------------------------
|
Module : Control.Create
License : BSD-style
Maintainer :
Stability : provisional
Portability : portable
Control.Create contains all control creation functions.
----------------------------------------------... | Copyright : ( c ) 2002
module Graphics.UI.ObjectIO.Control.Create ( createControls, createCompoundControls ) where
import Graphics.UI.ObjectIO.CommonDef
import Graphics.UI.ObjectIO.StdControlAttribute
import Graphics.UI.ObjectIO.Control.Layout
import Graphics.UI.ObjectIO.Control.Validate
import Graphics.UI... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.