_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 |
|---|---|---|---|---|---|---|---|---|
d2884a6892b744c7387f9226d0b0b6b4a81534176bf9d25746fd8ab23886d333 | circleci/stefon | coffeescript.clj | (ns stefon.asset.coffeescript
(:refer-clojure :exclude [compile])
(:require [stefon.jsengine :as jsengine]
[stefon.asset :as asset]))
(def processor (jsengine/compiler "compileCoffeeScript"
["coffee-script.js" "coffee-wrapper.js"]))
(asset/register "cs" processor)
(asse... | null | https://raw.githubusercontent.com/circleci/stefon/7c36114923ef7ec41316e22354d2e31217a1a416/stefon-core/src/stefon/asset/coffeescript.clj | clojure | (ns stefon.asset.coffeescript
(:refer-clojure :exclude [compile])
(:require [stefon.jsengine :as jsengine]
[stefon.asset :as asset]))
(def processor (jsengine/compiler "compileCoffeeScript"
["coffee-script.js" "coffee-wrapper.js"]))
(asset/register "cs" processor)
(asse... | |
a28c6be36c801c7d75044a98c19ddb5ff626109f9fd8b4cb6cc8a3610482b587 | zcaudate/hara | raise.clj | (ns hara.event.condition.raise
(:require [hara.data.base.map :as map]
[hara.event.handler :as handler]
[hara.event.condition.data :as data]
[hara.event.condition.manage :as manage]))
(defn default-unhandled-fn
"raises an unhandled exception"
{:added "3.0"}
[issue]
(let [ex... | null | https://raw.githubusercontent.com/zcaudate/hara/481316c1f5c2aeba5be6e01ae673dffc46a63ec9/src/hara/event/condition/raise.clj | clojure | (ns hara.event.condition.raise
(:require [hara.data.base.map :as map]
[hara.event.handler :as handler]
[hara.event.condition.data :as data]
[hara.event.condition.manage :as manage]))
(defn default-unhandled-fn
"raises an unhandled exception"
{:added "3.0"}
[issue]
(let [ex... | |
64fbe5c5d12ce06f2fb35b0ffee94d2d286b81dbda994557a32c9f21e9c82fd9 | philnguyen/soft-contract | morse-code-table.rkt | #lang racket
Copyright 2014 , except the portion that comes from wikipedia !
(provide (contract-out [char-table hash?]))
(require racket/match)
(define wikipedia-text
#<<#
| {{Audio-nohelp|A morse code.ogg|A}} || '''· –'''
| {{Audio-nohelp|J morse code.ogg|J}} || '''· – – –'''
· & nbsp ; · ''... | null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/gradual-typing-benchmarks/morsecode/morse-code-table.rkt | racket | –'''
– – –'''
· '' '
– – – –'''
– · – · –'''
– – · · ·'''
·  ; · '' '
– '' '
– –  ; – '' '
– · · – –'''
] || '''– · – · – ·'''
–  ; · '' '
– · ·'''
– '' '
· –  ; – '' '
–&... | #lang racket
Copyright 2014 , except the portion that comes from wikipedia !
(provide (contract-out [char-table hash?]))
(require racket/match)
(define wikipedia-text
#<<#
| {{Audio-nohelp|T morse code.ogg|T}} || '''–'''
| {{Audio-nohelp|E morse code.ogg|E}} || '''·'''
#
)
(define lines (regexp-split #px"\n" wi... |
c566918627a3cf640f02aaf0f0532bc3929d4284f5f5fd036d4dea88dd0b17b1 | quoll/raphael | core.cljc | (ns ^{:doc "A namespace for manually parsing Turtle. Entry point is parse-doc."
:author "Paula Gearon"}
quoll.raphael.core
(:require [clojure.string :as str]
[quoll.raphael.m :refer [throw-unex] :include-macros true]
[quoll.raphael.text :as text :refer [char-at]]
[quoll.r... | null | https://raw.githubusercontent.com/quoll/raphael/eb69299b6e6c288ff7828f2d4279b0b3209d1c58/src/quoll/raphael/core.cljc | clojure | \= \/ \? \# \@ \%})
adds a char, looking ahead if this is an escape sequence
at a dot. Check if this is inside a local name or terminating it
look ahead
the next character is a valid local name character, so save and continue parsing
no, this must mean the local name ended already, and the dot is terminating a li... | (ns ^{:doc "A namespace for manually parsing Turtle. Entry point is parse-doc."
:author "Paula Gearon"}
quoll.raphael.core
(:require [clojure.string :as str]
[quoll.raphael.m :refer [throw-unex] :include-macros true]
[quoll.raphael.text :as text :refer [char-at]]
[quoll.r... |
2be3deff723f232eae20e939f5f5216677c83189081329fee625565f5609becf | s-cerevisiae/leetcode-racket | 692-top-k-frequent-words.rkt | #lang racket
(define (top-k-frequent words k)
(define (count-word words)
(define table (make-hash))
(for ([word (in-list words)])
(hash-update! table word add1 0))
(hash->list table))
(define (sort-count counts)
(sort counts
(match-lambda**
[((cons w1 c1) (cons w2 c2))
... | null | https://raw.githubusercontent.com/s-cerevisiae/leetcode-racket/9cc641bad5399df06a1b29bdd5fe4ca656563f0a/692-top-k-frequent-words.rkt | racket | #lang racket
(define (top-k-frequent words k)
(define (count-word words)
(define table (make-hash))
(for ([word (in-list words)])
(hash-update! table word add1 0))
(hash->list table))
(define (sort-count counts)
(sort counts
(match-lambda**
[((cons w1 c1) (cons w2 c2))
... | |
9b9563c0d2ff6aa6bb4a87c38a93e026546c776cf21ff2a13f5e715ba824fad5 | DavidAlphaFox/aiwiki | aiwiki.erl | -module(aiwiki).
%% API
-export([start/0]).
start() ->
ok = application:start(crypto),
ok = application:start(asn1),
ok = application:start(public_key),
ok = application:start(ssl),
ok = application:start(inets),
ok = application:start(xmerl),
ok = application:start(ranch),
ok = application:start(cowlib... | null | https://raw.githubusercontent.com/DavidAlphaFox/aiwiki/3a2a78668d4a708fda4af35430f25a69c4b91a7e/src/aiwiki.erl | erlang | API | -module(aiwiki).
-export([start/0]).
start() ->
ok = application:start(crypto),
ok = application:start(asn1),
ok = application:start(public_key),
ok = application:start(ssl),
ok = application:start(inets),
ok = application:start(xmerl),
ok = application:start(ranch),
ok = application:start(cowlib),
ok... |
9b114d29c7e7bc91f78059c8ee9f0b48fc48b690607b4f321d29577c641147df | darrenldl/ProVerif-ATP | pievent.ml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Cryptographic protocol verifier *
* *
... | null | https://raw.githubusercontent.com/darrenldl/ProVerif-ATP/7af6cfb9e0550ecdb072c471e15b8f22b07408bd/proverif2.00/src/pievent.ml | ocaml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* *
* Cryptographic protocol verifier *
* *
... | |
89e583778edea03c1c6067cd0629be2bbcac2cb58f5f6ddec3861a6a2d189348 | austinhaas/kanren | miniKanren_operators.clj | (ns pettomato.kanren.cKanren.miniKanren-operators
(:require
[pettomato.kanren.cKanren.lvar :refer [lvar]]
[pettomato.kanren.cKanren.streams :refer [mzero]]
[pettomato.kanren.cKanren.operators :refer [mplus bind]]
[pettomato.kanren.cKanren.case-inf :refer [case-inf]]))
(defmacro mplus*
([e] e)
([e & e... | null | https://raw.githubusercontent.com/austinhaas/kanren/f55b68279ade01dbaae67a074ea3441370a27f9e/src/pettomato/kanren/cKanren/miniKanren_operators.clj | clojure | Impure control operators. | (ns pettomato.kanren.cKanren.miniKanren-operators
(:require
[pettomato.kanren.cKanren.lvar :refer [lvar]]
[pettomato.kanren.cKanren.streams :refer [mzero]]
[pettomato.kanren.cKanren.operators :refer [mplus bind]]
[pettomato.kanren.cKanren.case-inf :refer [case-inf]]))
(defmacro mplus*
([e] e)
([e & e... |
ad7c219b4f0a7981821f1c7dd9cc3bd8bc59b05e10a440c272282d0ac3404082 | processone/eturnal | eturnal_SUITE.erl | eturnal STUN / TURN server .
%%%
Copyright ( c ) 2020 - 2022 < > .
Copyright ( c ) 2020 - 2022 ProcessOne , SARL .
%%% All rights reserved.
%%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy ... | null | https://raw.githubusercontent.com/processone/eturnal/9b32bbe86f8b0dae7437059b113167c62abd769e/test/eturnal_SUITE.erl | erlang |
All rights reserved.
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific ... | eturnal STUN / TURN server .
Copyright ( c ) 2020 - 2022 < > .
Copyright ( c ) 2020 - 2022 ProcessOne , SARL .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(eturnal_SUITE).
-compile(export_all).
-include_l... |
5bd9392bb7114cf52c59a87144ab05e884ba2120fa1f871cd3a8fdaea043e3ab | vascokk/NumEr | numer_app.erl | -module(numer_app).
-behaviour(application).
%% Application callbacks
-export([start/2, stop/1]).
%% ===================================================================
%% Application callbacks
%% ===================================================================
start(_StartType, _StartArgs) ->
numer_sup:star... | null | https://raw.githubusercontent.com/vascokk/NumEr/0d22c31633ef2ab43dde50809a9dbbb6a736f5b7/src/numer_app.erl | erlang | Application callbacks
===================================================================
Application callbacks
=================================================================== | -module(numer_app).
-behaviour(application).
-export([start/2, stop/1]).
start(_StartType, _StartArgs) ->
numer_sup:start_link().
stop(_State) ->
ok.
|
7dd3cdce3860bca8acfc73e1a87ce0268092c359cc8c81a83275b9725877287f | ghilesZ/geoml | polygon.mli | (** This module provides basic functions for any concave, convex
and convex regular polygon (Does not handle complex polygon and polygon with
holes) *)
type t = private Point.t list
type polygon = t
val make : Point.t list -> t
val first_point : t -> Point.t
val to_list : t -> Point.t list
val fold : ('a ->... | null | https://raw.githubusercontent.com/ghilesZ/geoml/a239499dabbbfbf74bae73a105ed567546f43312/src/polygon.mli | ocaml | * This module provides basic functions for any concave, convex
and convex regular polygon (Does not handle complex polygon and polygon with
holes)
* Same function as [List.fold_left] but on segments of a given polygon
* returns the intersection point of a line and a polygon
* hull pts returns the smallest co... |
type t = private Point.t list
type polygon = t
val make : Point.t list -> t
val first_point : t -> Point.t
val to_list : t -> Point.t list
val fold : ('a -> Point.t -> Point.t -> 'a) -> 'a -> t -> 'a
val fold_filter : (Point.t -> Point.t -> bool) -> ('b -> Point.t -> Point.t -> 'b) -> 'b -> t -> 'b
* Same function... |
42abfc9304e549461932b7e76aada8532b81a4c9ed8ad14603f55ab646c9edec | gator1/jepsen | rethinkdb_test.clj | (ns jepsen.rethinkdb-test
(:require [clojure.test :refer :all]
[clojure.pprint :refer :all]
[clojure.java.io :as io]
[jepsen.rethinkdb.document-cas :as dc]
[jepsen.core :as jepsen]))
(defn run!
[test]
(let [test (jepsen/run! test)]
(is (:valid? (:results test))... | null | https://raw.githubusercontent.com/gator1/jepsen/1932cbd72cbc1f6c2a27abe0fe347ea989f0cfbb/rethinkdb/test/jepsen/rethinkdb_test.clj | clojure | (ns jepsen.rethinkdb-test
(:require [clojure.test :refer :all]
[clojure.pprint :refer :all]
[clojure.java.io :as io]
[jepsen.rethinkdb.document-cas :as dc]
[jepsen.core :as jepsen]))
(defn run!
[test]
(let [test (jepsen/run! test)]
(is (:valid? (:results test))... | |
d112ceaf75e2af89f5dbb031e8ea036b7e91c2fa344f57a73befeb259200f3f6 | piranha/piu.clj | main.clj | (ns piu.main
(:gen-class)
(:require [mount.core :as mount]
[org.httpkit.server :as httpkit]
[piu.config :as config]
[piu.log :as log]
[piu.app :as app]))
(set! *warn-on-reflection* true)
(alter-var-root #'log/*logger (fn [_] (log/->Stdout)))
(mount/defstate serve... | null | https://raw.githubusercontent.com/piranha/piu.clj/6dbf397dd315a520b1c3c2522f7855767a4f0e78/src/piu/main.clj | clojure | (ns piu.main
(:gen-class)
(:require [mount.core :as mount]
[org.httpkit.server :as httpkit]
[piu.config :as config]
[piu.log :as log]
[piu.app :as app]))
(set! *warn-on-reflection* true)
(alter-var-root #'log/*logger (fn [_] (log/->Stdout)))
(mount/defstate serve... | |
9b21e45f07ec8788f75fd99a0cdc7cd91d26949cf1d99c69b2b4db6918906bbc | lehins/massiv | NumericSpec.hs | # LANGUAGE TypeApplications #
module Test.Massiv.Array.NumericSpec (
spec,
) where
import Data.Massiv.Array as A
import Test.Massiv.Array.Numeric
import Test.Massiv.Core
spec :: Spec
spec = do
mutableNumericSpec @P @Int
mutableNumericFloatSpec @P
mutableNumericSpec @S @Int
mutableNumericFloatSpec @S
| null | https://raw.githubusercontent.com/lehins/massiv/67a920d4403f210d0bfdad1acc4bec208d80a588/massiv-test/tests/Test/Massiv/Array/NumericSpec.hs | haskell | # LANGUAGE TypeApplications #
module Test.Massiv.Array.NumericSpec (
spec,
) where
import Data.Massiv.Array as A
import Test.Massiv.Array.Numeric
import Test.Massiv.Core
spec :: Spec
spec = do
mutableNumericSpec @P @Int
mutableNumericFloatSpec @P
mutableNumericSpec @S @Int
mutableNumericFloatSpec @S
| |
674a120e60edf57ca8586f7090ad84aac19beffe606421e6c2550dc42dce9975 | bmsherman/haskell-matlab | Engine.hs | {-# LANGUAGE QuasiQuotes #-}
{-# LANGUAGE ScopedTypeVariables #-}
{-# LANGUAGE TemplateHaskell #-}
module Test.Engine where
import Control.Exception (SomeException, assert, try)
import Data.Either (isLeft, isRight, lefts)
import Foreign.Matlab
import Foreign.Matlab.Engine
import Foreign.Matlab.En... | null | https://raw.githubusercontent.com/bmsherman/haskell-matlab/21cdb98a2bcf23c90eb31026063f4c3a2cf5da15/test/Test/Engine.hs | haskell | # LANGUAGE QuasiQuotes #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TemplateHaskell #
|Similar to testAbstractValueUse, but instead of using
TODO: display cell array and extracted values in test |
module Test.Engine where
import Control.Exception (SomeException, assert, try)
import Data.Either (isLeft, isRight, lefts)
import Foreign.Matlab
import Foreign.Matlab.Engine
import Foreign.Matlab.Engine.Wrappers
import Language.Haskell.TH (Q, runIO)
import Language.Haskell.TH.Syntax (lift)
import Path
import Test.Uti... |
b1d45f7987ac67cf738d61ac303ccc364813f7c5e47b6cc6ea08c500f00eab5c | nomeata/ghc-proofs | Simple.hs | {-# OPTIONS_GHC -O -fplugin GHC.Proof.Plugin #-}
module Simple where
import GHC.Proof
import Data.Maybe
my_proof1 :: (a -> b) -> Maybe a -> Proof
my_proof1 f x = isNothing (fmap f x)
=== isNothing x
my_proof2 :: a -> Maybe a -> Proof
my_proof2 d x = fromMaybe d x
=== maybe d id x
| null | https://raw.githubusercontent.com/nomeata/ghc-proofs/9d013d36e1cac7b6e9322cd0b6295479cc7429eb/examples/Simple.hs | haskell | # OPTIONS_GHC -O -fplugin GHC.Proof.Plugin # | module Simple where
import GHC.Proof
import Data.Maybe
my_proof1 :: (a -> b) -> Maybe a -> Proof
my_proof1 f x = isNothing (fmap f x)
=== isNothing x
my_proof2 :: a -> Maybe a -> Proof
my_proof2 d x = fromMaybe d x
=== maybe d id x
|
4dc3e780539ad20159e8b5788986301fe0748ec29fadbcdc15b251d4ba4d5100 | mwand/5010-examples | 11-6-after-review.rkt | #lang racket
11-6-after-review.rkt
;; Clean up and review.
11-5-generalize-methods-in-superclass.rkt
;; If there are methods that are similar but not identical, generalize
;; them and put the generalization in the superclass. They can pick
;; up the differences using a hook method.
;; Here we'll do that with ad... | null | https://raw.githubusercontent.com/mwand/5010-examples/ac24491ec2e533d048e11087ccc30ff1c087c218/11-6-after-review.rkt | racket | Clean up and review.
If there are methods that are similar but not identical, generalize
them and put the generalization in the superclass. They can pick
up the differences using a hook method.
Here we'll do that with add-to-scene.
local functions in the subclasses weren't accessible from the
superclass.
So tu... | #lang racket
11-6-after-review.rkt
11-5-generalize-methods-in-superclass.rkt
11-4-turn-differences-into-methods.rkt
(require rackunit)
(require 2htdp/universe)
(require 2htdp/image)
(require "extras.rkt")
start with ( run framerate ) . Typically : ( run 0.25 )
(define CANVAS-WIDTH 400)
(define CANVA... |
8d073a5c719027005c359195ef7e1bc3b21308a3a2f96c410c5a7c42ca0ab50a | gafiatulin/codewars | Trim.hs | -- Trim a String
-- /
module Trim where
import Data.Char (isSpace)
trim :: String -> String
trim = reverse . dropWhile isSpace . reverse . dropWhile isSpace
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/6%20kyu/Trim.hs | haskell | Trim a String
/ |
module Trim where
import Data.Char (isSpace)
trim :: String -> String
trim = reverse . dropWhile isSpace . reverse . dropWhile isSpace
|
57f7c91d15a0de0d5bd400f212a9a24489c1275d1a307ab21785da502653b279 | metaocaml/ber-metaocaml | rec_check.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/metaocaml/ber-metaocaml/4992d1f87fc08ccb958817926cf9d1d739caf3a2/typing/rec_check.mli | ocaml | ************************************************************************
OCaml
... | , University of Cambridge
Copyright 2017
the GNU Lesser General Public License version 2.1 , with the
exception Illegal_expr
val is_valid_recursive_expression : Ident.t list -> Typedtree.expression -> bool
val is_valid_class_expr : Ident.t list -> Typedtree.c... |
4f789e64a010e4e25ba34dee1e4b93db52583bde8616288417d1469481242e81 | pixlsus/registry.gimp.org_static | descreen.scm | Descreen v1.0
; Tested on Gimp v2.6.8
(define (script-fu-descreen image drawable sensitivity selectiongrowth despeckle middle-ratio)
This script requires the FFT plug - in which provides FFT forward and FFT inverse filter
(if (not (defined? 'plug-in-fft-dir))
(begin
; Display an error message
(g... | null | https://raw.githubusercontent.com/pixlsus/registry.gimp.org_static/ffcde7400f402728373ff6579947c6ffe87d1a5e/registry.gimp.org/files/descreen.scm | scheme | Tested on Gimp v2.6.8
Display an error message
Abort the script
Start an undo group
Add the new layer to the image
Calculate the low threshold given the sensitivity (low-threshold=256-sensitivity)
Determine the dimensions of the middle zone that should remain untouched
Calculate the middle of the picture
gimp-... | Descreen v1.0
(define (script-fu-descreen image drawable sensitivity selectiongrowth despeckle middle-ratio)
This script requires the FFT plug - in which provides FFT forward and FFT inverse filter
(if (not (defined? 'plug-in-fft-dir))
(begin
(gimp-message "This script requires the FFT plug-in")
... |
e01d6285fb12e5cd63bafb0c4b269f64459861e52d91bff450cc2989dcb6b587 | ralsei/bingus | parsing-submission.rkt | #lang racket
(require "data-def-parsing.rkt"
"check-signature.rkt")
(provide parse-submission)
; mode controls what is parsed
; - 'a is for all lines
; - 'c is for all comments
; - 'd is for all data definitions
; - 's is for all signatures
(define (parse submitted-string [mode 'a])
(let ([regexp-exp
... | null | https://raw.githubusercontent.com/ralsei/bingus/c08cf67534088a19987c6c35bf7006d9a3a39171/bingus-lib/parser/from-checkers/parsing-submission.rkt | racket | mode controls what is parsed
- 'a is for all lines
- 'c is for all comments
- 'd is for all data definitions
- 's is for all signatures | #lang racket
(require "data-def-parsing.rkt"
"check-signature.rkt")
(provide parse-submission)
(define (parse submitted-string [mode 'a])
(let ([regexp-exp
(match mode
['a #px"(?m:^.*$)"]
['c #px"(?m:^\\s*;.*$)"]
['d #px"(?mi:^\\s*;[\\s;]*an?\\s+(.*\\S)\\s+is\\s+(?... |
aab971d4c4054a0d1443434e763f8db001f590902012e6c3db566907974bf83d | UBTECH-Walker/WalkerSimulationFor2020WAIC | _package_EndEffectorProperties.lisp | (cl:in-package ubt_core_msgs-msg)
(cl:export '(ID-VAL
ID
UI_TYPE-VAL
UI_TYPE
MANUFACTURER-VAL
MANUFACTURER
PRODUCT-VAL
PRODUCT
SERIAL_NUMBER-VAL
SERIAL_NUMBER
HARDWARE_REV-VAL
HARDWARE_REV
FIRMWARE_RE... | null | https://raw.githubusercontent.com/UBTECH-Walker/WalkerSimulationFor2020WAIC/7cdb21dabb8423994ba3f6021bc7934290d5faa9/walker_WAIC_18.04_v1.2_20200616/walker_install/share/common-lisp/ros/ubt_core_msgs/msg/_package_EndEffectorProperties.lisp | lisp | (cl:in-package ubt_core_msgs-msg)
(cl:export '(ID-VAL
ID
UI_TYPE-VAL
UI_TYPE
MANUFACTURER-VAL
MANUFACTURER
PRODUCT-VAL
PRODUCT
SERIAL_NUMBER-VAL
SERIAL_NUMBER
HARDWARE_REV-VAL
HARDWARE_REV
FIRMWARE_RE... | |
22797cba71dd459d323be481fd4b1e1b8e0706f6766a7b0550ae2a18baf505ba | janestreet/memtrace_viewer_with_deps | details_panel.ml | open! Core_kernel
open! Async_kernel
open! Bonsai_web
open Memtrace_viewer_common
let view ~focus ~total_allocations ~direction =
let header_text = Vdom.Node.text "Selection" in
let header = Vdom.Node.h2 [] [ header_text ] in
let body =
let to_percent size = 100. *. Byte_units.(size // total_allocations) in
... | null | https://raw.githubusercontent.com/janestreet/memtrace_viewer_with_deps/5a9e1f927f5f8333e2d71c8d3ca03a45587422c4/client/details_panel.ml | ocaml | en dash | open! Core_kernel
open! Async_kernel
open! Bonsai_web
open Memtrace_viewer_common
let view ~focus ~total_allocations ~direction =
let header_text = Vdom.Node.text "Selection" in
let header = Vdom.Node.h2 [] [ header_text ] in
let body =
let to_percent size = 100. *. Byte_units.(size // total_allocations) in
... |
7022729b18768ea3f9568e503356ba39b12eba69dca0a16a5cbd3eb3b68a3a55 | xxyzz/SICP | Exercise_5_30.rkt | #lang racket/base
;; a:
(define (lookup-variable-value var env)
(travsersing-env
(lambda (env) (lookup-variable-value var (enclosing-environment env)))
(lambda (current-pair) (frame-unit-value current-pair))
(lambda (var) (list 'unbound-variable-error var)) ;; ***
env
var))
(define (unbound-error? va... | null | https://raw.githubusercontent.com/xxyzz/SICP/e26aea1c58fd896297dbf5406f7fcd32bb4f8f78/5_Computing_with_Register_Machines/5.4_The_Explicit-Control_Evaluator/Exercise_5_30.rkt | racket | a:
***
add it to eceval-operations
***
b:
add it to eceval-operations
*** | #lang racket/base
(define (lookup-variable-value var env)
(travsersing-env
(lambda (env) (lookup-variable-value var (enclosing-environment env)))
(lambda (current-pair) (frame-unit-value current-pair))
env
var))
(tagged-list? val 'unbound-variable-error))
ev-variable
(assign val (op lookup-variable-v... |
c27b8ddddf23a01a40f8d8deffefaba7c1921251cd05f8a6053ac06da089c1fe | screenshotbot/screenshotbot-oss | settings.lisp | ;;;; Copyright 2018-Present Modern Interpreters Inc.
;;;;
This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(defpackage :screenshotbot/email-tasks/settings
(:use #:cl)
(:import-from #:scree... | null | https://raw.githubusercontent.com/screenshotbot/screenshotbot-oss/0dbade94b9a2f898cccc1193dbf8e45694cacaca/src/screenshotbot/email-tasks/settings.lisp | lisp | Copyright 2018-Present Modern Interpreters Inc.
there's not much in terms of validation to do here.
If we're here, we're probably clicking the email control
link in an email. Since we need to change the setting for
specific organization, let's change the organization, and
then redirect back to the settings page. | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(defpackage :screenshotbot/email-tasks/settings
(:use #:cl)
(:import-from #:screenshotbot/settings-api
#:settings-template
... |
963e03d94471d0c763447379ea05b51da79e43e5819f53a69ba1294afea1778b | fpco/ide-backend | TestPkgB.hs | module Testing.TestPkgB where
testPkgB :: String
testPkgB = "This is test package B"
| null | https://raw.githubusercontent.com/fpco/ide-backend/860636f2d0e872e9481569236bce690637e0016e/ide-backend/test-packages/testpkg-B/Testing/TestPkgB.hs | haskell | module Testing.TestPkgB where
testPkgB :: String
testPkgB = "This is test package B"
| |
5d71ee42a8e20a733483e851e402cb09161b09515b4f4ba195c9e6ecc7410426 | gsakkas/rite | 20060323-10:36:10-23f563f30054417a24188e71c358a86b.seminal.ml |
exception Unimplemented
exception AlreadyDone
(*** part a ***)
type move = Home | Forward of float
| Turn of float | For of int * (move)list
(*** part b -- return move***)
let makePoly sides len =
# # # # # # # # # # # # # # # # # # # # #
let rec makePolyHelp sidesLeft turn =
match sidesLe... | null | https://raw.githubusercontent.com/gsakkas/rite/958a0ad2460e15734447bc07bd181f5d35956d3b/features/data/seminal/20060323-10%3A36%3A10-23f563f30054417a24188e71c358a86b.seminal.ml | ocaml | ** part a **
** part b -- return move**
** part c **
** part d **
** part e **
** part f **
** possibly helpful testing code ** |
exception Unimplemented
exception AlreadyDone
type move = Home | Forward of float
| Turn of float | For of int * (move)list
let makePoly sides len =
# # # # # # # # # # # # # # # # # # # # #
let rec makePolyHelp sidesLeft turn =
match sidesLeft with
0 -> []
| 1 -> Home::makePolyH... |
ab3f21a7de20700840f72f4cbbb2286d18bb0ab7ab98f4a7538b1a9d8e408b71 | egonSchiele/actionkid | Internal.hs | module ActionKid.Internal where
import ActionKid.Types
import ActionKid.Utils
import Control.Applicative
import Control.Monad
import Data.List
import Data.Maybe
import Text.Printf
import Graphics.Gloss hiding (display)
import Data.Monoid ((<>), mconcat)
import Graphics.Gloss.Interface.IO.Game
import Data.Ord
import Act... | null | https://raw.githubusercontent.com/egonSchiele/actionkid/a1f1ca4efafb5a692dfd12b6c3a2fd74e8888fb0/src/ActionKid/Internal.hs | haskell | bounding box for a series of points
| Code borrowed from -game-0.3.0.0/docs/src/Graphics-Gloss-Game.html
Calculate bounding boxes for various `Picture` types.
^origin & extent, where the origin is at the centre
let ((x1, y1), (x2, y2)) = boundingBox p
w = x2 - x1
h = y2 - y1
scaledW = w * xf
sc... | module ActionKid.Internal where
import ActionKid.Types
import ActionKid.Utils
import Control.Applicative
import Control.Monad
import Data.List
import Data.Maybe
import Text.Printf
import Graphics.Gloss hiding (display)
import Data.Monoid ((<>), mconcat)
import Graphics.Gloss.Interface.IO.Game
import Data.Ord
import Act... |
2ceea9f9d68fc1549527a72ce803a3591e2b2f4f6c056c97131797192a0b8b42 | stan-dev/stanc3 | Parse.mli | * Some complicated stuff to get the custom syntax errors out of Menhir 's Incremental
API
API *)
open Core_kernel
val parse_file :
(Lexing.position -> Ast.untyped_program Parser.MenhirInterpreter.checkpoint)
-> string
-> (Ast.untyped_program, Errors.t) result * Warnings.t list
* A helper function t... | null | https://raw.githubusercontent.com/stan-dev/stanc3/2e5562c16c7567ddf7fedc988902f9e38e390136/src/frontend/Parse.mli | ocaml | * Some complicated stuff to get the custom syntax errors out of Menhir 's Incremental
API
API *)
open Core_kernel
val parse_file :
(Lexing.position -> Ast.untyped_program Parser.MenhirInterpreter.checkpoint)
-> string
-> (Ast.untyped_program, Errors.t) result * Warnings.t list
* A helper function t... | |
cf3cacb18bf9e2714a96b10e2128ab67b5a0f94612fc98c3cb376b1b32fc9cf8 | google/rysim | num_gen_SUITE.erl | %%%-------------------------------------------------------------------
Copyright 2014 The RySim Authors . All rights reserved .
%%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%%% you may not use this file except in compliance with the License.
%%% You may obtain a copy of the License at
%... | null | https://raw.githubusercontent.com/google/rysim/afe19cea6415eb9d17e97f2f67280cf0b92eaa6e/erlang/rysim_des_actor_smp/test/num_gen_SUITE.erl | erlang | -------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or im... | Copyright 2014 The RySim Authors . All rights reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(num_gen_SUITE).
-include_lib("common_test/include/ct.hrl").
-export([all/0]).
-export([init_per_testcase/2, ... |
9238a1e1b408cdbba0864fbb5826629debb34a30dfd38f621cae3264503025f2 | schnef/pm | pm_sup.erl | %%%-------------------------------------------------------------------
%% @doc pm top level supervisor.
%% @end
%%%-------------------------------------------------------------------
-module(pm_sup).
-behaviour(supervisor).
%% API
-export([start_link/0]).
%% Supervisor callbacks
-export([init/1]).
-define(SERVER, ... | null | https://raw.githubusercontent.com/schnef/pm/8691c9688c51dfb0aaa4d089ef59c0af54c27e63/src/pm_sup.erl | erlang | -------------------------------------------------------------------
@doc pm top level supervisor.
@end
-------------------------------------------------------------------
API
Supervisor callbacks
====================================================================
API functions
====================================... |
-module(pm_sup).
-behaviour(supervisor).
-export([start_link/0]).
-export([init/1]).
-define(SERVER, ?MODULE).
start_link() ->
supervisor:start_link({local, ?SERVER}, ?MODULE, []).
Child : : { Id , StartFunc , Restart , Shutdown , Type , Modules }
init([]) ->
Sup_flags = #{},
{ok, { Sup_flags, [#... |
d1c402b815b61511676d395fdf810443d59b251474eed5a2462f38eb51058bd3 | simonmar/monad-par | Direct.hs | # LANGUAGE RankNTypes , NamedFieldPuns , BangPatterns ,
ExistentialQuantification , CPP , ScopedTypeVariables ,
TypeSynonymInstances , MultiParamTypeClasses ,
, ,
ParallelListComp #
ExistentialQuantification, CPP, ScopedTypeVariables,
... | null | https://raw.githubusercontent.com/simonmar/monad-par/9a25911e2004c66c1eb14dc200d1f5b0c2d83f0e/monad-par/Control/Monad/Par/Scheds/Direct.hs | haskell | OPTIONS_GHC -Wall -fno-warn-name-shadowing -fno-warn-unused-do-bind
{- LANGUAGE Trustworthy -}
trace data structure).
abstract: Constructor not exported.
sched,
runParAsync, runParAsyncHelper,
yield,
------------------------------------------------------------------------------
Configuration Toggles
---... | # LANGUAGE RankNTypes , NamedFieldPuns , BangPatterns ,
ExistentialQuantification , CPP , ScopedTypeVariables ,
TypeSynonymInstances , MultiParamTypeClasses ,
, ,
ParallelListComp #
ExistentialQuantification, CPP, ScopedTypeVariables,
... |
f91c93d8d4235c9adb984990fc16a8b40decfc54c5dfaf9d004709a175762508 | emmabastas/elm-embed | Effects.hs | # OPTIONS_GHC -Wall #
{-# LANGUAGE OverloadedStrings #-}
module Canonicalize.Effects
( canonicalize
, checkPayload
)
where
import qualified Data.Foldable as F
import qualified Data.Map as Map
import qualified Data.Name as Name
import qualified AST.Canonical as Can
import qualified AST.Source as Src
import qua... | null | https://raw.githubusercontent.com/emmabastas/elm-embed/c2c4f9dcc5c4f47480f728247ff7b4d0700d7476/compiler/src/Canonicalize/Effects.hs | haskell | # LANGUAGE OverloadedStrings #
RESULT
CANONICALIZE
CANONICALIZE PORT
VERIFY MANAGER
CHECK PAYLOAD TYPES | # OPTIONS_GHC -Wall #
module Canonicalize.Effects
( canonicalize
, checkPayload
)
where
import qualified Data.Foldable as F
import qualified Data.Map as Map
import qualified Data.Name as Name
import qualified AST.Canonical as Can
import qualified AST.Source as Src
import qualified AST.Utils.Type as Type
impor... |
e388e732bffe213d412693a16c57c80ed56ce651043498e7b9c81e610267b3cb | MarchLiu/market | matcher.clj | (ns liu.mars.market.matcher
(:require [clojure.java.jdbc :as j]
[liu.mars.market.config :as config]
[cheshire.core :as c]))
(defn save [trade]
(let [data (c/parse-string trade true)]
(j/execute! @config/db {:meta {:category (:category data)
:symb... | null | https://raw.githubusercontent.com/MarchLiu/market/7a7daf6c04b41e0f8494be6740da8d54785c5e77/matcher/src/main/clojure/liu/mars/market/matcher.clj | clojure | (ns liu.mars.market.matcher
(:require [clojure.java.jdbc :as j]
[liu.mars.market.config :as config]
[cheshire.core :as c]))
(defn save [trade]
(let [data (c/parse-string trade true)]
(j/execute! @config/db {:meta {:category (:category data)
:symb... | |
d329bb3b41ff7e53540264798f09f36d4ce7436d11c1591692bb9dc2f40cc905 | mikera/core.matrix | sequence.cljc | (ns clojure.core.matrix.impl.sequence
"Namepace implementing selected core.matrix protocols for clojure sequences.
Useful if you want to pass Clojure sequences directly to core.matrix functions.
WARNING: because they lack efficient indexed access, sequences will perform badly for most
array operations. In ... | null | https://raw.githubusercontent.com/mikera/core.matrix/0a35f6e3d6d2335cb56f6f3e5744bfa1dd0390aa/src/main/clojure/clojure/core/matrix/impl/sequence.cljc | clojure |
Important notes:
TODO: figure out if this is a good return value? should it be an error?
handle 1D case, just return this sequence unchanged
=====================================
Register implementation
(imp/register-implementation '(1 2 3)) | (ns clojure.core.matrix.impl.sequence
"Namepace implementing selected core.matrix protocols for clojure sequences.
Useful if you want to pass Clojure sequences directly to core.matrix functions.
WARNING: because they lack efficient indexed access, sequences will perform badly for most
array operations. In ... |
e7f8affe772bb413bae0a4ad4bebdfbdcfccd42ce6e52e26fa3894546caac3be | gwathlobal/CotD | init-game-events-demonic-steal.lisp | (in-package :cotd)
;;===========================
WIN EVENTS
;;===========================
(set-game-event (make-instance 'game-event :id +game-event-demon-steal-win-for-angels+
:descr-func #'(lambda ()
"To win, des... | null | https://raw.githubusercontent.com/gwathlobal/CotD/d01ef486cc1d3b21d2ad670ebdb443e957290aa2/src/game-events/init-game-events-demonic-steal.lisp | lisp | ===========================
=========================== | (in-package :cotd)
WIN EVENTS
(set-game-event (make-instance 'game-event :id +game-event-demon-steal-win-for-angels+
:descr-func #'(lambda ()
"To win, destroy all demons in the district. To lose, have all angels ki... |
9703c16960b790e81eed47dd8501239bdcc5c6838c8f2294da26b001e7d6e0f0 | dolotech/erlang_server | data_produce_num.erl | -module(data_produce_num).
-export([get/1]).
get(ids) -> [1,2,3,4,5];
get(1) -> [{rand_top, 50}, {range, [{1,1,50}]}];
get(2) -> [{rand_top, 75}, {range, [{1,1,50},{2,51,75}]}];
get(3) -> [{rand_top, 87}, {range, [{1,1,50},{2,51,75},{3,76,87}]}];
get(4) -> [{rand_top, 95}, {range, [{1,1,50},{2,51,75},{3,76,87},{4,88,95... | null | https://raw.githubusercontent.com/dolotech/erlang_server/44ea3693317f60e18b19c9ddfa179307cbd646d7/src/data/data_produce_num.erl | erlang | -module(data_produce_num).
-export([get/1]).
get(ids) -> [1,2,3,4,5];
get(1) -> [{rand_top, 50}, {range, [{1,1,50}]}];
get(2) -> [{rand_top, 75}, {range, [{1,1,50},{2,51,75}]}];
get(3) -> [{rand_top, 87}, {range, [{1,1,50},{2,51,75},{3,76,87}]}];
get(4) -> [{rand_top, 95}, {range, [{1,1,50},{2,51,75},{3,76,87},{4,88,95... | |
1d148662cceb833ee2a55156ab23ad35af1e9a6c7a342a58c7f9406a5a26b2a7 | tek/ribosome | MenuFilter.hs | module Ribosome.Menu.Interpreter.MenuFilter where
import Text.Regex.PCRE.Light.Char8 (caseless, compileM, utf8)
import Ribosome.Menu.Data.Entry (Entry (Entry))
import Ribosome.Menu.Data.Filter (Filter (Fuzzy, Prefix, Regex, Substring))
import Ribosome.Menu.Data.FilterMode (FilterMode (FilterMode))
import Ribosome.Men... | null | https://raw.githubusercontent.com/tek/ribosome/ec3dd63ad47322e7fec66043dd7e6ade2f547ac1/packages/menu/lib/Ribosome/Menu/Interpreter/MenuFilter.hs | haskell | module Ribosome.Menu.Interpreter.MenuFilter where
import Text.Regex.PCRE.Light.Char8 (caseless, compileM, utf8)
import Ribosome.Menu.Data.Entry (Entry (Entry))
import Ribosome.Menu.Data.Filter (Filter (Fuzzy, Prefix, Regex, Substring))
import Ribosome.Menu.Data.FilterMode (FilterMode (FilterMode))
import Ribosome.Men... | |
0c8136d8757dc9da2b957366ecbe32b6eb3c41119aac1895698a44a3a1e558f8 | arttuka/reagent-material-ui | stacked_bar_chart_outlined.cljs | (ns reagent-mui.icons.stacked-bar-chart-outlined
"Imports @mui/icons-material/StackedBarChartOutlined as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def stacke... | null | https://raw.githubusercontent.com/arttuka/reagent-material-ui/14103a696c41c0eb67fc07fc67cd8799efd88cb9/src/icons/reagent_mui/icons/stacked_bar_chart_outlined.cljs | clojure | (ns reagent-mui.icons.stacked-bar-chart-outlined
"Imports @mui/icons-material/StackedBarChartOutlined as a Reagent component."
(:require-macros [reagent-mui.util :refer [create-svg-icon e]])
(:require [react :as react]
["@mui/material/SvgIcon" :as SvgIcon]
[reagent-mui.util]))
(def stacke... | |
7dac567e23e9e4ab19b6c1f93b38c725e00013dec421015254f98732e10b9973 | OlivierSohn/hamazed | Drawable.hs | {-# OPTIONS_HADDOCK hide #-}
# LANGUAGE NoImplicitPrelude #
module Imj.Graphics.Class.Drawable
( Drawable(..)
*
, Draw, MonadReader
) where
import Imj.Prelude
import Imj.Graphics.Class.Draw
import Control.Monad.Reader.Class(MonadReader)
-- | A 'D... | null | https://raw.githubusercontent.com/OlivierSohn/hamazed/c0df1bb60a8538ac75e413d2f5bf0bf050e5bc37/imj-base/src/Imj/Graphics/Class/Drawable.hs | haskell | # OPTIONS_HADDOCK hide #
| A 'Drawable' is a graphical element that knows how to draw itself
(it knows its color and position). |
# LANGUAGE NoImplicitPrelude #
module Imj.Graphics.Class.Drawable
( Drawable(..)
*
, Draw, MonadReader
) where
import Imj.Prelude
import Imj.Graphics.Class.Draw
import Control.Monad.Reader.Class(MonadReader)
class Drawable a where
| Draw the ' ... |
5292241c9b97320f03a16217f32bed69310faf9961f7e20234b25ed6c00ae561 | cse-bristol/110-thermos-ui | network_model.clj | This file is part of THERMOS , copyright © Centre for Sustainable Energy , 2017 - 2021
Licensed under the Reciprocal Public License v1.5 . See LICENSE for licensing details .
(ns thermos-backend.spreadsheet.network-model
"Functions to output network model data into a spreadsheet"
(:require [thermos-backend.spr... | null | https://raw.githubusercontent.com/cse-bristol/110-thermos-ui/729c0a279dba40b6d1a49bc485c968569741e915/src/thermos_backend/spreadsheet/network_model.clj | clojure | Add an empty row between categories | This file is part of THERMOS , copyright © Centre for Sustainable Energy , 2017 - 2021
Licensed under the Reciprocal Public License v1.5 . See LICENSE for licensing details .
(ns thermos-backend.spreadsheet.network-model
"Functions to output network model data into a spreadsheet"
(:require [thermos-backend.spr... |
1426df613d6400e80eb35535387915b5cff4dbf9787590ea1db31324c5fe274c | dgtized/shimmers | space_colonization.cljc | (ns shimmers.algorithm.space-colonization
(:require
[clojure.set :as set]
[shimmers.math.deterministic-random :as dr]
[shimmers.math.vector :as v]
[thi.ng.geom.core :as g]
[thi.ng.geom.spatialtree :as spatialtree]
[thi.ng.geom.vector :as gv]
[thi.ng.math.core :as tm]))
;; Ideas:
;; * attractors... | null | https://raw.githubusercontent.com/dgtized/shimmers/65df950817dfd06f86dc418413a0285fdf1fcc37/src/shimmers/algorithm/space_colonization.cljc | clojure | Ideas:
* attractors could have influence PER attractor instead of global, or a weight on their influence?
- need kd-tree, or voronoi for faster "closest" lookups
* build up an initial trunk if no attractors are in range?
* add more weight to roots of the tree
* improve rules for detecting steady state comp... | (ns shimmers.algorithm.space-colonization
(:require
[clojure.set :as set]
[shimmers.math.deterministic-random :as dr]
[shimmers.math.vector :as v]
[thi.ng.geom.core :as g]
[thi.ng.geom.spatialtree :as spatialtree]
[thi.ng.geom.vector :as gv]
[thi.ng.math.core :as tm]))
* some implementations ... |
766d92a5313a11523f4c81ad2abd081c2470e675ebfab9ef0cd8496fb0e83020 | altsun/My-Lisps | (CLD) Ve bong may revcloud.lsp | ;; free lisp from cadviet.com
;;; this lisp was downloaded from
(defun C:CLD (/ aleng p1 p2 )
(setq p1 (getpoint "\nCh\U+1ECDn \U+0111i\U+1EC3m \U+0111\U+1EA7u HCN :")
p2 (getcorner p1 "\n\U+0110i\U+1EC3m cu\U+1ED1i :")
aleng (getdist "\nB\U+00E1n k\U+00EDnh cong :"))
(command "_.rectangle" p1 p2)
(command... | null | https://raw.githubusercontent.com/altsun/My-Lisps/85476bb09b79ef5e966402cc5158978d1cebd7eb/Common/Revcloud/(CLD)%20Ve%20bong%20may%20revcloud.lsp | lisp | free lisp from cadviet.com
this lisp was downloaded from | (defun C:CLD (/ aleng p1 p2 )
(setq p1 (getpoint "\nCh\U+1ECDn \U+0111i\U+1EC3m \U+0111\U+1EA7u HCN :")
p2 (getcorner p1 "\n\U+0110i\U+1EC3m cu\U+1ED1i :")
aleng (getdist "\nB\U+00E1n k\U+00EDnh cong :"))
(command "_.rectangle" p1 p2)
(command "_.revcloud" "_A" aleng "" "_O" (entlast) "")
(princ)
)
|
eee4b97342a3a8195df1f7f2d8bf3b73b20a1cfaf9815b9cf82e4f0d5853bd40 | elm/package.elm-lang.org | Router.hs | # OPTIONS_GHC -Wall #
# LANGUAGE BangPatterns , GADTs , OverloadedStrings , UnboxedTuples #
module Server.Router
( Route, top, s, int, bytes, custom
, (</>), map, oneOf
, (==>)
, serve
)
where
import Prelude hiding (length, map)
import Control.Applicative ((<|>))
import Data.ByteString (ByteString)
import... | null | https://raw.githubusercontent.com/elm/package.elm-lang.org/d4d5a997a5d9d6622694c488e6a3ae9f537da761/src/backend/Server/Router.hs | haskell | ROUTES
SERVE
GET SEGMENT | # OPTIONS_GHC -Wall #
# LANGUAGE BangPatterns , GADTs , OverloadedStrings , UnboxedTuples #
module Server.Router
( Route, top, s, int, bytes, custom
, (</>), map, oneOf
, (==>)
, serve
)
where
import Prelude hiding (length, map)
import Control.Applicative ((<|>))
import Data.ByteString (ByteString)
import... |
c125916f380c1322d1a534dad84c758f17f98aafec754ec481a0eac1f7811574 | donaldsonjw/bigloo | alphatize.scm | ;*=====================================================================*/
* serrano / prgm / project / bigloo / comptime / Ast / alphatize.scm * /
;* ------------------------------------------------------------- */
* Author : * /
* Creation ... | null | https://raw.githubusercontent.com/donaldsonjw/bigloo/a4d06e409d0004e159ce92b9908719510a18aed5/comptime/Ast/alphatize.scm | scheme | *=====================================================================*/
* ------------------------------------------------------------- */
* ------------------------------------------------------------- */
* The substitution tools module */
*===========================... | * serrano / prgm / project / bigloo / comptime / Ast / alphatize.scm * /
* Author : * /
* Creation : Fri Jan 6 11:09:14 1995 * /
* Last change : Mon Nov 11 09:41:12 2013 ( serrano ) * /
(module ... |
e93d86e00564fd4c1aa725841c00c049fac6e9fdb4f1d068c87a6558208a9168 | SamirTalwar/advent-of-code | AOC_22_2.hs | {-# OPTIONS -Wall #-}
import Data.Functor
import qualified Data.List as List
import Data.Text (Text)
import Helpers.Parse
import Text.Parsec
data Instruction = Instruction Switch Cube
deriving (Show)
data Switch = Off | On
deriving (Show)
data Cube = Cube Range Range Range
deriving (Eq)
instance Show Cube wh... | null | https://raw.githubusercontent.com/SamirTalwar/advent-of-code/5f73557b8d62353e43062148e37ef0d03adab50b/2021/AOC_22_2.hs | haskell | # OPTIONS -Wall # |
import Data.Functor
import qualified Data.List as List
import Data.Text (Text)
import Helpers.Parse
import Text.Parsec
data Instruction = Instruction Switch Cube
deriving (Show)
data Switch = Off | On
deriving (Show)
data Cube = Cube Range Range Range
deriving (Eq)
instance Show Cube where
show (Cube x y z... |
8e5f9cf392773313f6259945a8de630603160cae04f345782308364b48685c1e | larcenists/larceny | numbers.scm | numbers.scm - Sassy 's number predicates
Copyright ( C ) 2005
; 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 ) any later... | null | https://raw.githubusercontent.com/larcenists/larceny/fef550c7d3923deb7a5a1ccd5a628e54cf231c75/src/Lib/Sassy/numbers.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 t... | numbers.scm - Sassy 's number predicates
Copyright ( C ) 2005
version 2.1 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 St , Fifth Floor , Boston , MA 02110 - 1301 USA
Sunnyside , NY 1... |
def8c141fae60de303b1cc666251fa662dc100182c62b1a421e2c5aa34ab8db5 | zhongwencool/observer_cli | observer_cli_inet.erl | %%% @author zhongwen <>
-module(observer_cli_inet).
-include("observer_cli.hrl").
%% API
-export([start/1]).
-export([clean/1]).
-define(LAST_LINE,
"q(quit) ic(inet_count) iw(inet_window) rc(recv_cnt) ro(recv_oct)"
" sc(send_cnt) so(send_oct) cnt oct 9(port 9 info) pd/pu(page:down/up)"
).
-spec start(view_o... | null | https://raw.githubusercontent.com/zhongwencool/observer_cli/baa70569bccc5508e9839e20768540ef3cdca016/src/observer_cli_inet.erl | erlang | @author zhongwen <>
API
Private
| -module(observer_cli_inet).
-include("observer_cli.hrl").
-export([start/1]).
-export([clean/1]).
-define(LAST_LINE,
"q(quit) ic(inet_count) iw(inet_window) rc(recv_cnt) ro(recv_oct)"
" sc(send_cnt) so(send_oct) cnt oct 9(port 9 info) pd/pu(page:down/up)"
).
-spec start(view_opts()) -> no_return.
start(#vie... |
3a1f61f46950a35dd9da7572518191a01ad2e795d2629c4d609c0f0f0f1ed2bd | qfpl/sv | bench.hs | module Main (main) where
import Control.Applicative ((*>))
import Control.DeepSeq (NFData)
import Control.Lens
import Criterion.Main
import qualified Data.Attoparsec.ByteString as A
import Data.ByteString (ByteString)
import qualified Data.ByteString.Lazy as LBS
import Data.Csv as C
import Data.Csv.Parser as C
import ... | null | https://raw.githubusercontent.com/qfpl/sv/74aa56bcdcc0d7f1d7b5783bf59e3878dfbb64bc/benchmarks/bench/bench.hs | haskell | module Main (main) where
import Control.Applicative ((*>))
import Control.DeepSeq (NFData)
import Control.Lens
import Criterion.Main
import qualified Data.Attoparsec.ByteString as A
import Data.ByteString (ByteString)
import qualified Data.ByteString.Lazy as LBS
import Data.Csv as C
import Data.Csv.Parser as C
import ... | |
ebf74a76c6572abe3b3abb5e6a323a613503a173ce3ee80f26e77009db3658ca | htm-community/comportex | tools.cljc | (ns org.nfrac.comportex.layer.tools
(:require [org.nfrac.comportex.core :as cx]
[org.nfrac.comportex.synapses :as syn]
[org.nfrac.comportex.topography :as topo]
[org.nfrac.comportex.layer :as layer]
[org.nfrac.comportex.util :as util]
[clojure.set :as set]
... | null | https://raw.githubusercontent.com/htm-community/comportex/cd318492cf2e43cb7f25238b116b90b8195ec5aa/src/org/nfrac/comportex/layer/tools.cljc | clojure | inputs to layer
synapse graphs - pre-learning state so from prior time step
internal sources
breakdown of proximal excitation by source
breakdown of distal excitation by source
same for apical
excitation levels
effect of boosting
total excitation | (ns org.nfrac.comportex.layer.tools
(:require [org.nfrac.comportex.core :as cx]
[org.nfrac.comportex.synapses :as syn]
[org.nfrac.comportex.topography :as topo]
[org.nfrac.comportex.layer :as layer]
[org.nfrac.comportex.util :as util]
[clojure.set :as set]
... |
9d90db18bcbc427b70103216f71629ef52a97c98f55a7188eda825b4e36b6f8a | bbc/haskell-workshop | C5Recursion.hs | module C5Recursion where
-- Implement all of these functions using explicit recursion
-- Write a minimum function that takes a list and returns its smallest element
myMin [ 10 , 5 , 15 ] returns 5
myMin :: Ord a => [a] -> a
myMin [] = error "please supply a list"
myMin [x] = x
myMin (y:x:xs)
| y <= x = myMin (y:x... | null | https://raw.githubusercontent.com/bbc/haskell-workshop/475b9bac04167665030d7863798ccd27dfd589d0/chrisb/exercises/src/C5Recursion.hs | haskell | Implement all of these functions using explicit recursion
Write a minimum function that takes a list and returns its smallest element
Write a function that takes a finite list and turns it into an infinite list which repeats itself
Hint: this won't need any base/edge case
Write the map function,
using recursion
... | module C5Recursion where
myMin [ 10 , 5 , 15 ] returns 5
myMin :: Ord a => [a] -> a
myMin [] = error "please supply a list"
myMin [x] = x
myMin (y:x:xs)
| y <= x = myMin (y:xs)
| otherwise = myMin (x:xs)
longList [ 1,2,3,4,5 ] returns [ 1,2,3,4,5 , ... ]
longList :: [a] -> [a]
longList xs = xs ++ longList xs... |
3776f7a6dd38115e3625584620d7b8d10467ad38d71b75a6262ca58db5347045 | rd--/hsc3 | lfSaw.help.hs | lfSaw ; note SC2 did not have the initial phase argument
lfSaw ar 500 1 * 0.025
lfSaw ; used as both Oscillator and LFO
lfSaw ar (lfSaw kr 4 0 * 400 + 400) 0 * 0.025
-- lfSaw ; output range is bi-polar
let f = mce [linLin (lfSaw kr 0.5 0) (-1) 1 200 1600, 200, 1600]
a = mce [0.1,0.05,0.05]
in mix (sinOsc ar f... | null | https://raw.githubusercontent.com/rd--/hsc3/024d45b6b5166e5cd3f0142fbf65aeb6ef642d46/Help/Ugen/lfSaw.help.hs | haskell | lfSaw ; output range is bi-polar
lfSaw ; saw-tooth wave as sum of sines, for all partials n amplitude is (1 / n) ; phase is always 0
lfSaw ; as phasor input to sin function
lfSaw ; mixed with sin, then with distortions
lfSaw
-- ; drawings
ascending | lfSaw ; note SC2 did not have the initial phase argument
lfSaw ar 500 1 * 0.025
lfSaw ; used as both Oscillator and LFO
lfSaw ar (lfSaw kr 4 0 * 400 + 400) 0 * 0.025
let f = mce [linLin (lfSaw kr 0.5 0) (-1) 1 200 1600, 200, 1600]
a = mce [0.1,0.05,0.05]
in mix (sinOsc ar f 0 * a)
let mk_freq f0 n = f0 * fro... |
4283692ce260267e4852e1acfaf82179e5a61cb74a5e75af33a34e48117752d3 | Goheeca/cl-drawille | animations.lisp | (defpackage :cl-drawille/examples-animations
(:use :common-lisp :cl-drawille :cl-charms)
(:export :sine-tracking-example :rotating-cube-example))
(in-package :cl-drawille/examples-animations)
(defun animate (animation)
(cl-charms:with-curses ()
(cl-charms:disable-echoing)
(cl-charms/low-level:timeout 10... | null | https://raw.githubusercontent.com/Goheeca/cl-drawille/c5501e71d16fd39f058ed760a0d6034b63e996f5/animations.lisp | lisp | (defpackage :cl-drawille/examples-animations
(:use :common-lisp :cl-drawille :cl-charms)
(:export :sine-tracking-example :rotating-cube-example))
(in-package :cl-drawille/examples-animations)
(defun animate (animation)
(cl-charms:with-curses ()
(cl-charms:disable-echoing)
(cl-charms/low-level:timeout 10... | |
1feaada9458c8938376f4fed0812c6ee31d204bff61fb69ec5199baf5eed7b1b | privet-kitty/cl-competitive | 2sat.lisp | (defpackage :cp/test/2sat
(:use :cl :fiveam :cp/2sat)
(:import-from :cp/test/base #:base-suite))
(in-package :cp/test/2sat)
(in-suite base-suite)
(test 2sat
(2sat-solve (make-2sat 0))
(let ((2sat (make-2sat 1)))
(2sat-add-imply 2sat 0 (lognot 0))
(is (equalp #(0) (2sat-solve 2sat))))
(let ((2sat (mak... | null | https://raw.githubusercontent.com/privet-kitty/cl-competitive/f618fa43e1a464c9f088aa367ac1135c0f33cabd/module/test/2sat.lisp | lisp | (defpackage :cp/test/2sat
(:use :cl :fiveam :cp/2sat)
(:import-from :cp/test/base #:base-suite))
(in-package :cp/test/2sat)
(in-suite base-suite)
(test 2sat
(2sat-solve (make-2sat 0))
(let ((2sat (make-2sat 1)))
(2sat-add-imply 2sat 0 (lognot 0))
(is (equalp #(0) (2sat-solve 2sat))))
(let ((2sat (mak... | |
424d7a3463c6a88743890715847681868da23d91140e81bf5dc92cd0c41a92d3 | 3b/3bgl-misc | timing-helper.lisp | (defpackage #:basecode-timing-helper
(:use #:cl #:basecode))
(in-package #:basecode-timing-helper)
;; mixin for handling simple timing graphs
(defclass basecode-timing-helper ()
((max-queries :reader max-queries :initform 16 :initarg :max-timer-queries)
(query-index :accessor query-index :initform 0)
... | null | https://raw.githubusercontent.com/3b/3bgl-misc/e3bf2781d603feb6b44e5c4ec20f06225648ffd9/timing/timing-helper.lisp | lisp | mixin for handling simple timing graphs
todo: adjust max-queries incrementally?
ignore if we don't have the mixin so it can be easily disabled
without modifying all the code
(declare (dynamic-extent queries))
draw graphs
fixme: convert this stuff to VBOs or something instead of immediate mode
pure blue is... | (defpackage #:basecode-timing-helper
(:use #:cl #:basecode))
(in-package #:basecode-timing-helper)
(defclass basecode-timing-helper ()
((max-queries :reader max-queries :initform 16 :initarg :max-timer-queries)
(query-index :accessor query-index :initform 0)
(timestamps :accessor timestamps :initform ... |
db3e243a4355d53d3cc63c5113b52dcae758a8b851408a47d3a82a2335e0fcbb | NorfairKing/the-notes | BinaryOperation.hs | module Functions.BinaryOperation where
import Notes
import Logic.FirstOrderLogic.Macro
import Sets.Basics.Terms
import Functions.Basics.Macro
import Functions.Basics.Terms
import Functions.BinaryOperation.Macro
import Functions.BinaryOperation.Te... | null | https://raw.githubusercontent.com/NorfairKing/the-notes/ff9551b05ec3432d21dd56d43536251bf337be04/src/Functions/BinaryOperation.hs | haskell | TODO(binary operation can go to other set than dom_ | module Functions.BinaryOperation where
import Notes
import Logic.FirstOrderLogic.Macro
import Sets.Basics.Terms
import Functions.Basics.Macro
import Functions.Basics.Terms
import Functions.BinaryOperation.Macro
import Functions.BinaryOperation.Te... |
44be08a35e0b3cb4715f3d34c8449f736644323753aee86df2cb3dbc1dbd9589 | xh4/web-toolkit | test.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : FLEXI - STREAMS - TEST ; Base : 10 -*-
$ Header : /usr / local / cvsrep / flexi - streams / test / test.lisp , v 1.39 2008/05/30 09:10:55 edi Exp $
Copyright ( c ) 2006 - 2008 , Dr. . All rights reserved .
;;; Redistribution and use in source and binary f... | null | https://raw.githubusercontent.com/xh4/web-toolkit/e510d44a25b36ca8acd66734ed1ee9f5fe6ecd09/vendor/flexi-streams-20190107-git/test/test.lisp | lisp | Syntax : COMMON - LISP ; Package : FLEXI - STREAMS - TEST ; Base : 10 -*-
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
* Redistributions of source code must retain the above copyright
notice, this list of condi... | $ Header : /usr / local / cvsrep / flexi - streams / test / test.lisp , v 1.39 2008/05/30 09:10:55 edi Exp $
Copyright ( c ) 2006 - 2008 , Dr. . All rights reserved .
DIRECT , INDIRECT , INCIDENTAL , SPECIAL , EXEMPLARY , OR CONSEQUENTIAL
INTERRUPTION ) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY ,
... |
3e42151cae88a704a41ffc40681837d5df73a38a2c5e726151d772012399727a | whalliburton/academy | pretty-pictures.lisp | (in-package :academy)
(defmacro %create-demo-images (&rest calls)
`(progn
,@(loop for call in calls
collect `(let ((*save-drawing-name*
,(format nil "~{~(~A~)~^-~}" (ensure-list call))))
,(ensure-list call)))))
(defun life-comic (&key (width 32... | null | https://raw.githubusercontent.com/whalliburton/academy/87a1a13ffbcd60d8553e42e647c59486c761e8cf/pretty-pictures.lisp | lisp | bullseye
moiré
sunbeam
life | (in-package :academy)
(defmacro %create-demo-images (&rest calls)
`(progn
,@(loop for call in calls
collect `(let ((*save-drawing-name*
,(format nil "~{~(~A~)~^-~}" (ensure-list call))))
,(ensure-list call)))))
(defun life-comic (&key (width 32... |
259e27cd79b671be5fd8a07b41f13833b0d3f01fbafbb884de30865bab3078da | earl-ducaine/cl-garnet | global.lisp |
(in-package :garnet-utils)
(defvar black nil)
(defvar white nil)
(defvar *garnet-break-key* :F1)
| null | https://raw.githubusercontent.com/earl-ducaine/cl-garnet/f0095848513ba69c370ed1dc51ee01f0bb4dd108/src/utils/global.lisp | lisp |
(in-package :garnet-utils)
(defvar black nil)
(defvar white nil)
(defvar *garnet-break-key* :F1)
| |
9dfd7c35c0312a02be2e68215f4820fc307a7b5b44773f50a1c095e8acfe1548 | racket/typed-racket | sealing-contract-4.rkt | #;
(exn-pred exn:fail:contract? #rx"shape-check")
#lang racket/base
(module u racket
(define state #f)
;; don't allow smuggling with mutation either
(define (mixin cls)
(define result
(if (not state)
(class cls
(super-new)
(define/public (n x) x))
;; should ... | null | https://raw.githubusercontent.com/racket/typed-racket/1dde78d165472d67ae682b68622d2b7ee3e15e1e/typed-racket-test/fail/shallow/sealing-contract-4.rkt | racket |
don't allow smuggling with mutation either
should subclass from cls, not state since otherwise
we lose the `m` method | (exn-pred exn:fail:contract? #rx"shape-check")
#lang racket/base
(module u racket
(define state #f)
(define (mixin cls)
(define result
(if (not state)
(class cls
(super-new)
(define/public (n x) x))
(class state (super-new))))
(set! state cls)
result)
... |
446a20be9cda3fe399180b0e09322ef82af6bfe260f680630a781447c78ff077 | cojna/iota | MaxFlow.hs | {-# LANGUAGE BangPatterns #-}
# LANGUAGE CPP #
# LANGUAGE LambdaCase #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE RecordWildCards #
module Data.Graph.MaxFlow where
import Control.Monad
import Control.Monad.Primitive
import Control.Monad.ST
import Data.Function
import qualified Data.Vector.Unboxed as U
import qualified Da... | null | https://raw.githubusercontent.com/cojna/iota/9acaa765ad685d466d889229d97b5a1c852a00dd/src/Data/Graph/MaxFlow.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE RankNTypes #
| number of vertices
| source
| sink | # LANGUAGE CPP #
# LANGUAGE LambdaCase #
# LANGUAGE RecordWildCards #
module Data.Graph.MaxFlow where
import Control.Monad
import Control.Monad.Primitive
import Control.Monad.ST
import Data.Function
import qualified Data.Vector.Unboxed as U
import qualified Data.Vector.Unboxed.Mutable as UM
import Data.Buffer
nothi... |
07d6711eab6603d0f8cfcd7cb45f2acf82e3ccc619a93029bcbd5a84e4c68d56 | input-output-hk/voting-tools | Crypto.hs | module Test.Cardano.Catalyst.Crypto
( tests
)
where
import qualified Data.Aeson as Aeson
import Hedgehog (Property, property, tripping)
import Hedgehog.Internal.Property (forAllT)
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.Hedgehog (testProperty)
import quali... | null | https://raw.githubusercontent.com/input-output-hk/voting-tools/d14c5a456dc440b1dfe7901b6f19e53e8aadea12/test/Test/Cardano/Catalyst/Crypto.hs | haskell | module Test.Cardano.Catalyst.Crypto
( tests
)
where
import qualified Data.Aeson as Aeson
import Hedgehog (Property, property, tripping)
import Hedgehog.Internal.Property (forAllT)
import Test.Tasty (TestTree, testGroup)
import Test.Tasty.Hedgehog (testProperty)
import quali... | |
c5756fa166d181f4e12effd42e12f117badda895e1b0410e422504a712b2c991 | osimon8/CombinatorC | expression.ml | open Bexp
open Circuit
type var_type =
| TInt
| TCondition
| TSignal
| TCircuit
| TPattern
let string_of_type ty : string =
begin match ty with
| TInt -> "int"
| TCondition -> "condition"
| TSignal -> "signal"
| TCircuit -> "circuit"
| TPattern -> "pattern"
end
let signal_or_var bexp : bool =
beg... | null | https://raw.githubusercontent.com/osimon8/CombinatorC/0bdbbc893ee458ec75eab7a48712d07a62e190aa/src/ast/expression.ml | ocaml | open Bexp
open Circuit
type var_type =
| TInt
| TCondition
| TSignal
| TCircuit
| TPattern
let string_of_type ty : string =
begin match ty with
| TInt -> "int"
| TCondition -> "condition"
| TSignal -> "signal"
| TCircuit -> "circuit"
| TPattern -> "pattern"
end
let signal_or_var bexp : bool =
beg... | |
51065676ba6c5dc998ac552f096da34d2d6a65f974503be6e7998a98889a2834 | rcherrueau/APE | cond_3.rkt | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
Writing Hygienic Macros in Scheme with Syntax - case
Technical Report # 356
;;
page 15
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
#lang racket
(require "print-test.rkt")
;; `cond_3' recur... | null | https://raw.githubusercontent.com/rcherrueau/APE/8b5302709000bd043b64d46d55642acb34ce5ba7/racket/hygienic_macros/cond_3.rkt | racket |
`cond_3' recurs internally so that it always has a handle on the
original input expression `orig-x'. | Writing Hygienic Macros in Scheme with Syntax - case
Technical Report # 356
page 15
#lang racket
(require "print-test.rkt")
(define-syntax (cond_3 orig-x)
(let docond ([x orig-x])
(syntax-case x (else =>)
[(_)
#'(void)]
[(_ [else e1 e2 ...])
#'(begin e1 e2 ...)]
[(_ [... |
16afefb4d8bd28b67309be3270c0e1176cbc2b3c84d63322a8b82ad23173450e | chenyukang/eopl | top.scm | (module top (lib "eopl.ss" "eopl")
;; top level module. Loads all required pieces.
;; Run the test suite with (run-all).
(require "drscheme-init.scm")
(require "data-structures.scm") ; for expval constructors
(require "lang.scm") ; for scan&parse
(require "interp.scm") ; ... | null | https://raw.githubusercontent.com/chenyukang/eopl/0406ff23b993bfe020294fa70d2597b1ce4f9b78/base/chapter3/proc-lang/ds-rep/top.scm | scheme | top level module. Loads all required pieces.
Run the test suite with (run-all).
for expval constructors
for scan&parse
for value-of-program
for test-list
interface to test harness ;;;;;;;;;;;;;;;;
run-all : () -> Unspecified
runs all the tests in test-list, comparing the results with
equal-answer? ... | (module top (lib "eopl.ss" "eopl")
(require "drscheme-init.scm")
(provide run run-all)
run : String - > ExpVal
(define run
(lambda (string)
(value-of-program (scan&parse string))))
(define run-all
(lambda ()
(run-tests! run equal-answer? test-list)))
... |
395746eef7be78e885dc7d2ee0bd17feb91dfb4fd151a6576703e45840c94c6e | aiya000/haskell-examples | StateT_IO.hs | import Control.Monad.State
wrapped IO { { {
ios1 :: StateT s IO Int
ios1 = StateT $ \s -> return (10, s)
runIOS1 :: IO ()
runIOS1 = do
let io = runStateT ios1 ()
io >>= print
-- }}}
-- runIO in StateT 1 {{{
ios2 :: StateT s IO String
ios2 = StateT $ \s -> do
a <- getLine
putStrLn $ "input: " ++ a
ret... | null | https://raw.githubusercontent.com/aiya000/haskell-examples/a337ba0e86be8bb1333e7eea852ba5fa1d177d8a/Control/Monad/State/StateT_IO.hs | haskell | }}}
runIO in StateT 1 {{{
}}}
}}}
}}} | import Control.Monad.State
wrapped IO { { {
ios1 :: StateT s IO Int
ios1 = StateT $ \s -> return (10, s)
runIOS1 :: IO ()
runIOS1 = do
let io = runStateT ios1 ()
io >>= print
ios2 :: StateT s IO String
ios2 = StateT $ \s -> do
a <- getLine
putStrLn $ "input: " ++ a
return (a, s)
runIOS2 :: IO ()
run... |
276df1f3bbe59b16d6b93dd1e410c47c6e9da905243be1417f96b3abc0bac701 | psholtz/MIT-SICP | exercise-10.scm | ;;
Working definitions ( Data Structures )
;;
(define (make-units C L H)
(list C L H))
(define get-units-C car)
(define get-units-L cadr)
(define get-units-H caddr)
(define (make-class number units)
(list number units))
(define get-class-number car)
(define get-class-units cadr)
(define (get-class-total-units cla... | null | https://raw.githubusercontent.com/psholtz/MIT-SICP/01e9b722ac5008e26f386624849117ca8fa80906/Recitations-F2007/Recitation-06/mit-scheme/exercise-10.scm | scheme |
Working definitions (HOPs)
Previous solutions
Basic Classes
Rewrite "credit-limit" to run in O(n) time.
Recursive loop to walk down "schedule" in O(n) time.
If we are the end of the list, then halt.
If we have exceeded the maximum number of credits, then halt.
Otherwise, keep recursing through... | Working definitions ( Data Structures )
(define (make-units C L H)
(list C L H))
(define get-units-C car)
(define get-units-L cadr)
(define get-units-H caddr)
(define (make-class number units)
(list number units))
(define get-class-number car)
(define get-class-units cadr)
(define (get-class-total-units class)
(... |
1173b1e852db8512c0c3a4c42833ea2e6dec0697ab4e578c89c3130fdc0100c3 | mirage/irmin-server | conf.ml | include Irmin.Backend.Conf
let spec = Irmin.Backend.Conf.Spec.v "irmin-client"
let uri = Irmin.Type.(map string) Uri.of_string Uri.to_string
module Key = struct
let uri =
Irmin.Backend.Conf.key ~spec "uri" uri
(Uri.of_string "tcp:9181")
let tls = Irmin.Backend.Conf.key ~spec "tls" Irmin.Type.bool false... | null | https://raw.githubusercontent.com/mirage/irmin-server/ffda6269663bfe8e0dd0ce1c7053d6e57f1f2deb/src/irmin-server-internal/conf.ml | ocaml | include Irmin.Backend.Conf
let spec = Irmin.Backend.Conf.Spec.v "irmin-client"
let uri = Irmin.Type.(map string) Uri.of_string Uri.to_string
module Key = struct
let uri =
Irmin.Backend.Conf.key ~spec "uri" uri
(Uri.of_string "tcp:9181")
let tls = Irmin.Backend.Conf.key ~spec "tls" Irmin.Type.bool false... | |
a16faea8f5992d24ed64095c8362142cfdb6b21f188e9766213e9613db453218 | paurkedal/batyr | config.mli | Copyright ( C ) 2022 < >
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This p... | null | https://raw.githubusercontent.com/paurkedal/batyr/13aa15970a60286afbd887685a816fcd5fc4976e/batyr-on-xmpp/lib/config.mli | ocaml | Copyright ( C ) 2022 < >
*
* This program is free software : you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation , either version 3 of the License , or
* ( at your option ) any later version .
*
* This p... | |
31a49303a3b1baad2f80d42f12c3e9d3ba9dd5b92c6df90abb14655363c5aac5 | openbadgefactory/salava | users_test.clj | (ns salava.gallery.users-test
(:require [midje.sweet :refer :all]
[salava.test-utils :refer [test-api-request login! logout! test-user-credentials]]))
(def test-user 1)
(def search-data
{:name ""
:country "all"
:common_badges false})
(facts "about viewing user profiles in gallery"
(fact ... | null | https://raw.githubusercontent.com/openbadgefactory/salava/97f05992406e4dcbe3c4bff75c04378d19606b61/test_old/clj/salava/gallery/users_test.clj | clojure | (ns salava.gallery.users-test
(:require [midje.sweet :refer :all]
[salava.test-utils :refer [test-api-request login! logout! test-user-credentials]]))
(def test-user 1)
(def search-data
{:name ""
:country "all"
:common_badges false})
(facts "about viewing user profiles in gallery"
(fact ... | |
a1ab266dcc4904ae675f9dc2bc32e48f4b0a4d0d175f92837fb2ec2914e27af2 | Gbury/archsat | position.ml | This file is free software , part of Archsat . See file " LICENSE " for more details .
(*
This module represents positions in
types, terms and formulas.
*)
(* Position type *)
(* ************************************************************************ *)
type t =
| Here
| Arg of int * t
(* Build position... | null | https://raw.githubusercontent.com/Gbury/archsat/322fbefa4a58023ddafb3fa1a51f8199c25cde3d/src/base/position.ml | ocaml |
This module represents positions in
types, terms and formulas.
Position type
************************************************************************
Build positions
Position results.
************************************************************************
What might wait at the end of a path.
Posi... | This file is free software , part of Archsat . See file " LICENSE " for more details .
type t =
| Here
| Arg of int * t
let root = Here
let arg i t =
if i >= 0 then Arg (i, t)
else invalid_arg "Position.arg"
let rec concat t t' =
match t with
| Here -> t'
| Arg(i, t'') -> Arg(i, concat t'' t')
let... |
c60e7bfb191b191659139b9802de83c3ebc147f3c6a74432f132fa1dd0ce0110 | ndmitchell/shake | Binary.hs | # LANGUAGE FlexibleInstances , ScopedTypeVariables , Rank2Types #
module General.Binary(
BinaryOp(..), binaryOpMap,
binarySplit, binarySplit2, binarySplit3, unsafeBinarySplit,
Builder(..), runBuilder, sizeBuilder,
BinaryEx(..),
Storable, putExStorable, getExStorable, putExStorableList, getExStorabl... | null | https://raw.githubusercontent.com/ndmitchell/shake/99c5a7a4dc1d5a069b13ed5c1bc8e4bc7f13f4a6/src/General/Binary.hs | haskell | -------------------------------------------------------------------
STORE TYPE
| An explicit and more efficient version of Binary
forM for zipWith
-------------------------------------------------------------------
We can't use the Data.ByteString builder as that doesn't track the size of the chunk.
# UNPACK #
a... | # LANGUAGE FlexibleInstances , ScopedTypeVariables , Rank2Types #
module General.Binary(
BinaryOp(..), binaryOpMap,
binarySplit, binarySplit2, binarySplit3, unsafeBinarySplit,
Builder(..), runBuilder, sizeBuilder,
BinaryEx(..),
Storable, putExStorable, getExStorable, putExStorableList, getExStorabl... |
bd26d9d69c536b601e44cbb0d74167d62e679fc43a90785741d9c5178195d01d | ghcjs/jsaddle-dom | WebGPUBuffer.hs | # LANGUAGE PatternSynonyms #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.WebGPUBuffer
(getLength, getContents, WebGPUBuffer(..), gTypeWebGPUBuffer) where
import Prelude ((.), (==), (>>=), ... | null | https://raw.githubusercontent.com/ghcjs/jsaddle-dom/5f5094277d4b11f3dc3e2df6bb437b75712d268f/src/JSDOM/Generated/WebGPUBuffer.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures # | # LANGUAGE PatternSynonyms #
# OPTIONS_GHC -fno - warn - unused - imports #
module JSDOM.Generated.WebGPUBuffer
(getLength, getContents, WebGPUBuffer(..), gTypeWebGPUBuffer) where
import Prelude ((.), (==), (>>=), return, IO, Int, Float, Double, Bool(..), Maybe, maybe, fromIntegral, round, realToFrac, fmap, Show... |
de38945ec990946e64bff3bbc79f60388978e5c142ced426a5e7b3b49da28611 | wrengr/bytestring-trie | ByteStringInternal.hs | {-# OPTIONS_GHC -Wall -fwarn-tabs #-}
----------------------------------------------------------------
-- ~ 2021.12.14
-- |
-- Module : Test.ByteStringInternal
Copyright : 2008 - -2021 wren romano
-- License : BSD-3-Clause
-- Maintainer :
-- Stabili... | null | https://raw.githubusercontent.com/wrengr/bytestring-trie/ec2216d2f560f5e453e65d24ce9cc249fc92d3ec/dev/Test/ByteStringInternal.hs | haskell | # OPTIONS_GHC -Wall -fwarn-tabs #
--------------------------------------------------------------
~ 2021.12.14
|
Module : Test.ByteStringInternal
License : BSD-3-Clause
Maintainer :
Stability : provisional
Portability : portable
-----------------... |
Copyright : 2008 - -2021 wren romano
Testing helper functions on ' ByteString 's .
module Test.ByteStringInternal where
import Test.Utils (packC2W)
import Data.Trie.Internal.ByteString
import Data.List (unfoldr)
showBits :: (Integral a) => a -> String
showBits = unfoldr getBit
where
getBit 0 ... |
f1a865c130a41828d3ea40d62a274e6f0939fe902a30021c7f688f21c3e35930 | gfZeng/time.clj | core.cljc | (ns time.core
(:refer-clojure :exclude [> < >= <= == set get format])
#?(:clj (:import [java.util Date TimeZone]
[java.text SimpleDateFormat]))
(:require [clojure.string :as str]
[clojure.core :as core]
#?(:cljs [goog.string :as gstr])))
#?(:cljs
(do (def Number js/... | null | https://raw.githubusercontent.com/gfZeng/time.clj/874bb2c7a1b4debc07818f4a25e241f8cfa8c5f8/src/time/core.cljc | clojure | (ns time.core
(:refer-clojure :exclude [> < >= <= == set get format])
#?(:clj (:import [java.util Date TimeZone]
[java.text SimpleDateFormat]))
(:require [clojure.string :as str]
[clojure.core :as core]
#?(:cljs [goog.string :as gstr])))
#?(:cljs
(do (def Number js/... | |
f85988a94fc9b40ebc3f7c70f8837044763078744776a7541285cfe13d33e54f | ghc/packages-dph | Unlifted.hs | # LANGUAGE TypeOperators , CPP #
-- | WARNING:
-- This is an abstract interface. All the functions will just `error` if called.
--
This module provides an API for the segmented array primitives used by DPH .
-- None of the functions here have implementations.
--
-- Client programs should use either the @dp... | null | https://raw.githubusercontent.com/ghc/packages-dph/64eca669f13f4d216af9024474a3fc73ce101793/dph-prim-interface/Data/Array/Parallel/Unlifted.hs | haskell | | WARNING:
This is an abstract interface. All the functions will just `error` if called.
None of the functions here have implementations.
Client programs should use either the @dph-prim-seq@ or @dph-prim-par@
packages, as these provide the same API and contain real code.
The dph-prim-interface, dph... | # LANGUAGE TypeOperators , CPP #
This module provides an API for the segmented array primitives used by DPH .
NOTE : The API is enforced by the DPH_Header.h and DPH_Interface.h headers .
#include "DPH_Header.h"
import qualified Prelude as P
import Prelude ( Eq(..), Num(..), Bool(..), ($), (.) )
#include "D... |
368bb51e750f4db7e02b6e527e6d1ac28b839944d807fec53d21da9f8bdbae73 | sol/logging-facade | Facade.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE ConstraintKinds #-}
-- |
-- This module is intended to be imported qualified:
--
> import qualified System . Logging . Facade as Log
module System.Logging.Facade (
-- * Producing log messages
log
, trace
, debug
, info
, warn
, error
-- * Types
, Logging
, LogLevel(..)
) ... | null | https://raw.githubusercontent.com/sol/logging-facade/2ed4f0b00a3a8db11c948ff215578ba5bdbcd188/src/System/Logging/Facade.hs | haskell | # LANGUAGE ConstraintKinds #
|
This module is intended to be imported qualified:
* Producing log messages
* Types
| Produce a log message with specified log level.
| Produce a log message with log level `TRACE`.
| Produce a log message with log level `DEBUG`.
| Produce a log message with log level `INFO`.
| P... | # LANGUAGE FlexibleContexts #
> import qualified System . Logging . Facade as Log
module System.Logging.Facade (
log
, trace
, debug
, info
, warn
, error
, Logging
, LogLevel(..)
) where
import Prelude hiding (log, error)
import Data.CallStack
import System.Logging.Facade.Types
imp... |
dfd569c31c93d160a2d20b991e9807a23d6148e28d9b8f1dd7a3d2d2656e64d3 | julienXX/clj-slack | core.clj | (ns clj-slack.core
(:require
[clj-http.client :as http]
[clojure.data.json :as json]
[clojure.tools.logging :as log])
(:import [java.net URLEncoder]))
(defn verify-api-url
[connection]
(assert
(and (string? (:api-url connection))
(and (not (empty? (:api-url connection)))
(not ... | null | https://raw.githubusercontent.com/julienXX/clj-slack/ff5649161646f11dd8d52d1315c0e74dc723eeb7/src/clj_slack/core.clj | clojure | (ns clj-slack.core
(:require
[clj-http.client :as http]
[clojure.data.json :as json]
[clojure.tools.logging :as log])
(:import [java.net URLEncoder]))
(defn verify-api-url
[connection]
(assert
(and (string? (:api-url connection))
(and (not (empty? (:api-url connection)))
(not ... | |
2a85e5d62a5923ff081ac10a25252439036c83ef183f74d5581e8c054b49d7b5 | tsloughter/kuberl | kuberl_v1beta1_cron_job_list.erl | -module(kuberl_v1beta1_cron_job_list).
-export([encode/1]).
-export_type([kuberl_v1beta1_cron_job_list/0]).
-type kuberl_v1beta1_cron_job_list() ::
#{ 'apiVersion' => binary(),
'items' := list(),
'kind' => binary(),
'metadata' => kuberl_v1_list_meta:kuberl_v1_list_meta()
}.
encode(#{ '... | null | https://raw.githubusercontent.com/tsloughter/kuberl/f02ae6680d6ea5db6e8b6c7acbee8c4f9df482e2/gen/kuberl_v1beta1_cron_job_list.erl | erlang | -module(kuberl_v1beta1_cron_job_list).
-export([encode/1]).
-export_type([kuberl_v1beta1_cron_job_list/0]).
-type kuberl_v1beta1_cron_job_list() ::
#{ 'apiVersion' => binary(),
'items' := list(),
'kind' => binary(),
'metadata' => kuberl_v1_list_meta:kuberl_v1_list_meta()
}.
encode(#{ '... | |
dd8bbba1d68782c797e74e4b36412943edd40f3fa94336c8ac4142a7a5b01124 | cstar/ec2nodefinder | ec2nodefindersrv.erl | %% @hidden
%% @doc ec2-describe-instances based node discovery service.
%% @end
-module (ec2nodefindersrv).
-behaviour (gen_server).
-export ([ start_link/4, discover/0 ]).
-export ([ init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3]... | null | https://raw.githubusercontent.com/cstar/ec2nodefinder/42534509b88120d5581ad4a4e822bb806f3b950f/src/ec2nodefindersrv.erl | erlang | @hidden
@doc ec2-describe-instances based node discovery service.
@end
-=====================================================================-
- Public -
-=====================================================================-
-=============================... |
-module (ec2nodefindersrv).
-behaviour (gen_server).
-export ([ start_link/4, discover/0 ]).
-export ([ init/1,
handle_call/3,
handle_cast/2,
handle_info/2,
terminate/2,
code_change/3]).
-record (state, { group,
ping_timeout,
a... |
ec6b4461088df15177dd32e84b351f6eb65add1145a9c6abb7926cde10b4af71 | ninjudd/clojure-protobuf | schema.clj | (ns flatland.protobuf.schema
(:use [flatland.useful.fn :only [fix]]
[clojure.string :only [lower-case]])
(:import (flatland.protobuf PersistentProtocolBufferMap
PersistentProtocolBufferMap$Def Extensions)
(com.google.protobuf Descriptors$Descriptor
... | null | https://raw.githubusercontent.com/ninjudd/clojure-protobuf/63d7192b35c3941cdaf1e13219a933b9f3286aac/src/flatland/protobuf/schema.clj | clojure | (ns flatland.protobuf.schema
(:use [flatland.useful.fn :only [fix]]
[clojure.string :only [lower-case]])
(:import (flatland.protobuf PersistentProtocolBufferMap
PersistentProtocolBufferMap$Def Extensions)
(com.google.protobuf Descriptors$Descriptor
... | |
65fd7f12de3c0bac1499d370c90836104908d08789eb8868cdb41290c2beac15 | albertoruiz/easyVision | mineig.hs | {-# LANGUAGE RecordWildCards, TemplateHaskell #-}
import Vision.GUI
import Image.Processing
autoParam "DemoParam" ""
[ ("sigma","Float",realParam 3 0.1 10)
]
data Experiment = Experiment
{ σ :: Float
, orig :: Image RGB
, mono :: Image Float
, smooth :: Image Float
, grads :: Gr... | null | https://raw.githubusercontent.com/albertoruiz/easyVision/26bb2efaa676c902cecb12047560a09377a969f2/projects/examples/mineig.hs | haskell | # LANGUAGE RecordWildCards, TemplateHaskell #
t = l1 |-| l2
>>> observe "source" mono
>>> sMonitor "grayscale" sh |
import Vision.GUI
import Image.Processing
autoParam "DemoParam" ""
[ ("sigma","Float",realParam 3 0.1 10)
]
data Experiment = Experiment
{ σ :: Float
, orig :: Image RGB
, mono :: Image Float
, smooth :: Image Float
, grads :: Grads
, e1 :: Image Float
, e2 :: Im... |
065ba59b280d8e13f20f60ac8ee05e437df4c601a754db529c28901c246e2751 | alphagov/govuk-guix | cuirass-specifications.scm | (define-module (gds build-jobs govuk cuirass-specifications)
#:export (govuk-packages))
(define govuk-packages
`((#:name . "govuk-packages")
(#:url . "govuk-guix")
(#:load-path . ".")
(#:file . "gds/build-jobs/cuirass-entry-point.scm")
(#:proc . govuk-packages-jobs)
(#:arguments . ())
(#:br... | null | https://raw.githubusercontent.com/alphagov/govuk-guix/dea8c26d2ae882d0278be5c745e23abb25d4a4e2/gds/build-jobs/govuk/cuirass-specifications.scm | scheme | (define-module (gds build-jobs govuk cuirass-specifications)
#:export (govuk-packages))
(define govuk-packages
`((#:name . "govuk-packages")
(#:url . "govuk-guix")
(#:load-path . ".")
(#:file . "gds/build-jobs/cuirass-entry-point.scm")
(#:proc . govuk-packages-jobs)
(#:arguments . ())
(#:br... | |
24a9bf0152c1f1393513a8e822f923a049cb6d12e35550ac5014d1f3c454457d | rescript-lang/syntax | obj.mli | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/rescript-lang/syntax/891fe05b88be2aa4443a951a0d16088b69b2e279/compiler-libs-406/obj.mli | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
type t
external repr : 'a -> t = "%identity"
external obj : t -> 'a = "%identity"
external magic : 'a -... |
3b7970b2ec06ca721e9cc65e84ff7aa4cadfce2839b4b6e52ef0ffea0e774f9d | rowangithub/DOrder | 416_repeat.ml | (*
USED: PLDI2011 as repeat
*)
let succ x = x + 1
let rec repeat (f:int->int) n s =
if n = 0 then
s
else
f (repeat f (n-1) s)
let main n = assert (repeat succ n 0 = n)
| null | https://raw.githubusercontent.com/rowangithub/DOrder/e0d5efeb8853d2a51cc4796d7db0f8be3185d7df/tests/mochi2/benchs/416_repeat.ml | ocaml |
USED: PLDI2011 as repeat
|
let succ x = x + 1
let rec repeat (f:int->int) n s =
if n = 0 then
s
else
f (repeat f (n-1) s)
let main n = assert (repeat succ n 0 = n)
|
c9cc8c064e4e55367c7b01104c5df67f9c12aed893a75a5b98b21a56d96c7f42 | Decentralized-Pictures/T4L3NT | client_proto_contracts.ml | (*****************************************************************************)
(* *)
(* Open Source License *)
Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
(* ... | null | https://raw.githubusercontent.com/Decentralized-Pictures/T4L3NT/6d4d3edb2d73575384282ad5a633518cba3d29e3/src/proto_alpha/lib_client/client_proto_contracts.ml | ocaml | ***************************************************************************
Open Source License
Permission is h... | Copyright ( c ) 2018 Dynamic Ledger Solutions , Inc. < >
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EXPRESS OR
LIABILITY , WHETH... |
bb1585ae94a00c664b83dd25f51d2df9aca180505318bbd67a4cb55d23dbe254 | projectcs13/sensor-cloud | plus_srv.erl | %%%-------------------------------------------------------------------
File : plus_srv.erl
@author
2012 Google
%%% @doc Example code on interacting with the discovery API
%%%
%%% @end
%%%
@since 2012 - 11 - 05
%%%-------------------------------------------------------------------
-module(plus_srv)... | null | https://raw.githubusercontent.com/projectcs13/sensor-cloud/0302bd74b2e62fddbd832fb4c7a27b9c62852b90/src/plus_srv.erl | erlang | -------------------------------------------------------------------
@doc Example code on interacting with the discovery API
@end
-------------------------------------------------------------------
API
gen_server callbacks
====================================================================
API
=================... | File : plus_srv.erl
@author
2012 Google
@since 2012 - 11 - 05
-module(plus_srv).
-author('Ian Barber').
-behaviour(gen_server).
-export([start_link/4,list_apis/0,set_api/1,call_method/3,
list_methods/0,list_scopes/1,gen_token_url/1,exchange_token/2,get_url/1]).
-export([init/1, handle_ca... |
4d69cac077bf58d89071fdb494f0b20a274f19e90be1231a8ddaf4ac101153d4 | ghcjs/ghcjs-dom | IDBIndex.hs | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
-- For HasCallStack compatibility
{-# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #-}
module GHCJS.DOM.JSFFI.Generated.IDBIndex
(js_openCursorRange, openCursorRange, openCursorRange_,
js_openCursor,... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Generated/IDBIndex.hs | haskell | For HasCallStack compatibility
# LANGUAGE ImplicitParams, ConstraintKinds, KindSignatures #
| <-US/docs/Web/API/IDBIndex.openKeyCursor Mozilla IDBIndex.openKeyCursor documentation>
| <-US/docs/Web/API/IDBIndex.openKeyCursor Mozilla IDBIndex.openKeyCursor documentation>
| <-US/docs/Web/API/IDBIndex.openKeyCursor M... | # LANGUAGE PatternSynonyms #
# LANGUAGE ForeignFunctionInterface #
# LANGUAGE JavaScriptFFI #
module GHCJS.DOM.JSFFI.Generated.IDBIndex
(js_openCursorRange, openCursorRange, openCursorRange_,
js_openCursor, openCursor, openCursor_, js_openKeyCursorRange,
openKeyCursorRange, openKeyCursorRange_, j... |
6338b125c335b6d6867121904035fd3e813157b6032e7c0844c9982340af1305 | tarides/dune-release | github_v4_api.mli | open Bos_setup
val with_auth : token:string -> Curl.t -> Curl.t
module Pull_request : sig
module Request : sig
val node_id : user:string -> repo:string -> id:int -> Curl.t
val ready_for_review : node_id:string -> Curl.t
end
module Response : sig
val node_id : Yojson.Basic.t -> (string, R.msg) resul... | null | https://raw.githubusercontent.com/tarides/dune-release/6bfed0f299b82c0931c78d4e216fd0efedff0673/lib/github_v4_api.mli | ocaml | open Bos_setup
val with_auth : token:string -> Curl.t -> Curl.t
module Pull_request : sig
module Request : sig
val node_id : user:string -> repo:string -> id:int -> Curl.t
val ready_for_review : node_id:string -> Curl.t
end
module Response : sig
val node_id : Yojson.Basic.t -> (string, R.msg) resul... | |
94f43dbf6f462687c217f4adbbc85dee91219458755e05cef95c76bc8f7cb80a | hugoduncan/makejack | fs.clj | (ns hooks.fs
(:require
[clj-kondo.hooks-api :as api]))
(defn with-binding
"A form that has a first vector argument and a body.
The first element of the vector is considered a binding. Other
elements are evaluated."
[{:keys [node]}]
(let [[_ binding-vec & body] (:children node)
[binding & others... | null | https://raw.githubusercontent.com/hugoduncan/makejack/9676516be89b36295477bb59e26e09b8c9916597/components/filesystem/resources/clj-kondo.exports/org.hugoduncan/makejack-filesystem/hooks/fs.clj | clojure | (ns hooks.fs
(:require
[clj-kondo.hooks-api :as api]))
(defn with-binding
"A form that has a first vector argument and a body.
The first element of the vector is considered a binding. Other
elements are evaluated."
[{:keys [node]}]
(let [[_ binding-vec & body] (:children node)
[binding & others... | |
3a07bef508ab220a3a473f8f3b52d4c5d2960a74bee1038c670969d0c9022f9b | Wizek/hs-di | NotSoEasyToTestCode.hs | # language NoMonomorphismRestriction #
# language TemplateHaskell #
module NotSoEasyToTestCode where
import DI
import System.IO
import Data.IORef
import Control.Monad
import Data.Time
injLeaf "putStrLn"
injLeaf "getCurrentTime"
inj
makeTimer putStrLn getCurrentTime = liftIO $ do
prevTime <- newIORef Nothing
r... | null | https://raw.githubusercontent.com/Wizek/hs-di/4e7d11f4341a155667cb856b6f231d7b6af2c935/test/NotSoEasyToTestCode.hs | haskell | Dep "makeTimer" [Dep "putStrLn" [], Dep "getCurrentTime" []]
makeTimer' = let (f, a, b) = a in f a b
Dep "makeTimer" [Dep "putStrLn" [], Dep "getCurrentTime" [], Dep "foo" [Dep "bar" []]]
makeTimer' = let (f, a, b, (g, d)) = a in f a b (g d) | # language NoMonomorphismRestriction #
# language TemplateHaskell #
module NotSoEasyToTestCode where
import DI
import System.IO
import Data.IORef
import Control.Monad
import Data.Time
injLeaf "putStrLn"
injLeaf "getCurrentTime"
inj
makeTimer putStrLn getCurrentTime = liftIO $ do
prevTime <- newIORef Nothing
r... |
d07fd020c6551cf7a0328750e6f6b01a57e46fc85fbc97ef9cbab9237911f701 | infinisil/nixbot | NixEval.hs | {-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
module NixEval ( nixInstantiate
, NixOptions(..)
, unsetNixOptions
, EvalMode(..)
, NixEvalOptions(..)
, defNixEvalOptions
, outputTransform
) wh... | null | https://raw.githubusercontent.com/infinisil/nixbot/e8695fd73c07bc115ee0dd3e7c121cd985c04c06/src/NixEval.hs | haskell | # LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings # | module NixEval ( nixInstantiate
, NixOptions(..)
, unsetNixOptions
, EvalMode(..)
, NixEvalOptions(..)
, defNixEvalOptions
, outputTransform
) where
import Data.ByteString.Lazy (ByteString)
import ... |
72b2f03242f124bb1c33d6beedaa132fdbe5fd452ac6e6ad1f4889bcbf0609e9 | TrustInSoft/tis-interpreter | eval_exprs.mli | Modified by TrustInSoft
(**************************************************************************)
(* *)
This file is part of Frama - C.
(* ... | null | https://raw.githubusercontent.com/TrustInSoft/tis-interpreter/33132ce4a825494ea48bf2dd6fd03a56b62cc5c3/src/plugins/value/legacy/eval_exprs.mli | 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... |
fa91f908f52cec1c436a3ba3eb8f807697df1617742c111a2f59ca5c71917769 | dgtized/shimmers | brush_sweep.cljs | (ns shimmers.sketches.brush-sweep
(:require
[quil.core :as q :include-macros true]
[quil.middleware :as m]
[shimmers.common.framerate :as framerate]
[shimmers.common.quil :as cq]
[shimmers.sketch :as sketch :include-macros true]
[thi.ng.geom.core :as g]
[thi.ng.geom.line :as gl]
[thi.ng.geom.t... | null | https://raw.githubusercontent.com/dgtized/shimmers/f096c20d7ebcb9796c7830efcd7e3f24767a46db/src/shimmers/sketches/brush_sweep.cljs | clojure | (ns shimmers.sketches.brush-sweep
(:require
[quil.core :as q :include-macros true]
[quil.middleware :as m]
[shimmers.common.framerate :as framerate]
[shimmers.common.quil :as cq]
[shimmers.sketch :as sketch :include-macros true]
[thi.ng.geom.core :as g]
[thi.ng.geom.line :as gl]
[thi.ng.geom.t... | |
d2cb3ac1621671da55790810f2dd0ae6f2cf853291deca77392a92bc3c0cf112 | rm-hull/project-euler | euler003.clj | EULER # 003
;; ==========
;; Find the largest prime factor of a composite number.
;;
The prime factors of 13195 are 5 , 7 , 13 and 29 .
;;
What is the largest prime factor of the number 600,851,475,143 ?
;;
(ns euler003
(:use [util.primes]))
(prime-factors-of 13195)
(time (sort (prime-factors-of 6008514751... | null | https://raw.githubusercontent.com/rm-hull/project-euler/04e689e87a1844cfd83229bb4628051e3ac6a325/src/euler003.clj | clojure | ==========
Find the largest prime factor of a composite number.
| EULER # 003
The prime factors of 13195 are 5 , 7 , 13 and 29 .
What is the largest prime factor of the number 600,851,475,143 ?
(ns euler003
(:use [util.primes]))
(prime-factors-of 13195)
(time (sort (prime-factors-of 600851475143)))
|
ec00590070e103a67decea81d28736569210a364d6bbd9c8aefbc8f2856cf59f | eval/deps-try | sexp_test.clj | (ns rebel-readline.clojure.sexp-test
(:require
[rebel-readline.clojure.tokenizer :as tokenize]
[rebel-readline.clojure.sexp :refer :all]
[clojure.test :refer [deftest is are testing]]))
(defn find-open [sexp pos]
(find-open-sexp-start (tokenize/tag-sexp-traversal sexp) pos))
(def find-open-pos (comp seco... | null | https://raw.githubusercontent.com/eval/deps-try/da691c68b527ad5f9e770dbad82cce6cbbe16fb4/vendor/rebel-readline/rebel-readline/test/rebel_readline/clojure/sexp_test.clj | clojure | position is a cursor position
more complex example
position is a cursor position
more complex example | (ns rebel-readline.clojure.sexp-test
(:require
[rebel-readline.clojure.tokenizer :as tokenize]
[rebel-readline.clojure.sexp :refer :all]
[clojure.test :refer [deftest is are testing]]))
(defn find-open [sexp pos]
(find-open-sexp-start (tokenize/tag-sexp-traversal sexp) pos))
(def find-open-pos (comp seco... |
f5db59c27c3b958d72c36e84135261f0cca44c947c743d4108854aa95565211f | fetburner/Coq2SML | gmap.ml | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2014
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/fetburner/Coq2SML/322d613619edbb62edafa999bff24b1993f37612/coq-8.4pl4/lib/gmap.ml | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
Maintien de fold_right par compatib... | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * INRIA - CNRS - LIX - LRI - PPS - Copyright 1999 - 2014
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
Maps using the generic comp... |
e7e41c6de50f3f7953000d359bedac448e91baf57aeeccfbe2aac2455210764a | Rotaerk/vulkanTest | DescriptorSetLayout.hs | module Graphics.VulkanAux.DescriptorSetLayout where
import Data.Reflection
import Graphics.Vulkan.Core_1_0
import Graphics.Vulkan.Marshal.Create
import Graphics.VulkanAux.Resource
vkaDescriptorSetLayoutResource :: Given VkDevice => VkaResource VkDescriptorSetLayoutCreateInfo VkDescriptorSetLayout
vkaDescriptorSetLayo... | null | https://raw.githubusercontent.com/Rotaerk/vulkanTest/beafd3cc27ba60561b9e76cd0058e30949a5affb/sandbox/sandbox/src/Graphics/VulkanAux/DescriptorSetLayout.hs | haskell | module Graphics.VulkanAux.DescriptorSetLayout where
import Data.Reflection
import Graphics.Vulkan.Core_1_0
import Graphics.Vulkan.Marshal.Create
import Graphics.VulkanAux.Resource
vkaDescriptorSetLayoutResource :: Given VkDevice => VkaResource VkDescriptorSetLayoutCreateInfo VkDescriptorSetLayout
vkaDescriptorSetLayo... | |
1728a702af90f0aa77e16d822d859a3850def025520f6846f0e63cc3aa5acfcf | brendanhay/amazonka | ListContents.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE RecordWildCards #
{-# LANGUAGE StrictData #-}
# LANGUAGE TypeFamilies #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - binds #
# OPTIONS_GHC -fno - warn - unused -... | null | https://raw.githubusercontent.com/brendanhay/amazonka/09f52b75d2cfdff221b439280d3279d22690d6a6/lib/services/amazonka-wisdom/gen/Amazonka/Wisdom/ListContents.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
Lists the content.
This operation returns paginated results.
* Creating a Request
* Request Lenses
* Destructuring the Response
* Response Lenses
| /See:/ 'newListContents' smart constructor.
| The maximum number of result... | # LANGUAGE DeriveGeneric #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE NoImplicitPrelude #
# OPTIONS_GHC -fno - warn - unused - binds #
# OPTIONS_GHC -fno - warn - unused - imports #
# OPTIONS_GHC -fno - warn - unused - matches #
De... |
206fd81bc31d195ae36484210e6e290b2870cf39828d491211aab781604c50e6 | cyverse-archive/DiscoveryEnvironmentBackend | app_metadata.clj | (ns metadactyl.persistence.app-metadata
"Persistence layer for app metadata."
(:use [kameleon.entities]
[kameleon.uuids :only [uuidify]]
[korma.core :exclude [update]]
[korma.db :only [transaction]]
[metadactyl.user :only [current-user]]
[metadactyl.util.assertions]
[... | null | https://raw.githubusercontent.com/cyverse-archive/DiscoveryEnvironmentBackend/7f6177078c1a1cb6d11e62f12cfe2e22d669635b/services/metadactyl-clj/src/metadactyl/persistence/app_metadata.clj | clojure | (ns metadactyl.persistence.app-metadata
"Persistence layer for app metadata."
(:use [kameleon.entities]
[kameleon.uuids :only [uuidify]]
[korma.core :exclude [update]]
[korma.db :only [transaction]]
[metadactyl.user :only [current-user]]
[metadactyl.util.assertions]
[... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.