_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 |
|---|---|---|---|---|---|---|---|---|
b4ed2422ddde2288cfaed7fe818de1156c62f17f6ccaa40696c9022acfec0229 | geneweb/geneweb | consangAll.ml | Copyright ( c ) 1998 - 2007 INRIA
open Gwdb
let rec clear_descend_consang base consang mark =
* let des = foi base ifam in
* Array.iter
* ( fun ip - >
* if not ( Gwdb.Marker.get mark ip ) then
* begin
* consang ip Adef.no_consang ;
* Gwdb.... | null | https://raw.githubusercontent.com/geneweb/geneweb/747f43da396a706bd1da60d34c04493a190edf0f/lib/core/consangAll.ml | ocaml | number of persons which need consanguinity to be computed
if person's consanguinity wasn't calculated
if person has parents
if parent's family's consanguinity wasn't calculated
if parent's consanguinity was calculated
if it wasn't makes further another run over persons
if it was then set to person his fami... | Copyright ( c ) 1998 - 2007 INRIA
open Gwdb
let rec clear_descend_consang base consang mark =
* let des = foi base ifam in
* Array.iter
* ( fun ip - >
* if not ( Gwdb.Marker.get mark ip ) then
* begin
* consang ip Adef.no_consang ;
* Gwdb.... |
7f3cd0fd0a1f862a48e6f818203aef704628b90c0fac98326ae3128c4ce1457d | uswitch/speculate | extract.clj | (ns speculate.transform.extract
(:refer-clojure :exclude [alias *])
(:require
[clojure.pprint :refer [pprint]]
[clojure.set :as set]
[clojure.spec.alpha :as s]
[clojure.spec.override]
[speculate.ast :as ast]
[speculate.util :as util]
[speculate.transform.state :as state]
[clojure.string :as ... | null | https://raw.githubusercontent.com/uswitch/speculate/9e02ec77c770bec94a71008d03806907bb86d3de/src/speculate/transform/extract.clj | clojure | (ns speculate.transform.extract
(:refer-clojure :exclude [alias *])
(:require
[clojure.pprint :refer [pprint]]
[clojure.set :as set]
[clojure.spec.alpha :as s]
[clojure.spec.override]
[speculate.ast :as ast]
[speculate.util :as util]
[speculate.transform.state :as state]
[clojure.string :as ... | |
e254de3b208770701aefd82adcb9406607ee1c40df81ce23c1abaefef93a5cce | sacerdot/CovidMonitoring | avvio.erl | -module(avvio).
-export([avvio/0, start/0]).
Il file è stato creato per compilare e i nodi
per l'esecuzione dell'intero progetto .
avvio () ->
compile:file(server),
compile:file(ospedale),
compile:file(luogo),
compile:file(utente).
sleep(N)->
receive
after N->ok
end.
start()-> ... | null | https://raw.githubusercontent.com/sacerdot/CovidMonitoring/fe969cd51869bbe6479da509c9a6ab21d43e6d11/RanalliRegiaCorte/avvio.erl | erlang | -module(avvio).
-export([avvio/0, start/0]).
Il file è stato creato per compilare e i nodi
per l'esecuzione dell'intero progetto .
avvio () ->
compile:file(server),
compile:file(ospedale),
compile:file(luogo),
compile:file(utente).
sleep(N)->
receive
after N->ok
end.
start()-> ... | |
8b753b3d5a1c9f571823b2685619879f5859d008ba13abd30636fe2b752ddd5d | softlab-ntua/bencherl | im_bench.erl | -module(im_bench).
-export([bench_args/2, run/3]).
bench_args(Vsn, Conf) ->
{ _, Slaves } = lists:keyfind(slaves, 1, Conf),
ClientNodes = filter_nodes(Slaves, "client"),
Ratio =
case Vsn of
short -> 5000;
intermediate -> 10000;
long -> 15000
end,
ClientProcs =
... | null | https://raw.githubusercontent.com/softlab-ntua/bencherl/317bdbf348def0b2f9ed32cb6621e21083b7e0ca/bench/im_bench/src/im_bench.erl | erlang | Setup a coordinator to know when the benchmark finished. This is done by
counting the number of loggers that have finished.
Get the data dir in order to store the .csv output files there.
Get the benchmark arguments from the configuration.
Start the benchmark on the different client domains.
XXX: Just to make sure... | -module(im_bench).
-export([bench_args/2, run/3]).
bench_args(Vsn, Conf) ->
{ _, Slaves } = lists:keyfind(slaves, 1, Conf),
ClientNodes = filter_nodes(Slaves, "client"),
Ratio =
case Vsn of
short -> 5000;
intermediate -> 10000;
long -> 15000
end,
ClientProcs =
... |
c9e8138390ef2969a73a77f648f9cbc959a351fa9b1a1fca5446122da91782b0 | nklein/grid-generators | run.lisp | ;;;; run.lisp
(in-package #:grid-generators-tests)
(defun run-all-tests (&key (debug-on-error nst:*debug-on-error*)
(debug-on-fail nst:*debug-on-fail*))
(let ((nst:*debug-on-error* debug-on-error)
(nst:*debug-on-fail* debug-on-fail))
(nst:nst-cmd :run-package #.*package*)))
| null | https://raw.githubusercontent.com/nklein/grid-generators/5f7b790c339123f84710d907ddafdb52c160d44e/test/run.lisp | lisp | run.lisp |
(in-package #:grid-generators-tests)
(defun run-all-tests (&key (debug-on-error nst:*debug-on-error*)
(debug-on-fail nst:*debug-on-fail*))
(let ((nst:*debug-on-error* debug-on-error)
(nst:*debug-on-fail* debug-on-fail))
(nst:nst-cmd :run-package #.*package*)))
|
cb0dfc28cc8d622717c8ffe92e6808fb1aba41d1d6ad7a369ace6ed8dbcb9b53 | Apress/practical-common-lisp-11 | macro-utilities.lisp | (in-package :com.gigamonkeys.macro-utilities)
(defmacro with-gensyms ((&rest names) &body body)
`(let ,(loop for n in names collect `(,n (make-symbol ,(string n))))
,@body))
(defmacro once-only ((&rest names) &body body)
(let ((gensyms (loop for n in names collect (gensym (string n)))))
`(let (,@(loop fo... | null | https://raw.githubusercontent.com/Apress/practical-common-lisp-11/3e36d8b02b7f0731ad36c31cbbf01f9de0acf003/practicals/Chapter08/macro-utilities.lisp | lisp | (in-package :com.gigamonkeys.macro-utilities)
(defmacro with-gensyms ((&rest names) &body body)
`(let ,(loop for n in names collect `(,n (make-symbol ,(string n))))
,@body))
(defmacro once-only ((&rest names) &body body)
(let ((gensyms (loop for n in names collect (gensym (string n)))))
`(let (,@(loop fo... | |
f7c9eb2b7910f990598011c7958e6542bd495a758c3df8f54781539557f90e78 | cgaebel/stm-conduit | Async.hs | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE PackageImports #-}
# LANGUAGE TupleSections #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE RecordWildCards #
-- | * Introduction
--
-- Contain combinators for concurrently joining conduits, such that
-- the producing side may continue to produce (up to the queu... | null | https://raw.githubusercontent.com/cgaebel/stm-conduit/f8710fcc8d4bcbe479a46d9bbb21d26b58feca74/Data/Conduit/Async.hs | haskell | # LANGUAGE PackageImports #
# LANGUAGE RankNTypes #
| * Introduction
Contain combinators for concurrently joining conduits, such that
the producing side may continue to produce (up to the queue size)
as the consumer is concurrently consuming.
| Gather output values asynchronously from an action in the base ... | # LANGUAGE CPP #
# LANGUAGE FlexibleContexts #
# LANGUAGE TupleSections #
# LANGUAGE RecordWildCards #
module Data.Conduit.Async ( module Data.Conduit.Async.Composition
, gatherFrom
, drainTo
) where
import Control.Monad.IO.Class
import Con... |
1939864c624c2caacea9e59b67287e8f40b152afa5e4166711eb5bbb35c103fd | ericcervin/getting-started-with-sketching | pg009.rkt | #lang sketching
(define (setup)
(size 480 120)
(smoothing 'smoothed))
(define (draw)
(cond
[mouse-pressed (fill 0)]
[else (fill 255)])
(ellipse mouse-x mouse-y 80 80)
)
| null | https://raw.githubusercontent.com/ericcervin/getting-started-with-sketching/1a387c52e9c66d684297fe776291604649abc5de/pg009.rkt | racket | #lang sketching
(define (setup)
(size 480 120)
(smoothing 'smoothed))
(define (draw)
(cond
[mouse-pressed (fill 0)]
[else (fill 255)])
(ellipse mouse-x mouse-y 80 80)
)
| |
f5e9e972f7067e64b14c81f2feb19909715edf763b005c7eb0abfa4dfcdec2e0 | kayceesrk/Quelea | Rubis_strong.hs | # LANGUAGE TemplateHaskell , ScopedTypeVariables , CPP #
import Quelea.Shim
import Quelea.ClientMonad
import Quelea.DBDriver
import Quelea.Contract
import Control.Concurrent (ThreadId, myThreadId, forkIO, threadDelay, killThread)
import Quelea.NameService.Types
import Quelea.Types (summarize)
import Quelea.Marshall
im... | null | https://raw.githubusercontent.com/kayceesrk/Quelea/73db79a5d5513b9aeeb475867a67bacb6a5313d0/tests/Rubis/Rubis_strong.hs | haskell | #define DEBUG
------------------------------------------------------------------------------
------------------------------------------------------------------------------
Kind of process
Broker's address
Daemon Options
--------------
Client Options
--------------
Number of concurrent client threads
Number... | # LANGUAGE TemplateHaskell , ScopedTypeVariables , CPP #
import Quelea.Shim
import Quelea.ClientMonad
import Quelea.DBDriver
import Quelea.Contract
import Control.Concurrent (ThreadId, myThreadId, forkIO, threadDelay, killThread)
import Quelea.NameService.Types
import Quelea.Types (summarize)
import Quelea.Marshall
im... |
98bc25c60492cd71c6c70d9c847a21f5b9ef9af8feb798bdcf218ad1afa1cf02 | LLazarek/mutate | mutate-program.rkt | #lang at-exp racket/base
(require racket/stream
ruinit
mutate
mutate/traversal
mutate/private/mutate-program
mutate/private/mutated
"testing-util.rkt")
(define-id-mutator plus-swap
[+ #:-> -])
(define em (make-expr-mutator plus-swap))
(test-begin
#:name make-... | null | https://raw.githubusercontent.com/LLazarek/mutate/8d3af6afb53b4f725e7a81a515403efad88a52e5/mutate-test/tests/mutate-program.rkt | racket | #lang at-exp racket/base
(require racket/stream
ruinit
mutate
mutate/traversal
mutate/private/mutate-program
mutate/private/mutated
"testing-util.rkt")
(define-id-mutator plus-swap
[+ #:-> -])
(define em (make-expr-mutator plus-swap))
(test-begin
#:name make-... | |
a97771bdf629ee143182042254f69772e910167cc6b1c9260abe95185dcdeb21 | rroohhh/guix_system | network-utils.scm |
(define-module (config network-utils)
#:use-module (config network)
#:use-module (guix gexp)
#:use-module ((services networking) #:prefix svc:)
#:export (networking-for etc-hosts-file))
(define* (networking-for host)
(svc:networking-for host network-config))
(define etc-hosts-file
(let* ((hosts (assoc-re... | null | https://raw.githubusercontent.com/rroohhh/guix_system/f126f17c309c4e4ead963f6cff9f9d2780ae5dae/config/network-utils.scm | scheme |
(define-module (config network-utils)
#:use-module (config network)
#:use-module (guix gexp)
#:use-module ((services networking) #:prefix svc:)
#:export (networking-for etc-hosts-file))
(define* (networking-for host)
(svc:networking-for host network-config))
(define etc-hosts-file
(let* ((hosts (assoc-re... | |
1a9f76527a085f683d18e8d0aec48f45d797f32e05f6fd8ff314acb24829858c | shirok/Gauche | redefutil.scm | ;;;
;;; redefutil.scm - class redefinition protocol (autoloaded)
;;;
Copyright ( c ) 2003 - 2022 < >
;;;
;;; Redistribution and use in source and binary forms, with or without
;;; modification, are permitted provided that the following conditions
;;; are met:
;;;
;;; 1. Redistributions of source code... | null | https://raw.githubusercontent.com/shirok/Gauche/6d15c99ee46aee9d22d77164e575fa22673848fe/lib/gauche/redefutil.scm | scheme |
redefutil.scm - class redefinition protocol (autoloaded)
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
1. Redistributions of source code must retain the above copyright
notice, this list of conditions... | Copyright ( c ) 2003 - 2022 < >
" AS IS " AND ANY EXPRESS OR IMPLIED WARRANTIES , INCLUDING , BUT NOT
SPECIAL , EXEMPLARY , OR CONSEQUENTIAL DAMAGES ( INCLUDING , BUT NOT LIMITED
LIABILITY , WHETHER IN CONTRACT , STRICT LIABILITY , OR TORT ( INCLUDING
(select-module gauche.object)
(define (r... |
47ab5d3b75d0875a22e9880dd25901d24922a42da9f3befc8fb948bdb7a0cb0c | tisnik/clojure-examples | core_test.clj | ;
( C ) Copyright 2016 , 2020 , 2021
;
; All rights reserved. This program and the accompanying materials
; are made available under the terms of the Eclipse Public License v1.0
; which accompanies this distribution, and is available at
-v10.html
;
; Contributors:
;
(ns topic-constructor.core-te... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/a5f9d6119b62520b05da64b7929d07b832b957ab/kafka-topic-constructor-10-partitions/test/topic_constructor/core_test.clj | clojure |
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
Contributors:
| ( C ) Copyright 2016 , 2020 , 2021
-v10.html
(ns topic-constructor.core-test
(:require [clojure.test :refer :all]
[topic-constructor.core :refer :all]))
(deftest a-test
(testing "FIXME, I fail."
(is (= 0 1))))
|
138787d5e2d647fb9ab6b072007bcac6136d7dd3e3519b28d073b8e3edf6a78e | ndmitchell/hlint | Pragma.hs | # LANGUAGE ViewPatterns #
# LANGUAGE FlexibleContexts #
Suggest better pragmas
OPTIONS_GHC -cpp = > LANGUAGE CPP
OPTIONS_GHC = > LANGUAGE ... ( in HSE )
OPTIONS_GHC -XFoo = > LANGUAGE Foo
LANGUAGE A , A = > LANGUAGE A
-- do not do LANGUAGE A , LANGUAGE B to combine
< TEST >
... | null | https://raw.githubusercontent.com/ndmitchell/hlint/d06148be027179469333a892294fb7a90b9ea51c/src/Hint/Pragma.hs | haskell | do not do LANGUAGE A , LANGUAGE B to combine
do not do LANGUAGE A, LANGUAGE B to combine
Given a pragma, can you extract some language features out?
'langexts' a list of all language extensions in the module enabled
by 'LANGUAGE' pragmas.
If ALL of the flags in the pragma enable language extensions,
'return N... | # LANGUAGE ViewPatterns #
# LANGUAGE FlexibleContexts #
Suggest better pragmas
OPTIONS_GHC -cpp = > LANGUAGE CPP
OPTIONS_GHC = > LANGUAGE ... ( in HSE )
OPTIONS_GHC -XFoo = > LANGUAGE Foo
LANGUAGE A , A = > LANGUAGE A
< TEST >
{ - # OPTIONS_GHC -cpp #
Suggest better pragmas
... |
29f1e42b8d21d6222d1c384d0a6f9f76156a1e589ca07e9b73795d5570a019cf | igrishaev/book-sessions | server.clj | (ns book.systems.comp.server
(:require
[com.stuartsierra.component :as component]
[book.systems.comp.db :as db]
[ring.adapter.jetty :refer [run-jetty]]))
(def app (constantly {:status 200 :body "Hello"}))
#_
(defn app
[request]
{:status 200
:body (with-out-str
(clojure.pprint/pprint reque... | null | https://raw.githubusercontent.com/igrishaev/book-sessions/c62af1230e91b8ab9e4e456798e894d1b4145dfc/src/book/systems/comp/server.clj | clojure | (def c1 (component/start c0))
(def c2 (component/stop c1))
(def s-started (component/start s-created))
(def s-stopped (component/stop s-started))
(def bs-started (component/start bs-created))
git : 27208684755d94a92186989f695db2d7b21ebc51 ; jvm 1.8.0_102 - b14 | (ns book.systems.comp.server
(:require
[com.stuartsierra.component :as component]
[book.systems.comp.db :as db]
[ring.adapter.jetty :refer [run-jetty]]))
(def app (constantly {:status 200 :body "Hello"}))
#_
(defn app
[request]
{:status 200
:body (with-out-str
(clojure.pprint/pprint reque... |
3eb68728ff7f8dc2252f3b04f83321856cf9c8b5e137c501b93e9b7253f356a4 | input-output-hk/cardano-ledger-byron | TxAux.hs | {-# LANGUAGE DeriveAnyClass #-}
{-# LANGUAGE DeriveFunctor #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TemplateHaskell #-}
# LANGUAGE TypeApplications #
{-# LANGUAGE... | null | https://raw.githubusercontent.com/input-output-hk/cardano-ledger-byron/d309449e6c303a9f0dcc8dcf172df6f0b3195ed5/cardano-ledger/src/Cardano/Chain/UTxO/TxAux.hs | haskell | # LANGUAGE DeriveAnyClass #
# LANGUAGE DeriveFunctor #
# LANGUAGE OverloadedStrings #
# LANGUAGE TemplateHaskell #
# LANGUAGE TypeFamilies #
| Transaction + auxiliary data
Used for debugging purposes only | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE TypeApplications #
module Cardano.Chain.UTxO.TxAux
( TxAux
, ATxAux(..)
, mkTxAux
, annotateTxAux
, taTx
, taWitness
, txaF
)
where
import Cardano.Prelude
i... |
bcd188e928fed5590ce01827baf2589d352c5a82c5ec45f7a285627912b8402a | kappelmann/eidi2_repetitorium_tum | SparseVectorTest.ml | open SparseVector
let _ = if empty<>[] then failwith "Your empty method is not working correctly"
let v = [1;2;3;0;1;0;5;(-10)]
let v = sb_vektor v
let expected = [(0,1);(1,2);(2,3);(4,1);(6,5);(7,(-10))]
let b = v=expected
let _ = if not b then failwith "Your sb_vektor method is not working correctly"
let t = set 3 0... | null | https://raw.githubusercontent.com/kappelmann/eidi2_repetitorium_tum/1d16bbc498487a85960e0d83152249eb13944611/2016/sparse_vector/solutions/SparseVectorTest.ml | ocaml | open SparseVector
let _ = if empty<>[] then failwith "Your empty method is not working correctly"
let v = [1;2;3;0;1;0;5;(-10)]
let v = sb_vektor v
let expected = [(0,1);(1,2);(2,3);(4,1);(6,5);(7,(-10))]
let b = v=expected
let _ = if not b then failwith "Your sb_vektor method is not working correctly"
let t = set 3 0... | |
3d4ca837a6a9f76f28921080f257907993007438718214c80a14da2968493e16 | c-cube/frog-utils | IPC_daemon.ml |
(* This file is free software, part of frog-utils. See file "license" for more details. *)
* { 1 Daemon for Coordination }
open Frog
open Lwt.Infix
module M = IPC_message
module Int_map = Misc.Int_map
[@@@ocaml.warning "-32"]
type 'a or_error = ('a, string) Result.result
let main_config_file = "/etc/froglock.con... | null | https://raw.githubusercontent.com/c-cube/frog-utils/3f68c606a7abe702f9e22a0606080191a2952b18/src/server/IPC_daemon.ml | ocaml | This file is free software, part of frog-utils. See file "license" for more details.
connection to a client
unique client id
a given "lock" task
message received by client
check timeout and all that
for allocating client IDs
unique count for messages
c_id -> client
for scheduling tasks
reply to cli... |
* { 1 Daemon for Coordination }
open Frog
open Lwt.Infix
module M = IPC_message
module Int_map = Misc.Int_map
[@@@ocaml.warning "-32"]
type 'a or_error = ('a, string) Result.result
let main_config_file = "/etc/froglock.conf"
let section = Lwt_log.Section.make "ipc_daemon"
let default_port = 12_042
type uid = M... |
c7922ffbdef3789af40c996e1be491a3a59e1bedfc8d1a8de25b7e59dd0ff096 | geophf/1HaskellADay | Solution.hs | # LANGUAGE OverloadedStrings , QuasiQuotes , ViewPatterns #
module Y2017.M10.D03.Solution where
-
Today we 're going to look at the MemoizingTable - type .
What is the MemoizingTable - type ?
Well , it 's what we 're going to look at today !
( circular - reference much , geophf ?
me : what ? )
-
Today ... | null | https://raw.githubusercontent.com/geophf/1HaskellADay/514792071226cd1e2ba7640af942667b85601006/exercises/HAD/Y2017/M10/D03/Solution.hs | haskell | }
}
ISubj { subjIdx :: Integer, subject :: String }
}
So, since we have a Subject-type, we want also to have a class of values
from which we can extract subjects. This is called 'subject-oriented
programming.'
subjects is now Data.MemoizingTable.bifurcate
the two Map.fromList functions are DIFFERENT FUNCTIONS ! ... | # LANGUAGE OverloadedStrings , QuasiQuotes , ViewPatterns #
module Y2017.M10.D03.Solution where
-
Today we 're going to look at the MemoizingTable - type .
What is the MemoizingTable - type ?
Well , it 's what we 're going to look at today !
( circular - reference much , geophf ?
me : what ? )
-
Today ... |
1c08b513c73fa107cbeed92c0c6eda324eab26fbd5b517dc31f2298fc63c9df7 | mnemonic-no/act-scio | project.clj | (defproject scio-back "0.1.42-SNAPSHOT"
:description "Storing tweets and documents to alastic search for indexing."
:dependencies [[org.clojure/clojure "1.10.0"]
[org.apache.commons/commons-compress "1.18"] ;; "fix" for missing class in pantomime
[ org.apache.tika/tika-parsers " 1... | null | https://raw.githubusercontent.com/mnemonic-no/act-scio/bd2e2ccfa54c8a102748d37c79c1292abb63522b/project.clj | clojure | "fix" for missing class in pantomime | (defproject scio-back "0.1.42-SNAPSHOT"
:description "Storing tweets and documents to alastic search for indexing."
:dependencies [[org.clojure/clojure "1.10.0"]
[ org.apache.tika/tika-parsers " 1.16 " ]
[com.novemberain/pantomime "2.10.0"]
[info.debatty/java-spam... |
906c45b144d5521e8787eb47d41bf17b41af8b0b22a26b7c2a8c6391246fb7e0 | Liutos/cl-github-page | index.lisp | (in-package #:com.liutos.cl-github-page.category)
(defun add-category (name)
"新增一个分类"
(check-type name string)
(when (com.liutos.cl-github-page.storage:find-category-by-name name)
(error "分类已存在"))
(com.liutos.cl-github-page.storage:create-category name))
(defun find-by-name (name)
"查找一个同名分类。"
(check-t... | null | https://raw.githubusercontent.com/Liutos/cl-github-page/336e4ad925c95969a8686ea2267099f49c1e01a6/src/category/index.lisp | lisp | (in-package #:com.liutos.cl-github-page.category)
(defun add-category (name)
"新增一个分类"
(check-type name string)
(when (com.liutos.cl-github-page.storage:find-category-by-name name)
(error "分类已存在"))
(com.liutos.cl-github-page.storage:create-category name))
(defun find-by-name (name)
"查找一个同名分类。"
(check-t... | |
8318fef487cd87b13e474a3314dad9353d63ccb44cd50e8dad537107251957f5 | trentmaetzold/cs61as | hw0-3.rkt | #lang racket
(require berkeley)
(provide (all-defined-out))
; Exercise 1 - Define describe-time
(define (describe-time secs)
(define (pl-secs num wd)
(word wd 's))
(cond ((or (not (integer? secs))
(< secs 0))
(error "Please enter a valid time format"))
((< secs 60)
(se s... | null | https://raw.githubusercontent.com/trentmaetzold/cs61as/6e4830786e2c28a26203a4f2046776405af2c10e/homework/hw0-3.rkt | racket | Exercise 1 - Define describe-time
Exercise 2 - Define remove-once
Exercise 3 - Define differences
Exercise 4 - Define location
Exercise 5 - Define initials
Exercise 6 - Define copies
Exercise 8 - Define repeat-words
Exercise 9 - Define same-shape? | #lang racket
(require berkeley)
(provide (all-defined-out))
(define (describe-time secs)
(define (pl-secs num wd)
(word wd 's))
(cond ((or (not (integer? secs))
(< secs 0))
(error "Please enter a valid time format"))
((< secs 60)
(se secs
(pl-secs secs 'seco... |
53d1728f943c9002cc650b9d38304d1df7caf9606cf2762be80168da8b4b2990 | ptal/AbSolute | parray.mli | (**************************************************************************)
(* *)
Copyright ( C )
(* *)
(* This software is free software;... | null | https://raw.githubusercontent.com/ptal/AbSolute/469159d87e3a717499573c1e187e5cfa1b569829/src/core/parray.mli | ocaml | ************************************************************************
This software is free software; you can redistribute it and/or
described in file LICENSE.... | Copyright ( C )
modify it under the terms of the GNU Library General Public
License version 2.1 , with the special exception on linking
type 'a t
val make : int -> 'a -> 'a t
val init : int -> (int -> 'a) -> 'a t
val length : 'a t -> int
val get :... |
ef4ebbcaa31fb4ca6bfbe6202a5b0b50dca9b8ae8dccedf96c581ac1b71f0cf3 | kdltr/chicken-core | fft.scm | fft.scm - fft benchmark , by
(cond-expand
disable in CHICKEN to test specialization in safe mode
(declare
(standard-bindings)
(extended-bindings)
(block)
(not safe)))
(else
(import (chicken bitwise)
(chicken fixnum)
(chicken flonum)
(chicken process-context))))
;;; All t... | null | https://raw.githubusercontent.com/kdltr/chicken-core/b2e6c5243dd469064bec947cb3b49dafaa1514e5/tests/fft.scm | scheme | All the following redefinitions are *ignored* by the Gambit compiler
because of the declarations above.
end of *ignored* definitions
number of complexes
we copy complex multiples of all entries below
start to entries starting at start
This is a direcct complex fft, using a decimation-in-time
algorithm with inpu... | fft.scm - fft benchmark , by
(cond-expand
disable in CHICKEN to test specialization in safe mode
(declare
(standard-bindings)
(extended-bindings)
(block)
(not safe)))
(else
(import (chicken bitwise)
(chicken fixnum)
(chicken flonum)
(chicken process-context))))
(define-... |
6b303887b19a1ba15331d35d8eebaecdfce6a01b765b16cc70ba2ee7530a2037 | ocsigen/eliom | ocamlbuild_eliom.ml | open Ocamlbuild_plugin
module Pack = Ocamlbuild_pack
module type ELIOM = sig
val server_dir : Ocamlbuild_plugin.Pathname.t
val type_dir : Ocamlbuild_plugin.Pathname.t
val client_dir : Ocamlbuild_plugin.Pathname.t
end
module type INTERNALS = sig
val with_eliom_ppx : ([< `Client | `Server] -> string) option
v... | null | https://raw.githubusercontent.com/ocsigen/eliom/c3e0eea5bef02e0af3942b6d27585add95d01d6c/src/ocamlbuild/ocamlbuild_eliom.ml | ocaml | WARNING: if you change this, also change inferred_type_prefix in
ppx/ppx_eliom_utils.ml and tools/eliomc.ml
A variant of flag_and_dep which recurse into Quote.
copy {shared,client,server}.ml rules | open Ocamlbuild_plugin
module Pack = Ocamlbuild_pack
module type ELIOM = sig
val server_dir : Ocamlbuild_plugin.Pathname.t
val type_dir : Ocamlbuild_plugin.Pathname.t
val client_dir : Ocamlbuild_plugin.Pathname.t
end
module type INTERNALS = sig
val with_eliom_ppx : ([< `Client | `Server] -> string) option
v... |
c756432b40ebce9eb8157d36caa00c9ef3d2e96dc75700d1cb38838e83f8156b | hazel-el/hazel | BCP47.hs | {-# LANGUAGE OverloadedStrings #-}
|
Module : . . OWL.BCP47
Copyright : ( c ) 2013 , 2014
License : GPL-3
Maintainer : < >
Stability : experimental
Portability : unknown
for the parts of BCP 47 referenced in the OWL2 Functional - Style grammar .
Module : ... | null | https://raw.githubusercontent.com/hazel-el/hazel/0f5d7e0c03d5eebd16f103df8cc05c5408c152f1/Hazel/Parser/OWL/BCP47.hs | haskell | # LANGUAGE OverloadedStrings #
^ language
^ script
^ region
^ variants
^ extensions
^ reserved for private use |
|
Module : . . OWL.BCP47
Copyright : ( c ) 2013 , 2014
License : GPL-3
Maintainer : < >
Stability : experimental
Portability : unknown
for the parts of BCP 47 referenced in the OWL2 Functional - Style grammar .
Module : Hazel.Parser.OWL.BCP47
Copyright ... |
67be8fafcf35492ef78444c0383a95ba3392e5abf1ea5ab91f629204287dcbf1 | AllAlgorithms/racket | factorial.rkt | #lang racket
(provide factorial)
(define (factorial n)
(let loop ([acc 1]
[n n])
(if (zero? n)
acc
(loop (* acc n) (sub1 n)))))
| null | https://raw.githubusercontent.com/AllAlgorithms/racket/46b2a4b963b0536351273ee8068f58fed4884dde/algorithms/math/factorial.rkt | racket | #lang racket
(provide factorial)
(define (factorial n)
(let loop ([acc 1]
[n n])
(if (zero? n)
acc
(loop (* acc n) (sub1 n)))))
| |
8d659c26dd049124ea5964a8ea41afde802c0c78561b423f10cca2d9320d5dc3 | emqx/emqx-bridge-mqtt | emqx_bridge_rpc.erl | %%--------------------------------------------------------------------
Copyright ( c ) 2020 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the L... | null | https://raw.githubusercontent.com/emqx/emqx-bridge-mqtt/f0107526efbfc38fab7727605ffd81e817ea3013/src/emqx_bridge_rpc.erl | erlang | --------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express ... | Copyright ( c ) 2020 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
@doc This module implements EMQX Bridge transport layer based on gen_rpc .
-module(emqx_bridge_rpc).... |
0448cec4f0dddee871115a5c8f1f0b48c9a2105520927166e88398215b53cca6 | saltysystems/enet | enet_sync.erl | -module(enet_sync).
-include_lib("enet/include/enet.hrl").
-export([
start_host/2,
connect_from_full_local_host/3,
connect_to_full_remote_host/3,
connect_to_self/3,
connect/3,
disconnect/2,
stop_host/1,
send_unsequenced/2,
send_unreliable/2,
send_reliable/2,
get_host_port/1... | null | https://raw.githubusercontent.com/saltysystems/enet/327f0cd4f408ce750027c736ab3cd021c0bb031b/test/enet_sync.erl | erlang |
Helpers
| -module(enet_sync).
-include_lib("enet/include/enet.hrl").
-export([
start_host/2,
connect_from_full_local_host/3,
connect_to_full_remote_host/3,
connect_to_self/3,
connect/3,
disconnect/2,
stop_host/1,
send_unsequenced/2,
send_unreliable/2,
send_reliable/2,
get_host_port/1... |
6f1b163cdf53dff550696710ead26d0a002f99bbf865a794fcfae553de122ccd | ghc/ghc | FreeRegs.hs | module GHC.CmmToAsm.Reg.Linear.FreeRegs (
FR(..),
maxSpillSlots
)
where
import GHC.Prelude
import GHC.Platform.Reg
import GHC.Platform.Reg.Class
import GHC.CmmToAsm.Config
import GHC.Utils.Panic
import GHC.Platform
-- -----------------------------------------------------------------------------
-- The free ... | null | https://raw.githubusercontent.com/ghc/ghc/aacf616df0b4059e6b177ecb64624ae6fb1d1c87/compiler/GHC/CmmToAsm/Reg/Linear/FreeRegs.hs | haskell | -----------------------------------------------------------------------------
The free register set
This needs to be *efficient*
type FreeRegs = [RegNo]
releaseReg n f = if n `elem` f then f else (n : f)
initFreeRegs = allocatableRegs
allocateReg f r = filter (/= r) f | module GHC.CmmToAsm.Reg.Linear.FreeRegs (
FR(..),
maxSpillSlots
)
where
import GHC.Prelude
import GHC.Platform.Reg
import GHC.Platform.Reg.Class
import GHC.CmmToAsm.Config
import GHC.Utils.Panic
import GHC.Platform
Here 's an inefficient ' executable specification ' of the FreeRegs data type :
noFr... |
1388c919021faf59904c404466397f292ea50f5bf8343b9fdd2452ad71e3a0d8 | RichiH/git-annex | ProblemFixer.hs | git - annex assistant thread to handle fixing problems with repositories
-
- Copyright 2013 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2013 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Assistant.Threads.ProblemFixer (
problemFixerThrea... | null | https://raw.githubusercontent.com/RichiH/git-annex/bbcad2b0af8cd9264d0cb86e6ca126ae626171f3/Assistant/Threads/ProblemFixer.hs | haskell | Waits for problems with a repo, and tries to fsck the repo and repair
- the problem.
Problems may have been re-reported while they were being
fixed, so ignore those. If a new unique problem happened
to do much good anyway.
This is not yet used, and should probably do a fsck. | git - annex assistant thread to handle fixing problems with repositories
-
- Copyright 2013 < >
-
- Licensed under the GNU GPL version 3 or higher .
-
- Copyright 2013 Joey Hess <>
-
- Licensed under the GNU GPL version 3 or higher.
-}
module Assistant.Threads.ProblemFixer (
problemFixerThrea... |
1ecd2df5b1e287a5cf3ff66c896a6815556c688f633add894823d2b525571a3a | CSCfi/rems | test_layers.clj | (ns rems.test-layers
"Test REMS layer architecture automatically.
Generates an architecture diagram.
NB: requires `graphviz` and `clj-kondo` to be installed on the machine.
NB: Work in progress. You should run `graph` manually currently."
(:require [clojure.java.io :as io]
[clojure.java.shell :a... | null | https://raw.githubusercontent.com/CSCfi/rems/132f19a6393765d780d339fc9904bc2055654218/test/clj/rems/test_layers.clj | clojure | (str/starts-with? s "rems.cli")
use for future namespace renaming needs
(concat ["rems.cli"]) ; consider implementing `rems.cli` ns
(concat [["rems.cli" "rems.service.test-data"]]) | (ns rems.test-layers
"Test REMS layer architecture automatically.
Generates an architecture diagram.
NB: requires `graphviz` and `clj-kondo` to be installed on the machine.
NB: Work in progress. You should run `graph` manually currently."
(:require [clojure.java.io :as io]
[clojure.java.shell :a... |
ae3a9082a31e166e3156b524c49702beada0d879245b9d1c2b37020e964f9eff | MarcFontaine/stm32hs | API.hs | ----------------------------------------------------------------------------
-- |
Module : STM32.API
Copyright : ( c ) 2017
-- License : BSD3
--
Maintainer :
-- Stability : experimental
Portability : GHC - only
--
-- The general part of the API.
The module for the peripheral ( G... | null | https://raw.githubusercontent.com/MarcFontaine/stm32hs/d7afeb8f9d83e01c76003f4b199b45044bd4e383/STM32-Zombie/src/STM32/API.hs | haskell | --------------------------------------------------------------------------
|
License : BSD3
Stability : experimental
The general part of the API. | Module : STM32.API
Copyright : ( c ) 2017
Maintainer :
Portability : GHC - only
The module for the peripheral ( GPIO , USART , ADC , .. ) has to be imported separately .
module STM32.API
(
module STM32.MachineInterface
, module STLinkUSB
, module STM32.RCC
, module Data.Word
, mo... |
8c43d6d816b51b4ca69b64f4bc39a67616eed37dd331d4b023f2eb9578708032 | zclj/replication-packages | gitlab_experiment.clj | (ns gql.gitlab-experiment
(:require [clojure.data.json :as json]
[org.httpkit.client :as http]
[gql.generators :as gqlgen]
[clojure.test.check.properties :as prop]
[clojure.test.check.generators :as gen]
[gql.query-data :as data]
[clojure.spec.al... | null | https://raw.githubusercontent.com/zclj/replication-packages/8a5cb02e4fdda74107b5dcc34cbfa5cb5ae34dcf/GraphQL/implementation/src/gql/gitlab_experiment.clj | clojure | [query-str]
(json/read-str
(:body
@(http/request {:url ""
:method :post
:headers {"PRIVATE-TOKEN" token}
:content-type "application/json"
:form-params {"query" query-str}}))
:key-fn keyword))
... | (ns gql.gitlab-experiment
(:require [clojure.data.json :as json]
[org.httpkit.client :as http]
[gql.generators :as gqlgen]
[clojure.test.check.properties :as prop]
[clojure.test.check.generators :as gen]
[gql.query-data :as data]
[clojure.spec.al... |
ce1881ce7c614f733f238251fd1cdef851e14d9b2aca3fd48ed07d7ad7695b2a | chaoxu/fancy-walks | 2.hs |
fib = 1 : 1 : zipWith (+) fib (tail fib)
problem_2 = sum $ filter even $ takeWhile (<=4000000) fib
main = print problem_2
| null | https://raw.githubusercontent.com/chaoxu/fancy-walks/952fcc345883181144131f839aa61e36f488998d/projecteuler.net/2.hs | haskell |
fib = 1 : 1 : zipWith (+) fib (tail fib)
problem_2 = sum $ filter even $ takeWhile (<=4000000) fib
main = print problem_2
| |
51717ee21faa33e579ed55e8d1bc8850fbdae962039d521ed0c9b4a6a46af060 | chaitanyagupta/chronicity | repeater-hour.lisp | -*- Mode : LISP ; Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*-
;;; repeater-hour.lisp
;;; See the LICENSE file for licensing information.
(cl:in-package #:chronicity-test)
(define-test repeater-hour-next-future
(let* ((now (make-datetime 2006 8 16 14))
(hours (create-tag 'repeater-hour :... | null | https://raw.githubusercontent.com/chaitanyagupta/chronicity/5841d1548cad0ca6917d8e68933124a5af68f5ec/test/repeater-hour.lisp | lisp | Syntax : COMMON - LISP ; Package : CL - USER ; Base : 10 -*-
repeater-hour.lisp
See the LICENSE file for licensing information. |
(cl:in-package #:chronicity-test)
(define-test repeater-hour-next-future
(let* ((now (make-datetime 2006 8 16 14))
(hours (create-tag 'repeater-hour :hour :now now))
(next-hour))
(setf next-hour (r-next hours :future))
(assert-datetime= (make-datetime 2006 8 16 15) (span-start next-hour)... |
087f486b02aeb039978275506e372752035cd39c220cc724e340e9e97833082f | tommaisey/aeon | buf-comb-c.help.scm | (with-sc3
(lambda (fd)
(async fd (b-alloc 0 44100 1))))
(let ((x (mul3 (decay (dust ar 1) 0.2) (white-noise ar) 0.5)))
(audition (out 0 (buf-comb-n 0 x 0.25 6))))
| null | https://raw.githubusercontent.com/tommaisey/aeon/80744a7235425c47a061ec8324d923c53ebedf15/libs/third-party/sc3/rsc3/help/ugen/delays/buf-comb-c.help.scm | scheme | (with-sc3
(lambda (fd)
(async fd (b-alloc 0 44100 1))))
(let ((x (mul3 (decay (dust ar 1) 0.2) (white-noise ar) 0.5)))
(audition (out 0 (buf-comb-n 0 x 0.25 6))))
| |
f46a673f1e18437f3b7c0f369e328e91a1201860e74325648de513566569430a | dscarpetti/codax | prefix.clj | (ns codax.prefix)
(defn set-prefix [tx prefix]
(assoc tx :prefix
(cond
(nil? prefix) []
(vector? prefix) prefix
(coll? prefix) (vec prefix)
:else [prefix])))
(defn prefix-path
"Helper function for prefixing a path with the `:prefix` of the transaction `txn`.
... | null | https://raw.githubusercontent.com/dscarpetti/codax/68edc73dbdfe4d33f5d08f658052edbc3de85121/src/codax/prefix.clj | clojure | (ns codax.prefix)
(defn set-prefix [tx prefix]
(assoc tx :prefix
(cond
(nil? prefix) []
(vector? prefix) prefix
(coll? prefix) (vec prefix)
:else [prefix])))
(defn prefix-path
"Helper function for prefixing a path with the `:prefix` of the transaction `txn`.
... | |
2e2f6560388ece835608304e4c349e18214ed448a7f8f163429d0d67d85b9960 | oakes/Nightweb | main.clj | (ns net.nightweb.main
(:require [neko.notify :as notify]
[neko.resource :as r]
[neko.ui.mapping :as mapping]
[net.clandroid.service :as service]
[net.nightweb.utils :as utils]
[nightweb.router :as router]))
(mapping/defelement :scroll-view
... | null | https://raw.githubusercontent.com/oakes/Nightweb/089c7a99a9a875fde33cc29d56e1faf54dc9de84/android/src/clojure/net/nightweb/main.clj | clojure | (ns net.nightweb.main
(:require [neko.notify :as notify]
[neko.resource :as r]
[neko.ui.mapping :as mapping]
[net.clandroid.service :as service]
[net.nightweb.utils :as utils]
[nightweb.router :as router]))
(mapping/defelement :scroll-view
... | |
3a41eecba5c3656e1fe1e227071063b687186d3555aac72ea0bc11b4fb9425b3 | inaka/elvis_core | consistent_generic_type_term_and_any.erl | -module(consistent_generic_type_term_and_any).
-export([simple_term/1, simple_combined/1, simple_when/1]).
% Type definitions when this is alone or combined
-type my_type() :: term().
-type combined() :: any() | my_type().
% Record definitions
-record(my_record, {t :: term(), a :: any()}).
% Callback definitions (w... | null | https://raw.githubusercontent.com/inaka/elvis_core/02161609796225f8574e3c3175b37f1795fb8eb6/test/examples/consistent_generic_type_term_and_any.erl | erlang | Type definitions when this is alone or combined
Record definitions
Callback definitions (with or without when)
Specs with when | -module(consistent_generic_type_term_and_any).
-export([simple_term/1, simple_combined/1, simple_when/1]).
-type my_type() :: term().
-type combined() :: any() | my_type().
-record(my_record, {t :: term(), a :: any()}).
-callback my_callback(term()) -> any().
-callback my_callback_when(X) -> X when X :: term().
-... |
b882185b3a579b281681a662a36f4b7a5505c4a66802c01ca91f7b36745d4553 | input-output-hk/project-icarus-importer | Txp.hs | {-# LANGUAGE Rank2Types #-}
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
-- | Utils for payments and redeeming.
module Pos.Wallet.Web.Methods.Txp
( MonadWalletTxFull
, gatherPendingTxsSummary
, rewrapTxError
, coinDistrToOutputs
, submitAndSaveNewPtx
, getPending... | null | https://raw.githubusercontent.com/input-output-hk/project-icarus-importer/36342f277bcb7f1902e677a02d1ce93e4cf224f0/wallet/src/Pos/Wallet/Web/Methods/Txp.hs | haskell | # LANGUAGE Rank2Types #
| Utils for payments and redeeming.
| Like 'submitAndSaveTx', but suppresses errors which can get gone
by the time of resubmission.
get addresses which are refered by some yet unconfirmed transaction outputs.
NOTE (int-index) The pending transactions are ignored when we optimize
f... | # LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
module Pos.Wallet.Web.Methods.Txp
( MonadWalletTxFull
, gatherPendingTxsSummary
, rewrapTxError
, coinDistrToOutputs
, submitAndSaveNewPtx
, getPendingAddresses
) where
import Universum
import qualified Data.Lis... |
85e92477949716d64017d2d0b3fcd5c45cd718afa9ce3a9e4afaefe0efa2802e | satori-com/mzbench | worker_from_git.erl | [
{make_install, [
{git, {var, "mzbench_repo"}},
{branch, {var, "worker_branch"}},
{dir, "workers/exec"}]},
{pool, [{size, 2}, {worker_type, exec_worker}],
[{execute, "sleep 5"}]}
].
| null | https://raw.githubusercontent.com/satori-com/mzbench/02be2684655cde94d537c322bb0611e258ae9718/acceptance_tests/scripts/worker_from_git.erl | erlang | [
{make_install, [
{git, {var, "mzbench_repo"}},
{branch, {var, "worker_branch"}},
{dir, "workers/exec"}]},
{pool, [{size, 2}, {worker_type, exec_worker}],
[{execute, "sleep 5"}]}
].
| |
216164ae74c2ce6c34c12d7f3918bfe96c2dd855b909c5896a958e18312f2ee7 | ocaml-omake/omake | lm_printf.mli |
(**
* For now, just use normal output channels.
* Type t of buffers.
*)
type 'a t = Format.formatter -> 'a -> unit
val open_out : string -> Format.formatter
val open_out_bin : string -> Format.formatter
(*
* These functions are bad style for functional programs.
*)
val prerr_char : char -> unit
val p... | null | https://raw.githubusercontent.com/ocaml-omake/omake/26b39e82f81c912f8c0f9859328c9c24800e6ba8/src/libmojave/lm_printf.mli | ocaml | *
* For now, just use normal output channels.
* Type t of buffers.
* These functions are bad style for functional programs.
* Flush the output.
* Printing.
* List printing helpers.
***********************************************************************
* Formatter interface.
* Boxes.
* Form... |
type 'a t = Format.formatter -> 'a -> unit
val open_out : string -> Format.formatter
val open_out_bin : string -> Format.formatter
val prerr_char : char -> unit
val prerr_int : int -> unit
val prerr_string : string -> unit
val flush : Format.formatter -> unit
val eflush : Format.formatter -> unit
... |
e3a32ca27cbb66e07a344ff5c2a22eb5effbf616c0489f648adbcb0f16cf28f4 | ygrek/mldonkey | donkeyUdp.ml | Copyright 2001 , 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey 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 2 of the License , or
... | null | https://raw.githubusercontent.com/ygrek/mldonkey/333868a12bb6cd25fed49391dd2c3a767741cb51/src/networks/donkey/donkeyUdp.ml | ocaml | search.search_handler (Waiting s.search_waiting)
(* USELESS NOW
now, it is done in donkeySources
List.iter (fun s ->
match s.server_sock with
None -> () (* assert false !!!
lprintf "Received location by UDP\n";
lprintf "Received file by UDP\n"; | Copyright 2001 , 2002 b8_bavard , b8_fee_carabine ,
This file is part of mldonkey .
mldonkey 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 2 of the License , or
... |
6924e38410fe7e344cdabf7db579c257c3f27a7fe5281dee7672d791c900ae20 | sicmutils/sicmutils | ch1_test.cljc | #_"SPDX-License-Identifier: GPL-3.0"
(ns sicmutils.fdg.ch1-test
(:refer-clojure :exclude [+ - * /])
(:require [clojure.test :refer [is deftest use-fixtures]]
[sicmutils.env :as e :refer [- * /
compose
up
... | null | https://raw.githubusercontent.com/sicmutils/sicmutils/f427fd073937faf62741fcdda6362f910ecda71f/test/sicmutils/fdg/ch1_test.cljc | clojure | x
y
z
Now we can compute the residuals of the Euler-Lagrange equations, but
we get a large messy expression that we will not show. | #_"SPDX-License-Identifier: GPL-3.0"
(ns sicmutils.fdg.ch1-test
(:refer-clojure :exclude [+ - * /])
(:require [clojure.test :refer [is deftest use-fixtures]]
[sicmutils.env :as e :refer [- * /
compose
up
... |
e83993a7be1c4bbf15df260e87accd238dd812ad6237c95a1cded7ceb3751c7d | nasa/Common-Metadata-Repository | project.clj | (defproject nasa-cmr/cmr-metadata-db-app "0.1.0-SNAPSHOT"
:description "The metadata db is a micro-service that provides
support for persisting metadata concepts."
:url "-Metadata-Repository/tree/master/metadata-db-app"
:exclusions [[cheshire]
[clj-http]
[clj-time]
... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/67820501151731b535b7087e11990ab1c2240042/metadata-db-app/project.clj | clojure | This profile is used for linting and static analysis. To run for this
all projects at the same time, use the same command but from the top-
level directory.
The following profile is overriden on the build server or in the user's
~/.lein/profiles.clj file.
Prints out documentation on configuration environment vari... | (defproject nasa-cmr/cmr-metadata-db-app "0.1.0-SNAPSHOT"
:description "The metadata db is a micro-service that provides
support for persisting metadata concepts."
:url "-Metadata-Repository/tree/master/metadata-db-app"
:exclusions [[cheshire]
[clj-http]
[clj-time]
... |
702294af7b83cc4fc0ab5889bb1cec007953c0f6537ac959080f7b6ba420114f | fulcro-legacy/semantic-ui-wrapper | ui_tab.cljs | (ns fulcrologic.semantic-ui.modules.tab.ui-tab
(:require
[fulcrologic.semantic-ui.factory-helpers :as h]
["semantic-ui-react/dist/commonjs/modules/Tab/Tab" :default Tab]))
(def ui-tab
"A Tab is a hidden section of content activated by a Menu.
Props:
- activeIndex (number|string): Index of the curr... | null | https://raw.githubusercontent.com/fulcro-legacy/semantic-ui-wrapper/b0473480ddfff18496df086bf506099ac897f18f/semantic-ui-wrappers-shadow/src/main/fulcrologic/semantic_ui/modules/tab/ui_tab.cljs | clojure | (ns fulcrologic.semantic-ui.modules.tab.ui-tab
(:require
[fulcrologic.semantic-ui.factory-helpers :as h]
["semantic-ui-react/dist/commonjs/modules/Tab/Tab" :default Tab]))
(def ui-tab
"A Tab is a hidden section of content activated by a Menu.
Props:
- activeIndex (number|string): Index of the curr... | |
e524f8a5c9e90dd45174be0a740ffb798f2fdeddeb53fd7c87d02955bb7b7ede | KingoftheHomeless/in-other-words | Fix.hs | # LANGUAGE CPP #
# OPTIONS_HADDOCK not - home #
module Control.Effect.Type.Fix
( -- * Effects
Fix(..)
-- * Threading utilities
, threadFixViaClass
) where
import Control.Monad.Fix
import qualified Control.Monad.Trans.Except as E
import qualified Control.Monad.Trans.Reader as R
import qualified Control.Monad.... | null | https://raw.githubusercontent.com/KingoftheHomeless/in-other-words/9c864c81beb4fdf71d363b6962db5c90275c57ef/src/Control/Effect/Type/Fix.hs | haskell | * Effects
* Threading utilities
on this effect; by having access to 'Fix', you're able to
use recursive do notation inside of effect handlers.
__Fix is typically used as a primitive effect__.
If you define a 'Control.Effect.Carrier' that relies on a novel
non-trivial monad transformer @t@, then you need to mak... | # LANGUAGE CPP #
# OPTIONS_HADDOCK not - home #
module Control.Effect.Type.Fix
Fix(..)
, threadFixViaClass
) where
import Control.Monad.Fix
import qualified Control.Monad.Trans.Except as E
import qualified Control.Monad.Trans.Reader as R
import qualified Control.Monad.Trans.State.Lazy as LSt
import qualified Con... |
a90488defe30629fbb9d42e2b6a60ce8c75c1031c71f45a44a3f6477e6926a59 | metrics-clojure/metrics-clojure | csv.clj | (ns metrics.reporters.csv
"CSV reporting"
(:require [metrics.core :refer [default-registry]]
[clojure.java.io :as io]
[metrics.reporters :as mrep])
(:import java.util.concurrent.TimeUnit
[com.codahale.metrics CsvReporter MetricRegistry MetricFilter ScheduledReporter]
... | null | https://raw.githubusercontent.com/metrics-clojure/metrics-clojure/a1dbacc748a1f8165f0094e2229c84f228efe29b/metrics-clojure-core/src/metrics/reporters/csv.clj | clojure | (ns metrics.reporters.csv
"CSV reporting"
(:require [metrics.core :refer [default-registry]]
[clojure.java.io :as io]
[metrics.reporters :as mrep])
(:import java.util.concurrent.TimeUnit
[com.codahale.metrics CsvReporter MetricRegistry MetricFilter ScheduledReporter]
... | |
4c7ea25c2297495383c03e4efecf436b561bae0f5d96be12e80e185545f785b1 | leanprover/tc | Internal.hs | |
Module : . Level . Internal
Description : Universe levels
Copyright : ( c ) , 2016
License : GPL-3
Maintainer :
Implementation of universe levels
Module : Kernel.Level.Internal
Description : Universe levels
Copyright : (c) Daniel Selsam, 2016
License : GPL-3
Maintainer :... | null | https://raw.githubusercontent.com/leanprover/tc/250a568346f29ae27190fccee169ba10002c7399/src/Kernel/Level/Internal.hs | haskell | A level is explicit if it is of the form 'Succ^k Zero' for some 'k'.
Factors out outermost sequence of 'mkSucc' applications.
called on sorted explicits
Replace
Order | |
Module : . Level . Internal
Description : Universe levels
Copyright : ( c ) , 2016
License : GPL-3
Maintainer :
Implementation of universe levels
Module : Kernel.Level.Internal
Description : Universe levels
Copyright : (c) Daniel Selsam, 2016
License : GPL-3
Maintainer :... |
28937c03111d8c958911ff020098d89ae6891d69254f054084b0346f7531281c | testedminds/edgewise | graph.clj | (in-ns 'edgewise.core)
;; All fn's return a graph:
(defn empty-graph []
{:vertex-id 0
:edge-id 0
:vertex-data {}
:vertex-index {:label {}}
:edge-data {}})
(defn- update-vertex-index [g property value id]
(let [index (:vertex-index g)
property-index (index property)
update (assoc prope... | null | https://raw.githubusercontent.com/testedminds/edgewise/0fb64c718e6a8e70eda87b77677a6679770569d1/src/edgewise/graph.clj | clojure | All fn's return a graph: | (in-ns 'edgewise.core)
(defn empty-graph []
{:vertex-id 0
:edge-id 0
:vertex-data {}
:vertex-index {:label {}}
:edge-data {}})
(defn- update-vertex-index [g property value id]
(let [index (:vertex-index g)
property-index (index property)
update (assoc property-index value id)
... |
f7b3bfb5f286307f00d52325f6a1e82964335a165bea0b5100e8daa74e4dc244 | xapi-project/xen-api | memory_interface.ml |
* Copyright ( C ) Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file LI... | null | https://raw.githubusercontent.com/xapi-project/xen-api/47fae74032aa6ade0fc12e867c530eaf2a96bf75/ocaml/xapi-idl/memory/memory_interface.ml | ocaml | * @group Memory
* The reservation_id is an opaque identifier associated with a block of
memory. It is used to reserve memory for a domain before the domain has been
created.
* Never balloon, use the specified fixed size
* [Unknown_reservation (id)] is reported if a the specified
reservation_id is u... |
* Copyright ( C ) Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file LI... |
bb36b9c5387272b9bf72957839a9e03f389680bcfa782d6813784cc9d66fb4e3 | blindglobe/clocc | section8.lisp | section 8 structures -*- mode : lisp -*-
(in-package :cl-user)
(proclaim '(special log))
;;;
;;; Example 1
;;; define town structure type
;;; area, watertowers, firetrucks, population, elevation are its components
;;;
(check-for-bug :section8-legacy-11
(defstruct town
area
watertowers
(firetrucks 1 :t... | null | https://raw.githubusercontent.com/blindglobe/clocc/a50bb75edb01039b282cf320e4505122a59c59a7/src/tools/ansi-test/section8.lisp | lisp |
Example 1
define town structure type
area, watertowers, firetrucks, population, elevation are its components
an initialized slot
a slot that can't be changed
create a town instance
town's predicate recognizes the new instance
new town's area is as specified by make-town
new town's elevation has initial value
since... | section 8 structures -*- mode : lisp -*-
(in-package :cl-user)
(proclaim '(special log))
(check-for-bug :section8-legacy-11
(defstruct town
area
watertowers
population
TOWN)
(check-for-bug :section8-legacy-21
(progn
(setq town1 (make-town :area 0 :watertowers 0))
t)
t )
(check-for-bug ... |
46413cf6a666468eadad8a09bb948ba853a76f3c4603d1faaf5cfaa0def7dae1 | NorfairKing/smos | Report.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
{-# LANGUAGE OverloadedStrings #-}
module Smos.Report.Report where
import Autodocodec
import Data.Aeson (FromJSON, ToJSON)
import Data.List.NonEmpty (NonEmpty (..))
import Data.Text (Text)
import Data.Validity
import GHC.Generics (Generic)
import Smos.Report.Archive... | null | https://raw.githubusercontent.com/NorfairKing/smos/489f5b510c9a30a3c79fef0a0d1a796464705923/smos-report/src/Smos/Report/Report.hs | haskell | # LANGUAGE OverloadedStrings # | # LANGUAGE DeriveGeneric #
# LANGUAGE DerivingVia #
module Smos.Report.Report where
import Autodocodec
import Data.Aeson (FromJSON, ToJSON)
import Data.List.NonEmpty (NonEmpty (..))
import Data.Text (Text)
import Data.Validity
import GHC.Generics (Generic)
import Smos.Report.Archive
import Smos.Report.Filter
import S... |
3c8e99b3e572515784b3a7c0c45fb5b3a77af9dcbe6336c0aa4341d4d9f3ac8e | iatorm/grime | grime.hs | A two - dimensional language based on Boolean grammars
import Expression
import Matcher (matchAllEmpty)
import Parser (Option(..), parseMatFile, parseGrFile, parseOptions)
import Data.List (nub)
import Data.Map.Strict (toList)
import Control.Monad (forM_, when)
import System.Environment (getArgs)
import System.IO (h... | null | https://raw.githubusercontent.com/iatorm/grime/52b4742bcd17479a892d665cbcd158b06d116243/grime.hs | haskell | Take a submatrix of a newline-delimited string, possibly with border
Print a string to STDERR with newline | A two - dimensional language based on Boolean grammars
import Expression
import Matcher (matchAllEmpty)
import Parser (Option(..), parseMatFile, parseGrFile, parseOptions)
import Data.List (nub)
import Data.Map.Strict (toList)
import Control.Monad (forM_, when)
import System.Environment (getArgs)
import System.IO (h... |
ae49608a94ea2f31d28c388da540313f28b0412b16c6d2606a9d38300e911811 | unnohideyuki/bunny | sample292.hs | a = 42 :: Int
b = 5 :: Integer
c = 3.14 :: Float
d = pi :: Double
main = do print $ (realToFrac a :: Float)
print $ (realToFrac b :: Float)
print $ (realToFrac c :: Float)
print $ (realToFrac d :: Float)
print $ (realToFrac a :: Double)
print $ (realToFrac b :: Double)... | null | https://raw.githubusercontent.com/unnohideyuki/bunny/501856ff48f14b252b674585f25a2bf3801cb185/compiler/test/samples/sample292.hs | haskell | a = 42 :: Int
b = 5 :: Integer
c = 3.14 :: Float
d = pi :: Double
main = do print $ (realToFrac a :: Float)
print $ (realToFrac b :: Float)
print $ (realToFrac c :: Float)
print $ (realToFrac d :: Float)
print $ (realToFrac a :: Double)
print $ (realToFrac b :: Double)... | |
5585aa164b024120c0556a447021d40ed18eed2cf72195ec9cc0af8361f93e16 | mu-chaco/ReWire | DLX.hs | module DLX where
import Prelude hiding (and,or,seq,(||))
import Boilerplate
import Control.Monad.Resumption.Reactive
import Control.Monad.State hiding (when)
import Control.Monad.Identity hiding (when)
loop = do
case rstIn inp of
One - > reset
Zero - > do ie < - getI... | null | https://raw.githubusercontent.com/mu-chaco/ReWire/a8dcea6ab0989474988a758179a1d876e2c32370/cruft/DLX.hs | haskell | "J 00000010 x02"
"LHI 0x0f 001111"
"LW 0x23 100011"
"SNEI 0x19 011001"
Instructions
Jump
Jump and Link
Jump register
Load high bits immediate
Load Word
It seems weird to me that there is no checking of whether
Where does that happen?
Move general purpose to special
Move special to general purpose
... | module DLX where
import Prelude hiding (and,or,seq,(||))
import Boilerplate
import Control.Monad.Resumption.Reactive
import Control.Monad.State hiding (when)
import Control.Monad.Identity hiding (when)
loop = do
case rstIn inp of
One - > reset
Zero - > do ie < - getI... |
dda88261ec98757776e59297086fcb507ca65c10b4d5219e8d7ab1e706e3c6f3 | DimaSamoz/mezzo | Music.hs |
-----------------------------------------------------------------------------
-- |
-- Module : Mezzo.Model.Music
-- Description : Mezzo music algebra
Copyright : ( c )
License : MIT
--
-- Maintainer :
-- Stability : experimental
-- Portability : portable
--
Algebraic description of mu... | null | https://raw.githubusercontent.com/DimaSamoz/mezzo/13365da8907a714e34540f7a1d99898b67816cc9/src/Mezzo/Model/Music.hs | haskell | ---------------------------------------------------------------------------
|
Module : Mezzo.Model.Music
Description : Mezzo music algebra
Maintainer :
Stability : experimental
Portability : portable
---------------------------------------------------------------------------
* Music
* Constrain... |
Copyright : ( c )
License : MIT
Algebraic description of music with type - level constraints .
module Mezzo.Model.Music
(
Music (..)
, Signature (..)
, ValidNote
, ValidRest
, ValidChord
, ValidProg
, ValidHom
, ValidMel
, ValidHarm
, ValidTripl
) ... |
79eb20b37d1a2e60ffee433dd25ecb46f90b3104637bdcf3f3201a596d975fab | Chris00/ocaml-dropbox | shared_folders.ml | open Lwt
module D = Dropbox_lwt_unix
(** If there is no argument, return the list of all shared folders.
Otherwise, put [shared_folder_id] to get the metadata for a specific
shared folder. *)
let shared_folders t shared_folder_id =
D.shared_folders ~shared_folder_id t >>= fun shared_folders ->
Lwt_list.it... | null | https://raw.githubusercontent.com/Chris00/ocaml-dropbox/36b222269e6bc7e5486cbb69738841d87a1212fb/tests/shared_folders.ml | ocaml | * If there is no argument, return the list of all shared folders.
Otherwise, put [shared_folder_id] to get the metadata for a specific
shared folder. | open Lwt
module D = Dropbox_lwt_unix
let shared_folders t shared_folder_id =
D.shared_folders ~shared_folder_id t >>= fun shared_folders ->
Lwt_list.iter_s
(fun shared_folder ->
Lwt_io.printlf "%s" (Dropbox_j.string_of_shared_folder shared_folder))
shared_folders
let main t args =
match args with
... |
8e3462c4c015e30314d135a25e06217893e343569b76414100668cb6c513c8ef | softwarelanguageslab/maf | R5RS_scp1_ring-squares-4.scm | ; Changes:
* removed : 0
* added : 1
* swaps : 0
* negated predicates : 1
; * swapped branches: 0
; * calls to id fun: 0
(letrec ((result ())
(output (lambda (i)
(set! result (cons i result))))
(kw-lijst (lambda (lst)
(letrec ((loop (lambda (l)
... | null | https://raw.githubusercontent.com/softwarelanguageslab/maf/11acedf56b9bf0c8e55ddb6aea754b6766d8bb40/test/changes/scheme/generated/R5RS_scp1_ring-squares-4.scm | scheme | Changes:
* swapped branches: 0
* calls to id fun: 0 | * removed : 0
* added : 1
* swaps : 0
* negated predicates : 1
(letrec ((result ())
(output (lambda (i)
(set! result (cons i result))))
(kw-lijst (lambda (lst)
(letrec ((loop (lambda (l)
(let ((rest (cdr l))
... |
b812f6e0a74894720814520d451fc0c4831ad7172eb8ea16077236baec4cdc29 | emqx/pulsar-client-erl | pulsar_producers_sup.erl | Copyright ( c ) 2013 - 2019 EMQ Technologies Co. , Ltd. All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law... | null | https://raw.githubusercontent.com/emqx/pulsar-client-erl/15261e052d936a7927a21bf522292959ed9ced31/src/pulsar_producers_sup.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright ( c ) 2013 - 2019 EMQ Technologies Co. , Ltd. All Rights Reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(pulsar_producers_sup).
-behaviour(supervisor).
-export([start_link/0, init/1]).
-expo... |
a635096f443586965f16d44497b8bd3fa873569353ee16b6aa686a511f3d0823 | cloudant-labs/couchdb-erlfdb | erlfdb_01_basic_test.erl | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
% use this file except in compliance with the License. You may obtain a copy of
% the License at
%
% -2.0
%
% Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an " A... | null | https://raw.githubusercontent.com/cloudant-labs/couchdb-erlfdb/510664facbc28c946960db2d12b3baf33923f4ea/test/erlfdb_01_basic_test.erl | erlang | use this file except in compliance with the License. You may obtain a copy of
the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
License for the specific language governing permissions and limitations... | Licensed under the Apache License , Version 2.0 ( the " License " ) ; you may not
distributed under the License is distributed on an " AS IS " BASIS , WITHOUT
-module(erlfdb_01_basic_test).
-include_lib("eunit/include/eunit.hrl").
load_test() ->
erlfdb_nif:ohai().
get_error_string_test() ->
?assertEqu... |
a99946a2291adf990f772f3b6e68eb38f9525813968b54c930129002a30f88a6 | huangjs/cl | transs.lisp | -*- Mode : Lisp ; Package : Maxima ; Syntax : Common - Lisp ; Base : 10 -*- ; ; ; ;
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; The data in this file contains enhancments. ;;;;;
;;; ;;;;;
... | null | https://raw.githubusercontent.com/huangjs/cl/96158b3f82f82a6b7d53ef04b3b29c5c8de2dbf7/lib/maxima/src/transs.lisp | lisp | Package : Maxima ; Syntax : Common - Lisp ; Base : 10 -*- ; ; ; ;
The data in this file contains enhancments. ;;;;;
;;;;;
; ; ; ;
All rights reserved ;;;;;
; ;
User-hacking ... |
(in-package :maxima)
(macsyma-module transs)
(transl-module transs)
(defmvar *transl-file-debug* nil
"set this to T if you don't want to have the temporary files
used automaticaly deleted in case of errors.")
There are various macros to cons - up filename TEMPLATES
which to into . The filenames should be t... |
31276744fae6cc66141061cd7b0d4197084d6cba558f5cb41be9414703f2d620 | well-typed-lightbulbs/ocaml-esp32 | pr5785.ml | (* TEST
* expect
*)
module Add (T : sig type two end) =
struct
type _ t =
| One : [`One] t
| Two : T.two t
let add (type a) : a t * a t -> string = function
| One, One -> "two"
| Two, Two -> "four"
end;;
[%%expect{|
Lines 7-9, characters 43-24:
7 | ...........................................functio... | null | https://raw.githubusercontent.com/well-typed-lightbulbs/ocaml-esp32/c24fcbfbee0e3aa6bb71c9b467c60c6bac326cc7/testsuite/tests/typing-gadts/pr5785.ml | ocaml | TEST
* expect
|
module Add (T : sig type two end) =
struct
type _ t =
| One : [`One] t
| Two : T.two t
let add (type a) : a t * a t -> string = function
| One, One -> "two"
| Two, Two -> "four"
end;;
[%%expect{|
Lines 7-9, characters 43-24:
7 | ...........................................function
8 | | One, One ->... |
8e62606676bea37034238513f845678e78df277a85f6e247b6628f1ba0d63604 | jepsen-io/jepsen | project.clj | (defproject jepsen.hazelcast "0.1.0-SNAPSHOT"
:description "Jepsen tests for Hazelcast IMDG"
:url "/"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[jepsen "0.1.11"]
[com.hazelcast/hazelcast-client "3.12-BETA... | null | https://raw.githubusercontent.com/jepsen-io/jepsen/a75d5a50dd5fa8d639a622c124bf61253460b754/hazelcast/project.clj | clojure | (defproject jepsen.hazelcast "0.1.0-SNAPSHOT"
:description "Jepsen tests for Hazelcast IMDG"
:url "/"
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.8.0"]
[jepsen "0.1.11"]
[com.hazelcast/hazelcast-client "3.12-BETA... | |
ba7412463fd34e3c1554a257faa5c5259345cc521b397c4eca6f815ad903b570 | wlitwin/graphv | perfGraph.ml | module Gv = Graphv_gles2
type style = FPS
| Ms
| Percent
type t = {
style : style;
name : string;
values : float array;
mutable head : int;
mutable last : float;
}
let init style name = {
name;
style;
values = Array.make 100 0.;
head = 0;
last = 0.;
... | null | https://raw.githubusercontent.com/wlitwin/graphv/d0a09575c5ff5ee3727c222dd6130d22e4cf62d9/examples/native_sdl/perfGraph.ml | ocaml | module Gv = Graphv_gles2
type style = FPS
| Ms
| Percent
type t = {
style : style;
name : string;
values : float array;
mutable head : int;
mutable last : float;
}
let init style name = {
name;
style;
values = Array.make 100 0.;
head = 0;
last = 0.;
... | |
a3ea5be5b8ee417ec6d0b5057b73390279712d20a094b0bcd7911287183cadcd | nuprl/gradual-typing-performance | tabulate-paths.rkt | #lang racket/base
TODO add parameters
TODO get quad / gregor results
;; Answers the question:
;; "For a given overhead N, how many paths
;; never have unacceptable performance?"
;; By creating a table:
;; - rows = overhead vs. untyped (variable N* in this file)
;; - columns = number of unacceptable conf... | null | https://raw.githubusercontent.com/nuprl/gradual-typing-performance/35442b3221299a9cadba6810573007736b0d65d4/tools/summarize/tabulate-paths.rkt | racket | Answers the question:
"For a given overhead N, how many paths
never have unacceptable performance?"
By creating a table:
- rows = overhead vs. untyped (variable N* in this file)
- columns = number of unacceptable configs along a path
- values = percent of paths where `column` configs have overhead gre... | #lang racket/base
TODO add parameters
TODO get quad / gregor results
Caveat : script does not run for quad & gregor . Those are too large .
(require
(only-in math/number-theory factorial)
(only-in racket/string string-suffix?)
gtp-summarize/summary
racket/format
racket/list
racket/match
)
(define... |
01c028fba8faa4f1d931ebe5e7c45171c134e5eab38efee9de8b20e16544f5ec | paulbutcher/electron-app | runner_visual.cljs | (ns {{name}}.test.runner-visual
(:require [cljs-test-display.core]
[figwheel.main.testing :refer-macros [run-tests]]
[{{name}}.renderer.arithmetic-test]
[{{name}}.main.arithmetic-test]))
(run-tests (cljs-test-display.core/init!))
| null | https://raw.githubusercontent.com/paulbutcher/electron-app/2b67a893b7dba60bf91d504a2daa009149c6fc9b/resources/clj/new/electron_app/src/test/test/runner_visual.cljs | clojure | (ns {{name}}.test.runner-visual
(:require [cljs-test-display.core]
[figwheel.main.testing :refer-macros [run-tests]]
[{{name}}.renderer.arithmetic-test]
[{{name}}.main.arithmetic-test]))
(run-tests (cljs-test-display.core/init!))
| |
4da4b562700e75ccadbed88fd750daaf882f8c2dce4c2973c659a0c914f4d819 | msfm2018/Online-Service | hub_client_gc_wc.erl | coding : utf-8
-module(hub_client_gc_wc).
-include("common.hrl").
-include("proto_player.hrl").
-compile(export_all).
loop(Socket, {init}) ->
ok;
loop(Socket, {terminate, Reason}) ->
case get(player_id) of
?UNDEFINED -> ok;
Player_Id ->
OldPid = ?ETS_LOOKUP_ELEMENT(?GC_PLAYER_INFO_ETS, Player_Id, ... | null | https://raw.githubusercontent.com/msfm2018/Online-Service/281c2db795f09c7e4dc6768d08d35bbe83350670/src/hub_client_gc_wc.erl | erlang | [[ 为了客户端好解析
先前是注册状态,
当前用户顶掉同节点上的用户
proto:pack(#mod_player_login_s2c{}),
登陆失败,当前这个账号正在登陆或者注册状态 直接返回稍后登陆
当前节点没有用户登陆此账号,直接登陆
访客给客服消息 0x03_web
false 跳出循环
false 跳出循环
io:format("~p~n", [Json_list]),
false 跳出循环
[
]
internal function | coding : utf-8
-module(hub_client_gc_wc).
-include("common.hrl").
-include("proto_player.hrl").
-compile(export_all).
loop(Socket, {init}) ->
ok;
loop(Socket, {terminate, Reason}) ->
case get(player_id) of
?UNDEFINED -> ok;
Player_Id ->
OldPid = ?ETS_LOOKUP_ELEMENT(?GC_PLAYER_INFO_ETS, Player_Id, ... |
0ca52e709d21b88de8c496f5a59319b0dcf7c2742fc145188252dd4288061bf8 | filipanselmo11/Lisp | 3.lisp | (defun quadrado(n) (* n n))
(defun soma(l) (cond ((equal nil l) 0) ((integerp(car l)) (if(evenp(car l)) (+ (quadrado(car l)) (soma(cdr l))) (soma(cdr l)))) (t (soma(cdr l)))))
(print (soma '(1 ss 0 4 a 8 gfy 3)))
| null | https://raw.githubusercontent.com/filipanselmo11/Lisp/0395bbfa40280ad0d9a9eab3378d813ec89e195a/3.lisp | lisp | (defun quadrado(n) (* n n))
(defun soma(l) (cond ((equal nil l) 0) ((integerp(car l)) (if(evenp(car l)) (+ (quadrado(car l)) (soma(cdr l))) (soma(cdr l)))) (t (soma(cdr l)))))
(print (soma '(1 ss 0 4 a 8 gfy 3)))
| |
641567b64acb75502c8d848baef1744c470c41e7d14e52592f4c53732e71e163 | NoahTheDuke/netrunner-data | data.clj | (ns nr-data.data
(:require
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.set :refer [rename-keys union]]
[clojure.string :as str]
[cond-plus.core :refer [cond+]]
[nr-data.utils :refer [cards->map prune-null-fields]]))
(defn read-edn-file
[file-path]
(edn/read-string (slurp file-path))... | null | https://raw.githubusercontent.com/NoahTheDuke/netrunner-data/8a38dd6a430033310ffc31b6796c9507799d9287/src/nr_data/data.clj | clojure | then we can check if the card is on the list | (ns nr-data.data
(:require
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.set :refer [rename-keys union]]
[clojure.string :as str]
[cond-plus.core :refer [cond+]]
[nr-data.utils :refer [cards->map prune-null-fields]]))
(defn read-edn-file
[file-path]
(edn/read-string (slurp file-path))... |
e16da1f3849e7958812caad46228c82e4147dc8f38d7ad4d5da899b6955c9a54 | rntz/moxy | values.rkt | #lang racket
;;(require (only-in racket [hash-map racket/hash-map]))
(require "util.rkt")
(require "tags.rkt")
;; Hashtable interface. Modelled on
;; -0.5.5.1/docs/Data-Map-Strict.html
;;
;; Needs to be defined here for access to Just, None.
;; TODO: more functionality
(provide
hash-empty? hash-count ... | null | https://raw.githubusercontent.com/rntz/moxy/18015aed1596ae55658be4ac9eb5cbb3debb1644/values.rkt | racket | (require (only-in racket [hash-map racket/hash-map]))
Hashtable interface. Modelled on
-0.5.5.1/docs/Data-Map-Strict.html
Needs to be defined here for access to Just, None.
TODO: more functionality
re-exports
hash-put-with hash-alter hash-map
convert a list-list like ((a x) (b y)) to a cons-list ((a . x) (b . y)... | #lang racket
(require "util.rkt")
(require "tags.rkt")
(provide
hash-empty hash-single hash-from-list hash-from-keys-values
hash-has? hash-lookup hash-get
hash-put hash-delete
hash-union)
(define hash-empty (hash))
(define (hash-single k v) (hash k v))
(define (hash-from-list kvs)
(make-immutable-hash (... |
cf40514f1ae11de1b08e505e7fa68a28e60b6c48f1173a25bf1594136c413f90 | tcsprojects/pgsolver | solverregistry.mli | open Paritygame
type global_solver_factory = string array -> global_solver
val register_solver_factory: global_solver_factory -> string -> string -> string -> unit
val register_solver: global_solver -> string -> string -> string -> unit
val mem_solver: string -> bool
val find_solver: string -> global_sol... | null | https://raw.githubusercontent.com/tcsprojects/pgsolver/b0c31a8b367c405baed961385ad645d52f648325/src/paritygame/solverregistry.mli | ocaml | open Paritygame
type global_solver_factory = string array -> global_solver
val register_solver_factory: global_solver_factory -> string -> string -> string -> unit
val register_solver: global_solver -> string -> string -> string -> unit
val mem_solver: string -> bool
val find_solver: string -> global_sol... | |
dbd892971d234b155bb7b68941c58668d0be8c82d475303a9053cad92e1b82c3 | tank-bohr/bookish_spork | bookish_spork_transport.erl | -module(bookish_spork_transport).
-export([
listen/2,
accept/1,
recv/1,
read_raw/2,
send/2,
close/1,
shutdown/1
]).
-export([
socket/1,
ssl_ext/1,
ssl_info/1,
connection_id/1
]).
-type callback_module() :: bookish_spork_tcp | bookish_spork_ssl.
-type socket() :: gen_tcp:so... | null | https://raw.githubusercontent.com/tank-bohr/bookish_spork/7e3acde6de789723ab6302707458ac6d13b9df58/src/bookish_spork_transport.erl | erlang | @doc generates unique id to be a connection id | -module(bookish_spork_transport).
-export([
listen/2,
accept/1,
recv/1,
read_raw/2,
send/2,
close/1,
shutdown/1
]).
-export([
socket/1,
ssl_ext/1,
ssl_info/1,
connection_id/1
]).
-type callback_module() :: bookish_spork_tcp | bookish_spork_ssl.
-type socket() :: gen_tcp:so... |
35d6fd0a846b9e192f18801e657d04c93b5d9843b4889754dda3dae7e334f7b2 | ghollisjr/cl-ana | package.lisp | cl - ana is a Common Lisp data analysis library .
Copyright 2013 , 2014
;;;;
This file is part of cl - ana .
;;;;
;;;; cl-ana 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 ... | null | https://raw.githubusercontent.com/ghollisjr/cl-ana/5cb4c0b0c9c4957452ad2a769d6ff9e8d5df0b10/hash-table-utils/package.lisp | lisp |
cl-ana is free software: you can redistribute it and/or modify it
(at your option) any later version.
cl-ana is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public Lice... | cl - ana is a Common Lisp data analysis library .
Copyright 2013 , 2014
This file is part of cl - ana .
under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
... |
383176ae18b11d4172d9412b2c8bd57dcd43aaef5b397d8000e08f7042197259 | yogthos/memory-hole | db.cljs | (ns memory-hole.db)
(def default-db
;; user should be coeffect on init event, not hard coded as it is here
{:user (js->clj js/user :keywordize-keys true)
:selected-tag "Recent"
:admin/show-all-groups? false
:active-page (when-not js/user :login)
:login-events ... | null | https://raw.githubusercontent.com/yogthos/memory-hole/925e399b0002d59998d10bd6f54ff3464a4b4ddb/src/cljs/memory_hole/db.cljs | clojure | user should be coeffect on init event, not hard coded as it is here | (ns memory-hole.db)
(def default-db
{:user (js->clj js/user :keywordize-keys true)
:selected-tag "Recent"
:admin/show-all-groups? false
:active-page (when-not js/user :login)
:login-events []})
|
080bd7594d5b9f12bfdc89162acbea4664db4bde6dd17d08bb29f80400948711 | KingMob/clojure-trie-performance | trie02.clj | (ns modulo-lotus.trie.trie02
(:require [clojure.string :refer (split triml)]
[taoensso.tufte :as tufte :refer (defnp p profiled profile)]))
;; From: -contacts/submissions/code/46151337
;; Like 00, but replaces {} with (array-map) - no real change
(defn add [db name]
(update-in db (seq name) (fnil ass... | null | https://raw.githubusercontent.com/KingMob/clojure-trie-performance/4c0c77799a0763c670fdde70b737e0af936a2bb8/src/modulo_lotus/trie/trie02.clj | clojure | From: -contacts/submissions/code/46151337
Like 00, but replaces {} with (array-map) - no real change | (ns modulo-lotus.trie.trie02
(:require [clojure.string :refer (split triml)]
[taoensso.tufte :as tufte :refer (defnp p profiled profile)]))
(defn add [db name]
(update-in db (seq name) (fnil assoc (array-map)) :* true))
(defn count-terminations [db]
(let [terminations (if (:* db) 1 0)]
(reduce... |
4e23613dea90ebe26e3b1965b0d5b41bad1b5445704a9966e2ceaebdac9c88cb | bmeurer/ocaml-rbtrees | rbmap.mli | -
* Copyright ( c ) 2007 , < >
*
* Permission is hereby granted , free of charge , to any person obtaining a
* copy of this software and associated documentation files ( the " Software " ) ,
* to deal in the Software without restriction , including without limitation
* the rights to use , copy , mo... | null | https://raw.githubusercontent.com/bmeurer/ocaml-rbtrees/06c879da5b009025e65b9cbe9a36405bcf301f35/src/rbmap.mli | ocaml | * The type of the map keys.
* Input signature of the functor {!Map.Make}.
* The type of the map keys.
* The type of maps from type [key] to type ['a].
* The empty map.
* Test whether a map is empty or not.
* [add x y m] returns a map containing the same bindings as
[m], plus a binding of [x] to [y]. If [x]... | -
* Copyright ( c ) 2007 , < >
*
* Permission is hereby granted , free of charge , to any person obtaining a
* copy of this software and associated documentation files ( the " Software " ) ,
* to deal in the Software without restriction , including without limitation
* the rights to use , copy , mo... |
d9fa3cee25a2952cee717d5bee359cb93334fdf6537366a406a6d7cee6b07a87 | haas/harmtrace | Annotate.hs | {-# OPTIONS_GHC -Wall #-}
# LANGUAGE GADTs #
{-# LANGUAGE ScopedTypeVariables #-}
# LANGUAGE TupleSections #
--------------------------------------------------------------------------------
-- |
Module : HarmTrace . Audio . Annotate
Copyr... | null | https://raw.githubusercontent.com/haas/harmtrace/e250855a3bb6e5b28fe538c728f707cf82ca9fd3/src/HarmTrace/Audio/Annotate.hs | haskell | # OPTIONS_GHC -Wall #
# LANGUAGE ScopedTypeVariables #
------------------------------------------------------------------------------
|
License : GPL3
Stability : experimental
Portability : non-portable
Summary: Combining low-level features (VAMP plug-ins) with high-level
--... | # LANGUAGE GADTs #
# LANGUAGE TupleSections #
Module : HarmTrace . Audio . Annotate
Copyright : ( c ) 2010 - 2012 Universiteit Utrecht , 2012 University of Oxford
Maintainer : ,
knowledge ( the HarmTrace harmony model )
module HarmTrace.Audio.Annotate ... |
bda8427105f61b1740645944261fde4b90fd1ed07fba80e22f39e1dc1ffbe6d4 | DaveWM/lobster-writer | core.clj | (ns lobster-writer.core)
| null | https://raw.githubusercontent.com/DaveWM/lobster-writer/98eef942cc61725f0a2e00c34e6952c1e262f1ad/src/clj/lobster_writer/core.clj | clojure | (ns lobster-writer.core)
| |
e404db7edbf1cb124a9807aec908147b25720568e7f7d33edb1ff1dfbb791631 | fogfish/typhoon | typhoon.erl | %%
%% Copyright 2015 Zalando SE
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
... | null | https://raw.githubusercontent.com/fogfish/typhoon/db0d76050a9c41c45582e9928206270450600d00/apps/typhoon/src/typhoon.erl | erlang |
Copyright 2015 Zalando SE
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 Licens... | Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(typhoon).
-author('').
-include_lib("ambitz/include/ambitz.hrl").
-compile({parse_transform, category}).
-export([start/0]).
-export([
put/3
,get/2
,remove... |
250a1e60d093c1047a3a700061488447d009879639b488e6ee32e5d83405491a | CSVdB/pinky | Internal.hs | # LANGUAGE DeriveGeneric #
# LANGUAGE RecordWildCards #
# LANGUAGE FlexibleContexts #
module Pinky.Core.HyperParams.Internal where
import Import
import Pinky.Utils
import Control.Monad.State.Lazy
import Pinky.Utils.PositiveInt.Internal
data HyperParams = HyperParams
{ hyperRate :: PositiveDouble
, hyperDe... | null | https://raw.githubusercontent.com/CSVdB/pinky/e77a4c0812ceb4b8548c41a7652fb247c2ab39e0/pinky/src/Pinky/Core/HyperParams/Internal.hs | haskell | # LANGUAGE DeriveGeneric #
# LANGUAGE RecordWildCards #
# LANGUAGE FlexibleContexts #
module Pinky.Core.HyperParams.Internal where
import Import
import Pinky.Utils
import Control.Monad.State.Lazy
import Pinky.Utils.PositiveInt.Internal
data HyperParams = HyperParams
{ hyperRate :: PositiveDouble
, hyperDe... | |
289b4980de331eb5008516eafef74a8ec09406198dc384d2265b68df36eada47 | kallisti-dev/hs-webdriver | WebDriver.hs | |
This module serves as the top - level interface to the Haskell WebDriver bindings ,
providing most of the functionality you 're likely to want .
This module serves as the top-level interface to the Haskell WebDriver bindings,
providing most of the functionality you're likely to want.
-}
module Test.WebDriver
... | null | https://raw.githubusercontent.com/kallisti-dev/hs-webdriver/ea594ce8720c9e11f053b2567f250079f0eac33b/src/Test/WebDriver.hs | haskell | ** Configuration helper functions
| Instead of working with the 'Capabilities' record directly, you can use
these config modifier functions to specify common options.
** Session history configuration
** HTTP request header utilities
* Capabilities (advanced configuration)
** Browser-specific capabilities
***... | |
This module serves as the top - level interface to the Haskell WebDriver bindings ,
providing most of the functionality you 're likely to want .
This module serves as the top-level interface to the Haskell WebDriver bindings,
providing most of the functionality you're likely to want.
-}
module Test.WebDriver
... |
b63e7a10a2ef217f82e20f439823e523c7a77fc0951704b59f1a7491994d30f7 | gas2serra/mcclim-desktop | commands.lisp | (in-package :desktop-app-manager)
(define-desktop-app-manager-command (com-quit :menu nil
:keystroke (#\q :meta))
()
(clim:frame-exit clim:*application-frame*))
(define-desktop-app-manager-command (com-refresh :menu nil
:keystroke (#\r :meta))
()
(clim:redisplay-frame-pane clim:*ap... | null | https://raw.githubusercontent.com/gas2serra/mcclim-desktop/f85d19c57d76322ae3c05f98ae43bfc8c0d0a554/Apps/app-manager/gui/commands.lisp | lisp | traslators | (in-package :desktop-app-manager)
(define-desktop-app-manager-command (com-quit :menu nil
:keystroke (#\q :meta))
()
(clim:frame-exit clim:*application-frame*))
(define-desktop-app-manager-command (com-refresh :menu nil
:keystroke (#\r :meta))
()
(clim:redisplay-frame-pane clim:*ap... |
20f65e38b4538e1afddd64550e49bc74e518a49239549bb9df86ff0491cdabfa | haskell-repa/repa | Gang.hs |
-- | Gang Primitives.
module Data.Repa.Eval.Gang
(Gang, forkGang, gangSize, gangIO, gangST)
where
import GHC.IO
import GHC.ST
import GHC.Conc (forkOn)
import Control.Concurrent.MVar
import Control.Exception (assert)
import Control.Monad
import System.IO
import GHC.Exts
-- Requests... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/repa-eval/Data/Repa/Eval/Gang.hs | haskell | | Gang Primitives.
Requests -------------------------------------------------------------------
| The 'Req' type encapsulates work requests for individual members of a gang.
| Instruct the worker to run the given action.
| Tell the worker that we're shutting the gang down.
The worker should signal that it's rec... |
module Data.Repa.Eval.Gang
(Gang, forkGang, gangSize, gangIO, gangST)
where
import GHC.IO
import GHC.ST
import GHC.Conc (forkOn)
import Control.Concurrent.MVar
import Control.Exception (assert)
import Control.Monad
import System.IO
import GHC.Exts
data Req
= ReqDo (... |
2ae1019b45980afe472595f6587b07cf7bcf93b688bc85a430022f70e4d71699 | dialohq/ocaml-grpc | buffer.mli | type t
(** [t] represents a buffer which is based on bytes but keeps track of the
length of valid data inside it. The internal capacity is increased when
needed. *)
val v : ?capacity:int -> unit -> t
(** [c ~capacity ()] creates a new buffer with internal capacity [capacity]. *)
val length : t -> int
(** [len... | null | https://raw.githubusercontent.com/dialohq/ocaml-grpc/79fa9373db069f7c8840b2f52b5df89499f75ba2/lib/grpc/buffer.mli | ocaml | * [t] represents a buffer which is based on bytes but keeps track of the
length of valid data inside it. The internal capacity is increased when
needed.
* [c ~capacity ()] creates a new buffer with internal capacity [capacity].
* [length t] returns the length of valid data in the buffer.
* [capacity t] retur... | type t
val v : ?capacity:int -> unit -> t
val length : t -> int
val capacity : t -> int
val to_bytes : t -> bytes
val to_string : t -> string
val copy_from_bigstringaf :
src_off:int -> src:Bigstringaf.t -> dst:t -> length:int -> unit
* [ copy_from_bigstringaf ~src_off ~src ~dst ] copies data from [ src ]
... |
5ec0bd0301000adf6f6d5eb8323eea36c7f83a7f57da8eecc44397fd85f8e397 | nextjournal/advent-of-clerk | day_25.clj | # 🎄 Advent of Clerk : Day 25
(ns advent-of-clerk.day-25
(:require [nextjournal.clerk :as clerk]))
| null | https://raw.githubusercontent.com/nextjournal/advent-of-clerk/2401fe42669220673f4a8dc6b70682483fae7038/src/advent_of_clerk/day_25.clj | clojure | # 🎄 Advent of Clerk : Day 25
(ns advent-of-clerk.day-25
(:require [nextjournal.clerk :as clerk]))
| |
0bef7b92f361beb0de2c83418ed9d67284de512b673429fa9e8176c0f8b208cd | gedge-platform/gedge-platform | rabbit_prometheus_handler.erl | 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 /.
%%
Copyright ( c ) 2007 - 2021 VMware , Inc. or its affiliates . All rights reserved .
%%
-module(rabbit_prometheus_handler).
-export([init... | null | https://raw.githubusercontent.com/gedge-platform/gedge-platform/97c1e87faf28ba2942a77196b6be0a952bff1c3e/gs-broker/broker-server/deps/rabbitmq_prometheus/src/rabbit_prometheus_handler.erl | erlang |
===================================================================
Cowboy Handler Callbacks
===================================================================
===================================================================
Private functions
=================================================================... | 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 /.
Copyright ( c ) 2007 - 2021 VMware , Inc. or its affiliates . All rights reserved .
-module(rabbit_prometheus_handler).
-export([init/2]).
... |
6f5a43b9e4ffd7409e8d62e37d4b2e52341ad35eb5e36b7ea0809ae6ba1c32ad | debug-ito/greskell | Env.hs | module TestUtil.Env
( requireEnv
, withEnvForExtServer
, withEnvForIntServer
) where
import System.Environment (lookupEnv)
import Test.Hspec
import Network.Greskell.WebSocket.Connection (Host, Port)
requireEnv :: String -> IO String
requireEnv env_key ... | null | https://raw.githubusercontent.com/debug-ito/greskell/ff21b8297a158cb4b5bafcbb85094cef462c5390/greskell-websocket/test/TestUtil/Env.hs | haskell | module TestUtil.Env
( requireEnv
, withEnvForExtServer
, withEnvForIntServer
) where
import System.Environment (lookupEnv)
import Test.Hspec
import Network.Greskell.WebSocket.Connection (Host, Port)
requireEnv :: String -> IO String
requireEnv env_key ... | |
735924072eb209d1e7b38dfe6ebae42a1891ac210941ff4def9ddf69ce231eed | synduce/Synduce | list_mps.ml |
let base_case = 0
let init a = max a 0
let join b c = max b (b + c)
let rec h =
function CNil -> base_case | Single(x) -> init x
| Concat(x, y) -> join (h x) (h y)
| null | https://raw.githubusercontent.com/synduce/Synduce/289888afb1c312adfd631ce8d90df2134de827b8/extras/solutions/constraints/all_positive/list_mps.ml | ocaml |
let base_case = 0
let init a = max a 0
let join b c = max b (b + c)
let rec h =
function CNil -> base_case | Single(x) -> init x
| Concat(x, y) -> join (h x) (h y)
| |
2ce675fa5f24e3330ff120effa09d592f08b0dcea766c1eb705c1e3e1e6a6e5f | emqx/replayq | benchmark_tests.erl | -module(benchmark_tests).
-include_lib("eunit/include/eunit.hrl").
-define(DIR, filename:join([data_dir(), ?FUNCTION_NAME, integer_to_list(uniq())])).
-define(WRITE_CHUNK_SIZE, 1).
-define(ITEM_BYTES, 256).
change to 10 or even more for real test
run_test_() ->
Dir = ?DIR,
Config = #{dir => Dir, seg_bytes => 1... | null | https://raw.githubusercontent.com/emqx/replayq/cd54fbfd7bc2671f7a10bf5a9ef9fd16318def73/test/benchmark_tests.erl | erlang | -module(benchmark_tests).
-include_lib("eunit/include/eunit.hrl").
-define(DIR, filename:join([data_dir(), ?FUNCTION_NAME, integer_to_list(uniq())])).
-define(WRITE_CHUNK_SIZE, 1).
-define(ITEM_BYTES, 256).
change to 10 or even more for real test
run_test_() ->
Dir = ?DIR,
Config = #{dir => Dir, seg_bytes => 1... | |
7fb022b2720cd2da5d3ed25a0aa7f87d52ad2fd0bad12dd426655baa6665b3d7 | frenetic-lang/ocaml-openflow | GroupTable0x04.ml | open OpenFlow0x04
open OpenFlow0x04_Core
type t = {
table : (groupId, (groupType * bucket list)) Hashtbl.t;
mutable next_group_id : groupId;
mutable pending_messages : Message.t list
}
let create () : t = {
table = Hashtbl.create 100;
next_group_id = 1l;
pending_messages = []
}
let add_group (tbl : t) (typ : ... | null | https://raw.githubusercontent.com/frenetic-lang/ocaml-openflow/289ffb8a692cf32b8413cc58044aae9c151ddd44/lib/GroupTable0x04.ml | ocaml | open OpenFlow0x04
open OpenFlow0x04_Core
type t = {
table : (groupId, (groupType * bucket list)) Hashtbl.t;
mutable next_group_id : groupId;
mutable pending_messages : Message.t list
}
let create () : t = {
table = Hashtbl.create 100;
next_group_id = 1l;
pending_messages = []
}
let add_group (tbl : t) (typ : ... | |
40bd69ce67de77b10a58516b994dd24f45481de596959ed2a4f25c6fbe94c7ee | typelead/intellij-eta | Comment00005.hs | module Comment00005 where
z = 2
This function implements double buffering of state for imnmutable
seqential loops ( forLoop and whileLoop ) . The intention is to generate
the minimal amount of copying ( especially deep array copies ) while
also avoiding frequent references to data that can not be allocated ... | null | https://raw.githubusercontent.com/typelead/intellij-eta/ee66d621aa0bfdf56d7d287279a9a54e89802cf9/plugin/src/test/resources/fixtures/eta/sources/Comment00005.hs | haskell | module Comment00005 where
z = 2
This function implements double buffering of state for imnmutable
seqential loops ( forLoop and whileLoop ) . The intention is to generate
the minimal amount of copying ( especially deep array copies ) while
also avoiding frequent references to data that can not be allocated ... | |
2395517d072b56758acff9e9726d26a247d946694485d9abfbe1d4798ca85932 | nodename/stately | re_frame_api.cljs | (ns nodename.stately.communications.re-frame-api
(:require [re-frame.core :as re-frame]
[re-frame.utils :as utils]
[re-frame.handlers :as handlers]
[re-frame.db :as db]))
(def dispatch re-frame/dispatch)
(def run-queue #()) ;; re-frame runs the queue automatically
(def register-h... | null | https://raw.githubusercontent.com/nodename/stately/cf4e1092445f1b88f0846756ba053ac1e2c5b9bf/src/nodename/stately/communications/re_frame_api.cljs | clojure | re-frame runs the queue automatically | (ns nodename.stately.communications.re-frame-api
(:require [re-frame.core :as re-frame]
[re-frame.utils :as utils]
[re-frame.handlers :as handlers]
[re-frame.db :as db]))
(def dispatch re-frame/dispatch)
(def register-handler re-frame/register-handler)
(def lookup-handler handler... |
90a0d351dcfaecc4c613c177cf84a90e982fe82e800c563e76b9172653342db5 | esumii/min-caml | asm.ml | 2オペランドではなく3オペランドのx86アセンブリもどき
type id_or_imm = V of Id.t | C of int
type t = (* 命令の列 (caml2html: sparcasm_t) *)
| Ans of exp
| Let of (Id.t * Type.t) * exp * t
and exp = (* 一つ一つの命令に対応する式 (caml2html: sparcasm_exp) *)
| Nop
| Set of int
| SetL of Id.l
| Mov of Id.t
| Neg of Id.t
| Add of Id.t * id_or_im... | null | https://raw.githubusercontent.com/esumii/min-caml/8860b6fbc50786a27963aff1f7639b94c244618a/x86/asm.ml | ocaml | 命令の列 (caml2html: sparcasm_t)
一つ一つの命令に対応する式 (caml2html: sparcasm_exp)
virtual instructions
左右対称ではないので必要
closure address, integer arguments, and float arguments
レジスタ変数の値をスタック変数へ保存 (caml2html: sparcasm_save)
スタック変数から値を復元 (caml2html: sparcasm_restore)
Array.init 16 (fun i -> Printf.sprintf "%%r%d" i)
closu... | 2オペランドではなく3オペランドのx86アセンブリもどき
type id_or_imm = V of Id.t | C of int
| Ans of exp
| Let of (Id.t * Type.t) * exp * t
| Nop
| Set of int
| SetL of Id.l
| Mov of Id.t
| Neg of Id.t
| Add of Id.t * id_or_imm
| Sub of Id.t * id_or_imm
| Ld of Id.t * id_or_imm * int
| St of Id.t * Id.t * id_or_imm * i... |
6a0a23ce895b7cceb31d7fccab346dd78d49241441f45ba47f0c1e7cc368a200 | dongcarl/guix | gnuzilla.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2013 , 2015 < >
Copyright © 2013 , 2014 , 2015 , 2016 , 2017 , 2018 , 2019 , 2020 < >
Copyright © 2014 , 2015 , 2016 , 2017 , 2018 , 2019 , 2020 , 2021 < >
Copyright © 2015 < >
Copyright © 2016 , 2017 , 2018 , 2019 , 2021 < >
... | null | https://raw.githubusercontent.com/dongcarl/guix/d2b30db788f1743f9f8738cb1de977b77748567f/gnu/packages/gnuzilla.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2013 , 2015 < >
Copyright © 2013 , 2014 , 2015 , 2016 , 2017 , 2018 , 2019 , 2020 < >
Copyright © 2014 , 2015 , 2016 , 2017 , 2018 , 2019 , 2020 , 2021 < >
Copyright © 2015 < >
Copyright © 2016 , 2017 , 2018 , 2019 , 2021 < >
Copyright © 2016 < >
Copyright © 2017 Clément < ... |
4ce47558b04aed73a08e6c99826b8c32bf31c1a022083e2c47997aa0e6c58ad7 | cram2/cram | prolog.lisp | Copyright ( c ) 2012 , < >
;;; All rights reserved.
;;;
;;; 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 o... | null | https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_common/cram_occupancy_grid_costmap/src/prolog.lisp | lisp | All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions are met:
* Redistributions of source code must retain the above copyright
notice, this list of conditions and the following disclaimer.
* Red... | Copyright ( c ) 2012 , < >
* Neither the name of the Intelligent Autonomous Systems Group/
THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS " AS IS "
IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
ARE DISCLAIMED . IN NO EVENT SHALL THE COPYRIGHT OWNER OR ... |
89f8adec8e1ae7183e5fcb7543a8d636d4026ce2767e59f21e63a279d8cce631 | gerritjvv/fileape | write_support.clj | (ns
^{:doc "Implement java write support for parquet
the different types and cases that can be written is
done via multimethods while the actual WriterSupport is reified"}
fileape.parquet.write-support
(:require [fileape.util.lang :refer [case-enum]]
[clojure.tools.logging :refer [... | null | https://raw.githubusercontent.com/gerritjvv/fileape/be8859fea1745e572463b658f8eb057aa46fe46d/src/fileape/parquet/write_support.clj | clojure |
(Binary/fromConstantByteArray ^"[B" v)
\n optional binary value;\n }\n}"
\n optional binary value;\n }\n}
} }
write hive compatible date
write a hive compatible map type
repeated group map (MAP_KEY_VALUE) {
required binary key;
... | (ns
^{:doc "Implement java write support for parquet
the different types and cases that can be written is
done via multimethods while the actual WriterSupport is reified"}
fileape.parquet.write-support
(:require [fileape.util.lang :refer [case-enum]]
[clojure.tools.logging :refer [... |
7c6a02c046ad1b5c53ccb73bf06fe0aa3e4736a35af33f902cc7fbaf836e56a6 | nomeata/incredible | ProofGraph.hs | # LANGUAGE DataKinds , TypeFamilies , RecordWildCards , FlexibleContexts , StandaloneDeriving , FlexibleInstances , GADTs , ExistentialQuantification #
-- |
-- The proof is (natuarlly) a directed graph. For full detail, one can view
-- blocks, out-ports, connections and in-ports as nodes of the graph. This
-- module r... | null | https://raw.githubusercontent.com/nomeata/incredible/d18ada4ae7ce1c7ca268c050ee688b633a307c2e/logic/ProofGraph.hs | haskell | |
The proof is (natuarlly) a directed graph. For full detail, one can view
blocks, out-ports, connections and in-ports as nodes of the graph. This
module realizes this view, and provides algorithms based on that.
This module plays with type families to get a very strongly typed graph, and
it ties the know to hav... | # LANGUAGE DataKinds , TypeFamilies , RecordWildCards , FlexibleContexts , StandaloneDeriving , FlexibleInstances , GADTs , ExistentialQuantification #
module ProofGraph where
import qualified Data.IntMap as IM
import qualified Data.Map as M
import qualified Data.IntSet as IS
import Data.Map ((!))
import Data.List
im... |
6b301c238a7303bc1d8f944c16d83e250025a8a9477cd10ca7dbfff7974f7a69 | basho/mochiweb | mochiweb_request.erl | @author < >
2007 Mochi Media , Inc.
%%
%% Permission is hereby granted, free of charge, to any person obtaining a
%% copy of this software and associated documentation files (the "Software"),
to deal in the Software without restriction , including without limitation
%% the rights to use, copy, modify, merge, ... | null | https://raw.githubusercontent.com/basho/mochiweb/34d3e420c3b74bde56483d8bd2896e03126314bb/src/mochiweb_request.erl | erlang |
Permission is hereby granted, free of charge, to any person obtaining a
copy of this software and associated documentation files (the "Software"),
the rights to use, copy, modify, merge, publish, distribute, sublicense,
Software is furnished to do so, subject to the following conditions:
The above copyright noti... | @author < >
2007 Mochi Media , Inc.
to deal in the Software without restriction , including without limitation
and/or sell copies of the Software , and to permit persons to whom the
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , E... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.