_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 |
|---|---|---|---|---|---|---|---|---|
30839a1d8ed59d13b4418add765e11ebb508b7ff318a8a1f923906fad301785e | fluree/json-ld | normalize.cljc | (ns fluree.json-ld.impl.normalize
(:require [clojure.string :as str]))
normalizing for hashing , cryptographic signatures , etc .
;; test against as baseline
;; basic normalization per JSON Canonicalization Scheme
;; NOTE - this work is to be done!
(def exp-str->exponent
{"1" 1
"2" 2
"3" 3
"4" 4... | null | https://raw.githubusercontent.com/fluree/json-ld/91219f3086917a35c7abea90fa088d190c6a72fa/src/fluree/json_ld/impl/normalize.cljc | clojure | test against as baseline
basic normalization per JSON Canonicalization Scheme
NOTE - this work is to be done! | (ns fluree.json-ld.impl.normalize
(:require [clojure.string :as str]))
normalizing for hashing , cryptographic signatures , etc .
(def exp-str->exponent
{"1" 1
"2" 2
"3" 3
"4" 4
"5" 5
"6" 6
"7" 7
"8" 8})
(defn- remove-trailing-decimal
"For numbers that have decimals, if the decimal ... |
edae11ca47f718c359b800b10c7a087bc1cc6f362456ebd254f69e041a8eab02 | snowleopard/alga | Class.hs | -----------------------------------------------------------------------------
-- |
-- Module : Algebra.Graph.HigherKinded.Class
Copyright : ( c ) 2016 - 2022
License : MIT ( see the file LICENSE )
-- Maintainer :
-- Stability : experimental
--
-- __Alga__ is a library for algebraic construction and ma... | null | https://raw.githubusercontent.com/snowleopard/alga/399b5dc538a2496b67f9322dc7247e06a4ec326b/src/Algebra/Graph/HigherKinded/Class.hs | haskell | ---------------------------------------------------------------------------
|
Module : Algebra.Graph.HigherKinded.Class
Maintainer :
Stability : experimental
__Alga__ is a library for algebraic construction and manipulation of graphs
motivation behind the library, the underlying theory, and implementation ... | Copyright : ( c ) 2016 - 2022
License : MIT ( see the file LICENSE )
in Haskell . See < -paper this paper > for the
module Algebra.Graph.HigherKinded.Class (
Graph (..), empty, vertex, overlay,
* graphs
Undirected,
Reflexive,
Transitive,
Preorder,
edge, vertices, edges, ove... |
dd652e9384e23e661c1296f242ca851409a50f19f678659237f9c1964d54f8bb | gfngfn/SATySFi | display.mli | open Types
val string_of_utast : untyped_abstract_tree -> string
val string_of_ast : abstract_tree -> string
(*
val string_of_mono_type_basic : mono_type -> string
val string_of_poly_type_basic : poly_type -> string
val string_of_kind_basic : kind -> string
*)
val string_of_mono_type : Typeenv.t -> mono_type -> st... | null | https://raw.githubusercontent.com/gfngfn/SATySFi/9dbd61df0ab05943b3394830c371e927df45251a/src/frontend/display.mli | ocaml |
val string_of_mono_type_basic : mono_type -> string
val string_of_poly_type_basic : poly_type -> string
val string_of_kind_basic : kind -> string
| open Types
val string_of_utast : untyped_abstract_tree -> string
val string_of_ast : abstract_tree -> string
val string_of_mono_type : Typeenv.t -> mono_type -> string
val string_of_mono_type_double : Typeenv.t -> mono_type -> mono_type -> (string * string)
val string_of_poly_type : Typeenv.t -> poly_type -> strin... |
c03e99d9cb841fd71a82f65dfbc05f8c4d7f3009b7dec8f3f97a2ab7630f96f2 | Armael/ocaml-libudev | searching.ml | open Udev
let str out = function
| None -> Printf.fprintf out "-"
| Some s -> Printf.fprintf out "%s" s
let _ =
(* Create the udev context *)
let ctx = Context.create () in
(* Create a list of the devices in the 'hidraw' subsystem. *)
Enumerate.(devices ctx [Subsystem "hidraw"]) |>
(* For each item en... | null | https://raw.githubusercontent.com/Armael/ocaml-libudev/45ee959cfc59c34d6c88f32eb70a3a33463ebbea/examples/searching.ml | ocaml | Create the udev context
Create a list of the devices in the 'hidraw' subsystem.
For each item enumerated, print out its information.
[Device.devnode] returns the path to the device node itself in /dev. | open Udev
let str out = function
| None -> Printf.fprintf out "-"
| Some s -> Printf.fprintf out "%s" s
let _ =
let ctx = Context.create () in
Enumerate.(devices ctx [Subsystem "hidraw"]) |>
List.iter (fun dev ->
Printf.printf "Device node path: %a\n" str (Device.devnode dev);
The device pointed t... |
ef48ff4999ccaf9ba68cfe13238976a7f9febea9c434434125088d13119e89a8 | malcolmreynolds/GSLL | flat.lisp | Regression test FLAT for GSLL , automatically generated
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST FLAT
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
(LIST 1.999741748906672d0 1.1629098753910512d0
1.2826178052928299d0 1.9472010820172727d0
1.2316565427463502d0 1.4849736143369228d0
1.9574769565369934d0 1.7... | null | https://raw.githubusercontent.com/malcolmreynolds/GSLL/2f722f12f1d08e1b9550a46e2a22adba8e1e52c4/tests/flat.lisp | lisp | Regression test FLAT for GSLL , automatically generated
(in-package :gsl)
(LISP-UNIT:DEFINE-TEST FLAT
(LISP-UNIT::ASSERT-NUMERICAL-EQUAL
(LIST
(LIST 1.999741748906672d0 1.1629098753910512d0
1.2826178052928299d0 1.9472010820172727d0
1.2316565427463502d0 1.4849736143369228d0
1.9574769565369934d0 1.7... | |
fafe1f401afc2d1e0d480934c40089fe242dd13b94773ebd04f39216ac3730df | DimaSamoz/mezzo | Reify.hs |
-----------------------------------------------------------------------------
-- |
Module : Mezzo . Model .
-- Description : MIDI exporting
Copyright : ( c )
License : MIT
--
-- Maintainer :
-- Stability : experimental
-- Portability : portable
--
-- Class of types which can be rei... | null | https://raw.githubusercontent.com/DimaSamoz/mezzo/13365da8907a714e34540f7a1d99898b67816cc9/src/Mezzo/Model/Reify.hs | haskell | ---------------------------------------------------------------------------
|
Description : MIDI exporting
Maintainer :
Stability : experimental
Portability : portable
Class of types which can be reified at the term level.
---------------------------------------------------------------------------
| C... |
Module : Mezzo . Model .
Copyright : ( c )
License : MIT
module Mezzo.Model.Reify where
import Data.Kind
class Primitive (a :: k) where
type Rep a
prim :: sing a -> Rep a
pretty :: sing a -> String
show = pretty
type BoolRep t = (Primitive t, Rep t ~ Bool)
type IntRep... |
55794770359f0eebf855a9db9721ed67a2cff6ff4041b67be15bc18b9f3931ca | SimulaVR/godot-haskell | Main.hs | # LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE MultiWayIf #-}
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE QuasiQuotes #
{-# LANGUAGE RankNTypes #-}
# LANGUAGE TemplateHaskell #
# LANG... | null | https://raw.githubusercontent.com/SimulaVR/godot-haskell/cabc06451292a9516ca34348094e8875d7b89816/project-generator/Main.hs | haskell | # LANGUAGE MultiWayIf #
# LANGUAGE OverloadedStrings #
# LANGUAGE RankNTypes #
# OPTIONS_GHC -Wno-name-shadowing #
| Use this to register all of your classes, it makes sure that you don't
forget a class that Godot needs.
exports :: GdnativeHandle -> IO ()
exports desc = registerAll' @Nodes @'[HUD, Main, Mob, Playe... | # LANGUAGE DerivingStrategies #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE QuasiQuotes #
# LANGUAGE TemplateHaskell #
# LANGUAGE TupleSections #
module Main where
import Control.Concurrent (threadDelay)
import Con... |
7fa88c49d7ad2892d10344588522c832d09453af7c9b1d04d9539b9c10882722 | mirage/ptt | mti_gf.ml | open Rresult
open Ptt_tuyau.Lwt_backend
open Lwt.Infix
let src = Logs.Src.create "ptt.mti-gf"
module Log : Logs.LOG = (val Logs.src_log src)
module Make
(Random : Mirage_random.S)
(Time : Mirage_time.S)
(Mclock : Mirage_clock.MCLOCK)
(Pclock : Mirage_clock.PCLOCK)
(Resolver : Ptt.Sigs.RESOLVER wi... | null | https://raw.githubusercontent.com/mirage/ptt/80411d4e1eedc989fe4f092d60ed9d56bfd2dbcf/lib/mti_gf.ml | ocaml | TODO(dinosaure): see the huge comment above. | open Rresult
open Ptt_tuyau.Lwt_backend
open Lwt.Infix
let src = Logs.Src.create "ptt.mti-gf"
module Log : Logs.LOG = (val Logs.src_log src)
module Make
(Random : Mirage_random.S)
(Time : Mirage_time.S)
(Mclock : Mirage_clock.MCLOCK)
(Pclock : Mirage_clock.PCLOCK)
(Resolver : Ptt.Sigs.RESOLVER wi... |
783220367fcd8cadaabb2c838a9adf55a3d328f05370e0a7b8853c1403686a5f | philnguyen/soft-contract | mj09.rkt |
#lang racket
(require soft-contract/fake-contract)
(let ([h (λ (b)
(let ([g (λ (z) z)])
(let ([f (λ (k)
(if b
(k 1)
(k 2)))])
(let ([y (f (λ (x) x))])
(g y)))))])
(let* ([x (h #t)]
[y (h #f)])
y))
| null | https://raw.githubusercontent.com/philnguyen/soft-contract/5e07dc2d622ee80b961f4e8aebd04ce950720239/soft-contract/test/programs/safe/sergey/mj09.rkt | racket |
#lang racket
(require soft-contract/fake-contract)
(let ([h (λ (b)
(let ([g (λ (z) z)])
(let ([f (λ (k)
(if b
(k 1)
(k 2)))])
(let ([y (f (λ (x) x))])
(g y)))))])
(let* ([x (h #t)]
[y (h #f)])
y))
| |
e89339b2c5436a5dc27ea99e44cfd2ebafea9af3ae072b8affa5b463342522ec | ztellman/penumbra | accumulate.clj | Copyright ( c ) . All rights reserved .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php)
;; which can be found in the file epl-v10.html at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be bound by... | null | https://raw.githubusercontent.com/ztellman/penumbra/db43d01c280305beab26d1004ae78b1777ab3fc7/test/example/opengl/accumulate.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php)
which can be found in the file epl-v10.html at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not remove ... | Copyright ( c ) . All rights reserved .
(ns example.opengl.accumulate
(:use [penumbra.opengl])
(:require [penumbra.app :as app]
[penumbra.data :as data]))
(defn init [state]
(app/title! "Accumulate")
(enable :texture-2d)
(point-size 5)
state)
(defn reshape [[x y w h] state]
(ortho-vie... |
67dbc2039a3b374432483bbdd740b61bb5c5b9fdc8c99395ff0c053fda806307 | avillega/generative-art | utils.clj | (ns generative-artistry.utils
(:require [quil.core :as q]))
(defn w
([] (q/width))
([x] (* (q/width) (q/map-range x 0 100 0 1))))
(defn h
([] (q/height))
([x] (* (q/height) (q/map-range x 0 100 0 1))))
(defn random-range [v]
"returns a random value between -v and v"
(q/random (- v) v))
(defn gauss [me... | null | https://raw.githubusercontent.com/avillega/generative-art/cd3be0a40ff9a7972b875df0e9e8f6981e45ee40/src/generative_artistry/utils.clj | clojure | (ns generative-artistry.utils
(:require [quil.core :as q]))
(defn w
([] (q/width))
([x] (* (q/width) (q/map-range x 0 100 0 1))))
(defn h
([] (q/height))
([x] (* (q/height) (q/map-range x 0 100 0 1))))
(defn random-range [v]
"returns a random value between -v and v"
(q/random (- v) v))
(defn gauss [me... | |
9443c239b386e8f1c77d5184b3c921af31ff8f4f0ffee123e4a20c830ca1f886 | Metaxal/rascas | polynomial-expansion.rkt | #lang racket/base
This file has been changed from its original dharmatech / mpl version .
(provide polynomial-expansion)
(require "arithmetic.rkt"
"algebraic-expand.rkt"
"polynomial-division.rkt")
(define (polynomial-expansion u v x t)
(if (equal? u 0)
0
(let ((d (polynomial-divisi... | null | https://raw.githubusercontent.com/Metaxal/rascas/540530c28689de50c526abf36079c07fd0436edb/polynomial-expansion.rkt | racket | #lang racket/base
This file has been changed from its original dharmatech / mpl version .
(provide polynomial-expansion)
(require "arithmetic.rkt"
"algebraic-expand.rkt"
"polynomial-division.rkt")
(define (polynomial-expansion u v x t)
(if (equal? u 0)
0
(let ((d (polynomial-divisi... | |
6d0ef7253910b9fb16349e96f5a5182ab21c3275be2b3f4ca4be9b218de1d4d4 | sashashakun/SICP | solution.rkt | #lang racket/base
(define (A x y)
(cond ((= y 0) 0)
((= x 0) (* 2 y))
((= y 1) 2)
(else (A (- x 1)
(A x (- y 1))))))
(provide A)
| null | https://raw.githubusercontent.com/sashashakun/SICP/2b5f15fa7c0ff5b0f31272eb100c691b5a4703fc/src/chapter1/1.10/solution.rkt | racket | #lang racket/base
(define (A x y)
(cond ((= y 0) 0)
((= x 0) (* 2 y))
((= y 1) 2)
(else (A (- x 1)
(A x (- y 1))))))
(provide A)
| |
b4fe79dede8ee5ef1e78d92aafddaf2fab089a86e0f03c0a293477dbe0c969de | vicampo/riposte | empty.rkt | #lang racket/base
(require racket/match
web-server/http/request-structs
web-server/dispatch
json
(file "common.rkt"))
(define baz 42)
(define bomb -59.8)
(define (robby req)
(response/jsexpr (hasheq 'foo "wow!"
'bar (list "foo")
... | null | https://raw.githubusercontent.com/vicampo/riposte/0a71e54539cb40b574f84674769792444691a8cf/examples/empty.rkt | racket | #lang racket/base
(require racket/match
web-server/http/request-structs
web-server/dispatch
json
(file "common.rkt"))
(define baz 42)
(define bomb -59.8)
(define (robby req)
(response/jsexpr (hasheq 'foo "wow!"
'bar (list "foo")
... | |
aff09fb62b61f8b0b0727fad2f4c80ef1be53ccec0cf4c235ade09d15d9259ec | juspay/fencer | Main.hs | # LANGUAGE NumericUnderscores #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE OverloadedLabels #
# LANGUAGE DataKinds #
| The main module of Fencer , included in the library to make it easier to
load it in REPL . @src / Main.hs@ simply calls ' main ' from this module .
module Fencer.Main
( main
)
where
im... | null | https://raw.githubusercontent.com/juspay/fencer/db7c64ff848446d247dc8d59a1df5b50cdc104f6/lib/Fencer/Main.hs | haskell | # LANGUAGE OverloadedStrings #
--------------------------------------------------------------------------
Main
--------------------------------------------------------------------------
| Load YAML rules from @config/@, create in-memory state and run the gRPC
server serving ratelimit requests.
Read environment vari... | # LANGUAGE NumericUnderscores #
# LANGUAGE OverloadedLabels #
# LANGUAGE DataKinds #
| The main module of Fencer , included in the library to make it easier to
load it in REPL . @src / Main.hs@ simply calls ' main ' from this module .
module Fencer.Main
( main
)
where
import BasePrelude
import qualified ... |
3c34f5b077fcd25bc88c28f5632550528b710540dafa3cda1e2fb4260520412e | rmloveland/scheme48-0.53 | node.scm |
Copyright ( c ) 1993 - 1999 by . See file COPYING .
; This file contains the definitions of the node tree data structure.
;---------------------------------------------------------------------------
Records to represent variables .
(define-record-type variable
((name) ; Source code name for variabl... | null | https://raw.githubusercontent.com/rmloveland/scheme48-0.53/1ae4531fac7150bd2af42d124da9b50dd1b89ec1/ps-compiler/node/node.scm | scheme | This file contains the definitions of the node tree data structure.
---------------------------------------------------------------------------
Source code name for variable (used for debugging only)
Unique numeric identifier (used for debugging only)
Type for variable's value
LAMBDA node which binds this vari... |
Copyright ( c ) 1993 - 1999 by . See file COPYING .
Records to represent variables .
(define-record-type variable
)
Useful slot , used by shapes , COPY - NODE , NODE->VECTOR , etc .
For various annotations , e.g. IGNORABLE
))
(define-record-discloser type/variable
(lambda (var)
(node-hash v... |
4f58c523aa04dfd383115d61922fd28bb2d395f483cd42fbd83b6b58198e6f4d | robx/puzzle-draw | checkpuzzle.hs | # LANGUAGE FlexibleContexts #
module Main where
import Control.Monad
import qualified Data.ByteString as ByteString
import Data.Elements
( KropkiDot (..),
digitList,
)
import Data.Grid (Grid)
import Data.GridShape
( C,
Edge,
N,
dualE,
edgesM,
ends,
rows,
unorient,
)
import Data... | null | https://raw.githubusercontent.com/robx/puzzle-draw/936f4c9bf8ff576fb657b7c05067504734adae14/src/tools/checkpuzzle.hs | haskell | # LANGUAGE FlexibleContexts #
module Main where
import Control.Monad
import qualified Data.ByteString as ByteString
import Data.Elements
( KropkiDot (..),
digitList,
)
import Data.Grid (Grid)
import Data.GridShape
( C,
Edge,
N,
dualE,
edgesM,
ends,
rows,
unorient,
)
import Data... | |
bf1a0262d0da3a5bb29ace3e26e3a6a743e3cde5a303a09dc7b80308cea00da1 | Eventuria/demonstration-gsd | HealthChecking.hs | # LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
module Eventuria.Commons.Dependencies.HealthChecking where
import Data.Function ((&))
import Control.Concurrent
import Eventuria.Adapters.Time.Core
import Eventuria.Commons.Dependencies.Core
import Eventuria.Commons.Logger.Core
import Data.List.NonEmpty
waitT... | null | https://raw.githubusercontent.com/Eventuria/demonstration-gsd/5c7692b310086bc172d3fd4e1eaf09ae51ea468f/src/Eventuria/Commons/Dependencies/HealthChecking.hs | haskell | # LANGUAGE NamedFieldPuns #
# LANGUAGE RecordWildCards #
module Eventuria.Commons.Dependencies.HealthChecking where
import Data.Function ((&))
import Control.Concurrent
import Eventuria.Adapters.Time.Core
import Eventuria.Commons.Dependencies.Core
import Eventuria.Commons.Logger.Core
import Data.List.NonEmpty
waitT... | |
91b702af4eaf94bbd23bca4439ef122e79dcabb920416f6ee6a41079be5212e6 | hopv/r_type | cond.ml |
open Core
let (=) = Poly.(=)
let (<>) = Poly.(<>)
module Subst = struct
type t = (Identity.t * Identity.t) list
[@@deriving eq, sexp, ord, hash]
let empty = []
let add (self:t) ((k:Identity.t), (v:Identity.t)) : t =
if List.Assoc.mem self ~equal:(=) k then self
else if k = v then self
else (k, v... | null | https://raw.githubusercontent.com/hopv/r_type/7120b74912118a8eced8e63d1792907702e090dc/src/data/cond.ml | ocaml | gather_equalities c1
TODO: Write conversion
Option.map ob ~f:(fun b -> log term; Logger.debug (Bool.to_string b));
Format.print_flush () ;
Format.printf "var %s@." vid ;
Format.printf "splitting %a@.@." term_fmt term ;
Format.fprintf fmt "collecting predicates...@." ;
Format.fprintf fmt "collecting varia... |
open Core
let (=) = Poly.(=)
let (<>) = Poly.(<>)
module Subst = struct
type t = (Identity.t * Identity.t) list
[@@deriving eq, sexp, ord, hash]
let empty = []
let add (self:t) ((k:Identity.t), (v:Identity.t)) : t =
if List.Assoc.mem self ~equal:(=) k then self
else if k = v then self
else (k, v... |
f0e40027d507cbbb25ecf9dcf7a0526c1d1627bd96e67deb3cc77e1e2afea446 | metabase/metabase | session.clj | (ns metabase.models.session
(:require
[buddy.core.codecs :as codecs]
[buddy.core.nonce :as nonce]
[metabase.models.interface :as mi]
[metabase.server.middleware.misc :as mw.misc]
[metabase.server.request.util :as request.u]
[schema.core :as s]
[toucan.models :as models]))
(s/defn ^:private rando... | null | https://raw.githubusercontent.com/metabase/metabase/2d22d3af60fb2c225b60a950a96e21eb7376865d/src/metabase/models/session.clj | clojure | (ns metabase.models.session
(:require
[buddy.core.codecs :as codecs]
[buddy.core.nonce :as nonce]
[metabase.models.interface :as mi]
[metabase.server.middleware.misc :as mw.misc]
[metabase.server.request.util :as request.u]
[schema.core :as s]
[toucan.models :as models]))
(s/defn ^:private rando... | |
f1b15e24fdc4980a7bd5bc91615d4b1e3812ad295123439362213a0f18cbd447 | futurice/haskell-mega-repo | Types.hs | # LANGUAGE DerivingVia #
module Futurice.App.OktaProxy.Types where
import Futurice.Generics
import Futurice.Prelude
import Prelude ()
data AppResponse = AppResponse
{ appResLabel :: !Text
, appResImageUrl :: !(Maybe Text)
} deriving (Eq, Ord, SopGeneric, GhcGeneric, ToSchema, HasDatatypeInfo)
... | null | https://raw.githubusercontent.com/futurice/haskell-mega-repo/2647723f12f5435e2edc373f6738386a9668f603/okta-proxy/src/Futurice/App/OktaProxy/Types.hs | haskell | # LANGUAGE DerivingVia #
module Futurice.App.OktaProxy.Types where
import Futurice.Generics
import Futurice.Prelude
import Prelude ()
data AppResponse = AppResponse
{ appResLabel :: !Text
, appResImageUrl :: !(Maybe Text)
} deriving (Eq, Ord, SopGeneric, GhcGeneric, ToSchema, HasDatatypeInfo)
... | |
a44252ec7316cda6ffbcc3f1b888c10d793778c2d52a0e7cade2f50306923967 | ndmitchell/hoogle | Str.hs | # LANGUAGE PatternGuards , DeriveDataTypeable , GeneralizedNewtypeDeriving #
-- | ByteString wrappers which don't require special imports and are all UTF8 safe
module General.Str(
Str, strPack, strUnpack, strNull, strCopy, strCons,
BStr, bstrPack, bstrUnpack, bstrReadFile, bstrSplitInfix, bstrNull, bstrStripPr... | null | https://raw.githubusercontent.com/ndmitchell/hoogle/25b2872929e3fccd5bbcdef026cec63ce365647e/src/General/Str.hs | haskell | | ByteString wrappers which don't require special imports and are all UTF8 safe | # LANGUAGE PatternGuards , DeriveDataTypeable , GeneralizedNewtypeDeriving #
module General.Str(
Str, strPack, strUnpack, strNull, strCopy, strCons,
BStr, bstrPack, bstrUnpack, bstrReadFile, bstrSplitInfix, bstrNull, bstrStripPrefix, bstrTrimStart,
LBStr, lbstrPack, lbstrUnpack, lbstrToChunks, lbstrFromChu... |
4cb1aa2b0b656c8944d503b9f0716e1d12951ca8d5c0ef45cc174f469edc3ec2 | astrada/ocaml-extjs | ext_util_Region.mli | * This class represents a rectangular region in X , Y ...
{ % < p > This class represents a rectangular region in X , Y space , and performs geometric
transformations or tests upon the region.</p >
< p > This class may be used to compare the document regions occupied by elements.</p > % }
{% <p>Thi... | null | https://raw.githubusercontent.com/astrada/ocaml-extjs/77df630a75fb84667ee953f218c9ce375b3e7484/lib/ext_util_Region.mli | ocaml | * {% <p>Modifies the current region to be adjusted by offsets.</p> %}
{b Parameters}:
{ul {- top: [Js.number Js.t]
{% <p>top offset</p> %}
}
{- right: [Js.number Js.t]
{% <p>right offset</p> %}
}
{- bottom: [Js.number Js.t]
{% <p>bottom offset</p> %}
}
{- left: [Js.numbe... | * This class represents a rectangular region in X , Y ...
{ % < p > This class represents a rectangular region in X , Y space , and performs geometric
transformations or tests upon the region.</p >
< p > This class may be used to compare the document regions occupied by elements.</p > % }
{% <p>Thi... |
c979e57d175be2d9195324f33f55934b7880a625f7665fbcdc1a373aa4d7200e | jimweirich/sicp-study | ex1_11_test.scm | SICP 1.11 tests
(test-case "Ex 1.11 Recursive Process"
(assert-equal 1 (f1 1))
(assert-equal 2 (f1 2))
(assert-equal 4 (f1 3))
(assert-equal 11 (f1 4))
(assert-equal 25 (f1 5))
(assert-equal 59 (f1 6)))
(test-case "Ex 1.11 Iterative Process"
... | null | https://raw.githubusercontent.com/jimweirich/sicp-study/bc5190e04ed6ae321107ed6149241f26efc1b8c8/scheme/chapter1/ex1_11_test.scm | scheme | SICP 1.11 tests
(test-case "Ex 1.11 Recursive Process"
(assert-equal 1 (f1 1))
(assert-equal 2 (f1 2))
(assert-equal 4 (f1 3))
(assert-equal 11 (f1 4))
(assert-equal 25 (f1 5))
(assert-equal 59 (f1 6)))
(test-case "Ex 1.11 Iterative Process"
... | |
1f029b84ec9b7699f33bccc1fc49cbbfe9fe5e6d00b1fed3517bb66695b6471f | mzp/bs-lwt | lwt_pool.mli | Lwt
*
* Copyright ( C ) 2008
* 2012
* Laboratoire PPS - CNRS Université Paris Diderot
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , wit... | null | https://raw.githubusercontent.com/mzp/bs-lwt/f37a3c47d038f4efcd65912c41fab95d1e6633ce/lwt/src/core/lwt_pool.mli | ocaml | * External resource pools.
* For example, instead of creating a new database connection each time you
need one, keep a pool of opened connections and reuse ones that are free.
The pool also provides a limit on the number of connections that can
simultaneously be open.
Note that pools are not for keepi... | Lwt
*
* Copyright ( C ) 2008
* 2012
* Laboratoire PPS - CNRS Université Paris Diderot
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published by
* the Free Software Foundation , wit... |
b84fc073aaa1288c95b050ee4a9d920a5590d0e3c012bb2108ccc492a67385f3 | cxxxr/cl-source-map | util.lisp | (defpackage :cl-source-map/util
(:use :cl)
(:export :missing
:when-let
:make-tlist
:tlist-left
:tlist-right
:tlist-empty-p
:tlist-add-left
:tlist-add-right
:tlist-rem-left
:tlist-update
:tlist-to-list
... | null | https://raw.githubusercontent.com/cxxxr/cl-source-map/1193fcc7c7bd1ce60a7aaa50e380f766f1ec774c/util.lisp | lisp | (defpackage :cl-source-map/util
(:use :cl)
(:export :missing
:when-let
:make-tlist
:tlist-left
:tlist-right
:tlist-empty-p
:tlist-add-left
:tlist-add-right
:tlist-rem-left
:tlist-update
:tlist-to-list
... | |
94e3cc19d9e7f5c506cfcf278956baac79a9297989aa2ce887099c121c5d1626 | parapluu/Concuerror | diff_dep_1.erl | -module(diff_dep_1).
-export([diff_dep_1/0]).
-export([scenarios/0]).
scenarios() -> [{?MODULE, inf, dpor}].
diff_dep_1() ->
ets:new(table, [public, named_table]),
ets:insert(table, {x, 0}),
ets:insert(table, {y, 0}),
ets:insert(table, {z, 0}),
spawn(fun() -> ets:insert(table, {x, 1}) end),
s... | null | https://raw.githubusercontent.com/parapluu/Concuerror/152a5ccee0b6e97d8c3329c2167166435329d261/tests/suites/dpor_tests/src/diff_dep_1.erl | erlang | -module(diff_dep_1).
-export([diff_dep_1/0]).
-export([scenarios/0]).
scenarios() -> [{?MODULE, inf, dpor}].
diff_dep_1() ->
ets:new(table, [public, named_table]),
ets:insert(table, {x, 0}),
ets:insert(table, {y, 0}),
ets:insert(table, {z, 0}),
spawn(fun() -> ets:insert(table, {x, 1}) end),
s... | |
acf13beafcd5ea2576a0f1d238770c27a67a421ef3710b1ecde64a58915eb560 | qfpl/leaderboard | Player.hs | {-# LANGUAGE DataKinds #-}
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
{-# LANGUAGE TypeOperators #-}
module Leaderboard.API.Player where
import Control.Monad ((<=<))
impor... | null | https://raw.githubusercontent.com/qfpl/leaderboard/2ada34ec31b197e44a9d17153b9397cdc3c83038/src/Leaderboard/API/Player.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators # | # LANGUAGE MultiParamTypeClasses #
# LANGUAGE OverloadedStrings #
# LANGUAGE RecordWildCards #
module Leaderboard.API.Player where
import Control.Monad ((<=<))
import Control.Monad.Except (MonadError, throwError)
import Control.Monad.IO.Class (liftIO... |
2479b3cef2dc84515875c10c6e85ce4ea6a1713e360e46b952b1084eb5945e2e | atgreen/lisp-openshift | sha256.lisp | sha256.lisp -- implementation of SHA-2/256 from NIST
(in-package :crypto)
(define-digest-registers (sha224 :endian :big :digest-registers 7)
(a #xc1059ed8)
(b #x367cd507)
(c #x3070dd17)
(d #xf70e5939)
(e #xffc00b31)
(f #x68581511)
(g #x64f98fa7)
(h #xbefa4fa4))
(defconst +pristine-sha224-registers+... | null | https://raw.githubusercontent.com/atgreen/lisp-openshift/40235286bd3c6a61cab9f5af883d9ed9befba849/quicklisp/dists/quicklisp/software/ironclad_0.30/src/digests/sha256.lisp | lisp | mid-level
No slots.
copy the data to BLOCK prematurely
fill in the remaining block data | sha256.lisp -- implementation of SHA-2/256 from NIST
(in-package :crypto)
(define-digest-registers (sha224 :endian :big :digest-registers 7)
(a #xc1059ed8)
(b #x367cd507)
(c #x3070dd17)
(d #xf70e5939)
(e #xffc00b31)
(f #x68581511)
(g #x64f98fa7)
(h #xbefa4fa4))
(defconst +pristine-sha224-registers+... |
3449ce675042f789e5762f7ad6df88e8313397a317b28fc42650c42b7571ac22 | yangyang5214/asciicast2mp4 | asciicast_test.cljs | (ns asciinema.player.asciicast-test
(:require-macros [cljs.test :refer (is deftest testing)])
(:require [cljs.test]
[asciinema.player.asciicast :as a]))
(deftest load-test
(testing "pre-rendered, vec"
(let [asciicast [[1.0 {:lines {:0 [["foo" {}] ["bar" {}]] :1 [["foobar" {}]]}}]
... | null | https://raw.githubusercontent.com/yangyang5214/asciicast2mp4/5404a53ae331d44abfada6002b9affac76073418/asciinema-player/test/asciinema/player/asciicast_test.cljs | clojure | (ns asciinema.player.asciicast-test
(:require-macros [cljs.test :refer (is deftest testing)])
(:require [cljs.test]
[asciinema.player.asciicast :as a]))
(deftest load-test
(testing "pre-rendered, vec"
(let [asciicast [[1.0 {:lines {:0 [["foo" {}] ["bar" {}]] :1 [["foobar" {}]]}}]
... | |
37b70a5535a61f594655f1b09f55bd73a53063f4421040777343fd9f707ffd21 | YoshikuniJujo/test_haskell | try-layout-indent.hs | # OPTIONS_GHC -Wall -fno - warn - tabs #
module Main where
import Graphics.Cairo.Drawing.CairoT
import Graphics.Cairo.Drawing.Paths
import Graphics.Cairo.Surfaces.ImageSurfaces
import Graphics.Cairo.Values
import Data.ImageData.Text
import Trial.TryPango
import Trial.MakePng
main :: IO ()
main = do
sr <- cairoImag... | null | https://raw.githubusercontent.com/YoshikuniJujo/test_haskell/1e8d50e552033d1bac6d09f08168148a4560c05b/themes/gui/cairo/try-image-data/app/try-layout-indent.hs | haskell | # OPTIONS_GHC -Wall -fno - warn - tabs #
module Main where
import Graphics.Cairo.Drawing.CairoT
import Graphics.Cairo.Drawing.Paths
import Graphics.Cairo.Surfaces.ImageSurfaces
import Graphics.Cairo.Values
import Data.ImageData.Text
import Trial.TryPango
import Trial.MakePng
main :: IO ()
main = do
sr <- cairoImag... | |
c8c0efacebb68cc4a3cbe59211866e4ab70f31576943da2a6763caaf31c502bf | kupl/FixML | sub3.ml | type formula =
| True
| False
| Not of formula
| AndAlso of formula * formula
| OrElse of formula * formula
| Imply of formula * formula
| Equal of exp * exp
and exp =
| Num of int
| Plus of exp * exp
| Minus of exp * exp;;
let rec eval_exp : exp -> int
= fun e ->
match e with
| Num(num) -> num... | null | https://raw.githubusercontent.com/kupl/FixML/0a032a733d68cd8ccc8b1034d2908cd43b241fce/benchmarks/formula/formula1/submissions/sub3.ml | ocaml | type formula =
| True
| False
| Not of formula
| AndAlso of formula * formula
| OrElse of formula * formula
| Imply of formula * formula
| Equal of exp * exp
and exp =
| Num of int
| Plus of exp * exp
| Minus of exp * exp;;
let rec eval_exp : exp -> int
= fun e ->
match e with
| Num(num) -> num... | |
996b8565a5e4c944c3c0df91ca76ff940f2a405137c1103aab556a868138dcaa | stepcut/plugins | Consts.hs | # LANGUAGE CPP #
--
Copyright ( C ) 2004
--
-- This library is free software; you can redistribute it and/or
-- modify it under the terms of the GNU Lesser General Public
License as published by the Free Software Foundation ; either
version 2.1 of the License , or ( at your option ) any later version .
--
-- ... | null | https://raw.githubusercontent.com/stepcut/plugins/52c660b5bc71182627d14c1d333d0234050cac01/src/System/Plugins/Consts.hs | haskell |
This library is free software; you can redistribute it and/or
modify it under the terms of the GNU Lesser General Public
This library is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GN... | # LANGUAGE CPP #
Copyright ( C ) 2004
License as published by the Free Software Foundation ; either
version 2.1 of the License , or ( at your option ) any later version .
You should have received a copy of the GNU Lesser General Public
Foundation , Inc. , 59 Temple Place , Suite 330 , Boston , MA 02111 ... |
d6357fc2223e9e36f7ae6e31d9f8eaa967e530a24ab74c187dc101ae175e41b7 | cram2/cram | polynomial.lisp | Regression test POLYNOMIAL for GSLL , automatically generated
;;
Copyright 2009 , 2014
Distributed under the terms of the GNU General Public License
;;
;; This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Softw... | null | https://raw.githubusercontent.com/cram2/cram/dcb73031ee944d04215bbff9e98b9e8c210ef6c5/cram_3rdparty/gsll/src/tests/polynomial.lisp | lisp |
This program is free software: you can redistribute it and/or modify
(at your option) any later version.
This program 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 Publi... | Regression test POLYNOMIAL for GSLL , automatically generated
Copyright 2009 , 2014
Distributed under the terms of the GNU General Public License
it 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 receiv... |
daf24b8f6be1d2d839dfc9c29a50d78e7257f8d71177eed87bc452d36130d7c6 | furkan3ayraktar/clojure-polylith-realworld-example-app | store.clj | (ns clojure.realworld.profile.store
(:require [clojure.java.jdbc :as jdbc]
[clojure.realworld.database.interface :as database]
[honey.sql :as sql]))
(defn following? [user-id followed-user-id]
(let [query {:select [:*]
:from [:userFollows]
:where [:and [:= :... | null | https://raw.githubusercontent.com/furkan3ayraktar/clojure-polylith-realworld-example-app/7703ee7af93887ea600d1c05e400255303a6ed47/components/profile/src/clojure/realworld/profile/store.clj | clojure | (ns clojure.realworld.profile.store
(:require [clojure.java.jdbc :as jdbc]
[clojure.realworld.database.interface :as database]
[honey.sql :as sql]))
(defn following? [user-id followed-user-id]
(let [query {:select [:*]
:from [:userFollows]
:where [:and [:= :... | |
5d386f2017a16dc8233f541e3de27f8d2dc66f7df364e8e9816bbae445960303 | nasa/Common-Metadata-Repository | user.clj | (ns user
"A dev namespace that supports Proto-REPL.
It seems that Proto-REPL doesn't support the flexible approach that lein
uses: any configurable ns can be the starting ns for a REPL. As such, this
minimal ns was created for Proto-REPL users, so they too can have an env
that supports startup and shutdown."... | null | https://raw.githubusercontent.com/nasa/Common-Metadata-Repository/63001cf021d32d61030b1dcadd8b253e4a221662/other/cmr-exchange/exchange-geo/dev-resources/src/user.clj | clojure | (ns user
"A dev namespace that supports Proto-REPL.
It seems that Proto-REPL doesn't support the flexible approach that lein
uses: any configurable ns can be the starting ns for a REPL. As such, this
minimal ns was created for Proto-REPL users, so they too can have an env
that supports startup and shutdown."... | |
fe21e7e6c3f690e8be0905274d40f2152bb1dfb8e1e02606ebf88e51b9ab41fc | skyzh/mips-simulator | CPU.hs | module CPU
( cycles
, boot
)
where
import Data.Word ( Word16
, Word32
)
import Data.Vector ( (//) )
import Debug.Trace
import Data.Bits
i... | null | https://raw.githubusercontent.com/skyzh/mips-simulator/61a319ab776fa30831e75aab906c6ef22bb7755e/src/CPU.hs | haskell | initial register set
debug current cycle information
run n cycles
STAGE: Instruction Fetch
STAGE: Decode
STAGE: Execute
REQUIRE: alu_op, alu_src1, alu_src2, opcode, pc, alu_branch_mask
STAGE: Memory
STAGE: Write Back
REQUIRE: mem_out, alu_out, opcode, pc
STEP: update register value
(even if I do... | module CPU
( cycles
, boot
)
where
import Data.Word ( Word16
, Word32
)
import Data.Vector ( (//) )
import Debug.Trace
import Data.Bits
i... |
56ce7006e2a2505543d3e3b19aa1808b7bcb616ac6db02a7dce92ac0fb58e28a | fused-effects/diffused-effects | Labelled.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE ConstraintKinds #-}
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGU... | null | https://raw.githubusercontent.com/fused-effects/diffused-effects/83e070da3232d9a909e06d775f3f245eabb70a84/src/Effect/Labelled.hs | haskell | # LANGUAGE ConstraintKinds #
# OVERLAPPABLE #
# OVERLAPPABLE #
# OVERLAPPABLE # | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE FlexibleContexts #
# LANGUAGE FlexibleInstances #
# LANGUAGE FunctionalDependencies #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PolyKinds #
# LANGUAGE ScopedTypeVariables #
# LANGUAGE TypeApplications #
# LANGUAGE TypeFamilies #
# LANGUAGE Typ... |
5e926ad2ca4296a127d274f2a6487bda7d220b2a23bd2981c57603d94ca36fc1 | monadbobo/ocaml-core | float.mli | include Float_intf.S with type t = float
| null | https://raw.githubusercontent.com/monadbobo/ocaml-core/9c1c06e7a1af7e15b6019a325d7dbdbd4cdb4020/base/core/lib/float.mli | ocaml | include Float_intf.S with type t = float
| |
61d01b5d916db026ce492f89d3bf660e06fc2ce53cea1812013686ce72ba4d0d | pflanze/chj-schemelib | cj-sxml.scm | Copyright 2006 - 2018 by < >
;;; This file is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
;;; (at your option) any later version.
(require (sr... | null | https://raw.githubusercontent.com/pflanze/chj-schemelib/59ff8476e39f207c2f1d807cfc9670581c8cedd3/cj-sxml.scm | scheme | This file is free software; you can redistribute it and/or modify
(at your option) any later version.
depreciate?
on request
?
Is it really a good idea to overload it for @ like this?
Should we provide a symbol predicate that checks for it being a
valid XML name, and/or not being @? XX
?
(boolean? v) hmm?... | Copyright 2006 - 2018 by < >
it under the terms of the GNU General Public License ( GPL ) as published
by the Free Software Foundation , either version 2 of the License , or
(require (srfi-1 append! fold-right)
(stream stream-map stream-filter)
Maybe
(stream-Maybe stream-mapfilter
strea... |
e48f3f50fe5897c0ec8e53038ef50d7827cbb650477b06181e996d45f442cd54 | vimus/vimus | Option.hs | module Option (getOptions) where
import Paths_vimus (version)
import Data.Version (showVersion)
import Data.Maybe
import Data.List
import Control.Monad
import Text.Printf (printf)
import System.Environment (getArgs, getProgName)
import Sy... | null | https://raw.githubusercontent.com/vimus/vimus/26a164fb50870f8112ca4b6c30820431c015916f/src/Option.hs | haskell | module Option (getOptions) where
import Paths_vimus (version)
import Data.Version (showVersion)
import Data.Maybe
import Data.List
import Control.Monad
import Text.Printf (printf)
import System.Environment (getArgs, getProgName)
import Sy... | |
6394be3a13fa9bbda07e295474f39cdf5e34102f18adea0f5bebf2cfd22af0e6 | theodormoroianu/SecondYearCourses | mMaybe.hs | Maybe este definita in
instance Maybe where
return = Just
Just va > > = k = k va
Nothing > > = _ = Nothing
instance Applicative Maybe where
pure = return
mf < * > ma = do
f < - mf
va < - ma
return ( f va )
instance Functor Maybe where
f... | null | https://raw.githubusercontent.com/theodormoroianu/SecondYearCourses/5e359e6a7cf588a527d27209bf53b4ce6b8d5e83/FLP/Laboratoare/Lab%203/mMaybe.hs | haskell | Maybe este definita in
instance Maybe where
return = Just
Just va > > = k = k va
Nothing > > = _ = Nothing
instance Applicative Maybe where
pure = return
mf < * > ma = do
f < - mf
va < - ma
return ( f va )
instance Functor Maybe where
f... | |
267ff7fd4ae3f9107f1c01cc8c4b2dd136bce1adae212cd9a2be61feb1172ba9 | yomimono/stitchcraft | types.ml | type borders = {
max_x : float;
max_y : float;
min_x : float;
min_y : float;
}
type doc = {
symbols : Stitchy.Symbol.t Stitchy.Types.SymbolMap.t;
pixel_size : int;
paper_size : Pdfpaper.t;
fat_line_interval : int;
}
type page = {
x_range : int * int;
y_range : int * int;
page_number : int;
}
ty... | null | https://raw.githubusercontent.com/yomimono/stitchcraft/0fc4a741bc00567327378a9322a228741fd2fd6a/pattern/lib/types.ml | ocaml | type borders = {
max_x : float;
max_y : float;
min_x : float;
min_y : float;
}
type doc = {
symbols : Stitchy.Symbol.t Stitchy.Types.SymbolMap.t;
pixel_size : int;
paper_size : Pdfpaper.t;
fat_line_interval : int;
}
type page = {
x_range : int * int;
y_range : int * int;
page_number : int;
}
ty... | |
d3bf392d11bf8e1e955f2b5f6d64e393134b78d375d61b28de58ea025b222d54 | vernemq/vernemq_dev | on_deliver_hook.erl | %% @hidden
-module(on_deliver_hook).
-include("vernemq_dev.hrl").
-callback on_deliver(UserName :: username(),
SubscriberId :: subscriber_id(),
QoS :: qos(),
Topic :: topic(),
Payload :: payload(),
... | null | https://raw.githubusercontent.com/vernemq/vernemq_dev/6d622aa8c901ae7777433aef2bd049e380c474a6/src/on_deliver_hook.erl | erlang | @hidden
Rewrite the topic of the message.
Rewrite the payload of the message.
Rewrite the QoS of the message.
Rewrite the retain flag of the message. | -module(on_deliver_hook).
-include("vernemq_dev.hrl").
-callback on_deliver(UserName :: username(),
SubscriberId :: subscriber_id(),
QoS :: qos(),
Topic :: topic(),
Payload :: payload(),
... |
5c17fd4911fb2e7b15e80185adc1a8f3179b9b37f7b4b4caa27a36fd0349b7d6 | cbd/edis | erldis_zsets_bench.erl | %%%-------------------------------------------------------------------
@author < >
@author < >
( C ) 2011 InakaLabs SRL
%%% @doc Benchmarks for zsets commands using erldis
%%% @end
%%%-------------------------------------------------------------------
-module(erldis_zsets_bench).
-author('Fernando Benavide... | null | https://raw.githubusercontent.com/cbd/edis/aad89352f25a7f3737242ddc9bc913def75a517a/test/benchmarks/erldis_zsets_bench.erl | erlang | -------------------------------------------------------------------
@doc Benchmarks for zsets commands using erldis
@end
-------------------------------------------------------------------
====================================================================
External functions
======================================... | @author < >
@author < >
( C ) 2011 InakaLabs SRL
-module(erldis_zsets_bench).
-author('Fernando Benavides <>').
-author('Chad DePue <>').
-behaviour(edis_bench).
-define(KEY, <<"test-zset">>).
-define(KEY2, <<"test-zset2">>).
-include("edis.hrl").
-include("edis_bench.hrl").
-export([bench/1, bench/2, ... |
744f15affd8b6e31d244c09978a40e5274ff3db21648aab33492668b6f6aa763 | icfpcontest2021/icfpcontest2021.github.io | Prosecutor.hs | module Main where
import qualified BrainWall.Main.Prosecutor
main :: IO ()
main = BrainWall.Main.Prosecutor.main
| null | https://raw.githubusercontent.com/icfpcontest2021/icfpcontest2021.github.io/fb23fea2a8ecec7740017d3dda78d921c1df5a26/toolchain/src/Prosecutor.hs | haskell | module Main where
import qualified BrainWall.Main.Prosecutor
main :: IO ()
main = BrainWall.Main.Prosecutor.main
| |
d5c3a6dad5327b3d4d545bf6070508846f796e46720f9c5b0609f88c097ce0a6 | davebryson/beepbeep | erlydtl_runtime.erl | -module(erlydtl_runtime).
-compile(export_all).
find_value(Key, L) when is_list(L) ->
proplists:get_value(Key, L);
find_value(Key, {GBSize, GBData}) when is_integer(GBSize) ->
case gb_trees:lookup(Key, {GBSize, GBData}) of
{value, Val} ->
Val;
_ ->
undefined
end;
fi... | null | https://raw.githubusercontent.com/davebryson/beepbeep/62db46d268c6cb6ad86345562b3c77f8ff070b27/deps/erlydtl/src/erlydtl_runtime.erl | erlang | -module(erlydtl_runtime).
-compile(export_all).
find_value(Key, L) when is_list(L) ->
proplists:get_value(Key, L);
find_value(Key, {GBSize, GBData}) when is_integer(GBSize) ->
case gb_trees:lookup(Key, {GBSize, GBData}) of
{value, Val} ->
Val;
_ ->
undefined
end;
fi... | |
15acf2fd0f2a4cfe5672169ebe63d956f558faa3ae855508feeb51bf287ea216 | uncomplicate/bayadera | extensions_cuda_test.clj | Copyright ( c ) . All rights reserved .
;; The use and distribution terms for this software are covered by the
;; Eclipse Public License 1.0 (-1.0.php) or later
;; which can be found in the file LICENSE at the root of this distribution.
;; By using this software in any fashion, you are agreeing to be boun... | null | https://raw.githubusercontent.com/uncomplicate/bayadera/4105fd0e02bbe1cb19b9413f454075d61def6945/test/clojure/uncomplicate/bayadera/internal/extensions_cuda_test.clj | clojure | The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 (-1.0.php) or later
which can be found in the file LICENSE at the root of this distribution.
By using this software in any fashion, you are agreeing to be bound by
the terms of this license.
You must not rem... | Copyright ( c ) . All rights reserved .
(ns uncomplicate.bayadera.internal.extensions-cuda-test
(:require [midje.sweet :refer :all]
[uncomplicate.clojurecuda.core :refer [with-default default-stream]]
[uncomplicate.neanderthal.cuda
:refer [with-engine cuda-float cuda-double... |
3d5a3984dbf4e22179a6cddd1bcd56192d73fe787f06d8fc652c94127e35bf87 | kupl/FixML | sub33.ml |
type exp =
| V of var
| P of var * exp
| C of exp * exp
and var = string
let listP = [""]
let rec check : exp -> bool
= fun exp ->
match exp with
| V x -> List.mem x listP
| P (x, e1) -> let listP = listP @ [x] in check e1
| C (e1, e2) -> check e1 && check e2
| null | https://raw.githubusercontent.com/kupl/FixML/0a032a733d68cd8ccc8b1034d2908cd43b241fce/benchmarks/wellformedness/wellformedness/submissions/sub33.ml | ocaml |
type exp =
| V of var
| P of var * exp
| C of exp * exp
and var = string
let listP = [""]
let rec check : exp -> bool
= fun exp ->
match exp with
| V x -> List.mem x listP
| P (x, e1) -> let listP = listP @ [x] in check e1
| C (e1, e2) -> check e1 && check e2
| |
09011e4d49939ba9931ec755b2ee6c0ea2a0a52c882543f4b9edf661b627df23 | cedlemo/OCaml-GI-ctypes-bindings-generator | Entry_icon_position.ml | open Ctypes
open Foreign
type t = Primary | Secondary
let of_value v =
if v = Unsigned.UInt32.of_int 0 then Primary
else if v = Unsigned.UInt32.of_int 1 then Secondary
else raise (Invalid_argument "Unexpected Entry_icon_position value")
let to_value = function
| Primary -> Unsigned.UInt32.of_int 0
| Second... | null | https://raw.githubusercontent.com/cedlemo/OCaml-GI-ctypes-bindings-generator/21a4d449f9dbd6785131979b91aa76877bad2615/tools/Gtk3/Entry_icon_position.ml | ocaml | open Ctypes
open Foreign
type t = Primary | Secondary
let of_value v =
if v = Unsigned.UInt32.of_int 0 then Primary
else if v = Unsigned.UInt32.of_int 1 then Secondary
else raise (Invalid_argument "Unexpected Entry_icon_position value")
let to_value = function
| Primary -> Unsigned.UInt32.of_int 0
| Second... | |
acddf5537dc1c210f8202fca46ae45f247e9d43fb709aa10942742a1f6913db4 | McParen/croatoan | touch.lisp | (in-package :de.anvi.croatoan)
(defgeneric touch (win)
(:documentation
"Touching a window marks all its cells as changed.
This makes the next call to refresh rewrite whe whole window instead
of only the cells that have actually been changed.
The combination of touch and refresh is required to raise overlapping
... | null | https://raw.githubusercontent.com/McParen/croatoan/413e8855b78a2e408f90efc38e8485f880691684/src/touch.lisp | lisp | (in-package :de.anvi.croatoan)
(defgeneric touch (win)
(:documentation
"Touching a window marks all its cells as changed.
This makes the next call to refresh rewrite whe whole window instead
of only the cells that have actually been changed.
The combination of touch and refresh is required to raise overlapping
... | |
d6885ff5ad3f4dd29a08a91fe4092a1f659a54064d8d21abc6b44a87d2dcef8b | dyzsr/ocaml-selectml | printast.ml | (**************************************************************************)
(* *)
(* OCaml *)
(* *)
... | null | https://raw.githubusercontent.com/dyzsr/ocaml-selectml/42cccb99506f8f33dac87d3bdb65391269b31d05/parsing/printast.ml | ocaml | ************************************************************************
OCaml
... | , projet Para , INRIA Rocquencourt
Copyright 1999 Institut National de Recherche en Informatique et
the GNU Lesser General Public License version 2.1 , with the
open Asttypes;;
open Format;;
open Lexing;;
open Location;;
open Parsetree;;
let fmt_position with_name f ... |
e48ce6011968423747b96b3a6f6c5f10ef2173371a663836c6afcc2c808c254a | NorfairKing/smos | Activation.hs | # LANGUAGE RecordWildCards #
# OPTIONS_GHC -fno - warn - unused - pattern - binds #
module Smos.Activation
( currentKeyMappings,
findActivations,
Activation (..),
)
where
import Cursor.DirForest
import Data.Ord as Ord
import qualified Data.Sequence as Seq
import qualified Graphics.Vty as Vty
import Import... | null | https://raw.githubusercontent.com/NorfairKing/smos/82707699b446bc431f5233e5dc18c7ec3dd679fd/smos/src/Smos/Activation.hs | haskell | Note that the ordering matters so we need to put the anys at the end.
History
Match | # LANGUAGE RecordWildCards #
# OPTIONS_GHC -fno - warn - unused - pattern - binds #
module Smos.Activation
( currentKeyMappings,
findActivations,
Activation (..),
)
where
import Cursor.DirForest
import Data.Ord as Ord
import qualified Data.Sequence as Seq
import qualified Graphics.Vty as Vty
import Import... |
30304c3a65f8438ac272cce3c7385196916b9d12d5e7f1dfeeeeb58e8643bfa7 | Verites/verigraph | Prettyprint.hs | {-# LANGUAGE OverloadedStrings #-}
| Basic building blocks for writing graphs with the Dot syntax .
This contains only the basic building blocks of to Dot syntax ,
and it does _ _ not _ _ provide conventions to print particular
kinds of graphs .
This module is intended to be imported qualified , e.g.
>... | null | https://raw.githubusercontent.com/Verites/verigraph/754ec08bf4a55ea7402d8cd0705e58b1d2c9cd67/src/library/Image/Dot/Prettyprint.hs | haskell | # LANGUAGE OverloadedStrings #
| Pretty prints a (undirected) graph with the given name and list of statements.
| Pretty prints a directed graph with the given name and list of statements.
| Pretty prints a subgraph with the given name and list of statements.
| Pretty prints an anonymous subgraph with the given lis... | | Basic building blocks for writing graphs with the Dot syntax .
This contains only the basic building blocks of to Dot syntax ,
and it does _ _ not _ _ provide conventions to print particular
kinds of graphs .
This module is intended to be imported qualified , e.g.
> import qualified Data . Map as M... |
2646b56ddcde6ae162b03b33e68ad41d3dd1bdf9a1a668d36fabf5ed31086407 | crategus/cl-cffi-gtk | gtk.cell-layout.lisp | ;;; ----------------------------------------------------------------------------
;;; gtk.cell-layout.lisp
;;;
The documentation of this file is taken from the GTK+ 3 Reference Manual
Version 3.24 and modified to document the Lisp binding to the GTK+ library .
;;; See <>. The API documentation of the Lisp binding is... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/ba198f7d29cb06de1e8965e1b8a78522d5430516/gtk/gtk.cell-layout.lisp | lisp | ----------------------------------------------------------------------------
gtk.cell-layout.lisp
See <>. The API documentation of the Lisp binding is
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU Lesser General Public License for Lisp
License, or (at your o... | The documentation of this file is taken from the GTK+ 3 Reference Manual
Version 3.24 and modified to document the Lisp binding to the GTK+ library .
available from < -cffi-gtk/ > .
Copyright ( C ) 2009 - 2011
Copyright ( C ) 2011 - 2021
as published by the Free Software Foundation , either version 3 of... |
bbbe838b6f77d031866bd960efbca8e776d68f199340ab494cf3f443a8390753 | Elzair/nazghul | ability.scm | ;;----------------------------------------------------------------------------
;; Ability "class"
;;----------------------------------------------------------------------------
(define (mk-ability name level mana ap proc rng)
(list name level mana ap proc rng))
(define (ability-name ability) (car ability))
(define (... | null | https://raw.githubusercontent.com/Elzair/nazghul/8f3a45ed6289cd9f469c4ff618d39366f2fbc1d8/worlds/template/lib/ability.scm | scheme | ----------------------------------------------------------------------------
Ability "class"
----------------------------------------------------------------------------
(println " can-use-ability?" display ability)
(println "use-ability:" ability)
----------------------------------------------------------------------... | (define (mk-ability name level mana ap proc rng)
(list name level mana ap proc rng))
(define (ability-name ability) (car ability))
(define (ability-level-required ability) (cadr ability))
(define (ability-mana-cost ability) (caddr ability))
(define (ability-ap-cost ability) (cadddr ability))
(define (ability-proc ab... |
43a648dea4a421fefc617c2aa1818eac8e08119a8d29f508797098c4d43eb9db | v-kolesnikov/sicp | 1_21_test.clj | (ns sicp.chapter01.1-21-test
(:require [clojure.test :refer :all]
[sicp.test-helper :refer :all]
[sicp.chapter01.1-21 :refer :all]))
(deftest test-smallest-divisor
(assert-equal 199 (smallest-divisor 199))
(assert-equal 1999 (smallest-divisor 1999))
(assert-equal 7 (smallest-divisor 199... | null | https://raw.githubusercontent.com/v-kolesnikov/sicp/4298de6083440a75898e97aad658025a8cecb631/test/sicp/chapter01/1_21_test.clj | clojure | (ns sicp.chapter01.1-21-test
(:require [clojure.test :refer :all]
[sicp.test-helper :refer :all]
[sicp.chapter01.1-21 :refer :all]))
(deftest test-smallest-divisor
(assert-equal 199 (smallest-divisor 199))
(assert-equal 1999 (smallest-divisor 1999))
(assert-equal 7 (smallest-divisor 199... | |
32a91cf9384555f3396321f81964273ff2c7e97ee959ae22e5c8d5709be9f09a | kappamodeler/kappa | story_compressor.ml | open Error
open Network
open Mods2
let trace = Data.show_steps_in_compression (*true for dumping compression log*)
let trace_print s =
if !trace then
begin
print_string s;
print_newline ()
end
let opt_extract f =
match f with
Some a -> a
| None -> Error.runtime (None,None,None)... | null | https://raw.githubusercontent.com/kappamodeler/kappa/de63d1857898b1fc3b7f112f1027768b851ce14d/simplx_rep/src/stories/story_compressor.ml | ocaml | true for dumping compression log
port -> eid -> shorteid
or (try network_after_short configuration event_after wire = state with Not_found -> false)
tail recursive
tail recursive
let _ =
if !trace then
let _ =
print_string "AGENT_TO_WIRE\n" in
let _ =
StringMap.iter
(fun i x -> print_string i;
In... | open Error
open Network
open Mods2
let trace_print s =
if !trace then
begin
print_string s;
print_newline ()
end
let opt_extract f =
match f with
Some a -> a
| None -> Error.runtime (None,None,None) "Story_compression.opt_extract: option doesn't have a Some argument"
type porti... |
f5380d0a552be1027e6a1942b2a513393d25350af5a5668fb391e851f327e620 | borodust/alien-works | material.lisp | (cl:in-package :alien-works.physics.physx)
(defun make-material (physics)
(%physx:physx+create-material '(:pointer %physx:physx+px-physics) physics
'%physx:physx+px-real 0.5f0
'%physx:physx+px-real 0.5f0
'%physx:physx+px... | null | https://raw.githubusercontent.com/borodust/alien-works/b849b739b7f5556900005a2aa6d8a2ea220cf3a6/src/physics/physx/material.lisp | lisp | (cl:in-package :alien-works.physics.physx)
(defun make-material (physics)
(%physx:physx+create-material '(:pointer %physx:physx+px-physics) physics
'%physx:physx+px-real 0.5f0
'%physx:physx+px-real 0.5f0
'%physx:physx+px... | |
d22f65fcf79ef19bee4b6f5909381c303d8a70ea582d78a4179b7cb1497eff7b | pbrisbin/tee-io | CommandSpec.hs | module Handler.CommandSpec
( main
, spec
) where
import SpecHelper
import Data.UUID (fromText)
data Response = Response Token
instance FromJSON Response where
parseJSON = withObject "Response" $ \o -> Response
<$> (parseToken =<< o .: "token")
where
parseToken = maybe mzero (re... | null | https://raw.githubusercontent.com/pbrisbin/tee-io/26f4643a7f44fafb9bf92f1c1f82a60309dc8b66/test/Handler/CommandSpec.hs | haskell | module Handler.CommandSpec
( main
, spec
) where
import SpecHelper
import Data.UUID (fromText)
data Response = Response Token
instance FromJSON Response where
parseJSON = withObject "Response" $ \o -> Response
<$> (parseToken =<< o .: "token")
where
parseToken = maybe mzero (re... | |
021bcb0c09051bade61644847d5af8417c9f0598ada7b8770a234ba652fdbc59 | deadpendency/deadpendency | Internal.hs | module DD.Effect.DetermineDependencies.Backend.LanguageFiles.Internal
( uniqueByName,
anyContainMatchingName,
isNotMatchedDep,
dependencyIdentifierToName,
dependencyIdentifierToQualifiedRepo,
)
where
import Common.Model.Dependency.Basic.BasicDependency
import Common.Model.Dependency.DependencyIdent... | null | https://raw.githubusercontent.com/deadpendency/deadpendency/170d6689658f81842168b90aa3d9e235d416c8bd/apps/dependency-determiner/src/DD/Effect/DetermineDependencies/Backend/LanguageFiles/Internal.hs | haskell | module DD.Effect.DetermineDependencies.Backend.LanguageFiles.Internal
( uniqueByName,
anyContainMatchingName,
isNotMatchedDep,
dependencyIdentifierToName,
dependencyIdentifierToQualifiedRepo,
)
where
import Common.Model.Dependency.Basic.BasicDependency
import Common.Model.Dependency.DependencyIdent... | |
bcc0f29463e61678ae82695ec022dbba1b63226786db0e71861e77ae58ea5906 | justinj/string-matching-visualization | brute_force_spec.cljs | (ns strmatch.brute-force-spec
(:require-macros [specljs.core :refer [describe it should=]])
(:require [specljs.core])
(:use [strmatch.logic.brute-force :only (match)]))
(describe "the naive matcher"
(it "checks against each alignment"
(should=
[0 1 2 3]
(ma... | null | https://raw.githubusercontent.com/justinj/string-matching-visualization/9aee3139d087860f4235b78b9a5dfc71df7a4e67/spec/cljs/strmatch/brute_force_spec.cljs | clojure | (ns strmatch.brute-force-spec
(:require-macros [specljs.core :refer [describe it should=]])
(:require [specljs.core])
(:use [strmatch.logic.brute-force :only (match)]))
(describe "the naive matcher"
(it "checks against each alignment"
(should=
[0 1 2 3]
(ma... | |
4cbc81c7ea9ded622aae9c991678569b5ba60cb3ee341bf11ed7788cb5bd4f30 | wireapp/wire-server | LastPrekey_user.hs | -- This file is part of the Wire Server implementation.
--
Copyright ( C ) 2022 Wire Swiss GmbH < >
--
-- This program is free software: you can redistribute it and/or modify it under
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License... | null | https://raw.githubusercontent.com/wireapp/wire-server/c428355b7683b7b7722ea544eba314fc843ad8fa/libs/wire-api/test/golden/Test/Wire/API/Golden/Generated/LastPrekey_user.hs | haskell | This file is part of the Wire Server implementation.
This program is free software: you can redistribute it and/or modify it under
later version.
This program 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 PARTI... | Copyright ( C ) 2022 Wire Swiss GmbH < >
the terms of the GNU Affero General Public License as published by the Free
Software Foundation , either version 3 of the License , or ( at your option ) any
You should have received a copy of the GNU Affero General Public License along
module Test.Wire.API.Golden.Gene... |
d4491202ba43d1747a11bb3ef0d5af712926ae876dccaee53af88337ed527d26 | brendanhay/gogol | Patch.hs | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
{-# LANGUAGE St... | null | https://raw.githubusercontent.com/brendanhay/gogol/77394c4e0f5bd729e6fe27119701c45f9d5e1e9a/lib/services/gogol-cloudkms/gen/Gogol/CloudKMS/Projects/Locations/EkmConnections/Patch.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE StrictData #
|
Stability : auto-generated
Updates an EkmConnection\'s metadata.
* Resource
** Constructing a Request
| A resource alias for @cloudkms.projects.locations.ekmConnections.patch@ method which the
'CloudKMSProjectsLocationsEkmConnectionsPatch' request conf... | # LANGUAGE DataKinds #
# LANGUAGE DeriveGeneric #
# LANGUAGE DerivingStrategies #
# LANGUAGE DuplicateRecordFields #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE LambdaCase #
# LANGUAGE PatternSynonyms #
# LANGUAGE RecordWildCards #
# LANGUAGE TypeFamilies #
# LANGUAGE TypeOperators... |
ce69c34d66344cb2aa845f23bb3cc4c7e609dac64d758b5cf355c55581f23c9d | penpot/penpot | layers.cljs | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
;;
;; Copyright (c) KALEIDOS INC
(ns app.main.data.workspace.layers
"Events related with layers transformations"
(:require
[app.common.d... | null | https://raw.githubusercontent.com/penpot/penpot/cc18f84d620e37d8efafc5bed1bcdbe70ec23c1e/frontend/src/app/main/data/workspace/layers.cljs | clojure |
Copyright (c) KALEIDOS INC
-- Opacity ----------------------------------------------------------
The opacity of an element can be changed by typing numbers on the keyboard:
...
The user can also type a more exact number:
avoiding duplicated events
Stop buffering after time without opacities | This Source Code Form is subject to the terms of the Mozilla Public
License , v. 2.0 . If a copy of the MPL was not distributed with this
file , You can obtain one at /.
(ns app.main.data.workspace.layers
"Events related with layers transformations"
(:require
[app.common.data :as d]
[app.common.math :a... |
b692394224add036f5a3580ceca33a341878aad3df5b91850a9332e010c1b871 | ndmitchell/cmdargs | Darcs.hs | {-# LANGUAGE DeriveDataTypeable #-}
module Darcs where
import System.Console.CmdArgs
COMMENTS
* The code in this file is not implemented in , it 's a discussion point .
* I have n't specified advanced / common on each flag , but it 's easy to add .
COMMENTS
* The code in this file is not implemented in Cmd... | null | https://raw.githubusercontent.com/ndmitchell/cmdargs/7c206f464fa666b2654ae9da59cdff44e310de66/Darcs.hs | haskell | # LANGUAGE DeriveDataTypeable # | module Darcs where
import System.Console.CmdArgs
COMMENTS
* The code in this file is not implemented in , it 's a discussion point .
* I have n't specified advanced / common on each flag , but it 's easy to add .
COMMENTS
* The code in this file is not implemented in CmdArgs, it's a discussion point.
* I ... |
faee849cfc9cd32636bc1a88b84a229027ce50162d4e5a6bfea44ae76e933cd5 | PrincetonUniversity/lucid | ModuleElimination.ml | open Batteries
open Syntax
open Collections
type subst_env =
{ sizes : id CidMap.t
; types : id CidMap.t
; vars : id CidMap.t
}
let empty_env =
{ sizes = CidMap.empty; types = CidMap.empty; vars = CidMap.empty }
;;
let subst =
let v =
object (self)
inherit [_] s_map
method! visit_EVar en... | null | https://raw.githubusercontent.com/PrincetonUniversity/lucid/8ca93fd803caaa80cf2e301154791564dd3fed7e/src/lib/frontend/transformations/ModuleElimination.ml | ocaml | rename the default action cid | open Batteries
open Syntax
open Collections
type subst_env =
{ sizes : id CidMap.t
; types : id CidMap.t
; vars : id CidMap.t
}
let empty_env =
{ sizes = CidMap.empty; types = CidMap.empty; vars = CidMap.empty }
;;
let subst =
let v =
object (self)
inherit [_] s_map
method! visit_EVar en... |
1ec32087298f4afd65248960e3dbd9a4473f8c23013c7181e038bfa3fddbe12c | AshleyYakeley/Truth | CoerceFunction.hs | module Data.CoerceFunction where
import Control.Category.Dual
import Data.CatFunctor
import Data.Coercion
import Data.KindMorphism
import Shapes.Import
data CoerceFunction (a :: k) (b :: k)
= FuncCoerceFunction (KindFunction a b)
| CoercionCoerceFunction (Coercion a b)
coerceFunctionToFunction ::
fora... | null | https://raw.githubusercontent.com/AshleyYakeley/Truth/10dec8e0c40dcc21ee04c9b57a3ca2016df152c6/Changes/shapes/src/Data/CoerceFunction.hs | haskell | module Data.CoerceFunction where
import Control.Category.Dual
import Data.CatFunctor
import Data.Coercion
import Data.KindMorphism
import Shapes.Import
data CoerceFunction (a :: k) (b :: k)
= FuncCoerceFunction (KindFunction a b)
| CoercionCoerceFunction (Coercion a b)
coerceFunctionToFunction ::
fora... | |
35df88d7df06ffa753337c61a032bc275bb30ef2c3956bab30f043df14130f5e | richmit/mjrcalc | exp-sierpinski.lisp | ;; -*- Mode:Lisp; Syntax:ANSI-Common-LISP; Coding:us-ascii-unix; fill-column:158 -*-
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;;
;; @file exp-sierpinski.lisp
@author < >
@brief D... | null | https://raw.githubusercontent.com/richmit/mjrcalc/96f66d030034754e7d3421688ff201f4f1db4833/exp-sierpinski.lisp | lisp | -*- Mode:Lisp; Syntax:ANSI-Common-LISP; Coding:us-ascii-unix; fill-column:158 -*-
@file exp-sierpinski.lisp
@std Common Lisp
Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
and/or other materials pro... | @author < >
@brief Draw a colorful gasket - like thingy , and output the drawing as an SVG file
@parblock
Copyright ( c ) 1997,1998,2004,2008,2010,2012,2015 , < > All rights reserved .
1 . Redistributions of source code must retain the above copyright notice , this list of conditions , ... |
9cccb273cdd318d2b4484681e286f65918414446e9c3a08c654ced4c9e5198f6 | NoRedInk/haskell-libraries | Test.hs | | Helpers for testing code that sends messages to .
module Kafka.Test
( stub,
)
where
import qualified Data.IORef
import qualified Expect
import qualified GHC.Stack as Stack
import qualified Kafka
import qualified Kafka.Internal as Internal
import qualified Platform
| Can be used to test your writer .
yie... | null | https://raw.githubusercontent.com/NoRedInk/haskell-libraries/9e4236066a7ebfefe1303dae0fcb352bda350b82/nri-kafka/src/Kafka/Test.hs | haskell | messages that would have been written if the handler was real | | Helpers for testing code that sends messages to .
module Kafka.Test
( stub,
)
where
import qualified Data.IORef
import qualified Expect
import qualified GHC.Stack as Stack
import qualified Kafka
import qualified Kafka.Internal as Internal
import qualified Platform
| Can be used to test your writer .
yie... |
d47149fdc5160677e21229476f57e1b1b6fe71781db5a1bc0bb2ea70d4cb7d4e | phadej/language-pts | Quarks.hs | #ifdef LANGUAGE_PTS_HAS_QUARKS
#ifdef LANGUAGE_PTS_HAS_PROP
#define QUARKS_EXAMPLES
#endif
#endif
#ifdef QUARKS_EXAMPLES
{-# LANGUAGE OverloadedStrings, ScopedTypeVariables, FlexibleContexts #-}
#endif
module Language.PTS.Examples.Quarks (
#ifdef QUARKS_EXAMPLES
quarkSyntaxScript,
monadScript,
#endif
) whe... | null | https://raw.githubusercontent.com/phadej/language-pts/761e5b92b14506b75164bd3162487df2d7fbfa93/src/Language/PTS/Examples/Quarks.hs | haskell | # LANGUAGE OverloadedStrings, ScopedTypeVariables, FlexibleContexts #
|
Using quarks we can form a variant of Booleans
--
1 . Type
----------
--
λ» :define Boolean : ⋆ = {:false :true}
--
2 . Constructors
------------------
--
λ» :define True : Boolean = :true
λ» :define False : Boolean = :false
--
3 . ... | #ifdef LANGUAGE_PTS_HAS_QUARKS
#ifdef LANGUAGE_PTS_HAS_PROP
#define QUARKS_EXAMPLES
#endif
#endif
#ifdef QUARKS_EXAMPLES
#endif
module Language.PTS.Examples.Quarks (
#ifdef QUARKS_EXAMPLES
quarkSyntaxScript,
monadScript,
#endif
) where
#ifdef QUARKS_EXAMPLES
import Language.PTS
import Language.PTS.Bound
... |
832c1b556311ee568c9b1aa9d4a239e9fbbfb541dd80c169757c6db7c94ea5a1 | ijvcms/chuanqi_dev | util_crypto.erl | %%%-------------------------------------------------------------------
@author zhengsiying
( C ) 2015 , < COMPANY >
%%% @doc
%%%
%%% @end
Created : 18 . 七月 2015 下午5:19
%%%-------------------------------------------------------------------
-module(util_crypto).
%% API
-export([
md5/1,
hmac_sha/2
]).
%% =====... | null | https://raw.githubusercontent.com/ijvcms/chuanqi_dev/7742184bded15f25be761c4f2d78834249d78097/server/trunk/server/src/api/util/util_crypto.erl | erlang | -------------------------------------------------------------------
@doc
@end
-------------------------------------------------------------------
API
====================================================================
API functions
====================================================================
转换成HEX格式的m... | @author zhengsiying
( C ) 2015 , < COMPANY >
Created : 18 . 七月 2015 下午5:19
-module(util_crypto).
-export([
md5/1,
hmac_sha/2
]).
md5(S) ->
lists:flatten([io_lib:format("~2.16.0b", [N]) || N <- binary_to_list(erlang:md5(S))]).
hmac_sha(Data, Key) ->
crypto:start(),
<<Mac:160/integer>> = crypto:hmac(Key, ... |
626a38ea5716a0e1fcf66476a18eaff49783f95343225e78cc49ed514c8c3484 | Clojure2D/clojure2d-examples | scene.clj | (ns rt4.in-one-weekend.ch11.scene
(:require [fastmath.vector :as v]
[fastmath.core :as m]
[rt4.in-one-weekend.ch11.hittable :as hittable]
[rt4.in-one-weekend.ch11.interval :as interval]
[rt4.in-one-weekend.ch11.material :as material]
[rt4.common :as common]
... | null | https://raw.githubusercontent.com/Clojure2D/clojure2d-examples/ead92d6f17744b91070e6308157364ad4eab8a1b/src/rt4/in_one_weekend/ch11/scene.clj | clojure | (ns rt4.in-one-weekend.ch11.scene
(:require [fastmath.vector :as v]
[fastmath.core :as m]
[rt4.in-one-weekend.ch11.hittable :as hittable]
[rt4.in-one-weekend.ch11.interval :as interval]
[rt4.in-one-weekend.ch11.material :as material]
[rt4.common :as common]
... | |
dec9ebf0229af15976319afabe702c4b79afa71954714420d650cdcc3fb796b7 | sebsheep/elm2node | Bump.hs | module Deps.Bump
( getPossibilities
)
where
import qualified Data.List as List
import qualified Deps.Registry as Registry
import qualified Elm.Magnitude as M
import qualified Elm.Version as V
-- GET POSSIBILITIES
getPossibilities :: Registry.KnownVersions -> [(V.Version, V.Version, M.Magnitude)]
getPossib... | null | https://raw.githubusercontent.com/sebsheep/elm2node/602a64f48e39edcdfa6d99793cc2827b677d650d/builder/src/Deps/Bump.hs | haskell | GET POSSIBILITIES | module Deps.Bump
( getPossibilities
)
where
import qualified Data.List as List
import qualified Deps.Registry as Registry
import qualified Elm.Magnitude as M
import qualified Elm.Version as V
getPossibilities :: Registry.KnownVersions -> [(V.Version, V.Version, M.Magnitude)]
getPossibilities (Registry.Kno... |
189856f5717bcae8c292f9cdd233fd919072490de4bd0091942a4f32901ba6ee | msp-strath/feet | Bwd.hs | {-# LANGUAGE DeriveTraversable #-}
# LANGUAGE DeriveFoldable #
# LANGUAGE DeriveFunctor #
module Utils.Bwd where
data Bwd x = B0 | Bwd x :< x
deriving (Show, Eq, Functor, Foldable, Traversable)
infixl 4 :<
instance Monoid (Bwd x) where
mempty = B0
mappend xz B0 = xz
mappend xz (yz :< y) = mappend xz y... | null | https://raw.githubusercontent.com/msp-strath/feet/630a3e897c83bde3b1a4d9dfdd98304afaef165f/src/Utils/Bwd.hs | haskell | # LANGUAGE DeriveTraversable # | # LANGUAGE DeriveFoldable #
# LANGUAGE DeriveFunctor #
module Utils.Bwd where
data Bwd x = B0 | Bwd x :< x
deriving (Show, Eq, Functor, Foldable, Traversable)
infixl 4 :<
instance Monoid (Bwd x) where
mempty = B0
mappend xz B0 = xz
mappend xz (yz :< y) = mappend xz yz :< y
instance Semigroup (Bwd x) ... |
8d882c0b5168bd50279189b6ee637f78b44f1c2033cbcd3e5c5280fdb59482a8 | haskell-game/fungen | Loader.hs | {-# OPTIONS_HADDOCK hide #-}
{- |
This FunGEn module loads [bmp] files.
-}
FunGEN - Functional Game Engine
/~haskell/fungen
Copyright ( C ) 2002 < >
This code is distributed in the hope that it will be useful ,
but WITHOUT ANY WARRANTY ; without even the implied warranty of
MERCHANTABIL... | null | https://raw.githubusercontent.com/haskell-game/fungen/fcf533d49fd3a0d9c1640faf6fd7d3a2f742083b/Graphics/UI/Fungen/Loader.hs | haskell | # OPTIONS_HADDOCK hide #
|
This FunGEn module loads [bmp] files.
| Loads a bitmap from a file.
| Loads n bitmaps from n files.
|
FunGEN - Functional Game Engine
/~haskell/fungen
Copyright ( C ) 2002 < >
This code 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 .
FunGEN - Functional Game Engine... |
8a1b873db8d12e1e96c6298eb4cd47ebfb4779ea31cd5999493456b970780679 | funkenblatt/figwheel-test | geometry.cljs | (ns figwheel-test.geometry)
(defn v- [[ax ay] [bx by]] (array (- ax bx) (- ay by)))
(defn v+ [[ax ay] [bx by]] (array (+ ax bx) (+ ay by)))
(defn vscale [s [ax ay]] (array (* s ax) (* s ay)))
(defn vdot [[ax ay] [bx by]]
(+ (* ax bx) (* ay by)))
(defn vcross [[ax ay] [bx by]]
(- (* ax by) (* bx ay)))
(defn vsqu... | null | https://raw.githubusercontent.com/funkenblatt/figwheel-test/03ca55406fde1f01b21c904f63840c3e1d6d8809/cljs/figwheel_test/geometry.cljs | clojure | (ns figwheel-test.geometry)
(defn v- [[ax ay] [bx by]] (array (- ax bx) (- ay by)))
(defn v+ [[ax ay] [bx by]] (array (+ ax bx) (+ ay by)))
(defn vscale [s [ax ay]] (array (* s ax) (* s ay)))
(defn vdot [[ax ay] [bx by]]
(+ (* ax bx) (* ay by)))
(defn vcross [[ax ay] [bx by]]
(- (* ax by) (* bx ay)))
(defn vsqu... | |
17300cd2ac2d8741bf03c05e0e1f0b8ce08fec0f6c5b500d99672178f85d0394 | charlieg/Sparser | Congress.lisp | ;;; -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
copyright ( c ) 1995 -- all rights reserved
;;;
File : " Congress "
;;; Module: "grammar;rules:sources:"
Version : June 1995
initiated 6/26/95
(in-package :sparser)
;;;-------
;;; style
;;;-------
(define-document-style appropr... | null | https://raw.githubusercontent.com/charlieg/Sparser/b9bb7d01d2e40f783f3214fc104062db3d15e608/Sparser/code/s/grammar/rules/sources/Congress.lisp | lisp | -*- Mode:LISP; Syntax:Common-Lisp; Package:SPARSER -*-
Module: "grammar;rules:sources:"
-------
style
-------
-----------------
document stream
----------------- | copyright ( c ) 1995 -- all rights reserved
File : " Congress "
Version : June 1995
initiated 6/26/95
(in-package :sparser)
(define-document-style appropriations-bill
:init-fn setup-for-appropriations-bill )
(defun setup-for-appropriations-bill ()
(use-original-lines-of-text)
(esta... |
1e802b3b4ceaf9a714a6db21e57b62c8392a0e2862f81b13a77a5f9c711c4306 | PapenfussLab/bioshake | Types.hs | # LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
-- | Core data types the pipeline abstraction.
module Bioshake.Types where
import Control.Monad
import Control.Monad.Trans
import Control.Monad.Tr... | null | https://raw.githubusercontent.com/PapenfussLab/bioshake/afeb7219b171e242b6e9bb9e99e2f80c0a099aff/Bioshake/Types.hs | haskell | # LANGUAGE GADTs #
| Core data types the pipeline abstraction.
| Pipes output of stage a into stage b, i.e., forms a pipeline.
| Buildable abstracts things that can be turned into shake 'Action's.
| The compiler tracks the set of output files to ensure duplicate 'Rules' are
not generated. This allow... | # LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators #
# LANGUAGE UndecidableInstances #
module Bioshake.Types where
import Control.Monad
import Control.Monad.Trans
import Control.Monad.Trans.State.Strict
import Data.Reflection
import qualified Data.Set ... |
f6c3b994cf32c8f47523b36b2d278ba1625ad6509234ed33d7903b8ed66e206a | chef-boneyard/bookshelf | bksw_wm_bucket.erl | 2012 - 2013 Opscode , Inc. All Rights Reserved
@author < >
%%
Licensed to the Apache Software Foundation ( ASF ) under one or more
%% contributor license agreements. See the NOTICE file distributed
%% with this work for additional information regarding copyright
ownership . The ASF licenses this file to ... | null | https://raw.githubusercontent.com/chef-boneyard/bookshelf/f9584e766d16d090812c8f7064651882dddc2512/src/bksw_wm_bucket.erl | erlang |
contributor license agreements. See the NOTICE file distributed
with this work for additional information regarding copyright
License, Version 2.0 (the "License"); you may not use this file
the License at -2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS ... | 2012 - 2013 Opscode , Inc. All Rights Reserved
@author < >
Licensed to the Apache Software Foundation ( ASF ) under one or more
ownership . The ASF licenses this file to you under the Apache
except in compliance with the License . You may obtain a copy of
distributed under the License is distributed... |
377bbba7572f6d24ef89a5fa1907ae26fb07137c5733cbf51fef2c23fd660ba4 | lisp/de.setf.thrift | ManyTypedefs.lisp | ;;; -*- Package: thrift-generated -*-
;;;
;;; base operators definitions
(def-package :thrift-generated)
(defun method2 ()
(list (map '(1 "string"))))
(defun method2 (int)
(make-instance 'struct1 :myint int :mylist (list (map '(1 "string")))))
| null | https://raw.githubusercontent.com/lisp/de.setf.thrift/32b0d1ca3d9fa95327165b8090e1021bc563ed3e/test/gen-cl/ManyTypedefs.lisp | lisp | -*- Package: thrift-generated -*-
base operators definitions |
(def-package :thrift-generated)
(defun method2 ()
(list (map '(1 "string"))))
(defun method2 (int)
(make-instance 'struct1 :myint int :mylist (list (map '(1 "string")))))
|
2b97fa97a903dc55391b7bcd396c31234d2d6fef05aa02bd563f512fb4480ae3 | AdaCore/why3 | shortener.mli | (********************************************************************)
(* *)
The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2022 -- Inria - CNRS - Paris - Saclay University
(* ... | null | https://raw.githubusercontent.com/AdaCore/why3/4441127004d53cf2cb0f722fed4a930ccf040ee4/src/trywhy3/shortener.mli | ocaml | ******************************************************************
This software is distributed under the terms of the GNU Lesser
on linking described in file LICENSE. ... | The Why3 Verification Platform / The Why3 Development Team
Copyright 2010 - 2022 -- Inria - CNRS - Paris - Saclay University
General Public License version 2.1 , with the special exception
val encode : string -> string
val decode : string -> string
|
60f555c4f294aa02400c344ae9771ebfda9dd03c189eceeddf7cad09a0e1213d | awolven/cl-vulkan | command-buffers.lisp | Copyright 2019 , 2020
;;
;; Permission is hereby granted, free of charge, to any person obtaining
;; a copy of this software and associated documentation files (the
" Software " ) , to deal in the Software without restriction , including
;; without limitation the rights to use, copy, modify, merge, publish,
d... | null | https://raw.githubusercontent.com/awolven/cl-vulkan/2b345589793748d114ab60a336d4e91852d533dc/src/command-buffers.lisp | lisp |
Permission is hereby granted, free of charge, to any person obtaining
a copy of this software and associated documentation files (the
without limitation the rights to use, copy, modify, merge, publish,
the following conditions:
The above copyright notice and this permission notice shall be
EXPRESS OR IMPLIE... | Copyright 2019 , 2020
" Software " ) , to deal in the Software without restriction , including
distribute , sublicense , and/or sell copies of the Software , and to
permit persons to whom the Software is furnished to do so , subject to
included in all copies or substantial portions of the Software .
THE ... |
ec9cfbbc3a8b6118e956aa05a7e92f3a20ced6d8f350676571cc2145e08efbdc | afiniate/aws_async | awsa_headers.ml | open Core.Std
type header = (String.t * String.t)
type t = header List.t
type quote_type = Single | Double
let rec run_to_end_quote quote_type value start len =
if start < len
then match (quote_type, value.[start]) with
| (_, '\\') ->
begin if start + 1 < len
then match (quote_type, value.[star... | null | https://raw.githubusercontent.com/afiniate/aws_async/44c27bf9f18f76e9e6405c2252098c4aa3d9a8bc/lib/auth/awsa_headers.ml | ocaml | open Core.Std
type header = (String.t * String.t)
type t = header List.t
type quote_type = Single | Double
let rec run_to_end_quote quote_type value start len =
if start < len
then match (quote_type, value.[start]) with
| (_, '\\') ->
begin if start + 1 < len
then match (quote_type, value.[star... | |
65f556fe8f8b4cf1c98357132e6fe03bba0e53e3fe7c1a17c4f0cd11ecf9937c | jxv/dino-rush | Obstacle.hs | module DinoRush.Engine.Obstacle where
import qualified Animate
import System.Random
import Linear (V2(..))
import DinoRush.Engine.Types
import DinoRush.Engine.Bird
import DinoRush.Engine.Lava
import DinoRush.Engine.Rock
import DinoRush.Engine.Physics
data ObstacleTag
= ObstacleTag'Lava
| ObstacleTag'Rock
| Obs... | null | https://raw.githubusercontent.com/jxv/dino-rush/f888bc05fe734ced2c49bec81f9c804b47c81069/library/DinoRush/Engine/Obstacle.hs | haskell | module DinoRush.Engine.Obstacle where
import qualified Animate
import System.Random
import Linear (V2(..))
import DinoRush.Engine.Types
import DinoRush.Engine.Bird
import DinoRush.Engine.Lava
import DinoRush.Engine.Rock
import DinoRush.Engine.Physics
data ObstacleTag
= ObstacleTag'Lava
| ObstacleTag'Rock
| Obs... | |
6097b118c4fbfeba9b0a2cb6c25a1f2eb280502b6c281a11fea04ec0155704f0 | jacekschae/learn-reitit-course-files | handlers.clj | (ns cheffy.recipe.handlers
(:require [cheffy.recipe.db :as recipe-db]
[ring.util.response :as rr]))
(defn list-all-recipes
[db]
(fn [request]
(let [recipes (recipe-db/find-all-recipes db)]
(rr/response recipes)))) | null | https://raw.githubusercontent.com/jacekschae/learn-reitit-course-files/c13a8eb622a371ad719d3d9023f1b4eff9392e4c/increments/17-list-all-recipes-refactor/src/cheffy/recipe/handlers.clj | clojure | (ns cheffy.recipe.handlers
(:require [cheffy.recipe.db :as recipe-db]
[ring.util.response :as rr]))
(defn list-all-recipes
[db]
(fn [request]
(let [recipes (recipe-db/find-all-recipes db)]
(rr/response recipes)))) | |
d410c9b053a8f6767bf7a2ed15da8c4678f950644bbe2bb8a8f7531888bf88a3 | kaizhang/matrices | Mutable.hs | {-# LANGUAGE ConstraintKinds #-}
# LANGUAGE KindSignatures #
module Data.Matrix.Unboxed.Mutable
( -- * Mutable Matrix
MMatrix
, dim
, takeRow
, write
, unsafeWrite
, read
, unsafeRead
, new
, replicate
) where
import GHC.Exts (Constraint)
import Prelude hiding (read, repli... | null | https://raw.githubusercontent.com/kaizhang/matrices/4d85abd72aecce03284c597497fbe6154d8919bd/src/Data/Matrix/Unboxed/Mutable.hs | haskell | # LANGUAGE ConstraintKinds #
* Mutable Matrix
| Create a mutable matrix without initialization | # LANGUAGE KindSignatures #
module Data.Matrix.Unboxed.Mutable
MMatrix
, dim
, takeRow
, write
, unsafeWrite
, read
, unsafeRead
, new
, replicate
) where
import GHC.Exts (Constraint)
import Prelude hiding (read, replicate)
import Control.Monad.Primitive (PrimMon... |
38f79ff7464771b4ec4674555a53c51c8c973f2dc006c2a3cc7277ed9d231dcd | yzh44yzh/practical_erlang | task_5.erl | -module(task_5).
-export([splitwith/2, zipwith/3]).
-include_lib("eunit/include/eunit.hrl").
implement lists :
#splitwith-2
splitwith(Pred, List) ->
{task_4:takewhile(Pred, List), task_4:dropwhile(Pred, List)}.
splitwith_test() ->
F = fun(Val) -> Val rem 2 =:= 0 end,
?assertEqual({[], []}, splitw... | null | https://raw.githubusercontent.com/yzh44yzh/practical_erlang/c9eec8cf44e152bf50d9bc6d5cb87fee4764f609/02_list_recursion/solution/task_5.erl | erlang | #zipwith-3 | -module(task_5).
-export([splitwith/2, zipwith/3]).
-include_lib("eunit/include/eunit.hrl").
implement lists :
#splitwith-2
splitwith(Pred, List) ->
{task_4:takewhile(Pred, List), task_4:dropwhile(Pred, List)}.
splitwith_test() ->
F = fun(Val) -> Val rem 2 =:= 0 end,
?assertEqual({[], []}, splitw... |
1c910d27dfdcd06173718a460e7fdc84fc252ad04eaa4b2167a446887ccbd093 | haskell-compat/base-compat | Batteries.hs | {-# LANGUAGE PackageImports #-}
# OPTIONS_GHC -fno - warn - dodgy - exports -fno - warn - unused - imports #
| Reexports " Text . Read . . Compat "
-- from a globally unique namespace.
module Text.Read.Lex.Compat.Repl.Batteries (
module Text.Read.Lex.Compat
) where
import "this" Text.Read.Lex.Compat
| null | https://raw.githubusercontent.com/haskell-compat/base-compat/3be91c934896977c67a7a4a24d1a321e7b2b4d0e/base-compat-batteries/src/Text/Read/Lex/Compat/Repl/Batteries.hs | haskell | # LANGUAGE PackageImports #
from a globally unique namespace. | # OPTIONS_GHC -fno - warn - dodgy - exports -fno - warn - unused - imports #
| Reexports " Text . Read . . Compat "
module Text.Read.Lex.Compat.Repl.Batteries (
module Text.Read.Lex.Compat
) where
import "this" Text.Read.Lex.Compat
|
4c6cb6e89effc52c9ce12fe05b8e9c44fe1e9d0b484d376fe708f0090596ab4f | tonyg/kali-scheme | bigbit.scm | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
Bitwise logical operators on bignums .
(define-opcode-extension bitwise-not &bitwise-not)
(define-opcode-extension bitwise-and &bitwise-and)
(define-opcode-extension bitwise-ior &bitwise-ior)
(... | null | https://raw.githubusercontent.com/tonyg/kali-scheme/79bf76b4964729b63fce99c4d2149b32cb067ac0/scheme/big/bigbit.scm | scheme | (integer+ (integer-negate m) -1)
Now both M and N are magnitudes of negative numbers.
arithmetic-shift
Split the low digit into left and right parts, and shift
shift right
(define (tst)
(let* ((m (random))
(n (bitwise-and m 63))
(m1 (integer-arithmetic-shift
(integer-arithmetic-shi... | Copyright ( c ) 1993 , 1994 by and .
Copyright ( c ) 1996 by NEC Research Institute , Inc. See file COPYING .
Bitwise logical operators on bignums .
(define-opcode-extension bitwise-not &bitwise-not)
(define-opcode-extension bitwise-and &bitwise-and)
(define-opcode-extension bitwise-ior &bitwise-ior)
(... |
01fd8171331aea00eba925fb00a9b8b4ff2423eb3c85f4360c419b9781694da3 | sklassen/erlang-linalg-native | linalg_cholesky.erl | -module(linalg_cholesky).
-vsn('1.0').
-author('simon.klassen').
-export([crout/1]).
-type scalar() :: number().
-type vector() :: list(scalar()).
-type matrix() :: list(vector()).
% example
25 15 -5 5 0 0
15 18 0 -- > 3 3 0
-5 0 11 -1 ... | null | https://raw.githubusercontent.com/sklassen/erlang-linalg-native/6e2158745d6e5a92b98e9f83c1400d36991d2b98/src/linalg_cholesky.erl | erlang | example
>>> np.linalg.cholesky([[25,15,-5],[15,18,0],[-5,0,11]])
peel
calc
rebuild peel | -module(linalg_cholesky).
-vsn('1.0').
-author('simon.klassen').
-export([crout/1]).
-type scalar() :: number().
-type vector() :: list(scalar()).
-type matrix() :: list(vector()).
25 15 -5 5 0 0
15 18 0 -- > 3 3 0
-5 0 11 -1 1 3
1... |
0a178572521f332ce688baef6a9252f91117edebdacbf284089f730b8401a1d7 | arthuredelstein/clooj | highlighting.clj | Copyright ( c ) 2011 - 2013 ,
; All rights reserved.
Eclipse Public License 1.0
;
(ns clooj.highlighting
(:import (javax.swing.text DefaultHighlighter
DefaultHighlighter$DefaultHighlightPainter)
(java.awt Color)
(javax.swing.event CaretListener))
(:require ... | null | https://raw.githubusercontent.com/arthuredelstein/clooj/6d78d07c16ff339e782b0031eae3a2ef1eeb5280/src/clooj/highlighting.clj | clojure | All rights reserved.
| Copyright ( c ) 2011 - 2013 ,
Eclipse Public License 1.0
(ns clooj.highlighting
(:import (javax.swing.text DefaultHighlighter
DefaultHighlighter$DefaultHighlightPainter)
(java.awt Color)
(javax.swing.event CaretListener))
(:require [clooj.utils :as utils]))
... |
b21d670914bc25b266bb8e51bc44a98c00946124f093b02d69ebf15ba51f821b | EveryTian/Haskell-Codewars | integers-recreation-one.hs | -- -recreation-one
module Codewars.G964.Sumdivsq where
listSquared :: Int -> Int -> [(Int, Int)]
listSquared m n = [(i, func i) | i <- [m .. n], func i /= 0]
func :: Int -> Int
func n = let s = sqrt . fromIntegral . sum $ map (^ 2) (divisors n ++ [n `div` i | i <- divisors n, i * i /= n])
in if ceiling s == ... | null | https://raw.githubusercontent.com/EveryTian/Haskell-Codewars/dc48d95c676ce1a59f697d07672acb6d4722893b/5kyu/integers-recreation-one.hs | haskell | -recreation-one |
module Codewars.G964.Sumdivsq where
listSquared :: Int -> Int -> [(Int, Int)]
listSquared m n = [(i, func i) | i <- [m .. n], func i /= 0]
func :: Int -> Int
func n = let s = sqrt . fromIntegral . sum $ map (^ 2) (divisors n ++ [n `div` i | i <- divisors n, i * i /= n])
in if ceiling s == floor s then floor ... |
a1d1dd62222639506daad5e5695ccfc6aad87f3af584af1f61b7f7b4f3db24b5 | ujamjar/reedsolomon | poly.mli |
* reedsolomon - error correction CODEC
*
* ( c ) 2014 MicroJamJar Ltd
*
* Author(s ):
* Description :
*
* reedsolomon - error correction CODEC
*
* (c) 2014 MicroJamJar Ltd
*
* Author(s):
* Description:
*
*)
* basic polynomials of 1 variable
module type S = sig
(** polynomial... | null | https://raw.githubusercontent.com/ujamjar/reedsolomon/6612f71e8cc30b6d3bfccccfdb8409bd6a0ec58f/src/poly.mli | ocaml | * polynomial coefficient type
* the degree of the polynomial
* this is represented as [|E.zero|]
* this is represented as [|E.one|]
* this is represented as [|E.zero;E.one|]
* convert to poly
* convert from poly
* make a copy of the poly
* control over print formatting
* create string of poly
* legalise the p... |
* reedsolomon - error correction CODEC
*
* ( c ) 2014 MicroJamJar Ltd
*
* Author(s ):
* Description :
*
* reedsolomon - error correction CODEC
*
* (c) 2014 MicroJamJar Ltd
*
* Author(s):
* Description:
*
*)
* basic polynomials of 1 variable
module type S = sig
type elt
* an ... |
425a7c91edb39dab52dd6676f7bcc6e1e25b40614c7fd858b85556fc962a6a40 | ghc/packages-dph | Sequential.hs | # LANGUAGE CPP #
#include "fusion-phases.h"
-- | Sequential operations on unlifted arrays.
--
-- * This is an internal API and shouldn't need to be used directly.
Client programs should use " Data . Array . Parallel . Unlifted "
module Data.Array.Parallel.Unlifted.Sequential
( -- * Constructors
... | null | https://raw.githubusercontent.com/ghc/packages-dph/64eca669f13f4d216af9024474a3fc73ce101793/dph-prim-seq/Data/Array/Parallel/Unlifted/Sequential.hs | haskell | | Sequential operations on unlifted arrays.
* This is an internal API and shouldn't need to be used directly.
* Constructors
* Folds
* Sums
* Extracts and Indexing | # LANGUAGE CPP #
#include "fusion-phases.h"
Client programs should use " Data . Array . Parallel . Unlifted "
module Data.Array.Parallel.Unlifted.Sequential
replicateSU
, replicateRSU
, appendSU
, indicesSU, indicesSU'
, foldSU, foldSSU
, foldlSU, ... |
7597767fc207869747909332a6710bad2770eae8289685ed85d5aca9b83d6054 | dto/cypress | lucius.lisp | (in-package :cypress)
;;; Thrown pebbles
(defthing (pebble sprite)
:image-scale 200
:height 20
:width 20
:sprite-height 20
:sprite-width 20
:clock 400
:heading (/ pi 2)
:image (random-choose *stone-images*))
(defmethod initialize ((self pebble) &key heading)
(when heading
(setf (field-value :h... | null | https://raw.githubusercontent.com/dto/cypress/c33c26f8bf470dbd74b14ed5afa2cbf25aea0ca6/lucius.lisp | lisp | Thrown pebbles
handle no-flowers
; warp to when ca n't pathfind
(multiple-value-bind (top left right bottom)
(when (not (can-walk-to self left top))
pick flowers
are we near flower?
when I heard
it's a short distance to the
(destroy-gump self)
(activate (find-spellbook)))
it's the | (in-package :cypress)
(defthing (pebble sprite)
:image-scale 200
:height 20
:width 20
:sprite-height 20
:sprite-width 20
:clock 400
:heading (/ pi 2)
:image (random-choose *stone-images*))
(defmethod initialize ((self pebble) &key heading)
(when heading
(setf (field-value :heading self) headin... |
f6afb8237a2da29518f8ad77afbacf92a78c42cc09026c913dedec41b6008ef8 | ocaml-multicore/parallel-programming-in-multicore-ocaml | senders_receivers.ml | open Domainslib
let num_domains = try int_of_string Sys.argv.(1) with _ -> 4
let c = Chan.make_bounded num_domains
let send c =
Printf.printf "Sending from: %d\n" (Domain.self () :> int);
Chan.send c "howdy!"
let recv c =
Printf.printf "Receiving at: %d\n" (Domain.self () :> int);
Chan.recv c |> ignore
let... | null | https://raw.githubusercontent.com/ocaml-multicore/parallel-programming-in-multicore-ocaml/2f95616234907bc0fb95f32bcc49c9b1f9c83d5a/code/chan/senders_receivers.ml | ocaml | open Domainslib
let num_domains = try int_of_string Sys.argv.(1) with _ -> 4
let c = Chan.make_bounded num_domains
let send c =
Printf.printf "Sending from: %d\n" (Domain.self () :> int);
Chan.send c "howdy!"
let recv c =
Printf.printf "Receiving at: %d\n" (Domain.self () :> int);
Chan.recv c |> ignore
let... | |
a9c4a27f686cb217fd741e326842bc417ead1feb00889180ed83647a94b914f3 | gsakkas/rite | 2622.ml |
let pipe fs = let f a x = a x in let base = (+) 0 in List.fold_left f base fs;;
fix
let pipe fs = let f a x = x in let base = ( + ) 0 in List.fold_left f base fs ; ;
let pipe fs = let f a x = x in let base = (+) 0 in List.fold_left f base fs;;
*)
changed spans
( 2,27)-(2,30 )
x
VarG
(2,27)-(2,3... | null | https://raw.githubusercontent.com/gsakkas/rite/958a0ad2460e15734447bc07bd181f5d35956d3b/data/sp14/2622.ml | ocaml |
let pipe fs = let f a x = a x in let base = (+) 0 in List.fold_left f base fs;;
fix
let pipe fs = let f a x = x in let base = ( + ) 0 in List.fold_left f base fs ; ;
let pipe fs = let f a x = x in let base = (+) 0 in List.fold_left f base fs;;
*)
changed spans
( 2,27)-(2,30 )
x
VarG
(2,27)-(2,3... | |
d366fa49d798907be1eb54b7851c059fcaf9b110e6bba7f82bdd4cbc1cecf45a | Clozure/ccl-tests | return-from.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Tue Feb 24 20:22:23 2004
;;;; Contains: Tests of RETURN-FROM
(in-package :cl-test)
;;; RETURN-FROM is tested extensively in other files
(deftest return-from.1
(block xyz (return-from xyz) :bad)
nil)
(deftest return-from.2
(block nil (return-from nil :good)... | null | https://raw.githubusercontent.com/Clozure/ccl-tests/0478abddb34dbc16487a1975560d8d073a988060/ansi-tests/return-from.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of RETURN-FROM
RETURN-FROM is tested extensively in other files | Author :
Created : Tue Feb 24 20:22:23 2004
(in-package :cl-test)
(deftest return-from.1
(block xyz (return-from xyz) :bad)
nil)
(deftest return-from.2
(block nil (return-from nil :good) :bad)
:good)
Macros are expanded in the appropriate environment
(deftest return-from.3
(macrolet
((%m... |
8d2f38ab9c9dcab12266e8c478fd254c20d6dc2e1daa906273daff77b6f8db8a | antono/guix-debian | attr.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2012 < >
Copyright © 2012 , 2013 < >
;;;
;;; This file is part of GNU Guix.
;;;
GNU is free software ; you can redistribute it and/or modify it
under the terms of the GNU General Public License as published by
the Free Software Foundati... | null | https://raw.githubusercontent.com/antono/guix-debian/85ef443788f0788a62010a942973d4f7714d10b4/gnu/packages/attr.scm | scheme | GNU Guix --- Functional package management for GNU
This file is part of GNU Guix.
you can redistribute it and/or modify it
either version 3 of the License , or ( at
your option) any later version.
GNU Guix is distributed in the hope that it will be useful, but
WITHOUT ANY WARRANTY; without even the implied wa... | Copyright © 2012 < >
Copyright © 2012 , 2013 < >
under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General Public License
along with GNU . If not , see < / > .
(define-module (gnu packages attr)
#:use-module (guix licenses)
#:use-module ... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.