_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 |
|---|---|---|---|---|---|---|---|---|
46ce92e5e6199b9e45cf909d71c4742e310e58f36fc1484abb6d06ffffb093d9 | namin/biohacker | jsaint.lisp | ;; -*- Mode: Lisp; -*-
JSAINT : A rational reconstruction of 's SAINT program
Last edited 1/29/92 , by KDF
Copyright ( c ) 1991 -- 1992 , , Northwestern University ,
and , Xerox Corporation
;;; All rights reserved.
;;; See the file legal.txt for a paragraph stating scope of permission
;;; and disclaim... | null | https://raw.githubusercontent.com/namin/biohacker/6b5da4c51c9caa6b5e1a68b046af171708d1af64/BPS/jtms/jsaint.lisp | lisp | -*- Mode: Lisp; -*-
All rights reserved.
See the file legal.txt for a paragraph stating scope of permission
and disclaimer of warranty. The above copyright notice and that
paragraph must be included in any separate copy of this file.
Name for printing
List of queued subproblems
When solved, we are done.
Cache... |
JSAINT : A rational reconstruction of 's SAINT program
Last edited 1/29/92 , by KDF
Copyright ( c ) 1991 -- 1992 , , Northwestern University ,
and , Xerox Corporation
(in-package :COMMON-LISP-USER)
(defstruct (Jsaint
(:PRINT-FUNCTION (lambda (a st ignore)
(format st "<Agenda ~A>"
... |
88b5554a8d6c242540bc645218204f7adc407cf9490d2eda15ae0d6e2fffc5dd | konn/dl-first-principle-tutorial | MNIST.hs | # LANGUAGE DataKinds #
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveTraversable #-}
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeApp... | null | https://raw.githubusercontent.com/konn/dl-first-principle-tutorial/1ab71b66c386f64e48759aa2402fe6658e6cb8d4/src/DeepLearning/MNIST.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveTraversable #
# INLINE distribute #
# SPECIALIZE INLINE inferDigit :: DigitVector Double -> Digit #
# SPECIALIZE INLINE inferDigit :: DigitVector Float -> Digit #
# SPECIALIZE INLINE toDigitVector :: Digit -> DigitVector Double #
# SPECIALIZE INLINE toDigitVector :: Digit ->... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE StandaloneDeriving #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators #
# ... |
26dc52a86a161c46190fc3c097893640918ca0b3a405c3ec7d1cb13f82912fc5 | mbj/stratosphere | NotificationConfigurationProperty.hs | module Stratosphere.Timestream.ScheduledQuery.NotificationConfigurationProperty (
module Exports, NotificationConfigurationProperty(..),
mkNotificationConfigurationProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
impor... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/timestream/gen/Stratosphere/Timestream/ScheduledQuery/NotificationConfigurationProperty.hs | haskell | # SOURCE # | module Stratosphere.Timestream.ScheduledQuery.NotificationConfigurationProperty (
module Exports, NotificationConfigurationProperty(..),
mkNotificationConfigurationProperty
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
impor... |
8b1f658a2448ef6c476f0627517bbdf32c2b21b1616522fbcdd7471ee1ef94a9 | crategus/cl-cffi-gtk | gtk.numerable-icon.lisp | ;;; ----------------------------------------------------------------------------
;;; gtk.numerable-icon.lisp
;;;
;;; The documentation of this file is taken from the GTK 3 Reference Manual
Version 3.24 and modified to document the Lisp binding to the GTK library .
;;; See <>. The API documentation of the Lisp binding... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/b613a266a5f8e7f477b66a33d4df84fbed3dc7bc/gtk/gtk.numerable-icon.lisp | lisp | ----------------------------------------------------------------------------
gtk.numerable-icon.lisp
The documentation of this file is taken from the GTK 3 Reference Manual
See <>. The API documentation of the Lisp binding is
This program is free software: you can redistribute it and/or modify
it under the ter... | Version 3.24 and modified to document the Lisp binding to the GTK library .
available from < -cffi-gtk/ > .
Copyright ( C ) 2014 - 2021
as published by the Free Software Foundation , either version 3 of the
the GNU Lesser General Public License that clarifies the terms for use
GNU Lesser General Public Li... |
443c37a07f1037991db3649bde29d0cdb801d147de0bda55c287a5810f7524a9 | scrintal/heroicons-reagent | phone.cljs | (ns com.scrintal.heroicons.mini.phone)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 20 20"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M2 3.5A1.5 1.5 0 013.5 2h1.148a1.5 1.5 0 011.465 1.175l.716 3.223a1.5 1.5 0 01-1.052 ... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/mini/phone.cljs | clojure | (ns com.scrintal.heroicons.mini.phone)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 20 20"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M2 3.5A1.5 1.5 0 013.5 2h1.148a1.5 1.5 0 011.465 1.175l.716 3.223a1.5 1.5 0 01-1.052 ... | |
5d54cd2779e613fe2d23b31f3675a58df3885ceed56df42bf1a1c7b9ab3153d7 | c-cube/ocaml-containers | t_cache.ml | module Test = (val Containers_testlib.make ~__FILE__ ())
open Test
open CCCache;;
t @@ fun () ->
let c = unbounded ~eq:Int64.equal 256 in
let fib =
with_cache_rec c (fun self n ->
match n with
| 1L | 2L -> 1L
| _ -> CCInt64.(self (n - 1L) + self (n - 2L)))
in
assert_equal 55L (fib 10L);
assert_equa... | null | https://raw.githubusercontent.com/c-cube/ocaml-containers/69f2805f1073c4ebd1063bbd58380d17e62f6324/tests/data/t_cache.ml | ocaml | module Test = (val Containers_testlib.make ~__FILE__ ())
open Test
open CCCache;;
t @@ fun () ->
let c = unbounded ~eq:Int64.equal 256 in
let fib =
with_cache_rec c (fun self n ->
match n with
| 1L | 2L -> 1L
| _ -> CCInt64.(self (n - 1L) + self (n - 2L)))
in
assert_equal 55L (fib 10L);
assert_equa... | |
535c26e39d119cd681c848b38ad22c317049424c4f0f3de045fcbf44acb4caf0 | ubf/ubf-thrift | thrift_plugin_sup.erl | %%%----------------------------------------------------------------------
%%% File : thrift_plugin_sup.erl
Purpose : test UBF top - level supervisor
%%%----------------------------------------------------------------------
-module(thrift_plugin_sup).
-behaviour(supervisor).
%% External exports
-export([start_li... | null | https://raw.githubusercontent.com/ubf/ubf-thrift/d23182cc1130c2248b11d7cad310c38da2e8c3d3/test/eunit/thrift_plugin_sup.erl | erlang | ----------------------------------------------------------------------
File : thrift_plugin_sup.erl
----------------------------------------------------------------------
External exports
supervisor callbacks
----------------------------------------------------------------------
API
-----------------------------... | Purpose : test UBF top - level supervisor
-module(thrift_plugin_sup).
-behaviour(supervisor).
-export([start_link/1]).
-export([init/1]).
-define(SERVER, ?MODULE).
start_link(_Args) ->
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
Returns : { ok , { SupFlags , [ ChildSpec ] } } |
@spec(Arg... |
5fb4c62be5dacf3d0ee45e59a640a07c892497eb9231cdd793c903373170a6e3 | lvh/caesium | secretbox_benchmark.clj | (ns caesium.crypto.secretbox-benchmark
(:require [caesium
[bench-utils :refer [fmt-bytes print-title]]
[binding :refer [sodium]]
[byte-bufs :as bb]
[randombytes :refer [randombytes]]]
[byte-streams :as bs]
[caesium.crypto.secretbox :as s]
... | null | https://raw.githubusercontent.com/lvh/caesium/cb90a4325fa48a2e4fb6cad810f340125a53fc57/benchmarks/caesium/crypto/secretbox_benchmark.clj | clojure | (ns caesium.crypto.secretbox-benchmark
(:require [caesium
[bench-utils :refer [fmt-bytes print-title]]
[binding :refer [sodium]]
[byte-bufs :as bb]
[randombytes :refer [randombytes]]]
[byte-streams :as bs]
[caesium.crypto.secretbox :as s]
... | |
18b040d9745b97fdcf552fff10bfd4679ac549ea37e742a47acb76c17a05e617 | 8c6794b6/guile-tjit | conditions.scm | ;;; conditions.scm --- The R6RS conditions library
Copyright ( C ) 2010 Free Software Foundation , Inc.
;;
;; This library is free software; you can redistribute it and/or
;; modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version 3 of... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/module/rnrs/conditions.scm | scheme | conditions.scm --- The R6RS conditions library
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
either
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANT... |
Copyright ( C ) 2010 Free Software Foundation , Inc.
version 3 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 51 Franklin Street , Fifth Floor , Boston , USA
(library (rnrs conditions (6))
(export &co... |
aaf58034d93c5b06dd72fab175a1200d35a9d87656637aa3fcb2c3050a1ed17e | racket/plai | empty-mutator.rkt | #lang plai/mutator
(allocator-setup "../good-collectors/good-collector.rkt" 80)
| null | https://raw.githubusercontent.com/racket/plai/164f3b763116fcfa7bd827be511650e71fa04319/plai-lib/tests/gc/good-mutators/empty-mutator.rkt | racket | #lang plai/mutator
(allocator-setup "../good-collectors/good-collector.rkt" 80)
| |
a1c1aaccace8f8d1c4d727091266bd455e0cd928d382ab39a78d7e0da14a3b75 | eyedouble/couchdb | legacy_gen_changes.erl | %% @hidden
%% @doc gen_changes CouchDB continuous changes consumer behavior
%% This behaviour allws you to create easily a server that consume
%% Couchdb continuous changes
-module(legacy_gen_changes).
-include("couchdb.hrl").
-behavior(gen_server).
-export([start_link/4]).
-export([init/1,
handle_call/3,
... | null | https://raw.githubusercontent.com/eyedouble/couchdb/39830e536e803dfb492bfdb8b3644839cdd7e356/src/legacy/legacy_gen_changes.erl | erlang | @hidden
@doc gen_changes CouchDB continuous changes consumer behavior
This behaviour allws you to create easily a server that consume
Couchdb continuous changes
@doc create a gen_changes process as part of a supervision tree.
The function should be called, directly or indirectly, by the supervisor.
... |
-module(legacy_gen_changes).
-include("couchdb.hrl").
-behavior(gen_server).
-export([start_link/4]).
-export([init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3]).
-export([behaviour_info/1]).
-export([call/2,
call/3,
cast... |
bfdbbc1639fe40a5f61423efcb86b2b8124b64c2808b2992e409cc29ae518d78 | ruricolist/cl-strftime | cl-strftime.lisp | (in-package #:cl-strftime)
(defvar *default-width* nil)
(deftype writer ()
'(or string function))
(defun expand-tz (tz)
(etypecase-of time-zone tz
((eql t) +utc-zone+)
(null *default-timezone*)
(local-time::timezone tz)))
(defun format-time (stream format &optional (time (now)) tz)
"Write TIME to ... | null | https://raw.githubusercontent.com/ruricolist/cl-strftime/21cb57f2595faa26d687893963f24ec41822b63c/cl-strftime.lisp | lisp | Don't pad.
Pad with spaces.
Toggle case.
Upcase.
Cannot specify a /smaller/ width.
"%02t" -> "0 " | (in-package #:cl-strftime)
(defvar *default-width* nil)
(deftype writer ()
'(or string function))
(defun expand-tz (tz)
(etypecase-of time-zone tz
((eql t) +utc-zone+)
(null *default-timezone*)
(local-time::timezone tz)))
(defun format-time (stream format &optional (time (now)) tz)
"Write TIME to ... |
025bc3cb62f5629af3f2945f088db4f04631e624036b2687de4f25a96c6fb34b | Kappa-Dev/KappaTools | ast.mli | (******************************************************************************)
(* _ __ * The Kappa Language *)
| |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
(* | ' / ********************************************************************... | null | https://raw.githubusercontent.com/Kappa-Dev/KappaTools/777835b82f449d3d379713df76ff25fd5926b762/core/grammar/ast.mli | ocaml | ****************************************************************************
_ __ * The Kappa Language
| ' / ********************************************************************
| . \ * This file is distributed under the terms of the
|_|\_\ * GN... | | |/ / * Copyright 2010 - 2020 CNRS - Harvard Medical School - INRIA - IRIF
type syntax_version = V3 | V4
val merge_version : syntax_version -> syntax_version -> syntax_version
type internal = string option Locality.annot list
type port = {
port_nme:string Locality.annot;
port_int:internal;
port_int_mod: ... |
10c23be7c9594082d303e445595d2d26e04cb32ed2a98b68e0b6afd75f13e867 | huangz1990/SICP-answers | 12-rec-pascal.scm | 12-rec-pascal.scm
(define (pascal row col)
(cond ((> col row)
(error "unvalid col value"))
((or (= col 0) (= row col))
1)
(else (+ (pascal (- row 1) (- col 1))
(pascal (- row 1) col)))))
| null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp1/code/12-rec-pascal.scm | scheme | 12-rec-pascal.scm
(define (pascal row col)
(cond ((> col row)
(error "unvalid col value"))
((or (= col 0) (= row col))
1)
(else (+ (pascal (- row 1) (- col 1))
(pascal (- row 1) col)))))
| |
66fc0b70f6c9454235ee8d18b2ced637d95e8dd1b91ed2fc77e53de0e6cf75dd | zoomhub/zoomhub | MainDevelopment.hs | {-# LANGUAGE OverloadedStrings #-}
Copyright ( c ) 2015
--
-- Permission is hereby granted, free of charge, to any person obtaining
-- a copy of this software and associated documentation files (the
" Software " ) , to deal in the Software without restriction , including
-- without limitation the rights to use, ... | null | https://raw.githubusercontent.com/zoomhub/zoomhub/f2fbcdbfe7ed081ff965b1dca8f49a075f2b3d44/src/ZoomHub/Web/MainDevelopment.hs | haskell | # LANGUAGE OverloadedStrings #
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
without limitation the rights to use, copy, modify, merge, publish,
the following conditions:
The above copyright notice and this permission notice ... |
Copyright ( c ) 2015
" 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
in all copies or substantial portions of the Software .
THE SOFTWARE I... |
f935c6b16b63324da0750a37a4fb9a9aac327541eaca53f3306a046629a46f66 | rundis/acme-buddy | security.clj | (ns acme-webstore.security
(:require [acme-webstore.views :as views]
[acme-webstore.roles :refer [any-granted?]]
[compojure.core :refer [defroutes GET POST]]
[ring.util.response :as response]
[clj-http.client :as http]
[buddy.sign.jws :as jws]
[b... | null | https://raw.githubusercontent.com/rundis/acme-buddy/4134ee33391c858c1c6c517eb22f65aaff34a40e/acme-webstore/src/acme_webstore/security.clj | clojure | you should probably add :secure true to enforce https
(log/warning "Possible redirect attack: " loc) | (ns acme-webstore.security
(:require [acme-webstore.views :as views]
[acme-webstore.roles :refer [any-granted?]]
[compojure.core :refer [defroutes GET POST]]
[ring.util.response :as response]
[clj-http.client :as http]
[buddy.sign.jws :as jws]
[b... |
bedad6cb2bf2a6aa792dd60be869401d8755be5f9c3c49c38ce1ca48d1953a1f | bobbae/gosling-emacs | tags.ml | ; Edit 7
; Fri Jul 16 18:05:28 1982
; twenex-like tags package J. Gosling, November 81
;
; A tag file is a sequence of lines of the following forms:
; ^_filename
; ^Atagline^Bposition
; A tagline/position pair refers to the preceeding file
(declare-global last-search-tag)
(defun (to-tag-buffer
(temp-use-buffe... | null | https://raw.githubusercontent.com/bobbae/gosling-emacs/8fdda532abbffb0c952251a0b5a4857e0f27495a/maclib/tags.ml | ocaml | ; Edit 7
; Fri Jul 16 18:05:28 1982
; twenex-like tags package J. Gosling, November 81
;
; A tag file is a sequence of lines of the following forms:
; ^_filename
; ^Atagline^Bposition
; A tagline/position pair refers to the preceeding file
(declare-global last-search-tag)
(defun (to-tag-buffer
(temp-use-buffe... | |
30fb85d03f5ae930c460e8c98b1db1d0b8dec7a7c71f3b2a2fc9074e835862dd | WeiDUorg/weidu | ids.ml | open BatteriesInit
open Hashtblinit
open Util
type ids = {
i_num : Int32.t ;
i_name : string ;
i_args : i_arg list ;
}
and i_arg = {
arg_kind : arg_kind ;
arg_comment : string ;
arg_file : string ;
}
and arg_kind = Arg_Object
| Arg_Action
| Arg_Point
| Arg_String
| Arg_Integ... | null | https://raw.githubusercontent.com/WeiDUorg/weidu/a4048b11e6904f39ea1f956a36018e5d9a6e8e5c/src/ids.ml | ocaml | open BatteriesInit
open Hashtblinit
open Util
type ids = {
i_num : Int32.t ;
i_name : string ;
i_args : i_arg list ;
}
and i_arg = {
arg_kind : arg_kind ;
arg_comment : string ;
arg_file : string ;
}
and arg_kind = Arg_Object
| Arg_Action
| Arg_Point
| Arg_String
| Arg_Integ... | |
ce4ec6d0844756a6fed1565e774ce0eb812f8111c44fcdad0925cd9516ef2a14 | Frechmatz/cl-threadpool | result-list.lisp | (in-package :cl-threadpool-test)
(defun make-result-list ()
"Collect results of jobs. A job result must be a string."
(let ((lock (bt:make-lock))
(results nil))
(list
:add (lambda (value)
"Add a result string."
(if (not (stringp value))
(error "result-list::add Value must be a string"))
... | null | https://raw.githubusercontent.com/Frechmatz/cl-threadpool/86ef8a6b3d6a28ce41f25362c1c2db804d3ca605/test/util/result-list.lisp | lisp | (in-package :cl-threadpool-test)
(defun make-result-list ()
"Collect results of jobs. A job result must be a string."
(let ((lock (bt:make-lock))
(results nil))
(list
:add (lambda (value)
"Add a result string."
(if (not (stringp value))
(error "result-list::add Value must be a string"))
... | |
2493b7606f9eef93bf6a86e4926d3f46ff927ab86f49310fda71f8a028245aa3 | SNePS/SNePS2 | simple-lexicon.lisp | -*- Mode : Lisp ; Syntax : Common - Lisp ; Package : USER ; Base : 10 -*-
Copyright ( C ) 1984 - -2013
Research Foundation of State University of New York
;; Version: $Id: simple-lexicon.lisp,v
;; This file is part of SNePS.
$ BEGIN LICENSE$
The contents of this file are subject to the University at
B... | null | https://raw.githubusercontent.com/SNePS/SNePS2/d3862108609b1879f2c546112072ad4caefc050d/demo/nlint/simple-lexicon.lisp | lisp | Syntax : Common - Lisp ; Package : USER ; Base : 10 -*-
Version: $Id: simple-lexicon.lisp,v
This file is part of SNePS.
you may
not use this file except in compliance with the License. You
may obtain a copy of the License at
. edu/sneps/Downloads/ubpl.pdf.
or implied. See the License for the specific langua... |
Copyright ( C ) 1984 - -2013
Research Foundation of State University of New York
$ BEGIN LICENSE$
The contents of this file are subject to the University at
Software distributed under the License is distributed on an
" AS IS " basis , WITHOUT WARRANTY OF ANY KIND , either express
The Original Code is... |
1a5e9eff0b03f5e850d4bcec20fa84d5d110c8586706fcd910f66b9820060a9e | uwplse/synapse | verifier-test.rkt | #lang s-exp rosette
(require "util.rkt" "../opsyn/engine/verifier.rkt"
rackunit "test-runner.rkt")
(current-bitwidth 32)
(define-symbolic* x y number?)
; Trivial tests.
(define (test0)
(test-case "trivial tests"
(check-true (unsat? (verify)))
(check-true (unsat? (verify #:pre '(#f))))
(check-true (s... | null | https://raw.githubusercontent.com/uwplse/synapse/10f605f8f1fff6dade90607f516550b961a10169/test/verifier-test.rkt | racket | Trivial tests.
Valid problem. | #lang s-exp rosette
(require "util.rkt" "../opsyn/engine/verifier.rkt"
rackunit "test-runner.rkt")
(current-bitwidth 32)
(define-symbolic* x y number?)
(define (test0)
(test-case "trivial tests"
(check-true (unsat? (verify)))
(check-true (unsat? (verify #:pre '(#f))))
(check-true (sat? (verify #:p... |
5b99e9f3b269539fd3e009b83cbe93e1d33a617084bcabf1e804ceb42213844a | haskell/haskell-language-server | NoExplicitExports.expected.hs | module Test where
import Data.Monoid
newtype Something = S { foo :: Int }
class Semigroup a => SomeData a
instance SomeData All
| null | https://raw.githubusercontent.com/haskell/haskell-language-server/fdbc555a9245cb3761c2bf7335f3d18b8cf7673c/plugins/hls-refactor-plugin/test/data/import-placement/NoExplicitExports.expected.hs | haskell | module Test where
import Data.Monoid
newtype Something = S { foo :: Int }
class Semigroup a => SomeData a
instance SomeData All
| |
eb890eda95265ec84ac00e7d66fe7dc2babc484feab714a017f7aece0c8e8fde | tensorflow/haskell | QueueTest.hs | Copyright 2016 TensorFlow authors .
--
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
distr... | null | https://raw.githubusercontent.com/tensorflow/haskell/d088e30b80f1508281e400975bec9d14b431a22c/tensorflow-ops/tests/QueueTest.hs | haskell |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright 2016 TensorFlow authors .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
# LANGUAGE DataKinds #
# LANGUAGE ScopedTypeVariables #
module Main where
import Control.Monad.IO.Class (liftIO)
import Data.Int (Int64)... |
89d351a11c3eccd7a1df4a9946aed9fee822a06e9da194dea593fceeebdcb246 | mitchellwrosen/hspolls | GetMetrics.hs | module Hp.Handler.GetMetrics
( handleGetMetrics
) where
import Control.Effect
import Prometheus
handleGetMetrics ::
( Carrier sig m
, MonadIO m
)
=> m Text
handleGetMetrics = do
bytes <- exportMetricsAsText
pure (bytes ^?! strict . utf8)
| null | https://raw.githubusercontent.com/mitchellwrosen/hspolls/22efea743194ade091f7daa112a2d9ce985a4500/src/Hp/Handler/GetMetrics.hs | haskell | module Hp.Handler.GetMetrics
( handleGetMetrics
) where
import Control.Effect
import Prometheus
handleGetMetrics ::
( Carrier sig m
, MonadIO m
)
=> m Text
handleGetMetrics = do
bytes <- exportMetricsAsText
pure (bytes ^?! strict . utf8)
| |
063c282340258c53ba373107bcff8ec93750b37d005c5b73155aed5512d11b5c | mirage/irmin | store_intf.ml |
* Copyright ( c ) 2018 - 2022 Tarides < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS... | null | https://raw.githubusercontent.com/mirage/irmin/0a6fbbeb1a4d132ef25a09a41c904cc7942bae5b/src/irmin-pack/unix/store_intf.ml | ocaml | * An [irmin-pack-unix] store. This provides the common {!Irmin} interface
with [irmin-pack-unix] specific extensions.
* {1 Integrity Check}
* Checks the integrity of the repository. if [auto_repair] is [true], will
also try to fix the issues. [ppf] is a formatter for progressive
reporting. [`Fixed] ... |
* Copyright ( c ) 2018 - 2022 Tarides < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS... |
b82f1e12de538c8ae54baa6f021fa763f94b1971daa137442044f206af6ade59 | nathell/solitaire | views.cljs | (ns solitaire.views
(:require [clojure.string :as string]
[re-frame.core :as rf]
[solitaire.board :as board]
[solitaire.events :as events]
[solitaire.subs :as subs]))
(defn field-blocked []
[:div.field.field--blocked])
(defn field-empty []
[:div.field])
(defn fie... | null | https://raw.githubusercontent.com/nathell/solitaire/02c951d7886aa391b2cea6b49fc6d892dd9c0fa4/exercises/ex_03/views.cljs | clojure | (ns solitaire.views
(:require [clojure.string :as string]
[re-frame.core :as rf]
[solitaire.board :as board]
[solitaire.events :as events]
[solitaire.subs :as subs]))
(defn field-blocked []
[:div.field.field--blocked])
(defn field-empty []
[:div.field])
(defn fie... | |
d5820d61eaf5b670edd8161f3ccb5b9d5b9b63ca1b88d4e60742288f3e418b8b | MUSTE-Project/MULLE | Prune.hs | # OPTIONS_GHC -Wall -Wno - unused - top - binds -Wno - name - shadowing #
{-# Language
ConstraintKinds,
DerivingStrategies,
OverloadedStrings,
ScopedTypeVariables,
StandaloneDeriving
#-}
module Muste.Prune
( replaceAllTrees
, PruneOpts(..)
, emptyPruneOpts
) where
import Control.Monad (guard)
import qua... | null | https://raw.githubusercontent.com/MUSTE-Project/MULLE/7908a97e765a21a869ff4ee5c46def9e12360c29/muste/src/Muste/Prune.hs | haskell | # Language
ConstraintKinds,
DerivingStrategies,
OverloadedStrings,
ScopedTypeVariables,
StandaloneDeriving
#
* Replacing trees
| Replace all metavariables in a tree with corresponding branches
(i.e. they have the correct (same?) type).
* with the same type | # OPTIONS_GHC -Wall -Wno - unused - top - binds -Wno - name - shadowing #
module Muste.Prune
( replaceAllTrees
, PruneOpts(..)
, emptyPruneOpts
) where
import Control.Monad (guard)
import qualified Data.Containers as Mono
import Data.Map (Map)
import qualified Data.Map as Map
import Data.Set (Set)
import qua... |
6e9bf2f8125458922c7c3b14f98232fd7a7863f2cdb03d9f6256c4f3c9e3b337 | spawnfest/eep49ers | wxGauge.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2020 . 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 License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/spawnfest/eep49ers/d1020fd625a0bbda8ab01caf0e1738eb1cf74886/lib/wx/src/gen/wxGauge.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 KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 2008 - 2020 . 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(wxGauge).
-include("wxe.hrl").
-export([create/4,create/5,destroy/1,getRange/1,getValue/1,isVertical/1,new/0... |
30d8e5ecc6cc54771aeec8b82fc208c27e66b8fe8a9fa4c487305e2398dfd32e | freizl/dive-into-haskell | HuttonRazor.hs | -- |
module HuttonRazor where
data Expr
= Lit Integer
| Add Expr Expr
eval :: Expr -> Integer
eval (Lit i) = i
eval (Add e1 e2) = eval e1 + eval e2
printExpr :: Expr -> String
printExpr (Lit i) = show i
printExpr (Add e1 e2) = printExpr e1 ++ " + " ++ printExpr e2
main :: IO ()
main = do
let e1 = Add (Lit 90... | null | https://raw.githubusercontent.com/freizl/dive-into-haskell/b18a6bfe212db6c3a5d707b4a640170b8bcf9330/readings/haskell-book/11/HuttonRazor.hs | haskell | | | module HuttonRazor where
data Expr
= Lit Integer
| Add Expr Expr
eval :: Expr -> Integer
eval (Lit i) = i
eval (Add e1 e2) = eval e1 + eval e2
printExpr :: Expr -> String
printExpr (Lit i) = show i
printExpr (Add e1 e2) = printExpr e1 ++ " + " ++ printExpr e2
main :: IO ()
main = do
let e1 = Add (Lit 9001) (... |
ce374005901a58f211ff885755ee7ee1c4e1c7fc820e51cce0306f4d28876b5d | clojurians-org/haskell-example | S3API.hs | --
MinIO Haskell SDK , ( C ) 2017 , 2018 MinIO , Inc.
--
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... | null | https://raw.githubusercontent.com/clojurians-org/haskell-example/c96b021bdef52a121e04ea203c8c3e458770a25a/minio-migration/src/Network/Minio/S3API.hs | haskell |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing per... | MinIO Haskell SDK , ( C ) 2017 , 2018 MinIO , Inc.
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
module Network.Minio.S3API
(
Region
, getLocation
, getService
, ListObjectsResult(..)
, ListObjectsV1Resul... |
c8501fde31da0f4937ede10caecb7b65d14ed912711e174d88e1ff9923d8260f | dkochmanski/charming-clim | frame-manager.lisp |
Copyright ( c ) 2018 , ( )
;;;;
;;;; Implementation of the charming frame manager.
(in-package #:charming-clim)
(defmethod clim:make-pane-1 ((fm charming-frame-manager) (frame clim:application-frame)
type &rest initargs)
(apply #'make-instance type :frame frame :manager fm :po... | null | https://raw.githubusercontent.com/dkochmanski/charming-clim/931da8f7f888499d880ae22187ce1779d13dc11c/src/frame-manager.lisp | lisp |
Implementation of the charming frame manager. |
Copyright ( c ) 2018 , ( )
(in-package #:charming-clim)
(defmethod clim:make-pane-1 ((fm charming-frame-manager) (frame clim:application-frame)
type &rest initargs)
(apply #'make-instance type :frame frame :manager fm :port (clim:port frame) initargs))
|
25e72f07cd80d7d1216ae07449e51699c18e220ec9e2b4c18adf8097d8bbef2a | klntsky/g4ip-prover | G4ipProver.hs | module G4ipProver
( module G4ipProver.Parser
, module G4ipProver.Prover
, module G4ipProver.Proposition
, module G4ipProver.LaTeXExporter
)
where
import G4ipProver.Parser
import G4ipProver.Prover
import G4ipProver.Proposition
import G4ipProver.LaTeXExporter
| null | https://raw.githubusercontent.com/klntsky/g4ip-prover/9ec543cd3818e7d5bee88802faf600358d9ba3fd/src/G4ipProver.hs | haskell | module G4ipProver
( module G4ipProver.Parser
, module G4ipProver.Prover
, module G4ipProver.Proposition
, module G4ipProver.LaTeXExporter
)
where
import G4ipProver.Parser
import G4ipProver.Prover
import G4ipProver.Proposition
import G4ipProver.LaTeXExporter
| |
cfdf54e3786f4f88bed2ffd178f53cc41a04e35d0ba14ad80ca61e0731f684c1 | racket/redex | lazy.rkt | #lang racket
(require redex)
(provide (all-defined-out))
;; This semantics comes from the paper
;; _A Natural Semantics for Lazy Evaluation_,
by , POPL 1993
;; extended with integers, +, and if0.
(define-language L
(e ::=
v
(e x)
(let ([x e] ...) e)
x
(+ e e) ;; add addition
... | null | https://raw.githubusercontent.com/racket/redex/4c2dc96d90cedeb08ec1850575079b952c5ad396/redex-examples/redex/examples/lazy.rkt | racket | This semantics comes from the paper
_A Natural Semantics for Lazy Evaluation_,
extended with integers, +, and if0.
add addition
add conditional
don't use 'z' for values,
because that's confusing
add integer constants
renames bound occurrences of 'x' to 'y'
makes sense only when 'y' doesn't app... | #lang racket
(require redex)
(provide (all-defined-out))
by , POPL 1993
(define-language L
(e ::=
v
(e x)
(let ([x e] ...) e)
x
(λ (x) e))
(i ::= integer)
(x y z ::= variable-not-otherwise-mentioned)
(Γ Δ Θ ::= · (Γ x ↦ e)))
(define-judgment-form L
#:mode (⇓ I I O O)
#... |
ba1928de1136098dc77583509d1a30184db4ac65bbdabd11eaf8d709c4a2c7f3 | 8c6794b6/haskell-sc-scratch | THRun.hs | # LANGUAGE TemplateHaskell #
------------------------------------------------------------------------------
-- |
-- Module : $Header$
CopyRight : ( c ) 8c6794b6
-- License : BSD3
Maintainer :
-- Stability : unstable
Portability : non - portable ( concurrency specific to ghc )
--
Playing with ... | null | https://raw.githubusercontent.com/8c6794b6/haskell-sc-scratch/22de2199359fa56f256b544609cd6513b5e40f43/Scratch/TH/THRun.hs | haskell | ----------------------------------------------------------------------------
|
Module : $Header$
License : BSD3
Stability : unstable
| # LANGUAGE TemplateHaskell #
CopyRight : ( c ) 8c6794b6
Maintainer :
Portability : non - portable ( concurrency specific to ghc )
Playing with , printf runner .
module THRun where
import THSrc
main = do
putStr printfR
putStr selR
printfR :: String
printfR = $(printf "Hello, %d, %s, %d \n") 100 ... |
01b44b02c930dc29fa4460abfc4c4bea4990275ccbd5a46c7d49dad0734dc7f3 | melange-re/melange | res_driver_reason_binary.ml | open Import
module IO = Res_io
let isReasonDocComment (comment: Res_comment.t) =
let content = Res_comment.txt comment in
let len = String.length content in
if len = 0 then true
else if len >= 2 && (String.unsafe_get content 0 = '*' && String.unsafe_get content 1 = '*') then false
else if len >= 1 && (String... | null | https://raw.githubusercontent.com/melange-re/melange/d6f41989ec092eea5a623171fe5e54e17fde0d10/jscomp/napkin/res_driver_reason_binary.ml | ocaml | handle {| |} or {sql||sql} quoted strings. We don't care about its contents.
Why? // abcdef inside the quoted string would otherwise be picked up as an extra comment | open Import
module IO = Res_io
let isReasonDocComment (comment: Res_comment.t) =
let content = Res_comment.txt comment in
let len = String.length content in
if len = 0 then true
else if len >= 2 && (String.unsafe_get content 0 = '*' && String.unsafe_get content 1 = '*') then false
else if len >= 1 && (String... |
190f14889cb520b1fadd336ccebc09bccb7d49288a4c12fd9e8a52245baf3680 | harpocrates/inline-rust | Omnibus.hs | # LANGUAGE TemplateHaskell , QuasiQuotes #
module Main where
import Language.Rust.Inline ( rust, rustIO, extendContext, setCrateRoot, basic, pointers, libc )
import Foreign.Marshal ( free, withArrayLen )
import Foreign.C.String ( newCString, peekCString )
extendContext basic
extendContext pointers
extend... | null | https://raw.githubusercontent.com/harpocrates/inline-rust/5ecff8c92526000e5fc358a2dfede9b60ef59a1a/examples/Omnibus.hs | haskell | [Integers](-ffi-omnibus/integers/)
[String Arguments](-ffi-omnibus/string_arguments/)
[String Return Values](-ffi-omnibus/string_return/)
[Slice Arguments](-ffi-omnibus/slice_arguments/)
TODO: argument used twice rust | # LANGUAGE TemplateHaskell , QuasiQuotes #
module Main where
import Language.Rust.Inline ( rust, rustIO, extendContext, setCrateRoot, basic, pointers, libc )
import Foreign.Marshal ( free, withArrayLen )
import Foreign.C.String ( newCString, peekCString )
extendContext basic
extendContext pointers
extend... |
19bac2f8c53ba027a9bda9e91288d902e57311f68f863b22c594b9dc198f34db | tfausak/monadoc-5 | MigrationMismatch.hs | module Monadoc.Type.MigrationMismatch where
import qualified Control.Monad.Catch as Exception
import Monadoc.Prelude
import qualified Monadoc.Type.Sha256 as Sha256
import qualified Monadoc.Type.Timestamp as Timestamp
-- | A content mismatch when running a migration. This is thrown when the
-- digest of a migration ha... | null | https://raw.githubusercontent.com/tfausak/monadoc-5/5361dd1870072cf2771857adbe92658118ddaa27/src/lib/Monadoc/Type/MigrationMismatch.hs | haskell | | A content mismatch when running a migration. This is thrown when the
digest of a migration has changed since it was ran. Identifying these cases
is useful to ensure data consistency. | module Monadoc.Type.MigrationMismatch where
import qualified Control.Monad.Catch as Exception
import Monadoc.Prelude
import qualified Monadoc.Type.Sha256 as Sha256
import qualified Monadoc.Type.Timestamp as Timestamp
data MigrationMismatch = MigrationMismatch
{ actual :: Sha256.Sha256
, expected :: Sha256.Sha256
... |
6ac3d5fa22803a02bcf44bc9b0a17e91b72e23e13a8ac1f58c439c2365ea6d38 | DSiSc/why3 | pinterp.mli | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
(* ... | null | https://raw.githubusercontent.com/DSiSc/why3/8ba9c2287224b53075adc51544bc377bc8ea5c75/src/mlw/pinterp.mli | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
General Public License version 2.1 , with the special exception
WhyML interpretation
type value
val print_value: Format.formatter -> value -> unit
type result =
|... |
814747c0a41b7cfe64f682b07de91a825fb60df08c4830989632a0f182bf8dec | nikita-volkov/rerebase | Internal.hs | module Data.Text.Internal
(
module Rebase.Data.Text.Internal
)
where
import Rebase.Data.Text.Internal
| null | https://raw.githubusercontent.com/nikita-volkov/rerebase/25895e6d8b0c515c912c509ad8dd8868780a74b6/library/Data/Text/Internal.hs | haskell | module Data.Text.Internal
(
module Rebase.Data.Text.Internal
)
where
import Rebase.Data.Text.Internal
| |
762089f1c5a3ad1eb8f1d298d62dfb69eb3916d5d0d952e194e71106fa5f428e | lexi-lambda/racket-tulip | configure-runtime.rkt | #lang racket/base
(require megaparsack
tulip/lang/parser
tulip/lang/emitter)
(provide configure-runtime!)
(define (configure-runtime!)
(current-read-interaction
(λ (src in)
The REPL works pretty differently when used at the terminal and when used from within .
; Therefore, it’s necessa... | null | https://raw.githubusercontent.com/lexi-lambda/racket-tulip/1613cfd4d7e8dbc8ceb86cf33479375147f42b2f/tulip-lib/lang/configure-runtime.rkt | racket | Therefore, it’s necessary to branch on the result of terminal-port? so we can check what
behavior to expect.
Additionally, when readline is loaded, it installs itself in place of the terminal port with
the name 'readline-input. Therefore, we should handle that case the same way.
At the terminal, input is delimite... | #lang racket/base
(require megaparsack
tulip/lang/parser
tulip/lang/emitter)
(provide configure-runtime!)
(define (configure-runtime!)
(current-read-interaction
(λ (src in)
The REPL works pretty differently when used at the terminal and when used from within .
(if (or (terminal-port? i... |
6fc55972f10daac51ac0baa67e0749bbab30c6f4fe6db8d8bead96daf50634f2 | thierry-martinez/stdcompat | arrayLabels.mli | external length : 'a array -> int = "%array_length"
external get : 'a array -> int -> 'a = "%array_safe_get"
external set : 'a array -> int -> 'a -> unit = "%array_safe_set"
external make : int -> 'a -> 'a array = "caml_make_vect"
external create : int -> 'a -> 'a array = "caml_make_vect"
val init : int -> f:(int -> 'a... | null | https://raw.githubusercontent.com/thierry-martinez/stdcompat/83d786cdb17fae0caadf5c342e283c3dcfee2279/interfaces/3.11/arrayLabels.mli | ocaml | external length : 'a array -> int = "%array_length"
external get : 'a array -> int -> 'a = "%array_safe_get"
external set : 'a array -> int -> 'a -> unit = "%array_safe_set"
external make : int -> 'a -> 'a array = "caml_make_vect"
external create : int -> 'a -> 'a array = "caml_make_vect"
val init : int -> f:(int -> 'a... | |
1e7852e6c04c8826ec817ba8580fb5dc9b0384edd3da77dd944b1ddcf96021e5 | jabber-at/ejabberd | override_opts.erl | -module(override_opts).
-export([preprocess/2]).
override_opts(override, Config, Opts) ->
lists:foldl(fun({Opt, Value}, Conf) ->
rebar_config:set(Conf, Opt, Value)
end, Config, Opts);
override_opts(add, Config, Opts) ->
lists:foldl(fun({Opt, Value}, Conf) ->
V = rebar_config:get_local(Conf, Opt, []),
... | null | https://raw.githubusercontent.com/jabber-at/ejabberd/7bfec36856eaa4df21b26e879d3ba90285bad1aa/plugins/override_opts.erl | erlang | -module(override_opts).
-export([preprocess/2]).
override_opts(override, Config, Opts) ->
lists:foldl(fun({Opt, Value}, Conf) ->
rebar_config:set(Conf, Opt, Value)
end, Config, Opts);
override_opts(add, Config, Opts) ->
lists:foldl(fun({Opt, Value}, Conf) ->
V = rebar_config:get_local(Conf, Opt, []),
... | |
e74f61305d7a1ef9dbb1c12da5c4028c8a02d57e464c3865d1982e3047d17b11 | fracnesco/HackYourDaw | BootTidal.hs | :set -XOverloadedStrings
:set prompt ""
import Sound.Tidal.Context
import System.IO (hSetEncoding, stdout, utf8)
hSetEncoding stdout utf8
-- total latency = oLatency + cFrameTimespan
:{
customTarget = Target {oName = "Max", -- Give your target a name
oAddress = "127.0.0.1", -- the target netwo... | null | https://raw.githubusercontent.com/fracnesco/HackYourDaw/0152785a80f8094effa7988a9dd0761c37e62013/tidalcycles/BootTidal.hs | haskell | total latency = oLatency + cFrameTimespan
Give your target a name
the target network address
the target network port
the latency (to smooth network jitter
parameters
synth parameters
macro
sends | :set -XOverloadedStrings
:set prompt ""
import Sound.Tidal.Context
import System.IO (hSetEncoding, stdout, utf8)
hSetEncoding stdout utf8
:{
oSchedule = Live,
oWindow = Nothing,
oHandshake = False,
oBusPort = Nothing
... |
4f19fd9fde2a99ed88cfbc88dc78aed3ec669aba3e18f84421d4ae0af4a3c0e2 | melange-re/melange | test_static_catch_ident.ml |
exception Scan_failure of string;;
let scanf_bad_input ib = function
| Scan_failure s | Failure s ->
for i = 0 to 100 do
print_endline s; (* necessary*)
print_endline "don't inlinie"
done
| x -> raise x
| null | https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/test/test_static_catch_ident.ml | ocaml | necessary |
exception Scan_failure of string;;
let scanf_bad_input ib = function
| Scan_failure s | Failure s ->
for i = 0 to 100 do
print_endline "don't inlinie"
done
| x -> raise x
|
788d3195049e067e310c8f568e9bbc03466db15525b41aa3c5ec55fc818cc52f | bensu/doo | utils.clj | (ns doo.utils
"Taken from leiningen.core.utils"
(:require [clojure.java.io :as io]))
(defn- get-by-pattern
"Gets a value from map m, but uses the keys as regex patterns, trying
to match against k instead of doing an exact match."
[m k]
(m (first (drop-while #(nil? (re-find (re-pattern %) k))
... | null | https://raw.githubusercontent.com/bensu/doo/157d80b63483040d7ff4546bbe64531a27d39922/library/src/doo/utils.clj | clojure | (ns doo.utils
"Taken from leiningen.core.utils"
(:require [clojure.java.io :as io]))
(defn- get-by-pattern
"Gets a value from map m, but uses the keys as regex patterns, trying
to match against k instead of doing an exact match."
[m k]
(m (first (drop-while #(nil? (re-find (re-pattern %) k))
... | |
29207e2f87e6354fd1ea2987edf4c60e28dd97c37e7fb6dcc1b0080a984143ce | s-cerevisiae/leetcode-racket | 220-contains-duplicate-iii.rkt | #lang racket
(require racket/stxparam syntax/parse/define)
(define-syntax-parameter it (syntax-rules ()))
(define-syntax-parse-rule (aand x:expr xs:expr ...)
(let ([v x])
(syntax-parameterize ([it (syntax-id-rules () [_ v])])
(and v xs ...))))
(define (contains-nearby-almost-duplicate nums k t)
(define... | null | https://raw.githubusercontent.com/s-cerevisiae/leetcode-racket/c46f06fea04032e4337fcdf3ddd941a14352c847/220-contains-duplicate-iii.rkt | racket | #lang racket
(require racket/stxparam syntax/parse/define)
(define-syntax-parameter it (syntax-rules ()))
(define-syntax-parse-rule (aand x:expr xs:expr ...)
(let ([v x])
(syntax-parameterize ([it (syntax-id-rules () [_ v])])
(and v xs ...))))
(define (contains-nearby-almost-duplicate nums k t)
(define... | |
97bee7c4335c0b4ae69dcf542c4b9a0122aa8d45dcc8c2523c28f38b08c794da | GaloisInc/saw-core | Cryptol.hs | # OPTIONS_GHC -Wall #
{-# LANGUAGE DoAndIfThenElse #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternGuards #
# LANGUAGE ViewPatterns #
# LANGUAGE TupleSections #
|
Module : Verifier . SAW.Cryptol
Copyright : Galois , Inc. 2012 - 2015
License : :
Stability : experimental
Porta... | null | https://raw.githubusercontent.com/GaloisInc/saw-core/ea914a9eea8e484189ee6e4c4dcdfc7db831d987/cryptol-saw-core/src/Verifier/SAW/Cryptol.hs | haskell | # LANGUAGE DoAndIfThenElse #
# LANGUAGE OverloadedStrings #
------------------------------------------------------------------------------
Type Environments
| SharedTerms are paired with a deferred shift amount for loose variables
^ Type variables are referenced by unique id
^ Term variables are referenced by name
... | # OPTIONS_GHC -Wall #
# LANGUAGE PatternGuards #
# LANGUAGE ViewPatterns #
# LANGUAGE TupleSections #
|
Module : Verifier . SAW.Cryptol
Copyright : Galois , Inc. 2012 - 2015
License : :
Stability : experimental
Portability : non - portable ( language extensions )
Module : Veri... |
88889a246c87d939ebc4f7d819f3b7eef22d76f704dcff4ea2e8514ae8be850f | timothypratley/leaderboardx | attributes.cljs | (ns algopop.leaderboardx.app.views.attributes
(:require [algopop.leaderboardx.app.firebase :as firebase]
[algopop.leaderboardx.app.views.common :as common]))
(defn attributes-view []
[firebase/on (firebase/user-entities-path)
(fn [entities r]
(prn "E" @entities)
[:div
[common/entity-... | null | https://raw.githubusercontent.com/timothypratley/leaderboardx/ad1719b3bb49fb7ab495ed833f1a451ebb3aec4d/src/algopop/leaderboardx/app/views/attributes.cljs | clojure | (ns algopop.leaderboardx.app.views.attributes
(:require [algopop.leaderboardx.app.firebase :as firebase]
[algopop.leaderboardx.app.views.common :as common]))
(defn attributes-view []
[firebase/on (firebase/user-entities-path)
(fn [entities r]
(prn "E" @entities)
[:div
[common/entity-... | |
81c704a6e9539cc1058edd906b1863360c55a6006b1e2159b1f388403a55bc02 | erlangonrails/devdb | mod_configure2.erl | %%%----------------------------------------------------------------------
%%% File : mod_configure2.erl
Author : < >
%%% Purpose : Support for online configuration of ejabberd
Created : 26 Oct 2003 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2010 ProcessOne
%%%
%%% This program is free software... | null | https://raw.githubusercontent.com/erlangonrails/devdb/0e7eaa6bd810ec3892bfc3d933439560620d0941/dev/ejabberd-2.1.4/src/mod_configure2.erl | erlang | ----------------------------------------------------------------------
File : mod_configure2.erl
Purpose : Support for online configuration of ejabberd
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 i... | Author : < >
Created : 26 Oct 2003 by < >
ejabberd , Copyright ( C ) 2002 - 2010 ProcessOne
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License
Founda... |
08e3f4db8adc73f94ec2855e526b95f6536c1c7423fbd5b2688fcb3ea8eb0dcc | Armael/doggybag | patch.ml | type loc = { offset: int; size: int }
let find_section_loc (section_name: string) sections : loc =
let offset = ref (-1L) in
let size = ref (-1) in
Array.iter (fun s ->
if s.Elf.sh_name_str = section_name then (
offset := s.Elf.sh_offset;
size := s.Elf.sh_size;
)
) sections;
if !offset < ... | null | https://raw.githubusercontent.com/Armael/doggybag/49693ccb7d23af5496d5a8651de4bacfd50e3ec9/libelf/patch.ml | ocaml | in case [f] moved around in the file
final \0
sanity check: patches must not overlap
End_of_file | type loc = { offset: int; size: int }
let find_section_loc (section_name: string) sections : loc =
let offset = ref (-1L) in
let size = ref (-1) in
Array.iter (fun s ->
if s.Elf.sh_name_str = section_name then (
offset := s.Elf.sh_offset;
size := s.Elf.sh_size;
)
) sections;
if !offset < ... |
3906d48f6e5375d586535726ec5ddcc52af73c282d4c49ecf56a797d7e11be80 | facebookarchive/pfff | callgraph_php_build.ml |
*
* Copyright ( C ) 2012 Facebook
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file licens... | null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/lang_php/analyze/foundation/callgraph_php_build.ml | ocaml | ***************************************************************************
Prelude
***************************************************************************
* Small wrapper around Abstract_interpreter_php.program with
* a functional interface (it returns a callgraph).
*****************************************... |
*
* Copyright ( C ) 2012 Facebook
*
* This library is free software ; you can redistribute it and/or
* modify it under the terms of the GNU Lesser General Public License
* version 2.1 as published by the Free Software Foundation , with the
* special exception on linking described in file licens... |
d80f1c8c054a439415d17ba27241f2a2ab922f0afe44d907289dde083f25c28c | TrustInSoft/tis-kernel | analyses_manager.ml | (**************************************************************************)
(* *)
This file is part of .
(* *)
is a fork of Frama - C. Al... | null | https://raw.githubusercontent.com/TrustInSoft/tis-kernel/748d28baba90c03c0f5f4654d2e7bb47dfbe4e7d/src/plugins/gui/analyses_manager.ml | ocaml | ************************************************************************
... | This file is part of .
is a fork of Frama - C. All the differences are :
Copyright ( C ) 2016 - 2017
is released under GPLv2
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015 ... |
79540ae4a5b85a600dd798d4f72190edd7d6197009c2945c034f58d3478cbcc9 | racket/redex | stlc-8.rkt | #lang racket/base
(require redex/benchmark
"util.rkt"
redex/reduction-semantics)
(provide (all-defined-out))
(define the-error "lookup always returns int")
(define-rewrite bug8
[(lookup (x σ Γ) x)
σ]
==>
[(lookup (x σ Γ) x)
int]
#:context (define-metafunction)
#:once-only)
(include... | null | https://raw.githubusercontent.com/racket/redex/4c2dc96d90cedeb08ec1850575079b952c5ad396/redex-benchmark/redex/benchmark/models/stlc%2Blists/stlc-8.rkt | racket | #lang racket/base
(require redex/benchmark
"util.rkt"
redex/reduction-semantics)
(provide (all-defined-out))
(define the-error "lookup always returns int")
(define-rewrite bug8
[(lookup (x σ Γ) x)
σ]
==>
[(lookup (x σ Γ) x)
int]
#:context (define-metafunction)
#:once-only)
(include... | |
4e846ab1ddf3c572285aec9d4fb3f56db79c7fc3ca6277a2f5c88d9fd3935c20 | nasa/Common-Metadata-Repository | dif10.clj | (ns cmr.umm-spec.test.xml-to-umm-mappings.dif10
(:require [clj-time.core :as t]
[clojure.test :refer :all]
[cmr.common.util :as common-util :refer [are3]]
[cmr.umm-spec.xml-to-umm-mappings.dif10 :as parse]))
(def options {:sanitize? true})
(deftest dif10-standard-product-test
;... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/371be298e3eb9b80041d1ac661d7cde85978012e/umm-spec-lib/test/cmr/umm_spec/test/xml_to_umm_mappings/dif10.clj | clojure | Note: At this unit test level, all the values returned are strings.
Eventually, parse-umm-c in cmr.umm-spec.json-schema converts them to proper boolean values. | (ns cmr.umm-spec.test.xml-to-umm-mappings.dif10
(:require [clj-time.core :as t]
[clojure.test :refer :all]
[cmr.common.util :as common-util :refer [are3]]
[cmr.umm-spec.xml-to-umm-mappings.dif10 :as parse]))
(def options {:sanitize? true})
(deftest dif10-standard-product-test
T... |
d8973ff79ff4dacea5ccaddc1a4c1a9e5518efe9c460590b36e35938879495c7 | tonyg/kali-scheme | mumble-packages.scm | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
This is for version 0.28
We define these two because they are n't reified :
; scheme-level-0
; silly
We redefine these two so as not to compromise the security of the
; built-in excepti... | null | https://raw.githubusercontent.com/tonyg/kali-scheme/79bf76b4964729b63fce99c4d2149b32cb067ac0/scheme/debug/mumble-packages.scm | scheme | scheme-level-0
silly
built-in exception and interrupt systems:
primitives
signals
Suppose you have just done "make image" to build the scheme48 heap image.
Suppose that the linker produces an initial.image, but that when that
image is resumed you get the error
exception handler is not a closure
Th... | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
This is for version 0.28
We define these two because they are n't reified :
We redefine these two so as not to compromise the security of the
two choices :
( 1 ) Run the image under... |
8a6e29f81d9958b0efc64bbdc07caa9268f3e064d6a1198361dd1edfefdbaea3 | jbracker/supermonad | Name.hs |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* H M T C *
* ... | null | https://raw.githubusercontent.com/jbracker/supermonad/2595396a225a65b1dce6ed9a1ce59960f392a55b/examples/monad/hmtc/original/Name.hs | haskell | | Representation of names. Types, variables, procedures, operators ... |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* H M T C *
* ... |
908d9787e81d6203ce347eb3d19b202015186917994ae74679642d8dad51ac55 | monadbobo/ocaml-core | tail.ml | open Core.Std
open Import
module Stream = Raw_stream
module Tail = Raw_tail
type ('a, 'execution_context) t_ = ('a, 'execution_context) Tail.t =
{ mutable next: (('a, 'execution_context) Stream.next, 'execution_context) Raw_ivar.t;
}
type 'a t = ('a, Execution_context.t) Tail.t with sexp_of
let create = Tail.cr... | null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/async/core/lib/tail.ml | ocaml | open Core.Std
open Import
module Stream = Raw_stream
module Tail = Raw_tail
type ('a, 'execution_context) t_ = ('a, 'execution_context) Tail.t =
{ mutable next: (('a, 'execution_context) Stream.next, 'execution_context) Raw_ivar.t;
}
type 'a t = ('a, Execution_context.t) Tail.t with sexp_of
let create = Tail.cr... | |
86932acf5ae9080e7bbaa3a2958a8d62f19548517b8c074fcd801bef3e71c2a9 | codecation/maize | draw.cljs | (ns maze.draw)
(def maze-size 20)
(def cell-size-in-pixels 25)
(def maze-size-in-pixels (* maze-size cell-size-in-pixels))
(def wall-width-in-pixels 2)
(defn- make-context []
"Creates the native js context object"
(let [canvas (.getElementById js/document "maze-canvas")
context (.getContext canvas "2d")]
... | null | https://raw.githubusercontent.com/codecation/maize/017bf53011c2359fb73d9a0ed72cad66f74e5260/src-cljs/maze/draw.cljs | clojure | (ns maze.draw)
(def maze-size 20)
(def cell-size-in-pixels 25)
(def maze-size-in-pixels (* maze-size cell-size-in-pixels))
(def wall-width-in-pixels 2)
(defn- make-context []
"Creates the native js context object"
(let [canvas (.getElementById js/document "maze-canvas")
context (.getContext canvas "2d")]
... | |
cc36afbba2633709234c8d15a2337b556297b2cd5cffa13a56164db35a68a74f | zarkone/stumpwm.d | ttf-fonts.lisp | ttf-fonts.lisp
(in-package #:ttf-fonts)
(export '(font-exists-p open-font close-font font-ascent font-descent text-line-width draw-image-glyphs))
;;; "ttf-fonts" goes here. Hacks and glory await!
TTF fonts
(defmethod font-exists-p ((font xft:font))
;; if we can list the font then it exists
t)
(defmethod open-... | null | https://raw.githubusercontent.com/zarkone/stumpwm.d/021e51c98a80783df1345826ac9390b44a7d0aae/modules/util/ttf-fonts/ttf-fonts.lisp | lisp | "ttf-fonts" goes here. Hacks and glory await!
if we can list the font then it exists | ttf-fonts.lisp
(in-package #:ttf-fonts)
(export '(font-exists-p open-font close-font font-ascent font-descent text-line-width draw-image-glyphs))
TTF fonts
(defmethod font-exists-p ((font xft:font))
t)
(defmethod open-font ((display xlib:display) (font xft:font))
font)
(defmethod close-font ((font xft:font))... |
18872b105b3c780990c1d2b219878a5bd7f39a963564d18038143b2155a842c8 | eholk/harlan | fix-kernel-local-regions.scm | (library
(harlan middle fix-kernel-local-regions)
(export fix-kernel-local-regions)
(import
(rnrs)
(nanopass)
(except (elegant-weapons helpers) ident?)
(elegant-weapons print-c)
(harlan compile-opts)
(harlan middle languages M8)
(harlan helpers)
(util compat))
(define in-kernel? (make-par... | null | https://raw.githubusercontent.com/eholk/harlan/3afd95b1c3ad02a354481774585e866857a687b8/harlan/middle/fix-kernel-local-regions.scm | scheme | (library
(harlan middle fix-kernel-local-regions)
(export fix-kernel-local-regions)
(import
(rnrs)
(nanopass)
(except (elegant-weapons helpers) ident?)
(elegant-weapons print-c)
(harlan compile-opts)
(harlan middle languages M8)
(harlan helpers)
(util compat))
(define in-kernel? (make-par... | |
6a2a6553c5472370eb819e767896ff016cb39f8eda2190d25cce2878476beab9 | fogus/minderbinder | convert_test.clj | (ns minderbinder.convert-test
(:use [minderbinder.core] :reload)
(:require minderbinder.time)
(:use [clojure.test]))
(deftest test-time-units
(is (= 1000 (minderbinder.time/parse-time-unit [1 :second])))
(is (= 1000 #unit/time [1 :second])))
| null | https://raw.githubusercontent.com/fogus/minderbinder/93534e9dd4e476d1fb4ed5badc254f7acbe6f34d/test/minderbinder/convert_test.clj | clojure | (ns minderbinder.convert-test
(:use [minderbinder.core] :reload)
(:require minderbinder.time)
(:use [clojure.test]))
(deftest test-time-units
(is (= 1000 (minderbinder.time/parse-time-unit [1 :second])))
(is (= 1000 #unit/time [1 :second])))
| |
eeb9598dd3d5ac331dffcfed538c0ed2a07ca661c7c8edae2bef8e1712967d5b | Ptival/yugioh | Operation.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
# LANGUAGE KindSignatures #
# LANGUAGE LambdaCase #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeOperators #
module YuGiOh.Operation
( Operation,
... | null | https://raw.githubusercontent.com/Ptival/yugioh/855e8f22c3ff322c7ca1d0a1fa96c50a54724aeb/lib/YuGiOh/Operation.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE GADTs #
# LANGUAGE RankNTypes #
| Some operations may be derived from other operations
When the source's attack is greater than the target's attack, the
target is destroyed, and damage is inflicted to the target player.
When the source's attack is equal to the target's attack... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE KindSignatures #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeOperators #
module YuGiOh.Operation
( Operation,
addCardToHand,
attack,
chooseMove,
directAttack,
drawCard,
end... |
5c9c77b108d8ccadea7568167e7292e24f522a858c77353e5c33658eac3acaaa | jumarko/clojure-experiments | half_truth.clj | (ns four-clojure.half-truth)
;;;
;;; Write a function that takes variable number of booleans.
;;; Your function should return true if some of the parameters are true, but not all of the parameters are true.
;;; Otherwise your function should return false
(defn half-truth [& args]
(and
(not-every? true? args)
... | null | https://raw.githubusercontent.com/jumarko/clojure-experiments/f0f9c091959e7f54c3fb13d0585a793ebb09e4f9/src/clojure_experiments/four_clojure/half_truth.clj | clojure |
Write a function that takes variable number of booleans.
Your function should return true if some of the parameters are true, but not all of the parameters are true.
Otherwise your function should return false
notice that we can't use the resut of "some" directly since it returns nil in case the condition is not ... | (ns four-clojure.half-truth)
(defn half-truth [& args]
(and
(not-every? true? args)
(true? ( some true? args))))
(defn half-truth [& args]
(and
(not-every? true? args)
(not-every? false? args)))
(= false (half-truth false false))
(= true (half-truth true false))
(= false (half-truth true))
(= tr... |
dc037d17a090c18c08ea13e03404e1d8ad76a510da281929241a2af9057d99b7 | synergistics/chemlambda-hask | Port.hs | module Chemlambda.Core.Port
where
data PortType = LO | LI | RO | RI | MO | MI
deriving ( Eq, Ord, Show )
data Direction = I | O
deriving ( Eq, Ord, Show )
isOut :: PortType -> Bool
isOut = flip elem [LO, RO, MO]
isIn :: PortType -> Bool
isIn = flip elem [LI, RI, MI]
direction :: PortType -> Direction
directi... | null | https://raw.githubusercontent.com/synergistics/chemlambda-hask/6a51981d88b950490f38559e3e4c5d109da22fc5/chemlambda-core/Chemlambda/Core/Port.hs | haskell | module Chemlambda.Core.Port
where
data PortType = LO | LI | RO | RI | MO | MI
deriving ( Eq, Ord, Show )
data Direction = I | O
deriving ( Eq, Ord, Show )
isOut :: PortType -> Bool
isOut = flip elem [LO, RO, MO]
isIn :: PortType -> Bool
isIn = flip elem [LI, RI, MI]
direction :: PortType -> Direction
directi... | |
332ff5cde1adbc640ac64ec0c0e012384bde9c964d348d7895b6ee8c2319385e | jrm-code-project/LISP-Machine | ni.lisp | -*- Mode : LISP ; Package : I ; ; : CL -*-
(defstruct (pkt-history (:type :list))
pkt
direction
time
)
(defvar *pkt-history* nil)
(defvar *enable-pkt-history* nil)
(defun record (pkt direction)
(when *enable-pkt-history*
(let ((save-pkt (get-pkt)))
(copy-array-contents pkt save... | null | https://raw.githubusercontent.com/jrm-code-project/LISP-Machine/0a448d27f40761fafabe5775ffc550637be537b2/lambda/pace/ni.lisp | lisp | Package : I ; ; : CL -*-
ih-source-address
ih-source-address
ih-dest-address
ih-dest-address
(record ip :received)
(recored int-pkt :transmited)
when the user closes, you send FIN, and go to fin-wait-1
when the ACK for the FIN comes back, change to FIN-WAIT-2
if you receive FIN before ack of FIN, go to CL... |
(defstruct (pkt-history (:type :list))
pkt
direction
time
)
(defvar *pkt-history* nil)
(defvar *enable-pkt-history* nil)
(defun record (pkt direction)
(when *enable-pkt-history*
(let ((save-pkt (get-pkt)))
(copy-array-contents pkt save-pkt)
(let ((struct (make-pkt-history
... |
284960ed4ad302406fdb8e68530d31076aac2e8e7a7c71b3712429e37b956914 | dvingo/cljs-emotion | helix_cards.cljs | (ns dv.cljs-emotion.helix-cards
(:require
[devcards.core :as dc :refer (defcard)]
[dv.cljs-emotion.fulcro-cards]
[dv.cljs-emotion.reagent-cards]
[dv.cljs-emotion.reagent-debug]
[dv.cljs-emotion.debug]
[dv.cljs-emotion.target-styled]
[dv.emotion-helix-dom :as d]
[dv.cljs-emotion :as em]... | null | https://raw.githubusercontent.com/dvingo/cljs-emotion/0e2d7339657bd2957f03fbf8f4bb4a97b4fefc81/src/dev/dv/cljs_emotion/helix_cards.cljs | clojure | (ns dv.cljs-emotion.helix-cards
(:require
[devcards.core :as dc :refer (defcard)]
[dv.cljs-emotion.fulcro-cards]
[dv.cljs-emotion.reagent-cards]
[dv.cljs-emotion.reagent-debug]
[dv.cljs-emotion.debug]
[dv.cljs-emotion.target-styled]
[dv.emotion-helix-dom :as d]
[dv.cljs-emotion :as em]... | |
e81a79b1c8a1d0c4a3bd60aa162ee4f6ee3464a637156c2759f2e643e8ffc701 | Ericsson/ered | ered_client.erl | -module(ered_client).
Queues messages for a specific node . Manages reconnects and resends
%% in case of error. Reports connection status with status messages.
This is implemented as one gen_server for message queue and a
%% separate process to handle reconnects.
-behaviour(gen_server).
%% API
-export([start_li... | null | https://raw.githubusercontent.com/Ericsson/ered/9667078018fab49fe38325c2677e2ef4d2c65e9e/src/ered_client.erl | erlang | in case of error. Reports connection status with status messages.
separate process to handle reconnects.
API
gen_server callbacks
===================================================================
Definitions
===================================================================
set to true when full, false when re... | -module(ered_client).
Queues messages for a specific node . Manages reconnects and resends
This is implemented as one gen_server for message queue and a
-behaviour(gen_server).
-export([start_link/3,
stop/1, deactivate/1, reactivate/1,
command/2, command/3,
command_async/3]).
-export... |
9a4385cb77292becd2db36e4017149b05db6eb78cd6c43140774553c87e7a420 | haskell/haskell-language-server | PragmasShebangsAndModuleDecl.hs | {-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -Wall #
#! /usr/bin/env nix-shell
pure -i runghc -p " haskellPackages.ghcWithPackages ( hp : with ; [ turtle ] ) "
module Test where
class Semigroup a => SomeData a
instance SomeData All
| null | https://raw.githubusercontent.com/haskell/haskell-language-server/fdbc555a9245cb3761c2bf7335f3d18b8cf7673c/plugins/hls-refactor-plugin/test/data/import-placement/PragmasShebangsAndModuleDecl.hs | haskell | # LANGUAGE OverloadedStrings # | # OPTIONS_GHC -Wall #
#! /usr/bin/env nix-shell
pure -i runghc -p " haskellPackages.ghcWithPackages ( hp : with ; [ turtle ] ) "
module Test where
class Semigroup a => SomeData a
instance SomeData All
|
1e977c9761007262ce20e91bd419238bd8b989b0d81dfaca53f03db9c85bc7b2 | vikram/lisplibraries | abcl.lisp |
(in-package :trivial-sockets)
(defun resolve-hostname (name)
(cond
((eql name :any) "0.0.0.0")
((typep name '(vector * 4)) (format nil "~{~A~^.~}" (coerce name 'list)))
(t name)))
(defun open-stream (peer-host peer-port
&key (local-host :any) (local-port 0)
... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/ucw-boxset/dependencies/trivial-sockets_until-i-can-merge-with-the-mainline/abcl.lisp | lisp |
(in-package :trivial-sockets)
(defun resolve-hostname (name)
(cond
((eql name :any) "0.0.0.0")
((typep name '(vector * 4)) (format nil "~{~A~^.~}" (coerce name 'list)))
(t name)))
(defun open-stream (peer-host peer-port
&key (local-host :any) (local-port 0)
... | |
ffb42a895bdc5f9841ee008b73297fa66d67443bc4a3430074a25b86ef69c073 | k0dev/erlang-notes | merge_sort.erl | -module(merge_sort).
-export([merge_sort/1, merge_sort/2]).
implementazione naive , processo per ogni sublist ( anche se la lista ) , per liste grandi
merge([], [], C, _) -> lists:reverse(C);
merge([], [B|BS], C, P) ->
merge([], BS, [B|C], P);
merge([A|AS], [], C, P) ->
merge(AS, [], [A|C], P);
merge([A... | null | https://raw.githubusercontent.com/k0dev/erlang-notes/3832149bddce387a3d002ca027f7100afaf42eca/code/other/merge_sort.erl | erlang | -module(merge_sort).
-export([merge_sort/1, merge_sort/2]).
implementazione naive , processo per ogni sublist ( anche se la lista ) , per liste grandi
merge([], [], C, _) -> lists:reverse(C);
merge([], [B|BS], C, P) ->
merge([], BS, [B|C], P);
merge([A|AS], [], C, P) ->
merge(AS, [], [A|C], P);
merge([A... | |
97c0efdfe74fca1be7553e8ff4c00a33332a76026930af7444296eaf357052c1 | theodormoroianu/SecondYearCourses | test2.hs | import Data.Char
import Data.List
import Test.QuickCheck
data Clasament = Cl [String] deriving Show
exista :: String -> Clasament -> Bool
exista s (Cl strs) =
any (isPrefixOf s) strs
extrage :: String -> [Clasament] -> [Clasament]
extrage s =
filter (exista s)
pozitie :: Clasament -> Clasament -> [String]... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/99185b0e97119135e7301c2c7be0f07ae7258006/Haskell/Teste/test2.hs | haskell | import Data.Char
import Data.List
import Test.QuickCheck
data Clasament = Cl [String] deriving Show
exista :: String -> Clasament -> Bool
exista s (Cl strs) =
any (isPrefixOf s) strs
extrage :: String -> [Clasament] -> [Clasament]
extrage s =
filter (exista s)
pozitie :: Clasament -> Clasament -> [String]... | |
b4edf0a0d6c56e9ed898b28f423c06dd6f6dc13dc4a9940527e5a80f9f1d3d1e | mejgun/haskell-tdlib | SendChatScreenshotTakenNotification.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Query.SendChatScreenshotTakenNotification where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
-- |
-- Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats @chat_id Ch... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/81516bd04c25c7371d4a9a5c972499791111c407/src/TD/Query/SendChatScreenshotTakenNotification.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
Sends a notification about a screenshot taken in a chat. Supported only in private and secret chats @chat_id Chat identifier
| |
module TD.Query.SendChatScreenshotTakenNotification where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
data SendChatScreenshotTakenNotification = SendChatScreenshotTakenNotification
chat_id :: Maybe Int
}
deriving (Eq)
instance Show SendChatScreenshotTa... |
409597c87c52f47f768ea057c564c63e38ba05076c579dd85173c5ec3797fd08 | PacktPublishing/Haskell-High-Performance-Programming | pipes-exceptions.hs | -- file: pipes-exceptions.hs
import Control.Exception
import Pipes
import GHC.IO.Exception (IOException(..))
tolerantStdinLn :: Producer' String IO ()
tolerantStdinLn = do
x <- lift $ try readLn
case x of
Left e@IOError{} -> return ()
Right ln -> yield ln >> tolerantStdinLn
| null | https://raw.githubusercontent.com/PacktPublishing/Haskell-High-Performance-Programming/2b1bfdb8102129be41e8d79c7e9caf12100c5556/Chapter06/pipes-exceptions.hs | haskell | file: pipes-exceptions.hs |
import Control.Exception
import Pipes
import GHC.IO.Exception (IOException(..))
tolerantStdinLn :: Producer' String IO ()
tolerantStdinLn = do
x <- lift $ try readLn
case x of
Left e@IOError{} -> return ()
Right ln -> yield ln >> tolerantStdinLn
|
42873059556b62b567baeae346701db20fd4baf8f4fdf44c875bb74735c89b5a | russmatney/reframe-games | views.cljs | (ns games.controls.views
(:require
[re-frame.core :as rf]
[games.subs :as subs]
[games.views.components :as components]))
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;; Controls-mini
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
(defn ... | null | https://raw.githubusercontent.com/russmatney/reframe-games/ff05f6ad4794e4505b6231522af0c90c3e212631/src/games/controls/views.cljs | clojure |
Controls-mini
| (ns games.controls.views
(:require
[re-frame.core :as rf]
[games.subs :as subs]
[games.views.components :as components]))
(defn mini-text
"Lists passed controls in text.
The expected controls passed are the control's `:id`"
[{:keys [controls]}]
[components/widget
{:style
{:padding "0.9rem"
... |
7f262d1f88c05eb82e8dca2b449d4737479d7fc7bfeef64b03b98b41d6665b93 | janestreet/ppx_typed_fields | variant_generator.ml | open Base
open Import
open Ppxlib
open Type_kind_intf
open Variant_kind_generator_intf
(* The structure items will be inserted after the type type
definitions and before any other items.*)
let extra_structure_items_to_insert _ = []
let generate_constructor_declarations ~loc ~elements_to_convert ~core_type_params =... | null | https://raw.githubusercontent.com/janestreet/ppx_typed_fields/6d1a2a68580ce7d7979aa6538cb8a6206a8404d5/src/variant_generator.ml | ocaml | The structure items will be inserted after the type type
definitions and before any other items.
Disables unused variable warning.
Disables unused match case warning.
Given a list of label declarations, will generate a pattern that destructs the record,
e.g. given
a : int
b : float
generates:
... | open Base
open Import
open Ppxlib
open Type_kind_intf
open Variant_kind_generator_intf
let extra_structure_items_to_insert _ = []
let generate_constructor_declarations ~loc ~elements_to_convert ~core_type_params =
let open (val Ast_builder.make loc) in
let unique_parameter_name = Type_kind_intf.generate_unique_id... |
ebe0ac9f6e7914a44e6d6e72c3a5aed15a3d16f29bfb7dcb2cc7ce2f741e2ce6 | clojure-interop/aws-api | core.clj | (ns com.amazonaws.services.kafka.core
(:refer-clojure :only [require comment defn ->])
(:import ))
(require '[com.amazonaws.services.kafka.AWSKafka])
(require '[com.amazonaws.services.kafka.AWSKafkaAsync])
(require '[com.amazonaws.services.kafka.AWSKafkaAsyncClient])
(require '[com.amazonaws.services.kafka.AWSKafk... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.kafka/src/com/amazonaws/services/kafka/core.clj | clojure | (ns com.amazonaws.services.kafka.core
(:refer-clojure :only [require comment defn ->])
(:import ))
(require '[com.amazonaws.services.kafka.AWSKafka])
(require '[com.amazonaws.services.kafka.AWSKafkaAsync])
(require '[com.amazonaws.services.kafka.AWSKafkaAsyncClient])
(require '[com.amazonaws.services.kafka.AWSKafk... | |
ae49ae16ae4f5de9dca35edffaa13503b29f44945b9afbafda0f4ddd06a18e1d | angavrilov/ecl-compute | cse.lisp | ;;; -*- mode:lisp; indent-tabs-mode: nil; -*-
(in-package fast-compute)
(defun count-subexprs (expr &key
(test #'eql)
(table (make-hash-table :test test)))
(labels ((recurse (expr)
;; Increment the counter, and avoid walking trees twice
(when (... | null | https://raw.githubusercontent.com/angavrilov/ecl-compute/466f0d287f8b6ab0e2b5c2ac03693ad4f4df6a3f/expr/cse.lisp | lisp | -*- mode:lisp; indent-tabs-mode: nil; -*-
Increment the counter, and avoid walking trees twice
Determine expressions to factor off
Factor common subexpressions
Factor symbols
Factor temporaries and arrays
assignment, and also somewhere else
Factor loop-invariant subexpressions
Don't factor constants and loop v... |
(in-package fast-compute)
(defun count-subexprs (expr &key
(test #'eql)
(table (make-hash-table :test test)))
(labels ((recurse (expr)
(when (> (incf-nil (gethash expr table)) 1)
(return-from recurse nil))
(match expr
... |
183a6335341c9a251b165362962d0ac48ec82b7d54c0b15ce3d6730aadaf438a | input-output-hk/high-assurance-legacy | Thread.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE UndecidableInstances #
module Simulation.Thread
( ThreadF(..)
, ThreadT(..)
, Thread
) where
import Control.Monad.IO.Class
import Control.Monad.Reader.Class
import Control.Monad.State.Class
import Control.Monad.Trans.Class
im... | null | https://raw.githubusercontent.com/input-output-hk/high-assurance-legacy/ee90add31d3fa286322144219092d60fe854bf8d/Exploration/%CE%94Q%20simulation/src/Simulation/Thread.hs | haskell | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE UndecidableInstances #
module Simulation.Thread
( ThreadF(..)
, ThreadT(..)
, Thread
) where
import Control.Monad.IO.Class
import Control.Monad.Reader.Class
import Control.Monad.State.Class
import Control.Monad.Trans.Class
im... | |
bef807db7890fe08cdb10d85f4c7f55120006b680af938dc73e84cdbad329a1d | realworldocaml/examples | basic_md5_with_opt_flags.ml | open Core.Std
open Cryptokit
let checksum_from_string buf =
hash_string (Hash.md5 ()) buf
|> transform_string (Hexa.encode ())
|> print_endline
let checksum_from_file filename =
let ic = match filename with
| "-" -> In_channel.stdin
| _ -> In_channel.create ~binary:true filename
in
hash_channel ... | null | https://raw.githubusercontent.com/realworldocaml/examples/32ea926861a0b728813a29b0e4cf20dd15eb486e/code/command-line-parsing/basic_md5_with_opt_flags.ml | ocaml | open Core.Std
open Cryptokit
let checksum_from_string buf =
hash_string (Hash.md5 ()) buf
|> transform_string (Hexa.encode ())
|> print_endline
let checksum_from_file filename =
let ic = match filename with
| "-" -> In_channel.stdin
| _ -> In_channel.create ~binary:true filename
in
hash_channel ... | |
1164c2bc3aca125fae6c740bc97e41a86c5b8b05246aa101d8fd8cabfbb6f2e6 | reactorlabs/sourir | disasm.ml | open Instr
let no_line_number buf pc = ()
let line_number buf pc = Printf.bprintf buf "% 6d |" pc
let pr = Printf.bprintf
let rec dump_comma_separated how buf what =
match what with
| [] -> ()
| [e] -> how buf e
| e::t -> pr buf "%a, %a" how e (dump_comma_separated how) t
let disassemble_instrs buf ?(ott_co... | null | https://raw.githubusercontent.com/reactorlabs/sourir/381289c294157e58b257ec8edb9d5005b8a66daf/disasm.ml | ocaml | TODO: disassemble annotations | open Instr
let no_line_number buf pc = ()
let line_number buf pc = Printf.bprintf buf "% 6d |" pc
let pr = Printf.bprintf
let rec dump_comma_separated how buf what =
match what with
| [] -> ()
| [e] -> how buf e
| e::t -> pr buf "%a, %a" how e (dump_comma_separated how) t
let disassemble_instrs buf ?(ott_co... |
5d7e676ef1d623935b3e9c6bb7e57df956b8ce5daefc319ad3ee285b3dc0b8a2 | zenhack/haskell-capnp | Untyped.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedLabels #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE RankNTypes #-}
# LANGUAGE RecordWil... | null | https://raw.githubusercontent.com/zenhack/haskell-capnp/97a893f57b8494d8d06f892d292bba9384c032a6/lib/Capnp/Rpc/Untyped.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
|
This module does not deal with schema-level concepts; all capabilities,
methods etc. as used here are untyped.
* Connections to other vats
* Clients for capabilities
* Promise pipelining
* Exporting local objects
* Unwrapping local clients
* Waiting for... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedLabels #
# LANGUAGE RecordWildCards #
# LANGUAGE RecursiveDo #
# LANGUAGE ScopedTypeVariable... |
991ef9ecd94b0cb92d160552f3fe395a4fcf2c6217da511de3ebce9fc34b59f8 | i-am-tom/learn-me-a-haskell | Options.hs | # LANGUAGE CPP #
# LANGUAGE DeriveFunctor #
module Options (
Result(..)
, Run(..)
, defaultMagic
, defaultFastMode
, defaultPreserveIt
, defaultVerbose
, parseOptions
#ifdef TEST
, usage
, info
, versionInfo
#endif
) where
import Prelude ()
import Prelude.Compat
import Data.List.Compat... | null | https://raw.githubusercontent.com/i-am-tom/learn-me-a-haskell/08271f6cdd4fc88c26ed7a62ed1e786a900824be/vendor/doctest-0.16.0/src/Options.hs | haskell | # LANGUAGE CPP #
# LANGUAGE DeriveFunctor #
module Options (
Result(..)
, Run(..)
, defaultMagic
, defaultFastMode
, defaultPreserveIt
, defaultVerbose
, parseOptions
#ifdef TEST
, usage
, info
, versionInfo
#endif
) where
import Prelude ()
import Prelude.Compat
import Data.List.Compat... | |
fd2cca4dcfdd8654e1f433197a938f9003a610c9e5fbff87dd9e147e427a7b9a | GaloisInc/saw-core | BitBlast.hs | # LANGUAGE CPP #
# LANGUAGE LambdaCase #
{-# LANGUAGE RankNTypes #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE ViewPatterns #
{-# LANGUAGE EmptyDataDecls #-}
# LANGUAGE TypeFamilies #
|
Module : Verifier . SAW.Simulator . BitBlast
Copyright : Galois , Inc. 2012 - 201... | null | https://raw.githubusercontent.com/GaloisInc/saw-core/6e32c659fdadfcf99d3d586e7dcda2b7bd9a0e10/saw-core-aig/src/Verifier/SAW/Simulator/BitBlast.hs | haskell | # LANGUAGE RankNTypes #
# LANGUAGE OverloadedStrings #
# LANGUAGE EmptyDataDecls #
----------------------------------------------------------
Vector operations
----------------------------------------------------------
Values
----------------------------------------------------------
---------------------------------... | # LANGUAGE CPP #
# LANGUAGE LambdaCase #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE ViewPatterns #
# LANGUAGE TypeFamilies #
|
Module : Verifier . SAW.Simulator . BitBlast
Copyright : Galois , Inc. 2012 - 2015
License : :
Stability : experimental
Portability : non - portable ( langu... |
6614716c34768d2bd1676c313fd60dea9e77ca19c534b1283872afa7067a0bc7 | hamidreza-s/Tnesia | tnesia_lib.erl | -module(tnesia_lib).
-export([
create_table/1,
delete_table/0,
recreate_table/1
]).
-export([
table_info/0,
table_cleanup/4,
remove_record/2,
remove_record/1,
seed_sample_data/2
]).
-export([
write/1,
read_timepoint/2,
read_count/1,
re... | null | https://raw.githubusercontent.com/hamidreza-s/Tnesia/52a3a88a52b423fbc5959978c0bba61654166d47/src/tnesia_lib.erl | erlang | ====================================================================
Table Management API
====================================================================
--------------------------------------------------------------------
create_table
--------------------------------------------------------------------
--------... | -module(tnesia_lib).
-export([
create_table/1,
delete_table/0,
recreate_table/1
]).
-export([
table_info/0,
table_cleanup/4,
remove_record/2,
remove_record/1,
seed_sample_data/2
]).
-export([
write/1,
read_timepoint/2,
read_count/1,
re... |
a9958b040f9b96ab28cc34455cf02cb31a41156088e605aa0ad2fce061a13bc7 | input-output-hk/ouroboros-network | Server.hs | {-# LANGUAGE DataKinds #-}
# LANGUAGE GADTs #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -Wno - unticked - promoted - constructors #
-- | A view of the chain synchronisation protocol from the point of view of the
-- server.
--
-- This provides a view that... | null | https://raw.githubusercontent.com/input-output-hk/ouroboros-network/2793b6993c8f6ed158f432055fa4ef581acdb661/ouroboros-network-protocols/src/Ouroboros/Network/Protocol/ChainSync/Server.hs | haskell | # LANGUAGE DataKinds #
| A view of the chain synchronisation protocol from the point of view of the
server.
This provides a view that uses less complex types and should be easier to
use than the underlying typed protocol itself.
For execution, a conversion into the typed protocol is provided.
* Proto... | # LANGUAGE GADTs #
# LANGUAGE NamedFieldPuns #
# LANGUAGE ScopedTypeVariables #
# OPTIONS_GHC -Wno - unticked - promoted - constructors #
module Ouroboros.Network.Protocol.ChainSync.Server
ChainSyncServer (..)
, ServerStIdle (..)
, ServerStNext (..)
, ServerStIntersect (..)
, chainSyn... |
81dd062be4aab9202266fca3845f01a65841b9d509e20059b3c5ab03353d598a | hhucn/decide3 | process.cljc | (ns decide.models.process
(:require
[clojure.set :as set]
#?(:clj [clojure.spec.alpha :as s]
:cljs [cljs.spec.alpha :as s])
[com.fulcrologic.fulcro.algorithms.normalized-state :as norm-state]
[com.fulcrologic.fulcro.raw.components :as rc]
[com.fulcrologic.guardrails.core :refer [>def >defn... | null | https://raw.githubusercontent.com/hhucn/decide3/5a4bef5d7d68981a8dc859a944a2ddd5844bdba9/src/main/decide/models/process.cljc | clojure | Participants may only approve to a single proposal.
Participants will be able to reject a proposal.
Ask the participant to give a reason for a reject. | (ns decide.models.process
(:require
[clojure.set :as set]
#?(:clj [clojure.spec.alpha :as s]
:cljs [cljs.spec.alpha :as s])
[com.fulcrologic.fulcro.algorithms.normalized-state :as norm-state]
[com.fulcrologic.fulcro.raw.components :as rc]
[com.fulcrologic.guardrails.core :refer [>def >defn... |
9d574662a3ef6918e814fe22abdba93250f2f6c78ffc4e2d7eddbf4e678fdc7f | scalaris-team/scalaris | comm.erl | 2007 - 2015 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
d... | null | https://raw.githubusercontent.com/scalaris-team/scalaris/feb894d54e642bb3530e709e730156b0ecc1635f/src/comm.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... | 2007 - 2015 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 < >
Messages consist of a tuple of which the first element is the message 's
-module(comm).
-author('').
-vsn('$Id$')... |
a81f5b4c233de727ae176ac793352f45fb1b274b38f375fa6e17fdd9a79889f2 | Opetushallitus/aipal | taustakysymykset_test.clj | Copyright ( c ) 2015 The Finnish National Board of Education - Opetushallitus
;;
This program is free software : Licensed under the EUPL , Version 1.1 or - as
soon as they will be approved by the European Commission - subsequent versions
of the EUPL ( the " Licence " ) ;
;;
;; You may not use this work except... | null | https://raw.githubusercontent.com/Opetushallitus/aipal/767bd14ec7153dc97fdf688443b9687cdb70082f/aipal/test/clj/aipal/toimiala/raportti/taustakysymykset_test.clj | clojure |
You may not use this work except in compliance with the Licence.
You may obtain a copy of the Licence at: /
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 PARTICULAR PURPOSE. See the | Copyright ( c ) 2015 The Finnish National Board of Education - Opetushallitus
This program is free software : Licensed under the EUPL , Version 1.1 or - as
soon as they will be approved by the European Commission - subsequent versions
European Union Public Licence for more details .
(ns aipal.toimiala.raport... |
e00b5097096173e329e1808afc58ce9c662f1ca89533f3390a38248eaa68cede | sondresl/AdventOfCode | Day09.hs | # LANGUAGE TypeApplications #
module Day09 where
import Control.Lens
import Lib
import Data.List.Extra
import qualified Text.Parsec as P
import Text.Parsec (anyToken, letter, count, oneOf, satisfy, char, many1, many, digit)
import qualified Data.Map as Map
import Control.Monad
type Parser = P.Parsec String ()
parseI... | null | https://raw.githubusercontent.com/sondresl/AdventOfCode/224cf59354c7c1c31821f36884fe8909c5fdf9a6/2016/Haskell/src/Day09.hs | haskell | # LANGUAGE TypeApplications #
module Day09 where
import Control.Lens
import Lib
import Data.List.Extra
import qualified Text.Parsec as P
import Text.Parsec (anyToken, letter, count, oneOf, satisfy, char, many1, many, digit)
import qualified Data.Map as Map
import Control.Monad
type Parser = P.Parsec String ()
parseI... | |
476f7243d6735fb156c488a1b53f72a88d849205a7fbc438402de5d6e9b8e800 | haskell/cabal | cabal.test.hs | import Test.Cabal.Prelude
main = cabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
script is called " s.hs " to avoid Windows long path issue in CI
res <- cabal' "v2-run" ["s.hs"]
assertOutputContains "Hello World" res
| null | https://raw.githubusercontent.com/haskell/cabal/410f871df899e5af0847089354e0031fe051551d/cabal-testsuite/PackageTests/NewBuild/CmdRun/ScriptWithProjectBlock/cabal.test.hs | haskell | import Test.Cabal.Prelude
main = cabalTest $ do
isWin <- isWindows
ghc94 <- isGhcVersion "== 9.4.*"
expectBrokenIf (isWin && ghc94) 8451 $ do
script is called " s.hs " to avoid Windows long path issue in CI
res <- cabal' "v2-run" ["s.hs"]
assertOutputContains "Hello World" res
| |
e99b5d0ca3ce02d56f235e64473963401ca561358723479e7f007ea550943a27 | scrintal/heroicons-reagent | signal.cljs | (ns com.scrintal.heroicons.solid.signal)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M5.636 4.575a.75.75 0 010 1.06 9 9 0 000 12.729.75.75 0 01-1.06 1.06c-4.101-4.1-4.1... | null | https://raw.githubusercontent.com/scrintal/heroicons-reagent/572f51d2466697ec4d38813663ee2588960365b6/src/com/scrintal/heroicons/solid/signal.cljs | clojure | (ns com.scrintal.heroicons.solid.signal)
(defn render []
[:svg {:xmlns ""
:viewBox "0 0 24 24"
:fill "currentColor"
:aria-hidden "true"}
[:path {:fillRule "evenodd"
:d "M5.636 4.575a.75.75 0 010 1.06 9 9 0 000 12.729.75.75 0 01-1.06 1.06c-4.101-4.1-4.1... | |
64d8282abdc3f83d99edf58bde98df4334f35c4acedd90f0f498254ad3fd3357 | nuvla/api-server | resource_metadata_value_scope.cljc | (ns sixsq.nuvla.server.resources.spec.resource-metadata-value-scope
"schema definitions for the 'value-scope' field of an attribute in a
resource-metadata resource"
(:require
[clojure.spec.alpha :as s]
[sixsq.nuvla.server.resources.spec.resource-metadata-value-scope-enumeration :as enumeration]
[sixs... | null | https://raw.githubusercontent.com/nuvla/api-server/a64a61b227733f1a0a945003edf5abaf5150a15c/code/src/sixsq/nuvla/server/resources/spec/resource_metadata_value_scope.cljc | clojure | (ns sixsq.nuvla.server.resources.spec.resource-metadata-value-scope
"schema definitions for the 'value-scope' field of an attribute in a
resource-metadata resource"
(:require
[clojure.spec.alpha :as s]
[sixsq.nuvla.server.resources.spec.resource-metadata-value-scope-enumeration :as enumeration]
[sixs... | |
5c25fc0c318f64cc78ac3c31a4440ee3cb6d09d857126a3f6756452d13ef080b | metosin/pohjavirta | response.clj | (ns pohjavirta.response
(:require [clojure.java.io :as io])
(:import (io.undertow.io IoCallback)
(io.undertow.server HttpServerExchange)
(io.undertow.util HeaderMap HttpString SameThreadExecutor)
(java.io File InputStream)
(java.nio ByteBuffer)
(java.nio.channe... | null | https://raw.githubusercontent.com/metosin/pohjavirta/022a44eec9109a0baf93827843eeba15265adea7/src/pohjavirta/response.clj | clojure | (ns pohjavirta.response
(:require [clojure.java.io :as io])
(:import (io.undertow.io IoCallback)
(io.undertow.server HttpServerExchange)
(io.undertow.util HeaderMap HttpString SameThreadExecutor)
(java.io File InputStream)
(java.nio ByteBuffer)
(java.nio.channe... | |
5add61c1c7da4166ab976d9cf32efa2d6906edb5f3c73f1994418ffeca731354 | abdulapopoola/SICPBook | Ex2.06.scm | #lang planet neil/sicp
(define zero (lambda (f) (lambda (x) x)))
(define (add-1 n)
(lambda (f) (lambda (x) (f ((n f) x)))))
(define one (lambda (f) (lambda (x) (f x))))
one - > ( add-1 zero )
( lambda ( f ) ( lambda ( x ) ( f ( ( zero f ) x ) ) ) ) )
( zero f ) - > ( ( lambda ( f ) ( lambda ( x ) x ) ) f )
... | null | https://raw.githubusercontent.com/abdulapopoola/SICPBook/c8a0228ebf66d9c1ddc5ef1fcc1d05d8684f090a/Chapter%202/2.1/Ex2.06.scm | scheme | (lambda (x) x)
-> (lambda (f) (lambda (x) (f x))))
(lambda (f) (lambda (x) (f ((one f) x)))))
(one f) -> ((lambda (f) (lambda (x) (f x)))) f)
(lambda (x) (f x))
(lambda (f) (lambda (x) (f ((lambda (x) (f x)) x)))))
-> (lambda (f) (lambda (x) (f (f x)))) | #lang planet neil/sicp
(define zero (lambda (f) (lambda (x) x)))
(define (add-1 n)
(lambda (f) (lambda (x) (f ((n f) x)))))
(define one (lambda (f) (lambda (x) (f x))))
one - > ( add-1 zero )
( lambda ( f ) ( lambda ( x ) ( f ( ( zero f ) x ) ) ) ) )
( zero f ) - > ( ( lambda ( f ) ( lambda ( x ) x ) ) f )
... |
e1c5f4a3e09e06f64b6557f8cc838995d3a9255f6a38191f36dae3349b945788 | fare/lisp-interface-library | pure-map.lisp | (uiop:define-package :lil/test/pure-map
(:import-from :stateful)
(:use :pure :lil/test/base :lil/transform/linearized-map :lil/interface/base
:cl :uiop :fare-utils :hu.dwim.stefil)
(:export :read-only-linear-map-test))
(in-package :lil/test/pure-map)
(declaim (optimize (speed 1) (debug 3) (space 3)))
(... | null | https://raw.githubusercontent.com/fare/lisp-interface-library/ac2e0063dc65feb805f0c57715d52fda28d4dcd8/test/pure-map.lisp | lisp | TODO: test each and every function in the API
TODO: test each and every function in the API
Repeatedly divide a map into pairs of smaller sub-maps.
TODO: implement and use a queue interface?
TODO: add more tests
TODO: add more tests
(X 'join/list)
TODO: add tests
Repeatedly divide a map into pairs of smaller s... | (uiop:define-package :lil/test/pure-map
(:import-from :stateful)
(:use :pure :lil/test/base :lil/transform/linearized-map :lil/interface/base
:cl :uiop :fare-utils :hu.dwim.stefil)
(:export :read-only-linear-map-test))
(in-package :lil/test/pure-map)
(declaim (optimize (speed 1) (debug 3) (space 3)))
(... |
3334464946f05d0c702e43c9f4d625fb36787e3f3e27ce68af5cdf4f7cc19bd8 | nuvla/api-server | nuvlabox_0_lifecycle_test.clj | (ns sixsq.nuvla.server.resources.nuvlabox-0-lifecycle-test
(:require
[clojure.data.json :as json]
[clojure.string :as str]
[clojure.test :refer [deftest is use-fixtures]]
[peridot.core :refer [content-type header request session]]
[ring.util.codec :as rc]
[sixsq.nuvla.server.app.params :as p]
... | null | https://raw.githubusercontent.com/nuvla/api-server/272c1b8f7a5cd306d01464cf801d6174df146f71/code/test/sixsq/nuvla/server/resources/nuvlabox_0_lifecycle_test.clj | clojure | This is not the default version, so it must appear explicitly.
only name description acl are editable for normal user other changes are ignored
create nuvlabox with inexistent vpn id will fail
and receive an api key/secret pair to access Nuvla
verify that an infrastructure-service-group has been created for this n... | (ns sixsq.nuvla.server.resources.nuvlabox-0-lifecycle-test
(:require
[clojure.data.json :as json]
[clojure.string :as str]
[clojure.test :refer [deftest is use-fixtures]]
[peridot.core :refer [content-type header request session]]
[ring.util.codec :as rc]
[sixsq.nuvla.server.app.params :as p]
... |
05b630b2d55703e1da860215b7e7416a4d6429959f704f10f6182b2c1b7e3c50 | smimram/saml | backend_interp.ml | (** Interpreter. *)
open Stdlib
open Backend
module B = Backend
let default_value t = V.default ~bot:true t
(** Operations on state for interpreter. *)
module State = struct
type state =
{
vars : V.t array;
(** Variables. *)
args : V.t array;
(** Arguments (for functions). *)
mut... | null | https://raw.githubusercontent.com/smimram/saml/02de9b7e90e34d19aeafa4b680e7777636355fa7/old/backend_interp.ml | ocaml | * Interpreter.
* Operations on state for interpreter.
* Variables.
* Arguments (for functions).
* Returned value for functions calls.
Printf.sprintf "%s [%s]" (V.to_string state.state_out) mem
Printf.printf "op: %s\n%!" (string_of_op op);
Convert \n into newlines, etc.
TODO: we should keep the existing valu... |
open Stdlib
open Backend
module B = Backend
let default_value t = V.default ~bot:true t
module State = struct
type state =
{
vars : V.t array;
args : V.t array;
mutable return : V.t;
}
let to_string state =
let mem = String.concat_map " , " V.to_string ( Array.to_list state.state_me... |
f74bfcf7fd3ee6b0d7e8d0eae764c649b692e8198f3f1c1708c94c5ff92de23b | ocaml/oasis-db | PkgView.ml |
* Display a package
@author
@author Sylvain Le Gall
*)
open Eliom_predefmod.Xhtml
open Eliom_parameters
open XHTML.M
open ODBGettext
open Template
open Lwt
open ODBPkg
open Context
let package_box ~ctxt ~sp pkg =
ODBStorage.PkgVer.elements ctxt.stor (`Pkg pkg)
>>= fun pkg_ver_lst ->
c... | null | https://raw.githubusercontent.com/ocaml/oasis-db/f8b19d431102b5c5b7dced00a5242a5366ad263f/src/web/PkgView.ml | ocaml |
* Display a package
@author
@author Sylvain Le Gall
*)
open Eliom_predefmod.Xhtml
open Eliom_parameters
open XHTML.M
open ODBGettext
open Template
open Lwt
open ODBPkg
open Context
let package_box ~ctxt ~sp pkg =
ODBStorage.PkgVer.elements ctxt.stor (`Pkg pkg)
>>= fun pkg_ver_lst ->
c... | |
c99ff8bd67b16c9a4cae52f2aba0a6a3b6508c1224c789d6bd2d546d98feb9d1 | factisresearch/opensource | Types.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveFoldable #
# LANGUAGE DeriveFunctor #
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveTraversable #-}
# LANGUAGE MonadComprehensions #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
module Data.StrictList.Types where
import Control.Applicative
import Contr... | null | https://raw.githubusercontent.com/factisresearch/opensource/d8b1fdf39d945bfcbc045ca9f73ab5aa84f89fa0/strict-data/src/Data/StrictList/Types.hs | haskell | # LANGUAGE DeriveDataTypeable #
# LANGUAGE DeriveTraversable # | # LANGUAGE DeriveFoldable #
# LANGUAGE DeriveFunctor #
# LANGUAGE DeriveGeneric #
# LANGUAGE MonadComprehensions #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
module Data.StrictList.Types where
import Control.Applicative
import Control.DeepSeq
import Control.Monad hiding (forM_, mapM, mapM_)
import Data... |
1c7cf18674689aad1cdc0753a31de6178f7c3c6d3b8fe3f7425834a48dce4e82 | jepsen-io/scylla | mv.clj | (ns scylla.mv
"Some kind of test for materialized views. Not exactly sure what this does!"
(:require [clojure [pprint :refer :all]]
[clojure.tools.logging :refer [info]]
[jepsen
[client :as client]
[generator :as gen]
[nemesis :as nemesis]]
... | null | https://raw.githubusercontent.com/jepsen-io/scylla/a9aed0cb2d5e51301d4b354e29bfa5df5fad3752/src/scylla/mv.clj | clojure | TODO: do we really want ALL
here?
Not exactly sure what this is supposed to do. Looks like it sets x to x
on the map, for sequential integers, then does a read, then turns around
and sets x to -x, and does another read. Is the read timing important?
We should look at associative-map (and maybe move it into this n... | (ns scylla.mv
"Some kind of test for materialized views. Not exactly sure what this does!"
(:require [clojure [pprint :refer :all]]
[clojure.tools.logging :refer [info]]
[jepsen
[client :as client]
[generator :as gen]
[nemesis :as nemesis]]
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.