_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 |
|---|---|---|---|---|---|---|---|---|
8f646fdc2805a1b15d5e4ef593574d40dff9aef53e84915d6d290396dd323208 | helium/router | router_console.erl | -module(router_console).
-export([command/1]).
-spec command([string()]) -> ok.
command(Cmd) ->
clique:run(Cmd).
| null | https://raw.githubusercontent.com/helium/router/8a103868831e99f72600ba34ef2f8ea2c3351e51/src/cli/router_console.erl | erlang | -module(router_console).
-export([command/1]).
-spec command([string()]) -> ok.
command(Cmd) ->
clique:run(Cmd).
| |
6b981b312dfa1bd04c6d66aabc96a43f6ec01690202449af5cdcc399c0478d9d | metabase/metabase | verify.clj | (ns metabase.test.data.impl.verify
"Logic for verifying that test data was loaded correctly."
(:require
[metabase.driver :as driver]
[metabase.models :refer [Table]]
[metabase.query-processor :as qp]
[metabase.test.data.interface :as tx]
[metabase.util :as u]
[metabase.util.log :as log]
[toucan... | null | https://raw.githubusercontent.com/metabase/metabase/dad3d414e5bec482c15d826dcc97772412c98652/test/metabase/test/data/impl/verify.clj | clojure | (ns metabase.test.data.impl.verify
"Logic for verifying that test data was loaded correctly."
(:require
[metabase.driver :as driver]
[metabase.models :refer [Table]]
[metabase.query-processor :as qp]
[metabase.test.data.interface :as tx]
[metabase.util :as u]
[metabase.util.log :as log]
[toucan... | |
0115b1d23b69725aaf62df1633505725ba21975f8790811eea4cb8a6e1c54ce4 | erldb/erldb | erldb.erl | %%%-------------------------------------------------------------------
@author < > [ ]
( C ) 2013 ,
%%% @doc
Main interface for erldb
%%% @end
Created : 16 Dec 2013 by
%%%-------------------------------------------------------------------
-module(erldb).
-export([
get_all_models/0,
st... | null | https://raw.githubusercontent.com/erldb/erldb/d014c29ab5efa00c26847d637ce09be83b10cc19/src/erldb.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
--------------------------------------------------------------------
@doc Starts the erldb application
@end
-------------------------------------------------------------... | @author < > [ ]
( C ) 2013 ,
Main interface for erldb
Created : 16 Dec 2013 by
-module(erldb).
-export([
get_all_models/0,
start/1,
stop/0,
find/2,
find/3,
find_one/2,
find_one/3,
delete/1,
delete/2,
save/1,
... |
3699c5c905fcb4e3cbbd30f33cca25fc0c98816b4d7943ab6e5bbc27ec588dee | SamB/coq | unify.mli | (************************************************************************)
v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *... | null | https://raw.githubusercontent.com/SamB/coq/8f84aba9ae83a4dc43ea6e804227ae8cae8086b1/contrib/firstorder/unify.mli | ocaml | **********************************************************************
// * This file is distributed under the terms of the
* GNU Lesser General Public License Version 2.1
**********************************************************************
domaine de quantification | v * The Coq Proof Assistant / The Coq Development Team
< O _ _ _ , , * CNRS - Ecole Polytechnique - INRIA Futurs - Universite Paris Sud
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
$ Id$
open Term
excepti... |
1ac12f056c085c9501612bf9ebdd356287364e3eb80369591170456d4bdd6ab6 | CryptoKami/cryptokami-core | Random.hs | -- | Secure generation of random numbers and bytestrings.
module Pos.Crypto.Random
( SecureRandom(..)
, secureRandomBS
, deterministic
, randomNumber
, randomNumberInRange
) where
import Crypto.Number.Basic (numBytes)
import Crypto.Number.Serialize (os2ip... | null | https://raw.githubusercontent.com/CryptoKami/cryptokami-core/12ca60a9ad167b6327397b3b2f928c19436ae114/crypto/Pos/Crypto/Random.hs | haskell | | Secure generation of random numbers and bytestrings.
| You can use 'runSecureRandom' on any 'MonadRandom' computation to make
| You can use 'deterministic' on any 'MonadRandom' computation to make it
use a seed (hopefully produced by a Really Secure™ randomness source). The
seed has to have enough entropy to mak... |
module Pos.Crypto.Random
( SecureRandom(..)
, secureRandomBS
, deterministic
, randomNumber
, randomNumberInRange
) where
import Crypto.Number.Basic (numBytes)
import Crypto.Number.Serialize (os2ip)
import Crypto.OpenSSL.Random (randBytes)
impor... |
da48d01838e6778c9c5aff4d96966843bd64def602b8a3c7a6342f12f8fc8703 | quoll/leap-clj | vector.clj | (ns leap.vector
(:import [com.leapmotion.leap Vector]))
(defprotocol LVector
(angle [v1 v2] "The angle in radians between two vectors")
(cross [v1 v2] "The cross product between two vectors")
(distance [v1 v2] "The distance between points specified by two vectors")
(divide [v s] "Divides a vector by a scalar... | null | https://raw.githubusercontent.com/quoll/leap-clj/3cac6c274d133cfe050966c7ada910c7718f43ca/src/leap/vector.clj | clojure | (ns leap.vector
(:import [com.leapmotion.leap Vector]))
(defprotocol LVector
(angle [v1 v2] "The angle in radians between two vectors")
(cross [v1 v2] "The cross product between two vectors")
(distance [v1 v2] "The distance between points specified by two vectors")
(divide [v s] "Divides a vector by a scalar... | |
e1e8365f42b04d71cc3e63716d5353fc4c005b179e25affb884d5b152d431582 | ahrefs/atd | test2.expected.ml | (* Auto-generated from "test2.atd" *)
[@@@ocaml.warning "-27-32-33-35-39"]
open Test
type ('aa, 'bb) poly = ('aa, 'bb) Test.poly
type poly_int2 = (int, int) poly
type test2 = { test0: poly_int2; test1: (int, string option) poly }
type poly_int_string = (int, string) poly
let poly_tag = Test.poly_tag
let write_unta... | null | https://raw.githubusercontent.com/ahrefs/atd/1f2b3bcc54d14159a5e25e9b23b5c9bed163721c/atdgen/test/test2.expected.ml | ocaml | Auto-generated from "test2.atd" | [@@@ocaml.warning "-27-32-33-35-39"]
open Test
type ('aa, 'bb) poly = ('aa, 'bb) Test.poly
type poly_int2 = (int, int) poly
type test2 = { test0: poly_int2; test1: (int, string option) poly }
type poly_int_string = (int, string) poly
let poly_tag = Test.poly_tag
let write_untagged_poly _aa_tag write_untagged__aa w... |
3c9c13328eaceeb4c8245c9c9c91936e05ad5b419b983fec64b80164623cf777 | 6cdh/racket-fixw | fixw.rkt | #lang racket/base
(provide fixw
fixw/lines)
(require syntax-color/racket-lexer
racket/match
racket/list
racket/string
racket/port
racket/hash
"rules.rkt")
(define (lexer in)
(define-values (text type paren start end) (racket-lexer in))
(cond [(eof-ob... | null | https://raw.githubusercontent.com/6cdh/racket-fixw/5b6e7e27b3b16b1566b3c034a91b23f0ff90fb6d/fixw.rkt | racket | for example, it's `fn` in `(fn arg ...)`,
it's `(` in `()`
it's `(` in `((fn ...))`
the number of current atom in current list, 0-indexed
the opening paren token
char position of the last char of the opening parenthesis at it's line
otherwise, it's -1
return a list of tokens
returned tokens:
* 'newline - "\... | #lang racket/base
(provide fixw
fixw/lines)
(require syntax-color/racket-lexer
racket/match
racket/list
racket/string
racket/port
racket/hash
"rules.rkt")
(define (lexer in)
(define-values (text type paren start end) (racket-lexer in))
(cond [(eof-ob... |
86509fc7f3d339d4d0aaffee1645700b78b86d6be3df2724d97ce6ecfbfbe105 | robkorn/plutus-experimental-smart-contracts | 6-Hashing-The-Winning-Number.hs |
In this file we now hash the guessedNum / winningNum before submitting them to the SC , then check for equality between the two ByteStrings . It is possible to do the hashing on - chain for the guessedNum , but this should incur a higher gas cost , so it 's better to do it offchain in the wallet .
import qualified ... | null | https://raw.githubusercontent.com/robkorn/plutus-experimental-smart-contracts/ef8cf5fbf93d5883b84d4398f88af579ec373392/Games/Jellybean/6-Hashing-The-Winning-Number.hs | haskell |
In this file we now hash the guessedNum / winningNum before submitting them to the SC , then check for equality between the two ByteStrings . It is possible to do the hashing on - chain for the guessedNum , but this should incur a higher gas cost , so it 's better to do it offchain in the wallet .
import qualified ... | |
a2c2fe00b970464e7dd9bbbb4a9122735e7700c51b479e602f26e2f7fa857ea0 | realworldocaml/book | test_ref.ml | type t =
| Init
| Set_by_inline_test
[@@deriving sexp, compare]
let inner = ref Init
let%expect_test _ =
let module _ = struct
let () = inner := Set_by_inline_test
end
in
()
;;
let%test_unit _ = inner := Set_by_inline_test
let value () = !inner
| null | https://raw.githubusercontent.com/realworldocaml/book/d822fd065f19dbb6324bf83e0143bc73fd77dbf9/duniverse/ppx_expect/negative-tests/disabling/lib/test_ref.ml | ocaml | type t =
| Init
| Set_by_inline_test
[@@deriving sexp, compare]
let inner = ref Init
let%expect_test _ =
let module _ = struct
let () = inner := Set_by_inline_test
end
in
()
;;
let%test_unit _ = inner := Set_by_inline_test
let value () = !inner
| |
e68f330b4a72522234285542bf8da7374568f4c7bb670de8ee7aae2c3b5c5674 | roman/servant-playground | Component.hs | {-# LANGUAGE NamedFieldPuns #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE NoImplicitPrelude #
module App.Component where
import RIO
import qualified System.Etc as Etc
import Database.Persist.Postgresql (SqlBackend, ConnectionString, createPostgresqlPool)
import Data.Pool (Pool)
import Control.Monad.Component ... | null | https://raw.githubusercontent.com/roman/servant-playground/37639f20c01306fb1a59050f7996f6779a627a1f/app/App/Component.hs | haskell | # LANGUAGE NamedFieldPuns #
# LANGUAGE OverloadedStrings #
Print warnings from reading config
Print configuration values at beginning of program | # LANGUAGE NoImplicitPrelude #
module App.Component where
import RIO
import qualified System.Etc as Etc
import Database.Persist.Postgresql (SqlBackend, ConnectionString, createPostgresqlPool)
import Data.Pool (Pool)
import Control.Monad.Component (ComponentM)
import App.Component.Config (buildConfig)
import App.Com... |
e4de3900e74cdc1cf18a160b1757d71cdcb6d1a15f90e85681d719ff0863b75d | johnlinvc/erruby | erb.erl | -module(erb).
-export([find_or_init_class/2]).
find_or_init_class(Name, InitFun) ->
case whereis(Name) of
undefined -> InitFun();
Pid -> {ok, Pid}
end.
| null | https://raw.githubusercontent.com/johnlinvc/erruby/60df66495a01f9dda08bd3f670bfe9dc0661a168/src/erb.erl | erlang | -module(erb).
-export([find_or_init_class/2]).
find_or_init_class(Name, InitFun) ->
case whereis(Name) of
undefined -> InitFun();
Pid -> {ok, Pid}
end.
| |
449b66130910813a25f281cda25c7744102e743bbe6c97542e2a72630bfff6f0 | gebi/jungerl | edit_file.erl | %%%----------------------------------------------------------------------
%%% File : edit_file.erl
Author : < >
%%% Purpose : file-related editor commands
Created : 14 Jan 2001 by < >
%%%----------------------------------------------------------------------
-module(edit_file).
-author('').
-include_lib... | null | https://raw.githubusercontent.com/gebi/jungerl/8f5c102295dbe903f47d79fd64714b7de17026ec/lib/ermacs/src/edit_file.erl | erlang | ----------------------------------------------------------------------
File : edit_file.erl
Purpose : file-related editor commands
----------------------------------------------------------------------
Open Filename in the buffer Name. If Name exists and is visiting a
already visiting this file, just attach to t... | Author : < >
Created : 14 Jan 2001 by < >
-module(edit_file).
-author('').
-include_lib("ermacs/include/edit.hrl").
-compile(export_all).
-compile({parse_transform, edit_transform}).
-import(edit_lib, [buffer/1]).
-command({find_file, [{file, "Filename:"}], "Open a file in a buffer."}).
mod_init() ->
... |
b283b9e8164f6f9569f4c265a5e85bfb3bff9a4a134e6fc10be9176af170262d | mariari/Misc-Lisp-Scripts | list.lisp | (defpackage #:list
(:documentation "Provides extra functionality functions for lists")
(:use #:common-lisp)
(:export :range
:split-on
:ncircular
:circular
:foldr-b
:foldl-b
:scanl
:scanl1
:scanr
:scanr1
:... | null | https://raw.githubusercontent.com/mariari/Misc-Lisp-Scripts/acecadc75fcbe15e6b97e084d179aacdbbde06a8/CL/stdlib/list.lisp | lisp | From Lisp | (defpackage #:list
(:documentation "Provides extra functionality functions for lists")
(:use #:common-lisp)
(:export :range
:split-on
:ncircular
:circular
:foldr-b
:foldl-b
:scanl
:scanl1
:scanr
:scanr1
:... |
930f719b817e0392dfd1edc0606805a2dfee074998e55205d317e4c31fe9d0fa | alanz/ghc-exactprint | LayoutIn1.hs | module LayoutIn1 where
--Layout rule applies after 'where','let','do' and 'of'
--In this Example: rename 'sq' to 'square'.
sumSquares x y= sq x + sq y where sq x= x^pow
--There is a comment.
pow=2
| null | https://raw.githubusercontent.com/alanz/ghc-exactprint/b6b75027811fa4c336b34122a7a7b1a8df462563/tests/examples/transform/LayoutIn1.hs | haskell | Layout rule applies after 'where','let','do' and 'of'
In this Example: rename 'sq' to 'square'.
There is a comment. | module LayoutIn1 where
sumSquares x y= sq x + sq y where sq x= x^pow
pow=2
|
a55d34f99bd3bea182af4274b317d67062754352948a0c0a1eb136a8a7752eb4 | phoityne/ghci-dap | GHCMain.hs | # LANGUAGE CPP #
# LANGUAGE LambdaCase #
# LANGUAGE NondecreasingIndentation #
# LANGUAGE TupleSections #
{-# OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #-}
-----------------------------------------------------------------------------
--
GHC Driver program
--
( c ) The University of Glasgow 2005... | null | https://raw.githubusercontent.com/phoityne/ghci-dap/0e077158a15043d59c6d10d1fa5e0f98a0134630/app-ghc-9.0/GHCMain.hs | haskell | # OPTIONS -fno-warn-incomplete-patterns -optc-DNON_POSIX_SOURCE #
---------------------------------------------------------------------------
---------------------------------------------------------------------------
Implementations of the various modes (--show-iface, mkdependHS. etc.)
Various other random stuff ... | # LANGUAGE CPP #
# LANGUAGE LambdaCase #
# LANGUAGE NondecreasingIndentation #
# LANGUAGE TupleSections #
GHC Driver program
( c ) The University of Glasgow 2005
DAP Modified
The official GHC API
import qualified GHC
DynFlags ( .. ) , HscTarget ( .. ) ,
GhcMode ( .. ) , ( .. ) ,
... |
dfa8d866910adb3f08a172b9e1b6ebb3a1b60baef3ff0a20107a5595a6396302 | racket/draw | local.rkt | #lang racket/base
(require racket/class)
(provide (protect-out (all-defined-out)))
(define-local-member-name
;; various
adjust-lock
;; bitmap%
get-cairo-surface
get-cairo-target-surface
get-cairo-alpha-surface
get-cairo-device-scale
release-bitmap-storage
get-bitmap-gl-context
drop-alpha-s
draw... | null | https://raw.githubusercontent.com/racket/draw/a6558bdc18438e784c23d452ffd877dac867a7fd/draw-lib/racket/draw/private/local.rkt | racket | various
bitmap%
bitmap-dc%
dc%
region%
font%
brush%
dc-backend<%> | #lang racket/base
(require racket/class)
(provide (protect-out (all-defined-out)))
(define-local-member-name
adjust-lock
get-cairo-surface
get-cairo-target-surface
get-cairo-alpha-surface
get-cairo-device-scale
release-bitmap-storage
get-bitmap-gl-context
drop-alpha-s
draw-bitmap-to
do-self-copy
... |
5a1f8af93aa66d50076f28fbc1a209ef82c8477a7bd135651cd25c85946b1727 | charles-cooper/peregrine | AST.hs | # LANGUAGE DeriveFunctor #
# LANGUAGE DeriveFoldable #
{-# LANGUAGE DeriveTraversable #-}
module Language.Peregrine.AST where
import Protocol.Backend.C.Base as CP
import Protocol
import qualified Language.C.Utils as C
import Control.Monad.Identity (runIdentity)
data Constant
= ConstIn... | null | https://raw.githubusercontent.com/charles-cooper/peregrine/3b670ed437f86993bf1c921381b8e72097a80423/src/Language/Peregrine/AST.hs | haskell | # LANGUAGE DeriveTraversable #
function name from cmath e.g. "abs"
member name on function
| A variable holding state.
| Recurse
The output will be x `op` y for most recent values of x and y
Any listeners will be updated on update of either argument.
| Unary operation
| Fold an operation over a stream
| A fiel... | # LANGUAGE DeriveFunctor #
# LANGUAGE DeriveFoldable #
module Language.Peregrine.AST where
import Protocol.Backend.C.Base as CP
import Protocol
import qualified Language.C.Utils as C
import Control.Monad.Identity (runIdentity)
data Constant
= ConstInt Int
| ConstDouble Double
| Co... |
4a9bf9ec9796d18f71ff36ea2a1799ef9e3689e23a68fc7ded2ffd37715ceff5 | ninjudd/cake | baz.clj | (ns baz
(:use [bar :only [foo]])
(:require bar))
(defn baz [i]
(foo)
(bar/inc i))
| null | https://raw.githubusercontent.com/ninjudd/cake/3a1627120b74e425ab21aa4d1b263be09e945cfd/examples/test/src/baz.clj | clojure | (ns baz
(:use [bar :only [foo]])
(:require bar))
(defn baz [i]
(foo)
(bar/inc i))
| |
b34d5e1bdcc6b1c66e1c63ebc1f2cd829e836c243c441cce75ea08523b47b49d | S8A/htdp-exercises | ex524.rkt | The first three lines of this file were inserted by . They record metadata
;; about the language level of this file in a form that our tools can easily process.
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex524) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "u... | null | https://raw.githubusercontent.com/S8A/htdp-exercises/578e49834a9513f29ef81b7589b28081c5e0b69f/ex524.rkt | racket | about the language level of this file in a form that our tools can easily process.
- 'left
- 'right
(make-ps N N RiverSide [Maybe PS])
- the number of missionaries on the left side of the river
- the number of cannibals on the left side of the river
- the side of the river in which the boat is currently at
ac... | The first three lines of this file were inserted by . They record metadata
#reader(lib "htdp-intermediate-lambda-reader.ss" "lang")((modname ex524) (read-case-sensitive #t) (teachpacks ((lib "image.rkt" "teachpack" "2htdp") (lib "universe.rkt" "teachpack" "2htdp"))) (htdp-settings #(#t constructor repeating-decimal ... |
a567eeaf81426c44075f12274d48ffd0c4b61f933094f3132a9d62b8b31d5c54 | well-typed/generics-sop | NS.hs | module Generics.SOP.NS
(
module Data.SOP.NS
) where
import Data.SOP.NS | null | https://raw.githubusercontent.com/well-typed/generics-sop/39a3badb10e11efc4f907db557f998412ffc1b2a/generics-sop/src/Generics/SOP/NS.hs | haskell | module Generics.SOP.NS
(
module Data.SOP.NS
) where
import Data.SOP.NS | |
73b65a3f3b42f7fb33dffcee9771852e8b6b8eee4fc8206cc6c45cf22a3509a3 | let-def/menhir | invariant.mli | (**************************************************************************)
(* *)
Menhir
(* *)
, INRIA Ro... | null | https://raw.githubusercontent.com/let-def/menhir/e8ba7bef219acd355798072c42abbd11335ecf09/src/invariant.mli | ocaml | ************************************************************************
et en Automatique. All rig... | Menhir
, INRIA Rocquencourt
, PPS , Université Paris Diderot
Copyright 2005 - 2008 Institut National de Recherche en Informatique
under the terms of the Q Public License versi... |
4d54ea3f988c75134138249eac3caf996220c373f766f8b8ef49e5edeae0ffa4 | hypernumbers/LuvvieScript | 1e_multiple_arity_fns.erl | -module('1e_multiple_arity_fns').
-export([
arity/0,
arity/1,
inserted/0
]).
arity() ->
erk.
%% inserted just mucks up the order inside the AST
inserted() ->
dynamite.
arity(B) ->
B.
| null | https://raw.githubusercontent.com/hypernumbers/LuvvieScript/d10da50e0719ff26690749570c75e1e614214381/test/not_passing/src/1e_multiple_arity_fns.erl | erlang | inserted just mucks up the order inside the AST | -module('1e_multiple_arity_fns').
-export([
arity/0,
arity/1,
inserted/0
]).
arity() ->
erk.
inserted() ->
dynamite.
arity(B) ->
B.
|
824e09c434642c5ea1910ecce86e6e7f15fa47147166db8233aa33ca56503927 | eait-itig/rdpproxy | http_host_handler.erl | %%
%% rdpproxy
%% remote desktop proxy
%%
Copyright 2012 - 2015 < >
The University of Queensland
%% All rights reserved.
%%
%% Redistribution and use in source and binary forms, with or without
%% modification, are permitted provided that the following conditions
%% are met:
1 . Redistributions of source code ... | null | https://raw.githubusercontent.com/eait-itig/rdpproxy/67cd36f22216f7d4f6c9cf259cf55cab38fc6bfb/src/http_host_handler.erl | erlang |
rdpproxy
remote desktop proxy
All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
are met:
notice, this list of conditions and the following disclaimer.
notice, this list of conditions and the followi... | Copyright 2012 - 2015 < >
The University of Queensland
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the above copyright
THIS SOFTWARE IS PROVIDED BY THE AUTHOR ` ` AS IS '' AND ANY EXPRESS OR
INCIDENTAL , SPECIAL , EXEMPLARY , OR CON... |
327556dc1f1a074d6d891e2b9b1367e6571ed1da0598755a6bd4be7feef142a6 | incoherentsoftware/defect-process | BlendMode.hs | module Window.Graphics.BlendMode
( BlendMode(..)
) where
data BlendMode
= BlendModeAlpha
| BlendModeAdditive
| null | https://raw.githubusercontent.com/incoherentsoftware/defect-process/3db404bb99e5134e4e7b8f045b8ab18f59fdc684/src/Window/Graphics/BlendMode.hs | haskell | module Window.Graphics.BlendMode
( BlendMode(..)
) where
data BlendMode
= BlendModeAlpha
| BlendModeAdditive
| |
e075328d07297eee7af81bdd53e53b68079e8917acf120d6f43eebf71e281a1d | MastodonC/kixi.hecuba | download_test.clj | (ns kixi.hecuba.data.measurements.download-test
(:require [kixi.hecuba.data.measurements.download :refer :all]
[clojure.test :refer :all]
[clj-time.core :as t]
[clojure.test.check.clojure-test :refer (defspec)]
[clojure.test.check :as tc]
[clojure.test.check... | null | https://raw.githubusercontent.com/MastodonC/kixi.hecuba/467400bbe670e74420a2711f7d49e869ab2b3e21/test/clj/kixi/hecuba/data/measurements/download_test.clj | clojure | we need to fix this.
(defn- reading [mins val]
[]]))))
TODO 29,30,31 days | (ns kixi.hecuba.data.measurements.download-test
(:require [kixi.hecuba.data.measurements.download :refer :all]
[clojure.test :refer :all]
[clj-time.core :as t]
[clojure.test.check.clojure-test :refer (defspec)]
[clojure.test.check :as tc]
[clojure.test.check... |
e5e957e1893aea0c1a260dd81ef9717440188bfd6829d387e48076ea9039a792 | facet-lang/facet | Format.hs | module Facet.Format
( format
) where
import System.Exit
FIXME : allow module names w/ search paths
FIXME : it really sucks that we have to have search paths and parse everything to be able to work on this one file
format :: [FilePath] -> FilePath -> IO ExitCode
format _ _ = pure ExitSuccess
| null | https://raw.githubusercontent.com/facet-lang/facet/4626eed1395cd91acc2d38910f27809ad6e753fa/src/Facet/Format.hs | haskell | module Facet.Format
( format
) where
import System.Exit
FIXME : allow module names w/ search paths
FIXME : it really sucks that we have to have search paths and parse everything to be able to work on this one file
format :: [FilePath] -> FilePath -> IO ExitCode
format _ _ = pure ExitSuccess
| |
1c121a989658983a6043d29a0a8187fcfedbf157766b4473d18581d4242d20ce | Javran/advent-of-code | Day19.hs | module Javran.AdventOfCode.Y2018.Day19 (
Program,
Regs,
programP,
Instr (..),
pprProgram,
Machine,
Register (..),
_reg,
) where
import Control.Applicative
import Control.Lens
import Control.Monad
import Data.Bits
import Data.Char
import qualified Data.IntSet as IS
import qualified Data.Map.Strict as M
... | null | https://raw.githubusercontent.com/Javran/advent-of-code/676ef13c2f9d341cf7de0f383335a1cf577bd73d/src/Javran/AdventOfCode/Y2018/Day19.hs | haskell | register that binds to ip.
assigning to ip register is just a jump,
also `plus one` is attached since in this model
ip always advance regardless of whether
we are assigning to it.
Pretty prints the program in a way that helps readability.
... | module Javran.AdventOfCode.Y2018.Day19 (
Program,
Regs,
programP,
Instr (..),
pprProgram,
Machine,
Register (..),
_reg,
) where
import Control.Applicative
import Control.Lens
import Control.Monad
import Data.Bits
import Data.Char
import qualified Data.IntSet as IS
import qualified Data.Map.Strict as M
... |
ac3c94ef17c18e0c396cde66ea2ca5ce547294d43033bae9d39daf81b0289233 | ih/ikarus.dev | ntakl.scm | NTAKL -- The TAKeuchi function using lists as counters ,
;;; with an alternative boolean expression.
(define (listn n)
(if (= n 0)
'()
(cons n (listn (- n 1)))))
(define l18 (listn 18))
(define l12 (listn 12))
(define l6 (listn 6))
(define (mas x y z)
(if (not (shorterp y x))
z
(mas (ma... | null | https://raw.githubusercontent.com/ih/ikarus.dev/8bb0c8e4d1122cf0f9aeb675cb51bc7df178959b/benchmarks.larceny/src/ntakl.scm | scheme | with an alternative boolean expression.
Part of the fun of this benchmark is seeing how well the compiler
can understand this ridiculous code, which dates back to the original
Common Lisp. So it probably isn't a good idea to improve upon it.
code above is rewritten as follows, so I tried it for Scheme also. | NTAKL -- The TAKeuchi function using lists as counters ,
(define (listn n)
(if (= n 0)
'()
(cons n (listn (- n 1)))))
(define l18 (listn 18))
(define l12 (listn 12))
(define l6 (listn 6))
(define (mas x y z)
(if (not (shorterp y x))
z
(mas (mas (cdr x) y z)
(mas (cdr y) z x)
... |
6a2521abe105c5fd703bec9e266598a8997e03bd2f0347090c9efce28d77231c | rizo/snowflake-os | hashtbl.ml | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
, projet ... | null | https://raw.githubusercontent.com/rizo/snowflake-os/51df43d9ba715532d325e8880d3b8b2c589cd075/libraries/stdlib/hashtbl.ml | ocaml | *********************************************************************
Objective Caml
... | , projet Cristal , INRIA Rocquencourt
Copyright 1996 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the GNU Library General Public License , with
$ I d : hashtbl.ml , v 1.27 2005 - 10... |
9cd3aa0c5495b19b7174994e313d2e1eb2e38984ad5037783c8b99f6ae8050d2 | htmfilho/minimily | home.clj | (ns minimily.web.ctrl.home
(:require [ring.util.response :refer [response]]
[minimily.web.ui.layout :refer [layout]]
[minimily.utils.web.wrapper :refer [http-headers]]
[minimily.web.model.menu :refer [menu-items]]
[minimily.web.ui.home :as home... | null | https://raw.githubusercontent.com/htmfilho/minimily/b317b6b67bc79773163f1a6f7c3b46db795ef979/src/minimily/web/ctrl/home.clj | clojure | (ns minimily.web.ctrl.home
(:require [ring.util.response :refer [response]]
[minimily.web.ui.layout :refer [layout]]
[minimily.utils.web.wrapper :refer [http-headers]]
[minimily.web.model.menu :refer [menu-items]]
[minimily.web.ui.home :as home... | |
e5974492ee462461fe42f410b0759599df315b58b216c9074ea46dd86d66ccaf | clojurewerkz/eep | windows_test.clj | (ns clojurewerkz.eep.windows-test
(:require [clojurewerkz.eep.emitter :as e]
[clojurewerkz.eep.stats :as s]
[clojurewerkz.eep.clocks :as c]
[clojure.test :refer :all]
[clojurewerkz.eep.windows :refer :all]
[clojurewerkz.eep.test-utils :refer :all]))
(defn s... | null | https://raw.githubusercontent.com/clojurewerkz/eep/b1f76fc4ff53f7e18baef26a7bf877757237adbd/test/clojurewerkz/eep/windows_test.clj | clojure | (ns clojurewerkz.eep.windows-test
(:require [clojurewerkz.eep.emitter :as e]
[clojurewerkz.eep.stats :as s]
[clojurewerkz.eep.clocks :as c]
[clojure.test :refer :all]
[clojurewerkz.eep.windows :refer :all]
[clojurewerkz.eep.test-utils :refer :all]))
(defn s... | |
ff5085b8a583767bcdba9e64dd6fb3f330868bcbebebee57ba6e93bf0a45c085 | angavrilov/cl-linux-debug | elf.lisp | ;;; -*- mode: Lisp; indent-tabs-mode: nil; -*-
(in-package :cl-linux-debug.code-info)
(defun elf-flag? (value kwd bitmask)
(or (eq value kwd)
(and (integerp value) (logtest value bitmask))))
(defun enum-elf-sections (executable elf)
(loop for section in (sections elf)
collect (let* ((name (name sectio... | null | https://raw.githubusercontent.com/angavrilov/cl-linux-debug/879da2dcd14918bb8ffab003e934f4b01fba12ff/code-info/elf.lisp | lisp | -*- mode: Lisp; indent-tabs-mode: nil; -*-
Discard processed elf section content to save memory |
(in-package :cl-linux-debug.code-info)
(defun elf-flag? (value kwd bitmask)
(or (eq value kwd)
(and (integerp value) (logtest value bitmask))))
(defun enum-elf-sections (executable elf)
(loop for section in (sections elf)
collect (let* ((name (name section))
(hdr (sh section))
... |
50b52464aeeddc3a59ce96a3c3b79b660a9c50862222e3f5036ebf665df45310 | qitab/pyjure | call.clj | (ns pyjure.call
(:use [clojure.core.match :only [match]]
[pyjure.utilities]
[pyjure.runtime]
[pyjure.exceptions]))
;; This file handles the semantics of python-like calling conventions
;; #calls
Every call site has a CallerShape , that describes its argument - passing pattern
(defrecord Ca... | null | https://raw.githubusercontent.com/qitab/pyjure/b9aa49b4f74c85f2b617e924f61eaddb194119bf/src/pyjure/call.clj | clojure | This file handles the semantics of python-like calling conventions
#calls
number of positional arguments
vector of names
index of the restarg, or false (or should we mix * and ** with names?)
describes its parameter-receiving pattern.
We separate the names, because if the caller has no keywords,
we don't includ... | (ns pyjure.call
(:use [clojure.core.match :only [match]]
[pyjure.utilities]
[pyjure.runtime]
[pyjure.exceptions]))
Every call site has a CallerShape , that describes its argument - passing pattern
(defrecord CallerShape
index of the kwarg , or false
Every callable function has a Calle... |
efa78b4eec6eae4d3c0acb380295b9c2fbd36643559c3cd117ac18fdb8dcf3ef | ghcjs/ghcjs-dom | Navigator.hs | # LANGUAGE ForeignFunctionInterface , JavaScriptFFI , GHCForeignImportPrim ,
UnboxedTuples , MagicHash , UnliftedFFITypes , LambdaCase #
UnboxedTuples, MagicHash, UnliftedFFITypes, LambdaCase #-}
module GHCJS.DOM.JSFFI.Navigator (
module Generated
, js_getUserMedia
, getUserMedia
) w... | null | https://raw.githubusercontent.com/ghcjs/ghcjs-dom/749963557d878d866be2d0184079836f367dd0ea/ghcjs-dom-jsffi/src/GHCJS/DOM/JSFFI/Navigator.hs | haskell | # LANGUAGE ForeignFunctionInterface , JavaScriptFFI , GHCForeignImportPrim ,
UnboxedTuples , MagicHash , UnliftedFFITypes , LambdaCase #
UnboxedTuples, MagicHash, UnliftedFFITypes, LambdaCase #-}
module GHCJS.DOM.JSFFI.Navigator (
module Generated
, js_getUserMedia
, getUserMedia
) w... | |
972118ffdc62c9ff4c746c2bed7ca16a460e5b19de510366d663c34593fc5276 | johnlinvc/erruby | erruby_debug.erl | -module(erruby_debug).
-export([init/1, terminate/2, code_change/3, handle_call/3, handle_cast/2, handle_info/2]).
-export([start_link/1, debug/3, debug_1/2,debug_2/2, debug_tmp/2, set_debug_level/1]).
-export([print_env/1]).
init([DebugLevel]) ->
{ok, #{debug_level => DebugLevel}}.
terminate(_Arg, _State) -> {ok, ... | null | https://raw.githubusercontent.com/johnlinvc/erruby/60df66495a01f9dda08bd3f670bfe9dc0661a168/src/erruby_debug.erl | erlang | -module(erruby_debug).
-export([init/1, terminate/2, code_change/3, handle_call/3, handle_cast/2, handle_info/2]).
-export([start_link/1, debug/3, debug_1/2,debug_2/2, debug_tmp/2, set_debug_level/1]).
-export([print_env/1]).
init([DebugLevel]) ->
{ok, #{debug_level => DebugLevel}}.
terminate(_Arg, _State) -> {ok, ... | |
fd4937f78782896978b474d38832441bd409bc0b12c99073ba3b7729f455a648 | redclawtech/vernemq_kinesis | vernemq_kinesis.erl | %%%-------------------------------------------------------------------
( C ) 2018 , Dairon < >
%%%
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... | null | https://raw.githubusercontent.com/redclawtech/vernemq_kinesis/b40ff24152cccc6c8f6fbb5350432e7be8c85a44/src/vernemq_kinesis.erl | erlang | -------------------------------------------------------------------
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express o... | ( C ) 2018 , Dairon < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(vernemq_kinesis).
-include("vernemq_dev.hrl").
-behaviour(on_publish_hook).
-export([on_publish/6]).
on_publish(UserName, {_MountPoint... |
f6f755ab12d0c6be6815c3c8fdb9e130be043b6774ffb8391430d709b77a7e82 | borkdude/deps.clj | deps_test.clj | (ns borkdude.deps-test
(:require
[babashka.fs :as fs]
[babashka.process :refer [check process]]
[borkdude.deps :as deps]
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.string :as str]
[clojure.test :as t :refer [deftest is testing]]
[clojure.set :as set])
(:import [java.util.zip Zi... | null | https://raw.githubusercontent.com/borkdude/deps.clj/2936eb104bd57e1f40df5a801f4ba770f5e4feac/test/borkdude/deps_test.clj | clojure | Print out information about the java executable that will be used
the `exit` command is a workaround for
-commands-windows-properly-exit-code-failure
meaning that the cache directory will be empty
Test clojure tools download methods
- direct download, when the above is not ran or fails.
- manual download, simul... | (ns borkdude.deps-test
(:require
[babashka.fs :as fs]
[babashka.process :refer [check process]]
[borkdude.deps :as deps]
[clojure.edn :as edn]
[clojure.java.io :as io]
[clojure.string :as str]
[clojure.test :as t :refer [deftest is testing]]
[clojure.set :as set])
(:import [java.util.zip Zi... |
981f4d9c9534cec88b391f3e6d7e6bdb31482ef7e301d1cdba3c2bb079007742 | yeller/datomic-riemann-reporter | project.clj | (defproject datomic-riemann-reporter "0.2.0"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[riemann-clojure-client "0.3.2"]
[environ "0.4.0"]])
| null | https://raw.githubusercontent.com/yeller/datomic-riemann-reporter/a3970275a9349607b4080413ecc04caa38c3ecba/project.clj | clojure | (defproject datomic-riemann-reporter "0.2.0"
:description "FIXME: write description"
:url ""
:license {:name "Eclipse Public License"
:url "-v10.html"}
:dependencies [[org.clojure/clojure "1.5.1"]
[riemann-clojure-client "0.3.2"]
[environ "0.4.0"]])
| |
1d8db2644aa3361e1dca00b2af909a44e3af1d6d84ba3873aac6e2aa6e13760d | froggey/Mezzano | input-drivers-virtio.lisp | ;;;; Drivers for virtio-input devices
(in-package :mezzano.gui.input-drivers)
(defconstant +evdev-type-syn+ #x00)
(defconstant +evdev-type-key+ #x01)
(defconstant +evdev-type-rel+ #x02)
(defconstant +evdev-type-abs+ #x03)
(defconstant +evdev-type-msc+ #x04)
(defconstant +evdev-type-sw+ #x05)
(defconstant +evdev-type... | null | https://raw.githubusercontent.com/froggey/Mezzano/f0eeb2a3f032098b394e31e3dfd32800f8a51122/gui/input-drivers-virtio.lisp | lisp | Drivers for virtio-input devices
#\' #\`
Num lock
Scroll lock
85 ZENKAKUHANKAKU
97 RIGHTCTRL
Submit changes to compositor.
Reset X/Y motion, but leave button state intact.
Mouse button change.
Press.
Release
rel-x
rel-y |
(in-package :mezzano.gui.input-drivers)
(defconstant +evdev-type-syn+ #x00)
(defconstant +evdev-type-key+ #x01)
(defconstant +evdev-type-rel+ #x02)
(defconstant +evdev-type-abs+ #x03)
(defconstant +evdev-type-msc+ #x04)
(defconstant +evdev-type-sw+ #x05)
(defconstant +evdev-type-led+ #x11)
(defconstant +evdev-type-s... |
2ca0cc9c2d7fb262634f25e5591a8f51be318a0405ccbda8744867f3ba9a5456 | prikhi/xmonad-config | xmonad.hs | module Main where
import XMonad (xmonad)
import Config (myConfig)
main :: IO ()
main =
myConfig >>= xmonad
| null | https://raw.githubusercontent.com/prikhi/xmonad-config/8357d9d6fcc988193d568874581b88d8c2b64cae/xmonad.hs | haskell | module Main where
import XMonad (xmonad)
import Config (myConfig)
main :: IO ()
main =
myConfig >>= xmonad
| |
175d58ab54990224e67a97b4bd99346149350866240057b1701d33678f3c665f | luisgabriel/erl-chat-server | controller.erl | -module(controller).
-behaviour(gen_server).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-export([start/0]).
start() ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
% This is called when a connection is made to the server
init([]) ->
Users = dict:n... | null | https://raw.githubusercontent.com/luisgabriel/erl-chat-server/fcc972fec727e7a9f1bb9a82a99a34262860f59a/src/controller.erl | erlang | This is called when a connection is made to the server
It maps nick to socket
handle_call is invoked in response to gen_server:call
handle_cast is invoked in response to gen_server:cast
auxiliary functions
Definitions to avoid gen_server compile warnings | -module(controller).
-behaviour(gen_server).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2, terminate/2, code_change/3]).
-export([start/0]).
start() ->
gen_server:start_link({local, ?MODULE}, ?MODULE, [], []).
init([]) ->
{ok, Users}.
handle_call({connect, Nick, Socket}, _From, Users) ->
... |
0b43f6648f594fca36c6fd91d7c28909467ebef242e3e2488a19353aa8fd4932 | gergoerdi/tandoori | DataType.hs | module Tandoori.Typing.DataType (constructorsFromDecl) where
import Tandoori
import Tandoori.Typing
import Tandoori.Typing.Error
import Tandoori.Typing.Monad
import Tandoori.GHC.Internals
import Tandoori.Typing.Repr
import Control.Monad
constructorsFromDecl :: TyClDecl Name -> Typing [(ConName, Ty)]
construc... | null | https://raw.githubusercontent.com/gergoerdi/tandoori/515142ce76b96efa75d7044c9077d85394585556/src/Tandoori/Typing/DataType.hs | haskell | module Tandoori.Typing.DataType (constructorsFromDecl) where
import Tandoori
import Tandoori.Typing
import Tandoori.Typing.Error
import Tandoori.Typing.Monad
import Tandoori.GHC.Internals
import Tandoori.Typing.Repr
import Control.Monad
constructorsFromDecl :: TyClDecl Name -> Typing [(ConName, Ty)]
construc... | |
91b5e51cb4d1a149421423d5363e5251926a08acd3227b591467647c015281f0 | neongreen/haskell-ex | Main.hs | module Main where
import Data.List
import Data.Set (Set)
import qualified Data.Set as S
-- | Returns the graph set of the spiral,
-- | i.e the points that are on the spiral.
spiralGraph :: Int -> Set (Int, Int)
spiralGraph n = fst $ foldl' f (S.empty, (0,-1)) $ zip counts deltas
-- | The s... | null | https://raw.githubusercontent.com/neongreen/haskell-ex/345115444fdf370a43390fd942e2851b9b1963ad/week4/spiral/vitcra/Main.hs | haskell | | Returns the graph set of the spiral,
| i.e the points that are on the spiral.
| The start is outside the grid ^^^^
| Counts are basically the lengths of the lines of the spiral
| Here's the pattern: (n: pattern)
| etc
| Go right, down, left, up and then cycle that.
| So zip counts deltas is like:
| "Draw" t... | module Main where
import Data.List
import Data.Set (Set)
import qualified Data.Set as S
spiralGraph :: Int -> Set (Int, Int)
spiralGraph n = fst $ foldl' f (S.empty, (0,-1)) $ zip counts deltas
| We 'll step into ( 0,0 ) right away .
where
| 9 : 9 9 8 7 6 5 4 3 2 1
| 8 : 8 8 7 6 5 4 3 2 ... |
2ad1ba2ee301789377c66abaebcca5f3fff2d26117bce85d160c1bd716a5db55 | froggey/Mezzano | xp-format.lisp | (in-package :mezzano.xp)
; ---- COMPILED FORMAT ----
;Note that compiled format strings always print through xp streams even if
;they don't have any xp directives in them. As a result, the compiled code
;can depend on the fact that the stream being operated on is an xp
;stream not an ordinary ... | null | https://raw.githubusercontent.com/froggey/Mezzano/f0eeb2a3f032098b394e31e3dfd32800f8a51122/system/xp-format.lisp | lisp | ---- COMPILED FORMAT ----
Note that compiled format strings always print through xp streams even if
they don't have any xp directives in them. As a result, the compiled code
can depend on the fact that the stream being operated on is an xp
stream not an ordinary one.
Probably safe to make unsy... | (in-package :mezzano.xp)
(eval-when (:compile-toplevel :load-toplevel :execute)
(proclaim '(special *string* *used-args* *used-outer-args* *used-initial*
*get-arg-carefully* *inner-end* *outer-end* *at-top*))
(defvar *fn-table* (make-hash-table :synchronized t)
"used to access fns for command... |
93a1200a04c4a66c7d9d4a2b272c120cc30df17655a035f8bd9bef46bd654b77 | SamirTalwar/advent-of-code | AOC_06_2.hs | {-# OPTIONS -Wall #-}
import Data.Map (Map)
import qualified Data.Map as Map
import Helpers.Function
import Helpers.Map
import Helpers.Parse
import Text.Parsec
days :: Int
days = 256
main :: IO ()
main = do
input <- parseTextIO $ sepBy int (string ",")
let initialState = countValues input
let finalState = iter... | null | https://raw.githubusercontent.com/SamirTalwar/advent-of-code/6b5b3ef3873e4a758868d100d4fe079dfeddf3e1/2021/AOC_06_2.hs | haskell | # OPTIONS -Wall # |
import Data.Map (Map)
import qualified Data.Map as Map
import Helpers.Function
import Helpers.Map
import Helpers.Parse
import Text.Parsec
days :: Int
days = 256
main :: IO ()
main = do
input <- parseTextIO $ sepBy int (string ",")
let initialState = countValues input
let finalState = iterate step initialState ... |
84c8e8e92e314524e43400312fc3bd5584fac8cd7ff5b19bcc26eb3dcbea492e | patoline/patoline | skeleton.ml | open Pervasives
(* Type of a polygon and examples *)
type polygon = (float * float) list
let square : polygon = [(1.,1.); (1.,2.); (2.,2.); (2.,1.)]
let triangle : polygon = [(1.,1.); (2.,1.); (1.5,2.)]
(* Vector type and basic operations *)
type point = (float * float)
type vector = (float * float)
type scalar =... | null | https://raw.githubusercontent.com/patoline/patoline/3dcd41fdff64895d795d4a78baa27d572b161081/tests/examples/skeleton/skeleton.ml | ocaml | Type of a polygon and examples
Vector type and basic operations
Orthogonal distance between line AB and point C
comme fuck
Input points are given counter-clockwise
h contains minimum distance | open Pervasives
type polygon = (float * float) list
let square : polygon = [(1.,1.); (1.,2.); (2.,2.); (2.,1.)]
let triangle : polygon = [(1.,1.); (2.,1.); (1.5,2.)]
type point = (float * float)
type vector = (float * float)
type scalar = float
let vect : point -> point -> vector = fun (xa, ya) (xb, yb) ->
le... |
9f9cc89eba1f39bfd15b3b896e93d64087f264588350de6b3a2db1231bf66a69 | myshov/programming_in_haskell | length.hs | import Prelude hiding (length)
length :: [a] -> Int
length xs = foldr (\ _ n -> 1 + n) 0 xs
| null | https://raw.githubusercontent.com/myshov/programming_in_haskell/3118695cc09a5ea0954917c318bf007b6ae5fcef/lesson7/length.hs | haskell | import Prelude hiding (length)
length :: [a] -> Int
length xs = foldr (\ _ n -> 1 + n) 0 xs
| |
1f3b67e11823f85170a01482d98da1a68285c38688b4f8a1a6e79694b29d379e | green-labs/gosura | edn.clj | (ns gosura.edn
(:require [clojure.edn :as edn]
[clojure.java.io :as io])
(:import (java.io PushbackReader)))
(defn read-config
"edn 형식의 설정파일을 불러들임.
tagged literal `#var`를 지원하기 위해 사용한다.
"
[path]
(with-open [r (io/reader path)]
(edn/read {:readers (merge default-data-readers
... | null | https://raw.githubusercontent.com/green-labs/gosura/5df09c6f3fefa8b010388709f8a4abaccac50dbd/src/gosura/edn.clj | clojure | (ns gosura.edn
(:require [clojure.edn :as edn]
[clojure.java.io :as io])
(:import (java.io PushbackReader)))
(defn read-config
"edn 형식의 설정파일을 불러들임.
tagged literal `#var`를 지원하기 위해 사용한다.
"
[path]
(with-open [r (io/reader path)]
(edn/read {:readers (merge default-data-readers
... | |
7f014f0d78081331e8b2a543ab9e0f92fe4dc0c8a9e85a4c4173aaae7ecf2c9c | metasoarous/oz | core.clj | (ns blerg.core)
(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
| null | https://raw.githubusercontent.com/metasoarous/oz/7676f6c798dafb87381f71ee3451b94f8460e49f/example-projects/blerg/src/blerg/core.clj | clojure | (ns blerg.core)
(defn foo
"I don't do a whole lot."
[x]
(println x "Hello, World!"))
| |
36cc5314dcc024ebe6abb478b45964bd41d706b0c45156e3b08f10de795592b7 | lpw25/ecaml | config.ml | let run_interactive_toplevel = ref true
| null | https://raw.githubusercontent.com/lpw25/ecaml/4588abb18436fb8a4983a353923ee667bf8c90a0/src/config.ml | ocaml | let run_interactive_toplevel = ref true
| |
d09e89ecc3d5f8198c053499698e133ee393db36ccbb69432aaf94a5cbb39659 | bennn/iPoe | logging.rkt | #lang racket/base
(provide
log-ipoe-db-fatal
log-ipoe-db-error
log-ipoe-db-warning
log-ipoe-db-info
log-ipoe-db-debug
log-ipoe-scrape-fatal
log-ipoe-scrape-error
log-ipoe-scrape-warning
log-ipoe-scrape-info
log-ipoe-scrape-debug
)
(define-logger ipoe-db)
(define-logger ipoe-scrape)
| null | https://raw.githubusercontent.com/bennn/iPoe/4a988f6537fb738b4fe842c404f9d78f658ab76f/ipoe/private/util/logging.rkt | racket | #lang racket/base
(provide
log-ipoe-db-fatal
log-ipoe-db-error
log-ipoe-db-warning
log-ipoe-db-info
log-ipoe-db-debug
log-ipoe-scrape-fatal
log-ipoe-scrape-error
log-ipoe-scrape-warning
log-ipoe-scrape-info
log-ipoe-scrape-debug
)
(define-logger ipoe-db)
(define-logger ipoe-scrape)
| |
cabee064a21a13f312335afa55b5e9dc0ae9ae921ae1bbd8145a4be400ffd00c | haskell-repa/repa | Project.hs |
module Data.Array.Repa.Vector.Operators.Project
( gather
, gather1)
where
import Data.Array.Repa.Vector.Base
import Data.Array.Repa.Vector.Operators.Bulk
import Data.Array.Repa.Vector.Operators.Map as R
import Prelude hiding (map)
-- | Gather elements from a share... | null | https://raw.githubusercontent.com/haskell-repa/repa/c867025e99fd008f094a5b18ce4dabd29bed00ba/icebox/abandoned/repa-vector/Data/Array/Repa/Vector/Operators/Project.hs | haskell | | Gather elements from a shared array.
| Like gather, but specialised to linear indices. |
module Data.Array.Repa.Vector.Operators.Project
( gather
, gather1)
where
import Data.Array.Repa.Vector.Base
import Data.Array.Repa.Vector.Operators.Bulk
import Data.Array.Repa.Vector.Operators.Map as R
import Prelude hiding (map)
gather :: (Shape sh, Bulk r1 a, ... |
7787f2492ab5b857b6e89efddf7912db4a846e865d9925bab778ccd78763d848 | oisdk/monus-weighted-search | Sort.hs | -- |
-- Module : MonusWeightedSearch.Examples.Sort
Copyright : ( c ) Kidney 2021
-- Maintainer :
-- Stability : experimental
-- Portability : non-portable
--
-- Sorting using the 'Heap' monad.
--
-- The 'Heap' monad can function like a normal heap (although it does need a
-- 'Monus' instead of just any ... | null | https://raw.githubusercontent.com/oisdk/monus-weighted-search/2333e477db513f2acb2cf85ee62c490a229e87bc/src/MonusWeightedSearch/Examples/Sort.hs | haskell | |
Module : MonusWeightedSearch.Examples.Sort
Maintainer :
Stability : experimental
Portability : non-portable
Sorting using the 'Heap' monad.
The 'Heap' monad can function like a normal heap (although it does need a
'Monus' instead of just any ordered key), and as such it can implement a
normal sort... | Copyright : ( c ) Kidney 2021
module MonusWeightedSearch.Examples.Sort where
import Data.Monus.Max
import Control.Monad.Heap
| /O(n log n)/. Heapsort .
> > > monusSort [ 5,1,2,3,1,6,3,2,5,7 ]
monusSort :: Ord a => [a] -> [a]
monusSort = map fst . search . fromList . map (\x -> (x, In x))
# INLINE monusS... |
7dcbfb09b31a2cfb214998e70cb0c8c1c53105394da651a4bbc09e966a3ca224 | ott-lang/ott | warnings.mli | (***********************************************************************)
(* *)
(* Objective Caml *)
(* *)
Pierre Weis... | null | https://raw.githubusercontent.com/ott-lang/ott/29ac9ef84967686da35b9b42608b3aec3539a689/examples/ocaml_light/hol/ocamlpp/utils/warnings.mli | ocaml | *********************************************************************
Objective Caml
... | Pierre Weis & & Damien Doligez , INRIA Rocquencourt
Copyright 1998 Institut National de Recherche en Informatique et
en Automatique . All rights reserved . This file is distributed
under the terms of the Q Public License version 1.0 .
$ I d : warnings.mli , v 1... |
cd391555588161cbc49d51dddfea2a697d21d27956cb4b6e6e79a081d1124f39 | keera-studios/keera-hails | View.hs | -- | This class encapsulates GUI apis with some basic common operations:
-- initialise the GUI, destroy the GUI, execute in the GUI Thread, etc.
--
Copyright : ( C ) Keera Studios Ltd , 2013
-- License : BSD3
Maintainer :
-- NOTE: This code is stable, but the design is experimental.
-- It works fine, but... | null | https://raw.githubusercontent.com/keera-studios/keera-hails/bf069e5aafc85a1f55fa119ae45a025a2bd4a3d0/keera-hails-mvc-view/src/Hails/MVC/View.hs | haskell | | This class encapsulates GUI apis with some basic common operations:
initialise the GUI, destroy the GUI, execute in the GUI Thread, etc.
License : BSD3
NOTE: This code is stable, but the design is experimental.
It works fine, but I doubt it's a good solution in the long term. In
particular, I do not like h... | Copyright : ( C ) Keera Studios Ltd , 2013
Maintainer :
module Hails.MVC.View where
data Null a = Null
class View a where
initView :: Null a -> IO ()
createView :: IO a
startView :: a -> IO ()
onViewSync :: a -> IO b -> IO b
onViewAsync :: a -> IO () -> IO ()
destroyView :: a -> IO ()
... |
361e74d00a40da769a4dc730183678e0e17e34ed65c759b5bd1e3e54a92004ad | botsunit/bucs | buctimer.erl | -module(buctimer).
-export([verify/1, next/1, next/2]).
-type period() :: atom().
-type day_of_week() :: monday | thursday | wednesday | thursday | friday | saturday | sunday.
-type year() :: calendar:year() | [calendar:year()] | period().
-type month() :: calendar:month() | [calendar:month()] | period().
-type day()... | null | https://raw.githubusercontent.com/botsunit/bucs/792437befd259042efaf95e301dec019a5dd6ea4/src/buctimer.erl | erlang | @doc
Verify the timer syntax.
@end
@doc
Return the next datetime from now.
@end
@doc
Return the next datetime from the given datetime.
@end | -module(buctimer).
-export([verify/1, next/1, next/2]).
-type period() :: atom().
-type day_of_week() :: monday | thursday | wednesday | thursday | friday | saturday | sunday.
-type year() :: calendar:year() | [calendar:year()] | period().
-type month() :: calendar:month() | [calendar:month()] | period().
-type day()... |
1655e59d17b82c7ad24a12d9b5bdb8bba9376f5efa7e4ff16633ff24cfb42106 | lymar/hastache | listsByIndex.hs | #!/usr/local/bin/runhaskell
{-# LANGUAGE DeriveDataTypeable #-}
import Text.Hastache
import Text.Hastache.Context
import qualified Data.Text.Lazy.IO as TL
import Data.Data
import Data.Generics
-- begin example
main = mapM_ (\(template,context) ->
hastacheStr defaultConfig (encodeStr template) context >>= TL.p... | null | https://raw.githubusercontent.com/lymar/hastache/cd299ff1ac4c35259fbd333ea7fa9b3c280b9ff9/examples/listsByIndex.hs | haskell | # LANGUAGE DeriveDataTypeable #
begin example
Context as function
With Generics
With Generics (another way) | #!/usr/local/bin/runhaskell
import Text.Hastache
import Text.Hastache.Context
import qualified Data.Text.Lazy.IO as TL
import Data.Data
import Data.Generics
main = mapM_ (\(template,context) ->
hastacheStr defaultConfig (encodeStr template) context >>= TL.putStrLn)
[(template1, mkStrContext context1)... |
672baba12ab65ad1dbecd7ef39cafc7795fab471a47af3f4a26881f61110bf16 | facebook/infer | ProcLocker.mli |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/facebook/infer/e5ed762d819c0f040ad73064e0d928e73d5d830a/infer/src/backend/ProcLocker.mli | ocaml | * This should be called once before trying to lock Anything.
* true = the lock belongs to the calling process. false = the lock belongs to a different worker
* This will work as a cleanup function because after calling unlock all the workers that need an
unlocked Proc should find it's summary already Cached. Thro... |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
e87d8e92de012604f37888ec615edfa094ac1db40fd3d826af47b15d97c36c60 | facebookarchive/pfff | ast_css.ml |
*
* Copyright ( C ) 2010 ( )
* Copyright ( C ) 2011 Facebook
*
* This software is distributed under the terms of the GNU GPL version 2 .
* See LICENSE file for full license text .
*
* Copyright (C) 2010 Dario Teixeira ()
* Copyright (C) 2011 Facebook
*
* This software is distributed u... | null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/lang_css/parsing/ast_css.ml | ocaml | ***************************************************************************
Prelude
***************************************************************************
***************************************************************************
***************************************************************************
-----... |
*
* Copyright ( C ) 2010 ( )
* Copyright ( C ) 2011 Facebook
*
* This software is distributed under the terms of the GNU GPL version 2 .
* See LICENSE file for full license text .
*
* Copyright (C) 2010 Dario Teixeira ()
* Copyright (C) 2011 Facebook
*
* This software is distributed u... |
6bbd52b314b23d23a48375b583a6e04c0a5152686dd06fa17d1f4f4539aaeba3 | realworldocaml/examples | verbose_shapes.ml | open Core.Std
open Async.Std
open Async_graphics
part 1
class square w x y = object(self)
val mutable x: int = x
method x = x
val mutable y: int = y
method y = y
val mutable width = w
method width = width
method draw = fill_rect x y width width
method private contains x' y' =
x <= x' && x' <=... | null | https://raw.githubusercontent.com/realworldocaml/examples/32ea926861a0b728813a29b0e4cf20dd15eb486e/code/classes-async/verbose_shapes.ml | ocaml | open Core.Std
open Async.Std
open Async_graphics
part 1
class square w x y = object(self)
val mutable x: int = x
method x = x
val mutable y: int = y
method y = y
val mutable width = w
method width = width
method draw = fill_rect x y width width
method private contains x' y' =
x <= x' && x' <=... | |
90a6e1cce3cffeb7a9c51b287515f6597964635ce0d2be2adb8ba6bd91b07d99 | lamdu/lamdu | Option.hs | # LANGUAGE TemplateHaskell , TypeApplications , GADTs , DerivingVia #
module Lamdu.Sugar.Convert.Option
( Result(..), rTexts, rExpr, rDeps, rAllowEmptyQuery, rWithTypeAnnotations
, ResultQuery(..), _QueryTexts, _QueryNewTag
, simpleResult
, ResultGroups(..), filterResults
, Matches, matchResult
... | null | https://raw.githubusercontent.com/lamdu/lamdu/6e5df434466c4402c92c5b73347232c58cd0d8e4/src/Lamdu/Sugar/Convert/Option.hs | haskell | Within certain search-term matching level (exact/prefix/infix),
prefer locals over globals even for type mismatches
to avoid using parameters inconsistent with frozen type.
No actual data is written to the db for generating an option
The results cache is not invalidated due to writing to the database
prune replac... | # LANGUAGE TemplateHaskell , TypeApplications , GADTs , DerivingVia #
module Lamdu.Sugar.Convert.Option
( Result(..), rTexts, rExpr, rDeps, rAllowEmptyQuery, rWithTypeAnnotations
, ResultQuery(..), _QueryTexts, _QueryNewTag
, simpleResult
, ResultGroups(..), filterResults
, Matches, matchResult
... |
9fb397ca90333aa3a4492d63527fd9af048552e26d6a6e03d2ead4658da268dc | JacquesCarette/Drasil | ExternalLibraryCall.hs | -- | Defines an AST to be paired with an ExternalLibrary for a specific use-case
module Language.Drasil.Code.ExternalLibraryCall (ExternalLibraryCall,
StepGroupFill(..), StepFill(..), FunctionIntFill(..), ArgumentFill(..),
ParameterFill(..), ClassInfoFill(..), MethodInfoFill(..), externalLibCall,
choiceStepsFill... | null | https://raw.githubusercontent.com/JacquesCarette/Drasil/76213c10d1d008d9284367147c4a1749c1be02b9/code/drasil-code/lib/Language/Drasil/Code/ExternalLibraryCall.hs | haskell | | Defines an AST to be paired with an ExternalLibrary for a specific use-case
| External library call holds a group of step groups.
specific information for an ExternalLibrary
Int is to "choose" from the options in 'ExternalLibrary'.
^ For arguments that are completely dependent on use case.
^ A basic function.
... | module Language.Drasil.Code.ExternalLibraryCall (ExternalLibraryCall,
StepGroupFill(..), StepFill(..), FunctionIntFill(..), ArgumentFill(..),
ParameterFill(..), ClassInfoFill(..), MethodInfoFill(..), externalLibCall,
choiceStepsFill, choiceStepFill, mandatoryStepFill, mandatoryStepsFill,
callStepFill, libCall... |
d312963efa67c57a5acd5b8e403e452633aa712fc947ec6cb676c34a092a2b4a | unison-code/unison | Usages.hs | module Unison.Target.Hexagon.Usages (usages) where
import Unison
import Unison.Target.Hexagon.Common
import Unison.Target.Hexagon.HexagonResourceDecl
import qualified Unison.Target.Hexagon.SpecsGen as SpecsGen
import Unison.Target.Hexagon.SpecsGen.HexagonItineraryDecl
import Unison.Target.Hexagon.SpecsGen.HexagonInst... | null | https://raw.githubusercontent.com/unison-code/unison/9f8caf78230f956a57b50a327f8d1dca5839bf64/src/unison/src/Unison/Target/Hexagon/Usages.hs | haskell | | Declares resource usages of each instruction
New-value stores cannot be issued with other stores, we model this by
saturating the 'Store' resource.
A new-value compare and jump instruction i cannot be issued in parallel
by the instruction feeding i. We model this by saturating the 'Store'
resource.
instruction... | module Unison.Target.Hexagon.Usages (usages) where
import Unison
import Unison.Target.Hexagon.Common
import Unison.Target.Hexagon.HexagonResourceDecl
import qualified Unison.Target.Hexagon.SpecsGen as SpecsGen
import Unison.Target.Hexagon.SpecsGen.HexagonItineraryDecl
import Unison.Target.Hexagon.SpecsGen.HexagonInst... |
4832cab7ab797656aa82b63c3014fee88706a183e8820223c73b4502a45c41f9 | jrh13/hol-light | quelim.ml | (* ========================================================================= *)
(* Naive quantifier elimination for complex numbers. *)
(* ========================================================================= *)
needs "Complex/fundamental.ml";;
let NULLSTELLENSATZ_LEMMA = prove
(`!n p q. ... | null | https://raw.githubusercontent.com/jrh13/hol-light/d125b0ae73e546a63ed458a7891f4e14ae0409e2/Complex/quelim.ml | ocaml | =========================================================================
Naive quantifier elimination for complex numbers.
=========================================================================
-------------------------------------------------------------------------
---------------... |
needs "Complex/fundamental.ml";;
let NULLSTELLENSATZ_LEMMA = prove
(`!n p q. (!x. (poly p x = Cx(&0)) ==> (poly q x = Cx(&0))) /\
(degree p = n) /\ ~(n = 0)
==> p divides (q exp n)`,
MATCH_MP_TAC num_WF THEN X_GEN_TAC `n:num` THEN DISCH_TAC THEN
MAP_EVERY X_GEN_TAC [`p:complex list`; `q:com... |
79bb45147485926913b1cf1b0c5c770f62b531ed25d6e09241d38db3a685e990 | shortishly/tansu | tansu_tcp_advertiser.erl | Copyright ( c ) 2012 - 2016 < >
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
distribute... | null | https://raw.githubusercontent.com/shortishly/tansu/154811fff81855419de9af380c81c7ae14e435d0/src/tansu_tcp_advertiser.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissi... | Copyright ( c ) 2012 - 2016 < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(tansu_tcp_advertiser).
-export([instances/0]).
-export([service/0]).
service() ->
"_tansu._tcp".
instances() ->
{ok, Hos... |
fc042b87b37cfd7ffdc1f29214783eaae1d86f105088753d83cf4870ac62714c | ftovagliari/ocamleditor | editor.ml |
OCamlEditor
Copyright ( C ) 2010 - 2014
This file is part of OCamlEditor .
OCamlEditor is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at y... | null | https://raw.githubusercontent.com/ftovagliari/ocamleditor/9013936c6092888d5d14750f6ba687b3003dc756/src/editor.ml | ocaml | * Editor
Now that the page is loaded, marks are used in place of offsets.
~prio:300
loc.loc.loc_start.pos_fname
Prf.crono Prf.prf_colorize_within_nearest_tag_bounds begin fun () ->
let tag_table_lexical = buffer#tag_table_lexical in
end ()
Load page
Insert_text and Delete range
Mark Set
Paste clipboard
~s... |
OCamlEditor
Copyright ( C ) 2010 - 2014
This file is part of OCamlEditor .
OCamlEditor is free software : you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
( at y... |
ce611f78213d325371a4d6ac3a2971c319b0094f0860a640f508ed481677956d | UU-ComputerScience/uhc | CaseFall1.hs | ----------------------------------------------------------------------------------------
what : fallthrough of case alternatives for single var + guard
expected : ok , 16
----------------------------------------------------------------------------------------
what : fallthrough of case alternati... | null | https://raw.githubusercontent.com/UU-ComputerScience/uhc/f2b94a90d26e2093d84044b3832a9a3e3c36b129/EHC/test/regress/99/CaseFall1.hs | haskell | --------------------------------------------------------------------------------------
--------------------------------------------------------------------------------------
-------------------------------------------------------------------------------------- -} | what : fallthrough of case alternatives for single var + guard
expected : ok , 16
what : fallthrough of case alternatives for single var + guard
expected: ok, 16
module CaseFall1 where
fib :: Int -> Int
fib n | n == 0 = n
fib n | n == 1 = n
fib n = fib (n-1) + fib (n-1)
main = putStrLn (show (... |
7cc4f9f7436e46429ef8de491908e6ce838b3f9dd09ea857dfae0bad43365080 | Twinside/Juicy.Pixels | jpeg-basic.hs | import qualified Data.ByteString.Lazy as LB
import System.Environment( getArgs )
import Codec.Picture
import Codec.Picture.Types
transformImage :: Image PixelYCbCr8 -> Image PixelYCbCr8
transformImage img = img -- Transform the image here
transformRGBImage :: Image PixelRGB8 -> Image PixelRGB8
Transform the RGB ima... | null | https://raw.githubusercontent.com/Twinside/Juicy.Pixels/ab41b84403699a7f4d290685e690fbaff42ed95f/skeletons/jpeg-basic.hs | haskell | Transform the image here
If you prefer to work in the RGB8 colorspace, uncomment
the following
-} | import qualified Data.ByteString.Lazy as LB
import System.Environment( getArgs )
import Codec.Picture
import Codec.Picture.Types
transformImage :: Image PixelYCbCr8 -> Image PixelYCbCr8
transformRGBImage :: Image PixelRGB8 -> Image PixelRGB8
Transform the RGB image here
main :: IO ()
main = do
commandArguments... |
b85837b3e202d636b4a485768604cf4345f8531051ba6da4dc2c35ad84dd9016 | calyau/maxima | mactex.lisp | -*- Mode : Lisp ; Package : Maxima ; Syntax : Common - Lisp ; Base : 10 -*- ; ; ; ;
(in-package :maxima)
;; TeX-printing
( c ) copyright 1987 ,
small corrections and additions : , 2001
additional additions : ( JM ) , September 2001
additional corrections : ( BLW ) , October 2001
Usage : tex(d8... | null | https://raw.githubusercontent.com/calyau/maxima/9352a3f5c22b9b5d0b367fddeb0185c53d7f4d02/src/mactex.lisp | lisp | Package : Maxima ; Syntax : Common - Lisp ; Base : 10 -*- ; ; ; ;
TeX-printing
/ foo.tex " ) ; ..
to append lines d8 and d10 to the tex file. If given only
Extract from permission letter to wfs:
Date: Sat, 2 Apr 88 18:06:16 PST
To:
Subject: about tex...
else who might be interested in it....
source languag... |
(in-package :maxima)
( c ) copyright 1987 ,
small corrections and additions : , 2001
additional additions : ( JM ) , September 2001
additional corrections : ( BLW ) , October 2001
one argument the result goes to standard output .
From : fateman%vangogh . Berkeley . EDU@ucbvax . Berkeley . EDU (... |
8c40eb4e362ceb5fec28147f00b9312672c09dcfd49da7e7ae83dbdbbb88fbde | jsquared21/Pragmatic-Programming-Erlang | ring.erl | @author < >
jsquared , Inc. , 2014 .
2014 by jsquared
%% @version 0.1
-module(ring).
-export ([start/3]).
%% Ex:12-3.
%% Write a ring benchmark. Create N processes in a ring. Send a
%% message round the ring M times so that a total of N * M messages
%% get sent. Time how long this takes for different values... | null | https://raw.githubusercontent.com/jsquared21/Pragmatic-Programming-Erlang/f028b4f288785ca6cd4e6bed7e7a03f627efbfb5/Ch_12/ring.erl | erlang | @version 0.1
Ex:12-3.
Write a ring benchmark. Create N processes in a ring. Send a
message round the ring M times so that a total of N * M messages
get sent. Time how long this takes for different values of N and
M. | @author < >
jsquared , Inc. , 2014 .
2014 by jsquared
-module(ring).
-export ([start/3]).
start(N, M, Message) when N > 1 ->
statistics(wall_clock),
spawn(fun() -> ring(N-1, M, Message) end).
ring(N, M, Message) when M > 0 ->
Fun = fun(_, P) -> spawn(fun() -> loop(P) end) end,
Pid = lists:foldl(F... |
12b7a352939f26f527ccb891334ff2912cddd7077a817f95bce2ffbb0aaf0be8 | khibino/haskell-relational-record | PostgreSQL.hs | -- |
-- Module : Database.Custom.PostgreSQL
Copyright : 2019
-- License : BSD3
--
-- Maintainer :
-- Stability : experimental
-- Portability : unknown
--
-- This module provides custom APIs with appropriate configuration
-- for PostgreSQL.
module Database.Custom.PostgreSQL (
module Database.Relati... | null | https://raw.githubusercontent.com/khibino/haskell-relational-record/759b3d7cea207e64d2bd1cf195125182f73d2a52/relational-schemas/src/Database/Custom/PostgreSQL.hs | haskell | |
Module : Database.Custom.PostgreSQL
License : BSD3
Maintainer :
Stability : experimental
Portability : unknown
This module provides custom APIs with appropriate configuration
for PostgreSQL.
| From 'Relation' into typed 'Query' with suffix SQL words.
^ relation to finalize building
^ finaliz... | Copyright : 2019
module Database.Custom.PostgreSQL (
module Database.Relational,
relationalQuery,
insertValue, insertValueNoPH, insertQuery,
update, updateNoPH,
delete, deleteNoPH,
) where
import Language.SQL.Keyword (Keyword)
import Database.Relational.Schema.PostgreSQL.Config (config)
import Dat... |
63106d2c2b35250258451f844f4cea57d41919e85f4846616476485e30856fb5 | ndmitchell/catch | Req.hs | {-# OPTIONS_GHC -fallow-undecidable-instances #-}
for the instance of Formula p
module Req(module Req, module Path) where
import Yhc.Core
import General
import Path
import Data.Proposition
import Data.List
import Data.Maybe
import Safe
-- DATA DEFINITIONS
type Scopes p = [Scope p]
data Scope p = Scope FuncName (... | null | https://raw.githubusercontent.com/ndmitchell/catch/5d834416a27b4df3f7ce7830c4757d4505aaf96e/comb/Req.hs | haskell | # OPTIONS_GHC -fallow-undecidable-instances #
DATA DEFINITIONS
given that a predicate is anded, what must this one be
must make things smaller, or returns Nothing
impliesPair a b, a => b
calculate all possible constructors that might arise | for the instance of Formula p
module Req(module Req, module Path) where
import Yhc.Core
import General
import Path
import Data.Proposition
import Data.List
import Data.Maybe
import Safe
type Scopes p = [Scope p]
data Scope p = Scope FuncName (p Req)
data Req = Req Hill Expr Path [CtorName]
| Demonic
... |
e1dcaa382291d7e0a25fc7fd7b420af2977dfc0ef381ac34cb1ae51de30652fc | dstarcev/stepic-haskell | Task11.hs | module Module4.Task11 where
import Data.Time.Clock
import Data.Time.Format
timeToString :: UTCTime -> String
timeToString = formatTime defaultTimeLocale "%a %d %T"
data LogLevel = Error | Warning | Info deriving Show
data LogEntry = LogEntry { timestamp :: UTCTime, logLevel :: LogLevel, message :: String ... | null | https://raw.githubusercontent.com/dstarcev/stepic-haskell/6a8cf4b3cc17333ac4175e825db57dbe151ebae0/src/Module4/Task11.hs | haskell | module Module4.Task11 where
import Data.Time.Clock
import Data.Time.Format
timeToString :: UTCTime -> String
timeToString = formatTime defaultTimeLocale "%a %d %T"
data LogLevel = Error | Warning | Info deriving Show
data LogEntry = LogEntry { timestamp :: UTCTime, logLevel :: LogLevel, message :: String ... | |
c9a7ce4a4c2f256ef47c944b41351833b2c3e3793bc3fe252bb795c33502b482 | sgbj/MaximaSharp | polybas.lisp | ;;; -*- mode: lisp; package: cl-maxima; syntax: common-lisp -*-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; ;;;;;
Copyright ( c ) 1984 by , University of Texas ; ; ; ; ;
;;; All rights reserved ... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/affine/polybas.lisp | lisp | -*- mode: lisp; package: cl-maxima; syntax: common-lisp -*-
;;;;;
; ; ; ;
All rights reserved ;;;;;
should take into account when the variables don't need replacing.
(cond ((or (eq xx '$rat)(eq yy '$... |
(in-package :maxima)
(defvar *varlist* nil)
(defvar *genvar* nil)
(defun polynomialp (x)
(cond ((numberp x))
((atom x) nil)
((and (atom (car x)) (symbolp (car x)) (get (car x) 'disrep)))
(t nil)))
(Defun header-poly (expr)
(cond ((numberp expr) expr)
((and (numberp (car expr))
(numberp (cdr ex... |
fc8390d3732763bd9ef033ad42457189492ab9169c91bde6014118fc371ee918 | JacquesCarette/Drasil | Constructors.hs | -- | Generic constructors and smart constructors to be used in renderers
module GOOL.Drasil.LanguageRenderer.Constructors (
mkStmt, mkStmtNoEnd, mkStateVal, mkVal, mkStateVar, mkVar, mkStaticVar,
VSOp, mkOp, unOpPrec, compEqualPrec, compPrec, addPrec, multPrec, powerPrec,
andPrec, orPrec, unExpr, unExpr', unExp... | null | https://raw.githubusercontent.com/JacquesCarette/Drasil/09b8f1d579fd5c34d4465f51be4bb6be14800353/code/drasil-gool/lib/GOOL/Drasil/LanguageRenderer/Constructors.hs | haskell | | Generic constructors and smart constructors to be used in renderers
Statements
| Constructs a statement terminated by a semi-colon
| Constructs a statement without a termination character
Values --
| Constructs a value in a stateful context
| Constructs a value in a non-stateful context
Variables --
| Constr... | module GOOL.Drasil.LanguageRenderer.Constructors (
mkStmt, mkStmtNoEnd, mkStateVal, mkVal, mkStateVar, mkVar, mkStaticVar,
VSOp, mkOp, unOpPrec, compEqualPrec, compPrec, addPrec, multPrec, powerPrec,
andPrec, orPrec, unExpr, unExpr', unExprNumDbl, typeUnExpr, binExpr,
binExpr', binExprNumDbl', typeBinExpr
) ... |
19f7e7de7f4f832f18fc4ccfb19239b8dec36bfc6ea520a19b48546cfaf755f6 | threatgrid/ctia | asset_mapping.clj | (ns ctia.entity.asset-mapping
(:require
[ctia.domain.entities :as entities]
[ctia.entity.asset :as asset]
[ctia.flows.schemas :refer [with-error]]
[ctia.graphql.delayed :as delayed]
[ctia.http.routes.common :as routes.common]
[ctia.http.routes.crud :refer [services->entity-crud-routes]]
[ctia.sch... | null | https://raw.githubusercontent.com/threatgrid/ctia/aec0c858103bc2c9e4d9a29a2f1aa6a86c4dd6c8/src/ctia/entity/asset_mapping.clj | clojure | (ns ctia.entity.asset-mapping
(:require
[ctia.domain.entities :as entities]
[ctia.entity.asset :as asset]
[ctia.flows.schemas :refer [with-error]]
[ctia.graphql.delayed :as delayed]
[ctia.http.routes.common :as routes.common]
[ctia.http.routes.crud :refer [services->entity-crud-routes]]
[ctia.sch... | |
2357dce98d6d51d82a50b85efef83fb09fcf7b4f085e9b000172f3e9c27e0fb0 | exoscale/clojure-kubernetes-client | v1beta2_deployment_list.clj | (ns clojure-kubernetes-client.specs.v1beta2-deployment-list
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1beta2-deployment :refer :all]
[clojure-kubernetes-client.specs.v1-list-meta :refer :all]
)
(:import (java.... | null | https://raw.githubusercontent.com/exoscale/clojure-kubernetes-client/79d84417f28d048c5ac015c17e3926c73e6ac668/src/clojure_kubernetes_client/specs/v1beta2_deployment_list.clj | clojure | (ns clojure-kubernetes-client.specs.v1beta2-deployment-list
(:require [clojure.spec.alpha :as s]
[spec-tools.data-spec :as ds]
[clojure-kubernetes-client.specs.v1beta2-deployment :refer :all]
[clojure-kubernetes-client.specs.v1-list-meta :refer :all]
)
(:import (java.... | |
e4bbc9f20890132179ed51ca9003d56580d7f21b5405c53cd4ba7c867a42ffe1 | mfoemmel/erlang-otp | wxSetCursorEvent.erl | %%
%% %CopyrightBegin%
%%
Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
%%
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
%% compliance with the License. You should have received a copy of the
%% Erlang Pub... | null | https://raw.githubusercontent.com/mfoemmel/erlang-otp/9c6fdd21e4e6573ca6f567053ff3ac454d742bc2/lib/wx/src/gen/wxSetCursorEvent.erl | erlang |
%CopyrightBegin%
compliance with the License. You should have received a copy of the
Erlang Public License along with this software. If not, it can be
retrieved online at /.
basis, WITHOUT WARRANTY OF ANY KIND, either express or implied. See
the License for the specific language governing rights and limita... | Copyright Ericsson AB 2008 - 2009 . All Rights Reserved .
The contents of this file are subject to the Erlang Public License ,
Version 1.1 , ( the " License " ) ; you may not use this file except in
Software distributed under the License is distributed on an " AS IS "
-module(wxSetCursorEvent).
-include("wxe.... |
cba5b8c14ab1c189240d7b1f94e1a1f27c95aae951f5e3808ccccbee43f65bc0 | coq/coq | evar_tactics.mli | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/fad4cb7e5447f86a67aebec15b417fd7c071a81c/tactics/evar_tactics.mli | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
30dfa84ae182dcd4c2addceadd0c93ba352db4b89fc6d4a0b59999ee2d9d46fe | rvantonder/hack_parallel | hack_parallel.mli | module Scheduler : sig
module Daemon : sig
val check_entry_point : unit -> unit
end
type t
val create : ?number_of_workers:int -> ?bucket_multiplier:int -> unit -> t
val map_reduce
: t
-> ?bucket_size:int
-> init:'a
-> map:('a -> 'b list -> 'c)
-> reduce:('c -> 'a -> 'a)
-> 'b... | null | https://raw.githubusercontent.com/rvantonder/hack_parallel/c9d0714785adc100345835c1989f7c657e01f629/hack_parallel.mli | ocaml | module Scheduler : sig
module Daemon : sig
val check_entry_point : unit -> unit
end
type t
val create : ?number_of_workers:int -> ?bucket_multiplier:int -> unit -> t
val map_reduce
: t
-> ?bucket_size:int
-> init:'a
-> map:('a -> 'b list -> 'c)
-> reduce:('c -> 'a -> 'a)
-> 'b... | |
f75d3e65e210274ef6563814d1e6327a5357c10941b08c43f8a9e6cc5dd0c8ae | jarmitage/jarmlib | NanoOSCSpecs.hs | -- LiveCore OSC Spec template
:{
lcOSCSpec t = [OSC note2Path $ ArgList $ note2Args++oscBundle++t,
OSC notePath $ ArgList $ noteArgs++oscBundle++t ,
OSC ctlPath $ ArgList $ ctlArgs++oscBundle++t,
-- OSC samplePath $ ArgList $ sampleArgs++t,
OSC patchPath $ ArgList ... | null | https://raw.githubusercontent.com/jarmitage/jarmlib/853f6d18ab32630397be91ea89846d55e59e3d70/tidal/osc/targets/LiveCore/NanoOSCSpecs.hs | haskell | LiveCore OSC Spec template
OSC samplePath $ ArgList $ sampleArgs++t, | :{
lcOSCSpec t = [OSC note2Path $ ArgList $ note2Args++oscBundle++t,
OSC notePath $ ArgList $ noteArgs++oscBundle++t ,
OSC ctlPath $ ArgList $ ctlArgs++oscBundle++t,
OSC patchPath $ ArgList $ patchArgs++oscBundle++t,
OSC clockPath $ ArgList $ clockArgs++t]
:}
O... |
eab1083a81c87ef84fc52b177885dd4b2088bcba4d92a73378e0c8a2b8559d14 | pauleve/pint | pintsg.ml |
open Big_int_Z
open PintTypes
open LocalCausalityGraph
open AutomataNetwork
let usage_msg = "pint-sg - State graph analyser"
let do_count = ref false
let do_attractors = ref false
let do_description = ref false
let do_states = ref false
let do_sg = ref ""
let cmdopts = An_cli.common_cmdopts @ An_cli.input_cmdop... | null | https://raw.githubusercontent.com/pauleve/pint/7cf943ec60afcf285c368950925fd45f59f66f4a/pintsg.ml | ocaml |
open Big_int_Z
open PintTypes
open LocalCausalityGraph
open AutomataNetwork
let usage_msg = "pint-sg - State graph analyser"
let do_count = ref false
let do_attractors = ref false
let do_description = ref false
let do_states = ref false
let do_sg = ref ""
let cmdopts = An_cli.common_cmdopts @ An_cli.input_cmdop... | |
21ebe013cabb34357bace79404c55a0ee2b8d6c7ae402a476930a231ac1edac1 | mpickering/apply-refact | Lambda7.hs | fun mr = y mr | null | https://raw.githubusercontent.com/mpickering/apply-refact/a4343ea0f4f9d8c2e16d6b16b9068f321ba4f272/tests/examples/Lambda7.hs | haskell | fun mr = y mr | |
d80dd1652783b1a982257491c3e494f7d76b3c2244192537ae7e249b687e0181 | ghollisjr/cl-ana | package.lisp | cl - ana is a Common Lisp data analysis library .
Copyright 2013 , 2014
;;;;
This file is part of cl - ana .
;;;;
;;;; cl-ana is free software: you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the ... | null | https://raw.githubusercontent.com/ghollisjr/cl-ana/08bda33323a5058ae3a76302fa2488c368f92353/calculus/package.lisp | lisp |
cl-ana is free software: you can redistribute it and/or modify it
(at your option) any later version.
cl-ana is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
General Public Lice... | cl - ana is a Common Lisp data analysis library .
Copyright 2013 , 2014
This file is part of cl - ana .
under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the License , or
You should have received a copy of the GNU General Public License
... |
5a9694cd57b70cf1ce317fd65f34dca11bebffc8167efd1dcb5d7f09eec2486c | GrammaticalFramework/gf-core | Lexing.hs | | and unlexers - they work on space - separated word strings
module GF.Text.Lexing (stringOp,opInEnv,bindTok) where
import GF.Text.Transliterations
import Data.Char (isSpace,toUpper,toLower)
import Data.List (intersperse)
stringOp :: (String -> Bool) -> String -> Maybe (String -> String)
stringOp good name = case... | null | https://raw.githubusercontent.com/GrammaticalFramework/gf-core/9b4f2dd18b64b770aaebfa1885085e8e3447f119/src/compiler/GF/Text/Lexing.hs | haskell | perform op in environments beg--end, t.ex. between "--"
- suboptimal implementation
--appUnlexer f = unlines . map (f . words) . lines
* Text lexing
* Code lexing
| Haskell lexer, usable for much code
Philological greek text may use vowel length indicators. Then '.' is not a sentence
separator, nor is 'v. ' for ... | | and unlexers - they work on space - separated word strings
module GF.Text.Lexing (stringOp,opInEnv,bindTok) where
import GF.Text.Transliterations
import Data.Char (isSpace,toUpper,toLower)
import Data.List (intersperse)
stringOp :: (String -> Bool) -> String -> Maybe (String -> String)
stringOp good name = case... |
d3e94364569ddd9acb37c0d6da917d0b60a33c3b985b0b8d1ddfae7d92156c52 | ygrek/ocaml-zstd | zstd_stubs.ml | open Ctypes
module Bindings
(F : Cstubs.FOREIGN) =
struct
open F
let versionNumber = foreign "ZSTD_versionNumber" (void @-> returning int)
let compressBound = foreign "ZSTD_compressBound" (size_t @-> returning size_t)
let getErrorName = foreign "ZSTD_getErrorName" (size_t @-> returning string)
let isError... | null | https://raw.githubusercontent.com/ygrek/ocaml-zstd/d630b698bdd75463d8de7af225edfd83d3872cf9/src/zstd_stubs.ml | ocaml | open Ctypes
module Bindings
(F : Cstubs.FOREIGN) =
struct
open F
let versionNumber = foreign "ZSTD_versionNumber" (void @-> returning int)
let compressBound = foreign "ZSTD_compressBound" (size_t @-> returning size_t)
let getErrorName = foreign "ZSTD_getErrorName" (size_t @-> returning string)
let isError... | |
7c56af695ddeb0f3673f884f50f4a9609139e18b79bfb45f8534042f23f6b866 | tweag/ormolu | op-chain-r-gt-colon-2-out.hs | Right chain , : case , 2 operators with p(a ) > p (: )
l :: Int
l =
1
^^ 2
^^ 3
^^ 4
: 5
^^ 6
^^ 7
^^ 8
| null | https://raw.githubusercontent.com/tweag/ormolu/1f63136d047205f95b7d3c0f6aa34c34bb29ac7f/data/examples/declaration/value/function/infix/op-chain-r-gt-colon-2-out.hs | haskell | Right chain , : case , 2 operators with p(a ) > p (: )
l :: Int
l =
1
^^ 2
^^ 3
^^ 4
: 5
^^ 6
^^ 7
^^ 8
| |
6483554ba086a31114ce73ca4d4c2a6afdb3afb95b7f786b7f2dd7772a60d7d0 | ptaoussanis/carmine | message_queue.clj | (ns taoensso.carmine.tests.message-queue
(:require
[clojure.test :as test :refer [deftest testing is]]
[taoensso.carmine :as car :refer [wcar]]
[taoensso.carmine.message-queue :as mq]))
(comment
(remove-ns 'taoensso.carmine.tests.message-queue)
(test/run-tests 'taoensso.carmine.tests.message-q... | null | https://raw.githubusercontent.com/ptaoussanis/carmine/4f13e08a5a41a81c745e4a82ea1c5c1a2223a3eb/test/taoensso/carmine/tests/message_queue.clj | clojure | Config, etc.
End of circle
End of circle
Locked mid1
(is (= (wcar* (dequeue* tq)) "eoq-backoff))
Handler will *not* run against eoq-backoff/nil reply:
Will gc
Simulate bad handler
Wait for lock to expire
< handler backoff
> handler backoff
Will gc
< handler backoff
> handler backoff
Hold lock
> handler... | (ns taoensso.carmine.tests.message-queue
(:require
[clojure.test :as test :refer [deftest testing is]]
[taoensso.carmine :as car :refer [wcar]]
[taoensso.carmine.message-queue :as mq]))
(comment
(remove-ns 'taoensso.carmine.tests.message-queue)
(test/run-tests 'taoensso.carmine.tests.message-q... |
4ea215cd179da2387ebbdd2c06dfc81b3ae6032115ee363300a8e8a7d013e6c4 | cicakhq/potato | private-web.lisp | (defpackage :potato.web.private
(:use :cl :potato :potato.common :potato.web))
(in-package :potato.web.private)
(declaim #.potato.common::*compile-decl*)
(potato.core:define-json-handler-fn-login (start-private-chat-screen "/start_private_chat" data nil ())
(potato.core:with-authenticated-user ()
(lofn:case-... | null | https://raw.githubusercontent.com/cicakhq/potato/88b6c92dbbc80a6c9552435604f7b1ae6f2a4026/src/potato/private-web.lisp | lisp | The following check is done in the call to
FIND-PRIVATE-CHANNEL-FOR-USERS as well, but let's be clear
about the intent.
Find the channel and redirect to it | (defpackage :potato.web.private
(:use :cl :potato :potato.common :potato.web))
(in-package :potato.web.private)
(declaim #.potato.common::*compile-decl*)
(potato.core:define-json-handler-fn-login (start-private-chat-screen "/start_private_chat" data nil ())
(potato.core:with-authenticated-user ()
(lofn:case-... |
c6098226fd9230995d96336960c1abfd732845bd4a1996e1a9c6f7bd5bcd6d67 | mekispeter/haskell2019spring | haskell_may_6.hs |
Functional Programming for Logicians 2019 Spring
May 6 session
Sections :
1 for List
2 for Maybe
3 Monadic operations vs do notation
4 Monadizing list comprehension
We started with a considerable amount of initial code in each section .
Functional Programming for Logicians 2019 S... | null | https://raw.githubusercontent.com/mekispeter/haskell2019spring/18fa81092cdc7a15c8ef92a2eff8274dfe79d00d/src/haskell_may_6.hs | haskell | These definitions will be familiar from previous sessions:
> lf <*> lx
> lstf <*> lstx
<1,4,9,16,25,36,49,1,8,27,64,125,216,343,1,16,81,256,625,1296,2401>
Example on the whiteboard:
xs :: Integer
xs = [1,2,3]
f :: Integer -> [Integer]
f 3 = [3,3,3]
return :: a -> m a
>>= binding
(>>=) :: m a -> (a -> m b) -... |
Functional Programming for Logicians 2019 Spring
May 6 session
Sections :
1 for List
2 for Maybe
3 Monadic operations vs do notation
4 Monadizing list comprehension
We started with a considerable amount of initial code in each section .
Functional Programming for Logicians 2019 S... |
690f64f24c2024a396840ee3e78a71d55690c74aacc93498dc0e65469da2dabe | padsproj/opads | swat.ml | open Pads
open PadsParser
let alphaNumRE = REd ("[a-zA-Z0-9]*", "a")
let alphaRE = REd ("[a-zA-Z]*", "a")
let uc = REd ("[A-Z]+", "A")
let label = REd ("[A-Z_0-9]+", "A")
let filenameRE = REd ("[a-zA-Z.0-9]+", "a")
let fertnameRE = REd ("[a-zA-Z.0-9\\-]*", "a")
let ws = REd ("[ \t]*", " ")
let nonws = REd ("[^ \t]*"... | null | https://raw.githubusercontent.com/padsproj/opads/bb9a380e73ea68954b30acf785294f95004ffcfb/examples/swat/swat.ml | ocaml | Some inconsistency between docs and actual data here
Missing last parameter?
Last float isn't in manual, no idea what it is
Hacky
let sdrFile x = x.sdrFile | open Pads
open PadsParser
let alphaNumRE = REd ("[a-zA-Z0-9]*", "a")
let alphaRE = REd ("[a-zA-Z]*", "a")
let uc = REd ("[A-Z]+", "A")
let label = REd ("[A-Z_0-9]+", "A")
let filenameRE = REd ("[a-zA-Z.0-9]+", "a")
let fertnameRE = REd ("[a-zA-Z.0-9\\-]*", "a")
let ws = REd ("[ \t]*", " ")
let nonws = REd ("[^ \t]*"... |
3a7c51ccee52117da55defe15d77985ab36a43e319fb49b22ff05b44fc0fd729 | slepher/astranaut | astranaut_macro_SUITE.erl | %%%-------------------------------------------------------------------
@author < >
( C ) 2018 ,
%%% @doc
%%%
%%% @end
Created : 8 Dec 2018 by < >
%%%-------------------------------------------------------------------
-module(astranaut_macro_SUITE).
-compile(export_all).
-include_lib("eunit/include/eu... | null | https://raw.githubusercontent.com/slepher/astranaut/0731eaf49ef32dd39a2748a2b481f8fff5826067/test/astranaut_macro_SUITE.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
--------------------------------------------------------------------
Info = [tuple()]
@end
--------------------------------------------------------------------
---------... | @author < >
( C ) 2018 ,
Created : 8 Dec 2018 by < >
-module(astranaut_macro_SUITE).
-compile(export_all).
-include_lib("eunit/include/eunit.hrl").
-include_lib("common_test/include/ct.hrl").
@spec suite ( ) - > Info
suite() ->
[{timetrap,{seconds,60}}].
@spec init_per_suite(Config0 ) - >
... |
66be4e754f42803a9ec503918fefd0c32c3cfc595fdb0f1846d0ef15c64be349 | Twinside/Eq | Linker.hs | -- | This module will link variable names to
-- symbols.
module Language.Eq.Linker( DocString, LongDescr
, entityList
, metaFunctionList
, unaryFunctions
, multiParamsFunctions
, linkFormula
... | null | https://raw.githubusercontent.com/Twinside/Eq/60105372d55420735b722245db7021c239c812f4/Language/Eq/Linker.hs | haskell | | This module will link variable names to
symbols.
| Linking formula doesn't change it's form,
so we can keep it
| Function associating variables to symbol.
Transformations for operators
General transformations | module Language.Eq.Linker( DocString, LongDescr
, entityList
, metaFunctionList
, unaryFunctions
, multiParamsFunctions
, linkFormula
) where
import Control.Applicative( (<$>) )
import ... |
ad05d06ff01950d9f455c9e30f71962c703f5690b4757dff6e1b9e7a90f0e069 | YoshikuniJujo/test_haskell | Lib.hs | # LANGUAGE CApiFFI #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module Lib where
import Foreign.Ptr
import Foreign.C.Types
foreign import ccall "foo" c_foo :: IO ()
foreign import capi "use-bin-tree-array.h value tree" c_tree :: Ptr ()
foreign import ccall "depth" c_depth :: Ptr () -> CInt -> CInt -> IO ()
foreign i... | null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/68179ae9fd8f9e76268c0c2e6a2ed4d88f7d1a08/tribial/try-c-bin-tree-array/src/Lib.hs | haskell | # LANGUAGE CApiFFI #
# OPTIONS_GHC -Wall -fno - warn - tabs #
module Lib where
import Foreign.Ptr
import Foreign.C.Types
foreign import ccall "foo" c_foo :: IO ()
foreign import capi "use-bin-tree-array.h value tree" c_tree :: Ptr ()
foreign import ccall "depth" c_depth :: Ptr () -> CInt -> CInt -> IO ()
foreign i... | |
bdc3901fefc8b9408e734229b69c8bc070bb8e19c49f0fe1f3856bbc61ca702a | ocaml-sf/learn-ocaml-corpus | any_fail.ml | (* The type [parser] satisfies the monad API: [delay], [return], [>>=]. *)
(* [delay p] behaves like [p()], except the construction of the monadic
computation is delayed until the moment when this computation is run. *)
let delay (p : unit -> 'a parser) : 'a parser =
fun cursor ->
NonDet.delay (fun () -> p (... | null | https://raw.githubusercontent.com/ocaml-sf/learn-ocaml-corpus/7dcf4d72b49863a3e37e41b3c3097aa4c6101a69/exercises/fpottier/parser_combinators/wrong/any_fail.ml | ocaml | The type [parser] satisfies the monad API: [delay], [return], [>>=].
[delay p] behaves like [p()], except the construction of the monadic
computation is delayed until the moment when this computation is run.
[return a] always succeeds, consumes no input, and returns [a].
[p >>= f] is the sequential compositio... |
let delay (p : unit -> 'a parser) : 'a parser =
fun cursor ->
NonDet.delay (fun () -> p () cursor)
let return (a : 'a) : 'a parser =
fun cursor ->
NonDet.return (a, cursor)
let (>>=) (p : 'a parser) (f : 'a -> 'b parser) : 'b parser =
fun cursor ->
let open NonDet in
p cursor >>= fun (a, cur... |
380b3a9c3ffd19d59a9e3c63eeeebb7077f6d746c1ebeac4093a717c593bc3a7 | irastypain/sicp-on-language-racket | exercise_2_51a.rkt | #lang racket
(require "../lib/vectors.rkt"
(only-in "../lib/graphics.rkt"
transform-painter))
Процедура добавляет painter2 к painter1 снизу
; (вариант аналогичен определению beside)
(define (below painter1 painter2)
(let ((split-point (make-vect 0.0 0.5)))
(let ((paint-top
... | null | https://raw.githubusercontent.com/irastypain/sicp-on-language-racket/0052f91d3c2432a00e7e15310f416cb77eeb4c9c/src/chapter02/exercise_2_51a.rkt | racket | (вариант аналогичен определению beside) | #lang racket
(require "../lib/vectors.rkt"
(only-in "../lib/graphics.rkt"
transform-painter))
Процедура добавляет painter2 к painter1 снизу
(define (below painter1 painter2)
(let ((split-point (make-vect 0.0 0.5)))
(let ((paint-top
(transform-painter painter2
... |
7e89c069b245d13494a7811cec2a9df89b5874a1a65373966be49ebe018cb5b8 | nojb/llvm-min-caml | prim.ml | type primitive =
| Ptest of bool_test
| Pnot
| Pnegint
| Paddint | Psubint
| Pnegfloat
| Paddfloat | Psubfloat | Pmulfloat | Pdivfloat
| Pmakearray | Pget | Pput
| Pmaketuple
and bool_test =
| Peq_test
| Pnoteq_test
| Pint_test of prim_test
| Pfloat_test of prim_test
and prim_test =
| PTeq
... | null | https://raw.githubusercontent.com/nojb/llvm-min-caml/68703b905f8292cb2e20b41bbd90cfea85ca2a19/prim.ml | ocaml | type primitive =
| Ptest of bool_test
| Pnot
| Pnegint
| Paddint | Psubint
| Pnegfloat
| Paddfloat | Psubfloat | Pmulfloat | Pdivfloat
| Pmakearray | Pget | Pput
| Pmaketuple
and bool_test =
| Peq_test
| Pnoteq_test
| Pint_test of prim_test
| Pfloat_test of prim_test
and prim_test =
| PTeq
... | |
5578656117a7f16567da4caae1c373fe738e8b02d05feb0d3e6af06328e94828 | OlivierSohn/hamazed | Hamazed.hs | # LANGUAGE NoImplicitPrelude #
# LANGUAGE LambdaCase #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE DeriveGeneric #
# LANGUAGE TypeFamilies #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
module Imj.Game.Hamazed
( HamazedGame(..)
, checkComponentStatus
, checkSums
... | null | https://raw.githubusercontent.com/OlivierSohn/hamazed/c0df1bb60a8538ac75e413d2f5bf0bf050e5bc37/imj-game-hamazed/src/Imj/Game/Hamazed.hs | haskell | # LANGUAGE OverloadedStrings #
^ Maybe the world that we transition to (when a level is over).
Once the transition is over, we replace 'currentWorld' with this 'Just' value.
^ Which 'Number's were shot
^ The current 'Level'
# INLINABLE gameWindowTitle #
# INLINABLE getViewport #
draw the walls outside the matrix:
... | # LANGUAGE NoImplicitPrelude #
# LANGUAGE LambdaCase #
# LANGUAGE FlexibleContexts #
# LANGUAGE DeriveGeneric #
# LANGUAGE TypeFamilies #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
module Imj.Game.Hamazed
( HamazedGame(..)
, checkComponentStatus
, checkSums
, checkTargetAndAmmo
, countAm... |
565c3e6738c586cc93fa7178c2f5ecd6a141aa1323af6aa8c6ef85e4506fefb5 | Emmanuel-PLF/facile | pkg.ml | #!/usr/bin/env ocaml
#use "topfind"
#require "topkg-jbuilder"
open Topkg
let publish =
Pkg.publish ~artefacts:[`Distrib] ()
let () =
Topkg_jbuilder.describe ~publish ()
| null | https://raw.githubusercontent.com/Emmanuel-PLF/facile/3b6902e479019c25b582042d9a02152fec145eb0/pkg/pkg.ml | ocaml | #!/usr/bin/env ocaml
#use "topfind"
#require "topkg-jbuilder"
open Topkg
let publish =
Pkg.publish ~artefacts:[`Distrib] ()
let () =
Topkg_jbuilder.describe ~publish ()
|
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.