_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 |
|---|---|---|---|---|---|---|---|---|
124433eb820514f84e6c95f053adb153167461d5b3b7bed121f1494f400a5c6e | erlang/corba | data_types_SUITE.erl | %%-----------------------------------------------------------------
%%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2002 - 2016 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a c... | null | https://raw.githubusercontent.com/erlang/corba/396df81473a386d0315bbba830db6f9d4b12a04f/lib/orber/test/data_types_SUITE.erl | erlang | -----------------------------------------------------------------
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KI... | Copyright Ericsson AB 2002 - 2016 . All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(data_types_SUITE).
-include_lib("common_test/include/ct.hrl").
-include_lib("orber/include/corba.hrl").
-d... |
bd4cec669963eea974945adf8632522f2d00961eace8b58be2d0f8ed1374226c | GaloisInc/LIMA | Types.hs | -- |
Module : Language .
Copyright : Galois Inc. 2016
-- License : BSD3
--
-- Maintainer :
-- Stability : experimental
-- Portability : unknown
--
Collect common types for the DSL and code generator .
--
module Language.LIMA.Types (
UID
, Name
, Path
, Phase(..)
) where
type... | null | https://raw.githubusercontent.com/GaloisInc/LIMA/8006bb52b2fb5d3264fe55ef8c9b7c89ab7f4630/lima/src/Language/LIMA/Types.hs | haskell | |
License : BSD3
Maintainer :
Stability : experimental
Portability : unknown
| A name.
| A hierarchical name.
| A phase is either the minimum phase or the exact phase. | Module : Language .
Copyright : Galois Inc. 2016
Collect common types for the DSL and code generator .
module Language.LIMA.Types (
UID
, Name
, Path
, Phase(..)
) where
type UID = Int
type Name = String
type Path = [Name]
data Phase = MinPhase Int | ExactPhase Int
deriving (Show)
|
efa91588151107c5dfe817bc1bc897bf5bd3f69d222b083b2d606b0db1deca7c | hoplon/demos | api.clj | (ns app.api
(:require
[app.datomic-query :refer [fetch-random-data]]
[castra.core :refer [defrpc]]))
(defrpc get-state []
(fetch-random-data))
| null | https://raw.githubusercontent.com/hoplon/demos/50d613892db0624a4f0326c1427d82f5b8e2390f/castra-datomic-free/src/app/api.clj | clojure | (ns app.api
(:require
[app.datomic-query :refer [fetch-random-data]]
[castra.core :refer [defrpc]]))
(defrpc get-state []
(fetch-random-data))
| |
0aafb19db8292a076c6a9400e158d0168b5c1f4273356e915163d28ed108027c | emqx/emqx-web-hook | prop_webhook_hooks.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the L... | null | https://raw.githubusercontent.com/emqx/emqx-web-hook/28436cca2735cb4f4c39c64bfcf51e7689e16986/test/props/prop_webhook_hooks.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2020 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(prop_webhook_hooks).
-include_lib("proper/include/proper.hrl").
-import(emqx_ct_proper_types,... |
50e6fd7988bec33edd723d54abd3b0ae27b646137c269d37f1ae2221c61b5889 | rcherrueau/APE | lang.rkt | #lang racket/base
;; ,-,-,-.
;; `,| | | ,-. . . ,-. ,-. . . ,-. ,-.
;; | ; | . ,-| | | | ,-| | | | | |
;; ' `-' `-^ `-^ `-' `-^ `-^ `-' `-'
;; Ownership Types Checker.
;;
;; Naming conventions:
- X , Y , FOO ( ie , uppercase variables ) and ` stx ' are syntax objects
;; - XS (with an uppercase "S" at the... | null | https://raw.githubusercontent.com/rcherrueau/APE/8b5302709000bd043b64d46d55642acb34ce5ba7/racket/CPN98/lang.rkt | racket | ,-,-,-.
`,| | | ,-. . . ,-. ,-. . . ,-. ,-.
| ; | . ,-| | | | ,-| | | | | |
' `-' `-^ `-^ `-' `-^ `-^ `-' `-'
Ownership Types Checker.
Naming conventions:
- XS (with an uppercase "S" at the end) is a syntax list of syntax
objects, e.g., #'(a b c 1 v)
- Xs (with a small "s" at the end) is a list ... | #lang racket/base
- X , Y , FOO ( ie , uppercase variables ) and ` stx ' are syntax objects
e.g. , ( list # ' a # ' b # ' c # ' 1 # ' v )
- meta : FS is the map of fields with ownership type field as value
(require "utils.rkt"
"check.rkt")
(provide (rename-out
[lang-read read]
[l... |
b3ac498a2fdd406e5890bda870157b009332e26058d73dd9eac8ebdc9e61d234 | rowangithub/DOrder | selectionsort.ml | let rec getmin xs : int =
match xs with
| x::xs' -> (
match xs' with
| [] -> x
| y::ys ->
let m = getmin xs' in
if (x < m) then x
else m)
let rec rem_min m xs =
match xs with
| x :: xs ->
if (x = m) then xs
else x :: (rem_min m xs)
let rec selection_sort xs =
match xs w... | null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/reachability/selectionsort.ml | ocaml | let rec getmin xs : int =
match xs with
| x::xs' -> (
match xs' with
| [] -> x
| y::ys ->
let m = getmin xs' in
if (x < m) then x
else m)
let rec rem_min m xs =
match xs with
| x :: xs ->
if (x = m) then xs
else x :: (rem_min m xs)
let rec selection_sort xs =
match xs w... | |
7a5abe5f165f3d775e1926fa516ac7ba24c8d3321c721e90a36b90c2621ea6cf | xh4/web-toolkit | encode.lisp | (in-package :uri-test)
(in-suite :uri-test)
(test percent-encode
(is (equal nil (uri::percent-encode nil)))
(is (equal "%E2%9D%A4" (uri::percent-encode "❤")))
(is (equal "%E7%88%B1" (uri::percent-encode "爱")))
(is (equal "%61%62%63" (uri::percent-encode "abc")))
(is (equal "abc" (uri::percent-encode "abc" :... | null | https://raw.githubusercontent.com/xh4/web-toolkit/e510d44a25b36ca8acd66734ed1ee9f5fe6ecd09/test/uri/encode.lisp | lisp | (in-package :uri-test)
(in-suite :uri-test)
(test percent-encode
(is (equal nil (uri::percent-encode nil)))
(is (equal "%E2%9D%A4" (uri::percent-encode "❤")))
(is (equal "%E7%88%B1" (uri::percent-encode "爱")))
(is (equal "%61%62%63" (uri::percent-encode "abc")))
(is (equal "abc" (uri::percent-encode "abc" :... | |
17a90db58c9d584b21363f72156e4824a498f06a166610a7b2d9fff1f8d5a9b2 | Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library | PaymentFlowsPrivatePaymentMethodsAlipayDetails.hs | {-# LANGUAGE MultiWayIf #-}
CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
{-# LANGUAGE OverloadedStrings #-}
-- | Contains the types generated from the schema PaymentFlowsPrivatePaymentMethodsAlipayDetails
module StripeAPI.Types.Payme... | null | https://raw.githubusercontent.com/Haskell-OpenAPI-Code-Generator/Stripe-Haskell-Library/ba4401f083ff054f8da68c741f762407919de42f/src/StripeAPI/Types/PaymentFlowsPrivatePaymentMethodsAlipayDetails.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
| Contains the types generated from the schema PaymentFlowsPrivatePaymentMethodsAlipayDetails
| Defines the object schema located at @components.schemas.payment_flows_private_payment_methods_alipay_details@ in the specification.
Constraints:
Constraints:
... | CHANGE WITH CAUTION : This is a generated code file generated by -OpenAPI-Code-Generator/Haskell-OpenAPI-Client-Code-Generator .
module StripeAPI.Types.PaymentFlowsPrivatePaymentMethodsAlipayDetails where
import qualified Control.Monad.Fail
import qualified Data.Aeson
import qualified Data.Aeson as Data.Aeson.Encod... |
d70b4e7c85ad3241105c13df7f1df1b8dc58d814ffe0150b159ddc58fe3c6846 | metaocaml/ber-metaocaml | build_path_prefix_map.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/utils/build_path_prefix_map.mli | ocaml | ************************************************************************
OCaml
... | , projet , INRIA Saclay
Copyright 2017 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
type path = string
type path_prefix = string
type error_message = string
val encode_prefix : path_prefix -> strin... |
7f35df43328a47787e7215cb547b72bf3c2703faf5882909b4c956fd698d8b4b | arielnetworks/cl-markup | markup.lisp | (in-package :cl-markup)
(defmacro %escape-string-form (val)
(let ((val2 (gensym)))
`(let ((,val2 ,val))
(if (should-escape-p ,val2)
`(escape-string ,,val2)
,val2))))
(defun %dirty-string-form (form)
(cond
((consp form) (let ((res (gensym))
(s (gensym))
... | null | https://raw.githubusercontent.com/arielnetworks/cl-markup/e0eb7debf4bdff98d1f49d0f811321a6a637b390/src/markup.lisp | lisp | (in-package :cl-markup)
(defmacro %escape-string-form (val)
(let ((val2 (gensym)))
`(let ((,val2 ,val))
(if (should-escape-p ,val2)
`(escape-string ,,val2)
,val2))))
(defun %dirty-string-form (form)
(cond
((consp form) (let ((res (gensym))
(s (gensym))
... | |
ee06a0184dadc471e8d70a82765ed47ec0aa08c003dbdf5ee9197e3fcec9dda8 | racket/drracket | teaching-lang-save-file.rkt | #lang scheme/base
(require scheme/file
scheme/class
scheme/port
framework/test
framework/preferences)
(require tests/drracket/private/drracket-test-util)
(fire-up-drracket-and-run-tests
(λ ()
(let* ([drr-frame (wait-for-drracket-frame)]
[fn (make-temporary-file "save-... | null | https://raw.githubusercontent.com/racket/drracket/2d7c2cded99e630a69f05fb135d1bf7543096a23/drracket-test/tests/drracket/teaching-lang-save-file.rkt | racket | #lang scheme/base
(require scheme/file
scheme/class
scheme/port
framework/test
framework/preferences)
(require tests/drracket/private/drracket-test-util)
(fire-up-drracket-and-run-tests
(λ ()
(let* ([drr-frame (wait-for-drracket-frame)]
[fn (make-temporary-file "save-... | |
54e65834193b125745cb13cb9f552857e8ead3ee191290cc660496f42bc16efe | ayamada/copy-of-svn.tir.jp | mydbm.scm | #!/usr/local/bin/gosh
;;; coding: euc-jp
;;; -*- scheme -*-
;;; vim:set ft=scheme ts=8 sts=2 sw=2 et:
$ Id$
;;; mydbm client/server module
;;; 仕様:
;;; - keyは文字列のみ固定対応
;;; - valueはS式のread/writeのみ固定対応?
;;; - serverはsocketで待ち受ける
;;; - 認証は、socketに接続できるか否か、のみとする
;;; 機能:
;;; -
;;; インターフェース:
;;; - (create table)
;;; ... | null | https://raw.githubusercontent.com/ayamada/copy-of-svn.tir.jp/101cd00d595ee7bb96348df54f49707295e9e263/Gauche-tir/branches/Gauche-tir01/trunk/tir/mydbm.scm | scheme | coding: euc-jp
-*- scheme -*-
vim:set ft=scheme ts=8 sts=2 sw=2 et:
mydbm client/server module
仕様:
- keyは文字列のみ固定対応
- valueはS式のread/writeのみ固定対応?
- serverはsocketで待ち受ける
- 認証は、socketに接続できるか否か、のみとする
機能:
-
インターフェース:
- (create table)
- (drop table)
- (exists table)
- (copy table)
- (read table key)
- (exist... | #!/usr/local/bin/gosh
$ Id$
- ( write table key )
ToDo : dbmの仕様を満たす事
(define-module tir.mydbm
(use dbm)
(use tir.lock)
(export
<mydbm-server>
mydbm-server-start
<mydbm-client>
))
(select-module tir.mydbm)
(autoload dbm.fsdbm <fsdbm>)
(define-class <mydbm-server> ()
(
(d... |
ad428f94df6048855058c12a94de117f015a73425e84f7f17dde1da4bfed26de | clojerl/clojerl | erlang_List_SUITE.erl | -module(erlang_List_SUITE).
-include("clojerl.hrl").
-include("clj_test_utils.hrl").
-export([ all/0
, init_per_suite/1
, end_per_suite/1
]).
-export([ new/1
, count/1
, str/1
, is_sequential/1
, get/1
, hash/1
, seq/1
, equiv/1
... | null | https://raw.githubusercontent.com/clojerl/clojerl/aa35847ca64e1c66224867ca4c31ca6de95bc898/test/erlang_List_SUITE.erl | erlang | ------------------------------------------------------------------------------
Test Cases
------------------------------------------------------------------------------ | -module(erlang_List_SUITE).
-include("clojerl.hrl").
-include("clj_test_utils.hrl").
-export([ all/0
, init_per_suite/1
, end_per_suite/1
]).
-export([ new/1
, count/1
, str/1
, is_sequential/1
, get/1
, hash/1
, seq/1
, equiv/1
... |
73ef09532d6003cbadda615e799ecaa14bd97006304507f2b75457fe373faa9d | skyzh/mips-simulator | Forward.hs | module Forward
( forward
, ForwardInfo(..)
)
where
import Data.Word ( Word32 )
import Branch ( isBranchOp
, isLinkOp
)
import Memory ... | null | https://raw.githubusercontent.com/skyzh/mips-simulator/61a319ab776fa30831e75aab906c6ef22bb7755e/src/Forward.hs | haskell | use after load, stall | module Forward
( forward
, ForwardInfo(..)
)
where
import Data.Word ( Word32 )
import Branch ( isBranchOp
, isLinkOp
)
import Memory ... |
5c877f3f6e53e94f3a76bf3362e82251041d312bd1043e3d632b1adec2655660 | lucasdicioccio/deptrack-project | Parasite.hs | # LANGUAGE DataKinds #
{-# LANGUAGE OverloadedStrings #-}
module Devops.Parasite (
ParasitedHost (..)
, ParasiteLogin
, ControlledHost (..)
, control
, parasite
, remoted
, fileTransferred
, SshFsMountedDir , sshMounted , sshFileCopy
, FileTransferred
) where
import Control.Applicative ... | null | https://raw.githubusercontent.com/lucasdicioccio/deptrack-project/cd3d59a796815af8ae8db32c47b1e1cdc209ac71/deptrack-devops-recipes/src/Devops/Parasite.hs | haskell | # LANGUAGE OverloadedStrings #
| A host that we control.
| A host that we control.
| A file transferred at a given remote path.
| Assert control on a remote.
'Continued' argument.
| A file transferred at a remote path.
Remote storage mounting.
| Looks for the filepath in the list of mounts. | # LANGUAGE DataKinds #
module Devops.Parasite (
ParasitedHost (..)
, ParasiteLogin
, ControlledHost (..)
, control
, parasite
, remoted
, fileTransferred
, SshFsMountedDir , sshMounted , sshFileCopy
, FileTransferred
) where
import Control.Applicative ((<|>))
import Da... |
d6f684c87ccb29eae33ce94f3c24f64e1e4bb03e757ca75fc73060a0bd0340c8 | elastic/eui-cljs | set_style_for_restricted_page_width.cljs | (ns eui.set-style-for-restricted-page-width
(:require ["@elastic/eui/lib/components/page/_restrict_width.js" :as eui]))
(def setStyleForRestrictedPageWidth eui/setStyleForRestrictedPageWidth)
(def PAGE_MAX_WIDTH eui/PAGE_MAX_WIDTH)
(def setPropsForRestrictedPageWidth eui/setPropsForRestrictedPageWidth)
| null | https://raw.githubusercontent.com/elastic/eui-cljs/ad60b57470a2eb8db9bca050e02f52dd964d9f8e/src/eui/set_style_for_restricted_page_width.cljs | clojure | (ns eui.set-style-for-restricted-page-width
(:require ["@elastic/eui/lib/components/page/_restrict_width.js" :as eui]))
(def setStyleForRestrictedPageWidth eui/setStyleForRestrictedPageWidth)
(def PAGE_MAX_WIDTH eui/PAGE_MAX_WIDTH)
(def setPropsForRestrictedPageWidth eui/setPropsForRestrictedPageWidth)
| |
a77869089610a4ce0a148337f7003ac9dc6c261993eb2628a0a6a9d19a0d62b5 | flavioc/cl-hurd | file-set-translator.lisp |
(in-package :hurd-translator)
(defun %get-short-circuited-translator (ls)
"Return a symbol denoting the short circuited translator, if that is the case."
(let ((name (first ls)))
(cond
((string= name +hurd-symlink+) :lnk)
((string= name +hurd-chrdev+) :chr)
((string= name +hurd-blkdev+) :blk... | null | https://raw.githubusercontent.com/flavioc/cl-hurd/982232f47d1a0ff4df5fde2edad03b9df871470a/translator/interfaces/file-set-translator.lisp | lisp |
(in-package :hurd-translator)
(defun %get-short-circuited-translator (ls)
"Return a symbol denoting the short circuited translator, if that is the case."
(let ((name (first ls)))
(cond
((string= name +hurd-symlink+) :lnk)
((string= name +hurd-chrdev+) :chr)
((string= name +hurd-blkdev+) :blk... | |
00e6292b533e6d62ca706b68ce79e1c6d77100f6f92d666de54ef8835da39287 | ckirkendall/enfocus | ring.clj | (ns enfocus.ring
(:use ring.middleware.file
ring.handler.dump))
(def app
(wrap-file handle-dump "resources/public"))
| null | https://raw.githubusercontent.com/ckirkendall/enfocus/54ee5d1ec4c1fd603d4766caac07bfc482f65abb/temp/testing/src/enfocus/ring.clj | clojure | (ns enfocus.ring
(:use ring.middleware.file
ring.handler.dump))
(def app
(wrap-file handle-dump "resources/public"))
| |
1badac64bdeca5453d25a24d9df407d01004a116644922dd9725f5f09663176d | r-willis/biten | bootstrap.erl | %%% --------------------------------------------------------------------------
@author <
%%% @doc Bootstrap process. Uses DNS for peer discovery.
%%% @end
%%% --------------------------------------------------------------------------
-module(bootstrap).
-behaviour(gen_server).
%% API
-export([start_link/0, stop... | null | https://raw.githubusercontent.com/r-willis/biten/75b13ea296992f8fa749646b9d7c15c5ef23d94d/apps/biten/src/bootstrap.erl | erlang | --------------------------------------------------------------------------
@doc Bootstrap process. Uses DNS for peer discovery.
@end
--------------------------------------------------------------------------
API
gen_server callbacks
Use module name for registered process
========================================... | @author <
-module(bootstrap).
-behaviour(gen_server).
-export([start_link/0, stop/0]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-define(SERVER, ?MODULE).
-spec start_link() -> pid().
start_link() ->
gen_server:start_link({local, ?SERVER}, ?MODULE, [], [... |
9c4bfb550fca23a6fb3c9d98f7440a9fb7b74aabd2e2b0d3f882bef3621c1f9a | xapi-project/xen-api | gen_empty_custom.ml |
* Copyright ( C ) 2006 - 2009 Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking describe... | null | https://raw.githubusercontent.com/xapi-project/xen-api/4ec6be956b1181619e12b5cd14c70973ef85cb4d/ocaml/idl/ocaml_backend/gen_empty_custom.ml | ocaml | open Api_lowlevel
this flag always forces msg into custom_actions.ml
RW=force both setters and getters into custom_actions
filter out the session_id
debug version has full signature
* 'release' version has the same structures but none of the methods; so
this will cause the compile of the server to fail unl... |
* 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... |
38a0d60506f320efd0500201fd55479fd00d965d4fec95ce419813005f1a23ab | alezost/guix-config | os-32-to-64.scm | ;; This is a simple example of an operating system declaration to move
from a 32 - bit system to a 64 - bit one . See the thread
;; <-devel/2015-05/msg00392.html>
;; for details.
(use-modules
(gnu)
(guix monads)
(guix store)
((guix build utils) #:select (alist-replace))
(guix packages)
(gnu packages linux)
... | null | https://raw.githubusercontent.com/alezost/guix-config/1fb884c7b1225a875537fe2856d3866f817d328b/system-config/os-32-to-64.scm | scheme | This is a simple example of an operating system declaration to move
<-devel/2015-05/msg00392.html>
for details.
Make sure guix-service uses 'guix-x86_64' package. | from a 32 - bit system to a 64 - bit one . See the thread
(use-modules
(gnu)
(guix monads)
(guix store)
((guix build utils) #:select (alist-replace))
(guix packages)
(gnu packages linux)
(gnu packages package-management)
(gnu services base)
(al guix services linux))
(define linux-libre-x86_64
(package
... |
7123d39ff977dd2bbd41602f6183882b4583eef4b7e5a42cc8568a8590e923f3 | c4-project/c4f | replay.ml | This file is part of c4f .
Copyright ( c ) 2018 - 2022 C4 Project
c4 t itself is licensed under the MIT License . See the LICENSE file in the
project root for more information .
Parts of c4 t are based on code from the Herdtools7 project
( ) : see the LICENSE.herd file in the
project... | null | https://raw.githubusercontent.com/c4-project/c4f/8939477732861789abc807c8c1532a302b2848a5/lib/cmd_fuzz/src/replay.ml | ocaml | There's no point exposing the trace here; it'll be the same as the
input one. | This file is part of c4f .
Copyright ( c ) 2018 - 2022 C4 Project
c4 t itself is licensed under the MIT License . See the LICENSE file in the
project root for more information .
Parts of c4 t are based on code from the Herdtools7 project
( ) : see the LICENSE.herd file in the
project... |
e98d7435dda41935d1eb09dea24fcf1545d12d1d60e5b5cae53eff2439b3bf60 | janestreet/bonsai | vdom_examples.ml | open! Core
open! Bonsai_web
(* $MDX part-begin=hello_world *)
let hello_world : Vdom.Node.t = Vdom.Node.text "hello world!"
(* $MDX part-end *)
let () = Util.run_vdom hello_world ~id:"hello_world"
(* $MDX part-begin=bulleted_list *)
let bulleted_list : Vdom.Node.t =
let open Vdom.Node in
div
[ h3 [ text "No... | null | https://raw.githubusercontent.com/janestreet/bonsai/33e9a58fc55ec12095959dc5ef4fd681021c1083/examples/bonsai_guide_code/vdom_examples.ml | ocaml | $MDX part-begin=hello_world
$MDX part-end
$MDX part-begin=bulleted_list
$MDX part-end
$MDX part-begin=input_placeholder
$MDX part-end
$MDX part-begin=css_gen
$MDX part-end
Running side-effects directly inside an event-handler is not ideal, but I
didn't want to take a dependency on "Effect"s before i... | open! Core
open! Bonsai_web
let hello_world : Vdom.Node.t = Vdom.Node.text "hello world!"
let () = Util.run_vdom hello_world ~id:"hello_world"
let bulleted_list : Vdom.Node.t =
let open Vdom.Node in
div
[ h3 [ text "Norwegian Pancakes" ]
; ul
[ li [ text "3 eggs" ]
; li [ text "2 cups of... |
cd59eea1a0e95a62f943162ccc528db1fd0ea0a05b1cfb846b7834cc3002b6bc | gregtatcam/imaplet-lwt | dedup.ml | open Lwt
open Imaplet
open Commands
open Parsemail
open Server_config
module MapStr = Map.Make(String)
let dedup = ref MapStr.empty
let () =
Lwt_main.run (
let config = {srv_config with compress = false;compress_attach = false; encrypt = false } in
Utils.fold_email_with_file Sys.argv.(1) (fun cnt message -... | null | https://raw.githubusercontent.com/gregtatcam/imaplet-lwt/d7b51253e79cffa97e98ab899ed833cd7cb44bb6/test/dedup.ml | ocaml | open Lwt
open Imaplet
open Commands
open Parsemail
open Server_config
module MapStr = Map.Make(String)
let dedup = ref MapStr.empty
let () =
Lwt_main.run (
let config = {srv_config with compress = false;compress_attach = false; encrypt = false } in
Utils.fold_email_with_file Sys.argv.(1) (fun cnt message -... | |
f536c4d99a619e6bbe16f2bd1cef8ac6b00fdb611b3579fbc8654ac718813a8d | marijnh/Postmodern | util.lisp | -*- Mode : LISP ; Syntax : Ansi - Common - Lisp ; Base : 10 ; Package : POSTMODERN ; -*-
(in-package :postmodern)
(defun make-keyword (name)
(values (intern (string-upcase name) "KEYWORD")))
(defun valid-sql-character-p (chr)
"Returns t if chr is letter, underscore, digits or dollar sign"
(or (uax-15:unicode-... | null | https://raw.githubusercontent.com/marijnh/Postmodern/d8c57ef277240535353cee3c478bee34dba2ff1b/postmodern/util.lisp | lisp | Syntax : Ansi - Common - Lisp ; Base : 10 ; Package : POSTMODERN ; -*-
Databases
See namespace.lisp
Sequences
Types
Tables
create table can only be done either using a deftable approach or s-sql
Columns
"
"
Views
Functions
Indices
Keys
Constraints
"
Triggers
Misc that need to be reorganized
\"" | (in-package :postmodern)
(defun make-keyword (name)
(values (intern (string-upcase name) "KEYWORD")))
(defun valid-sql-character-p (chr)
"Returns t if chr is letter, underscore, digits or dollar sign"
(or (uax-15:unicode-letter-p chr)
(digit-char-p chr)
(eq chr #\_)
(eq chr #\$)))
(defun code... |
603c5c466eab8c4667a5bb2a6e1cc98b4390e6bd32f5984be4012f05f1cded95 | ntoronto/pict3d | untyped-pict3d-canvas.rkt | #lang racket/base
(require racket/gui/base
racket/match
racket/list
racket/draw
racket/class
racket/async-channel
racket/math
typed/opengl
"../gl.rkt"
"../utils.rkt"
"parameters.rkt"
"pict3d-struct.rkt"
"pict3d-... | null | https://raw.githubusercontent.com/ntoronto/pict3d/09283c9d930c63b6a6a3f2caa43e029222091bdb/pict3d/private/gui/untyped-pict3d-canvas.rkt | racket | ===================================================================================================
Rendering threads
(: render-thread-loop (-> Void))
Wait for a scene and view matrix
(: cmd render-command)
===================================================================================================
Scene ca... | #lang racket/base
(require racket/gui/base
racket/match
racket/list
racket/draw
racket/class
racket/async-channel
racket/math
typed/opengl
"../gl.rkt"
"../utils.rkt"
"parameters.rkt"
"pict3d-struct.rkt"
"pict3d-... |
acbddc6bcf2e83e0004f8b34f47baa5ca0d371be60b73f83d2e7eb9c2bc688cc | xsc/claro | chain.cljc | (ns claro.data.ops.chain
(:require [claro.data.protocols :as p]
[claro.data.tree
[blocking-composition :refer [->BlockingComposition]]
[composition :as composition :refer [->ResolvableComposition]]
[leaf :refer [->ResolvableLeaf]]]
[claro.data.tree :refer... | null | https://raw.githubusercontent.com/xsc/claro/16db75b7a775a14f3b656362e8ee4f65dd8b0d49/src/claro/data/ops/chain.cljc | clojure | ## Resolved Node
## Chains | (ns claro.data.ops.chain
(:require [claro.data.protocols :as p]
[claro.data.tree
[blocking-composition :refer [->BlockingComposition]]
[composition :as composition :refer [->ResolvableComposition]]
[leaf :refer [->ResolvableLeaf]]]
[claro.data.tree :refer... |
721543921f4f12758b3d196e40e20532f5c58a3cac8ac4e6de4ff20764743c96 | metabase/metabase | util.cljc | (ns metabase.mbql.util
"Utilitiy functions for working with MBQL queries."
(:refer-clojure :exclude [replace])
#?@
(:clj
[(:require
[clojure.string :as str]
[metabase.mbql.predicates :as mbql.preds]
[metabase.mbql.schema :as mbql.s]
[metabase.mbql.schema.helpers :as schema.helpers]
[... | null | https://raw.githubusercontent.com/metabase/metabase/9ac7f26ed92ea0dff3474c0f887040549d2d85ad/shared/src/metabase/mbql/util.cljc | clojure | -> true
-> true"
+----------------------------------------------------------------------------------------------------------------+
| Functions for manipulating queries |
+-------------------------------------------------------------------... | (ns metabase.mbql.util
"Utilitiy functions for working with MBQL queries."
(:refer-clojure :exclude [replace])
#?@
(:clj
[(:require
[clojure.string :as str]
[metabase.mbql.predicates :as mbql.preds]
[metabase.mbql.schema :as mbql.s]
[metabase.mbql.schema.helpers :as schema.helpers]
[... |
80262035cbe1695cad7c00893184c08c3786df61a4c08915ea401ed45be4f555 | iconnect/api-tools | JSON.hs | {-# LANGUAGE BangPatterns #-}
module Data.Binary.Serialise.CBOR.JSON (
cborToJson,
jsonToCbor,
encodeJSON,
decodeJSON,
) where
import Data.API.JSON.Compat
import qualified Data.Aeson as JSON
import qualified Data.Scientific as Scientific
import qualified Data.Vector as... | null | https://raw.githubusercontent.com/iconnect/api-tools/77a8cd4c11b6e1df078e57c8a0c48b8fef3e26e4/src/Data/Binary/Serialise/CBOR/JSON.hs | haskell | # LANGUAGE BangPatterns #
Most of the types in CBOR have direct analogs in JSON. However, some
do not, and someone implementing a CBOR-to-JSON converter has to
consider what to do in those cases. The following non-normative
advice deals with these by converting them to a single substitute
value, such as a JSON n... | module Data.Binary.Serialise.CBOR.JSON (
cborToJson,
jsonToCbor,
encodeJSON,
decodeJSON,
) where
import Data.API.JSON.Compat
import qualified Data.Aeson as JSON
import qualified Data.Scientific as Scientific
import qualified Data.Vector as Vec
import Data.Te... |
d7af51968991b137ade31fd7e73371b052ccf50e62743c69f4885e2d13c0080a | gleber/exat | aclscan.erl | %%
%% aclscan.erl
%% - New acl scanner
%%
%% ----------------------------------------------------------------------
%%
eXAT , an erlang eXperimental Agent Tool
Copyright ( C ) 2005 - 07 ( )
%%
%% This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Publ... | null | https://raw.githubusercontent.com/gleber/exat/a7ccf4807a321934d9a69fada59103f580d7fcce/src/aclscan.erl | erlang |
aclscan.erl
- New acl scanner
----------------------------------------------------------------------
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without ... | eXAT , an erlang eXperimental Agent Tool
Copyright ( C ) 2005 - 07 ( )
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
-module(aclscan).
-export([... |
57556996ec8716f78f52dba2ec692ff73e05518c8b0ac1480f829a96e31b903d | micahasmith/crypto-watch | gdax_history_recorder.clj | (ns crypto.systems.gdax-history-recorder
(:require [crypto.infra.config :refer [get-config]]
[crypto.infra.helpers :refer :all]
[crypto.infra.redis :refer [redis*]]
[crypto.infra.rolling-log :refer [roll!]]
[crypto.services.gdax :as gdax]
[crypto.data.gdax-r... | null | https://raw.githubusercontent.com/micahasmith/crypto-watch/265d03148a018e422513a6daee67cf6e58ac12bf/crypto/src/crypto/systems/gdax_history_recorder.clj | clojure | send gdax output into the log writer
kick off the history-writer
kick off the service
return a map of closeable/disposable things
return that we had success
return fn that is the closer
(def a (-start!)) | (ns crypto.systems.gdax-history-recorder
(:require [crypto.infra.config :refer [get-config]]
[crypto.infra.helpers :refer :all]
[crypto.infra.redis :refer [redis*]]
[crypto.infra.rolling-log :refer [roll!]]
[crypto.services.gdax :as gdax]
[crypto.data.gdax-r... |
a5d6cb633e2b90aa6473f5a438d23bd2df40dc78a2841ba4d3ff369b1aefffd6 | barrel-db/rebar3_elixir_compile | rebar3_elixir_compile_resource.erl | -module(rebar3_elixir_compile_resource).
-behaviour(rebar_resource).
-define(DEFAULT_CDN_SITE, "").
-define(CDN_TARBALL_LOCATION, "/tarballs").
-export([lock/2
,download/3
,needs_update/2
,make_vsn/1]).
lock(_Dir, {elixir, Name, Vsn}) ->
{elixir, rebar3_elixir_compile_util:to_binary(Nam... | null | https://raw.githubusercontent.com/barrel-db/rebar3_elixir_compile/2bc219a9feaa77362523808096f226de805857e8/src/rebar3_elixir_compile_resource.erl | erlang | -module(rebar3_elixir_compile_resource).
-behaviour(rebar_resource).
-define(DEFAULT_CDN_SITE, "").
-define(CDN_TARBALL_LOCATION, "/tarballs").
-export([lock/2
,download/3
,needs_update/2
,make_vsn/1]).
lock(_Dir, {elixir, Name, Vsn}) ->
{elixir, rebar3_elixir_compile_util:to_binary(Nam... | |
d8ffc294eae2e7c3f7862d419dcca98acedc592667b2893628c090a9ec69be0d | wdhowe/clojure-snippets | comparisons.clj | (ns clojure.examples.comparisons (:gen-class))
(defn do-compare
[]
(println "Equality:" (= 7 7))
(println "Not Equality:" (not= 7 7))
(println "Less than:" (< 7 8))
(println "Greater than:" (> 7 8))
(println "And op:" (and true false))
(println "Or op:" (or true false))
(println "Not op:" (not false)))... | null | https://raw.githubusercontent.com/wdhowe/clojure-snippets/0c3247ce99a563312b549d03f080b8cf449b541d/basic_syntax/comparisons.clj | clojure | (ns clojure.examples.comparisons (:gen-class))
(defn do-compare
[]
(println "Equality:" (= 7 7))
(println "Not Equality:" (not= 7 7))
(println "Less than:" (< 7 8))
(println "Greater than:" (> 7 8))
(println "And op:" (and true false))
(println "Or op:" (or true false))
(println "Not op:" (not false)))... | |
3d212212c6d4f356acce2f142f3d738092a6f10f24680d66a2ca8b6676edfb30 | coq/coq | autorewrite.ml | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/c1bf187bdd7a7b660692a97e0a36c6bf1acd0647/tactics/autorewrite.ml | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
0edc263f6457361cde39429805a05a4cfb327ec68d8eecfc7d513b4610902fd8 | engstrand-config/guix-dotfiles | documents.scm | (define-module (engstrand features documents)
#:use-module (guix gexp)
#:use-module (rde features)
#:use-module (rde features predicates)
#:use-module (gnu packages pdf)
#:use-module (gnu services)
#:use-module (guix packages)
#:use-module (gnu home services)
#:use-module (gnu packages tex)
#:use-modu... | null | https://raw.githubusercontent.com/engstrand-config/guix-dotfiles/1b17ea2732baea38b9ed19a3c18eed850acd175c/engstrand/features/documents.scm | scheme | for linking to installed plugins. Therefore, you will need to restart
the session after installing for the plugin to be loaded correctly. | (define-module (engstrand features documents)
#:use-module (guix gexp)
#:use-module (rde features)
#:use-module (rde features predicates)
#:use-module (gnu packages pdf)
#:use-module (gnu services)
#:use-module (guix packages)
#:use-module (gnu home services)
#:use-module (gnu packages tex)
#:use-modu... |
e2f3dc1aa7a51699f4e42773ef6fcf442c8e08fb253fbeef410292445f5e89c3 | racket/racket7 | struct.rkt | #lang racket/base
(require "private/custom-write.rkt"
racket/contract/base)
(provide (contract-out
[make-constructor-style-printer
(-> (-> any/c (or/c symbol? string?))
(-> any/c sequence?)
(-> any/c output-port? (or/c #t #f 0 1) void?))])
struct->lis... | null | https://raw.githubusercontent.com/racket/racket7/5dbb62c6bbec198b4a790f1dc08fef0c45c2e32b/racket/collects/racket/struct.rkt | racket | struct->list : struct?
#:on-opaque (or/c 'error 'return-false 'skip)
go through vector backwards, don't traverse 0 (struct name) | #lang racket/base
(require "private/custom-write.rkt"
racket/contract/base)
(provide (contract-out
[make-constructor-style-printer
(-> (-> any/c (or/c symbol? string?))
(-> any/c sequence?)
(-> any/c output-port? (or/c #t #f 0 1) void?))])
struct->lis... |
c698d57281db9436de2edc49f78092e6df28680aaa40aa7c7d553efd7c2d1240 | simmone/racket-simple-xlsx | date-read-and-write-test.rkt | #lang racket
(require rackunit/text-ui rackunit)
(require racket/date)
(require "../../../main.rkt")
(require racket/runtime-path)
(define-runtime-path date_write_file "date_write.xlsx")
(define-runtime-path date_read_and_write_file "date_read_and_write.xlsx")
(define test-writer
(test-suite
"test-writer"
... | null | https://raw.githubusercontent.com/simmone/racket-simple-xlsx/e0ac3190b6700b0ee1dd80ed91a8f4318533d012/simple-xlsx/tests/write-and-read/date/date-read-and-write-test.rkt | racket | (void) | #lang racket
(require rackunit/text-ui rackunit)
(require racket/date)
(require "../../../main.rkt")
(require racket/runtime-path)
(define-runtime-path date_write_file "date_write.xlsx")
(define-runtime-path date_read_and_write_file "date_read_and_write.xlsx")
(define test-writer
(test-suite
"test-writer"
... |
9d6b6522bdbb6978dbbb6b0d2dcf41a7c96d2c6913f18b3fe8e1566c6c29246d | hypernumbers/hypernumbers | hnfuns_bootstrap.erl | @author
( C ) 2012 - 2014 , Hypernumbers Ltd
%%% @doc Make Bootstrap components available
%%%
%%% @end
Created : 19 May 2012 by
%%%-------------------------------------------------------------------
%%%
%%% LICENSE
%%%
%%% This program is free software: you can redistribute it and/or modify
it un... | null | https://raw.githubusercontent.com/hypernumbers/hypernumbers/281319f60c0ac60fb009ee6d1e4826f4f2d51c4e/lib/formula_engine-1.0/src/hnfuns_bootstrap.erl | erlang | @doc Make Bootstrap components available
@end
-------------------------------------------------------------------
LICENSE
This program is free software: you can redistribute it and/or modify
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implie... | @author
( C ) 2012 - 2014 , Hypernumbers Ltd
Created : 19 May 2012 by
it under the terms of the GNU Affero General Public License as
published by the Free Software Foundation version 3
You should have received a copy of the GNU Affero General Public License
-module(hnfuns_bootstrap).
-export([
... |
8d5c78d3f567b0c3b932c1681e04fa243839f460b4b731c3aab88bb2f2efb3ac | gothinkster/clojurescript-keechma-realworld-example-app | user_actions.cljs | (ns app.controllers.guest.user-actions
(:require [keechma.next.controller :as ctrl]
[keechma.next.controllers.pipelines :as pipelines]
[keechma.pipelines.core :refer-macros [pipeline!]]
[keechma.next.controllers.router :as router]))
(derive :guest/user-actions ::pipelines/controll... | null | https://raw.githubusercontent.com/gothinkster/clojurescript-keechma-realworld-example-app/f6d32f8eea5439b0b33df1afb89da6d27b7da66b/src/app/controllers/guest/user_actions.cljs | clojure | (ns app.controllers.guest.user-actions
(:require [keechma.next.controller :as ctrl]
[keechma.next.controllers.pipelines :as pipelines]
[keechma.pipelines.core :refer-macros [pipeline!]]
[keechma.next.controllers.router :as router]))
(derive :guest/user-actions ::pipelines/controll... | |
86a49b2228491fce4a161a076521fbb70be892fab2477f5c1f3ae27578073c0b | malcolmreynolds/GSLL | dilogarithm.lisp | Regression test DILOGARITHM for GSLL , automatically generated
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST DILOGARITHM
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 1.6449340668482264d0 7.304974700020789d-16)
(MULTIPLE-VALUE-LIST (DILOGARITHM 1.0d0)))
... | null | https://raw.githubusercontent.com/malcolmreynolds/GSLL/2f722f12f1d08e1b9550a46e2a22adba8e1e52c4/tests/dilogarithm.lisp | lisp | Regression test DILOGARITHM for GSLL , automatically generated
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST DILOGARITHM
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST 1.6449340668482264d0 7.304974700020789d-16)
(MULTIPLE-VALUE-LIST (DILOGARITHM 1.0d0)))
... | |
30584248d6d48717392bb1d3b6dcf4324adf429b405a12a6f92921b00f0d4ae3 | clj-commons/cljss | user.clj | (ns user
(:require [figwheel-sidecar.repl-api :as f]))
(defn start! [id]
(f/start-figwheel! id)
(f/cljs-repl))
(defn stop! []
(f/stop-figwheel!))
| null | https://raw.githubusercontent.com/clj-commons/cljss/d2856688cf650babe518c798cf20e6bdb4227bb7/example/dev/user.clj | clojure | (ns user
(:require [figwheel-sidecar.repl-api :as f]))
(defn start! [id]
(f/start-figwheel! id)
(f/cljs-repl))
(defn stop! []
(f/stop-figwheel!))
| |
b6b10d7e6a7ea03e7ae553a2efc8e671a2e6f2a3b88b3b83a0bc4befeb699209 | projectcs13/sensor-cloud | vstreams_tests.erl | @author
%% [www.csproj13.student.it.uu.se]
%% @version 1.0
[ Copyright information ]
%%
%% @doc == datapoints_tests ==
%% This module contains several tests to test
%% the virtual streams functionality.
%%
%% @end
-module(vstreams_tests).
-include_lib("eunit/include/eunit.hrl").
-define(WEBMACHINE_URL, api_he... | null | https://raw.githubusercontent.com/projectcs13/sensor-cloud/0302bd74b2e62fddbd832fb4c7a27b9c62852b90/test/vstreams_tests.erl | erlang | [www.csproj13.student.it.uu.se]
@version 1.0
@doc == datapoints_tests ==
This module contains several tests to test
the virtual streams functionality.
@end
@doc
Function: init_test/0
Purpose: Used to start the inets to be able to do HTTP requests
Returns: ok | {error, term()}
Side effects: Start inets
@... | @author
[ Copyright information ]
-module(vstreams_tests).
-include_lib("eunit/include/eunit.hrl").
-define(WEBMACHINE_URL, api_help:get_webmachine_url()).
-define(STREAMS_URL, ?WEBMACHINE_URL ++ "/streams/").
-define(VSTREAMS_URL, ?WEBMACHINE_URL ++ "/vstreams/").
-define(VSDATAPOINTS_URL, ?WEBMACHINE_URL ++ ... |
7486cf6f5821019d1d8406b96f1ea6367ac4cb226528cac7b32f90812e338b9f | stchang/macrotypes | rackunit-typechecking.rkt | #lang racket/base
(require (for-syntax rackunit syntax/srcloc racket/pretty racket/string racket/port)
rackunit macrotypes/typecheck-core
(only-in macrotypes/typecheck infer+erase))
(provide check-type typecheck-fail check-not-type check-props check-runtime-exn
check-equal/rand typecheck-fai... | null | https://raw.githubusercontent.com/stchang/macrotypes/05ec31f2e1fe0ddd653211e041e06c6c8071ffa6/rackunit-macrotypes-lib/rackunit/rackunit-typechecking.rkt | racket | duplicate code to avoid redundant expansions
count this test case in the test count
for checking properties other than types
count this test case in the test count
check err msg matches
swallow stderr
count this test case in the test count | #lang racket/base
(require (for-syntax rackunit syntax/srcloc racket/pretty racket/string racket/port)
rackunit macrotypes/typecheck-core
(only-in macrotypes/typecheck infer+erase))
(provide check-type typecheck-fail check-not-type check-props check-runtime-exn
check-equal/rand typecheck-fai... |
b301ae1020c4e58e39b01add8127f80b6943227eaccb0e70000e99b62a7233f3 | dongcarl/guix | shellutils.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2016 < >
Copyright © 2016 , 2017 < >
Copyright © 2016 < >
Copyright © 2017 < >
Copyright © 2018 , 2020 < >
Copyright © 2018 < >
Copyright © 2019 < >
Copyright © 2020 < >
Copyright © 2020 aecepoglu < >
Copy... | null | https://raw.githubusercontent.com/dongcarl/guix/d2b30db788f1743f9f8738cb1de977b77748567f/gnu/packages/shellutils.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2016 < >
Copyright © 2016 , 2017 < >
Copyright © 2016 < >
Copyright © 2017 < >
Copyright © 2018 , 2020 < >
Copyright © 2018 < >
Copyright © 2019 < >
Copyright © 2020 < >
Copyright © 2020 aecepoglu < >
Copyright © 2020 < >
Copyright © 2021 < >
under t... |
e91344f0c17ea527bc092a52ef14e8e21f713b8457330bc3705f7dcdd3a9abba | jordanthayer/ocaml-search | optimistic_search.ml | (** Optimistic Search *)
type 'a node = {
mutable fp : float;
h : float;
mutable g : float;
mutable ppos : int;
mutable fpos: int;
mutable dpos: int;
data : 'a;
}
let ordered_f a b =
(** are nodes [a] and [b] in order of increasing f? *)
let af = a.g +. a.h
and bf = b.g +. b.h in
af < bf ||... | null | https://raw.githubusercontent.com/jordanthayer/ocaml-search/57cfc85417aa97ee5d8fbcdb84c333aae148175f/search/optimistic/optimistic_search.ml | ocaml | * Optimistic Search
* are nodes [a] and [b] in order of increasing f?
* is [a] a better solution than [b]
* returns the f position of node a
* returns the delayed position of node [a]
* returns the open position of node [a]
* sets the cleanup position of node [a] to [i]
* sets the open position of node [a] to [i... |
type 'a node = {
mutable fp : float;
h : float;
mutable g : float;
mutable ppos : int;
mutable fpos: int;
mutable dpos: int;
data : 'a;
}
let ordered_f a b =
let af = a.g +. a.h
and bf = b.g +. b.h in
af < bf ||
(af = bf &&
a.g >= b.g)
let ordered_p a b =
* are [ a ] and [ b ] in b... |
97d16aa63697ef80c2f1f24c40817606583c6dd8b021f34fd3cba26a887a0a6d | anmonteiro/ocaml-h2 | h2_async.ml | ----------------------------------------------------------------------------
* Copyright ( c ) 2018 Inhabited Type LLC .
* Copyright ( c ) 2019 - 2020 .
*
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted prov... | null | https://raw.githubusercontent.com/anmonteiro/ocaml-h2/5a71d3acbfb081024b1412eb2f867cfd4db9d10e/async/h2_async.ml | ocaml | ----------------------------------------------------------------------------
* Copyright ( c ) 2018 Inhabited Type LLC .
* Copyright ( c ) 2019 - 2020 .
*
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted prov... | |
35427e3226ac8e58cbedeae0eddf1f026a0134643e2a9620d72d250fdf7cc451 | deedy/Custom-Scheme-Interpreter | eval.ml | open Ast
open Heap
open Util
let rec eval (ast : expr) (env : env) : value =
match ast with
| Int_e n -> Int n
| Str_e s -> Str s
| Bool_e b -> Bool b
| Def_e _ -> runtime "define may occur at top level only"
| Defrec_e _ -> runtime "definerec may occur at top level only"
| Nil_e -> Nil
| Id_e id -> (m... | null | https://raw.githubusercontent.com/deedy/Custom-Scheme-Interpreter/ad49612f809e54eb48f5a3af3428022856574b77/eval.ml | ocaml | open Ast
open Heap
open Util
let rec eval (ast : expr) (env : env) : value =
match ast with
| Int_e n -> Int n
| Str_e s -> Str s
| Bool_e b -> Bool b
| Def_e _ -> runtime "define may occur at top level only"
| Defrec_e _ -> runtime "definerec may occur at top level only"
| Nil_e -> Nil
| Id_e id -> (m... | |
6f43a5c0cbc46d8829b95c64da5f3f04eb54ecdc3c7fcbafe5a39b10f57dd5a6 | returntocorp/semgrep | ruby_log.ml | open Format
type pos = Lexing.position
type ctx =
| Ctx_Empty
| Ctx_Pos of pos * ctx
| Ctx_Msg of string * ctx
| Ctx_Merge of ctx * ctx
let empty = Ctx_Empty
let loc pos ctx = Ctx_Pos (pos, ctx)
let of_loc pos = loc pos Ctx_Empty
let of_tok _x = raise Common.Todo
let msg str ctx = Ctx_Msg (str, ctx)
let of_m... | null | https://raw.githubusercontent.com/returntocorp/semgrep/00f1e67bbb80f00e29db3381288fc00398b6868a/languages/ruby/dyp/ruby_log.ml | ocaml | (Format.pp_get_margin std_formatter ())
Filename.basename
conf.debug_level >= i
let fake_ppf = make_formatter (fun s pos len -> ()) (fun () -> ())
prime
conf.no_dup_errors
conf.no_dup_errors
conf.print_error_ctx <- true; | open Format
type pos = Lexing.position
type ctx =
| Ctx_Empty
| Ctx_Pos of pos * ctx
| Ctx_Msg of string * ctx
| Ctx_Merge of ctx * ctx
let empty = Ctx_Empty
let loc pos ctx = Ctx_Pos (pos, ctx)
let of_loc pos = loc pos Ctx_Empty
let of_tok _x = raise Common.Todo
let msg str ctx = Ctx_Msg (str, ctx)
let of_m... |
1c3f995d223696de6b652a16b3d9bc886417038edeb36e07f6d319b7fe05bcb8 | cronokirby/haze | TieredList.hs | |
Description : Contains functions and utilities for TieredLists
Description: Contains functions and utilities for TieredLists
-}
module Data.TieredList
( TieredList
, makeTieredList
, tieredSingleton
, popTiered
)
where
import Relude
-- | Represents a list of tiers of equal prior... | null | https://raw.githubusercontent.com/cronokirby/haze/3cfbc9de8d923a541429f4a5cb1eb4151d5aea08/src/Data/TieredList.hs | haskell | | Represents a list of tiers of equal priority
| Make a Tiered list from a list of tiers
| Make a tiered list with a single item
| Pop off the highest priority element from a tiered list.
Returns Nothing if the list is null
| |
Description : Contains functions and utilities for TieredLists
Description: Contains functions and utilities for TieredLists
-}
module Data.TieredList
( TieredList
, makeTieredList
, tieredSingleton
, popTiered
)
where
import Relude
newtype TieredList a = TieredList [[a]]
de... |
50ab8c90ff0d3e89249ae57cc5ea2e028e8b58dd8883c17cb8c5a7ba452b77b2 | ocaml/dune | vcs_tests.ml | open Stdune
open Dune_engine
open Fiber.O
open! Dune_tests_common
module Config = Dune_util.Config
let () = init ()
let printf = Printf.printf
let temp_dir = lazy (Path.of_string "vcs-tests")
let () = at_exit (fun () -> Path.rm_rf (Lazy.force temp_dir))
(* When hg is not available, we test with git twice indeed. T... | null | https://raw.githubusercontent.com/ocaml/dune/5463cd87c573c28c71d513fbecd8cb17dbdb27b7/test/expect-tests/vcs_tests.ml | ocaml | When hg is not available, we test with git twice indeed. This is because many
people don't have hg installed. | open Stdune
open Dune_engine
open Fiber.O
open! Dune_tests_common
module Config = Dune_util.Config
let () = init ()
let printf = Printf.printf
let temp_dir = lazy (Path.of_string "vcs-tests")
let () = at_exit (fun () -> Path.rm_rf (Lazy.force temp_dir))
let has_hg =
match Lazy.force Vcs.hg with
| (_ : Path.t) ... |
09f7b6b6626cb9ccdba82f7252788a9f1d90d4e86488f81bfa2ea5b29df5d7ac | Phaetec/pogo-cruncher | views.cljs | (ns cruncher.utils.views
"Reusable components, which use twitter bootstrap to reduce redundancy."
(:require [om.next :as om :refer-macros [defui]]
[om.dom :as dom :include-macros true]
[goog.dom :as gdom]
[cruncher.utils.lib :as lib]))
(defn commit-component-state
"Set local s... | null | https://raw.githubusercontent.com/Phaetec/pogo-cruncher/a93bd16cc4d118d2ec57c2a641bd1b11be0d133d/frontend/src/cruncher/utils/views.cljs | clojure | Table stuff
Bootstrap
Selections
UIs
"Spinning icon to indicate if there is data being transferred." | (ns cruncher.utils.views
"Reusable components, which use twitter bootstrap to reduce redundancy."
(:require [om.next :as om :refer-macros [defui]]
[om.dom :as dom :include-macros true]
[goog.dom :as gdom]
[cruncher.utils.lib :as lib]))
(defn commit-component-state
"Set local s... |
1053afb70f5dcb7c19dc4d3fbcc475807d9001b9f60bf5269630198394997540 | jeffa5/mirage-xmpp | performance.ml | open Cmdliner
let run_python_stats file =
let%lwt () = Lwt_io.printl @@ "PYTHON: Running stats on file: " ^ file in
let%lwt _ = Lwt_unix.system @@ "python test/performance/stats.py --save " ^ file in
Lwt_io.printl "PYTHON: Finished stats"
;;
let run_command_with_output command =
let command = Lwt_process.shel... | null | https://raw.githubusercontent.com/jeffa5/mirage-xmpp/df3dafecba9081880809d8649ed0727b9f6a9dc7/test/performance/performance.ml | ocaml | get the log file location
separate the input file to the name of the xml file
remove the file extension
copy the dump file to a new location with servername, xml file and time to identify it: servername-xmlfile-time.dump
Command line parsing | open Cmdliner
let run_python_stats file =
let%lwt () = Lwt_io.printl @@ "PYTHON: Running stats on file: " ^ file in
let%lwt _ = Lwt_unix.system @@ "python test/performance/stats.py --save " ^ file in
Lwt_io.printl "PYTHON: Finished stats"
;;
let run_command_with_output command =
let command = Lwt_process.shel... |
2efcbe664a06e22c63892eca1b228d9ea4fb207aa11cc953ca809818ceb81461 | jeffshrager/biobike | process-interface.lisp | ;;; -*- mode: Lisp; Syntax: Common-Lisp; Package: wb; -*-
(in-package :wb)
;;; +=========================================================================+
| Copyright ( c ) 2002 , 2003 , 2004 JP , , |
;;; | |
;;; | Permission is hereby... | null | https://raw.githubusercontent.com/jeffshrager/biobike/5313ec1fe8e82c21430d645e848ecc0386436f57/BioLisp/Portability/process-interface.lisp | lisp | -*- mode: Lisp; Syntax: Common-Lisp; Package: wb; -*-
+=========================================================================+
| |
| Permission is hereby granted, free of charge, to any person obtaining |
| a copy of this software and ass... |
(in-package :wb)
| Copyright ( c ) 2002 , 2003 , 2004 JP , , |
| " Software " ) , to deal in the Software without restriction , including |
| distribute , sublicense , and/or sell copies of the Software , and to |
| permit persons to whom the Software is furnished to do so , subject to ... |
7e2f0e786dc97f3c4103211ca1e9b1122c3d370d7b7a2534d1f4908bc90566f9 | bgusach/exercises-htdp2e | ex-183.rkt | #lang htdp/bsl+
(require test-engine/racket-tests)
(check-expect
(cons "a" (list 0 #false))
(list "a" 0 #false)
)
(check-expect
(cons "a" (list 0 #false))
(cons "a" (cons 0 (cons #false '())))
)
(check-expect
(list (cons 1 (cons 13 '())))
(list (list 1 13))
)
(check-expect
(list (cons 1 (co... | null | https://raw.githubusercontent.com/bgusach/exercises-htdp2e/c4fd33f28fb0427862a2777a1fde8bf6432a7690/2-arbitrarily-large-data/ex-183.rkt | racket | #lang htdp/bsl+
(require test-engine/racket-tests)
(check-expect
(cons "a" (list 0 #false))
(list "a" 0 #false)
)
(check-expect
(cons "a" (list 0 #false))
(cons "a" (cons 0 (cons #false '())))
)
(check-expect
(list (cons 1 (cons 13 '())))
(list (list 1 13))
)
(check-expect
(list (cons 1 (co... | |
4a40c957b406d7c249bfbef2149e9d8d822f424c2ca80c61a4db07e6e81dd8e3 | astrolin/ephemeris-api | project.clj | (defproject ephemeris-api "0.0.1-SNAPSHOT"
:description "Ephemeris HTTP API"
due to lein - immutant
:dependencies [[org.clojure/clojure "1.10.1"]
[ephemeris "0.0.1"]
[prismatic/schema "1.1.12"]
[pedestal-api "0.3.4" :exclusions [prismatic/schema]]
... | null | https://raw.githubusercontent.com/astrolin/ephemeris-api/f910c4e2e3dbfc62799fad4e3af5684eb3ba9016/project.clj | clojure | for dev
for prod
ephemeris-api v[ersion]
keep the trailing / | (defproject ephemeris-api "0.0.1-SNAPSHOT"
:description "Ephemeris HTTP API"
due to lein - immutant
:dependencies [[org.clojure/clojure "1.10.1"]
[ephemeris "0.0.1"]
[prismatic/schema "1.1.12"]
[pedestal-api "0.3.4" :exclusions [prismatic/schema]]
... |
59d4b275ae59620d59ad6b2a02df2245e35fff09635849a45d1270ba54b38dd5 | wireapp/wire-server | Roles.hs | -- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License... | null | https://raw.githubusercontent.com/wireapp/wire-server/7f6a2903f2435736b9a498a853a48c3c5abdfb8d/services/galley/test/integration/API/Roles.hs | haskell | This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
later version.
This program is distributed in the hope that it will be useful, but WITHOUT
ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTI... | Copyright ( C ) 2022 Wire Swiss GmbH < >
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option ) any
You should have received a copy of the GNU Affero General Public License along
module API.Roles where
import A... |
44f59cbc92fab2fcd627e965640925231f94a35df7d1effea256073f6c7059ca | jabber-at/ejabberd | example_tests.erl | %%%-------------------------------------------------------------------
Author : < >
Created : 16 Nov 2016 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2017 ProcessOne
%%%
%%% This program is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License ... | null | https://raw.githubusercontent.com/jabber-at/ejabberd/7bfec36856eaa4df21b26e879d3ba90285bad1aa/test/example_tests.erl | erlang | -------------------------------------------------------------------
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHA... | Author : < >
Created : 16 Nov 2016 by < >
ejabberd , Copyright ( C ) 2002 - 2017 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License along
... |
c3ee8c6f02f69d0009289fcfa59766dcd01ea607baa59151310c4e73ad4d99f3 | seereason/logic-classes | Meson.hs | # LANGUAGE FlexibleContexts , OverloadedStrings , RankNTypes , ScopedTypeVariables , TypeFamilies #
# OPTIONS_GHC -Wall #
module Harrison.Meson where
import Control.Applicative.Error (Failing(..))
import qualified Data.Map as Map
import qualified Data.Set as Set
import FOL (pApp)
import Formulas ((.&.), (.=>.), (.|.))... | null | https://raw.githubusercontent.com/seereason/logic-classes/819059218027c3ee77bd2ef3a873fcca230d54b4/Tests/Harrison/Meson.hs | haskell | -------------------------------------------------------------------------
Example.
------------------------------------------------------------------------- | # LANGUAGE FlexibleContexts , OverloadedStrings , RankNTypes , ScopedTypeVariables , TypeFamilies #
# OPTIONS_GHC -Wall #
module Harrison.Meson where
import Control.Applicative.Error (Failing(..))
import qualified Data.Map as Map
import qualified Data.Set as Set
import FOL (pApp)
import Formulas ((.&.), (.=>.), (.|.))... |
d0084c3a9cb10e0fb3c9133284ec82c7f90b19d3443456e27d63337130c472f9 | TrueBoxGuy/Iocularia | Scope.hs | |
Module : Transpiler . Scope
Description : Scope helper functions
License : Apache License 2.0
Stability : experimental
Contains helpers for differentiating the behaviour conversions have on bound and unbound variables .
Furthermore , this module enables for inlined variables .
Module ... | null | https://raw.githubusercontent.com/TrueBoxGuy/Iocularia/5def65d2d21c33c5c09462a2015a64848f6f4f41/src/Transpiler/Scope.hs | haskell | | Term that can refer to either the global scope or a bound variable.
^ Inner scope, referring to the term instantiated by a lambda at a certain depth.
^ The global scope, which contains all variables that aren't inlined.
| Converts an expression containing only bound variables to a scoped expression.
to access bi... | |
Module : Transpiler . Scope
Description : Scope helper functions
License : Apache License 2.0
Stability : experimental
Contains helpers for differentiating the behaviour conversions have on bound and unbound variables .
Furthermore , this module enables for inlined variables .
Module ... |
47bd3c10006220cecccb69a457f7f0acb5e7711a0569176c985a7c8ff48050cb | mattdw/stemmers | core.clj | (ns stemmers.test.core
(:use [stemmers.core] :reload)
(:use [clojure.test]))
(deftest basic-tokenise
(is (= (tokenise "nothing ever happens")
["nothing" "ever" "happens"])))
(deftest default-stem
(is (= (stems "the hungry dog hungrily jumped over the angry moon with a hunger, jumping with anger.")
... | null | https://raw.githubusercontent.com/mattdw/stemmers/7a29b412352ebb604058b357ba332a8b53d0565f/test/stemmers/test/core.clj | clojure | (ns stemmers.test.core
(:use [stemmers.core] :reload)
(:use [clojure.test]))
(deftest basic-tokenise
(is (= (tokenise "nothing ever happens")
["nothing" "ever" "happens"])))
(deftest default-stem
(is (= (stems "the hungry dog hungrily jumped over the angry moon with a hunger, jumping with anger.")
... | |
6e50d59ed450deabb8164591167d5921e0e417bd1e5db1dec7262e7c633fdb9a | zenspider/schemers | exercise.4.60.scm | #!/usr/bin/env csi -s
(require rackunit)
(require-library logic-eval)
(import logic-eval)
(initialize-data-base microshaft-data-base)
Exercise 4.60
;; By giving the query
;;
( lives - near ? person ( Hacker ) )
;;
is able to find people who live near her , with
;; whom she can ride to work. On the o... | null | https://raw.githubusercontent.com/zenspider/schemers/2939ca553ac79013a4c3aaaec812c1bad3933b16/sicp/ch_4/exercise.4.60.scm | scheme | By giving the query
whom she can ride to work. On the other hand, when she tries to
find all pairs of people who live near each other by querying
(lives-near ?person-1 ?person-2)
she notices that each pair of people who live near each other is
listed twice; for example,
Why does this happen? Is ther... | #!/usr/bin/env csi -s
(require rackunit)
(require-library logic-eval)
(import logic-eval)
(initialize-data-base microshaft-data-base)
Exercise 4.60
( lives - near ? person ( Hacker ) )
is able to find people who live near her , with
( lives - near ( Hacker ) ( ) )
( lives - near ( ... |
ef2a9028a3d75e75fcb80561b273e950b66f29f382f48c8e23ff3ef7e2bdc3b3 | AeneasVerif/aeneas | Utils.ml | include Charon.Utils
| null | https://raw.githubusercontent.com/AeneasVerif/aeneas/d8d661d02cf0068753ae3963156896492dfde50a/compiler/Utils.ml | ocaml | include Charon.Utils
| |
6ee0447b46de8e5a0813ec3742a52cc0f00b6319f8e810b52e117b0c447fd64b | clojure-interop/java-jdk | BasicCheckBoxUI.clj | (ns javax.swing.plaf.basic.BasicCheckBoxUI
"CheckboxUI implementation for BasicCheckboxUI
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version... | null | https://raw.githubusercontent.com/clojure-interop/java-jdk/8d7a223e0f9a0965eb0332fad595cf7649d9d96e/javax.swing/src/javax/swing/plaf/basic/BasicCheckBoxUI.clj | clojure | (ns javax.swing.plaf.basic.BasicCheckBoxUI
"CheckboxUI implementation for BasicCheckboxUI
Warning:
Serialized objects of this class will not be compatible with
future Swing releases. The current serialization support is
appropriate for short term storage or RMI between applications running
the same version... | |
fda619ad70cdcef252c8b2d0197294a0b007ab47d833429e492f6e5b35615162 | lambdabot/lambdabot | Instances.hs | | A module to output the instances of a typeclass .
Some sample input\/output :
> > @instances Monad
> [ ] , ArrowMonad a , WriterT w m , , ReaderT r m , Reader r ,
> StateT s m , State s , RWST r w s m , RWS r w s , ErrorT e m , Either e ,
, Cont r , Maybe , ST s , IO
>
> > @instances Sho... | null | https://raw.githubusercontent.com/lambdabot/lambdabot/de01f362c7a8fc6f85c37e604168dcccb1283a0e/lambdabot-haskell-plugins/src/Lambdabot/Plugin/Haskell/Instances.hs | haskell | | Nice little combinator used to throw away error messages from an Either
and just keep a Maybe indicating the success of the computation.
* Parsing
| Parse an instance declaration. Sample inputs:
> instance (Monoid w) => Monad (Writer w)
break on the "imported from" comment or a newline.
| Wrapper for the ... | | A module to output the instances of a typeclass .
Some sample input\/output :
> > @instances Monad
> [ ] , ArrowMonad a , WriterT w m , , ReaderT r m , Reader r ,
> StateT s m , State s , RWST r w s m , RWS r w s , ErrorT e m , Either e ,
, Cont r , Maybe , ST s , IO
>
> > @instances Sho... |
96697d55c23e32b4528f33c532fec35627e5838a231f9fecef7041c8f6c4a055 | bazurbat/chicken-scheme | makedist.scm | ;;;; makedist.scm - Make distribution tarballs
(use srfi-69 irregex srfi-1 setup-api)
(define *release* #f)
(define *help* #f)
(define BUILDVERSION (with-input-from-file "buildversion" read))
(define *platform*
(let ((sv (symbol->string (software-version))))
(cond ((irregex-match ".*bsd" sv) "bsd")
(else... | null | https://raw.githubusercontent.com/bazurbat/chicken-scheme/f0c9d1fd8b68eb322e320e65ec40b0bf7d1b41dc/scripts/makedist.scm | scheme | makedist.scm - Make distribution tarballs |
(use srfi-69 irregex srfi-1 setup-api)
(define *release* #f)
(define *help* #f)
(define BUILDVERSION (with-input-from-file "buildversion" read))
(define *platform*
(let ((sv (symbol->string (software-version))))
(cond ((irregex-match ".*bsd" sv) "bsd")
(else
(case (build-platform)
((mingw32)
... |
3758920734913feaa71228a90ad96bd0335ce45deb2e92dbcaad089e8616e406 | jvf/scalaris | rr_recon_stats.erl | 2011 - 2012 Zuse Institute Berlin
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
di... | null | https://raw.githubusercontent.com/jvf/scalaris/c069f44cf149ea6c69e24bdb08714bda242e7ee0/src/rrepair/rr_recon_stats.erl | erlang | you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language gov... | 2011 - 2012 Zuse Institute Berlin
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@author < >
-module(rr_recon_stats).
-author('').
-vsn('$Id$').
-include("scalaris.hrl").
-include("record_helpers.hrl").
-expo... |
4fc6375d27ffced53faa8dd81f16962967b00a6f08ddc7c96abd97ba85339f46 | facebook/flow | checkedSet.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/flow/741104e69c43057ebd32804dd6bcc1b5e97548ea/src/common/utils/checked_set/checkedSet.ml | ocaml | A file foo.js can be focused, a dependent, and a dependency all at the same time. However, in
* CheckedSet.t, we just keep track of its most important role. A focused file is more important
* than a dependent file, which is more important than a dependency file
This uses polymorphic compare. Use caution if `kind` ... |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
99a4bc3179a046486c3c38ebf1bdd0c1b6c03d8ce641cd6a9f729a7114b44bff | ktakashi/sagittarius-scheme | convert.scm | -*- mode : scheme ; coding : utf-8 -*-
;;;
;;; text/markdown/convert.scm - Converter for parsed markdown
;;;
Copyright ( c ) 2010 - 2015 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are m... | null | https://raw.githubusercontent.com/ktakashi/sagittarius-scheme/f3fe8ea86ec4f760af45d9ac055163b9146677f7/sitelib/text/markdown/convert.scm | scheme | coding : utf-8 -*-
text/markdown/convert.scm - Converter for parsed markdown
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
no... | Copyright ( c ) 2010 - 2015 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
#!nounbound
(library (text markdown convert)... |
2ddcdf3e0ade4a2268bf00b73482dc57a365d61cd631da8c4443121c34b0f873 | nklein/Woolly | label.lisp |
(in-package #:woolly)
(sheeple:defproto =label= (=widget=)
(label))
(sheeple:defreply sheeple:init-object :after ((ll =label=)
&key label
&allow-other-keys)
(set? (label ll) label))
| null | https://raw.githubusercontent.com/nklein/Woolly/f18b5d5dc28b04e6a194757d7ebc1f03bb6ebd4d/woolly/label.lisp | lisp |
(in-package #:woolly)
(sheeple:defproto =label= (=widget=)
(label))
(sheeple:defreply sheeple:init-object :after ((ll =label=)
&key label
&allow-other-keys)
(set? (label ll) label))
| |
9b75a65863a5b488901d5d70e07e35419c76e425d156005949914256e937f3b0 | narkisr-deprecated/core | physical.clj | (ns re-core.test.physical
"Physical instance creation"
(:import clojure.lang.ExceptionInfo)
(:require
physical.provider
[flatland.useful.map :refer (dissoc-in*)]
[re-core.fixtures.core :refer (with-m?)]
[re-core.model :refer (vconstruct)]
[re-core.fixtures.data :refer (redis-physical)])
... | null | https://raw.githubusercontent.com/narkisr-deprecated/core/85b4a768ef4b3a4eae86695bce36d270dd51dbae/test/re_core/test/physical.clj | clojure | (ns re-core.test.physical
"Physical instance creation"
(:import clojure.lang.ExceptionInfo)
(:require
physical.provider
[flatland.useful.map :refer (dissoc-in*)]
[re-core.fixtures.core :refer (with-m?)]
[re-core.model :refer (vconstruct)]
[re-core.fixtures.data :refer (redis-physical)])
... | |
b381c180c558c80304dbaf56ce7599febab0daa2491a988dfccc567f877a514c | binghe/fm-plugin-tools | deliver.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*-
$ Header : /usr / local / cvsrep / regex - plugin / deliver.lisp , v 1.10 2008/01/08 01:09:25 edi Exp $
Copyright ( c ) 2006 - 2008 , Dr. and Dr. . All rights reserved .
;;; Redistribution and use in source and binary f... | null | https://raw.githubusercontent.com/binghe/fm-plugin-tools/ddb970a38b9a6fb44e9fb49a3ef74a4d17ac8738/regex-plugin/deliver.lisp | lisp | Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions a... | $ Header : /usr / local / cvsrep / regex - plugin / deliver.lisp , v 1.10 2008/01/08 01:09:25 edi Exp $
Copyright ( c ) 2006 - 2008 , Dr. and Dr. . All rights reserved .
OR IMPLIED WARRANTIES , INCLUDING , BUT NOT LIMITED TO , THE IMPLIED
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLAR... |
c6cd10a94960192c7445b441a373bbc9ee87c00cb2b0815d02d4c6a06138fdc8 | ninenines/cowboy | charsets_provided_empty_h.erl | %% This module has a text and non-text media type,
%% but provides no charset. All requests will result
in a 406 not acceptable .
-module(charsets_provided_empty_h).
-export([init/2]).
-export([content_types_provided/2]).
-export([charsets_provided/2]).
-export([get_text_plain/2]).
-export([get_application_json/2])... | null | https://raw.githubusercontent.com/ninenines/cowboy/8795233c57f1f472781a22ffbf186ce38cc5b049/test/handlers/charsets_provided_empty_h.erl | erlang | This module has a text and non-text media type,
but provides no charset. All requests will result | in a 406 not acceptable .
-module(charsets_provided_empty_h).
-export([init/2]).
-export([content_types_provided/2]).
-export([charsets_provided/2]).
-export([get_text_plain/2]).
-export([get_application_json/2]).
init(Req, Opts) ->
{cowboy_rest, Req, Opts}.
content_types_provided(Req, State) ->
{[
{{<<"text"... |
6f7015683d2e135724fbcddc0070588856c1d99995cbc3e123ce12dc3a519783 | expipiplus1/vulkan | OpenXR.hs | {-# language CPP #-}
No documentation found for Chapter " OpenXR "
module OpenXR ( module OpenXR.CStruct
, module OpenXR.Core10
, module OpenXR.Extensions
, module OpenXR.NamedType
, module OpenXR.Version
) where
import OpenXR.CStruct
import ... | null | https://raw.githubusercontent.com/expipiplus1/vulkan/b1e33d1031779b4740c279c68879d05aee371659/openxr/src/OpenXR.hs | haskell | # language CPP # | No documentation found for Chapter " OpenXR "
module OpenXR ( module OpenXR.CStruct
, module OpenXR.Core10
, module OpenXR.Extensions
, module OpenXR.NamedType
, module OpenXR.Version
) where
import OpenXR.CStruct
import OpenXR.Core10
import ... |
2080965e7053be067a88696e2d044401b686f991373675ce1da5e3c02a1b532d | gsakkas/rite | 0138.ml | IteG (BopG EmptyG EmptyG) (SeqG EmptyG EmptyG) (AppG [EmptyG])
if sumList (digitsOfInt n) < 9
then (1 :: x;
additivePersistence (sumList (digitsOfInt n)))
else sumList x
| null | https://raw.githubusercontent.com/gsakkas/rite/958a0ad2460e15734447bc07bd181f5d35956d3b/data/sp14_min/clusters/0138.ml | ocaml | IteG (BopG EmptyG EmptyG) (SeqG EmptyG EmptyG) (AppG [EmptyG])
if sumList (digitsOfInt n) < 9
then (1 :: x;
additivePersistence (sumList (digitsOfInt n)))
else sumList x
| |
de9e220eef9f4ac8913c99c004bd64a21e5adb37c4821bf46bebaabf32a0f380 | awslabs/s2n-bignum | bignum_mod_n384.ml |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
(* =================================================================... | null | https://raw.githubusercontent.com/awslabs/s2n-bignum/824c15f908d7a343af1b2f378cfedd36e880bdde/x86/proofs/bignum_mod_n384.ml | ocaml | =========================================================================
=========================================================================
*** print_literal_from_elf "x86/p384/bignum_mod_n384.o";;
***
PUSH (% rbx)
PUSH (% r12)
PUSH (% r13)
PUSH (% r14)
ADD (% r8) (% rax)
ADC (% r9) (% rbx)
AD... |
* Copyright Amazon.com , Inc. or its affiliates . All Rights Reserved .
* SPDX - License - Identifier : Apache-2.0 OR ISC
* Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
* SPDX-License-Identifier: Apache-2.0 OR ISC
*)
Reduction modulo n_384 , the order of the NIST curve P-384 ... |
5d202e33436637ddc8302892693cb7fcc7c5f1f14349fef4940ebb2bf0063df9 | realworldocaml/book | main.mli | open Import
* Tie the knot between [ ] and [ Dune_rules ] .
val init :
stats:Dune_stats.t option
-> sandboxing_preference:Sandbox_mode.t list
-> cache_config:Dune_cache.Config.t
-> cache_debug_flags:Dune_engine.Cache_debug_flags.t
-> unit
type build_system =
{ conf : Dune_load.conf
; contexts : Cont... | null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/dune_/src/dune_rules/main.mli | ocaml | open Import
* Tie the knot between [ ] and [ Dune_rules ] .
val init :
stats:Dune_stats.t option
-> sandboxing_preference:Sandbox_mode.t list
-> cache_config:Dune_cache.Config.t
-> cache_debug_flags:Dune_engine.Cache_debug_flags.t
-> unit
type build_system =
{ conf : Dune_load.conf
; contexts : Cont... | |
bbc48777a35271dfe9ab6aafa23604b0b3a2d700ce6451d77021ecc7d2b52917 | capn-freako/Haskell_ML | Classifiable.hs | -- Class of types amenable to classification, via machine learning.
--
Original author : < >
Original date : March 1 , 2018
--
Copyright ( c ) 2018 ; all rights reserved World wide .
--
-- Note: This code originally came into being, as part of a code clean-
up , which started at ' v0.5.0 ' of the ... | null | https://raw.githubusercontent.com/capn-freako/Haskell_ML/bfba2aacd700db875a9de3aae88214cfc3171e3a/src/Haskell_ML/Classify/Classifiable.hs | haskell | Class of types amenable to classification, via machine learning.
Note: This code originally came into being, as part of a code clean-
# OPTIONS_GHC -Wno-unused-top-binds #
| Class of types amenable to classification, via machine learning.
| Read a list of samples from the named file.
Note: Can throw error!
| ... | Original author : < >
Original date : March 1 , 2018
Copyright ( c ) 2018 ; all rights reserved World wide .
up , which started at ' v0.5.0 ' of the Haskell_ML repository .
# OPTIONS_GHC -Wall #
# LANGUAGE AllowAmbiguousTypes #
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE Type... |
a0114dffaee5503334b554dc8fdd781cd6de57e1c380567f35fb9924745b5668 | Clozure/ccl-tests | ccase.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Fri Oct 18 21:06:45 2002
;;;; Contains: Tests of CCASE
(in-package :cl-test)
(deftest ccase.1
(let ((x 'b))
(ccase x (a 1) (b 2) (c 3)))
2)
(deftest ccase.2
(signals-type-error x 1 (ccase x))
t)
(deftest ccase.3
(signals-type-error x 1 (ccase x (a ... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/ccase.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of CCASE
It is legal to use T or OTHERWISE as key designators
in CCASE forms. They have no special meaning here.
Show that the key expression is evaluated only once.
No implicit tagbody
Test that explicit calls to macroexpand in subforms
are done in the correct environment... | Author :
Created : Fri Oct 18 21:06:45 2002
(in-package :cl-test)
(deftest ccase.1
(let ((x 'b))
(ccase x (a 1) (b 2) (c 3)))
2)
(deftest ccase.2
(signals-type-error x 1 (ccase x))
t)
(deftest ccase.3
(signals-type-error x 1 (ccase x (a 1) (b 2) (c 3)))
t)
(deftest ccase.4
(signals-ty... |
4336b9fb9a93c73e6e66f58e855ef280ed9619b198805eba628f3f08ac67dbb0 | seckcoder/iu_c311 | interp.rkt | #lang racket
(require eopl/datatype
"parser.rkt"
"../base/utils.rkt"
"../types/type.rkt"
"../types/store.rkt"
"env.rkt")
(define-datatype
proc proc?
(closure
(vars (list-of symbol?))
(body expression?)
(env environment?))
)
(define apply-proc
(lambda (... | null | https://raw.githubusercontent.com/seckcoder/iu_c311/a1215983b6ab08df32058ef1e089cb294419e567/racket/module/interp.rkt | racket | import mod mname and return a new env
module variable.
this expression has no effect on the whole module | #lang racket
(require eopl/datatype
"parser.rkt"
"../base/utils.rkt"
"../types/type.rkt"
"../types/store.rkt"
"env.rkt")
(define-datatype
proc proc?
(closure
(vars (list-of symbol?))
(body expression?)
(env environment?))
)
(define apply-proc
(lambda (... |
dcd1e1ed4c5cc0dc4864f3ef390aaeb3ac5bbe3b18a639a664dd54610234ad36 | hoplon/hoplon | svg.cljs | (ns hoplon.svg
(:refer-clojure :exclude [symbol filter mask set use])
(:require [hoplon.core :refer [parse-args do!]]))
(defmethod do! :xlink/default
[elem kw val]
(let [xlink ""]
(.setAttributeNS elem xlink (name kw) val)))
(derive :xlink/type :xlink/default)
(derive :xlink/href :xlink/default)
(de... | null | https://raw.githubusercontent.com/hoplon/hoplon/2f886d10d942e72e4565dfbb997487e90c8d5e3a/src/hoplon/svg.cljs | clojure | (ns hoplon.svg
(:refer-clojure :exclude [symbol filter mask set use])
(:require [hoplon.core :refer [parse-args do!]]))
(defmethod do! :xlink/default
[elem kw val]
(let [xlink ""]
(.setAttributeNS elem xlink (name kw) val)))
(derive :xlink/type :xlink/default)
(derive :xlink/href :xlink/default)
(de... | |
f55c138b15a2e840d44fb15fef4bc13a2c58819cf69d0627d515e5b4c40b2116 | finnishtransportagency/harja | erilliskustannus.cljc | (ns harja.domain.erilliskustannus
"Erilliskustannuksiin (lähinnä bonuksiin) liittyvien asioiden domain määritykset:"
(:require [clojure.spec.alpha :as s]
[harja.domain.muokkaustiedot :as m]
[harja.domain.tierekisteri :as tr]
[harja.domain.organisaatio :as o]
#?@(:clj ... | null | https://raw.githubusercontent.com/finnishtransportagency/harja/302b08738881a33ba3f66118db55647f3951f193/src/cljc/harja/domain/erilliskustannus.cljc | clojure | (ns harja.domain.erilliskustannus
"Erilliskustannuksiin (lähinnä bonuksiin) liittyvien asioiden domain määritykset:"
(:require [clojure.spec.alpha :as s]
[harja.domain.muokkaustiedot :as m]
[harja.domain.tierekisteri :as tr]
[harja.domain.organisaatio :as o]
#?@(:clj ... | |
3a297d87d45bf80227f37de278fef583a0231fa3ecf354401aaf82dd3a65ed49 | shentufoundation/deepsea | LowValues.ml | open Integers
type coq_val =
| Vunit
| Vint of Int256.int
| Vhash of coq_val
| Vhash2 of coq_val * coq_val
| null | https://raw.githubusercontent.com/shentufoundation/deepsea/970576a97c8992655ed2f173f576502d73b827e1/src/backend/extraction/LowValues.ml | ocaml | open Integers
type coq_val =
| Vunit
| Vint of Int256.int
| Vhash of coq_val
| Vhash2 of coq_val * coq_val
| |
82ac901d50e460f146ddbf6c2f953d104268e12076ef0cb83c174299963eb3c3 | UU-ComputerScience/uhc | sum.hs | data Bool = False | True
data ''[]'' a = a : [a] | ''[]''
foreign import ccall "primAddInt" (+) :: Int -> Int -> Int
foreign import ccall "primGtInt" (>) :: Int -> Int -> Bool
upto m n | m > n = []
| True = m : upto (m + 1) n
sum [] = 0
sum (n:ns) = n + sum ns
main = sum (upto 1 10)
| null | https://raw.githubusercontent.com/UU-ComputerScience/uhc/f2b94a90d26e2093d84044b3832a9a3e3c36b129/EHC/test/grinc/sum.hs | haskell | data Bool = False | True
data ''[]'' a = a : [a] | ''[]''
foreign import ccall "primAddInt" (+) :: Int -> Int -> Int
foreign import ccall "primGtInt" (>) :: Int -> Int -> Bool
upto m n | m > n = []
| True = m : upto (m + 1) n
sum [] = 0
sum (n:ns) = n + sum ns
main = sum (upto 1 10)
| |
6bc47ef36fdd9b100cf6fa60545a09e76cc14dbdb7ac1ea672d4107d6d44525f | Perry961002/SICP | HeapSort.scm |
(define (MaxHeapify heap root len)
(define (Left i) (+ (* i 2) 1))
(define (Right i) (* (+ i 1) 2))
(let ((left (Left root))
(right (Right root))
(largest root))
(begin
(if (and (<= left len)
(> (vector-ref heap left)
(vec... | null | https://raw.githubusercontent.com/Perry961002/SICP/89d539e600a73bec42d350592f0ac626e041bf16/little%20practice/HeapSort.scm | scheme |
(define (MaxHeapify heap root len)
(define (Left i) (+ (* i 2) 1))
(define (Right i) (* (+ i 1) 2))
(let ((left (Left root))
(right (Right root))
(largest root))
(begin
(if (and (<= left len)
(> (vector-ref heap left)
(vec... | |
03386230590543d4b815f73d4b69b2ffd23962fb2a4adbfc3c32b22ffdbdb7f8 | elnewfie/lslforge | Error.hs | We encountered problem that LSLForge process hung up when start up .
I knew it was caused by difference of ' fail ' for Either monad behavier
between base version prior 4.3 and later .
Prior 4.3 , fail returns Left e , but later throws exception .
Language . Lsl . Internal . Util.lookupM is called in 3 monads... | null | https://raw.githubusercontent.com/elnewfie/lslforge/27eb84231c53fffba6bdb0db67bde81c1c12dbb9/lslforge/haskell/src/Control/Monad/Outdated/Error.hs | haskell | lookupM calls fail when module name not found,
which will be removed from standard library.
But we still need this class for fail on Either monad.
This is core to reproduce old Either fail. | We encountered problem that LSLForge process hung up when start up .
I knew it was caused by difference of ' fail ' for Either monad behavier
between base version prior 4.3 and later .
Prior 4.3 , fail returns Left e , but later throws exception .
Language . Lsl . Internal . Util.lookupM is called in 3 monads... |
5ed1e6c48f06d4e9ca4ba3603f9f9663f71a3648ff33554fb19f18198a4c3166 | rm-hull/project-euler | binomial.clj | (ns util.binomial)
(def pascals-triangle
(let [seed 1N]
(letfn [(next-row [xs] (cons seed (map (partial apply +) (partition-all 2 1 xs))))
(rows-seq [xs] (lazy-seq (cons xs (rows-seq (next-row xs)))))]
(rows-seq (list seed)))))
(defn choose
"The number of ways of picking k unordered outcomes... | null | https://raw.githubusercontent.com/rm-hull/project-euler/04e689e87a1844cfd83229bb4628051e3ac6a325/src/util/binomial.clj | clojure | (ns util.binomial)
(def pascals-triangle
(let [seed 1N]
(letfn [(next-row [xs] (cons seed (map (partial apply +) (partition-all 2 1 xs))))
(rows-seq [xs] (lazy-seq (cons xs (rows-seq (next-row xs)))))]
(rows-seq (list seed)))))
(defn choose
"The number of ways of picking k unordered outcomes... | |
48f11c91a2de5faf18de84078b1e97ff44e42a8f6bc38f740abd8e64ee64f51c | troydm/edda | ParserTest.hs | {-# LANGUAGE OverloadedStrings #-}
module EDDA.Schema.ParserTest where
import Test.HUnit
import Data.Maybe (fromJust,isJust)
import Data.Aeson
import Data.Aeson.Types
import qualified Data.ByteString.Char8 as C
import qualified Data.HashMap.Strict as HM
import Control.Monad.Trans.Reader
import Data.Time.Format (forma... | null | https://raw.githubusercontent.com/troydm/edda/710856d5bc3bf70c1061c50ae159107ca51c15f0/test/EDDA/Schema/ParserTest.hs | haskell | # LANGUAGE OverloadedStrings # | module EDDA.Schema.ParserTest where
import Test.HUnit
import Data.Maybe (fromJust,isJust)
import Data.Aeson
import Data.Aeson.Types
import qualified Data.ByteString.Char8 as C
import qualified Data.HashMap.Strict as HM
import Control.Monad.Trans.Reader
import Data.Time.Format (formatTime)
import EDDA.Schema.Commodit... |
528bfcf6cad9fd54f7caa659ff0dd221210aa7a873fd977090155ae36092a96a | sheyll/mediabus | SyncStream.hs | -- | A module for removing and creating sequence numbers and time stamps for
-- 'Stream's.
--
It 's sometimes helpful to explicity use a ' SyncStream ' instead of a ' Stream ' .
--
-- For example, for a library function that consumes 'Frame's and doesn't regard
-- the sequence numbers and time stamps, such that the f... | null | https://raw.githubusercontent.com/sheyll/mediabus/351272b2bb26a1bde7b0ffda6ceabc623ede2b14/src/Data/MediaBus/Media/SyncStream.hs | haskell | | A module for removing and creating sequence numbers and time stamps for
'Stream's.
For example, for a library function that consumes 'Frame's and doesn't regard
the sequence numbers and time stamps, such that the function does not handle
any gaps and/or out of order packages or discrepancies in the time stamps... | It 's sometimes helpful to explicity use a ' SyncStream ' instead of a ' Stream ' .
When the library author chooses ' SyncStream ' , the library users then know ,
module Data.MediaBus.Media.SyncStream
( SyncStream,
assumeSynchronized,
setSequenceNumberAndTimestamp,
)
where
import Data.MediaBus.Basics.S... |
bc5e3567fbad510ee95a20d6fc98a949247c8c1f87be7e579e9131e13c1a9f12 | EligiusSantori/L2Apf | attack_start.scm | (module system racket/base
(require "../../packet.scm")
(provide game-server-packet/attack-start)
(define (game-server-packet/attack-start buffer)
(let ((s (open-input-bytes buffer)))
(list
(cons 'id (read-byte s))
(cons 'object-id (read-int32 #f s))
)
)
)
)
| null | https://raw.githubusercontent.com/EligiusSantori/L2Apf/30ffe0828e8a401f58d39984efd862c8aeab8c30/packet/game/server/attack_start.scm | scheme | (module system racket/base
(require "../../packet.scm")
(provide game-server-packet/attack-start)
(define (game-server-packet/attack-start buffer)
(let ((s (open-input-bytes buffer)))
(list
(cons 'id (read-byte s))
(cons 'object-id (read-int32 #f s))
)
)
)
)
| |
8ceecc832d4aee00f7cf85ff72e38aa3bcec5bacfb9e9277ce9524c703c75b38 | dalaing/little-languages | Eval.hs | |
Copyright : ( c ) , 2016
License : :
Stability : experimental
Portability : non - portable
Copyright : (c) Dave Laing, 2016
License : BSD3
Maintainer :
Stability : experimental
Portability : non-portable
-}
module Test.Term.Eval (
evalTests
) where
-- from 'base'
import ... | null | https://raw.githubusercontent.com/dalaing/little-languages/9f089f646a5344b8f7178700455a36a755d29b1f/code/i/tests/Test/Term/Eval.hs | haskell | from 'base'
from 'tasty'
from 'tasty-quickcheck'
from 'QuickCheck'
local | |
Copyright : ( c ) , 2016
License : :
Stability : experimental
Portability : non - portable
Copyright : (c) Dave Laing, 2016
License : BSD3
Maintainer :
Stability : experimental
Portability : non-portable
-}
module Test.Term.Eval (
evalTests
) where
import Data.L... |
6ca3fb00f9335e132a96d27e399d0237c4075bd88a65d7cf83588c0f760fbf8b | roman/servant-playground | DevelMain.hs | # OPTIONS_GHC -Wno - deprecations #
{-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE NoImplicitPrelude #
module DevelMain where
import RIO
import App.Component (buildApp)
import App.Component.Logger (logComponentEvents)
import Control.Monad.Component.Development (ComponentEvent(..), run... | null | https://raw.githubusercontent.com/roman/servant-playground/37639f20c01306fb1a59050f7996f6779a627a1f/app/DevelMain.hs | haskell | # LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings # | # OPTIONS_GHC -Wno - deprecations #
# LANGUAGE NoImplicitPrelude #
module DevelMain where
import RIO
import App.Component (buildApp)
import App.Component.Logger (logComponentEvents)
import Control.Monad.Component.Development (ComponentEvent(..), runComponentDevel)
main :: IO ()
main = do
tmpLogOptions <- logOption... |
6a7aef964df0a028a6af7c4725769d73176c025d98984ea8795e27330386812b | alexanderwasey/stupid-computer | Listcomp.hs | module Listcomp where
import Prelude hiding (map, take)
map :: (a -> b) -> [a] -> [b]
map f (x:xs) = (f x) : (map f xs)
map _ [] = []
square :: Integer -> Integer
square x = x*x
doublelarge :: [Integer] -> [Integer]
doublelarge xs = [x * 2 | x <- xs, x > 3]
take :: Integer -> [a] -> [a]
take 0 _ = []
take n (x:... | null | https://raw.githubusercontent.com/alexanderwasey/stupid-computer/a485d2f33a4b8d58128a74b9003b9eadffe42702/examples/Listcomp.hs | haskell | module Listcomp where
import Prelude hiding (map, take)
map :: (a -> b) -> [a] -> [b]
map f (x:xs) = (f x) : (map f xs)
map _ [] = []
square :: Integer -> Integer
square x = x*x
doublelarge :: [Integer] -> [Integer]
doublelarge xs = [x * 2 | x <- xs, x > 3]
take :: Integer -> [a] -> [a]
take 0 _ = []
take n (x:... | |
551e8573c7ac2326ef92945242c930f9735d66a13be0307a77580973baa6fc5c | clojure-goes-fast/clj-memory-meter | core.clj | (ns clj-memory-meter.core
(:require [clojure.java.io :as io])
(:import java.io.File
java.lang.management.ManagementFactory
java.net.URLClassLoader))
Agent unpacking
(def ^:private jamm-jar-name "jamm-0.4.0-unsafe.jar")
(defn- unpack-jamm-from-resource []
(let [dest (File/createTempFile... | null | https://raw.githubusercontent.com/clojure-goes-fast/clj-memory-meter/14358428fe5dafd50ed316db60cb319b63830139/src/clj_memory_meter/core.clj | clojure | Agent loading
The chain starts with a dynamic classloader, walk the chain up to find
the uppermost one.
Otherwise, return the immediate classloader and tell it's not dynamic.
Public API | (ns clj-memory-meter.core
(:require [clojure.java.io :as io])
(:import java.io.File
java.lang.management.ManagementFactory
java.net.URLClassLoader))
Agent unpacking
(def ^:private jamm-jar-name "jamm-0.4.0-unsafe.jar")
(defn- unpack-jamm-from-resource []
(let [dest (File/createTempFile... |
db01a5f95d2e36c4dcb1adba3a1e67848c0e229c941eb6f63d990765ea6e8bad | TyOverby/mono | test_async_quickcheck.ml | open! Core
open! Async
let trials = 5
let examples = [ "Example 1"; "Example 2"; "Example 3" ]
let generator = Quickcheck.Generator.return "Generated value"
let%expect_test "[~examples] are tested first" =
let%bind () =
Async_quickcheck.async_test ~trials ~examples generator ~f:(fun string ->
print_endlin... | null | https://raw.githubusercontent.com/TyOverby/mono/5ce4569fc6edf6564d29d37b66d455549df1e497/vendor/janestreet-async/async_quickcheck/test/test_async_quickcheck.ml | ocaml | open! Core
open! Async
let trials = 5
let examples = [ "Example 1"; "Example 2"; "Example 3" ]
let generator = Quickcheck.Generator.return "Generated value"
let%expect_test "[~examples] are tested first" =
let%bind () =
Async_quickcheck.async_test ~trials ~examples generator ~f:(fun string ->
print_endlin... | |
68a3e4d0babe1c4d11c7154df79320f421b766c43bb15133a68ab01cf492810a | facebook/flow | serverEnv.ml |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... | null | https://raw.githubusercontent.com/facebook/flow/8d9850a82f1e3094aed7e46acab5c2b120d10a31/src/server/env/serverEnv.ml | ocaml | ***************************************************************************
***************************************************************************
***************************************************************************
The environment constantly maintained by the server
**************************************... |
* Copyright ( c ) Meta Platforms , Inc. and affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Meta Platforms, Inc. and affiliates.
*
* This source code is licensed under the MIT license found in t... |
e0ad28a8aece5a5db848e805de92e5389f4fc03c3e542d4c7c152ef652ee6458 | RefactoringTools/HaRe | Nested.expected.hs | module AddOneParameter.Nested(sumSquares,sumSquares_y) where
{- add parameter 'y' to 'sumSquares'. 'sumSquares_y_1' to be added to the
export list -}
sumSquares y (x:xs) = sq x + (sumSquares y) xs + foo xs
where foo a = (sumSquares y) a + 1
sumSquares y [] = 0
sumSquares_y = undefined
sq x = x ^ pow
pow =2
| null | https://raw.githubusercontent.com/RefactoringTools/HaRe/ef5dee64c38fb104e6e5676095946279fbce381c/test/testdata/AddOneParameter/Nested.expected.hs | haskell | add parameter 'y' to 'sumSquares'. 'sumSquares_y_1' to be added to the
export list | module AddOneParameter.Nested(sumSquares,sumSquares_y) where
sumSquares y (x:xs) = sq x + (sumSquares y) xs + foo xs
where foo a = (sumSquares y) a + 1
sumSquares y [] = 0
sumSquares_y = undefined
sq x = x ^ pow
pow =2
|
5d095358482783e73c6f9c020e2b72a375a8abc1eff9cd212be951677cb20588 | slyrus/mcclim-old | demodemo.lisp | ;;; -*- Mode: Lisp; Syntax: Common-Lisp; Package: CLIM-DEMO; -*-
;;; --------------------------------------------------------------------------------------
;;; Title: The demo demo
Created : 2002 - 02 - 11
Author : < >
;;; License: LGPL (See file COPYING for details).
;;; -----------------------------... | null | https://raw.githubusercontent.com/slyrus/mcclim-old/354cdf73c1a4c70e619ccd7d390cb2f416b21c1a/Examples/demodemo.lisp | lisp | -*- Mode: Lisp; Syntax: Common-Lisp; Package: CLIM-DEMO; -*-
--------------------------------------------------------------------------------------
Title: The demo demo
License: LGPL (See file COPYING for details).
--------------------------------------------------------------------------------------
This l... | Created : 2002 - 02 - 11
Author : < >
( c ) copyright 2002 by
modify it under the terms of the GNU Library General Public
version 2 of the License , or ( at your option ) any later version .
Library General Public License for more details .
You should have received a copy of the GNU Library Ge... |
ffd20baf73a2d3fda3c061434bd984fd52f4702e91e426942073cbf252209732 | maximedenes/native-coq | reserve.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/reserve.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
Reserved names
Rem: AApp(ARef ref... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2010
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
open Errors
open Util
open P... |
85ed083c3763a053f2666040d719b0a4a2f2a686e7bda67c0b6587dec87de228 | seanomlor/programming-in-haskell | voting.hs | import Data.List
type Vote = String
votes :: [Vote]
votes = ["Red", "Blue", "Green", "Blue", "Blue", "Red"]
--count :: Eq a => a -> [a] -> Int
count :: Vote -> [Vote] -> Int
count x = length . filter (== x)
--
rmdups [ 1 , 5 , 5 , 3 , 2 , 1 ]
1 : filter ( /= 1 ) ( rmdups [ 5 , 5 , 3 , 2 , 1 ] )
rmdups [ 5 ,... | null | https://raw.githubusercontent.com/seanomlor/programming-in-haskell/e05142e6709eeba2e95cf86f376a32c9e629df88/07-higher-order-functions/voting.hs | haskell | count :: Eq a => a -> [a] -> Int
rmdups []
[]
rmdups :: Eq a => [a] -> [a]
example:
> result votes
runoff voting
rank ballots
["Red", "Blue", "Green"]
| import Data.List
type Vote = String
votes :: [Vote]
votes = ["Red", "Blue", "Green", "Blue", "Blue", "Red"]
count :: Vote -> [Vote] -> Int
count x = length . filter (== x)
rmdups [ 1 , 5 , 5 , 3 , 2 , 1 ]
1 : filter ( /= 1 ) ( rmdups [ 5 , 5 , 3 , 2 , 1 ] )
rmdups [ 5 , 5 , 3 , 2 , 1 ]
5 : filter ( /= 5... |
d9e7bbe197224642e288c56722dc1b4ea3d085a6f7d2deeaf08e31307b1a701d | haskell-lisp/yale-haskell | xlibclx.scm | xlibclx.scm -- Lisp support for Haskell / CLX interface
;; general
(define-syntax (nth-value n form)
(cond ((eqv? n 0)
`(values ,form))
((number? n)
(let ((temps '()))
(dotimes (i n)
(declare (ignorable i))
(push (gensym) temps))
`(multiple-value-bind ,(reverse temps) ,form
(decla... | null | https://raw.githubusercontent.com/haskell-lisp/yale-haskell/4e987026148fe65c323afbc93cd560c07bf06b3f/progs/lib/X11/xlibclx.scm | scheme | general
This is stuff to support slots that consist of a keyword/value
pair. Note that the value is always unboxed.
The forces here are necessary because the thing being funcalled
returns a data structure of type (IO a), and we need to do
an IO a -> a transformation.
Bitmap
XKeysymTable
XPixarray
Can't use ... | xlibclx.scm -- Lisp support for Haskell / CLX interface
(define-syntax (nth-value n form)
(cond ((eqv? n 0)
`(values ,form))
((number? n)
(let ((temps '()))
(dotimes (i n)
(declare (ignorable i))
(push (gensym) temps))
`(multiple-value-bind ,(reverse temps) ,form
(declare (ignore ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.