_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 |
|---|---|---|---|---|---|---|---|---|
63ffacfdeca67563dd11f6ac7763a45ec6b9ca8a263fcde2f70000d695deb3ad | lopec/LoPEC | janitor.erl | %%%-----------------------------------------------------------------------------
@author < >
%%% @doc
%%% Our garbagecollector
%%% @end
Created : 12 Okt 2009 by
%%%-----------------------------------------------------------------------------
-module(janitor).
-include("../include/env.hrl").
-behaviour(gen_serve... | null | https://raw.githubusercontent.com/lopec/LoPEC/29a3989c48a60e5990615dea17bad9d24d770f7b/trunk/lib/master/src/janitor.erl | erlang | -----------------------------------------------------------------------------
@doc
Our garbagecollector
@end
-----------------------------------------------------------------------------
=============================================================================
API
===============================================... | @author < >
Created : 12 Okt 2009 by
-module(janitor).
-include("../include/env.hrl").
-behaviour(gen_server).
-export([
cleanup_job/1,
cleanup_split/1,
cleanup_map/1,
cleanup_reduce/1,
cleanup_finalize/1
]).
-export([start_link/0, init/1, handle_call/3, handle_... |
1823b4717dc524e4116dedeef20fc5d52f78d1110d2f0054c45c00e73d3863ac | ocaml/dune | progress.mli | val flush : Backend_intf.t
val no_flush : Backend_intf.t
| null | https://raw.githubusercontent.com/ocaml/dune/8d552d3064644da62347d4afc8db88ab27452fa5/src/dune_console/progress.mli | ocaml | val flush : Backend_intf.t
val no_flush : Backend_intf.t
| |
5fae1c8492198f30c12825748f36eb56783c07756c683dfce843bbcada83474f | MastodonC/kixi.hecuba | security_test.clj | (ns kixi.hecuba.security-test
(:require [kixi.hecuba.security :refer :all :as sec]
[clojure.test :refer :all]))
(def programmes {"g1" ::sec/programme-manager
"g2" ::sec/project-manager
"g3" ::sec/user})
(def projects {"j1" ::sec/programme-manager
"j2" ::s... | null | https://raw.githubusercontent.com/MastodonC/kixi.hecuba/467400bbe670e74420a2711f7d49e869ab2b3e21/test/clj/kixi/hecuba/security_test.clj | clojure | (ns kixi.hecuba.security-test
(:require [kixi.hecuba.security :refer :all :as sec]
[clojure.test :refer :all]))
(def programmes {"g1" ::sec/programme-manager
"g2" ::sec/project-manager
"g3" ::sec/user})
(def projects {"j1" ::sec/programme-manager
"j2" ::s... | |
b25d5a8c3265993a2e0d2d0d83bda965a2abcb3972e26f518bead5f0d053cd9a | eamsden/Animas | TailgatingDetector.hs |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* A F R P *
* ... | null | https://raw.githubusercontent.com/eamsden/Animas/2404d1de20982a337109fc6032cb77b022514f9d/examples/TailgatingDetector/TailgatingDetector.hs | haskell | Context: an autonomous flying vehicle carrying out traffic surveillance
through an on-board video camera.
Objective: finding a tailgater among a group of vehicles traveling along
a highway lane. The group is defined by the section of the highway in
relative speed to the flying vehicles enters or leaves the field ... |
* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* A F R P *
* ... |
6c2d9ec2486fc9754fcb917045ae887f345261689a8e4c8addb4744f918e4c6c | hoplon/brew | skel.clj | (ns hoplon.skel)
(defmacro with-breakpoint [bp f]
(let [events (str bp)]
`(on ~events ~f)))
| null | https://raw.githubusercontent.com/hoplon/brew/08d520fc43a14180dd52955af48dae63d0065add/src/hoplon/skel.clj | clojure | (ns hoplon.skel)
(defmacro with-breakpoint [bp f]
(let [events (str bp)]
`(on ~events ~f)))
| |
0b2df34c15d8239c82be147d85bc8c8e7178103530e94c68526992aaf2300db1 | tov/shcaml | priorityQueue.ml | open Util
type 'a t = Empty
| Node of 'a node_data
and 'a node_data = {
data: 'a;
prio: int;
left: 'a t;
right: 'a t;
}
let empty = Empty
let is_empty = function
| Empty -> true
| _ -> false
let rec insert prio data = function
| Empty -> Node {
data = data;
... | null | https://raw.githubusercontent.com/tov/shcaml/43ae852a00e3a11520f90f2451baa71863409774/lib/priorityQueue.ml | ocaml | open Util
type 'a t = Empty
| Node of 'a node_data
and 'a node_data = {
data: 'a;
prio: int;
left: 'a t;
right: 'a t;
}
let empty = Empty
let is_empty = function
| Empty -> true
| _ -> false
let rec insert prio data = function
| Empty -> Node {
data = data;
... | |
40a65ce05e4570f63989f186fd0659c34900696847dd057e21e66127af8a3ede | cerebro/ggp-clj-players | project.clj | (defproject ggp-clj-players "0.1.1"
:description "CLojure library to develop GGP players"
:url ""
:license {:name "MIT license"
:url ""}
:min-lein-version "2.0.0"
:plugins [[lein-sub "0.3.0"]]
:source-paths ["src"]
:sub ["vendor/ggp-base"]
:dependencies [[org.clojure/clojure "1.5.1"]
... | null | https://raw.githubusercontent.com/cerebro/ggp-clj-players/dca13fbc4024fa12a2fd8aac162c1e9a03e2560f/project.clj | clojure | (defproject ggp-clj-players "0.1.1"
:description "CLojure library to develop GGP players"
:url ""
:license {:name "MIT license"
:url ""}
:min-lein-version "2.0.0"
:plugins [[lein-sub "0.3.0"]]
:source-paths ["src"]
:sub ["vendor/ggp-base"]
:dependencies [[org.clojure/clojure "1.5.1"]
... | |
48a54dee21e456fd2dadeb8b0c9fb57d728cbffe33c04b21cceabde453160512 | byteally/webapi | OpenAPI.hs | # LANGUAGE CPP #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE NoMonomorphismRestriction #
# LANGUAGE FlexibleContexts #
# LANGUAGE NamedFieldPuns #
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# OPTIONS_GHC -Wno - type - defaults #
{-# LANGUAGE BangPatterns #-}
module WebApi.OpenAPI wh... | null | https://raw.githubusercontent.com/byteally/webapi/79f8f9e8964b5224963b6c2ae556f1858137e2c3/webapi-openapi/src/WebApi/OpenAPI.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE BangPatterns #
(T.pack fileContent) | # LANGUAGE CPP #
# LANGUAGE NoMonomorphismRestriction #
# LANGUAGE FlexibleContexts #
# LANGUAGE NamedFieldPuns #
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
# OPTIONS_GHC -Wno - type - defaults #
module WebApi.OpenAPI where
import Data.ByteString.Lazy as B (readFile)
import Data.Aeso... |
4fab586b37c62f1fc34d110a73b0f4754415fc48c287fe24beb0a31b18f3a5b4 | ayamada/copy-of-svn.tir.jp | tcpcgi.scm | ;;; coding: euc-jp
;;; -*- scheme -*-
;;; vim:set ft=scheme sw=2 ts=2 et:
$ Id$
;;; ToDo : クライアントへの出力を、なるべく効率良くできるようにしたい
;;; バッファリングモード:noneが最も効率が悪い、気がするが、
;;; :fullだと、メモリ効率が悪い気がする
;;; Nagleアルゴリズムが働いて、効率良く送れてる?
但し、どちらにせよ、nph , : noneにしないと駄目
ToDo : nph時、またはfiler時には、すぐに実行せずに
;;; ... | null | https://raw.githubusercontent.com/ayamada/copy-of-svn.tir.jp/101cd00d595ee7bb96348df54f49707295e9e263/tcpcgi/tags/0.4.2/src/lib/tcpcgi.scm | scheme | coding: euc-jp
-*- scheme -*-
vim:set ft=scheme sw=2 ts=2 et:
ToDo : クライアントへの出力を、なるべく効率良くできるようにしたい
バッファリングモード:noneが最も効率が悪い、気がするが、
:fullだと、メモリ効率が悪い気がする
Nagleアルゴリズムが働いて、効率良く送れてる?
ロギングフェーズを終え、クライアントへ結果を返す時点で
遅延実行するようにする
ToDo : keepalive-timeoutは、SIGALRMではなく、selectで実装する?
ToDo :... | $ Id$
但し、どちらにせよ、nph , : noneにしないと駄目
ToDo : nph時、またはfiler時には、すぐに実行せずに
ToDo : 上記と同じように、pathでもリダイレクト設定を簡単に行えるようにする ?
ToDo : check - authentication!実装
ToDo : rfc2616を見て、クライアントからの接続がHTTP/1.1なら 、
しないオプションをつける ?
ToDo : stateのスロットの初期値が#... |
58253b1fac482483a62f3214281302fe441fdad76939b96fc087e29273965831 | bldl/magnolisp | test-block-expr-2.rkt | #lang magnolisp/2014
(typedef int (#:annos foreign))
(function (equal x y)
(#:annos (type (fn int int Bool)) foreign)
(begin-racket (equal? x y)))
(function (default e f d) #an([export dflt])
(if (equal e f) d e))
(function (f x)
(#:annos export)
(define y (default x 2 7))
(default x 1 7))
(f 1)
(f 2)
... | null | https://raw.githubusercontent.com/bldl/magnolisp/191d529486e688e5dda2be677ad8fe3b654e0d4f/tests/test-block-expr-2.rkt | racket | #lang magnolisp/2014
(typedef int (#:annos foreign))
(function (equal x y)
(#:annos (type (fn int int Bool)) foreign)
(begin-racket (equal? x y)))
(function (default e f d) #an([export dflt])
(if (equal e f) d e))
(function (f x)
(#:annos export)
(define y (default x 2 7))
(default x 1 7))
(f 1)
(f 2)
... | |
16577f2e18ac865e772150a13ccfcb0771eb44d8067b3f8f0aa4bb0eeadfda07 | Tyruiop/syncretism | filters_def.cljs | (ns synfron.filters-def)
(def all-filters
[{:title "Miscellaneous"
:type :misc
:descr [:p [:strong "Active"]
" means only options for which ask, bid, OI, and V are > 0. "]
:entries
[{:name "Tickers: "
:type :text
:placeholder "e.g. AMC, GME"
:id "tickers"}
{:name "E... | null | https://raw.githubusercontent.com/Tyruiop/syncretism/841b5c1d74511684f027c9d14eb18a761d8c0276/syncretism-frontend/src/main/synfron/filters_def.cljs | clojure | (ns synfron.filters-def)
(def all-filters
[{:title "Miscellaneous"
:type :misc
:descr [:p [:strong "Active"]
" means only options for which ask, bid, OI, and V are > 0. "]
:entries
[{:name "Tickers: "
:type :text
:placeholder "e.g. AMC, GME"
:id "tickers"}
{:name "E... | |
ad6690e771c5f51c51e6e2d4eb0532eb03c0d717e1223a797a26350d9064a3a3 | haskell/cabal | A.hs | # OPTIONS_GHC -F -pgmF my - foreign - preprocessor #
module A where
a :: String
a = "0000"
| null | https://raw.githubusercontent.com/haskell/cabal/00a2351789a460700a2567eb5ecc42cca0af913f/cabal-testsuite/PackageTests/BuildTools/Foreign/A.hs | haskell | # OPTIONS_GHC -F -pgmF my - foreign - preprocessor #
module A where
a :: String
a = "0000"
| |
4c1423f827099d304c96f1949f0ecb8215f826365fd6a7cd6885c59d261b823c | ladderlife/autochrome | tree.clj | (ns autochrome.tree
(:require [autochrome.common :as clj-common])
(:import [clojure.lang Util]))
(defn branch?
[{:keys [type] :as form}]
(or (clj-common/decoration? form)
(= type :coll)
(= type :lambda)
(= type :data-reader)
(= type :reader-conditional)
(= type :reader-conditional... | null | https://raw.githubusercontent.com/ladderlife/autochrome/d454e4450658b4799bfd939f2a84690921800806/src/autochrome/tree.clj | clojure | The parser is unfortunately designed so that recursing into everything
is a little bit... involved.
empty collection
empty collection | (ns autochrome.tree
(:require [autochrome.common :as clj-common])
(:import [clojure.lang Util]))
(defn branch?
[{:keys [type] :as form}]
(or (clj-common/decoration? form)
(= type :coll)
(= type :lambda)
(= type :data-reader)
(= type :reader-conditional)
(= type :reader-conditional... |
9f769d962b158b456a1c7b8718fa4980c457f4b04b8be288805a91661ef3ac89 | TrustInSoft/tis-interpreter | value_perf.ml | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of Frama - C.
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/plugins/value/utils/value_perf.ml | ocaml | ************************************************************************
alternatives)
... | Modified by TrustInSoft
This file is part of Frama - C.
Copyright ( C ) 2007 - 2015
CEA ( Commissariat à l'énergie atomique et aux énergies
Lesser General Public License as published by the Free Softwa... |
16a8739d6bca1949830a29ee13b9897f3e6bcb84a0201fb27e32b69e9e717d2b | dalaing/little-languages | AST.hs | {-# LANGUAGE DeriveFunctor #-}
{-# LANGUAGE DeriveFoldable #-}
{-# LANGUAGE DeriveTraversable #-}
# LANGUAGE FlexibleInstances #
module Term.AST (
Term(..)
, lam_
, freshVarForLam
) where
import Control.Monad (ap)
import Data.Foldable (toList)
import Bound
import Prelude.Extras
import Test.QuickChec... | null | https://raw.githubusercontent.com/dalaing/little-languages/9f089f646a5344b8f7178700455a36a755d29b1f/code/old/prototypes/lc/src/Term/AST.hs | haskell | # LANGUAGE DeriveFunctor #
# LANGUAGE DeriveFoldable #
# LANGUAGE DeriveTraversable #
want arbitrary here so that we can shrink terms
TODO we might want to distinguish between
- lambdas where the binder is used
- lambdas where the binder is not used
TODO we probably also want an explicit gen for lambdas ... | # LANGUAGE FlexibleInstances #
module Term.AST (
Term(..)
, lam_
, freshVarForLam
) where
import Control.Monad (ap)
import Data.Foldable (toList)
import Bound
import Prelude.Extras
import Test.QuickCheck
data Term a =
Var a
| Lam (Scope () Term a)
| App (Term a) (Term a)
deriving (Eq, Ord, Show,... |
7919a9dc1fa928f0800b3cf86623fd7f83317fcf54c89bfe557d41ecdd470c25 | jgrodziski/set-game | main.cljs | (ns ^:figwheel-no-load env.ios.main
(:require [reagent.core :as r]
[re-frame.core :refer [clear-subscription-cache!]]
[set-game.ios.core :as core]
[figwheel.client :as figwheel :include-macros true]))
(enable-console-print!)
(def cnt (r/atom 0))
(defn reloader [] @cnt [core/app... | null | https://raw.githubusercontent.com/jgrodziski/set-game/4f918f53f26fe1b7744773cf1786ccf7272a121d/frontend/env/dev/env/ios/main.cljs | clojure | (ns ^:figwheel-no-load env.ios.main
(:require [reagent.core :as r]
[re-frame.core :refer [clear-subscription-cache!]]
[set-game.ios.core :as core]
[figwheel.client :as figwheel :include-macros true]))
(enable-console-print!)
(def cnt (r/atom 0))
(defn reloader [] @cnt [core/app... | |
0ed571f0e2d62e89bcb0a56f4c6f519dc77fe8f8c0717edddf4238f258aa21b0 | racket/typed-racket | regexp-match-kw.rkt | #lang typed/racket
(ann (regexp-match* "foo" "foobar") (Listof String))
(ann (regexp-match* "foo" #"foobar") (Listof Bytes))
(ann (regexp-match* #"foo" "foobar") (Listof Bytes))
(ann (regexp-match* #"foo" #"foobar") (Listof Bytes))
(regexp-match* #rx"foo" "foobar" #:match-select car #:gap-select? #t)
| null | https://raw.githubusercontent.com/racket/typed-racket/6ca7c7fa1c503b605cf907711c7c90020906b1a6/typed-racket-test/succeed/regexp-match-kw.rkt | racket | #lang typed/racket
(ann (regexp-match* "foo" "foobar") (Listof String))
(ann (regexp-match* "foo" #"foobar") (Listof Bytes))
(ann (regexp-match* #"foo" "foobar") (Listof Bytes))
(ann (regexp-match* #"foo" #"foobar") (Listof Bytes))
(regexp-match* #rx"foo" "foobar" #:match-select car #:gap-select? #t)
| |
590e1b4fc181b89fbcf3ced3344cd15d44e720adbbbf66656c3c7f7ea15e075e | gfngfn/SATySFi | alist.mli |
type 'a t
val empty : 'a t
val extend : 'a t -> 'a -> 'a t
val append : 'a t -> 'a list -> 'a t
val to_list : 'a t -> 'a list
val to_list_rev : 'a t -> 'a list
val of_list : 'a list -> 'a t
val chop_last : 'a t -> ('a t * 'a) option
val map : ('a -> 'b) -> 'a t -> 'b t
val fold_left : ('a -> 'b -> 'a) -> 'a -... | null | https://raw.githubusercontent.com/gfngfn/SATySFi/9dbd61df0ab05943b3394830c371e927df45251a/src/alist.mli | ocaml |
type 'a t
val empty : 'a t
val extend : 'a t -> 'a -> 'a t
val append : 'a t -> 'a list -> 'a t
val to_list : 'a t -> 'a list
val to_list_rev : 'a t -> 'a list
val of_list : 'a list -> 'a t
val chop_last : 'a t -> ('a t * 'a) option
val map : ('a -> 'b) -> 'a t -> 'b t
val fold_left : ('a -> 'b -> 'a) -> 'a -... | |
fe84ca475264bbe7c8dc3641132a74c25889135e8351a7fda86d8f1d11c0cc70 | lagenorhynque/clj-rest-api | artist.clj | (ns clj-rest-api.boundary.db.artist
(:require
[clj-rest-api.boundary.db.core :as db]
[clj-rest-api.util.const :as const]
[clojure.spec.alpha :as s]
[duct.database.sql]
[honeysql.core :as sql]
[honeysql.helpers :refer [merge-where]]))
(s/def ::id nat-int?)
(s/def ::type const/artist-types)
(s/def ::... | null | https://raw.githubusercontent.com/lagenorhynque/clj-rest-api/0a1c14cb902498b1ecc6bd3bc7c1ff9f4c4b4c36/src/clj_rest_api/boundary/db/artist.clj | clojure | (ns clj-rest-api.boundary.db.artist
(:require
[clj-rest-api.boundary.db.core :as db]
[clj-rest-api.util.const :as const]
[clojure.spec.alpha :as s]
[duct.database.sql]
[honeysql.core :as sql]
[honeysql.helpers :refer [merge-where]]))
(s/def ::id nat-int?)
(s/def ::type const/artist-types)
(s/def ::... | |
8ab471c8bd678c820cdc3134c61387d275f1ccb3e8bd98b94177aa2359bb0c92 | yurug/ocaml4.04.0-copatterns | ident.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/yurug/ocaml4.04.0-copatterns/b3ec6a3cc203bd2cde3b618546d29e10f1102323/typing/ident.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Format
type t = { stamp: int; name: string; mutable flags: int }
let global_flag = 1
let predef_ex... |
48dbef8cf8ba4280d222f58d51c80e8daccfc8874deaa646424226e0154be114 | project-oak/hafnium-verification | QuandarySummary.mli |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/project-oak/hafnium-verification/6071eff162148e4d25a0fedaea003addac242ace/experiments/ownership-inference/infer/infer/src/quandary/QuandarySummary.mli | ocaml | * summary type for Quandary taint analysis |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
c30d062d9cfe8d7fd97ee6fdbda7516bd5a1364598d8460744389bf0706b8d5e | bakul/s9fes | programp.scm | Scheme 9 from Empty Space , Function Library
By , 2009 , 2018
; In the public domain
;
; (program? object) ==> boolean
;
; (load-from-library "programp.scm")
;
; Return #T, if OBJECT is a syntactically correct Scheme program.
This program does not implement all of R4RS . Caveat utilitor .
;
Example : ( ... | null | https://raw.githubusercontent.com/bakul/s9fes/74c14c0db5f07f5bc6d94131e9e4ee15a29275aa/lib/programp.scm | scheme | In the public domain
(program? object) ==> boolean
(load-from-library "programp.scm")
Return #T, if OBJECT is a syntactically correct Scheme program.
not formally correct, but useful | Scheme 9 from Empty Space , Function Library
By , 2009 , 2018
This program does not implement all of R4RS . Caveat utilitor .
Example : ( program ? ' ( let ( ( x 1 ) ) ( cons x x ) ) ) = = > # t
(load-from-library "for-all.scm")
(define (program? x)
(define INF #f)
(define (list-of-programs? x... |
c910b4c5b54bd3da9f4bc5bb488839dbaa97eacfb57b54cd8b47a411fc3fb5a6 | stevenvar/OMicroB | chrono.ml | (*************************************************************************)
(* *)
(* OCaPIC *)
(* *)
... | null | https://raw.githubusercontent.com/stevenvar/OMicroB/aea797bf5f52bc1c897c8281e5e6812bab3442b3/tests/chrono/chrono.ml | ocaml | ***********************************************************************
OCaPIC
... |
This file is distributed under the terms of the CeCILL license .
Configuration de la connection PIC / Afficheur LCD
module%comp Disp = Circuits.MakeLCD(struct
let rsPin = PIN11
let enablePin = PIN12
let d4Pin = PIN2
let d5Pin = PIN... |
3bc5c9dbd471fdc532a427e312b2b8a0ef0f491c230111a82daa7890f978da79 | DKurilo/hackerrank | solution.hs | # LANGUAGE FlexibleInstances , UndecidableInstances , DuplicateRecordFields #
module Main where
import Control.Monad
import Control.Monad.ST
import Data.Array
import Data.Bits
import qualified Data.List as DL
import Data.List.Split
import qualified Data.Set as DS
import Debug.Trace
import System.Environment
import Sy... | null | https://raw.githubusercontent.com/DKurilo/hackerrank/37063170567b397b25a2b7123bc9c1299d34814a/crush/solution.hs | haskell | Complete the arrayManipulation function below.
hPutStrLn fptr $ show result | # LANGUAGE FlexibleInstances , UndecidableInstances , DuplicateRecordFields #
module Main where
import Control.Monad
import Control.Monad.ST
import Data.Array
import Data.Bits
import qualified Data.List as DL
import Data.List.Split
import qualified Data.Set as DS
import Debug.Trace
import System.Environment
import Sy... |
a2715490ff4d580dd84fe01ddf255d93ce27327e0fcfc9cb577f0c0de4faf41d | kelsey-sorrels/robinson | crafting.clj | (ns robinson.ui.components.crafting
(:require
[robinson.ui.components.common :as ruicommon]
[robinson.crafting :as rcrafting]
[robinson.crafting.mod-protocol :as rcmp]
[robinson.player :as rp]
[robinson.inventory :as ri]
[robinson.itemgen :as ig]... | null | https://raw.githubusercontent.com/kelsey-sorrels/robinson/337fd2646882708331257d1f3db78a3074ccc67a/src/robinson/ui/components/crafting.clj | clojure | Drop down to fn->component definition due to recursive nature of this component | (ns robinson.ui.components.crafting
(:require
[robinson.ui.components.common :as ruicommon]
[robinson.crafting :as rcrafting]
[robinson.crafting.mod-protocol :as rcmp]
[robinson.player :as rp]
[robinson.inventory :as ri]
[robinson.itemgen :as ig]... |
f3f0a1b60a2c28d3840a773c9a9a30b17fe3ae3f9a14bd85b1e9bd162ebf8da3 | metabase/metabase | user_test.clj | (ns metabase.models.user-test
(:require
[clojure.set :as set]
[clojure.string :as str]
[clojure.test :refer :all]
[metabase.http-client :as client]
[metabase.integrations.google]
[metabase.models
:refer [Collection
Database
PermissionsGroup
PermissionsGroupMem... | null | https://raw.githubusercontent.com/metabase/metabase/7e3048bf73f6cb7527579446166d054292166163/test/metabase/models/user_test.clj | clojure | Tests for permissions-set
Tests for invite-user and create-new-google-auth-user!
Clean up after ourselves
admin shouldn't get email saying user joined until they accept the invite (i.e., reset their password)
+---------------------------------------------------------------------------------------------------------... | (ns metabase.models.user-test
(:require
[clojure.set :as set]
[clojure.string :as str]
[clojure.test :refer :all]
[metabase.http-client :as client]
[metabase.integrations.google]
[metabase.models
:refer [Collection
Database
PermissionsGroup
PermissionsGroupMem... |
a9549266d877e36c76cb2f913a5a3ab5043158e320d72190b8503f2511cafe92 | commercialhaskell/stack | Extra.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE RecordWildCards #-}
-- | Extra functions for optparse-applicative.
module Options.Applicative.Builder.Extra
( boolFlags
, boolFlagsNoDefault
, firstBoolFlagsNoDefault
, firstBoolFlagsTrue
, firstBoolFlagsFalse
, enableDisableFlags
, enableDisableFlagsNo... | null | https://raw.githubusercontent.com/commercialhaskell/stack/80429690da92c634cb129f99f1507dbc47a70d45/src/Options/Applicative/Builder/Extra.hs | haskell | # LANGUAGE RecordWildCards #
| Extra functions for optparse-applicative.
| Type representing exceptions thrown by functions exported by the
"Options.Applicative.Builder.Extra" module.
| Enable/disable flags for a 'Bool'.
^ Default value
^ Flag name
^ Help suffix
| Enable/disable flags for a 'Bool', without ... | # LANGUAGE NoImplicitPrelude #
module Options.Applicative.Builder.Extra
( boolFlags
, boolFlagsNoDefault
, firstBoolFlagsNoDefault
, firstBoolFlagsTrue
, firstBoolFlagsFalse
, enableDisableFlags
, enableDisableFlagsNoDefault
, extraHelpOption
, execExtraHelp
, textOption
, textArgument
, op... |
7123dcf428648a8a8b856047dbe76f88825f6fe574d1e8bffed10b892cdf4ffa | clojuredus/clojure-coding-dojo | core.clj | (ns rover.core)
;; Don't forget tests!
(defn execute
"Given the current game state, execute the commands. Returns the next game
state. You do not need to edit (:world game)."
[game commands]
game)
| null | https://raw.githubusercontent.com/clojuredus/clojure-coding-dojo/21a60a3a4be825544b9a07eb7cd9c9c83a112b01/rover/src/rover/core.clj | clojure | Don't forget tests! | (ns rover.core)
(defn execute
"Given the current game state, execute the commands. Returns the next game
state. You do not need to edit (:world game)."
[game commands]
game)
|
25e2fabbc4084f947d526a9f4ead1de10263e0d6bac25c74fc75605070f6861b | noinia/hgeometry | DTSpec.hs | module Algorithms.Geometry.DelaunayTriangulation.DTSpec (spec) where
import qualified Algorithms.Geometry.DelaunayTriangulation.DivideAndConquer as DC
import qualified Algorithms.Geometry.DelaunayTriangulation.Naive as Naive
import Algorithms.Geometry.DelaunayTriangulation.Types
import Control.Lens... | null | https://raw.githubusercontent.com/noinia/hgeometry/89cd3d3109ec68f877bf8e34dc34b6df337a4ec1/hgeometry-test/src/Algorithms/Geometry/DelaunayTriangulation/DTSpec.hs | haskell | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
------------------------------------------------------------------------------
| M... | module Algorithms.Geometry.DelaunayTriangulation.DTSpec (spec) where
import qualified Algorithms.Geometry.DelaunayTriangulation.DivideAndConquer as DC
import qualified Algorithms.Geometry.DelaunayTriangulation.Naive as Naive
import Algorithms.Geometry.DelaunayTriangulation.Types
import Control.Lens... |
0a79bc663607b69bfb8e71de3502ce1b06cfb80fa047e8f319c34f47fef84f63 | jvranish/MiniKanrenT | MiniKanren.hs |
module Control.Monad.MiniKanren
( module Control.Monad.MiniKanren.Core
, module Control.Monad.MiniKanren.Term
) where
import Control.Monad.MiniKanren.Core
import Control.Monad.MiniKanren.Term | null | https://raw.githubusercontent.com/jvranish/MiniKanrenT/60772630ea31a64a1d7d15cf24524fd1b5031010/src/Control/Monad/MiniKanren.hs | haskell |
module Control.Monad.MiniKanren
( module Control.Monad.MiniKanren.Core
, module Control.Monad.MiniKanren.Term
) where
import Control.Monad.MiniKanren.Core
import Control.Monad.MiniKanren.Term | |
52e5c5a8a1ff210845437bac7524e15fe3b5c2b92939321a896bcb626fad5fee | liqd/thentos | FrontendSpec.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# OPTIONS -fno-warn-incomplete-patterns #-}
module Thentos.FrontendSpec where
import Control.Lens ((^.))
import Control.Monad.IO.Class (liftIO)
import Data.Maybe (fromJust, isJust, listToMaybe)
import ... | null | https://raw.githubusercontent.com/liqd/thentos/f7d53d8e9d11956d2cc83efb5f5149876109b098/thentos-tests/tests/Thentos/FrontendSpec.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE OverloadedStrings #
# LANGUAGE ScopedTypeVariables #
# OPTIONS -fno-warn-incomplete-patterns #
check that user is in db
FIXME: test with ordinary user (not god).
"create_user" and "reset_password" (make sure the check is in
separate function, not inlined.)
manageGro... |
module Thentos.FrontendSpec where
import Control.Lens ((^.))
import Control.Monad.IO.Class (liftIO)
import Data.Maybe (fromJust, isJust, listToMaybe)
import Data.String.Conversions (ST, cs)
import Test.Hspec (Spec, SpecWith, hspec, around, describe, it,
shouldBe, shouldContain, shouldSatisfy, pend... |
8ca71cc1c7522f948025ccd8a7432695f5002f7b01491f26eca29adb195f85f1 | jessealama/laramie | doctype.rkt | #lang typed/racket/base/optional
(provide DOCTYPE)
(require (file "types.rkt")
(file "tokens.rkt")
(file "stream.rkt")
(file "predicates.rkt")
(file "parameters.rkt")
(file "infrastructure.rkt"))
(module+ test
(require typed/rackunit))
(: current-doctype-quirky? (Param... | null | https://raw.githubusercontent.com/jessealama/laramie/1057028aabb938b019b5429dd4a1207b8476aa00/laramie-lib/laramie/tokenizer/doctype.rkt | racket | #doctype-state
#after-doctype-public-keyword-state | #lang typed/racket/base/optional
(provide DOCTYPE)
(require (file "types.rkt")
(file "tokens.rkt")
(file "stream.rkt")
(file "predicates.rkt")
(file "parameters.rkt")
(file "infrastructure.rkt"))
(module+ test
(require typed/rackunit))
(: current-doctype-quirky? (Param... |
1008636eed98ff6150cdf23a937399347cbdf8fd88e71b07bc08011953a70c9e | janestreet/hardcaml | comb_intf.ml | open Base
* Various functions that build a tree - structured circuit take an optional
[ branching_factor ] argument that controls the number of branches at each level of the
circuit . With [ N ] inputs and the depth is [ N ] . With
[ branching_factor = 2 ] the the depth is [ ceil_log2 N ] . ... | null | https://raw.githubusercontent.com/janestreet/hardcaml/15727795c2bf922dd852cc0cd895a4ed1d9527e5/src/comb_intf.ml | ocaml | * the empty signal
* returns the width of a signal
* creates a constant
* concatenates a list of signals
* select a range of bits
* names a signal
* bitwise and
* bitwise or
* bitwise xor
* bitwise not
* create string from signal
* Type required to generate the full combinational API
* multiplexer
* additi... | open Base
* Various functions that build a tree - structured circuit take an optional
[ branching_factor ] argument that controls the number of branches at each level of the
circuit . With [ N ] inputs and the depth is [ N ] . With
[ branching_factor = 2 ] the the depth is [ ceil_log2 N ] . ... |
211f0d6dce308b7c699101b895be2d9b854edf6bc86e3ce8972b8807dff238b8 | glguy/ssh-hans | Mac.hs | # LANGUAGE RecordWildCards #
{-# LANGUAGE OverloadedStrings #-}
module Network.SSH.Mac (
Mac()
, mETM
, computeMac
, allMac
, mac_none
, mac_hmac_md5
, mac_hmac_md5_96
, mac_hmac_ripemd160
, mac_hmac_sha1
, mac_hmac_sha1_96
, mac_hmac_sha2_256
, mac_hmac_sha2_512
, mac_hmac_md5_etm
, m... | null | https://raw.githubusercontent.com/glguy/ssh-hans/25d05366d4655eb249bfb13f9a6d473b49885bd9/src/Network/SSH/Mac.hs | haskell | # LANGUAGE OverloadedStrings #
Put this last so it's not used on accident; the entries in this
list are interpreted to be in preference order in
'allAlgsSshProposalPrefs'.
Algorithms ------------------------------------------------------------------
^ name
^ encrypt then modify
^ keystream argument
| A helpe... | # LANGUAGE RecordWildCards #
module Network.SSH.Mac (
Mac()
, mETM
, computeMac
, allMac
, mac_none
, mac_hmac_md5
, mac_hmac_md5_96
, mac_hmac_ripemd160
, mac_hmac_sha1
, mac_hmac_sha1_96
, mac_hmac_sha2_256
, mac_hmac_sha2_512
, mac_hmac_md5_etm
, mac_hmac_md5_96_etm
, mac_hmac_rip... |
77d3f63035fa68db25e16842ded02cb485c5597c60c834e122579a1ee11840d8 | unisonweb/unison | Referent.hs | {-# LANGUAGE OverloadedStrings #-}
module Unison.Test.Referent where
import Data.Text (Text)
import qualified Data.Text as Text
import EasyTest
import qualified Unison.Reference as Rf
import qualified Unison.Referent as R
import qualified Unison.ShortHash as SH
test :: Test ()
test =
scope "hashparsing" . tests $
... | null | https://raw.githubusercontent.com/unisonweb/unison/7843e48cddbe46436bffb5a2e1bb5fb444f55302/parser-typechecker/tests/Unison/Test/Referent.hs | haskell | # LANGUAGE OverloadedStrings # |
module Unison.Test.Referent where
import Data.Text (Text)
import qualified Data.Text as Text
import EasyTest
import qualified Unison.Reference as Rf
import qualified Unison.Referent as R
import qualified Unison.ShortHash as SH
test :: Test ()
test =
scope "hashparsing" . tests $
[ scope "Reference" $
t... |
30b82f651930609f5385224694e5772869b9247ed9233442a460b96aa7a146c9 | fortytools/holumbus | Client.hs | module Main
( main )
where
import Crawl2.Examples2.MRIndexer
import Crawl2.Examples2.Common
import Holumbus.Distribution.SimpleDMapReduceIO
import Holumbus.DCrawler.URIs
import Holumbus.DCrawler.Robots
import Holumbus.DCrawler.Core
import Holumbus.Common.Logging
import System.Log.Logger
import System.Environment
impor... | null | https://raw.githubusercontent.com/fortytools/holumbus/4b2f7b832feab2715a4d48be0b07dca018eaa8e8/crawl2/Examples2/Re/Client.hs | haskell | _ <- readline "Press a key"
do another loop
infoM localLogger ("\n~~~~~~~~~\niteration: " ++ show count)
split toBeProcessed uris by num of workers tbps and give each uri an unique id :: [(URI, Int)]
tbps = partition num (idoffset `div` num) (zip uris [nextId..])
<<<<<<<<------------------------------- ????????... | module Main
( main )
where
import Crawl2.Examples2.MRIndexer
import Crawl2.Examples2.Common
import Holumbus.Distribution.SimpleDMapReduceIO
import Holumbus.DCrawler.URIs
import Holumbus.DCrawler.Robots
import Holumbus.DCrawler.Core
import Holumbus.Common.Logging
import System.Log.Logger
import System.Environment
impor... |
7875f3c2cfb2d8837c2150cafa951bec09fa3dc31b3da1ac8545a40522846e76 | aryx/xix | timers.ml | open Common
open Types
type t = {
(* sorted by fasttk *)
mutable elts: Timer.t list;
(* !lock ordering! lock(Timer.t); lock(Timers.t) *)
l: Ilock.t;
}
let alloc () = {
elts = [];
l = Ilock.alloc ();
}
let cpus_timers =
Array.init Arch.max_cpus (fun _ -> alloc ())
let add timer =
Ilock.lock timer... | null | https://raw.githubusercontent.com/aryx/xix/60ce1bd9a3f923e0e8bb2192f8938a9aa49c739c/kernel/time/timers.ml | ocaml | sorted by fasttk
!lock ordering! lock(Timer.t); lock(Timers.t)
stricter? allow to have timer already active
timerdel? but then should call arch_timerset somewhere?
* or assert cpuid = cpu.id?
* or ok if timer occurs anyway; it will do not trigger any callback.
todo: can have race where timer not ... | open Common
open Types
type t = {
mutable elts: Timer.t list;
l: Ilock.t;
}
let alloc () = {
elts = [];
l = Ilock.alloc ();
}
let cpus_timers =
Array.init Arch.max_cpus (fun _ -> alloc ())
let add timer =
Ilock.lock timer.Timer_.l;
timer.Timer_.cpu |> Common.if_some (fun cpuid ->
raise Todo
... |
bc3966462814195c8b792063879aa1ca583859c3de5dfbad2674d75cbea5cd61 | craigl64/clim-ccl | defs-graphics-generics.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Package : CLIM - INTERNALS ; Base : 10 ; Lowercase : Yes -*-
(in-package :clim-internals)
"Copyright (c) 1990, 1991, 1992 Symbolics, Inc. All rights reserved.
Portions copyright (c) 1989, 1990 International Lisp Associates."
(eval-when (compile load eval)
;; NO... | null | https://raw.githubusercontent.com/craigl64/clim-ccl/301efbd770745b429f2b00b4e8ca6624de9d9ea9/pre-silica/defs-graphics-generics.lisp | lisp | Syntax : ANSI - Common - Lisp ; Package : CLIM - INTERNALS ; Base : 10 ; Lowercase : Yes -*-
NOTE: if you change this list of keywords, you also have to change the keyword arguments
accepted by (CLOS:METHOD INVOKE-WITH-DRAWING-OPTIONS (DRAWING-STATE-MIXIN T))
If drawing-options isn't nil, it's a list of the option ... |
(in-package :clim-internals)
"Copyright (c) 1990, 1991, 1992 Symbolics, Inc. All rights reserved.
Portions copyright (c) 1989, 1990 International Lisp Associates."
(eval-when (compile load eval)
(defparameter *all-drawing-options*
'(:ink :clipping-region :transformation
:line-style :line-unit :line-thic... |
c6987f7818ca8525177a7def1e19f9345e2a915ad07571fdf69e943a18340600 | input-output-hk/cardano-sl | DSL.hs | {-# LANGUAGE DerivingStrategies #-}
# LANGUAGE DuplicateRecordFields #
{-# LANGUAGE RankNTypes #-}
module Test.Integration.Framework.DSL
(
-- * Scenario
scenario
, xscenario
, pendingWith
, Scenarios
, Context(..)
-- * Steps
, Setup(..)
, setup
, request
... | null | https://raw.githubusercontent.com/input-output-hk/cardano-sl/1499214d93767b703b9599369a431e67d83f10a2/wallet/test/integration/Test/Integration/Framework/DSL.hs | haskell | # LANGUAGE DerivingStrategies #
# LANGUAGE RankNTypes #
* Scenario
* Steps
* Requests (Only API types)
* Expectations
* Helpers
SCENARIO
Prior to starting integration tests, we setup a global context
and "prepare" a few faucet wallets which all contains some funds.
This helps speed up testing a... | # LANGUAGE DuplicateRecordFields #
module Test.Integration.Framework.DSL
(
scenario
, xscenario
, pendingWith
, Scenarios
, Context(..)
, Setup(..)
, setup
, request
, request_
, successfulRequest
, unsafeRequest
, verify
, NewAddress(..)
, NewWallet (..)... |
afdbbec28d70e62b909badbdc5cb76029e257b33e0c557962ac9ed4c05ac84a5 | AdRoll/erlmld | erlmld_sup.erl | -module(erlmld_sup).
-behaviour(supervisor).
%% API
-export([start_link/1]).
%% Supervisor callbacks
-export([init/1]).
%%====================================================================
%% API functions
%%====================================================================
start_link(Opts) ->
Regname = reg... | null | https://raw.githubusercontent.com/AdRoll/erlmld/0ca902895fb058a42d4b8a7ab32ec91a74441e61/src/erlmld_sup.erl | erlang | API
Supervisor callbacks
====================================================================
API functions
====================================================================
====================================================================
Supervisor callbacks
=================================================... | -module(erlmld_sup).
-behaviour(supervisor).
-export([start_link/1]).
-export([init/1]).
start_link(Opts) ->
Regname = regname(?MODULE, Opts),
supervisor:start_link({local, Regname}, ?MODULE, [Regname, Opts]).
init([Regname,
#{record_processor := RecordProcessor,
record_processor_data := Rec... |
9b9c2c59fcdfd19fce36567c5397dd3a2ff1b8fa82d422fe5dbd63d7f30714d2 | senorcarbone/erlang-nnar-kvs | logger.erl | -module(logger).
-behavior(gen_server).
-export([start/1, stop/1, log/2]).
-export([init/1, handle_cast/2]).
-record(state, {logfile}).
start(Logname) ->
gen_server:start_link(?MODULE, [Logname], []).
stop(Me) ->
gen_server:cast(Me, stop).
log(Me, Msg) ->
gen_server:cast(Me, {log, Msg}).
%%GEN_SERVER
init([Lo... | null | https://raw.githubusercontent.com/senorcarbone/erlang-nnar-kvs/defb7a529b5fb3c248be7f620fa7fbbd312723b5/src/logger.erl | erlang | GEN_SERVER | -module(logger).
-behavior(gen_server).
-export([start/1, stop/1, log/2]).
-export([init/1, handle_cast/2]).
-record(state, {logfile}).
start(Logname) ->
gen_server:start_link(?MODULE, [Logname], []).
stop(Me) ->
gen_server:cast(Me, stop).
log(Me, Msg) ->
gen_server:cast(Me, {log, Msg}).
init([Logname]) ->
{... |
d65fd0f9c8f0e41c599be2adf797e300725e75416092c4b7dd291181ce8355a7 | gtk2hs/gtk2hs | GtkChap5-2a.hs | import Graphics.UI.Gtk
main :: IO ()
main = do
initGUI
window <- windowNew
set window [windowTitle := "File Chooser Widget",
windowDefaultWidth := 500,
windowDefaultHeight := 400 ]
fch <- fileChooserWidgetNew FileChooserActionOpen
containerAdd window fch
selopt <- chec... | null | https://raw.githubusercontent.com/gtk2hs/gtk2hs/0f90caa1dae319a0f4bbab76ed1a84f17c730adf/docs/tutorial/Tutorial_Port/Example_Code/GtkChap5-2a.hs | haskell | import Graphics.UI.Gtk
main :: IO ()
main = do
initGUI
window <- windowNew
set window [windowTitle := "File Chooser Widget",
windowDefaultWidth := 500,
windowDefaultHeight := 400 ]
fch <- fileChooserWidgetNew FileChooserActionOpen
containerAdd window fch
selopt <- chec... | |
bb7263cf2ed499d6cf1d7eab3c19736cc21ecea4b153743892e9f936c6a6c260 | OCamlPro/ocp-build | ocpLang.ml | (**************************************************************************)
(* *)
(* Typerex Libraries *)
(* *)
Copyrigh... | null | https://raw.githubusercontent.com/OCamlPro/ocp-build/56aff560bb438c12b2929feaf8379bc6f31b9840/libs/ocplib-lang/ocpLang.ml | ocaml | ************************************************************************
Typerex Libraries
... | Copyright 2011 - 2017 OCamlPro SAS
the GNU Lesser General Public License version 2.1 , with the
include OcpPervasives
module List = struct
include List
include OcpList
end
module String = struct
include String
include OcpString
end
module Stream = stru... |
977f87e4ca6a4cf101cf986fa262ce3acec1f8a14d121e527ff290f92d263449 | lemmaandrew/CodingBatHaskell | count8.hs | From
Given a non - negative int n , compute recursively ( no loops ) the count of the occurrences
of 8 as a digit , except that an 8 with another 8 immediately to its left counts double ,
so 8818 yields 4 . Note that mod ( % ) by 10 yields the rightmost digit ( 126 % 10 is 6 ) ,
while divide ( / ) by 10 remo... | null | https://raw.githubusercontent.com/lemmaandrew/CodingBatHaskell/d839118be02e1867504206657a0664fd79d04736/CodingBat/Recursion-1/count8.hs | haskell | From
Given a non - negative int n , compute recursively ( no loops ) the count of the occurrences
of 8 as a digit , except that an 8 with another 8 immediately to its left counts double ,
so 8818 yields 4 . Note that mod ( % ) by 10 yields the rightmost digit ( 126 % 10 is 6 ) ,
while divide ( / ) by 10 remo... | |
1b521bd97c7b64dff2733ab73a98416e32f2aaf495b9bc5c41868ba46332cb5a | haskell-compat/base-compat | Compat.hs | # LANGUAGE CPP , NoImplicitPrelude #
module Data.Void.Compat (
#if MIN_VERSION_base(4,8,0)
module Base
#endif
) where
#if MIN_VERSION_base(4,8,0)
import Data.Void as Base
#endif
| null | https://raw.githubusercontent.com/haskell-compat/base-compat/847aa35c4142f529525ffc645cd035ddb23ce8ee/base-compat/src/Data/Void/Compat.hs | haskell | # LANGUAGE CPP , NoImplicitPrelude #
module Data.Void.Compat (
#if MIN_VERSION_base(4,8,0)
module Base
#endif
) where
#if MIN_VERSION_base(4,8,0)
import Data.Void as Base
#endif
| |
e258e76f2912c3eec03e1695884c0625942ce5e77f8b3cf5c1e81c1c05f24306 | cuichaox/dml | sequnces-examples.lisp | example for sequnce diagram using
(asdf:load-system :dml)
(in-package :dml)
(uiop:chdir (asdf:system-relative-pathname :dml "demo"))
(dml-create-sequence "legend" ()
(&prog "==>ObjectA.SyncMsg1()/ret1"
(&chain "==>ObjectA.SyncMsg2()/ret2"
"==>ObjectB.SyncMsg2.1()/ret2.1"
... | null | https://raw.githubusercontent.com/cuichaox/dml/6f71a2ce9b2cfa295f2db4e17446935f9136b0b1/demo/sequnces-examples.lisp | lisp | example for sequnce diagram using
(asdf:load-system :dml)
(in-package :dml)
(uiop:chdir (asdf:system-relative-pathname :dml "demo"))
(dml-create-sequence "legend" ()
(&prog "==>ObjectA.SyncMsg1()/ret1"
(&chain "==>ObjectA.SyncMsg2()/ret2"
"==>ObjectB.SyncMsg2.1()/ret2.1"
... | |
6754d9cd13e26cd89726bad4a5e7ee7b8388263373447af45ce864abb3b75185 | realworldocaml/book | ast_helper_lite.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/ppxlib/ast/ast_helper_lite.mli | ocaml | ************************************************************************
OCaml
... | , LexiFi
Copyright 2012 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
* Copy of Ast_helper from OCaml 4.14 with docstring related stuff removed
open Astlib.Ast_500
open Asttyp... |
0ac7491a9dcf98c226fbd0b472de30ddbae01cc6a7d28f6b0e0661b03ea8858b | licht1stein/clj-telegram-bot | core.clj | (ns telegram.core
(:require [clojure.string :as str]
[clojure.java.shell :as shell]
[clojure.core.async :refer [go go-loop <! timeout]]
[telegram.api.core :as api])
(:gen-class))
(def ^{:private true} default-data
{:bot {:user-agent "clj-telegram-bot"
:timeout 300000
... | null | https://raw.githubusercontent.com/licht1stein/clj-telegram-bot/f3181314ad9b1a0153283f9d5666da2f00e1294d/src/telegram/core.clj | clojure | (ns telegram.core
(:require [clojure.string :as str]
[clojure.java.shell :as shell]
[clojure.core.async :refer [go go-loop <! timeout]]
[telegram.api.core :as api])
(:gen-class))
(def ^{:private true} default-data
{:bot {:user-agent "clj-telegram-bot"
:timeout 300000
... | |
c8d7196264b44ff079e8b4cb34bab51cc1b63f77ce9d56c79d324988dd463bb0 | korya/efuns | demo_filesel.ml | (***********************************************************************)
(* *)
(* ____ *)
(* *)
Fabrice Le Fessa... | null | https://raw.githubusercontent.com/korya/efuns/78b21d9dff45b7eec764c63132c7a564f5367c30/toolkit/examples/demo_filesel.ml | ocaml | *********************************************************************
____
... | Fabrice Le Fessant , projet Para / SOR , INRIA Rocquencourt
Copyright 1999 Institut National de Recherche en Informatique et
Automatique . Distributed only by permission .
open WX_types
let display = new WX_display.t ""
let root = new WX_root.t display 0
open WX_fi... |
c43d315a357998315f7a68bf306f3c52a46b737442761abab5fd2b16af6785a8 | ymherklotz/verismith | Vivado.hs | -- |
Module : . Tool . Vivado
-- Description : Vivado Synthesiser implementation.
Copyright : ( c ) 2019 ,
-- License : GPL-3
-- Maintainer : yann [at] yannherklotz [dot] com
-- Stability : experimental
-- Portability : POSIX
--
implementation .
module Verismith.Tool.Vivado
( Vivado (..),
... | null | https://raw.githubusercontent.com/ymherklotz/verismith/773acb06f15d49b810b76508505f5df5a84f8172/src/Verismith/Tool/Vivado.hs | haskell | |
Description : Vivado Synthesiser implementation.
License : GPL-3
Maintainer : yann [at] yannherklotz [dot] com
Stability : experimental
Portability : POSIX
| Module : . Tool . Vivado
Copyright : ( c ) 2019 ,
implementation .
module Verismith.Tool.Vivado
( Vivado (..),
defaultVivado,
)
where
import Control.DeepSeq (NFData, rnf, rwhnf)
import Data.Text (Text, unpack)
import Shelly
import Shelly.Lifted (liftSh)
import Verismith.Tool.Internal
impor... |
c0133b6853f8c6917a0c9fb6cf1cd79c0be2611f8bba324df4bada4c6b33d7d0 | jscrane/jvml | ex7_pca.clj | (ns ml.ex7-pca
(:use (incanter core charts)
(ml matlab util pca)))
(def args (into #{} *command-line-args*))
(if (contains? args "pca")
(let [X (:X (read-dataset-mat5 "data/ex7data1.mat"))
{Xnorm :data mu :mean} (feature-normalize X)
{:keys [U S]} (pca Xnorm)
p (plus mu (mult 1.5 (... | null | https://raw.githubusercontent.com/jscrane/jvml/844eb267150564a3a0f882edbbd505ce94924c8f/src/main/clojure/ml/ex7_pca.clj | clojure | TODO: computing the covariance matrix takes forever... | (ns ml.ex7-pca
(:use (incanter core charts)
(ml matlab util pca)))
(def args (into #{} *command-line-args*))
(if (contains? args "pca")
(let [X (:X (read-dataset-mat5 "data/ex7data1.mat"))
{Xnorm :data mu :mean} (feature-normalize X)
{:keys [U S]} (pca Xnorm)
p (plus mu (mult 1.5 (... |
b5af0c0e5c467316673f4a1f2ebdbd1833c5bd4de2df69f56d6c1fed0dfae92c | 8c6794b6/guile-tjit | function.scm | ECMAScript for
Copyright ( C ) 2009 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 the License , or ( at your option )... | null | https://raw.githubusercontent.com/8c6794b6/guile-tjit/9566e480af2ff695e524984992626426f393414f/module/language/ecmascript/function.scm | scheme | 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
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See... | ECMAScript for
Copyright ( C ) 2009 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
(define-module (language ecmasc... |
f15a77281102c5a12f45647e28782edfdd2b2d302c68297e4e06b6f83fd58aa2 | matterandvoid-space/todomvc-fulcro-subscriptions | ui.cljs | (ns space.matterandvoid.todomvc.todo.ui
(:require
[applied-science.js-interop :as j]
[com.fulcrologic.fulcro.algorithms.form-state :as fs]
[helix.core :refer [defnc $]]
[helix.dom :as d]
[helix.hooks :as hooks]
[space.matterandvoid.todomvc.todo.model :as todo.model]
[goog.object :as gobj]
... | null | https://raw.githubusercontent.com/matterandvoid-space/todomvc-fulcro-subscriptions/e2e244936efe1005fa2cac204a24758b067aac4e/src/main/space/matterandvoid/todomvc/todo/ui.cljs | clojure | (ns space.matterandvoid.todomvc.todo.ui
(:require
[applied-science.js-interop :as j]
[com.fulcrologic.fulcro.algorithms.form-state :as fs]
[helix.core :refer [defnc $]]
[helix.dom :as d]
[helix.hooks :as hooks]
[space.matterandvoid.todomvc.todo.model :as todo.model]
[goog.object :as gobj]
... | |
9f9b905e9b123230da932881ae38904d99cd7fd31e63f4eb3870a81703049c74 | onedata/op-worker | opt_cdmi.erl | %%%-------------------------------------------------------------------
@author
( C ) 2022 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
%%% @end
%%%-------------------------------------------------------------------
%%% @doc
Utility functions for manipulating C... | null | https://raw.githubusercontent.com/onedata/op-worker/41e0afe4d7fa536734c0e22187cd354b2d6c87f7/test_distributed/utils/opt/opt_cdmi.erl | erlang | -------------------------------------------------------------------
@end
-------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
===================================================================
API
====================... | @author
( C ) 2022 ACK CYFRONET AGH
This software is released under the MIT license
cited in ' LICENSE.txt ' .
Utility functions for manipulating CDMI file metadata in CT tests .
-module(opt_cdmi).
-author("Bartosz Walkowicz").
-export([
get_transfer_encoding/3,
set_transfer_encoding/4,
get_c... |
136839cf1abdde218f1852ecded6918d6c51e1d569b09fc40b7c572c8893a6ea | easyuc/EasyUC | ecCallbyValue.ml | (* -------------------------------------------------------------------- *)
open EcUtils
open EcIdent
open EcTypes
open EcEnv
open EcFol
open EcReduction
open EcBaseLogic
module BI = EcBigInt
(* -------------------------------------------------------------------- *)
type state = {
st_ri : reduction_info;
st_hyps ... | null | https://raw.githubusercontent.com/easyuc/EasyUC/a9ce3e3a47b48a498ec9944eab85f2677886c7ae/uc-dsl/ucdsl-proj/src/ECsrc/ecCallbyValue.ml | ocaml | --------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
-----------------------------------... | open EcUtils
open EcIdent
open EcTypes
open EcEnv
open EcFol
open EcReduction
open EcBaseLogic
module BI = EcBigInt
type state = {
st_ri : reduction_info;
st_hyps : LDecl.hyps;
st_env : EcEnv.env;
}
module Subst : sig
type subst
val subst_id : subst
val subst : subst -> form -> form
val su... |
febf397dac9380e8d1d4b2f6f9c1289340d777b74ea28d8350200ac56ba80f35 | otto-de/tesla-examples | end_to_end_test.clj | (ns de.otto.tesla.example.end-to-end-test
(:require [clojure.test :refer :all]
[hickory.select :as s]
[hickory.core :as h]
[de.otto.tesla.util.test-utils :as u]
[de.otto.tesla.stateful.handler :as hndl]
[de.otto.tesla.example.core :as core]))
(deftest ^:int... | null | https://raw.githubusercontent.com/otto-de/tesla-examples/1be46ceae1dac53204a8f655a81285e1ca214f9b/simple-example/test/de/otto/tesla/example/end_to_end_test.clj | clojure | (ns de.otto.tesla.example.end-to-end-test
(:require [clojure.test :refer :all]
[hickory.select :as s]
[hickory.core :as h]
[de.otto.tesla.util.test-utils :as u]
[de.otto.tesla.stateful.handler :as hndl]
[de.otto.tesla.example.core :as core]))
(deftest ^:int... | |
616bb4c9c70edbafd2ab4991602f2e9e212b22f7ff73bfd47ae5ba0948898c44 | SNePS/SNePS2 | findexact.lisp | -*- Mode : Lisp ; Syntax : Common - Lisp ; Package : SNEPS ; Base : 10 -*-
Copyright ( C ) 1984 - -2013 Research Foundation of
;; State University of New York
Version : $ I d : findexact.lisp , v 1.3 2013/08/28 19:07:25 shapiro Exp $
;; This file is part of SNePS.
$ BEGIN LICENSE$
... | null | https://raw.githubusercontent.com/SNePS/SNePS2/d3862108609b1879f2c546112072ad4caefc050d/sneps/fns/findexact.lisp | lisp | Syntax : Common - Lisp ; Package : SNEPS ; Base : 10 -*-
State University of New York
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 t... |
Copyright ( C ) 1984 - -2013 Research Foundation of
Version : $ I d : findexact.lisp , v 1.3 2013/08/28 19:07:25 shapiro Exp $
$ 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 AN... |
3d9171ed545b52e0dae6364f4344f6306e5ad04006fc511c89769c6c2fa1d2b0 | yesodweb/wai | Mime.hs | {-# LANGUAGE OverloadedStrings #-}
module Network.Mime
( -- * Lookups
mimeByExt
, defaultMimeLookup
-- * Defaults
, defaultMimeType
, defaultMimeMap
-- * Utilities
, fileNameExtensions
-- * Types
, FileName
, MimeType
, MimeMap
, Extension
) where
import ... | null | https://raw.githubusercontent.com/yesodweb/wai/8a95ecd7459e5da995aa043a55c1fc582c183c40/mime-types/Network/Mime.hs | haskell | # LANGUAGE OverloadedStrings #
* Lookups
* Defaults
* Utilities
* Types
| Maps extensions to mime types.
| The filename component of a filepath, leaving off the directory but
keeping all extensions.
| Individual mime type for be served over the wire.
| Look up a mime type from the given mime map and default mi... | module Network.Mime
mimeByExt
, defaultMimeLookup
, defaultMimeType
, defaultMimeMap
, fileNameExtensions
, FileName
, MimeType
, MimeMap
, Extension
) where
import Data.Text (Text)
import qualified Data.Text as T
import Data.ByteString (ByteString)
import Data.ByteString.Char... |
8a583dae94fade9adc40cb7ce84014c11e428ad6183364fe1ccc17c98fd44544 | henrystanley/Quark | REPL.hs | module Quark.REPL (qRepl) where
import Quark.QVM
import Quark.Interpret
import Quark.Serialize
import qualified Data.Map as Map
import Data.List
--- REPL ---
-- read eval loop
-- prints prompt, gets input, then handles special cmds or evaulates the input
qRepl :: [String] -> IO QVM -> IO ()
qRepl params vm = do
pu... | null | https://raw.githubusercontent.com/henrystanley/Quark/63df61e47bedc1092c89529eedaf8ad229193f0b/Quark/REPL.hs | haskell | - REPL ---
read eval loop
prints prompt, gets input, then handles special cmds or evaulates the input
-
prints the stack | module Quark.REPL (qRepl) where
import Quark.QVM
import Quark.Interpret
import Quark.Serialize
import qualified Data.Map as Map
import Data.List
qRepl :: [String] -> IO QVM -> IO ()
qRepl params vm = do
putStr ":> "
input <- getLine
case words input of
["*q"] -> return ()
["*f"] -> vm >>= displayFuncti... |
30d6fa6d4de527ff429a1482eff4019cfe07b9cf6aa5ef88af978f27106d42d4 | exercism/racket | example.rkt | #lang racket
(provide (contract-out
[encode (string? . -> . string?)]
[decode (string? . -> . string?)]))
(define (prepare-string m)
(filter (λ(s)
(or (char-numeric? s)
(char-alphabetic? s)))
(string->list
(string-downcase m))))
(define (atbash-c... | null | https://raw.githubusercontent.com/exercism/racket/d171a5fb3595cc09d171051a3f5ef45caedad020/exercises/practice/atbash-cipher/.meta/example.rkt | racket | #lang racket
(provide (contract-out
[encode (string? . -> . string?)]
[decode (string? . -> . string?)]))
(define (prepare-string m)
(filter (λ(s)
(or (char-numeric? s)
(char-alphabetic? s)))
(string->list
(string-downcase m))))
(define (atbash-c... | |
aa3ebeae53f011ca2fc417827e42d5d292310d196483d061dccb8270edf136fd | kanru/cl-mustache | test-api.lisp | ;;;; test-api.lisp --- CL-MUSTACHE API test
Copyright ( C ) 2012 ( 陳侃如 )
Author(s ): ( 陳侃如 ) < >
;;; 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 , in... | null | https://raw.githubusercontent.com/kanru/cl-mustache/f5501e4372900813a9be4a557764b41636a7e250/t/test-api.lisp | lisp | test-api.lisp --- CL-MUSTACHE API test
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
the rights to use, copy, modify, merge, publish, distribute, sublicense,
Software is furnished to do so, subject to the following... |
Copyright ( C ) 2012 ( 陳侃如 )
Author(s ): ( 陳侃如 ) < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WIT... |
c4d6c8a2826892d0c372aea59da30e6220e204dc3731baaf6de933f786f92aa7 | bgavran/Compositional_Deep_Learning | Para.hs | module Para where
import Prelude hiding (id, (.))
import Control.Lens hiding ((#), para)
import GHC.Exts (Constraint)
import Data.Kind (Type)
import CategoricDefinitions
import Autodiff.GAD
import Autodiff.Additive
import Autodiff.Dual
import Autodiff.D
import TensorUtils
import OnesLike
import AsymmetricLens
------... | null | https://raw.githubusercontent.com/bgavran/Compositional_Deep_Learning/a1c3fce3367a5bddf55287ac8393a729ab815ab9/src/Para.hs | haskell | -----------------------------------------------------------------
f)
----------------------------------------------------------------- | module Para where
import Prelude hiding (id, (.))
import Control.Lens hiding ((#), para)
import GHC.Exts (Constraint)
import Data.Kind (Type)
import CategoricDefinitions
import Autodiff.GAD
import Autodiff.Additive
import Autodiff.Dual
import Autodiff.D
import TensorUtils
import OnesLike
import AsymmetricLens
newty... |
5796f9df0e38a1d65e5e4b0f04e6a4560eb15e85f9f9c71ff24d84f07937b388 | ragkousism/Guix-on-Hurd | gxmessage.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2014 < >
Copyright © 2016 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation ; ei... | null | https://raw.githubusercontent.com/ragkousism/Guix-on-Hurd/e951bb2c0c4961dc6ac2bda8f331b9c4cee0da95/gnu/packages/gxmessage.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2014 < >
Copyright © 2016 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages gxmessage)
#:use-module (guix licenses)
#:use-module (g... |
b91323cc03e5e5c00415f9813433b798ed60885539a2945f4d6ebdb9a6104e04 | ifigueroap/racket-quickcheck | arbitrary.rkt | #lang racket/base
(provide (struct-out arbitrary)
coarbitrary)
;; generator : (generator a)
;; transformer : a (generator b) -> (generator b)
(struct arbitrary (generator transformer))
; class Arbitrary a where
; arbitrary :: Gen a
: : a - > Gen b - > Gen b
(define (coarbitrary arb val gen)
... | null | https://raw.githubusercontent.com/ifigueroap/racket-quickcheck/902eb30fa8f5c0df7910df22c1442ff866b3920d/quickcheck/private/arbitrary.rkt | racket | generator : (generator a)
transformer : a (generator b) -> (generator b)
class Arbitrary a where
arbitrary :: Gen a | #lang racket/base
(provide (struct-out arbitrary)
coarbitrary)
(struct arbitrary (generator transformer))
: : a - > Gen b - > Gen b
(define (coarbitrary arb val gen)
((arbitrary-transformer arb) val gen)) |
1144a422ed35790badc7207f09f00914e976884ba726e7b14d94d9e33fd5bad1 | nominolo/lambdachine | Rank2.hs | # LANGUAGE NoImplicitPrelude , Rank2Types #
module Bc.Rank2 where
import GHC.Base
import Control.Monad ( MonadPlus(..) )
data P a
= Get (Char -> P a)
| Look (String -> P a)
| Fail
| Final [(a, String)]
| Result a (P a)
type ReadS a = String -> [(a,String)]
newtype ReadP a = R (forall b. (a -> P b) -> P b... | null | https://raw.githubusercontent.com/nominolo/lambdachine/49d97cf7a367a650ab421f7aa19feb90bfe14731/tests/Bc/Rank2.hs | haskell | (Look f) >>= k = Look (\s -> f s >>= k)
results are delivered as soon as possible
fail disappears
look + sthg else floats upwards
Maintains invariant for Final constructor | # LANGUAGE NoImplicitPrelude , Rank2Types #
module Bc.Rank2 where
import GHC.Base
import Control.Monad ( MonadPlus(..) )
data P a
= Get (Char -> P a)
| Look (String -> P a)
| Fail
| Final [(a, String)]
| Result a (P a)
type ReadS a = String -> [(a,String)]
newtype ReadP a = R (forall b. (a -> P b) -> P b... |
41cbc94b7024c4fe6cb688687e31660ba36b301b45a440e6e4e6f01b76bccc5e | unison-code/unison | PresolverParameters.hs | |
Copyright : Copyright ( c ) 2016 , RISE SICS AB
License : BSD3 ( see the LICENSE file )
Maintainer :
Copyright : Copyright (c) 2016, RISE SICS AB
License : BSD3 (see the LICENSE file)
Maintainer :
-}
Main authors :
< >
Contributing authors :
< >
Mats >
... | null | https://raw.githubusercontent.com/unison-code/unison/9f8caf78230f956a57b50a327f8d1dca5839bf64/src/unison/src/Unison/Tools/Model/PresolverParameters.hs | haskell | Default (empty presolver parameters)
set of dominated uses
set of precedences
set of register assignment hints
sets of interchangeable copies
Default (empty) presolver parameters, see presolver doc
Maximum number of nodes in a block for dominated uses | |
Copyright : Copyright ( c ) 2016 , RISE SICS AB
License : BSD3 ( see the LICENSE file )
Maintainer :
Copyright : Copyright (c) 2016, RISE SICS AB
License : BSD3 (see the LICENSE file)
Maintainer :
-}
Main authors :
< >
Contributing authors :
< >
Mats >
... |
802663caffe6219b95e055af6d4fd4a1bf5d434939b5d24bd825706b093f1ba9 | hverr/haskell-obd | Monad.hs | -- | Collection of helper functions to deal with monads.
module System.Hardware.ELM327.Utils.Monad where
import Control.Monad.Except (MonadError, throwError)
-- | Convert 'Maybe a' to 'Either a b'.
maybeToLeft :: b -> Maybe a -> Either a b
maybeToLeft _ (Just x) = Left x
maybeToLeft x Nothing = Right x
-- | Convert... | null | https://raw.githubusercontent.com/hverr/haskell-obd/f7de2d2c392ad491671fda60552563af181c15dd/src/System/Hardware/ELM327/Utils/Monad.hs | haskell | | Collection of helper functions to deal with monads.
| Convert 'Maybe a' to 'Either a b'.
| Convert 'Maybe a' to 'Either b a'.
| Convert 'Maybe a' to @throwError a@.
| Throw an exception on 'Nothing'. | module System.Hardware.ELM327.Utils.Monad where
import Control.Monad.Except (MonadError, throwError)
maybeToLeft :: b -> Maybe a -> Either a b
maybeToLeft _ (Just x) = Left x
maybeToLeft x Nothing = Right x
maybeToRight :: b -> Maybe a -> Either b a
maybeToRight _ (Just x) = Right x
maybeToRight x Nothing = Left x
... |
234d38488d751e9f9a7ce726653d8620aba9cedcdeff26b81728590d2fd79da1 | regex-generate/regenerate | LazyList.ml | module L = CCLazy_list
let next = Lazy.force
module Make (K : Sigs.OrderedMonoid)
: Sigs.S with type elt = K.t and type t = K.t L.t
= struct
type elt = K.t
type t = elt L.t
let empty = L.empty
let is_empty = L.is_empty
let return = L.return
let of_list l = L.of_list @@ CCList.sort_uniq ~cmp:K.compare... | null | https://raw.githubusercontent.com/regex-generate/regenerate/a616d6c2faf4a55f794ac9b6fbf03acca91fbeb9/segments/LazyList.ml | ocaml | let pp = pp | module L = CCLazy_list
let next = Lazy.force
module Make (K : Sigs.OrderedMonoid)
: Sigs.S with type elt = K.t and type t = K.t L.t
= struct
type elt = K.t
type t = elt L.t
let empty = L.empty
let is_empty = L.is_empty
let return = L.return
let of_list l = L.of_list @@ CCList.sort_uniq ~cmp:K.compare... |
7e5c15a59b13bd0a531ef955d2b46c4bdf25d36de1e592ce04d696d856cd62b6 | kblake/erlang-chat-demo | quickstart_app.erl | -module (quickstart_app).
-export ([start/2, stop/0, do/1]).
-include_lib ("nitrogen/include/wf.hrl").
-define(PORT, 8000).
start(_, _) ->
inets:start(),
{ok, Pid} = inets:start(httpd, [
{port, ?PORT},
{server_name, "nitrogen"},
{server_root, "."},
{document_root, "./static"},
... | null | https://raw.githubusercontent.com/kblake/erlang-chat-demo/6fd2fce12f2e059e25a24c9a84169b088710edaf/Quickstart/src/quickstart_app.erl | erlang | Uncomment for basic authentication...
nitrogen:handler(http_basic_auth_security_handler, basic_auth_callback_mod), | -module (quickstart_app).
-export ([start/2, stop/0, do/1]).
-include_lib ("nitrogen/include/wf.hrl").
-define(PORT, 8000).
start(_, _) ->
inets:start(),
{ok, Pid} = inets:start(httpd, [
{port, ?PORT},
{server_name, "nitrogen"},
{server_root, "."},
{document_root, "./static"},
... |
bae8ea09e55fcedeeeb581394cc15423f216eb149005491ffd6686b4f3f483b6 | i-am-tom/holmes | FlatMapping.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE FunctionalDependencies #
# LANGUAGE KindSignatures #
|
Module : Data . JoinSemilattice . Class . FlatMapping
Description : Refine parameters using their raw values .
Copyright : ( c ) , 2020
License : MIT
Module : Data.JoinSemilattice.Class.Fla... | null | https://raw.githubusercontent.com/i-am-tom/holmes/ecbb6da0c7a73f839ea2c4d00cdb902fe7080981/src/Data/JoinSemilattice/Class/FlatMapping.hs | haskell | # LANGUAGE ConstraintKinds #
| Some types, such as `Intersect`, contain multiple "candidate values". This
function allows us to take /each/ candidate, apply a function, and then
union all the results. Perhaps @fanOut@ would have been a better name for
this function, but we use `(>>=)` to lend an intuition when we l... | # LANGUAGE FunctionalDependencies #
# LANGUAGE KindSignatures #
|
Module : Data . JoinSemilattice . Class . FlatMapping
Description : Refine parameters using their raw values .
Copyright : ( c ) , 2020
License : MIT
Module : Data.JoinSemilattice.Class.FlatMapping
Description : Refine par... |
9fc6009156bc7f784db1a5998ff8343c69fcacdf87644960d79e2e34eafe51e0 | hmac/kite | DSL.hs | -- A little DSL for writing types without all the 'TOther' wrapping
-- The primed functions return 'Type'', which is useful if you want to then use 'tapp'.
module Type.DSL where
import Data.Name ( Name )
import Type.Type ( E
... | null | https://raw.githubusercontent.com/hmac/kite/a48839fa5a4edce3bc7a758e4fcb1bda38a556f0/src/Type/DSL.hs | haskell | A little DSL for writing types without all the 'TOther' wrapping
The primed functions return 'Type'', which is useful if you want to then use 'tapp'. | module Type.DSL where
import Data.Name ( Name )
import Type.Type ( E
, Type(..)
, Type'(..)
, U
... |
30d0fe4c6cd69a3b9374ae5b84c4f4ace3e5d17cf319b67a0a266002a179b15a | ostinelli/bisbino | misultin_utility.erl | % ==========================================================================================================
MISULTIN - Various Utilities
%
% >-|-|-(°>
%
Copyright ( C ) 2010 , < > .
% All rights reserved.
%
% BSD License
%
% Redistribution and use in source and binary forms, with or without modification, are ... | null | https://raw.githubusercontent.com/ostinelli/bisbino/eb722fbf174edbe4aac0acb48ab3be076f241860/src/misultin_utility.erl | erlang | ==========================================================================================================
>-|-|-(°>
All rights reserved.
BSD License
Redistribution and use in source and binary forms, with or without modification, are permitted provided
that the following conditions are met:
* Redistribu... | MISULTIN - Various Utilities
Copyright ( C ) 2010 , < > .
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS " AND ANY EXPRESS OR
PARTICULAR PURPOSE ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT HOLDER OR FOR
ANY DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONS... |
69d63005890f8ba7f776ff4e33f26b63db355effb1dc6f6c3a058b129ebb8a05 | reborg/clojure-essential-reference | 5.clj | < 1 >
(intern 'disappear 'my-var 0)
(refer 'disappear :only ['my-var])
;; nil
my-var
0
(remove-ns 'disappear)
;; #object[clojure.lang.Namespace 0x1f780201 "disappear"]
< 2 >
;; #object[clojure.lang.Namespace 0x1f780201 "disappear"]
(create-ns 'disappear) ; <3>
(intern 'disappear 'my-var 1)
< 4 >
0
< 5... | null | https://raw.githubusercontent.com/reborg/clojure-essential-reference/c37fa19d45dd52b2995a191e3e96f0ebdc3f6d69/VarsandNamespaces/ns%2Cin-ns%2Ccreate-nsandremove-ns/5.clj | clojure | nil
#object[clojure.lang.Namespace 0x1f780201 "disappear"]
#object[clojure.lang.Namespace 0x1f780201 "disappear"]
<3> | < 1 >
(intern 'disappear 'my-var 0)
(refer 'disappear :only ['my-var])
my-var
0
(remove-ns 'disappear)
< 2 >
(intern 'disappear 'my-var 1)
< 4 >
0
< 5 >
1 |
44684de8ec4d18bd2985b50a3976b0d12849ebe25658390c31ec2ad96c8e13ba | NorfairKing/smos | Types.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# OPTIONS_GHC -fno - warn - orphans #
module Smos.Scheduler.OptParse.Types where
import Autodocodec
import Data.Aeson (FromJSON, FromJSO... | null | https://raw.githubusercontent.com/NorfairKing/smos/cf1669f353dce8c5d5fc2f378a89a9bc945f3f0b/smos-scheduler/src/Smos/Scheduler/OptParse/Types.hs | haskell | # LANGUAGE OverloadedStrings #
Don't hash the description, on purpose
| At these times | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# OPTIONS_GHC -fno - warn - orphans #
module Smos.Scheduler.OptParse.Types where
import Autodocodec
import Data.Aeson (FromJSON, FromJSONKey, ToJSON, ToJSONKey)
import Dat... |
0897b7a1fa3421ccb7c4541862733a1d2479d7a6eb3a884f77e99324c524eee8 | bbss/cljsc2 | pushhandlers.cljs | (ns cljsc2.cljs.pushhandlers
(:require [cljsc2.cljs.ui.run :refer [Run RunConfig]]
[fulcro.client.primitives :as prim :refer [defsc]]
[fulcro.ui.form-state :as fs]
[fulcro.websockets :as fw]
[fulcro.websockets.networking :refer [push-received]]))
(defmethod push-receiv... | null | https://raw.githubusercontent.com/bbss/cljsc2/70e720f5bae9b58248df86f3f50d855878ae4f49/src/cljsc2/cljs/pushhandlers.cljs | clojure | (ns cljsc2.cljs.pushhandlers
(:require [cljsc2.cljs.ui.run :refer [Run RunConfig]]
[fulcro.client.primitives :as prim :refer [defsc]]
[fulcro.ui.form-state :as fs]
[fulcro.websockets :as fw]
[fulcro.websockets.networking :refer [push-received]]))
(defmethod push-receiv... | |
d619bae8266b8b6c9214e8f0d539a0910572bee8884ecff965f03c7ffc3f7724 | TheLortex/mirage-monorepo | merlin_helpers.mli | * Some helpers to annotate the AST so can decide which branches to look
at and which branches to ignore .
at and which branches to ignore. *)
open! Import
* { 2 Annotations understand }
val hide_attribute : attribute
* Adding this [ \[@merlin.hide\ ] ] attribute on a piece of AST " hides " it from
... | null | https://raw.githubusercontent.com/TheLortex/mirage-monorepo/b557005dfe5a51fc50f0597d82c450291cfe8a2a/duniverse/ppxlib/src/merlin_helpers.mli | ocaml | * Some helpers to annotate the AST so can decide which branches to look
at and which branches to ignore .
at and which branches to ignore. *)
open! Import
* { 2 Annotations understand }
val hide_attribute : attribute
* Adding this [ \[@merlin.hide\ ] ] attribute on a piece of AST " hides " it from
... | |
00d5c2745a487fd1180d15aae0c8411b9303a69380e2af6efcc506e4b843641d | practicalli/clojure-through-code | collections.clj | (ns clojure-through-code.collections)
The built in data structures of Clojure are great for representing simple and complex collections .
;; So what are examples of collecitons? It could be all the movies you own or your music library. It could be all the books you own, both paper and electronic.
;; How would yo... | null | https://raw.githubusercontent.com/practicalli/clojure-through-code/82834cdab6b5315aea630386c851200f98d5e48f/src/clojure_through_code/collections.clj | clojure | So what are examples of collecitons? It could be all the movies you own or your music library. It could be all the books you own, both paper and electronic.
How would you represent a simple collecion of music?
and then give this collection a name
or you could make this map more expressive by explictly adding keys... | (ns clojure-through-code.collections)
The built in data structures of Clojure are great for representing simple and complex collections .
You could simply list all the albums you have , in this case using a Clojure vector
["Smells like Teen Spirit", "Trash", "Vision Thing"]
(def albums ["Smells like Teen Spi... |
3482f0ae7f799533fd43122de96c39287217a80bc27f0c82191ac4e77bac9e2b | TorXakis/TorXakis | TestUtils.hs |
TorXakis - Model Based Testing
Copyright ( c ) 2015 - 2017 TNO and Radboud University
See LICENSE at root directory of this repository .
TorXakis - Model Based Testing
Copyright (c) 2015-2017 TNO and Radboud University
See LICENSE at root directory of this repository.
-}
module TestUtils
(
createTestEnvC,
print... | null | https://raw.githubusercontent.com/TorXakis/TorXakis/038463824b3d358df6b6b3ff08732335b7dbdb53/sys/lpeops/test/TestUtils.hs | haskell | createTestEnvC
printInputExpectedFound
tryLPEOperation |
TorXakis - Model Based Testing
Copyright ( c ) 2015 - 2017 TNO and Radboud University
See LICENSE at root directory of this repository .
TorXakis - Model Based Testing
Copyright (c) 2015-2017 TNO and Radboud University
See LICENSE at root directory of this repository.
-}
module TestUtils
(
createTestEnvC,
print... |
3bd4701d3883313c032466fc7aa6329c57226355ce20c8b70aa8b32f13dbf39f | suhdonghwi/nuri | ASTNode.hs | module Nuri.ASTNode where
import Text.Megaparsec.Pos (SourcePos)
class ASTNode a where
getSourcePos :: a -> SourcePos
| null | https://raw.githubusercontent.com/suhdonghwi/nuri/337550e3d50c290144df905ea3f189e9af6123c2/src/Nuri/ASTNode.hs | haskell | module Nuri.ASTNode where
import Text.Megaparsec.Pos (SourcePos)
class ASTNode a where
getSourcePos :: a -> SourcePos
| |
898b509aeadd27f3001b2a7e352b68affa5bd804c0a19824c938108e217e9d7c | satori-com/mzbench | signal_parallel.erl | [
{pool, [{size, {var, "nodes_num"}},
{worker_type, dummy_worker}],
[
{parallel, [
{wait_signal, 'A'},
{set_signal, 'A'}]}]},
{pool, [{size, {var, "nodes_num"}},
{worker_type, dummy_worker}],
[
{loop, [{time, {200, ms}}, {rate, {1.1, rps}}],
[
{l... | null | https://raw.githubusercontent.com/satori-com/mzbench/02be2684655cde94d537c322bb0611e258ae9718/acceptance_tests/scripts/signal_parallel.erl | erlang | [
{pool, [{size, {var, "nodes_num"}},
{worker_type, dummy_worker}],
[
{parallel, [
{wait_signal, 'A'},
{set_signal, 'A'}]}]},
{pool, [{size, {var, "nodes_num"}},
{worker_type, dummy_worker}],
[
{loop, [{time, {200, ms}}, {rate, {1.1, rps}}],
[
{l... | |
1c30d3d5a871f453d1e0250fe71094773b2c766e15da2d2bffcca6334f18933d | ChrisPenner/dumbwaiter | Matchers.hs | # language NamedFieldPuns #
{-# language OverloadedStrings #-}
module Dumbwaiter.Matchers
( allMatchers
) where
import qualified Data.Text as T
import qualified Web.Firefly as F
import Data.Aeson.Lens
import Control.Lens
import Dumbwaiter.Types
allMatchers :: [Matcher]
allMatchers =
[ methodMatcher
, pathMat... | null | https://raw.githubusercontent.com/ChrisPenner/dumbwaiter/f47eb441a9083fe1c66dcacc2f0de8e993464372/src/Dumbwaiter/Matchers.hs | haskell | # language OverloadedStrings # | # language NamedFieldPuns #
module Dumbwaiter.Matchers
( allMatchers
) where
import qualified Data.Text as T
import qualified Web.Firefly as F
import Data.Aeson.Lens
import Control.Lens
import Dumbwaiter.Types
allMatchers :: [Matcher]
allMatchers =
[ methodMatcher
, pathMatcher
]
methodMatcher :: Matcher
... |
69c16f12081a8b7c72a2ac6388ed099ce6f330a5f7227c847028c3c3a06009d5 | ahushh/monaba | Request.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE DeriveGeneric #
module Request ( PostRequest(..)
, EditPostRequest(..)
, FileRequest(..)
) where
import Prelude
import Data.Text
import Data.Aeson
import GHC.Generics
data PostRequest = PostRequest { name :: Text
... | null | https://raw.githubusercontent.com/ahushh/monaba/9fbfffcc970da0ebaf2d5df716c3bb075b1c761a/monaba/src/Request.hs | haskell | # LANGUAGE FlexibleInstances #
# LANGUAGE DeriveGeneric #
module Request ( PostRequest(..)
, EditPostRequest(..)
, FileRequest(..)
) where
import Prelude
import Data.Text
import Data.Aeson
import GHC.Generics
data PostRequest = PostRequest { name :: Text
... | |
30fb1336bed9e45fdd0ace2ea4f4caf0b2305412f603ff1a9451dff9d1f92352 | emina/rosette | itunes100_2.rkt | #lang rosette
(require (only-in racket/runtime-path define-runtime-path))
(require "../dom.rkt")
(require "../websynth.rkt")
(require "../websynthlib.rkt")
(define-runtime-path html (build-path ".." "html/itunes_top100_v2.html"))
(define dom (read-DOMNode html))
(define-tags (tags dom))
(define max_zpath_depth (depth... | null | https://raw.githubusercontent.com/emina/rosette/a64e2bccfe5876c5daaf4a17c5a28a49e2fbd501/sdsl/websynth/test/itunes100_2.rkt | racket | Record 0 fields
Record 1 fields
Cross-record Mask
Record 0 zpath asserts
Record 1 zpath asserts
Record 0 Field Mask Generation
Record 1 Field Mask Generation
Record Mask
Solve
Record 0 zpaths
Record 1 zpaths | #lang rosette
(require (only-in racket/runtime-path define-runtime-path))
(require "../dom.rkt")
(require "../websynth.rkt")
(require "../websynthlib.rkt")
(define-runtime-path html (build-path ".." "html/itunes_top100_v2.html"))
(define dom (read-DOMNode html))
(define-tags (tags dom))
(define max_zpath_depth (depth... |
a00748cad92635d28f5c3cdb5183550b3a42276d0cbe6f2211dcf828a3c38f76 | bomberstudios/mtasc | std.mli |
* Std - Additional functions
* Copyright ( C ) 2003
*
* 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 2.1 of the License , or ( at your option ) ... | null | https://raw.githubusercontent.com/bomberstudios/mtasc/d7c2441310248776aa89d60f9c8f98d539bfe8de/src/extlib-dev/std.mli | ocaml | * Additional functions.
* Returns an enumeration over characters of an input channel.
* Returns the list of lines read from an input channel.
* Return the whole contents of an input channel as a single
string.
* Print a boolean to stdout.
* Print a boolean to stderr.
* returns the data of a given filename.
* cr... |
* Std - Additional functions
* Copyright ( C ) 2003
*
* 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 2.1 of the License , or ( at your option ) ... |
5558cfdda2b8f12bf7e5537a1710cb539c44392076b3f26cf04a8875169fc0b6 | TyGuS/hoogle_plus | Synthesize.hs | module HooglePlus.Synthesize(synthesize, envToGoal) where
import Database.Environment
import Database.Util
import qualified HooglePlus.Abstraction as Abstraction
import PetriNet.PNSolver
import Synquid.Error
import Synquid.Logic
import Synquid.Parser
import Synquid.Pretty
import Synquid.Program
import Synquid.Resolver... | null | https://raw.githubusercontent.com/TyGuS/hoogle_plus/d02a1466d98f872e78ddb2fb612cb67d4bd0ca18/src/HooglePlus/Synthesize.hs | haskell | add higher order query arguments
putStrLn $ "Component number: " ++ show (Map.size $ allSymbols env)
return () | module HooglePlus.Synthesize(synthesize, envToGoal) where
import Database.Environment
import Database.Util
import qualified HooglePlus.Abstraction as Abstraction
import PetriNet.PNSolver
import Synquid.Error
import Synquid.Logic
import Synquid.Parser
import Synquid.Pretty
import Synquid.Program
import Synquid.Resolver... |
d41fa1317839823e389741313033a49994c8118ce66f3f67b23d31909bf56a10 | karimarttila/clojure | session_service.clj | (ns simpleserver.service.session.session-service
"Provides simplified access to session functions."
(:require [simpleserver.service.service :as ss-service]
[simpleserver.service.session.session-interface :as ss-session-i]))
(defn- get-service [env]
(ss-service/get-service env :session))
(defn create... | null | https://raw.githubusercontent.com/karimarttila/clojure/ee1261b9a8e6be92cb47aeb325f82a278f2c1ed3/webstore-demo/re-frame-demo/src/clj/simpleserver/service/session/session_service.clj | clojure | (ns simpleserver.service.session.session-service
"Provides simplified access to session functions."
(:require [simpleserver.service.service :as ss-service]
[simpleserver.service.session.session-interface :as ss-session-i]))
(defn- get-service [env]
(ss-service/get-service env :session))
(defn create... | |
4554f82e8e0c028c4f77d6eccc23f9dc115334a7b3c237a62f409352b381aa90 | alexkehayias/chocolatier | events.cljs | (ns chocolatier.engine.events
(:require [clojure.core.reducers :as r]))
;; Anyone can send a message to the event bus
;; The event system distributes the events to any subscribers into
;; their inbox component state
;; Events are tuples of event keyword, the sender, and message hm
;; Messages should only be used for... | null | https://raw.githubusercontent.com/alexkehayias/chocolatier/6b77c1dbf10ef7ff83d0b5a2ebb9fda39edcde5a/src/cljs/chocolatier/engine/events.cljs | clojure | Anyone can send a message to the event bus
The event system distributes the events to any subscribers into
their inbox component state
Events are tuples of event keyword, the sender, and message hm
Messages should only be used for asynchronous communication
Avoid sending messages based recieving a message to prev... | (ns chocolatier.engine.events
(:require [clojure.core.reducers :as r]))
(def queue-path
[:state :events :queue])
(defn get-events
"Returns a collection of events or nil"
[queue selectors]
(get-in queue selectors))
(defn get-subscribed-events
"Returns an array of events that matches the collection of s... |
a276cda5b33b501bf33961f682b5b9a4b2ff9b175255304abdd8edcecf36da8d | sirherrbatka/vellum | package.lisp | (cl:in-package #:cl-user)
(cl-ds.fancy:defpackage vellum
(:use #:cl #:vellum.aux-package)
(:nicknames #:vellum)
(:export
#:add-columns
#:copy-from
#:copy-to
#:empty-column
#:empty-table
#:with-standard-header
#:visualize
#:join
#:column-list
#:pipeline
#:file-input-row-cant-be-cr... | null | https://raw.githubusercontent.com/sirherrbatka/vellum/7c7412005863fdd88c88aac5cadb12f43dffa692/src/api/package.lisp | lisp | (cl:in-package #:cl-user)
(cl-ds.fancy:defpackage vellum
(:use #:cl #:vellum.aux-package)
(:nicknames #:vellum)
(:export
#:add-columns
#:copy-from
#:copy-to
#:empty-column
#:empty-table
#:with-standard-header
#:visualize
#:join
#:column-list
#:pipeline
#:file-input-row-cant-be-cr... | |
783f00258cc1bf26928ee12e31d5e59f51ace123a944a323d2adb319bba314f5 | gravicappa/gambit-sdl | pango-draw.scm | (define (pango-draw screen pango time)
#f)
(let ((pango #f)
(surface #f)
(text (string-append
"This <i>is</i> pango text!"
" It supports unicode "
"<span background=\"red\" color=\"yellow\"> ☭</span>!"
" Даже так."
"<span color=\"red\... | null | https://raw.githubusercontent.com/gravicappa/gambit-sdl/bde15600d7911e8c629e32f715bfa030000a3b09/example/pango-draw.scm | scheme | (define (pango-draw screen pango time)
#f)
(let ((pango #f)
(surface #f)
(text (string-append
"This <i>is</i> pango text!"
" It supports unicode "
"<span background=\"red\" color=\"yellow\"> ☭</span>!"
" Даже так."
"<span color=\"red\... | |
7994d302d4253f160e092830d72ffbf130af235288e75689f3dec7c89f3d5b2f | chaw/r7rs-libs | mapcol.scm | map coloring , example from Sterling & Shapiro , p. 212
;(%member x y) holds if x is in y
(define %member
(%rel (X Xs Y Ys)
((X (cons X Xs)))
((X (cons Y Ys)) (%member X Ys))))
;(%members x y) holds if x is a subset of y
(define %members
(%rel (X Xs Ys)
(((cons X Xs) Ys) (%member X Ys) (%members Xs ... | null | https://raw.githubusercontent.com/chaw/r7rs-libs/b8b625c36b040ff3d4b723e4346629a8a0e8d6c2/rebottled-examples/mapcol.scm | scheme | (%member x y) holds if x is in y
(%members x y) holds if x is a subset of y
region is a structure-builder
ask (%which (M) (%test-color 'test M)) or
ask (%which (M) (%test-color 'western-europe M)) for the
respective (non-unique) colorings. | map coloring , example from Sterling & Shapiro , p. 212
(define %member
(%rel (X Xs Y Ys)
((X (cons X Xs)))
((X (cons Y Ys)) (%member X Ys))))
(define %members
(%rel (X Xs Ys)
(((cons X Xs) Ys) (%member X Ys) (%members Xs Ys))
(('() Ys))))
( % select x y z ) holds if z is y with one less occurr... |
f7e81e22b3efa1daf1e75695954824145a397b8267cb98771d468d769b5100df | skanev/playground | 69.scm | SICP exercise 2.69
;
; The following procedure as its arguments a list of symbol-frequency pairs
( where no symbol appears in more than one pair ) and generates a
encoding tree according to the Huffman algorithm .
;
; (define (generate-huffman-tree pairs)
; (successive-merge (make-leaf-set pairs)))
;
; mak... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/02/69.scm | scheme |
The following procedure as its arguments a list of symbol-frequency pairs
(define (generate-huffman-tree pairs)
(successive-merge (make-leaf-set pairs)))
make-leaf-set is the procedure given above that transforms the list of pairs
into an ordered set of leaves. successive-merge is the procedure you must
... | SICP exercise 2.69
( where no symbol appears in more than one pair ) and generates a
encoding tree according to the Huffman algorithm .
elements of the set until there is only one element left , which is the
(define (make-leaf symbol weight)
(list 'leaf symbol weight))
(define (leaf? object)
(eq? (car ob... |
a7609b7639ab38b70079760d5d70e40bdad1a44b56473865bdf0ea8349aaad6f | startalkIM/ejabberd | glc_code.erl | %% @doc Code generation functions.
-module(glc_code).
-compile({nowarn_unused_function, {abstract_module,2}}).
-compile({nowarn_unused_function, {abstract_tables,1}}).
-compile({nowarn_unused_function, {abstract_reset,0}}).
-compile({nowarn_unused_function, {abstract_filter,3}}).
-compile({nowarn_unused_function, {abst... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/deps/goldrush/src/glc_code.erl | erlang | @doc Code generation functions.
abstract code generation functions
-module(Module)
-export([
get/1
reset_counters/1
table/1
handle/1
]).
get(Name) -> Term.
info(Name) -> Term.
reset_counters(Name) -> boolean().
table(Name) -> atom().
handle(Event) - entry function
Transform Term -> Key to Key -> Term
@p... | -module(glc_code).
-compile({nowarn_unused_function, {abstract_module,2}}).
-compile({nowarn_unused_function, {abstract_tables,1}}).
-compile({nowarn_unused_function, {abstract_reset,0}}).
-compile({nowarn_unused_function, {abstract_filter,3}}).
-compile({nowarn_unused_function, {abstract_filter_,4}}).
-compile({nowarn... |
09932b11e9564ec47c0333bd33fd92595c987e6fb70895cabec58cb4baeafdad | Morgawr/Cloister-Engine | core.clj | (ns cloister.star-test.core
(:require [cloister.core :as c])
(:require [cloister.bindings.graphics :as g])
(:require [cloister.render :as r])
(:require [cloister.sound :as s])
(:require [cloister.utils :as utils])
(:require [cloister.components :as comps])
(:use [cloister.bindings.input])
(:use [cloiste... | null | https://raw.githubusercontent.com/Morgawr/Cloister-Engine/0ca1eb6840cb6b3aac90c4f9ce187a375a99591e/test/cloister/star_test/core.clj | clojure | TODO - REWRITE THIS
default texture base
base rendering function
Specialization of the base star, this one flickers as it updates
Specialization of the base star, this one is green and stays even under screens
<-- we make it permanent between screen transitions
init our engine
add a new screen to the engine, so... | (ns cloister.star-test.core
(:require [cloister.core :as c])
(:require [cloister.bindings.graphics :as g])
(:require [cloister.render :as r])
(:require [cloister.sound :as s])
(:require [cloister.utils :as utils])
(:require [cloister.components :as comps])
(:use [cloister.bindings.input])
(:use [cloiste... |
b6eccc06fd7f9613c6a24f98380e8997d53d7fe1f020db1ec6652ca536d6305c | eir-forsakring/aws-lambda-haskell-runtime-wai | Wai.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE ViewPatterns #
module Aws.Lambda.Wai
( runWaiAsLambda,
runWaiAsProxiedHttpLambda,
WaiLambdaProxyType (..),
apiGatewayWaiHandler,
ApiGatewayWaiHandler,
albWaiHa... | null | https://raw.githubusercontent.com/eir-forsakring/aws-lambda-haskell-runtime-wai/d9d46682f2687905f43c0bb41d301b716794376d/src/Aws/Lambda/Wai.hs | haskell | # LANGUAGE OverloadedStrings #
TODO: Duplication
includes the resource which we don't need
default port
default port
flow info
scope id | # LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE ViewPatterns #
module Aws.Lambda.Wai
( runWaiAsLambda,
runWaiAsProxiedHttpLambda,
WaiLambdaProxyType (..),
apiGatewayWaiHandler,
ApiGatewayWaiHandler,
albWaiHandler,
ALBWaiHandler,
ignor... |
a0309c3268cb9b5564af9e174590bdfc268ad863e5e46c12cbf5ef31a148f48d | clj-commons/rewrite-clj | test_libs.clj | #!/usr/bin/env bb
(ns test-libs
"Test 3rd party libs against rewrite-clj head"
(:require [babashka.curl :as curl]
[babashka.fs :as fs]
[build-shared]
[cheshire.core :as json]
[clojure.java.io :as io]
[clojure.string :as string]
[doric.core :as... | null | https://raw.githubusercontent.com/clj-commons/rewrite-clj/d6d7885fc573dda35ddc06428ae2a9c199f00f50/script/test_libs.clj | clojure | no official release
else via release which works better than tags sometimes due to the way tags sort
ancient-clj
we remove and add tools.reader because project.clj has pedantic? :abort enabled
clojure-lsp
depot
lein ancient
done with exercising my rewrite-clj skills for now! :-)
mranderson
done w... | #!/usr/bin/env bb
(ns test-libs
"Test 3rd party libs against rewrite-clj head"
(:require [babashka.curl :as curl]
[babashka.fs :as fs]
[build-shared]
[cheshire.core :as json]
[clojure.java.io :as io]
[clojure.string :as string]
[doric.core :as... |
cb1c6cd613db9f3f96c951a7a70252842acc1c97a32a19c5ef73bce295af7ca1 | lisp-mirror/clpm | requirement.lisp | ;;;; This file defines the various requirements used during dependency
;;;; resolution.
;;;;
This software is part of CLPM . See README.org for more information . See
;;;; LICENSE for license information.
(uiop:define-package #:clpm/requirement
(:use #:cl
#:anaphora
#:clpm/sources/defs)
(:e... | null | https://raw.githubusercontent.com/lisp-mirror/clpm/174b7db5e548518aff668cdd1f4d1a7b863becfb/clpm/requirement.lisp | lisp | This file defines the various requirements used during dependency
resolution.
LICENSE for license information.
version
why
ID | This software is part of CLPM . See README.org for more information . See
(uiop:define-package #:clpm/requirement
(:use #:cl
#:anaphora
#:clpm/sources/defs)
(:export #:convert-asd-system-spec-to-req
#:fs-system-file-requirement
#:fs-system-requirement
#:proj... |
b5f5fd2b792ad7c95868b511a6df5fd57b1d6f0090b033b708b3b73492dfe81c | spurious/sagittarius-scheme-mirror | parser.scm | -*- mode : scheme ; coding : utf-8 ; -*-
;;;
text / xml / dom / parser.scm - XML parser for DOM
;;;
Copyright ( c ) 2018 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;;... | null | https://raw.githubusercontent.com/spurious/sagittarius-scheme-mirror/53f104188934109227c01b1e9a9af5312f9ce997/sitelib/text/xml/dom/parser.scm | scheme | coding : utf-8 ; -*-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaime... | text / xml / dom / parser.scm - XML parser for DOM
Copyright ( c ) 2018 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING... |
d5a4283c7a18ba7c00de06134636ecf98601b5ad5022c7367efbd965b3e5eff6 | tlaitinen/yesod-dsl | SyncFile.hs | module YesodDsl.SyncFile where
import Prelude hiding (readFile)
import System.IO.Strict (readFile)
import Control.Exception (catch, SomeException)
syncFile :: FilePath -> String -> IO ()
syncFile path content = do
oldContent <- catch (readFile path) ((\_ -> return "") :: SomeException -> IO String)
if content ... | null | https://raw.githubusercontent.com/tlaitinen/yesod-dsl/e248471bc708542dd050d96ac9fde627e9e349ae/YesodDsl/SyncFile.hs | haskell | module YesodDsl.SyncFile where
import Prelude hiding (readFile)
import System.IO.Strict (readFile)
import Control.Exception (catch, SomeException)
syncFile :: FilePath -> String -> IO ()
syncFile path content = do
oldContent <- catch (readFile path) ((\_ -> return "") :: SomeException -> IO String)
if content ... | |
d0563ad528fa0588dc82d5cd670b3cdca58a70167b31d4ba5f71d23bc43e2243 | heechul/crest-z3 | canonicalize.ml |
*
* Copyright ( c ) 2001 - 2002 ,
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
*
* 1 . Redistributions... | null | https://raw.githubusercontent.com/heechul/crest-z3/cfcebadddb5e9d69e9956644fc37b46f6c2a21a0/cil/src/ext/canonicalize.ml | ocaml | For transformation #1. Stores all variable definitions in the file.
A hashtable to prevent duplicate declarations.
move variable declarations around
delete from here.
delete from here.
add an explicit cast
Iterate over the arguments, looking for formals that
expect enum types, and insert casts where ne... |
*
* Copyright ( c ) 2001 - 2002 ,
* < >
* < >
* < >
* All rights reserved .
*
* Redistribution and use in source and binary forms , with or without
* modification , are permitted provided that the following conditions are
* met :
*
* 1 . Redistributions... |
69352c8f3f5196d58015ad8fb60b005949e6468534ced71475dd64c6707cc5d1 | ninenines/cowboy | ws_handler_SUITE.erl | Copyright ( c ) 2018 , < >
%%
%% Permission to use, copy, modify, and/or distribute this software for any
%% purpose with or without fee is hereby granted, provided that the above
%% copyright notice and this permission notice appear in all copies.
%%
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS A... | null | https://raw.githubusercontent.com/ninenines/cowboy/8795233c57f1f472781a22ffbf186ce38cc5b049/test/ws_handler_SUITE.erl | erlang |
Permission to use, copy, modify, and/or 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.
WITH REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF
MERCHANTABILITY AND FITNESS. IN NO EVE... | Copyright ( c ) 2018 , < >
THE SOFTWARE IS PROVIDED " AS IS " AND THE AUTHOR DISCLAIMS ALL WARRANTIES
ANY SPECIAL , DIRECT , INDIRECT , OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
WHATSOEVER RESULTING FROM LOSS OF USE , DATA OR PROFITS , WHETHER IN AN
-module(ws_handler_SUITE).
-compile(export_all).
-compile(no... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.