_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 |
|---|---|---|---|---|---|---|---|---|
00abdbffc17310114d875cfae9c53ae24ba16b830f55f94695a1a74756629683 | marcoheisig/Petalisp | defalias.lisp | © 2016 - 2023 - license : GNU AGPLv3 -*- coding : utf-8 -*-
(in-package #:petalisp.utilities)
(defmacro defalias (alias thing)
(check-type alias symbol)
`(ensure-alias ',alias ',thing))
(defun ensure-alias (alias designator)
(cond ((and (symbolp designator)
(special-operator-p design... | null | https://raw.githubusercontent.com/marcoheisig/Petalisp/a1c85cf71da445ef9c7913cd9ddb5149373211a7/code/utilities/defalias.lisp | lisp | © 2016 - 2023 - license : GNU AGPLv3 -*- coding : utf-8 -*-
(in-package #:petalisp.utilities)
(defmacro defalias (alias thing)
(check-type alias symbol)
`(ensure-alias ',alias ',thing))
(defun ensure-alias (alias designator)
(cond ((and (symbolp designator)
(special-operator-p design... | |
46cafe896918a10f5a251040e1e7ed3e77464962393fda853c23b39ffb7fbb71 | ocaml-multicore/multicoretests | stm_tests.ml | open QCheck
open STM
module SConf =
struct
type path = string list [@@deriving show]
type cmd =
| File_exists of path
| Mkdir of path * string
| Rmdir of path * string
| Readdir of path
| Mkfile of path * string
[@@deriving show { with_path = false }]
module Map_names = Map.Make (String... | null | https://raw.githubusercontent.com/ocaml-multicore/multicoretests/1dc53af62c5badd44a86f639dda695a1fa4bbae9/src/sys/stm_tests.ml | ocaml | can be empty
if not a directory
if not a directory
Temporary work around for mingW, see | open QCheck
open STM
module SConf =
struct
type path = string list [@@deriving show]
type cmd =
| File_exists of path
| Mkdir of path * string
| Rmdir of path * string
| Readdir of path
| Mkfile of path * string
[@@deriving show { with_path = false }]
module Map_names = Map.Make (String... |
c59f637e629940e611f15e11b6a4a2eeaff282551aa069f3ea7a6909f056034c | repl-acement/repl-acement | defn.cljs | (ns replacement.xform.defn
(:require [cljs.spec.alpha :as s]
[replacement.structure.core-fn-specs :as core-specs]
[replacement.structure.form-specs :as form-specs]))
(defn single-arity?
[conformed-data]
(-> conformed-data
(get-in [:defn-args :fn-tail])
(first)
(= :arity-... | null | https://raw.githubusercontent.com/repl-acement/repl-acement/649046e720d413433ce9600951dd51c6b210a91a/repl-ui/replacement/xform/defn.cljs | clojure | (ns replacement.xform.defn
(:require [cljs.spec.alpha :as s]
[replacement.structure.core-fn-specs :as core-specs]
[replacement.structure.form-specs :as form-specs]))
(defn single-arity?
[conformed-data]
(-> conformed-data
(get-in [:defn-args :fn-tail])
(first)
(= :arity-... | |
16c6d8af54464c5074bb6ac64a1fc976e428a52014db35de89b807e54a65f4a7 | mejgun/haskell-tdlib | EditForumTopic.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Query.EditForumTopic where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
-- |
-- Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless ... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/dc380d18d49eaadc386a81dc98af2ce00f8797c2/src/TD/Query/EditForumTopic.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
Edits title and icon of a topic in a forum supergroup chat; requires can_manage_topics administrator right in the supergroup unless the user is creator of the topic
| Pass true to edit the icon of the topic. Icon of the General topic can't be edited
| Message thread identifier of... |
module TD.Query.EditForumTopic where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
data EditForumTopic = EditForumTopic
| Identifier of the new custom emoji for topic icon ; pass 0 to remove the custom emoji . Ignored if edit_icon_custom_emoji is false . Telegr... |
d493b901a72a878f381f07d155fff5f10a3ea2cf74e2b87114ff46f1035aa1ee | metaocaml/ber-metaocaml | t240-c_call1.ml | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
if Stdlib.int_of_string "123" <> 123 then raise Not_found;;
(** tes... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/tool-ocaml/t240-c_call1.ml | ocaml | * test for fix of bug 6649: | TEST
include tool - ocaml - lib
flags = " -w a "
ocaml_script_as_argument = " true "
* setup - ocaml - build - env
* *
include tool-ocaml-lib
flags = "-w a"
ocaml_script_as_argument = "true"
* setup-ocaml-build-env
** ocaml
*)
open Lib;;
if Stdlib.int_of_string "123" <> 123 then raise Not_found;;
if Stdl... |
d70a1c39a92b4e478ceab1d866df28e2fad6ef2bce1309d9b239b6b6991e0f3b | Agda-zh/PLFA-zh | Script.hs | module Buildfile.Script where
import Data.Aeson.Types (KeyValue ((.=)), ToJSON (..), object)
import Data.Text (Text)
import Data.Text qualified as Text
import Data.Text.Lazy qualified as LazyText
import Shoggoth.Configuration (Mode (Development), getMode)
import Shoggoth.Prelude (Action, Url, takeBaseName)
import Shog... | null | https://raw.githubusercontent.com/Agda-zh/PLFA-zh/8963a3edb2d92b0f708a7caf540fbed630488cd9/tools/Buildfile/Script.hs | haskell | module Buildfile.Script where
import Data.Aeson.Types (KeyValue ((.=)), ToJSON (..), object)
import Data.Text (Text)
import Data.Text qualified as Text
import Data.Text.Lazy qualified as LazyText
import Shoggoth.Configuration (Mode (Development), getMode)
import Shoggoth.Prelude (Action, Url, takeBaseName)
import Shog... | |
59c5b9b6de0fa2fd6e9f7c34d84e9c0142f88d053b0633d7de713992f3bef2d1 | andrenth/ocaml-mariadb | nonblocking_stress_test.ml | open Printf
module Make (W : Mariadb.Nonblocking.Wait) = struct
module M = Mariadb.Nonblocking.Make (W)
open W.IO
let (>|=) m f = m >>= fun x -> return (f x)
let env var def = try Sys.getenv var with Not_found -> def
let or_die where = function
| Ok r -> return r
| Error (i, e) -> eprintf "%s: (%d... | null | https://raw.githubusercontent.com/andrenth/ocaml-mariadb/3ae20e7d58b30b75e47ad3f34b94bb32df2666b1/examples/nonblocking/nonblocking_stress_test.ml | ocaml | Treat `Datetime and `Timestamp as equal.
Make sure the conversion between timestamps and strings are consistent
* between MariaDB and OCaml. By sending timestamps to be compared as binary
* and as string, this also verifies the MYSQL_TIME encoding. | open Printf
module Make (W : Mariadb.Nonblocking.Wait) = struct
module M = Mariadb.Nonblocking.Make (W)
open W.IO
let (>|=) m f = m >>= fun x -> return (f x)
let env var def = try Sys.getenv var with Not_found -> def
let or_die where = function
| Ok r -> return r
| Error (i, e) -> eprintf "%s: (%d... |
43858029038496ce480314d5b6598366ace44f7950b1a5ee7d1dbbca59ce385c | emqxarchive/emqx-modbus | emq_modbus_device_sup.erl | %%%-----------------------------------------------------------------------------
Copyright ( c ) 2016 - 2017 < > , All Rights Reserved .
%%%
%%% 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 So... | null | https://raw.githubusercontent.com/emqxarchive/emqx-modbus/d3f7e8f84399424a5af059fe117de4e99402ef97/src/emq_modbus_device_sup.erl | erlang | -----------------------------------------------------------------------------
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnishe... | Copyright ( c ) 2016 - 2017 < > , All Rights Reserved .
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... |
931f261d2d66ed1e9d559f7b6f11176c8d8f1376b1cbacf3cf5ae9e2eb78e1d3 | appleshan/cl-http | null-construction-context.lisp | -*- package : " XML - PARSER " ; Syntax : Common - lisp ; Base : 10 -*-
(in-package "XML-PARSER")
;; examples of construction context implementations which produces no results.
(defClass null-construction-context ()
()
(:documentation
"the class <code>NULL-CONSTRUCTION-CONTEXT</code> implements the minimum ... | null | https://raw.githubusercontent.com/appleshan/cl-http/a7ec6bf51e260e9bb69d8e180a103daf49aa0ac2/contrib/janderson/xml-2001-10-03/demos/sax/null-construction-context.lisp | lisp | Syntax : Common - lisp ; Base : 10 -*-
examples of construction context implementations which produces no results.
the top-level parse function parses a source to produce nothing
(null-document-parser "<asdf q='t'>1234</asdf>")
(null-document-parser "file") |
(in-package "XML-PARSER")
(defClass null-construction-context ()
()
(:documentation
"the class <code>NULL-CONSTRUCTION-CONTEXT</code> implements the minimum required
of a construction context to cause the parser to generate a null result."))
(defMethod |Attribute-Constructor|
((context null-co... |
fad3de5de597c5a67b58b132c1d87227479c2b443d7e6d92e4fca3dd4cfb7f96 | FieryCod/holy-lambda | core.cljc | (ns fierycod.holy-lambda.core
(:require
[fierycod.holy-lambda.util]
[fierycod.holy-lambda.custom-runtime]
[fierycod.holy-lambda.agent]))
(defmacro entrypoint
"Generates the `-main` function, which is an entrypoint for `bootstrap` script.
Lambdas passed as a first parameter are converted to a routing map... | null | https://raw.githubusercontent.com/FieryCod/holy-lambda/77a55abe566a9b0ba5d29cab26e72eeb01a88d3e/src/fierycod/holy_lambda/core.cljc | clojure | Side effect init-hook
executor = native-agent -- Indicates that the configuration for compiling via `native-image`
will be generated via the agent.
executor = anything else -- Run provided runtime loop
Generate the native configuration for the lambdas
Start custom runtime loop | (ns fierycod.holy-lambda.core
(:require
[fierycod.holy-lambda.util]
[fierycod.holy-lambda.custom-runtime]
[fierycod.holy-lambda.agent]))
(defmacro entrypoint
"Generates the `-main` function, which is an entrypoint for `bootstrap` script.
Lambdas passed as a first parameter are converted to a routing map... |
073b5731b7dfb0d74d78fb3d26ea6721633e13e9e785d6b82fb47e8363f8758a | dinosaure/carton | core.ml | let cpu () =
match String.lowercase_ascii (Sys.os_type) with
| "win32" -> Sys.getenv "NUMBER_OF_PROCESSORS" |> int_of_string
| "freebsd" ->
let i = Unix.open_process_in "sysctl -n hw.ncpu" in
let close () = ignore (Unix.close_process_in i) in
( try let i = Scanf.Scanning.from_channel i in
Scan... | null | https://raw.githubusercontent.com/dinosaure/carton/8cb8b3685fab477594b2d83c70b2fc965d1d59b9/bin/core.ml | ocaml | let cpu () =
match String.lowercase_ascii (Sys.os_type) with
| "win32" -> Sys.getenv "NUMBER_OF_PROCESSORS" |> int_of_string
| "freebsd" ->
let i = Unix.open_process_in "sysctl -n hw.ncpu" in
let close () = ignore (Unix.close_process_in i) in
( try let i = Scanf.Scanning.from_channel i in
Scan... | |
f88aebc55fcedc79ce6e1a54a258b74a6a3835ea16137f735662d11ad8272771 | MLstate/opalang | qmlCpsServerLib.mli |
Copyright © 2011 , 2012 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be us... | null | https://raw.githubusercontent.com/MLstate/opalang/424b369160ce693406cece6ac033d75d85f5df4f/compiler/qmlcps/qmlCpsServerLib.mli | ocaml | *[true] if the continuation may be stolen by another server,
[false] otherwise
*[true] if the continuation should not be scheduled.
This can cause runtime errors if the continuation contains [wait].
*[true] if the continuation should be evaluated rather than scheduled.
*A mechanism for returning value... |
Copyright © 2011 , 2012 MLstate
This file is part of .
is free software : you can redistribute it and/or modify it under the
terms of the GNU Affero General Public License , version 3 , as published by
the Free Software Foundation .
is distributed in the hope that it will be us... |
396b6bcc3bcc284fd8e535d1cf4bc99068e7419f7b4944bbd7ab84291fd79bc8 | basho/riak_test | verify_aae.erl | %% -------------------------------------------------------------------
%%
Copyright ( c ) 2013 Basho Technologies , Inc.
%%
This file is provided to you under the Apache License ,
%% Version 2.0 (the "License"); you may not use this file
except in compliance with the License . You may obtain
%% a copy of the Li... | null | https://raw.githubusercontent.com/basho/riak_test/8170137b283061ba94bc85bf42575021e26c929d/tests/verify_aae.erl | erlang | -------------------------------------------------------------------
Version 2.0 (the "License"); you may not use this file
a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing,
KIND, either express or implied. See the License for the
specific language governing permissio... | Copyright ( c ) 2013 Basho Technologies , Inc.
This file is provided to you under the Apache License ,
except in compliance with the License . You may obtain
software distributed under the License is distributed on an
" AS IS " BASIS , WITHOUT WARRANTIES OR CONDITIONS OF ANY
The basic guarantee of AAE is ... |
a998e283ea7b585b635aa04c285ea5d2afcd92af5cc986beb4b122b2e81b4c98 | probprog/anglican | stat_test.cljc | (ns anglican.stat-test
(:require [clojure.core.matrix :as m]
[clojure.test :refer [deftest testing is]]
[anglican.stat :refer [empirical-distribution
empirical-mean
empirical-expectation]]
[anglican.runtime :refe... | null | https://raw.githubusercontent.com/probprog/anglican/ab6111d7fa8f68f42ea046feab928ca3eedde1d7/test/anglican/stat_test.cljc | clojure | (ns anglican.stat-test
(:require [clojure.core.matrix :as m]
[clojure.test :refer [deftest testing is]]
[anglican.stat :refer [empirical-distribution
empirical-mean
empirical-expectation]]
[anglican.runtime :refe... | |
5b3156dec254f33cfb36e00447fdc13ad662d9b836ad43be0aeeaeabc2417d44 | samrushing/irken-compiler | t_sha1.scm | ;; -*- Mode: Irken -*-
(include "lib/basis.scm")
(include "lib/map.scm")
(include "lib/codecs/hex.scm")
(include "lib/crypto/sha1.scm")
(define (t0)
(let ((strings '("testing" ", testing!\n")))
(assert
(string=?
"fbf8c65de539027c21c84cd3544aaf18e8786c90"
(string->hex (sha1 (list-generator strin... | null | https://raw.githubusercontent.com/samrushing/irken-compiler/690da48852d55497f873738df54f14e8e135d006/tests/t_sha1.scm | scheme | -*- Mode: Irken -*- |
(include "lib/basis.scm")
(include "lib/map.scm")
(include "lib/codecs/hex.scm")
(include "lib/crypto/sha1.scm")
(define (t0)
(let ((strings '("testing" ", testing!\n")))
(assert
(string=?
"fbf8c65de539027c21c84cd3544aaf18e8786c90"
(string->hex (sha1 (list-generator strings)))))))
(define (t1)... |
bc9bb71eef8e7289e8b7a4c6b3cfa99767efa0fdaab7638412f7e3df0f9f02dc | schemedoc/implementation-metadata | silk.scm | (title "SILK")
(based-on "jscheme")
(author "Peter Norvig")
(author "Kenneth R Anderson")
(author "Timothy J Hickey")
(academy "Brandeis University")
(company "BBN Technologies")
(paper
(type inproceedings)
(title "Reflecting Java into Scheme")
(author "Kenneth R Anderson")
(author "Timothy J Hickey")
(booktitle... | null | https://raw.githubusercontent.com/schemedoc/implementation-metadata/6280d9c4c73833dc5bd1c9bef9b45be6ea5beb68/schemes/silk.scm | scheme | (title "SILK")
(based-on "jscheme")
(author "Peter Norvig")
(author "Kenneth R Anderson")
(author "Timothy J Hickey")
(academy "Brandeis University")
(company "BBN Technologies")
(paper
(type inproceedings)
(title "Reflecting Java into Scheme")
(author "Kenneth R Anderson")
(author "Timothy J Hickey")
(booktitle... | |
5b4a4b1820b2e53fb1d5e80c5e17577c598a75b0f6b505357706dfb3a6c82d34 | jyh/metaprl | m_doc_parsing.ml | (* -*- mode: text; -*- *)
doc <:doc<
@begin[spelling]
YACC lexing params LetAtom op lexer regex LALR pos
EQ ID exp
@end[spelling]
@section[m_doc_parsing]{Language}
@docoff
----------------------------------------------------------------
@begin[license]
Copyright (C) 2003 Jason Hickey, Calt... | null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/theories/experimental/compile/m_doc_parsing.ml | ocaml | -*- mode: text; -*- | doc <:doc<
@begin[spelling]
YACC lexing params LetAtom op lexer regex LALR pos
EQ ID exp
@end[spelling]
@section[m_doc_parsing]{Language}
@docoff
----------------------------------------------------------------
@begin[license]
Copyright (C) 2003 Jason Hickey, Caltech
This program is fr... |
169fd3f776b82094d49aa68461f996c8331f0f2c6329469ee2df8cd7a92ecf30 | AllAlgorithms/lisp | linearsearch.lisp | (defun linear-search (lst el)
(cond ((null lst) nil)
((equal (car lst) el) t)
(t (linear-search (cdr lst) el))))
(print (linear-search '(1 2 3) 1))
(print (linear-search '(1 2 3) 0))
| null | https://raw.githubusercontent.com/AllAlgorithms/lisp/0dd927d445ccd45da18be264e6f6312c7d3f1716/algorithms/searches/linearsearch.lisp | lisp | (defun linear-search (lst el)
(cond ((null lst) nil)
((equal (car lst) el) t)
(t (linear-search (cdr lst) el))))
(print (linear-search '(1 2 3) 1))
(print (linear-search '(1 2 3) 0))
| |
03549f5885534efffe90d1e62f960d9e75442bca5d98566b973accb4337b4e8c | prg-titech/Kani-CUDA | diffusion2d-toy.rkt | #lang rosette
(require "../../lang.rkt" "diffusion2d-baseline.rkt")
9 - points stencil computation example .
Parallel diffusion program
(define (diffusion2d-kernel in
out
nx ny
ce cw cn cs cnw cne csw cse cc)
(:= int i (+/LS (*... | null | https://raw.githubusercontent.com/prg-titech/Kani-CUDA/e97c4bede43a5fc4031a7d2cfc32d71b01ac26c4/Emulator/Examples/Diffusion2d/diffusion2d-toy.rkt | racket | Add a constraint that it is equal to each of the elements of
Execute a diffusion program on CPU
Execute a diffusion program on GPU
(newline) | #lang rosette
(require "../../lang.rkt" "diffusion2d-baseline.rkt")
9 - points stencil computation example .
Parallel diffusion program
(define (diffusion2d-kernel in
out
nx ny
ce cw cn cs cnw cne csw cse cc)
(:= int i (+/LS (*... |
ed3f90ccba5985c5d5e13b2b8f1c24e4c71e1b238fdd054d9c2aeecf3d3da52c | nd/bird | 10.2.1.hs | type Exception = String
data Exc a = Raise Exception | Return a
instance Monad Exc where
return x = Return x
(Raise e) >>= q = Raise e
(Return x) >>= q = q x
raise :: Exception -> Exc a
raise e = Raise e
try :: Exc a -> Exc a -> Exc a
try (Return x) b = (Return x)
try (Raise e) b = b
data Term = Con I... | null | https://raw.githubusercontent.com/nd/bird/06dba97af7cfb11f558eaeb31a75bd04cacf7201/ch10/10.2.1.hs | haskell | type Exception = String
data Exc a = Raise Exception | Return a
instance Monad Exc where
return x = Return x
(Raise e) >>= q = Raise e
(Return x) >>= q = q x
raise :: Exception -> Exc a
raise e = Raise e
try :: Exc a -> Exc a -> Exc a
try (Return x) b = (Return x)
try (Raise e) b = b
data Term = Con I... | |
f693a951ebda366973336a670956446637b55e5313ba5278effcc50f186acb71 | jordwalke/rehp | dom.mli | Js_of_ocaml library
* /
* Copyright ( C ) 2010
* Laboratoire PPS - CNRS Université Paris Diderot
*
* 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 ... | null | https://raw.githubusercontent.com/jordwalke/rehp/f122b94f0a3f06410ddba59e3c9c603b33aadabf/lib/js_of_ocaml/dom.mli | ocaml | Will not happen
* Specification of [Node] objects.
* Specification of [Attr] objects.
* Specification of [NamedNodeMap] objects.
* Specification of [Element] objects.
* Specification of [Comment] objects
* Specification of [Text] objects.
* Specification of [DocumentFragment] objects.
* Specification of [Docum... | Js_of_ocaml library
* /
* Copyright ( C ) 2010
* Laboratoire PPS - CNRS Université Paris Diderot
*
* 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 ... |
7416fe2d82cc68069cb872e4e84fdb0288ffe8aeaf7bab36ede564cc90d74301 | jamis/rtc-ocaml | RTCCube.ml | let build () =
let check_axis origin direction =
let t1 = ((-1.) -. origin) /. direction in
let t2 = (1. -. origin) /. direction in
if t1 > t2 then (t2, t1) else (t1, t2)
in
let local_intersect shape ?(trail=[]) (r:RTCRay.t) =
let (xtmin, xtmax) = check_axis r.origin.x r.direction.x in
let (yt... | null | https://raw.githubusercontent.com/jamis/rtc-ocaml/f5ba04e874ef0b54d100cdabfe9a67c2b80a643f/src/RTCCube.ml | ocaml | let build () =
let check_axis origin direction =
let t1 = ((-1.) -. origin) /. direction in
let t2 = (1. -. origin) /. direction in
if t1 > t2 then (t2, t1) else (t1, t2)
in
let local_intersect shape ?(trail=[]) (r:RTCRay.t) =
let (xtmin, xtmax) = check_axis r.origin.x r.direction.x in
let (yt... | |
994455f9e47980b0f2c2610dbd34fcba073c64a6f2550cff217c8738540276b0 | darkleaf/publicator | post_queries.clj | (ns publicator.use-cases.test.fakes.post-queries
(:require
[publicator.use-cases.abstractions.post-queries :as post-q]
[publicator.domain.aggregates.post :as post]
[publicator.domain.aggregates.user :as user]))
(defn- author-for-post [db post]
(->> @db
(vals)
(filter user/user?)
(filt... | null | https://raw.githubusercontent.com/darkleaf/publicator/e07eee93d8f3d9c07a15d574619d5ea59c00f87d/core/src/publicator/use_cases/test/fakes/post_queries.clj | clojure | (ns publicator.use-cases.test.fakes.post-queries
(:require
[publicator.use-cases.abstractions.post-queries :as post-q]
[publicator.domain.aggregates.post :as post]
[publicator.domain.aggregates.user :as user]))
(defn- author-for-post [db post]
(->> @db
(vals)
(filter user/user?)
(filt... | |
1324e672b2a2625fe201894797c4ef86770de2436d7657870e42052212c8819b | WorksHub/client | util_macros.cljc | (ns wh.util-macros
#?(:cljs (:require-macros [wh.util-macros :refer [when-not-prod]])))
#?(:clj
(defmacro when-not-prod
[& body]
(when (not= (System/getenv "ENVIRONMENT") "prod")
`(do
~@body))))
| null | https://raw.githubusercontent.com/WorksHub/client/a51729585c2b9d7692e57b3edcd5217c228cf47c/common/src/wh/util_macros.cljc | clojure | (ns wh.util-macros
#?(:cljs (:require-macros [wh.util-macros :refer [when-not-prod]])))
#?(:clj
(defmacro when-not-prod
[& body]
(when (not= (System/getenv "ENVIRONMENT") "prod")
`(do
~@body))))
| |
fc98ab4c11f2fa96cbbeab302b69507513bc68b8d249fe0d6359445ce3aa846d | matsen/pplacer | newick_bark.ml | The bark for , i.e. trees that only have bl , name , and boot .
*)
open Ppatteries
exception No_bl
exception No_node_label
exception No_edge_label
let ppr_opt_node_labeld node_label ppr_val ff = function
| Some x -> Format.fprintf ff " %s = %a;@," node_label ppr_val x
| None -> ()
let write_something_opt ... | null | https://raw.githubusercontent.com/matsen/pplacer/f40a363e962cca7131f1f2d372262e0081ff1190/pplacer_src/newick_bark.ml | ocaml | The bark for , i.e. trees that only have bl , name , and boot .
*)
open Ppatteries
exception No_bl
exception No_node_label
exception No_edge_label
let ppr_opt_node_labeld node_label ppr_val ff = function
| Some x -> Format.fprintf ff " %s = %a;@," node_label ppr_val x
| None -> ()
let write_something_opt ... | |
a40759dce6d34ffa3fa2201b16648a731dd6bdde859a9857c7e1c42221c4c7da | returntocorp/semgrep | Semgrepignore.mli |
and interpret ' .semgrepignore ' files in addition to ' .gitignore '
files .
The patterns they contain specify file paths to exclude from Semgrep scans .
See the ml file for compatibility issues .
Parse and interpret '.semgrepignore' files in addition to '.gitignore'
files.
The patter... | null | https://raw.githubusercontent.com/returntocorp/semgrep/88135d1c4affe447c98819b677160069fc4b3270/src/osemgrep/targeting/Semgrepignore.mli | ocaml | Holds project root, and some cached data
TODO: ignore folders containing a '.git' file (in list_files only?)
?ignore_folder_if_contains:string list ->
Pass a path to a file and determine whether it should be ignored for
Semgrep scanning purposes.
The input path must be either absolute with the... |
and interpret ' .semgrepignore ' files in addition to ' .gitignore '
files .
The patterns they contain specify file paths to exclude from Semgrep scans .
See the ml file for compatibility issues .
Parse and interpret '.semgrepignore' files in addition to '.gitignore'
files.
The patter... |
91330e12104a167c91d923ec383e89caf44f7d611f433ed8d5968be98c07c8c4 | 8c6794b6/guile-tjit | t-nest-22.scm | ;;; Nested inter-procedure loop with condition in inner loop.
(define (loop1 n acc)
(let lp ((n n) (acc acc))
(cond
((< 500 n)
(lp (- n 1) (+ acc 4)))
((< 250 n)
(lp (- n 1) (+ acc 3)))
((< 0 n)
(lp (- n 1) (+ acc 2)))
(else
acc))))
(define (loop2 n)
(let lp ((n n) ... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/test-suite/tjit/t-nest-22.scm | scheme | Nested inter-procedure loop with condition in inner loop. |
(define (loop1 n acc)
(let lp ((n n) (acc acc))
(cond
((< 500 n)
(lp (- n 1) (+ acc 4)))
((< 250 n)
(lp (- n 1) (+ acc 3)))
((< 0 n)
(lp (- n 1) (+ acc 2)))
(else
acc))))
(define (loop2 n)
(let lp ((n n) (acc 0))
(if (< 0 n)
(lp (- n 1) (+ acc (loop1 n 0... |
1b1792413312eda8cb1bee07f309ada05066d6664a1a6fe97c73b3252ed73899 | mmottl/aifad | rand_gen.ml |
AIFAD - Automated Induction of Functions over
Author :
email :
WWW :
Copyright ( C ) 2002 Austrian Research Institute for Artificial Intelligence
Copyright ( C ) 2003-
This library is free software ; you can redistribute it and/or
modify it under the terms of t... | null | https://raw.githubusercontent.com/mmottl/aifad/b06786f5cd60992548405078a903ee3d962ea969/src/rand_gen.ml | ocaml | Random data generation |
AIFAD - Automated Induction of Functions over
Author :
email :
WWW :
Copyright ( C ) 2002 Austrian Research Institute for Artificial Intelligence
Copyright ( C ) 2003-
This library is free software ; you can redistribute it and/or
modify it under the terms of t... |
d384571cc6e5b4722f6a3d015d87cea8938bf19c8ee491f00cf3239009f5abe3 | bufferswap/ViralityEngine | asset.lisp | (in-package #:virality)
;;; implementation of ASSET-SPEC
(u:define-printer (asset-spec stream :type nil)
(format stream "~s (pool: ~s)" (name asset-spec) (pool asset-spec)))
(defun find-asset-pool (name)
(u:href =meta/asset-pools= name))
(defun make-asset-spec (pool-name base-path data)
(destructuring-bind (n... | null | https://raw.githubusercontent.com/bufferswap/ViralityEngine/df7bb4dffaecdcb6fdcbfa618031a5e1f85f4002/src/core-early/asset.lisp | lisp | implementation of ASSET-SPEC
implementation
TODO: The below code feels really wrong and has a fundamental flaw. It needs
inspection wrt to live coding vs deployed binary contexts. | (in-package #:virality)
(u:define-printer (asset-spec stream :type nil)
(format stream "~s (pool: ~s)" (name asset-spec) (pool asset-spec)))
(defun find-asset-pool (name)
(u:href =meta/asset-pools= name))
(defun make-asset-spec (pool-name base-path data)
(destructuring-bind (name path) data
(let* ((pool (... |
9a39159fa03e4fab7bf38f1ba5774e3ad26309148c4db052e60a7fb77bfb97c5 | tmspzz/Rome | Common.hs | module Data.Carthage.Common where
newtype Version = Version { unVersion :: String }
deriving (Eq, Show, Ord)
| null | https://raw.githubusercontent.com/tmspzz/Rome/b667f84010af439f90618ed25357ab2307ddff67/src/Data/Carthage/Common.hs | haskell | module Data.Carthage.Common where
newtype Version = Version { unVersion :: String }
deriving (Eq, Show, Ord)
| |
f361fc80b4adcd71c613fd8cd4890830ae16ec7f40a5983a5ad9acea58ec5040 | rotty/ocelotl | http-client.sps | #!r6rs
;;; http-client.sps --- Simple HTTP client demo
Copyright ( C ) 2009 , 2015 < >
Author : < >
;; This program is free software, you can redistribute it and/or
modify it under the terms of the new - style BSD license .
You should have received a copy of the BSD license along with this
;; program.... | null | https://raw.githubusercontent.com/rotty/ocelotl/0c6aadaef99444b180574f18f1935d9507e20978/examples/http-client.sps | scheme | http-client.sps --- Simple HTTP client demo
This program is free software, you can redistribute it and/or
program. If not, see <>.
Commentary:
Usage: http-client.sps HTTP-URL
Performs a GET request on HTTP-URL, and copies the response body to
the standard output port.
Code: | #!r6rs
Copyright ( C ) 2009 , 2015 < >
Author : < >
modify it under the terms of the new - style BSD license .
You should have received a copy of the BSD license along with this
(import (rnrs)
(spells ports)
(ocelotl net http-client))
(define (main argv)
(call-with-http-response... |
3db2059d9f841853cff26e1f014346711234cfd8ce18328a6f030915c8707d60 | silky/quipper | Auxiliary.hs | This file is part of Quipper . Copyright ( C ) 2011 - 2016 . Please see the
-- file COPYRIGHT for a list of authors, copyright holders, licensing,
-- and other details. All rights reserved.
--
-- ======================================================================
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE Fle... | null | https://raw.githubusercontent.com/silky/quipper/1ef6d031984923d8b7ded1c14f05db0995791633/Algorithms/CL/Auxiliary.hs | haskell | file COPYRIGHT for a list of authors, copyright holders, licensing,
and other details. All rights reserved.
======================================================================
| This module defines general-purpose functions not specific to the Class Number algorithm, but required by it.
Needed to define boxed... | This file is part of Quipper . Copyright ( C ) 2011 - 2016 . Please see the
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleContexts #
module Algorithms.CL.Auxiliary where
import Quipper
import QuipperLib.Arith hiding (q_ext_euclid, q_add, q_mult, q_div_exact,
q_add_in_place, ... |
59091ff1c1587ad6d035e2e61572934937e8897d47eda78fadcf6b2a5aee82ba | bcc32/projecteuler-ocaml | sol_047.ml | open! Core
open! Import
let main () =
let distinct_prime_factors =
Number_theory.Int.natural_numbers ~init:2 ()
|> Sequence.map ~f:(fun n ->
if debug then Debug.eprintf "factoring %d" n;
n, Number_theory.Int.prime_factor n |> List.length)
in
let each_consecutive_4 =
let dpf = distinct_pri... | null | https://raw.githubusercontent.com/bcc32/projecteuler-ocaml/e47a58cb8d6a448be8907b1fef2b4d1988fb4c87/sol/sol_047.ml | ocaml | Check [dpf] first à la Boyer-Moore:
-search_algorithm.
This doesn't actually buy us much performance-wise, but it's cool, so
whatever. | open! Core
open! Import
let main () =
let distinct_prime_factors =
Number_theory.Int.natural_numbers ~init:2 ()
|> Sequence.map ~f:(fun n ->
if debug then Debug.eprintf "factoring %d" n;
n, Number_theory.Int.prime_factor n |> List.length)
in
let each_consecutive_4 =
let dpf = distinct_pri... |
a69c5e843e05efcf6668c29ee51e2e239ab5db51b0f135d2d028d846af2b2a25 | c4-project/c4f | lex_utils.ml | This file is part of c4f .
Copyright ( c ) 2018 - 2022 C4 Project
c4 t itself is licensed under the MIT License . See the LICENSE file in the
project root for more information .
Parts of c4 t are based on code from the Herdtools7 project
( ) : see the LICENSE.herd file in the
project... | null | https://raw.githubusercontent.com/c4-project/c4f/8939477732861789abc807c8c1532a302b2848a5/lib/utils/src/lex_utils.ml | ocaml | This file derives in part from the Herd7 project
(); its original attribution and
copyright notice follow.
Int.Hex.of_string won't take raw digits.
per 'Real World OCaml' | This file is part of c4f .
Copyright ( c ) 2018 - 2022 C4 Project
c4 t itself is licensed under the MIT License . See the LICENSE file in the
project root for more information .
Parts of c4 t are based on code from the Herdtools7 project
( ) : see the LICENSE.herd file in the
project... |
189fe7a497352b37a7daaf07bb801757bbbc15a98804af9953ed72ad67a8eb52 | timbertson/passe | option.ml | type 'a t = 'a option
let return x = Some x
let map f opt = match opt with Some x -> Some (f x) | None -> None
let may f opt = match opt with
| Some x -> (f x)
| None -> ()
let default_fn f opt = match opt with
| Some x -> x
| None -> (f ())
let default (d:'a) (opt:'a option) : 'a = match opt with Some x -> x | ... | null | https://raw.githubusercontent.com/timbertson/passe/467a79ea0cd7b08a97b52be3bd1307a3bdf55799/src/common/option.ml | ocaml | type 'a t = 'a option
let return x = Some x
let map f opt = match opt with Some x -> Some (f x) | None -> None
let may f opt = match opt with
| Some x -> (f x)
| None -> ()
let default_fn f opt = match opt with
| Some x -> x
| None -> (f ())
let default (d:'a) (opt:'a option) : 'a = match opt with Some x -> x | ... | |
d4d3ae349778d8711a5f05482f46c3e2777af0bb8975899d19a2aa0f35735a27 | GrammaticalFramework/gf-core | Main.hs | -- | GF main program (grammar compiler, interactive shell, http server)
# LANGUAGE CPP #
module GF.Main where
import GF.Compiler
import qualified GF.Interactive as GFI1
#ifdef C_RUNTIME
import qualified GF.Interactive2 as GFI2
#endif
import GF.Data.ErrM
import GF.Infra.Option
import GF.Infra.UseIO
import GF.Infra.Build... | null | https://raw.githubusercontent.com/GrammaticalFramework/gf-core/e9bbd38f686a5026179b7295427d9620cf967ab7/src/compiler/GF/Main.hs | haskell | | GF main program (grammar compiler, interactive shell, http server)
import GF.System.Console (setConsoleEncoding)
Run @gf --help@ for usage info.
setConsoleEncoding
| Get and parse GF command line arguments. Fix relative paths.
Calls 'getArgs' and 'parseOptions'.
the options it invokes 'mainGFC', 'mainGFI', 'ma... | # LANGUAGE CPP #
module GF.Main where
import GF.Compiler
import qualified GF.Interactive as GFI1
#ifdef C_RUNTIME
import qualified GF.Interactive2 as GFI2
#endif
import GF.Data.ErrM
import GF.Infra.Option
import GF.Infra.UseIO
import GF.Infra.BuildInfo (buildInfo)
import Paths_gf
import Data.Version
import System.Dire... |
de280e04dcd9a499924aaf33f5c678d8b4cb0418fa3f4211c21791e255c322bd | tschady/advent-of-code | d16_test.clj | (ns aoc.2020.d16-test
(:require [aoc.2020.d16 :as sut]
[clojure.test :refer :all]))
(deftest challenges
(is (= 25916 (sut/part-1 sut/input)))
(is (= 2564529489989 (sut/part-2 sut/input))))
| null | https://raw.githubusercontent.com/tschady/advent-of-code/0288cf9de646b9be0b0bc9e33ac9cfc34a984302/test/aoc/2020/d16_test.clj | clojure | (ns aoc.2020.d16-test
(:require [aoc.2020.d16 :as sut]
[clojure.test :refer :all]))
(deftest challenges
(is (= 25916 (sut/part-1 sut/input)))
(is (= 2564529489989 (sut/part-2 sut/input))))
| |
4ff94099b61ede0be1a6f00d2797bccc9b3c342df1f552b0e48ba355461448bf | ocaml-gospel/ortac | arith.ml | open Arith__Lib_rtac
open Common
let forall () =
check_success "bounds in the right order" (fun () ->
test_forall (-2) (-3) |> ignore);
check_success "empty interval" (fun () -> test_forall (-2) (-2) |> ignore);
check_raises_ortac "formula not satisfied" (fun () ->
test_forall (-2) (-1) |> ignore);
... | null | https://raw.githubusercontent.com/ocaml-gospel/ortac/dacc564ffaf8cfeb6f012bacefa5319d042ba29f/test/suite/arith.ml | ocaml | open Arith__Lib_rtac
open Common
let forall () =
check_success "bounds in the right order" (fun () ->
test_forall (-2) (-3) |> ignore);
check_success "empty interval" (fun () -> test_forall (-2) (-2) |> ignore);
check_raises_ortac "formula not satisfied" (fun () ->
test_forall (-2) (-1) |> ignore);
... | |
7776fa060f20dcc0d3e86f342bbe675ad8ebf4d22eb3bb81ab209b7e7e753d6a | composewell/streaming-benchmarks | VectorCommon.hs | -- |
-- Module : Benchmarks.Vector
Copyright : ( c ) 2018
--
License : MIT
-- Maintainer :
{ - # LANGUAGE CPP # - }
-- {-# LANGUAGE ScopedTypeVariables #-}
import Benchmarks.Common (value, maxValue, appendValue)
import Prelude (Int, (+), ($), (.), even, (>), (<=), subtract, undefined,
... | null | https://raw.githubusercontent.com/composewell/streaming-benchmarks/31d0ca72b4e668f8502896a34846418d6feda3d4/Benchmarks/VectorCommon.hs | haskell | |
Module : Benchmarks.Vector
Maintainer :
{-# LANGUAGE ScopedTypeVariables #-}
-----------------------------------------------------------------------------
Stream generation and elimination
-----------------------------------------------------------------------------
source v = S.fromList [v..v+value]
--... | Copyright : ( c ) 2018
License : MIT
{ - # LANGUAGE CPP # - }
import Benchmarks.Common (value, maxValue, appendValue)
import Prelude (Int, (+), ($), (.), even, (>), (<=), subtract, undefined,
maxBound, Maybe(..))
import qualified Prelude as P
#ifdef VECTOR_BOXED
import qualified Data.... |
0cc6f739f774724cb913bfbb503c3f91c62193fc97aae5a9d280f7d30255fb4f | ivanjovanovic/sicp | e-2.72.scm | Exercise 2.72 .
;
; Consider the encoding procedure that you designed in exercise
2.68 . What is the order of growth in the number of steps needed to encode a
; symbol? Be sure to include the number of steps needed to search the symbol
; list at each node encountered. To answer this question in general is
; difficu... | null | https://raw.githubusercontent.com/ivanjovanovic/sicp/a3bfbae0a0bda414b042e16bbb39bf39cd3c38f8/2.3/e-2.72.scm | scheme |
Consider the encoding procedure that you designed in exercise
symbol? Be sure to include the number of steps needed to search the symbol
list at each node encountered. To answer this question in general is
difficult. Consider the special case where the relative frequencies of the n
function of n) of the number of... | Exercise 2.72 .
2.68 . What is the order of growth in the number of steps needed to encode a
symbols are as described in exercise 2.71 , and give the order of growth ( as a
|
54c756e2ea8c5e1b7fb7321517b918870bff6c0244e50362e1281c0a61da20fd | fp-works/2019-winter-Haskell-school | SExprSpec.hs | import AParser
import Data.Char
import SExpr
import Test.Hspec
main :: IO ()
main =
hspec $ do
describe "SExpr" $ do
describe "exercise 1" $ do
it "should return correct results of zeroOrMore" $ do
runParser (zeroOrMore (satisfy isUpper)) "ABCdEfgH" `shouldBe`
Just ("ABC", "dE... | null | https://raw.githubusercontent.com/fp-works/2019-winter-Haskell-school/823b67f019b9e7bc0d3be36711c0cc7da4eba7d2/cis194/week11/tien/test/SExprSpec.hs | haskell | import AParser
import Data.Char
import SExpr
import Test.Hspec
main :: IO ()
main =
hspec $ do
describe "SExpr" $ do
describe "exercise 1" $ do
it "should return correct results of zeroOrMore" $ do
runParser (zeroOrMore (satisfy isUpper)) "ABCdEfgH" `shouldBe`
Just ("ABC", "dE... | |
f07a1ae0b6dee9c61711b904453c24f0a00da2a87787013a1b8675bbf58351f2 | Twinside/Rasterific | coon_rendering.hs | {-# LANGUAGE RankNTypes #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE StandaloneDeriving #
import Control.Monad.Trans.State.Strict
import Control.Monad( forM_ )
import Control.Monad.ST( ST, runST )
import Graphics.Rasterific hiding ( fill
, dashedStrokeWithOffset
... | null | https://raw.githubusercontent.com/Twinside/Rasterific/709e2828d6378aa82f133a881665f2fa951e0204/exec-src/coon_rendering.hs | haskell | # LANGUAGE RankNTypes #
-}
{-
-}
-}
{-
-}
-}
{-
-} | # LANGUAGE FlexibleContexts #
# LANGUAGE StandaloneDeriving #
import Control.Monad.Trans.State.Strict
import Control.Monad( forM_ )
import Control.Monad.ST( ST, runST )
import Graphics.Rasterific hiding ( fill
, dashedStrokeWithOffset
, dashedStroke
... |
9996c5d5c31f0139e2b9e1d094ba5cbcb3ed765817728d8d5a0ca158beebceff | nasa/Common-Metadata-Repository | high_concept_number_test.clj | (ns cmr.system-int-test.search.high-concept-number-test
"Tests that check how the system handles concepts with high concept numbers."
(:require
[clojure.test :refer [deftest testing is use-fixtures]]
[cmr.common.util :refer [are3]]
[cmr.system-int-test.data2.core :as d]
[cmr.system-int-test.data2.granul... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/945feb164afb30c75953a157fcd1d4fdbbba32a1/system-int-test/test/cmr/system_int_test/search/high_concept_number_test.clj | clojure | :concept-seq-id is derived from the serialization of the numeric portion of a :concept-id
original elasticsearch indexes stored the value as a signed integer, now it is stored as an unsigned_long | (ns cmr.system-int-test.search.high-concept-number-test
"Tests that check how the system handles concepts with high concept numbers."
(:require
[clojure.test :refer [deftest testing is use-fixtures]]
[cmr.common.util :refer [are3]]
[cmr.system-int-test.data2.core :as d]
[cmr.system-int-test.data2.granul... |
ff123f23464b6a9a5c1fcd0e3f8c5029bc865bf404a893f1bb3f1ba8c61b7a0c | mikeizbicki/subhask | Array.hs | # LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - missing - methods #
# OPTIONS_GHC -fno - warn - incomplete - patterns #
# OPTIONS_GHC -fno - warn - orphans #
module SubHask.Algebra.Array
( BArray (..)
, UArray (..)
, Unboxable
)
where
import Control.Monad
import Control.Monad.Primitive
import Data.Pr... | null | https://raw.githubusercontent.com/mikeizbicki/subhask/f53fd8f465747681c88276c7dabe3646fbdf7d50/src/SubHask/Algebra/Array.hs | haskell | -----------------------------------------------------------------------------
boxed arrays
--------------------------------------
mutability
--------------------------------------
misc instances
--------------------------------------
algebra
--------------------------------------
comparison
-----------------------... | # LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - missing - methods #
# OPTIONS_GHC -fno - warn - incomplete - patterns #
# OPTIONS_GHC -fno - warn - orphans #
module SubHask.Algebra.Array
( BArray (..)
, UArray (..)
, Unboxable
)
where
import Control.Monad
import Control.Monad.Primitive
import Data.Pr... |
9dd47a7a1114d94cd6699eba72514dc8db5a7dcbf26f6e050ab106bc3463e50c | fisherdj/miniAdapton | microadapton.scm | (library (microadapton)
(export adapton? make-athunk adapton-add-dcg-edge! adapton-del-dcg-edge!
adapton-compute adapton-ref adapton-ref-set!)
(import (rnrs (6))
(set)
(include))
(define-record-type (adapton adapton-cons adapton?)
(fields thunk
(mutable result)
... | null | https://raw.githubusercontent.com/fisherdj/miniAdapton/1b5749422304567c96ac5367f2221dda9eff5880/microadapton.scm | scheme | (library (microadapton)
(export adapton? make-athunk adapton-add-dcg-edge! adapton-del-dcg-edge!
adapton-compute adapton-ref adapton-ref-set!)
(import (rnrs (6))
(set)
(include))
(define-record-type (adapton adapton-cons adapton?)
(fields thunk
(mutable result)
... | |
b30a9a23c27f3fcc50d7f4b652dc2a4e673988039a18b57d1a3f9e1263e87ef0 | sonowz/advent-of-code-haskell | Day02.hs | module Y2017.Day02 where
import Relude
import Relude.Extra.Foldable1
import Data.Maybe (fromJust)
import Data.Semigroup
import Lib.IO
-----------------------
-- Type declarations --
-----------------------
type Spreadsheet = [NonEmpty Int]
type Checksum = Int
------------
-- Part 1 --
------------
solve1 :: Spread... | null | https://raw.githubusercontent.com/sonowz/advent-of-code-haskell/6cec825c5172bbec687aab510e43832e6f2c0372/src/Y2017/Day02.hs | haskell | ---------------------
Type declarations --
---------------------
----------
Part 1 --
----------
----------
----------
------------------
------------------ | module Y2017.Day02 where
import Relude
import Relude.Extra.Foldable1
import Data.Maybe (fromJust)
import Data.Semigroup
import Lib.IO
type Spreadsheet = [NonEmpty Int]
type Checksum = Int
solve1 :: Spreadsheet -> Checksum
solve1 = sum . map minMaxDiff
minMaxDiff :: NonEmpty Int -> Int
minMaxDiff l = maximum1 l - ... |
34fad89db573b0981e092faf6ef331ef425301ff5b51e98971a31d9c8653f7f0 | OlivierSohn/hamazed | ColoredGlyphList.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE DeriveGeneric #
# LANGUAGE InstanceSigs #
{-# LANGUAGE BangPatterns #-}
{- | A 'ColoredGlyphList' is a colored string, with the notion of font.-}
module Imj.Graphics.Text.ColoredGlyphList
(
-- * Type
ColoredGlyphList(..)
-- * ... | null | https://raw.githubusercontent.com/OlivierSohn/hamazed/6c2b20d839ede7b8651fb7b425cb27ea93808a4a/imj-base/src/Imj/Graphics/Text/ColoredGlyphList.hs | haskell | # LANGUAGE BangPatterns #
| A 'ColoredGlyphList' is a colored string, with the notion of font.
* Type
* Constructors
* Utilities
since color interpolation happens AFTER char changes,
we compare colors with result of char interpolation | # LANGUAGE NoImplicitPrelude #
# LANGUAGE DeriveGeneric #
# LANGUAGE InstanceSigs #
module Imj.Graphics.Text.ColoredGlyphList
(
ColoredGlyphList(..)
, colored
, colored'
, concat
, intercalate
, take
*
, LayeredColor(... |
58a073de34463545d0a1be19215d9233584c3b27e19d357e8a06237d007445d8 | keechma/keechma-entitydb | internal.cljs | (ns keechma.entitydb.internal
"Collection of functions used for managing Entity idents. EntityIdent is defined as a record consisting of fields
`type` and `id`. ")
(defrecord EntityIdent [type id])
(defn entity-ident?
"Check if `leaf` is of record `EntityIdent`"
[leaf]
(= EntityIdent (type leaf)))
(defn en... | null | https://raw.githubusercontent.com/keechma/keechma-entitydb/100f1871bbd62b688901fd1359e8b0a2bbf3153c/src/keechma/entitydb/internal.cljs | clojure | (ns keechma.entitydb.internal
"Collection of functions used for managing Entity idents. EntityIdent is defined as a record consisting of fields
`type` and `id`. ")
(defrecord EntityIdent [type id])
(defn entity-ident?
"Check if `leaf` is of record `EntityIdent`"
[leaf]
(= EntityIdent (type leaf)))
(defn en... | |
1e5cbbf024f82efbf1954d382da7b9347a3c4236995744dfa8c76c6c11947bbd | ghcjs/ghcjs | Main.hs | Copyright ( c ) 2000 Galois Connections , Inc.
-- All rights reserved. This software is distributed as
-- free software under the license in the file "LICENSE",
-- which is included in the distribution.
-- Modified to read sample input directly from a file.
module Main where
import Parse
import Eval
main = do { ... | null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/programs/galois_raytrace/Main.hs | haskell | All rights reserved. This software is distributed as
free software under the license in the file "LICENSE",
which is included in the distribution.
Modified to read sample input directly from a file. | Copyright ( c ) 2000 Galois Connections , Inc.
module Main where
import Parse
import Eval
main = do { str <- readFile "galois.gml"
; mainEval (rayParse str)
}
|
c3cb5d2223ff02075fd3bbd0593a7e26293a181d485887ea00c2063f26faf820 | JLZml/Credit-Scoring-Data-Sets | credit.lisp | ;; positive examples represent people that were granted credit
(def-pred credit_screening :type (:person)
:pos
((s1) (s2) (s4) (s5) (s6) (s7) (s8) (s9) (s14) (s15) (s17) (s18) (s19)
(s21) (s22) (s24) (s28) (s29) (s31) (s32) (s35) (s38) (s40) (s41)
(s42) (s43) (s45) (s46) (s47) (s49) (s50) (s51) (s53) (s54) (... | null | https://raw.githubusercontent.com/JLZml/Credit-Scoring-Data-Sets/dd454322df86d98ff97d6035357aa9a5c450c783/1.%20UCI%20Repository/Japan/credit.lisp | lisp | positive examples represent people that were granted credit
item purchased that loan is for.
people who live in a problematic region
This is a quite discriminatory rule against feminine, but the reality of
(aged_more_60 ?s ?b)
(not (rejected_aged_unstable_work ?s)) | (def-pred credit_screening :type (:person)
:pos
((s1) (s2) (s4) (s5) (s6) (s7) (s8) (s9) (s14) (s15) (s17) (s18) (s19)
(s21) (s22) (s24) (s28) (s29) (s31) (s32) (s35) (s38) (s40) (s41)
(s42) (s43) (s45) (s46) (s47) (s49) (s50) (s51) (s53) (s54) (s55)
(s56) (s57) (s59) (s61) (s62) (s63) (s64) (s65) (s66) (... |
04f98d969c902536318b3e213d28758c72b7bf43ac771c9de741661cb0561dfb | acarrico/wayland-protocol | wayland-0-descriptor-table.rkt | #lang at-exp racket/base
(require "wayland-ast.rkt"
"util.rkt")
(require racket/pretty)
(require racket/list)
(require racket/format)
(require racket/match)
(require racket/function)
(provide dump-descriptor-table)
(define (dump-descriptor-table protocol)
(define interfaces
(filter
(lambda (i) (... | null | https://raw.githubusercontent.com/acarrico/wayland-protocol/7270ae8f420c8062466c230e7cf3fe5331fe9fbd/generator/wayland-0-descriptor-table.rkt | racket | #lang at-exp racket/base
(require "wayland-ast.rkt"
"util.rkt")
(require racket/pretty)
(require racket/list)
(require racket/format)
(require racket/match)
(require racket/function)
(provide dump-descriptor-table)
(define (dump-descriptor-table protocol)
(define interfaces
(filter
(lambda (i) (... | |
88c572af1d2f6fab4d5e68278dbe162ea15533e40fdd27e30a0c3b6b454e04df | tek/polysemy-hasql | DeriveUnitTest.hs | # options_ghc -Wno - redundant - constraints #
module Polysemy.Hasql.Test.Tree.DeriveUnitTest where
import Generics.SOP (I, NP)
import Polysemy.Db.Data.Rep (Auto, Prim)
import Polysemy.Db.Data.FieldId (FieldId(NamedField))
import qualified Polysemy.Db.Kind.Data.Tree as Kind
import Polysemy.Db.Tree (AdtNode, Node, Pro... | null | https://raw.githubusercontent.com/tek/polysemy-hasql/443ccf348bb8af0ec0543981d58af8aa26fc4c10/packages/hasql/test/Polysemy/Hasql/Test/Tree/DeriveUnitTest.hs | haskell | # options_ghc -Wno - redundant - constraints #
module Polysemy.Hasql.Test.Tree.DeriveUnitTest where
import Generics.SOP (I, NP)
import Polysemy.Db.Data.Rep (Auto, Prim)
import Polysemy.Db.Data.FieldId (FieldId(NamedField))
import qualified Polysemy.Db.Kind.Data.Tree as Kind
import Polysemy.Db.Tree (AdtNode, Node, Pro... | |
6219507f16656d9c4de8db99594225ad289c2778477d33409e69d0abcfc7e0ee | death/zonquerer | a-star.lisp | ;;;; +----------------------------------------------------------------+
;;;; | zonquerer |
;;;; +----------------------------------------------------------------+
| Copyright ( C ) 2021 death |
;;;; | ... | null | https://raw.githubusercontent.com/death/zonquerer/2a0ff29b9d974fc66addb9126f1638f4d5d071cb/a-star.lisp | lisp | +----------------------------------------------------------------+
| zonquerer |
+----------------------------------------------------------------+
| |
| This program is free software: you can redist... | | Copyright ( C ) 2021 death |
| modify it under the terms of the GNU Affero General Public |
| License as published by the Free Software Foundation , either |
| version 3 of the License , or ( at your option ) any later |
(defpackage #:zonquerer/a-star
... |
f1694dae5d43a621e50e5617e92c0e63dbc650d2d5e95fe69229642621bc1f60 | vseloved/cl-nlp | features.lisp | ( c ) 2014 - 2017 Vsevolod Dyomkin
(in-package #:nlp.learning)
(named-readtables:in-readtable rutilsx-readtable)
(defgeneric extract-fs (model &rest args)
(:documentation
"Extract features for MODEL from ARGS."))
(defgeneric extract-gold (model data)
(:documentation
"Extract from data a list of pairs of... | null | https://raw.githubusercontent.com/vseloved/cl-nlp/f180b6c3c0b9a3614ae43f53a11bc500767307d0/src/learning/features.lisp | lisp | utils | ( c ) 2014 - 2017 Vsevolod Dyomkin
(in-package #:nlp.learning)
(named-readtables:in-readtable rutilsx-readtable)
(defgeneric extract-fs (model &rest args)
(:documentation
"Extract features for MODEL from ARGS."))
(defgeneric extract-gold (model data)
(:documentation
"Extract from data a list of pairs of... |
5e2a2f2fbd92d7fa6de5a8f1a5796073fc14c505b23f8418af35c2f221380e10 | spechub/Hets | hacapa.hs | |
Module : $ Id$
Description : testing HasCASL homogeneously
Copyright : ( c ) , Uni Bremen 2002 - 2004
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : experimental
Portability : portable
test some parsers ( and printers )
Module : $Id... | null | https://raw.githubusercontent.com/spechub/Hets/af7b628a75aab0d510b8ae7f067a5c9bc48d0f9e/HasCASL/hacapa.hs | haskell | |
Module : $ Id$
Description : testing HasCASL homogeneously
Copyright : ( c ) , Uni Bremen 2002 - 2004
License : GPLv2 or higher , see LICENSE.txt
Maintainer :
Stability : experimental
Portability : portable
test some parsers ( and printers )
Module : $Id... | |
ac07c46e936e69d22fbd6412af8e77482a998c96189f8d947dc99808b08ffdca | jeapostrophe/exp | workout-song.rkt | #lang racket/base
(require racket/system
racket/port
racket/path
racket/list
racket/file
racket/match)
(struct music (label))
(struct action (len s))
(define (+rest len)
(action len "Take A Rest"))
(define (action+rest len s)
(list (action len s)
(+rest (max 5 ... | null | https://raw.githubusercontent.com/jeapostrophe/exp/43615110fd0439d2ef940c42629fcdc054c370f9/workout-song.rkt | racket | XXX Add count to know when last one is
1:00 quad extension
1:15 leg curl
1:10 lat pull
3:00 chest press
1:00 shoulder press
2:00 squat + calf raise
1:00 shrugg
1:00 tricep press
0:05 to 0:10 for moving things and resting | #lang racket/base
(require racket/system
racket/port
racket/path
racket/list
racket/file
racket/match)
(struct music (label))
(struct action (len s))
(define (+rest len)
(action len "Take A Rest"))
(define (action+rest len s)
(list (action len s)
(+rest (max 5 ... |
7c92d3639f777ed205f22535c8b05938f9d1c80352beb8b7e390968c3f0951eb | zlatozar/study-paip | tutor.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : TUTOR ; Base : 10 -*-
;;; Code from Paradigms of Artificial Intelligence Programming
Copyright ( c ) 1991
;;;; File tutor.lisp: An interactive application for running the examples
(in-package #:tutor)
(defvar *chapters* '() "List of chapter structures, one ... | null | https://raw.githubusercontent.com/zlatozar/study-paip/dfa1ca6118f718f5d47d8c63cbb7b4cad23671e1/tutor.lisp | lisp | Syntax : COMMON - LISP ; Package : TUTOR ; Base : 10 -*-
Code from Paradigms of Artificial Intelligence Programming
File tutor.lisp: An interactive application for running the examples
If given a chapter, just return it.
____________________________________________________________________________
... |
Copyright ( c ) 1991
(in-package #:tutor)
(defvar *chapters* '() "List of chapter structures, one per chapter.")
(defstruct (chapter (:print-function
(lambda (chapter stream depth)
(declare (ignore depth))
(format stream "~2D. ~A" (chapter-numb... |
a6ef0ef234db447464bb327c14f70f271ed1fdd4c214700426ce929d29a462b7 | 314eter/ocaml-stringsearch-benchmark | naive.ml | let name = "naive"
exception Found of int
let search pattern patternlength text maxpos pos =
let i = ref 0 in
for pos = pos to maxpos do
i := 0;
while String.unsafe_get text (pos + !i) = String.unsafe_get pattern !i do
incr i;
if !i = patternlength then raise (Found pos)
done;
done
let ... | null | https://raw.githubusercontent.com/314eter/ocaml-stringsearch-benchmark/bcf81514a2cffa919bc4283fb5be96a38dacf56d/naive.ml | ocaml | let name = "naive"
exception Found of int
let search pattern patternlength text maxpos pos =
let i = ref 0 in
for pos = pos to maxpos do
i := 0;
while String.unsafe_get text (pos + !i) = String.unsafe_get pattern !i do
incr i;
if !i = patternlength then raise (Found pos)
done;
done
let ... | |
f5f49ea2f4a8f6ccc6c51c7a36d71cccf77b933449b3ed142bf316142608c5bf | B-Lang-org/bsc | SymTab.hs | # LANGUAGE CPP #
module SymTab(
SymTab(..), VarInfo(..), TypeInfo(..),
ConInfo(..), ConTagInfo(..),
FieldInfo(..), VarKind(..),
getAllTypes,
emptySymtab,
addVars, addTypes, addCons, addFields, addClasses,
addVarsUQ, addTyp... | null | https://raw.githubusercontent.com/B-Lang-org/bsc/bd141b505394edc5a4bdd3db442a9b0a8c101f0f/src/comp/SymTab.hs | haskell | import Debug.Trace
the Maybe is whether the identifier has been deprecated, and why
(as "noinline" compiles to)
type
constructor number and tag metadata
Nothing for numeric and string types
Id is the identifier of a type which has this field
Bool is if the fields of that type are visible to user
Int is the arit... | # LANGUAGE CPP #
module SymTab(
SymTab(..), VarInfo(..), TypeInfo(..),
ConInfo(..), ConTagInfo(..),
FieldInfo(..), VarKind(..),
getAllTypes,
emptySymtab,
addVars, addTypes, addCons, addFields, addClasses,
addVarsUQ, addTyp... |
458329a48d294dc6ae2292baa74c23314f65bed897ccaab8d97b8ee3ec4ca6fc | rudymatela/speculate | minus.hs | import Test.Speculate
main :: IO ()
main = speculate args
{ constants =
[ showConstant (0::Int)
, showConstant (1::Int)
, constant "id" $ id -:> int
Add abs for 30 seconds runtime in " old " KBC , about 10 without .
--, constant "abs" $ abs -:> int
, constant "+" $ (+... | null | https://raw.githubusercontent.com/rudymatela/speculate/8ec39747d03033db4349d554467d4b78bb72935d/eg/minus.hs | haskell | , constant "abs" $ abs -:> int | import Test.Speculate
main :: IO ()
main = speculate args
{ constants =
[ showConstant (0::Int)
, showConstant (1::Int)
, constant "id" $ id -:> int
Add abs for 30 seconds runtime in " old " KBC , about 10 without .
, constant "+" $ (+) -:> int
, constant "negate" $ ne... |
21fa84fba20ee354b7ac611b117b7206c64cb0df54c6f05387f3e0ee3dc5944f | intermine/bluegenes | utils.cljs | (ns bluegenes.utils
(:require [clojure.string :as string]
[clojure.data.xml :as xml]
[clojure.walk :as walk]
[imcljs.query :as im-query]
[bluegenes.version :as version]
[bluegenes.components.icons :refer [icon]]
[markdown-to-hiccup.core :as md]
... | null | https://raw.githubusercontent.com/intermine/bluegenes/f2c291dd4b32122329d5561c01e26a70eaa3186e/src/cljs/bluegenes/utils.cljs | clojure |
Please do not use this for model classes. You can get results like:
"ThisIsADog" -> "This isa dog"
I don't think camelcasing is a reversible operation unless you explicitly
specify all acronyms present (inflections.core uses this approach).
without defining UTR as an acronym , you would n't get " This
Instea... | (ns bluegenes.utils
(:require [clojure.string :as string]
[clojure.data.xml :as xml]
[clojure.walk :as walk]
[imcljs.query :as im-query]
[bluegenes.version :as version]
[bluegenes.components.icons :refer [icon]]
[markdown-to-hiccup.core :as md]
... |
cbf3e2e3a3a8ab9f2b0afb5bd8f5c4b7ff291f76b8a754eba7508d9862d3dcec | aeolus-project/zephyrus | stateful_abstract_io.ml | (****************************************************************************)
(* *)
This file is part of Zephyrus .
(* *)
Z... | null | https://raw.githubusercontent.com/aeolus-project/zephyrus/0b52de4038bbab724e6a9628430165a7f09f77ae/src/input/stateful_abstract_io.ml | ocaml | **************************************************************************
(at your option) any later version.
... | This file is part of Zephyrus .
Zephyrus is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
Zephyru... |
d8c219c9740ab17ad86c4bd9de2baedcf4f79ba9d8f2e65a101c0072c1ba7bf3 | let-def/menhir | internalSyntax.mli | (**************************************************************************)
(* *)
Menhir
(* *)
, INRIA Ro... | null | https://raw.githubusercontent.com/let-def/menhir/e8ba7bef219acd355798072c42abbd11335ecf09/src/internalSyntax.mli | ocaml | ************************************************************************
et en Automatique. All rig... | Menhir
, INRIA Rocquencourt
, PPS , Université Paris Diderot
Copyright 2005 - 2008 Institut National de Recherche en Informatique
under the terms of the Q Public License versi... |
d2efe8f2419edc416c593e37e79aa2300bb579dbd9fa29e463e18eca669335b0 | rowangithub/DOrder | 025_sum.ml | let rec sum n =
if n <= 0 then
0
else
n + sum (n-1)
let main n = assert (n <= sum n) | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/mochi2/benchs/025_sum.ml | ocaml | let rec sum n =
if n <= 0 then
0
else
n + sum (n-1)
let main n = assert (n <= sum n) | |
e0b71c208001f5475a56cbd89f3e2d4199402dfb1f6f6eed940fb3a437c89cba | geocaml/ISO3166 | ISO3166.mli | type alpha2 =
[ `AF
| `AX
| `AL
| `DZ
| `AS
| `AD
| `AO
| `AI
| `AQ
| `AG
| `AR
| `AM
| `AW
| `AU
| `AT
| `AZ
| `BS
| `BH
| `BD
| `BB
| `BY
| `BE
| `BZ
| `BJ
| `BM
| `BT
| `BO
| `BQ
| `BA
| `BW
| `BV
| `BR
| `IO
| `BN
| `BG
| `BF
| `BI
| `CV
... | null | https://raw.githubusercontent.com/geocaml/ISO3166/d14fda3468a12e6247c9823dcae482e78f7bcabb/src/lib/ISO3166.mli | ocaml | * Convert from an integer, this will only check that the number falls between [0-999]
and raise [Invalid_argument] if it doesn't. There is no check that the integer is in fact
a valid, assigned numeric country code.
* A country as defined by ISO3166.
* The numeric country code.
* Country info... | type alpha2 =
[ `AF
| `AX
| `AL
| `DZ
| `AS
| `AD
| `AO
| `AI
| `AQ
| `AG
| `AR
| `AM
| `AW
| `AU
| `AT
| `AZ
| `BS
| `BH
| `BD
| `BB
| `BY
| `BE
| `BZ
| `BJ
| `BM
| `BT
| `BO
| `BQ
| `BA
| `BW
| `BV
| `BR
| `IO
| `BN
| `BG
| `BF
| `BI
| `CV
... |
5edc82c2967ba59edca7623c0dae9c7efb0081cff9df4739aa3e7b3a75d642d8 | soulomoon/haskell-katas | Main.hs | module Main where
main :: IO ()
main = print "Hello world"
| null | https://raw.githubusercontent.com/soulomoon/haskell-katas/0861338e945e5cbaadf98138cf8f5f24a6ca8bb3/app/Main.hs | haskell | module Main where
main :: IO ()
main = print "Hello world"
| |
576d966dca7d83936b50e0c8691d6afc530bf2170c3774f63fcf961e8b5fee62 | metaocaml/ber-metaocaml | open_warnings.ml | TEST
flags = " -w A-41 - 42 - 18 "
* expect
flags = " -w A-41-42-18"
* expect
*)
module T1 : sig end = struct
module M = struct type t end (* unused type t *)
open M (* unused open *)
end;;
[%%expect{|
Line 2, characters 20-26:
2 | module M = struct type t end (* unused type t *)
... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/typing-warnings/open_warnings.ml | ocaml | unused type t
unused open
unused type t
unused open
used by line below
unused type and constructor
used by line below; shadow constructor A
A belongs to several types
used by line below; shadow constructor A
unused type and constructor
unused type and constructor
unused type and constructor
unu... | TEST
flags = " -w A-41 - 42 - 18 "
* expect
flags = " -w A-41-42-18"
* expect
*)
module T1 : sig end = struct
end;;
[%%expect{|
Line 2, characters 20-26:
^^^^^^
Warning 34: unused type t.
Line 3, characters 2-8:
^^^^^^
Warning 33: unused open M.
module T1 : sig end
|}]
... |
04c95c6a970c90605ab90c5626bb63295366f8df21297c001952878120188c92 | mk270/archipelago | game_protocol.mli |
Archipelago , a multi - user dungeon ( MUD ) server , by ( C ) 2009 - 2012
This programme is free software ; you may redistribute and/or modify
it under the terms of the GNU Affero General Public Licence as published by
the Free Software Foundation , either version 3 of said Licence , or
( ... | null | https://raw.githubusercontent.com/mk270/archipelago/4241bdc994da6d846637bcc079051405ee905c9b/src/server/game_protocol.mli | ocaml |
Archipelago , a multi - user dungeon ( MUD ) server , by ( C ) 2009 - 2012
This programme is free software ; you may redistribute and/or modify
it under the terms of the GNU Affero General Public Licence as published by
the Free Software Foundation , either version 3 of said Licence , or
( ... | |
655e4d2865afb61fb867b1ab1044ea1b77863d11a0d68bf7d0b4b7bbb14045e1 | kazu-yamamoto/mighttpd2 | WaiApp.hs | # LANGUAGE CPP #
{-# LANGUAGE OverloadedStrings #-}
module WaiApp (fileCgiApp) where
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as BS
import Network.HTTP.Types (preconditionFailed412, movedPermanently301, urlDecode, badRequest400)
import Network.Wai (Application, responseLBS)
import Ne... | null | https://raw.githubusercontent.com/kazu-yamamoto/mighttpd2/893a5faa81726c5eea6c4e588edd04e7d9c107f5/src/WaiApp.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE CPP #
module WaiApp (fileCgiApp) where
import Data.ByteString (ByteString)
import qualified Data.ByteString.Char8 as BS
import Network.HTTP.Types (preconditionFailed412, movedPermanently301, urlDecode, badRequest400)
import Network.Wai (Application, responseLBS)
import Network.Wai.Internal
import Network.W... |
72c64bc1781b05e95c877ca4c58908daede47d3a778a18b6f3474bdcdcc595e4 | romstad/clj-chess | book.clj | (ns clj-chess.book
(:require [clojure.java.io :as io]
[clojure.pprint :refer [cl-format]]
[clj-time.core :as time]
[clj-chess.board :as b]
[clj-chess.db :as db]
[clj-chess.game :as g])
(:import (java.io RandomAccessFile)
(chess Board Move Square... | null | https://raw.githubusercontent.com/romstad/clj-chess/1f7d4d0217c7299d49386a1e5dca404a37441728/src/clojure/clj_chess/book.clj | clojure | (ns clj-chess.book
(:require [clojure.java.io :as io]
[clojure.pprint :refer [cl-format]]
[clj-time.core :as time]
[clj-chess.board :as b]
[clj-chess.db :as db]
[clj-chess.game :as g])
(:import (java.io RandomAccessFile)
(chess Board Move Square... | |
62b45ffb666c1642545986e46d7b841ccca0f37ded5338567643e985b01491d0 | rescript-association/genType | ModuleName.ml | type t = string
let curry = "Curry"
let propTypes = "PropTypes"
let react = "React"
let rescriptPervasives = "RescriptPervasives"
let dotRegex = "." |> Str.quote |> Str.regexp
let lbracketRegex = "[" |> Str.quote |> Str.regexp
let rbracketRegex = "]" |> Str.quote |> Str.regexp
let sanitizeId s =
let s =
i... | null | https://raw.githubusercontent.com/rescript-association/genType/c19a86c13f0f05c983cce5794540a7c30a0c02a1/src/ModuleName.ml | ocaml | type t = string
let curry = "Curry"
let propTypes = "PropTypes"
let react = "React"
let rescriptPervasives = "RescriptPervasives"
let dotRegex = "." |> Str.quote |> Str.regexp
let lbracketRegex = "[" |> Str.quote |> Str.regexp
let rbracketRegex = "]" |> Str.quote |> Str.regexp
let sanitizeId s =
let s =
i... | |
7996417d8e81b341e3ea29f9a85c8e4337580a2ba9140a963219a9145cdd81ea | Mikolaj/horde-ad | OrthotopeOrphanInstances.hs | # LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wno - missing - methods #
# OPTIONS_GHC -Wno - orphans #
| Orphan instances for orthotope classes .
module HordeAd.Internal.OrthotopeOrphanInstances
( liftVT, liftVT2, liftVR, liftVR2, liftVS, liftVS2
) where
import Prelude
import Data.Array.Convert (Co... | null | https://raw.githubusercontent.com/Mikolaj/horde-ad/357a8af1b6ca255ce58ac1f94e0c75e2f4ffa07b/src/common/HordeAd/Internal/OrthotopeOrphanInstances.hs | haskell | by unsafe internal operations and then hmatrix helps some more.
However, the removal of the check vs run-time type is risky.
These constraints force @UndecidableInstances@.
often fails and there's no fix
often fails and there's no fix
very low priority, since these are all extremely not continuous
very low prior... | # LANGUAGE UndecidableInstances #
# OPTIONS_GHC -Wno - missing - methods #
# OPTIONS_GHC -Wno - orphans #
| Orphan instances for orthotope classes .
module HordeAd.Internal.OrthotopeOrphanInstances
( liftVT, liftVT2, liftVR, liftVR2, liftVS, liftVS2
) where
import Prelude
import Data.Array.Convert (Co... |
c5753c71fc15a820e8d7265bdbf4ad8cfa41f35d35ab63ace2a4aabc3cd18a84 | takikawa/racket-ppa | info.rkt | (module info setup/infotab (#%module-begin (define collection (quote multi)) (define deps (quote ("base"))) (define pkg-desc "Libraries for handling zo files") (define pkg-authors (quote (mflatt))) (define version "1.3") (define license (quote (Apache-2.0 OR MIT)))))
| null | https://raw.githubusercontent.com/takikawa/racket-ppa/d336bb10e3e0ec3a20020e9ade9e77d2f6f80b6d/share/pkgs/zo-lib/info.rkt | racket | (module info setup/infotab (#%module-begin (define collection (quote multi)) (define deps (quote ("base"))) (define pkg-desc "Libraries for handling zo files") (define pkg-authors (quote (mflatt))) (define version "1.3") (define license (quote (Apache-2.0 OR MIT)))))
| |
f5a38bc1f43103462ff81c5d12c02715c1dec0385f9489f7da7b380ec7622a84 | jxv/animate-preview | Main.hs | module Main where
import qualified Animate.Preview
main :: IO ()
main = Animate.Preview.main
| null | https://raw.githubusercontent.com/jxv/animate-preview/c5da38ed8cae0c558ff07833eb48a8e5831a2cc1/executable/Main.hs | haskell | module Main where
import qualified Animate.Preview
main :: IO ()
main = Animate.Preview.main
| |
fc6c658005131d86eb1792f9d5e6923b061c1379f50de5aefb2bbc6cfeb51a35 | evertedsphere/preposterous | Engine.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE OverloadedStrings #
{-# LANGUAGE FlexibleContexts #-}
{-# LANGUAGE LambdaCase #-}
# LANGUAGE MultiParamTypeClasses #
{-# LANGUAGE ScopedTypeVariables #-}
module Inference.Engine where
import Control.Lens hiding (rewrite)
import quali... | null | https://raw.githubusercontent.com/evertedsphere/preposterous/d8ee12fbef3589c6a93294c14eb6c51a0e49b8b5/lib/Inference/Engine.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
the "side-condition is not significant algorithmically"
| Constraint generation
[env] |-> e : typ ~> gen
| fuv(T,C) = fuv(T) U fuv(C), for now
| [sch]; [env] |-> prog
sch is... | # LANGUAGE OverloadedStrings #
# LANGUAGE MultiParamTypeClasses #
module Inference.Engine where
import Control.Lens hiding (rewrite)
import qualified Data.Map as Map
import qualified Data.Text as Text
import Eval.Monad
import Inference.Monad
import Types
i... |
c7c2cab4fb53e6053f27738a8b7f0c789fae86f00728354a636a7a2a432c9ea5 | rbkmoney/erlang_capi_v2 | capi_authorization_tests_SUITE.erl | -module(capi_authorization_tests_SUITE).
-include_lib("common_test/include/ct.hrl").
-include_lib("capi_dummy_data.hrl").
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
-include_lib("jose/include/jose_jwk.hrl").
-export([all/0]).
-export([groups/0]).
-export([init_per_suite/1]).
-export([end_per_... | null | https://raw.githubusercontent.com/rbkmoney/erlang_capi_v2/f469f166ae74ea1fd187b1b1358cc0bb3eb8ff55/apps/capi/test/capi_authorization_tests_SUITE.erl | erlang |
starting/stopping
Tests
| -module(capi_authorization_tests_SUITE).
-include_lib("common_test/include/ct.hrl").
-include_lib("capi_dummy_data.hrl").
-include_lib("damsel/include/dmsl_payment_processing_thrift.hrl").
-include_lib("jose/include/jose_jwk.hrl").
-export([all/0]).
-export([groups/0]).
-export([init_per_suite/1]).
-export([end_per_... |
85a937e62c68fa5c2e1d6ce7225a98bb64178f5723ce158183babefdb6711b26 | ocsigen/ocsigenserver | ocsigen_response.mli | type t
val make
: ?body:Cohttp_lwt.Body.t
-> ?cookies:Ocsigen_cookie_map.t
-> Cohttp.Response.t
-> t
val update
: ?response:Cohttp.Response.t
-> ?body:Cohttp_lwt.Body.t
-> ?cookies:Ocsigen_cookie_map.t
-> t
-> t
val of_cohttp
: ?cookies:Ocsigen_cookie_map.t
-> Cohttp.Response.t * Cohttp_lwt.... | null | https://raw.githubusercontent.com/ocsigen/ocsigenserver/d468cf464dcc9f05f820c35f346ffdbe6b9c7931/src/server/ocsigen_response.mli | ocaml | type t
val make
: ?body:Cohttp_lwt.Body.t
-> ?cookies:Ocsigen_cookie_map.t
-> Cohttp.Response.t
-> t
val update
: ?response:Cohttp.Response.t
-> ?body:Cohttp_lwt.Body.t
-> ?cookies:Ocsigen_cookie_map.t
-> t
-> t
val of_cohttp
: ?cookies:Ocsigen_cookie_map.t
-> Cohttp.Response.t * Cohttp_lwt.... | |
35e548bb8ac0709f168adb6dccabeb47bf8a926bb69186fecc7d3e4c219b16c6 | ekmett/haskell | Base.hs | # language PatternSynonyms #
module Unaligned.Base
( View(..)
, Cons(..)
, Uncons(..)
, Snoc(..)
, Unsnoc(..)
, Nil(..)
, Singleton(..)
, Q
, Cat
, Rev(..)
, pattern Nil
, pattern Cons
, pattern Snoc
) where
import Unaligned.Internal
| null | https://raw.githubusercontent.com/ekmett/haskell/37ad048531f5a3a13c6dfbf4772ee4325f0e4458/sequences/common/Unaligned/Base.hs | haskell | # language PatternSynonyms #
module Unaligned.Base
( View(..)
, Cons(..)
, Uncons(..)
, Snoc(..)
, Unsnoc(..)
, Nil(..)
, Singleton(..)
, Q
, Cat
, Rev(..)
, pattern Nil
, pattern Cons
, pattern Snoc
) where
import Unaligned.Internal
| |
8a63878707ec3e21083f57cd7c54d9ed0dd9a249249426c7b25c87020719d47a | shayan-najd/NativeMetaprogramming | T10971b.hs | # LANGUAGE MonomorphismRestriction , NoExtendedDefaultRules #
module T10971b where
import Data.Traversable (fmapDefault)
f = \x -> length x
g = \f x -> fmapDefault f x
h = \f x -> (fmapDefault f x, length x)
| null | https://raw.githubusercontent.com/shayan-najd/NativeMetaprogramming/24e5f85990642d3f0b0044be4327b8f52fce2ba3/testsuite/tests/typecheck/should_fail/T10971b.hs | haskell | # LANGUAGE MonomorphismRestriction , NoExtendedDefaultRules #
module T10971b where
import Data.Traversable (fmapDefault)
f = \x -> length x
g = \f x -> fmapDefault f x
h = \f x -> (fmapDefault f x, length x)
| |
21aee3baeb517dde46cb448965480b848c5f94e9903a8728c58d84ac83e25405 | ferigis/netconf | netconf_device.erl | %%%-------------------------------------------------------------------
%%% @doc
%%% This is module is the device behaviour.
%%% @end
%%%-------------------------------------------------------------------
-module(netconf_device).
-callback capabilities() -> []|list(string()).
| null | https://raw.githubusercontent.com/ferigis/netconf/c92654450039a0604296851b13e545db3e26d7bb/src/netconf_device.erl | erlang | -------------------------------------------------------------------
@doc
This is module is the device behaviour.
@end
------------------------------------------------------------------- | -module(netconf_device).
-callback capabilities() -> []|list(string()).
|
fe1a642b5a79e1b7331f12b2a21018242a778f5787dec14be61d35e497ab484e | RedlineResearch/floorplan | Literals.hs | |
Module : Language . Rust . Pretty . Literals
Description : Parsing literals
Copyright : ( c ) , 2017 - 2018
License : BSD - style
Maintainer :
Stability : experimental
Portability : portable
Functions for pretty printing literals .
Module : Language.Rust.Pretty.Literals
D... | null | https://raw.githubusercontent.com/RedlineResearch/floorplan/dbaa7e6649eed18707ff8a27ee3c33fa83b47fcf/src/Language/Rust/Pretty/Literals.hs | haskell | # LANGUAGE OverloadedStrings #
| Print literal suffix
| Print an integer literal
<> "0"
= pretty $ take (fromIntegral $ l - (fromIntegral thing)) (repeat '0')
| Extend a byte into a unicode character
| Constrain a unicode character to a byte
This assumes the character is in the right range already
| Escape a by... | |
Module : Language . Rust . Pretty . Literals
Description : Parsing literals
Copyright : ( c ) , 2017 - 2018
License : BSD - style
Maintainer :
Stability : experimental
Portability : portable
Functions for pretty printing literals .
Module : Language.Rust.Pretty.Literals
D... |
53b6389c803da579fb0f54fb8d99e8aef3d786fb305150ac04b5a99d3408a5ce | nasa/Common-Metadata-Repository | association_save_test.clj | (ns cmr.metadata-db.int-test.concepts.association-save-test
"Contains integration tests for saving generic associations. Tests saves with various
configurations including checking for proper error handling."
(:require
[clojure.edn :as edn]
[clojure.test :refer :all]
[cmr.metadata-db.int-test.concepts.ut... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/5bed3637580e2ad6e0b0ecda4c90845171ffeb8a/metadata-db-app/int-test/cmr/metadata_db/int_test/concepts/association_save_test.clj | clojure | (ns cmr.metadata-db.int-test.concepts.association-save-test
"Contains integration tests for saving generic associations. Tests saves with various
configurations including checking for proper error handling."
(:require
[clojure.edn :as edn]
[clojure.test :refer :all]
[cmr.metadata-db.int-test.concepts.ut... | |
5a6382cf1d9fcd2bbdb5aaf896cf71ad9b6a19c5cd510e8d007a1a22601df61f | nandor/llir-ocaml | linearize.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/nandor/llir-ocaml/9c019f15c444e30c825b1673cbe827e0497868fe/asmcomp/linearize.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Linear
let cons_instr d n =
{ desc = d; next = n; arg = [||]; res = [||];
dbg = Debuginfo.no... |
8b555b5c0f3a9af44c4c1287aedb891001969e63082f37ace8949ca7d983a7b5 | fractalide/fractalide | receive.rkt | #lang racket
(require fractalide/modules/rkt/rkt-fbp/agent
fractalide/modules/rkt/rkt-fbp/def)
(require (prefix-in gui: racket/gui))
(require racket/draw)
(require racket/runtime-path)
(define-runtime-path blank-path "./baconipsum.png")
; (define address-qr (read-bitmap address-qr-path))
(define-runtime-pat... | null | https://raw.githubusercontent.com/fractalide/fractalide/9c54ec2615fcc2a1f3363292d4eed2a0fcb9c3a5/modules/rkt/rkt-fbp/agents/cantor/wallet/receive.rkt | racket | (define address-qr (read-bitmap address-qr-path))
in port
out port
Generate a new addresses
List of existing addresses | #lang racket
(require fractalide/modules/rkt/rkt-fbp/agent
fractalide/modules/rkt/rkt-fbp/def)
(require (prefix-in gui: racket/gui))
(require racket/draw)
(require racket/runtime-path)
(define-runtime-path blank-path "./baconipsum.png")
(define-runtime-path qr-path "./qrcode.png")
(require/edge ${cantor.wa... |
0a8a1aafbe347abc9ab9d3df6999825636be14d29d6373ee1ad6822aa85bd233 | tanders/cluster-engine | 9c.lisp | (in-package cluster-engine)
(setf *random-state* (make-random-state t))
(print (cluster-engine::ClusterEngine 15 t nil
(append (r-canon '(0 1) :rhythm&pitch 1/2 -7)
(r-pitch-pitch #'(lambda (x) (if (and (first x) (second x)) (member (- (first x) (second x)) '(0 3 4 5 7 8 9)) t)) '(0 1) '(0) :beat :no_grace :... | null | https://raw.githubusercontent.com/tanders/cluster-engine/064ad4fd107f8d9a3dfcaf260524c2ab034c6d3f/test_files/9c.lisp | lisp | (in-package cluster-engine)
(setf *random-state* (make-random-state t))
(print (cluster-engine::ClusterEngine 15 t nil
(append (r-canon '(0 1) :rhythm&pitch 1/2 -7)
(r-pitch-pitch #'(lambda (x) (if (and (first x) (second x)) (member (- (first x) (second x)) '(0 3 4 5 7 8 9)) t)) '(0 1) '(0) :beat :no_grace :... | |
34831fe2fd264cefe9587b40c437a769d3a20e01e6b5886b061c25b805498af2 | LeventErkok/sbv | List.hs | -----------------------------------------------------------------------------
-- |
-- Module : TestSuite.Basics.List
Copyright : ( c )
-- License : BSD3
-- Maintainer:
-- Stability : experimental
--
-- Test the sequence/list functions.
--------------------------------------------------------------------------... | null | https://raw.githubusercontent.com/LeventErkok/sbv/46281c5610fbea68951133bd0417bc7a41d6547d/SBVTestSuite/TestSuite/Basics/List.hs | haskell | ---------------------------------------------------------------------------
|
Module : TestSuite.Basics.List
License : BSD3
Maintainer:
Stability : experimental
Test the sequence/list functions.
---------------------------------------------------------------------------
# OPTIONS_GHC -Wall -Werror #
Test ... | Copyright : ( c )
# LANGUAGE OverloadedLists #
# LANGUAGE ScopedTypeVariables #
module TestSuite.Basics.List(tests) where
import Data.SBV.Control
import Utils.SBVTestFramework
import Prelude hiding ((++), (!!))
import qualified Prelude as P ((++))
import Data.SBV.List ((!!), (++))
import qua... |
47b594b87c1e62934baf4eb34e79eae690e14cdff129994ebc7d80a817857f48 | Bogdanp/racket-gui-extra | init.rkt | #lang racket/base
(require mred/private/wx/cocoa/init)
| null | https://raw.githubusercontent.com/Bogdanp/racket-gui-extra/0760650cc1968db396e175c042e97ca597927739/gui-extra-lib/gui/extra/private/cocoa/init.rkt | racket | #lang racket/base
(require mred/private/wx/cocoa/init)
| |
1961c1307baf10af9532faf7b49f7e64a6969e8edb3be9343fa9b09266e817f2 | colis-anr/morsmall | testParser.ml | (***************************************************************************)
(* A concise AST for POSIX shell *)
(* *)
Copyright ( C ) 2017,2018,2019 , , ... | null | https://raw.githubusercontent.com/colis-anr/morsmall/33cd42984f421e5da8414e18059dcef276f0593b/src/utilities/testParser.ml | ocaml | *************************************************************************
A concise AST for POSIX shell
This program is free s... |
Copyright ( C ) 2017,2018,2019 , ,
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have ... |
66f00f3a254825ecb03c634d6ccdd5cd823d81169f29169e099e803c196263ab | f-f/dhall-clj | binary.clj | (ns dhall-clj.binary
(:require [clojure.string :as string]
[medley.core :refer [map-vals]]
[dhall-clj.ast :refer :all]
[clojure.java.io :as io]
[clj-cbor.core :as cbor]
[dhall-clj.fail :as fail])
(:import [dhall_clj.ast App]))
;; Main API
(declare cbor)
... | null | https://raw.githubusercontent.com/f-f/dhall-clj/05d25d2464972bbeae46d828b478b4cfd59836dc/src/dhall_clj/binary.clj | clojure | Main API
CBOR -> Dhall AST
If no builtins match, then it's a variable
Here we fail because if we got an array it must have at least
- the tag representing what it is
Here we exploit the fact that Text literals always have an odd count
and they alternate strings and exprs.
tuples of exprs and strings
Dhall AST ... | (ns dhall-clj.binary
(:require [clojure.string :as string]
[medley.core :refer [map-vals]]
[dhall-clj.ast :refer :all]
[clojure.java.io :as io]
[clj-cbor.core :as cbor]
[dhall-clj.fail :as fail])
(:import [dhall_clj.ast App]))
(declare cbor)
(declare dec... |
836da2a7b3a2c75f5695f25f1842c7e7bd9017f2d1837bc2821f824be7025344 | tmfg/mmtis-national-access-point | transit_changes_config.cljc | (ns ote.config.transit-changes-config
"Configuration values for the transit change detection feature.
This file contains constants which are not environment-specific, so they are defined here instead of hard-coding in
implementation files. Motivation is to have constants in one place for better overview to the fe... | null | https://raw.githubusercontent.com/tmfg/mmtis-national-access-point/a86cc890ffa1fe4f773083be5d2556e87a93d975/ote/src/cljc/ote/config/transit_changes_config.cljc | clojure | For reporting a no-traffic change, the length of no-traffic period must exceed this value
How many days into the future the detection task analyzes traffic for a service | (ns ote.config.transit-changes-config
"Configuration values for the transit change detection feature.
This file contains constants which are not environment-specific, so they are defined here instead of hard-coding in
implementation files. Motivation is to have constants in one place for better overview to the fe... |
5017bee07097a4ed3e525a5a79def078e2b10f2f0341cd3ca4b34ba22ccf300c | csabahruska/jhc-components | Collected.hs | module Ho.Collected(
CollectedHo(..),
choDataTable,
choClassHierarchy,
choTypeSynonyms,
choFixities,
choAssumps,
choRules,
choEs,
updateChoHo
)where
import Control.Monad.Identity
import Data.List
import Data.Monoid
import DataConstructors
import E.Annotate
import E.E
import Ho.... | null | https://raw.githubusercontent.com/csabahruska/jhc-components/a7dace481d017f5a83fbfc062bdd2d099133adf1/jhc-core/src/Ho/Collected.hs | haskell | this will have to merge rules and properties. | module Ho.Collected(
CollectedHo(..),
choDataTable,
choClassHierarchy,
choTypeSynonyms,
choFixities,
choAssumps,
choRules,
choEs,
updateChoHo
)where
import Control.Monad.Identity
import Data.List
import Data.Monoid
import DataConstructors
import E.Annotate
import E.E
import Ho.... |
046dfa0fe89a1aaf66a534bff0a217cf72de8db57ddfd9bc07004b5829f7ea3f | ku-fpg/haskino | TransRecurLetTestE.hs | -------------------------------------------------------------------------------
-- |
-- Module : System.Hardware.Haskino.SamplePrograms.Rewrite.TransRecurLetTestE
Copyright : ( c ) University of Kansas
-- License : BSD3
-- Stability : experimental
--
-- Recursion test example used for rewrite writt... | null | https://raw.githubusercontent.com/ku-fpg/haskino/9a0709c92c2da9b9371e292b00fd076e5539eb18/tests/TransTests/TransRecurLetTestE.hs | haskell | -----------------------------------------------------------------------------
|
Module : System.Hardware.Haskino.SamplePrograms.Rewrite.TransRecurLetTestE
License : BSD3
Stability : experimental
Recursion test example used for rewrite written in shallow version.
-------------------------------------... | Copyright : ( c ) University of Kansas
module System.Hardware.Haskino.SamplePrograms.Rewrite.TransRecurLetTestE(recurProgE) where
import Prelude hiding ((<*))
import System.Hardware.Haskino
import Control.Monad
import Control.Monad.Fix
import Data.Word
import Data.Boolean
data Key = KeyNone
| KeyRigh... |
6f07b9e1bf7cfe4308a787148809da977fdd25c9f717af2a6fede428d936fe00 | tezos/tezos-mirror | tx_rollup_benchmarks.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2022 Nomadic Labs , < >
(* ... | null | https://raw.githubusercontent.com/tezos/tezos-mirror/cdc7a4382ef6dfcd6c73f86d9a29b829b33d18d4/src/proto_alpha/lib_benchmarks_proto/tx_rollup_benchmarks.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2022 Nomadic Labs , < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETHER IN A... |
7424c48ef46de8668afbad1947706a4c4aa315b0eaf229c3ce08012db00e4a32 | 2600hz-archive/whistle | static_resource.erl | -module(static_resource).
-export([init/1, content_types_provided/2, resource_exists/2]).
-export([last_modified/2, generate_etag/2, content/2, encodings_provided/2]).
-include_lib("webmachine/include/webmachine.hrl").
-include_lib("kernel/include/file.hrl").
-include("crossbar.hrl").
-record(context, {
root = ""... | null | https://raw.githubusercontent.com/2600hz-archive/whistle/1a256604f0d037fac409ad5a55b6b17e545dcbf9/whistle_apps/apps/crossbar/src/static_resource.erl | erlang | -module(static_resource).
-export([init/1, content_types_provided/2, resource_exists/2]).
-export([last_modified/2, generate_etag/2, content/2, encodings_provided/2]).
-include_lib("webmachine/include/webmachine.hrl").
-include_lib("kernel/include/file.hrl").
-include("crossbar.hrl").
-record(context, {
root = ""... | |
4dbcb76395e320efe8beab48a14a3531b73976d7c441c1924fc81bb14184cd7e | agrafix/Spock | Benchmarks.hs | # LANGUAGE DataKinds #
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Criterion.Main
import Data.List (foldl', permutations)
import Data.Maybe (fromMaybe, listToMaybe)
import qualified Data.Text as T
import System.Random (mkStdGen, randomRs)
import Web.Routing.Combinators
import Web.Routing.SafeRouting
... | null | https://raw.githubusercontent.com/agrafix/Spock/6055362b54f2fae5418188c3fc2fc1659ca43e79/reroute/benchmarks/Benchmarks.hs | haskell | # LANGUAGE OverloadedStrings #
| Generate a number of paths consisting of a fixed number of fixed length
strings ("path segments") where the content of the segments are letters in
random order. Contains all permutations with the path.
| Length of each string
| Number of segments
| Number of routes | # LANGUAGE DataKinds #
module Main where
import Criterion.Main
import Data.List (foldl', permutations)
import Data.Maybe (fromMaybe, listToMaybe)
import qualified Data.Text as T
import System.Random (mkStdGen, randomRs)
import Web.Routing.Combinators
import Web.Routing.SafeRouting
buildPath :: [T.Text] -> PathIntern... |
fe4d314e74ebaa2d1ae12ed908f3c08efe5ac27022b7993f0cc2c3da1d61cbc2 | nuvla/api-server | kafka_test.clj | (ns sixsq.nuvla.server.util.kafka-test
(:require
[clojure.test :refer [deftest is use-fixtures]]
[kinsky.client :as kc]
[sixsq.nuvla.server.resources.lifecycle-test-utils :as ltu]
[sixsq.nuvla.server.util.kafka :as k]))
(def bootstrap-servers (format "%s:%s" ltu/kafka-host ltu/kafka-port))
(use-fi... | null | https://raw.githubusercontent.com/nuvla/api-server/17c8a5aa3e11899913db2f06a71de58c6051c10c/code/test/sixsq/nuvla/server/util/kafka_test.clj | clojure | (ns sixsq.nuvla.server.util.kafka-test
(:require
[clojure.test :refer [deftest is use-fixtures]]
[kinsky.client :as kc]
[sixsq.nuvla.server.resources.lifecycle-test-utils :as ltu]
[sixsq.nuvla.server.util.kafka :as k]))
(def bootstrap-servers (format "%s:%s" ltu/kafka-host ltu/kafka-port))
(use-fi... | |
6433b8e31e8689e9e8b2f358a397659d5782125a7a71046f58d3b96fb251c889 | fulcrologic/semantic-ui-wrapper | ui_transition.cljc | (ns com.fulcrologic.semantic-ui.modules.transition.ui-transition
(:require
[com.fulcrologic.semantic-ui.factory-helpers :as h]
#?(:cljs ["semantic-ui-react$Transition" :as Transition])))
(def ui-transition
"A transition is an animation usually used to move content in or out of view.
Props:
- anima... | null | https://raw.githubusercontent.com/fulcrologic/semantic-ui-wrapper/7bd53f445bc4ca7e052c69596dc089282671df6c/src/main/com/fulcrologic/semantic_ui/modules/transition/ui_transition.cljc | clojure | triggers the enter or exit animation." | (ns com.fulcrologic.semantic-ui.modules.transition.ui-transition
(:require
[com.fulcrologic.semantic-ui.factory-helpers :as h]
#?(:cljs ["semantic-ui-react$Transition" :as Transition])))
(def ui-transition
"A transition is an animation usually used to move content in or out of view.
Props:
- anima... |
e6b019c543b40579ad3eae23976dca1a6d0ed8b03e37e4e3685ef145569056e6 | soegaard/sketching | fullscreen.rkt | #lang sketching
(define x 0)
(define (setup)
(fullscreen)
(background 0)
(no-stroke)
(fill 102))
(define (draw)
(background 255)
(rect x (* 0.2 height) 1 (* 0.6 height))
(:= x (+ x 2)))
| null | https://raw.githubusercontent.com/soegaard/sketching/3773cb790ac69201c967201a2fa1727d90a4ad62/sketching-examples/reference-snippets/fullscreen.rkt | racket | #lang sketching
(define x 0)
(define (setup)
(fullscreen)
(background 0)
(no-stroke)
(fill 102))
(define (draw)
(background 255)
(rect x (* 0.2 height) 1 (* 0.6 height))
(:= x (+ x 2)))
| |
9e68b619c09bd26ec5099bd7e2f20c542503a535959843afb75f6eb087622d73 | lingnand/VIMonad | ManageHelpers.hs | -----------------------------------------------------------------------------
-- |
-- Module : XMonad.Hooks.ManageHelpers
Copyright : ( c )
-- License : BSD
--
Maintainer : >
-- Stability : unstable
-- Portability : unportable
--
This module provides helper functions to be used in @man... | null | https://raw.githubusercontent.com/lingnand/VIMonad/048e419fc4ef57a5235dbaeef8890faf6956b574/XMonadContrib/XMonad/Hooks/ManageHelpers.hs | haskell | ---------------------------------------------------------------------------
|
Module : XMonad.Hooks.ManageHelpers
License : BSD
Stability : unstable
Portability : unportable
how you might use this:
> import XMonad.Hooks.ManageHelpers
> main =
> xmonad def{
> ...
> manage... | Copyright : ( c )
Maintainer : >
This module provides helper functions to be used in @manageHook@. Here 's
module XMonad.Hooks.ManageHelpers (
Side(..),
composeOne,
currentWs,
isInProperty,
isKDETrayWindow,
isFullscreen,
isDialog,
pid,
transientTo,
maybeToDefi... |
4dac9b9359edd9cbdf4719271b409355b02578c4d1820bd899a7462c740be043 | dizengrong/erlang_game | gen_cache.erl | %% @doc 通用缓存系统
%% 实现说明:
%% 这里对每个数据库表使用了三张ets表
1.record数据表:用来存在具体数据的 ,
%% 不过由于mysql和ets关键字问题,我做了一个双休转化的:
rec_transform_cache_to_db : 缓存ets中的数据转化到mysql
rec_transform_db_to_cache :
2.index索引表:因为我们的数据大都是以玩家id为建立的,会有一对多的情况
)
索引表的数据为{Index ,
3.dirty脏数据表:被更新过的数据都会变为脏数据,然后对他们进行记录,以便进行差量更... | null | https://raw.githubusercontent.com/dizengrong/erlang_game/4598f97daa9ca5eecff292ac401dd8f903eea867/gerl/src/cache/gen_cache.erl | erlang | @doc 通用缓存系统
实现说明:
这里对每个数据库表使用了三张ets表
不过由于mysql和ets关键字问题,我做了一个双休转化的:
保存缓存数据到数据库的间隔1(ms)
保存缓存数据到数据库的间隔2(ms)
TODO:使用global来注册进程,是为了获得节点透明性的好处
但是global名称在分布式环境下的同步问题可能会存在通信量问题
因此这里以后可以改成local方式来注册进程,然后再封装一套RPC方法来获取数据
@doc lookup支持两种查询:
1.Key只是索引字段值的查询
@doc 和ets:lookup_element/3方法一样
@doc 同步数据插入,会立马插入到数据库中并更... | 1.record数据表:用来存在具体数据的 ,
rec_transform_cache_to_db : 缓存ets中的数据转化到mysql
rec_transform_db_to_cache :
2.index索引表:因为我们的数据大都是以玩家id为建立的,会有一对多的情况
)
索引表的数据为{Index ,
3.dirty脏数据表:被更新过的数据都会变为脏数据,然后对他们进行记录,以便进行差量更新
-module (gen_cache).
-include ("gen_cache.hrl").
-include ("log.hrl").
-exp... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.