_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 |
|---|---|---|---|---|---|---|---|---|
cf0ac432cead1d998be23b2d8088963ad59a05f9d4ae24e796af9a9fcb9db8c1 | igorhvr/bedlam | javascript-code.scm | (define-generic-java-method get |get|)
(define-generic-java-method set |set|)
;;nodejs - remote
(define (nodejs-global code)
(log-trace "About to execute js code" code)
(let ((result (http-call-post-string/string ":27429/" code)))
(log-trace "Result" result)
(if (and result
(not (string=? "" r... | null | https://raw.githubusercontent.com/igorhvr/bedlam/b62e0d047105bb0473bdb47c58b23f6ca0f79a4e/iasylum/javascript-code.scm | scheme | nodejs - remote
generic
rhino
" ) ) )
mtlv8;")))
(define (v8-js-manager) "<for-v8-no-js-manager-because-we-are-single-threaded>")
rhino
(d/n "Will run code: (((((" code "))))) saved to " (save-to-somewhere code))
(d/n "vars: " vars)
"
(d/n "saving " sname " to " (save-to-somewhere vvalue))
"
(d/n... | (define-generic-java-method get |get|)
(define-generic-java-method set |set|)
(define (nodejs-global code)
(log-trace "About to execute js code" code)
(let ((result (http-call-post-string/string ":27429/" code)))
(log-trace "Result" result)
(if (and result
(not (string=? "" result)))
(... |
6a05f9299c1d78a64b03bfc65196a856726f93d4ede9ce220120e52b2dba958a | ivanjovanovic/sicp | e-3.65.scm | Exercise 3.65 . Use the series
ln2 = 1 - 1/2 + 1/3 - 1/4 + ...
to compute three sequences of approximations to the natural logarithm
of 2 , in the same way we did above for . How rapidly do these
; sequences converge?
; ------------------------------------------------------------
| null | https://raw.githubusercontent.com/ivanjovanovic/sicp/a3bfbae0a0bda414b042e16bbb39bf39cd3c38f8/3.5/e-3.65.scm | scheme | sequences converge?
------------------------------------------------------------ | Exercise 3.65 . Use the series
ln2 = 1 - 1/2 + 1/3 - 1/4 + ...
to compute three sequences of approximations to the natural logarithm
of 2 , in the same way we did above for . How rapidly do these
|
4b2926f4be06e6bc33a17f293885a8bf0cec865ae4a9c039e5c9bb649e764cb1 | DSiSc/why3 | gappa.ml | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
(* ... | null | https://raw.githubusercontent.com/DSiSc/why3/8ba9c2287224b53075adc51544bc377bc8ea5c75/src/printer/gappa.ml | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2018 -- Inria - CNRS - Paris - Sud University
General Public License version 2.1 , with the special exception
open Format
open Pp
open Printer
open Ident
open Term
open Decl
open Theory
open Task
let syntactic_tran... |
f89bfa4bd8d092a88af38eafb93c6aa3858b32df3a2fe80be61a93b4f88821a3 | slipstream/SlipStreamServer | user_template_github.clj | (ns com.sixsq.slipstream.ssclj.resources.user-template-github
"
Resource that is used to create a user account from a GitHub authentication
workflow.
"
(:require
[com.sixsq.slipstream.ssclj.resources.common.utils :as u]
[com.sixsq.slipstream.ssclj.resources.resource-metadata :as md]
[com.sixsq.slipstrea... | null | https://raw.githubusercontent.com/slipstream/SlipStreamServer/3ee5c516877699746c61c48fc72779fe3d4e4652/cimi/src/com/sixsq/slipstream/ssclj/resources/user_template_github.clj | clojure |
resource
description
initialization: register this User template
multimethods for validation
| (ns com.sixsq.slipstream.ssclj.resources.user-template-github
"
Resource that is used to create a user account from a GitHub authentication
workflow.
"
(:require
[com.sixsq.slipstream.ssclj.resources.common.utils :as u]
[com.sixsq.slipstream.ssclj.resources.resource-metadata :as md]
[com.sixsq.slipstrea... |
bc1c84b4da67426f09d6a6d9f6e692ffa4dee81fb481978acd1cdfd7beefc817 | lispbuilder/lispbuilder | package.lisp | ;;; -*- lisp -*-
(in-package #:cl-user)
(defpackage #:lispbuilder-opengl-examples
(:use #:cl #:cffi)
(:nicknames #:gl-examples)
(:documentation "Examples for `lispbuilder-opengl'.")
(:export #:opengl-gears))
| null | https://raw.githubusercontent.com/lispbuilder/lispbuilder/589b3c6d552bbec4b520f61388117d6c7b3de5ab/lispbuilder-opengl/examples/package.lisp | lisp | -*- lisp -*- |
(in-package #:cl-user)
(defpackage #:lispbuilder-opengl-examples
(:use #:cl #:cffi)
(:nicknames #:gl-examples)
(:documentation "Examples for `lispbuilder-opengl'.")
(:export #:opengl-gears))
|
d782d0954fe91ca99b012c63ede9fd25272eac8ac12c607748687cd0b06aca10 | devaspot/games | deck.erl | Author : < >
Created : Oct 8 , 2012
%% Description: The library for manipulations with decks.
-module(deck).
%% Predefined types of deck:
%% empty - No one element in the deck.
%%
%% okey - The deck consist of such types of element: {Color, Value} | false_okey.
There are two instances of each e... | null | https://raw.githubusercontent.com/devaspot/games/a1f7c3169c53d31e56049e90e0094a3f309603ae/apps/server/src/lib/deck.erl | erlang | Description: The library for manipulations with decks.
Predefined types of deck:
empty - No one element in the deck.
okey - The deck consist of such types of element: {Color, Value} | false_okey.
Include files
Exported Functions
API Functions
@doc Creates a deck.
@end
@spec from_list(List) -> Dec... | Author : < >
Created : Oct 8 , 2012
-module(deck).
There are two instances of each element in the deck .
Color = 1 .. 4
Value = 1 .. 13
-export([
init_deck/1,
from_list/1,
to_list/1,
shuffle/1,
pop/2,
push/2,
... |
0c7e526df4259b80b7eb9fe9db980aef58a84a794fca8515a1af535a0af392d8 | restyled-io/restyled.io | Env.hs | -- | Local version of @envparse@
module Restyled.Env
( Error
, Parser
, auto
, def
, nonempty
, str
, switch
, var
-- * Overrides
, parse
, splitOn
-- * Extensions
, eitherReader
-- * Specialized @'Reader'@s
, connectInfo
, githubId
-- * Specialize... | null | https://raw.githubusercontent.com/restyled-io/restyled.io/85589518a297f5378c7d74ab720e59441c3b13bc/src/Restyled/Env.hs | haskell | | Local version of @envparse@
* Overrides
* Extensions
* Specialized @'Reader'@s
* Specialized @'Parser'@s | module Restyled.Env
( Error
, Parser
, auto
, def
, nonempty
, str
, switch
, var
, parse
, splitOn
, eitherReader
, connectInfo
, githubId
, postgresConf
) where
import Restyled.Prelude hiding (Reader)
import Database.Redis (ConnectInfo, parseConnectInf... |
012aa31eb7b116ec0b55e164a312ae6d93d8207ae3e52f56a5a08b59854cc87e | PataphysicalSociety/soupault | version.ml | (* Version comparison *)
Parses a version string .
The goal is to support full semver strings like 4.2.0 - beta1 ( compliant )
and also partial versions like 4 ( implied 4.0.0 ) and 4.2 ( implied 4.2.0 ) .
Partial versions are against the semver spec but
[ Plugin.require_version(4 ) ] is much s... | null | https://raw.githubusercontent.com/PataphysicalSociety/soupault/7e580f082bdda09f3b280a943162efe0abcdab8b/src/version.ml | ocaml | Version comparison
Scanf is used here because it's easy to use and it's in the standard library.
That approach can't separate pre-release suffix and build metadata in a case like 1.2.3-beta+20210919.
However, the semver.org standard says that build metadata must be ignored in comparisons,
so we don't... |
Parses a version string .
The goal is to support full semver strings like 4.2.0 - beta1 ( compliant )
and also partial versions like 4 ( implied 4.0.0 ) and 4.2 ( implied 4.2.0 ) .
Partial versions are against the semver spec but
[ Plugin.require_version(4 ) ] is much shorter to write and , arg... |
bfdf96b302943451055d599025777ba9a23340f181a38cfddb8062ed07b22e46 | markbastian/partsbin | alpha.clj | (ns partsbin.immutant.web.websocket.alpha)
| null | https://raw.githubusercontent.com/markbastian/partsbin/8dc159327f296c9625d129b5943ec79433019e54/src/partsbin/immutant/web/websocket/alpha.clj | clojure | (ns partsbin.immutant.web.websocket.alpha)
| |
5e8992042ae07c0db976d84c1363473a7ae29566cdef835aa2506af07827c5c6 | scicloj/tablecloth | missing.clj | (ns tablecloth.api.missing
(:require [tech.v3.dataset :as ds]
[tech.v3.dataset.math :as dm]
[tablecloth.api.utils :refer [column-names grouped? process-group-data]]
[tablecloth.api.columns :refer [select-columns]]))
(defn- select-or-drop-missing
"Select rows with mi... | null | https://raw.githubusercontent.com/scicloj/tablecloth/517c75e1dced1f27a81e237721ebe809870e1b04/src/tablecloth/api/missing.clj | clojure | (ns tablecloth.api.missing
(:require [tech.v3.dataset :as ds]
[tech.v3.dataset.math :as dm]
[tablecloth.api.utils :refer [column-names grouped? process-group-data]]
[tablecloth.api.columns :refer [select-columns]]))
(defn- select-or-drop-missing
"Select rows with mi... | |
65545876b4e6cff4f200d4a85f62286a5ff480a48a420b55040f3f5340f13d8a | snoyberg/why-you-should-use-stm | solution.hs | #!/usr/bin/env stack
-- stack --resolver lts-13.21 script
import Control.Concurrent.STM
main :: IO ()
main = do
var <- newTVarIO 5
atomically $ do
x <- readTVar var
check (x >= 10)
writeTVar var $ x - 10
| null | https://raw.githubusercontent.com/snoyberg/why-you-should-use-stm/adf3366aebd6daf1dd702ed4cad1c2303d296afc/exercises/08-deadlock/solution.hs | haskell | stack --resolver lts-13.21 script | #!/usr/bin/env stack
import Control.Concurrent.STM
main :: IO ()
main = do
var <- newTVarIO 5
atomically $ do
x <- readTVar var
check (x >= 10)
writeTVar var $ x - 10
|
4d08db076af4f0f60a3cf2de3d1cbe44bcb707659575a599dc19d345821bd22f | donut/OCamURL-server | insert.ml |
open Lib_model
open Lwt.Infix
open Printf
open Util
exception Last_inserted_ID_missing of string
let get_last_insert_id db_conn query =
let query = "SELECT LAST_INSERT_ID() as id" in
execute db_conn query [||] Select.id_of_first_row >>= (function
| None -> raise (Last_inserted_ID_missing query)
| Some id -> L... | null | https://raw.githubusercontent.com/donut/OCamURL-server/87738c1a0bbfc2c848f9f4e2052cacc81a176489/lib/db/insert.ml | ocaml |
open Lib_model
open Lwt.Infix
open Printf
open Util
exception Last_inserted_ID_missing of string
let get_last_insert_id db_conn query =
let query = "SELECT LAST_INSERT_ID() as id" in
execute db_conn query [||] Select.id_of_first_row >>= (function
| None -> raise (Last_inserted_ID_missing query)
| Some id -> L... | |
972518643d383ff05090c3be003da4a17dbc5fb3231e81673ce820d121cb2524 | lipas-liikuntapaikat/lipas | db.cljs | (ns lipas.ui.map.db)
(def default-db
{:drawer-open? true
:center {:lon 435047 :lat 7201408}
:zoom 2
:mode {:name :default}
:basemap :taustakartta
:selected-overlays #{:vectors :edits :markers :analysis :schools :population}
:import
{:dialog-ope... | null | https://raw.githubusercontent.com/lipas-liikuntapaikat/lipas/5cb995420b615c64f2f583d473854eb7585b5832/webapp/src/cljs/lipas/ui/map/db.cljs | clojure | (ns lipas.ui.map.db)
(def default-db
{:drawer-open? true
:center {:lon 435047 :lat 7201408}
:zoom 2
:mode {:name :default}
:basemap :taustakartta
:selected-overlays #{:vectors :edits :markers :analysis :schools :population}
:import
{:dialog-ope... | |
8442452018535e24c3c4733e7fc7b1b39dfeafa48cbf37cff7c2a233565d2598 | zenspider/schemers | exercise.2.64.scm | #lang racket/base
(require "../lib/test.rkt")
(require "../lib/myutils.scm")
Exercise 2.64 :
The following procedure ` list->tree ' converts an ordered list to a
;; balanced binary tree. The helper procedure `partial-tree' takes as
;; arguments an integer n and list of at least n elements and
constructs a bala... | null | https://raw.githubusercontent.com/zenspider/schemers/2939ca553ac79013a4c3aaaec812c1bad3933b16/sicp/ch_2/exercise.2.64.scm | scheme | balanced binary tree. The helper procedure `partial-tree' takes as
arguments an integer n and list of at least n elements and
list. The result returned by `partial-tree' is a pair (formed with
`cons') whose `car' is the constructed tree and whose `cdr' is the
list of elements not included in the tree.
a. Write ... | #lang racket/base
(require "../lib/test.rkt")
(require "../lib/myutils.scm")
Exercise 2.64 :
The following procedure ` list->tree ' converts an ordered list to a
constructs a balanced tree containing the first n elements of the
(define entry car)
(define left-branch cadr)
(define right-branch caddr)
(define m... |
183bc8a52fcd3e3fbc5f1ce408b6e2fc081cd87e02c707e0e87d0aaa63e83983 | alakahakai/hackerrank | subset-sum-vector.hs |
Subset Sum
-sum
Author : < >
Date : June 10th , 2015
Subset Sum
-sum
Author: Ray Qiu <>
Date: June 10th, 2015
-}
import Control.Applicative (liftA)
import Control.Monad (forM_)
import Data.List (sortBy)
import Data.Ord
import qualifi... | null | https://raw.githubusercontent.com/alakahakai/hackerrank/465d17107bbe402daf750651bb57cf092305acf9/fp/subset-sum-vector.hs | haskell | _ <- readLn :: IO Int
n <- readLn :: IO Int
m <- readLn :: IO Int |
Subset Sum
-sum
Author : < >
Date : June 10th , 2015
Subset Sum
-sum
Author: Ray Qiu <>
Date: June 10th, 2015
-}
import Control.Applicative (liftA)
import Control.Monad (forM_)
import Data.List (sortBy)
import Data.Ord
import qualifi... |
ce5de1c211239f5e3c4d02a22eded1aaf8d36ff22af488eb25cec1d6156e7be7 | caribou/caribou-core | h2.clj | (ns caribou.db.adapter.h2
(:require [clojure.java.jdbc.deprecated :as old-sql]
[clojure.java.jdbc :as sql]
[clojure.string :as string]
[caribou.util :as util]
[caribou.logger :as log])
(:use [caribou.db.adapter.protocol :only (DatabaseAdapter)]))
(import org.h2.tools... | null | https://raw.githubusercontent.com/caribou/caribou-core/6ebd9db4e14cddb1d6b4e152e771e016fa9c55f6/src/caribou/db/adapter/h2.clj | clojure | (ns caribou.db.adapter.h2
(:require [clojure.java.jdbc.deprecated :as old-sql]
[clojure.java.jdbc :as sql]
[clojure.string :as string]
[caribou.util :as util]
[caribou.logger :as log])
(:use [caribou.db.adapter.protocol :only (DatabaseAdapter)]))
(import org.h2.tools... | |
65327c873b239fb95a7207cf985665a884dc5835cf31e92c2405931150918e34 | flussonic/reconfigurable_supervisor | reconfigurable_supervisor.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 1996 - 2018 . All Rights Reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicab... | null | https://raw.githubusercontent.com/flussonic/reconfigurable_supervisor/30ba2bc825186084c9086d5679393ff49e96e56a/src/reconfigurable_supervisor.erl | erlang |
%CopyrightBegin%
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific lan... | Copyright Ericsson AB 1996 - 2018 . 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(reconfigurable_supervisor).
-behaviour(gen_server).
-export([start_link/2, start_link/3,
start_child/2, r... |
44105009fc42c2555423448ec26a96a8377ebf9eb6b0838e20edaff7377c53b2 | lucasdicioccio/deptrack-project | Nginx.hs | # LANGUAGE DataKinds #
{-# LANGUAGE OverloadedStrings #-}
{-# LANGUAGE TypeFamilies #-}
-- TODO:
-- fix pid and run directories
-- disable triggers when debian packages are installed or piggy-back on its /etc configuration
module Devops.Nginx (
WebService (..)
, NginxServerConfig (..)
, Nginx... | null | https://raw.githubusercontent.com/lucasdicioccio/deptrack-project/cd3d59a796815af8ae8db32c47b1e1cdc209ac71/deptrack-devops-recipes/src/Devops/Nginx.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE TypeFamilies #
TODO:
fix pid and run directories
disable triggers when debian packages are installed or piggy-back on its /etc configuration
service
all the rest
higher-level construct
| A hostname to configure nginx.
compiler and as human-friendly documentatio... | # LANGUAGE DataKinds #
module Devops.Nginx (
WebService (..)
, NginxServerConfig (..)
, NginxLocationConfig (..)
, NginxLocationDirective (..)
, proxyPassDirectives
, staticSiteDirectives
, Nginx
, ConfigDir
, nginxWorkerUser
, nginxMainServer
, HostName
, nginxAsWebService
, rever... |
9891d065b3bfaff5540b5bfc07c50871e3daa3d0ab6f8fc18e8b4886a3ab70f9 | ocurrent/ocurrent | output.mli | type active = [`Ready | `Running | `Waiting_for_confirmation]
[@@deriving eq]
type 'a t = ('a, [`Active of active | `Msg of string]) result
[@@deriving eq]
val pp : 'a Fmt.t -> ('a, [< `Active of active | `Msg of string]) result Fmt.t
module Blockable : sig
type 'a t = ('a, [`Active of active | `Msg of string... | null | https://raw.githubusercontent.com/ocurrent/ocurrent/8978121df138cb868e001ae9f8fff84118a81830/lib_term/output.mli | ocaml | type active = [`Ready | `Running | `Waiting_for_confirmation]
[@@deriving eq]
type 'a t = ('a, [`Active of active | `Msg of string]) result
[@@deriving eq]
val pp : 'a Fmt.t -> ('a, [< `Active of active | `Msg of string]) result Fmt.t
module Blockable : sig
type 'a t = ('a, [`Active of active | `Msg of string... | |
64b152cf98772ed3e397981d5b9cde5451c811e49beeb527d260d902b1893ed3 | janestreet/shell | string_extended.mli | (** Extensions to [Core.Core_String]. *)
open! Core
* [ collate s1 s2 ] sorts string in an order that 's usually more suited for human
consumption by treating ints specially , e.g. it will output :
[ [ " rfc1.txt";"rfc822.txt";"rfc2086.txt " ] ] .
It works by splitting the strings in numerical and ... | null | https://raw.githubusercontent.com/janestreet/shell/96adc30aec6417cde2873e882f38983141599b56/string_extended/src/string_extended.mli | ocaml | * Extensions to [Core.Core_String].
* [squeeze str] reduces all sequences of spaces, newlines, tabs, and carriage
returns to single spaces.
|
open! Core
* [ collate s1 s2 ] sorts string in an order that 's usually more suited for human
consumption by treating ints specially , e.g. it will output :
[ [ " rfc1.txt";"rfc822.txt";"rfc2086.txt " ] ] .
It works by splitting the strings in numerical and non - numerical chunks and comparing
... |
acb4867fb242e70a6084b1d21c781a6695d583af7a050317666974e195bc0991 | copumpkin/java | Encoding.hs | {-# LANGUAGE OverloadedStrings #-}
module Java.ClassFormat.Encoding where
import Data.Char
import Data.Word
import Data.Maybe
import Data.Tuple
import Data.Monoid
import Data.Prickler
import qualified Data.Vector as V
import Data.Binary.Get hiding (skip, Partial)
import Control.Applicative
import Control.Monad
import ... | null | https://raw.githubusercontent.com/copumpkin/java/ca5ecc025eef4463ef5f0f33e6873707aeb88bd9/src/Java/ClassFormat/Encoding.hs | haskell | # LANGUAGE OverloadedStrings #
TODO: add catchall
attribute = undefined
this should really be at least partially synthetic... | module Java.ClassFormat.Encoding where
import Data.Char
import Data.Word
import Data.Maybe
import Data.Tuple
import Data.Monoid
import Data.Prickler
import qualified Data.Vector as V
import Data.Binary.Get hiding (skip, Partial)
import Control.Applicative
import Control.Monad
import qualified Data.ByteString.Lazy as B... |
3042fe1e6285f5a6ea86577278a87e8a39d204019c4fd75233ef943acece3661 | alakahakai/hackerrank | euler006.hs |
Project Euler+ 006 - Sum square difference
Author : < >
Date : July 21st , 2015
Project Euler+ 006 - Sum square difference
Author: Ray Qiu <>
Date: July 21st, 2015
-}
import Control.Monad (forM_)
solve :: [Integer] -> Integer
solve = go 0 0 where
go acc _ [] = acc
go acc ... | null | https://raw.githubusercontent.com/alakahakai/hackerrank/465d17107bbe402daf750651bb57cf092305acf9/euler%2B/euler006.hs | haskell |
Project Euler+ 006 - Sum square difference
Author : < >
Date : July 21st , 2015
Project Euler+ 006 - Sum square difference
Author: Ray Qiu <>
Date: July 21st, 2015
-}
import Control.Monad (forM_)
solve :: [Integer] -> Integer
solve = go 0 0 where
go acc _ [] = acc
go acc ... | |
e1a45b3331bf58464aa9ad458196e80c0d95840186f028788ba5b0f786999d29 | vasilisp/inez | slides_mono.ml | open Script ;;
open Core.Std ;;
(* vars *)
let x = fresh_int_var () ;;
let y = fresh_int_var () ;;
let z = fresh_int_var () ;;
UF
let f _ = ~free ;;
assert_axiom
( ~forall x ( ~forall y ( [ x < y ] , f x < = f y ) ) ) ; ;
assert_axiom
(~forall x (~forall y ([x < y], f x <= f y))) ;;
*)
assert_axiom... | null | https://raw.githubusercontent.com/vasilisp/inez/3bbbbb82a12918c1557f5fb0b49a8c73ab8d6da1/frontend/examples/axioms/slides_mono.ml | ocaml | vars
objective
constraints
solve and print | open Script ;;
open Core.Std ;;
let x = fresh_int_var () ;;
let y = fresh_int_var () ;;
let z = fresh_int_var () ;;
UF
let f _ = ~free ;;
assert_axiom
( ~forall x ( ~forall y ( [ x < y ] , f x < = f y ) ) ) ; ;
assert_axiom
(~forall x (~forall y ([x < y], f x <= f y))) ;;
*)
assert_axiom
(~forall... |
412896c1dd08652308604c8db4b931e75afa9cdb1e97fbec368750a73e30ba27 | simonmar/monad-par | embarrassingly_par.hs | # LANGUAGE BangPatterns , CPP #
Author :
-- Embarassingly parallel.
-- If this doesn't get a speedup nothing will!
-- Note: This program is an example of a program that depends
-- critically on "put" being strict. If it were not the real work
-- would be deferred until after the parallel computation is finished!... | null | https://raw.githubusercontent.com/simonmar/monad-par/1266b0ac1b4040963ab356cf032c6aae6b8a7add/examples/src/Microbench/embarrassingly_par.hs | haskell | Embarassingly parallel.
If this doesn't get a speedup nothing will!
Note: This program is an example of a program that depends
critically on "put" being strict. If it were not the real work
would be deferred until after the parallel computation is finished!
tid2 <- S.lift$ myThreadId
stepPutStr (show tid++" j... | # LANGUAGE BangPatterns , CPP #
Author :
import GHC.Conc
import Debug.Trace
import Control.Monad
import System.Environment
import Microbench.Flops
import Control . . Par . . Trace
import Control.Exception
#ifdef PARSCHED
import PARSCHED
#else
import Control.Monad.Par
#endif
puts = unsafeIO . putStr
runit... |
2ccb0d45fb9aec52baa2b65db6d1a2e09a08268299a6e306f55fac27cd586ea5 | clj-commons/etaoin | shell.clj | (ns helper.shell
(:require [babashka.tasks :as tasks]
[clojure.pprint :as pprint]
[clojure.string :as string]
[helper.os :as os]
[lread.status-line :as status]))
(def default-opts {:error-fn
(fn die-on-error [{{:keys [exit cmd]} :proc}]
... | null | https://raw.githubusercontent.com/clj-commons/etaoin/a89c9a3ad1cfc6c5e0206c69ff0936ce51d139ce/script/helper/shell.clj | clojure | naive, but fine for our uses for now, adjust as necessary
powershell -command does not automatically propagate exit code,
hence the secret exit sauce here | (ns helper.shell
(:require [babashka.tasks :as tasks]
[clojure.pprint :as pprint]
[clojure.string :as string]
[helper.os :as os]
[lread.status-line :as status]))
(def default-opts {:error-fn
(fn die-on-error [{{:keys [exit cmd]} :proc}]
... |
949e7c2a2dde62c0d66f0ec517952afbeb8460bd27d3912988a686602c80319b | ddssff/cabal-debian | Debianize.hs | import Data.List (isPrefixOf)
import Debian.Relation (BinPkgName(..))
import Debian.Cabal.Config (Flags(..), defaultConfig, defaultFlags, Executable(..), Server(..), Site(..), tightDependencyFixup)
import Debian.Cabal.Types (DebAtom(..))
import Debian.Cabal.Debianize
import Debian.Cabal.Server (databaseDirectory)
impor... | null | https://raw.githubusercontent.com/ddssff/cabal-debian/763270aed987f870762e660f243451e9a34e1325/test-data/clckwrks-dot-com/input/debian/Debianize.hs | haskell | For each pair (A, B) make sure that this package requires the
same exact version of package B as the version of A currently
installed during the build.
, "clckwrks-dot-com-staging", "clckwrks-dot-com-development"]
Insert a line just above the debhelper.mk include | import Data.List (isPrefixOf)
import Debian.Relation (BinPkgName(..))
import Debian.Cabal.Config (Flags(..), defaultConfig, defaultFlags, Executable(..), Server(..), Site(..), tightDependencyFixup)
import Debian.Cabal.Types (DebAtom(..))
import Debian.Cabal.Debianize
import Debian.Cabal.Server (databaseDirectory)
impor... |
5aebf73e56723652587352615bf4a698ca8d0e44aa5fea3e002b1e8341a7ab78 | gethop-dev/hydrogen.duct-template | routes.cljs | 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 /
{{=<< >>=}}
(ns <<namespace>>.client.routes
(:require-macros [secretary.core :refer [defroute]])
(:import goog.History)
(:require <<#hydro... | null | https://raw.githubusercontent.com/gethop-dev/hydrogen.duct-template/34d56aa499af1e673d9587b7da0cca2b126ff106/resources/ssr/cljs/routes.cljs | clojure | file, You can obtain one at /
This part takes a vector for new view to navigate to.
By convention we recommend using a namespaced one with 'view' as a name (e.g. ::shop/view).
The optional remaining arguments of that view vector are arguments to the view.
- New view always is composed into ::*/view.enter event
-... | 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
{{=<< >>=}}
(ns <<namespace>>.client.routes
(:require-macros [secretary.core :refer [defroute]])
(:import goog.History)
(:require <<#hydrogen-session?>>[clojure.spec.alpha... |
1ec12b6dcc1b56b20d63cda6a36872f7fb25eb2de1d2ef4dfa0516d66f52ade4 | UBTECH-Walker/WalkerSimulationFor2020WAIC | EndEffectorCommand.lisp | ; Auto-generated. Do not edit!
(cl:in-package ubt_core_msgs-msg)
;//! \htmlinclude EndEffectorCommand.msg.html
(cl:defclass <EndEffectorCommand> (roslisp-msg-protocol:ros-message)
((id
:reader id
:initarg :id
:type cl:integer
:initform 0)
(command
:reader command
:initarg :command
... | null | https://raw.githubusercontent.com/UBTECH-Walker/WalkerSimulationFor2020WAIC/7cdb21dabb8423994ba3f6021bc7934290d5faa9/walker_WAIC_16.04_v1.2_20200616/walker_install/share/common-lisp/ros/ubt_core_msgs/msg/EndEffectorCommand.lisp | lisp | Auto-generated. Do not edit!
//! \htmlinclude EndEffectorCommand.msg.html |
(cl:in-package ubt_core_msgs-msg)
(cl:defclass <EndEffectorCommand> (roslisp-msg-protocol:ros-message)
((id
:reader id
:initarg :id
:type cl:integer
:initform 0)
(command
:reader command
:initarg :command
:type cl:string
:initform "")
(args
:reader args
:initarg :arg... |
7699a0c440d0ec7671a1033a7a0e5d646cf727684a3fac6f6dd28b009464fd55 | ekmett/adjunctions | Reader.hs | # LANGUAGE GADTs , TypeFamilies , TypeOperators , CPP , FlexibleContexts , FlexibleInstances , MultiParamTypeClasses , UndecidableInstances , TypeSynonymInstances #
# OPTIONS_GHC -fenable - rewrite - rules -fno - warn - orphans #
----------------------------------------------------------------------
-- |
Module ... | null | https://raw.githubusercontent.com/ekmett/adjunctions/c22ac44829eede02b2dee643371a21da51ad4909/src/Control/Monad/Representable/Reader.hs | haskell | --------------------------------------------------------------------
|
License : BSD3
Maintainer :
Stability : experimental
a 'Reader' monad.
--------------------------------------------------------------------
* Representable functor monad
misc. instances that can exist, but aren't particularly abo... | # LANGUAGE GADTs , TypeFamilies , TypeOperators , CPP , FlexibleContexts , FlexibleInstances , MultiParamTypeClasses , UndecidableInstances , TypeSynonymInstances #
# OPTIONS_GHC -fenable - rewrite - rules -fno - warn - orphans #
Module : Control . Monad . Representable . Reader
Copyright : ( c ) 201... |
c75cb5484174543714361b9d4f8990ae11d97dd21f8b7341876e891fcdd5d2f6 | exercism/scheme | example.scm | (define (roman n)
(let loop ([n n]
[r '((1000 . "M")
(900 . "CM")
(500 . "D")
(400 . "CD")
(100 . "C")
(90 . "XC")
(50 . "L")
(40 . "XL")
(10 . "X")
... | null | https://raw.githubusercontent.com/exercism/scheme/aa880e6222a393fcf5d672decb5c5dd6fae286ff/exercises/practice/roman-numerals/.meta/example.scm | scheme | Or, alternatively ...
(define (roman n)
(format #f "~@r" n)) | (define (roman n)
(let loop ([n n]
[r '((1000 . "M")
(900 . "CM")
(500 . "D")
(400 . "CD")
(100 . "C")
(90 . "XC")
(50 . "L")
(40 . "XL")
(10 . "X")
... |
e0f99c00a5c62f7316ba25e7ba16133e377f9ae5407b30fe3213a39d14f911e8 | LadyBoonami/wsedit | ElasticTabstops.hs | # LANGUAGE LambdaCase #
module WSEdit.ElasticTabstops
( rebuildTabCache
) where
import Control.DeepSeq
( force
)
import Control.Exception
( evaluate
)
import Control.Monad.RWS.Strict
( asks
, gets
, liftIO
, modify
)
import Data.Foldable
( foldl'
)
import Data.List... | null | https://raw.githubusercontent.com/LadyBoonami/wsedit/e836b81b743123df2fa21470072ccd5ee1083ee4/src/WSEdit/ElasticTabstops.hs | haskell | | Get the text buffer contents in table form (tab-delimited) without the last
cell.
| Get the display width of every cell's content, excluding the delimiting tab
stop.
only used for tab alignment and the tab-delimited table should not
contain those any more.
| Get the final width of every cell, including the... | # LANGUAGE LambdaCase #
module WSEdit.ElasticTabstops
( rebuildTabCache
) where
import Control.DeepSeq
( force
)
import Control.Exception
( evaluate
)
import Control.Monad.RWS.Strict
( asks
, gets
, liftIO
, modify
)
import Data.Foldable
( foldl'
)
import Data.List... |
ccc5c66b496e77c062bb969d0e4c5fce9413cad15f68ed69d58f800ce6bd42d2 | dbuenzli/gg | orient_p2.ml | ---------------------------------------------------------------------------
Copyright ( c ) 2022 The gg programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... | null | https://raw.githubusercontent.com/dbuenzli/gg/d4333c8b2abdfc18c01f9c0d15521ce099bbb374/test/orient_p2.ml | ocaml | This set of coordinates was found via
/@mourner/non-robust-arithmetic-as-art
if x = y then 0x00, 0x00, 0x00 else
when o > 0. | ---------------------------------------------------------------------------
Copyright ( c ) 2022 The gg programmers . All rights reserved .
Distributed under the ISC license , see terms at the end of the file .
---------------------------------------------------------------------------
Copyright (c) 20... |
8af4e22f4ecd7b1440b6a2a6d05b87575d911c7ca0a11404a30bf9c4fd5d8642 | Perry961002/SICP | exe2.82-apply-generic.scm | (load "Chap3\\example\\exa3.3.3-table.scm")
补充定义 :
(define coercion-table (make-table))
(define get-coercion (operation-table 'lookup-proc))
(define put-coercion (operation-table 'insert-proc!))
(define (apply-generic op . args)
;将列表里的参数类型都转换为类型target
(define (coercion-list lst target)
(map (lambda (x)... | null | https://raw.githubusercontent.com/Perry961002/SICP/89d539e600a73bec42d350592f0ac626e041bf16/Chap2/exercise/exe2.82-apply-generic.scm | scheme | 将列表里的参数类型都转换为类型target | (load "Chap3\\example\\exa3.3.3-table.scm")
补充定义 :
(define coercion-table (make-table))
(define get-coercion (operation-table 'lookup-proc))
(define put-coercion (operation-table 'insert-proc!))
(define (apply-generic op . args)
(define (coercion-list lst target)
(map (lambda (x)
(let ((pro... |
79c7fb9c1c360952caf2cc6d07f8226f8b926d9f4246dea6186339f612a2f656 | seckcoder/iu_c311 | env.rkt | #lang racket
(require eopl/datatype
"../racket/base/utils.rkt"
"store.rkt")
(provide (all-defined-out))
; env := '() | (var val env)
(define-datatype
environment environment?
(empty-env)
(extend-envs
(vars (list-of symbol?))
(refs (list-of reference?))
(env environment?)))
(defin... | null | https://raw.githubusercontent.com/seckcoder/iu_c311/a1215983b6ab08df32058ef1e089cb294419e567/lisp/env.rkt | racket | env := '() | (var val env) | #lang racket
(require eopl/datatype
"../racket/base/utils.rkt"
"store.rkt")
(provide (all-defined-out))
(define-datatype
environment environment?
(empty-env)
(extend-envs
(vars (list-of symbol?))
(refs (list-of reference?))
(env environment?)))
(define extend-env
(lambda (var r... |
0772087145d04da948b51b6e8811d276a868cd3f605e7b89ac3ae5ba4d78097d | simmone/racket-simple-xlsx | sort-styles.rkt | #lang racket
(require "style.rkt")
(require "border-style.rkt")
(require "font-style.rkt")
(require "alignment-style.rkt")
(require "number-style.rkt")
(require "fill-style.rkt")
(provide (contract-out
[style<? (-> STYLE? STYLE? boolean?)]
[sort-styles (-> void?)]
))
(define (style<? st... | null | https://raw.githubusercontent.com/simmone/racket-simple-xlsx/e0ac3190b6700b0ee1dd80ed91a8f4318533d012/simple-xlsx/style/sort-styles.rkt | racket | #lang racket
(require "style.rkt")
(require "border-style.rkt")
(require "font-style.rkt")
(require "alignment-style.rkt")
(require "number-style.rkt")
(require "fill-style.rkt")
(provide (contract-out
[style<? (-> STYLE? STYLE? boolean?)]
[sort-styles (-> void?)]
))
(define (style<? st... | |
e4ca0f1d04ea0ce78cbe3b3cab4a112a712bbc406ec6768734c5b8c90a03a4c0 | mirage/mirage-www-deployment | config.ml |
* Copyright ( c ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... | null | https://raw.githubusercontent.com/mirage/mirage-www-deployment/ef439e79be8fb8b475021c72af3c781a8bd42cfa/xen/4c504657e8087274e2ce23c0b9203bae360627be/config.ml | ocaml | Hack to make the image name parametrized
* With tls
* Without tls
let tracing = mprof_trace ~size:10000 () in |
* Copyright ( c ) 2015 < >
*
* Permission to use , copy , modify , and distribute this software for any
* purpose with or without fee is hereby granted , provided that the above
* copyright notice and this permission notice appear in all copies .
*
* THE SOFTWARE IS PROVIDED " AS IS " AND THE AU... |
ab04da004d35f3e277f1190288a45ab0b63594976f6f33f10ce0711553f66ef8 | patrikja/AFPcourse | Reader.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Control.Monad.Reader (
module Control.Monad.Reader.Class,
Reader(..),
mapReader,
withReader,
ReaderT(..),
mapReaderT,
withReaderT,
module Control.Monad
) where
import Control.Monad
import Control.Monad.Reader.C... | null | https://raw.githubusercontent.com/patrikja/AFPcourse/1a079ae80ba2dbb36f3f79f0fc96a502c0f670b6/L5/mtl/Control/Monad/Reader.hs | haskell | ----------------------------------------------------------------------------
The partially applied function type is a simple reader monad
Imported instance:
instance MonadReader r ((->) r) where
ask = id
local f m = m . f
| A more general version of 'local'.
|
The reader monad transformer.
Can be ... | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
module Control.Monad.Reader (
module Control.Monad.Reader.Class,
Reader(..),
mapReader,
withReader,
ReaderT(..),
mapReaderT,
withReaderT,
module Control.Monad
) where
import Control.Monad
import Control.Monad.Reader.C... |
3a7a345c58357452989772babc0b374b1c5c9c2bff156a8ec3711e8f7365fbee | ijvcms/chuanqi_dev | fighting_config.erl | %%%-------------------------------------------------------------------
@author zhengsiying
%%% @doc
%%% 自动生成文件,不要手动修改
%%% @end
Created : 2016/10/12
%%%-------------------------------------------------------------------
-module(fighting_config).
-include("common.hrl").
-include("config.hrl").
-compile([export_al... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/config/fighting_config.erl | erlang | -------------------------------------------------------------------
@doc
自动生成文件,不要手动修改
@end
------------------------------------------------------------------- | @author zhengsiying
Created : 2016/10/12
-module(fighting_config).
-include("common.hrl").
-include("config.hrl").
-compile([export_all]).
get_list_conf() ->
[ fighting_config:get(X) || X <- get_list() ].
get_list() ->
[5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28... |
210eb5afce22da3c5275a066f39e45c18f8f457171d3a2708855a17f2e0ccd0a | lpgauth/httpc_bench | httpc_bench_katipo.erl | %
-module(httpc_bench_katipo).
-include("httpc_bench.hrl").
-export([
get/0,
start/1,
stop/0
]).
%% public
get() ->
{ok, _} = katipo:get(httpc_bench, ?URL, #{}),
ok.
% NOTE: Opens arbitrary number of TCP connections
%
start(PoolSize) ->
{ok, _} = application:ensure_all_started(katipo),
... | null | https://raw.githubusercontent.com/lpgauth/httpc_bench/5430ddd569dcecf2c120ca424493c336df44284f/src/httpc_bench_katipo.erl | erlang |
public
NOTE: Opens arbitrary number of TCP connections
|
-module(httpc_bench_katipo).
-include("httpc_bench.hrl").
-export([
get/0,
start/1,
stop/0
]).
get() ->
{ok, _} = katipo:get(httpc_bench, ?URL, #{}),
ok.
start(PoolSize) ->
{ok, _} = application:ensure_all_started(katipo),
KatipoOpts = [
{pipelining, true},
{max_pipeline... |
6b543936ef5a2e88bda1376ae1bf8943f83cd0c06566d4fd0f3634dc93aaed4e | Ptival/chick | GlobalEnvironment.hs | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - orphans #
module PrettyPrinting.Chick.GlobalEnvironment where
import Control.Monad.Reader (runReader)
import Data.Default (Default (def))
import Language (Language (Chick))
import PrettyPrin... | null | https://raw.githubusercontent.com/Ptival/chick/a5ce39a842ff72348f1c9cea303997d5300163e2/backend/lib/PrettyPrinting/Chick/GlobalEnvironment.hs | haskell | # LANGUAGE FlexibleInstances #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE UndecidableInstances #
# OPTIONS_GHC -fno - warn - orphans #
module PrettyPrinting.Chick.GlobalEnvironment where
import Control.Monad.Reader (runReader)
import Data.Default (Default (def))
import Language (Language (Chick))
import PrettyPrin... | |
d6a23f488842f2639bd50af6cc1dfadb72d5a26dcd9f60949ed36b3b6b5d92a7 | kazu-yamamoto/quic | FrameSpec.hs | module FrameSpec where
import Control.Monad
import Data.ByteString.Internal (memset)
import Data.Word
import Foreign.Marshal.Alloc
import Foreign.Ptr
import Foreign.Storable
import Test.Hspec
import qualified UnliftIO.Exception as E
import Network.QUIC.Internal
spec :: Spec
spec = do
describe "countZero" $ do
... | null | https://raw.githubusercontent.com/kazu-yamamoto/quic/d76d1dbf7a4eb5c280d626d90adfcd6b67444e9b/test/FrameSpec.hs | haskell | module FrameSpec where
import Control.Monad
import Data.ByteString.Internal (memset)
import Data.Word
import Foreign.Marshal.Alloc
import Foreign.Ptr
import Foreign.Storable
import Test.Hspec
import qualified UnliftIO.Exception as E
import Network.QUIC.Internal
spec :: Spec
spec = do
describe "countZero" $ do
... | |
50298e91b85926e64f42d979ba1ab90072e0817cacf2c7827e43585d8a0030bb | poscat0x04/telegram-types | PinChatMessage.hs | module Web.Telegram.Types.Internal.API.PinChatMessage where
import Common
import Web.Telegram.Types.Internal.API.ChatId
data PinChatMessage = PinChatMessage
{ chatId :: ChatId,
messageId :: Int,
disableNotification :: Maybe Bool
}
deriving stock (Show, Eq)
mkLabel ''PinChatMessage
deriveToJSON snake ''... | null | https://raw.githubusercontent.com/poscat0x04/telegram-types/3de0710640f5303638a83e409001b0342299aeb8/src/Web/Telegram/Types/Internal/API/PinChatMessage.hs | haskell | module Web.Telegram.Types.Internal.API.PinChatMessage where
import Common
import Web.Telegram.Types.Internal.API.ChatId
data PinChatMessage = PinChatMessage
{ chatId :: ChatId,
messageId :: Int,
disableNotification :: Maybe Bool
}
deriving stock (Show, Eq)
mkLabel ''PinChatMessage
deriveToJSON snake ''... | |
adcdfa89891e8a3a5ac00f3dfc0755b821f94d17e1af6149c98e4a5e9f9f1795 | rbkmoney/hellgate | hg_domain.erl | %%% Domain config interfaces
%%%
TODO
%%% - Use proper reflection instead of blind pattern matching when (un)wrapping
%%% domain objects
-module(hg_domain).
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
-include_lib("damsel/include/dmsl_domain_config_thrift.hrl").
%%
-export([head/0]).
-export([get/1... | null | https://raw.githubusercontent.com/rbkmoney/hellgate/9dd99ab584105159efdcc8f0c48ef74a0b918299/apps/hellgate/src/hg_domain.erl | erlang | Domain config interfaces
- Use proper reflection instead of blind pattern matching when (un)wrapping
domain objects
convenience shortcuts, use carefully | TODO
-module(hg_domain).
-include_lib("damsel/include/dmsl_domain_thrift.hrl").
-include_lib("damsel/include/dmsl_domain_config_thrift.hrl").
-export([head/0]).
-export([get/1]).
-export([get/2]).
-export([find/2]).
-export([exists/2]).
-export([commit/2]).
-export([reset/1]).
-export([insert/1]).
-export([updat... |
3f4ed2b0b91cf3bd9a69344fbc128052bce65bde56195371402a65a3e25517ea | facebookarchive/pfff | parse_rust.ml |
*
* Copyright ( C ) 2014 Facebook
*
* This program is free software ; you can redistribute it and/or
* modify it under the terms of the GNU General Public License ( GPL )
* version 2 as published by the Free Software Foundation .
*
* This program is distributed in the hope that it will be us... | null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/lang_rust/parsing/parse_rust.ml | ocaml | ***************************************************************************
Prelude
***************************************************************************
***************************************************************************
Types
**************************************************************************... |
*
* Copyright ( C ) 2014 Facebook
*
* This program is free software ; you can redistribute it and/or
* modify it under the terms of the GNU General Public License ( GPL )
* version 2 as published by the Free Software Foundation .
*
* This program is distributed in the hope that it will be us... |
96a766e62febd7c4c058f624fe2e7d12044abc7b380efd6cdc49c4c81243ceb5 | racket/draw | blits.rkt | #lang scheme/gui
(define ok-frame (make-object frame% "Ok"))
(define ok-panel #f)
(define (try path mode color bg-color sx sy)
(let ([bm (if (is-a? path bitmap%)
path
(make-object bitmap% path 'unknown/mask))])
(let ([w (inexact->exact (ceiling (* sx (send bm get-width))))]
[h (inexact->exact (cei... | null | https://raw.githubusercontent.com/racket/draw/a6558bdc18438e784c23d452ffd877dac867a7fd/draw-test/tests/racket/draw/blits.rkt | racket | (collection-file-path "mred.xbm" "icons")) | #lang scheme/gui
(define ok-frame (make-object frame% "Ok"))
(define ok-panel #f)
(define (try path mode color bg-color sx sy)
(let ([bm (if (is-a? path bitmap%)
path
(make-object bitmap% path 'unknown/mask))])
(let ([w (inexact->exact (ceiling (* sx (send bm get-width))))]
[h (inexact->exact (cei... |
bb30d5b34ee8e82f73d630e2d68afe568bc68ef98e66f2354fcc59be6848afa1 | mfikes/coal-mine | problem_141.cljc | (ns coal-mine.problem-141
(:require [coal-mine.checks :refer [defcheck-141] :rename {defcheck-141 defcheck}]
[clojure.test]))
(defn run-tests []
(clojure.test/run-tests 'coal-mine.problem-141))
(defn -main []
(run-tests))
#?(:cljs (set! *main-cli-fn* -main))
| null | https://raw.githubusercontent.com/mfikes/coal-mine/0961d085b37f4e59489a8cf6a2b8fef0a698d8fb/src/coal_mine/problem_141.cljc | clojure | (ns coal-mine.problem-141
(:require [coal-mine.checks :refer [defcheck-141] :rename {defcheck-141 defcheck}]
[clojure.test]))
(defn run-tests []
(clojure.test/run-tests 'coal-mine.problem-141))
(defn -main []
(run-tests))
#?(:cljs (set! *main-cli-fn* -main))
| |
0e241a355015896ed08c9e6a615e9cc5593268bcb4ca596fdcf51a125b851f7b | IndianRoboticsOrganization/ArimaTTS | CLUNITS_clunits.scm | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;;
Carnegie Mellon University ; ; ;
and and ; ; ;
Copyright ( c ) 1998 - 2005 ... | null | https://raw.githubusercontent.com/IndianRoboticsOrganization/ArimaTTS/7377dca466306e2e6b90a063427273142cd50616/festvox/src/unitsel/CLUNITS_clunits.scm | scheme |
;;;
; ;
; ;
; ;
; ;
;;;
Permission is hereby granted, free of charge, to use and distribute ;;;
this software and its documentation without restriction, including ;;;
withou... |
Ensure this version of festival has been compiled with clunits module
(require_module 'clunits)
(if (assoc 'INST_LANG_VOX_clunits voice-locations)
(defvar INST_LANG_VOX::dir
(cdr (assoc 'INST_LANG_VOX_clunits voice-locations)))
(defvar INST_LANG_VOX::dir (string-append (pwd) "/")))
(if (not (probe_f... |
2c0e223aea0d5536923e2f71f29f621d74130e666948c4e7643470c05094f252 | sdiehl/elliptic-curve | Curve25519.hs | module Data.Curve.Montgomery.Curve25519
( module Data.Curve.Montgomery
, Point(..)
-- * Curve25519 curve
, module Data.Curve.Montgomery.Curve25519
) where
import Protolude
import Data.Field.Galois
import GHC.Natural (Natural)
import Data.Curve.Montgomery
---------------------------------------------------... | null | https://raw.githubusercontent.com/sdiehl/elliptic-curve/445e196a550e36e0f25bd4d9d6a38676b4cf2be8/src/Data/Curve/Montgomery/Curve25519.hs | haskell | * Curve25519 curve
-----------------------------------------------------------------------------
Types
-----------------------------------------------------------------------------
| Curve25519 curve.
# INLINABLE a_ #
# INLINABLE h_ #
| Affine Curve25519 curve point.
------------------------------------------------... | module Data.Curve.Montgomery.Curve25519
( module Data.Curve.Montgomery
, Point(..)
, module Data.Curve.Montgomery.Curve25519
) where
import Protolude
import Data.Field.Galois
import GHC.Natural (Natural)
import Data.Curve.Montgomery
data Curve25519
| Field of points of curve .
type Fq = Prime Q
type Q ... |
f2320fa5238608a2366955a692b677bf75a67e578ba18341b746e4c22cb9f093 | reasonml/reason | input.ml | (* Type names (supported with PR#2342) *)
module T = struct
type pub = unit
end
(* Value names (already supported) *)
module V = struct
let method_ = ()
end
(* Record fields *)
module R = struct
type r = { mutable method_ : int }
let foo = { method_ = 4 }
let x = foo.method_
let () = foo.method_ <- 42
... | null | https://raw.githubusercontent.com/reasonml/reason/3d829d8abedf961cfebc306a0a07f585bc9664c4/refmt_test/ocaml_identifiers.t/input.ml | ocaml | Type names (supported with PR#2342)
Value names (already supported)
Record fields
Class names and instance variables
Class types
Virtual
Object methods
Function parameter labels
Module types
Polymorphic variants (probably ok as-is?)
Not an identifier test, but this is testing OCaml -> RE | module T = struct
type pub = unit
end
module V = struct
let method_ = ()
end
module R = struct
type r = { mutable method_ : int }
let foo = { method_ = 4 }
let x = foo.method_
let () = foo.method_ <- 42
let y = match foo with {method_} -> method_
let z = match foo with {method_=12} -> 21
end
mod... |
b38590aac378fbc6b671e3293a4ad6c567aae1968d6b96151ef2646fd6ff9316 | babashka/bbin | scripts.clj | (ns babashka.bbin.scripts
(:require [babashka.bbin.util :as util :refer [sh]]
[babashka.deps :as deps]
[babashka.fs :as fs]
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.main :as main]
[clojure.pprint :as pprint]
[clojure.st... | null | https://raw.githubusercontent.com/babashka/bbin/6d08f41dfbfd29d8f43382998d2b99fae4c6f9c0/src/babashka/bbin/scripts.clj | clojure | selmer filter for clojure escaping for e.g. files
(see #discussion_r1071348344)
| (ns babashka.bbin.scripts
(:require [babashka.bbin.util :as util :refer [sh]]
[babashka.deps :as deps]
[babashka.fs :as fs]
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.main :as main]
[clojure.pprint :as pprint]
[clojure.st... |
b30cc8af44fa44ccd8ae1db7066a073aeabb19290f2ce8dabc59c9e0a103f24a | incoherentsoftware/defect-process | StartingShopItemPickupIndicator.hs | module Level.Room.Trigger.All.StartingShopItemPickupIndicator
( mkStartingShopItemPickupIndicator
) where
import Control.Monad.IO.Class (MonadIO)
import Level.Room
import Level.Room.Trigger
import Msg
mkStartingShopItemPickupIndicator :: MonadIO m => m RoomTrigger
mkStartingShopItemPickupIndicator = do
... | null | https://raw.githubusercontent.com/incoherentsoftware/defect-process/c39ce1f742d32a0ffcde82c03bf872adeb7d9162/src/Level/Room/Trigger/All/StartingShopItemPickupIndicator.hs | haskell | module Level.Room.Trigger.All.StartingShopItemPickupIndicator
( mkStartingShopItemPickupIndicator
) where
import Control.Monad.IO.Class (MonadIO)
import Level.Room
import Level.Room.Trigger
import Msg
mkStartingShopItemPickupIndicator :: MonadIO m => m RoomTrigger
mkStartingShopItemPickupIndicator = do
... | |
faa59f0b5c300cd41d9c4f8414c86a7ce4fd8715f7e7590739cbda59d564bf22 | reborg/fluorine | fs.clj | (ns net.reborg.fluorine.fs
(:refer-clojure :exclude [read])
(:require
[net.reborg.fluorine.config :refer [fluorine-root]]
[clojure.tools.logging :as log]
[clojure.java.io :as io]
[net.reborg.fluorine.data :as data]
[net.reborg.fluorine.metadata :as metadata]
))
(defn with-file
"Creates a ... | null | https://raw.githubusercontent.com/reborg/fluorine/58d533646adce8537ca5c57692a0a998f06e1d25/src/net/reborg/fluorine/fs.clj | clojure | (ns net.reborg.fluorine.fs
(:refer-clojure :exclude [read])
(:require
[net.reborg.fluorine.config :refer [fluorine-root]]
[clojure.tools.logging :as log]
[clojure.java.io :as io]
[net.reborg.fluorine.data :as data]
[net.reborg.fluorine.metadata :as metadata]
))
(defn with-file
"Creates a ... | |
a4a498c705577738f1961a8d54f22ffb334a2ac4a8cdc8e8c9fad782ec27027d | zed-throben/erlangeos | erleos_selftest.erl | -module(erleos_selftest).
-compile(export_all).
%
%
%
f(F,P)->
eosstd:lsformat(F,P).
to_list(X) when is_binary(X) -> binary_to_list(X);
to_list(X) when is_list(X) -> X.
p(X)->
io:format("~s~n",[X]).
pp(X)->
io:format("~p~n",[X]).
%
%
%
src(N)->
Filename = lists:flatten( io_lib:format("../src/tes... | null | https://raw.githubusercontent.com/zed-throben/erlangeos/44e50e442f5d396c69ae90db530b0b60b01d692a/src/erleos_selftest.erl | erlang | -module(erleos_selftest).
-compile(export_all).
f(F,P)->
eosstd:lsformat(F,P).
to_list(X) when is_binary(X) -> binary_to_list(X);
to_list(X) when is_list(X) -> X.
p(X)->
io:format("~s~n",[X]).
pp(X)->
io:format("~p~n",[X]).
src(N)->
Filename = lists:flatten( io_lib:format("../src/test~w.eos",[N]... | |
607241497a984b44b7c9b53c3306992796f6f577e97394eb65698dac99d2c50a | nyuichi/r7expander | init.scm | (make-library '(r7expander builtin))
(with-library '(r7expander builtin)
(lambda ()
(define (install-builtin! keyword transformer)
(let ((env (current-toplevel-environment)))
(let ((expander (make-expander transformer env)))
(install-expander! keyword expander env)))
(library-export keyword))
... | null | https://raw.githubusercontent.com/nyuichi/r7expander/6016af336607212563624f6e04ea90d367736bce/init.scm | scheme | expand later on
missing features:
- placeholder
- vector
- more syntax check (e.g. non-linearity of pattern variables)
p ::= var | constant | (p <ellipsis> . p) | (p . p)
pattern -> ((var . depth))
pattern * template -> undefined
pattern * obj -> ((var . obj))
comparing literal identifiers using eq?
template... | (make-library '(r7expander builtin))
(with-library '(r7expander builtin)
(lambda ()
(define (install-builtin! keyword transformer)
(let ((env (current-toplevel-environment)))
(let ((expander (make-expander transformer env)))
(install-expander! keyword expander env)))
(library-export keyword))
... |
b51ecee409202f915724d3104bf4784b35bdac9ab2ecbd7df135f4b2b6d4f788 | typelead/etlas | Exception.hs | # LANGUAGE CPP #
module Distribution.Compat.Exception (
catchIO,
catchExit,
tryIO,
displayException,
) where
import System.Exit
import qualified Control.Exception as Exception
#if __GLASGOW_HASKELL__ >= 710
import Control.Exception (displayException)
#endif
tryIO :: IO a -> IO (Either Exception.IOException ... | null | https://raw.githubusercontent.com/typelead/etlas/bbd7c558169e1fda086e759e1a6f8c8ca2807583/etlas-cabal/Distribution/Compat/Exception.hs | haskell | # LANGUAGE CPP #
module Distribution.Compat.Exception (
catchIO,
catchExit,
tryIO,
displayException,
) where
import System.Exit
import qualified Control.Exception as Exception
#if __GLASGOW_HASKELL__ >= 710
import Control.Exception (displayException)
#endif
tryIO :: IO a -> IO (Either Exception.IOException ... | |
396f28bf8ab98e656dad408525a58490abba84b1c67d7f39841bb1452f7568e2 | zenspider/schemers | exercise.2.06.scm | #lang racket/base
Exercise 2.6 :
;; In case representing pairs as procedures wasn't mind-boggling
;; enough, consider that, in a language that can manipulate
;; procedures, we can get by without numbers (at least insofar as
;; nonnegative integers are concerned) by implementing 0 and the
operation of adding 1 as
... | null | https://raw.githubusercontent.com/zenspider/schemers/2939ca553ac79013a4c3aaaec812c1bad3933b16/sicp/ch_2/exercise.2.06.scm | scheme | In case representing pairs as procedures wasn't mind-boggling
enough, consider that, in a language that can manipulate
procedures, we can get by without numbers (at least insofar as
nonnegative integers are concerned) by implementing 0 and the
redefining for my own sanity:
This representation is known as "Church ... | #lang racket/base
Exercise 2.6 :
operation of adding 1 as
(define zero- (lambda (g) (lambda (x) x)))
(define (add-1 n) (lambda (f) (lambda (x) (f ((n f) x)))))
(define identity (lambda (x) x))
(define (zero g) (lambda (g) identity))
inventor , Alonzo Church , the logician who invented the [ lambda ]
... |
60e4bf29e66d8953df72111504b48e17148c0b19c1ab2a67f9bcf2ccca84ee5c | camllight/camllight | lbox.ml | #open "tk";;
#open "listbox";;
let setup () =
let Top = OpenTk () in
let Quit = function () -> CloseTk () ; exit 0 in
let b = button__create Top [Relief Raised ; Text "Exit" ; Command Quit] in
let s = scrollbar__create Top [ActiveForeground Blue ; Background Green] in
let l = listbox__create Top [Relief (Rai... | null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/contrib/camltk/test/lbox.ml | ocaml | #open "tk";;
#open "listbox";;
let setup () =
let Top = OpenTk () in
let Quit = function () -> CloseTk () ; exit 0 in
let b = button__create Top [Relief Raised ; Text "Exit" ; Command Quit] in
let s = scrollbar__create Top [ActiveForeground Blue ; Background Green] in
let l = listbox__create Top [Relief (Rai... | |
c8608128f6864482ff6862a0adcebf5a451bf30c291e60fc575d6a3e74c0a894 | gafiatulin/codewars | FindShortest.hs | -- Shortest Word
--
module FindShortest where
find_shortest :: String -> Integer
find_shortest = fromIntegral . minimum . map length . words
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/7%20kyu/FindShortest.hs | haskell | Shortest Word
|
module FindShortest where
find_shortest :: String -> Integer
find_shortest = fromIntegral . minimum . map length . words
|
75606ec924bbb9133166916bf0bb03816d7d8b2a6e40a0883b62b7b68b02157b | nedap/formatting-stack | sample_cljc_ns.cljc | (ns sample-cljc-ns
(:require
#?(:clj [foo.bar.baz :as baz-clj]
:cljs [foo.bar.baz :as baz-cljs]))
#?(:clj
(:import
(java.util UUID)))
#?(:cljs
(:require-macros
[sample-cljc-ns :refer [the-macro]])))
| null | https://raw.githubusercontent.com/nedap/formatting-stack/c43e74d5409e9338f208457bb8928ce437381a3f/test-resources/sample_cljc_ns.cljc | clojure | (ns sample-cljc-ns
(:require
#?(:clj [foo.bar.baz :as baz-clj]
:cljs [foo.bar.baz :as baz-cljs]))
#?(:clj
(:import
(java.util UUID)))
#?(:cljs
(:require-macros
[sample-cljc-ns :refer [the-macro]])))
| |
38de2853d3f7361f5d7f98bff43a3df96bfd6fa9956a779c6994b5f0aa041822 | rfkm/zou | runner.cljs | (ns zou.cljs.runner
(:require [doo.runner :refer-macros [doo-tests]]
zou.component-test
zou.util.namespace-test
zou.util.platform-test
zou.util-test))
(doo-tests 'zou.component-test
'zou.util.namespace-test
'zou.util.platform-test
'zou.... | null | https://raw.githubusercontent.com/rfkm/zou/228feefae3e008f56806589cb8019511981f7b01/test/zou/cljs/runner.cljs | clojure | (ns zou.cljs.runner
(:require [doo.runner :refer-macros [doo-tests]]
zou.component-test
zou.util.namespace-test
zou.util.platform-test
zou.util-test))
(doo-tests 'zou.component-test
'zou.util.namespace-test
'zou.util.platform-test
'zou.... | |
e8305c9eee5fca58cdfefde338d8c74f50243fa79d0f287eaf9f6560aa02fa58 | pariyatti/kosa | params.clj | (ns kosa.middleware.params
(:require [ring.middleware.keyword-params]
[ring.middleware.multipart-params]))
(defn wrap-wrap-keyword-params [handler]
(ring.middleware.keyword-params/wrap-keyword-params
handler
{:parse-namespaces? true}))
(def keyword-params
{:name ::keyword-params
:wrap wrap-... | null | https://raw.githubusercontent.com/pariyatti/kosa/75896fea96b3ff3f47551e272be2c45616af074e/src/kosa/middleware/params.clj | clojure | (ns kosa.middleware.params
(:require [ring.middleware.keyword-params]
[ring.middleware.multipart-params]))
(defn wrap-wrap-keyword-params [handler]
(ring.middleware.keyword-params/wrap-keyword-params
handler
{:parse-namespaces? true}))
(def keyword-params
{:name ::keyword-params
:wrap wrap-... | |
cfad92f2454ecb8f9f5b56b90548993e8fcecc2843d7d480aa8d21bc32bf461a | thma/PolysemyCleanArchitecture | Hosting.hs | module ExternalInterfaces.Hosting where
import ExternalInterfaces.ConfigProvider (ConfigProvider, getConfig)
import ExternalInterfaces.AppServer (AppServer(..), serveAppFromConfig)
import Polysemy
| load configuration via ConfigProvider effect , then contruct and ... | null | https://raw.githubusercontent.com/thma/PolysemyCleanArchitecture/3bb375a30bcbf35c9df62802902e0faa03e3f03d/src/ExternalInterfaces/Hosting.hs | haskell | module ExternalInterfaces.Hosting where
import ExternalInterfaces.ConfigProvider (ConfigProvider, getConfig)
import ExternalInterfaces.AppServer (AppServer(..), serveAppFromConfig)
import Polysemy
| load configuration via ConfigProvider effect , then contruct and ... | |
50ec4369e3ceb27cbd563b6597bf0e5a72dc1e52918e554b6e3d6623ba0c524c | sigscale/5g-ngap | ngap_association_fsm.erl | %%% ngap_association_fsm.erl
%%% vim: ts=3
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2020 SigScale Global Inc.
%%% @end
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... | null | https://raw.githubusercontent.com/sigscale/5g-ngap/e4de7891a757d9587314d02f9e5598d51f8e7f5a/src/ngap_association_fsm.erl | erlang | ngap_association_fsm.erl
vim: ts=3
@end
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 Licen... | 2020 SigScale Global Inc.
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
module implements an SCTP association socket handler in the
{ @link //ngap . } application .
-module(ngap_association_fsm).
-copyright('Copyr... |
6e41adbc69cafe67eb2edc9c587cc097ee284c5384cdd928c45b8b2e1f57de96 | erlydtl/erlydtl | erlydtl_compiler_utils.erl | %%%-------------------------------------------------------------------
%%% File: erlydtl_compiler_utils.erl
@author < > [ ]
@author < >
@author < >
2008 ,
2014
%%% @doc
%%% ErlyDTL template compiler utils.
%%% @end
%%%
%%% The MIT License
%%%
Copyright ( c ) 2007 ,
C... | null | https://raw.githubusercontent.com/erlydtl/erlydtl/c1f3df8379b09894d333de4e9a3ca2f3e260cba3/src/erlydtl_compiler_utils.erl | erlang | -------------------------------------------------------------------
File: erlydtl_compiler_utils.erl
@doc
ErlyDTL template compiler utils.
@end
The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software")... | @author < > [ ]
@author < >
@author < >
2008 ,
2014
Copyright ( c ) 2007 ,
Copyright ( c ) 2014
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is
all copies or subst... |
b514e27131ededb6afd01935036c7f143f4c59c3d66a89d62e3ddd233f486378 | runeksvendsen/orderbook | OrderBook.hs | module OrderBook
( module OBT
, module OBM
)
where
import OrderBook.Types as OBT
import OrderBook.Matching as OBM
| null | https://raw.githubusercontent.com/runeksvendsen/orderbook/6521d80ffbf17a524de70bda040da170643e5e78/src/OrderBook.hs | haskell | module OrderBook
( module OBT
, module OBM
)
where
import OrderBook.Types as OBT
import OrderBook.Matching as OBM
| |
86f26e2b2b675c765292312bad9ae6a52d65c6a24c2b3aa16970fdee9639761e | ocaml/odoc | paths_desc.mli | open Odoc_model.Paths
val root : Odoc_model.Root.t Type_desc.t
val modulename : Odoc_model.Names.ModuleName.t Type_desc.t
val identifier : [< Identifier.t_pv ] Odoc_model.Paths.Identifier.id Type_desc.t
val resolved_path : [< Path.Resolved.t ] Type_desc.t
val path : [< Path.t ] Type_desc.t
val resolved_fragment :... | null | https://raw.githubusercontent.com/ocaml/odoc/c3f025d2e67d2a6f236bad5b0db7891ad0a7973f/src/model_desc/paths_desc.mli | ocaml | open Odoc_model.Paths
val root : Odoc_model.Root.t Type_desc.t
val modulename : Odoc_model.Names.ModuleName.t Type_desc.t
val identifier : [< Identifier.t_pv ] Odoc_model.Paths.Identifier.id Type_desc.t
val resolved_path : [< Path.Resolved.t ] Type_desc.t
val path : [< Path.t ] Type_desc.t
val resolved_fragment :... | |
e7709cfffedcf893033150f0cf7df14c0c5b4dee8ebbd2cb55e522d19859fb2a | cbaggers/cepl | var-speed-test.lisp | ;;
(declaim
(ftype (function (single-float single-float single-float) single-float)
top-level-closure)
(notinline top-level-closure))
(let ((the-id 0))
(declare (type (signed-byte 32) the-id))
(defun top-level-closure (x y z)
(declare (type single-float x y z)
(optimize (speed 3) (safety... | null | https://raw.githubusercontent.com/cbaggers/cepl/d1a10b6c8f4cedc07493bf06aef3a56c7b6f8d5b/core/protocode/var-speed-test.lisp | lisp |
so if we take the difference between the closure and var
Oh but wait! the packed approach is way better!
the gain is bigger over the closure that the cost of the seperate vars
awesome |
(declaim
(ftype (function (single-float single-float single-float) single-float)
top-level-closure)
(notinline top-level-closure))
(let ((the-id 0))
(declare (type (signed-byte 32) the-id))
(defun top-level-closure (x y z)
(declare (type single-float x y z)
(optimize (speed 3) (safety 1)... |
bb4721e2d8b87941cea9528a20e0aaee2276f3fd8346eb94695d08cb2b711465 | uw-unsat/leanette-popl22-artifact | lang.rkt | #lang s-exp rosette
(require "fs.rkt" "nondet.rkt")
(provide (all-defined-out))
Litmus tests are written as lists of syscalls .
(struct syscall () #:transparent)
(struct creat syscall (fd) #:transparent)
(struct write syscall (fd content) #:transparent)
(struct rename syscall (old new) #:transparent)
(struct efsyn... | null | https://raw.githubusercontent.com/uw-unsat/leanette-popl22-artifact/80fea2519e61b45a283fbf7903acdf6d5528dbe7/rosette-benchmarks-4/ferrite/lib/lang.rkt | racket | The problem is that if the instructions are merged, the operands can be
symbolic, and the operands of some ops are used in forms like (take ...),
which perform poorly when all operands are symbolic.
Making the structs mutable forces them to be concrete when they reach the
file system's (execute ...) form.
Since a... | #lang s-exp rosette
(require "fs.rkt" "nondet.rkt")
(provide (all-defined-out))
Litmus tests are written as lists of syscalls .
(struct syscall () #:transparent)
(struct creat syscall (fd) #:transparent)
(struct write syscall (fd content) #:transparent)
(struct rename syscall (old new) #:transparent)
(struct efsyn... |
09d4d5f79535a6599b9b45107bd6eec8e71456fa6ba98ae1720058f8378e4631 | NorfairKing/tickler | PostEmailTrigger.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
module Tickler.Server.Handler.Protected.PostEmailTrigger (servePostEmailTrigger) where
import Data.Time
import Data.UUID.Typed
import Database.Persist
import Import
import Tickler.API
import Tickler.Se... | null | https://raw.githubusercontent.com/NorfairKing/tickler/71c6aec471d095fe2357e135bed90a92619de393/tickler-server/src/Tickler/Server/Handler/Protected/PostEmailTrigger.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE RecordWildCards #
module Tickler.Server.Handler.Protected.PostEmailTrigger (servePostEmailTrigger) where
import Data.Time
import Data.UUID.Typed
import Database.Persist
import Import
import Tickler.API
import Tickler.Se... | |
89362309e630d6ced591edaec92ca1e10af5b38de0135bfeffde3aaa8a612d37 | ocaml-ppx/ppx | int.ml | module T = struct
type t = int
let compare (a : int) b : Ordering.t =
if a < b then
Lt
else if a = b then
Eq
else
Gt
let to_sexp = Sexp.Encoder.int
end
include T
module Set = Set.Make(T)
module Map = Map.Make(T)
let equal (a : t) b = a = b
let hash (t : t) = t
let of_string_exn ... | null | https://raw.githubusercontent.com/ocaml-ppx/ppx/40e5a35a4386d969effaf428078c900bd03b78ec/stdppx/int.ml | ocaml | module T = struct
type t = int
let compare (a : int) b : Ordering.t =
if a < b then
Lt
else if a = b then
Eq
else
Gt
let to_sexp = Sexp.Encoder.int
end
include T
module Set = Set.Make(T)
module Map = Map.Make(T)
let equal (a : t) b = a = b
let hash (t : t) = t
let of_string_exn ... | |
f4f09ea6772454ebacc040d9e762b5e29b2394e90927797eb1b09dc5fd34aebb | tisnik/clojure-examples | project.clj | ;
( C ) Copyright 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:
;
(defproject testing2 "0.1.0-SNAPSHOT"
:de... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/cf9b3484a332ebd93bc585f051802c333ebde3df/testing2/project.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 2021
-v10.html
(defproject testing2 "0.1.0-SNAPSHOT"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.10.1"]
[org.clojure/java.jdbc "0.3.5"]
... |
5da522118a115eea99f017b9fa1e6788008cb8ed5a7509ac13cf626fe269259f | sadiqj/ocaml-esp32 | ident.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/sadiqj/ocaml-esp32/33aad4ca2becb9701eb90d779c1b1183aefeb578/typing/ident.ml | ocaml | ************************************************************************
OCaml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Format
type t = { stamp: int; name: string; mutable flags: int }
let global_flag = 1
let predef_ex... |
567ce176889a21ea9da3f572d9e2f4691aee0a5927977f81f2d6b63b6b3d4685 | anton-k/sharc-timbre | BassClarinet.hs | module Sharc.Instruments.BassClarinet (bassClarinet) where
import Sharc.Types
bassClarinet :: Instr
bassClarinet = Instr
"bass_clarinet"
"Bass Clarinet"
(Legend "McGill" "2" "12")
(Range
(InstrRange
(HarmonicFreq 1 (Pitch 69.29 25 "c#2"))
(Pitch 69.29 25 "c#2")
... | null | https://raw.githubusercontent.com/anton-k/sharc-timbre/14be260021c02f31905b3e63269f582030a45c8d/src/Sharc/Instruments/BassClarinet.hs | haskell | module Sharc.Instruments.BassClarinet (bassClarinet) where
import Sharc.Types
bassClarinet :: Instr
bassClarinet = Instr
"bass_clarinet"
"Bass Clarinet"
(Legend "McGill" "2" "12")
(Range
(InstrRange
(HarmonicFreq 1 (Pitch 69.29 25 "c#2"))
(Pitch 69.29 25 "c#2")
... | |
9d592e6779cedae8c92997b7ece3c30e1677e96c55883d424387b551a4078d9f | dinosaure/tuyau | tuyau_caml.ml | module Caml_scheduler = struct
type 'a t = 'a
let bind x f = f x
let return x = x
end
include Tuyau.Make (Caml_scheduler)(Bytes)(String)
| null | https://raw.githubusercontent.com/dinosaure/tuyau/8ed849805153f5dfad6c045782e3d20ef06cd9b6/caml/tuyau_caml.ml | ocaml | module Caml_scheduler = struct
type 'a t = 'a
let bind x f = f x
let return x = x
end
include Tuyau.Make (Caml_scheduler)(Bytes)(String)
| |
5469a806be8d82163a54698f14ff11e68b258113e1268ea7ed6b1ecc69a8a941 | camllight/camllight | canvas_bind.mli | value bind : support__widget -> tagOrId ->
(modifier list * xEvent) list -> bindAction -> unit
;;
| null | https://raw.githubusercontent.com/camllight/camllight/0cc537de0846393322058dbb26449427bfc76786/sources/contrib/camltk4/libsupport/canvas_bind.mli | ocaml | value bind : support__widget -> tagOrId ->
(modifier list * xEvent) list -> bindAction -> unit
;;
| |
2385853a1abc0f0850d5cb996a46cf2e71987131d3c78e3334cd4f16c32254cc | dhess/hpio | GpioReader.hs | {-|
This program demonstrates how to use the 'SysfsGpioT' transformer with
a transformer stack.
-}
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
module Main where
Protolude uses < > and options from Semigroups , but
-- optparse-applicati... | null | https://raw.githubusercontent.com/dhess/hpio/27004ef379db5d35e240222d6ba4cf91da9ec14d/examples/GpioReader.hs | haskell | |
This program demonstrates how to use the 'SysfsGpioT' transformer with
a transformer stack.
# LANGUAGE ConstraintKinds #
# LANGUAGE OverloadedStrings #
optparse-applicative hasn't caught up yet.
Only one for now.
| Our 'IO' transformer stack:
* A reader monad.
* 'IO'
The 'listPins' program takes no arguments... |
# LANGUAGE FlexibleContexts #
# LANGUAGE LambdaCase #
module Main where
Protolude uses < > and options from Semigroups , but
import Protolude hiding ((<>))
import Control.Monad.Catch (MonadMask)
import Data.Monoid ((<>))
import Data.Text (unwords)
import Options.Applicative
(Parser, argument, auto, command,... |
c740f0d40003d9de1dcaf36e8fc0b0996adbb8ab572696a5b8cd0654b2ed6048 | scverif/scverif | utils.mli | Copyright 2019 - 2020 - Inria , NXP
(* Copyright 2021 - NXP *)
SPDX - License - Identifier : BSD-3 - Clause - Clear WITH modifications
(* -------------------------------------------------------------------- *)
module Set : sig include module type of BatSet end
module Map : sig include module type of BatMap end
m... | null | https://raw.githubusercontent.com/scverif/scverif/307a17b61a2286fb7009d434825f9245caebfddc/src/utils.mli | ocaml | Copyright 2021 - NXP
--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
--------------------------------------------------------------------
------------... | Copyright 2019 - 2020 - Inria , NXP
SPDX - License - Identifier : BSD-3 - Clause - Clear WITH modifications
module Set : sig include module type of BatSet end
module Map : sig include module type of BatMap end
module Hash : sig include module type of BatHashtbl end
module Sint : Set.S with type elt = int
module... |
aae7204231e5e4cb89dbd4797fbccad2c579c684c9aa96b9009311ba76617297 | acieroid/overscore | identification.clj | ;;; Identify the position of the staffline using a method described by
in 1988 .
The method is done in two times : first we locate
;;; the systems, then for each system we locate the stafflines.
;;; To locate the systems, we do a y-projection over the entire image,
and look for 5 peaks of black pixels , separa... | null | https://raw.githubusercontent.com/acieroid/overscore/71649b37c415482b6c4ab150290ef0719649d359/src/overscore/staffline/identification.clj | clojure | Identify the position of the staffline using a method described by
the systems, then for each system we locate the stafflines.
To locate the systems, we do a y-projection over the entire image,
distance.
Once the systems are located, for each system we look for the
beginning and the end of the stafflines by movin... | in 1988 .
The method is done in two times : first we locate
and look for 5 peaks of black pixels , separated from a similar
different images and can be analyzed separately .
(ns overscore.staffline.identification
(:use overscore.proj
overscore.utils)
(:import java.awt.image.BufferedImage))
(d... |
a3b2dda1f9d9c846c0748d141773ba178bf9416b4867da4daa96f60bd0397646 | discus-lang/ddc | Pipeline.hs | {-# LANGUAGE GADTs #-}
-- | A pipeline is an abstraction of a single compiler pass.
--
NOTE : The documentation on pipeline constructors is missing
because does not support commenting GADTs .
-- See the source code for documentation.
--
module DDC.Build.Pipeline
( -- * Errors
Erro... | null | https://raw.githubusercontent.com/discus-lang/ddc/2baa1b4e2d43b6b02135257677671a83cb7384ac/src/s1/ddc-build/DDC/Build/Pipeline.hs | haskell | # LANGUAGE GADTs #
| A pipeline is an abstraction of a single compiler pass.
See the source code for documentation.
* Errors
* Source code
* Core Flow modules
* Core Machine modules
* Emitting output | NOTE : The documentation on pipeline constructors is missing
because does not support commenting GADTs .
module DDC.Build.Pipeline
Error(..)
, PipeText (..)
, pipeText
* Generic Core modules
, PipeCore (..)
, pipeCore
, PipeFlow (... |
c8bc0e503cd58bdd61c29d39706061f0583880a9b5bd9f91c4e0d4405dbabcce | webyrd/mediKanren | transform-node-normalization.rkt | #lang racket/base
(require "transform-edge-jsonl.rkt"
"transform-node-normalization-nodes.rkt")
(transform-node-normalization-nodes)
(transform-edge-jsonl "../../neo-data/raw_downloads_from_kge_archive/node_normalization/edges.jsonl"
"../../neo-data/raw_downloads_from_kge_archive_transf... | null | https://raw.githubusercontent.com/webyrd/mediKanren/9fdaf625066bb25cef99e7aadcb0cc1c4e59654d/medikanren2/neo/neo-data-import/transform-2tsv-to-4tsv-kgs/transform-node-normalization.rkt | racket | #lang racket/base
(require "transform-edge-jsonl.rkt"
"transform-node-normalization-nodes.rkt")
(transform-node-normalization-nodes)
(transform-edge-jsonl "../../neo-data/raw_downloads_from_kge_archive/node_normalization/edges.jsonl"
"../../neo-data/raw_downloads_from_kge_archive_transf... | |
53b947976f60fd443fb7327a9ec5abc9266cae55572d89475ef8ed0d2fac5b8d | parapluu/Concuerror | strip_attr.erl | %%%----------------------------------------------------------------------
%%% File : strip_attr.erl
Authors : < >
< >
%%% Description : Test stripping type and spec related attributes
%%% (type, spec, opaque, export_type, import_type)
%%% before instrument... | null | https://raw.githubusercontent.com/parapluu/Concuerror/152a5ccee0b6e97d8c3329c2167166435329d261/resources/syntax/strip_attr.erl | erlang | ----------------------------------------------------------------------
File : strip_attr.erl
Description : Test stripping type and spec related attributes
(type, spec, opaque, export_type, import_type)
before instrumentation (import_type not tested).
------------------------------... | Authors : < >
< >
Created : 9 Jan 2010
-module(strip_attr).
-export([foo/0]).
-export_type([mytype/0]).
-record(myrec, {foo :: integer(), bar :: integer()}).
-type mytype() :: #myrec{}.
-opaque mytype_2() :: #myrec{}.
-spec foo() -> {mytype(), mytype_2()}.
foo() -> {#myrec{fo... |
bad85740f7ebc3544f8c7044505ea284b2324cf5ec882a27c32a7318d46253a3 | vimus/vimus | ListWidget.hs | # LANGUAGE DeriveFunctor #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
module Vimus.Widget.ListWidget (
ListWidget
, new
, getLength
-- * current element
, getPosition
, select
, breadcrumbs
, selected
, removeSelected
, selectGroupBy
-- * movement
, move
, moveUp
, move... | null | https://raw.githubusercontent.com/vimus/vimus/26a164fb50870f8112ca4b6c30820431c015916f/src/Vimus/Widget/ListWidget.hs | haskell | * current element
* movement
* parent and children
* update
* format
* exported, because they have fewer constraints than the Widget variants
* exported for testing
| position of viewport within the list
| The number of lines that are available for content.
| Make sure that position is within the viewport.
... | # LANGUAGE DeriveFunctor #
# LANGUAGE RecordWildCards #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeFamilies #
module Vimus.Widget.ListWidget (
ListWidget
, new
, getLength
, getPosition
, select
, breadcrumbs
, selected
, removeSelected
, selectGroupBy
, move
, moveUp
, moveDown
, moveUpWhile
, moveDownWhile
... |
043029a180a01ff3816ee5b669e23c774cbed670c7f16167e181aa6ef1a2843f | cbaggers/cepl.examples | tessellation-inline-glsl.lisp | (in-package :cepl.examples+camera)
;;- - - - - - - - - - - - - - - - - -
(defparameter sphere-stream nil)
(defparameter brick nil)
(defstruct sphere
(pos (v! 0 0 -10))
(rot (q:identity)))
(defparameter sphere-a (make-sphere :pos (v! 0 0 -1.5)))
;;- - - - - - - - - - - - - - - - - -
(defun model->world (x)
(... | null | https://raw.githubusercontent.com/cbaggers/cepl.examples/87ac3def3e674632662350c809edf09f4820fbd1/examples/tessellation-inline-glsl.lisp | lisp | - - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - - - -
Inline glsl for vertex shaders is not currently supported
- - - - - - - - - - - - - - - - - -
- - - - - - - - - - - - - - - ... | (in-package :cepl.examples+camera)
(defparameter sphere-stream nil)
(defparameter brick nil)
(defstruct sphere
(pos (v! 0 0 -10))
(rot (q:identity)))
(defparameter sphere-a (make-sphere :pos (v! 0 0 -1.5)))
(defun model->world (x)
(m4:* (m4:translation (sphere-pos x)) (q:to-mat4 (sphere-rot x))))
(defun wo... |
eb0ed69888779202568191f70aeb1c3acf82a5b884e625aab22c0e46c9c1fb42 | nklein/Woolly | font.lisp |
(in-package #:woolly)
(sheeple:defproto =font= ()
((em-size 12)
zpb-font-loader))
(sheeple:defmessage open-font (font pathname)
(:documentation "Force the FONT sheep to open the font specified by PATHNAME")
(:reply (f p) (error "No way to open a font on (~S,~S)" f p)))
(sheeple:defreply sheeple:init-object... | null | https://raw.githubusercontent.com/nklein/Woolly/f18b5d5dc28b04e6a194757d7ebc1f03bb6ebd4d/woolly/font.lisp | lisp |
(in-package #:woolly)
(sheeple:defproto =font= ()
((em-size 12)
zpb-font-loader))
(sheeple:defmessage open-font (font pathname)
(:documentation "Force the FONT sheep to open the font specified by PATHNAME")
(:reply (f p) (error "No way to open a font on (~S,~S)" f p)))
(sheeple:defreply sheeple:init-object... | |
068e366be42068a182a05c915a80da16b19196c42ccc411e775748c00cec1e60 | MinaProtocol/mina | validated_block.mli | open Mina_base
[%%versioned:
module Stable : sig
module V2 : sig
type t [@@deriving sexp, equal]
val to_yojson : t -> Yojson.Safe.t
end
end]
type t = Stable.Latest.t [@@deriving sexp, to_yojson, equal]
val lift : Validation.fully_valid_with_block -> t
val forget : t -> Block.with_hash
val remember : t... | null | https://raw.githubusercontent.com/MinaProtocol/mina/f3f7d625ce45a0820a56ebc8f4f1c967865a3e57/src/lib/mina_block/validated_block.mli | ocaml | open Mina_base
[%%versioned:
module Stable : sig
module V2 : sig
type t [@@deriving sexp, equal]
val to_yojson : t -> Yojson.Safe.t
end
end]
type t = Stable.Latest.t [@@deriving sexp, to_yojson, equal]
val lift : Validation.fully_valid_with_block -> t
val forget : t -> Block.with_hash
val remember : t... | |
68e7d9bb51145ed6d8829b9b70098e10869b373f4f7ea7d29cbefdf8aa4da085 | haskell-rewriting/term-rewriting | Samples.hs | -- This file is part of the 'term-rewriting' library. It is licensed
under an MIT license . See the accompanying ' LICENSE ' file for details .
--
Authors :
# LANGUAGE StandaloneDeriving #
-- selected samples for tests
module Samples where
import Data.Rewriting.Term (Term (..))
import qualified Data.Rewriting... | null | https://raw.githubusercontent.com/haskell-rewriting/term-rewriting/d01ee419f9fd3c2011d37b6417326a9373d5ee9c/test/Samples.hs | haskell | This file is part of the 'term-rewriting' library. It is licensed
selected samples for tests
>) = Rule
> g[a, x], f[a, y] --> h[a], a --> b] | under an MIT license . See the accompanying ' LICENSE ' file for details .
Authors :
# LANGUAGE StandaloneDeriving #
module Samples where
import Data.Rewriting.Term (Term (..))
import qualified Data.Rewriting.Term as Term
import Data.Rewriting.Rule (Rule (..))
import Data.Rewriting.Pos (Pos)
import Data.Rewri... |
857ff6ee22fec9282eb486125936abfc953f5e81eecba6a5a22b55dc4a3e1f48 | kennytilton/its-alive | test-cycle.lisp | ;; -*- mode: Lisp; Syntax: Common-Lisp; Package: cells; -*-
;;;
Copyright ( c ) 1995,2003 by .
;;;
;;; 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 w... | null | https://raw.githubusercontent.com/kennytilton/its-alive/9a627c1b7f16efc005103985ce27a4bcdbab9fce/lisp/test-cycle.lisp | lisp | -*- mode: Lisp; Syntax: Common-Lisp; Package: cells; -*-
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
to do so, subject to the... | Copyright ( c ) 1995,2003 by .
in the Software without restriction , including without limitation the rights
copies of the Software , and to permit persons to whom the Software is furnished
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIN... |
bbd604b22d3ddf23d0ee78626cc13f5f81b1d3527c312a2bcba1ccf8ad922faa | ertugrulcetin/ClojureNews | not_found.clj | (ns clj.route.not-found
(:require [compojure.core :refer [defroutes]]
[compojure.route :refer [not-found]]))
(defroutes route
( not - found " Unkown . " )
) | null | https://raw.githubusercontent.com/ertugrulcetin/ClojureNews/28002f6b620fa4977d561b0cfca0c7f6a635057b/src/clj/route/not_found.clj | clojure | (ns clj.route.not-found
(:require [compojure.core :refer [defroutes]]
[compojure.route :refer [not-found]]))
(defroutes route
( not - found " Unkown . " )
) | |
414e8f6ed39441bc5bc9f47421203ef0ca91dcaada6c44c5a5f6e5f89f6f3b62 | josefs/Gradualizer | cons.erl | -module(cons).
-export([f/0]).
-spec f() -> [].
f() -> [x, y].
| null | https://raw.githubusercontent.com/josefs/Gradualizer/208f5816b0157f282212fc036ba7560f0822f9fc/test/should_fail/cons.erl | erlang | -module(cons).
-export([f/0]).
-spec f() -> [].
f() -> [x, y].
| |
23ef9c99777c1dd953b1f9d5657e59ab4c152c4f69e32b0c9c337904b6aa2eb0 | chaoxu/fancy-walks | A.hs | # LANGUAGE MultiParamTypeClasses , FunctionalDependencies , FlexibleInstances #
{-# OPTIONS_GHC -O2 #-}
import Data.List
import Data.Maybe
import Data.Char
import Data.Array.IArray
import Data.Array.Unboxed (UArray)
import Data.Int
import Data.Ratio
import Data.Bits
import Data.Function
import Data.Ord
import Control ... | null | https://raw.githubusercontent.com/chaoxu/fancy-walks/952fcc345883181144131f839aa61e36f488998d/codeforces.com/98/A.hs | haskell | # OPTIONS_GHC -O2 #
--------------------------------------------------------------------
--------------------------------------------------------------------
-------------------------------------------------------------------- | # LANGUAGE MultiParamTypeClasses , FunctionalDependencies , FlexibleInstances #
import Data.List
import Data.Maybe
import Data.Char
import Data.Array.IArray
import Data.Array.Unboxed (UArray)
import Data.Int
import Data.Ratio
import Data.Bits
import Data.Function
import Data.Ord
import Control . Monad . State
import C... |
a01b880ad294cb74cca2735a6e1619be4726c613ade45585253512c5efa3d37d | ronxin/stolzen | nestedmappings.scm | #lang scheme
(define (accumulate op initial sequence)
(if (null? sequence)
initial
(op (car sequence)
(accumulate op initial (cdr sequence)))
)
)
(define (enumerate-interval begin end)
(if (> begin end)
null
(cons begin (enumerate-interval (+ begin... | null | https://raw.githubusercontent.com/ronxin/stolzen/bb13d0a7deea53b65253bb4b61aaf2abe4467f0d/sicp/chapter2/2.2/nestedmappings.scm | scheme | permutations
algorithm:
for each element s in S do:
calc permutations for S without s
append s to each permutation in result
Notice how this strategy reduces the problem of generating
permutations of S to the problem of generating the permutations of
sets with fewer elements than S. In the terminal c... | #lang scheme
(define (accumulate op initial sequence)
(if (null? sequence)
initial
(op (car sequence)
(accumulate op initial (cdr sequence)))
)
)
(define (enumerate-interval begin end)
(if (> begin end)
null
(cons begin (enumerate-interval (+ begin... |
7ba69cb846b37ca7d71d010e5f63fb3cbb2dfda18d7f5cc6dff6f9b8d93d3995 | dongcarl/guix | final.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2018 , 2020 < >
Copyright © 2019 , 2020 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software F... | null | https://raw.githubusercontent.com/dongcarl/guix/82543e9649da2da9a5285ede4ec4f718fd740fcb/gnu/installer/final.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 © 2018 , 2020 < >
Copyright © 2019 , 2020 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu installer final)
#:use-module (gnu installer newt pa... |
c9c602cd9e39b8eb35df00dc39001285188e56d5bafb210ec3da3c4a165d0cda | namin/biohacker | coverage.lisp | (defvar *coverage-path*
(make-path *trunk-home* "coverage"))
(defvar *coverage-rules-file*
(make-bps-source-file-name *coverage-path* "coverage-rules"))
(defvar *debugging-coverage* t)
(defvar *organism* nil)
(defmacro debugging-coverage (msg &rest args)
`(when *debugging-coverage* (format t ,msg ,@ args)))
... | null | https://raw.githubusercontent.com/namin/biohacker/6b5da4c51c9caa6b5e1a68b046af171708d1af64/coverage/coverage.lisp | lisp | see if we can get growth by assuming some reactions | (defvar *coverage-path*
(make-path *trunk-home* "coverage"))
(defvar *coverage-rules-file*
(make-bps-source-file-name *coverage-path* "coverage-rules"))
(defvar *debugging-coverage* t)
(defvar *organism* nil)
(defmacro debugging-coverage (msg &rest args)
`(when *debugging-coverage* (format t ,msg ,@ args)))
... |
bccc0b46cdb24451d15d276f381ed71bf6c66fee4549a51c25631fd4ba80efc0 | morazanm/fsm | genCode.rkt | #lang racket
(require racket/date
"globals.rkt"
"./structs/machine.rkt"
"./structs/world.rkt"
"./structs/state.rkt"
"./structs/input.rkt"
"../fsm-core/interface.rkt")
(provide genCode)
;; genCode: world -> world
;; Purpose: Writes the current machine in the visua... | null | https://raw.githubusercontent.com/morazanm/fsm/9ab59c0cf45e4932e4aa1512ac8246f53c0f7f1d/fsm-gui/genCode.rkt | racket | genCode: world -> world
Purpose: Writes the current machine in the visualization tool to a specified file location
valid-machine?: machine -> boolean
write-to-file: path machine boolean -> ()
Purpose: writes the comments and code to create a machine in the specified file.
If the file does not exist it will crea... | #lang racket
(require racket/date
"globals.rkt"
"./structs/machine.rkt"
"./structs/world.rkt"
"./structs/state.rkt"
"./structs/input.rkt"
"../fsm-core/interface.rkt")
(provide genCode)
(define (genCode world file-path)
(define machine (world-fsm-machine world))... |
e639e1faf25f41f1207fbca56259370cc38cc6762cd7b4c5c99b3ecd0ee91008 | lispgames/cl-sdl2 | gamecontroller.lisp | (in-package #:sdl2)
SDL2 has some mappings built - in , but since I have a wonderful Logitech controller that is n't part
;; of the spec yet I embed these here. Also it's a good example of how to provide your own
(defparameter *default-controller-maps* ())
(defmacro add-to-default-controller-maps (&rest maps)
`(... | null | https://raw.githubusercontent.com/lispgames/cl-sdl2/80410b514570ca06894675d4a2a5fc93287ea7b6/src/gamecontroller.lisp | lisp | of the spec yet I embed these here. Also it's a good example of how to provide your own
controller | (in-package #:sdl2)
SDL2 has some mappings built - in , but since I have a wonderful Logitech controller that is n't part
(defparameter *default-controller-maps* ())
(defmacro add-to-default-controller-maps (&rest maps)
`(setf *default-controller-maps*
(append *default-controller-maps* ,@maps)))
(add-t... |
3281efc81a012c055d7792204ae7cd402756663d903ab7f0599ee8b2838727de | ocaml-sf/learn-ocaml-corpus | map.ml | (* Basic constructor functions. *)
let empty : 'a enum =
fun _s ->
Seq.empty
let just (x : 'a) : 'a enum =
fun s ->
if s = 0 then Seq.singleton x else Seq.empty
let pay (enum : 'a enum) : 'a enum =
fun s ->
(* Treating [s = 0] as a special case is required, because we have asked
the student ... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/enumerating_trees/wrong/map.ml | ocaml | Basic constructor functions.
Treating [s = 0] as a special case is required, because we have asked
the student to guarantee that every size argument [s] ever passed to
an enumeration is nonnegative.
wrong: this combines [pay] and [map] |
let empty : 'a enum =
fun _s ->
Seq.empty
let just (x : 'a) : 'a enum =
fun s ->
if s = 0 then Seq.singleton x else Seq.empty
let pay (enum : 'a enum) : 'a enum =
fun s ->
if s = 0 then Seq.empty else enum (s-1)
let sum (enum1 : 'a enum) (enum2 : 'a enum) : 'a enum =
fun s ->
Seq.sum (enum1 ... |
6af5e6a1760aadcb7dfbc68a8d7a64587eb3df0e758ca9fa4e3d8f3f0eb5f5aa | athos/lein-with-env-vars | with_env_vars.clj | (ns leiningen.with-env-vars
(:require [clojure.edn :as edn]
[clojure.java.io :as io]
[leiningen.core.eval :as eval]
[leiningen.core.main :as main]
[robert.hooke :as hooke]))
(defn- read-env-vars [file]
(edn/read-string (slurp (io/file file))))
(defn- collect-env-var... | null | https://raw.githubusercontent.com/athos/lein-with-env-vars/7a4e42883e9bd3a8442a4408698a3a208c806ead/src/leiningen/with_env_vars.clj | clojure | (ns leiningen.with-env-vars
(:require [clojure.edn :as edn]
[clojure.java.io :as io]
[leiningen.core.eval :as eval]
[leiningen.core.main :as main]
[robert.hooke :as hooke]))
(defn- read-env-vars [file]
(edn/read-string (slurp (io/file file))))
(defn- collect-env-var... | |
d1061fa8cc34c01df68a0e61b9cd34c6df2a6f18d2ac034f28bd41f4917cbee5 | immutant/immutant | internal.clj | Copyright 2014 - 2017 Red Hat , Inc , and individual contributors .
;;
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 ... | null | https://raw.githubusercontent.com/immutant/immutant/6ff8fa03acf73929f61f2ca75446cb559ddfc1ef/scheduling/src/immutant/scheduling/internal.clj | clojure |
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 permiss... | Copyright 2014 - 2017 Red Hat , Inc , and individual contributors .
distributed under the License is distributed on an " AS IS " BASIS ,
(ns ^:no-doc ^:internal immutant.scheduling.internal
(:require [immutant.internal.options :as o]
[immutant.internal.util :as u])
(:import org.projectodd.wu... |
8ad44d51a670c6c2b37cea66e1cccad4395bbdd529150d83b8d8da3545a523cd | xapi-project/xapi-xe | unixext.ml | open Pervasiveext
let try_read_string ?limit fd =
let buf = Buffer.create 0 in
let chunk = match limit with None -> 4096 | Some x -> x in
let cache = String.make chunk '\000' in
let finished = ref false in
while not !finished do
let to_read = match limit with
... | null | https://raw.githubusercontent.com/xapi-project/xapi-xe/7a170a1c7a4ed7855b3c1acd702f8a013c044cf5/src/unixext.ml | ocaml | * open a file, and make sure the close is always done
* [fd_blocks_fold block_size f start fd] folds [f] over blocks (strings)
from the fd [fd] with initial value [start]
* open a file, and make sure the close is always done
* open a file, and make sure the close is always done | open Pervasiveext
let try_read_string ?limit fd =
let buf = Buffer.create 0 in
let chunk = match limit with None -> 4096 | Some x -> x in
let cache = String.make chunk '\000' in
let finished = ref false in
while not !finished do
let to_read = match limit with
... |
c1d4cf9e4c9effef9abe8ec1a9324c904d6984eca360af58d2147365217fac17 | databrary/databrary | Mail.hs | {-# LANGUAGE OverloadedStrings #-}
module Service.Mail
( initMailer
, Mailer(..)
, MonadMail
, sendMail
-- below for testing
, wrapText
) where
import Control.Monad.IO.Class (liftIO)
import Data.Aeson (decode)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS
import Data... | null | https://raw.githubusercontent.com/databrary/databrary/685f3c625b960268f5d9b04e3d7c6146bea5afda/src/Service/Mail.hs | haskell | # LANGUAGE OverloadedStrings #
below for testing
settings where mailer is not being mocked
| Default implementation of sendMail to be used in most environments besides unit tests
| Server hostname for smtp mail delivery
| Sever port for smtp mail delivery
| Account password for smtp mail delivery
| Parts of mail... | module Service.Mail
( initMailer
, Mailer(..)
, MonadMail
, sendMail
, wrapText
) where
import Control.Monad.IO.Class (liftIO)
import Data.Aeson (decode)
import qualified Data.ByteString as BS
import qualified Data.ByteString.Lazy as LBS
import Data.Int (Int64)
import Data.Monoid ((<>))
import qualified Da... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.