_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 |
|---|---|---|---|---|---|---|---|---|
95bdf61ada02c85ef37658923caae267abe845e005fc4a416ca18281635ba316 | turnbullpress/aom-code | count-notifications.clj | (ns examplecom.etc.count-notifications
(:require [riemann.streams :refer :all]))
(defn count-notifications
"Count notifications"
[& children]
(adjust [:service #(str % ".rate")]
(tag "notification-rate"
(rate 5
(fn [event]
(call-rescue event children))))))
| null | https://raw.githubusercontent.com/turnbullpress/aom-code/2c016cab87d81bcd1f04ab41b6824798eb09e780/10/riemann/examplecom/etc/count-notifications.clj | clojure | (ns examplecom.etc.count-notifications
(:require [riemann.streams :refer :all]))
(defn count-notifications
"Count notifications"
[& children]
(adjust [:service #(str % ".rate")]
(tag "notification-rate"
(rate 5
(fn [event]
(call-rescue event children))))))
| |
e75c04311e1e1ab879bb05fe16fac8acc05458e823ce102a1494eb22f37201ef | picty/parsifal | enum-17.ml | enum test (8, UnknownVal Unknown) =
| 0 -> Zero, "0"
| 1 -> One
| 2 | 3 -> TwoOrThree, "2 or 3"
| 4 | 5 -> FourOrFive
| 6, 10 -> SixToTen, "6 .. 10"
| 11, 20 -> More
| null | https://raw.githubusercontent.com/picty/parsifal/767a1d558ea6da23ada46d8d96a057514b0aa2a8/syntax/unit/enum-17.ml | ocaml | enum test (8, UnknownVal Unknown) =
| 0 -> Zero, "0"
| 1 -> One
| 2 | 3 -> TwoOrThree, "2 or 3"
| 4 | 5 -> FourOrFive
| 6, 10 -> SixToTen, "6 .. 10"
| 11, 20 -> More
| |
f550f9b268aed42449dbb4b2b8fdad4592f4918a0c91d52843a3094ba3b31037 | BillHallahan/G2 | Prim.hs | module Prim where
g :: Int -> Int
g 0 = 1
g _ = 2
f :: Int -> Int
f x = 1 + x + g x
h :: Int -> Int
h x = x + 5
| null | https://raw.githubusercontent.com/BillHallahan/G2/dfd377793dcccdc7126a9f4a65b58249673e8a70/tests/Prim/Prim.hs | haskell | module Prim where
g :: Int -> Int
g 0 = 1
g _ = 2
f :: Int -> Int
f x = 1 + x + g x
h :: Int -> Int
h x = x + 5
| |
2235712efd837e2a98ddcd88236f5c23c173ccad9921f254937bf2704f8f73e1 | michaelmelanson/erlyweb | erlyweb.erl | @author < > [ ]
@copyright Yariv Sadan 2006 - 2007
%%
@doc : The Erlang Twist on Web Framworks .
%%
This module contains a few functions for creating and using ErlyWeb
%% applications and components. It is also the module set as the YAWS
appmod for ErlyWeb applications .
For license information see LI... | null | https://raw.githubusercontent.com/michaelmelanson/erlyweb/997df18b70459bfaaf8c3ab70ab4f54907045d0f/src/erlyweb/erlyweb.erl | erlang |
applications and components. It is also the module set as the YAWS
a few basic files for a rudimantary application.
@equiv create_component(Component, AppDir, [{magic, on}, {model, on},
{erltl, off}])
@doc Create all files (model, view, and controller) for a componen... | @author < > [ ]
@copyright Yariv Sadan 2006 - 2007
@doc : The Erlang Twist on Web Framworks .
This module contains a few functions for creating and using ErlyWeb
appmod for ErlyWeb applications .
For license information see LICENSE.txt
-module(erlyweb).
-author("Yariv Sadan (, )").
-export([
creat... |
921c4c75835145e5402d4f559b40474752aa13f0ca038b3db6024c99d4c88921 | savonet/ocaml-mm | autotune.ml | open Mm_audio
module FFT = Audio.Mono.Analyze.FFT
let channels = 2
let sample_rate = 44100
let periods = 4
let () =
let fft = FFT.init 11 in
let blen = FFT.length fft in
let alsa_in =
Mm_alsa.rw channels sample_rate ~capture:true ~buffer_size:(periods * blen)
~periods ()
in
let alsa_out =
Mm_a... | null | https://raw.githubusercontent.com/savonet/ocaml-mm/3f9e7d0d8da358383fd62e02b476e8fca59fe137/examples/autotune.ml | ocaml | Printf.printf "Read: %d\n%!" r | open Mm_audio
module FFT = Audio.Mono.Analyze.FFT
let channels = 2
let sample_rate = 44100
let periods = 4
let () =
let fft = FFT.init 11 in
let blen = FFT.length fft in
let alsa_in =
Mm_alsa.rw channels sample_rate ~capture:true ~buffer_size:(periods * blen)
~periods ()
in
let alsa_out =
Mm_a... |
9070aba897deb5cf8a31b9eb18b64d9d7037bd8ed37debe7e4cf30e61c35389f | facebookarchive/pfff | overlay_code.mli |
type overlay = {
(* the filenames are in a readable path format *)
orig_to_overlay: (Common.filename, Common.filename) Hashtbl.t;
overlay_to_orig: (Common.filename, Common.filename) Hashtbl.t;
data: (Common.filename (* overlay *) * Common.filename) list;
(* in realpath format *)
root_orig: Common.dirname;... | null | https://raw.githubusercontent.com/facebookarchive/pfff/ec21095ab7d445559576513a63314e794378c367/h_program-lang/overlay_code.mli | ocaml | the filenames are in a readable path format
overlay
in realpath format |
type overlay = {
orig_to_overlay: (Common.filename, Common.filename) Hashtbl.t;
overlay_to_orig: (Common.filename, Common.filename) Hashtbl.t;
root_orig: Common.dirname;
root_overlay: Common.dirname;
}
val overlay_equivalences:
dir_orig:Common.dirname -> dir_overlay:Common.dirname ->
overlay
val adapt_la... |
4ace387c4f0121a9662b532ddb5b417cafb7036854ef2f293fa695f13d68bded | mdsebald/link_blox_app | lblx_send_values.erl |
%%% @doc
%%% @doc
BLOCKTYPE
%%% Send Input values
%%% DESCRIPTION
Export values to receive_value block(s ) on other LinkBlox Nodes .
%%% Send block and Receive block must have the same name.
%%% LINKS
%%% @end
-module(lblx_send_values).
-author("Mark Sebald").
-include("../block_state.hrl")... | null | https://raw.githubusercontent.com/mdsebald/link_blox_app/64034fa5854759ad16625b93e3dde65a9c65f615/src/block_types/lblx_send_values.erl | erlang | @doc
@doc
Send Input values
DESCRIPTION
Send block and Receive block must have the same name.
LINKS
@end
====================================================================
API functions
====================================================================
| int | 1 | 1..99 |
| atom array | n... |
BLOCKTYPE
Export values to receive_value block(s ) on other LinkBlox Nodes .
-module(lblx_send_values).
-author("Mark Sebald").
-include("../block_state.hrl").
-export([groups/0, version/0]).
-export([create/2, create/4, create/5, upgrade/1, initialize/1, execute/2, delete/1]).
groups() -> [output, comm... |
ccbc960a51066eb7ff652538193336d7a04615866674ffaf0c677a1046ff4d4b | andrewzhurov/brawl-haus | core.cljc | (ns config.core)
(def env {:server-url "localhost:9090"
:debug? true})
| null | https://raw.githubusercontent.com/andrewzhurov/brawl-haus/7f560c3dcee7b242fda545d87c102471fdb21888/dev/config/core.cljc | clojure | (ns config.core)
(def env {:server-url "localhost:9090"
:debug? true})
| |
5705d375b9569074254fca8063bc8f3040eb5dd54b809cdb7b8d979eb9de3829 | SimulaVR/simula-godot | Types.hs | # LANGUAGE AllowAmbiguousTypes #
{-# LANGUAGE DataKinds #-}
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
module Plugin.Types where
import Data.Text (Text)
import Data.Vector (Vector)
import Godot.Gdnative.Internal
import ... | null | https://raw.githubusercontent.com/SimulaVR/simula-godot/31472f967e15ddfaf0878f34522b02920573a74b/addons/godot-haskell-plugin/src/Plugin/Types.hs | haskell | # LANGUAGE DataKinds #
Just lazily trying things and don't want to modify | # LANGUAGE AllowAmbiguousTypes #
# LANGUAGE MultiParamTypeClasses #
# LANGUAGE TypeFamilies #
module Plugin.Types where
import Data.Text (Text)
import Data.Vector (Vector)
import Godot.Gdnative.Internal
import Godot.Gdnative.Types
import ... |
c18ff73c1094a1e276531074e0d1c60051e92942f58302ad6c6d12b8e6990fb8 | glguy/advent | 17.hs | # Language ImportQualifiedPost , QuasiQuotes #
|
Module : Main
Description : Day 17 solution
Copyright : ( c ) , 2021
License : ISC
Maintainer :
< >
Module : Main
Description : Day 17 solution
Copyright : (c) Eric Mertens, 2021
License : ISC
Maintainer :
<>
-}
module M... | null | https://raw.githubusercontent.com/glguy/advent/d46da97b9e5ba3c82331f40743bc9652aa7da7d4/solutions/src/2016/17.hs | haskell | | >>> :main | # Language ImportQualifiedPost , QuasiQuotes #
|
Module : Main
Description : Day 17 solution
Copyright : ( c ) , 2021
License : ISC
Maintainer :
< >
Module : Main
Description : Day 17 solution
Copyright : (c) Eric Mertens, 2021
License : ISC
Maintainer :
<>
-}
module M... |
27311ae3cc728e59240fd56c839fe8dad5703ef17cf6bd3249402d7b50fa84cc | nyu-acsys/drift | x_plus_2_pow_n03.ml | let rec bot _ = bot ()
let fail _ = assert false
let rec c1_COEFFICIENT_1086 = 0
let rec c0_COEFFICIENT_1085 = 0
let succ_1030 set_flag_f_1181 s_f_n_1178 n_1031 = n_1031 + 1
let g_1032 x_DO_NOT_CARE_1215 x_DO_NOT_CARE_1216 r_EXPARAM_1088 x_DO_NOT_CARE_1213 x_DO_NOT_CARE_1214 r_1033 set_flag_f_1181 s_f_n_1178 a_1034 =
... | null | https://raw.githubusercontent.com/nyu-acsys/drift/51a3160d74b761626180da4f7dd0bb950cfe40c0/tests/benchmarks/r_type/termination/x_plus_2_pow_n03.ml | ocaml | -:{v:Int | true}
-:{v:Int | true} | let rec bot _ = bot ()
let fail _ = assert false
let rec c1_COEFFICIENT_1086 = 0
let rec c0_COEFFICIENT_1085 = 0
let succ_1030 set_flag_f_1181 s_f_n_1178 n_1031 = n_1031 + 1
let g_1032 x_DO_NOT_CARE_1215 x_DO_NOT_CARE_1216 r_EXPARAM_1088 x_DO_NOT_CARE_1213 x_DO_NOT_CARE_1214 r_1033 set_flag_f_1181 s_f_n_1178 a_1034 =
... |
5c9b146ad5eb1326caca30af331e9fc025a7cce00542ffa9ac4102b7d2d0b5a8 | alexandergunnarson/quantum | devices.cljc | (ns quantum.test.ui.style.css.devices
(:require [quantum.ui.style.css.devices :as ns])) | null | https://raw.githubusercontent.com/alexandergunnarson/quantum/0c655af439734709566110949f9f2f482e468509/test/quantum/test/ui/style/css/devices.cljc | clojure | (ns quantum.test.ui.style.css.devices
(:require [quantum.ui.style.css.devices :as ns])) | |
0207b855294dd7dc1430d9d96c5a9f9f9508d584207ef0efccea18ca2efed200 | patricoferris/ocaml-multicore-monorepo | suspended.ml | (** A suspended fiber with its context. *)
open Eio.Private.Effect.Deep
module Ctf = Eio.Private.Ctf
type 'a t = {
fiber : Eio.Private.Fiber_context.t;
k : ('a, [`Exit_scheduler]) continuation;
}
let tid t = Eio.Private.Fiber_context.tid t.fiber
let continue t v =
Ctf.note_switch (tid t);
continue t.k v
le... | null | https://raw.githubusercontent.com/patricoferris/ocaml-multicore-monorepo/624b3293ee41e83736fe7ac3a79f810c2b70f68b/duniverse/eio/lib_eio/utils/suspended.ml | ocaml | * A suspended fiber with its context. |
open Eio.Private.Effect.Deep
module Ctf = Eio.Private.Ctf
type 'a t = {
fiber : Eio.Private.Fiber_context.t;
k : ('a, [`Exit_scheduler]) continuation;
}
let tid t = Eio.Private.Fiber_context.tid t.fiber
let continue t v =
Ctf.note_switch (tid t);
continue t.k v
let discontinue t ex =
Ctf.note_switch (tid... |
8f667889230fa0ee77d0f1763d018049aeeb29f8c38ec27e73645b313059cbae | timbod7/haskell-chart | AreaSpots.hs | -- |
-- Module : Graphics.Rendering.Chart.Plot.AreaSpots
Copyright : ( c ) 2009
-- License : BSD-style (see COPYRIGHT file)
--
-- Area spots are a collection of unconnected filled circles,
-- with x,y position, and an independent z value to be represented
-- by the relative area of the spots.
# LANGUA... | null | https://raw.githubusercontent.com/timbod7/haskell-chart/8c5a823652ea1b4ec2adbced4a92a8161065ead6/chart/Graphics/Rendering/Chart/Plot/AreaSpots.hs | haskell | |
Module : Graphics.Rendering.Chart.Plot.AreaSpots
License : BSD-style (see COPYRIGHT file)
Area spots are a collection of unconnected filled circles,
with x,y position, and an independent z value to be represented
by the relative area of the spots.
| A collection of unconnected spots, with x,y positio... | Copyright : ( c ) 2009
# LANGUAGE TemplateHaskell #
module Graphics.Rendering.Chart.Plot.AreaSpots
( AreaSpots(..)
, area_spots_title
, area_spots_linethick
, area_spots_linecolour
, area_spots_fillcolour
, area_spots_opacity
, area_spots_max_radius
, area_spots_values
, AreaSpots4D(..)
... |
8207d2ad374bf8ffabaa0c13b3aa5eded879999aa225677178dba73eecc2ce8f | mbj/stratosphere | ModelCard.hs | module Stratosphere.SageMaker.ModelCard (
module Exports, ModelCard(..), mkModelCard
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import {-# SOURCE #-} Stratosphere.SageMaker.ModelCard.ContentProperty as Exports
import {-# SOURCE #... | null | https://raw.githubusercontent.com/mbj/stratosphere/c70f301715425247efcda29af4f3fcf7ec04aa2f/services/sagemaker/gen/Stratosphere/SageMaker/ModelCard.hs | haskell | # SOURCE #
# SOURCE #
# SOURCE # | module Stratosphere.SageMaker.ModelCard (
module Exports, ModelCard(..), mkModelCard
) where
import qualified Data.Aeson as JSON
import qualified Stratosphere.Prelude as Prelude
import Stratosphere.Property
import Stratosphere.ResourceProperties
import Stratosphere.Tag
import Stratosphere.Value
data ModelCa... |
6befd814eb20b3de659904b365701e8de7df328f5029655e5788d1771928581d | protz/mezzo | ResugarFold.mli | open TypeCore
(** This is only for display purposes. *)
val fold_type : env -> typ -> typ
val fold_var : env -> var -> typ
| null | https://raw.githubusercontent.com/protz/mezzo/4e9d917558bd96067437116341b7a6ea02ab9c39/typing/ResugarFold.mli | ocaml | * This is only for display purposes. | open TypeCore
val fold_type : env -> typ -> typ
val fold_var : env -> var -> typ
|
e2dbbe843f4fc67c835bc5f0471768d66f2d95fd6fdd6e2ad12d0eda4cf1a891 | markbastian/partsbin | core.clj | (ns partsbin.monger.core.core
(:require [partsbin.monger.core.alpha :as monger]
[integrant.core :as ig]))
(derive ::connection ::monger/connection)
(derive ::uri-connection ::monger/uri-connection)
(derive ::database ::monger/database)
(def config
{::connection {:host "localhost"}
[::confi... | null | https://raw.githubusercontent.com/markbastian/partsbin/8dc159327f296c9625d129b5943ec79433019e54/src/partsbin/monger/core/core.clj | clojure | (ns partsbin.monger.core.core
(:require [partsbin.monger.core.alpha :as monger]
[integrant.core :as ig]))
(derive ::connection ::monger/connection)
(derive ::uri-connection ::monger/uri-connection)
(derive ::database ::monger/database)
(def config
{::connection {:host "localhost"}
[::confi... | |
aa5241d5908a1df12c79532c5b99f365c842380e0d43884b8281b59a7b6591c9 | dvdt/xvsy | core.clj | (ns xvsy.test.core
(:require [clojure.test :refer :all]
[xvsy.core :refer :all]
[xvsy.ggsql :as ggsql]
[korma.db :as db]
[korma.core :as k]
[clojure.data.json :as json]
[clojure.walk :as walk]
[xvsy.ui :as ui])
(:require [clojure.ma... | null | https://raw.githubusercontent.com/dvdt/xvsy/ff29b96affc6723bb9c66da1011f31900af679dd/test/xvsy/test/core.clj | clojure | (ns xvsy.test.core
(:require [clojure.test :refer :all]
[xvsy.core :refer :all]
[xvsy.ggsql :as ggsql]
[korma.db :as db]
[korma.core :as k]
[clojure.data.json :as json]
[clojure.walk :as walk]
[xvsy.ui :as ui])
(:require [clojure.ma... | |
97f391b2b0f5322e2b89bb32098dd24be566ba32911f542a7903a1e2defa89ab | sondresl/AdventOfCode | Day12.hs | module Day12 where
import Advent.Coord
( down, left, origin, right, turnLeft, turnRight, up,)
import Control.Lens (Lens', view, (%~), (&), (+~), _1, _2)
import Data.List (foldl')
import Lib (Point, mannDist)
import Linear (V2 (..), (*^))
data Command = N | S | E | W | L | R | F
deriving (Show, Read, Eq, Ord)
p... | null | https://raw.githubusercontent.com/sondresl/AdventOfCode/51525441795417f31b3eb67a690aa5534d1e699b/2020/Haskell/src/Day12.hs | haskell | 1424 | module Day12 where
import Advent.Coord
( down, left, origin, right, turnLeft, turnRight, up,)
import Control.Lens (Lens', view, (%~), (&), (+~), _1, _2)
import Data.List (foldl')
import Lib (Point, mannDist)
import Linear (V2 (..), (*^))
data Command = N | S | E | W | L | R | F
deriving (Show, Read, Eq, Ord)
p... |
2dcd430f9ea7258f480b1b2183e8b956ec87c26ec6ad7df141931e49ca0989dd | naoiwata/sicp | q2.13.scm | ;;
;; @author naoiwata
SICP Chapter2
question 2.13
;;
n = ( 100 * w)/(a + w )
- > n = 100 * ( A - a)/2 / ( A + a)/2
- > n = 100 * ( A - a ) / ( A + a )
; a(X , x) = (X - x)/(X + x)*100
b(Y , y ) = ( Y - y)/(Y + y)*100
a(X , x ) + b(Y , y )
; = (X - x)/(X + x)*100 + (Y - y)/(Y + y)*100
= 100 * 2*(XY -... | null | https://raw.githubusercontent.com/naoiwata/sicp/7314136c5892de402015acfe4b9148a3558b1211/chapter2/q2.13.scm | scheme |
@author naoiwata
a(X , x) = (X - x)/(X + x)*100
= (X - x)/(X + x)*100 + (Y - y)/(Y + y)*100
?
= ab(XY, xy)
in conclusion,
a(+ +) b(+ +)
END | SICP Chapter2
question 2.13
n = ( 100 * w)/(a + w )
- > n = 100 * ( A - a)/2 / ( A + a)/2
- > n = 100 * ( A - a ) / ( A + a )
b(Y , y ) = ( Y - y)/(Y + y)*100
a(X , x ) + b(Y , y )
= 100 * 2*(XY - xy ) / ( XY + Xy + xY + xy )
= 100 * 2*(XY - xy ) / 2*(XY + xy )
= 100 * ( XY - xy ) / ( XY + xy )
... |
ab3df56a702b6c99082b352445871bba6aa5186c88405141e20ac3aa91b94a52 | melange-re/melange | jsoo_400_test.ml | let u () =
match String.length "123" with
| n -> 3 / 0
| exception _ -> 42 (* TODO: could be optimized *)
;; Mt.from_pair_suites __MODULE__
[
__LOC__, fun _ -> ThrowAny (fun _ -> ignore (u ()))
]
| null | https://raw.githubusercontent.com/melange-re/melange/246e6df78fe3b6cc124cb48e5a37fdffd99379ed/jscomp/test/jsoo_400_test.ml | ocaml | TODO: could be optimized | let u () =
match String.length "123" with
| n -> 3 / 0
;; Mt.from_pair_suites __MODULE__
[
__LOC__, fun _ -> ThrowAny (fun _ -> ignore (u ()))
]
|
b2e6bc41d5434aeb7809e0ac536ee0c19d295965b2ce8544640e63bc3b85b6f6 | lfe/lfe | lfe_types.erl | Copyright ( c ) 2016 - 2021
%%
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
%% you may not use this file except in compliance with the License.
%% You may obtain a copy of the License at
%%
%% -2.0
%%
%% Unless required by applicable law or agreed to in writing, software
distributed... | null | https://raw.githubusercontent.com/lfe/lfe/fc5ae30f6738dfd0664864698bfebb5423241ff8/src/lfe_types.erl | erlang |
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
-2.0
Unless required by applicable law or agreed to in writing, software
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing perm... | Copyright ( c ) 2016 - 2021
Licensed under the Apache License , Version 2.0 ( the " License " ) ;
distributed under the License is distributed on an " AS IS " BASIS ,
Author :
Purpose : Lisp Flavoured Erlang type formatting .
Handling types in LFE including functions for converting between
Erlang ... |
4c9f759ac550907ce6fd49f1bed55f7d5816fb112bf524ac8bf89b3e4f237695 | ott-lang/ott | coq_induct.ml | (**************************************************************************)
(* Ott *)
(* *)
, Computer Laboratory , University of Cambridge
, project , I... | null | https://raw.githubusercontent.com/ott-lang/ott/29ac9ef84967686da35b9b42608b3aec3539a689/src/coq_induct.ml | ocaml | ************************************************************************
Ott
... | , Computer Laboratory , University of Cambridge
, project , INRIA Rocquencourt
Copyright 2005 - 2010
1 . Redistributions of source code must retain the above copyright
2 . Redistributions in binary form must reproduce the ... |
3bc9729492c05719eff927d01f5212bfd907049a58ca708014334d51ffe8d016 | GregorySchwartz/too-many-cells | Load.hs | TooManyCells . MakeTree . Load
Collects the functions pertaining to loading labels for the tree .
Gregory W. Schwartz
Collects the functions pertaining to loading labels for the tree.
-}
{-# LANGUAGE BangPatterns #-}
{-# LANGUAGE OverloadedStrings #-}
module TooManyCells.MakeTree.Load
( loadClusterRe... | null | https://raw.githubusercontent.com/GregorySchwartz/too-many-cells/85b1180613c4f4c7570fb167b89bf0ad9b3fe59e/src/TooManyCells/MakeTree/Load.hs | haskell | # LANGUAGE BangPatterns #
# LANGUAGE OverloadedStrings #
Remote
Local
| Load a format for the tree and results from a file.
| Load a format for the tree and results from a file.
| Convert a dendrogram type to a tree type in the cluster results. | TooManyCells . MakeTree . Load
Collects the functions pertaining to loading labels for the tree .
Gregory W. Schwartz
Collects the functions pertaining to loading labels for the tree.
-}
module TooManyCells.MakeTree.Load
( loadClusterResultsFiles
, loadClusterResults
) where
import BirchBeer... |
3f1fd2c5a1bcbb9b7cfb8ce50ec2bcf8cbd9efa874040392e8424a8d92b8fccb | ghcjs/ghcjs | testTypeableBinary.hs | # LANGUAGE MagicHash #
# LANGUAGE DataKinds #
# LANGUAGE PolyKinds #
import qualified Data.ByteString as BS
import Type.Reflection
import Data.Binary
import GHCi.TH.Binary ()
import GHC.Exts
import Data.Kind
import Data.Proxy
testRoundtrip :: Typeable a => TypeRep a -> IO ()
testRoundtrip rep
| rep /= rep' = putSt... | null | https://raw.githubusercontent.com/ghcjs/ghcjs/e4cd4232a31f6371c761acd93853702f4c7ca74c/test/ghc/typecheck/testTypeableBinary.hs | haskell | # LANGUAGE MagicHash #
# LANGUAGE DataKinds #
# LANGUAGE PolyKinds #
import qualified Data.ByteString as BS
import Type.Reflection
import Data.Binary
import GHCi.TH.Binary ()
import GHC.Exts
import Data.Kind
import Data.Proxy
testRoundtrip :: Typeable a => TypeRep a -> IO ()
testRoundtrip rep
| rep /= rep' = putSt... | |
0b195bfa8ed618a642a97f71c520977e2ee384db72088f2a850923d54d4378f9 | vmchale/dickinson | Unique.hs | {-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE GeneralizedNewtypeDeriving #
module Language.Dickinson.Unique ( Unique (..)
, UniqueCtx
, dummyUnique
) where
import Control.DeepSeq (NFData)
import ... | null | https://raw.githubusercontent.com/vmchale/dickinson/5b7d9d48bdb2aa902cddc0161dca3a6e7f3e0aea/src/Language/Dickinson/Unique.hs | haskell | # LANGUAGE DeriveDataTypeable #
| For interning identifiers.
| Dummy unique for sake of testing | # LANGUAGE GeneralizedNewtypeDeriving #
module Language.Dickinson.Unique ( Unique (..)
, UniqueCtx
, dummyUnique
) where
import Control.DeepSeq (NFData)
import Data.Binary (Binary (..))
import ... |
9072cc733a7b3a2b93ba9c45c6390e58670975fae680bf5d4f22eb03e5d03576 | haskell-github/github | GitShow.hs | module GitShow where
import qualified Github.Repos.Commits as Github
import Data.List
main = do
possibleCommit <- Github.commit "thoughtbot" "paperclip" "bc5c51d1ece1ee45f94b056a0f5a1674d7e8cba9"
case possibleCommit of
(Left error) -> putStrLn $ "Error: " ++ (show error)
(Right commit) -> putStrLn $ fo... | null | https://raw.githubusercontent.com/haskell-github/github/d9ac0c7ffbcc720a24d06f0a96ea4e3891316d1a/samples/Repos/Commits/GitShow.hs | haskell | module GitShow where
import qualified Github.Repos.Commits as Github
import Data.List
main = do
possibleCommit <- Github.commit "thoughtbot" "paperclip" "bc5c51d1ece1ee45f94b056a0f5a1674d7e8cba9"
case possibleCommit of
(Left error) -> putStrLn $ "Error: " ++ (show error)
(Right commit) -> putStrLn $ fo... | |
982f389e52ca8857ddf08073b228bdadeffa07602b12cb49eb51ab55fd2c5ac1 | UBTECH-Walker/WalkerSimulationFor2020WAIC | cruiserSensorAction.lisp | ; Auto-generated. Do not edit!
(cl:in-package cruiser_msgs-srv)
// ! \htmlinclude cruiserSensorAction-request.msg.html
(cl:defclass <cruiserSensorAction-request> (roslisp-msg-protocol:ros-message)
((ultrasound_freq
:reader ultrasound_freq
:initarg :ultrasound_freq
:type cl:integer
:initform 0)
... | null | https://raw.githubusercontent.com/UBTECH-Walker/WalkerSimulationFor2020WAIC/7cdb21dabb8423994ba3f6021bc7934290d5faa9/walker_WAIC_18.04_v1.2_20200616/walker_install/share/common-lisp/ros/cruiser_msgs/srv/cruiserSensorAction.lisp | lisp | Auto-generated. Do not edit!
//! \htmlinclude cruiserSensorAction-response.msg.html |
(cl:in-package cruiser_msgs-srv)
// ! \htmlinclude cruiserSensorAction-request.msg.html
(cl:defclass <cruiserSensorAction-request> (roslisp-msg-protocol:ros-message)
((ultrasound_freq
:reader ultrasound_freq
:initarg :ultrasound_freq
:type cl:integer
:initform 0)
(wall_ir_freq
:reader wall... |
f50503674e9486b2fca3926782f54cb9986f9e51c56318c740f706497554b223 | coq/coq | certificate.mli | (************************************************************************)
(* * The Coq Proof Assistant / The Coq Development Team *)
v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * *... | null | https://raw.githubusercontent.com/coq/coq/a281562cee7d026e02731c943fa86bd9352a618a/plugins/micromega/certificate.mli | ocaml | **********************************************************************
* The Coq Proof Assistant / The Coq Development Team
// * This file is distributed under the terms of the
* (see LICENSE file for the text of the license)
************************************... | v * Copyright INRIA , CNRS and contributors
< O _ _ _ , , * ( see version control and CREDITS file for authors & dates )
\VV/ * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
* GNU Lesser Gener... |
ef1dbceab46d38b20a8c0eb46bf31f4fef3c4adc176757ef2bb7a2234ce66e37 | crategus/cl-cffi-gtk | rtest-gdk-rectangle.lisp | (def-suite gdk-rectangle :in gdk-suite)
(in-suite gdk-rectangle)
;;; --- Types and Values -------------------------------------------------------
GdkRectangle
(test gdk-rectangle-struct
;; Type check
(is-true (g-type-is-a (gtype "GdkRectangle") +g-type-boxed+))
;; Check the type initializer
(is (eq (gt... | null | https://raw.githubusercontent.com/crategus/cl-cffi-gtk/22156e3e2356f71a67231d9868abcab3582356f3/test/rtest-gdk-rectangle.lisp | lisp | --- Types and Values -------------------------------------------------------
Type check
Check the type initializer
--- Functions --------------------------------------------------------------
gdk_rectangle_intersect
gdk_rectangle_union
gdk_rectangle_equal | (def-suite gdk-rectangle :in gdk-suite)
(in-suite gdk-rectangle)
GdkRectangle
(test gdk-rectangle-struct
(is-true (g-type-is-a (gtype "GdkRectangle") +g-type-boxed+))
(is (eq (gtype "GdkRectangle")
(gtype (foreign-funcall "gdk_rectangle_get_type" g-size)))))
(test gdk-rectangle-properties
(let... |
ab665113bbbcfd7463c914a52ddb54096cf63a9afdd989e378e41fbde65d3007 | ocaml-ppx/ppx | viewer_common.mli | open Viewlib
val txt'match : ('a, 'i, 'o) View.t -> ('a Astlib.Loc.t, 'i, 'o) View.t
val loc'match : (Astlib.Location.t, 'i, 'o) View.t -> ('a Astlib.Loc.t, 'i, 'o) View.t
val loc_start'match : (Astlib.Position.t, 'i, 'o) View.t -> (Astlib.Location.t, 'i, 'o) View.t
val loc_end'match : (Astlib.Position.t, 'i, 'o) Vie... | null | https://raw.githubusercontent.com/ocaml-ppx/ppx/40e5a35a4386d969effaf428078c900bd03b78ec/ast/viewer_common.mli | ocaml | open Viewlib
val txt'match : ('a, 'i, 'o) View.t -> ('a Astlib.Loc.t, 'i, 'o) View.t
val loc'match : (Astlib.Location.t, 'i, 'o) View.t -> ('a Astlib.Loc.t, 'i, 'o) View.t
val loc_start'match : (Astlib.Position.t, 'i, 'o) View.t -> (Astlib.Location.t, 'i, 'o) View.t
val loc_end'match : (Astlib.Position.t, 'i, 'o) Vie... | |
9784b1982d47f1367d8e7b54602c5c24cde3227175ca2a7f4f93f5a5c6c8d247 | HealthSamurai/re-form | checkbox_page.cljs | (ns ui.checkbox-page
(:require [re-form.core :as form]
[re-form.inputs :as w]
[ui.routes :as ui-routes]))
(defn checkbox-page []
(let [items [{:name "Nikolai"}
{:name "Mike"}
{:name "Max"}
{:name "Marat"}
{:name "Tim"}
... | null | https://raw.githubusercontent.com/HealthSamurai/re-form/810321d67e3946876c834998e3472d0693846953/example/srcs/ui/checkbox_page.cljs | clojure | (ns ui.checkbox-page
(:require [re-form.core :as form]
[re-form.inputs :as w]
[ui.routes :as ui-routes]))
(defn checkbox-page []
(let [items [{:name "Nikolai"}
{:name "Mike"}
{:name "Max"}
{:name "Marat"}
{:name "Tim"}
... | |
ff7df416e18a794a809c0f7230f687fecec64b14b638900fbf9cce60338e1078 | IronScheme/IronScheme | fixnums.sps | #!r6rs
(import (tests r6rs arithmetic fixnums)
(tests r6rs test)
(rnrs io simple))
(display "Running tests for (rnrs arithmetic fixnums)\n")
(run-arithmetic-fixnums-tests)
(report-test-results)
| null | https://raw.githubusercontent.com/IronScheme/IronScheme/687cde5d4e463a119e4ba28296f2af42a5c4a9df/IronScheme/IronScheme.Console/tests/r6rs/run/arithmetic/fixnums.sps | scheme | #!r6rs
(import (tests r6rs arithmetic fixnums)
(tests r6rs test)
(rnrs io simple))
(display "Running tests for (rnrs arithmetic fixnums)\n")
(run-arithmetic-fixnums-tests)
(report-test-results)
| |
b959cfeae7d861eee6dc3c637aa67f9666fcf9141442f30f3dfccc056805ceb6 | static-analysis-engineering/codehawk | bCHSystemSettings.mli | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... | null | https://raw.githubusercontent.com/static-analysis-engineering/codehawk/15765b4be65024f1687ccc3cc7b645347ce72063/CodeHawk/CHB/bchlib/bCHSystemSettings.mli | ocaml | bchlib | = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = = =
CodeHawk Binary Analyzer
Author : ------------------------------------------------------------------------------
The MIT License ( MIT )
Co... |
9b86cb5a312c83607511acd6ede8e29d97233b2b3ef343d814dfbbaefd0ab462 | startalkIM/ejabberd | ejabberd_node_groups.erl | %%%----------------------------------------------------------------------
%%% File : ejabberd_node_groups.erl
Author : < >
%%% Purpose : Distributed named node groups based on pg2 module
Created : 1 Nov 2006 by < >
%%%
%%%
ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne
%%%
%%% This program is f... | null | https://raw.githubusercontent.com/startalkIM/ejabberd/718d86cd2f5681099fad14dab5f2541ddc612c8b/src/ejabberd_node_groups.erl | erlang | ----------------------------------------------------------------------
File : ejabberd_node_groups.erl
Purpose : Distributed named node groups based on pg2 module
This program is free software; you can redistribute it and/or
License, or (at your option) any later version.
This program is distributed in the ... | Author : < >
Created : 1 Nov 2006 by < >
ejabberd , Copyright ( C ) 2002 - 2016 ProcessOne
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
... |
feafa914b569171c31bd14f9ce6144431fbaefbb142e10da3e4a6e3c58b95b3d | potomak/haskell-player | AudioInfo.hs | {-# LANGUAGE OverloadedStrings #-}
module Sound.Player.AudioInfo (
SongInfo(..),
fetchSongInfo
) where
import Control.Exception (SomeException(SomeException), Exception)
import Data.ByteString.Lazy (ByteString, hGetContents)
import qualified Data.Text as T
import System.Process (StdStream(CreatePipe), CreateProce... | null | https://raw.githubusercontent.com/potomak/haskell-player/4328ba614254328fcc7107f60afc603562da137b/src/Sound/Player/AudioInfo.hs | haskell | # LANGUAGE OverloadedStrings # |
module Sound.Player.AudioInfo (
SongInfo(..),
fetchSongInfo
) where
import Control.Exception (SomeException(SomeException), Exception)
import Data.ByteString.Lazy (ByteString, hGetContents)
import qualified Data.Text as T
import System.Process (StdStream(CreatePipe), CreateProcess(std_out),
createProcess, proc)... |
ed71c362461ca10a44d3d6b9878f7e19f4fb3269ca3738ff17614f791ba01935 | coco-team/lustrec | c_backend_header.ml | (********************************************************************)
(* *)
The LustreC compiler toolset / The LustreC Development Team
Copyright 2012 - -- ONERA - CNRS - INPT
(* ... | null | https://raw.githubusercontent.com/coco-team/lustrec/b21f9820df97e661633cd4418fdab68a6c6ca67d/src/backends/C/c_backend_header.ml | ocaml | ******************************************************************
LustreC is free software, distributed WITHOUT ANY WARRANTY
under the terms of the GNU Lesser General Public L... | The LustreC compiler toolset / The LustreC Development Team
Copyright 2012 - -- ONERA - CNRS - INPT
version 2.1 .
open Format
open Lustre_types
open Corelang
open Machine_code_types
open Machine_code_common
open C_backend_c... |
93fe50241cfcdb8b41bf4913ad89055292864465cc1cb65cf9f7d865c0a6f14f | tweag/asterius | strun002.hs | This showed up an " entered - absent - arg " error in 5.02.1
module Main where
is_volatile :: [Int] -> (String,Int) -> Int
is_volatile [] (destVarName, destPtr)
= error ("Variable not found: " ++ "(" ++ (show destPtr) ++ ") " ++ destVarName)
is_volatile (a:allWrites) (destVarName, destPtr)
| a == destPtr ... | null | https://raw.githubusercontent.com/tweag/asterius/e7b823c87499656860f87b9b468eb0567add1de8/asterius/test/ghc-testsuite/strAnal/strun002.hs | haskell | This showed up an " entered - absent - arg " error in 5.02.1
module Main where
is_volatile :: [Int] -> (String,Int) -> Int
is_volatile [] (destVarName, destPtr)
= error ("Variable not found: " ++ "(" ++ (show destPtr) ++ ") " ++ destVarName)
is_volatile (a:allWrites) (destVarName, destPtr)
| a == destPtr ... | |
daed063ae52ad1371ad66a1f34b290b42ad6e043bb2d51056d6374d0a72b3e1f | steinuil/xobl | parser.ml | open Parsetree
open Parser_utils
open Patche.Combinators
open Patche.Combinators.Infix
open Patche.Xml
type 'a parser = ('a, Parser_utils.error) Patche.Xml.t
let doc = el_discard "doc" |> discard_with Doc
let required_start_align : required_start_align parser =
el_a "required_start_align"
(map2 mk_required_sta... | null | https://raw.githubusercontent.com/steinuil/xobl/a5480d9ed51c6b9a51b3a7aa41f246a47ce1ecda/compiler/parser.ml | ocaml | open Parsetree
open Parser_utils
open Patche.Combinators
open Patche.Combinators.Infix
open Patche.Xml
type 'a parser = ('a, Parser_utils.error) Patche.Xml.t
let doc = el_discard "doc" |> discard_with Doc
let required_start_align : required_start_align parser =
el_a "required_start_align"
(map2 mk_required_sta... | |
b037efb3fc2122660d9a9395805f613f9c4cc0678975f875511dd11c1b51f2b0 | yminer/libml | inputMlpnnStdVisitor.ml | * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
[ LibML - Machine Learning Library ]
Copyright ( C ) 2002 - 2003 LAGACHERIE
This program is free software ; you can redistribute it and/or
modify it under the te... | null | https://raw.githubusercontent.com/yminer/libml/1475dd87c2c16983366fab62124e8bbfbbf2161b/src/nn/input/inputMlpnnStdVisitor.ml | ocaml | *
The method which activate the input layer.
//FIXME we have to verify the size of the input layer vs
the size of the learning vector
| * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *
[ LibML - Machine Learning Library ]
Copyright ( C ) 2002 - 2003 LAGACHERIE
This program is free software ; you can redistribute it and/or
modify it under the te... |
7839759d675b116dcf9611da9a46d27b9501873f7bfe88e6436bda8b481075a2 | aliaksandr-s/prototyping-with-clojure | config.clj | (ns visitera.config
(:require
[cprop.core :refer [load-config]]
[cprop.source :as source]
[mount.core :refer [args defstate]]))
(defstate env
:start
(load-config
:merge
[(args)
(source/from-system-props)
(source/from-env)]))
| null | https://raw.githubusercontent.com/aliaksandr-s/prototyping-with-clojure/e1f90bf66c315de1dfa72624895637f1c609c42e/app/chapter-03/end/visitera/src/clj/visitera/config.clj | clojure | (ns visitera.config
(:require
[cprop.core :refer [load-config]]
[cprop.source :as source]
[mount.core :refer [args defstate]]))
(defstate env
:start
(load-config
:merge
[(args)
(source/from-system-props)
(source/from-env)]))
| |
d94b3d7e1aa652ac67880c8710fae442020a5314ceb5166fa5e3abdb13093891 | lichenscript/lichenscript | npm_version_bumper.ml |
* Copyright 2022
*
* Licensed under the Apache License , Version 2.0 ( the " License " ) ;
* you may not use this file except in compliance with the License .
* You may obtain a copy of the License at
*
* -2.0
*
* Unless required by applicable law or agreed to in writing , software
... | null | https://raw.githubusercontent.com/lichenscript/lichenscript/ccdd538f82c95e6478cdcaee974b2100e21cfa09/npm_version_bumper/npm_version_bumper.ml | ocaml |
* Copyright 2022
*
* 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
... | |
40776fc21060981544ff024703c69269913c78e94e34d4f04f2bcd9246467891 | facebook/infer | PerfEvent.mli |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... | null | https://raw.githubusercontent.com/facebook/infer/4ee1c2a8e783ee770b61547a38ff1715d6ed75fe/infer/src/base/PerfEvent.mli | ocaml | * only what we need for now |
* Copyright ( c ) Facebook , Inc. and its affiliates .
*
* This source code is licensed under the MIT license found in the
* LICENSE file in the root directory of this source tree .
* Copyright (c) Facebook, Inc. and its affiliates.
*
* This source code is licensed under the MIT license found in the
... |
fa43d6feb50735e57ff03d953a129b406a9ad2a359a0bfe1bcbe7d0a8fc0b6e4 | huangz1990/real-world-haskell-cn | TreeMap.hs | -- file: ch10/TreeMap.hs
data Tree a = Node (Tree a) (Tree a)
| Leaf a
deriving (Show)
-- file: ch10/TreeMap.hs
treeLengths (Leaf s) = Leaf (length s)
treeLengths (Node l r) = Node (treeLengths l) (treeLengths r)
-- file: ch10/TreeMap.hs
treeMap :: (a -> b) -> Tree a -> Tree b
treeMap f (Lea... | null | https://raw.githubusercontent.com/huangz1990/real-world-haskell-cn/f67b07dd846b1950d17ff941d650089fcbbe9586/code/ch10/TreeMap.hs | haskell | file: ch10/TreeMap.hs
file: ch10/TreeMap.hs
file: ch10/TreeMap.hs
file: ch10/TreeMap.hs | data Tree a = Node (Tree a) (Tree a)
| Leaf a
deriving (Show)
treeLengths (Leaf s) = Leaf (length s)
treeLengths (Node l r) = Node (treeLengths l) (treeLengths r)
treeMap :: (a -> b) -> Tree a -> Tree b
treeMap f (Leaf a) = Leaf (f a)
treeMap f (Node l r) = Node (treeMap f l) (treeMap f r)... |
d7aefb7bfa4614d7bd60e91c8b268954301bdcfd0a1810589be26c1d5d02c6a1 | vasilisp/inez | smtlib_parser.ml |
A parser for SMT - LIB QF_UFLIA instances .
This module translates formulas and terms to our GADT
representation , but not commands ( declare - fun , assert & co ) .
Smtlib_solver parses commands and puts everything together , i.e. ,
calls the underlying solver in our usual functorial way .... | null | https://raw.githubusercontent.com/vasilisp/inez/3bbbbb82a12918c1557f5fb0b49a8c73ab8d6da1/frontend/smtlib_parser.ml | ocaml | utilities
parsing functions
base cases
erroneous base cases
recursive cases
erroneous recursive cases
int cases
bool cases
bool-from-int cases
polymorphic cases |
A parser for SMT - LIB QF_UFLIA instances .
This module translates formulas and terms to our GADT
representation , but not commands ( declare - fun , assert & co ) .
Smtlib_solver parses commands and puts everything together , i.e. ,
calls the underlying solver in our usual functorial way .... |
9bc4cff04ebfd18f2eeceb3b548af4465b02fc42afd9204d0cc2a8941cd09282 | mfelleisen/Acquire | game-intf.rkt | #lang racket
;; ---------------------------------------------------------------------------------------------------
;; interface specification for integration testers
(require
"admin.rkt" "basics.rkt" "board.rkt" (only-in "state.rkt" state?) "player.rkt" "Lib/contract.rkt")
(interface game&
(run
;; (run lp... | null | https://raw.githubusercontent.com/mfelleisen/Acquire/5b39df6c757c7c1cafd7ff198641c99d30072b91/game-intf.rkt | racket | ---------------------------------------------------------------------------------------------------
interface specification for integration testers
(run lp n)
run n rounds of a game of Aquire with the external players in lp
(run lp n #:show show)
.. like above, but use show to display the current board | #lang racket
(require
"admin.rkt" "basics.rkt" "board.rkt" (only-in "state.rkt" state?) "player.rkt" "Lib/contract.rkt")
(interface game&
(run
(->i ((lp (and/c (listof player?) (lambda (lp) (<= MIN-PLAYER# (length lp) MAX-PLAYER#))))
(n natural-number/c))
(#:show (show (-> natural-number/c ... |
7ef87015c373a109bd1ae9eabc491e68716ec3403528e3940dfe4379ce2e21c3 | mput/sicp-solutions | 3_02.test.rkt | #lang racket
(require rackunit rackunit/text-ui)
(require (only-in "../solutions/3_02.rkt" make-monitored))
(define tests
(test-suite
"Test for exercise 3_02"
(test-case
"Tests for make-monitored"
(define square-monitored (make-monitored (lambda (x) (* x x))))
(square-monitored 2)
... | null | https://raw.githubusercontent.com/mput/sicp-solutions/fe12ad2b6f17c99978c8fe04b2495005986b8496/tests/3_02.test.rkt | racket | #lang racket
(require rackunit rackunit/text-ui)
(require (only-in "../solutions/3_02.rkt" make-monitored))
(define tests
(test-suite
"Test for exercise 3_02"
(test-case
"Tests for make-monitored"
(define square-monitored (make-monitored (lambda (x) (* x x))))
(square-monitored 2)
... | |
77d10e64c7ab6eb9937f754f3aa3085ebe97dd00b513b9a4a6df5339b3d8dd19 | linearray/mealstrom | Recovery.hs | {-# LANGUAGE OverloadedStrings #-}
# LANGUAGE DeriveGeneric #
{-# LANGUAGE DeriveAnyClass #-}
# LANGUAGE FlexibleContexts #
{-# LANGUAGE TypeSynonymInstances #-}
# LANGUAGE MultiParamTypeClasses #
|
Module : Recovery
Description : Test that recovery works
Copyright : ( c ) , 2016
License : MIT ... | null | https://raw.githubusercontent.com/linearray/mealstrom/802bc8c06734d447c1193359a6a853da9c578176/test/Recovery.hs | haskell | # LANGUAGE OverloadedStrings #
# LANGUAGE DeriveAnyClass #
# LANGUAGE TypeSynonymInstances #
indicate that we read the IORef and are running the action now
action is run again
If we reach this, then the recovery definitely ran, yet the entry in the DB
might still be wrong. That's ok. | # LANGUAGE DeriveGeneric #
# LANGUAGE FlexibleContexts #
# LANGUAGE MultiParamTypeClasses #
|
Module : Recovery
Description : Test that recovery works
Copyright : ( c ) , 2016
License : MIT
Maintainer :
Module : Recovery
Description : Test that recovery works
Copyright : (c) Max A... |
f04c49e5ebe7cb79b6a5642e1bcecb0d8004cab63eab6840036b3a966d771352 | mejgun/haskell-tdlib | ReadAllMessageThreadMentions.hs | {-# LANGUAGE OverloadedStrings #-}
-- |
module TD.Query.ReadAllMessageThreadMentions where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
-- |
Marks all mentions in a forum topic as read @chat_id Chat identifier @message_thread_id Message thread identifier in wh... | null | https://raw.githubusercontent.com/mejgun/haskell-tdlib/d9868e9231a4ec23e4bcbf7f6627ff9f43acea21/src/TD/Query/ReadAllMessageThreadMentions.hs | haskell | # LANGUAGE OverloadedStrings #
|
|
|
| |
module TD.Query.ReadAllMessageThreadMentions where
import qualified Data.Aeson as A
import qualified Data.Aeson.Types as T
import qualified Utils as U
Marks all mentions in a forum topic as read @chat_id Chat identifier @message_thread_id Message thread identifier in which mentions are marked as read
data ReadAllM... |
a1e960f596017e12bd7d11f946cf1e4a7d69c45ce17de4a7f3d74730c4c2300e | nikomatsakis/a-mir-formality | locations.rkt | #lang racket
(require redex/reduction-semantics
"grammar.rkt"
)
(provide basic-block-locations)
(define-metafunction formality-body
;; Returns the set of all locations in the body.
all-locations : BasicBlockDecls -> Locations
[(all-locations [BasicBlockDecl ...])
(flatten [[Location_s ... L... | null | https://raw.githubusercontent.com/nikomatsakis/a-mir-formality/bc951e21bff2bae1ccab8cc05b2b39cfb6365bfd/racket-src/body/locations.rkt | racket | Returns the set of all locations in the body.
Returns the statements/terminator from the block, paired with their locations. | #lang racket
(require redex/reduction-semantics
"grammar.rkt"
)
(provide basic-block-locations)
(define-metafunction formality-body
all-locations : BasicBlockDecls -> Locations
[(all-locations [BasicBlockDecl ...])
(flatten [[Location_s ... Location_t] ...])
(where/error [([(Location_s Sta... |
0ffec2edbc7682860a556c1f971631075ca5358945d6598b8c05b3be051afd19 | huangjs/cl | sequence.lisp | (in-package :cl-user)
(defpackage :hjs.data.sequence
(:use #:common-lisp #:iterate #:hjs.meta.functional)
(:export #:flatten
#:flatten1
#:split
#:split1
#:substitute-sequence
#:shuffle
#:nshuffle
#:random-elt
#:position-any
#:find-any
#:print-list-table
#:range
#:out... | null | https://raw.githubusercontent.com/huangjs/cl/96158b3f82f82a6b7d53ef04b3b29c5c8de2dbf7/lib/mylib/sequence.lisp | lisp | modifier
constructor & predicates
flatten/split/shuffle
TODO: list is not optimized. use pattern matching
position-any/find-any
print a table made from a list of lists
fax's functional version seems to be faster than mine...
indicating the width of each column
start printing
range
foldl/foldr
note: used by ... | (in-package :cl-user)
(defpackage :hjs.data.sequence
(:use #:common-lisp #:iterate #:hjs.meta.functional)
(:export #:flatten
#:flatten1
#:split
#:split1
#:substitute-sequence
#:shuffle
#:nshuffle
#:random-elt
#:position-any
#:find-any
#:print-list-table
#:range
#:out... |
42c4875ed66b249a9b8a6745a753da435ac63d08583e0db63543b364fa71db60 | agentm/project-m36 | Persist.hs | # LANGUAGE ForeignFunctionInterface , CPP #
this module is related to persisting Project : M36 structures to disk and not related to the persistent library
module ProjectM36.Persist (writeFileSync,
writeSerialiseSync,
renameSync,
printFdC... | null | https://raw.githubusercontent.com/agentm/project-m36/8ad012958c87cef633ffbe266d94b394cac08b40/src/lib/ProjectM36/Persist.hs | haskell | System.Directory's renameFile/renameDirectory almost do exactly what we want except that it needlessly differentiates between directories and files
uses lazy bytestring to write to file
on Windows directory metadata cannot be synchronized- perhaps there is a workaround? resync a file in the directory?
prints out num... | # LANGUAGE ForeignFunctionInterface , CPP #
this module is related to persisting Project : M36 structures to disk and not related to the persistent library
module ProjectM36.Persist (writeFileSync,
writeSerialiseSync,
renameSync,
printFdC... |
3919325f3977754c30a5d3496116f0406486d7ac39abc035de3973e19df9e482 | coalton-lang/coalton | struct-or-class.lisp | (defpackage #:coalton-impl/codegen/struct-or-class
(:use
#:cl
#:coalton-impl/util)
(:local-nicknames
(#:global-lexical #:coalton-impl/global-lexical)
(#:rt #:coalton-impl/runtime))
(:export
#:struct-or-class
#:struct-or-class-field
#:make-struct-or-class-field
#:struct-or-class-field-name
... | null | https://raw.githubusercontent.com/coalton-lang/coalton/9f8c25d72f5b5e237739f79bb92042f2f2fbaa59/src/codegen/struct-or-class.lisp | lisp | (defpackage #:coalton-impl/codegen/struct-or-class
(:use
#:cl
#:coalton-impl/util)
(:local-nicknames
(#:global-lexical #:coalton-impl/global-lexical)
(#:rt #:coalton-impl/runtime))
(:export
#:struct-or-class
#:struct-or-class-field
#:make-struct-or-class-field
#:struct-or-class-field-name
... | |
596a9563363f341789a95fb984b03c3292031945837df925928182815f3675e1 | ocaml/MPP-language-blender | mpp_stringmap.ml | (***********************************************************************)
Meta Pre Processor , a language blender
( c ) 2013 by < >
(* Licence : ISC *)
(* -support-policy/isc-license/ *)
(*************************... | null | https://raw.githubusercontent.com/ocaml/MPP-language-blender/0596bf5d50b4b36d071dc429473d039b777e7c3b/src/mpp_stringmap.ml | ocaml | *********************************************************************
Licence : ISC
-support-policy/isc-license/
********************************************************************* | Meta Pre Processor , a language blender
( c ) 2013 by < >
include Map.Make(String)
|
a74b9807a9cc2f04461de9c401420475ff8af38e9335350973b8988924f78fc6 | Gizra/ihp-simple-seat-reservation | New.hs | module Web.View.Events.New where
import Web.View.Prelude
data NewView = NewView
{ event :: Event
, venue :: Venue
}
instance View NewView where
html NewView { .. } = [hsx|
{breadcrumb}
<h1>New Event</h1>
{renderForm event}
|]
where
breadcrumb = renderBre... | null | https://raw.githubusercontent.com/Gizra/ihp-simple-seat-reservation/a779754064ccbfc9c6fc23c8bb013764ab4a157d/Web/View/Events/New.hs | haskell | module Web.View.Events.New where
import Web.View.Prelude
data NewView = NewView
{ event :: Event
, venue :: Venue
}
instance View NewView where
html NewView { .. } = [hsx|
{breadcrumb}
<h1>New Event</h1>
{renderForm event}
|]
where
breadcrumb = renderBre... | |
b005a61e82698b22ccacda41b272c3f47e337a43985e96a1e30311160907777d | pallix/lacij | swing.clj | (ns lacij.examples.swing
(:use lacij.edit.graph
analemma.xml
(tikkba swing dom)
tikkba.utils.xml)
(:import (javax.swing JFrame SwingUtilities)))
(defn -main []
(let [g (-> (graph)
(add-node :athena "Athena" :x 10 :y 30)
(add-node :zeus "Zeus" :x 200 :y 150)
... | null | https://raw.githubusercontent.com/pallix/lacij/ee9b7dcda13f25f7460acb5995b7970a7564c11e/src/lacij/examples/swing.clj | clojure | wait for rendering, TODO: attach a listener instead | (ns lacij.examples.swing
(:use lacij.edit.graph
analemma.xml
(tikkba swing dom)
tikkba.utils.xml)
(:import (javax.swing JFrame SwingUtilities)))
(defn -main []
(let [g (-> (graph)
(add-node :athena "Athena" :x 10 :y 30)
(add-node :zeus "Zeus" :x 200 :y 150)
... |
d9e525ca94bc4ed036fafb066cd905137002993ce1c8808482d1fa12b6f69a3d | richhickey/clojure-contrib | test_io.clj | (ns clojure.contrib.test-io
(:refer-clojure :exclude (spit))
(:use clojure.test clojure.contrib.io)
(:import (java.io File FileInputStream BufferedInputStream)
(java.net URL URI)))
(deftest file-str-backslash
(is (= (java.io.File.
(str "C:" java.io.File/separator
"Documents"... | null | https://raw.githubusercontent.com/richhickey/clojure-contrib/40b960bba41ba02811ef0e2c632d721eb199649f/src/test/clojure/clojure/contrib/test_io.clj | clojure | (ns clojure.contrib.test-io
(:refer-clojure :exclude (spit))
(:use clojure.test clojure.contrib.io)
(:import (java.io File FileInputStream BufferedInputStream)
(java.net URL URI)))
(deftest file-str-backslash
(is (= (java.io.File.
(str "C:" java.io.File/separator
"Documents"... | |
9722facdbe2e77c0a945d8c8e095619b0c72772b472624eb220294adb8fe99ea | johnwhitington/ocamli | tinyocamlutil.mli | val calc : Tinyocaml.op -> (int -> int -> int)
val comp : Tinyocaml.cmp -> ('a -> 'a -> bool)
val is_value : Tinyocaml.t -> bool
val underline_redex : Tinyocaml.t -> Tinyocaml.t
val strip_control : Tinyocaml.t -> Tinyocaml.t
val remove_named_recursive_functions : bool -> string list -> Tinyocaml.t -> Tinyocaml.t
... | null | https://raw.githubusercontent.com/johnwhitington/ocamli/28da5d87478a51583a6cb792bf3a8ee44b990e9f/tinyocamlutil.mli | ocaml | val calc : Tinyocaml.op -> (int -> int -> int)
val comp : Tinyocaml.cmp -> ('a -> 'a -> bool)
val is_value : Tinyocaml.t -> bool
val underline_redex : Tinyocaml.t -> Tinyocaml.t
val strip_control : Tinyocaml.t -> Tinyocaml.t
val remove_named_recursive_functions : bool -> string list -> Tinyocaml.t -> Tinyocaml.t
... | |
0783692e21bea4af7de08595c56a895c5590cd802e88efd8ea21851633f757e0 | mbillingr/lisp-in-small-pieces | interpreter7.scm | (import (builtin core)
(libs utils)
(libs book))
; instructions are encoded as bytecode
; call/cc is defined as a primitive
; bind-exit is defined as a special form
; dynamic variables with special forms
; exception handling
(include "common-stuff.scm")
(include "pretreatment.scm")
(define backup.g.c... | null | https://raw.githubusercontent.com/mbillingr/lisp-in-small-pieces/b2b158dfa91dc95d75af4bd7d93f8df22219047e/07-compilation/interpreter7.scm | scheme | instructions are encoded as bytecode
call/cc is defined as a primitive
bind-exit is defined as a special form
dynamic variables with special forms
exception handling
===========================================================================
pc for (POP-HANDLER) (RESTORE-ENV) (RETURN)
pc for (NON-CONT-ERR)
===... | (import (builtin core)
(libs utils)
(libs book))
(include "common-stuff.scm")
(include "pretreatment.scm")
(define backup.g.current g.current)
(define (original.g.current) backup.g.current)
(define *code* 'anything)
(define *pc* 'anything)
(define *constants* 'anything)
(define *env* 'anything)
(def... |
f7c016960fcfedc8b06aa70a7e6ff3bad91ffc9d5c1360e266c6005d7cec2b31 | racket/typed-racket | path.rkt | #lang typed/racket/base
(require (only-in "../xml.rkt" XExpr))
(provide (all-defined-out))
(define-type Se-Path
(Listof (U Symbol Keyword)))
(require/typed/provide xml/path
[se-path*/list (-> Se-Path XExpr (Listof Any))]
[se-path* (-> Se-Path XExpr Any)])
| null | https://raw.githubusercontent.com/racket/typed-racket/50fb1c013b8b9691be7482a8911d4d4466f5fa44/typed-racket-more/typed/xml/path.rkt | racket | #lang typed/racket/base
(require (only-in "../xml.rkt" XExpr))
(provide (all-defined-out))
(define-type Se-Path
(Listof (U Symbol Keyword)))
(require/typed/provide xml/path
[se-path*/list (-> Se-Path XExpr (Listof Any))]
[se-path* (-> Se-Path XExpr Any)])
| |
9dba35897f3e333d1776d3b11001f1b2a77ac2a86d59d564a576b209111bdc65 | dhleong/wish | inventory.cljs | (ns ^{:author "Daniel Leong"
:doc "Inventory-related util functions"}
wish.inventory
(:require [clojure.string :as str]))
(def stackable-types #{:ammunition
:potion})
(def custom-namespace "custom")
(defn custom?
"Given an item map, check if it's a custom item"
[item]
(or (nil?... | null | https://raw.githubusercontent.com/dhleong/wish/9036f9da3706bfcc1e4b4736558b6f7309f53b7b/src/cljs/wish/inventory.cljs | clojure | this method doesn't handle that" | (ns ^{:author "Daniel Leong"
:doc "Inventory-related util functions"}
wish.inventory
(:require [clojure.string :as str]))
(def stackable-types #{:ammunition
:potion})
(def custom-namespace "custom")
(defn custom?
"Given an item map, check if it's a custom item"
[item]
(or (nil?... |
62e9e93031c4d0126d1fa92a51e45444b4522f896d48d81de076fa9a43758fa0 | andgate/type-theory-compiler | Extra.hs | module LLVM.IRBuilder.Extra where
import Control.Monad
import LLVM.AST hiding (callingConvention)
import LLVM.AST.CallingConvention
import LLVM.AST.Global
import LLVM.AST.Type
import qualified LLVM.AST.Constant as C
import LLVM.IRBuilder.Module
import LLVM.IRBuilder.Monad
functionCC
:: MonadModuleBuilder m
=> Na... | null | https://raw.githubusercontent.com/andgate/type-theory-compiler/a404f085d19a19b16ae8c26616707dc46707ea10/lltt-llvm/src/LLVM/IRBuilder/Extra.hs | haskell | ^ Function name
^ Parameter types and name suggestions
^ Return type
^ Function body builder | module LLVM.IRBuilder.Extra where
import Control.Monad
import LLVM.AST hiding (callingConvention)
import LLVM.AST.CallingConvention
import LLVM.AST.Global
import LLVM.AST.Type
import qualified LLVM.AST.Constant as C
import LLVM.IRBuilder.Module
import LLVM.IRBuilder.Monad
functionCC
:: MonadModuleBuilder m
-> Ca... |
6f1986f9aad4f9c9953008e426d453116aaba21915dbfd59b7510b17480625f9 | bluelisp/hemlock | htext3.lisp | ;;;; -*- Mode: Lisp; indent-tabs-mode: nil -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
;;;
;;;
;;; ******************************************... | null | https://raw.githubusercontent.com/bluelisp/hemlock/47e16ba731a0cf4ffd7fb2110e17c764ae757170/src/htext3.lisp | lisp | -*- Mode: Lisp; indent-tabs-mode: nil -*-
**********************************************************************
**********************************************************************
More Hemlock Text-Manipulation functions.
The code in this file implements the insert functions in the
hack marked line's cha... | This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
Written by .
" Doing Stuff and Going Places " chapter of the Hemlock Design document .
(in-package :hemlock-internals)
(defmethod insert-character (mark character)
"Ins... |
5aac47c7a9b187f3e56fba0da7c880f21ecab18dc3b6ce5bb522c069102a3340 | doublecrowngaming/dataflower | Operators.hs | |
Module : Dataflow
Description : Timely Dataflow for Haskell
Copyright : ( c ) Double Crown Gaming Co. 2020
License : :
Stability : experimental
Common utility operators for data flows
@since 0.1.3.0
Module : Dataflow
Description : Timely Dataflow for Haskell
Copyright :... | null | https://raw.githubusercontent.com/doublecrowngaming/dataflower/aac24873936883cc9e555030c8598f61b676c242/src/Dataflow/Operators.hs | haskell | | Construct a stateless vertex that sends each input to every 'Edge' in the output list.
| Construct a stateless vertex that applies the provided function to every input
and sends the result to the output.
@since 0.2.1.0
@since 0.2.1.0
@since 0.2.1.0 | |
Module : Dataflow
Description : Timely Dataflow for Haskell
Copyright : ( c ) Double Crown Gaming Co. 2020
License : :
Stability : experimental
Common utility operators for data flows
@since 0.1.3.0
Module : Dataflow
Description : Timely Dataflow for Haskell
Copyright :... |
5ed172d77c04913e18345aa67f8ebf05a95e373547bd9b0c9606a054191464d0 | wdebeaum/step | deenergize.lisp | ;;;;
;;;; w::deenergize
;;;;
(define-words :pos W::V
:TEMPL AGENT-FORMAL-XP-TEMPL
:words (
(w::deenergize
(senses
((LF-parent ont::deactivate-turn-off)) ;change-device-state))
((LF-parent ont::deactivate-turn-off) ;change-device-state)
(templ agent-templ)
(Example "Intransitive ... | null | https://raw.githubusercontent.com/wdebeaum/step/f38c07d9cd3a58d0e0183159d4445de9a0eafe26/src/LexiconManager/Data/new/deenergize.lisp | lisp |
w::deenergize
change-device-state))
change-device-state) |
(define-words :pos W::V
:TEMPL AGENT-FORMAL-XP-TEMPL
:words (
(w::deenergize
(senses
(templ agent-templ)
(Example "Intransitive usage: how do I deenergize "))
))
))
|
c99b7a51b4b88245e97e96ed51e111da99f0f25c16f1e268ad819d92e6c5a0dd | ekmett/reactive | Integ.hs | Simple test of recursive integrals , from
import Control.Arrow (first)
import Data.Max
import Data.AddBounds
import FRP.Reactive.Behavior
import FRP.Reactive.PrimReactive
import FRP.Reactive.Internal.Reactive
import FRP.Reactive.Internal.Behavior
import FRP.Reactive.Future
import FRP.Reactive
import FRP.Reactive.I... | null | https://raw.githubusercontent.com/ekmett/reactive/61b20b7a2e92af372b5bd9a2af294db0fbdfa9d8/src/Test/Integ.hs | haskell | For ticker
[(0.0,1.0),(0.1,1.1046221254112045),(0.2,1.2081089504435316),(0.30000000000000004,1.3345038765672335),(0.4000000000000001,1.4741225085031893),(0.5000000000000001,1.6283483384592894),(0.6000000000000001,1.7987096025387035),(0.7000000000000001,1.9868944241538458),(0.8,2.1947675417764927),(0.9,2.4243887867806... | Simple test of recursive integrals , from
import Control.Arrow (first)
import Data.Max
import Data.AddBounds
import FRP.Reactive.Behavior
import FRP.Reactive.PrimReactive
import FRP.Reactive.Internal.Reactive
import FRP.Reactive.Internal.Behavior
import FRP.Reactive.Future
import FRP.Reactive
import FRP.Reactive.I... |
c4ec4b37063dd2ff9ff2583c2110ef1c0b92f62b37f6d7c264f5ce92875d6908 | dparis/gen-phzr | webgl_graphics_data.cljs | (ns phzr.pixi.webgl-graphics-data
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser]))
(defn ->WebGLGraphicsData
""
([]
(js/PIXI.WebGLGraphicsData.)))
(defn reset
""
([webgl-graphics-data]
(phaser->clj
(.reset webgl-g... | null | https://raw.githubusercontent.com/dparis/gen-phzr/e4c7b272e225ac343718dc15fc84f5f0dce68023/out/pixi/webgl_graphics_data.cljs | clojure | (ns phzr.pixi.webgl-graphics-data
(:require [phzr.impl.utils.core :refer [clj->phaser phaser->clj]]
[phzr.impl.extend :as ex]
[cljsjs.phaser]))
(defn ->WebGLGraphicsData
""
([]
(js/PIXI.WebGLGraphicsData.)))
(defn reset
""
([webgl-graphics-data]
(phaser->clj
(.reset webgl-g... | |
647ba83325bde282626009fdcb5310ad86109036f0d8a052aee4b80878ca9fce | mirleft/ocaml-tls | echo_client.ml |
open Ex_common
open Lwt
let cached_session : Tls.Core.epoch_data =
let hex = Cstruct.of_hex in
{
Tls.Core.protocol_version = `TLS_1_3 ;
ciphersuite = `DHE_RSA_WITH_AES_128_GCM_SHA256 ;
peer_random = hex "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" ;
peer_certificate = None ;
... | null | https://raw.githubusercontent.com/mirleft/ocaml-tls/9e05cbb8c61f1dd3e9707c530a7697cd2e63f45f/lwt/examples/echo_client.ml | ocaml |
open Ex_common
open Lwt
let cached_session : Tls.Core.epoch_data =
let hex = Cstruct.of_hex in
{
Tls.Core.protocol_version = `TLS_1_3 ;
ciphersuite = `DHE_RSA_WITH_AES_128_GCM_SHA256 ;
peer_random = hex "000102030405060708090a0b0c0d0e0f101112131415161718191a1b1c1d1e1f" ;
peer_certificate = None ;
... | |
55463c822ccf87376ed82d924010e0748fd7c26dd9dde91e737c8ef44b9e2eb3 | vikram/lisplibraries | sbcl.lisp | (in-package :trivial-sockets)
(eval-when (:compile-toplevel :load-toplevel :execute)
(require :sb-bsd-sockets))
(defun resolve-hostname (name)
(cond
((eql name :any) #(0 0 0 0))
((typep name '(vector * 4)) name)
(t (car (sb-bsd-sockets:host-ent-addresses
(sb-bsd-sockets:get-host-by-name name))))))
... | null | https://raw.githubusercontent.com/vikram/lisplibraries/105e3ef2d165275eb78f36f5090c9e2cdd0754dd/site/ucw-boxset/dependencies/trivial-sockets_until-i-can-merge-with-the-mainline/sbcl.lisp | lisp | (in-package :trivial-sockets)
(eval-when (:compile-toplevel :load-toplevel :execute)
(require :sb-bsd-sockets))
(defun resolve-hostname (name)
(cond
((eql name :any) #(0 0 0 0))
((typep name '(vector * 4)) name)
(t (car (sb-bsd-sockets:host-ent-addresses
(sb-bsd-sockets:get-host-by-name name))))))
... | |
c442af32b8edcabdb30ea06bc2f0c3e85007c0ba148621a85024fe0afb8a81d8 | quil-lang/qvm | fowler-noise.lisp | ;;;; fowler-noise.lisp
;;;;
This file is a reparametrization of ` DEPOLARIZING - NOISE - QVM ' , further
extended over the stabilizer QVM . The reparameterization is to match
Fowler 's convention : a set of flags toggle whether noise is applied after
;;;; various kinds of gates (see `FOWLER-NOISE'), a single pa... | null | https://raw.githubusercontent.com/quil-lang/qvm/4617625cb6053b1adfd3f7aea9cd2be328b225f6/src/error/fowler-noise.lisp | lisp | fowler-noise.lisp
various kinds of gates (see `FOWLER-NOISE'), a single parameter determining
the probability of whether noise is _not_ applied after a gate, and in the
complementary case uniform probability of the different sorts of Pauli
flips one can apply.
specifically simulating upkeep for a surface code. ... | This file is a reparametrization of ` DEPOLARIZING - NOISE - QVM ' , further
extended over the stabilizer QVM . The reparameterization is to match
Fowler 's convention : a set of flags toggle whether noise is applied after
Fowler further groups the flags into " classes " which assume that one is
(in-package ... |
0af4131f2d6de48e022abbe9eb32dcc4e75fb738c1323ab7d0040953cc7f5775 | clj-commons/rewrite-cljs | findz.cljs | (ns rewrite-clj.zip.findz
(:refer-clojure :exclude [find])
(:require [rewrite-clj.zip.base :as base]
[rewrite-clj.zip.move :as m]
[rewrite-clj.node :as node]
[rewrite-clj.zip.whitespace :as ws]
[clojure.zip :as z]))
;; ## Helpers
(defn- tag-predicate
[t & [additio... | null | https://raw.githubusercontent.com/clj-commons/rewrite-cljs/5b0fdea43a6748519d0b0ad3d7eaa98aa541de35/src/rewrite_clj/zip/findz.cljs | clojure | ## Helpers
## Find Operations | (ns rewrite-clj.zip.findz
(:refer-clojure :exclude [find])
(:require [rewrite-clj.zip.base :as base]
[rewrite-clj.zip.move :as m]
[rewrite-clj.node :as node]
[rewrite-clj.zip.whitespace :as ws]
[clojure.zip :as z]))
(defn- tag-predicate
[t & [additional]]
(if ad... |
6e59f577fd527561c644c4cca84e0a00453f4970963fce868e1a60e64fdbbe86 | simonmar/monad-par | kmeans.hs | K - Means sample from " Parallel and Concurrent Programming in Haskell "
-- with modifications for benchmarking: erjiang
--
# LANGUAGE CPP #
{-# LANGUAGE DeriveDataTypeable #-}
# LANGUAGE NamedFieldPuns #
{-# OPTIONS_GHC -O2 -ddump-splices #-}
import System.IO
import System.IO.Unsafe
import Data.IORef
import KMe... | null | https://raw.githubusercontent.com/simonmar/monad-par/1266b0ac1b4040963ab356cf032c6aae6b8a7add/examples/src/kmeans/kmeans.hs | haskell | with modifications for benchmarking: erjiang
# LANGUAGE DeriveDataTypeable #
# OPTIONS_GHC -O2 -ddump-splices #
-----------------------------------------------------------------------------
K-Means: repeatedly step until convergence (sequential)
kmeans_seq :: Int -> [Cluster] -> IO [Cluster]
let
loop :: ... | K - Means sample from " Parallel and Concurrent Programming in Haskell "
# LANGUAGE CPP #
# LANGUAGE NamedFieldPuns #
import System.IO
import System.IO.Unsafe
import Data.IORef
import KMeansCommon
import Control.Applicative
import Control.Monad.IO.Class (liftIO)
import Data.Array
import Text.Printf
import Data.D... |
216aa2454c7e85d90815b178667e88bd0cc947a21922703ab678694951511347 | abridgewater/nq-clim | standard-rectangle.lisp | ;;;
nq - clim / geometry / standard - rectangle
;;;
Parts of CLIM II 3.2.4 .
;;;
(cl:defpackage :nq-clim/geometry/standard-rectangle
(:use :cl
:nq-clim/geometry/bounding-rectangle-protocol
:nq-clim/geometry/nowhere
:nq-clim/geometry/rectangle-protocol)
(:export
"STANDARD-RECTANGLE"
... | null | https://raw.githubusercontent.com/abridgewater/nq-clim/11d339fd0ac77b6d624fc5537b170294a191a3de/geometry/standard-rectangle.lisp | lisp |
"MAKE-RECTANGLE"
This is the definition of a standard rectangle, which conforms to
the rectangle protocol (which happens to also require implementing
the bounding-rectangle protocol), as opposed to
standard-bounding-rectangle, which is a bounding-rectangle that
therefore are completely different, their almost-... | nq - clim / geometry / standard - rectangle
Parts of CLIM II 3.2.4 .
(cl:defpackage :nq-clim/geometry/standard-rectangle
(:use :cl
:nq-clim/geometry/bounding-rectangle-protocol
:nq-clim/geometry/nowhere
:nq-clim/geometry/rectangle-protocol)
(:export
"STANDARD-RECTANGLE"
"MAKE-RECT... |
a693cf2151cad0336b62174c36c9143de667698b7fb24252e1f081ec9d819c43 | tisnik/clojure-examples | core.clj | ;
( C ) Copyright 2015 , 2020
;
; All rights reserved. This program and the accompanying materials
; are made available under the terms of the Eclipse Public License v1.0
; which accompanies this distribution, and is available at
-v10.html
;
; Contributors:
;
(ns seesaw10.core
(:gen-class))
... | null | https://raw.githubusercontent.com/tisnik/clojure-examples/984af4a3e20d994b4f4989678ee1330e409fdae3/seesaw10/src/seesaw10/core.clj | clojure |
All rights reserved. This program and the accompanying materials
are made available under the terms of the Eclipse Public License v1.0
which accompanies this distribution, and is available at
Contributors:
| ( C ) Copyright 2015 , 2020
-v10.html
(ns seesaw10.core
(:gen-class))
(use 'seesaw.core)
(use 'seesaw.color)
(defn button-clicked-event
[e]
(alert (str "Button clicked!")))
(def formular
(grid-panel :columns 2
:rows 3
:items [(button :text ":backgro... |
845360768b7b5bad063eced69caa058268b33b752fc633fee88df0331bc3b12e | alexwl/haskell-code-explorer | Regex.hs | module Regex where
import Prelude hiding (null)
import Str
import Regex.Types
accept :: Reg -> Str -> Bool
accept Eps u = null u
accept (Sym c) u = u == singleton c
accept (Alt p q) u = accept p u || accept q u
accept (Seq p q) u =
or [accept p u1 && accept q u2 | (u1, u2) <- splits u]
accept (Rep r) u =
... | null | https://raw.githubusercontent.com/alexwl/haskell-code-explorer/2f1c2a4c87ebd55b8a335bc4670eec875af8b4c4/vendor/cabal-helper-0.8.1.2/tests/bkpregex/regex-indef/Regex.hs | haskell | module Regex where
import Prelude hiding (null)
import Str
import Regex.Types
accept :: Reg -> Str -> Bool
accept Eps u = null u
accept (Sym c) u = u == singleton c
accept (Alt p q) u = accept p u || accept q u
accept (Seq p q) u =
or [accept p u1 && accept q u2 | (u1, u2) <- splits u]
accept (Rep r) u =
... | |
f389fb2192b44fd16107436f373a8c5bba5293376a0cf09e344fb8bd8c9f6ca3 | edgecase/dieter | project.clj | (defproject t3 "1.0.0-SNAPSHOT"
:description "FIXME: write description"
:main t3.core/boot
:dependencies [[org.clojure/clojure "1.3.0"]
[ring/ring-core "1.1.1"]
[ring/ring-jetty-adapter "1.1.1"]
[org.eclipse.jetty/jetty-server "7.6.1.v20120215"]
... | null | https://raw.githubusercontent.com/edgecase/dieter/f3c7cdd7703c6d1556e68bbe8fc94406b717f6f1/test-projects/t3/project.clj | clojure | (defproject t3 "1.0.0-SNAPSHOT"
:description "FIXME: write description"
:main t3.core/boot
:dependencies [[org.clojure/clojure "1.3.0"]
[ring/ring-core "1.1.1"]
[ring/ring-jetty-adapter "1.1.1"]
[org.eclipse.jetty/jetty-server "7.6.1.v20120215"]
... | |
3a927ea9ed8d41ffcfc4a941132eba835c7ba104b5d275da3b0e5363061d2fc1 | craigl64/clim-ccl | test-clim-tests.lisp | -*- mode : common - lisp ; package : clim - user -*-
;;
;;
;; See the file LICENSE for the full license governing this code.
;;
(in-package :clim-user)
;;; Testing stuff
(clim-test:define-frame-test run-clim-tests (clim-tests :width 600 :height 600)
(
(:commands clim-tests-commands)
)
(exit-clim-tests)... | null | https://raw.githubusercontent.com/craigl64/clim-ccl/301efbd770745b429f2b00b4e8ca6624de9d9ea9/test/test-clim-tests.lisp | lisp | package : clim - user -*-
See the file LICENSE for the full license governing this code.
Testing stuff
--- phew. write some more
This would be nice but moving to the top right of the
presentation does not work when they are circular!
(com-ordering-test-1)
(:presentation-click display-pane integer)
(com-grap... |
(in-package :clim-user)
(clim-test:define-frame-test run-clim-tests (clim-tests :width 600 :height 600)
(
(:commands clim-tests-commands)
)
(exit-clim-tests))
(clim-test:define-frame-test run-clim-tests-with-r-tree (clim-tests
:width 600 :height 600
:history-class r-tree-output-history)
... |
67dc7786e24c2d73b2ab2076623372634d35973d24762db1ac0413bf13d646c8 | racket/gui | procs.rkt | #lang racket/base
(require ffi/unsafe
"../../syntax.rkt"
"../../lock.rkt"
racket/class
racket/draw
"filedialog.rkt"
"colordialog.rkt"
"types.rkt"
"utils.rkt"
"style.rkt"
"widget.rkt"
"window.rkt"
"frame.rkt"
... | null | https://raw.githubusercontent.com/racket/gui/1386c815512906250443e50212e0816717cc493b/gui-lib/mred/private/wx/gtk/procs.rkt | racket | see also
`install-control-font`
if the background and foreground are the same
color, probably something has gone wrong; | #lang racket/base
(require ffi/unsafe
"../../syntax.rkt"
"../../lock.rkt"
racket/class
racket/draw
"filedialog.rkt"
"colordialog.rkt"
"types.rkt"
"utils.rkt"
"style.rkt"
"widget.rkt"
"window.rkt"
"frame.rkt"
... |
fa918db590a9e3004e9563fd7a5233989021e326f372f2931bdd5368be91e878 | gheber/kenzo | whitehead.lisp | -*- Mode : Lisp ; Syntax : ANSI - Common - Lisp ; Base : 10 - *
WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD
WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD
WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEA... | null | https://raw.githubusercontent.com/gheber/kenzo/48e2ea398b80f39d3b5954157a7df57e07a362d7/src/kenzo-7/whitehead.lisp | lisp | Syntax : ANSI - Common - Lisp ; Base : 10 - *
Z
Z/2Z
|
WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD
WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD
WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD WHITEHEAD
(IN-PACKAGE #:cat-7)
(provide "whitehead")
(DEFUN Z-WWHITEHE... |
9a04ede2acc866ec680c2a003d612d1049e2f3aba5b718c64a44a3e86b263e71 | djblue/portal | launcher.clj | (ns ^:no-doc portal.runtime.jvm.launcher
(:require [clojure.edn :as edn]
[org.httpkit.client :as client]
[org.httpkit.server :as http]
[portal.runtime :as rt]
[portal.runtime.browser :as browser]
[portal.runtime.fs :as fs]
[portal.runtime.jvm.cli... | null | https://raw.githubusercontent.com/djblue/portal/d70730d4e5506937be4d5c1eb37120ff2e199931/src/portal/runtime/jvm/launcher.clj | clojure | (ns ^:no-doc portal.runtime.jvm.launcher
(:require [clojure.edn :as edn]
[org.httpkit.client :as client]
[org.httpkit.server :as http]
[portal.runtime :as rt]
[portal.runtime.browser :as browser]
[portal.runtime.fs :as fs]
[portal.runtime.jvm.cli... | |
260b8c5a9b6360106f7819acbe778b87ad4e748e29b93eccec2d109ecb1e4660 | sbcl/sbcl | array.lisp | ;;;; array operations for the x86 VM
This software is part of the SBCL system . See the README file for
;;;; more information.
;;;;
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
;;;; public domain. The software is in the public domain and ... | null | https://raw.githubusercontent.com/sbcl/sbcl/181370a72104503dc5dce7f89196fe5d690fa08c/src/compiler/x86/array.lisp | lisp | array operations for the x86 VM
more information.
public domain. The software is in the public domain and is
provided with absolutely no warranty. See the COPYING and CREDITS
files for more information.
allocator for the array header
additional accessors and setters for the array header
not all registers have ... |
This software is part of the SBCL system . See the README file for
This software is derived from the CMU CL system , which was
written at Carnegie Mellon University and released into the
(in-package "SB-VM")
(define-vop (make-array-header)
(:translate make-array-header)
(:policy :fast-safe)
(:args (typ... |
52fd1567be6f9ca0b200f3bc362fdf598bf1e21b6f74fe96e82c849b17a0f91e | avsm/platform | opamFormula.mli | (**************************************************************************)
(* *)
Copyright 2012 - 2015 OCamlPro
Copyright 2012 INRIA
(* ... | null | https://raw.githubusercontent.com/avsm/platform/b254e3c6b60f3c0c09dfdcde92eb1abdc267fa1c/duniverse/opam-client.2.0.5%2Bdune/src/format/opamFormula.mli | ocaml | ************************************************************************
All rights reserved. This file is distributed under the terms of the
exception on linking descr... | Copyright 2012 - 2015 OCamlPro
Copyright 2012 INRIA
GNU Lesser General Public License version 2.1 , with the special
* binary operations ( compatible with the Dose type for Cudf operators ! )
* Version constra... |
3bed478a253ec95e9e45572ddf64ae4ce334944a6f953d61dde9525fbdb2fd20 | dm3/sicp | e2_61_62.clj | (ns e2-61-62
(:use clojure.test)
(:require [clojurecheck.core :as cc]))
; From the previous exercise
(defn element-of-set? [x xs]
(cond (empty? xs) false
(= x (first xs)) true
:else (element-of-set? x (rest xs))))
2.61
; Takes roughly |xs|/2 operations
(defn adjoin-set-ord [x xs]
(cond (empt... | null | https://raw.githubusercontent.com/dm3/sicp/14f0361cbd0cce817d93e38dcc895f3e845515b1/src/main/clojure/e2_61_62.clj | clojure | From the previous exercise
Takes roughly |xs|/2 operations
It's (almost) |xs|+|ys| in case xs = {k, ..., m-1, n}, ys = {m, ..., n - 1} where n > m > k.
In this case we need to scan to the xs(m-1) where we'll have accumulated the
{k, ..., m-1} segment. Then we'll have to scan to the end of ys which will
result in ... | (ns e2-61-62
(:use clojure.test)
(:require [clojurecheck.core :as cc]))
(defn element-of-set? [x xs]
(cond (empty? xs) false
(= x (first xs)) true
:else (element-of-set? x (rest xs))))
2.61
(defn adjoin-set-ord [x xs]
(cond (empty? xs) [x]
(<= x (first xs)) (cons x xs)
(> x (... |
083bfba8ab25b369312c4014c852c96588bad23e68b4c2309dbbedfbc69d36aa | jimweirich/sicp-study | ex2_32_test.scm | SICP Tests 2.32
(test-case "Ex 2.32"
(assert-equal '(() (3) (2) (2 3) (1) (1 3) (1 2) (1 2 3))
(subsets '(1 2 3))))
| null | https://raw.githubusercontent.com/jimweirich/sicp-study/bc5190e04ed6ae321107ed6149241f26efc1b8c8/scheme/chapter2/ex2_32_test.scm | scheme | SICP Tests 2.32
(test-case "Ex 2.32"
(assert-equal '(() (3) (2) (2 3) (1) (1 3) (1 2) (1 2 3))
(subsets '(1 2 3))))
| |
dacdf447d1e89a9706fa48423f3b1b7e29faee148f25ea4eb04feb6115856f5d | ChrisTitusTech/gimphelp | 210_create-new_animated-letters.scm | ; 210_create-new_animated-letters.scm
last modified / tested by [ gimphelp.org ]
05/11/2019 on GIMP 2.10.10
;==================================================
;
; Installation:
; This script should be placed in the user or system-wide script folder.
;
; Windows 7/10
C:\Program Files\GIMP 2\share\gimp\2.0\scrip... | null | https://raw.githubusercontent.com/ChrisTitusTech/gimphelp/fdbc7e3671ce6bd74cefd83ecf7216e5ee0f1542/gimp_scripts-2.10/210_create-new_animated-letters.scm | scheme | 210_create-new_animated-letters.scm
==================================================
Installation:
This script should be placed in the user or system-wide script folder.
Windows 7/10
or
Linux
/home/yourname/.config/GIMP/2.10/scripts
or
Linux system-wide
/usr/share/gimp/2.0/scripts
==============... | last modified / tested by [ gimphelp.org ]
05/11/2019 on GIMP 2.10.10
C:\Program Files\GIMP 2\share\gimp\2.0\scripts
C:\Users\YOUR - NAME\AppData\Roaming\GIMP\2.10\scripts
it under the terms of the GNU General Public License as published by
the Free Software Foundation , either version 3 of the Lice... |
5872864ae9c2a2ff12ef324708137a20eef2cc534fc05dc9335772f20d11340b | SHoltzen/dice | CoreGrammar.ml | open Core
type expr =
| And of expr * expr
| Or of expr * expr
| Eq of expr * expr
| Xor of expr * expr
| Not of expr
| Ident of String.t
| Sample of expr
| Fst of expr
| Snd of expr
| Tup of expr * expr
| Ite of expr * expr * expr
| True
| False
| Flip of Bignum.t
| Let of String.t * exp... | null | https://raw.githubusercontent.com/SHoltzen/dice/83a52ead59f6c7c13c5c0f79dbd89eeb4e4e581a/lib/CoreGrammar.ml | ocaml | let t2 = type_of env els in
assert (t1 == t2);
* Core function grammar
set up the type environment and then type the body | open Core
type expr =
| And of expr * expr
| Or of expr * expr
| Eq of expr * expr
| Xor of expr * expr
| Not of expr
| Ident of String.t
| Sample of expr
| Fst of expr
| Snd of expr
| Tup of expr * expr
| Ite of expr * expr * expr
| True
| False
| Flip of Bignum.t
| Let of String.t * exp... |
dfce4e8a4a15a3238ee919deb26bccfc8bf4cba896e0636632ddfd9e7c5974ac | pedestal/pedestal | sse.clj | Copyright 2013 Relevance , Inc.
Copyright 2014 - 2022 Cognitect , Inc.
; The use and distribution terms for this software are covered by the
Eclipse Public License 1.0 ( )
; 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 ... | null | https://raw.githubusercontent.com/pedestal/pedestal/53bfe70143a22cdfd2f0d183023334a199c9e9a2/service/src/io/pedestal/http/sse.clj | clojure | The use and distribution terms for this software are covered by the
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 notice, or any other, from this software.
C... | Copyright 2013 Relevance , Inc.
Copyright 2014 - 2022 Cognitect , Inc.
Eclipse Public License 1.0 ( )
(ns io.pedestal.http.sse
(:require [ring.util.response :as ring-response]
[clojure.core.async :as async]
[clojure.core.async.impl.protocols :as asyncimpl]
[io.pedestal.htt... |
b77284076e403701416f07fecae2fc2be0791435341ed6c8e8f215dac681dba9 | fukamachi/caveman | nested-parameter.lisp | (in-package :cl-user)
(defpackage caveman2-nested-parameter-test
(:use :cl
:prove)
(:import-from :caveman2.nested-parameter
:parse-parameters
:parse-key)
(:import-from :trivial-types
:property-list-p
:association-list-p))
(in-package :caveman... | null | https://raw.githubusercontent.com/fukamachi/caveman/faa5f7e3b364fd7e7096af9a7bb06728b8d80441/v2/t/nested-parameter.lisp | lisp | (in-package :cl-user)
(defpackage caveman2-nested-parameter-test
(:use :cl
:prove)
(:import-from :caveman2.nested-parameter
:parse-parameters
:parse-key)
(:import-from :trivial-types
:property-list-p
:association-list-p))
(in-package :caveman... | |
1c6a9577b010696a90e7b0ca0e68b82048549c7fa81d33dda11ed6de56766fd8 | rtoy/cmucl | debug.lisp | ;;; -*- Package: HPPA -*-
;;;
;;; **********************************************************************
This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
;;;
(ext:file-comment
"$Header: src/compiler/hppa/debug.lisp $")
;;;
;;; ... | null | https://raw.githubusercontent.com/rtoy/cmucl/9b1abca53598f03a5b39ded4185471a5b8777dea/src/compiler/hppa/debug.lisp | lisp | -*- Package: HPPA -*-
**********************************************************************
**********************************************************************
| This code was written as part of the CMU Common Lisp project at
Carnegie Mellon University , and has been placed in the public domain .
(ext:file-comment
"$Header: src/compiler/hppa/debug.lisp $")
Compiler support for the new whizzy debugger .
Written by .
(in-package "HPPA")
(define-vop (debug-cur-sp)
... |
9de7f457c25574241582d053a1b00348d4caa46b3b0a730d21ce6a40acf762c9 | erdos/stencil | merger.clj | (ns stencil.merger
"Token listaban a text tokenekbol kiszedi a parancsokat es action tokenekbe teszi."
(:require [clojure.data.xml :as xml]
[clojure.string :refer [index-of ends-with?]]
[stencil.postprocess.ignored-tag :as ignored-tag]
[stencil
[types :refer [open-ta... | null | https://raw.githubusercontent.com/erdos/stencil/92a7dab98affd26ac7c32ab7c4ba5477f5ad1633/src/stencil/merger.clj | clojure | only fragment includes are evaluated
returns a map of {:char :stack :text-rest :rest}
If the current :text node ends with a prefix of open-tag: | (ns stencil.merger
"Token listaban a text tokenekbol kiszedi a parancsokat es action tokenekbe teszi."
(:require [clojure.data.xml :as xml]
[clojure.string :refer [index-of ends-with?]]
[stencil.postprocess.ignored-tag :as ignored-tag]
[stencil
[types :refer [open-ta... |
3b5a5e1c549a16587ab1425dec05029dd7c94ea57867ed846677aa5cfb930614 | thma/WhyHaskellMatters | Lists.hs | module Lists where
import Prelude hiding (map, foldr, length, filter, sum)
import qualified Prelude as P ( foldr )
import Functions (square, double)
--data [a] = [] | a : [a]
-- a list of numbers to play around with
someNumbers :: [Integer]
someNumbers = [49,64,97,54,19,90,934,22,215,6,68,325,720,8082,1,33,31]
us... | null | https://raw.githubusercontent.com/thma/WhyHaskellMatters/e6fe2973230d342ad222490984722baad3d93389/src/Lists.hs | haskell | data [a] = [] | a : [a]
a list of numbers to play around with
filtering lists
compute squares for all list elements
compute the double value for all list elements
We don't want to repeat ourselves so we want something that captures the essence of mapping a function over a list:
now we can use map to simply declar... | module Lists where
import Prelude hiding (map, foldr, length, filter, sum)
import qualified Prelude as P ( foldr )
import Functions (square, double)
someNumbers :: [Integer]
someNumbers = [49,64,97,54,19,90,934,22,215,6,68,325,720,8082,1,33,31]
use arithmetic sequences to generate a list of hundred Integers
upToH... |
76f98721da19ffee2f195da08289e585b54a9e0c203402e9132cc92f35ca21c6 | icicle-lang/icicle-ambiata | Context.hs | -- | Contexts that filter, group, and do stuff on the input
-- before they hit the expression.
# LANGUAGE DeriveGeneric #
# LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
{-# LANGUAGE OverloadedStrings #-}
module Icicle.Source.Query.Context (
Context' (..)
, Fold (..)
, FoldType (..)
, annotOfCon... | null | https://raw.githubusercontent.com/icicle-lang/icicle-ambiata/9b9cc45a75f66603007e4db7e5f3ba908cae2df2/icicle-source/src/Icicle/Source/Query/Context.hs | haskell | | Contexts that filter, group, and do stuff on the input
before they hit the expression.
# LANGUAGE OverloadedStrings # | # LANGUAGE DeriveGeneric #
# LANGUAGE LambdaCase #
# LANGUAGE NoImplicitPrelude #
module Icicle.Source.Query.Context (
Context' (..)
, Fold (..)
, FoldType (..)
, annotOfContext
) where
import GHC.Generics (Generic)
import Icicle.Source.Query.Exp
import Icicle.Internal... |
4bb75ce79f8534ae34376b3ae7ba44fb1128fcf49d7218d15dfe028348d829c4 | heroku/logplex | logplex_shard.erl | Copyright ( c ) 2010 < >
%%
%% Permission is hereby granted, free of charge, to any person
%% obtaining a copy of this software and associated documentation
files ( the " Software " ) , to deal in the Software without
%% restriction, including without limitation the rights to use,
%% copy, modify, merge, publish... | null | https://raw.githubusercontent.com/heroku/logplex/fc520c44cf4687726d5d51464d3264ddc6abb0ba/src/logplex_shard.erl | erlang |
Permission is hereby granted, free of charge, to any person
obtaining a copy of this software and associated documentation
restriction, including without limitation the rights to use,
copy, modify, merge, publish, distribute, sublicense, and/or sell
Software is furnished to do so, subject to the following
condit... | Copyright ( c ) 2010 < >
files ( the " Software " ) , to deal in the Software without
copies of the Software , and to permit persons to whom the
included in all copies or substantial portions of the Software .
THE SOFTWARE IS PROVIDED " AS IS " , WITHOUT WARRANTY OF ANY KIND ,
-module(logplex_shard).
-beha... |
ca7beb3491ce20c1852deb025ca92d04c3affac3548fba08f868a72d5cf8c3ad | min-nguyen/prob-fx | LW.hs | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
{-# LANGUAGE GADTs #-}
# LANGUAGE TypeOperators #
{- | Likelihood-Weighting inference.
-}
module Inference.LW (
lw
, runLW
, handleObs) where
import qualified Data.Map as Map
import Env ( Env )
import Effects.ObsReader ( ObsReader )
import Control.Monad ( ... | null | https://raw.githubusercontent.com/min-nguyen/prob-fx/0523d89bd22bbb0bb7e6e1350ef7a9691d22252c/src/Inference/LW.hs | haskell | # LANGUAGE GADTs #
| Likelihood-Weighting inference.
| Top-level wrapper for Likelihood-Weighting (LW) inference
^ model
^ model environment
^ [(output model environment, likelihood-weighting)]
^ model
^ model environment
^ ((model output, sample trace), likelihood-weighting)
| Handle each @Observe@ operation... | # LANGUAGE DataKinds #
# LANGUAGE FlexibleContexts #
# LANGUAGE TypeOperators #
module Inference.LW (
lw
, runLW
, handleObs) where
import qualified Data.Map as Map
import Env ( Env )
import Effects.ObsReader ( ObsReader )
import Control.Monad ( replicateM )
import Effects.Dist ( Dist, Observe(..), Sample )
... |
03a3877f5af5389a3bfc906d2da912a2997fd1c289267c897ff4e5567e5222d5 | leftaroundabout/dynamic-plot | Colour.hs | -- |
-- Module : Graphics.Dynamic.Plot.Colour
Copyright : ( c ) 2013
-- License : GPL v3
--
-- Maintainer : (@) jsag $ hvl.no
-- Stability : experimental
-- Portability : requires GHC>6 extensions
# LANGUAGE FlexibleInstances #
module Graphics.Dynamic.Plot.Colour ( module Graphics.Dynamic.Plot.Co... | null | https://raw.githubusercontent.com/leftaroundabout/dynamic-plot/f6e8d1259dc08a0a1382593f34e939b938dda475/dynamic-plot/Graphics/Dynamic/Plot/Colour.hs | haskell | |
Module : Graphics.Dynamic.Plot.Colour
License : GPL v3
Maintainer : (@) jsag $ hvl.no
Stability : experimental
Portability : requires GHC>6 extensions | Copyright : ( c ) 2013
# LANGUAGE FlexibleInstances #
module Graphics.Dynamic.Plot.Colour ( module Graphics.Dynamic.Plot.Colour
, Colour, AColour, FColour, PColour, ColourScheme
) where
import qualified Data.Colour as DCol
import Data.Co... |
766a09957d07e5b0ff77c85f3d785bc22c4592a59a4279df53b5f8095ab25d6c | aphyr/tesser | cardinality.clj | (ns tesser.cardinality
"Cardinality estimate digest using HyperLogLog+.
For examples, check tesser.math/digest."
(:import [com.clearspring.analytics.stream.cardinality
HyperLogLogPlus HyperLogLogPlus$Builder])
(:require [tesser.quantiles :as q]))
(defn hll
"Construct a new HLL cardinality estimat... | null | https://raw.githubusercontent.com/aphyr/tesser/d82895390264d8f6bf012fa4053a2003a500b574/math/src/tesser/cardinality.clj | clojure | old behaviour | (ns tesser.cardinality
"Cardinality estimate digest using HyperLogLog+.
For examples, check tesser.math/digest."
(:import [com.clearspring.analytics.stream.cardinality
HyperLogLogPlus HyperLogLogPlus$Builder])
(:require [tesser.quantiles :as q]))
(defn hll
"Construct a new HLL cardinality estimat... |
b609c79e6314502730d229f7fa39f012471538a5992a94986f656328749f7ad0 | rtoy/ansi-cl-tests | random-type-prop-tests-07.lsp | ;-*- Mode: Lisp -*-
Author :
Created : Sun Mar 13 17:03:52 2005
Contains : Random type prop tests , part 7 ( strings )
(in-package :cl-test)
(def-type-prop-test simple-string-p 'simple-string-p '(t) 1)
(def-type-prop-test char 'char (list 'string (index-type-for-dim 0)) 2)
(def-type-prop-test schar '... | null | https://raw.githubusercontent.com/rtoy/ansi-cl-tests/9708f3977220c46def29f43bb237e97d62033c1d/random-type-prop-tests-07.lsp | lisp | -*- Mode: Lisp -*- | Author :
Created : Sun Mar 13 17:03:52 2005
Contains : Random type prop tests , part 7 ( strings )
(in-package :cl-test)
(def-type-prop-test simple-string-p 'simple-string-p '(t) 1)
(def-type-prop-test char 'char (list 'string (index-type-for-dim 0)) 2)
(def-type-prop-test schar 'schar (list 'simple-stri... |
63911a0bb3a3dcd7d2933d7cb45414fda47a843d3f5f81cbf2bd1636b34f6da3 | tweag/asterius | return_mem_to_os.hs |
import Control.Concurrent
import System.IO
import System.Mem
main :: IO ()
main = do hSetBuffering stdout LineBuffering
mapM_ doIter [1..3]
doIter :: Int -> IO ()
doIter n = do putStrLn ("Iteration " ++ show n)
let xs = [n .. 1000000 + n]
putStrLn ("Last: " ++ show (last xs))
... | null | https://raw.githubusercontent.com/tweag/asterius/e7b823c87499656860f87b9b468eb0567add1de8/asterius/test/ghc-testsuite/rts/return_mem_to_os.hs | haskell |
import Control.Concurrent
import System.IO
import System.Mem
main :: IO ()
main = do hSetBuffering stdout LineBuffering
mapM_ doIter [1..3]
doIter :: Int -> IO ()
doIter n = do putStrLn ("Iteration " ++ show n)
let xs = [n .. 1000000 + n]
putStrLn ("Last: " ++ show (last xs))
... | |
32112c02fc4a75ac3e1d74e80e84a43940a0990b2b1f87b3b9177803626a592e | xavierchow/metabase-couchbase-driver | query_processor.clj | (ns metabase.driver.couchbase.query-processor
(:refer-clojure :exclude [==])
(:require [clojure.string :as cs]
[clojure.tools.logging :as log]
[cheshire.core :as json]
[metabase.util :as u]
[metabase.driver.couchbase.util :as cu]
[metabase.mbql.util :as mb... | null | https://raw.githubusercontent.com/xavierchow/metabase-couchbase-driver/9abb4f72890ea2403aa03136e73630b7aca14ab9/src/metabase/driver/couchbase/query_processor.clj | clojure | workaround for -couchbase-driver/issues/3
replace `.` with underscore and remove `[]`
(log/info (format "query-result %s" (:rows result))) | (ns metabase.driver.couchbase.query-processor
(:refer-clojure :exclude [==])
(:require [clojure.string :as cs]
[clojure.tools.logging :as log]
[cheshire.core :as json]
[metabase.util :as u]
[metabase.driver.couchbase.util :as cu]
[metabase.mbql.util :as mb... |
88795e889b067526d5c5b9ba435c58d0e64717cdb312d72ae0e8ec4d0c512eac | MastodonC/kixi.hecuba | profiles.clj | (ns kixi.hecuba.api.profiles
(:require
[clojure.core.match :refer (match)]
[cheshire.core :as json]
[clojure.tools.logging :as log]
[liberator.core :refer (defresource)]
[liberator.representation :refer (ring-response)]
[qbits.hayt :as hayt]
[clojure.java.io :as io]
[clojure.data.csv... | null | https://raw.githubusercontent.com/MastodonC/kixi.hecuba/467400bbe670e74420a2711f7d49e869ab2b3e21/src/clj/kixi/hecuba/api/profiles.clj | clojure |
INDEX
TODO It's not working as body is a seq and we can post to multiple entities
test file is in examples/csv-upload/profiles.csv
curl command used:
serving tall csv style profiles
| (ns kixi.hecuba.api.profiles
(:require
[clojure.core.match :refer (match)]
[cheshire.core :as json]
[clojure.tools.logging :as log]
[liberator.core :refer (defresource)]
[liberator.representation :refer (ring-response)]
[qbits.hayt :as hayt]
[clojure.java.io :as io]
[clojure.data.csv... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.