_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 |
|---|---|---|---|---|---|---|---|---|
de607a48d2bd7b8d7cf2ba2f88b9e3903c9891ad7238729904c24723c42a0060 | khotyn/4clojure-answer | 96-beauty-is-symmetry.clj | (fn [s]
(let [a (second s) b (last s)]
(letfn
[(mirror [s]
(let [x (second s) y (last s)]
(if
(and (nil? x) (nil? y))
s
(list (first s)
(if (nil? y) y (mirror y))
(if (nil? x) x (mirror x))))))]
(= a (mirror b))))) | null | https://raw.githubusercontent.com/khotyn/4clojure-answer/3de82d732faedceafac4f1585a72d0712fe5d3c6/96-beauty-is-symmetry.clj | clojure | (fn [s]
(let [a (second s) b (last s)]
(letfn
[(mirror [s]
(let [x (second s) y (last s)]
(if
(and (nil? x) (nil? y))
s
(list (first s)
(if (nil? y) y (mirror y))
(if (nil? x) x (mirror x))))))]
(= a (mirror b))))) | |
cc4fb0d372b9e13eb57db3009d7ea0f0165b37406134807d130ca1a2fac9b92c | backtracking/functory | master_test.ml | (**************************************************************************)
(* *)
(* Functory: a distributed computing library for OCaml *)
Copyright ( C ) 2010- and
(* ... | null | https://raw.githubusercontent.com/backtracking/functory/75368305a853a90ebea9e306d82e4ef32649d1ce/master_test.ml | ocaml | ************************************************************************
Functory: a distributed computing library for OCaml
This software is free soft... | Copyright ( C ) 2010- and
modify it under the terms of the GNU Library General Public
License version 2.1 , with the special exception on linking
open Format
open Unix
open Functory
let server = ref "localhost"
let port = ref 51000
let () =
Arg.parse
["-server", Arg.Set_s... |
a5291744081d5cb9246aea96685ede4fa1a25cdc2a8fe67424b1e0d6ca887954 | metaocaml/ber-metaocaml | anonymous_class_parameter.ml | (* TEST
flags = "-i"
* setup-ocamlc.byte-build-env
** ocamlc.byte
*** check-ocamlc.byte-output
*)
(* This test is valid OCaml code.
It uses an anonymous type variable as a formal parameter in a class
declaration. This used to be rejected by the parser, even though the
printer (ocamlc -i) could in ... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/testsuite/tests/parsing/anonymous_class_parameter.ml | ocaml | TEST
flags = "-i"
* setup-ocamlc.byte-build-env
** ocamlc.byte
*** check-ocamlc.byte-output
This test is valid OCaml code.
It uses an anonymous type variable as a formal parameter in a class
declaration. This used to be rejected by the parser, even though the
printer (ocamlc -i) could in fact pr... |
class ['a, _] foo = object
method bar: 'a -> 'a = fun x -> x
end
|
b327bced6eeba43a912d849886ac53fea6064f073583a63fef29bd453e9f532d | roosta/herb | vendor_local.cljs | (ns site.snippets.vendor-local)
(defn style []
^{:vendors [:webkit]
:prefix true}
{:transition "all 1s ease-in"})
| null | https://raw.githubusercontent.com/roosta/herb/64afb133a7bf51d7171a3c5260584c09dbe4e504/site/src/site/snippets/vendor_local.cljs | clojure | (ns site.snippets.vendor-local)
(defn style []
^{:vendors [:webkit]
:prefix true}
{:transition "all 1s ease-in"})
| |
24e89f824c9103b745c95ca368f5cfbac19bb9a8834a1596acadd09d889cb4ef | bluelisp/hemlock | unixcoms.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
;;;
;;;
;;; ******************************************... | null | https://raw.githubusercontent.com/bluelisp/hemlock/47e16ba731a0cf4ffd7fb2110e17c764ae757170/src/unixcoms.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
**********************************************************************
**********************************************************************
This file contains Commands useful when running on a Unix box. Hopefully
Lisp dependencies, such as RUN-PROGRAM.
Region and... | This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
there are no CMU Unix dependencies though there are probably CMU Common
Written by .
(in-package :hemlock)
(defhvar "Print Utility"
"UNIX(tm) program to invoke (via E... |
337092ce6acebde87fc73223540fc0bc7d38d229fcc91ccc1be315cce2a46c93 | restyled-io/restyled.io | Expectations.hs | module Restyled.Test.Expectations
( shouldMatchJson
, shouldRedirectTo
, shouldBeWithin
, expectRight
, expectationFailure
, module X
) where
import Restyled.Prelude
import qualified Data.Text as T
import Restyled.Foundation
import qualified Test.Hspec.Expectations.Json as HSpec
import Tes... | null | https://raw.githubusercontent.com/restyled-io/restyled.io/7b53f3d485a3d805da946aaf359174ea2f1ddf01/test/Restyled/Test/Expectations.hs | haskell | ^ Perform the request
This would be more explicit and ought to work, but is always a parse
failure. Sigh.
location <- getLocation | module Restyled.Test.Expectations
( shouldMatchJson
, shouldRedirectTo
, shouldBeWithin
, expectRight
, expectationFailure
, module X
) where
import Restyled.Prelude
import qualified Data.Text as T
import Restyled.Foundation
import qualified Test.Hspec.Expectations.Json as HSpec
import Tes... |
de790a4d873cdd692b3dfab6d4b1a4dfaab20705956fbe09dc09d2aaab1105c7 | KestrelInstitute/Specware | System.lisp | (defpackage :System-Spec (:use :cl))
(in-package :System-Spec)
(setq SpecToLisp::SuppressGeneratedDefuns
(append '("System-Spec::|!random|"
"System-Spec::anyToString"
"System-Spec::writeLine"
"System-Spec::|!warn|"
)
SpecToLisp::SuppressGeneratedDefuns))
(defvar specwareDeb... | null | https://raw.githubusercontent.com/KestrelInstitute/Specware/2be6411c55f26432bf5c9e2f7778128898220c24/Library/Legacy/Utilities/Handwritten/Lisp/System.lisp | lisp | op fail : [a] String -> a
op debug : [a] String -> a
NIL -- handle as any other data
:TERSE -- search for specs and print them like this: #<spec with I elements, J types, K ops, qualified as "foo">
elements: SpecElements
qualifier: Option Qualifier
:limited
op anyToString : [a] a -> String
op ... | (defpackage :System-Spec (:use :cl))
(in-package :System-Spec)
(setq SpecToLisp::SuppressGeneratedDefuns
(append '("System-Spec::|!random|"
"System-Spec::anyToString"
"System-Spec::writeLine"
"System-Spec::|!warn|"
)
SpecToLisp::SuppressGeneratedDefuns))
(defvar specwareDeb... |
e1e2c0d96bdaebeb73c7c2fbbf6cd0d70202138242a8e08775c4341150f54687 | logicmoo/wam_common_lisp | ffi.lsp | ;;;; -*- Mode: Lisp; Syntax: Common-Lisp; indent-tabs-mode: nil; Package: SYSTEM -*-
;;;; vim: set filetype=lisp tabstop=8 shiftwidth=2 expandtab:
;;;;
Copyright ( c ) 2001 ,
;;;;
;;;; This program is free software; you can redistribute it and/or
modify it under the terms of the GNU Library General Pub... | null | https://raw.githubusercontent.com/logicmoo/wam_common_lisp/4396d9e26b050f68182d65c9a2d5a939557616dd/prolog/wam_cl/src/lsp/ffi.lsp | lisp | -*- Mode: Lisp; Syntax: Common-Lisp; indent-tabs-mode: nil; Package: SYSTEM -*-
vim: set filetype=lisp tabstop=8 shiftwidth=2 expandtab:
This program is free software; you can redistribute it and/or
either
See file '../Copyright' for full details.
----------------------------------------------------------... |
Copyright ( c ) 2001 ,
modify it under the terms of the GNU Library General Public
version 2 of the License , or ( at your option ) any later version .
FFI Symbols used in the foreign function interface
(in-package "FFI")
(import 'si:null-pointer-p)
(export 'si:null-pointer-p)
#-ecl-min... |
ce5ac5788a366ef071411f2b2555d9cbb41b23da1a57cd23ca8f7abc2e95c738 | nikita-volkov/graph-db | Model.hs | -- |
-- A shared model.
-- Subjects provide implementation for 'Session'.
module Benchmarks.Model where
import Benchmarks.Prelude
-- * Values
-------------------------
newtype UID a = UID Int deriving (Show, Eq, Ord, Generic, Data, Typeable, Enum, Num, Real, Integral)
data Artist = Artist Name deriving (Show, Eq, O... | null | https://raw.githubusercontent.com/nikita-volkov/graph-db/3e886f6b298d2b2b09eb94c2818a7b648f42cb0a/executables/Benchmarks/Model.hs | haskell | |
A shared model.
Subjects provide implementation for 'Session'.
* Values
-----------------------
# UNPACK #
* Session
----------------------- | module Benchmarks.Model where
import Benchmarks.Prelude
newtype UID a = UID Int deriving (Show, Eq, Ord, Generic, Data, Typeable, Enum, Num, Real, Integral)
data Artist = Artist Name deriving (Show, Eq, Ord, Generic, Data, Typeable)
data Genre = Genre Name deriving (Show, Eq, Ord, Generic, Data, Typeable)
data Song... |
5c643ca30f7b9efef995f252d34f721f70f64735c541095447e92ca2ccddd964 | cstar/ejabberd-old | ejabberd_logger_h.erl | %%%----------------------------------------------------------------------
%%% File : ejabberd_logger_h.erl
Author : < >
%%% Purpose : Manage Erlang logging.
Created : 23 Oct 2003 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2010 ProcessOne
%%%
%%% This program is free software; you can redistrib... | null | https://raw.githubusercontent.com/cstar/ejabberd-old/559f8b6b0a935710fe93e9afacb4270d6d6ea00f/src/ejabberd_logger_h.erl | erlang | ----------------------------------------------------------------------
File : ejabberd_logger_h.erl
Purpose : Manage Erlang logging.
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
... | Author : < >
Created : 23 Oct 2003 by < >
ejabberd , Copyright ( C ) 2002 - 2010 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License
Founda... |
5a900f93de7e75ad50869bccc10cc2b2f77e45d02df950e27bd96aebd35120cc | OCamlPro/socaml-analyzer | good.ml | let x = 1
let () = print_endline "This file only exists for testing purpose"
let y = x + 2
let z = y * y
let () = print_endline "Please make sure that it won't throw any exception when you edit it"
let () = print_endline "Please also make sure that the analysis won't see any cranky exception"
| null | https://raw.githubusercontent.com/OCamlPro/socaml-analyzer/f39121e1d05a9e5bb6f005497eaaa5a67f256d4c/test/samples/good.ml | ocaml | let x = 1
let () = print_endline "This file only exists for testing purpose"
let y = x + 2
let z = y * y
let () = print_endline "Please make sure that it won't throw any exception when you edit it"
let () = print_endline "Please also make sure that the analysis won't see any cranky exception"
| |
7e9aa931382f83da2e280c1745340c07ec52fe3cb372192cc72c254b3650f778 | philnguyen/soft-contract | dynamic.rkt | #lang racket
This benchmark was obtained from ,
based on code .
970215 / wdc Removed most i / o and added dynamic - benchmark .
990707 / lth Added a quote and changed the call to run - benchmark .
010404 / wdc Changed the input file path name to " dynamic-input.sch " .
's dynamic type inferencer , se... | null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/larceny/dynamic.rkt | racket | (see the end of this file).
----------------------------------------------------------------------------
Environment management
----------------------------------------------------------------------------
general environment operations
empty-env: Env
gen-binding: Key x Value -> Binding
binding-key: Binding -> Ke... | #lang racket
This benchmark was obtained from ,
based on code .
970215 / wdc Removed most i / o and added dynamic - benchmark .
990707 / lth Added a quote and changed the call to run - benchmark .
010404 / wdc Changed the input file path name to " dynamic-input.sch " .
's dynamic type inferencer , se... |
8df5c88b5499cf0d168cb95f5b0d3d7f858390ca338622836ea9cb358ce4b170 | finnishtransportagency/harja | raporttien_suoritustieto.cljs | (ns harja.views.hallinta.raporttien-suoritustieto
(:require [reagent.core :refer [atom] :as reagent]
[cljs.core.async :refer [<! >! chan close!]]
[harja.domain.raportointi :as raportti-domain]
[harja.tiedot.hallinta.raporttien-suoritustieto :as tiedot]
[harja.tiedot.ha... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/c02df7e75c7a098a008c2595573b8738d3f9b8b4/src/cljs/harja/views/hallinta/raporttien_suoritustieto.cljs | clojure | (ns harja.views.hallinta.raporttien-suoritustieto
(:require [reagent.core :refer [atom] :as reagent]
[cljs.core.async :refer [<! >! chan close!]]
[harja.domain.raportointi :as raportti-domain]
[harja.tiedot.hallinta.raporttien-suoritustieto :as tiedot]
[harja.tiedot.ha... | |
9e4885f7baa2d5fa9a1a77cb4111bb402b0d3d9e79817826c3a8f88d1f4dd386 | jarcane/heresy | infix-math.rkt | #lang heresy
;; based on maya.clj:
;;
;; -dsl-for-math-and-numerical-work.html
(require "../lib/infix-math.rkt"
"../lib/require-stuff.rkt"
rackunit
(only-in racket/base sqrt))
(def macro ~> (a b) (b a))
(test-case "quadratic1"
(def fn quadratic (a b c)
(m let d = 4 * a * c
l... | null | https://raw.githubusercontent.com/jarcane/heresy/a736b69178dffa2ef97f5eb5204f3e06840088c2/tests/infix-math.rkt | racket | based on maya.clj:
-dsl-for-math-and-numerical-work.html | #lang heresy
(require "../lib/infix-math.rkt"
"../lib/require-stuff.rkt"
rackunit
(only-in racket/base sqrt))
(def macro ~> (a b) (b a))
(test-case "quadratic1"
(def fn quadratic (a b c)
(m let d = 4 * a * c
let D = b * b - d ~> sqrt
let t = 2 * a let -b = (- b)
... |
57ee8cdea39fb720e22f530dbd388ec3e95e1f6b40dd8ec48c0705a96445ec72 | openvstorage/alba | asd_client.ml |
Copyright ( C ) iNuron -
This file is part of Open vStorage . For license information , see < LICENSE.txt >
Copyright (C) iNuron -
This file is part of Open vStorage. For license information, see <LICENSE.txt>
*)
open! Prelude
open Lwt.Infix
open Slice
open Asd_protocol
open Protocol
open Range_query_a... | null | https://raw.githubusercontent.com/openvstorage/alba/459bd459335138d6b282d332fcff53a1b4300c29/ocaml/src/asd_client.ml | ocaml |
Copyright ( C ) iNuron -
This file is part of Open vStorage . For license information , see < LICENSE.txt >
Copyright (C) iNuron -
This file is part of Open vStorage. For license information, see <LICENSE.txt>
*)
open! Prelude
open Lwt.Infix
open Slice
open Asd_protocol
open Protocol
open Range_query_a... | |
c8c68e42bf1884d7cd55b92474f23374780c8c979b8b73a6e0ed0a5faaf85fdb | vagarenko/static-tensor | Remove_2_0.hs | # LANGUAGE TypeApplications #
{-# LANGUAGE TypeInType #-}
module CoreDump.Tensor.Remove_2_0 where
import Data.Tensor.Static
import TensorInstances ()
remove_2_0_ :: Tensor '[2, 3, 4] Float -> Tensor '[2, 3, 3] Float
remove_2_0_ = remove @2 @0
| null | https://raw.githubusercontent.com/vagarenko/static-tensor/8409d281707c23f3fe2028e926f1d4e8f7a9bc2d/tests/CoreDump/Tensor/Remove_2_0.hs | haskell | # LANGUAGE TypeInType # | # LANGUAGE TypeApplications #
module CoreDump.Tensor.Remove_2_0 where
import Data.Tensor.Static
import TensorInstances ()
remove_2_0_ :: Tensor '[2, 3, 4] Float -> Tensor '[2, 3, 3] Float
remove_2_0_ = remove @2 @0
|
1390ac2309f4092f95606c0b3413dcf739f2ccd4baec4751dad57e6ce3c3d848 | fulcrologic/fulcro-rad-sql | sql.cljs | (ns com.fulcrologic.rad.database-adapters.sql
"ns for aliasing")
| null | https://raw.githubusercontent.com/fulcrologic/fulcro-rad-sql/ff022ffb861330692e0997a5ad8af09605a683c4/src/main/com/fulcrologic/rad/database_adapters/sql.cljs | clojure | (ns com.fulcrologic.rad.database-adapters.sql
"ns for aliasing")
| |
a86df15102048a2488ffccb63309c8d7b92ddf0cc3f86c5b4af2056faca95e91 | openbadgefactory/salava | edit.cljs | (ns salava.profile.ui.edit
(:require [reagent.core :refer [atom cursor create-class]]
[reagent.session :as session]
[salava.core.ui.ajax-utils :as ajax]
[salava.core.ui.helper :refer [path-for plugin-fun navigate-to js-navigate-to]]
[salava.core.i18n :refer [t]]
... | null | https://raw.githubusercontent.com/openbadgefactory/salava/97f05992406e4dcbe3c4bff75c04378d19606b61/src/cljs/salava/profile/ui/edit.cljs | clojure | {:id "page-edit"}
{:id "badge-content"}
#profile | (ns salava.profile.ui.edit
(:require [reagent.core :refer [atom cursor create-class]]
[reagent.session :as session]
[salava.core.ui.ajax-utils :as ajax]
[salava.core.ui.helper :refer [path-for plugin-fun navigate-to js-navigate-to]]
[salava.core.i18n :refer [t]]
... |
77ff0ddd6ad0b1515966e16bb1c3b51f57be586ab11a7b5008bae51cd95d8685 | weavejester/euclidean | matrix.clj | (ns euclidean.math.matrix
(:require [euclidean.math.vector :as vec])
(:import (euclidean.math.vector Vector2D Vector3D Vector4D)))
(defprotocol Matrix
(^:no-doc add* [m1 m2] "Add two matrices together.")
(^:no-doc sub* [m1 m2] "Subtract the second matrix from the first.")
(^:no-doc mult* [m1 m2] "Multiply on... | null | https://raw.githubusercontent.com/weavejester/euclidean/3e52fb59afc8d305fe04b212425138dcd9760829/src/euclidean/math/matrix.clj | clojure | (ns euclidean.math.matrix
(:require [euclidean.math.vector :as vec])
(:import (euclidean.math.vector Vector2D Vector3D Vector4D)))
(defprotocol Matrix
(^:no-doc add* [m1 m2] "Add two matrices together.")
(^:no-doc sub* [m1 m2] "Subtract the second matrix from the first.")
(^:no-doc mult* [m1 m2] "Multiply on... | |
26e7c123defe673b325e6a5c4a4bf6b8cfe9dab15c7360c709b093ca5a848a0f | BranchTaken/Hemlock | q.mli | * Lazy - evaluated immutable queue .
The q is an immutable queue container . All operations on q are amortized via lazy execution and
are O(1 ) .
The q is an immutable queue container. All operations on q are amortized via lazy execution and
are O(1). *)
open Rudiments0
* { 1 Type and derivation... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/207ede78129be95ec063cf2bb3c955760c2fd303/bootstrap/src/basis/q.mli | ocaml | * {1 Creation}
* {1 Length}
* Return q length.
* Return [true] if q length is 0; [false] otherwise.
* Return tail (a q of all elements except head), or halt if q is empty.
* {1 Combining and partitioning}
* Push element onto back of q and return resulting q with element as back.
* Pop head element off q and retu... | * Lazy - evaluated immutable queue .
The q is an immutable queue container . All operations on q are amortized via lazy execution and
are O(1 ) .
The q is an immutable queue container. All operations on q are amortized via lazy execution and
are O(1). *)
open Rudiments0
* { 1 Type and derivation... |
9a9927b90b11c23d21369f239ee64ffdb0b9ab807bbf0467073655ce21b73adb | tommaisey/aeon | lpz1.help.scm | ;; (lpz1 ar in)
Two point average filter
(audition
(out 0 (lpz1 (mul (white-noise ar) 0.25))))
| null | https://raw.githubusercontent.com/tommaisey/aeon/80744a7235425c47a061ec8324d923c53ebedf15/libs/third-party/sc3/rsc3/help/ugen/filters/lpz1.help.scm | scheme | (lpz1 ar in) |
Two point average filter
(audition
(out 0 (lpz1 (mul (white-noise ar) 0.25))))
|
64c4e8c35eaf493e445c1ee0ab4a2342dd0022846e8c2bad59998b8fd4db2d67 | igorhvr/bedlam | txpath.scm | Classic TXPath implementation based on sxpathlib , sxpath - ext and txp - parser
;
; This software is in Public Domain.
IT IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND .
;
; Please send bug reports and comments to:
; Dmitry Lizorkin
;
; XPointer's points and ranges are NOT implemented
;
;... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/siscweb/siscweb-src-0.5/opt/sxml/scm/sxpath/txpath.scm | scheme |
This software is in Public Domain.
Please send bug reports and comments to:
Dmitry Lizorkin
XPointer's points and ranges are NOT implemented
Full XPath Core Function Library is supported. That is:
number last()
number position()
number count(node-set)
node-set id(object)
string local-... | Classic TXPath implementation based on sxpathlib , sxpath - ext and txp - parser
IT IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND .
4.1 Node Set Functions
4.3 Boolean Functions
)
)
4.4 Number Functions
number round(number )
Auxilliary
a sub - expression which caus... |
f2b0cb887995252545b03afda42a450bce2d3e4e0d5c63b102a432616222acd7 | CryptoKami/cryptokami-core | Metrics.hs | {-# LANGUAGE Rank2Types #-}
-- | This module basically combines reporting functionality with metrics.
module Pos.Reporting.Metrics
( MetricMonitor (..)
, MetricMonitorState
, mkMetricMonitorState
, noReportMonitor
, recordValue
) where
import Universum
import ... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/infra/Pos/Reporting/Metrics.hs | haskell | # LANGUAGE Rank2Types #
| This module basically combines reporting functionality with metrics.
function (see below).
Note: currently this type only supports 'Gauge' metric type. We can
generalize it later if necessary.
^ A predicate which determines which values should be also
'Nothing' means that value is good ... |
module Pos.Reporting.Metrics
( MetricMonitor (..)
, MetricMonitorState
, mkMetricMonitorState
, noReportMonitor
, recordValue
) where
import Universum
import Data.Time.Units (Microsecond)
import Formatting (Format, build, sformat)
import ... |
53093ff6b1a58c986b118caf2916534b90ad7faba65bb0c0a27dc45a9b44581e | static-analysis-engineering/codehawk | bCHVarDictionary.mli | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/e8fed9f226abe38578768968279c8242eb21fea9/CodeHawk/CHB/bchlib/bCHVarDictionary.mli | ocaml | xprlib
bchlib | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... |
74958c8ad64cd9372ddebb69298dc04184a7faba209ab25484d341da35316ae6 | chuchao333/6.945 | load.scm | Fun with Continuations
(load "funco")
;; AMB Scheme extensions
(load "stack-queue")
(load "ambsch")
AMB Examples from SICP
(load "examples")
':have-fun!
| null | https://raw.githubusercontent.com/chuchao333/6.945/c50bb28aadf0c3fcda3c8e56b4a61b9a2d582552/ps6/code/load.scm | scheme | AMB Scheme extensions | Fun with Continuations
(load "funco")
(load "stack-queue")
(load "ambsch")
AMB Examples from SICP
(load "examples")
':have-fun!
|
399cece9bfc315ec88c7271e66dde1bbc049cfe1587a3589e2361f62e032fe7b | Tclv/HaskellBook | ChapterExercises.hs | newtype Word' = Word' String deriving (Eq, Show)
vowels :: [Char]
vowels = ['a', 'e', 'u', 'i', 'o']
consonants :: [Char]
consonants = "bcdfghjklmnpqrstvwxyz"
notThe :: String -> Maybe String
notThe a
| a == "the" = Nothing
| otherwise = Just a
replaceThe :: String -> String
replaceThe = unwords . map repl... | null | https://raw.githubusercontent.com/Tclv/HaskellBook/78eaa5c67579526b0f00f85a10be3156bc304c14/ch12/ChapterExercises.hs | haskell | newtype Word' = Word' String deriving (Eq, Show)
vowels :: [Char]
vowels = ['a', 'e', 'u', 'i', 'o']
consonants :: [Char]
consonants = "bcdfghjklmnpqrstvwxyz"
notThe :: String -> Maybe String
notThe a
| a == "the" = Nothing
| otherwise = Just a
replaceThe :: String -> String
replaceThe = unwords . map repl... | |
92cb1243c57ca1ed2b6be54a8c702dce9fcac34aeb550db809fdf4a55606bcd3 | monadbobo/ocaml-core | core_sys.ml | module LargeFile = Unix.LargeFile
let getenv var = try Some (Sys.getenv var) with Not_found -> None
let getenv_exn var =
match getenv var with
| Some x -> x
| None ->
Core_printf.failwithf
"Sys.getenv_exn: environment variable %s is not set" var ()
let stat_check_exn f ?(follow_symlinks=true) path =... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/lib/core_sys.ml | ocaml | module LargeFile = Unix.LargeFile
let getenv var = try Some (Sys.getenv var) with Not_found -> None
let getenv_exn var =
match getenv var with
| Some x -> x
| None ->
Core_printf.failwithf
"Sys.getenv_exn: environment variable %s is not set" var ()
let stat_check_exn f ?(follow_symlinks=true) path =... | |
60cf04675795fdf483a6b2e3da38b538f51e7911e820731ee2b00cbcd2bda302 | regex-generate/regenerate | test_re.ml | let () = Printexc.record_backtrace true
(* Turn a regular expression from Regenerate into an Re one. *)
let rec to_re = let open Regenerate.Regex in function
| One -> Re.epsilon
| Set (true, l) -> Re.set @@ CCString.of_list l
| Set (false, l) -> Re.compl [Re.set @@ CCString.of_list l]
| Seq (re, re') -> Re.seq... | null | https://raw.githubusercontent.com/regex-generate/regenerate/a616d6c2faf4a55f794ac9b6fbf03acca91fbeb9/test/re/test_re.ml | ocaml | Turn a regular expression from Regenerate into an Re one.
Re does not handle arbitrary complement.
Check positive and negative samples.
Discard regular expressions that Re does not handle.
Should we generate complement operations?
Printer for characters
Average number of sampes for each regular expression | let () = Printexc.record_backtrace true
let rec to_re = let open Regenerate.Regex in function
| One -> Re.epsilon
| Set (true, l) -> Re.set @@ CCString.of_list l
| Set (false, l) -> Re.compl [Re.set @@ CCString.of_list l]
| Seq (re, re') -> Re.seq [to_re re; to_re re']
| Or (re, re') -> Re.alt [to_re re; to_... |
dfc10785f8ce29f5abd076411eebb5596f2307baebe037d8bf7ea528b882dd1d | dsheets/codoc | codocXml.ml |
* Copyright ( c ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/dsheets/codoc/382077cf3e7e20e478bd97cc0b348e0b2ec926db/lib/codocXml.ml | ocaml | TODO: ? |
* Copyright ( c ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... |
4a32232f898cab287b5feb0ce4bc29a7ec5911d6c3e396988519f8471ed8e25b | okeuday/erlbench | jsx.erl | %% The MIT License
Copyright ( c ) 2010 - 2013 < >
%% Permission is hereby granted, free of charge, to any person obtaining a copy
%% of this software and associated documentation files (the "Software"), to deal
in the Software without restriction , including without limitation the rights
%% to use, copy, modi... | null | https://raw.githubusercontent.com/okeuday/erlbench/9fc02a2e748b287b85f6e9641db6b2ca68791fa4/src/jsx.erl | erlang | The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
furnished to do so, subject to the following conditions:
The above co... |
Copyright ( c ) 2010 - 2013 < >
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , E... |
531bed65c6a6e73819825acfb17870ba227af47cf88240a4519fe613361f9310 | zilch-lang/nstar | Ld.hs | module Language.NStar.CodeGen.Machine.X64.Ld where
import Language.NStar.Typechecker.Core (Expr(RegE), Register, Expr)
import Language.NStar.CodeGen.Compiler (Compiler)
import Language.NStar.CodeGen.Machine.Internal.Intermediate (InterOpcode(..))
import Internal.Error (internalError)
import Language.NStar.Typechecker.... | null | https://raw.githubusercontent.com/zilch-lang/nstar/8a9d1d5aa19fe6493c556ae3606c758829683762/lib/nsc-codegen/src/Language/NStar/CodeGen/Machine/X64/Ld.hs | haskell | module Language.NStar.CodeGen.Machine.X64.Ld where
import Language.NStar.Typechecker.Core (Expr(RegE), Register, Expr)
import Language.NStar.CodeGen.Compiler (Compiler)
import Language.NStar.CodeGen.Machine.Internal.Intermediate (InterOpcode(..))
import Internal.Error (internalError)
import Language.NStar.Typechecker.... | |
f32a1a7285a8eaf6368a94cb175d5d0a1089bff927023fc333efaf2b2196d141 | axellang/axel | AppMock.hs | module Axel.Test.Eff.AppMock where
import Axel.Prelude
import qualified Axel.Eff.Console as Effs
import Axel.Eff.Error as Error
import qualified Axel.Eff.FileSystem as Effs
import qualified Axel.Eff.Ghci as Effs
import qualified Axel.Eff.Log as Effs
import qualified Axel.Eff.Process as Effs
import qualified Axel.Eff.... | null | https://raw.githubusercontent.com/axellang/axel/8da784ae24406d4328e111b3db13f64dc943f738/test/Axel/Test/Eff/AppMock.hs | haskell | module Axel.Test.Eff.AppMock where
import Axel.Prelude
import qualified Axel.Eff.Console as Effs
import Axel.Eff.Error as Error
import qualified Axel.Eff.FileSystem as Effs
import qualified Axel.Eff.Ghci as Effs
import qualified Axel.Eff.Log as Effs
import qualified Axel.Eff.Process as Effs
import qualified Axel.Eff.... | |
967800723b64e7eb67d6150a4db4ea72d7b18b47a7c8340639507d5cc98d8278 | larskuhtz/wai-cors | Cors.hs | {-# LANGUAGE GADTs #-}
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternGuards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE UnicodeSyntax #
-- |
Module : Network . Wai . Middleware . Cors
-- Description: Cross-Origin resource sharing (CORS) for WAI
-- Copyright:
© 2015 - 2019 < ... | null | https://raw.githubusercontent.com/larskuhtz/wai-cors/0c5f30a82a8bf2f247b170394007e766dc55a83f/src/Network/Wai/Middleware/Cors.hs | haskell | # LANGUAGE GADTs #
# LANGUAGE OverloadedStrings #
|
Description: Cross-Origin resource sharing (CORS) for WAI
Copyright:
Stability: stable
aims to be compliant with <>.
The function 'simpleCors' enables support of simple cross-origin requests. More
advanced CORS policies can be enabled by passing a 'CorsResour... | # LANGUAGE LambdaCase #
# LANGUAGE PatternGuards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE UnicodeSyntax #
Module : Network . Wai . Middleware . Cors
© 2015 - 2019 < ,
© 2014 AlephCloud Systems , Inc.
License : MIT
Maintainer : < >
An implemenation of Cross - Origin resource sharing ( COR... |
64bdede1d614cd3c24dddcf8d86beead0a48bc20b7ba450624892a471e855a94 | alexandergunnarson/quantum | stem.cljc | (ns quantum.nlp.stem
"A stemmer transforms a word into its root form. The stemming is a process
for removing the commoner morphological and inflexional endings from words
(in English). Its main use is as part of a term normalization process."
(:require
[quantum.core.vars
:refer [#?@(:clj [def... | null | https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/src/quantum/nlp/stem.cljc | clojure | (ns quantum.nlp.stem
"A stemmer transforms a word into its root form. The stemming is a process
for removing the commoner morphological and inflexional endings from words
(in English). Its main use is as part of a term normalization process."
(:require
[quantum.core.vars
:refer [#?@(:clj [def... | |
cf0c2b2a3476b4097cfc717325a55cfce2a1dd74f335d44f0f09168be1c10ddd | ekmett/algebra | Log.hs | # LANGUAGE MultiParamTypeClasses #
module Numeric.Log
( Log(..)
) where
import Data.Function (on)
import Numeric.Algebra
import Prelude hiding ((*),(^),(/),recip,negate,subtract)
newtype Log r = Log { runLog :: r }
instance Multiplicative r => Additive (Log r) where
Log a + Log b = Log (a * b)
sumWith1 f ... | null | https://raw.githubusercontent.com/ekmett/algebra/12dd33e848f406dd53d19b69b4f14c93ba6e352b/src/Numeric/Log.hs | haskell | # LANGUAGE MultiParamTypeClasses #
module Numeric.Log
( Log(..)
) where
import Data.Function (on)
import Numeric.Algebra
import Prelude hiding ((*),(^),(/),recip,negate,subtract)
newtype Log r = Log { runLog :: r }
instance Multiplicative r => Additive (Log r) where
Log a + Log b = Log (a * b)
sumWith1 f ... | |
8c9e01e379135706c4c34f3e135f7ca1c034155a70783903b16beec364124a84 | helium/blockchain-core | blockchain_cli_sc.erl | %%%-------------------------------------------------------------------
%% @doc
%% == Blockchain CLI SC ==
%% @end
%%%-------------------------------------------------------------------
-module(blockchain_cli_sc).
-behavior(clique_handler).
-export([register_cli/0]).
-include("blockchain.hrl").
register_cli() ->
... | null | https://raw.githubusercontent.com/helium/blockchain-core/d44651710154c15fe5f0dbfc65eac083a8d8c467/src/cli/blockchain_cli_sc.erl | erlang | -------------------------------------------------------------------
@doc
== Blockchain CLI SC ==
@end
-------------------------------------------------------------------
--------------------------------------------------------------------
sc
--------------------------------------------------------------------
-----... | -module(blockchain_cli_sc).
-behavior(clique_handler).
-export([register_cli/0]).
-include("blockchain.hrl").
register_cli() ->
register_all_usage(), register_all_cmds().
register_all_usage() ->
lists:foreach(
fun(Args) ->
apply(clique, register_usage, Args)
end,
[
... |
3a3ff12f91b776f579f0388c46b521100822d81b3ad4b0d5b5e289f3e5fc3063 | spurious/chibi-scheme-mirror | lset.scm | ;; lset.scm -- list set library
Copyright ( c ) 2009 - 2012 . All rights reserved .
;; BSD-style license:
(define (lset<= eq . sets)
(if (null? sets)
#t
(let lp1 ((set1 (car sets)) (sets (cdr sets)))
(if (null? sets)
#t
(let ((set2 (car sets)))
(let lp... | null | https://raw.githubusercontent.com/spurious/chibi-scheme-mirror/49168ab073f64a95c834b5f584a9aaea3469594d/lib/srfi/1/lset.scm | scheme | lset.scm -- list set library
BSD-style license: | Copyright ( c ) 2009 - 2012 . All rights reserved .
(define (lset<= eq . sets)
(if (null? sets)
#t
(let lp1 ((set1 (car sets)) (sets (cdr sets)))
(if (null? sets)
#t
(let ((set2 (car sets)))
(let lp2 ((ls set1))
(if (pair? ls)
... |
71c11e063992dc2378fade060a6835ef0b1e7f43401347f707928778ee1e8f68 | albertoruiz/easyVision | Parser.hs | {-# OPTIONS_HADDOCK hide #-}
module Parser(
Argument, Header(..),
getHeaders
) where
import Text.ParserCombinators.Parsec
import System.Environment
import Data.List(tails,isPrefixOf,inits,isSuffixOf)
type Argument = ([String], String)
data Header = Header { name :: String
, tyre :: [Str... | null | https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/packages/ip/ippicv/src/Image/Processing/IPP/Parser.hs | haskell | # OPTIONS_HADDOCK hide #
"misplaced" space: pointers should be properly parsed
------------------------------------------ |
module Parser(
Argument, Header(..),
getHeaders
) where
import Text.ParserCombinators.Parsec
import System.Environment
import Data.List(tails,isPrefixOf,inits,isSuffixOf)
type Argument = ([String], String)
data Header = Header { name :: String
, tyre :: [String]
, a... |
93343907ed03a25cb57e029e42d6ccb495b378efedb93ef0a96b8a7fd2498dab | vsedach/HTTP-DOHC | server.lisp | (in-package #:http-dohc)
(defvar *default-connection-timeout* 5 "seconds")
(defun start-server (port &key (number-threads 50))
(let ((server-socket (iolib:fd-of
(iolib:listen-on
(iolib:make-socket
:connect :passive
... | null | https://raw.githubusercontent.com/vsedach/HTTP-DOHC/52672654a1e8ceddf6c416ed84a5d4f6b6d6a8b3/server.lisp | lisp | accept() thread pool
this assumes thread safety in adding events
to the mux (true for epoll)
TODO: if we're not using epoll (ONESHOT),
need to turn off events on this fd
(read-headers request)
(unless (request-body request)
;; read and discard content-length bytes from client-connection
)
(defun rea... | (in-package #:http-dohc)
(defvar *default-connection-timeout* 5 "seconds")
(defun start-server (port &key (number-threads 50))
(let ((server-socket (iolib:fd-of
(iolib:listen-on
(iolib:make-socket
:connect :passive
... |
88a106b27b1506268c1b7c2a39cfde3640ae68fbb4737145712796981efa598d | antono/guix-debian | grub.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013 , 2014 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 3 of t... | null | https://raw.githubusercontent.com/antono/guix-debian/85ef443788f0788a62010a942973d4f7714d10b4/gnu/system/grub.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2013 , 2014 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu system grub)
#:use-module (guix store)
#:use-module (guix packages)
#:use-module ... |
df29abc220915a2a22116b72b3f5bdd4268d0a4dbf59264b999d1f76b7bad3ab | unclebob/AdventOfCode2022 | core.clj | (ns day9-rope-bridge.core
(:require [clojure.string :as string]))
(def directions
{"R" :right
"U" :up
"L" :left
"D" :down})
(defn parse-move [move-line]
(let [[_ direction amount] (re-matches #"([LRUD]) (\d+)$" move-line)]
(repeat (Integer/parseInt amount) (directions direction))))
(defn calculate... | null | https://raw.githubusercontent.com/unclebob/AdventOfCode2022/16b7c9f643623bed1b191ca518add463ce0566de/day9-rope-bridge/src/day9_rope_bridge/core.clj | clojure | (ns day9-rope-bridge.core
(:require [clojure.string :as string]))
(def directions
{"R" :right
"U" :up
"L" :left
"D" :down})
(defn parse-move [move-line]
(let [[_ direction amount] (re-matches #"([LRUD]) (\d+)$" move-line)]
(repeat (Integer/parseInt amount) (directions direction))))
(defn calculate... | |
d0412b09de6bb12e6f1f3afcbb63e25bf2734e8739cc5b9fbdf4796d709a1ea8 | nvim-treesitter/nvim-treesitter | folds.scm | [
(prologue)
(select_query)
(construct_query)
(describe_query)
(ask_query)
(values_clause)
(load)
(clear)
(drop)
(add)
(move)
(copy)
(create)
(insert_data)
(delete_data)
(delete_where)
(modify)
(group_graph_pattern)
(triples_same_subject)
(where_clause)
(delete_clause)
(inser... | null | https://raw.githubusercontent.com/nvim-treesitter/nvim-treesitter/ddc0f1b606472b6a1ab85ee9becfd4877507627d/queries/sparql/folds.scm | scheme | [
(prologue)
(select_query)
(construct_query)
(describe_query)
(ask_query)
(values_clause)
(load)
(clear)
(drop)
(add)
(move)
(copy)
(create)
(insert_data)
(delete_data)
(delete_where)
(modify)
(group_graph_pattern)
(triples_same_subject)
(where_clause)
(delete_clause)
(inser... | |
665e61fec8c968cf0cf237c23e4c80d95148c1d439ec21ef3f48d52aa6b857aa | shr/pltcod | zip.rkt | #lang racket
(require ffi/unsafe
"loader.rkt"
"color.rkt"
"console.rkt"
"image.rkt")
(provide (all-defined-out))
(define _zip (_cpointer/null "tcod-zip"))
(deftcod zip-new : -> _zip)
(deftcod zip-delete : _zip -> _void)
(deftcod zip-put-char : _zip _uint8 -> _void)
(deftcod zip-p... | null | https://raw.githubusercontent.com/shr/pltcod/4b856aab3dcbfe142725fc58cce071e2201d9ea1/zip.rkt | racket | #lang racket
(require ffi/unsafe
"loader.rkt"
"color.rkt"
"console.rkt"
"image.rkt")
(provide (all-defined-out))
(define _zip (_cpointer/null "tcod-zip"))
(deftcod zip-new : -> _zip)
(deftcod zip-delete : _zip -> _void)
(deftcod zip-put-char : _zip _uint8 -> _void)
(deftcod zip-p... | |
f00e15394cfe863265ce73eb413d2bb116c6606d70df0da091cddb97b92d9aaf | sdiehl/elliptic-curve | BN254C.hs | module Data.Curve.Weierstrass.BN254C
( module Data.Curve.Weierstrass
, Point(..)
* BN254C curve
, module Data.Curve.Weierstrass.BN254C
) where
import Protolude
import Data.Field.Galois
import GHC.Natural (Natural)
import Data.Curve.Weierstrass
--------------------------------------------------------------... | null | https://raw.githubusercontent.com/sdiehl/elliptic-curve/445e196a550e36e0f25bd4d9d6a38676b4cf2be8/src/Data/Curve/Weierstrass/BN254C.hs | haskell | -----------------------------------------------------------------------------
Types
-----------------------------------------------------------------------------
# INLINABLE a_ #
# INLINABLE h_ #
-----------------------------------------------------------------------------
Parameters
---------------------------------... | module Data.Curve.Weierstrass.BN254C
( module Data.Curve.Weierstrass
, Point(..)
* BN254C curve
, module Data.Curve.Weierstrass.BN254C
) where
import Protolude
import Data.Field.Galois
import GHC.Natural (Natural)
import Data.Curve.Weierstrass
| BN254C curve .
data BN254C
| Field of points of BN254C... |
c7d21a1c5a9de68ea898ff980be9048c7370287f0e609e4b3fb6ec9c26dda9d6 | myuon/Chimera | Scripts.hs | # LANGUAGE GADTs , TypeSynonymInstances , FlexibleInstances #
# LANGUAGE MultiParamTypeClasses , FlexibleContexts , UndecidableInstances #
# LANGUAGE TypeOperators , DataKinds , Rank2Types , DeriveFunctor #
module Chimera.Engine.Scripts (
Controller(..), Stage, isShooting, isStageRunning
, runStage, runController, ... | null | https://raw.githubusercontent.com/myuon/Chimera/e4e9db7edc15ef56e54f4629133b615dcbe3e90a/Chimera/Engine/Scripts.hs | haskell | , effCommonAnimated | # LANGUAGE GADTs , TypeSynonymInstances , FlexibleInstances #
# LANGUAGE MultiParamTypeClasses , FlexibleContexts , UndecidableInstances #
# LANGUAGE TypeOperators , DataKinds , Rank2Types , DeriveFunctor #
module Chimera.Engine.Scripts (
Controller(..), Stage, isShooting, isStageRunning
, runStage, runController, ... |
59ae726ebd8bab72b496c5e6a8eae153f43121b4b8d7e211eb70e547f455e553 | xapi-project/xen-api | record_util.ml |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | null | https://raw.githubusercontent.com/xapi-project/xen-api/42ebd10a2b3ec82c8f9fa4bf69c10324e6c1093c/ocaml/xapi-cli-server/record_util.ml | ocaml | conversion utils
string_to_string_map_to_string
string to blob ref map to string
no suffix on the end
FIXME: detect overflow
generate a random mac that is locally administered |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... |
1e6cc55d922329f41864b2e969e34f7ac25746eea0ecb88944b57d2f4986a627 | gafiatulin/codewars | Initials.hs | -- Get initials from person name
--
module Initials where
toInitials :: String -> String
toInitials = unwords . map ((: ".") . head) . words
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/7%20kyu/Initials.hs | haskell | Get initials from person name
|
module Initials where
toInitials :: String -> String
toInitials = unwords . map ((: ".") . head) . words
|
8c167e09f138ef9b8b4855bfc449fe5c058bf63ac78051e3fd6699b3e62defae | simingwang/emqx-plugin-kafkav5 | dtls_packet_demux.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2016 - 2022 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Publi... | null | https://raw.githubusercontent.com/simingwang/emqx-plugin-kafkav5/bbf919e56dbc8fd2d4c1c541084532f844a11cbc/_build/default/rel/emqx_plugin_kafka/lib/ssl-10.7/src/dtls_packet_demux.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitatio... | Copyright Ericsson AB 2016 - 2022 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(dtls_packet_demux).
-behaviour(g... |
0d82565efbd5194427e6ab76a31b6975a0c954c35d79faf0ca8a546dedcf6b57 | merijn/Belewitte | Schema.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
module Schema
( AllowNewer(..)
, ByteString
, Checkmark(..)
, CommitId(..)
, GlobalVars.GlobalVar(..)
, Hash(..)
, HashDigest
, ImplFilter
, ImplType(..)
, Model
, Percentage(..)
... | null | https://raw.githubusercontent.com/merijn/Belewitte/cab6010a2bc54acfc4f4b169c95799fe455799ef/benchmark-analysis/src/Schema.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE FlexibleContexts #
# LANGUAGE NamedFieldPuns #
module Schema
( AllowNewer(..)
, ByteString
, Checkmark(..)
, CommitId(..)
, GlobalVars.GlobalVar(..)
, Hash(..)
, HashDigest
, ImplFilter
, ImplType(..)
, Model
, Percentage(..)
, PersistValue(..)
, toPersistV... |
9993671278c5a85b8625fa03c7a812dc1b42b1bf2f4961b4255dd5c76184288d | mzp/coq-ruby | libobject.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/mzp/coq-ruby/99b9f87c4397f705d1210702416176b13f8769c1/library/libobject.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
The suggested object declaration is... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$ I d : libobject.ml 1173... |
43e493d15e73a1652b25a9c6053aad9744e3b14e6e051e42a78625c9ed8c0f92 | Dasudian/DSDIN | dsdc_spend_tx_tests.erl |
-module(dsdc_spend_tx_tests).
-include_lib("eunit/include/eunit.hrl").
-include("blocks.hrl").
-define(TEST_MODULE, dsdc_spend_tx).
-define(SENDER_PUBKEY, <<"sender_pubkey">>).
-define(RECIPIENT_PUBKEY, <<"recipient_pubkey">>).
check_test_() ->
[{"Tx fee lower than minimum fee defined in governance",
fu... | null | https://raw.githubusercontent.com/Dasudian/DSDIN/b27a437d8deecae68613604fffcbb9804a6f1729/apps/dsdcore/test/dsdc_spend_tx_tests.erl | erlang | Dispatcher sanity check: |
-module(dsdc_spend_tx_tests).
-include_lib("eunit/include/eunit.hrl").
-include("blocks.hrl").
-define(TEST_MODULE, dsdc_spend_tx).
-define(SENDER_PUBKEY, <<"sender_pubkey">>).
-define(RECIPIENT_PUBKEY, <<"recipient_pubkey">>).
check_test_() ->
[{"Tx fee lower than minimum fee defined in governance",
fu... |
e05730a8353eb1a39b551118e9a5e03556f95dfbb109cdfe10a6e6a21936e972 | bmeg/ophion | search.clj | (ns ophion.search
(:require
[clojure.string :as string]
[cheshire.core :as json]
[taoensso.timbre :as log]
[clojurewerkz.elastisch.rest :as elastic]
[clojurewerkz.elastisch.rest.index :as index]
[clojurewerkz.elastisch.rest.multi :as multi]
[clojurewerkz.elastisch.rest.document :as document]))
(... | null | https://raw.githubusercontent.com/bmeg/ophion/d22333e8d2b33c6b9e6284ec8ef9fc2a6ce60c8f/src/ophion/search.clj | clojure | (name mapping)
{:match
{:_all query}}
{(str "properties." (name term)) query} | (ns ophion.search
(:require
[clojure.string :as string]
[cheshire.core :as json]
[taoensso.timbre :as log]
[clojurewerkz.elastisch.rest :as elastic]
[clojurewerkz.elastisch.rest.index :as index]
[clojurewerkz.elastisch.rest.multi :as multi]
[clojurewerkz.elastisch.rest.document :as document]))
(... |
a64454fbe175688465ffe9ac2cebab44590578ccc3621c9afb737cd5295610b5 | ejackson/mlapp | numbers_game_2.clj | This is the number game , from 3.2 in the book , using the flow engine
;;
(ns mlapp.numbers-game-2
(:use [incanter.charts :only [bar-chart]]
[incanter.core :only [pow view]]
[clojure.core.incubator :only [dissoc-in]]
[clojure.set :only [rename-keys union difference]])
(:require
[i... | null | https://raw.githubusercontent.com/ejackson/mlapp/b3613bedd65921dcc4dff561fca79d97c205db9a/src/mlapp/numbers_game_2.clj | clojure |
-----------------------------------------------------------------------------
Some helpful utilities
-----------------------------------------------------------------------------
Our collection of hypotheses.
They work simply by giving the set of all members of the hypothesis
These are just (sorted) sets, so inc... | This is the number game , from 3.2 in the book , using the flow engine
(ns mlapp.numbers-game-2
(:use [incanter.charts :only [bar-chart]]
[incanter.core :only [pow view]]
[clojure.core.incubator :only [dissoc-in]]
[clojure.set :only [rename-keys union difference]])
(:require
[infl... |
6092532f825a360d27dd43d6bce0bf3ac8854cfe259a5ad567bb9d5dd4a0e806 | bzliu94/cs61a_fa07 | demo2.scm | (define-class (counter)
(instance-vars (count 0))
(class-vars (total 0))
(method (next)
(set! total (1+ total))
(set! count (1+ count))
(list count total)))
(define-class (person name)
(method (say stuff) stuff)
(method (ask stuff) (ask self 'say (se '(would you please) stuff)))
(method (greet)... | null | https://raw.githubusercontent.com/bzliu94/cs61a_fa07/12a62689f149ef035a36b326351928928f6e7b5d/02%20-%20labs/lab7/demo2.scm | scheme | (define-class (counter)
(instance-vars (count 0))
(class-vars (total 0))
(method (next)
(set! total (1+ total))
(set! count (1+ count))
(list count total)))
(define-class (person name)
(method (say stuff) stuff)
(method (ask stuff) (ask self 'say (se '(would you please) stuff)))
(method (greet)... | |
60e6837ac1b5eb4a307521f4e309c371b4fe4755773b3dc4ef675232d26fad53 | samrocketman/home | egger-duotone-simulation.scm | ;
; The GIMP -- an image manipulation program
Copyright ( C ) 1995 and
;
Duotone / Tritone Simulation , V2.2 for GIMP 2.4
Original author : ( )
( C ) 2005 , Bern , Switzerland
;
; Tags: photo, duotone
;
; Author statement:
;
; You can find more about toning at
; /
;
; ------------------------------------... | null | https://raw.githubusercontent.com/samrocketman/home/63a8668a71dc594ea9ed76ec56bf8ca43b2a86ca/dotfiles/.gimp/scripts/egger-duotone-simulation.scm | scheme |
The GIMP -- an image manipulation program
Tags: photo, duotone
Author statement:
You can find more about toning at
/
--------------------------------------------------------------------
--------------------------------------------------------------------
- Changelog -
---------------------------------... | Copyright ( C ) 1995 and
Duotone / Tritone Simulation , V2.2 for GIMP 2.4
Original author : ( )
( C ) 2005 , Bern , Switzerland
Distributed by Gimp FX Foundry project
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public Licen... |
b79b76abace9202cacb28723525ffcb96343f0f963fc73cd4609b8c635e71b8f | jorgetavares/core-gp | sin-function.lisp | ;;;;
;;;; core-gp example: sin function example (see tinygp code for more info)
;;;;
(defpackage #:core-gp-sin
(:use #:common-lisp #:core-gp)
(:export #:gp-sin
#:var-x
#:real-constants
#:make-fitness-regression
#:*X*
#:*fset*
#:*tset*
#:*sin-data-points*
#:*data-points*))
(in-packa... | null | https://raw.githubusercontent.com/jorgetavares/core-gp/90ec1c4599a19c5a911be1f703f78d5108aee160/examples/sin-function.lisp | lisp |
core-gp example: sin function example (see tinygp code for more info)
function and terminal sets
variable
constants
functions and terminals
fitness function ( y = f(x) = sin (x) )
(GP-PLUS |
(defpackage #:core-gp-sin
(:use #:common-lisp #:core-gp)
(:export #:gp-sin
#:var-x
#:real-constants
#:make-fitness-regression
#:*X*
#:*fset*
#:*tset*
#:*sin-data-points*
#:*data-points*))
(in-package #:core-gp-sin)
(defparameter *X* 0)
(defnode var-x (() (:string "X" :ephemeral ... |
232d2a0fe3778f61e6b9b6142a36122b71f8f79d6f319d7982ff78982f7a51c8 | wireapp/wire-server | Effects.hs | -- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License... | null | https://raw.githubusercontent.com/wireapp/wire-server/c27541d7456e3ea07ce5c8991585d0ffc4fac226/services/galley/src/Galley/Intra/Effects.hs | haskell | This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTI... | Copyright ( C ) 2022 Wire Swiss GmbH < >
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
You should have received a copy of the GNU Affero General Public License along
module Galley.Intra.Effects
( ... |
9bcc2b537a742886331c54a67536d3352d3c7dec26a895b68e17dbf95e1ea3a4 | babashka/sci.configs | reagent_dom_server.cljs | (ns sci.configs.reagent.reagent-dom-server
(:require [reagent.dom.server :as srv]
[sci.core :as sci]))
(def rdns (sci/create-ns 'reagent.dom.server nil))
(def reagent-dom-server-namespace
{'render-to-string (sci/copy-var srv/render-to-string rdns)
'render-to-static-markup (sci/copy-var srv/render-t... | null | https://raw.githubusercontent.com/babashka/sci.configs/2e036c73094ecb9f59873e4e6bd6620890550201/src/sci/configs/reagent/reagent_dom_server.cljs | clojure | (ns sci.configs.reagent.reagent-dom-server
(:require [reagent.dom.server :as srv]
[sci.core :as sci]))
(def rdns (sci/create-ns 'reagent.dom.server nil))
(def reagent-dom-server-namespace
{'render-to-string (sci/copy-var srv/render-to-string rdns)
'render-to-static-markup (sci/copy-var srv/render-t... | |
88f8c23127d3b2998e513929cec5e603e93583b0965d2ff56bcebcaaeb68e4c3 | emil0r/reverie | object.clj | (ns reverie.object
(:refer-clojure :exclude [name])
(:require [clojure.string :as str]
[reverie.http.route :as route]
[reverie.module.entity :as entity]
[reverie.render :as render]
[reverie.system :as sys]
[schema.core :as s]
[reverie.RenderEx... | null | https://raw.githubusercontent.com/emil0r/reverie/a29c223b7326e6d5a5e0874d33c37ff2fa0dfd4d/reverie-core/src/reverie/object.clj | clojure | we have provided methods to the renderer
we just want to utilize the render-method
we don't want to do anything, just return what we got | (ns reverie.object
(:refer-clojure :exclude [name])
(:require [clojure.string :as str]
[reverie.http.route :as route]
[reverie.module.entity :as entity]
[reverie.render :as render]
[reverie.system :as sys]
[schema.core :as s]
[reverie.RenderEx... |
05aa3502cdd67c100c81b3ba1233687b0d5f76d3227ce0ab75f172d19044c615 | lojic/RacketChess | chess.rkt | #lang racket
(require "./board.rkt"
"./board-utilities.rkt"
"./fen.rkt"
"./legality.rkt"
"./make-move.rkt"
"./movement.rkt"
"./pgn.rkt"
"./search.rkt"
"./zobrist.rkt")
(define (game depth computer-plays-black? seconds [ fen #f ])
(define (norma... | null | https://raw.githubusercontent.com/lojic/RacketChess/115ca7fecca9eaf31f9b2f4ef59935372c9920c8/src/chess.rkt | racket | Apparently just hit enter key
Something entered
a bit tricky to find the right move. Note - we need to set the full
move count so the engine knows to use the endgame piece square
table for the king !
The following causes the engine to play stupidly w/ TT enabled ?!?!
"8/8/8/8/2K5/5Q2/6PP/4k3 w - - 0 100"
"8/8/... | #lang racket
(require "./board.rkt"
"./board-utilities.rkt"
"./fen.rkt"
"./legality.rkt"
"./make-move.rkt"
"./movement.rkt"
"./pgn.rkt"
"./search.rkt"
"./zobrist.rkt")
(define (game depth computer-plays-black? seconds [ fen #f ])
(define (norma... |
44dc41e030301d5ba9a16ccd04d246117695b0d44c113ac824761ed647181e14 | malcolmreynolds/GSLL | multinomial.lisp | Multinomial distribution
, Sat Nov 25 2006 - 16:00
Time - stamp : < 2009 - 05 - 24 23:00:01EDT >
$ Id$
(in-package :gsl)
;;; /usr/include/gsl/gsl_randist.h
(defmfun sample
((generator random-number-generator) (type (eql 'multinomial))
&key sum probabilities
(n (make-marray
'(signed-byte 32... | null | https://raw.githubusercontent.com/malcolmreynolds/GSLL/2f722f12f1d08e1b9550a46e2a22adba8e1e52c4/random/multinomial.lisp | lisp | /usr/include/gsl/gsl_randist.h
technically, n should be a uint array, but integers work
Examples and unit test | Multinomial distribution
, Sat Nov 25 2006 - 16:00
Time - stamp : < 2009 - 05 - 24 23:00:01EDT >
$ Id$
(in-package :gsl)
(defmfun sample
((generator random-number-generator) (type (eql 'multinomial))
&key sum probabilities
(n (make-marray
'(signed-byte 32) :dimensions (dim0 probabilities))... |
a6a7d95da3e07b4f4a6c3f8f1826c4b088c444948c713ab077ef51eaf371d780 | e-wrks/edh | Runtime.hs | # LANGUAGE ImplicitParams #
module Language.Edh.Runtime where
-- import Debug.Trace
import Control.Concurrent.STM
import Control.Exception
import Control.Monad
import qualified Data.ByteString as B
import Data.Dynamic
import qualified Data.HashMap.Strict as Map
import Data.IORef
import qualified Data.List ... | null | https://raw.githubusercontent.com/e-wrks/edh/df43a9fe4c594a333836be7084d58d2bb5428572/host.hs/src/Language/Edh/Runtime.hs | haskell | import Debug.Trace
the meta class
no super class, and self is not stored
the event's meta class
no super class, and self is not stored
the root object and root scope
the sandbox object and sandbox scope
no super class, and self is not stored
the namespace class, root object is a special instance of n... | # LANGUAGE ImplicitParams #
module Language.Edh.Runtime where
import Control.Concurrent.STM
import Control.Exception
import Control.Monad
import qualified Data.ByteString as B
import Data.Dynamic
import qualified Data.HashMap.Strict as Map
import Data.IORef
import qualified Data.List as L
import Data.Maybe
import Da... |
9b5893d6c0c1e55507301e117881139ff661f80694700f49da6693685da4f0a4 | Hans-Halverson/myte | ast_utils.ml | open Ast
let statement_loc stmt =
let open Statement in
match stmt with
| VariableDeclaration { VariableDeclaration.loc; _ }
| FunctionDeclaration { Function.loc; _ }
| ExpressionStatement { ExpressionStatement.loc; _ }
| Block { Block.loc; _ }
| If { If.loc; _ }
| While { While.loc; _ }
| For { For.... | null | https://raw.githubusercontent.com/Hans-Halverson/myte/51d03315a204aca9babde9c43de1672b993ba18d/src/parser/ast_utils.ml | ocaml | open Ast
let statement_loc stmt =
let open Statement in
match stmt with
| VariableDeclaration { VariableDeclaration.loc; _ }
| FunctionDeclaration { Function.loc; _ }
| ExpressionStatement { ExpressionStatement.loc; _ }
| Block { Block.loc; _ }
| If { If.loc; _ }
| While { While.loc; _ }
| For { For.... | |
9f8169cc1d69679af85d93775bd3d2b588de7c64915c77c27a59f22da8502398 | bsless/clj-fast | analysis.clj | (ns clj-fast.analysis
"Interactive notebook namespace to load, parse and chart benchmark results"
(:require
[clojure.edn]
[clojure.set :as set]
[clojure.string]
[incanter
[core :as i]
[charts :as charts]]))
(def default-opts
{:x-dim :log-size
:y-dim :count})
(def case-opts
{:memoize {:x... | null | https://raw.githubusercontent.com/bsless/clj-fast/e150f4c363c4950f56e59d922f0dd9d067b146e4/extra/clj-fast.analysis/src/clj_fast/analysis.clj | clojure | (ns clj-fast.analysis
"Interactive notebook namespace to load, parse and chart benchmark results"
(:require
[clojure.edn]
[clojure.set :as set]
[clojure.string]
[incanter
[core :as i]
[charts :as charts]]))
(def default-opts
{:x-dim :log-size
:y-dim :count})
(def case-opts
{:memoize {:x... | |
8aa4eabeb64bdbfd200b4f690d4364edb3a7d539bed2b45206f7e3f7c36cbcea | intermine/bluegenes | sidebar.cljs | (ns bluegenes.pages.reportpage.components.sidebar
(:require [re-frame.core :refer [subscribe dispatch]]
[reagent.core :as reagent]
[bluegenes.components.icons :refer [icon-comp]]
[bluegenes.components.bootstrap :refer [poppable]]
[bluegenes.pages.reportpage.subs :as sub... | null | https://raw.githubusercontent.com/intermine/bluegenes/8724aafb032ace3ca6a3f79f6296bd07b3189a84/src/cljs/bluegenes/pages/reportpage/components/sidebar.cljs | clojure | Only available for registry mines. | (ns bluegenes.pages.reportpage.components.sidebar
(:require [re-frame.core :refer [subscribe dispatch]]
[reagent.core :as reagent]
[bluegenes.components.icons :refer [icon-comp]]
[bluegenes.components.bootstrap :refer [poppable]]
[bluegenes.pages.reportpage.subs :as sub... |
3fb9a092e904df188808a6d167c2b165c00f3b3fe7390dbd8362a4b94c5a08aa | static-analysis-engineering/codehawk | bCHGlobalState.mli | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/c1b3158e0d73cda7cfc10d75f6173f4297991a82/CodeHawk/CHB/bchlib/bCHGlobalState.mli | ocaml | bchlib | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... |
387e1e586d828379c6293391cb7bb98a91ee6daa6aef0df924f7598ba6529637 | faylang/fay | Text.hs | {-# OPTIONS -fno-warn-missing-methods #-}
{-# LANGUAGE DeriveDataTypeable #-}
{-# LANGUAGE EmptyDataDecls #-}
# LANGUAGE NoImplicitPrelude #
# LANGUAGE NoRebindableSyntax #
{-# LANGUAGE PackageImports #-}
# LANGUAGE StandaloneDeriving #
-- | Compatible API with the `text' package.
module Data.Text
( Text
-- * Cre... | null | https://raw.githubusercontent.com/faylang/fay/8455d975f9f0db2ecc922410e43e484fbd134699/fay-base/src/Data/Text.hs | haskell | # OPTIONS -fno-warn-missing-methods #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE EmptyDataDecls #
# LANGUAGE PackageImports #
| Compatible API with the `text' package.
* Creation and elimination
* Conversions
* I/O
* Breaking into many substrings
* Basic interface
* Special folds
* Case conversion
* Transforma... | # LANGUAGE NoImplicitPrelude #
# LANGUAGE NoRebindableSyntax #
# LANGUAGE StandaloneDeriving #
module Data.Text
( Text
, pack
, unpack
, fromString
, empty
, showInt
, toShortest
, putStrLn
, splitOn
, stripSuffix
, cons
, snoc
, append
, (<>)
, uncons
, head
, init
, last
, tail... |
8ee2ef638842c5170814037e18a5aa3c33e93e620814c079d3bb84e7868a83db | jyh/metaprl | shell_tex.mli |
* Imperative TeX file .
*
* ----------------------------------------------------------------
*
* Copyright ( C ) 2000 , Caltech
*
* This program is free software ; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Softwar... | null | https://raw.githubusercontent.com/jyh/metaprl/51ba0bbbf409ecb7f96f5abbeb91902fdec47a19/support/shell/shell_tex.mli | ocaml |
* Open an output file with the given name.
* Printer interface for opening and closing the
* output file. In open_file, if the name has not
* been specified with set_file previously, the
* file output.tex is used instead.
* -*-
* Local Variables:
* Caml-master: "compile"
* End:
* -*-
|
* Imperative TeX file .
*
* ----------------------------------------------------------------
*
* Copyright ( C ) 2000 , Caltech
*
* This program is free software ; you can redistribute it and/or
* modify it under the terms of the GNU General Public License
* as published by the Free Softwar... |
133c1e197bb150dae1c8752279cc22aee02a5e318129e02394b954611e32f34d | alex314159/ib-re-actor-976-plus | gap-fade.clj | (ns ib-re-actor-976-plus.examples.gap-fade
(:use [ib-re-actor-976-plus.connection]
[ib-re-actor-976-plus.contracts]
[clj-time.core :only [date-time minus]]))
(defn compute-pivots [{high :high low :low close :close}]
(let [pp (/ (+ high low close) 3)
r1 (- (* 2 pp) low)
s1 (- (* 2 pp... | null | https://raw.githubusercontent.com/alex314159/ib-re-actor-976-plus/96dad45d7dd8cef39330b75118a5d409dc96cc76/old_examples/gap-fade.clj | clojure | (ns ib-re-actor-976-plus.examples.gap-fade
(:use [ib-re-actor-976-plus.connection]
[ib-re-actor-976-plus.contracts]
[clj-time.core :only [date-time minus]]))
(defn compute-pivots [{high :high low :low close :close}]
(let [pp (/ (+ high low close) 3)
r1 (- (* 2 pp) low)
s1 (- (* 2 pp... | |
dbc49909094b5680b2b9cb99f2a306cf3bcc96a3d3dbee1a9e88430463d9fbe2 | khotyn/4clojure-answer | 26-fibonacci-sequence.clj | #(take % (map first (iterate (fn [[a b]] [b (+ a b)]) [1 1])))
| null | https://raw.githubusercontent.com/khotyn/4clojure-answer/3de82d732faedceafac4f1585a72d0712fe5d3c6/26-fibonacci-sequence.clj | clojure | #(take % (map first (iterate (fn [[a b]] [b (+ a b)]) [1 1])))
| |
001de1d95ae7c4660d7b400ad77261f34c64f45268795200f33d36960dfbcd14 | sionescu/iolib | utils.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; --- Miscellaneous utilities.
;;;
(in-package :iolib/multiplex)
(defun timeout->timeval (timeout tv)
(with-foreign-slots ((isys:sec isys:usec)
tv (:struct isys:timeval))
(multiple-value-bind (%sec %usec)
(decode-timeout timeout... | null | https://raw.githubusercontent.com/sionescu/iolib/dac715c81db55704db623d8b2cfc399ebcf6175f/src/multiplex/utils.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
--- Miscellaneous utilities.
|
(in-package :iolib/multiplex)
(defun timeout->timeval (timeout tv)
(with-foreign-slots ((isys:sec isys:usec)
tv (:struct isys:timeval))
(multiple-value-bind (%sec %usec)
(decode-timeout timeout)
(setf isys:sec %sec
isys:usec %usec))))
(defun timeout->timespec (ti... |
d2a1400982cf12b2c12b672f1aabeefae26be08471a0afa182cd3b8b8edeb565 | dangtv/BIRDS | ast2sql.ml | (*******************************************************)
(**
AST-to-SQL functions
*)
(********************************************************)
@author :
@author: Vandang Tran
*)
open Expr
open Utils
open Rule_preprocess
open Stratification
open Derivation
type sql_binary_operator =
| SqlPlus (* + *)
|... | null | https://raw.githubusercontent.com/dangtv/BIRDS/bd006185990da59fd45024c92222f6e07c15ebb6/src/ast2sql.ml | ocaml | *****************************************************
*
AST-to-SQL functions
******************************************************
+
-
*
/
||
-
* Given an aggregate function name, checks if it is supported and returns it.
* Get sql code for comparison operators.
* Given an arithmetic expression, retur... |
@author :
@author: Vandang Tran
*)
open Expr
open Utils
open Rule_preprocess
open Stratification
open Derivation
type sql_binary_operator =
type sql_unary_operator =
type sql_agg_function =
| SqlAggMax
| SqlAggMin
| SqlAggSum
| SqlAggAvg
| SqlAggCount
type sql_operator =
| SqlRelEqual
| SqlRelN... |
af95a8d937427615acc47a028ab581a1f76fee9326073c5c618fc7d144924a9f | HealthSamurai/stresty | typography.cljc | (ns stylo.tailwind.typography
(:require
[stylo.rule :refer [rule]]
[stylo.tailwind.color :refer [colors]]
[stylo.util :refer [with-alpha as-unit]]))
;; -family/#app
(defmethod rule :font-sans [_] [[:& {:font-family "system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", ... | null | https://raw.githubusercontent.com/HealthSamurai/stresty/130cedde6bf53e07fe25a6b0b13b8bf70846f15a/src-ui/stylo/tailwind/typography.cljc | clojure | -family/#app
-weight/#app
-size/#app
-smoothing/#app
-style/#app
-spacing/#app
-height/#app
-style-position/#app
-style-type/#app
-color/#app
-opacity/#app
-align/#app
-color/#app
-opacity/#app
-transform/#app
-align/#app
/#app
-break/#app | (ns stylo.tailwind.typography
(:require
[stylo.rule :refer [rule]]
[stylo.tailwind.color :refer [colors]]
[stylo.util :refer [with-alpha as-unit]]))
(defmethod rule :font-sans [_] [[:& {:font-family "system-ui, -apple-system, BlinkMacSystemFont, \"Segoe UI\", Roboto, \"Helvetica Neue\", Arial, \"Noto Sa... |
83381dc0162afd0f863cefcbb9ac30cad52bc589bca676eb04bdb87c39cf5c35 | mitar/nxt | Basic.hs | module Robotics.NXT.Basic where
import Control.Monad.State hiding (state, runState)
import qualified Data.ByteString.Lazy as B
import Data.IORef
import Data.Maybe
import Data.Time.Clock.POSIX
import System.FilePath
import System.IO
import Test.HUnit
import Robotics.NXT
import Robotics.NXT.Remote
import Robotics.NXT.S... | null | https://raw.githubusercontent.com/mitar/nxt/5c811b03308f106e9dbf1055c8c92a860c533ca3/tests/Robotics/NXT/Basic.hs | haskell | it time to send a keep alive packet
speed should not fall under allowed threshold
xs is a reversed list | module Robotics.NXT.Basic where
import Control.Monad.State hiding (state, runState)
import qualified Data.ByteString.Lazy as B
import Data.IORef
import Data.Maybe
import Data.Time.Clock.POSIX
import System.FilePath
import System.IO
import Test.HUnit
import Robotics.NXT
import Robotics.NXT.Remote
import Robotics.NXT.S... |
7014b16358c1dcc87c6bf79e6d69b9e68d94526067ff692a23719bd51d31ece5 | souenzzo/souenzzo.github.io | dev.clj | (ns br.com.souenzzo.dvm.dev
(:require [io.pedestal.http :as http]
[br.com.souenzzo.dvm :as dvm]
[io.pedestal.http.route :as route]
[ring.util.mime-type :as mime]))
(defn body
[env]
[:div "body!"])
(def ui-hello
[:html
[:head
[:title "Hello!"]]
[:body
[body]]])... | null | https://raw.githubusercontent.com/souenzzo/souenzzo.github.io/30a811c4e5633ad07bba1d58d19eb091dac222e9/dvm/dev/br/com/souenzzo/dvm/dev.clj | clojure | (ns br.com.souenzzo.dvm.dev
(:require [io.pedestal.http :as http]
[br.com.souenzzo.dvm :as dvm]
[io.pedestal.http.route :as route]
[ring.util.mime-type :as mime]))
(defn body
[env]
[:div "body!"])
(def ui-hello
[:html
[:head
[:title "Hello!"]]
[:body
[body]]])... | |
8a26e6e3b8db726b064652248f01c95c444bb83e25ffd33a3187f1bde8d2c0db | heroku/sdiff | sdiff_serv.erl | -module(sdiff_serv).
-behaviour(gen_server).
%% user callbacks
-export([start_link/1, start_link/2,
write/3, delete/2, ready/1]).
callbacks from the connection server third party
-export([await/1, connect/3]).
%% internal callbacks
-export([tree/1]).
%% debug/test callbacks
-export([client_count/1]).
%% expo... | null | https://raw.githubusercontent.com/heroku/sdiff/15e3fb2974919b7349387288a89881c2850f3073/src/sdiff_serv.erl | erlang | user callbacks
internal callbacks
debug/test callbacks
export/import of tree
gen_server callbacks
PUBLIC %%%
Wait for a notification from the server once ready
Let server know all background data is in place and can
start to sync
Internal call to get state
Debug function to get an idea of how many clients ... | -module(sdiff_serv).
-behaviour(gen_server).
-export([start_link/1, start_link/2,
write/3, delete/2, ready/1]).
callbacks from the connection server third party
-export([await/1, connect/3]).
-export([tree/1]).
-export([client_count/1]).
-export([export/3, import/3]).
-export([init/1, handle_call/3, handle_c... |
d19b74dc847164810221c4711e9ab1edd8aa0b863e1da48464e840c47a7ea6cc | kennknowles/aspcc | HtmlDoc.mli |
* [ ? outputdir filenames ] Outputs documentation for all the
files , and an index of the functions in all the files , to the given directory .
Included are :
{ - for each file XXX / YYY / ZZZ.asp a file outputdir / XXX_YYY_ZZZ.asp.html }
{ - an index " index.html " }
{ - a function index " index... | null | https://raw.githubusercontent.com/kennknowles/aspcc/951a91cc21e291b1d3c750bbbca7fa79209edd08/output/HtmlDoc.mli | ocaml |
* [ ? outputdir filenames ] Outputs documentation for all the
files , and an index of the functions in all the files , to the given directory .
Included are :
{ - for each file XXX / YYY / ZZZ.asp a file outputdir / XXX_YYY_ZZZ.asp.html }
{ - an index " index.html " }
{ - a function index " index... | |
640386463296c7c15b1397b9d6bdfe0466f2d373128c0e78befacbd4b9a86fff | mflatt/plait | hygiene.rkt | #lang plait
(define (msg o m a)
((o m) a))
(define-syntax (object/self-2 x)
(syntax-case x ()
[(object [mtd-name (var) val] ...)
(with-syntax ([self (datum->syntax x 'self)])
#'(letrec ([self
(lambda (msg)
(case msg
[(mtd-name) (lambda... | null | https://raw.githubusercontent.com/mflatt/plait/32420453c0890a505c4cb4ee13b0fdcc74655a18/tests/hygiene.rkt | racket | #lang plait
(define (msg o m a)
((o m) a))
(define-syntax (object/self-2 x)
(syntax-case x ()
[(object [mtd-name (var) val] ...)
(with-syntax ([self (datum->syntax x 'self)])
#'(letrec ([self
(lambda (msg)
(case msg
[(mtd-name) (lambda... | |
7f177316dc40bf97387bc06157749f74f514db94d29638d4d7ace12a601f2079 | atdixon/me.untethr.nostr-desk | timeline.clj | (ns me.untethr.nostr.timeline
(:require
[cljfx.api :as fx]
[clojure.set :as set]
[clojure.tools.logging :as log]
[me.untethr.nostr.domain :as domain]
[me.untethr.nostr.parse :as parse]
[me.untethr.nostr.timeline-support :as timeline-support]
[me.untethr.nostr.util :as util]
[me.untethr... | null | https://raw.githubusercontent.com/atdixon/me.untethr.nostr-desk/6cb2f2ae1704ce04fe8481cb3b3895a978332e52/src/me/untethr/nostr/timeline.clj | clojure | these field values are only ever mutated on fx thread
contains UITextNoteWrapper
NOTE: we're querying and subscribing to all of time but for now, for ux
todo we'll really wish to query/subscribe at an epoch and only update it on scroll etc.
consider: optimization--not having to create contact set each note
identi... | (ns me.untethr.nostr.timeline
(:require
[cljfx.api :as fx]
[clojure.set :as set]
[clojure.tools.logging :as log]
[me.untethr.nostr.domain :as domain]
[me.untethr.nostr.parse :as parse]
[me.untethr.nostr.timeline-support :as timeline-support]
[me.untethr.nostr.util :as util]
[me.untethr... |
5713e4c2342da87ac97c25c13a6ba0ce9344f543fc628234b3752f0fcb70eaaf | SimulaVR/godot-haskell | SplitContainer.hs | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.SplitContainer
(Godot.Core.SplitContainer._DRAGGER_H... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/e8f2c45f1b9cc2f0586ebdc9ec6002c8c2d384ae/src/Godot/Core/SplitContainer.hs | haskell | | Emitted when the dragger is dragged by user.
# NOINLINE bindSplitContainer_get_split_offset #
# NOINLINE bindSplitContainer_is_collapsed # | # LANGUAGE DerivingStrategies , GeneralizedNewtypeDeriving ,
TypeFamilies , TypeOperators , FlexibleContexts , DataKinds ,
MultiParamTypeClasses #
TypeFamilies, TypeOperators, FlexibleContexts, DataKinds,
MultiParamTypeClasses #-}
module Godot.Core.SplitContainer
(Godot.Core.SplitContainer._DRAGGER_H... |
819a3fe394381cbf00459817ebc5efd74528bd7a693849d5342b2c856fdb00b4 | eholk/harlan | insert-transactions.scm | (library (harlan middle insert-transactions)
(export insert-transactions)
(import
(rnrs)
(nanopass)
(only (harlan middle languages M7)
M7.0.0
M7.0.1))
(define-pass insert-transactions : M7.0.0 (m) -> M7.0.1 ()
(Body
: Body (body) -> Body ()
((do (kernel ,[t] ,r (,[e*] ...... | null | https://raw.githubusercontent.com/eholk/harlan/3afd95b1c3ad02a354481774585e866857a687b8/harlan/middle/insert-transactions.scm | scheme | (library (harlan middle insert-transactions)
(export insert-transactions)
(import
(rnrs)
(nanopass)
(only (harlan middle languages M7)
M7.0.0
M7.0.1))
(define-pass insert-transactions : M7.0.0 (m) -> M7.0.1 ()
(Body
: Body (body) -> Body ()
((do (kernel ,[t] ,r (,[e*] ...... | |
7a487c062a7af8422ba1eb9d047e9ae31a955772ef19d79ac5a48a7c8664863a | facebook/infer | globalDefn.ml |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/facebook/infer/b5896bf75c00277aa4a93994c1971077cf40ebd7/sledge/src/llair/globalDefn.ml | ocaml | * Global variables |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
ff5c73cbc2d4eef3c4bb55dbf283671956c5a24e7eb36223deb6f5fe5468f2c9 | sethfowler/pygmalion | Make.hs | {-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
module Pygmalion.Make
( observeMake
, indexUserCommand
) where
import Control.Concurrent.Async
import Control.Concurrent.Chan
import Control.Exception (catch, SomeException)
import Control.Monad hiding (join)
import Data.IORef
import qualified Data.IntS... | null | https://raw.githubusercontent.com/sethfowler/pygmalion/d58cc3411d6a17cd05c3b0263824cd6a2f862409/src/Pygmalion/Make.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings #
Set up our handlers.
Set up the environment.
Start the child process.
Observe it!
TODO: Should extract just filename instead of using isSuffixOf.
logWarn $ "indexCommand: [" ++ show cmd ++ "] [" ++ show args ++ "] [" ++ show wd ++ "]"
Couldn't parse command... |
module Pygmalion.Make
( observeMake
, indexUserCommand
) where
import Control.Concurrent.Async
import Control.Concurrent.Chan
import Control.Exception (catch, SomeException)
import Control.Monad hiding (join)
import Data.IORef
import qualified Data.IntSet as Set
import qualified Data.ByteString as B
import qualified ... |
69f51de1e59d4d9514f6aec7c2082a0f16a6541932555d6905d64ae7bedea743 | ZHaskell/stdio | BitTwiddle.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE DataKinds #
# LANGUAGE MagicHash #
module BitTwiddle (bitTwiddle) where
import Criterion.Main
import qualified Data.ByteString as BS
import qualified Std.Data.Vector.Base as V
import Control.DeepSeq
import Control.Monad
import Data.Word
import GHC.Prim
import GHC.Types
import ... | null | https://raw.githubusercontent.com/ZHaskell/stdio/7887b9413dc9feb957ddcbea96184f904cf37c12/bench/data/BitTwiddle.hs | haskell | # LANGUAGE FlexibleContexts #
# LANGUAGE DataKinds #
# LANGUAGE MagicHash #
module BitTwiddle (bitTwiddle) where
import Criterion.Main
import qualified Data.ByteString as BS
import qualified Std.Data.Vector.Base as V
import Control.DeepSeq
import Control.Monad
import Data.Word
import GHC.Prim
import GHC.Types
import ... | |
6a95a2fb13117a6a558289b516a0f5068e1795eb91e1baa1355983c99d829538 | helins/dsim.cljc | util.cljc | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns dvlopt.dsim.util
"Utilities, the user should not be bothered by this."
{:author "Adam Helinski"
:no-doc true})
;;;;;;;;;; Colle... | null | https://raw.githubusercontent.com/helins/dsim.cljc/aa1b551d3149015f022133c2ae5f480d4621d32d/src/main/dvlopt/dsim/util.cljc | clojure | Collections
Cf. `assoc-shortest`
Associates `leaf` at `path` only if `path` is shorter than the tree.
Cf. Tests
""
[hmap-1 hmap-2]
; TODO . # 1 When neither is a map , still pick v-2 over v-1 ?
;; Shouldn't matter as (= v-1 v-2), by convention, supposedly.
;;
;; TODO. Really useful ... | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns dvlopt.dsim.util
"Utilities, the user should not be bothered by this."
{:author "Adam Helinski"
:no-doc true})
(defn- -assoc-... |
300910bb97677e6c6f4b70984d4498b03caa7b6339739f2d4c0db9441ee6056c | finnishtransportagency/harja | koodistot.clj | (ns harja.kyselyt.koodistot
"Koodistoihin liittyvät tietokantakyselyt
(hetkellä vain koodisto konversiot käytetty integraatioissa)"
(:require [jeesql.core :refer [defqueries]]))
(defqueries "harja/kyselyt/koodistot.sql"
{:positional? false})
(defn konversio-db [db koodisto-id lahde]
(let [rivi (fi... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/13aafd9d83a338ac7d30a7f891417521324bed28/src/clj/harja/kyselyt/koodistot.clj | clojure | (ns harja.kyselyt.koodistot
"Koodistoihin liittyvät tietokantakyselyt
(hetkellä vain koodisto konversiot käytetty integraatioissa)"
(:require [jeesql.core :refer [defqueries]]))
(defqueries "harja/kyselyt/koodistot.sql"
{:positional? false})
(defn konversio-db [db koodisto-id lahde]
(let [rivi (fi... | |
1502664255e77e5ca998bd9a111ed324122d83260fc067b39772db2879f152ef | gebi/jungerl | snmp_smux_admin.erl | %%%-------------------------------------------------------------------
%%% File : snmp_smux_admin.erl
Author : < >
%%% Description : Holds the SMUX config, starts tcp listeners, implements
%%% the SMUX MIB.
Created : 31 Oct 2003 by < >
%%%----------------------------------------------------... | null | https://raw.githubusercontent.com/gebi/jungerl/8f5c102295dbe903f47d79fd64714b7de17026ec/lib/snmp_ext/src/snmp_smux_admin.erl | erlang | -------------------------------------------------------------------
File : snmp_smux_admin.erl
Description : Holds the SMUX config, starts tcp listeners, implements
the SMUX MIB.
-------------------------------------------------------------------
PRE R10 -include_lib("snmp/src/snmp_verbosity.hrl").... | Author : < >
Created : 31 Oct 2003 by < >
-module(snmp_smux_admin).
-behaviour(gen_server).
-define(VMODULE, "SMUX").
-include_lib("snmp/src/misc/snmp_verbosity.hrl").
-include("snmp_smux.hrl").
-export([start_link/0, start_link/5]).
-export([add_peer/2, del_peer/1, add_registration/3, del_registration/... |
4d851ae1857838aa3da456ebc88d1cc9e8651df1c05984a51131b3920beb9c5d | cgrand/seqexp | seqexp.clj | (ns net.cgrand.seqexp
"Regular expressions for sequences."
(:refer-clojure :exclude [+ * repeat +' *' cat])
(:require [clojure.walk :as walk]))
(defprotocol ^:private Regex
(instructions [re]))
(defn- link
"Resolve labels to addresses.
(idempotent)"
[instructions]
(let [[insts labels] (reduce (fn [[i... | null | https://raw.githubusercontent.com/cgrand/seqexp/b2831c0b48f0e6fe364d3714f56bb224e43d0be1/src/net/cgrand/seqexp.clj | clojure | required to allow nested lookaheads to converge
Run non pred threads to completion. If none
accept negative lookahead succeeds.
With nothing left to consume threads with pred
op will never ACCEPT so drop them right away
Run remaing threads to ensure nested
accepting vms run
With nothing left to consume we can
... | (ns net.cgrand.seqexp
"Regular expressions for sequences."
(:refer-clojure :exclude [+ * repeat +' *' cat])
(:require [clojure.walk :as walk]))
(defprotocol ^:private Regex
(instructions [re]))
(defn- link
"Resolve labels to addresses.
(idempotent)"
[instructions]
(let [[insts labels] (reduce (fn [[i... |
84d28e25a940fcb7fc96f693f3c7d3d42f448c96093a62a7f85c06f20ec8f5b4 | holyjak/fulcro-billing-app | date_time.cljc | (ns billing-app.formatters.date-time
(:refer-clojure :exclude [name])
(:require
[com.fulcrologic.rad.type-support.date-time :as datetime])
#?(:clj (:import
(java.time LocalDateTime ZoneId Instant)
(java.time.format DateTimeFormatter)
(java.util Date))
:cljs (:impor... | null | https://raw.githubusercontent.com/holyjak/fulcro-billing-app/568bf28552989e1e611773b2d946c9990e1edc3d/src/shared/billing_app/formatters/date_time.cljc | clojure | (ns billing-app.formatters.date-time
(:refer-clojure :exclude [name])
(:require
[com.fulcrologic.rad.type-support.date-time :as datetime])
#?(:clj (:import
(java.time LocalDateTime ZoneId Instant)
(java.time.format DateTimeFormatter)
(java.util Date))
:cljs (:impor... | |
1e7fdf9aae397f845c156a53576636d6496011244f200c2a4ce6c52c489ee414 | evturn/programming-in-haskell | 07.6-binary-string-transmitter.hs | import Data.Char
type Bit = Int
type Bits = [Bit]
bin2int :: Bits -> Int
bin2int = foldr (\x y -> x + 2*y) 0
-- bin2int [1,0,1,1]
13
int2bin :: Int -> Bits
int2bin 0 = []
int2bin n = n `mod` 2 : int2bin (n `div` 2)
int2bin 13
[ 1,0,1,1 ]
make8 :: Bits -> Bits
make8 bits = take 8 (bits ++ repeat 0)
-- make8... | null | https://raw.githubusercontent.com/evturn/programming-in-haskell/0af2c48c8221b5bcd052492e2be2b79635f6994c/07-higher-order-functions/07.6-binary-string-transmitter.hs | haskell | bin2int [1,0,1,1]
make8 [1,0,1,1]
[1,0,1,1,0,0,0]
encode "sup"
"sup" | import Data.Char
type Bit = Int
type Bits = [Bit]
bin2int :: Bits -> Int
bin2int = foldr (\x y -> x + 2*y) 0
13
int2bin :: Int -> Bits
int2bin 0 = []
int2bin n = n `mod` 2 : int2bin (n `div` 2)
int2bin 13
[ 1,0,1,1 ]
make8 :: Bits -> Bits
make8 bits = take 8 (bits ++ repeat 0)
encode :: String -> Bits
enc... |
64ab03a5f6caf6507b5e7137c4b272e2bacddd844be24f3a45fac65a5bbc6a12 | HunterYIboHu/htdp2-solution | ex133-check-name-list.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname ex133-check-name-list) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp... | null | https://raw.githubusercontent.com/HunterYIboHu/htdp2-solution/6182b4c2ef650ac7059f3c143f639d09cd708516/Chapter2/Section9-Lists/ex133-check-name-list.rkt | racket | about the language level of this file in a form that our tools can easily process.
- '()
- (cons String List-of-names)
interpretation a List-of-names represents a list of invitees by last name.
List-of-names -> Boolean
determine whether "Flatt" occurs on a-list-of-names
examples:
Exercise133 check example
I ex... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname ex133-check-name-list) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t constructor repeatin... |
d1a8aef5ecfcb2ed5c515ea0ba1867478b207176b07ad10c70888ff13456cac1 | tianyicui/golio | myocamlbuild.ml | OASIS_START
DO NOT EDIT ( digest : 985f26bf556d4376fb3ffe883f67df6d )
module OASISGettext = struct
# 21 "/Users/tianyi/.opam/system/build/oasis.0.3.0/src/oasis/OASISGettext.ml"
let ns_ str =
str
let s_ str =
str
let f_ (str : ('a, 'b, 'c, 'd) format4) =
str
let fn_ fmt1 fmt2 n =
if n = 1... | null | https://raw.githubusercontent.com/tianyicui/golio/2f03a0ddb451ff8389125477e1214839973eaa1f/myocamlbuild.ml | ocaml | these functions are not really officially exported
this lists all supported packages
this is supposed to list available syntaxes, but I don't know how to do it.
ocamlfind command
by using Before_options one let command line options have an higher priority
on the contrary using After_options will guarantee to... | OASIS_START
DO NOT EDIT ( digest : 985f26bf556d4376fb3ffe883f67df6d )
module OASISGettext = struct
# 21 "/Users/tianyi/.opam/system/build/oasis.0.3.0/src/oasis/OASISGettext.ml"
let ns_ str =
str
let s_ str =
str
let f_ (str : ('a, 'b, 'c, 'd) format4) =
str
let fn_ fmt1 fmt2 n =
if n = 1... |
50930fbdbe6e2d83e08fde528310a026731f6efb5a3bdf9d8a6c1130a58ec347 | coccinelle/coccinelle | moreLabels.mli | module Hashtbl :
sig
type ('a, 'b) t = ('a, 'b) Hashtbl.t
val create : ?random:bool -> int -> ('a, 'b) t
val clear : ('a, 'b) t -> unit
val reset : ('a, 'b) t -> unit
val copy : ('a, 'b) t -> ('a, 'b) t
val add : ('a, 'b) t -> key:'a -> data:'b -> unit
val find : ('a, 'b) t -> 'a -> 'b
val find_opt : ('... | null | https://raw.githubusercontent.com/coccinelle/coccinelle/5448bb2bd03491ffec356bf7bd6ddcdbf4d36bc9/bundles/stdcompat/stdcompat-current/interfaces/4.14/moreLabels.mli | ocaml | module Hashtbl :
sig
type ('a, 'b) t = ('a, 'b) Hashtbl.t
val create : ?random:bool -> int -> ('a, 'b) t
val clear : ('a, 'b) t -> unit
val reset : ('a, 'b) t -> unit
val copy : ('a, 'b) t -> ('a, 'b) t
val add : ('a, 'b) t -> key:'a -> data:'b -> unit
val find : ('a, 'b) t -> 'a -> 'b
val find_opt : ('... | |
72e51b339f2ed1340d7d4d016761ad138d8c574ee8f443c6335763dc7c6c0d90 | programaker-project/Programaker-Core | automate_rest_api_user_settings.erl | %%% @doc
%%% REST endpoint to manage user settings
%%% @end
-module(automate_rest_api_user_settings).
-export([init/2]).
-export([ allowed_methods/2
, options/2
, is_authorized/2
, content_types_accepted/2
, resource_exists/2
]).
-export([ accept_json/2
]).
-define(UTI... | null | https://raw.githubusercontent.com/programaker-project/Programaker-Core/ef10fc6d2a228b2096b121170c421f5c29f9f270/backend/apps/automate_rest_api/src/automate_rest_api_user_settings.erl | erlang | @doc
REST endpoint to manage user settings
@end
CORS
Authentication
Don't do authentication if it's just asking for options
Non matching user id
POST handler |
-module(automate_rest_api_user_settings).
-export([init/2]).
-export([ allowed_methods/2
, options/2
, is_authorized/2
, content_types_accepted/2
, resource_exists/2
]).
-export([ accept_json/2
]).
-define(UTILS, automate_rest_api_utils).
-include("./records.hrl").
-r... |
a053f92053dcf89d2cd0703e60f407d1bf004f40123dcb88e3c2401fb801e6ee | richcarl/eunit | eunit_listener.erl | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may
%% not use this file except in compliance with the License. You may obtain
%% a copy of the License at <-2.0>
%%
%% Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an " A... | null | https://raw.githubusercontent.com/richcarl/eunit/cb7eb2bc2cec01e405c717b6f6b551be7d256f06/src/eunit_listener.erl | erlang | not use this file except in compliance with the License. You may obtain
a copy of the License at <-2.0>
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
... | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may
distributed under the License is distributed on an " AS IS " BASIS ,
General Public License ( the " LGPL " ) as published by the Free Software
Foundation ; either version 2.1 , or ( at your option ) any later version .
either the Ap... |
0beffd712b00925b2d23e3e38104b92255b5f38483300910a486f82fc7346806 | atzeus/type-aligned | TASequence.hs | # LANGUAGE CPP #
# LANGUAGE GADTs , TypeSynonymInstances , FlexibleInstances , Rank2Types , KindSignatures #
#if __GLASGOW_HASKELL__ >= 706
# LANGUAGE PolyKinds #
#endif
-----------------------------------------------------------------------------
-- |
Module : Data . TASequence
Copyright : ( c ) ... | null | https://raw.githubusercontent.com/atzeus/type-aligned/b3b150eee234b7c5bfe4b2c973b7936b21b6925c/Data/TASequence.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD-style
Maintainer :
Stability : provisional
Portability : portable
A type class for type aligned sequences: heterogeneous
sequences where the types enforce the element order.
Type aligned sequences are best e... | # LANGUAGE CPP #
# LANGUAGE GADTs , TypeSynonymInstances , FlexibleInstances , Rank2Types , KindSignatures #
#if __GLASGOW_HASKELL__ >= 706
# LANGUAGE PolyKinds #
#endif
Module : Data . TASequence
Copyright : ( c ) 2014
the composition of these functions f 1 ◦ f 2 ◦ f 3 ◦ ... ◦ f n is well type... |
dd1162624830f0681e0f7bb8d9af60c48046fdd1995c0698f03e73bf2864300d | alaricsp/chicken-scheme | chicken.import.scm | chicken.import.scm - import library for " chicken " module
;
Copyright ( c ) 2008 - 2009 , The Chicken Team
; All rights reserved.
;
; Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
; conditions are met:
;
; Redistributions of source code... | null | https://raw.githubusercontent.com/alaricsp/chicken-scheme/1eb14684c26b7c2250ca9b944c6b671cb62cafbc/chicken.import.scm | scheme |
All rights reserved.
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following
conditions are met:
Redistributions of source code must retain the above copyright notice, this list of conditions and the following
disclaimer.
Redistribution... | chicken.import.scm - import library for " chicken " module
Copyright ( c ) 2008 - 2009 , The Chicken Team
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS " AND ANY EXPRESS
CONTRIBUTORS BE LIABLE FOR ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR
CONSEQUENTIAL DAMAGES... |
ed3aea95f364ebd081425fa28e2544f828646f8e3e500a979b595df358e55a5d | clj-commons/seesaw | multi_dialog.clj | Copyright ( c ) , 2011 . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this
; distribution.
; By using this software in any fashion, you are agreeing to be ... | null | https://raw.githubusercontent.com/clj-commons/seesaw/4ca89d0dcdf0557d99d5fa84202b7cc6e2e92263/test/seesaw/test/examples/multi_dialog.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this
distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not rem... | Copyright ( c ) , 2011 . All rights reserved .
(ns seesaw.test.examples.multi-dialog
(:use [seesaw core]))
(defn do-dialog [title]
(-> (dialog
:title title
:modal? :document
:options [(button :text "CLICK!" :listen [:action (fn [e] (return-from-dialog e title))])])
pack! show!... |
6061e6343196b90cf679a58166d7b0ee97982d30c8cb8733642bda68f8fa6f2b | andrewzhurov/brawl-haus | space_versus.cljs | (ns brawl-haus.panels.space-versus
(:require [reagent.core :as r]
[re-frame.core :as rf]
[brawl-haus.panels :as panels]
[brawl-haus.utils :refer [l <sub >evt <=sub =>evt defview view]]
[cljs-time.core :as t]
[cljs-time.coerce :as c]
[cljs-time.fo... | null | https://raw.githubusercontent.com/andrewzhurov/brawl-haus/7f560c3dcee7b242fda545d87c102471fdb21888/src/cljs/brawl_haus/panels/space_versus.cljs | clojure | (ns brawl-haus.panels.space-versus
(:require [reagent.core :as r]
[re-frame.core :as rf]
[brawl-haus.panels :as panels]
[brawl-haus.utils :refer [l <sub >evt <=sub =>evt defview view]]
[cljs-time.core :as t]
[cljs-time.coerce :as c]
[cljs-time.fo... | |
3f93bd75ad274940b8fbd89effdbbf9b33a3077836cdbf75667246a2c7706ee1 | discus-lang/ddc | Runtime.hs |
module DDC.Core.Llvm.Runtime
( varGlobal
* GC Root chain
, nameGlobalLlvmRootChain, varGlobalLlvmRootChain
-- * Intrinsics
, nameGlobalMalloc
, nameGlobalMemcpy
, nameGlobalMemset
, nameGlobalGcroot)
where
import DDC.Llvm.Syntax
import DDC.Core.Llvm.Co... | null | https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-core-llvm/DDC/Core/Llvm/Runtime.hs | haskell | * Intrinsics
Globals ---------------------------------------------------------------------
| Refer to a global variable.
Root Stack ------------------------------------------------------------------
Intrinsics -----------------------------------------------------------------
| Name of the malloc function that is ... |
module DDC.Core.Llvm.Runtime
( varGlobal
* GC Root chain
, nameGlobalLlvmRootChain, varGlobalLlvmRootChain
, nameGlobalMalloc
, nameGlobalMemcpy
, nameGlobalMemset
, nameGlobalGcroot)
where
import DDC.Llvm.Syntax
import DDC.Core.Llvm.Convert.Type
import DDC.Core... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.