_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 |
|---|---|---|---|---|---|---|---|---|
e8317aa7a9e9ef90955ef62decf330aaefe6741496456ecd4148d6a521270ba7 | rauhs/hicada | util.cljc | (ns hicada.util
(:require
[clojure.string :as str]
[clojure.set :as set]))
(defn join-classes-js
"Joins strings space separated"
([] "")
([& xs]
(let [strs (->> (repeat (count xs) "~{}")
(interpose ",")
(apply str))]
(list* 'js* (str "[" strs "].join(' ')")... | null | https://raw.githubusercontent.com/rauhs/hicada/963a793d3f96617f0de7d6afb1f65cdc3a26ea26/src/hicada/util.cljc | clojure | React native accepts :style [{:foo-bar ..} other-styles] so camcase those keys: | (ns hicada.util
(:require
[clojure.string :as str]
[clojure.set :as set]))
(defn join-classes-js
"Joins strings space separated"
([] "")
([& xs]
(let [strs (->> (repeat (count xs) "~{}")
(interpose ",")
(apply str))]
(list* 'js* (str "[" strs "].join(' ')")... |
89793c589ec560fc37a895cb9293ae9bddc70cea8018d922b54e8d7ff52df48d | gafiatulin/codewars | FixedXor.hs | -- Fixed Xor
--
module Codewars.Kata.FixedXor where
import Data.Bits (xor)
import Data.Char(intToDigit, digitToInt)
fixedXor :: String -> String -> String
fixedXor = zipWith (\c1 c2 -> intToDigit (digitToInt c1 `xor` digitToInt c2))
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/Beta/FixedXor.hs | haskell | Fixed Xor
|
module Codewars.Kata.FixedXor where
import Data.Bits (xor)
import Data.Char(intToDigit, digitToInt)
fixedXor :: String -> String -> String
fixedXor = zipWith (\c1 c2 -> intToDigit (digitToInt c1 `xor` digitToInt c2))
|
64c6f29ffc86e43052ec8b6c14880e4494287d621b117260b14ccb25c61c467c | juspay/atlas | Environment.hs | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... | null | https://raw.githubusercontent.com/juspay/atlas/e64b227dc17887fb01c2554db21c08284d18a806/app/atlas-transport/src/App/Allocator/Environment.hs | haskell | should we flatten it too? | |
Copyright 2022 Juspay Technologies Pvt Ltd
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing , software
dis... |
7cd4614d99d6b4a017855efbb079e09c830d114e7b9a56d7a3837e9f2a6faedb | takikawa/drracket-vim-tool | tool.rkt | #lang racket/unit
(require drracket/tool
framework
racket/class
racket/gui
"private/text.rkt")
(import drracket:tool^)
(export drracket:tool-exports^)
(define vim-frame-mixin
(mixin (drracket:unit:frame<%>) ()
(unless (preferences:default-set? 'drracket:vim-emulation?)
... | null | https://raw.githubusercontent.com/takikawa/drracket-vim-tool/c347e8f8dcb0d89efd44755587b108e1f420912a/tool.rkt | racket | trigger redraws to get rid of vim effects
for the vim status (mode text, etc.)
TODO: this pattern is really horrible
overriden to add a status panel
overriden just to inform us when the tab becomes active
initialize editor state | #lang racket/unit
(require drracket/tool
framework
racket/class
racket/gui
"private/text.rkt")
(import drracket:tool^)
(export drracket:tool-exports^)
(define vim-frame-mixin
(mixin (drracket:unit:frame<%>) ()
(unless (preferences:default-set? 'drracket:vim-emulation?)
... |
f3821659d985ae6842873711cd8130554ad3dddc6fce09a9d208c666dbf78caa | vmchale/tomlcheck | Main.hs | module Main
( main
) where
import Control.Monad
import Data.Semigroup
import qualified Data.Text.IO as TIO
import Data.Version (showVersion)
import Options.Applicative
import Paths_tomlcheck (version)
import System.Exit (Exit... | null | https://raw.githubusercontent.com/vmchale/tomlcheck/7459f92cd3db3c59708eec8394e71b51e3ef44fc/app/Main.hs | haskell | module Main
( main
) where
import Control.Monad
import Data.Semigroup
import qualified Data.Text.IO as TIO
import Data.Version (showVersion)
import Options.Applicative
import Paths_tomlcheck (version)
import System.Exit (Exit... | |
8f70305faeb6030c051538326b11d7819fc7b9bdfc09559fa0d9eab6dba6cb1c | openbadgefactory/salava | notactivated.cljs | (ns salava.core.ui.notactivated
(:require [reagent.session :as session]
[clojure.string :as str]
[salava.core.ui.helper :refer [path-for not-activated?]]
[salava.core.i18n :refer [t]]
[ajax.core :as ajax]))
#_(defn not-activated-banner []
(if (not-activated?)
... | null | https://raw.githubusercontent.com/openbadgefactory/salava/97f05992406e4dcbe3c4bff75c04378d19606b61/src/cljs/salava/core/ui/notactivated.cljs | clojure | (ns salava.core.ui.notactivated
(:require [reagent.session :as session]
[clojure.string :as str]
[salava.core.ui.helper :refer [path-for not-activated?]]
[salava.core.i18n :refer [t]]
[ajax.core :as ajax]))
#_(defn not-activated-banner []
(if (not-activated?)
... | |
6926bee298a00eb6d23c72f89e28cac823d63688091b73527a06662d64ca428a | marijnh/Postmodern | test-package.lisp | -*- Mode : LISP ; Syntax : Ansi - Common - Lisp ; Base : 10 ; Package : CL - USER ; -*-
(defpackage :postmodern-tests
(:use :common-lisp :fiveam :postmodern :simple-date :cl-postgres-tests)
(:shadow #:with-test-connection))
| null | https://raw.githubusercontent.com/marijnh/Postmodern/45fa35ddad0f0aff6218f2708f7652a3deb83c06/postmodern/tests/test-package.lisp | lisp | Syntax : Ansi - Common - Lisp ; Base : 10 ; Package : CL - USER ; -*- |
(defpackage :postmodern-tests
(:use :common-lisp :fiveam :postmodern :simple-date :cl-postgres-tests)
(:shadow #:with-test-connection))
|
500100fc38517d635a1be54579d075398f2b1d215c20db818531d0bdeb49ef31 | thicksteadTHpp/Obvius | glfw-nk-draw.lisp | ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;
;;; File: glfw-nk-draw.lisp
Author : , [ THO ]
;;; Description: nk drawing routines
Creation Date : 1993 , 2020
;;; ----------------------------------------------------------------
Object - Based Vision and Image Understan... | null | https://raw.githubusercontent.com/thicksteadTHpp/Obvius/9a91673609def033539c9ebaf098e8f11eb0df6e/obvius_eye/glfw-nk-draw.lisp | lisp |
File: glfw-nk-draw.lisp
Description: nk drawing routines
----------------------------------------------------------------
returns the font-helper in dispatcher
which should hold a pointer to the default font
if not changed otherwise
(ctx :style :font &))))
todo get the font height from nk
font arg... | Author : , [ THO ]
Creation Date : 1993 , 2020
Object - Based Vision and Image Understanding System ( OBVIUS ) ,
(in-package :obvius)
(defstruct (nk-canvas (:conc-name canvas-))
context
painter
item-spacing
panel-padding
window-background
drawing-color
total-space
rect)
(defmethod fon... |
51a51efe682be74462bfbc36cd48b3206f9fc4e3d6c3449485309ea814efaf30 | snoyberg/haskell-web-rosetta | happstack.hs | module Main where
import Happstack.Server
| start the server on port 8000
respond to any incoming request with : 200 OK , " Hello World "
--
-- This example is explained in detail here:
--
-- <>
--
main = simpleHTTP nullConf $ ok "Hello World"
-- brief overview:
--
-- > ok :: (FilterMonad Response m) ... | null | https://raw.githubusercontent.com/snoyberg/haskell-web-rosetta/43f8b736aed9a5bad375f5d1dc7ecc31979cb7c2/hello-world/happstack.hs | haskell |
This example is explained in detail here:
<>
brief overview:
> ok :: (FilterMonad Response m) => a -> m a
'ok' is a similar to 'return', except it also adds a filter
includes setting the 'Content-Type'. For 'String' the content-type
is 'text/plain; charset=UTF-8'. There are instances for many... | module Main where
import Happstack.Server
| start the server on port 8000
respond to any incoming request with : 200 OK , " Hello World "
main = simpleHTTP nullConf $ ok "Hello World"
which will set the http response code to 200 OK . There are similar
functions for other responses such as ' notFound ' , ' '... |
6954f9553107c2a4e4d2461ce84a2a9621ca68807e9527b09b3657b43deaf83e | padsproj/oforest | forest.ml | open Unix
(* Types *)
type fKind =
| AsciiK
| BinaryK
| DirectoryK
| SymK
| UnknownK
type forest_regexp = Str.regexp
type forest_glob = Re.t
type forest_regexp_str = string
type filepath = Pads.filepath
type varname = string
module OrderedPath = String
module PathMap = Map.Make(OrderedPath)
type manifest_err... | null | https://raw.githubusercontent.com/padsproj/oforest/e10abf1c35f6d49d4bdf13d51cab44487629b3a3/lib/forest.ml | ocaml | Types
Some useful user level functions
Helper functions
Loadings and Storing primitives
Costs
Example from paper: Tally number of files (not links etc) loaded
Example from paper: Total file size
Example from paper: Total load time
Example from paper: Multiset of names of files loaded
Unit Cost Monad,... | open Unix
type fKind =
| AsciiK
| BinaryK
| DirectoryK
| SymK
| UnknownK
type forest_regexp = Str.regexp
type forest_glob = Re.t
type forest_regexp_str = string
type filepath = Pads.filepath
type varname = string
module OrderedPath = String
module PathMap = Map.Make(OrderedPath)
type manifest_error =
| MD_M... |
fe9da1de6e6e59be5e00fb687d1b69441b2e25061d9a7cbf4866937be5110ebf | tiredpixel/isoxya-api | API.hs | # LANGUAGE TemplateHaskell #
module Main (main) where
import Control.Concurrent (forkIO)
import Control.Concurrent.Chan
import Control.Lens (makeLenses)
import Data.Version (showVersion)
import Isoxya.API
import qualif... | null | https://raw.githubusercontent.com/tiredpixel/isoxya-api/1022ee6db77f744c77541c53ef6f15f56884f939/src/Isoxya/Bin/API.hs | haskell | # LANGUAGE TemplateHaskell #
module Main (main) where
import Control.Concurrent (forkIO)
import Control.Concurrent.Chan
import Control.Lens (makeLenses)
import Data.Version (showVersion)
import Isoxya.API
import qualif... | |
4fb47ebf88b193a223ad67b43cf0b411cc1228357b044d517895f96eb23a7b9e | hachreak/swagger_routerl | swagger_routerl_cowboy_rest_tests.erl | @author < >
( C ) 2016
%%%
%%% This software is free software; you can redistribute it and/or
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
%%% License, or (at your option) any later version.
%%%
%%% This software is dist... | null | https://raw.githubusercontent.com/hachreak/swagger_routerl/3005b789f8c09b58894b15fe31ee699630553338/test/swagger_routerl_cowboy_rest_tests.erl | erlang |
This software is free software; you can redistribute it and/or
License, or (at your option) any later version.
This software 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... | @author < >
( C ) 2016
modify it under the terms of the GNU General Public License as
published by the Free Software Foundation ; either version 2 of the
You should have received a copy of the GNU General Public License
along with this software ; if not , write to the Free Software Foundation ,
Inc.... |
f91665d832240b094625c59ad5221a65e3fe91a281ace703b5ff750dba1b277f | logicmoo/logicmoo_nlu | clecteur.lsp | ; mini-Cprolog & mini-PrologII
; cparser.lsp
;
(defvar *lvarloc nil) ; list of local vars
(defvar *lvarglob nil) ; list of global vars
(set-macro-character #\% (get-macro-character #\;))
skips
(do ((ch (read-char) (read-char)))
((char/= ch #\Newline) ch)))
skips and Sp... | null | https://raw.githubusercontent.com/logicmoo/logicmoo_nlu/c066897f55b3ff45aa9155ebcf799fda9741bf74/ext/e2c/microUt/clecteur.lsp | lisp | mini-Cprolog & mini-PrologII
cparser.lsp
list of local vars
list of global vars
))
symbol normal constituant
next integer
next normal symbol
next special symbol
next variable
n is the term's depth
local if not yet global
else global
next simple term
next functional term
reads its arguments
adds its des... |
skips
(do ((ch (read-char) (read-char)))
((char/= ch #\Newline) ch)))
skips and Space
(do ((ch (rch) (rch)))
((char/= ch #\space) ch)))
(defun special (ch) (char= ch '#\_))
(or (alphanumericp ch) (special ch)))
(defun valdigit (ch) (digit-char-p ch))
(do ((v (valdigit ch) (+ (* v 10) (va... |
24a7d25b8bed9b0e9a5cd6c3da5ad021594d1b2b06f59610ff9ffa6ac518b1db | ates/netspire-core | mod_mschap_v2.erl | -module(mod_mschap_v2).
-behaviour(gen_module).
%% API
-export([verify_mschap_v2/6]).
%% gen_module callbacks
-export([start/1, stop/0]).
-include("../netspire.hrl").
-include("../radius/radius.hrl").
start(_Options) ->
?INFO_MSG("Starting dynamic module ~p~n", [?MODULE]),
netspire_hooks:add(radius_auth, ?... | null | https://raw.githubusercontent.com/ates/netspire-core/746c0f254aa6f2669040d954096b4a95ae58b3ce/src/modules/mod_mschap_v2.erl | erlang | API
gen_module callbacks | -module(mod_mschap_v2).
-behaviour(gen_module).
-export([verify_mschap_v2/6]).
-export([start/1, stop/0]).
-include("../netspire.hrl").
-include("../radius/radius.hrl").
start(_Options) ->
?INFO_MSG("Starting dynamic module ~p~n", [?MODULE]),
netspire_hooks:add(radius_auth, ?MODULE, verify_mschap_v2).
sto... |
bf87715f890f54ec266bfa24d7d298138e68ee184cf784ecea4e2a4072564fe6 | KULeuven-CS/CPL | syntax.rkt | #lang eopl
(provide (all-defined-out))
;;; Syntax
(define-datatype program program?
(a-program (exp1 expression?)))
(define-datetype ref ref?
(ref (num number?))
(define newref
(lambda (val)
))
(define-datatype expression expression?
(const-exp (num number?))
(diff-exp (exp1 expression?) (exp2 expression?)... | null | https://raw.githubusercontent.com/KULeuven-CS/CPL/0c62cca832edc43218ac63c4e8233e3c3f05d20a/chapter5/5.9%20IMPLICITREFS-CONT/syntax.rkt | racket | Syntax | #lang eopl
(provide (all-defined-out))
(define-datatype program program?
(a-program (exp1 expression?)))
(define-datetype ref ref?
(ref (num number?))
(define newref
(lambda (val)
))
(define-datatype expression expression?
(const-exp (num number?))
(diff-exp (exp1 expression?) (exp2 expression?))
(zero?-... |
2a1f778c0c03638ddcefa690b9dcaec98a098b1e6c8d4786d6a377847186188e | dhleong/wish | shared.cljs | (ns wish.sheets.dnd5e.views.shared
(:require [spade.core :refer [defattrs]]
[wish.style.flex :as flex]
[wish.util :refer [<sub]]
[wish.views.widgets.error-boundary :refer [error-boundary]]
[wish.sheets.dnd5e.subs :as subs]))
(defn buff-kind->attrs [buff-kind]
(when b... | null | https://raw.githubusercontent.com/dhleong/wish/db5d22763d9bce17dd5af22754de47c6dcacc68e/src/cljs/wish/sheets/dnd5e/views/shared.cljs | clojure | (ns wish.sheets.dnd5e.views.shared
(:require [spade.core :refer [defattrs]]
[wish.style.flex :as flex]
[wish.util :refer [<sub]]
[wish.views.widgets.error-boundary :refer [error-boundary]]
[wish.sheets.dnd5e.subs :as subs]))
(defn buff-kind->attrs [buff-kind]
(when b... | |
95364b99778a7a5ae0048a4d573e0c2fe514e9f4b44c408832186d8ab726e673 | gafiatulin/codewars | Razor.hs | Hutton 's Razor
/
module Razor where
data Razor = Lit Int | Add Razor Razor
interpret :: Razor -> Int
interpret (Lit a) = a
interpret (Add a b) = interpret a + interpret b
pretty :: Razor -> String
pretty (Lit a) = show a
pretty (Add a b) = "(" ++ pretty a ++ "+" ++ pretty b ++ ")"
| null | https://raw.githubusercontent.com/gafiatulin/codewars/535db608333e854be93ecfc165686a2162264fef/src/6%20kyu/Razor.hs | haskell | Hutton 's Razor
/
module Razor where
data Razor = Lit Int | Add Razor Razor
interpret :: Razor -> Int
interpret (Lit a) = a
interpret (Add a b) = interpret a + interpret b
pretty :: Razor -> String
pretty (Lit a) = show a
pretty (Add a b) = "(" ++ pretty a ++ "+" ++ pretty b ++ ")"
| |
b96ee30dc67e48c42e4866874b7b7dc8a3b0a38e21a745c6ba2b2ee785d6a63a | dwayne/eopl3 | interpreter.rkt | #lang eopl
(require "./env.rkt")
(require "./parser.rkt")
(require "./store.rkt")
(provide
;; Expressed Values
num-val bool-val
;; Interpreter
run)
(define (run s)
(initialize-store!)
(let ([init-env (extend-env
'(i v x)
(map newref (list (num-val 1)
... | null | https://raw.githubusercontent.com/dwayne/eopl3/9d5fdb2a8dafac3bc48852d49cda8b83e7a825cf/solutions/04-ch4/interpreters/racket/IMPLICIT-REFS-4.17/interpreter.rkt | racket | Expressed Values
Interpreter
Procedure ADT
Values
ExpVal = Int + Bool + Proc | #lang eopl
(require "./env.rkt")
(require "./parser.rkt")
(require "./store.rkt")
(provide
num-val bool-val
run)
(define (run s)
(initialize-store!)
(let ([init-env (extend-env
'(i v x)
(map newref (list (num-val 1)
(num-val 5)
... |
bd149daf8eacc27e27d69c540a3811963eb3ec82e8981af14cac7087298c2056 | mischief901/gen_quic | quic_registry.erl | %%%-------------------------------------------------------------------
@author >
( C ) 2018 ,
%%% @doc
%%% This is the register for keeping track of each separate socket.
%%% These functions are called by start_link using {via, quic_registry, Socket}.
%%% This will need to be wrapped into a gen_server so tha... | null | https://raw.githubusercontent.com/mischief901/gen_quic/9f0211a16548fff69738027e3ddcfd16a464fe40/src/quic_registry.erl | erlang | -------------------------------------------------------------------
@doc
This is the register for keeping track of each separate socket.
These functions are called by start_link using {via, quic_registry, Socket}.
This will need to be wrapped into a gen_server so that all the lookups and
mutations are kept atomic... | @author >
( C ) 2018 ,
-module(quic_registry).
-export([start/0]).
-export([register_name/2, unregister_name/1]).
-export([register_stream/2, unregister_stream/1]).
-export([register_conn_id/2, unregister_conn_id/1]).
-export([whereis_name/1]).
-export([whereis_conn_id/1]).
-export([send/2]).
-define(TABL... |
8e9bf19448695e8ac3922ea00b41c884f74717561559d41f9ae4be6ea7feb89a | ericclack/overtone-loops | pattern_04_09.clj | (ns overtone-loops.dph-book.pattern-04-09
(:use [overtone.live]
[overtone-loops.loops]))
Define some samples from Freesound.org
(def closed-hh (freesound2 404890))
(def snare (freesound2 404859))
(def kick (freesound2 171104))
(def ride-bell (freesound2 171482))
(def crash (freesound2 439789))
(def clap (f... | null | https://raw.githubusercontent.com/ericclack/overtone-loops/54b0c230c1e6bd3d378583af982db4e9ae4bda69/src/overtone_loops/dph_book/pattern_04_09.clj | clojure | Stop any currently playing music and clear any patterns
BAR1
---------------------------------------------
(stop) | (ns overtone-loops.dph-book.pattern-04-09
(:use [overtone.live]
[overtone-loops.loops]))
Define some samples from Freesound.org
(def closed-hh (freesound2 404890))
(def snare (freesound2 404859))
(def kick (freesound2 171104))
(def ride-bell (freesound2 171482))
(def crash (freesound2 439789))
(def clap (f... |
e2d9a6b8f644301f881716f8ce2740df42d5fea09ff0b3279b0fe6bd3368e157 | janestreet/async_unix | tcp.mli | * [ ] supports connection to [ inet ] sockets and [ unix ] sockets .
These are two different types . We use [ ' a ] to specify a socket to
connect to , where the [ ' a ] identifies the type of socket .
These are two different types. We use ['a Where_to_connect.t] to specify a socket to
connect t... | null | https://raw.githubusercontent.com/janestreet/async_unix/e38241dc5c2ffad9842b0100ffbc44fb7941bfe2/src/tcp.mli | ocaml | * A [Where_to_connect] describes the socket that a tcp client should connect to.
* [bind_to_address] and [bind_to_port] can be used to bind the source IP and port of
the underlying socket. This does not necessarily alter the interface used to send
the data. In particular, the commonly used destination-ba... | * [ ] supports connection to [ inet ] sockets and [ unix ] sockets .
These are two different types . We use [ ' a ] to specify a socket to
connect to , where the [ ' a ] identifies the type of socket .
These are two different types. We use ['a Where_to_connect.t] to specify a socket to
connect t... |
ebd65448dc55745e7e62ae610df041d6d8c97866785608acaca5383c797e31dd | Vetd-Inc/vetd-app | admin_settings.cljs | (ns vetd-admin.overlays.admin-settings
(:require [vetd-app.ui :as ui]
[vetd-app.util :as util]
[reagent.core :as r]
[re-frame.core :as rf]
[re-com.core :as rc]))
(rf/reg-event-fx
:a/create-community
(fn [{:keys [db]} [_ community-name admin-org-id]]
{:ws-send {... | null | https://raw.githubusercontent.com/Vetd-Inc/vetd-app/9b33b1443b9d84d39305a63fc58119f8e014cf11/src/cljs/admin/vetd_admin/overlays/admin_settings.cljs | clojure | (ns vetd-admin.overlays.admin-settings
(:require [vetd-app.ui :as ui]
[vetd-app.util :as util]
[reagent.core :as r]
[re-frame.core :as rf]
[re-com.core :as rc]))
(rf/reg-event-fx
:a/create-community
(fn [{:keys [db]} [_ community-name admin-org-id]]
{:ws-send {... | |
1faeafd3467fd1877e8659d05cf429cac7eb10985c87b5aa7f98bfbf98e77b16 | borodust/notalone | player.lisp | (cl:in-package :notalone)
px / sec
(defclass player (movable renderable)
((dead-p :initform nil :reader dead-p)))
(defun kill-player (player)
(with-slots (dead-p) player
(setf dead-p t)))
(defgeneric look-at (player x y)
(:method (player x y)))
(defmethod look-at ((player player) x y)
(setf (angl... | null | https://raw.githubusercontent.com/borodust/notalone/f914ec7b63618f917a976f49ff9fcd57b72a1b1d/player.lisp | lisp | (cl:in-package :notalone)
px / sec
(defclass player (movable renderable)
((dead-p :initform nil :reader dead-p)))
(defun kill-player (player)
(with-slots (dead-p) player
(setf dead-p t)))
(defgeneric look-at (player x y)
(:method (player x y)))
(defmethod look-at ((player player) x y)
(setf (angl... | |
f64b4dbabec9327ab35c3c20dceca7f9324a3e8094ba1f91c5f794f6c12c2d1f | acl2/acl2 | package.lsp | (acl2::in-package "ACL2")
; The following comment line tells the build system that if *acl2-exports*
; changes, then every book that uses this file should be recertified:
; (depends-on "build/acl2-exports.certdep" :dir :system)
(include-book "data-structures/portcullis" :dir :system)
(include-book "coi/symbol-fns/por... | null | https://raw.githubusercontent.com/acl2/acl2/f64742cc6d41c35f9d3f94e154cd5fd409105d34/books/acl2s/package.lsp | lisp | The following comment line tells the build system that if *acl2-exports*
changes, then every book that uses this file should be recertified:
(depends-on "build/acl2-exports.certdep" :dir :system)
Put any symbols we want exported to other packages here. This allows
=> I really want this to be undefined since we def... | (acl2::in-package "ACL2")
(include-book "data-structures/portcullis" :dir :system)
(include-book "coi/symbol-fns/portcullis" :dir :system)
us to export symbols in the ACL2S package , such as functions defined
in utilities.lisp to DEFDATA , CGEN , etc .
(defpkg "ACL2S-SHARED"
(append
'(pkgp
fix-sym
... |
42392d0fc9b7b6b86ac8da058b7d2b5590f558e864992e621969376de07e03a0 | melange-re/melange | ext_pp.ml | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* 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 , either version 3 of the License , or
* ( at your option ) any later... | null | https://raw.githubusercontent.com/melange-re/melange/24083b39f10d8df40a786d890d7530b514ba70a4/jscomp/ext/ext_pp.ml | ocaml | only when we print newline, we print the indent
let indent t n =
t.indent_level <- t.indent_level + n | Copyright ( C ) 2015 - 2016 Bloomberg Finance L.P.
*
* 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 , either version 3 of the License , or
* ( at your option ) any later... |
77f3a330f1d7bf0e61e0b847b4092385bfaf131f5d4eecb4785e49a8d6fc0dc2 | haskell-mafia/mafia | Index.hs | # LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
# LANGUAGE ScopedTypeVariables #
module Mafia.Cabal.Index
( createIndexFile
, readIndexFile
, repairIndexFile
) where
import Control.Exception (IOException)
import Control.Monad.Catch (catch)
import Control.Monad.Tr... | null | https://raw.githubusercontent.com/haskell-mafia/mafia/529440246ee571bf1473615e6218f52cd1e990ae/src/Mafia/Cabal/Index.hs | haskell | # LANGUAGE OverloadedStrings #
----------------------------------------------------------------------
----------------------------------------------------------------------
----------------------------------------------------------------------
----------------------------------------------------------------------
This... | # LANGUAGE NoImplicitPrelude #
# LANGUAGE ScopedTypeVariables #
module Mafia.Cabal.Index
( createIndexFile
, readIndexFile
, repairIndexFile
) where
import Control.Exception (IOException)
import Control.Monad.Catch (catch)
import Control.Monad.Trans.Either (EitherT, hoistEither)
... |
9c1c81cadb3cdbfd1c4647251221c2ab89b19c044d0e44653acab81ff02f51e7 | evilbinary/scheme-lib | math-integer.scm | ; "math-integer.scm": mathematical functions restricted to exact integers
Copyright ( C ) 2006 , 2013
;
;Permission to copy this software, to modify it, to redistribute it,
;to distribute modified versions, and to use it for any purpose is
;granted, subject to the following restrictions and understandings.
;
1 . ... | null | https://raw.githubusercontent.com/evilbinary/scheme-lib/6df491c1f616929caa4e6569fa44e04df7a356a7/packages/slib/math-integer.scm | scheme | "math-integer.scm": mathematical functions restricted to exact integers
Permission to copy this software, to modify it, to redistribute it,
to distribute modified versions, and to use it for any purpose is
granted, subject to the following restrictions and understandings.
in full.
this software will be error-free, ... | Copyright ( C ) 2006 , 2013
1 . Any copy made of this software must include this copyright notice
2 . I have made no warranty or representation that the operation of
3 . In conjunction with products arising from the use of this
srfi-60
Returns @1 raised to the power @2 if that result is an exact
0 @2 ... |
5c3f4981332043442dd50561b2883354812783d49c98f104b7bf966caa195016 | manifest/pal | pal_http.erl | %% ----------------------------------------------------------------------------
%% The MIT License
%%
Copyright ( c ) 2014 - 2015 < >
%%
%% 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... | null | https://raw.githubusercontent.com/manifest/pal/07711ca02635895af78be5105c7fa7c9bbd4e896/src/pal_http.erl | erlang | ----------------------------------------------------------------------------
The MIT License
Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to
rights to use, copy, modify, merge, publish, distribute, sublicense, a... | Copyright ( c ) 2014 - 2015 < >
deal in the Software without restriction , including without limitation the
sell copies of the Software , and to permit persons to whom the Software is
all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND , EX... |
3f28adeb702b39d28add2aab1d69330f81653beb1cf3ddd3e9ab291c0ed79232 | brianhempel/maniposynth | fold.ml | let rec fold f list acc =
match list with
| hd :: tail ->
let acc' = f hd acc [@@pos 158, 121] in
let fold_rest = fold f tail acc' [@@pos 106, 5] in
fold_rest
| [] -> acc
[@@pos 1022, 329]
let fold_List = fold List.cons [ 1; 2; 3 ] [] [@@pos 1472, 339]
| null | https://raw.githubusercontent.com/brianhempel/maniposynth/8cb8e0c84db2ffb51feae2fccb10dbff40c4e0e0/expert_eval_manual/fold.ml | ocaml | let rec fold f list acc =
match list with
| hd :: tail ->
let acc' = f hd acc [@@pos 158, 121] in
let fold_rest = fold f tail acc' [@@pos 106, 5] in
fold_rest
| [] -> acc
[@@pos 1022, 329]
let fold_List = fold List.cons [ 1; 2; 3 ] [] [@@pos 1472, 339]
| |
0f4ddfcf5fd6c28c73bf891be72804c7c7e1f7c6eca91c83a2f31fd7dcb15258 | fujita-y/digamma | destruc.scm | ;;; DESTRUC -- Destructive operation benchmark.
(define (append-to-tail! x y)
(if (null? x)
y
(let loop ((a x) (b (cdr x)))
(if (null? b)
(begin
(set-cdr! a y)
x)
(loop b (cdr b))))))
(define (destructive n m)
(let ((l (do ((i 10 (- i 1)) (a '() (cons '() a)))
... | null | https://raw.githubusercontent.com/fujita-y/digamma/5a31f9fd67737fd857ada643d5548155a2ed0e76/bench/gambit-benchmarks/destruc.scm | scheme | DESTRUC -- Destructive operation benchmark. |
(define (append-to-tail! x y)
(if (null? x)
y
(let loop ((a x) (b (cdr x)))
(if (null? b)
(begin
(set-cdr! a y)
x)
(loop b (cdr b))))))
(define (destructive n m)
(let ((l (do ((i 10 (- i 1)) (a '() (cons '() a)))
((= i 0) a))))
(do ((i n (- i 1)... |
ee86e0b4a018f81f12a3ac804a2e031e2fdcb8f2c563bafe203327e804e31227 | torkve/melange-seawar | gui.ml | open Unix;;
open Message;;
(* gui elements creation *)
let boarditem_of_data x y state =
let cppobj = BoardItem.create_BoardItem () in
object(self)
inherit BoardItem.base_BoardItem cppobj as super
val mutable state_ = state
method cellX () = x
method cellY () = y
method... | null | https://raw.githubusercontent.com/torkve/melange-seawar/e1633ef088a2dbf893536a7ba2fa8a72eac198ec/gui.ml | ocaml | gui elements creation
Main
make a shot and get result
receive a shot and send response
select next state | open Unix;;
open Message;;
let boarditem_of_data x y state =
let cppobj = BoardItem.create_BoardItem () in
object(self)
inherit BoardItem.base_BoardItem cppobj as super
val mutable state_ = state
method cellX () = x
method cellY () = y
method cellState () = state_
... |
b770dcb13f75a0c3b1b31723be5caa6defa22f4357fb97768dc57e8590b8e6df | quil-lang/qvm | utilities.lisp | ;;;; tests/utilities.lisp
;;;;
Author :
(in-package #:qvm-tests)
(defmacro run-unless-environment-has (env-var &body body)
(alexandria:once-only (env-var)
`(cond
((uiop:getenvp ,env-var)
(skip))
(t
,@body))))
(defmacro with-output-to-quil (&body body)
`(let ((quil:*allow-unr... | null | https://raw.githubusercontent.com/quil-lang/qvm/de95ead6e7df70a1f8e0212455a802bd0cef201c/tests/utilities.lisp | lisp | tests/utilities.lisp
:underflow nil
:division-by-zero nil
:invalid nil
:inexact nil
Doc string | Author :
(in-package #:qvm-tests)
(defmacro run-unless-environment-has (env-var &body body)
(alexandria:once-only (env-var)
`(cond
((uiop:getenvp ,env-var)
(skip))
(t
,@body))))
(defmacro with-output-to-quil (&body body)
`(let ((quil:*allow-unresolved-applications* t))
... |
137878bb6e4a904acd27c1f5f2b12300dcbee755d3a095fc5bad3cec3be2c184 | christian-marie/oauth2-server | Base.hs | --
Copyright © 2013 - 2015 Anchor Systems , Pty Ltd and Others
--
-- The code in this file, and the program it is a part of, is
-- made available to you by its authors as open source software:
-- you can redistribute it and/or modify it under the terms of
the 3 - clause BSD licence .
--
-- | Description: OAuth2 to... | null | https://raw.githubusercontent.com/christian-marie/oauth2-server/ebb75be9d05dd52d478a6e069d32461d4e54544e/lib/Network/OAuth2/Server/Store/Base.hs | haskell |
The code in this file, and the program it is a part of, is
made available to you by its authors as open source software:
you can redistribute it and/or modify it under the terms of
| Description: OAuth2 token storage class and data definitions
OAuth2 token storage class and data definitions
| Standard logging... | Copyright © 2013 - 2015 Anchor Systems , Pty Ltd and Others
the 3 - clause BSD licence .
module Network.OAuth2.Server.Store.Base (
TokenStore(..),
StoreStats(..),
defaultStoreStats,
logName,
) where
import Crypto.Scrypt (EncryptedPass)
import Data.Int (... |
d9715de8e03af9daf05bee5d65cc939e3e42483311636748e6e84f084f02dcad | macchiato-framework/macchiato-core | restful_format.cljs | (ns macchiato.middleware.restful-format
(:require
[cljs.nodejs :as node]
[cognitect.transit :as t]
[cljs.reader :as edn]
[macchiato.util.request :as rq]
[macchiato.util.response :as r]))
(def concat-stream (node/require "concat-stream"))
(def ct (node/require "content-type"))
(def lru (let [LRU... | null | https://raw.githubusercontent.com/macchiato-framework/macchiato-core/14eac3dbc561927ee61b6127f30ef0b0269b2af6/src/macchiato/middleware/restful_format.cljs | clojure | request content type multimethods for decoding the request body | (ns macchiato.middleware.restful-format
(:require
[cljs.nodejs :as node]
[cognitect.transit :as t]
[cljs.reader :as edn]
[macchiato.util.request :as rq]
[macchiato.util.response :as r]))
(def concat-stream (node/require "concat-stream"))
(def ct (node/require "content-type"))
(def lru (let [LRU... |
06d1bb5275944cf23c199a672594d3dfc0fce96cb586c308e572a0a48d8c529d | ralt/network-addresses | address.lisp | (in-package #:network-addresses)
(defclass address ()
((integer-value :initarg :integer-value :reader as-int)))
| null | https://raw.githubusercontent.com/ralt/network-addresses/b7ce23eafcdf6e337a09bdf19d0314842d99482e/src/address.lisp | lisp | (in-package #:network-addresses)
(defclass address ()
((integer-value :initarg :integer-value :reader as-int)))
| |
bf611891806ff1c65d42aba482a60bb30b538108fac4764e0e40cf3e316eec62 | ghc/testsuite | SafeLang11_B.hs | # LANGUAGE TemplateHaskell #
module SafeLang11_B ( Class(..), mkSimpleClass ) where
import Language.Haskell.TH
class Class a where
c :: a
mkSimpleClass :: Name -> Q [Dec]
mkSimpleClass name = do
TyConI (DataD [] dname [] cs _) <- reify name
((NormalC conname []):_) <- return cs
ClassI (ClassD [] cname [_] [] [Si... | null | https://raw.githubusercontent.com/ghc/testsuite/998a816ae89c4fd573f4abd7c6abb346cf7ee9af/tests/safeHaskell/safeLanguage/SafeLang11_B.hs | haskell | # LANGUAGE TemplateHaskell #
module SafeLang11_B ( Class(..), mkSimpleClass ) where
import Language.Haskell.TH
class Class a where
c :: a
mkSimpleClass :: Name -> Q [Dec]
mkSimpleClass name = do
TyConI (DataD [] dname [] cs _) <- reify name
((NormalC conname []):_) <- return cs
ClassI (ClassD [] cname [_] [] [Si... | |
59b48cffe8257238aa3390a5abee12855f7163582d0860d7be7b871c258d35e7 | txkaduo/weixin-mp-sdk | JS.hs | module WeiXin.PublicPlatform.JS where
{ { { 1 imports
import ClassyPrelude
#if MIN_VERSION_base(4, 13, 0)
import Control . ( MonadFail ( .. ) )
#else
import Control.Monad.Reader (asks)
#endif
import qualified Crypto.Hash.SHA1 as SHA1
import qualified Data.ByteString.Base16 as B16
import ... | null | https://raw.githubusercontent.com/txkaduo/weixin-mp-sdk/994ca99eed5d3cfdf32be1cfbf33c36bb7a1ab2e/WeiXin/PublicPlatform/JS.hs | haskell | ^ random string
^ API list
| 因为目前没找到可能的方法在服务器端能确保取出当前页面的URL
(它依赖配置文件而变)
目前的解释办法是:调用者(服务器端)提供一个它认为正确的url
js 里(客户端)判断当前页面与服务器预期的不一致的话,
则重定向至服务器预期的地址上去
^ API list
必填,生成签名的时间戳
必填,生成签名的随机串
必填,需要使用的JS接口列表,所有JS接口列表见附录2
| 传播类菜单项列表
| 保护类菜单项列表 | module WeiXin.PublicPlatform.JS where
{ { { 1 imports
import ClassyPrelude
#if MIN_VERSION_base(4, 13, 0)
import Control . ( MonadFail ( .. ) )
#else
import Control.Monad.Reader (asks)
#endif
import qualified Crypto.Hash.SHA1 as SHA1
import qualified Data.ByteString.Base16 as B16
import ... |
1d272c1756679296873c5951c5b05f7c944f8401160b8b2421e744f37e7c8966 | BranchTaken/Hemlock | test_push_back.ml | open! Basis.Rudiments
open! Basis
open Deq
let test () =
let rec fn i n t = begin
match i <= n with
| false -> ()
| true -> begin
let t' = push_back i t in
File.Fmt.stdout
|> Fmt.fmt "push_back "
|> Uns.pp i
|> Fmt.fmt " "
|> (pp Uns.pp) t
|> Fmt.fm... | null | https://raw.githubusercontent.com/BranchTaken/Hemlock/f3604ceda4f75cf18b6ee2b1c2f3c5759ad495a5/bootstrap/test/basis/deq/test_push_back.ml | ocaml | open! Basis.Rudiments
open! Basis
open Deq
let test () =
let rec fn i n t = begin
match i <= n with
| false -> ()
| true -> begin
let t' = push_back i t in
File.Fmt.stdout
|> Fmt.fmt "push_back "
|> Uns.pp i
|> Fmt.fmt " "
|> (pp Uns.pp) t
|> Fmt.fm... | |
8a0a569c6df72b9bff18cd91147b2adca985d0e185bca501cd331237254f56eb | Storkle/clj-forex | general.clj |
(ns forex.util.general
(:require [clojure.contrib.str-utils2 :as s] clojure.string)
(:import java.lang.management.ManagementFactory)
(:require [matchure :as m]
[clojure.contrib.def :as d])
(:use clojure.contrib.macro-utils))
(defmacro for+ [args & body]
(let [a (partition-all 2 args)]
`(ma... | null | https://raw.githubusercontent.com/Storkle/clj-forex/1800b982037b821732b9df1e2e5ea1eda70f941f/src/forex/util/general.clj | clojure |
copied from
WARNING: this can screw up protocols implemented on existing object - i.e. replace them, they no longer work! so you have to create new object. how to fix this???...
TODO: get rid of!
this should be done in a thread pool!
TAKEN FROM debug-repl |
(ns forex.util.general
(:require [clojure.contrib.str-utils2 :as s] clojure.string)
(:import java.lang.management.ManagementFactory)
(:require [matchure :as m]
[clojure.contrib.def :as d])
(:use clojure.contrib.macro-utils))
(defmacro for+ [args & body]
(let [a (partition-all 2 args)]
`(ma... |
94761ef66103ff7538ca6e7bbae3ddaa4a9b80d51f518044599d69a57e284c26 | CoucouInc/coucoubot | Plugin_search.ml |
* { 1 Search plugin }
open Calculon
module Db = Sqlite3_utils
(* schema is:
[
CREATE VIRTUAL TABLE irc using fts3(author, msg, date);
]
*)
type state = {
db: Db.t;
}
let cmd_search state =
Command.make_simple
~descr:"search in logs sneakily" ~cmd:"nsa" ~prio:10
(fun msg s ->
let s = String... | null | https://raw.githubusercontent.com/CoucouInc/coucoubot/71d664da513fba17c283a4e68d354a79cecc59c1/src/Plugin_search.ml | ocaml | schema is:
[
CREATE VIRTUAL TABLE irc using fts3(author, msg, date);
]
update logs
log only public messages that are not commands |
* { 1 Search plugin }
open Calculon
module Db = Sqlite3_utils
type state = {
db: Db.t;
}
let cmd_search state =
Command.make_simple
~descr:"search in logs sneakily" ~cmd:"nsa" ~prio:10
(fun msg s ->
let s = String.trim s in
if s = "" then Lwt.return_none
else if not (Core.is_chan... |
d18b0a6f9442919d491f295e90b67aa864e4fb4d8a190cb5ff716586edf4389b | samrocketman/home | lowry-auto-contrast.scm | ;
; The GIMP -- an image manipulation program
Copyright ( C ) 1995 and
;
Auto Contrast Correction script for GIMP 2.4
Original author :
;
; Tags: color, photo, exposure
;
; Author statement:
;
; Automatically adjusts contrast of the current
; drawable by duplicating the layer, setting the
; new layer to V... | null | https://raw.githubusercontent.com/samrocketman/home/63a8668a71dc594ea9ed76ec56bf8ca43b2a86ca/dotfiles/.gimp/scripts/lowry-auto-contrast.scm | scheme |
The GIMP -- an image manipulation program
Tags: color, photo, exposure
Author statement:
Automatically adjusts contrast of the current
drawable by duplicating the layer, setting the
new layer to Value blend mode, then running
--------------------------------------------------------------------
-----------... | Copyright ( C ) 1995 and
Auto Contrast Correction script for GIMP 2.4
Original author :
Auto Levels on the Value layer .
Distributed by Gimp FX Foundry project
Created 4/5/2006
it under the terms of the GNU General Public License as published by
You should have received a copy of the GNU General... |
24356f42b880bb36bcd68040b8e5aa05e0e3609f5f8066e2594ef6b8014fd98c | cirodrig/triolet | Main.hs | # LANGUAGE ForeignFunctionInterface #
module Main(main) where
import Control.Exception
import Control.Monad
import Data.Binary
import System.Cmd
import System.CPUTime
import System.Directory
import System.Environment
import System.Exit
import System.FilePath
import System.IO
import Text.PrettyPrint.HughesPJ
import In... | null | https://raw.githubusercontent.com/cirodrig/triolet/e515a1dc0d6b3e546320eac7b71fb36cea5b53d0/src/program/Main.hs | haskell | import qualified SystemF.ConSpecialization as SystemF
Do work
| Run a task. This is the entry point for each stage of the
compiler.
Read the core module.
The module was loaded during initialization.
Lower the core module.
Most optimizations are skipped.
Note that flattening may introduce shadowing, so detecti... | # LANGUAGE ForeignFunctionInterface #
module Main(main) where
import Control.Exception
import Control.Monad
import Data.Binary
import System.Cmd
import System.CPUTime
import System.Directory
import System.Environment
import System.Exit
import System.FilePath
import System.IO
import Text.PrettyPrint.HughesPJ
import In... |
87a0b3cb837d6869be53d08b5fb90acd2d851bf47f54a6b7f6fe0d45e4b486fe | mumuki/mulang | ExpectationsAnalyzerSpec.hs | module ExpectationsAnalyzerSpec(spec) where
import Language.Mulang
import Language.Mulang.Analyzer hiding (result, spec)
import Test.Hspec
result expectationResults smells
= emptyCompletedAnalysisResult { expectationResults = expectationResults, smells = smells }
run language content ... | null | https://raw.githubusercontent.com/mumuki/mulang/92684f687566b2adafb331eae5b5916e2d90709e/spec/ExpectationsAnalyzerSpec.hs | haskell | module ExpectationsAnalyzerSpec(spec) where
import Language.Mulang
import Language.Mulang.Analyzer hiding (result, spec)
import Test.Hspec
result expectationResults smells
= emptyCompletedAnalysisResult { expectationResults = expectationResults, smells = smells }
run language content ... | |
744242986dd04107a3113130a491974bb09181da1c6af9f65afeb6b55c53c8a4 | arrdem/oxcart | util_test.clj | Copyright ( c ) , Rich Hickey & contributors . 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... | null | https://raw.githubusercontent.com/arrdem/oxcart/38c3247dabe904b3c067385a7d64c5f4f65ccc09/test/oxcart/util_test.clj | clojure | 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 this
... | Copyright ( c ) , Rich Hickey & contributors . The use
(ns oxcart.util-test
(:require [oxcart.util :refer :all]
[clojure.test :refer :all]))
(deftest take-when-test
(is (= [1 [2 3]]
(take-when (constantly true)
[1 2 3])))
(is (= [nil [1 2 3]]
(take-when ... |
b34d7efd215bee0855230c682b3a412de7a4a03301d620cc48c854dbb34b5258 | reach-sh/reach-lang | BinaryLeafTree.hs | module Reach.BinaryLeafTree
( bltM
, bltL
, BLT (..)
)
where
import qualified Data.Map.Strict as M
import qualified Data.Sequence as S
data BLT i a
= Empty
| Leaf i Bool a
| Branch i (BLT i a) (BLT i a)
instance Show i => Show (BLT i a) where
show = \case
Empty -> "."
Leaf i _ _ -> show i
... | null | https://raw.githubusercontent.com/reach-sh/reach-lang/c62a9e7f34338db76ec8a915e889ad9182b57bba/hs/src/Reach/BinaryLeafTree.hs | haskell | XXX incorporate into this the logic of when you need to check a leaf
and when you don't if you know the low/hi | module Reach.BinaryLeafTree
( bltM
, bltL
, BLT (..)
)
where
import qualified Data.Map.Strict as M
import qualified Data.Sequence as S
data BLT i a
= Empty
| Leaf i Bool a
| Branch i (BLT i a) (BLT i a)
instance Show i => Show (BLT i a) where
show = \case
Empty -> "."
Leaf i _ _ -> show i
... |
1bf2043a70a81c26bf5c1f038ca49110639d57497666cf058032db3fb42bd295 | sgbj/MaximaSharp | odeutils.lisp | Author
University of Nebraska at Kearney
Copyright ( C ) 2004 ,
Brief Description : Maxima code for linear homogeneous second order
;; differential equations.
Maxima odelin is free software ; you can redistribute it and/or
modify it under the terms of the GNU General Public License ,
;; .
Maxima od... | null | https://raw.githubusercontent.com/sgbj/MaximaSharp/75067d7e045b9ed50883b5eb09803b4c8f391059/Test/bin/Debug/Maxima-5.30.0/share/maxima/5.30.0/share/contrib/diffequations/odeutils.lisp | lisp | differential equations.
you can redistribute it and/or
.
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Map the function f onto a mbag and simplify the result. When the
bag is an equality, list, or matrix, simplification isn't needed;
however, new types of bags (say sets) may need simplification after
t... | Author
University of Nebraska at Kearney
Copyright ( C ) 2004 ,
Brief Description : Maxima code for linear homogeneous second order
modify it under the terms of the GNU General Public License ,
Maxima odelin has NO WARRANTY , not even the implied warranty of
($put '$odeutils 1 '$version)
Maxima ... |
ba66eda6ac98df79ffb842236dad4679bcaaa9962d20d7a64fcf3e6bfa6fbfbe | HugoPeters1024/hs-sleuth | Lazy.hs | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE BangPatterns , MagicHash , CPP , TypeFamilies #
# LANGUAGE Trustworthy #
{-# LANGUAGE TemplateHaskellQuotes #-}
-- |
-- Module : Data.Text.Lazy
Copyright : ( c ) 2009 , 2010 , 2012
--
-- License : BSD-style
-- Maintainer :
Portability : GHC
--
A ti... | null | https://raw.githubusercontent.com/HugoPeters1024/hs-sleuth/91aa2806ea71b7a26add3801383b3133200971a5/test-project/text-nofusion/src/Data/Text/Lazy.hs | haskell | # LANGUAGE TemplateHaskellQuotes #
|
Module : Data.Text.Lazy
License : BSD-style
Maintainer :
lists of packed arrays.
/Note/: Read below the synopsis for important notes on the use of
this module.
The representation used by this module is suitable for high
performance use and for streaming large... | # OPTIONS_GHC -fno - warn - orphans #
# LANGUAGE BangPatterns , MagicHash , CPP , TypeFamilies #
# LANGUAGE Trustworthy #
Copyright : ( c ) 2009 , 2010 , 2012
Portability : GHC
A time and space - efficient implementation of Unicode text using
operations , lazy ' Text 's are usually within a few percent of... |
84e132af1213fa99b7611178d67dfc037d8e72a9ed7eb819b06b9239cd3ea208 | ghcjs/ghcjs | t5712.hs | {-# LANGUAGE GADTs #-}
module Main where
infix 5 :*:
data T a where
(:*:) :: Int -> a -> T a
(:+:) :: Char -> T a -> T a
deriving( Show )
-- The Show should print (:*:) infix, but (:+:) prefix,
-- since it lacks a fixity declaration
main = print ('x' :+: (3 :*: True))
| null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/deriving/t5712.hs | haskell | # LANGUAGE GADTs #
The Show should print (:*:) infix, but (:+:) prefix,
since it lacks a fixity declaration |
module Main where
infix 5 :*:
data T a where
(:*:) :: Int -> a -> T a
(:+:) :: Char -> T a -> T a
deriving( Show )
main = print ('x' :+: (3 :*: True))
|
d971e48f8ebee7ad348b035316bb3e41fdcc2d1ca33ccc866f2c4d25b6c41924 | xapi-project/xenopsd | xenops_server.ml |
* Copyright ( C ) Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file LI... | null | https://raw.githubusercontent.com/xapi-project/xenopsd/3fe01ff797980017be4ee413ba13c0306ea33cd0/lib/xenops_server.ml | ocaml | * some API calls take a file descriptor argument
use Qmp.add_device
no_sharept
* takes suspend data, plus optionally vGPU state data
* takes suspend data, plus optionally vGPU state data
* used to suppress fast reboot loops
VM id * 'force'
Only if the corresponding VM actually exists
Only if the correspondin... |
* Copyright ( C ) Citrix Systems Inc.
*
* This program is free software ; you can redistribute it and/or modify
* it under the terms of the GNU Lesser General Public License as published
* by the Free Software Foundation ; version 2.1 only . with the special
* exception on linking described in file LI... |
864da6fb5c18e09177031f293b5fb326112173905f4b330bcf5c7aa5414a6999 | kupl/FixML | sub20.ml |
let rec max : int list -> int
= fun lst -> match lst with
| [] -> 0
| h :: t -> if(h > max(t)) then h else max(t);;
| null | https://raw.githubusercontent.com/kupl/FixML/0a032a733d68cd8ccc8b1034d2908cd43b241fce/benchmarks/maxmin/maxmin/submissions/sub20.ml | ocaml |
let rec max : int list -> int
= fun lst -> match lst with
| [] -> 0
| h :: t -> if(h > max(t)) then h else max(t);;
| |
a852afde8399599034364cf50a59276a72d7dcb41d6963c3aa5c7f633392bcad | skruger/ClusterSupervisor | clusterlib.erl | -module(clusterlib).
%%
%% Include files
%%
%%
%% Exported Functions
%%
-export([inet_parse/1,inet_version/1]).
%%
%% API Functions
%%
inet_parse({ip,IP}) ->
inet_parse(IP);
inet_parse({_,_,_,_,_,_,_,_}=IP) ->
IP;
inet_parse({_,_,_,_} = IP) ->
IP;
inet_parse(IPStr) when is_list(IPStr) ->
case inet_parse:address... | null | https://raw.githubusercontent.com/skruger/ClusterSupervisor/92db35944c3da1efdaa8b0b84cc701ad23ee1281/src/clusterlib.erl | erlang |
Include files
Exported Functions
API Functions
Local Functions
| -module(clusterlib).
-export([inet_parse/1,inet_version/1]).
inet_parse({ip,IP}) ->
inet_parse(IP);
inet_parse({_,_,_,_,_,_,_,_}=IP) ->
IP;
inet_parse({_,_,_,_} = IP) ->
IP;
inet_parse(IPStr) when is_list(IPStr) ->
case inet_parse:address(IPStr) of
{ok,IP} ->
IP;
_ ->
error_logger:error_msg("Invalid I... |
03f407bb0011756df0dee472bf98bcaa18399d86385582a6d7ac3ad6f78489fc | skanev/playground | compiler.scm | The section 5.5 compiler .
;
; The only difference is the introduction of let expressions.
(define (compile-exp exp target linkage)
(cond ((self-evaluating? exp)
(compile-self-evaluating exp target linkage))
((quoted? exp) (compile-quoted exp target linkage))
((variable? exp)
(com... | null | https://raw.githubusercontent.com/skanev/playground/d88e53a7f277b35041c2f709771a0b96f993b310/scheme/sicp/05/support/52/compiler.scm | scheme |
The only difference is the introduction of let expressions.
Compiling linkage code
Compiling simple expressions
Compiling conditional expressions
Compiling sequences
Compiling lambda expressions
Compiling combinations
Applying procedures
Applying compiled procedures
Combining Instruction Sequences
Instructi... | The section 5.5 compiler .
(define (compile-exp exp target linkage)
(cond ((self-evaluating? exp)
(compile-self-evaluating exp target linkage))
((quoted? exp) (compile-quoted exp target linkage))
((variable? exp)
(compile-variable exp target linkage))
((assignment? exp)
... |
d5275fcfad3ece7b90edaf87715c41f80eaea790dbad8bdf400d823f85ff6334 | barko/brr-eg | ttt.ml | open Util
type player = X | O
type field =
| Empty
| Marked of player
type turn =
| Playing of player
| Winner of player
| Draw
type t = {
board : field IntMap.t;
turn : turn;
}
let empty = {
board = Seq.fold_left (fun board i -> IntMap.add i Empty board) IntMap.empty (range 9);
turn = Playing X;... | null | https://raw.githubusercontent.com/barko/brr-eg/912ac110fd8ef139e163a086bf3e25e0ccc35740/tic-tac-toe/ttt.ml | ocaml | open Util
type player = X | O
type field =
| Empty
| Marked of player
type turn =
| Playing of player
| Winner of player
| Draw
type t = {
board : field IntMap.t;
turn : turn;
}
let empty = {
board = Seq.fold_left (fun board i -> IntMap.add i Empty board) IntMap.empty (range 9);
turn = Playing X;... | |
e255ac8d553d1a5b54d89616572012c8611b31d110998f646516c982961d2f86 | KeenS/s7p | main.clj | (ns s7p.slave.main
(:gen-class)
(:require
[clojure.tools.logging :as log]
[clojure.core.async :refer [thread close! chan >!! <!!]]
[cheshire.core :as json]
[zeromq.zmq :as zmq]
[s7p.config :as config]
[s7p.slave.manage :as manage]
[s7p.slave.core :as core]))
(defn make-request-handler [reciev... | null | https://raw.githubusercontent.com/KeenS/s7p/d3230114b8e8bd4ac292012b5ae0b53ba6df2bc9/src/s7p/slave/main.clj | clojure | (ns s7p.slave.main
(:gen-class)
(:require
[clojure.tools.logging :as log]
[clojure.core.async :refer [thread close! chan >!! <!!]]
[cheshire.core :as json]
[zeromq.zmq :as zmq]
[s7p.config :as config]
[s7p.slave.manage :as manage]
[s7p.slave.core :as core]))
(defn make-request-handler [reciev... | |
608922c82d4838ad0f60ca0b36830e3a2b466db0a6b05b68d8fcf1f5b642e1cb | yutopp/rill | sema_context.ml |
* Copyright yutopp 2015 - .
*
* Distributed under the Boost Software License , Version 1.0 .
* ( See accompanying file LICENSE_1_0.txt or copy at
* )
* Copyright yutopp 2015 - .
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* )... | null | https://raw.githubusercontent.com/yutopp/rill/375b67c03ab2087d0a2a833bd9e80f3e51e2694f/rillc/_migrating/sema_context.ml | ocaml | type sets
for template
errors |
* Copyright yutopp 2015 - .
*
* Distributed under the Boost Software License , Version 1.0 .
* ( See accompanying file LICENSE_1_0.txt or copy at
* )
* Copyright yutopp 2015 - .
*
* Distributed under the Boost Software License, Version 1.0.
* (See accompanying file LICENSE_1_0.txt or copy at
* )... |
2dd3e03096d64ba69ad0e958b8a999e5a9542725c7ac5c95349bbee30bde19e7 | ocaml-explore/explore | utils.mli | val get_time : unit -> string
val elt_to_string : 'a Tyxml_html.elt -> string
* [ elt_to_string elt ] takes a HTML element and prints it to a string
val code_to_html : string -> Omd.block list -> Omd.block list
* [ code_to_html filename bs ] Converts code blocks to HTML blocks for a given
set of Omd blocks -- ... | null | https://raw.githubusercontent.com/ocaml-explore/explore/117768b378959f18a8d818f37779a750e90f3438/explore/lib/utils.mli | ocaml | val get_time : unit -> string
val elt_to_string : 'a Tyxml_html.elt -> string
* [ elt_to_string elt ] takes a HTML element and prints it to a string
val code_to_html : string -> Omd.block list -> Omd.block list
* [ code_to_html filename bs ] Converts code blocks to HTML blocks for a given
set of Omd blocks -- ... | |
314d6f7658953bd5d2718d39480bcd087d2036350311d8f17fe856afd6dd55e2 | NelosG/fp-tests | T4Spec.hs | # LANGUAGE PartialTypeSignatures #
{-# LANGUAGE StandaloneDeriving #-}
module T4Spec
( tests
) where
import HW2.T1 (Annotated ((:#)))
import HW2.T4 (Prim (Add, Mul, Sub), State (runS, S), eval, joinState, wrapState, mapState)
import qualified Hedgehog as H
import Test.Expr (genFullExpr, stupidEval)
import Test... | null | https://raw.githubusercontent.com/NelosG/fp-tests/8f825ab1b581d065078daf8b3c44c5b532139658/hw2/test/T4/T4Spec.hs | haskell | # LANGUAGE StandaloneDeriving #
Map, Wrap and Join tests were added at the request of the student, a single test is enough for correct work in any case
| These are for test tests | # LANGUAGE PartialTypeSignatures #
module T4Spec
( tests
) where
import HW2.T1 (Annotated ((:#)))
import HW2.T4 (Prim (Add, Mul, Sub), State (runS, S), eval, joinState, wrapState, mapState)
import qualified Hedgehog as H
import Test.Expr (genFullExpr, stupidEval)
import Test.Tasty (TestTree, testGroup)
import Tes... |
29fbf9a6fe0d63bd3ae670b2bff13761328837afbd97a4ca806702be6f537371 | danr/hipspec | PolyFOL.hs | # LANGUAGE DeriveFunctor , , , ScopedTypeVariables , RecordWildCards #
# LANGUAGE ExplicitForAll , FlexibleInstances , TemplateHaskell , MultiParamTypeClasses #
# OPTIONS_GHC -fno - warn - orphans #
Type signatures and formulae have a list of top - level quantified
type variables . They have type * ( or $ tType ... | null | https://raw.githubusercontent.com/danr/hipspec/a114db84abd5fee8ce0b026abc5380da11147aa9/src/HipSpec/Lang/PolyFOL.hs | haskell | ^ type quantification
^ ( ordinary ) value quantification
^ type quantification
^ (ordinary) value quantification
* Builders
types to ints | # LANGUAGE DeriveFunctor , , , ScopedTypeVariables , RecordWildCards #
# LANGUAGE ExplicitForAll , FlexibleInstances , TemplateHaskell , MultiParamTypeClasses #
# OPTIONS_GHC -fno - warn - orphans #
Type signatures and formulae have a list of top - level quantified
type variables . They have type * ( or $ tType ... |
2fdf7e70385c44eeca2319c4dba7621684bb4e50bf00397e420c77ae9a7220b5 | quek/paiprolog | intro.lisp | ;;; -*- Mode: Lisp; Syntax: Common-Lisp; -*-
;;; Code from Paradigms of Artificial Intelligence Programming
Copyright ( c ) 1991
;;;; File intro.lisp: Miscellaneous functions from the introduction.
(defun last-name (name)
"Select the last name from a name represented as a list."
(first (last name)))
(defun f... | null | https://raw.githubusercontent.com/quek/paiprolog/012d6bb255d8af7f1c8b1d061dcd8a474fb3b57a/intro.lisp | lisp | -*- Mode: Lisp; Syntax: Common-Lisp; -*-
Code from Paradigms of Artificial Intelligence Programming
File intro.lisp: Miscellaneous functions from the introduction.
==============================
==============================
==============================
==============================
========================... | Copyright ( c ) 1991
(defun last-name (name)
"Select the last name from a name represented as a list."
(first (last name)))
(defun first-name (name)
"Select the first name from a name represented as a list."
(first name))
(setf names '((John Q Public) (Malcolm X)
(Admiral Grace Murray Hopp... |
4d01ca7e63cca30921d0741188a0743734558a7eb9035dac5e2bbff38a5f9ef7 | mhkoji/Senn | im-util.lisp | (defpackage :senn.t.im-util
(:use :cl)
(:export :converting-state-segment-strings))
(in-package :senn.t.im-util)
(defun converting-state-segment-strings (state)
(mapcar (lambda (seg)
(format nil "~A/~A"
(first (senn.im.converting:segment-forms seg))
(senn.im.... | null | https://raw.githubusercontent.com/mhkoji/Senn/f87ef781aa671aa494e9392e5d7332a6bc7ef5ff/senn/t/im-util.lisp | lisp | (defpackage :senn.t.im-util
(:use :cl)
(:export :converting-state-segment-strings))
(in-package :senn.t.im-util)
(defun converting-state-segment-strings (state)
(mapcar (lambda (seg)
(format nil "~A/~A"
(first (senn.im.converting:segment-forms seg))
(senn.im.... | |
db413079e2d4babcf231faefd7875e75d0bdaa82cf103365f72d47da7b787a0c | sile/proxy | proxy_restart_tests.erl | -module(proxy_restart_tests).
-include_lib("eunit/include/eunit.hrl").
-define(assertDown(Pid, Reason),
(fun () -> receive {'DOWN', _, _, Pid, _Reason} -> ?assertMatch(Reason, _Reason) after 100 -> ?assert(timeout) end end)()).
restart_test_() ->
[
{"指定回数だけ実プロセスの再起動が行われる",
fun () ->
... | null | https://raw.githubusercontent.com/sile/proxy/009418087d92ec44d25ae82462213f3792360f77/test/proxy_restart_tests.erl | erlang | 許容誤差
適当に待つ
linkプロセスがnormal以外で死んだ => proxyも同じ理由で死ぬ | -module(proxy_restart_tests).
-include_lib("eunit/include/eunit.hrl").
-define(assertDown(Pid, Reason),
(fun () -> receive {'DOWN', _, _, Pid, _Reason} -> ?assertMatch(Reason, _Reason) after 100 -> ?assert(timeout) end end)()).
restart_test_() ->
[
{"指定回数だけ実プロセスの再起動が行われる",
fun () ->
... |
e5ee75625ac821c7dcaf49bbc47a5cfd69de73ee68bd3fbb2614d2d0d65eba32 | thheller/shadow-grove | dev_support.cljs | (ns shadow.grove.dev-support
(:require
[goog.functions :as gfn]
[goog.style :as gs]
[goog.positioning :as goog-pos]
[clojure.core.protocols :as cp]
[shadow.remote.runtime.api :as rapi]
[shadow.debug :refer (?> ?-> ?->>)]
[shadow.arborist.protocols :as p]
[shadow.grove.components :as co... | null | https://raw.githubusercontent.com/thheller/shadow-grove/3b2a2683d533284b26b71f02016148d96b0efd50/src/main/shadow/grove/dev_support.cljs | clojure | sketch of some of the development support might work
never used in production anyways | (ns shadow.grove.dev-support
(:require
[goog.functions :as gfn]
[goog.style :as gs]
[goog.positioning :as goog-pos]
[clojure.core.protocols :as cp]
[shadow.remote.runtime.api :as rapi]
[shadow.debug :refer (?> ?-> ?->>)]
[shadow.arborist.protocols :as p]
[shadow.grove.components :as co... |
fdc3e612c51a848373f7e71bb79c47d2730f8db9bf000aaa2957116cdcabf8a2 | gildor478/ounit | oUnitUtils.ml | (**************************************************************************)
The OUnit library
(* *)
Copyright ( C ) 2002 - 2008 Maas - Maarten Zeeman .
Copyright... | null | https://raw.githubusercontent.com/gildor478/ounit/faf4936b17507406c7592186dcaa3f25c6fc138a/src/lib/ounit2/advanced/oUnitUtils.ml | ocaml | ************************************************************************
Permission is hereby grante... | The OUnit library
Copyright ( C ) 2002 - 2008 Maas - Maarten Zeeman .
Copyright ( C ) 2010 OCamlCore SARL
Copyright ( C ) 2013
The package OUnit is cop... |
216bd742db7e9dc95d2c9908b7281424d8f2c136472a43eff6a0cf0cf414edb7 | Helium4Haskell/helium | Main.hs | | Module : Main
License : GPL
Maintainer :
Stability : experimental
Portability : portable
License : GPL
Maintainer :
Stability : experimental
Portability : portable
-}
module Main where
import Control.Monad
import System.FilePath(joinP... | null | https://raw.githubusercontent.com/Helium4Haskell/helium/5928bff479e6f151b4ceb6c69bbc15d71e29eb47/src/commands/helium/Helium/Main.hs | haskell | Prelude will be treated specially
Order matters
Can't fail, because processHeliumArgs checks it.
The lib will be part of path already.
baseLibs always last
File that is compiled must exist, this test doesn't use the search path
And now deal with Prelude | | Module : Main
License : GPL
Maintainer :
Stability : experimental
Portability : portable
License : GPL
Maintainer :
Stability : experimental
Portability : portable
-}
module Main where
import Control.Monad
import System.FilePath(joinP... |
0335fb06c9a4f4bc5cb2611e5789cd126132c6c9457b8d2039260a9523450350 | sph-mn/sph-lib | string.scm | (define-module (sph string))
(use-modules (ice-9 pretty-print) (ice-9 regex)
(sph) (srfi srfi-1)
((rnrs bytevectors) #:select (u8-list->bytevector utf8->string))
((sph list) #:select (fold-multiple)))
(export any->string any->string-display
any->string-pretty-print any->string-write
any->string-write* list-... | null | https://raw.githubusercontent.com/sph-mn/sph-lib/c7daf74f42d6bd1304f49c2fef89dcd6dd94fdc9/modules/sph/string.scm | scheme | (define-module (sph string))
(use-modules (ice-9 pretty-print) (ice-9 regex)
(sph) (srfi srfi-1)
((rnrs bytevectors) #:select (u8-list->bytevector utf8->string))
((sph list) #:select (fold-multiple)))
(export any->string any->string-display
any->string-pretty-print any->string-write
any->string-write* list-... | |
3a6f344f2820560da7d41ff9fd90e2934151b5744d863ca1cc67041963349cd8 | 2mol/pboy | PDFInfo.hs | # LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ViewPatterns #
{-# LANGUAGE OverloadedStrings #-}
{-# OPTIONS -Wall #-}
module PDFInfo
(-- * Reading PDF info
pdfInfo
, PDFInfo(..)
, PDFSize(..)
, PDFEncryptionInfo(..)
, PDFInfoError(..)
-- * Internals
... | null | https://raw.githubusercontent.com/2mol/pboy/b2614d6ab6366a7c174f45c2fd5753a751f2646b/src/PDFInfo.hs | haskell | # LANGUAGE OverloadedStrings #
# OPTIONS -Wall #
* Reading PDF info
* Internals
| A type representing the output from the pdfinfo command.
^ Title
^ Subject
^ Creation Date
^ Modification Date
^ Tagged?
^ Encryption information
^ Optimized?
| Possible things that can go wrong while reading the info.
^ Could... | # LANGUAGE FlexibleContexts #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE ViewPatterns #
module PDFInfo
pdfInfo
, PDFInfo(..)
, PDFSize(..)
, PDFEncryptionInfo(..)
, PDFInfoError(..)
, ParsePDFInfo
, runParse
, parse
, parseSize
, parseDate
, parseEncrypted
, re... |
f00a1d0f3ae40f002fef132e3f90b0f3046234dd3a9df297a458b1b1c0998786 | swarmpit/swarmpit | setup.clj | (ns swarmpit.setup
(:require [swarmpit.log :as log]
[swarmpit.config :as cfg]
[swarmpit.docker.engine.client :as dc]
[taoensso.timbre :as timbre :refer [info]]))
(defn docker
[]
(let [docker-version (dc/version)
docker-api (str (:ApiVersion docker-version))
doc... | null | https://raw.githubusercontent.com/swarmpit/swarmpit/38ffbe08e717d8620bf433c99f2e85a9e5984c32/src/clj/swarmpit/setup.clj | clojure | (ns swarmpit.setup
(:require [swarmpit.log :as log]
[swarmpit.config :as cfg]
[swarmpit.docker.engine.client :as dc]
[taoensso.timbre :as timbre :refer [info]]))
(defn docker
[]
(let [docker-version (dc/version)
docker-api (str (:ApiVersion docker-version))
doc... | |
afc58155dc43bf26f2134f57bf1f74e45d5c75c5fa82783f23d3d8442837acd3 | mirage/mmap | mmap.mli | (** Compat module for memory mapping files *)
module V1 : sig
val map_file :
Unix.file_descr
-> ?pos:int64
-> ('a, 'b) Bigarray_compat.kind
-> 'c Bigarray_compat.layout
-> bool
-> int array
-> ('a, 'b, 'c) Bigarray_compat.Genarray.t
* [ map_file ] is the same as { ! Unix.map_file } in ... | null | https://raw.githubusercontent.com/mirage/mmap/75e9fbfb68cb90e12449851e5d027a42088567be/src/mmap.mli | ocaml | * Compat module for memory mapping files |
module V1 : sig
val map_file :
Unix.file_descr
-> ?pos:int64
-> ('a, 'b) Bigarray_compat.kind
-> 'c Bigarray_compat.layout
-> bool
-> int array
-> ('a, 'b, 'c) Bigarray_compat.Genarray.t
* [ map_file ] is the same as { ! Unix.map_file } in OCaml > = 4.06.0
end
|
9024768eb5885172f40e9358cc40bffefd1c65a1391d414a17bff9cab60a73e4 | xxyzz/SICP | Exercise_5_40.rkt | #lang racket/base
(define (compile exp target linkage compile-env) ;; ***
(cond [(self-evaluating? exp)
(compile-self-evaluating exp target linkage)]
[(quoted? exp) (compile-quoted exp target linkage)]
[(variable? exp)
(compile-variable exp target linkage compile-env)] ;; ***
... | null | https://raw.githubusercontent.com/xxyzz/SICP/e26aea1c58fd896297dbf5406f7fcd32bb4f8f78/5_Computing_with_Register_Machines/5.5_Compilation/Exercise_5_40.rkt | racket | ***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
***
test | #lang racket/base
(cond [(self-evaluating? exp)
(compile-self-evaluating exp target linkage)]
[(quoted? exp) (compile-quoted exp target linkage)]
[(variable? exp)
[(assignment? exp)
[(definition? exp)
[(begin? exp)
(compile-sequence
[(cond? exp)
... |
4991e503d5f396052469e083c6873514f17bc2fd5f7e5d3831d9f0afda6bae12 | huangz1990/SICP-answers | test-27-tree-reverse.scm | (load "test-manager/load.scm")
(load "27-tree-reverse.scm")
(define binary-tree (list (list 1 2) (list 3 4)))
(define three-branch-tree (list (list 1 2) (list 3 4) (list 5 6)))
(define-each-check
(equal? (tree-reverse '())
'())
(equal? (tree-reverse binary-tree)
(list (list 4 3) (li... | null | https://raw.githubusercontent.com/huangz1990/SICP-answers/15e3475003ef10eb738cf93c1932277bc56bacbe/chp2/code/test-27-tree-reverse.scm | scheme | (load "test-manager/load.scm")
(load "27-tree-reverse.scm")
(define binary-tree (list (list 1 2) (list 3 4)))
(define three-branch-tree (list (list 1 2) (list 3 4) (list 5 6)))
(define-each-check
(equal? (tree-reverse '())
'())
(equal? (tree-reverse binary-tree)
(list (list 4 3) (li... | |
0c8e03230cf91b32d24933672af8d2bfa63a1116c7162712fd53f86b9bb2c5b0 | cgrand/enliven | plans.clj | (ns enliven.core.plans
(:require
[enliven.core.lenses :as lens]
[enliven.core.actions :as action]))
;; a plan is a hierarchical representation of a set of rules
(def empty-plan {:range (sorted-map)
:number (sorted-map)
:misc {}})
(defn map-vals [m f]
(reduce-kv (fn [m k ... | null | https://raw.githubusercontent.com/cgrand/enliven/f40d91bd3ba1b9523ea743cd541bd98e298e2e62/src/enliven/core/plans.clj | clojure | a plan is a hierarchical representation of a set of rules
subs should embed their node so that const-execute could be propagated
subs should embed their node so that const-execute could be propagated | (ns enliven.core.plans
(:require
[enliven.core.lenses :as lens]
[enliven.core.actions :as action]))
(def empty-plan {:range (sorted-map)
:number (sorted-map)
:misc {}})
(defn map-vals [m f]
(reduce-kv (fn [m k v] (assoc m k (f v))) m m))
(defn- map-actions [plan f]
(i... |
39a663f7d92c84fd188e9bb462c16d3d054d579c53d978ac9309c4b08d4c1fab | TaktInc/freer | Main.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
module Main where
import Eff
import Teletype
runner :: (Member Teletype r) => Eff r ()
runner = do
x <- getLine'
_ <- getLine'
putStrLn' x
z <- getLine'
putStrLn' z
putStrLn' x
putStrLn' x
main :: IO ()
main = do
let xs = runTeletypePure ["cat", "f... | null | https://raw.githubusercontent.com/TaktInc/freer/b1e4911832ad12ef0b9b23883548dcf44ea3bd59/examples/src/Main.hs | haskell | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
module Main where
import Eff
import Teletype
runner :: (Member Teletype r) => Eff r ()
runner = do
x <- getLine'
_ <- getLine'
putStrLn' x
z <- getLine'
putStrLn' z
putStrLn' x
putStrLn' x
main :: IO ()
main = do
let xs = runTeletypePure ["cat", "f... | |
f0757a642bc97262a043b5163ef94c9283a49938e3a3d694c326280de3ea1d64 | chenyukang/rubytt | def.ml |
module NodeHashT =
struct
type t = Node.node_t
let equal n1 n2 = Node.compare_node_t n1 n2 = 0
let hash n = Node.node_t_hash n;
end
module NodeHashtbl = Hashtbl.Make(NodeHashT);;
module NodeSetT =
struct
type t = Node.node_t
let compare n1 n2 =
Node.compare_node_t n1 n2
end
module ... | null | https://raw.githubusercontent.com/chenyukang/rubytt/3b9898cd9e180594ee30fb74cea9a8356a6e0c14/src/def.ml | ocaml | module TypeSetT =
struct
let compare t1 t2 =
Type.compare_type_t t1 t2
end
module TypeHashT =
struct
type t = type_t
let equal t1 t2 = if compare_type_t t1 t2 = 0 then true else false
let hash t = type_t_hash t;
end
NodeHashtbl.add h Node.nil_node true;; |
module NodeHashT =
struct
type t = Node.node_t
let equal n1 n2 = Node.compare_node_t n1 n2 = 0
let hash n = Node.node_t_hash n;
end
module NodeHashtbl = Hashtbl.Make(NodeHashT);;
module NodeSetT =
struct
type t = Node.node_t
let compare n1 n2 =
Node.compare_node_t n1 n2
end
module ... |
ca0daecb2f9fef6e3aaf9f8291956d5f4419fc7c558f6bab972924c381665f52 | kellino/microML | MathsPrimitives.hs | module MathsPrimitives where
import Test.Hspec
import MicroML.ListPrimitives
import MicroML.MathsPrimitives
import MicroML.Syntax
import Control.Exception (evaluate)
mathsprims :: IO ()
mathsprims = hspec $
describe "mathsprims" $ do
describe "add" $ do
it "should add two integers" $
... | null | https://raw.githubusercontent.com/kellino/microML/26a4e0ad7542e26f51945eb92db19f63f69b6962/test/MathsPrimitives.hs | haskell | test for failure, but the type checker should prevent this ever happening | module MathsPrimitives where
import Test.Hspec
import MicroML.ListPrimitives
import MicroML.MathsPrimitives
import MicroML.Syntax
import Control.Exception (evaluate)
mathsprims :: IO ()
mathsprims = hspec $
describe "mathsprims" $ do
describe "add" $ do
it "should add two integers" $
... |
9069c0fbd0973008dfb489337f8effc3236fd868008bf1586a6774260d54e4c1 | patricoferris/ocaml-multicore-monorepo | app.ml | let () =
Eio_main.run @@ fun env ->
Dream.run ~interface:"0.0.0.0" ~port:80 env
@@ Dream.logger
@@ Dream.router [
Dream.get "/" (fun _ -> Dream.html "Dream started by systemd!");
]
@@ Dream.not_found
| null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/22b441e6727bc303950b3b37c8fbc024c748fe55/duniverse/dream/example/z-systemd/app.ml | ocaml | let () =
Eio_main.run @@ fun env ->
Dream.run ~interface:"0.0.0.0" ~port:80 env
@@ Dream.logger
@@ Dream.router [
Dream.get "/" (fun _ -> Dream.html "Dream started by systemd!");
]
@@ Dream.not_found
| |
0402ebb71ba23fc8869a8df4b6496884203664ac40c81b2d0969ae11590d44ce | clojerl/clojerl | clojerl.BadArgumentError.erl | -module('clojerl.BadArgumentError').
-include("clojerl.hrl").
-behavior('clojerl.IEquiv').
-behavior('clojerl.IError').
-behavior('clojerl.IHash').
-behavior('clojerl.IStringable').
-export([?CONSTRUCTOR/1]).
-export([equiv/2]).
-export([ message/1
, message/2
]).
-export([hash/1]).
-export([str/1])... | null | https://raw.githubusercontent.com/clojerl/clojerl/506000465581d6349659898dd5025fa259d5cf28/src/erl/lang/errors/clojerl.BadArgumentError.erl | erlang | ------------------------------------------------------------------------------
------------------------------------------------------------------------------
clojerl.IEquiv
clojerl.IError
clojerl.IStringable | -module('clojerl.BadArgumentError').
-include("clojerl.hrl").
-behavior('clojerl.IEquiv').
-behavior('clojerl.IError').
-behavior('clojerl.IHash').
-behavior('clojerl.IStringable').
-export([?CONSTRUCTOR/1]).
-export([equiv/2]).
-export([ message/1
, message/2
]).
-export([hash/1]).
-export([str/1])... |
868fe610f27c20edb9d96a4474a7c1eeb5eeb1934f7e7bf7c82555047db40c6c | clojure-interop/aws-api | AbstractAmazonDynamoDBStreamsAsync.clj | (ns com.amazonaws.services.dynamodbv2.AbstractAmazonDynamoDBStreamsAsync
"Abstract implementation of AmazonDynamoDBStreamsAsync. Convenient method forms pass through to the
corresponding overload that takes a request object and an AsyncHandler, which throws an
UnsupportedOperationException."
(:refer-clojure :on... | null | https://raw.githubusercontent.com/clojure-interop/aws-api/59249b43d3bfaff0a79f5f4f8b7bc22518a3bf14/com.amazonaws.services.dynamodbv2/src/com/amazonaws/services/dynamodbv2/AbstractAmazonDynamoDBStreamsAsync.clj | clojure | (ns com.amazonaws.services.dynamodbv2.AbstractAmazonDynamoDBStreamsAsync
"Abstract implementation of AmazonDynamoDBStreamsAsync. Convenient method forms pass through to the
corresponding overload that takes a request object and an AsyncHandler, which throws an
UnsupportedOperationException."
(:refer-clojure :on... | |
3c0d584bc62f8d3b6f82e3b3f70091d2b964e91cb42ae43756c34bd2e9e6a47d | benoitc/couchbeam | couchbeam_uuids.erl | %%% -*- erlang -*-
%%%
This file is part of couchbeam released under the MIT license .
%%% See the NOTICE for more information.
-module(couchbeam_uuids).
-behaviour(gen_server).
-export([random/0,
utc_random/0]).
-export([start_link/0]).
-export([get_uuids/2]).
%% gen_server callbacks
-export([init/1, ha... | null | https://raw.githubusercontent.com/benoitc/couchbeam/8dcba7209b040d7225aceddc2956680340937790/src/couchbeam_uuids.erl | erlang | -*- erlang -*-
See the NOTICE for more information.
gen_server callbacks
@doc return a random uuid
@doc return a random uuid based on time
@doc Get a list of uuids from the server
@spec get_uuids(server(), integer()) -> lists()
--------------------------------------------------------------------
Description: S... | This file is part of couchbeam released under the MIT license .
-module(couchbeam_uuids).
-behaviour(gen_server).
-export([random/0,
utc_random/0]).
-export([start_link/0]).
-export([get_uuids/2]).
-export([init/1, handle_call/3, handle_cast/2, handle_info/2,
terminate/2, code_change/3]).
-inc... |
91e6c7b67daa53e79fb3ce25c794b93094963eb4c1ee2734483fec958115443a | tweag/asterius | Blackhole.hs | {-# LANGUAGE OverloadedStrings #-}
module Asterius.Builtins.Blackhole
( blackholeCBits,
)
where
import Asterius.EDSL
import Asterius.Types
import qualified Data.ByteString as BS
import Data.List
import Language.Haskell.GHC.Toolkit.Constants
blackholeCBits :: AsteriusModule
blackholeCBits = messageBlackHole <> up... | null | https://raw.githubusercontent.com/tweag/asterius/e4791671dcfe3baae97a3f5f6bc582e0f9d7d292/asterius/src/Asterius/Builtins/Blackhole.hs | haskell | # LANGUAGE OverloadedStrings # |
module Asterius.Builtins.Blackhole
( blackholeCBits,
)
where
import Asterius.EDSL
import Asterius.Types
import qualified Data.ByteString as BS
import Data.List
import Language.Haskell.GHC.Toolkit.Constants
blackholeCBits :: AsteriusModule
blackholeCBits = messageBlackHole <> updateThunk
messageBlackHole :: Aste... |
a72a81c2857ac48eab6eb7902f24b6b8073f27ac7ae7a459735919529cea37b8 | HaskellCNOrg/snap-web | FormExt.hs | {-# LANGUAGE OverloadedStrings #-}
--
-- Extension to Text.Digestive.Form.
-- Basically more utils.
--
module Text.Digestive.FormExt where
import Data.Maybe (isJust)
import Data.Text (Text)
import qualified Data.Text as T
import Text.Digestive
---------------------------... | null | https://raw.githubusercontent.com/HaskellCNOrg/snap-web/f104fd9b8fc5ae74fc7b8002f0eb3f182a61529e/src/Text/Digestive/FormExt.hs | haskell | # LANGUAGE OverloadedStrings #
Extension to Text.Digestive.Form.
Basically more utils.
-------------------------------------------------- Validator
| MAYBE: more accurate email addr. validator.
| Mandatroy field validator.
^ Convert to list
^ Input text
-------------------------------------------------- Valid... |
module Text.Digestive.FormExt where
import Data.Maybe (isJust)
import Data.Text (Text)
import qualified Data.Text as T
import Text.Digestive
emailValidator :: T.Text -> Bool
emailValidator = isJust . T.find (== '@')
requiredValidator :: T.Text -> Bool
requiredValidato... |
47a4b9ba5668da4c6d02ac257433bbd98b29d30fbe36aaf1aa44f01f543148ce | crategus/cl-cffi-gtk | application-notification.lisp | ;;;; Application Notification - 2021-10-12
;; TODO: This examples does not seem to work as expected. Try to work out an
example that demonstrates the usage of the g - notification class .
(in-package :gtk-application)
(defun application-notification (&rest argv)
(let (;; Create an application
(app (make-... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/7f5a09f78d8004a71efa82794265f2587fff98ab/demo/gtk-application/application-notification.lisp | lisp | Application Notification - 2021-10-12
TODO: This examples does not seem to work as expected. Try to work out an
Create an application
Add action "clear-all" to the application
Create an application window
Add more information to the notification
Send the notification to the application
Show the application wind... |
example that demonstrates the usage of the g - notification class .
(in-package :gtk-application)
(defun application-notification (&rest argv)
(app (make-instance 'gtk-application
:application-id
"com.crategus.application-notification"
... |
a102dc9a8748ba3f3464173aa103948462234c75df8d4ca3e5c53f15960a8212 | hammerlab/ketrew | persistance.ml |
open Ketrew_pure
open Ketrew
open Internal_pervasives
open Unix_io
module P = Persistent_data
Cf . /
docker run --name ketrew - postgres -p 5432:5432 -e POSTGRES_PASSWORD = kpass -d postgres
docker kill ketrew - postgres
docker
docker run -it --rm --link ketrew - postgres : postgres p... | null | https://raw.githubusercontent.com/hammerlab/ketrew/8940d48fbe174709f076b7130974ecd0ed831d58/src/test/persistance.ml | ocaml |
open Ketrew_pure
open Ketrew
open Internal_pervasives
open Unix_io
module P = Persistent_data
Cf . /
docker run --name ketrew - postgres -p 5432:5432 -e POSTGRES_PASSWORD = kpass -d postgres
docker kill ketrew - postgres
docker
docker run -it --rm --link ketrew - postgres : postgres p... | |
98b19f16264b0e3435938fc0a03996ca61ca5f80c34669e102b1d5ca8aea0e88 | herd/herdtools7 | variant_litmus.mli | (****************************************************************************)
(* the diy toolsuite *)
(* *)
, University College London , UK .
, INRIA Par... | null | https://raw.githubusercontent.com/herd/herdtools7/bf8f4b801fe87d91ddcabdde7116f00c4f4155eb/litmus/variant_litmus.mli | ocaml | **************************************************************************
the diy toolsuite
en Automatique and ... | , University College London , UK .
, INRIA Paris - Rocquencourt , France .
Copyright 2019 - present Institut National de Recherche en Informatique et
This software is governed by the CeCILL - B license under French law and
modify and/ or redistribu... |
1f2d57544c0303e31b98fdbcca7164dda54a1bed11abb764a80037326240de07 | cldwalker/table | width_test.clj | (ns table.width-test
(:require [clojure.test :refer :all]
[table.width :refer :all]))
(defn auto-resize [widths]
(binding [*width* (delay 238)] (auto-resize-widths widths)))
for of 238 , 76 is the max - width - per - field for 3 fields
(deftest test-auto-resize-allows-over-max-field-to-get-width-f... | null | https://raw.githubusercontent.com/cldwalker/table/13874e2ab8bce3a95547761433b1e56c552a6700/test/table/width_test.clj | clojure | (ns table.width-test
(:require [clojure.test :refer :all]
[table.width :refer :all]))
(defn auto-resize [widths]
(binding [*width* (delay 238)] (auto-resize-widths widths)))
for of 238 , 76 is the max - width - per - field for 3 fields
(deftest test-auto-resize-allows-over-max-field-to-get-width-f... | |
61ba3e2884c3741622e7955c4f9e6965ccb8ea5adb8f0023bc2e2f1833d2028d | liqd/aula | Core.hs | {-# LANGUAGE ConstraintKinds #-}
{-# LANGUAGE DataKinds #-}
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE FlexibleContexts #-}
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
{-# LANGUAGE K... | null | https://raw.githubusercontent.com/liqd/aula/f96dbf85cd80d0b445e7d198c9b2866bed9c4e3d/src/Types/Core.hs | haskell | # LANGUAGE ConstraintKinds #
# LANGUAGE DataKinds #
# LANGUAGE DeriveDataTypeable #
# LANGUAGE FlexibleContexts #
# LANGUAGE KindSignatures #
# LANGUAGE LambdaCase #
# LANGUAGE OverloadedStrings #
# LANGUAGE Rank2Types ... | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleInstances #
# LANGUAGE GeneralizedNewtypeDeriving #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE ScopedTypeVariables #
module Types.Core
where
import Control.Lens hiding ((<.>))
import Data.Char
import Data.Data (Data)
import ... |
b629b0753d05f533659ca383d1e7f24a8c3c99eba9e07a28437ff6d00c2100ab | everpeace/programming-erlang-code | misc.erl | -module(misc).
-compile(export_all).
perimeter({square, X}) -> 4 * X;
perimeter({rectangle, Width, Ht}) -> 2 * (Width+Ht);
perimeter({circle, R}) -> 2 * math:pi() * R;
perimeter({triangle, A, B, C}) -> A + B + C.
fac2(0) -> 1;
fac2(N) when is_integer(N), N > 0 -> N * fac2(N-1);
fac2(N) when... | null | https://raw.githubusercontent.com/everpeace/programming-erlang-code/8ef31aa13d15b41754dda225c50284915c29cb48/code/misc.erl | erlang | -module(misc).
-compile(export_all).
perimeter({square, X}) -> 4 * X;
perimeter({rectangle, Width, Ht}) -> 2 * (Width+Ht);
perimeter({circle, R}) -> 2 * math:pi() * R;
perimeter({triangle, A, B, C}) -> A + B + C.
fac2(0) -> 1;
fac2(N) when is_integer(N), N > 0 -> N * fac2(N-1);
fac2(N) when... | |
5b585268b456e2afb7783940ace43d6960e7371603c63b8a38b0946646f6c1e9 | granule-project/gerty | Location.hs | module Language.Gerty.Syntax.Location
(
-- * Locations
Location
, locFile
, locLine
, locColumn
-- * Spans
, Span
, mkSpan
, spanFile
, spanStart
, spanEnd
) where
-- | A line and column position.
data Pos = Pos { posLine :: Int, posCol :: Int }
deriving (Eq)
instance Ord Pos where
... | null | https://raw.githubusercontent.com/granule-project/gerty/972fa027973032a4499747039b45e744ca17e9e2/src/Language/Gerty/Syntax/Location.hs | haskell | * Locations
* Spans
| A line and column position.
| A position in a file.
Location : FilePath -> Type, to guarantee (at the type level) e.g.,
| The line number of the given location.
| The column number of the given location.
| A position range in a file.
| The start location of a span.
| The end location of ... | module Language.Gerty.Syntax.Location
(
Location
, locFile
, locLine
, locColumn
, Span
, mkSpan
, spanFile
, spanStart
, spanEnd
) where
data Pos = Pos { posLine :: Int, posCol :: Int }
deriving (Eq)
instance Ord Pos where
p1 <= p2 | posLine p1 < posLine p2 = True
| posLine... |
389eacc30836eb66cfc9c7fe2a316e328d2f576fb53ed99cd132cd5575430369 | ciste/ciste | commands.clj | (ns ciste.commands
(:require [ciste.filters :refer [deffilter]]
[ciste.predicates :as pred]
[ciste.routes :refer [resolve-routes]]
[ciste.views :refer [defview]]
[clojure.string :as string]
[taoensso.timbre :as timbre]))
(defonce
^{:dynamic true
:doc ... | null | https://raw.githubusercontent.com/ciste/ciste/fac15456f9f00867c0073b7e55e5e8b5cd4a902d/src/ciste/commands.clj | clojure | Should this return a set? | (ns ciste.commands
(:require [ciste.filters :refer [deffilter]]
[ciste.predicates :as pred]
[ciste.routes :refer [resolve-routes]]
[ciste.views :refer [defview]]
[clojure.string :as string]
[taoensso.timbre :as timbre]))
(defonce
^{:dynamic true
:doc ... |
853851204a4a1aa076e331b5cd92c31e6d267fd46bfe6853ec8cb113f7286c5d | codinuum/cca | py_unparsing.ml |
Copyright 2012 - 2020 Codinuum Software Lab < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in wri... | null | https://raw.githubusercontent.com/codinuum/cca/c22bbe5b4d8824695a5844b23309a8652d371e70/src/ast/analyzing/langs/python/py_unparsing.ml | ocaml | py_unparsing.ml
| L.DottedName -> pr_a pr_dot pr_node_ children |
Copyright 2012 - 2020 Codinuum Software Lab < >
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
you may not use this file except in compliance with the License .
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in wri... |
b27ddbb93f9e7d264e018e10e7fc7c39f898307265499e888745a0fda97ebfa9 | cljfx/cljfx | e01_basic.clj | (ns e01-basic
(:require [cljfx.api :as fx]))
(fx/on-fx-thread
(fx/create-component
{:fx/type :stage
:showing true
:always-on-top true
:style :transparent
:scene {:fx/type :scene
:fill :transparent
:stylesheets #{"styles.css"}
:root {:fx/type :v-box
... | null | https://raw.githubusercontent.com/cljfx/cljfx/ec3c34e619b2408026b9f2e2ff8665bebf70bf56/examples/e01_basic.clj | clojure | (ns e01-basic
(:require [cljfx.api :as fx]))
(fx/on-fx-thread
(fx/create-component
{:fx/type :stage
:showing true
:always-on-top true
:style :transparent
:scene {:fx/type :scene
:fill :transparent
:stylesheets #{"styles.css"}
:root {:fx/type :v-box
... | |
16016d83b5ac30ed875b96a516e01d3e7663a3272291f1c7c19ac39c73283869 | kitnil/dotfiles | web.scm | ;;; GNU Guix --- Functional package management for GNU
Copyright © 2020 , 2021 , 2022 < >
;;;
;;; 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 Foundation ; either version... | null | https://raw.githubusercontent.com/kitnil/dotfiles/82e8e40906389a0720bf490f5c5a701457891a00/dotfiles/guixsd/modules/services/web.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 © 2020 , 2021 , 2022 < >
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 (services web)
#:use-module (services docker)
#:use-module (gnu packages guile)
... |
60df0341389c9c9c18603a64d2e5338023cb2ab3e42908238a147c34101ec8fe | hstreamdb/hstream | Preprocess.hs | {-# LANGUAGE OverloadedStrings #-}
module HStream.SQL.Preprocess
( preprocess
) where
import Data.Text (Text, append, breakOn)
import qualified Data.Text as Text
commentStart :: Text
commentStart = "/*"
commentEnd :: Text
commentEnd = "*/"
removeComments :: Text -> Text
removeComments "" = ""
removeC... | null | https://raw.githubusercontent.com/hstreamdb/hstream/0300ec357a1e6c0ac6ab43d92f6745d5787be98e/hstream-sql/src/HStream/SQL/Preprocess.hs | haskell | # LANGUAGE OverloadedStrings # |
module HStream.SQL.Preprocess
( preprocess
) where
import Data.Text (Text, append, breakOn)
import qualified Data.Text as Text
commentStart :: Text
commentStart = "/*"
commentEnd :: Text
commentEnd = "*/"
removeComments :: Text -> Text
removeComments "" = ""
removeComments text = prefix `append` remo... |
95a6c3915e04adcf705f2c87a3688757397530c2428b474dbf5bbd01cb45cfa3 | jacius/lispbuilder | syswm.lisp |
(in-package #:lispbuilder-sdl-cffi)
(cffi:defcstruct HWND__
(unused :int))
(cffi:defcstruct HGLRC__
(unused :int))
(cffi:defcstruct HDC__
(unused :int))
#+windows(defcstruct SDL-Sys-WM-msg
(version SDL-version)
(hwnd :pointer)
(msg :pointer)
(wParam :unsigned-int)
... | null | https://raw.githubusercontent.com/jacius/lispbuilder/e693651b95f6818e3cab70f0074af9f9511584c3/lispbuilder-sdl/cffi/syswm.lisp | lisp |
(in-package #:lispbuilder-sdl-cffi)
(cffi:defcstruct HWND__
(unused :int))
(cffi:defcstruct HGLRC__
(unused :int))
(cffi:defcstruct HDC__
(unused :int))
#+windows(defcstruct SDL-Sys-WM-msg
(version SDL-version)
(hwnd :pointer)
(msg :pointer)
(wParam :unsigned-int)
... | |
f0050112a9283c2c2cbe2e40375a3973e0bb490a440c8a1522fce3aa292c6820 | haskell-compat/base-compat | Batteries.hs | {-# LANGUAGE PackageImports #-}
# OPTIONS_GHC -fno - warn - dodgy - exports -fno - warn - unused - imports #
-- | Reexports "Data.STRef.Compat"
-- from a globally unique namespace.
module Data.STRef.Compat.Repl.Batteries (
module Data.STRef.Compat
) where
import "this" Data.STRef.Compat
| null | https://raw.githubusercontent.com/haskell-compat/base-compat/847aa35c4142f529525ffc645cd035ddb23ce8ee/base-compat-batteries/src/Data/STRef/Compat/Repl/Batteries.hs | haskell | # LANGUAGE PackageImports #
| Reexports "Data.STRef.Compat"
from a globally unique namespace. | # OPTIONS_GHC -fno - warn - dodgy - exports -fno - warn - unused - imports #
module Data.STRef.Compat.Repl.Batteries (
module Data.STRef.Compat
) where
import "this" Data.STRef.Compat
|
d9770a823dfe64c8151a75236b19ad21caaf017dd8b7b87df01b72f262b0d57a | francescoc/scalabilitywitherlangotp | phone_fsm.erl | ( c ) 2013,2016
-module(phone_fsm).
-behaviour(gen_fsm).
-export([start_link/1]).
-export([init/1, terminate/3, handle_sync_event/4]).
-export([inbound/1, action/2, busy/1, reject/1, accept/1, hangup/1]).
-export([idle/2, calling/2, connected/2, receiving/2]).
start_link(Ms) ->
gen_fsm:start_link(?MODULE,... | null | https://raw.githubusercontent.com/francescoc/scalabilitywitherlangotp/961de968f034e55eba22eea9a368fe9f47c608cc/ch6/exercise/phone_fsm.erl | erlang | We hang up, We initated call
Events from the Phone
Action == hangup, reject, accept
--------------------------------------------------------------------
--------------------------------------------------------------------
Event outbound in state idle is synchronous and handled in
handle_sync_event
Beware of race c... | ( c ) 2013,2016
-module(phone_fsm).
-behaviour(gen_fsm).
-export([start_link/1]).
-export([init/1, terminate/3, handle_sync_event/4]).
-export([inbound/1, action/2, busy/1, reject/1, accept/1, hangup/1]).
-export([idle/2, calling/2, connected/2, receiving/2]).
start_link(Ms) ->
gen_fsm:start_link(?MODULE,... |
dd5bd2dcd47cce048749f553b0b3cd36f68ccfef8d4dfc9bd70023160ea886fe | bondy-io/bondy | bondy_wamp_protocol_SUITE.erl | %% =============================================================================
%% bondy_SUITE.erl -
%%
Copyright ( c ) 2016 - 2022 Leapsight . All rights reserved .
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% ... | null | https://raw.githubusercontent.com/bondy-io/bondy/a1267e7e5526db24f278e12315020753f3168b44/apps/bondy/test/bondy_wamp_protocol_SUITE.erl | erlang | =============================================================================
bondy_SUITE.erl -
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR COND... | Copyright ( c ) 2016 - 2022 Leapsight . All rights reserved .
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
-module(bondy_wamp_protocol_SUITE).
-include_lib("common_test/include/ct.hrl").
-include_lib("stdlib/include/... |
7c05b208a8ecad196ce191f2a72a4a1a44b0ff6d919bcaee606f9cbbcf85dd41 | INRIA/zelus | total.ml | (***********************************************************************)
(* *)
(* *)
(* Zelus, a synchronous language for hybrid systems *)
(* ... | null | https://raw.githubusercontent.com/INRIA/zelus/685428574b0f9100ad5a41bbaa416cd7a2506d5e/compiler/typing/total.ml | ocaml | *********************************************************************
Zelus, a synchronous language for hybrid systems
... | ( c ) 2020 Paris ( see the file )
Automatique . All rights reserved . This file is distributed under
the terms of the INRIA Non - Commercial License Agreement ( see the
open Zlocation
open Zident
open Zelus
open Typerrors
open Deftypes
open Ztypes
let union
{ dv = dv1;... |
8dcb684c572fdedaae1351e7eebed6c78c4f51506572bd3013aab0363374caa0 | processone/xmpp | xep0279.erl | Created automatically by XML generator ( fxml_gen.erl )
%% Source: xmpp_codec.spec
-module(xep0279).
-compile(export_all).
do_decode(<<"address">>, <<"urn:xmpp:sic:0">>, El,
Opts) ->
decode_sic(<<"urn:xmpp:sic:0">>, Opts, El);
do_decode(<<"address">>, <<"urn:xmpp:sic:1">>, El,
Opts) ->
... | null | https://raw.githubusercontent.com/processone/xmpp/88c43c3cf5843a8a0f76eac390980a3a39c972dd/src/xep0279.erl | erlang | Source: xmpp_codec.spec | Created automatically by XML generator ( fxml_gen.erl )
-module(xep0279).
-compile(export_all).
do_decode(<<"address">>, <<"urn:xmpp:sic:0">>, El,
Opts) ->
decode_sic(<<"urn:xmpp:sic:0">>, Opts, El);
do_decode(<<"address">>, <<"urn:xmpp:sic:1">>, El,
Opts) ->
decode_sic(<<"urn:xmpp:sic:... |
bf19655ad392c4ddf1e2e279319c91e41e4d8780affef094cf438bf2c6114b39 | rtoy/ansi-cl-tests | lambda.lsp | ;-*- Mode: Lisp -*-
Author :
Created : We d Nov 27 06:43:21 2002
;;;; Contains: Tests of LAMBDA forms
(in-package :cl-test)
(deftest lambda.1
((lambda (x) x) 'a)
a)
(deftest lambda.2
((lambda () 'a))
a)
(deftest lambda.3
((lambda () "documentation" 'a))
a)
(deftest lambda.4
((lambda (x... | null | https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/lambda.lsp | lisp | -*- Mode: Lisp -*-
Contains: Tests of LAMBDA forms
Free declaration scope
Test that declarations for aux variables are handled properly
Tests of lambda as a macro
Error tests | Author :
Created : We d Nov 27 06:43:21 2002
(in-package :cl-test)
(deftest lambda.1
((lambda (x) x) 'a)
a)
(deftest lambda.2
((lambda () 'a))
a)
(deftest lambda.3
((lambda () "documentation" 'a))
a)
(deftest lambda.4
((lambda (x) (declare (type symbol x)) x) 'z)
z)
(deftest lambda.5
... |
a3f04a81578db3d7ad8e6a73e6d5a44bc62053c33606b7511a5439b783ac8825 | hcarty/ocaml-gdal | band_iter.ml | open Gdal
let () =
if Array.length Sys.argv <> 2 then (
Printf.eprintf "Usage: %s [source file]\n" Sys.argv.(0);
exit 1
);
let file = Sys.argv.(1) in
Lib.init_dynamic ();
Lib.register_all ();
let ds = Data_set.of_source_exn file in
let band = Data_set.get_band ds 1 Band.Data.Int16 in
le... | null | https://raw.githubusercontent.com/hcarty/ocaml-gdal/9c225c1e3f8002ec7614b3c1657e5f05e4e0e821/examples/band_iter.ml | ocaml | Iterate over a single band | open Gdal
let () =
if Array.length Sys.argv <> 2 then (
Printf.eprintf "Usage: %s [source file]\n" Sys.argv.(0);
exit 1
);
let file = Sys.argv.(1) in
Lib.init_dynamic ();
Lib.register_all ();
let ds = Data_set.of_source_exn file in
let band = Data_set.get_band ds 1 Band.Data.Int16 in
le... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.