_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 |
|---|---|---|---|---|---|---|---|---|
62eb513bfd208bd0bd1acb61b8e2d8ac6be51a74ffbfe0bf6b2f5a7d173f7768 | turquoise-hexagon/euler | solution.scm | (import
(chicken fixnum)
(euler)
(srfi 69))
(define (order n)
(let loop ((i 1))
(let ((_ (fx* i 10)))
(if (fx> _ n)
i
(loop _)))))
(define (make-circular-prime? primes)
(let ((acc (make-hash-table)))
(for-each
(lambda (_)
(hash-table-set! acc _ #t))
primes)
... | null | https://raw.githubusercontent.com/turquoise-hexagon/euler/346c4bc2e0cfe0afff41df9b040af77cdae91a74/src/035/solution.scm | scheme | (import
(chicken fixnum)
(euler)
(srfi 69))
(define (order n)
(let loop ((i 1))
(let ((_ (fx* i 10)))
(if (fx> _ n)
i
(loop _)))))
(define (make-circular-prime? primes)
(let ((acc (make-hash-table)))
(for-each
(lambda (_)
(hash-table-set! acc _ #t))
primes)
... | |
35209b41d5b058cc92e52641829cd636bf876b7d9c2f0babf890684ff9ef26f1 | juspay/euler-hs | DB.hs | {-# LANGUAGE DerivingStrategies #-}
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE FunctionalDependencies #
# LANGUAGE RecordWildCards #
|
Module : EulerHS.Core . Types . DB
Copyright : ( C ) Juspay Technologies Pvt Ltd 2019 - 2022
License : Apache 2.0 ( see... | null | https://raw.githubusercontent.com/juspay/euler-hs/0fdda6ef43c1a6c9c7221d7c194c278e375b9936/src/EulerHS/Core/Types/DB.hs | haskell | # LANGUAGE DerivingStrategies #
# LANGUAGE DeriveAnyClass #
* Core DB
** Types
** Methods
** Helpers
TODO: move somewhere (it's implementation)
TODO: move somewhere (it's implementation)
^ 'Pool' with Postgres connections
^ 'Pool' with MySQL connections
| Representation of native DB connect... | # LANGUAGE FunctionalDependencies #
# LANGUAGE RecordWildCards #
|
Module : EulerHS.Core . Types . DB
Copyright : ( C ) Juspay Technologies Pvt Ltd 2019 - 2022
License : Apache 2.0 ( see the file LICENSE )
Maintainer :
Stability : experimental
Portability : ... |
3a8a9d7b6b44125129696f4a0be587440bcf69bfd1db4f9526bd6ae6bb6bd852 | Mayvenn/storefront | footer_minimal.cljc | (ns storefront.components.footer-minimal
(:require [storefront.accessors.experiments :as experiments]
[storefront.component :as component :refer [defcomponent]]
[storefront.components.footer-links :as footer-links]
[storefront.components.ui :as ui]
[storefront.config :a... | null | https://raw.githubusercontent.com/Mayvenn/storefront/c7f73e173246f123cfc8197ffe651b1d20792f75/src-cljc/storefront/components/footer_minimal.cljc | clojure | Desktop & Tablet
mobile | (ns storefront.components.footer-minimal
(:require [storefront.accessors.experiments :as experiments]
[storefront.component :as component :refer [defcomponent]]
[storefront.components.footer-links :as footer-links]
[storefront.components.ui :as ui]
[storefront.config :a... |
0c803ad2ac83e3e5c376cd40e440033360f59141aa058dc0b0b5bcead75edf7e | AshleyYakeley/Truth | Env.hs | module Pinafore.Language.Library.Env
( envLibSection
) where
import Changes.Core
import Pinafore.Base
import Pinafore.Context
import Pinafore.Language.Library.Convert ()
import Pinafore.Language.Library.Defs
import Pinafore.Language.Library.Storage ()
import Pinafore.Language.Library.Stream
import Shapes
getV... | null | https://raw.githubusercontent.com/AshleyYakeley/Truth/f567d19253bb471cbd8c39095fb414229b27706a/Pinafore/pinafore-language/lib/Pinafore/Language/Library/Env.hs | haskell | module Pinafore.Language.Library.Env
( envLibSection
) where
import Changes.Core
import Pinafore.Base
import Pinafore.Context
import Pinafore.Language.Library.Convert ()
import Pinafore.Language.Library.Defs
import Pinafore.Language.Library.Storage ()
import Pinafore.Language.Library.Stream
import Shapes
getV... | |
c4b64c720cd6b441d8cb8bd6201cd6a486c5dd96827a66970834af07f43eb3a9 | narkisr-deprecated/core | common.clj | (ns openstack.common
"common openstack api access"
(:require
[re-core.model :refer (hypervisor)]
)
(:import
org.openstack4j.openstack.OSFactory
)
)
(defn openstack [tenant]
(let [{:keys [username password endpoint]} (hypervisor :openstack)]
(-> (OSFactory/builder)
(.endpoint e... | null | https://raw.githubusercontent.com/narkisr-deprecated/core/85b4a768ef4b3a4eae86695bce36d270dd51dbae/src/openstack/common.clj | clojure | (ns openstack.common
"common openstack api access"
(:require
[re-core.model :refer (hypervisor)]
)
(:import
org.openstack4j.openstack.OSFactory
)
)
(defn openstack [tenant]
(let [{:keys [username password endpoint]} (hypervisor :openstack)]
(-> (OSFactory/builder)
(.endpoint e... | |
bc1846aaa2a037c31d200b5dea26d13be4cef22315fd07f03a8dacd2c3c109a1 | zalando-stups/kio | sql.clj | ; Copyright 2015 Zalando SE
;
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 Li... | null | https://raw.githubusercontent.com/zalando-stups/kio/d84dd2e27d155340c4d2ae45908a11d637563493/src/org/zalando/stups/kio/sql.clj | clojure | Copyright 2015 Zalando SE
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the speci... | Licensed under the Apache License , Version 2.0 ( the " License " )
distributed under the License is distributed on an " AS IS " BASIS ,
(ns org.zalando.stups.kio.sql
(:require [environ.core :as env]
[yesql.core :refer [defqueries]]
[org.zalando.stups.friboo.system.db :refer [def-db-comp... |
1be57fe9e63bb75bcd3309ed8bae467fdcb222e66839c0b6eda9596000423427 | aphyr/tesser | bench_test.clj | (ns tesser.bench-test
(:require [clojure.test :refer :all]
[clojure.test.check :as tc]
[clojure.test.check [clojure-test :refer :all]
[generators :as gen]
[properties :as prop]]
[multiset.core :refer [multiset]]
... | null | https://raw.githubusercontent.com/aphyr/tesser/2e6fedebbdb127850bd48f255c5793b858eee445/core/test/tesser/bench_test.clj | clojure | For profiling | (ns tesser.bench-test
(:require [clojure.test :refer :all]
[clojure.test.check :as tc]
[clojure.test.check [clojure-test :refer :all]
[generators :as gen]
[properties :as prop]]
[multiset.core :refer [multiset]]
... |
4f5eb04b990d1899add937fee1237dfed617c3344462e38aab449648ae99044b | rorokimdim/stash | TestUtility.hs | module TestUtility
( randomPlainNode
, randomPlainNodes
, randomLine
, randomTitle
, randomText
, randomBody
)
where
import Control.Monad (replicateM)
import Data.Time (getCurrentTime)
import System.Random (randomRIO)
import qualified Data.Text as T
import qualified Test.RandomStrings as RS
import qual... | null | https://raw.githubusercontent.com/rorokimdim/stash/18bdb25b9d1cb0386daf7a2c93bcb4ef654729d9/src/TestUtility.hs | haskell | |Gets a tree of plain-nodes with provided depth and order.
order is the number of children per node
number of nodes at each level = order ^ level
|Gets random text for given format.
|Gets random title for given format.
|Gets random body of text
|Gets a random line of text | module TestUtility
( randomPlainNode
, randomPlainNodes
, randomLine
, randomTitle
, randomText
, randomBody
)
where
import Control.Monad (replicateM)
import Data.Time (getCurrentTime)
import System.Random (randomRIO)
import qualified Data.Text as T
import qualified Test.RandomStrings as RS
import qual... |
9ee3b97ec51f38ca240dfef3740b242635baa2c8af72439534ff089a271a36c8 | achirkin/vulkan | Enum.hs | # LANGUAGE DuplicateRecordFields #
# LANGUAGE OverloadedStrings #
{-# LANGUAGE QuasiQuotes #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE Strict #-}
-- Generate enums and bitmasks
module Write.Types.Enum
( genEnum
, genAlias
, genApiConstants
, enumPattern
, genBitmaskPair
... | null | https://raw.githubusercontent.com/achirkin/vulkan/b2e0568c71b5135010f4bba939cd8dcf7a05c361/genvulkan/src/Write/Types/Enum.hs | haskell | # LANGUAGE QuasiQuotes #
# LANGUAGE Strict #
Generate enums and bitmasks
^ type category bitmask
^ corresponding bits
| Lookup an enum in vk.xml and generate code for it
# INLINE showsPrec #
# INLINE readsPrec #
tname = toQName vkTName
For positive constants, we can make a type-level valu... | # LANGUAGE DuplicateRecordFields #
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
module Write.Types.Enum
( genEnum
, genAlias
, genApiConstants
, enumPattern
, genBitmaskPair
) where
import Control.Lens
import Control.Monad
import Control.Monad.Reader.Class
import Data.Maybe
imp... |
8d5fc66fa5ba151f2bd307ffa011ce6bf43ef5c97256ff235550bc592175f820 | vincenthz/hs-asn1 | Stream.hs | -- |
-- Module : Data.ASN1.Stream
-- License : BSD-style
Maintainer : < >
-- Stability : experimental
-- Portability : unknown
--
module Data.ASN1.Stream
( ASN1Repr
, getConstructedEnd
, getConstructedEndRepr
) where
import Data.ASN1.Types
import Data.ASN1.Types.Lowlevel
associate ... | null | https://raw.githubusercontent.com/vincenthz/hs-asn1/c017c03b0f71a3b45165468a1d1028a0ed7502c0/encoding/Data/ASN1/Stream.hs | haskell | |
Module : Data.ASN1.Stream
License : BSD-style
Stability : experimental
Portability : unknown
| Maintainer : < >
module Data.ASN1.Stream
( ASN1Repr
, getConstructedEnd
, getConstructedEndRepr
) where
import Data.ASN1.Types
import Data.ASN1.Types.Lowlevel
associate a list of asn1 event with an ASN1 type .
- it 's sometimes required to know the exact byte sequence leading to an ASN1 ty... |
731fb030a3f5b43acdce749d19ff8043ffd8116234b7ac8c9ef00fc0ce09f8a3 | szynwelski/nlambda | Nondeterministic.hs | module Nominal.Automaton.Nondeterministic where
import Nominal.Atoms
import Nominal.Automaton.Base
import Nominal.Automaton.Deterministic (isDeterministic)
import Nominal.Formula
import Nominal.Set
import Nominal.Type
import Nominal.Variants
import Prelude hiding (not)
------------------------------------------------... | null | https://raw.githubusercontent.com/szynwelski/nlambda/8357a5f661180438ca6f08104b3f3395d157c0c2/src/Nominal/Automaton/Nondeterministic.hs | haskell | --------------------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------------------
| The constructor of a nondeterministic automaton.
| The constructor of a nondeterministic automaton with additional not... | module Nominal.Automaton.Nondeterministic where
import Nominal.Atoms
import Nominal.Automaton.Base
import Nominal.Automaton.Deterministic (isDeterministic)
import Nominal.Formula
import Nominal.Set
import Nominal.Type
import Nominal.Variants
import Prelude hiding (not)
Nondeterministic automaton
na :: (Nominal q, ... |
60c6c264770608a809507d0c741c56cb326017cb9d1b2905bce08028b477bd09 | pezipink/asi64 | reader.rkt | `
Copyright , 2017
#lang s-exp syntax/module-reader
asi64
#:wrapper1 wrapper1
#:language-info #(asi64/lang/language-info get-language-info #f)
(require "../reader.rkt") | null | https://raw.githubusercontent.com/pezipink/asi64/81e61a25a6f35e137df6326353b9c54f50f2d829/lang/reader.rkt | racket | `
Copyright , 2017
#lang s-exp syntax/module-reader
asi64
#:wrapper1 wrapper1
#:language-info #(asi64/lang/language-info get-language-info #f)
(require "../reader.rkt") | |
e001cb5a3fa94681ca0c0fc7713bc3080a4f25bcc05a18572300c8102d11dc65 | JacobGabrielson/cl-rogue | armor.lisp | ;;;; This file contains misc functions for dealing with armor
@(#)armor.c 3.9 ( Berkeley ) 6/15/81
(in-package :cl-rogue)
(defun wear ()
"The player wants to wear something, so let him/her put it on."
(if cur-armor
(progn
(addmsg "You are already wearing some")
(verbose (addmsg ". You'l... | null | https://raw.githubusercontent.com/JacobGabrielson/cl-rogue/ecc0eba9224313cbc7f8003c15e35dbb0d2b57eb/armor.lisp | lisp | This file contains misc functions for dealing with armor | @(#)armor.c 3.9 ( Berkeley ) 6/15/81
(in-package :cl-rogue)
(defun wear ()
"The player wants to wear something, so let him/her put it on."
(if cur-armor
(progn
(addmsg "You are already wearing some")
(verbose (addmsg ". You'll have to take it off first"))
(endmsg)
(setf ... |
7027c673bd61c0c395b29b0163ff1b0648c3aec589558c0600c78f5236fbacd0 | typesafety/aoc2021 | Day05.hs | module Solutions.Day05 (
solveP1,
solveP2,
) where
import CustomPrelude
import Data.Sequence qualified as Seq
import Data.HashMap.Strict qualified as M
import Text.Megaparsec qualified as P
import Text.Megaparsec.Char qualified as P
import Text.Megaparsec.Char.Lexer qualified as Lex
* Part 1
solveP1 :: Tex... | null | https://raw.githubusercontent.com/typesafety/aoc2021/578980d74b06383ce0008bcc0f4d6a75f64f210d/src/Solutions/Day05.hs | haskell | | Map from coordinate to number of vents.
| Add the vents described by a Line to a VentMap.
| Only considers horizontal and vertical lines.
Vertical line | module Solutions.Day05 (
solveP1,
solveP2,
) where
import CustomPrelude
import Data.Sequence qualified as Seq
import Data.HashMap.Strict qualified as M
import Text.Megaparsec qualified as P
import Text.Megaparsec.Char qualified as P
import Text.Megaparsec.Char.Lexer qualified as Lex
* Part 1
solveP1 :: Tex... |
7319ac204dd5668507e75439986ac994364881675ab61868978e9ecae487b741 | kind2-mc/kind2 | lib.ml | This file is part of the Kind 2 model checker .
Copyright ( c ) 2015 by the Board of Trustees of the University of Iowa
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 a... | null | https://raw.githubusercontent.com/kind2-mc/kind2/f353437dc4f4f9f0055861916e5cbb6e564cfc65/src/utils/lib.ml | ocaml | * function thunk for unimplimented features
**********************************************************************
Helper functions
**********************************************************************
Identity function.
Returns true when given unit.
Ret... | This file is part of the Kind 2 model checker .
Copyright ( c ) 2015 by the Board of Trustees of the University of Iowa
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 a... |
9a7e8317048c30991c2ce82bc9d081ce4b4e1ce5960ad3fca4ca71900cd3e7f2 | screenshotbot/screenshotbot-oss | binding.lisp | (pkg:define-package :util/java/binding
(:use #:cl
#:alexandria)
(:import-from #:util/java/java
#:invoke)
(:export
#:bind-instance))
(defun javafy-name (name)
(let ((name (string name)))
(cond
((str:ends-with-p "-P" name)
(str:camel-case (format nil "is-~a" (cl-pp... | null | https://raw.githubusercontent.com/screenshotbot/screenshotbot-oss/4e9a99ee9dac3821843238e357c86e31745f7df2/src/util/java/binding.lisp | lisp | (pkg:define-package :util/java/binding
(:use #:cl
#:alexandria)
(:import-from #:util/java/java
#:invoke)
(:export
#:bind-instance))
(defun javafy-name (name)
(let ((name (string name)))
(cond
((str:ends-with-p "-P" name)
(str:camel-case (format nil "is-~a" (cl-pp... | |
e547b14b45deb1c5e513ffe5926b80886600695918118e7cec5ac2deaf0ea6ee | ciderpunx/57-exercises-for-programmers | P16DrivingAgeSpec.hs | module P16DrivingAgeSpec (main,spec) where
import Test.Hspec
import P16DrivingAge hiding (main)
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "drivingMsg" $ do
it "gives are of driving age for UK, 17" $
drivingMsg "UK" 17 `shouldBe` "You are old enough to drive in UK"
it "gives are ... | null | https://raw.githubusercontent.com/ciderpunx/57-exercises-for-programmers/25958ab80cc3edc29756d3bddd2d89815fd390bf/test/P16DrivingAgeSpec.hs | haskell | module P16DrivingAgeSpec (main,spec) where
import Test.Hspec
import P16DrivingAge hiding (main)
main :: IO ()
main = hspec spec
spec :: Spec
spec = do
describe "drivingMsg" $ do
it "gives are of driving age for UK, 17" $
drivingMsg "UK" 17 `shouldBe` "You are old enough to drive in UK"
it "gives are ... | |
95ecfe4ab3779853c374f94afd1f70ca2f17f8fb00f893a038f0fb5e728f6fd6 | andreasabel/miniagda | Eval.hs | # LANGUAGE TupleSections , FlexibleInstances , FlexibleContexts , NamedFieldPuns #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - orphans #
Activate this flag if i < $ i should only hold for i < # .
# define
module Eval where
import Prelude hiding (mapM, null, pi)
#if !MIN_VERSION... | null | https://raw.githubusercontent.com/andreasabel/miniagda/55374597238071c2c2c74acf166cf95b34281e1f/src/Eval.hs | haskell | import Debug.Trace (trace)
positivity checking
trace msg a
traceM msg
trace msg a
traceM msg
trace msg a
traceM msg
traceLoop msg a = trace msg a
traceLoopM msg = traceM msg
trace msg a
traceM msg
traceSize msg a = trace msg a
traceSizeM msg = traceM msg
evaluation with rewriting ------------------------... | # LANGUAGE TupleSections , FlexibleInstances , FlexibleContexts , NamedFieldPuns #
# LANGUAGE NoImplicitPrelude #
# LANGUAGE CPP #
# OPTIONS_GHC -fno - warn - orphans #
Activate this flag if i < $ i should only hold for i < # .
# define
module Eval where
import Prelude hiding (mapM, null, pi)
#if !MIN_VERSION... |
1f55cea580568826416d966d75c976fac64916b978e664e278b1ab9f4e393a66 | v-kolesnikov/sicp | 1_11_test.clj | (ns sicp.chapter01.1-11-test
(:require [clojure.test :refer :all]
[sicp.test-helper :refer :all]
[sicp.chapter01.1-11 :refer :all]))
(deftest test-f-recursive
(assert-equal 1 (f-recursive 1))
(assert-equal 2 (f-recursive 2))
(assert-equal 3 (f-recursive 3))
(assert-equal 6 (f-recursiv... | null | https://raw.githubusercontent.com/v-kolesnikov/sicp/4298de6083440a75898e97aad658025a8cecb631/test/sicp/chapter01/1_11_test.clj | clojure | (ns sicp.chapter01.1-11-test
(:require [clojure.test :refer :all]
[sicp.test-helper :refer :all]
[sicp.chapter01.1-11 :refer :all]))
(deftest test-f-recursive
(assert-equal 1 (f-recursive 1))
(assert-equal 2 (f-recursive 2))
(assert-equal 3 (f-recursive 3))
(assert-equal 6 (f-recursiv... | |
b829a661547b1068764997a6505e4aa3963459c53d5f10fb7164cdfbfa7fc621 | rcherrueau/APE | web08.rkt | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Web Applications in Racket
;; -lang.org/continue/
;;
8 . Extending the Model
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#lang web-server/insta
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;... | null | https://raw.githubusercontent.com/rcherrueau/APE/8b5302709000bd043b64d46d55642acb34ce5ba7/racket/webAppInRacket/web08.rkt | racket |
-lang.org/continue/
Blog Structure
Posts
Blog post data-structure
A blog post is title, a body (content) and a list of comments.
post-add-comment! : post comment -> void
Consumes a post and a comment, adds the comment at the end of the post.
Blog
Mutable structure provide mutators to change their fie... | Web Applications in Racket
8 . Extending the Model
#lang web-server/insta
(struct post(title body comments) #:mutable)
(define (post-add-comment! post comment)
(set-post-comments! (append (post-comments post) (list comment))))
A blog is a ( blog posts ) where posts is a ( listof post )
So blog struct pr... |
2da7207458fda04e9153fb7e9dfe0a55069044509a01b7378e013f752e0e42c2 | abcdw/rde | fonts.scm | ;;; rde --- Reproducible development environment.
;;;
Copyright © 2022 < >
;;;
;;; This file is part of rde.
;;;
;;; rde is free software; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; either version 3 of the License , ... | null | https://raw.githubusercontent.com/abcdw/rde/5b8605f421d0b8a9569e43cb6f7e651e7a8f7218/src/rde/packages/fonts.scm | scheme | rde --- Reproducible development environment.
This file is part of rde.
rde is free software; you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
rde is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the im... | Copyright © 2022 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
(define-module (rde packages fonts)
#:use-module (guix build-system trivial)
#:use-module (guix build-system font)
#:use-module (guix download)
#:use... |
8cf32f589a3b272ac3d3e6dd1a74192476c9e65587313b879a548e5ee1be0b75 | ftovagliari/ocamleditor | project_xml.ml |
OCamlEditor
Copyright ( C ) 2010 - 2014
This file is part of OCamlEditor .
OCamlEditor is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at y... | null | https://raw.githubusercontent.com/ftovagliari/ocamleditor/53284253cf7603b96051e7425e85a731f09abcd1/src/project_xml.ml | ocaml | * write
Xml.Element ("description", [], [Xml.PCData proj.description]);
, _
_data
* xml_bs_targets
* xml_bs_args
* xml_commands
* read
Backward compatibility with 1.7.5
Backward compatibility with 1.7.5
Backward compatibility with 1.7.5
Patch build tasks connected to the runtime
Set default runtime con... |
OCamlEditor
Copyright ( C ) 2010 - 2014
This file is part of OCamlEditor .
OCamlEditor is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at y... |
77b3ff9688d844219d5517c0e24a49730e509e2cf00ca3e4aa6a3f55b3477266 | blancas/kern | json.clj | (ns ^{:doc "A sample JSON parser."
:author "Armando Blancas"}
json
(:use [blancas.kern.core]
[blancas.kern.lexer.basic]))
;; To try:
(comment
(load "json")
(ns json)
(run jvalue (slurp "src/main/resources/tweet.json"))
)
(declare jvalue)
(def pair
"Parses the rule: pair := String ':' jvalue"
(... | null | https://raw.githubusercontent.com/blancas/kern/3ef65e559658c06a321a9ca7c85a541edc7b9ff2/src/main/resources/json.clj | clojure | To try: | (ns ^{:doc "A sample JSON parser."
:author "Armando Blancas"}
json
(:use [blancas.kern.core]
[blancas.kern.lexer.basic]))
(comment
(load "json")
(ns json)
(run jvalue (slurp "src/main/resources/tweet.json"))
)
(declare jvalue)
(def pair
"Parses the rule: pair := String ':' jvalue"
(bind [f str... |
5988ab8031d4117882b060cc5a1e29f5a53cf3790691549c93ea582f4f0e7d18 | foreverbell/project-euler-solutions | 81.hs | import Data.Array.ST
import Control.Monad
import Control.Monad.ST
getShortest :: [[Int]] -> Int
getShortest mat = runST $ do
dp <- newArray ((0, 0), (n - 1, m - 1)) 0 :: ST s (STArray s (Int, Int) Int)
forM_ [0 .. n - 1] $ \i -> do
forM_ [0 .. m - 1] $ \j -> do
update dp i j
readArray d... | null | https://raw.githubusercontent.com/foreverbell/project-euler-solutions/c0bf2746aafce9be510892814e2d03e20738bf2b/src/81.hs | haskell | import Data.Array.ST
import Control.Monad
import Control.Monad.ST
getShortest :: [[Int]] -> Int
getShortest mat = runST $ do
dp <- newArray ((0, 0), (n - 1, m - 1)) 0 :: ST s (STArray s (Int, Int) Int)
forM_ [0 .. n - 1] $ \i -> do
forM_ [0 .. m - 1] $ \j -> do
update dp i j
readArray d... | |
2597151350ea4e899db9aa5e5123c94373c35cf42560b817b67c40cebe473c12 | S8A/htdp-exercises | ex221.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 ex221) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "univers... | null | https://raw.githubusercontent.com/S8A/htdp-exercises/578e49834a9513f29ef81b7589b28081c5e0b69f/ex221.rkt | racket | about the language level of this file in a form that our tools can easily process.
Constants :.
# of blocks, horizontally
blocks are squares
red squares with black rims
Data definitions :.
(make-tetris Block Landscape)
A Landscape is one of:
– '()
– (cons Block Landscape)
A Block is a structure:
interpr... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-beginner-abbr-reader.ss" "lang")((modname ex221) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp") (lib "batch-io.rkt" "teachpack" "2htdp") (lib "itunes.rkt"... |
758410b69aab83d5e8049b10b6ca737866d36a735affe4dfeed3720f5127a9f1 | clash-lang/clash-prelude | DDR.hs | |
Copyright : ( C ) 2017 , Google Inc
License : BSD2 ( see the file LICENSE )
Maintainer : < >
We simulate DDR signal by using ' Signal 's which have exactly half the period
( or double the speed ) of our normal ' Signal 's .
The primives in this module can be used to produce of consume DDR... | null | https://raw.githubusercontent.com/clash-lang/clash-prelude/5645d8417ab495696cf4e0293796133c7fe2a9a7/src/Clash/Explicit/DDR.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE TypeOperators #
* Internal
of values.
^ clock
^ reset
^ reset values
^ DDR input signal
^ normal speed output pairs
| DDR output primitive
^ clock
^ reset
^ reset value
^ normal speed input pairs
^ DDR output signal
first input.
| |
Copyright : ( C ) 2017 , Google Inc
License : BSD2 ( see the file LICENSE )
Maintainer : < >
We simulate DDR signal by using ' Signal 's which have exactly half the period
( or double the speed ) of our normal ' Signal 's .
The primives in this module can be used to produce of consume DDR... |
df6bea7411719ac9c46174fff745ef1e705e507d1ac5f9a47f779e5a75a4fd5c | jiacai2050/blog-backup | runner.cljs | (ns blog-backup.runner
(:require [doo.runner :refer-macros [doo-tests]]
[blog-backup.util-test]))
;; (doo.runner/doo-all-tests)
(doo-tests 'blog-backup.util-test)
| null | https://raw.githubusercontent.com/jiacai2050/blog-backup/5c76db345699b23cfd3759b62d743f41edf17d2e/test/blog_backup/runner.cljs | clojure | (doo.runner/doo-all-tests) | (ns blog-backup.runner
(:require [doo.runner :refer-macros [doo-tests]]
[blog-backup.util-test]))
(doo-tests 'blog-backup.util-test)
|
3315942b9e71baa7411bfbb8aa58969fdf7c7f9c4aa8f8927f86e11bab851d15 | seckcoder/course-compiler | s1_2.rkt | (let ([x #f])
42) | null | https://raw.githubusercontent.com/seckcoder/course-compiler/4363e5b3e15eaa7553902c3850b6452de80b2ef6/tests/s1_2.rkt | racket | (let ([x #f])
42) | |
c9486b491a46cb4645b16dc87b36335681c3e631baca05fe73b6de00ac39b126 | YoshikuniJujo/test_haskell | Q.hs | # LANGUAGE TemplateHaskell #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module BigTuple.Example.Q where
import Language.Haskell.TH
data Tuple3 a b c = Tuple3 a b c deriving Show
foo0 :: DecsQ
foo0 = [d| data Tuple3 a b c = Tuple3 a b c |]
foo :: ExpQ
foo = [| Tuple3 1 2 3 |]
bar :: TypeQ
bar = [t| Tuple3 Int Char (... | null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/59b4f68cfacd8e3b0911dc8d4cb754a201d7a381/tribial/try-tribials/src/BigTuple/Example/Q.hs | haskell | # LANGUAGE TemplateHaskell #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module BigTuple.Example.Q where
import Language.Haskell.TH
data Tuple3 a b c = Tuple3 a b c deriving Show
foo0 :: DecsQ
foo0 = [d| data Tuple3 a b c = Tuple3 a b c |]
foo :: ExpQ
foo = [| Tuple3 1 2 3 |]
bar :: TypeQ
bar = [t| Tuple3 Int Char (... | |
97a43547abc957107ba657a37f8eb4dc7ed9d3f01f90e985df9b9b40b6c112a8 | arcfide/chez-srfi | cut.sps | #!r6rs
Copyright 2010 . My MIT - style license is in the file named
;; LICENSE from the original collection this file is distributed with.
(import
(except (rnrs) display newline)
(srfi :78 lightweight-testing)
(srfi private include)
(srfi :26 cut))
(define (ignore . _) (values))
(define display ignore)
... | null | https://raw.githubusercontent.com/arcfide/chez-srfi/96fb553b6ba0834747d5ccfc08c181aa8fd5f612/tests/cut.sps | scheme | LICENSE from the original collection this file is distributed with.
free-identifier=? of <> and <...> | #!r6rs
Copyright 2010 . My MIT - style license is in the file named
(import
(except (rnrs) display newline)
(srfi :78 lightweight-testing)
(srfi private include)
(srfi :26 cut))
(define (ignore . _) (values))
(define display ignore)
(define newline ignore)
(define check-all ignore)
(let-syntax ((define... |
f6b5ebcc099784faed0253b94c72f4fa29ad0e280e57d58fa9551a05f99edac6 | p1mps/roterabebot | core.clj | (ns roterabebot.core
(:gen-class)
(:require
[cheshire.core :as json]
[clojure.string :as string]
[mount.core :as mount]
[roterabebot.http :as http]
[roterabebot.markov :as markov]
[roterabebot.nlp :as nlp]
[roterabebot.socket :as socket]))
(def bot-ids ["U028XHG7U4B" "UFTAL8WH4"])
(def events-... | null | https://raw.githubusercontent.com/p1mps/roterabebot/1518ae1afe73dd8f64c4aabf46e6e5d091f36397/src/roterabebot/core.clj | clojure | not a bot nor empty
bot's mention, we reply
keep in memory the timestamp of received messages to not reply to messages already received
(nlp/reset-sentences reply)
drop some messages when there are too many in memory
if it's a user message we save it and we just regenerate all our sentences | (ns roterabebot.core
(:gen-class)
(:require
[cheshire.core :as json]
[clojure.string :as string]
[mount.core :as mount]
[roterabebot.http :as http]
[roterabebot.markov :as markov]
[roterabebot.nlp :as nlp]
[roterabebot.socket :as socket]))
(def bot-ids ["U028XHG7U4B" "UFTAL8WH4"])
(def events-... |
af5f81aa4732f6d47f5ff29bde5820ef397ab9ebd20d8377e4b78dbceba02401 | ailisp/simple-gui | cards.lisp | (eval-when (:compile-toplevel :load-toplevel :execute)
(use-package :simple-gui)
(use-package :q-))
(defparameter *rows* 6)
(defparameter *cols* 8)
(defparameter *block-size* 90)
(defparameter *kinds* 15)
(defvar *empty-icon*)
(defvar *current-flip* nil)
(defvar *board-total-size*)
(defvar *board*)
(defvar *board... | null | https://raw.githubusercontent.com/ailisp/simple-gui/35919f8cab7771f106d0fc268f47866b0fb5526d/examples/cards.lisp | lisp | (eval-when (:compile-toplevel :load-toplevel :execute)
(use-package :simple-gui)
(use-package :q-))
(defparameter *rows* 6)
(defparameter *cols* 8)
(defparameter *block-size* 90)
(defparameter *kinds* 15)
(defvar *empty-icon*)
(defvar *current-flip* nil)
(defvar *board-total-size*)
(defvar *board*)
(defvar *board... | |
ec69e51f82dd360ad462bacfc145a24eb9c9f4661bcf53225dfb360636067994 | kafka4beam/snabbkaffe | snabbkaffe_sup.erl | Copyright 2019 - 2020 Klarna Bank AB
Copyright 2021 snabbkaffe contributors
%%
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... | null | https://raw.githubusercontent.com/kafka4beam/snabbkaffe/13bda71d0dfd2c7c23352412f365f23145b43d06/src/snabbkaffe_sup.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 2019 - 2020 Klarna Bank AB
Copyright 2021 snabbkaffe contributors
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@private
-module(snabbkaffe_sup).
-behaviour(supervisor).
-export([start_link/0, stop/0]).
-... |
39e6541f7a882ef010538e41dbd8ebc4abbb8bc2ef31f80cceb1b7f4f380a803 | RBornat/jape | rewinf.ml |
Copyright ( C ) 2003 - 19
This file is part of the proof engine , which is part of .
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 ver... | null | https://raw.githubusercontent.com/RBornat/jape/afe9f207e89e965636b43ef8fad38fd1f69737ae/distrib/camlengine/rewinf.ml | ocaml | see rewrite.sml for an explanation of this data structure |
Copyright ( C ) 2003 - 19
This file is part of the proof engine , which is part of .
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 ver... |
db42a072304cbc6e91c4ac3d9a9b63381a9477c5dd3e0d47967d69255789b102 | typeclasses/haskell-phrasebook | test-logging.hs | import qualified Data.Map.Strict as Map
main = propertyMain $ withTests 1 $ property do
let levels = ["INFO", "ERROR"]
(output, fileOutputs) <- liftIO $ flip runContT pure do
files <- Map.fromList <$> for levels \l -> do
f <- ContT \c -> withSystemTempFile (l <> ".txt") \fp h -> hClose h *>... | null | https://raw.githubusercontent.com/typeclasses/haskell-phrasebook/2b0aa44ef6f6e9745c51ed47b4e59ff704346c87/tests/test-logging.hs | haskell | import qualified Data.Map.Strict as Map
main = propertyMain $ withTests 1 $ property do
let levels = ["INFO", "ERROR"]
(output, fileOutputs) <- liftIO $ flip runContT pure do
files <- Map.fromList <$> for levels \l -> do
f <- ContT \c -> withSystemTempFile (l <> ".txt") \fp h -> hClose h *>... | |
555f434a86bc5cbd7689a0cc52e1cce034045b6d076989933a501f6778c468b9 | themetaschemer/malt | test-E-argmax.rkt | (module+ test
(require (only-in "../tensors.rkt" tensor))
(let ((y (tensor 0.0 0.0 1.0 0.0)))
(check-ρ-∇ (d-argmax y) 2.0
(list (tensor 0.0 0.0 0.0 0.0))))
(let ((y (tensor (tensor 0.0 0.0 1.0 0.0)
(tensor 0.0 1.0 0.0 0.0)
(tensor 1.0 0.0 0.0 0.0)
... | null | https://raw.githubusercontent.com/themetaschemer/malt/78a04063a5a343f5cf4332e84da0e914cdb4d347/flat-tensors/ext-ops/test/test-E-argmax.rkt | racket | (module+ test
(require (only-in "../tensors.rkt" tensor))
(let ((y (tensor 0.0 0.0 1.0 0.0)))
(check-ρ-∇ (d-argmax y) 2.0
(list (tensor 0.0 0.0 0.0 0.0))))
(let ((y (tensor (tensor 0.0 0.0 1.0 0.0)
(tensor 0.0 1.0 0.0 0.0)
(tensor 1.0 0.0 0.0 0.0)
... | |
0f6c895c7e83b7ae510fd09047732c61c88d0300adde6d2b3319676e3537d5bb | janestreet/lwt-async | lwt_pool.mli | Lwt
*
* Copyright ( C ) 2008
* 2012
* Laboratoire PPS - CNRS Université Paris Diderot
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , wit... | null | https://raw.githubusercontent.com/janestreet/lwt-async/c738e6202c1c7409e079e513c7bdf469f7f9984c/src/core/lwt_pool.mli | ocaml | * Creating pools (for example pools of connections to a database).
* Instead of creating a new connection each time you need one,
keep a pool of opened connections and reuse opened connections
that are free.
* Type of pools
* [create n ?check ?validate f] creates a new pool with at most
[n] members. [f... | Lwt
*
* Copyright ( C ) 2008
* 2012
* Laboratoire PPS - CNRS Université Paris Diderot
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , wit... |
12ef367c9944e341b16bdc10fce5711972816f7f6642aed191bbc5345441d3ba | sgimenez/laby | level.mli |
* Copyright ( C ) 2007 - 2014 The laby team
* You have permission to copy , modify , and redistribute under the
* terms of the GPL-3.0 . For full license terms , see gpl-3.0.txt .
* Copyright (C) 2007-2014 The laby team
* You have permission to copy, modify, and redistribute under the
* terms of the GPL... | null | https://raw.githubusercontent.com/sgimenez/laby/47f9560eb827790d26900bb553719afb4b0554ea/src/level.mli | ocaml | type of levels
loads a given file
width and height of the level
generates a initial labyrinth state for the given level |
* Copyright ( C ) 2007 - 2014 The laby team
* You have permission to copy , modify , and redistribute under the
* terms of the GPL-3.0 . For full license terms , see gpl-3.0.txt .
* Copyright (C) 2007-2014 The laby team
* You have permission to copy, modify, and redistribute under the
* terms of the GPL... |
1a1f750a11f93e688a47c6dbc356f50918a8888323da8ffd57ec2c3bdef63af8 | input-output-hk/project-icarus-importer | Util.hs | | Pending tx utils which db depends on
module Pos.Wallet.Web.Pending.Util
( incPtxSubmitTimingPure
, mkPtxSubmitTiming
, ptxMarkAcknowledgedPure
, cancelApplyingPtx
, resetFailedPtx
, sortPtxsChrono
, allPendingAddresses
, nonConfirmedTransactions
) where
import Univers... | null | https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/wallet/src/Pos/Wallet/Web/Pending/Util.hs | haskell | | Sort pending transactions as close as possible to chronological order.
| If given pending transaction is not yet confirmed, cancels it.
| If given transaction is in 'PtxWontApply' condition, sets its condition
again.
Has no effect for transactions in other conditions.
| Returns the full list of "pending addres... | | Pending tx utils which db depends on
module Pos.Wallet.Web.Pending.Util
( incPtxSubmitTimingPure
, mkPtxSubmitTiming
, ptxMarkAcknowledgedPure
, cancelApplyingPtx
, resetFailedPtx
, sortPtxsChrono
, allPendingAddresses
, nonConfirmedTransactions
) where
import Univers... |
0692c0f7ccaa04fe25040926f57d4e4e13a9186f459088daf465984b399bd3f0 | yi-editor/yi | Tag.hs | {-# LANGUAGE CPP #-}
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
{-# OPTIONS_HADDOCK show-extensions #-}
# LANGUAGE GeneralizedNewtypeDeriving #
-- |
-- Module : Yi.Tag... | null | https://raw.githubusercontent.com/yi-editor/yi/58c239e3a77cef8f4f77e94677bd6a295f585f5f/yi-core/src/Yi/Tag.hs | haskell | # LANGUAGE CPP #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE OverloadedStrings #
# LANGUAGE TemplateHaskell #
# OPTIONS_HADDOCK show-extensions #
|
Module : Yi.Tag
License : GPL-2
Maintainer :
Stability : experimental
Portability : portable
file produced by @hasktags@, not th... | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
A module for CTags integration . Note that this reads the ‘ tags ’
module Yi.Tag ( lookupTag
, importTagTable
, hintTags
, completeTag
, Tag(..)
... |
4fe4c339819a2601bcd9bb4886ec8affbf4c90f0b50f7da6e3eae553e0448473 | scicloj/clj-djl | cv.clj | (ns clj-djl.modality.cv
(:import [ai.djl.modality.cv ImageFactory]))
(defn download-image-from [url]
(.fromUrl (ImageFactory/getInstance) url))
| null | https://raw.githubusercontent.com/scicloj/clj-djl/f089b10a22c869c0e643d456dc9bbad8233bd6ac/src/clj_djl/modality/cv.clj | clojure | (ns clj-djl.modality.cv
(:import [ai.djl.modality.cv ImageFactory]))
(defn download-image-from [url]
(.fromUrl (ImageFactory/getInstance) url))
| |
5046f4c2e7c2dd1e8f277611efed1c92b3040a0c7fdf9e9d267ecdc2c55722be | ivan-m/graphviz | Values.hs | # LANGUAGE CPP , OverloadedStrings #
{-# OPTIONS_HADDOCK hide #-}
|
Module : Data . GraphViz . Attributes . Values
Description : Values for use with the Attribute data type
Copyright : ( c )
License : 3 - Clause BSD - style
Maintainer :
Defined to have smaller module... | null | https://raw.githubusercontent.com/ivan-m/graphviz/42dbb6312d7edf789d7055079de7b4fa099a4acc/Data/GraphViz/Attributes/Values.hs | haskell | # OPTIONS_HADDOCK hide #
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
| Should only have 2D points (i.e. created with 'createPoint').
-----------------------------------------------------------------------... | # LANGUAGE CPP , OverloadedStrings #
|
Module : Data . GraphViz . Attributes . Values
Description : Values for use with the Attribute data type
Copyright : ( c )
License : 3 - Clause BSD - style
Maintainer :
Defined to have smaller modules and thus faster compilation... |
9d5e5e08e96d8b1792e07facef86ddd63278ee13df9a593a2bc67c7049dfe8e7 | HugoPeters1024/hs-sleuth | Fold.hs | -- | Benchmark which formats paragraph, like the @sort@ unix utility.
--
-- Tested in this benchmark:
--
-- * Reading the file
--
-- * Splitting into paragraphs
--
-- * Reformatting the paragraphs to a certain line width
--
* the results using the text builder
--
-- * Writing back to a handle
--
{-# LANGUAGE Overloa... | null | https://raw.githubusercontent.com/HugoPeters1024/hs-sleuth/385655e62031959a14a3bac5e9ccd1c42c045f0c/test-project/text-1.2.4.0/benchmarks/haskell/Benchmarks/Programs/Fold.hs | haskell | | Benchmark which formats paragraph, like the @sort@ unix utility.
Tested in this benchmark:
* Reading the file
* Splitting into paragraphs
* Reformatting the paragraphs to a certain line width
* Writing back to a handle
# LANGUAGE OverloadedStrings #
| We represent a paragraph by a word list
| Fold a t... | * the results using the text builder
module Benchmarks.Programs.Fold
( benchmark
) where
import Data.List (foldl')
import Data.List (intersperse)
import Data.Monoid (mempty, mappend, mconcat)
import System.IO (Handle)
import Criterion (Benchmark, bench, whnfIO)
import qualified Data.Text as T
import qualifi... |
c6c0f0c3cb3dfb895ef956ce213825f42332f96b177f90700ac5b9036c96c419 | lisp-mirror/clpm | cli-source.lisp | ;;;; Definitions for using CLI options as a config source
;;;;
This software is part of CLPM . See README.org for more information . See
;;;; LICENSE for license information.
(uiop:define-package #:clpm/config/cli-source
(:use #:cl
#:clpm/config/defs
#:clpm/config/source-defs)
(:export #:co... | null | https://raw.githubusercontent.com/lisp-mirror/clpm/ad9a704fcdd0df5ce30ead106706ab6cc5fb3e5b/clpm/config/cli-source.lisp | lisp | Definitions for using CLI options as a config source
LICENSE for license information. | This software is part of CLPM . See README.org for more information . See
(uiop:define-package #:clpm/config/cli-source
(:use #:cl
#:clpm/config/defs
#:clpm/config/source-defs)
(:export #:config-cli-source))
(in-package #:clpm/config/cli-source)
(defclass config-cli-source (config-source)... |
2e6fbb32a61961835d8a5c093f737eb2cef8341ce6e3ebcd6d955a139dcfd143 | links-lang/links | transform.mli | module type INTERFACE = sig
type state
type 'a result
val name : string
val program : state ->
Sugartypes.program ->
Sugartypes.program result
val sentence : state ->
Sugartypes.sentence ->
Sugartypes.sentence result
end
module type UNTYPED... | null | https://raw.githubusercontent.com/links-lang/links/2923893c80677b67cacc6747a25b5bcd65c4c2b6/core/transform.mli | ocaml | This virtual class helps break the dependency cycle:
Value -> DesugarDatatypes -> Transform -> TransformSugar -> DesugarDatatypes -> Transform
| module type INTERFACE = sig
type state
type 'a result
val name : string
val program : state ->
Sugartypes.program ->
Sugartypes.program result
val sentence : state ->
Sugartypes.sentence ->
Sugartypes.sentence result
end
module type UNTYPED... |
2bbe7a39089c3f9749618153d5b02d7262576d268c08c3f0797ca548d22292da | racket/htdp | jpr-bug.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-advanced-reader.ss" "lang")((modname jpr-bug) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #... | null | https://raw.githubusercontent.com/racket/htdp/aa78794fa1788358d6abd11dad54b3c9f4f5a80b/htdp-test/2htdp/tests/jpr-bug.rkt | racket | about the language level of this file in a form that our tools can easily process.
This program demonstrated that the idea of using default handlers (K) for
absent mouse and key handlers was a horrible idea. The balls on his cannvas
just started jumping around when the mouse moved in. | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-advanced-reader.ss" "lang")((modname jpr-bug) (read-case-sensitive #t) (teachpacks ()) (htdp-settings #(#t constructor repeating-decimal #t #t none #f ())))
(require 2htdp/universe)
(require 2htdp/image)
(define (animati... |
8cc0b17e9a8753b76d39da7118de43cced344de349ce4f5c7bd375ac795f97ad | raymorgan/merl | support.erl | -module (merl.router.support).
-author ("Ray Morgan").
-export ([split_path/1, atomize/1, bindings_from/1, is_var/1]).
-import (string).
-import (lists).
split_path(Path) ->
[P|_] = string:tokens(Path, [$?, $.]),
atomize(string:tokens(P, [$/])).
atomize([]) -> [];
atomize([H|T]) ->
[list_to_atom(H)|atomize(... | null | https://raw.githubusercontent.com/raymorgan/merl/f71df567bc61b7b088d534df99ce8955dbfa5407/src/router/support.erl | erlang | -module (merl.router.support).
-author ("Ray Morgan").
-export ([split_path/1, atomize/1, bindings_from/1, is_var/1]).
-import (string).
-import (lists).
split_path(Path) ->
[P|_] = string:tokens(Path, [$?, $.]),
atomize(string:tokens(P, [$/])).
atomize([]) -> [];
atomize([H|T]) ->
[list_to_atom(H)|atomize(... | |
46b41a76037db6d8167e196274bd04b667c86b04f2752f1da8c8607540e1a1a7 | fumieval/webauthn | TPM.hs | {-# LANGUAGE OverloadedStrings #-}
| 8.3 . TPM Attestation Statement Format
--
-- Work in progress. Do not use.
module WebAuthn.Attestation.Statement.TPM where
import Data.ByteString (ByteString)
import Crypto.Hash (Digest, SHA256)
import qualified Data.X509 as X509
import qualified Codec.CBOR.Term as CBOR
import qu... | null | https://raw.githubusercontent.com/fumieval/webauthn/46343b0afc0b57bd78546765139265f5b3142b5d/webauthn/src/WebAuthn/Attestation/Statement/TPM.hs | haskell | # LANGUAGE OverloadedStrings #
Work in progress. Do not use.
#algorithms | | 8.3 . TPM Attestation Statement Format
module WebAuthn.Attestation.Statement.TPM where
import Data.ByteString (ByteString)
import Crypto.Hash (Digest, SHA256)
import qualified Data.X509 as X509
import qualified Codec.CBOR.Term as CBOR
import qualified Codec.CBOR.Decoding as CBOR
import qualified Data.Map as Map
i... |
2d2bc1e3503d9fed7375c32f2fa4c5c68baa8355ed37888cfed3561a785ce898 | ghilesZ/apronext | abox.ml | include Domain.Make (struct
type t = Box.t
let man = Box.manager_alloc ()
end)
(** given a box, builds an iterator over triplets : variables, type, interval
e.g: [let it = iterator b in it (); it (); it()].
@raise Exit when all dimension have been iterated on. *)
let iterator b =
let {box1_env; interva... | null | https://raw.githubusercontent.com/ghilesZ/apronext/4472f711ea4e54945cc91d469b852105a3f44343/src/abox.ml | ocaml | * given a box, builds an iterator over triplets : variables, type, interval
e.g: [let it = iterator b in it (); it (); it()].
@raise Exit when all dimension have been iterated on.
* Difference operator for boxes. WARNING, real variable have a floatting point
semantics, e.g [\[0.;1.\] - \[0.5; 1.\]= \[0.; ... | include Domain.Make (struct
type t = Box.t
let man = Box.manager_alloc ()
end)
let iterator b =
let {box1_env; interval_array} = to_box1 b in
let i = ref 0 in
let len = Array.length interval_array in
fun () ->
if !i >= len then raise Exit
else
let v = E.var_of_dim box1_env !i in
let ty... |
e9d98c632041d8c25d7ba0f78a40446c09bb34cbcb6fefff13ab7142737310d0 | davexunit/guile-2d | audio.scm | ;;; guile-2d
Copyright ( C ) 2013 >
;;;
;;; Guile-2d is free software: you can redistribute it and/or modify it
;;; under the terms of the GNU Lesser General Public License as
published by the Free Software Foundation , either version 3 of the
;;; License, or (at your option) any later version.
;;;
;;; Guile-2d... | null | https://raw.githubusercontent.com/davexunit/guile-2d/83d9dfab5b04a337565cb2798847b15e4fbd7786/2d/audio.scm | scheme | guile-2d
Guile-2d is free software: you can redistribute it and/or modify it
under the terms of the GNU Lesser General Public License as
License, or (at your option) any later version.
Guile-2d is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MER... | Copyright ( C ) 2013 >
published by the Free Software Foundation , either version 3 of the
You should have received a copy of the GNU Lesser General Public
Wrappers over SDL mixer .
(define-module (2d audio)
#:use-module (srfi srfi-9)
#:use-module (srfi srfi-2)
#:use-module ((sdl mixer) #:prefix SDL... |
69958a9ac3a294305401d54e41c29958d6f5b12756d5e336468a356977464f01 | youscape/ebt | ebt_transform.erl | %%%-------------------------------------------------------------------
@author zyuyou
( C ) 2015 ,
@doc 实现行为树节点的继承
%%%
%%% @end
%%%-------------------------------------------------------------------
-module(ebt_transform).
-include("ebt.hrl").
%% API
-export([parse_transform/2]).
-define(EBT_NODE_FUNCTIONS,... | null | https://raw.githubusercontent.com/youscape/ebt/546121bdfa24cb8cbd64ff4f842fd42ec7d50189/src/ebt_transform.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
API
====================================================================
transform
====================================================================
get base-module and in... | @author zyuyou
( C ) 2015 ,
@doc 实现行为树节点的继承
-module(ebt_transform).
-include("ebt.hrl").
-export([parse_transform/2]).
-define(EBT_NODE_FUNCTIONS, [init, precondition, evaluate, do_evaluate, tick, clear]).
-define(EBT_ACTION_FUNCTIONS, [do_enter, do_execute, do_exit | ?EBT_NODE_FUNCTIONS]).
-define(EBT_EXTE... |
8f38ac5178535243afed83aa70ec18e0a570e5f809b8c40e643b7dc6ca1e9f4b | FlowerWrong/mblog | clock.erl | %% ---
Excerpted from " Programming Erlang , Second Edition " ,
published by The Pragmatic Bookshelf .
%% Copyrights apply to this code. It may not be used to create training material,
%% courses, books, articles, and the like. Contact us if you are in doubt.
%% We make no guarantees that this code is fit for... | null | https://raw.githubusercontent.com/FlowerWrong/mblog/3233ede938d2019a7b57391405197ac19c805b27/categories/erlang/demo/jaerlang2_code/clock.erl | erlang | ---
Copyrights apply to this code. It may not be used to create training material,
courses, books, articles, and the like. Contact us if you are in doubt.
We make no guarantees that this code is fit for any purpose.
Visit for more book information.
--- | Excerpted from " Programming Erlang , Second Edition " ,
published by The Pragmatic Bookshelf .
-module(clock).
-export([start/2, stop/0]).
start(Time, Fun) ->
register(clock, spawn(fun() -> tick(Time, Fun) end)).
stop() -> clock ! stop.
tick(Time, Fun) ->
receive
stop ->
void
after Time ->
... |
c3c6ee4a4be629332dcfcdc8ce7664846935f7431197d0ae73bcec269457dfb6 | orbitz/oort | irc_lookup.erl | -module(irc_lookup).
-author("").
-export([start/0, translate_command/1, loop/2, shutdown/0, test/0]).
start() ->
case whereis(irc_lookup_server) of
undefined ->
Symbols = dict:from_list([
{"RPL_UNAWAY", "305"},
{"ERR_... | null | https://raw.githubusercontent.com/orbitz/oort/a61ec85508917ae9a3f6672a0b708d47c23bb260/src/irc_lookup.erl | erlang | Unit Tests | -module(irc_lookup).
-author("").
-export([start/0, translate_command/1, loop/2, shutdown/0, test/0]).
start() ->
case whereis(irc_lookup_server) of
undefined ->
Symbols = dict:from_list([
{"RPL_UNAWAY", "305"},
{"ERR_... |
c491fd0610f02f046940b99bb92931b25aeb27fab77eb5140488465ef7d54920 | clojure-interop/java-jdk | DatatypeConverterInterface.clj | (ns javax.xml.bind.DatatypeConverterInterface
" The DatatypeConverterInterface is for JAXB provider use only. A
JAXB provider must supply a class that implements this interface.
JAXB Providers are required to call the
DatatypeConverter.setDatatypeConverter api at
some point before the first marshal or unmarsh... | null | https://raw.githubusercontent.com/clojure-interop/java-jdk/8d7a223e0f9a0965eb0332fad595cf7649d9d96e/javax.xml/src/javax/xml/bind/DatatypeConverterInterface.clj | clojure | (ns javax.xml.bind.DatatypeConverterInterface
" The DatatypeConverterInterface is for JAXB provider use only. A
JAXB provider must supply a class that implements this interface.
JAXB Providers are required to call the
DatatypeConverter.setDatatypeConverter api at
some point before the first marshal or unmarsh... | |
1d4de149d758c9844fe22417343233ab146eb46daa41f744dc1aae3aad721940 | huangjs/cl | numeric.lisp | Copyright ( c ) 1987
;;; Permission is given to freely modify and distribute this code
;;; so long as this copyright notice is retained.
;;;; Basic numeric operators are defined here.
CL functions implemented here :
;;; + * - /
;;; + has variable # of args, does constant folding
(define-ps +
(let ((... | null | https://raw.githubusercontent.com/huangjs/cl/96158b3f82f82a6b7d53ef04b3b29c5c8de2dbf7/lib/plisp/compiler/common-lisp/numeric.lisp | lisp | Permission is given to freely modify and distribute this code
so long as this copyright notice is retained.
Basic numeric operators are defined here.
+ * - /
+ has variable # of args, does constant folding
like +
Like +
/ is a little hairier for constant folding. | Copyright ( c ) 1987
CL functions implemented here :
(define-ps +
(let ((const-part 0)
(pending-arg nil))
(for (:in arg (cdr ps-form))
(:do
(compile-1 arg)
(if (numeric-constant)
(setf const-part (+ (remove-number) const-part))
(progn (when pending-arg (emit 'add))
... |
3d18028ce22c03d1d19521502e35bdfddb92d07bcf6022b7aaedef80aacfeff6 | coord-e/mlml | resolve.ml | (* resolve paths and convert them into string *)
(* TODO: use more clear ways to resolve paths *)
module Path = Tree.Path
module Expr = Tree.Expression
module Mod = Tree.Module
module TyExpr = Tree.Type_expression
module Pat = Tree.Pattern
module NS = Tree.Namespace
module SS = Tree.Simple_set
type 'a value =
| Ent... | null | https://raw.githubusercontent.com/coord-e/mlml/ec34b1fe8766901fab6842b790267f32b77a2861/mlml/analysis/resolve.ml | ocaml | resolve paths and convert them into string
TODO: use more clear ways to resolve paths
absolute path
find a provided path in env and returns canonical path and `module_env` if found
same as `find_module_local`, but resolves the aliases
returns `module_env` and canonical path if name is alias
not a module
... |
module Path = Tree.Path
module Expr = Tree.Expression
module Mod = Tree.Module
module TyExpr = Tree.Type_expression
module Pat = Tree.Pattern
module NS = Tree.Namespace
module SS = Tree.Simple_set
type 'a value =
| Entity of 'a
| Alias of Path.t
and module_env =
{ vars : (string, unit value) Hashtbl.t
; type... |
011dc2e32a9d28f0bc86a9dd738a4f4389a9daac60138b98de62cf7f1226f311 | robert-strandh/SICL | packages.lisp | (cl:in-package #:common-lisp-user)
(defpackage #:sicl-call-site-manager
(:use #:common-lisp)
(:local-nicknames (#:env #:sicl-environment))
(:export
#:create-trampoline-snippet))
| null | https://raw.githubusercontent.com/robert-strandh/SICL/59d8fa94811a0eac4ac747333ad9ecd976652c41/Code/Call-site-manager/packages.lisp | lisp | (cl:in-package #:common-lisp-user)
(defpackage #:sicl-call-site-manager
(:use #:common-lisp)
(:local-nicknames (#:env #:sicl-environment))
(:export
#:create-trampoline-snippet))
| |
b1b73c9d990d5814e69d4d2e5ce2b573edc834c6ed2fc52e0c0c266b972323d3 | unclebob/spacewar | protocols.cljc | (ns spacewar.ui.protocols
#?(:cljs (:refer-clojure :exclude [clone]))
(:require [clojure.spec.alpha :as s]))
;update-state returns [new-drawable [events]]
(defprotocol Drawable
(draw [this])
(setup [this])
(update-state [this world])
(get-state [this])
(clone [this state]))
(s/def ::elements (s/coll-of... | null | https://raw.githubusercontent.com/unclebob/spacewar/71c3195b050c4fdb7e643f53556ab580d70f27ba/src/spacewar/ui/protocols.cljc | clojure | update-state returns [new-drawable [events]]
{:pre [
(s/valid? ::drawable-state container-state)
]
:post [
(s/valid? ::updated-elements-and-events %)
]} | (ns spacewar.ui.protocols
#?(:cljs (:refer-clojure :exclude [clone]))
(:require [clojure.spec.alpha :as s]))
(defprotocol Drawable
(draw [this])
(setup [this])
(update-state [this world])
(get-state [this])
(clone [this state]))
(s/def ::elements (s/coll-of keyword?))
(s/def ::drawable-state (s/keys :o... |
ea19c3b126c8c2036371a89bdaee05be1f03cfbc739a38262268886143f8b109 | juxt/bolt | cookie_session_store.clj | ;; TODO: This is misnamed. The cookie only contains a UUID, which keys
;; into a token store containing the material.
(ns bolt.session.cookie-session-store
(:require
[clojure.tools.logging :refer :all]
[com.stuartsierra.component :refer (using)]
[bolt.session :refer (session)]
[bolt.session.protocols :re... | null | https://raw.githubusercontent.com/juxt/bolt/f77be416f82c1ca19d5dc20a15942375edc9b740/src/bolt/session/cookie_session_store.clj | clojure | TODO: This is misnamed. The cookie only contains a UUID, which keys
into a token store containing the material.
(doto (new java.util.Date) (.setTime (.getTime (:c {:c (new java.util.Date)}))))
Use of cookies-response mean it is non-destructive - existing
cookies are preserved (but existing :cookies entries are not... |
(ns bolt.session.cookie-session-store
(:require
[clojure.tools.logging :refer :all]
[com.stuartsierra.component :refer (using)]
[bolt.session :refer (session)]
[bolt.session.protocols :refer (SessionStore)]
[bolt.authentication.protocols :refer (RequestAuthenticator)]
[bolt.token-store :refer (get... |
737cd9b18ce1ccaea373132d175bce45420a26bd872874fe8217cba29fcdafab | mirage/mirage-vnetif | vnetif.mli |
* Copyright ( c ) 2015 < >
* Copyright ( c ) 2011 - 2013 Anil Madhavapeddy < >
*
* 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 .... | null | https://raw.githubusercontent.com/mirage/mirage-vnetif/e33e44c987289b31571dbb5f836d43a3a6485120/src/vnetif/vnetif.mli | ocaml | * Dummy interface for software bridge. |
* Copyright ( c ) 2015 < >
* Copyright ( c ) 2011 - 2013 Anil Madhavapeddy < >
*
* 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 .... |
29048970df8ca5fbd44152231acd0d94f1448b6165ba41e92fe07151aacf5e63 | hlprmnky/ion-appsync-example | handlers.cljs | (ns pages.handlers
(:require
[cljs.pprint :refer [pprint]]
[goog.string :as gstring]
[goog.string.format]
[goog.crypt.base64 :as base64]
[clojure.string :as str]
["request" :as req]
["request-promise-native" :as reqp]
[pages.views :as views]))
(defn ->clj
"parse a json strin... | null | https://raw.githubusercontent.com/hlprmnky/ion-appsync-example/76a3dcfcf2d09c066a8d4dac7f1e930f79fb1237/src-pages/pages/handlers.cljs | clojure | -jsonwebtoken
TODO !!!!
trailing / is important!
only provide env data when in "dev" stage
(js/console.log error)
(js/console.log (.-body (.-response error))) | (ns pages.handlers
(:require
[cljs.pprint :refer [pprint]]
[goog.string :as gstring]
[goog.string.format]
[goog.crypt.base64 :as base64]
[clojure.string :as str]
["request" :as req]
["request-promise-native" :as reqp]
[pages.views :as views]))
(defn ->clj
"parse a json strin... |
56b51e610806caa09d8a0e3bdd108ee5f79a66dab3af761b3d1fae167c698c20 | hjwylde/werewolf | Engine.hs | |
Module : Game . Werewolf . Engine
Description : Engine functions .
Copyright : ( c ) , 2016
License : :
Engine functions .
Module : Game.Werewolf.Engine
Description : Engine functions.
Copyright : (c) Henry J. Wylde, 2016
License : BSD3
Maintainer :
Engine functions... | null | https://raw.githubusercontent.com/hjwylde/werewolf/d22a941120a282127fc3e2db52e7c86b5d238344/app/Game/Werewolf/Engine.hs | haskell | # LANGUAGE FlexibleContexts #
* Loop | |
Module : Game . Werewolf . Engine
Description : Engine functions .
Copyright : ( c ) , 2016
License : :
Engine functions .
Module : Game.Werewolf.Engine
Description : Engine functions.
Copyright : (c) Henry J. Wylde, 2016
License : BSD3
Maintainer :
Engine functions... |
281a6cd70469b81c7557e0bed3505934949cd7cb916ab3d13ad724b224241d6a | rtoy/ansi-cl-tests | format-tilde.lsp | ;-*- Mode: Lisp -*-
Author :
Created : We d Jul 28 00:27:00 2004
;;;; Contains: Tests of format directive ~~
(in-package :cl-test)
(compile-and-load "printer-aux.lsp")
(def-format-test format.~.1
"~~" nil "~")
(deftest format.~.2
(loop for i from 0 to 100
for s = (make-string i :initial-el... | null | https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/format-tilde.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of format directive ~~ | Author :
Created : We d Jul 28 00:27:00 2004
(in-package :cl-test)
(compile-and-load "printer-aux.lsp")
(def-format-test format.~.1
"~~" nil "~")
(deftest format.~.2
(loop for i from 0 to 100
for s = (make-string i :initial-element #\~)
for format-string = (format nil "~~~D~~" i)
... |
0577e5129e08cdc61a55637e93598a4b33eae6faa40440109209d030a84d7f4e | jimcrayne/jhc | tc235.hs | {-# OPTIONS -fglasgow-exts #-}
# LANGUAGE UndecidableInstances #
-- Trac #1564
module Foo where
import Text.PrettyPrint
import Prelude hiding(head,tail)
class FooBar m k l | m -> k l where
a :: m graphtype
instance FooBar [] Bool Bool where
a = error "urk"
instance FooBar Maybe Int Int where
a = error "urk"... | null | https://raw.githubusercontent.com/jimcrayne/jhc/1ff035af3d697f9175f8761c8d08edbffde03b4e/regress/tests/1_typecheck/2_pass/ghc/uncat/tc235.hs | haskell | # OPTIONS -fglasgow-exts #
Trac #1564
=> m Int (which is wrong)
The uses in foo and bar show if that happens | # LANGUAGE UndecidableInstances #
module Foo where
import Text.PrettyPrint
import Prelude hiding(head,tail)
class FooBar m k l | m -> k l where
a :: m graphtype
instance FooBar [] Bool Bool where
a = error "urk"
instance FooBar Maybe Int Int where
a = error "urk"
class (Monad m)=>Gr g ep m | g -> ep where ... |
9054516c48fbc7a5f19a8267689069bfb662a475f2abf48ef6a0c5005fe1a239 | finnishtransportagency/harja | toteumat_test.clj | (ns harja.palvelin.palvelut.toteumat-test
(:require [clojure.test :refer :all]
[clojure.java.io :as io]
[com.stuartsierra.component :as component]
[harja
[pvm :as pvm]
[testi :refer :all]]
[harja.kyselyt.konversio :as konv]
[harja.k... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/624f72c2dcd408fbf4acc3305fd0472e5afb341d/test/clj/harja/palvelin/palvelut/toteumat_test.clj | clojure | Testaa päivittämistä
Testaa poistetuksi merkitsemistä
")))
Testaa päivitys
Testaa päivitys
"))
1.10.2020
30.9.2021
(not (circleci?))
on tekaistu)
JVH voi hakea siirtymätiedot
24.12.2009
30.9.2017
30.9.2017 | (ns harja.palvelin.palvelut.toteumat-test
(:require [clojure.test :refer :all]
[clojure.java.io :as io]
[com.stuartsierra.component :as component]
[harja
[pvm :as pvm]
[testi :refer :all]]
[harja.kyselyt.konversio :as konv]
[harja.k... |
487b4144eb974d4d2e117bdc2372977e271ea3a5f541cb20555c6b44c936f0d2 | dsheets/ocaml-unix-dirent | dirent_unix_lwt.mli |
* Copyright ( c ) 2016 < >
*
* 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/ocaml-unix-dirent/b3749486aa44642b911b7740193cd8133c6e144a/lwt/dirent_unix_lwt.mli | ocaml |
* Copyright ( c ) 2016 < >
*
* 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... | |
6b2aa1ee7e434cd26e676fdea30c477800d901c0eb0ab8612dab1b2b38f1dffe | alanzplus/EOPL | reg-interpreter.rkt | #lang eopl
(require "./reg-spec.rkt")
(provide run)
(provide num-val)
(provide bool-val)
(provide proc-val)
(provide list-val)
(provide expval->num)
(provide expval->bool)
(provide expval->proc)
(provide expval->list)
(provide procedure)
(provide apply-procedure/k)
; -------------------------------------------------... | null | https://raw.githubusercontent.com/alanzplus/EOPL/d7b06392d26d93df851d0ca66d9edc681a06693c/EOPL/ch5/buggy/reg-interpreter.rkt | racket | -----------------------------------------------------------------------------
-----------------------------------------------------------------------------
-----------------------------------------------------------------------------
Expression Value Representation
-------------------------------------------------... | #lang eopl
(require "./reg-spec.rkt")
(provide run)
(provide num-val)
(provide bool-val)
(provide proc-val)
(provide list-val)
(provide expval->num)
(provide expval->bool)
(provide expval->proc)
(provide expval->list)
(provide procedure)
(provide apply-procedure/k)
List Utilities
Return the first idx which sati... |
ada171d725c5187e539b3e9027f01a3cb23c4a697e61bb8d769aef8c2f72bf05 | NyanCAD/Mosaic | libman.cljs | SPDX - FileCopyrightText : 2022
;
SPDX - License - Identifier : MPL-2.0
(ns nyancad.mosaic.libman
(:require clojure.string
[reagent.core :as r]
[reagent.dom :as rd]
[nyancad.hipflask :refer [pouch-atom pouchdb sep watch-changes]]
[nyancad.mosaic.common :as cm]))... | null | https://raw.githubusercontent.com/NyanCAD/Mosaic/ea210a8b33d90584ed3c690386a74dc28d0f0181/src/main/nyancad/mosaic/libman.cljs | clojure |
initialise the model database
used for ephermeal UI state
branch
leaf
inactive, active, key, title
inactive, active, key, title
pass nil to disable synchronization
(set! js/document.onkeyup (partial cm/keyboard-shortcuts shortcuts)) | SPDX - FileCopyrightText : 2022
SPDX - License - Identifier : MPL-2.0
(ns nyancad.mosaic.libman
(:require clojure.string
[reagent.core :as r]
[reagent.dom :as rd]
[nyancad.hipflask :refer [pouch-atom pouchdb sep watch-changes]]
[nyancad.mosaic.common :as cm]))
... |
cbdd914530407143e020aac367aaf4291ce8233bf63ecebb9554e2d6adfb2acb | ocaml-flambda/flambda-backend | simplify_primitives.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/ocaml-flambda/flambda-backend/651e3119bfd6ed8d79d3139054093872b735fda1/middle_end/flambda/simplify_primitives.ml | ocaml | ************************************************************************
OCaml
... | , OCamlPro
and ,
Copyright 2014 - -2016 Jane Street Group LLC
the GNU Lesser General Public License version 2.1 , with the
[@@@ocaml.warning "+a-4-9-30-40-41-42-66"]
open! Int_replace_polymor... |
ca510ac0765bbc0206e16354268eba01114c746f96f52cb8ae9766e398918c1a | chethan/SICP | FibonacciTailRecursive.hs | fib n = fib_iter 1 0 n
where fib_iter a b n | n==0 = b
| otherwise = fib_iter (a+b) a (n-1) | null | https://raw.githubusercontent.com/chethan/SICP/ff83adc7e3e89e299c772080d32103f72ecf5dbf/Chapter1/FibonacciTailRecursive.hs | haskell | fib n = fib_iter 1 0 n
where fib_iter a b n | n==0 = b
| otherwise = fib_iter (a+b) a (n-1) | |
1686d0a5f6a5e7f9a7118d4f3e4f2026b497f0d903687834d376579af21d51ed | manuel-serrano/hop | cache.scm | ;*=====================================================================*/
* serrano / prgm / project / hop / hop / runtime / cache.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/manuel-serrano/hop/481cb10478286796addd2ec9ee29c95db27aa390/runtime/cache.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
*=====================================================================*/
*---------------------------... | * serrano / prgm / project / hop / hop / runtime / cache.scm * /
* Author : * /
* Creation : Sat Apr 1 06:54:00 2006 * /
* Last change : We d Oct 24 14:39:07 2018 ( serrano ) * /
* Co... |
059e964a4dcc26308473258ca717d8204f747cd362dd7b21e541a3d271cae734 | wlitwin/graphv | graphv_gles3.ml | include Graphv_core
let create ~flags () =
let gles = Gles.create ~flags () |> opt_exn in
let font = Fontstash.create () in
create ~flags gles font
| null | https://raw.githubusercontent.com/wlitwin/graphv/d0a09575c5ff5ee3727c222dd6130d22e4cf62d9/gles3/graphv_gles3.ml | ocaml | include Graphv_core
let create ~flags () =
let gles = Gles.create ~flags () |> opt_exn in
let font = Fontstash.create () in
create ~flags gles font
| |
3d63de3e9c05f3f6780ecf6757e68f054efdfc7cd70bc6fea3abb78ba08058fc | marick/fp-oo | lazy-world.clj | The solution to 1 is in the text
2
(def ys-and-ns
(filter (fn [string]
(or (.startsWith string "y")
(.startsWith string "n")))
(repeatedly prompt-and-read)))
3
(def counted-sum
(fn []
(let [numbers-only
(map to-integer
... | null | https://raw.githubusercontent.com/marick/fp-oo/434937826d794d6fe02b3e9a62cf5b4fbc314412/solutions/lazy-world.clj | clojure | The solution to 1 is in the text
2
(def ys-and-ns
(filter (fn [string]
(or (.startsWith string "y")
(.startsWith string "n")))
(repeatedly prompt-and-read)))
3
(def counted-sum
(fn []
(let [numbers-only
(map to-integer
... | |
4a0ec83dd06288317cd44b4ca682883c8a267cd923e5f9f55c42c87873d2cf12 | khinsen/leibniz | documents.rkt | #lang racket
(provide empty-document
add-to-library
add-context-from-source
get-asset
get-context
make-term make-rule make-transformation make-equation
make-test
get-document-sxml get-context-sxml
write-xml import-xml
write-signature-grap... | null | https://raw.githubusercontent.com/khinsen/leibniz/881955b4c642114fbdc2f36ecc99582ae2371238/leibniz/documents.rkt | racket |
Re-raise exceptions with the source location information from the document
Compile declarations from a context to internal datas tructures.
Merge the sort graphs of the included contexts.
Process the sort declarations.
Merge the signatures of the included contexts.
Process the var declarations.
Check for non... | #lang racket
(provide empty-document
add-to-library
add-context-from-source
get-asset
get-context
make-term make-rule make-transformation make-equation
make-test
get-document-sxml get-context-sxml
write-xml import-xml
write-signature-grap... |
3912262438b35f09abd5f0d29f23a0416100ea1a7c557b6d5c571c6bfd36daa6 | bobzhang/fan | id_set.ml | (** A common utility module
when doing code generation *)
include Set.Make(
struct
type t = Locf.t * string
let compare (_,x) (_,y) = String.compare x y
end
)
| null | https://raw.githubusercontent.com/bobzhang/fan/7ed527d96c5a006da43d3813f32ad8a5baa31b7f/src/common/id_set.ml | ocaml | * A common utility module
when doing code generation | include Set.Make(
struct
type t = Locf.t * string
let compare (_,x) (_,y) = String.compare x y
end
)
|
74f7610f6b9332eb8de7ffeca58fdc76ed220e6a8db41ddddcab01e594bc6f3d | jordanthayer/ocaml-search | tpl_main_reg.ml | $ I d : main.ml , v 1.1 2005/04/06 00:38:57 ruml Exp ruml $
main for stand - alone regression tplan executable
main for stand-alone regression tplan executable
*)
let run_alg alg domain problem limit =
let do_run = alg (domain,problem) limit in
let (sol, e, g, p, q),t = Wrsys.with_time do_run in
fl... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/tplan/tpl_main_reg.ml | ocaml | * looks at command line. returns alg_func (which is world -> node
option * int * int) and list of string pairs for logging parameters. | $ I d : main.ml , v 1.1 2005/04/06 00:38:57 ruml Exp ruml $
main for stand - alone regression tplan executable
main for stand-alone regression tplan executable
*)
let run_alg alg domain problem limit =
let do_run = alg (domain,problem) limit in
let (sol, e, g, p, q),t = Wrsys.with_time do_run in
fl... |
c7fce42ba023089cff984ec9989d962f477484866c34507bcfeeb11b969bda92 | ghcjs/ghcjs | objInfo.hs | # LANGUAGE OverloadedStrings , LambdaCase #
Print the size of each section in a GHCJS object file
optionally dump the sections
Print the size of each section in a GHCJS object file
optionally dump the sections
-}
module Main where
import Control.Applicative
import Control.Monad (wh... | null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/utils/objInfo.hs | haskell | # LANGUAGE OverloadedStrings , LambdaCase #
Print the size of each section in a GHCJS object file
optionally dump the sections
Print the size of each section in a GHCJS object file
optionally dump the sections
-}
module Main where
import Control.Applicative
import Control.Monad (wh... | |
4e30cef736aead0cac45a9de8fe32acecaace8f988969c70501bf47b8296968a | capsjac/opengles | Sync.hs | module Graphics.OpenGLES.Sync where
import Control.Applicative
import Control.Monad
import Data.IORef
import Foreign
import Graphics.OpenGLES.Base
import Graphics.OpenGLES.Internal
data Sync = Sync Word64 (IORef GLsync)
-- | Obtain new 'Sync' with or without timeout in nanoseconds.
Fence sync objects are used to ... | null | https://raw.githubusercontent.com/capsjac/opengles/23b78e5d1b058349a778a49310d867164ea1a529/src/Graphics/OpenGLES/Sync.hs | haskell | | Obtain new 'Sync' with or without timeout in nanoseconds.
command stream, as a more flexible form of glFinish.
> -- Sync objects can be used many times
For each frame:
> glFence sync1 $ \isTimedOut -> do
> {- modify buffers, textures, etc -}
> {- modify buffers, textures, etc -}
GL_TIMEOUT_IGNORED
... | module Graphics.OpenGLES.Sync where
import Control.Applicative
import Control.Monad
import Data.IORef
import Foreign
import Graphics.OpenGLES.Base
import Graphics.OpenGLES.Internal
data Sync = Sync Word64 (IORef GLsync)
Fence sync objects are used to wait for partial completion of the GL
> sync1 < - getSync ( J... |
eb15dde3d2112619e193146e17dd07a8ec501c558d0ee4e645ce97ab6c3db5f7 | kupl/LearnML | patch.ml | type aexp =
| Const of int
| Var of string
| Power of (string * int)
| Times of aexp list
| Sum of aexp list
let rec map (f : 'c * 'b -> 'a) ((l : 'c list), (var : string)) : 'a list =
match l with [] -> [] | hd :: tl -> f (hd, var) :: map f (tl, var)
let rec diff ((exp : aexp), (var : string)) : aexp =
... | null | https://raw.githubusercontent.com/kupl/LearnML/c98ef2b95ef67e657b8158a2c504330e9cfb7700/result/cafe2/diff/sub102/patch.ml | ocaml | type aexp =
| Const of int
| Var of string
| Power of (string * int)
| Times of aexp list
| Sum of aexp list
let rec map (f : 'c * 'b -> 'a) ((l : 'c list), (var : string)) : 'a list =
match l with [] -> [] | hd :: tl -> f (hd, var) :: map f (tl, var)
let rec diff ((exp : aexp), (var : string)) : aexp =
... | |
e3905b7fc9b93bbf0cd55014258d3af2e46a3a59eb241eff0898bd6807386194 | input-output-hk/ouroboros-network | Index.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE DerivingVia #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index (
-- * Index
Index (..)
, readEntry
, readOffset
-- * File-backed inde... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/c82309f403e99d916a76bb4d96d6812fb0a9db81/ouroboros-consensus/src/Ouroboros/Consensus/Storage/ImmutableDB/Impl/Index.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE RankNTypes #
* Index
* File-backed index
* Cached index
-----------------------------------------------------------------------------
Index
-----------------------------------------------------------------------------
| Bundle the operations on the primary and ... | # LANGUAGE DerivingVia #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
module Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index (
Index (..)
, readEntry
, readOffset
, fileBackedIndex
, CacheConfig (..)
, cachedIndex
) where
import Control.Tracer (Tracer)
impor... |
09887fd6cb9914db6e9446478fbd0631eda1f49ce0335cd496a1c085cafe9722 | HachiSecurity/plc-llvm | String.hs |
module Hachi.Compiler.CodeGen.Constant.String ( globalStrs ) where
-------------------------------------------------------------------------------
globalStrs :: [(String, String)]
globalStrs =
[ ("nlStr", "\n")
, ("i64FormatStr", "%d")
, ("strFormatStr", "%s")
, ("hexFormatStr", "%02X")
, ("trueS... | null | https://raw.githubusercontent.com/HachiSecurity/plc-llvm/c99c8d58ec7cbbb8942604338cfde00ad23e7f13/compiler/src/Hachi/Compiler/CodeGen/Constant/String.hs | haskell | -----------------------------------------------------------------------------
----------------------------------------------------------------------------- |
module Hachi.Compiler.CodeGen.Constant.String ( globalStrs ) where
globalStrs :: [(String, String)]
globalStrs =
[ ("nlStr", "\n")
, ("i64FormatStr", "%d")
, ("strFormatStr", "%s")
, ("hexFormatStr", "%02X")
, ("trueStr", "True")
, ("falseStr", "False")
, ("unitStr", "()")
, ("dataCon... |
269b09a73109e3859d8faa3bd7e11b97469f2f2110f38c4e92a4893684f2756c | thoughtstem/vr-engine | info.rkt | #lang info
(define version "0.0.1")
(define deps '("hostname"
"simple-qr"
"urlang"
"-assets-from.git"
"-coloring.git"
"-GE-Katas.git?path=ts-kata-util"
))
(define scribblings '(("scribblings/manual.scrbl" (multi-page))))
| null | https://raw.githubusercontent.com/thoughtstem/vr-engine/18e290f7d61ddd2b32a2f12a8abb0c4a30ed3a08/info.rkt | racket | #lang info
(define version "0.0.1")
(define deps '("hostname"
"simple-qr"
"urlang"
"-assets-from.git"
"-coloring.git"
"-GE-Katas.git?path=ts-kata-util"
))
(define scribblings '(("scribblings/manual.scrbl" (multi-page))))
| |
7af2f652506ef116b6f166846bf43dc24453580d36d660dfadfeefbb33c62265 | kaoskorobase/mescaline | Params.hs | module Mescaline.Synth.Sampler.Params
( Params(..)
, defaultParams
) where
import Mescaline (Duration)
import qualified Mescaline.Database as DB
data Params = Params {
file :: DB.SourceFile
, unit :: DB.Unit
, offset :: Duration
, duration :: Duration
, rate ... | null | https://raw.githubusercontent.com/kaoskorobase/mescaline/13554fc4826d0c977d0010c0b4fb74ba12ced6b9/lib/mescaline/Mescaline/Synth/Sampler/Params.hs | haskell | module Mescaline.Synth.Sampler.Params
( Params(..)
, defaultParams
) where
import Mescaline (Duration)
import qualified Mescaline.Database as DB
data Params = Params {
file :: DB.SourceFile
, unit :: DB.Unit
, offset :: Duration
, duration :: Duration
, rate ... | |
fe95e85b27a0edfd40774685d39d8d73a6872452c2e918c7dc582a5fa2adbf0c | zotonic/zotonic | import_csv.erl | %% @doc Import a csv file according to the derived file/record definitions.
@author < >
@author < >
Copyright 2010 - 2020 ,
%%
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 Lice... | null | https://raw.githubusercontent.com/zotonic/zotonic/1bb4aa8a0688d007dd8ec8ba271546f658312da8/apps/zotonic_mod_import_csv/src/support/import_csv.erl | erlang | @doc Import a csv file according to the derived file/record definitions.
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either exp... | @author < >
@author < >
Copyright 2010 - 2020 ,
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(import_csv).
-author("Arjan Scherpenisse <>").
-author("Marc Worrell <>").
-export([
import/3
])... |
d6ea4c628b727d971a79fd5df270a7fa43ab1748614b9569f9175209664188f0 | yakaz/yamerl | flow_mapping_empty_5.erl | -module('flow_mapping_empty_5').
-include_lib("eunit/include/eunit.hrl").
-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").
single_test_() ->
?_assertMatch(
{yamerl_parser,
{file,?FILENAME},
[],
<<>>,
9,
true,
[],
0,
10,
4,
... | null | https://raw.githubusercontent.com/yakaz/yamerl/0032607a7b27fa2b548fc9a02d7ae6b53469c0c5/test/parsing/flow_mapping_empty_5.erl | erlang | -module('flow_mapping_empty_5').
-include_lib("eunit/include/eunit.hrl").
-define(FILENAME, "test/parsing/" ?MODULE_STRING ".yaml").
single_test_() ->
?_assertMatch(
{yamerl_parser,
{file,?FILENAME},
[],
<<>>,
9,
true,
[],
0,
10,
4,
... | |
75baff3beb2d32b368e76b321209bc1eac0823ce9497a7c1a7eaf2039bf440cb | GlideAngle/flare-timing | DiscardFurther.hs | module Flight.DiscardFurther
( AltBonus(..)
, readCompBestDistances
, readPilotAlignTimeWriteDiscardFurther
, readPilotAlignTimeWritePegThenDiscard
, readPilotDiscardFurther
, readPilotPegThenDiscard
, readDiscardFurther
) where
import Control.Exception.Safe (MonadThrow, throwString)
im... | null | https://raw.githubusercontent.com/GlideAngle/flare-timing/172a9b199eb1ff72c967669dc349cbf8d9c4bc52/lang-haskell/scribe/library/Flight/DiscardFurther.hs | haskell | module Flight.DiscardFurther
( AltBonus(..)
, readCompBestDistances
, readPilotAlignTimeWriteDiscardFurther
, readPilotAlignTimeWritePegThenDiscard
, readPilotDiscardFurther
, readPilotPegThenDiscard
, readDiscardFurther
) where
import Control.Exception.Safe (MonadThrow, throwString)
im... | |
6631cf849d83121a4c9c4082961ec15e41f7f201cf0dc623bae6a65978fa624e | igrishaev/farseer | http.clj | (ns farseer.spec.http
(:require
[clojure.string :as str]
[clojure.spec.alpha :as s]))
(s/def :http/method #{:post :get :put :delete})
(defn path? [line]
(str/starts-with? line "/"))
(s/def :http/path
(s/and string? path?))
(s/def :http/health? boolean?)
(s/def ::config
(s/keys :req [:http/method... | null | https://raw.githubusercontent.com/igrishaev/farseer/0c5aead5cbabf80edf32952888c9f860aa1248c7/farseer-http/src/farseer/spec/http.clj | clojure | (ns farseer.spec.http
(:require
[clojure.string :as str]
[clojure.spec.alpha :as s]))
(s/def :http/method #{:post :get :put :delete})
(defn path? [line]
(str/starts-with? line "/"))
(s/def :http/path
(s/and string? path?))
(s/def :http/health? boolean?)
(s/def ::config
(s/keys :req [:http/method... | |
14923686483e30870160399feddf76d6fee7290329853395182cc7892c82d69e | Kappa-Dev/KappaTools | tools.ml | (******************************************************************************)
(* _ __ * The Kappa Language *)
| |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
(* | ' / ********************************************************************... | null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/eef2337e8688018eda47ccc838aea809cae68de7/core/dataStructures/tools.ml | ocaml | ****************************************************************************
_ __ * The Kappa Language
| ' / ********************************************************************
| . \ * This file is distributed under the terms of the
|_|\_\ * GN... | | |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
let float_is_zero x =
match classify_float x with
| FP_zero -> true
| FP_normal | FP_subnormal |FP_infinite | FP_nan -> false
let pow i j =
let () = assert (0 <= j) in
let rec aux i k accu =
if k=0 then accu
else if k la... |
f13354c1c8049ac1c1c81065489f7037dbd2f29a2b148df481f803a4c1d30c57 | HaskellZhangSong/Introduction_to_Haskell_2ed_source | TypeFamily2.hs | # LANGUAGE TypeFamilies , MultiParamTypeClasses , FlexibleInstances #
type family Elem a :: *
type instance Elem [e] = e
class (Elem ce ~ e) => Collection e ce where
empty :: ce
insert :: e -> ce -> ce
member :: e -> ce -> Bool
| null | https://raw.githubusercontent.com/HaskellZhangSong/Introduction_to_Haskell_2ed_source/140c50fdccfe608fe499ecf2d8a3732f531173f5/C16/TypeFamily2.hs | haskell | # LANGUAGE TypeFamilies , MultiParamTypeClasses , FlexibleInstances #
type family Elem a :: *
type instance Elem [e] = e
class (Elem ce ~ e) => Collection e ce where
empty :: ce
insert :: e -> ce -> ce
member :: e -> ce -> Bool
| |
96bd3cb7e64419dfb350ec270c4a138b70713b05a95e1e3e9cfa18c0415934aa | Clozure/ccl-tests | disassemble.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sun May 18 20:47:58 2003
Contains : Tests of DISASSEMBLE
(in-package :cl-test)
(defun disassemble-it (fn)
(let (val)
(values
(notnot
(stringp
(with-output-to-string (*standard-output*)
(setf val (disassemble fn)))))
val)))
... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/disassemble.lsp | lisp | -*- Mode: Lisp -*-
Error tests | Author :
Created : Sun May 18 20:47:58 2003
Contains : Tests of DISASSEMBLE
(in-package :cl-test)
(defun disassemble-it (fn)
(let (val)
(values
(notnot
(stringp
(with-output-to-string (*standard-output*)
(setf val (disassemble fn)))))
val)))
(deftest disassemble.1
... |
fece7fdaa0ef436efc975384787fcb427a6677a5f1c2db7e3637cb0fc83009bf | Gabriella439/suns-search | Index.hs | Copyright 2013
This file is part of the Suns Search Engine
The Suns Search Engine is free software : you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 2 of the License , or ( at your
opt... | null | https://raw.githubusercontent.com/Gabriella439/suns-search/59c4cbf109c8d93b3170c3da529121f2b589900c/src/Index.hs | haskell | * Main | Copyright 2013
This file is part of the Suns Search Engine
The Suns Search Engine is free software : you can redistribute it and/or
modify it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 2 of the License , or ( at your
opt... |
997f5fe11bf0bab180952dadd7180ab90969e7662178678ba64baeee7514f861 | craigfe/diff | diff.ml | open Sink
type index = int
type 'a command =
| Insert of { expected : index; actual : index }
* Insert the element [ actual.(actual ) ] at [ expected.(expected ) ] .
| Delete of { expected : index }
(** Delete the element at [expected.(expected)]. *)
| Substitute of { expected : index; actual : index }
... | null | https://raw.githubusercontent.com/craigfe/diff/81c28ef5009bafc65cda762f2382ae3b5037e063/src/diff.ml | ocaml | * Delete the element at [expected.(expected)].
* Set [expected.(expected)) := actual.(actual)].
* Read-only wrapper around an array or a string. Can be {!truncate}d in
[O(1)] time.
* Return a new subarray with smaller bounds than the previous one.
Reverse-engineer the direction and action towards a given cel... | open Sink
type index = int
type 'a command =
| Insert of { expected : index; actual : index }
* Insert the element [ actual.(actual ) ] at [ expected.(expected ) ] .
| Delete of { expected : index }
| Substitute of { expected : index; actual : index }
let pp_command ppf = function
| Insert { expected; actual... |
0261231eeaca0f825e49d8f92cf071c143dd287d3c2500374967377f11042773 | bobbae/gosling-emacs | unipress.ml | (defun (exit-emacs-hook (novalue)))
(defun (new-exit-emacs (exit-emacs-hook) (exit-emacs)))
(defun (new-write-file-exit (write-modified-files) (new-exit-emacs)))
(defun (global-rebind new-function old-function default-binding
(setq new-function (arg 1 ": new function: "))
(setq old-function (arg 2 ": old fun... | null | https://raw.githubusercontent.com/bobbae/gosling-emacs/8fdda532abbffb0c952251a0b5a4857e0f27495a/maclib/unipress.ml | ocaml | (defun (exit-emacs-hook (novalue)))
(defun (new-exit-emacs (exit-emacs-hook) (exit-emacs)))
(defun (new-write-file-exit (write-modified-files) (new-exit-emacs)))
(defun (global-rebind new-function old-function default-binding
(setq new-function (arg 1 ": new function: "))
(setq old-function (arg 2 ": old fun... | |
2eccff97056aa2ff26c19af39246a05cdfcec42ae23d6759d2965e8d0e4037de | deadcode/Learning-CL--David-Touretzky | 6.13.lisp | (format t "~s = ~s~%" '(INTERSECTION '(LET US SEE) nil) (INTERSECTION '(LET US SEE) nil))
| null | https://raw.githubusercontent.com/deadcode/Learning-CL--David-Touretzky/b4557c33f58e382f765369971e6a4747c27ca692/Chapter%206/6.13.lisp | lisp | (format t "~s = ~s~%" '(INTERSECTION '(LET US SEE) nil) (INTERSECTION '(LET US SEE) nil))
| |
f544e3fc6be9af4a8f7040ebd63aa0fb10fc9da649ee9c57c3917c885e00091d | ageneau/clchess | views.cljs | (ns clchess.views
(:require [reagent.core :as reagent :refer [atom]]
[re-frame.core :refer [subscribe dispatch dispatch-sync]]
[clchess.utils :as utils]
[clchess.board :as board]
[clchess.theme :as theme]
[clchess.widgets :as widgets]
[clchess.s... | null | https://raw.githubusercontent.com/ageneau/clchess/4680d47d2bd919f5bf5eb820deaf97b402de3592/src/cljs/clchess/views.cljs | clojure | FIXME: Unknown prop `field` on <input> tag
:field :file
[study-overboard]
[widgets/tip]
[widgets/context-menu] | (ns clchess.views
(:require [reagent.core :as reagent :refer [atom]]
[re-frame.core :refer [subscribe dispatch dispatch-sync]]
[clchess.utils :as utils]
[clchess.board :as board]
[clchess.theme :as theme]
[clchess.widgets :as widgets]
[clchess.s... |
c7b7fb02586df155f41620ca3d442edfd66a81c824399da615f110729688496d | iovxw/tg-rss-bot | core.clj | (ns tg-rss-bot.core
(:require [tg-rss-bot.tgapi :as tgapi]
[clojure.tools.logging :as log]
[clojure.java.jdbc :as jdbc]
[clojure.string :as string]
[clj-http.client :as client]
[clojure.core.match :refer [match]]
[feedparser-clj.core :as feedpars... | null | https://raw.githubusercontent.com/iovxw/tg-rss-bot/52be6d971095cb7ec1ab0d4ddb4394fa4adb606f/src/tg_rss_bot/core.clj | clojure | 当前所选定的长度
剩下的长度小于最大长度
DONE
单行大于最大长度,进行行内切分
nginx
检查是否为第一次订阅
最后一个订阅者退订,删除这个 RSS
Bad Request: chat not found
Bad Request: Channel members are unavailable
convert to hash-set for (contains?)
强制退订
强制退订 | (ns tg-rss-bot.core
(:require [tg-rss-bot.tgapi :as tgapi]
[clojure.tools.logging :as log]
[clojure.java.jdbc :as jdbc]
[clojure.string :as string]
[clj-http.client :as client]
[clojure.core.match :refer [match]]
[feedparser-clj.core :as feedpars... |
a0565d5db299f39165ceae58eb81018e31be18728c0104fef4a379f26b4da294 | acl2/acl2 | lift-r1cs-common@useless-runes.lsp | (SYMBOL<-OF-CARS)
(CONSP-AND-SYMBOLP-CAR)
(ALL-CONSP-AND-SYMBOLP-CAR)
(ALL-CONSP-AND-SYMBOLP-CAR-OF-CONS-FOR-DEFMERGESORT
(70 7 (:REWRITE CONSP-FROM-LEN-CHEAP))
(35 35 (:TYPE-PRESCRIPTION LEN))
(14 7 (:REWRITE DEFAULT-<-2))
(10 5 (:REWRITE SYMBOLP-OF-CAR-WHEN-SYMBOL-LISTP-CHEAP))
(8 8 (:REWRITE DEFAULT-CAR))
(7 7... | null | https://raw.githubusercontent.com/acl2/acl2/f64742cc6d41c35f9d3f94e154cd5fd409105d34/books/kestrel/axe/r1cs/.sys/lift-r1cs-common%40useless-runes.lsp | lisp | (SYMBOL<-OF-CARS)
(CONSP-AND-SYMBOLP-CAR)
(ALL-CONSP-AND-SYMBOLP-CAR)
(ALL-CONSP-AND-SYMBOLP-CAR-OF-CONS-FOR-DEFMERGESORT
(70 7 (:REWRITE CONSP-FROM-LEN-CHEAP))
(35 35 (:TYPE-PRESCRIPTION LEN))
(14 7 (:REWRITE DEFAULT-<-2))
(10 5 (:REWRITE SYMBOLP-OF-CAR-WHEN-SYMBOL-LISTP-CHEAP))
(8 8 (:REWRITE DEFAULT-CAR))
(7 7... | |
c780eb011a47fbd56acf16f76a3ab01ab83fc25428e8b6ce95b60d5713d4e9ae | sybilant/sybilant | label.clj | (ns sybilant.ast.label
(:require
[sybilant.ast :as-alias ast]
[sybilant.ast.symbol :as ast.symbol]))
(def ^:private ^:const +type+
{:kind ::ast/type :name ::ast/label})
(defn make
"Make label from name.
nil if name is not a valid symbol."
[name]
(when (ast.symbol/valid? name)
{:type +type+ :nam... | null | https://raw.githubusercontent.com/sybilant/sybilant/445afcba2ff3d7fb4c4f37526901c2ddedf65c91/src/sybilant/ast/label.clj | clojure | (ns sybilant.ast.label
(:require
[sybilant.ast :as-alias ast]
[sybilant.ast.symbol :as ast.symbol]))
(def ^:private ^:const +type+
{:kind ::ast/type :name ::ast/label})
(defn make
"Make label from name.
nil if name is not a valid symbol."
[name]
(when (ast.symbol/valid? name)
{:type +type+ :nam... | |
e126de470a5b11845d3e193daff1ca04fd5fff7796693006cb914b3a591e4e55 | TrustInSoft/tis-interpreter | metrics_parameters.ml | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of Frama - C.
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/plugins/metrics/metrics_parameters.ml | ocaml | ************************************************************************
alternatives)
... | Modified by TrustInSoft
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Softwa... |
3b2b16b8c077d6ca39feae1b41a849a3e7c94f124a2c9090583a240cbcbcf306 | haskell-servant/servant-snap | Context.hs | # LANGUAGE CPP #
{-# LANGUAGE DataKinds #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
#if __GLASGOW_HASKELL__ < 7... | null | https://raw.githubusercontent.com/haskell-servant/servant-snap/b54c5da86f2f2ed994e9dfbb0694c72301b5a220/src/Servant/Server/Internal/Context.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE GADTs #
# LANGUAGE TypeOperators #
| 'Context's are used to pass values to combinators. (They are __not__ meant
to be used to pass parameters to your handlers, i.e. they should not replace
with 'Servant.Utils.Enter'.) If you don't u... | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE KindSignatures #
# LANGUAGE MultiParamTypeClasses #
#if __GLASGOW_HASKELL__ < 710
# LANGUAGE OverlappingInstances #
#endif
# LANGUAGE ScopedTypeVariables ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.