_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 |
|---|---|---|---|---|---|---|---|---|
88d28cf4f12d2a51959b0283c4c302079e68dfbd2df5aa7625d93c2d83f7efa6 | bobatkey/CS316-2022 | Week01.hs | # OPTIONS_GHC -fwarn - incomplete - patterns #
module Week01 where
import Prelude hiding (take, drop, Left, Right, Maybe (..), reverse, length)
CS316 2022/23 : Week 1
DATA AND FUNCTIONS
We start the course with an introduction to the two fundamental
concepts of functional programming in H... | null | https://raw.githubusercontent.com/bobatkey/CS316-2022/e26930b695191ed9cf6acadfc673d4a1ee7849b2/lecture-notes/Week01.hs | haskell | each line of the definition specifies
each line of the definition specifies
Since 'Pair's can be constructed for any types 'a' and 'b', we can
write functions that move them around. For example, swapping the
components of a pair:
We will see the 'Maybe' type many times in this course.
We can construct lis... | # OPTIONS_GHC -fwarn - incomplete - patterns #
module Week01 where
import Prelude hiding (take, drop, Left, Right, Maybe (..), reverse, length)
CS316 2022/23 : Week 1
DATA AND FUNCTIONS
We start the course with an introduction to the two fundamental
concepts of functional programming in H... |
f64923ba982b359fa88e4d6e124dadf69dc9c2f99b4be32dbd385a6c83c8937e | phillord/tawny-owl | read_test.clj | The contents of this file are subject to the LGPL License , Version 3.0 .
Copyright ( C ) 2013 , 2017 , Newcastle University
;; 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 , eithe... | null | https://raw.githubusercontent.com/phillord/tawny-owl/331e14b838a42adebbd325f80f60830fa0915d76/test/tawny/read_test.clj | clojure | 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
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHA... | The contents of this file are subject to the LGPL License , Version 3.0 .
Copyright ( C ) 2013 , 2017 , Newcastle University
the Free Software Foundation , either version 3 of the License , or
GNU Lesser General Public License for more details .
You should have received a copy of the GNU Lesser General Pu... |
3fe15e3b99252ed94f4562f091002bd9e57721307bf128e489d3d42fd5af2b05 | samply/blaze | date_time_operators_test.clj | (ns blaze.elm.compiler.date-time-operators-test
"18. Date and Time Operators
Section numbers are according to
-logicalspecification.html."
(:require
[blaze.anomaly :as ba]
[blaze.elm.compiler :as c]
[blaze.elm.compiler.core :as core]
[blaze.elm.compiler.test-util :as tu]
[blaze.elm.date-tim... | null | https://raw.githubusercontent.com/samply/blaze/315385a281e238adbd48df581d8cc52960a3acda/modules/cql/test/blaze/elm/compiler/date_time_operators_test.clj | clojure |
The Date operator constructs a date value from the given components.
at a precision below an unspecified precision. For example, month may be
null, but if it is, day must be null as well.
the argument.
If the argument is null, the result is null.
The DateTime operator constructs a DateTime value from th... | (ns blaze.elm.compiler.date-time-operators-test
"18. Date and Time Operators
Section numbers are according to
-logicalspecification.html."
(:require
[blaze.anomaly :as ba]
[blaze.elm.compiler :as c]
[blaze.elm.compiler.core :as core]
[blaze.elm.compiler.test-util :as tu]
[blaze.elm.date-tim... |
0722b8a307a07c13d8c279f876ff67da82c52fd994860478ed853b399ee3b310 | bomberstudios/mtasc | unzip.ml |
* Unzip - inflate format decompression algorithm
* Copyright ( C ) 2004
* Compliant with RFC 1950 and 1951
*
* This library 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 ; eithe... | null | https://raw.githubusercontent.com/bomberstudios/mtasc/d7c2441310248776aa89d60f9c8f98d539bfe8de/src/extlib-dev/unzip.ml | ocaml | ************************************************************************
************************************************************************
************************************************************************
WINDOW
************************************************************************
let flevel ... |
* Unzip - inflate format decompression algorithm
* Copyright ( C ) 2004
* Compliant with RFC 1950 and 1951
*
* This library 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 ; eithe... |
4ab3fc2432c4798afa7218be2ef655532d60b358acd486ccd7349003c54ff5a6 | apache/couchdb-chttpd | chttpd_cors.erl | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an " A... | null | https://raw.githubusercontent.com/apache/couchdb-chttpd/74002101513c03df74a4c25f3c892f5d003fa5da/src/chttpd_cors.erl | erlang | 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
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations... | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
-module(chttpd_cors).
-export([
maybe_handle_preflight_request/1,
maybe_handle_preflight_request/2,
headers/2,
headers/4
]).
-export([
... |
cf8323082c6d945c89aa3449d0409e8e1fadcd71bb62f72c0dfe377e1d8bf8f2 | wboag/Scheme-NLP | test-ngrams.rkt | #lang racket
(require "../ngrams.rkt")
; Instantiate model
(define model-a (new ngram-model (n 2)))
(define model-b (new ngram-model (n 1)))
; Train model on input data
(send model-a train 'file "../data/greet.txt")
; Predict probabiity of a sentence
(newline)
(display "<probability>")
(newline)
(display (send mo... | null | https://raw.githubusercontent.com/wboag/Scheme-NLP/8899d49c689f2b147a0f0485110c5a7e2c97abca/testing/test-ngrams.rkt | racket | Instantiate model
Train model on input data
Predict probabiity of a sentence
Generate a random sequence of text
Get frequencies | #lang racket
(require "../ngrams.rkt")
(define model-a (new ngram-model (n 2)))
(define model-b (new ngram-model (n 1)))
(send model-a train 'file "../data/greet.txt")
(newline)
(display "<probability>")
(newline)
(display (send model-a probability "John read Moby Dick"))
(newline)
(display (send model-a probabil... |
1ac70fa83b8515a23c75d6bb900ba686554f5f5c02a6bd826b754ca41669750a | aitorres/firelink | FlowGraphGenerator.hs | module FireLink.BackEnd.FlowGraphGenerator(
generateFlowGraph, BasicBlock, NumberedBlock, FlowGraph,
entryVertex, exitVertex, getAllVariables, getProgramVariables
) where
import Data.Char (isDigit)
import Data.Graph
import Data.List (nub)
... | null | https://raw.githubusercontent.com/aitorres/firelink/075d7aad1c053a54e39a27d8db7c3c719d243225/src/FireLink/BackEnd/FlowGraphGenerator.hs | haskell | | A numbered instruction (the number being a unique identifier within some context)
| Semantic shortcut for a list of numbered instructions
| Semantic shortcut for a list of basic blocks
| Semantic shortcut for a list of numbered blocks
| Semantic shortcut for a list of edges
| Second tuple position contains the ... | module FireLink.BackEnd.FlowGraphGenerator(
generateFlowGraph, BasicBlock, NumberedBlock, FlowGraph,
entryVertex, exitVertex, getAllVariables, getProgramVariables
) where
import Data.Char (isDigit)
import Data.Graph
import Data.List (nub)
... |
722fd41dbb738afb8cf3a41cb1af14cbc95324e1857b098d23286be7493255a5 | scicloj/metamorph.ml | persistence_tools.clj | (ns scicloj.metamorph.persistence-tools
(:require [clojure.test :as t]
[clojure.tools.reader :as tr]
[clojure.tools.reader.reader-types :as rts]
[clojure.java.classpath]
[scicloj.metamorph.ml.evaluation-handler :as eval]
[clojure.repl]))
(defn key... | null | https://raw.githubusercontent.com/scicloj/metamorph.ml/7070dfbdd0561f9534be117a02d6b152e5d3baad/test/scicloj/metamorph/persistence_tools.clj | clojure | (ns scicloj.metamorph.persistence-tools
(:require [clojure.test :as t]
[clojure.tools.reader :as tr]
[clojure.tools.reader.reader-types :as rts]
[clojure.java.classpath]
[scicloj.metamorph.ml.evaluation-handler :as eval]
[clojure.repl]))
(defn key... | |
ab368244bb847ab391990f747105af31212e4ec50706207a919b04cd3d25d5ef | dcastro/twenty48 | main.hs | # LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Control.Concurrent.Async
import Control.Monad.Random (MonadRandom)
import Data.Function ((&))
import qualified Data.List as L
import Data.List.NonEmpty ... | null | https://raw.githubusercontent.com/dcastro/twenty48/d4a58bfa389bb247525fd18f80ef428d84ef5fe9/eval/main.hs | haskell | # LANGUAGE OverloadedStrings #
| Play the game n number of times and print the average number of wins/score.
| This is used for tuning the heuristic function.
| the pieces to the right
| (or to the left, it doesn't matter). | # LANGUAGE LambdaCase #
module Main where
import Control.Concurrent.Async
import Control.Monad.Random (MonadRandom)
import Data.Function ((&))
import qualified Data.List as L
import Data.List.NonEmpty (NonEmpty)
import qualified Data.... |
5026db7015ae8eceaafaa586526a8c43f4aed35ab1d1c096e3ea0a75aff6f562 | tonymorris/fp-course | AsWin.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE GADTs #-}
module TicTacToe.AsWin(
AsWin(_Win)
) where
import Control.Applicative(Applicative)
import Control.Lens(Optic, Choice, _1, _Left)
import Data.Either(Either)
import Data.Functor(Functor)
class AsW... | null | https://raw.githubusercontent.com/tonymorris/fp-course/73a64c3d4d0df58654a1a9a0ee9d9b11c3818911/projects/TicTacToe/haskell/src/TicTacToe/AsWin.hs | haskell | # LANGUAGE GADTs # | # LANGUAGE NoImplicitPrelude #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE FlexibleInstances #
module TicTacToe.AsWin(
AsWin(_Win)
) where
import Control.Applicative(Applicative)
import Control.Lens(Optic, Choice, _1, _Left)
import Data.Either(Either)
import Data.Functor(Functor)
class AsWin p f o where
_Win :... |
02136a99b1aff6ac25b0c31d3f4909fa57ce7180fa89ae23ba1c640ee54385e7 | xapi-project/xenopsd | squeeze_test.ml |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | null | https://raw.githubusercontent.com/xapi-project/xenopsd/2a66192f4e23fd7ebd839980dc6e6078d02b7d81/squeezed/test/squeeze_test.ml | ocaml | * Simulation environment and set of unit tests for the domain memory balancer.
compute the direction of travel of the balloon
We stop when we get to 'inaccuracy_kib'
don't exceed the target
* Return the current domain state
* Helper function to change the domain's balloon target
* Helper function to set the do... |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... |
4cd98e2a60cabab50fe3dc53b68726fb5b8a234ecb13d0530f3c4770efee091a | heraldry/heraldicon | variant.cljs | (ns spec.heraldry.charge.variant
(:require
[cljs.spec.alpha :as s]))
(s/def :heraldry.charge.variant/id string?)
(s/def :heraldry.charge.variant/version (s/nilable number?))
(s/def :heraldry.charge/variant (s/keys :opt-un [:heraldry.charge.variant/version]
:req-un [:heraldr... | null | https://raw.githubusercontent.com/heraldry/heraldicon/5b1ee92bdbeb8e4ad16fbdad3d7e83db3cda2ed7/src/spec/heraldry/charge/variant.cljs | clojure | (ns spec.heraldry.charge.variant
(:require
[cljs.spec.alpha :as s]))
(s/def :heraldry.charge.variant/id string?)
(s/def :heraldry.charge.variant/version (s/nilable number?))
(s/def :heraldry.charge/variant (s/keys :opt-un [:heraldry.charge.variant/version]
:req-un [:heraldr... | |
b5124d050469e0626897a785cab5b6f7814a450eb2f7dbae7b32d068985073a6 | launchdarkly/erlang-server-sdk | ldclient_rollout.erl | %%-------------------------------------------------------------------
%% @doc Rollout data type
@private
%% @end
%%-------------------------------------------------------------------
-module(ldclient_rollout).
%% API
-export([new/1]).
-export([bucket_context/6]).
-export([rollout_context/3]).
%% Types
-type seed(... | null | https://raw.githubusercontent.com/launchdarkly/erlang-server-sdk/d9a4442a8a214bf950dec8182b26cd042436f4c8/src/ldclient_rollout.erl | erlang | -------------------------------------------------------------------
@doc Rollout data type
@end
-------------------------------------------------------------------
API
Types
Describes how contexts will be bucketed into variations during a percentage rollout
the type of rollout to use,
- rollout uses old hashing... | @private
-module(ldclient_rollout).
-export([new/1]).
-export([bucket_context/6]).
-export([rollout_context/3]).
-type seed() :: non_neg_integer() | null.
-type rollout() :: #{
variations => [weighted_variation()],
bucketBy => ldclient_attribute_reference:attribute_reference(),
contextKind => ldc... |
c6ed9f34ab31f84241aac8c4e41cec5d8b7bac85e54845cc9ba949d81aa2747d | discus-lang/ddc | BuilderX8664Darwin.hs | {-# OPTIONS_HADDOCK hide #-}
module DDC.Build.Builder.BuilderX8664Darwin where
import DDC.Build.Builder.Base
import qualified DDC.Core.Salt.Platform as Llvm
import qualified System.Directory as System
builder_X8664_Darwin config host mVersion
= Builder
{ builderName = "x86_64-darwin"
... | null | https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-build/DDC/Build/Builder/BuilderX8664Darwin.hs | haskell | # OPTIONS_HADDOCK hide #
The install_name is the intended install path of the dylib.
When executables are linked against a library with an install_name
set that path is added to the linker meta-data of the executable.
When the system then loads the executable it tries to find the dylib
at that previously set p... |
module DDC.Build.Builder.BuilderX8664Darwin where
import DDC.Build.Builder.Base
import qualified DDC.Core.Salt.Platform as Llvm
import qualified System.Directory as System
builder_X8664_Darwin config host mVersion
= Builder
{ builderName = "x86_64-darwin"
, buildHost ... |
045999a73532e227fb0b3ef2719ef47611506c005b98e591e360fa61357f3df4 | brown/city-hash | package.lisp |
(in-package #:common-lisp-user)
(defpackage #:city-hash
(:documentation "An implementation of the CityHash family of hash functions.")
(:use #:common-lisp #:com.google.base)
(:import-from #:nibbles
nibbles:ub32ref/le
nibbles:ub64ref/le)
(:import-from #:swap-bytes
... | null | https://raw.githubusercontent.com/brown/city-hash/47c236670a63330e86e7ba327e5526ed9843767b/package.lisp | lisp |
(in-package #:common-lisp-user)
(defpackage #:city-hash
(:documentation "An implementation of the CityHash family of hash functions.")
(:use #:common-lisp #:com.google.base)
(:import-from #:nibbles
nibbles:ub32ref/le
nibbles:ub64ref/le)
(:import-from #:swap-bytes
... | |
9700180a4c844b140ccb62cf86389addd297300c1703535a2a798a38de2832a7 | yallop/ocaml-reex | test_match.ml |
* Copyright ( c ) 2022 .
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2022 Jeremy Yallop.
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*)
open OUnit2
open Reex
let ma... | null | https://raw.githubusercontent.com/yallop/ocaml-reex/94eea88bb06be5e295627f437d7a585bd9d9b0a6/tests/test_match.ml | ocaml | "regenerate" >:: test_with_regenerate; |
* Copyright ( c ) 2022 .
*
* This file is distributed under the terms of the MIT License .
* See the file LICENSE for details .
* Copyright (c) 2022 Jeremy Yallop.
*
* This file is distributed under the terms of the MIT License.
* See the file LICENSE for details.
*)
open OUnit2
open Reex
let ma... |
c762fd4a78a58d2c2e6b354fa8f560464f2c76fd3503ea5e40705c6cc4d49dbd | vikram/lisplibraries | errors.lisp | (in-package :trivial-sockets)
;; you're using a part of the interface that the implementation doesn't do
(define-condition unsupported (error)
((feature :initarg :feature :reader unsupported-feature))
(:report (lambda (c s)
(format s "~S does not support trivial-socket feature ~S."
... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/ucw-boxset/dependencies/trivial-sockets_until-i-can-merge-with-the-mainline/errors.lisp | lisp | you're using a part of the interface that the implementation doesn't do
all-purpose error: host not found, host not responding,
no service on that port, etc | (in-package :trivial-sockets)
(define-condition unsupported (error)
((feature :initarg :feature :reader unsupported-feature))
(:report (lambda (c s)
(format s "~S does not support trivial-socket feature ~S."
(lisp-implementation-type) (unsupported-feature c)))))
(define-conditi... |
9a55c22c947c3abf91ac27ba397140548495c8c6bbc4fb5ec6db9787529606d8 | VisionsGlobalEmpowerment/webchange | add_text.clj | (ns webchange.templates.library.flipbook.add-text
(:require
[clojure.tools.logging :as log]
[webchange.templates.library.flipbook.display-names :refer [update-display-names]]
[webchange.templates.library.flipbook.add-page :refer [get-action-data]]
[webchange.utils.flipbook :as f]
[webchange.utils.... | null | https://raw.githubusercontent.com/VisionsGlobalEmpowerment/webchange/d16f88e2e1dc8aa6acea26f7c45629b4242a32b4/src/clj/webchange/templates/library/flipbook/add_text.clj | clojure | (ns webchange.templates.library.flipbook.add-text
(:require
[clojure.tools.logging :as log]
[webchange.templates.library.flipbook.display-names :refer [update-display-names]]
[webchange.templates.library.flipbook.add-page :refer [get-action-data]]
[webchange.utils.flipbook :as f]
[webchange.utils.... | |
4cc0c127a21d68cf2950b440d495deec215b82edc92e908e4353d70d61e622e4 | bmeurer/ocamljit2 | oo.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet Cri... | null | https://raw.githubusercontent.com/bmeurer/ocamljit2/ef06db5c688c1160acc1de1f63c29473bcd0055c/stdlib/oo.mli | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ Id$
val copy : (< .. > as 'a) -> 'a
... |
68c5e04da8e38943880abce4cc7a4249e0ba31151b266e3d0b609b9f1d2593f2 | ecraven/r7rs-swank | gerbil.scm | (define ($scheme-name)
"gerbil-scheme")
(define (remove-underscores-and-trailing-numbers str)
(define last (- (string-length str) 1))
(cond ((char-numeric? (string-ref str last))
(remove-underscores-and-trailing-numbers (substring str 0 last)))
((char=? (string-ref str last) #\_)
(remov... | null | https://raw.githubusercontent.com/ecraven/r7rs-swank/c483de0397502e35f47f216bd73c84e714d7670c/specific/gerbil.scm | scheme | (define hash-table? hash-table?)
basic implementation, print all output at the end, this should
be replaced with a custom output port
If we are swanky
otherwise, back to normal | (define ($scheme-name)
"gerbil-scheme")
(define (remove-underscores-and-trailing-numbers str)
(define last (- (string-length str) 1))
(cond ((char-numeric? (string-ref str last))
(remove-underscores-and-trailing-numbers (substring str 0 last)))
((char=? (string-ref str last) #\_)
(remov... |
cc8a08005c9f667e2a4a2fede96809f18352cff5c124a19ebbe041a0d6f9c9ec | jgm/texmath | texmath.hs | # LANGUAGE CPP #
{-# LANGUAGE OverloadedStrings #-}
module Main where
import Text.TeXMath
import Data.Char (isSpace)
import Text.XML.Light
import System.IO
import System.Environment
import System.Console.GetOpt
import System.Exit
import Data.Maybe
import Text.Pandoc.Definition
import Network.URI (unEscapeString)
impo... | null | https://raw.githubusercontent.com/jgm/texmath/cac1b789a4d40730402c15111d5214a9a8577f81/extra/texmath.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE CPP #
module Main where
import Text.TeXMath
import Data.Char (isSpace)
import Text.XML.Light
import System.IO
import System.Environment
import System.Console.GetOpt
import System.Exit
import Data.Maybe
import Text.Pandoc.Definition
import Network.URI (unEscapeString)
import Data.Aeson (encode, (.=), object... |
cba528016c8bcea014ecf51280db7d594f07d9e88aacae834a3048bf9a99e564 | achirkin/vulkan | 02-GLFWWindow.hs | |
In this example , I follow first parts of vulkan-tutorial.com to create a window
and pick a device using GLFW .
Parts of the code are moved to Lib
In this example, I follow first parts of vulkan-tutorial.com to create a window
and pick a device using GLFW.
Parts of the code are moved to Lib
-}
module Ma... | null | https://raw.githubusercontent.com/achirkin/vulkan/b2e0568c71b5135010f4bba939cd8dcf7a05c361/vulkan-examples/02-GLFWWindow.hs | haskell | |
In this example , I follow first parts of vulkan-tutorial.com to create a window
and pick a device using GLFW .
Parts of the code are moved to Lib
In this example, I follow first parts of vulkan-tutorial.com to create a window
and pick a device using GLFW.
Parts of the code are moved to Lib
-}
module Ma... | |
5aa0930e18caf1c488b55eadad1b59059bda60ccc3893c029e1365e5e08c4140 | KavehYousefi/Esoteric-programming-languages | main.lisp | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;
This program implements an interpreter for the joke language " OHE " ,
invented by the Esolang user " ResU " .
;;
;; Concept
;; =======
Any program authored in the OHE programming language partakes of a
treatment concerning its code ... | null | https://raw.githubusercontent.com/KavehYousefi/Esoteric-programming-languages/8e0143ebd0978798f0137d10479066c3ac56acec/OHE/OHE_001/main.lisp | lisp |
Concept
=======
instead merely printing the text "Hello, world!".
Architecture
============
Data Types
==========
The insignificance apportioned to its source code perforce excludes
the participation of data types. Solely the ASCII character set, as a
supplying substrate for the requisite text "H... | This program implements an interpreter for the joke language " OHE " ,
invented by the Esolang user " ResU " .
Any program authored in the OHE programming language partakes of a
treatment concerning its code by the same 's neglect ,
OHE neither prescribes nor requires any architectural warklooms .
... |
06a8d3dba5e036b236f0341c0245d37b3991a72e0fcdf413f08a1156a06cae60 | cedlemo/OCaml-GI-ctypes-bindings-generator | Icon_source.ml | open Ctypes
open Foreign
type t
let t_typ : t structure typ = structure "Icon_source"
let create =
foreign "gtk_icon_source_new" (void @-> returning (ptr t_typ))
let copy =
foreign "gtk_icon_source_copy" (ptr t_typ @-> returning (ptr t_typ))
let free =
foreign "gtk_icon_source_free" (ptr t_typ @-> returning (vo... | null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Icon_source.ml | ocaml | open Ctypes
open Foreign
type t
let t_typ : t structure typ = structure "Icon_source"
let create =
foreign "gtk_icon_source_new" (void @-> returning (ptr t_typ))
let copy =
foreign "gtk_icon_source_copy" (ptr t_typ @-> returning (ptr t_typ))
let free =
foreign "gtk_icon_source_free" (ptr t_typ @-> returning (vo... | |
927c75e06708c0de571ed865daf2af01bb63915cc6f9cd369783a15e90879e2e | lexi-lambda/freer-simple | Reader.hs | -- |
Module : Control . . Freer . Reader
-- Description: Reader effects, for encapsulating an environment.
Copyright : ( c ) 2016 Allele Dev ; 2017 Ixperta Solutions s.r.o . ; 2017
-- License: BSD3
Maintainer : < >
-- Stability: experimental
Portability : GHC specific language ext... | null | https://raw.githubusercontent.com/lexi-lambda/freer-simple/e5ef0fec4a79585f99c0df8bc9e2e67cc0c0fb4a/src/Control/Monad/Freer/Reader.hs | haskell | |
Description: Reader effects, for encapsulating an environment.
License: BSD3
Stability: experimental
Composable handler for 'Reader' effects. Handy for encapsulating an
environment with immutable state for interpreters.
Using <> as a starting point.
* Reader Effect
* Reader Operations
* Reader Ha... | Module : Control . . Freer . Reader
Copyright : ( c ) 2016 Allele Dev ; 2017 Ixperta Solutions s.r.o . ; 2017
Maintainer : < >
Portability : GHC specific language extensions .
module Control.Monad.Freer.Reader
Reader(..)
, ask
, asks
, local
, runReader
* Example 1 : Simpl... |
b84f93bbabe6e3fe0e7912412dab4378537717c9aef3edeb9f7e177db98a4518 | bluemont/kria | user.clj | (ns user
(:require
[clojure.pprint :refer (pprint)]
[clojure.repl :refer :all]
[clojure.string :as str]
[clojure.test :refer [run-tests run-all-tests]]
[clojure.tools.namespace.repl :refer (refresh)]
[kria.bucket :as bucket]
[kria.client :as client]
[kria.conversions :as conv]
[kria.core :a... | null | https://raw.githubusercontent.com/bluemont/kria/8ed7fb1ebda8bfa1a2a6d7a3acf05e2255fcf0f0/dev/user.clj | clojure | (ns user
(:require
[clojure.pprint :refer (pprint)]
[clojure.repl :refer :all]
[clojure.string :as str]
[clojure.test :refer [run-tests run-all-tests]]
[clojure.tools.namespace.repl :refer (refresh)]
[kria.bucket :as bucket]
[kria.client :as client]
[kria.conversions :as conv]
[kria.core :a... | |
45820b04f80975ffd2ca516b5119c44e16f320497459c5f394fde104342704b6 | pariyatti/kosa | time_fixtures.clj | (ns kuti.fixtures.time-fixtures
(:require [kuti.support.time :as time]))
(defn freeze-clock
([t]
(time/freeze-clock!)
(t)
(time/unfreeze-clock!))
([date-time test-fn]
(time/freeze-clock! date-time)
(test-fn)
(time/unfreeze-clock!)))
(def win95 (time/instant "1995-08-24T00:00:00.000Z"))
(defn ... | null | https://raw.githubusercontent.com/pariyatti/kosa/692fc236c596baa11fd562f4998d2e683cfb4466/test/kuti/fixtures/time_fixtures.clj | clojure | (ns kuti.fixtures.time-fixtures
(:require [kuti.support.time :as time]))
(defn freeze-clock
([t]
(time/freeze-clock!)
(t)
(time/unfreeze-clock!))
([date-time test-fn]
(time/freeze-clock! date-time)
(test-fn)
(time/unfreeze-clock!)))
(def win95 (time/instant "1995-08-24T00:00:00.000Z"))
(defn ... | |
b2adda2c7ce5a994a7c92fe9525e4dc8f53fd035cd8e2a35a00a15c77bd4405a | mpdairy/posh | datomic.clj | (ns posh.clj.datomic
(:require [posh.plugin-base :as base]
[posh.lib.ratom :as rx]
[datomic.api :as d]))
(defn- TODO [& [msg]] (throw (ex-info (str "TODO: " msg) nil)))
(defn- conn? [x] (instance? datomic.Connection x))
; TODO maybe we don't want blocking here?)
(defn- transact!* [& args] @... | null | https://raw.githubusercontent.com/mpdairy/posh/2347c8505f795ab252dbab2fcdf27eca65a75b58/src/posh/clj/datomic.clj | clojure | TODO maybe we don't want blocking here?) | (ns posh.clj.datomic
(:require [posh.plugin-base :as base]
[posh.lib.ratom :as rx]
[datomic.api :as d]))
(defn- TODO [& [msg]] (throw (ex-info (str "TODO: " msg) nil)))
(defn- conn? [x] (instance? datomic.Connection x))
(defn- transact!* [& args] @(apply d/transact args))
(defn- listen!
... |
99d486eabd5b0fa4e61d04b49a430e402d18972e2bfdf292ec1b057c4edb88be | acl2/acl2 | eval-functions@useless-runes.lsp | (RP::CREATE-EVAL-FNC
(13 13 (:REWRITE DEFAULT-CAR))
(7 7 (:REWRITE DEFAULT-CDR))
(3 3 (:REWRITE SYMBOL-LISTP-IMPLIES-SYMBOLP))
(3 3 (:REWRITE INTEGER-LISTP-IMPLIES-INTEGERP))
(3 3 (:REWRITE DEFAULT-<-2))
(3 3 (:REWRITE DEFAULT-<-1))
)
(APPLY-FOR-DEFEVALUATOR)
(RP::RP-EVL)
(EVAL-LIST-KWOTE-LST)
(TRUE-LIST-FIX-EV-... | null | https://raw.githubusercontent.com/acl2/acl2/f64742cc6d41c35f9d3f94e154cd5fd409105d34/books/projects/rp-rewriter/.sys/eval-functions%40useless-runes.lsp | lisp | (RP::CREATE-EVAL-FNC
(13 13 (:REWRITE DEFAULT-CAR))
(7 7 (:REWRITE DEFAULT-CDR))
(3 3 (:REWRITE SYMBOL-LISTP-IMPLIES-SYMBOLP))
(3 3 (:REWRITE INTEGER-LISTP-IMPLIES-INTEGERP))
(3 3 (:REWRITE DEFAULT-<-2))
(3 3 (:REWRITE DEFAULT-<-1))
)
(APPLY-FOR-DEFEVALUATOR)
(RP::RP-EVL)
(EVAL-LIST-KWOTE-LST)
(TRUE-LIST-FIX-EV-... | |
60a39bc11bf6c3a7fdd42dc8bbadc4467535b1030037fa78ee7f44a0d4dd36e8 | maximedenes/native-coq | topconstr.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/interp/topconstr.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
i
i
********************************... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Pp
open Errors
open Util... |
d7a7247e646b93805dfdf35af5d0c9c1d73b669b35a2896a78295d8404ad806b | anmonteiro/ocaml-quic | cID.ml | ----------------------------------------------------------------------------
* Copyright ( c ) 2020
*
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1... | null | https://raw.githubusercontent.com/anmonteiro/ocaml-quic/6bcd5e4cb2da0a7b8a5274321f08771143373666/lib/cID.ml | ocaml | ----------------------------------------------------------------------------
* Copyright ( c ) 2020
*
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are met :
*
* 1... | |
3bbab8d55cf3694030d8b20a5a975514f5636aadd70bac8c741135c4a12959c4 | quek/paiprolog | othello2.lisp | ;;;; -*- Mode: Lisp; Syntax: Common-Lisp -*-
Code from Paradigms of AI Programming
Copyright ( c ) 1991
;;;; File othello2.lisp: More strategies for othello.lisp,
from section 18.9 onward ( alpha - beta2 , alpha - beta3 , iago ) .
If a compiled version of edge-table.lisp exists , then merely
;;;; load it af... | null | https://raw.githubusercontent.com/quek/paiprolog/012d6bb255d8af7f1c8b1d061dcd8a474fb3b57a/othello2.lisp | lisp | -*- Mode: Lisp; Syntax: Common-Lisp -*-
File othello2.lisp: More strategies for othello.lisp,
load it after you load this file. Otherwise, load this file,
evaluate (init-edge-table) (this will take a really long time),
future use.
player's current mobility
player's potential mobility
Do the indexes with most ... | Code from Paradigms of AI Programming
Copyright ( c ) 1991
from section 18.9 onward ( alpha - beta2 , alpha - beta3 , iago ) .
If a compiled version of edge-table.lisp exists , then merely
then compile edge-table.lisp . This will save the edge - table for
(requires "othello")
(defconstant all-squares
... |
e5138f51aefeb138aeaf88ba738f4c4bb40bbf7b880c0d7b5925ca1b8dd36473 | ice1000/learn | find-the-odd-int.hs | module Codewars.Kata.FindOdd where
import Data.List
findOddRec :: [Int] -> Int
findOddRec [a] = a
findOddRec (a : (b : c))
|a == b = findOddRec c
|a /= b = a
--
-- | Given a list, find the [Int] that appears an
-- odd number of times. The tests will always
-- provide such a number, and the list will
always c... | null | https://raw.githubusercontent.com/ice1000/learn/4ce5ea1897c97f7b5b3aee46ccd994e3613a58dd/Haskell/CW-Kata/find-the-odd-int.hs | haskell |
| Given a list, find the [Int] that appears an
odd number of times. The tests will always
provide such a number, and the list will
| module Codewars.Kata.FindOdd where
import Data.List
findOddRec :: [Int] -> Int
findOddRec [a] = a
findOddRec (a : (b : c))
|a == b = findOddRec c
|a /= b = a
always contain at least one element .
findOdd :: [Int] -> Int
findOdd xs = findOddRec $ sort xs
|
4dfdbc0f27e3697468ac6b53f6d4d215be8ad4fe29a2d5dd322b1d75565e2801 | okuoku/nausicaa | test-random.sps | ;;;
Part of : / Scheme
;;;Contents: tests for random
Date : Thu Jun 25 , 2009
;;;
;;;Abstract
;;;
;;;
;;;
Copyright ( c ) 2009 < >
;;;
;;;This program is free software: you can redistribute it and/or modify
;;;it under the terms of the GNU General Public License as published by
the Free Software Foundation , eith... | null | https://raw.githubusercontent.com/okuoku/nausicaa/50e7b4d4141ad4d81051588608677223fe9fb715/scheme/tests/test-random.sps | scheme |
Contents: tests for random
Abstract
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
your option) any later version.
This program is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without ... | Part of : / Scheme
Date : Thu Jun 25 , 2009
Copyright ( c ) 2009 < >
the Free Software Foundation , either version 3 of the License , or ( at
General Public License for more details .
You should have received a copy of the GNU General Public License
#!r6rs
(import (nausicaa)
(nausicaa checks)
(nausic... |
e23185d97ea8e7885310c8833aff11a7276150e860a92f1519c31364e3e94162 | AnyChart/export-server | web_handlers_test.clj | (ns export-server.web-handlers-test
(:use [clojure.test]
[export-server.test-utils]))
;====================================================================================
/png
;====================================================================================
(deftest png-handler-test
(let [response (... | null | https://raw.githubusercontent.com/AnyChart/export-server/0ef2f084e07aaa144e38dff30e3283f686de1108/test/export_server/web_handlers_test.clj | clojure | ====================================================================================
====================================================================================
====================================================================================
/jpg
===========================================================... | (ns export-server.web-handlers-test
(:use [clojure.test]
[export-server.test-utils]))
/png
(deftest png-handler-test
(let [response ((call-post "/png" {}) :response)]
(testing "Empty params"
(is (= (response :status) 400))
(is (> (.indexOf (response :body) "error") 0))
(is (= ((resp... |
d52e3a5fbd132bac3336747381a105787147a5fda25d5c871f270ff7c4ed0387 | falgon/htcc | Generate.hs | |
Module : Htcc . Asm . Generate
Description : The modules of intrinsic ( x86_64 ) assembly
Copyright : ( c ) roki , 2019
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
The executable module for compilation
Module : Htcc.Asm.Generate
Description : The... | null | https://raw.githubusercontent.com/falgon/htcc/3cef6fc362b00d4bc0ae261cba567bfd9c69b3c5/src/Htcc/Asm/Generate.hs | haskell | # LANGUAGE OverloadedStrings #
* Generator
| input string, C source code
| the function to output error message
| the function to output warning message
global variables, and literals and composes assembly code
| Build AST from string of C source code | |
Module : Htcc . Asm . Generate
Description : The modules of intrinsic ( x86_64 ) assembly
Copyright : ( c ) roki , 2019
License : MIT
Maintainer :
Stability : experimental
Portability : POSIX
The executable module for compilation
Module : Htcc.Asm.Generate
Description : The... |
e75901a94e37895fb909438f91a57fd551009994719c5c15f5d0d9d92fdbd0c3 | ermine-language/ermine | Syntax.hs | # OPTIONS_GHC -fno - warn - missing - signatures #
# LANGUAGE TemplateHaskell #
module Syntax where
import Ermine.Syntax.Kind as Kind
import Ermine.Syntax.Type as Type
import Ermine.Syntax.Term as Term
import Test.QuickCheck
import Test.QuickCheck.Function
import Test.QuickCheck.Instances
import Test.Framework.TH
imp... | null | https://raw.githubusercontent.com/ermine-language/ermine/bd58949ab56311be9e0d2506a900f3d77652566b/tests/properties/Syntax.hs | haskell | # OPTIONS_GHC -fno - warn - missing - signatures #
# LANGUAGE TemplateHaskell #
module Syntax where
import Ermine.Syntax.Kind as Kind
import Ermine.Syntax.Type as Type
import Ermine.Syntax.Term as Term
import Test.QuickCheck
import Test.QuickCheck.Function
import Test.QuickCheck.Instances
import Test.Framework.TH
imp... | |
5735f277c27f0f8fb646741ff9d873c71052764d7dc2be74136b59e84ff063c1 | niquola/reframe-template | layout.cljs | (ns ui.layout
(:require-macros [reagent.ratom :refer [reaction]])
(:require
[reagent.core :as reagent]
[ui.styles :as styles]
[re-frame.core :as rf]
[ui.routes :refer [href]]
[ui.styles :as styles]
[ui.widgets :as wgt]
[clojure.string :as str]))
(rf/reg-sub-raw
:auth
(fn [db _] (reaction (:... | null | https://raw.githubusercontent.com/niquola/reframe-template/6482afabc1967d2b6cb39ddc3fc0158075535700/srcs/ui/layout.cljs | clojure | (ns ui.layout
(:require-macros [reagent.ratom :refer [reaction]])
(:require
[reagent.core :as reagent]
[ui.styles :as styles]
[re-frame.core :as rf]
[ui.routes :refer [href]]
[ui.styles :as styles]
[ui.widgets :as wgt]
[clojure.string :as str]))
(rf/reg-sub-raw
:auth
(fn [db _] (reaction (:... | |
e5c4603c0a05ed0127cbd6a2d30ff75f734a5093f0b2d1ac420bc689291f119b | gregtatcam/imaplet-lwt | test_lightparse.ml | open Lwt
open Sexplib
open Imaplet
open Commands
open Lightparsemail
let pr message ent msg =
let len = ent.size in
let offset = ent.offset in
let prfx = if len > 50 then String.sub message offset 50 else
String.sub message offset len in
let pstfx = if len > 100 then String.sub message (offset+len - 50) 5... | null | https://raw.githubusercontent.com/gregtatcam/imaplet-lwt/d7b51253e79cffa97e98ab899ed833cd7cb44bb6/test/test_lightparse.ml | ocaml | open Lwt
open Sexplib
open Imaplet
open Commands
open Lightparsemail
let pr message ent msg =
let len = ent.size in
let offset = ent.offset in
let prfx = if len > 50 then String.sub message offset 50 else
String.sub message offset len in
let pstfx = if len > 100 then String.sub message (offset+len - 50) 5... | |
b80ff1515af5e85bd011d9bb60218f5dd0f7122a554e18faddd58730bfe90e71 | simonjbeaumont/ocaml-pci | ffi_bindings.ml | open Ctypes
module Types (F: Cstubs.Types.TYPE) = struct
module Lookup_mode = struct
let lookup_vendor = F.constant "PCI_LOOKUP_VENDOR" F.int
let lookup_device = F.constant "PCI_LOOKUP_DEVICE" F.int
let lookup_class = F.constant "PCI_LOOKUP_CLASS" F.int
let lookup_subsystem = F.constant "PCI_LOOKUP_S... | null | https://raw.githubusercontent.com/simonjbeaumont/ocaml-pci/936cff8794bcb2ac0c4de6f8431f1810ba4e6941/bindings/ffi_bindings.ml | ocaml | Just a subset of the access types we'll need internally | open Ctypes
module Types (F: Cstubs.Types.TYPE) = struct
module Lookup_mode = struct
let lookup_vendor = F.constant "PCI_LOOKUP_VENDOR" F.int
let lookup_device = F.constant "PCI_LOOKUP_DEVICE" F.int
let lookup_class = F.constant "PCI_LOOKUP_CLASS" F.int
let lookup_subsystem = F.constant "PCI_LOOKUP_S... |
aaf01714c565df496a1b7bcff853fe711b010b6c2a680809dd8396c9bab8dc1c | GaloisInc/tower | Document.hs |
module Ivory.Tower.Config.Document where
import Ivory.Tower.Config.Preprocess
import Ivory.Tower.Config.TOML
getDocument :: FilePath -> [FilePath] -> IO (Either String TOML)
getDocument root path = do
b <- getPreprocessedFile root path
case b of
Right bs -> return (tomlParse bs)
Left e -> return (Left e)... | null | https://raw.githubusercontent.com/GaloisInc/tower/a43f5e36c6443472ea2dc15bbd49faf8643a6f87/tower-config/src/Ivory/Tower/Config/Document.hs | haskell |
module Ivory.Tower.Config.Document where
import Ivory.Tower.Config.Preprocess
import Ivory.Tower.Config.TOML
getDocument :: FilePath -> [FilePath] -> IO (Either String TOML)
getDocument root path = do
b <- getPreprocessedFile root path
case b of
Right bs -> return (tomlParse bs)
Left e -> return (Left e)... | |
d8bd013e3006e5559a9b15324e2095a2a436c6ece74ff1f50fe21a0cf45d21ed | CrossRef/cayenne | user.clj | (ns cayenne.user
(:require [clojure.string :as str]
[cayenne.conf :as conf]
[cayenne.ids.doi :as doi-id]
[cayenne.schedule :as schedule]
[cayenne.api.route :as route]
[cayenne.action :as action]
[taoensso.timbre.appenders.irc :as irc-appender]
... | null | https://raw.githubusercontent.com/CrossRef/cayenne/02321ad23dbb1edd3f203a415f4a4b11ebf810d7/src/cayenne/user.clj | clojure | (ns cayenne.user
(:require [clojure.string :as str]
[cayenne.conf :as conf]
[cayenne.ids.doi :as doi-id]
[cayenne.schedule :as schedule]
[cayenne.api.route :as route]
[cayenne.action :as action]
[taoensso.timbre.appenders.irc :as irc-appender]
... | |
a55c14451f255674d9f6e3940585daecf7efc72f1161a6b263c4cfd5b763e8e4 | faylang/fay | json.hs | module Console where
import FFI
import Prelude
import Fay.Text
data MyData = MyData { xVar :: Text, yVar :: Int }
myData :: MyData
myData = MyData { xVar = pack "asdfasd", yVar = 9 }
main = do
jsonSerialized <- toJSON myData
jsonDeserialized <- toMyData jsonSerialized
-- The "insta... | null | https://raw.githubusercontent.com/faylang/fay/8455d975f9f0db2ecc922410e43e484fbd134699/examples/json.hs | haskell | The "instance" field below is required for reliable parsing.
If your JSON source doesn't have an "instance" field, you can
| Print using console.log. | module Console where
import FFI
import Prelude
import Fay.Text
data MyData = MyData { xVar :: Text, yVar :: Int }
myData :: MyData
myData = MyData { xVar = pack "asdfasd", yVar = 9 }
main = do
jsonSerialized <- toJSON myData
jsonDeserialized <- toMyData jsonSerialized
add one like... |
601815f00bc24fde898cfee2375c7b8752dd98635578d20b2c1e52aabf412001 | JacquesCarette/Drasil | Body.hs | -- | Gathers and organizes all the information for the [Drasil website](/).
module Drasil.Website.Body where
import Language.Drasil.Printers (PrintingInformation(..), defaultConfiguration)
import Database.Drasil
import SysInfo.Drasil
import Language.Drasil
import Drasil.DocLang (findAllRefs)
import Drasil.Website.Int... | null | https://raw.githubusercontent.com/JacquesCarette/Drasil/84272acccc09574dec70d8d96c6ea994f15f8b22/code/drasil-website/lib/Drasil/Website/Body.hs | haskell | | Gathers and organizes all the information for the [Drasil website](/).
| Printing info to get document to generate. Takes in the 'FolderLocation'.
| Instead of being an 'SRSDecl', this takes the folder locations and generates the document from there.
Document -- Title -- author (hack for now to show up in prop... | module Drasil.Website.Body where
import Language.Drasil.Printers (PrintingInformation(..), defaultConfiguration)
import Database.Drasil
import SysInfo.Drasil
import Language.Drasil
import Drasil.DocLang (findAllRefs)
import Drasil.Website.Introduction (introSec)
import Drasil.Website.About (aboutSec)
import Drasil.We... |
b42b86d0ac84ab2e8393d33a8c2516ca5b803399198eafd50ebe9c4a54fb1d31 | zwizwa/staapl | sim-tools.rkt | #lang racket/base
(require "../tools.rkt"
"../target/rep.rkt"
racket/dict
racket/control
racket/match
racket/pretty
)
(provide (all-defined-out))
;; Reusable tools for writing machine emulators.
;; abstract register access
;; Convenient interface for register ac... | null | https://raw.githubusercontent.com/zwizwa/staapl/e30e6ae6ac45de7141b97ad3cebf9b5a51bcda52/pic18/sim-tools.rkt | racket | Reusable tools for writing machine emulators.
abstract register access
Convenient interface for register access
name-symbol
super-struct-type
init-field-k
auto-field-k
auto-v
inspector or false
word-run or 0
(define-struct register
separate due to pre/post inc/dec on FSRs
if register access does not have si... | #lang racket/base
(require "../tools.rkt"
"../target/rep.rkt"
racket/dict
racket/control
racket/match
racket/pretty
)
(provide (all-defined-out))
(define (register-fn reg [arg #f])
(cond
((procedure? arg)
((register-read-modify-write reg) arg))
(arg
... |
63b8b3e953fab09a13fd183247b348a46860050752f2811cee23f5ace7893a3e | scarvalhojr/haskellbook | section21.12.hs |
import Control.Applicative (liftA, liftA2, liftA3)
newtype Identity a = Identity a
deriving (Eq, Ord, Show)
instance Functor Identity where
fmap f (Identity x) = Identity (f x)
-- The following isn't necessary
instance Applicative Identity where
pure = Identity
Identity f <*> Identity x... | null | https://raw.githubusercontent.com/scarvalhojr/haskellbook/6016a5a78da3fc4a29f5ea68b239563895c448d5/chapter21/section21.12.hs | haskell | The following isn't necessary
-
traverse :: (Applicative f) => (a -> f b) -> Constant a -> f (Constant b)
-
foldMap :: (Monoid m) => (a -> m) -> Optional a -> m
traverse :: (Applicative f) => (a -> f b) -> Optional a -> f (Optional b)
-
-
-
-
-
fmap :: (a -> b) -> S n a -> S n b
foldr :: (a -> b -> b) -> b -> S n... |
import Control.Applicative (liftA, liftA2, liftA3)
newtype Identity a = Identity a
deriving (Eq, Ord, Show)
instance Functor Identity where
fmap f (Identity x) = Identity (f x)
instance Applicative Identity where
pure = Identity
Identity f <*> Identity x = Identity (f x)
instance Folda... |
01e1e6a5442e2338eb33dbe6057b67541460aa559f242204706daff26f70db82 | metaocaml/ber-metaocaml | opttoploop.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/toplevel/opttoploop.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Format
val set_paths : unit -> unit
val loop : formatter -> unit
val run_script : formatter ->... |
a95f9b138518422666a367d86e2ea35d2e9f9bbf4d21245c1d953a797873715e | ThoughtWorksInc/clj-http-s3 | middleware.clj | (ns clj-http-s3.middleware
(:require [clj-http-s3.s3 :as s3]
[clj-time.format :as format-time]
[clj-time.local :as local-time]
[clojure.set :as set])
(:import [com.amazonaws.auth
DefaultAWSCredentialsProviderChain]))
(defn- request-date-time [] (format-time/unparse (... | null | https://raw.githubusercontent.com/ThoughtWorksInc/clj-http-s3/d5523b9448d3910978f09c709697adc167c9496c/src/clj_http_s3/middleware.clj | clojure | (ns clj-http-s3.middleware
(:require [clj-http-s3.s3 :as s3]
[clj-time.format :as format-time]
[clj-time.local :as local-time]
[clojure.set :as set])
(:import [com.amazonaws.auth
DefaultAWSCredentialsProviderChain]))
(defn- request-date-time [] (format-time/unparse (... | |
fe0ce3b9dd9300ef202b5159e1e1aec5d76a0c3370ab35f59dba040ecdcfb3a7 | flavioc/cl-hurd | getcttyid.lisp |
(in-package :hurd)
(defcfun ("getcttyid" %getcttyid) port)
(defun getcttyid ()
"Get the CTTY port."
(%getcttyid))
| null | https://raw.githubusercontent.com/flavioc/cl-hurd/982232f47d1a0ff4df5fde2edad03b9df871470a/hurd/libc/getcttyid.lisp | lisp |
(in-package :hurd)
(defcfun ("getcttyid" %getcttyid) port)
(defun getcttyid ()
"Get the CTTY port."
(%getcttyid))
| |
d26c79e4c8eb5856cbb50a482f7a5e827d9dff768458cf2fd297b128637fd83f | bi1yeu/generation-p | biology.clj | (ns generation-p.biology
(:require [clojure.data.generators :as data.gen]
[generation-p.model :as m]
[generation-p.social :as social]
[generation-p.image :as image]))
(def ^:const desired-generation-population-count 60)
(def ^:const ^:private crossover-mutation-rate 0.0001)
(def ^... | null | https://raw.githubusercontent.com/bi1yeu/generation-p/1a00cd2138a77967dc72fc4315c3d50878580fe7/src/generation_p/biology.clj | clojure | width is desired dimensions of resultant square image -- the return val of
==============================================================================
==============================================================================
individuals in `population` should already have an accumulated normalized
fitness ... | (ns generation-p.biology
(:require [clojure.data.generators :as data.gen]
[generation-p.model :as m]
[generation-p.social :as social]
[generation-p.image :as image]))
(def ^:const desired-generation-population-count 60)
(def ^:const ^:private crossover-mutation-rate 0.0001)
(def ^... |
3a6bc4af98c10b26130612028155d9ed0b519e426cefd98dbb51dffcb416e1d0 | Mathnerd314/stroscot | Resource.hs | # LANGUAGE LambdaCase , BlockArguments , ScopedTypeVariables #
# LANGUAGE RecordWildCards , ViewPatterns #
module Resource where
import Data.Function
import Data.List.Extra
import Data.Maybe(fromJust)
import Unsafe.Coerce
import Control.Concurrent.Extra
import Control.Exception.Extra
import Data.Tuple.Extra
import Da... | null | https://raw.githubusercontent.com/Mathnerd314/stroscot/47638b8609bf6b7539e187120f7d8be3438893bf/src/build/Resource.hs | haskell | In shake: Exception > Resume > Start > Batch > Deprioritize
batch runs with Batch
* this is terribly non-deterministic, as the batches change each run depending on which files are modified
* better is to collect the files in a list and then split the list into batches
* if the file list is generated sequentially, ... | # LANGUAGE LambdaCase , BlockArguments , ScopedTypeVariables #
# LANGUAGE RecordWildCards , ViewPatterns #
module Resource where
import Data.Function
import Data.List.Extra
import Data.Maybe(fromJust)
import Unsafe.Coerce
import Control.Concurrent.Extra
import Control.Exception.Extra
import Data.Tuple.Extra
import Da... |
1d2984d814544b2648874ca40ce8cd48dfae9ff6935a37952e09d8b6d08a7a97 | amnh/ocamion | subplex.ml | open Internal
open Numerical
* The strategy contains a simplex strategy and added features
type subplex_strategy =
{ simplex : Simplex.simplex_strategy;
psi : float; (** The Simplex Reduction coefficient *)
omega : float; (** The Step Reduction coefficient *)
* Minimum subsp... | null | https://raw.githubusercontent.com/amnh/ocamion/699c2471b7fdac12f061cf24b588f9eef5bf5cb8/lib/subplex.ml | ocaml | * The Simplex Reduction coefficient
* The Step Reduction coefficient
* Default Simplex Strategy defined by FSAoNA paper
* Return the vector that represents the subspace
* Replace elements of a subspace vector into the main vector
find the scale factor for new step
orient step in the proper direction
* Determin... | open Internal
open Numerical
* The strategy contains a simplex strategy and added features
type subplex_strategy =
{ simplex : Simplex.simplex_strategy;
* Minimum subspace dimension ; or 2
* Maximum subspace dimension ; or 5
}
let default_subplex =
{ simplex = Simplex.default_simplex; omega = 0.1; psi = 0.25;... |
a5e7108b98da6499815359b4580735ab8804e8e8bc422598f9f94b5eba1bf4de | dragonmark/util | project.clj | (defproject dragonmark/util "0.1.4"
:description "A bunch of useful functions"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
; {:name "GNU LESSER GENERAL PUBLIC LICENSE"
; :url ""}]
:dependencies [[org.clojure/clojure "1.6.0"]]
:plugins [[codox "0.8.10"... | null | https://raw.githubusercontent.com/dragonmark/util/2f3e4161e2268c0665219b06fba274eacbbbe960/project.clj | clojure | {:name "GNU LESSER GENERAL PUBLIC LICENSE"
:url ""}] | (defproject dragonmark/util "0.1.4"
:description "A bunch of useful functions"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.6.0"]]
:plugins [[codox "0.8.10"]
[lein-cljsbuild "1.0.3"]
[com.keminglabs/cljx "0.4.0"]... |
68d10681bec4f18f452348d12fe069ac0ab60b4f4677a5a4ebcfd020646cc57d | hiroshi-unno/coar | RLConfig.ml | open Core
open Common.Util
type t = {
enable: bool;
show_num_constrs: bool;
show_num_pvars: bool;
show_num_args: bool;
show_user_time: bool;
show_elapsed_time: bool;
show_constraints: bool;
show_candidates: bool;
show_examples: bool;
show_unsat_core: bool;
ask_smt_timeout: bool
} [@@ deriving yoj... | null | https://raw.githubusercontent.com/hiroshi-unno/coar/90a23a09332c68f380efd4115b3f6fdc825f413d/lib/PCSat/common/RLConfig.ml | ocaml | open Core
open Common.Util
type t = {
enable: bool;
show_num_constrs: bool;
show_num_pvars: bool;
show_num_args: bool;
show_user_time: bool;
show_elapsed_time: bool;
show_constraints: bool;
show_candidates: bool;
show_examples: bool;
show_unsat_core: bool;
ask_smt_timeout: bool
} [@@ deriving yoj... | |
a16811e0bda17fae3c2a52eff960b144b0408d12259ff1ca1236f02fae2a65a8 | openbadgefactory/salava | export_test.clj | (ns salava.badge.export-test
(:require [clojure.test :refer :all]
[midje.sweet :refer :all]
[salava.test-utils :as ts ]))
;;[get-system stop-system test-api-request login! logout! test-user-credentials]
(def test-user 1)
(def user-with-no-badges 3)
(def system (ts/get-system))
(facts "about... | null | https://raw.githubusercontent.com/openbadgefactory/salava/97f05992406e4dcbe3c4bff75c04378d19606b61/test_old/clj/salava/badge/export_test.clj | clojure | [get-system stop-system test-api-request login! logout! test-user-credentials] | (ns salava.badge.export-test
(:require [clojure.test :refer :all]
[midje.sweet :refer :all]
[salava.test-utils :as ts ]))
(def test-user 1)
(def user-with-no-badges 3)
(def system (ts/get-system))
(facts "about exporting badges"
(fact "user must be logged in to export badges"
... |
aecc688e0815abeee07a12ce4e740375c592b6c2330fce042138430b0e47a72c | gebi/jungerl | rdbms_wsearch.erl | %%%
The contents of this file are subject to the Erlang Public License ,
Version 1.0 , ( the " License " ) ; you may not use this file except in
%%% compliance with the License. You may obtain a copy of the License at
%%%
%%%
Software distributed under the License is distributed on an " AS IS "
%%% basis, WITHOU... | null | https://raw.githubusercontent.com/gebi/jungerl/8f5c102295dbe903f47d79fd64714b7de17026ec/lib/rdbms/src/rdbms_wsearch.erl | erlang |
compliance with the License. You may obtain a copy of the License at
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limitations
under the License.
Contributor(s): ______________________________________.
-------------------------... | The contents of this file are subject to the Erlang Public License ,
Version 1.0 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
The Original Code is rdbms-1.2 .
The Initial Developer of the Original Code is Ericsson Telecom
A... |
437ff2bf10950832d5d9d647bd5bdb4c81fec1b024bceb1c89df4e203dc47933 | madstap/recex | cron_test.clj | (ns madstap.recex.cron-test
(:require
[clojure.string :as str]
[clojure.test :refer [deftest testing is are run-tests test-var]]
[madstap.recex :as recex]))
(defn recex= [& recexes]
(when-not (every? recex/valid? recexes)
(throw (ex-info (-> (keep recex/explain-str recexes) (str/join "\n"))
... | null | https://raw.githubusercontent.com/madstap/recex/8414f9779e6444e6c1d442ca24b46db1d48f7dae/test/madstap/recex/cron_test.clj | clojure | (ns madstap.recex.cron-test
(:require
[clojure.string :as str]
[clojure.test :refer [deftest testing is are run-tests test-var]]
[madstap.recex :as recex]))
(defn recex= [& recexes]
(when-not (every? recex/valid? recexes)
(throw (ex-info (-> (keep recex/explain-str recexes) (str/join "\n"))
... | |
ed02d3f846660a03dd6a6a39e1324fbb4a5e0767f1706a0bce99d76f0b4c41bb | dsorokin/aivika | MachRep2.hs |
It corresponds to model MachRep2 described in document
-- Introduction to Discrete-Event Simulation and the SimPy Language
-- [/~matloff/156/PLN/DESimIntro.pdf].
SimPy is available on [ / ] .
--
-- The model description is as follows.
--
Two machines , but sometimes break down . Up time is exponentially
... | null | https://raw.githubusercontent.com/dsorokin/aivika/7a14f460ab114b0f8cdfcd05d5cc889fdc2db0a4/examples/MachRep2.hs | haskell | Introduction to Discrete-Event Simulation and the SimPy Language
[/~matloff/156/PLN/DESimIntro.pdf].
The model description is as follows.
at the same time.
In addition to finding the long-run proportion of up time as in
model MachRep1, let’s also find the long-run proportion of the time
that a given m... |
It corresponds to model MachRep2 described in document
SimPy is available on [ / ] .
Two machines , but sometimes break down . Up time is exponentially
distributed with mean 1.0 , and repair time is exponentially distributed
with mean 0.5 . In this example , there is only one repairperson , so
the two mach... |
af59d0b371ffc14cd8ecdcd05dac34618e5d41fe9a336a76d6f4435c02fa5b6b | reanimate/reanimate | doc_linear.hs | #!/usr/bin/env stack
-- stack runghc --package reanimate
{-# LANGUAGE OverloadedStrings #-}
module Main(main) where
import Reanimate
import Reanimate.Builtin.Documentation
import Reanimate.Morph.Common
import Reanimate.Morph.Linear
import Graphics.SvgTree
main :: IO ()
main = reanimate $ docEnv $ playThenReverseA $ p... | null | https://raw.githubusercontent.com/reanimate/reanimate/5ea023980ff7f488934d40593cc5069f5fd038b0/examples/doc_linear.hs | haskell | stack runghc --package reanimate
# LANGUAGE OverloadedStrings # | #!/usr/bin/env stack
module Main(main) where
import Reanimate
import Reanimate.Builtin.Documentation
import Reanimate.Morph.Common
import Reanimate.Morph.Linear
import Graphics.SvgTree
main :: IO ()
main = reanimate $ docEnv $ playThenReverseA $ pauseAround 0.5 0.5 $ mkAnimation 3 $ \t ->
withStrokeLineJoin JoinRou... |
05ad6bb339bd7802546100213958ec95f8e969a5c5182a2ba30e92a122842952 | grasswire/chat-app | DataStore.hs | {-# LANGUAGE OverloadedStrings #-}
module DataStore
(
RedisAction
, runRedisAction
, numUsersPresent
, setChannelPresence
, incrChannelPresence
, decrChannelPresence
, getPresenceForChannels
) where
import ClassyPrelude
import Database.Redis
import qualified Types as TP
i... | null | https://raw.githubusercontent.com/grasswire/chat-app/a8ae4e782cacd902d7ec9c68c40a939cc5cabb0a/backend/DataStore.hs | haskell | # LANGUAGE OverloadedStrings #
setChannelPresence :: Integer -> ChannelSlug -> RedisAction Integer
runRedis conn $ do
currentPresence <- hget channelPresenceSetKey key
case currentPresence of
Left err -> pure $ Left err
Right x ->
case x of
Just p -> do
... |
module DataStore
(
RedisAction
, runRedisAction
, numUsersPresent
, setChannelPresence
, incrChannelPresence
, decrChannelPresence
, getPresenceForChannels
) where
import ClassyPrelude
import Database.Redis
import qualified Types as TP
import Control.Monad.Trans... |
22836b3866efeadedb8c179c47a6db0a6dce90c8469cad7c5a80e9d0aa060ea5 | austral/austral | BuiltIn.ml |
Part of the Austral project , under the Apache License v2.0 with LLVM Exceptions .
See LICENSE file for details .
SPDX - License - Identifier : Apache-2.0 WITH LLVM - exception
Part of the Austral project, under the Apache License v2.0 with LLVM Exceptions.
See LICENSE file for details.
SPDX... | null | https://raw.githubusercontent.com/austral/austral/69b6f7de36cc9576483acd1ac4a31bf52074dbd1/lib/BuiltIn.ml | ocaml | Austral.Memory |
Part of the Austral project , under the Apache License v2.0 with LLVM Exceptions .
See LICENSE file for details .
SPDX - License - Identifier : Apache-2.0 WITH LLVM - exception
Part of the Austral project, under the Apache License v2.0 with LLVM Exceptions.
See LICENSE file for details.
SPDX... |
c4010b49ca8666450d0d13e069d287b5905f46c701b7e3273519163322cdf982 | evturn/haskellbook | 19.02-templating-content-in-scotty.hs | {-# LANGUAGE OverloadedStrings #-}
import Web.Scotty
import Data.Monoid (mconcat)
main = scotty 3000 $ do
get "/word" $ do
beam <- param "word"
html
(mconcat
[ "<h1>Scotty, "
, beam
, " me up!</h1>"])
| null | https://raw.githubusercontent.com/evturn/haskellbook/3d310d0ddd4221ffc5b9fd7ec6476b2a0731274a/19/19.02-templating-content-in-scotty.hs | haskell | # LANGUAGE OverloadedStrings # |
import Web.Scotty
import Data.Monoid (mconcat)
main = scotty 3000 $ do
get "/word" $ do
beam <- param "word"
html
(mconcat
[ "<h1>Scotty, "
, beam
, " me up!</h1>"])
|
65ab5c6971182fd2e0a8f01fe47c0a860f2e7b0b532878a19cd7012008f0563b | ates/radius | radius_service.erl | -module(radius_service).
-behaviour(gen_server).
%% API
-export([start_link/5]).
-export([name/1]).
-export([stop/1]).
-export([stats/1]).
%% gen_server callbacks
-export([init/1, handle_call/3, handle_cast/2,
handle_info/2, code_change/3, terminate/2]).
-include("radius.hrl").
-callback handle_request(Ty... | null | https://raw.githubusercontent.com/ates/radius/2145a5f79aef8b81b3b77b5beccb29d31044e272/src/radius_service.erl | erlang | API
gen_server callbacks
table used to store requests from clients
creates the table to store requests from clients
made it public to allow access from spawned processes(callback)
store request in the table to avoid duplicates | -module(radius_service).
-behaviour(gen_server).
-export([start_link/5]).
-export([name/1]).
-export([stop/1]).
-export([stats/1]).
-export([init/1, handle_call/3, handle_cast/2,
handle_info/2, code_change/3, terminate/2]).
-include("radius.hrl").
-callback handle_request(Type :: non_neg_integer(),
... |
e1d8b21e7934a54db9db652c3ea4b40f4fa3d0bf360ea6a1e210da480ff7f578 | orionsbelt-battlegrounds/obb-rules | driller.cljc | (ns ^{:added "1.8"
:author "Pedro Santos"}
obb-rules.units.driller
"Metadata information for the Driller unit")
(def metadata
{:name "driller"
:code "d"
:attack 1500
:after-attack [[:triple]]
:defense 1500
:range 1
:value 32
:type :mechanic
:category :medium
:displacement :grou... | null | https://raw.githubusercontent.com/orionsbelt-battlegrounds/obb-rules/97fad6506eb81142f74f4722aca58b80d618bf45/src/obb_rules/units/driller.cljc | clojure | (ns ^{:added "1.8"
:author "Pedro Santos"}
obb-rules.units.driller
"Metadata information for the Driller unit")
(def metadata
{:name "driller"
:code "d"
:attack 1500
:after-attack [[:triple]]
:defense 1500
:range 1
:value 32
:type :mechanic
:category :medium
:displacement :grou... | |
85636a69310b0336103f70fecb8b102ac03903e65be2d0ed80d32289f2fc35e0 | seantempesta/expo-cljs-template | core.cljs | (ns {{name}}.core
(:require [om.next :as om :refer-macros [defui]]
[re-natal.support :as sup]
[oops.core :refer [ocall]]
[{{name}}.state :as state]))
(def logo-img (js/require "./assets/images/cljs.png"))
(set! js/window.React (js/require "react"))
(def ReactNative (js/re... | null | https://raw.githubusercontent.com/seantempesta/expo-cljs-template/fb85abad30b000c24bb25f430b4f84ccae243cd4/resources/leiningen/new/expo/om/core.cljs | clojure | (ns {{name}}.core
(:require [om.next :as om :refer-macros [defui]]
[re-natal.support :as sup]
[oops.core :refer [ocall]]
[{{name}}.state :as state]))
(def logo-img (js/require "./assets/images/cljs.png"))
(set! js/window.React (js/require "react"))
(def ReactNative (js/re... | |
b26b125c60067e553db41af23b17691d0826a792eb3cba9bce11b5abfec1c092 | mzp/coq-ide-for-ios | segmenttree.ml | (** This module is a very simple implementation of "segment trees".
A segment tree of type ['a t] represents a mapping from a union of
disjoint segments to some values of type 'a.
*)
(** Misc. functions. *)
let list_iteri f l =
let rec loop i = function
| [] -> ()
| x :: xs -> f i x; loop (i + 1) x... | null | https://raw.githubusercontent.com/mzp/coq-ide-for-ios/4cdb389bbecd7cdd114666a8450ecf5b5f0391d3/coqlib/lib/segmenttree.ml | ocaml | * This module is a very simple implementation of "segment trees".
A segment tree of type ['a t] represents a mapping from a union of
disjoint segments to some values of type 'a.
* Misc. functions.
* We focus on integers but this module can be generalized.
* A value of type [domain] is interpreted different... |
let list_iteri f l =
let rec loop i = function
| [] -> ()
| x :: xs -> f i x; loop (i + 1) xs
in
loop 0 l
let log2 x = log x /. log 2.
let log2n x = int_of_float (ceil (log2 (float_of_int x)))
type elt = int
type domain =
| Interval of elt * elt
* On internal node or root , a domain [ Universe ... |
020ba5af09b4a317467009bf0c203617d78c976105c438a2c60651c8e11cb0f7 | taffybar/taffybar | Workspaces.hs | # OPTIONS_GHC -fno - warn - type - defaults #
# LANGUAGE ScopedTypeVariables , ExistentialQuantification , RankNTypes , OverloadedStrings #
-----------------------------------------------------------------------------
-- |
Module : System . . Widget . Workspaces
Copyright : ( c )
-- License : BSD3-... | null | https://raw.githubusercontent.com/taffybar/taffybar/4129b2aed4349752dd9a1b47676d457883d95490/src/System/Taffybar/Widget/Workspaces.hs | haskell | ---------------------------------------------------------------------------
|
License : BSD3-style (see LICENSE)
Stability : unstable
Portability : unportable
---------------------------------------------------------------------------
add the widgets in the correct order
widgets appear out of order, in the... | # OPTIONS_GHC -fno - warn - type - defaults #
# LANGUAGE ScopedTypeVariables , ExistentialQuantification , RankNTypes , OverloadedStrings #
Module : System . . Widget . Workspaces
Copyright : ( c )
Maintainer :
module System.Taffybar.Widget.Workspaces where
import Control.Applicative... |
9b54058724746c06a29d23d429bce88821cbefbbff8cfb4165ab466e116dcb70 | OCADml/OCADml | v.ml | * Two - dimensional vector
@canonical OCADml.v2
@canonical OCADml.v2 *)
type v2 = Gg.v2
* Three - dimensional vector
@canonical OCADml.v3
@canonical OCADml.v3 *)
type v3 = Gg.v3
* Four - dimensional vector
@canonical OCADml.v4
@canonical OCADml.v4 *)
type v4 = Gg.v4
let[@inline] v2 x y ... | null | https://raw.githubusercontent.com/OCADml/OCADml/f8cd87da86cd5ea4c31ec169c796640ffdc6bdee/lib/v.ml | ocaml | * [equal a b]
Float equality between the vectors [a] and [b].
* [compare a b]
Compare the vectors [a] and [b].
* [approx ?eps a b]
Returns true if the distance between vectors [a] and [b] is less than or
equal to the epsilon [eps].
* {1 Basic Arithmetic}
* [horizontal_op f a b]
Hadamard ... | * Two - dimensional vector
@canonical OCADml.v2
@canonical OCADml.v2 *)
type v2 = Gg.v2
* Three - dimensional vector
@canonical OCADml.v3
@canonical OCADml.v3 *)
type v3 = Gg.v3
* Four - dimensional vector
@canonical OCADml.v4
@canonical OCADml.v4 *)
type v4 = Gg.v4
let[@inline] v2 x y ... |
a50441ca6441bccff0f9ad1ce865bdf6183c9da1eebdfa569178b0bc74f7500f | lispgames/mathkit | package.lisp | (defpackage #:kit.math
(:use #:cl #:sb-cga)
(:export #:deg-to-rad
#:rad-to-deg
#:matrix*vec4
#:matrix*vec3
#:copy-matrix
#:perspective-matrix
#:ortho-matrix
#:look-at
#:frustum
#:unproject
#:vec2 #:vec3 #:... | null | https://raw.githubusercontent.com/lispgames/mathkit/fd884f94b36ef5e9bc19459ad0b3cda6303d2a2a/src/package.lisp | lisp | (defpackage #:kit.math
(:use #:cl #:sb-cga)
(:export #:deg-to-rad
#:rad-to-deg
#:matrix*vec4
#:matrix*vec3
#:copy-matrix
#:perspective-matrix
#:ortho-matrix
#:look-at
#:frustum
#:unproject
#:vec2 #:vec3 #:... | |
31a684890933d4d82597e4c7ac161f2aee2be91859d3163ed109f85a020e5ec0 | eeng/mercurius | in_memory_ticker_repository_test.clj | (ns mercurius.trading.adapters.repositories.in-memory-ticker-repository-test
(:require [clojure.test :refer [deftest testing is]]
[matcher-combinators.test]
[mercurius.support.factory :refer [build-trade]]
[mercurius.trading.domain.repositories.ticker-repository :refer [update-tick... | null | https://raw.githubusercontent.com/eeng/mercurius/f83778ddde99aa13692e4fe2e70b2e9dc2fd70e9/test/mercurius/trading/adapters/repositories/in_memory_ticker_repository_test.clj | clojure | (ns mercurius.trading.adapters.repositories.in-memory-ticker-repository-test
(:require [clojure.test :refer [deftest testing is]]
[matcher-combinators.test]
[mercurius.support.factory :refer [build-trade]]
[mercurius.trading.domain.repositories.ticker-repository :refer [update-tick... | |
f78df326f48bfc99fb5861b71955d57a8214a2283d0fc0dd885b1a804c2cf2e9 | maximedenes/native-coq | namegen.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/maximedenes/native-coq/3623a4d9fe95c165f02f7119c0e6564a83a9f4c9/pretyping/namegen.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
************************************... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Names
open Term
open Env... |
2cd3e8bf564cb1f0404ebc6b582b49ba8d7d2942bad2458729dde1082b052112 | kit-clj/kit | formats.clj | (ns <<ns-name>>.web.middleware.formats
(:require
[luminus-transit.time :as time]
[muuntaja.core :as m]))
(def instance
(m/create
(-> m/default-options
(update-in
[:formats "application/transit+json" :decoder-opts]
(partial merge time/time-deserialization-handlers))
(... | null | https://raw.githubusercontent.com/kit-clj/kit/9a38fbdfce072e056e6b0d79001f810e5deebe62/libs/deps-template/resources/io/github/kit_clj/kit/src/clj/web/middleware/formats.clj | clojure | (ns <<ns-name>>.web.middleware.formats
(:require
[luminus-transit.time :as time]
[muuntaja.core :as m]))
(def instance
(m/create
(-> m/default-options
(update-in
[:formats "application/transit+json" :decoder-opts]
(partial merge time/time-deserialization-handlers))
(... | |
ad9eb8437886f29967cc652b1e3cfb54d9940ec1dfe2d849693d1eb457261b43 | unisonweb/unison | Internal.hs | | The private Unison . Name innards . Prefer importing Unison . Name instead , unless you need the data constructor of
-- Name.
module Unison.Name.Internal
( Name (..),
isAbsolute,
segments,
)
where
import Control.Lens as Lens
import Data.List.NonEmpty (pattern (:|))
import qualified Data.List.NonEmpty a... | null | https://raw.githubusercontent.com/unisonweb/unison/ef3e70dc3a07e08e7979fafa8c2a9ebc0411f090/unison-core/src/Unison/Name/Internal.hs | haskell | Name.
| A name is an absolute-or-relative non-empty list of name segments.
A few example names:
"foo.bar" --> Name Relative ["bar", "foo"]
".foo.bar" --> Name Absolute ["bar", "foo"]
> Name Relative [ " < | " , " | > " ]
"." --> Name Relative ["."]
".." --> Name Absolute ["."]
whether t... | | The private Unison . Name innards . Prefer importing Unison . Name instead , unless you need the data constructor of
module Unison.Name.Internal
( Name (..),
isAbsolute,
segments,
)
where
import Control.Lens as Lens
import Data.List.NonEmpty (pattern (:|))
import qualified Data.List.NonEmpty as List (N... |
85bc24ec0f6aa5b41dca62eea6aa3536dece2fa272abe314026b78bd0c9ae69c | hspec/hspec | Mock.hs | module Mock where
import Prelude ()
import Test.Hspec.Core.Compat
newtype Mock = Mock (IORef Int)
newMock :: IO Mock
newMock = Mock <$> newIORef 0
mockAction :: Mock -> IO ()
mockAction (Mock ref) = modifyIORef ref succ
mockCounter :: Mock -> IO Int
mockCounter (Mock ref) = readIORef ref
| null | https://raw.githubusercontent.com/hspec/hspec/b48eee41032450123044de82c4c02213813563b1/hspec-core/test/Mock.hs | haskell | module Mock where
import Prelude ()
import Test.Hspec.Core.Compat
newtype Mock = Mock (IORef Int)
newMock :: IO Mock
newMock = Mock <$> newIORef 0
mockAction :: Mock -> IO ()
mockAction (Mock ref) = modifyIORef ref succ
mockCounter :: Mock -> IO Int
mockCounter (Mock ref) = readIORef ref
| |
37b7f22ab707d32a5bf62d5c3fa8aa0494e91d21794f6c67acaf04db3dda60f0 | qiao/sicp-solutions | 2.38.scm | (define nil '())
3/2
1/6
( 1 ( 2 ( 3 ( ) ) ) )
( ( ( ( ) 1 ) 2 ) 3 )
| null | https://raw.githubusercontent.com/qiao/sicp-solutions/a2fe069ba6909710a0867bdb705b2e58b2a281af/chapter2/2.38.scm | scheme | (define nil '())
3/2
1/6
( 1 ( 2 ( 3 ( ) ) ) )
( ( ( ( ) 1 ) 2 ) 3 )
| |
12e6ef37f33d40fdea6013316fd6460319abc423e041463737e44af3614eb9d9 | sergv/hkanren | InterleavingLogic.hs | ----------------------------------------------------------------------------
-- |
-- Module : Control.Monad.InterleavingLogic
Copyright : ( c ) 2015
-- License : BSD3-style (see LICENSE)
--
-- Maintainer :
-- Stability :
-- Portability :
--
--
---------------------------------------------------... | null | https://raw.githubusercontent.com/sergv/hkanren/94a9038f5885471c9f4d3b17a8e52af4e7747af3/src/Control/Monad/InterleavingLogic.hs | haskell | --------------------------------------------------------------------------
|
Module : Control.Monad.InterleavingLogic
License : BSD3-style (see LICENSE)
Maintainer :
Stability :
Portability :
--------------------------------------------------------------------------
# LANGUAGE RankNTypes ... | Copyright : ( c ) 2015
# LANGUAGE InstanceSigs #
# LANGUAGE ScopedTypeVariables #
module Control.Monad.InterleavingLogic
( Logic
, logic
, observe
, observeAll
, observeMany
, runLogic
)
where
import Control.Applicative
import Control.Monad
import Control.Monad.Logic.Class
import qual... |
1eee368544fa6670f36022212b897eb13bf6de5a6b1d204e8ac4e14b80285594 | pfdietz/ansi-test | tagbody.lsp | (in-package :cl-test)
;;; Utility to make a random tagbody
(defun make-random-digraph (n m)
"Create a random digraph with n nodes and m edges. Error if m is out of range of possible values."
(assert (typep n '(integer 0)))
(assert (typep m '(integer 0)))
(let ((m-max (* n (1- n)))
(adj-vec (make-arra... | null | https://raw.githubusercontent.com/pfdietz/ansi-test/3f4b9d31c3408114f0467eaeca4fd13b28e2ce31/random/tagbody.lsp | lisp | Utility to make a random tagbody
Generate all and select randomly
Few edges; generate with iteration when collision
is detected
Generate all and select randomly
Generate randomly
Now generate back edges | (in-package :cl-test)
(defun make-random-digraph (n m)
"Create a random digraph with n nodes and m edges. Error if m is out of range of possible values."
(assert (typep n '(integer 0)))
(assert (typep m '(integer 0)))
(let ((m-max (* n (1- n)))
(adj-vec (make-array (list n) :initial-element nil)))
... |
99330e29be1b38c6eca9bf66432b70e5c997872200cfb6f8db1ff999c6d47280 | rtoy/cmucl | ctor.lisp | Copyright ( C ) 2002 < >
;;; All rights reserved.
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
1 . Redistributions of source code must retain the above copyright
;;; notice, this list of condi... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/tests/pcl/ctor.lisp | lisp | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the following disclaimer in the
document... | Copyright ( C ) 2002 < >
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
3 . The name of the author may not be used to endorse or promote
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ` ` AS IS '' AND ANY EXPRESS
ARE DISCL... |
77bb8e1386c640d06576bf40093510204453058362341ce9a82138294cd26679 | bit-ranger/scheme-bootstrap | core.scm | (load "eval/types.scm")
(load "eval/keywords.scm")
(define (interp exp env)
(cond ((self-evaluating? exp) exp) ; 字面量
(else (interp-generic (wrap exp) env))))
;封装语法类型
(define (wrap exp)
(if (pair? exp)
(attach-tag (car exp) exp)
(attach-tag exp e... | null | https://raw.githubusercontent.com/bit-ranger/scheme-bootstrap/a9155ebd29efe1196854b2dcd76941357dab151e/eval/core.scm | scheme | 字面量
封装语法类型
是否字面量?
是否过程应用?
取序列第一个
剩余的序列 | (load "eval/types.scm")
(load "eval/keywords.scm")
(define (interp exp env)
(else (interp-generic (wrap exp) env))))
(define (wrap exp)
(if (pair? exp)
(attach-tag (car exp) exp)
(attach-tag exp exp)))
动态转发解释过程
(define (interp-generic tagged-exp env)
(let ((type (type-tag tagged-exp))
... |
976f6093a09a2d120f1d38f66e5b29b89cb0f7b6ab65c82fdd588203aa64b2e6 | electric-sql/vaxine | log_dump.erl | #!/usr/bin/env escript
%% -*- erlang -*-
%%! -sname log_dump -I ../../
-include("../include/antidote.hrl").
main([LogFile]) ->
try
read_log(LogFile)
catch
_:_ ->
usage()
end;
main(_) ->
usage().
usage() ->
io:format("usage: log_dump LOG_FILE_NAME\n"),
halt(1).
read... | null | https://raw.githubusercontent.com/electric-sql/vaxine/d726a7a3aeead9b9362e8b657f0929cb4fca9b5c/apps/antidote/priv/log_dump.erl | erlang | -*- erlang -*-
! -sname log_dump -I ../../
------------------------------------------------------------------------------ | #!/usr/bin/env escript
-include("../include/antidote.hrl").
main([LogFile]) ->
try
read_log(LogFile)
catch
_:_ ->
usage()
end;
main(_) ->
usage().
usage() ->
io:format("usage: log_dump LOG_FILE_NAME\n"),
halt(1).
read_log(LogFile) ->
case
disk_log:open(... |
32205e91e79fbd54ac244b6619a69b58209b8ba474f35395f744b67351cd2ca7 | joearms/music_experiments | midi_event_listener.erl | -module(midi_event_listener).
-compile(export_all).
start() ->
register(?MODULE,
spawn(fun() ->
process_flag(trap_exit, true),
Port = open_port({spawn, "./midi_event_listener"},
[{packet, 2}]),
io:format("Port=~p~n",[Port]),
loop(Port)
end)).
sleep(T) ->
receive
... | null | https://raw.githubusercontent.com/joearms/music_experiments/3c0db01d03571599a3506fcb1a001d0b8dd205d9/midi_mac_driver/midi_event_listener.erl | erlang | -module(midi_event_listener).
-compile(export_all).
start() ->
register(?MODULE,
spawn(fun() ->
process_flag(trap_exit, true),
Port = open_port({spawn, "./midi_event_listener"},
[{packet, 2}]),
io:format("Port=~p~n",[Port]),
loop(Port)
end)).
sleep(T) ->
receive
... | |
8d12c107241857b8e34e822e09d68436ac478de26096a7007cb9c9929fe078c7 | ku-fpg/blank-canvas | Rounded_Corners.hs | {-# LANGUAGE OverloadedStrings #-}
module Rounded_Corners where
import Graphics.Blank
( 578,200 )
main :: IO ()
main = blankCanvas 3000 $ \ context -> do
send context $ do
lineWidth 25;
let rectWidth = 200;
let rectHeight = 100;
let rectX = 189;
let rectY = 50;
... | null | https://raw.githubusercontent.com/ku-fpg/blank-canvas/39915c17561106ce06e1e3dcef85cc2e956626e6/wiki-suite/Rounded_Corners.hs | haskell | # LANGUAGE OverloadedStrings # | module Rounded_Corners where
import Graphics.Blank
( 578,200 )
main :: IO ()
main = blankCanvas 3000 $ \ context -> do
send context $ do
lineWidth 25;
let rectWidth = 200;
let rectHeight = 100;
let rectX = 189;
let rectY = 50;
let cornerRadius = 50;
... |
b01bf8f832230e9eb5618534718e0b61eb8110bc422fac007b883d29a357f6f2 | arcadia-unity/catcon | junit.clj | Copyright ( c ) . All rights reserved .
; The use and distribution terms for this software are covered by the
; Eclipse Public License 1.0 (-1.0.php)
; which can be found in the file epl-v10.html at the root of this distribution.
; By using this software in any fashion, you are agreeing to be bound b... | null | https://raw.githubusercontent.com/arcadia-unity/catcon/6c69f424d3c14639ff11a3ea7d9da6aa81328f8a/Arcadia/Internal/clojure/test/junit.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not re... | Copyright ( c ) . All rights reserved .
by
June 2009
(ns ^{:doc "clojure.test extension for JUnit-compatible XML output.
JUnit (/) is the most popular unit-testing library
for Java. As such, tool support for JUnit output formats is
common. By producing compatible output from tests... |
aec93e32c265a2962b325478e2c3d68d45909b11ab1a629347931c5f24702032 | AshleyYakeley/Truth | Main.hs | {-# OPTIONS -fno-warn-orphans #-}
module Main
( main
) where
import Changes.Core
import Lens
import Resource
import Shapes
import Shapes.Test
import Subscribe
import Test.SimpleString
instance Arbitrary SequencePoint where
arbitrary = MkSequencePoint <$> (getSmall . getNonNegative <$> arbitrary)
shri... | null | https://raw.githubusercontent.com/AshleyYakeley/Truth/2817d5e36bd1dc5de932d808026098b6c35e7185/Changes/changes-core/test/Main.hs | haskell | # OPTIONS -fno-warn-orphans #
# OVERLAPPING #
oldState <- get
newState <- get |
module Main
( main
) where
import Changes.Core
import Lens
import Resource
import Shapes
import Shapes.Test
import Subscribe
import Test.SimpleString
instance Arbitrary SequencePoint where
arbitrary = MkSequencePoint <$> (getSmall . getNonNegative <$> arbitrary)
shrink 0 = []
shrink 1 = [0]
s... |
2359caa9eb2ec5885a87df79eb9adc9b3f9674e3b5e0cdcaa75572238a7a8582 | tomjaguarpaw/haskell-opaleye | Column.hs | # OPTIONS_GHC -fno - warn - duplicate - exports #
| Do not use . Will be deprecated in version 0.10 . Use
-- "Opaleye.Field" instead.
--
-- Functions for working directly with 'Column's.
--
Please note that numeric ' Column ' types are instances of ' ' , so
-- you can use '*', '/', '+', '-' on them.
module Op... | null | https://raw.githubusercontent.com/tomjaguarpaw/haskell-opaleye/2b264ecd62659f568c838a2bbdd796a4f6c3dd1f/src/Opaleye/Column.hs | haskell | "Opaleye.Field" instead.
Functions for working directly with 'Column's.
you can use '*', '/', '+', '-' on them.
* 'Column'
* Working with @NULL@
* Unsafe operations
* Entire module
| A NULL of any type
| @TRUE@ if the value of the column is @NULL@, @FALSE@ otherwise. | # OPTIONS_GHC -fno - warn - duplicate - exports #
| Do not use . Will be deprecated in version 0.10 . Use
Please note that numeric ' Column ' types are instances of ' ' , so
Column,
Nullable,
null,
isNull,
... |
f07ddd4c856c1baaddfd257457665690eb731bda4885052fef9802dc6f4f4709 | Flexiana/xiana-template | core.cljs | (ns {{sanitized-name}}.core
(:require
[reagent.dom :as rdom]
[re-frame.core :as re-frame]
[{{sanitized-name}}.events :as events]
[{{sanitized-name}}.views :as views]
[{{sanitized-name}}.config :as config]))
(defn dev-setup []
(when config/debug?
(println "dev mode")))
(defn ^:dev/after-load mo... | null | https://raw.githubusercontent.com/Flexiana/xiana-template/238738a29db3c948bd6d3281b4c0c241c5bdb59e/resources/leiningen/new/xiana/src/frontend/app_name/core.cljs | clojure | (ns {{sanitized-name}}.core
(:require
[reagent.dom :as rdom]
[re-frame.core :as re-frame]
[{{sanitized-name}}.events :as events]
[{{sanitized-name}}.views :as views]
[{{sanitized-name}}.config :as config]))
(defn dev-setup []
(when config/debug?
(println "dev mode")))
(defn ^:dev/after-load mo... | |
9b10cb1a7aaf720aa8a6023aa693f5147b4726c75d01141fe8b865e171af01e0 | yesodweb/yesod | streaming.hs | # LANGUAGE OverloadedStrings , TemplateHaskell , QuasiQuotes , TypeFamilies #
import Yesod.Core
import Data.Conduit
import qualified Data.Conduit.Binary as CB
import Control.Concurrent.Lifted (threadDelay)
import Data.Monoid ((<>))
import qualified Data.Text as T
import Control.Monad (forM_)
data App = App
mkYesod "A... | null | https://raw.githubusercontent.com/yesodweb/yesod/c59993ff287b880abbf768f1e3f56ae9b19df51e/demo/streaming/streaming.hs | haskell | # LANGUAGE OverloadedStrings , TemplateHaskell , QuasiQuotes , TypeFamilies #
import Yesod.Core
import Data.Conduit
import qualified Data.Conduit.Binary as CB
import Control.Concurrent.Lifted (threadDelay)
import Data.Monoid ((<>))
import qualified Data.Text as T
import Control.Monad (forM_)
data App = App
mkYesod "A... | |
6ee6379b350608c488f07e629542056743cad966f05af4b0ba3051701bfbbd71 | bbusching/libgit2 | revert.rkt | #lang racket
(require ffi/unsafe
"define.rkt"
"types.rkt"
"merge.rkt"
"checkout.rkt"
"index.rkt"
"utils.rkt")
(provide (all-defined-out))
; Types
(define-cstruct _git_revert_opts
([version _uint]
[mainline _uint]
[merge_opts _git_merge_opts]
[checkout... | null | https://raw.githubusercontent.com/bbusching/libgit2/6d6a007543900eb7a6fbbeba55850288665bdde5/libgit2/include/revert.rkt | racket | Types
Functions | #lang racket
(require ffi/unsafe
"define.rkt"
"types.rkt"
"merge.rkt"
"checkout.rkt"
"index.rkt"
"utils.rkt")
(provide (all-defined-out))
(define-cstruct _git_revert_opts
([version _uint]
[mainline _uint]
[merge_opts _git_merge_opts]
[checkout_opts _g... |
d3e82f1ebd14d2fc61f8cff19e2345ef6ff330b7745e657fb5cf6ae223f48c56 | cirodrig/triolet | Kind.hs | | The first pass of Core code generation , which computes kinds for
all type - level definitions in the module .
all type-level definitions in the module.
-}
module CParser2.GenCode.Kind(genKind, kindTranslation)
where
import Control.Applicative
import Control.Monad
import qualified Data.Map as Map
import... | null | https://raw.githubusercontent.com/cirodrig/triolet/e515a1dc0d6b3e546320eac7b71fb36cea5b53d0/src/program/CParser2/GenCode/Kind.hs | haskell | | Translate an AST kind to a core kind
Look up this type, if it's a @let type@ synonym
| Translate a global type-related declaration.
| Create a kind environment from the declarations in the module
| Compute the kinds of all type-level entities in the module.
These kinds are not part of the module that's finall... | | The first pass of Core code generation , which computes kinds for
all type - level definitions in the module .
all type-level definitions in the module.
-}
module CParser2.GenCode.Kind(genKind, kindTranslation)
where
import Control.Applicative
import Control.Monad
import qualified Data.Map as Map
import... |
c98c13652bec11736b104d75791f4e95c62d970aa7e8361aaa3855fe2e6bbb85 | typelead/eta | tc036.hs | module ShouldSucceed where
class (Eq a) => A a where
op1 :: a -> a
| null | https://raw.githubusercontent.com/typelead/eta/97ee2251bbc52294efbf60fa4342ce6f52c0d25c/tests/suite/typecheck/compile/tc036.hs | haskell | module ShouldSucceed where
class (Eq a) => A a where
op1 :: a -> a
| |
1613a5ebf5434ad082ee35c207946b21e61c5cfe82ffb2478f99c1992e413523 | degree9/enterprise | service.cljs | (ns degree9.service
"A service endpoint via websockets."
(:require [degree9.socket-io :as io]
["@feathersjs/feathers" :as feathers]
["@feathersjs/socketio-client" :as socketio]
[goog.object :as obj]
[meta.server :as server]
[degree9.debug :as dbg]))
(dbg/... | null | https://raw.githubusercontent.com/degree9/enterprise/65737c347e513d0a0bf94f2d4374935c7270185d/src/degree9/service.cljs | clojure | ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ; ;
| (ns degree9.service
"A service endpoint via websockets."
(:require [degree9.socket-io :as io]
["@feathersjs/feathers" :as feathers]
["@feathersjs/socketio-client" :as socketio]
[goog.object :as obj]
[meta.server :as server]
[degree9.debug :as dbg]))
(dbg/... |
d0631a68705a099f3c345fb6925f7871f846a81158a468db8a50f22fe316e354 | haskell-trasa/trasa | Doctest.hs | module Main (main) where
import Test.DocTest (doctest)
main :: IO ()
main = do
putStrLn "\nRUNNING DOCTESTS"
doctest
[ "src"
]
| null | https://raw.githubusercontent.com/haskell-trasa/trasa/bfc23d4fd5b895493ba650a7f607b5fa034179d7/trasa/test/Doctest.hs | haskell | module Main (main) where
import Test.DocTest (doctest)
main :: IO ()
main = do
putStrLn "\nRUNNING DOCTESTS"
doctest
[ "src"
]
| |
6378866f61493176ad076768d3d0125418c8fc3d6294aa10c6d420d4f4759d28 | couchbase/couchdb | mochiweb_acceptor.erl | @author < >
@copyright 2010 Mochi Media , Inc.
%%
%% Permission is hereby granted, free of charge, to any person obtaining a
%% copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction , including without limitation
%% the rights to use, copy, modif... | null | https://raw.githubusercontent.com/couchbase/couchdb/8a75fd2faa89f95158de1776354ceccf3e762753/src/mochiweb/mochiweb_acceptor.erl | erlang |
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
the rights to use, copy, modify, merge, publish, distribute, sublicense,
Software is furnished to do so, subject to the following conditions:
The above copyright noti... | @author < >
@copyright 2010 Mochi Media , Inc.
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF AN... |
f09ae1be1b7bc98cc0046e9fd6e3bd7b8c8208fd6a80a9d01949403fa8f7c175 | Zetawar/zetawar | spec.cljs | (ns zetawar.system.spec
(:require
[cljs.core.async :as async]
[cljs.core.async.impl.protocols :as async.protocols]
[clojure.spec :as s]
[clojure.spec.impl.gen :as gen]
[clojure.test.check]
[datascript.core :as d]))
;; Logger
(s/def :zetawar.system/logger nil?)
DataScript
(s/def :zetawar.system.d... | null | https://raw.githubusercontent.com/Zetawar/zetawar/dc1ee8d27afcac1cd98904859289012c2806e58c/src/cljs/zetawar/system/spec.cljs | clojure | Logger
Players
Router
Views | (ns zetawar.system.spec
(:require
[cljs.core.async :as async]
[cljs.core.async.impl.protocols :as async.protocols]
[clojure.spec :as s]
[clojure.spec.impl.gen :as gen]
[clojure.test.check]
[datascript.core :as d]))
(s/def :zetawar.system/logger nil?)
DataScript
(s/def :zetawar.system.datascript/... |
8a2f6dcdd3f6d9d76f9f02edb29c88e744189c3a707388b96be97af083dc7db5 | OCamlPro/typerex-lint | lexer_iter.mli | (**************************************************************************)
(* *)
(* OCamlPro Typerex *)
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/OCamlPro/typerex-lint/6d9e994c8278fb65e1f7de91d74876531691120c/libs/ocplib-compiler/lexer_iter.mli | ocaml | ************************************************************************
OCamlPro Typerex
This file is distributed ... | Copyright OCamlPro 2011 - 2016 . All rights reserved .
( GNU General Public Licence version 3.0 ) .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
NONINFRINGEMENT . IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS
BE LIABLE... |
71956dace56acc0c6adacfd5aad19bbded74517c420781801134565724f34c03 | weavejester/clout | project.clj | (defproject clout "2.2.1"
:description "A HTTP route matching library"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.228" :scope "provided"]
[instaparse "1.4.8" :exclu... | null | https://raw.githubusercontent.com/weavejester/clout/122b6a6ea31fb29904de4ca9964819557ac982ac/project.clj | clojure | (defproject clout "2.2.1"
:description "A HTTP route matching library"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.7.0"]
[org.clojure/clojurescript "1.7.228" :scope "provided"]
[instaparse "1.4.8" :exclu... | |
081869f7bf5ebb4419687a3ec98c5a225f6c3e9eac58c3bbd1b06feb3ffa3da6 | xapi-project/xenopsd | fence.ml |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | null | https://raw.githubusercontent.com/xapi-project/xenopsd/f4da21a4ead7c6a7082af5ec32f778faf368cf1c/xc/fence/fence.ml | ocaml | The world's simplest program which attempts to reboot domain 0
Clear both watchdog slots
set a very short timeout
boom? |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... |
7b71b53077d8b068c3b85fa1a58bb52be6205a3e07f22a824ce407d1af1fdf3d | Disco-Dave/message-db | Properties.hs | module Properties
( jsonRoundtrip
)
where
import qualified Data.Aeson as Aeson
import Hedgehog (Gen, PropertyT, forAll, (===))
jsonRoundtrip :: (Aeson.ToJSON a, Aeson.FromJSON a, Eq a, Show a) => Gen a -> PropertyT IO ()
jsonRoundtrip gen = do
thing <- forAll gen
Aeson.eitherDecode (Aeson.encode thing) === R... | null | https://raw.githubusercontent.com/Disco-Dave/message-db/b272c1648587046657e778685518a79f27c9f793/message-db/test/Properties.hs | haskell | module Properties
( jsonRoundtrip
)
where
import qualified Data.Aeson as Aeson
import Hedgehog (Gen, PropertyT, forAll, (===))
jsonRoundtrip :: (Aeson.ToJSON a, Aeson.FromJSON a, Eq a, Show a) => Gen a -> PropertyT IO ()
jsonRoundtrip gen = do
thing <- forAll gen
Aeson.eitherDecode (Aeson.encode thing) === R... | |
143fd6f3c2a51f9a6a5004559479a1aac833bca53452bdfcbe5f24df6b313b62 | racket/racket-lang-org | plot.rkt | #lang racket/base
(require pict
racket/list
racket/format
"color.rkt")
(provide plot
single-plot
get-times
r5rs-color
r5rs?)
(define (get-times f)
(define all-times
(call-with-input-file*
f
(lambda (i)
(for/fold ([ht '#hasheq()]) (... | null | https://raw.githubusercontent.com/racket/racket-lang-org/88dada2ee769ada9afaf1e3ec1fb28b8ddf216db/blog/_src/posts/racket-status-jan2021/plot.rkt | racket | #lang racket/base
(require pict
racket/list
racket/format
"color.rkt")
(provide plot
single-plot
get-times
r5rs-color
r5rs?)
(define (get-times f)
(define all-times
(call-with-input-file*
f
(lambda (i)
(for/fold ([ht '#hasheq()]) (... | |
3998145ed41d6745b03c8306a77c9d411b1fcc97eb901cb69278818188d80cdd | jwiegley/linearscan-hoopl | BranchAlloc.hs | module Programs.BranchAlloc where
import Assembly
import LinearScan.Hoopl.DSL
branchAlloc :: Program (Node IRVar)
branchAlloc = do
label "entry" $ do
branch v55 "L39" "L111"
label "L111" $ do
jump "L19"
label "L19" $ do
lc v0
branch v6 "L49" "L32"
label "L32" $ do
... | null | https://raw.githubusercontent.com/jwiegley/linearscan-hoopl/f654adf64cba4b3af1f42f06112c9225b1369c74/test/Programs/BranchAlloc.hs | haskell | module Programs.BranchAlloc where
import Assembly
import LinearScan.Hoopl.DSL
branchAlloc :: Program (Node IRVar)
branchAlloc = do
label "entry" $ do
branch v55 "L39" "L111"
label "L111" $ do
jump "L19"
label "L19" $ do
lc v0
branch v6 "L49" "L32"
label "L32" $ do
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.