## dist_cpan-DONPDONP-BlkMeV.md
the bitcoin protocol in perl6, because why not.

##

run from source

```
$ git clone https://github.com/donpdonp/blkmev
Cloning into 'blkmev'...
remote: Counting objects: 451, done.
remote: Compressing objects: 100% (268/268), done.
remote: Total 451 (delta 240), reused 363 (delta 152), pack-reused 0
Receiving objects: 100% (451/451), 88.04 KiB | 117.00 KiB/s, done.
Resolving deltas: 100% (240/240), done.
Checking connectivity... done.
$ cd blkmev
$ zef install .
===> Testing: BlkMev
===> Testing [OK] for BlkMev
===> Installing: BlkMev

1 bin/ script [blkmev] installed to:
~/.rakudobrew/moar-2018.04.1/install/share/perl6/site/bin

```

##

`blkmev <bitcoin|bitcoincash|litecoin|dogecoin> [seed peer]`

```
$ ./bin/blkmev dogecoin
* pool new client dogecoin {:host("seed.multidoge.org")}. pool size 1
* connecting dogecoin seed.multidoge.org:22556
176.31.106.41 [dogecoin] -> VERSION 1100004 BlkMev:dogecoin block height 2150000 payload len 100
176.31.106.41 [dogecoin] command: VERSION (105 bytes)
176.31.106.41 [dogecoin] /Shibetoshi:1.10.0/ version #70004 height #2220526
176.31.106.41 [dogecoin] -> VERACK
176.31.106.41 [dogecoin] command: VERACK (0 bytes)
176.31.106.41 [dogecoin] command: PING (8 bytes)
176.31.106.41 [dogecoin] -> pong d012d0c672c01404
176.31.106.41 [dogecoin] command: GETHEADERS (1093 bytes)
176.31.106.41 [dogecoin] command: INV (37 bytes)
176.31.106.41 [dogecoin] TX 4b5f4c7b23d52ff2c7ca6a7aec7ee66923f3887d2a306b249921926ad00a3a9d mempool#1
176.31.106.41 [dogecoin] command: ADDR (30003 bytes)
176.31.106.41 [dogecoin] peers: [20:01:00:00:9d:38:6a:bd:08:5f:17:ed:23:12:a0:19] 22556 ... 1000 peer addresses

```

## roadmap

* build hashlock/timelock transactions and watch the mempool as the atomic swap process progresses.


## dist_zef-Scimon-Range-SetOps.md
[![Build Status](https://travis-ci.org/Scimon/p6-Range-SetOps.svg?branch=master)](https://travis-ci.org/Scimon/p6-Range-SetOps)

# NAME

Range::SetOps - Provides set operators geared to work on ranges.

# SYNOPSIS

```
use Range::SetOps;
say 10 (elem) (1.5 .. 15.2);

```

# DESCRIPTION

The standard Set operators work on Ranges by first converting them to lists and then applying the set operations to these lists. But Ranges can also represent a Range of possible values for which this type of comparison does not work well. The Range::SetOps module aims to provide operators based on the Set operators but geared to work on Ranges without list conversion.

# IMPLEMENTED OPERATORS

The following operators have been implemented for continous numerical ranges and also tested on string and date range. They also work on Sets of Ranges like those returned by the (|) or ∪ operators.

* (elem)
* ∈
* ∉
* (cont)
* ∋
* ∌

The following operators already work for continuous Ranges as expected.

* (<=)
* ⊆
* (>=)
* ⊇
* (<)
* ⊂
* (>)
* ⊃
* ⊅
* ⊄
* ⊉
* ⊈

The following Operations will return Sets comprising one or more Ranges. When the Ranges within the Set overlap they will be combined into one larger Range.

* (|)
* ∪
* (&)
* ∩

# AUTHOR

Simon Proctor [simon.proctor@gmail.com](mailto:simon.proctor@gmail.com)

# COPYRIGHT AND LICENSE

Copyright 2018 Simon Proctor

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-FRITH-Math-Libgsl-DigitalFiltering.md
[![Actions Status](https://github.com/frithnanth/raku-Math-Libgsl-DigitalFiltering/workflows/test/badge.svg)](https://github.com/frithnanth/raku-Math-Libgsl-DigitalFiltering/actions)

![Impulse filter](examples/04-impulse.svg)

# NAME

Math::Libgsl::DigitalFiltering - An interface to libgsl, the Gnu Scientific Library - Digital Filtering

# SYNOPSIS

```
use Math::Libgsl::Vector;
use Math::Libgsl::DigitalFiltering;

my constant $N = 1000;
my constant $K = 21;
my Math::Libgsl::Vector $x .= new: :size($N);
$x.scanf('data.dat');
my Math::Libgsl::DigitalFiltering::Gaussian $gauss .= new: :size($K);
my $y = $gauss.filter(2.5, $x);

```

# DESCRIPTION

Math::Libgsl::DigitalFiltering is an interface to the Digital Filtering functions of libgsl, the Gnu Scientific Library.

This module exports four classes:

* Math::Libgsl::DigitalFiltering::Gaussian
* Math::Libgsl::DigitalFiltering::Median
* Math::Libgsl::DigitalFiltering::RMedian
* Math::Libgsl::DigitalFiltering::Impulse

each encapsulates the methods and the buffers needed to create and use the filter on the data stored in a Math::Libgsl::Vector object.

## Math::Libgsl::DigitalFiltering::Gaussian

This class encapsulate a Gaussian filter.

### multi method new(Int $size!)

### multi method new(Int :$size!)

The constructor accepts one simple or named argument: the kernel size.

### filter(Num() $alpha!, Math::Libgsl::Vector $x!, Int :$order = 0, Int :$endtype = GSL\_MOVSTAT\_END\_PADZERO, Bool :$inplace? --> Math::Libgsl::Vector)

This method applies a Gaussian filter parameterized by **$alpha** to the input vector **$x**. The optional named argument **:$order** specifies the derivative order, with `0` corresponding to a Gaussian, `1` corresponding to a first derivative Gaussian, and so on. The optional named argument **:$endtype** specifies how the signal end points are handled. The symbolic names for this argument are listed in the Math::Libgsl::Constants module as follows:

* **GSL\_MOVSTAT\_END\_PADZERO**: inserts zeros into the window near the signal end points
* **GSL\_MOVSTAT\_END\_PADVALUE**: pads the window with the first and last sample in the input signal
* **GSL\_MOVSTAT\_END\_TRUNCATE**: no padding is performed: the windows are truncated as the end points are approached

The boolean named argument **:$inplace** directs the method to apply the filter in-place. This method returns the filter output as a **Math::Libgsl::Vector** object.

### kernel(Num() $alpha!, Int $size, Int :$order = 0, Int :$normalize = 0 --> Math::Libgsl::Vector)

This method constructs a Gaussian kernel parameterized by **$alpha**, of size **$size**. The optional named argument **:$order** specifies the derivative order. The optional named argument **:$normalize** specifies if the kernel is to be normalized to sum to one on output. This method returns the filter output as a **Math::Libgsl::Vector** object.

## Math::Libgsl::DigitalFiltering::Median

This class encapsulate a Median filter.

### multi method new(Int $size!)

### multi method new(Int :$size!)

The constructor accepts one simple or named argument: the kernel size.

### filter(Math::Libgsl::Vector $x!, Int :$endtype = GSL\_MOVSTAT\_END\_PADZERO, Bool :$inplace? --> Math::Libgsl::Vector)

This method applies a Median filter to the input vector **$x**. The optional named argument **:$endtype** specifies how the signal end points are handled. The optional boolean named argument **:$inplace** directs the method to apply the filter in-place. This method returns the filter output as a **Math::Libgsl::Vector** object.

## Math::Libgsl::DigitalFiltering::RMedian

This class encapsulate a recursive Median filter.

### multi method new(Int $size!)

### multi method new(Int :$size!)

The constructor accepts one simple or named argument: the kernel size.

### filter(Math::Libgsl::Vector $x!, Int :$endtype = GSL\_MOVSTAT\_END\_PADZERO, Bool :$inplace? --> Math::Libgsl::Vector)

This method applies a Median filter to the input vector **$x**. The optional named argument **:$endtype** specifies how the signal end points are handled. The optional boolean named argument **:$inplace** directs the method to apply the filter in-place. This method returns the filter output as a **Math::Libgsl::Vector** object.

## Math::Libgsl::DigitalFiltering::Impulse

This class encapsulate an Impulse detection filter.

### multi method new(Int $size!)

### multi method new(Int :$size!)

The constructor accepts one simple or named argument: the kernel size.

### filter(Math::Libgsl::Vector $x!, Num() $tuning, Int :$endtype = GSL\_MOVSTAT\_END\_PADZERO, Int :$scaletype = GSL\_FILTER\_SCALE\_MAD, Bool :$inplace? --> List)

This method applies an Impulse filter to the input vector **$x**, using the tuning parameter **$tuning**. The optional named argument **:$endtype** specifies how the signal end points are handled. The optional named argument **:$scaletype** specifies how the scale estimate Sₙ of the window is calculated. The symbolic names for this argument are listed in the Math::Libgsl::Constants module as follows:

* **GSL\_FILTER\_SCALE\_MAD**: specifies the median absolute deviation (MAD) scale estimate
* **GSL\_FILTER\_SCALE\_IQR**: specifies the interquartile range (IQR) scale estimate
* **GSL\_FILTER\_SCALE\_SN**: specifies the so-called Sₙ statistic
* **GSL\_FILTER\_SCALE\_QN**: specifies the so-called Qₙ statistic

The optional boolean named argument **:$inplace** directs the method to apply the filter in-place. This method returns a List of values:

* the window medians, as a **Math::Libgsl::Vector** object
* the window Sₙ, as a **Math::Libgsl::Vector** object
* the number of outliers as an Int
* the location of the outliers as a **Math::Libgsl::Vector::Int32** object

# C Library Documentation

For more details on libgsl see <https://www.gnu.org/software/gsl/>. The excellent C Library manual is available here <https://www.gnu.org/software/gsl/doc/html/index.html>, or here <https://www.gnu.org/software/gsl/doc/latex/gsl-ref.pdf> in PDF format.

# Prerequisites

This module requires the libgsl library to be installed. Please follow the instructions below based on your platform:

## Debian Linux and Ubuntu 20.04+

```
sudo apt install libgsl23 libgsl-dev libgslcblas0

```

That command will install libgslcblas0 as well, since it's used by the GSL.

## Ubuntu 18.04

libgsl23 and libgslcblas0 have a missing symbol on Ubuntu 18.04. I solved the issue installing the Debian Buster version of those three libraries:

* <http://http.us.debian.org/debian/pool/main/g/gsl/libgslcblas0_2.5+dfsg-6_amd64.deb>
* <http://http.us.debian.org/debian/pool/main/g/gsl/libgsl23_2.5+dfsg-6_amd64.deb>
* <http://http.us.debian.org/debian/pool/main/g/gsl/libgsl-dev_2.5+dfsg-6_amd64.deb>

# Installation

To install it using zef (a module management tool):

```
$ zef install Math::Libgsl::DigitalFiltering

```

# AUTHOR

Fernando Santagata [nando.santagata@gmail.com](mailto:nando.santagata@gmail.com)

# COPYRIGHT AND LICENSE

Copyright 2020 Fernando Santagata

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_github-gfldex-Rakudo-Slippy-Semilist.md
# Rakudo::Slippy::Semilist

[![Build Status](https://travis-ci.org/gfldex/perl6-rakudo-slippy-semilists.svg?branch=master)](https://travis-ci.org/gfldex/perl6-rakudo-slippy-semilists)

Implements `postcircumfix:<{|| }>` to allow coercion of Array to semilist.
Implements `postcircumfix:<{; }>:exists` and `postcircumfix:<{|| }>`.
see: <http://design.perl6.org/S09.html#line_419>

# Usage:

```
use Rakudo::Slippy::Semilist;

my @a = 1,2,3;
my %h;
%h{||@a} = 42;
dd %h;
# OUTPUT«Hash %h = {"1" => ${"2" => ${"3" => 1}}}␤»
dd %h{1;2;3}:exists;
# OUTPUT«Bool::True␤»

```


## dist_cpan-DMAESTRO-Module-Pod.md
# NAME

Module::Pod

# SYNOPSIS

```
use Module::Loader;
use Module::Pod;

my $l = Module::Loader.new(module => <Seq::Bounded>);
say describe-compunit($l.compunit);
say Module::Pod.new(:loader($l)).pod

use Module::Pod;

my $pod1 = pod-from-module(Module::Loader);

```

# ATTRIBUTES

* `loader` - An object of type Module::Loader, specifying the external module

# METHODS

### method pod

```
method pod() returns Mu

```

Return the $=pod from the module, precompiling if necessary

# EXPORTS

### sub pod-from-module

```
sub pod-from-module(
    $module where { ... }
) returns Mu

```

Get the $=pod from the named module

# LICENSE

This file is licensed under the same terms as perl itself.

# AUTHOR

Doug Schrag [dmaestro@cpan.org](mailto:dmaestro@cpan.org)


## dist_zef-antononcube-DSL-English-RecommenderWorkflows.md
# Recommenders Workflows

## In brief

This Raku (Perl 6) package has grammar classes and action classes for the parsing and
interpretation of natural Domain Specific Language (DSL) commands that specify recommendations workflows.

The interpreters (actions) target different programming languages: R, Mathematica, Python, Raku.
Also, different natural languages.

The generated pipelines are for the software monads
["SMRMon-R"](https://github.com/antononcube/R-packages/tree/master/SMRMon-R) and
["SMRMon-WL"](https://github.com/antononcube/MathematicaForPrediction/blob/master/MonadicProgramming/MonadicLatentSemanticAnalysis.m)
implemented in R and WL respectively, [AAp2, AAp3], and the object oriented Python and Raku implementations [AAp4, AAp5].

**Remark:** "SMR" stands for "Sparse Matrix Recommender". "SBR" stands for "Streams Blending Recommender".

**Remark:** "WL" stands for "Wolfram Language". "Mathematica" and "WL" are used as synonyms.

---

## Installation

Zef ecosystem:

```
zef install DSL::English::RecommenderWorkflows

```

GitHub:

```
zef install https://github.com/antononcube/Raku-DSL-English-RecommenderWorkflows.git

```

---

## Examples

### Programming languages

Here is a simple invocation:

```
use DSL::English::RecommenderWorkflows;

ToRecommenderWorkflowCode('recommend by profile action->10, drama->7', 'R::SMRMon');

```

```
# SMRMonRecommendByProfile( profile = c("action"=10, "drama"=7))

```

Here is a more complicated pipeline specification used to generate the code
for recommender systems implemented in different languages:

```
my $command = q:to/END/;
create from dfTitanic;
apply the LSI functions inverse document frequency, term frequency, and cosine;
recommend by profile female->3, 30->0.1;
extend recommendations with dfTitanic;
show pipeline value
END

say $_.key, "\n", $_.value, "\n"  for ($_ => ToRecommenderWorkflowCode($command, $_ ) for <R::SMRMon WL::SMRMon Python::SMRMon Raku>);

```

```
# R::SMRMon
# SMRMonCreate(data = dfTitanic) %>%
# SMRMonApplyTermWeightFunctions(globalWeightFunction = "IDF", localWeightFunction = "TermFrequency", normalizerFunction = "Cosine") %>%
# SMRMonRecommendByProfile( profile = c("female"=3, "30"=0.1)) %>%
# SMRMonJoinAcross( data = dfTitanic ) %>%
# SMRMonEchoValue()
#
# WL::SMRMon
# SMRMonUnit[] \[DoubleLongRightArrow] SMRMonCreate[dfTitanic] \[DoubleLongRightArrow]
# SMRMonApplyTermWeightFunctions["GlobalWeightFunction" -> "IDF", "LocalWeightFunction" -> "TermFrequency", "NormalizerFunction" -> "Cosine"] \[DoubleLongRightArrow]
# SMRMonRecommendByProfile[<|"female"->3, "30"->0.1|>] \[DoubleLongRightArrow]
# SMRMonJoinAcross[dfTitanic] \[DoubleLongRightArrow]
# SMRMonEchoValue[]
#
# Python::SMRMon
# obj = SparseMatrixRecommender().create_from_wide_form(data = dfTitanic).apply_term_weight_functions(global_weight_func = "IDF", local_weight_func = "TermFrequency", normalizer_func = "Cosine").recommend_by_profile( profile = {"female":3, "30":0.1}).join_across( data = dfTitanic ).echo_value()
#
# Raku
# my $sbrObj = ML::StreamsBlendingRecommender::CoreSBR.new;
# $sbrObj.makeTagInverseIndexesFromWideForm( dfTitanic);
# $sbrObj.applyTermWeightFunctions(globalWeightFunction => "IDF", localWeightFunction = "TermFrequency", normalizerFunction => "Cosine");
# $sbrObj.recommendByProfile( profile => %("female"=>3, "30"=>0.1));
# $sbrObj.joinAcross( dfTitanic );
# say $sbrObj.takeValue

```

### Natural languages

```
say $_.key, "\n", $_.value, "\n"  for ($_ => ToRecommenderWorkflowCode($command, $_ ) for <Bulgarian English Russian>);

```

```
# Bulgarian
# създай с таблицата: dfTitanic
# приложи тегловите функции: глобално-теглова функция: "IDF", локално-теглова функция: "TermFrequency", нормализираща функция: "Cosine"
# препоръчай с профила: {"female":3, "30":0.1}
# напречно съединение с таблицата: dfTitanic
# покажи лентовата стойност
#
# English
# create with data table: dfTitanic
# apply the term weight functions: global weight function: "IDF", local weight function: "TermFrequency", normalizing function: "Cosine"
# recommend with the profile: {"female":3, "30":0.1}
# join across with the data table: dfTitanic
# show the pipeline value
#
# Russian
# создать с таблицу: dfTitanic
# применять весовые функции: глобальная весовая функция: "IDF", локальная весовая функция: "TermFrequency", нормализующая функция: "Cosine"
# рекомендуй с профилю: {"female":3, "30":0.1}
# перекрестное соединение с таблицу: dfTitanic
# показать текущее значение конвейера

```

---

## CLI

The package provides a Command Line Interface (CLI) script. Here is its usage message:

```
ToRecommenderWorkflowCode --help

```

```
# Translates natural language commands into recommender workflow programming code.
# Usage:
#   ToRecommenderWorkflowCode <command> [--target=<Str>] [--language=<Str>] [--format=<Str>] [-c|--clipboard-command=<Str>] -- Translates natural language commands into (machine learning) recommender workflow programming code.
#   ToRecommenderWorkflowCode <target> <command> [--language=<Str>] [--format=<Str>] [-c|--clipboard-command=<Str>] -- Both target and command as arguments.
#   ToRecommenderWorkflowCode [<words> ...] [-t|--target=<Str>] [-l|--language=<Str>] [-f|--format=<Str>] [-c|--clipboard-command=<Str>] -- Command given as a sequence of words.
#
#     <command>                       A string with one or many commands (separated by ';').
#     --target=<Str>                  Target (programming language with optional library spec.) [default: 'WL::SMRMon']
#     --language=<Str>                The natural language to translate from. [default: 'English']
#     --format=<Str>                  The format of the output, one of 'automatic', 'code', 'hash', or 'raku'. [default: 'automatic']
#     -c|--clipboard-command=<Str>    Clipboard command to use. [default: 'Whatever']
#     <target>                        Programming language.
#     [<words> ...]                   Words of a data query.
#     -t|--target=<Str>               Target (programming language with optional library spec.) [default: 'WL::SMRMon']
#     -l|--language=<Str>             The natural language to translate from. [default: 'English']
#     -f|--format=<Str>               The format of the output, one of 'automatic', 'code', 'hash', or 'raku'. [default: 'automatic']
# Details:
#     If --clipboard-command is the empty string then no copying to the clipboard is done.
#     If --clipboard-command is 'Whatever' then:
#         1. It is attempted to use the environment variable CLIPBOARD_COPY_COMMAND.
#             If CLIPBOARD_COPY_COMMAND is defined and it is the empty string then no copying to the clipboard is done.
#         2. If the variable CLIPBOARD_COPY_COMMAND is not defined then:
#             - 'pbcopy' is used on macOS
#             - 'clip.exe' on Windows
#             - 'xclip -sel clip' on Linux.

```

---

## Versions

The original version of this Raku package was developed/hosted at
[ [AAp3](https://github.com/antononcube/ConversationalAgents/tree/master/Packages/Perl6/RecommenderWorkflows) ].

A dedicated GitHub repository was made in order to make the installation with Raku's `zef` more direct.
(As shown above.)

---

## References

[AAp1] Anton Antonov,
[Recommender Workflows Raku Package](https://github.com/antononcube/ConversationalAgents/tree/master/Packages/Perl6/RecommenderWorkflows),
(2019),
[ConversationalAgents at GitHub](https://github.com/antononcube/ConversationalAgents).

[AAp2] Anton Antonov,
[Sparse Matrix Recommender Monad in R](https://github.com/antononcube/R-packages/tree/master/SMRMon-R),
(2019),
[R-packages at GitHub](https://github.com/antononcube/R-packages).

[AAp3] Anton Antonov,
[Monadic Sparse Matrix Recommender Mathematica package](https://github.com/antononcube/MathematicaForPrediction/blob/master/MonadicProgramming/MonadicSparseMatrixRecommender.m),
(2018),
[MathematicaForPrediction at GitHub](https://github.com/antononcube/MathematicaForPrediction).

[AAp4] Anton Antonov,
[SparseMatrixRecommender Python package](https://github.com/antononcube/Python-packages/tree/main/SparseMatrixRecommender),
(2021),
[Python-packages at GitHub](https://github.com/antononcube/Python-packages).

[AAp5] Anton Antonov,
[ML::StreamsBlendingRecommender Raku package](https://github.com/antononcube/Raku-ML-StreamsBlendingRecommender)
(2021),
[GitHub/antononcube](https://github.com/antononcube).


## dist_zef-titsuki-Algorithm-Treap.md
[![Actions Status](https://github.com/titsuki/raku-Algorithm-Treap/actions/workflows/test.yml/badge.svg)](https://github.com/titsuki/raku-Algorithm-Treap/actions)

# NAME

Algorithm::Treap - randomized search tree

# SYNOPSIS

```
use Algorithm::Treap;

# store Int key
my $treap = Algorithm::Treap[Int].new;
$treap.insert(0, 0);
$treap.insert(1, 10);
$treap.insert(2, 20);
$treap.insert(3, 30);
$treap.insert(4, 40);
my $value = $treap.find-value(3); # 30
my $first-key = $treap.find-first-key(); # 0
my $last-key = $treap.find-last-key(); # 4

# delete
$treap.delete(4);

# store Str key
my $treap = Algorithm::Treap[Str].new;
$treap.insert('a', 0);
$treap.insert('b', 10);
$treap.insert('c', 20);
$treap.insert('d', 30);
$treap.insert('e', 40);
my $value = $treap.find-value('a'); # 0
my $first-key = $treap.find-first-key(); # 'a'
my $last-key = $treap.find-last-key(); # 'e'

# delete
$treap.delete('c');

```

# DESCRIPTION

Algorithm::Treap is a implementation of the Treap algorithm. Treap is the one of the self-balancing binary search tree. It employs a randomized strategy for maintaining balance.

## CONSTRUCTOR

### new

```
my $treap = Algorithm::Treap[::KeyT].new(%options);

```

Sets either one of the type objects(Int or Str) for `::KeyT` and some `%options`, where `::KeyT` is a type of insertion items to the treap.

#### OPTIONS

* `order-by => TOrder::ASC|TOrder::DESC`

Sets key order `TOrder::ASC` or `TOrder::DESC` in the treap. Default is `TOrder::ASC`.

## METHODS

### insert

```
$treap.insert($key, $value);

```

Inserts the key-value pair to the treap. If the treap already has the same key, it overwrites existing one.

### delete

```
$treap.delete($key);

```

Deletes the node associated with the key from the treap.

### find-value

```
my $value = $treap.find-value($key);

```

Returns the value associated with the key in the treap. When it doesn't hit any keys, it returns type object Any.

### find

```
my $node = $treap.find($key);

```

Returns the instance of the Algorithm::Treap::Node associated with the key in the treap. When it doesn't hit any keys, it returns type object Any.

### find-first-key

```
my $first-key = $treap.find-first-key();

```

Returns the first key in the treap.

### find-last-key

```
my $last-key = $treap.find-last-key();

```

Returns the last key in the treap.

# METHODS NOT YET IMPLEMENTED

join, split, finger-search, sort

# AUTHOR

titsuki [titsuki@cpan.org](mailto:titsuki@cpan.org)

# COPYRIGHT AND LICENSE

Copyright 2016 titsuki

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.

The algorithm is from Seidel, Raimund, and Cecilia R. Aragon. "Randomized search trees." Algorithmica 16.4-5 (1996): 464-497.


## dist_cpan-JFORGET-Date-Calendar-CopticEthiopic.md
# NAME

Date::Calendar::CopticEthiopic - conversions from / to the Coptic calendar and from / to the Ethiopic calendar

# SYNOPSIS

Converting a Gregorian date to both Coptic and Ethiopic

```
use Date::Calendar::Coptic;
use Date::Calendar::Ethiopic;

my Date                     $Perlcon-Riga-grg;
my Date::Calendar::Coptic   $Perlcon-Riga-cop;
my Date::Calendar::Ethiopic $Perlcon-Riga-eth;

$Perlcon-Riga-grg .= new(2019, 8, 7);
$Perlcon-Riga-cop .= new-from-date($Perlcon-Riga-grg);
$Perlcon-Riga-eth .= new-from-date($Perlcon-Riga-grg);

say $Perlcon-Riga-cop.strftime("%A %e %B %Y");
#--> Peftoou 1 Mesori 1735
say $Perlcon-Riga-eth.strftime("%A %e %B %Y");
#--> Rob 1 Nahas 2011

```

Converting a Coptic date and an Ethiopic date to Gregorian

```
use Date::Calendar::Coptic;
use Date::Calendar::Ethiopic;

my Date::Calendar::Coptic   $TPC-Pittsburgh-cop;
my Date::Calendar::Ethiopic $TPC-Pittsburgh-eth;
my Date                     $TPC-Pittsburgh-grg1;
my Date                     $TPC-Pittsburgh-grg2;

$TPC-Pittsburgh-cop .= new(year => 1735, month => 10, day => 9);
$TPC-Pittsburgh-grg1 = $TPC-Pittsburgh-cop.to-date;
#--> 9 Paoni 1735 = 16 June 2019

$TPC-Pittsburgh-eth .= new(year => 2011, month => 10, day => 14);
$TPC-Pittsburgh-grg2 = $TPC-Pittsburgh-eth.to-date;
#--> 14 Sane 2011 = 21 June 2019

```

# INSTALLATION

```
zef install Date::Calendar::CopticEthiopic

```

or

```
git clone https://github.com/jforget/raku-Date-Calendar-CopticEthiopic.git
cd Date-Calendar-CopticEthiopic
zef install .

```

# DESCRIPTION

Date::Calendar::CopticEthiopic is a module distribution providing two
classes, Date::Calendar::Coptic and Date::Calendar::Ethiopic. The
corresponding calendars both derive from the ancient Egyptian
calendar. In each, a year consists of 12 months with 30 days each,
plus 5 or 6 additional days (epagomene) at the end of the year. Leap
years occurs every fourth year, with no adjustment for century years.
The calendars also define weeks which last for 7 days, beginning on
sunday and ending on saturday.

# AUTHOR

Jean Forget [JFORGET@cpan.org](mailto:JFORGET@cpan.org)

# COPYRIGHT AND LICENSE

Copyright © 2019, 2020 Jean Forget

This library is free software; you can redistribute it and/or modify
it under the Artistic License 2.0.


## dist_cpan-TYIL-Matrix-Bot-Plugin-AutoAcceptInvites.md
# NAME

Matrix::Bot::Plugin::AutoAcceptInvites

# AUTHOR

Patrick Spek [p.spek@tyil.work](mailto:p.spek@tyil.work)

# VERSION

0.0.0

# Description

A plugin for Matrix::Bot to automatically accept all room invites

# Installation

Install this module through [zef](https://github.com/ugexe/zef):

```
zef install Matrix::Bot::Plugin::AutoAcceptInvites

```

# Usage

To use this plugin in your Matrix bot, include it in the `plugins` list.

```
use Matrix::Bot;
use Matrix::Bot::Plugin::AutoAcceptInvites;

Matrix::Bot.new(
    home-server => $*ENV<MATRIX_HOMESERVER> // "https://matrix.org",
    username => %*ENV<USER>,
    password => %*ENV<MATRIX_PASSWORD>,
    plugins => [
	    Matrix::Bot::Plugin::AutoAcceptInvites.new,
    ],
);

```

# License

This module is distributed under the terms of the AGPL-3.0.


## iterator.md
iterator

Combined from primary sources listed below.

# [In role Iterable](#___top "go to top of document")[§](#(role_Iterable)_method_iterator "direct link")

See primary documentation
[in context](/type/Iterable#method_iterator)
for **method iterator**.

```raku
method iterator(--> Iterator:D)
```

Method stub that ensures all classes doing the `Iterable` role have a method `iterator`.

It is supposed to return an [`Iterator`](/type/Iterator).

```raku
say (1..10).iterator;
```

# [In Seq](#___top "go to top of document")[§](#(Seq)_method_iterator "direct link")

See primary documentation
[in context](/type/Seq#method_iterator)
for **method iterator**.

```raku
method iterator(Seq:D:)
```

If the `Seq` is not cached, returns the underlying iterator and marks the invocant as consumed. If called on an already consumed sequence, throws an error of type [`X::Seq::Consumed`](/type/X/Seq/Consumed).

Otherwise returns an iterator over the cached list.

# [In Any](#___top "go to top of document")[§](#(Any)_method_iterator "direct link")

See primary documentation
[in context](/type/Any#method_iterator)
for **method iterator**.

```raku
multi method iterator(Any:)
```

Returns the object as an iterator after converting it to a list. This is the function called from the `for` statement.

```raku
.say for 3; # OUTPUT: «3␤»
```

Most subclasses redefine this method for optimization, so it's mostly types that do not actually iterate the ones that actually use this implementation.

# [In Mu](#___top "go to top of document")[§](#(Mu)_method_iterator "direct link")

See primary documentation
[in context](/type/Mu#method_iterator)
for **method iterator**.

```raku
method iterator(--> Iterator)
```

Coerces the invocant to a `list` by applying its [`.list`](/routine/list) method and uses [`iterator`](/type/Iterable#method_iterator) on it.

```raku
my $it = Mu.iterator;
say $it.pull-one; # OUTPUT: «(Mu)␤»
say $it.pull-one; # OUTPUT: «IterationEnd␤»
```

# [In role PositionalBindFailover](#___top "go to top of document")[§](#(role_PositionalBindFailover)_method_iterator "direct link")

See primary documentation
[in context](/type/PositionalBindFailover#method_iterator)
for **method iterator**.

```raku
method iterator(PositionalBindFailover:D:) { ... }
```

This method stub ensure that a class implementing role `PositionalBindFailover` provides an `iterator` method.

# [In HyperSeq](#___top "go to top of document")[§](#(HyperSeq)_method_iterator "direct link")

See primary documentation
[in context](/type/HyperSeq#method_iterator)
for **method iterator**.

```raku
method iterator(HyperSeq:D: --> Iterator:D)
```

Returns the underlying iterator.

# [In Junction](#___top "go to top of document")[§](#(Junction)_method_iterator "direct link")

See primary documentation
[in context](/type/Junction#method_iterator)
for **method iterator**.

```raku
multi method iterator(Junction:D:)
```

Returns an iterator over the `Junction` converted to a [`List`](/type/List).

# [In RaceSeq](#___top "go to top of document")[§](#(RaceSeq)_method_iterator "direct link")

See primary documentation
[in context](/type/RaceSeq#method_iterator)
for **method iterator**.

```raku
method iterator(RaceSeq:D: --> Iterator:D)
```

Returns the underlying iterator.


## dist_zef-CIAvash-Sway-Config.md
# NAME

Sway::Config - A [Raku](https://www.raku-lang.ir/en) library and script for parsing [Sway](https://swaywm.org/) window manager's config.

# DESCRIPTION

Sway::Config is a module and program for parsing [Sway](https://swaywm.org/) window manager's config, and getting the raw `Match`, configs, variables, modes and key bindings, either as Raku data structures or as JSON.

# INSTALLATION

You need to have [Raku](https://www.raku-lang.ir/en) and [zef](https://github.com/ugexe/zef), then run:

```
zef install --/test "Sway::Config:auth<zef:CIAvash>"

```

or if you have cloned the repo:

```
zef install .

```

# TESTING

```
prove -ve 'raku -I.' --ext rakutest

```

# CLI

## SYNOPSIS

```
sway-config - Parses Sway config and prints the specified section

By default gets the config from sway, unless config or config path is provided via stdin or command option.

Then parses the config and prints the requested output as JSON.

Usage:
  bin/sway-config -v|--version -- Prints version
  bin/sway-config all [-i|--stdin] [-c|--config-path=<Str>] -- Prints configs, variables, modes and key_bindings as JSON
  bin/sway-config configs [-i|--stdin] [-c|--config-path=<Str>] -- Prints configs as JSON
  bin/sway-config match [-i|--stdin] [-c|--config-path=<Str>] -- Prints raw match as JSON
  bin/sway-config variable [-i|--stdin] [-c|--config-path=<Str>] -- Prints variables as JSON
  bin/sway-config mode [-i|--stdin] [-c|--config-path=<Str>] -- Prints modes as JSON
  bin/sway-config key_binding [-i|--stdin] [-c|--config-path=<Str>] -- Prints key bindings as JSON (Object/Hash)
  bin/sway-config key_bindings [-i|--stdin] [-c|--config-path=<Str>] -- Prints key bindings as JSON (Array)

```

## COPYRIGHT

Copyright © 2021 Siavash Askari Nasr

## LICENSE

sway-config is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

sway-config is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.

You should have received a copy of the GNU General Public License along with sway-config. If not, see <http://www.gnu.org/licenses/>.

# LIBRARY

## SYNOPSIS

```
use Sway::Config:auth<zef:CIAvash>;

# By default Sway::Config gets the config from Sway
my $config = Sway::Config.new;

# Giving the config content to Sway::Config
my $config2 = Sway::Config.new: :config('Your Config Here');

# Giving path of a config file to Sway::Config
my $config3 = Sway::Config.new: :config_path<Path to config file>;

put $config.match;

put $config.mode<resize>;

put $config.configs: :json;

```

## ATTRIBUTES

### has Str $.config

Content of the config to parse

### has IO() $.config\_path

Path to the config file

## METHODS

### multi method match

```
multi method match() returns Match

```

Returns the raw match object

### multi method match

```
multi method match(
    Bool:D :json($)
) returns Str

```

Returns the raw `Match` object as JSON

### multi method configs

```
multi method configs() returns Array

```

Returns the parsed confis as an `Array`

### multi method configs

```
multi method configs(
    Bool:D :json($)
) returns Str

```

Returns the parsed confis as JSON

### multi method variable

```
multi method variable() returns Hash

```

Returns the parsed variables as a `Hash`

### multi method variable

```
multi method variable(
    Bool:D :json($)
) returns Str

```

Returns the parsed variables as JSON

### multi method mode

```
multi method mode() returns Hash

```

Returns the parsed modes as a `Hash`

### multi method mode

```
multi method mode(
    Bool:D :json($)
) returns Str

```

Returns the parsed modes as JSON

### multi method key\_binding

```
multi method key_binding() returns Hash

```

Returns the parsed key bindings as a `Hash`

### multi method key\_binding

```
multi method key_binding(
    Bool:D :json($)
) returns Str

```

Returns the parsed key bindings as JSON (Object/Hash)

### multi method key\_bindings

```
multi method key_bindings() returns List

```

Returns the parsed key bindings as a `List`

### multi method key\_bindings

```
multi method key_bindings(
    Bool:D :json($)
) returns Str

```

Returns the parsed key bindings as JSON (Array)

### multi method all

```
multi method all() returns Hash

```

Returns the parsed configs, variables, modes and key bindings as a `Hash`

### multi method all

```
multi method all(
    Bool:D :json($)
) returns Str

```

Returns the parsed configs, variables, modes and key bindings as JSON

## COPYRIGHT

Copyright © 2021 Siavash Askari Nasr

## LICENSE

Sway::Config is free software: you can redistribute it and/or modify it under the terms of the GNU Lesser General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version.

Sway::Config is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.

You should have received a copy of the GNU Lesser General Public License along with Sway::Config. If not, see <http://www.gnu.org/licenses/>.

# REPOSITORY

<https://codeberg.org/CIAvash/Sway-Config/>

# BUG

<https://codeberg.org/CIAvash/Sway-Config/issues>

# AUTHOR

Siavash Askari Nasr - <https://siavash.askari-nasr.com>


## nativecast.md
nativecast

Combined from primary sources listed below.

# [In Native calling interface](#___top "go to top of document")[§](#(Native_calling_interface)_sub_nativecast "direct link")

See primary documentation
[in context](/language/nativecall#sub_nativecast)
for **sub nativecast**.

```raku
sub nativecast($target-type, $source) is export(:DEFAULT)
```

This will *cast* the `Pointer` `$source` to an object of `$target-type`. The source pointer will typically have been obtained from a call to a native subroutine that returns a pointer or as a member of a `struct`, this may be specified as `void *` in the `C` library definition for instance, but you may also cast from a pointer to a less specific type to a more specific one.

As a special case, if a [`Signature`](/type/Signature) is supplied as `$target-type` then a `subroutine` will be returned which will call the native function pointed to by `$source` in the same way as a subroutine declared with the `native` trait. This is described in [Function Pointers](/language/nativecall#Function_pointers).


## dist_zef-raku-community-modules-Locale-US.md
[![Actions Status](https://github.com/raku-community-modules/Locale-US/actions/workflows/test.yml/badge.svg)](https://github.com/raku-community-modules/Locale-US/actions)

# NAME

Locale::US - Two letter codes for identifying United States territories and vice versa

# SYNOPSIS

```
use Locale::US;

say state-to-code("California");  # CA
say code-to-state("CA");  # CALIFORNIA

.say for all-state-names;  # ALABAMA, ALASKA...
.say for all-state-codes;  # AK, AL, ...

```

# DESCRIPTION

A Raku module for mapping two character state abbreviations for United States territories to their state name and vice versa. This module was very much inspired by the Perl module of the same name.

# EXPORTED SUBROUTINES

## state-to-code

Map a state name to a two-letter code.

## code-to-state

Map a two-letter code to a state name (all uppercase).

## all-state-names

Returns a `List` of all state names in alphabetical order.

## all-state-codes

Returns a `List` of all state codes in alphabetical order.

# AUTHOR

Jonathan Scott Duff

# COPYRIGHT AND LICENSE

Copyright 2012 - 2017 Jonathan Scott Duff

Copyright 2018 - 2022 Raku Community

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## statement-prefixes.md
Statement prefixes

Prefixes that alter the behavior of a statement or a set of them

Statement prefixes are written in front of a statement, and change their meaning, their output, or the moment they are going to be run. Since they have a specific behavior, they are also sometimes specific to some statement or group of statements.

## [`lazy`](#Statement_prefixes "go to top of document")[§](#lazy "direct link")

As a statement prefix, `lazy` acts in front of any statement, including `for` loops, saving the execution for when the variable they are assigned to is actually needed.

```raku
my $incremented = 0;
my $var = lazy for <1 2 3 4> -> $d {
    $incremented++
};
say $incremented; # OUTPUT: «0␤»
say eager $var;   # OUTPUT: «(0 1 2 3)␤»
say $incremented; # OUTPUT: «4␤»

```

The `$incremented` variable is only incremented, that is, the internal part of the loop is only run when we eagerly evaluate the variable `$var` that contains the lazy loop. Eagerness can be applied on a variable in other ways, such as calling the `.eager` method on it.

```raku
my @array = lazy { (^3).map( *² )  };
say @array;       # OUTPUT: «[...]␤»
say @array.eager; # OUTPUT: «[0 1 4]␤»

```

This prefix can also be used [in front of `gather`](/language/control#gather/take) to make the inner statements behave lazily; in general, any set of statements that returns a value will be made lazy using this.

## [`eager`](#Statement_prefixes "go to top of document")[§](#eager "direct link")

The `eager` statement prefix will eagerly return the result of the statements behind, throwing away laziness and returning the result.

```raku
my $result := eager gather { for 1..3 { say "Hey"; take $_² } };
say $result[0]; # OUTPUT: «Hey␤Hey␤Hey␤1␤»

```

`gather` is [implicitly lazy when bound to a scalar](/syntax/gather%20take). However, with `eager` as a statement prefix it will run all three iterations in the loop, as shown by the printed "Hey", even if we are just requesting the first one in a row.

## [`hyper`](#Statement_prefixes "go to top of document")[§](#hyper,_race "direct link")

A `for` loop will automatically serialize any [`HyperSeq`](/type/HyperSeq) or [`RaceSeq`](/type/RaceSeq) used in it; on the other hand `hyper` and `race` use (maybe simultaneous) threads to run different iterations in a loop:

```raku
my @a = hyper for ^100_000 { .is-prime }

```

This code is around 3x faster than the bare `for`. But there are a couple of caveats here:

* The operation inside the loop should take enough time for threading to make sense.
* There should be no read or write access to the same data structure inside the loop. Let the loop produce a result, and assign it.
* If there's an I/O operation inside the loop, there might be some contention so please avoid it.

Main difference between `hyper` and `race` is the ordering of results. Use `hyper` if you need the loop results to be produced in order, `race` if you don't care.

## [`quietly`](#Statement_prefixes "go to top of document")[§](#quietly "direct link")

As a prefix, `quietly` suppresses all runtime warnings produced by the block or statement it precedes.

```raku
sub marine() {};
quietly say ~&marine; # OUTPUT: «marine␤»
sub told-you { warn 'hey...' };
quietly { told-you; warn 'kaput!' };
warn 'Telling you now!';  # OUTPUT: «Telling you now!␤ [...] ␤»

```

Calling [`.Str` on `code` produces a warning](/type/Code#method_Str). Preceding the code with `quietly` will just produce the output without warning.

## [`try`](#Statement_prefixes "go to top of document")[§](#try "direct link")

If you use `try` in front of a statement, it will contain the exception produced in it and store it in the `$!` variable, just like when [it's used in front of a block](/language/exceptions#try_blocks).

```raku
try [].pop;
say $!; # OUTPUT: «Cannot pop from an empty Array␤..»

```

## [`do`](#Statement_prefixes "go to top of document")[§](#do "direct link")

`do` can be used as a statement prefix to disambiguate the statement they precede; this is needed, for instance, if you want to assign the result of a `for` statement. A bare `for` will fail, but this will work:

```raku
my $counter = 0;
my $result = do for ^5 { $counter++ };
say $counter; # OUTPUT: «5␤»
say $result;  # OUTPUT: «(0 1 2 3 4)␤»

```

`do` is equivalent, as in other cases, to surrounding a statement with a parenthesis. It can be used as an alternative with a (possibly more) straightforward syntax.

## [`sink`](#Statement_prefixes "go to top of document")[§](#sink "direct link")

As in the [case of the routine](/routine/sink), `sink` will run the statement, throwing away the result. Use it in case you want to run some statement for the side effects it produces.

```raku
my $counter = 0;
my $result = sink for ^5 { $counter++ };
say $counter; #  OUTPUT: «5␤»
say $result;  #  OUTPUT: «(Any)␤»

```

The `sink` statement prefix will also convert [`Failure`](/type/Failure)s into exceptions:

```raku
sub find-the-number ( Int $n where $n < 10 ) {
    if $n == 7 {
        return True;
    } else {
        fail "Not that number" ;
    }
}
for 1..^10 {
    try {
        sink find-the-number($_);
    };
    say "Found $_" unless $!;
}

```

In this case, we will know that the number has been found only when the `try` block is not catching an exception.

## [`react`](#Statement_prefixes "go to top of document")[§](#react "direct link")

`react` can be used in concurrent programs to create blocks of code that run whenever some event occurs. It [works with blocks](/syntax/react), and also as a statement prefix.

```raku
my Channel $KXGA .= new;
for ^100 {
    $KXGA.send( (100000..200000).pick );
}

my @sums = ( start react whenever $KXGA -> $number {
    say "In thread ", $*THREAD.id;
    say "→ ", (^$number).sum;
} ) for ^10;

start { sleep 10; $KXGA.close(); }

await @sums;

```

In this case `react` prefixes `whenever`, which makes a long sum with every number read from a channel.


## dist_zef-neula-IO-Maildir.md
# NAME

`IO::Maildir` provides functions for safely dealing with maildir directories.

# SYNOPSIS

```
use IO::Maildir;
my $inbox = maildir "~/mail/INBOX";
$inbox.create;
my $msg = $inbox.receive($somemail);

```

# DESCRIPTION

`IO::Maildir` tries to implement the [maildir](https://cr.yp.to/proto/maildir.html) spec. It can serve as a basis for mail delivery agents or mail user agents (or a mixture of both). The named `agent` parameter can be used to set the behaviour for some methods. Default behaviour can be changed by setting `$maildir-agent`.

### sub maildir

```
sub maildir($path --> IO::Maildir)

```

Returns a maildir object from `$path`. `$path` will be coerced to IO.

### maildir-agent

```
our Agent $maildir-agent = IO::Maildir::DELIVERY

```

Set this to either `IO::Maildir::DELIVERY` or `IO::Maildir::USER`. Affects behaviour of following methods:

* `IO::Maildir::File`: `flag`, `move`
* `IO::Maildir`: `walk`

## class IO::Maildir

Class for maildir directories.

```
my $maildir = IO::Maildir.new "~/Mail/INBOX";
my $maildir = maildir "~/Mail/INBOX" # Same

```

### method create

```
method create( --> IO::Maildir) { ... }

```

Creates a new maildir directory including its cur, new and tmp subdirectories.

### method receive

```
multi method receive($mail --> IO::Maildir::File) { ... }

```

Adds a new file to the maildir. `receive` will always deliver to new and write the file to tmp first if neccessary. `$mail` may be of any type which is accepted by `IO::Path.spurt`, which are any `Cool` or `Blob` types.

Up to version 0.0.2 receiving an IO object would delete the original file. This behaviour was fixed and the original file now remains after receiving.

### method walk

```
method walk(:$all, :$agent = $maildir-agent --> Seq) { ... }

```

Returns the new mails in the maildir (or all if you set it). Newest mails will be returned first.

If called with `$agent = IO::Maildir::USER` it will also do the following actions:

* 1. Look inside tmp and delete files older than 36 hours.
* 1. Move files from new to cur **after** the returned Seq is consumed.

## class IO::Maildir::Files

Handle for files inside a maildir.

```
#Create from IO::Path
my $file = IO::Maildir::File.new( path => "~/Mail/INBOX/cur/uniquefilename:2,".IO );
#Create from maildir
my $file = IO::Maildir::File.new( dir => $maildir, name => "uniquefilename:2," );

```

Usually you don't need to do anything of the above, since you will receive your `IO::Maildir::File` objects from `IO::Maildir`s methods.

### attribute dir

```
has IO::Maildir $.dir

```

Points to the maildir containing this file.

### attribute name

```
has $.name

```

Complete file name including flags and stuff.

### method IO

```
method IO( --> IO ) { ... }

```

Returns the `IO::Path` object pointing to the file.

### method flags

```
method flags( --> Set ) { ... }

```

Returns the `Set` of flags set for this file.

### method flag

```
multi method flag(:$agent = $maildir-agent, *%flags)
multi method flag(
    %flags where *.keys.Set ⊆ <P R S T D>.Set,
    :$agent = $maildir-agent)

```

Use this to set flags. Fails if `$agent` is set to `IO::Maildir::DELIVERY`. This will also move the file to cur, because it has been seen by the MUA.

### method move

```
multi method move(IO::Maildir $maildir, Agent :$agent = $maildir-agent --> IO::Maildir::File) { ... }
multi method move (IO $iodir, Agent :$agent = $maildir-agent --> IO::Maildir::File) { ... }

```

Moves the file to a different maildir and returns the updated file-handle. If called in `IO::Maildir::DELIVERY` mode, the file will be moved to new and old flags will be removed. If called in `IO::Maildir::USER` mode, it will be moved to cur and flags will be preserved.

# AUTHOR

neula [thomas@famsim.de](mailto:thomas@famsim.de)

Source can be located at: <https://github.com/neula/IO-Maildir> . Comments and Pull Requests are welcome.

# LICENSE

This library is free software; you may redistribute or modify it under the Artistic License 2.0.


## dist_zef-masukomi-Terminal-Graphing-BarChart.md
# Terminal::Graphing::BarChart

Terminal::Graphing::BarChart is a simple library to let you produce bar graphs on the command line.
It takes special care to give you good looking output.

![example graph](../readme_images/images/social_media_preview.png)

Currently limited to vertical bar charts. See the end of this document for future plans & contribution guidelines.

# SYNOPSIS

## Common Usage Example

```
# VERTICAL BAR CHART
use Terminal::Graphing::BarChart::Vertical;

my $x_and_y_axis_graph = Terminal::Graphing::BarChart::Vertical.new(
    data => [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
    bar_length => 10,
    x_axis_labels => <a b c d e f g h i j k>,
    y_axis_labels => <0 1 2 3 4 5 6 7 8 9>
);

# to get the string version of the graph
$x_and_y_axis_graph.generate();

# to print the graph to Standard Out
$x_and_y_axis_graph.print();

```

Note that for a *vertical* graph the 0 x 0 point of this graph is the bottom left corner.
Data and labels start from there and move outwards. BUT for a *horizontal* graph the 0 x 0 point is the top left corner.

```

my $horizontal_graph = Terminal::Graphing::BarChart::Horizontal.new(
    data => [0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100],
    bar_length => 20,
    x_axis_labels => <a b c d e f g h i j>,
    y_axis_labels => <alpha bravo charlie delta echo foxtrot golf hotel india juliet kilo>
);
# to get the string version of the graph
$horizontal_graph.generate();

# to print the graph to Standard Out
$horizontal_graph.print();

```

There are 3 notable restrictions in the horizontal graph

1. x axis labels can't be longer than 1 character
2. `bar_length` must be evenly divisible by the number of x axis labels.
3. the x axis labels will be spread evenly across `bar_length` characters of width.

Folks using Arabic & other Right-to-Left are encouraged to make a PR
to support reversed graphs.

## Required Attributes

When creating a graph there are two required keys. `bar_length` and `data`.

`bar_length` is how tall or wide you wish the core graph's bars to be (in characters).
This does not include the additional lines for labels or the lines separating them
from the graph.

`data` is an array of numbers. Each is expected to be a percentage from 0 to 100.
100 create a vertical bar `bar_length` lines tall. 0 will create an empty bar.

Note, there *will* be rounding issues if your `bar_length` is anything other than
an even multiple of 100. This is ok.

Just to set expectations, if for example, you specify a `bar_length`
of 10 that means there are only 10 vertical/horizontal elements to each bar. If
one of your data points is 7 you'll end up with an empty bar because that's
less than the number needed to activate the 1st element (10).

## Optional Attributes

`x_axis_labels` This is an array of labels for the x axis.
In the vertical bar chart it must be equal in length
to the number of data points. If you want some of your bars to be unlabeled
then specify a space for that "label". In the horizontal bar chart it must be
a number that's `bar_length` can be evenly divided by. In the horizontal bar
chart they must also be no longer than 1 character.

For the horizontal graph I recommend just making it the same number of elements
as the `bar_length`. That way you can precisely specify where each label appears.

`y_axis_labels` This is an array of labels for the y axis.
In the vertical bar graph it must be equal in length
to the `bar_length` (one label per row). Again, if you want some of
the points to be unlabeled, you should use a space character. In the horizontal graph it can be less.

Note that the 0 x 0 point of the vertical graph is the bottom left. So its list
of `y_axis_labels` will go from bottom up. This corresponds to how the
`data` and `x_axis_labels` go from left to right. In the horizontal bar graph it's top left
so data moves from that column out.

In the Vertical bar graph you can specify `space_between_columns` This is a
`Bool` which defaults to `True`. If you set it to `False` the system will *not*
introduce a space between each column. This works fine, and may be a good
choice if you have a large number of data points, but for short graphs it's
almost always worse looking.

### Advice

From a purely visual perspective it is not recommended that you use
full words for your `x_axis_labels`. In order to not introduce a false sense
of time compression or similar meaning, every bar gets spread out by the
length of the longest label.

`y_axis_labels` should be fine regardless of length. They are right-aligned, and
just shove the graph farther to the right.

I would not recommend generating a vertical graph that's more than 10 characters high.
I would recommend making a horizontal graph that's >=20 characters wide. Otherwise they
look too squished.

See `vertical-graph-tester.raku` and `horizontal-graph-tester.raku` for examples.

## Legend

This library does not support generating a legend for your graph.
My advice is to use single letter `x_axis_labels` and then use
[Prettier::Table](https://github.com/masukomi/Prettier-Table/)
to generate a legend that explains your x axis.

# Future + Contributing

## Contributing

Please do. All I ask is that you include unit tests that cover whatever changes or additions you make, and that you're fine with your contributions being distributed under the AGPL.

What kind of contributions? New Features, refactored code, more tests, etc.

For best results, please ping me on mastodon (see below) to make sure I see your PR right away.

# AUTHOR

web: [masukomi](https://masukomi.org)
mastodon: [@masukomi@connectified.com](https://connectified.com/@masukomi)

# COPYRIGHT AND LICENSE

Copyright 2023 Kay Rhodes (a.k.a. masukomi)

This library is free software; you can redistribute it and/or modify it under the AGPL 3.0 or later. See LICENSE.md for details.


## dist_zef-raku-community-modules-Text-T9.md
[![Actions Status](https://github.com/raku-community-modules/Text-T9/actions/workflows/linux.yml/badge.svg)](https://github.com/raku-community-modules/Text-T9/actions) [![Actions Status](https://github.com/raku-community-modules/Text-T9/actions/workflows/macos.yml/badge.svg)](https://github.com/raku-community-modules/Text-T9/actions) [![Actions Status](https://github.com/raku-community-modules/Text-T9/actions/workflows/windows.yml/badge.svg)](https://github.com/raku-community-modules/Text-T9/actions)

# NAME

Text::T9 - Guess words based on a T9 key sequence

# SYNOPSIS

```
use Text::T9;

my @words = <this is a simple kiss test lips here how>;
.say for t9(5477, @words);  # kiss lips

my %additional-keys = ź => 9, ń => 6;
@words.push: 'jaźń';
.say for t9(5296, @words, %additional-keys);  # jaźń

```

# DESCRIPTION

The `Text::T9` distribution exports a single subroutine `t9` that looks up matching words from a given list of words using the [T9 predictive text](https://en.wikipedia.org/wiki/T9_(predictive_text)) algorithm known from older mobile phones (pre-smart phone).

# AUTHOR

Tadeusz Sośnierz

Source can be located at: <https://github.com/raku-community-modules/Text::T9> . Comments and Pull Requests are welcome.

# COPYRIGHT AND LICENSE

Copyright 2012 - 2017 Tadeusz Sośnierz

Copyright 2025 Raku Community

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_cpan-MELEZHIK-Sparky-Plugin-Hello.md
# SYNOPSIS

Sparky Hello Plugin

# INSTALL

```
$ zef install Sparky::Plugin::Hello

```

# USAGE

```
$ cat sparky.yaml

plugins:
 - Sparky::Plugin::Hello:
    parameters:
      name: "Sparrow"

```

# Author

Alexey Melezhik


## later.md
later

Combined from primary sources listed below.

# [In role Dateish](#___top "go to top of document")[§](#(role_Dateish)_method_later "direct link")

See primary documentation
[in context](/type/Dateish#method_later)
for **method later**.

```raku
multi method later(DateTime:D: *%unit)
```

Returns an object based on the current one (belonging to any class that mixes this role in), but with a time delta applied. The time delta can be passed as a named argument where the argument name is the unit.

Unless the given unit is `second` or `seconds`, the given value will be converted to an [`Int`](/type/Int).

Allowed units are `second`, `seconds`, `minute`, `minutes`, `hour`, `hours`, `day`, `days`, `week`, `weeks`, `month`, `months`, `year`, `years`. Please note that the plural forms can only be used with the `later` and `earlier` methods.

The `:2nd` form of colonpairs can be used as a compact and self-documenting way of specifying the delta:

```raku
say DateTime.new('2015-12-24T12:23:00Z').later(:2years);
# OUTPUT: «2017-12-24T12:23:00Z␤»
```

Since addition of several different time units is not commutative, only one unit may be passed (and the first multi will be used).

```raku
my $d = DateTime.new(date => Date.new('2015-02-27'));
say $d.later(month => 1).later(:2days);  # OUTPUT: «2015-03-29T00:00:00Z␤»
say $d.later(days => 2).later(:1month);  # OUTPUT: «2015-04-01T00:00:00Z␤»
say $d.later(days => 2).later(:month);   # same, as +True === 1
```

You can also (since release 2021.02 of the Rakudo compiler) pass several units at the same time, but you will have to join them in a [`List`](/type/List) to activate the second form:

```raku
say DateTime.new(date => Date.new('2015-02-27')).later( (:1month, :2days) )
# OUTPUT: «2015-03-29T00:00:00Z␤»

```

If the resultant time has value `60` for seconds, yet no leap second actually exists for that time, seconds will be set to `59`:

```raku
say DateTime.new('2008-12-31T23:59:60Z').later: :1day;
# OUTPUT: «2009-01-01T23:59:59Z␤»
```

Negative offsets are allowed, though [earlier](/routine/earlier) is more idiomatic for that.

Objects of type [`Date`](/type/Date) will behave in the same way:

```raku
my $d = Date.new('2015-02-27');
say $d.later(month => 1).later(:2days);  # OUTPUT: «2015-03-29␤»
say $d.later(days => 2).later(:1month);  # OUTPUT: «2015-04-01␤»
say $d.later(days => 2).later(:month);   # same, as +True === 1

```


## dist_zef-Kaiepi-Acme-BaseCJK.md
![Build Status](https://github.com/Kaiepi/ra-Acme-BaseCJK/actions/workflows/test.yml/badge.svg)

# NAME

Acme::BaseCJK - More digits for more better

# SYNOPSIS

```
use Acme::BaseCJK;

put my $x = CJK:of(0x1541DBAD); # OUTPUT: 崁㼄
put CJK:to($x).base(16);        # OUTPUT: 1541DBAD

```

# DESCRIPTION

While clear about each bit's value, binary makes for a rather sparse encoding of integers compared to decimal. Hexadecimal is more compact, making it a little easier to read at a glance. `Acme::BaseCJK` takes this a step further by encoding integers with Unicode 13.0.0's CJK Unified Ideographs block, along with extensions A-G, making for a base 92 844 encoding.

# AUTHOR

Ben Davies (Kaiepi)

# COPYRIGHT AND LICENSE

Copyright 2022 Ben Davies

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_zef-wbiker-IO-Prompt.md
IO::Prompt -- Interactive validating terminal prompt

# HTML

[![](https://travis-ci.org/wbiker/io-prompt.svg?branch=master)](https://travis-ci.org/wbiker/io-prompt)

# SYNOPSIS

```
use v6;
use IO::Prompt;

my $a = ask( "Defaults to 42, type Num?", 42, :type(Num) );
say $a.perl;
say '------------------------------';

$a = ask( "Defaults to false?", Bool::False );
say $a.perl;
say '------------------------------';

$a = ask( "No default but type Bool?", :type(Bool) );
say $a.perl;
say '------------------------------';

## OO style ##
my $prompt = IO::Prompt.new();

$a = $prompt.ask( "Dot notation?", Bool::False );
say $a.perl;
say '------------------------------';

## You can override the IO methods for testing purposes
class IO::Prompt::Testable is IO::Prompt {
    method !do_say( Str $question ) returns Bool {
        say "Testable saying    '$question'";
        say 'Please do not continue questioning';
        return Bool::False; # do not continue
    }
    method !do_prompt( Str $question ) returns Str {
        say "Testable saying    '$question'";
        say "Testable answering 'daa'";
        return 'daa';
    }
}

my $prompt_test = IO::Prompt::Testable.new();
$a = $prompt_test.ask_yn( "Testable, defaults to false?", Bool::False );
say $a.perl;
say '------------------------------';

## You can override the language class attributes
class IO::Prompt::Finnish is IO::Prompt {
    our $.lang_prompt_Yn        = 'K/e';
    our $.lang_prompt_yN        = 'k/E';
    our $.lang_prompt_yn        = 'k/e';
    our $.lang_prompt_yn_retry  = 'Sano kyllä tai ei';
    our $.lang_prompt_match_y   = m/ ^^ <[kK]> /;
    our $.lang_prompt_match_n   = m/ ^^ <[eE]> /;
    our $.lang_prompt_int       = 'Int';
    our $.lang_prompt_int_retry = 'Anna kokonaisluku';
    our $.lang_prompt_num       = 'Num';
    our $.lang_prompt_num_retry = 'Anna luku';
    our $.lang_prompt_str       = 'Str';
    our $.lang_prompt_str_retry = 'Anna merkkijono';
}

my $prompt_fi = IO::Prompt::Finnish.new();
$a = $prompt_fi.ask( "Suomeksi Bool?", :type(Bool) );
say $a.perl;
say '------------------------------';
$a = $prompt_fi.ask( "Suomeksi Num?", :type(Num) );
say $a.perl;
say '------------------------------';
$a = $prompt_fi.ask( "Suomeksi Str?", :type(Str) );
say $a.perl;
say '------------------------------';

```

# DESCRIPTION

This is a generic module for interactive prompting from the console.

The build-in function prompt is great, but sometimes it is convenient to have default values and/or the control over the return type.

IO::Prompt provides both.

Original written bei pnu.

## FUNCTIONAL METHODS

IO::Prompt provides method ask to set the question string, a default answer and/or a return type.

Examples:

```
use IO::Prompt;

my $answer = ask("What do you want for Christmas?", "Perl6");
$answer = Whatever the user entered or if just Enter was pressed the string Perl6

```

## OO

IO::Prompt provides also a OO interface.

Example:

```
use IO::Prompt;

my $asker = IO::Prompt.new;
my $answer = $asker.ask("Wanna some money?", 2e9, :type(Num));

```

# COPYRIGHT

Written by pnu, maintained by wbiker


## dist_zef-coke-App-Unicode-Mangle.md
# Overview

Silly script to let you take unicode input and transform it.
Some samples:

```
$ uni-mangler --circle '#rakulang'
#ⓡⓐⓚⓤⓛⓐⓝⓖ

$ uni-mangler --invert 'Hello, github!'
¡quɥʇıƃ ,oʃʃǝH

$ uni-mangler --bold 'A bird, a plane.'
𝐀 𝐛𝐢𝐫𝐝, 𝐚 𝐩𝐥𝐚𝐧𝐞.

$ uni-mangler --paren 'lisplike'
⒧⒤⒮⒫⒧⒤⒦⒠

$ uni-mangler --combo 'combo breaker'
c̩͘o̍ͧmͮ͠b̄͋o̸̫ ̣͚b͠ͅř̗ẻ͔aͪ͢k̥̀e̒͋r͎̦

$ uni-mangler --italic 'The Telltale Heart'
𝘛𝘩𝘦 𝘛𝘦𝘭𝘭𝘵𝘢𝘭𝘦 𝘏𝘦𝘢𝘳𝘵

$ uni-mangler --square 'Presenting'
🄿 🅁 🄴 🅂 🄴 🄽 🅃 🄸 🄽 🄶

$ uni-mangler --nsquare 'A little boxy'
🅰   🅻 🅸 🆃 🆃 🅻 🅴   🅱 🅾 ❎ 🆈

$ uni-mangler --random 'Happy Birthday!'
Ⓗ⒜ⓟ𝐩𝐲 𐐒⒤𝐫⒯⒣pɐ⒴¡

```

## Combining Characters

Where possible, preserve input combining marks:

```
$ uni-mangler --outline rákü
𝕣𝕒́𝕜𝕦̈

```

## Related Modules

For a more focused approach on the Mathematical Alphanumeric Symbols unicode block, try:
<https://modules.raku.org/dist/Text::MathematicalCase:cpan:ELIZABETH/>


## dist_zef-japhb-MUGS-UI-WebSimple.md
[![Actions Status](https://github.com/Raku-MUGS/MUGS-UI-WebSimple/workflows/test/badge.svg)](https://github.com/Raku-MUGS/MUGS-UI-WebSimple/actions)

# NAME

MUGS-UI-WebSimple - WebSimple UI for MUGS, including HTTP gateway and game UIs

# SYNOPSIS

```
# Set up a full-stack MUGS-UI-WebSimple development environment
mkdir MUGS
cd MUGS
git clone git@github.com:Raku-MUGS/MUGS-Core.git
git clone git@github.com:Raku-MUGS/MUGS-Games.git
git clone git@github.com:Raku-MUGS/MUGS-UI-WebSimple.git

cd MUGS-Core
zef install --exclude="pq:ver<5>:from<native>" .
mugs-admin create-universe

cd ../MUGS-Games
zef install .

cd ../MUGS-UI-WebSimple
zef install --deps-only .  # Or skip --deps-only if you prefer

### GAME SERVER (handles actual gameplay; used by the web UI gateway)

# Start a TLS WebSocket game server on localhost:10000 using fake certs
mugs-ws-server

# Specify a different MUGS identity universe (defaults to "default")
mugs-ws-server --universe=other-universe

# Start a TLS WebSocket game server on different host:port
mugs-ws-server --host=<hostname> --port=<portnumber>

# Start a TLS WebSocket game server using custom certs
mugs-ws-server --private-key-file=<path> --certificate-file=<path>

# Write a Log::Timeline JSON log for the WebSocket server
LOG_TIMELINE_JSON_LINES=log/mugs-ws-server mugs-ws-server

### WEB UI GATEWAY (frontend for a MUGS backend game server)

# Start a web UI gateway on localhost:20000 to play games in a web browser
mugs-web-simple --server-host=<websocket-host> --server-port=<websocket-port>
mugs-web-simple --server=<websocket-host>:<websocket-port>

# Start a web UI gateway on a different host:port
mugs-web-simple --host=<hostname> --port=<portnumber>

# Use a different CA to authenticate the WebSocket server's certificates
mugs-web-simple --server-ca-file=<path>

# Use custom certs for the web UI gateway itself
mugs-web-simple --private-key-file=<path> --certificate-file=<path>

# Turn off TLS to the web browser (serving only unencrypted HTTP)
mugs-web-simple --/secure

```

# DESCRIPTION

**NOTE: See the [top-level MUGS repo](https://github.com/Raku-MUGS/MUGS) for more info.**

MUGS::UI::WebSimple is a Cro-based web gateway for MUGS, including templates and UI plugins to play games from [MUGS-Core](https://github.com/Raku-MUGS/MUGS-Core) and [MUGS-Games](https://github.com/Raku-MUGS/MUGS-Games) via a web browser. The WebSimple UI focuses on low-bandwidth, resource-friendly HTML.

This Proof-of-Concept release only contains very simple turn-based games, plus a simple front door for creating identities and choosing games to play. Future releases will include many more games and genres, plus better handling of asynchronous events such as inter-player messaging.

# GOTCHAS

In this early release, there are a couple rough edges (aside from the very simple UI and trivial game selection):

* Templates only work in checkout dir; must run mugs-web-simple from checkout root
* Each mugs-web-simple instance can only serve *either* HTTP or HTTPS (not both at once)
* Session cookies do not have a SameSite setting; some browsers will complain if not using HTTPS

# ROADMAP

MUGS is still in its infancy, at the beginning of a long and hopefully very enjoyable journey. There is a [draft roadmap for the first few major releases](https://github.com/Raku-MUGS/MUGS/tree/main/docs/todo/release-roadmap.md) but I don't plan to do it all myself -- I'm looking for contributions of all sorts to help make it a reality.

# CONTRIBUTING

Please do! :-)

In all seriousness, check out [the CONTRIBUTING doc](docs/CONTRIBUTING.md) (identical in each repo) for details on how to contribute, as well as [the Coding Standards doc](https://github.com/Raku-MUGS/MUGS/tree/main/docs/design/coding-standards.md) for guidelines/standards/rules that apply to code contributions in particular.

The MUGS project has a matching GitHub org, [Raku-MUGS](https://github.com/Raku-MUGS), where you will find all related repositories and issue trackers, as well as formal meta-discussion.

More informal discussion can be found on IRC in Libera.Chat #mugs.

# AUTHOR

Geoffrey Broadwell [gjb@sonic.net](mailto:gjb@sonic.net) (japhb on GitHub and Libera.Chat)

# COPYRIGHT AND LICENSE

Copyright 2021-2024 Geoffrey Broadwell

MUGS is free software; you can redistribute it and/or modify it under the Artistic License 2.0.


## dist_github-cygx-Image-RGBA.md
# Image::RGBA [Build Status](https://travis-ci.org/cygx/p6-image-rgba)

Create and manipulate 32-bit RGBA images

# Synopsis

```
use Image::RGBA;

my $img = Image::RGBA.create(10, 20);
my $pixel = $img.pixel(2, 5);
$pixel.g = 0xA0;
say $pixel;

```

```
use Image::RGBA::Text;
use Image::PGN::Inflated;

my $img = Image::RGBA::Text.load('examples/camelia.txt'.IO);
spurt 'camelia.png', to-png($img);

for Image::RGBA::Text.slurp('examples/feep.txt'.IO) {
    spurt "{.meta<name>}.png", .&to-png;
}

```

```
use Image::RGBA::Fun;
use Image::PGN::Inflated;

my $img = load-rgba-from-textfile('examples/camelia.txt');
spurt 'camelia.png', to-png($img);

my %palette = x => 'fbf', o => 'a33';
say create-rgba-from-text(q:to/THE_END/, 2, 2, :%palette).pixel(0, 1);
    x o
    o x
    THE_END

```

# Description

This module allows the manipulation of raw RGBA images on a per-pixel basis
and the creation of such images from a simple text format.

The pixel data is held in a flat byte buffer, with each 4-byte sequence
describing the red, green, blue and alpha channel.

The text representation of a pixel is given by a sequence of non-whitespace
characters (a 'word'), separated by whitespace to form the image data.

Before decoding, each word gets filtered through a 'palette', a hash mapping
arbitrary words to hexadecimal color values in one of the 6 supported formats.

Images may be embedded in structured text files, with each line potentially
holding a parsing directive starting in `=`, or pixel data.

## The Base Module Image::RGBA

Wraps binary pixel data.

```
class Image::RGBA {
    has buf8 $.bytes;
    has uint $.width is required;
    has uint $.height is required;
    has %.meta;

    method create($width, $height, $bytes?) { ... }
    method pixel($x, $y) { ... }
}

my class Pixel {
    # numerical manipulation
    method r is rw { ... }
    method g is rw { ... }
    method b is rw { ... }
    method a is rw { ... }
    method value($order = BigEndian) is rw { ... }

    # stringification
    method Str { ... }  # rgba(?,?,?,?)
    method hex { ... }  # hexadecimal, excluding alpha channel
    method hexa { ... } # hexadecimal, including alpha channel
}

```

## Parsing Text with Image::RGBA::Text

Methods `load` and `slurp` for text parsing are exposed via the type object.

```
class Image::RGBA::Text {
    # loads a single image
    method load($src, :%palettes = {}) { ... }

    # returns a sequence of all images
    method slurp($src, :%palettes = {}) { ... }
}

```

The `$src` argument must provide a `lines` method. Examples of valid sources
are strings, file handles and path objects. A hash of named palette hashes may
be passed in, allowing communication betweeen sources.

The module contains two decoder classes that implement parsing of color values
and colorization of the image.

```
class Image::RGBA::Text::Decoder {
    has Image::RGBA $.image is required;
    has Associative $.palette = {};

    method create($width, $height, %palette?) { ... }

    # colorize a single pixel, moving the cursor forward
    method paint($color) { ... }

    # use each word of the text to colorize a subsequent pixel
    method decode($text) { ... }

    # check if the image has been fully colorized
    method done { ... }
}

class Image::RGBA::Text::ScalingDecoder is Image::RGBA::Text::Decoder {
    has uint $.scale is required;
    method create($width, $height, $scale, %palette?) { ... }
}

```

The latter class allows automatic scaling of the image by an integer factor.

## Functional API provided by Image::RGBA::Fun

```
# Create individual images from raw data
sub create-rgba($width, $height, $bytes?) { ... }
sub create-rgba-from-text($text, $width, $height, $scale = 1, :%palette) { ... }

# Load individual image, parsing directives
sub load-rgba-from-text($text, :%palettes) { ... }
sub load-rgba-from-textfile($file, :%palettes) { ... }

# Load all images, parsing directives
sub slurp-rgba-from-text($text, :%palettes) { ... }
sub slurp-rgba-from-textfile($file, :%palettes) is export { ... }

```

If a file argument is not of type `IO::Handle`, it is assumed to be a file
path and converted via a call to `.IO`.

# The Textual Format

Yet to be properly documented. When in doubt, check the [`examples`](https://github.com/cygx/p6-image-rgba/tree/master/examples)
directory for working code.

## Supported Directives

```
=img <width> <height> <scale>?

=palette <name>

=map <alias> <color>

=use <palette>

=meta <key> <value>

```

Following an `=img` directive, until the image has been fully colorized,
each line that does not start in `=` is assumed to hold pixel data.

A `=palette` directive may occur between `=img` directives, but must not
occur until any given image is complete.

## Supported Color Formats

There are six different ways to specify colors. They are distinguished by the
number of characters in the given string.

### A single hexadecimal digit

Numbers 0 through 7 are black and dark colors, all opaque. Number 8 is a
transparent black pixel. Numbers 9 through F are bright colors followed
by white.

| Digit | RGB value | Alpha value | Name |
| --- | --- | --- | --- |
| 0 | #000000 | 100% | black |
| 1 | #800000 | 100% | dark red (maroon) |
| 2 | #008000 | 100% | dark green |
| 3 | #808000 | 100% | dark yellow (olive) |
| 4 | #000080 | 100% | dark blue (navy) |
| 5 | #800080 | 100% | dark magenta (purple) |
| 6 | #008080 | 100% | dark cyan (teal) |
| 7 | #808080 | 100% | dark gray |
| 8 | #000000 | 0% | transparent black |
| 9 | #FF0000 | 100% | red |
| A | #00FF00 | 100% | green (lime) |
| B | #FFFF00 | 100% | yellow |
| C | #0000FF | 100% | blue |
| D | #FF00FF | 100% | magenta (fuchsia) |
| E | #00FFFF | 100% | cyan (aqua) |
| F | #FFFFFF | 100% | white |

### Double hexadecimal digits

Double hexadecimal digits, i.e. 00 through FF, will result in a greyscale of
opaque pixels. 00 is black, FF is white, the values in between just have the
given hexadecimal number for the R, G, B channels and FF for the alpha channel.

### Three hexadecimal digits

Three hexadecimal digits will result in opaque pixels where the individual
hexadecimal digits are doubled and stored as the R, G, and B value
respectively. For example, the value `47e` would result in the RGB color
value `#4477ee` at fixed alpha value FF.

### Four hexadecimal digits

This works the same way as three hexadecimal digits, but the alpha channel
takes its value from the fourth digit rather than being fixed at FF.

### Six hexadecimal digits

Six hexadecimal digits work exactly like you would expect from HTML, CSS,
or graphics software in general: The first two digits are for the red
channel, the next two for the green channel, and the last two for the blue
channel. The alpha channel is always FF.

### Eight hexadecimal digits

This works the same way as six hexadecimal digits, but the last two digits
are used for the alpha channel.

# Bugs and Development

Development happens at [GitHub](https://github.com/cygx/p6-image-rgba). If you found a bug or have a feature
request, use the [issue tracker](https://github.com/cygx/p6-image-rgba/issues) over there.

# Copyright and License

Copyright (C) 2019 by cygx <[cygx@cpan.org](mailto:cygx@cpan.org)>

Distributed under the [Boost Software License, Version 1.0](https://www.boost.org/LICENSE_1_0.txt)


## dist_zef-raku-community-modules-File-Find.md
[![Actions Status](https://github.com/raku-community-modules/File-Find/actions/workflows/linux.yml/badge.svg)](https://github.com/raku-community-modules/File-Find/actions) [![Actions Status](https://github.com/raku-community-modules/File-Find/actions/workflows/macos.yml/badge.svg)](https://github.com/raku-community-modules/File-Find/actions) [![Actions Status](https://github.com/raku-community-modules/File-Find/actions/workflows/windows-spec.yml/badge.svg)](https://github.com/raku-community-modules/File-Find/actions)

# NAME

File::Find - Get a lazy sequence of a directory tree

# SYNOPSIS

```
use File::Find;

my @list = lazy find(dir => 'foo');  # Keep laziness
say @list[0..3];

my $list = find(dir => 'foo');       # Keep laziness
say $list[0..3];

my @list = find(dir => 'foo');       # Drop laziness
say @list[0..3];

```

# DESCRIPTION

`File::Find` allows you to get the contents of the given directory, recursively, depth first. The only exported function, `find()`, generates a `Seq` of files in given directory. Every element of the `Seq` is an `IO::Path` object, described below. `find()` takes one (or more) named arguments. The `dir` argument is mandatory, and sets the directory `find()` will traverse. There are also few optional arguments. If more than one is passed, all of them must match for a file to be returned.

## name

Specify a name of the file `File::Find` is ought to look for. If you pass a string here, `find()` will return only the files with the given name. When passing a regex, only the files with path matching the pattern will be returned. Any other type of argument passed here will just be smartmatched against the path (which is exactly what happens to regexes passed, by the way).

## type

Given a type, `find()` will only return files being the given type. The available types are `file`, `dir` or `symlink`.

## exclude

Exclude is meant to be used for skipping certain big and uninteresting directories, like '.git'. Neither them nor any of their contents will be returned, saving a significant amount of time.

The value of `exclude` will be smartmatched against each IO object found by File::Find. It's recommended that it's passed as an IO object (or a Junction of those) so we avoid silly things like slashes vs backslashes on different platforms.

## keep-going

Parameter `keep-going` tells `find()` to not stop finding files on errors such as 'Access is denied', but rather ignore the errors and keep going.

## recursive

By default, `find` will recursively traverse a directory tree, descending into any subdirectories it finds. This behaviour can be changed by setting `recursive` to a false value. In this case, only the first level entries will be processed.

# Perl's File::Find

Please note, that this module is not trying to be the verbatim port of Perl's File::Find module. Its interface is closer to Perl's File::Find::Rule, and its features are planned to be similar one day.

# CAVEATS

List assignment is eager by default in Raku, so if you assign a `find()` result to an array, the laziness will be dropped by default. To keep the laziness either insert `lazy` or assign to a scalar value (see SYNOPSIS).


## dist_cpan-HOLLI-Test-Color.md
[![Build Status](https://travis-ci.org/holli-holzer/perl6-Test-Color.svg?branch=master)](https://travis-ci.org/holli-holzer/perl6-Test-Color)

# NAME

Test::Color - Colored Test - output

# SYNOPSIS

```
use Test;
use Test::Color;
use Test::Color sub { :ok("blue on_green"), :nok("255,0,0 on_255,255,255") };

```

# DESCRIPTION

Test::Color uses [Terminal::ANSIColor](https://github.com/tadzik/Terminal-ANSIColor) to color your test output. Simply add the `use Color` statement to your test script.

## Setup

If you don't like the default colors, you can configure them by passing an anonymous sub to the use statement.

The sub must return a hash; keys representing the output category (one of ), and the values being color commands as in [Terminal::ANSIColor](https://github.com/tadzik/Terminal-ANSIColor).

You can tweak the behaviour even further by setting output handles of the `Test` module directly.

```
Test::output()         = Test::Color.new( :handle($SOME-HANDLE) );
Test::failure_output() = Test::Color.new( :handle($SOME-HANDLE) );
Test::todo_output()    = Test::Color.new( :handle($SOME-HANDLE) );

```

## Caveat

This module works using escape sequences. This means that test suite runners will most likely trip over it. The module is mainly meant for the development phase, by helping to spot problematic tests in longish test outputs.

# AUTHOR

```
Markus 'Holli' Holzer

```

# COPYRIGHT AND LICENSE

Copyright © [holli.holzer@gmail.com](mailto:holli.holzer@gmail.com)

License GPLv3: The GNU General Public License, Version 3, 29 June 2007 <https://www.gnu.org/licenses/gpl-3.0.txt>

This is free software: you are free to change and redistribute it. There is NO WARRANTY, to the extent permitted by law.


## dist_zef-bradclawsie-Hash-Consistent.md
[![](https://img.shields.io/badge/License-BSD-yellow.svg)](https://opensource.org/licenses/BSD-2-Clause)
[![ci](https://github.com/bradclawsie/Hash-Consistent/workflows/test/badge.svg)](https://github.com/bradclawsie/Hash-Consistent/actions)

# Hash::Consistent

A Raku implementation of a Consistent Hash.

## DESCRIPTION

A "consistent" hash allows the user to create a data structure in which a set of string
flags are entered in the hash at intervals specified by the CRC32 hash of the flag.
Optionally, each flag can have suffixes appended to it in order to create multiple
entries in the hash.

Once flags are entered into the hash, we can find which flag would be associated with
a candidate string of our choice. A typical use-case for this is to enter host
names into the hash the represent destination hosts where values are stored
for particular keys, as determined by the result of searching for the corresponding
flag in the hash.

This technique is best explained in these links:

<http://en.wikipedia.org/wiki/Consistent_hashing>

<http://www.tomkleinpeter.com/2008/03/17/programmers-toolbox-part-3-consistent-hashing/>

## SYNOPSIS

```
use v6;
use Hash::Consistent;
use String::CRC32;
use Test;

my $ch = Hash::Consistent.new(mult=>2);
$ch.insert('example.org');
$ch.insert('example.com');
is $ch.sum_list.elems(), 4, 'correct hash cardinality';
# > $ch.print();
# 0: 2725249910 [crc32 of example.org.0 derived from example.org]
# 1: 3210990709 [crc32 of example.com.1 derived from example.com]
# 2: 3362055395 [crc32 of example.com.0 derived from example.com]
# 3: 3581359072 [crc32 of example.org.1 derived from example.org]

# > String::CRC32::crc32('blah');
# 3458818396
# (should find next at 3581359072 -> example.org)
is $ch.find('blah'), 'example.org', 'found blah -> example.org';

# > String::CRC32::crc32('whee');
# 3023755156
# (should find next at 3210990709 -> example.com)
is $ch.find('whee'), 'example.com', 'found whee -> example.com';

```

## AUTHOR

Brad Clawsie (zef:bradclawsie, email:brad@b7j0c.org)

## Notice

This repository was uploaded via `fez` under the username `b7j0c`,
and later `bradclawsie`. This change was made so the username would match
Github. Sorry for any confusion.

## Installation

```
zef install Hash::Consistent

```


## dist_github-niner-Grammar-Highlighter.md
# TITLE

Grammar::Highlighter

# SYNOPSIS

```
    use Grammar::Highlighter;
    use Whatever::Grammar::You::Like;

    my $highlighter = Grammar::Highlighter.new;
    my $parser = Whatever::Grammar::You::Like.new;
    say $parser.parse($string, :actions($highlighter)).ast.Str;

```

# DESCRIPTION

Get automatic syntax highlighting for any grammar you provide.

Grammar::Highlighter is a generic syntax highlighter. You use it as an actions
object for a grammar's parse method. It will assign a different color to all
the grammar's tokens, rules and regexes. The generated parse tree stringifies
to the original string with colors applied.

# AUTHOR

Stefan Seifert [nine@detonation.org](mailto:nine@detonation.org)


## dist_github-antifessional-Net-ZMQ.md
# Net::ZMQ

## SYNOPSIS

Net::ZMQ is a Perl6 binding library for ZeroMQ

## Introduction

#### Version 0.1.2

#### Status

This is in development. The only certainty is that the tests pass on my machine.

#### Alternatives

There is an an earlier project on github: <https://github.com/arnsholt/Net-ZMQ>
I started this one primarily to learn both Perl6 and ZMQ. The older project
may be more stable and suitable to your needs. If you do boldly go and use this
one, please share bugs and fixes!

#### ZMQ Versions

Current development is with ZeroMQ 4.2.

#### Portability

Development is on linux/x64. Due to some pointer voodoo, it is possible the code
will break on other architectures/OSes. This should not be too hard to fix, but
it depends on other people trying it on other platforms.

## Example Code

```
use v6;
use Net::ZMQ::V4::Constants;
use Net::ZMQ::Context;
use Net::ZMQ::Socket;
use Net::ZMQ::Message;

my Context $ctx .= new :throw-everything;
my Socket $s1 .= new($ctx, :pair, :throw-everything);
my Socket $s2 .= new($ctx, :pair, :throw-everything);

my $endpoint = 'inproc://con';
$s1.bind($endpoint);
$s2.connect($endpoint);

my $counter = 0;
my $callme = sub ($d, $h) { say 'sending ++$counter'};

MsgBuilder.new\
      .add('a short envelope' )\
      .add( :newline )\
      .add( :empty )\
      .add('a very long story', :max-part-size(255), :newline )\
      .add('another long chunk à la française', :divide-into(3), :newline )\
      .add( :empty )\
      .finalize\
      .send($s1, :callback( $callme ));

my $message = $s2.receive( :slurp );
say $message;

$s1.unbind.close;
$s2.disconnect.close;

```

## Documentation

#### Net::ZMQ::V4::Constants

holds all the constants from zmq.h v4. They are grouped with tags.
The tags not loaded by default are

* :EVENT
* :DEPRECATED
* :DRAFT Experimental, not in stable version
* :RADIO
* :IOPLEX multiplexing
* :SECURITY

#### Net::ZMQ::V4::LowLevel

holds NativeCall bindings for all the functions in zmq.h
most calls are machine generated and the only check is that they compile.
constant ZMQ\_LOW\_LEVEL\_FUNCTIONS\_TESTED holds a list of the calls used and tested
in the module so far. loading Net::ZMQ::V4::Version prints it

#### Net::ZMQ::V4::Version

use in order to chack version compatibility. It exports

* verion()
* version-major()

#### Net::ZMQ::Context, ::Socket, ::Message, ::Poll

These are the main classes providing a higher-level Perl6 OO interface to ZMQ

##### Context

```
         .new( :throw-everything(True))      # set to True to throw non fatal errors
         .terminate() 			                 # manually release all resources (gc would do that)
         .shutdown()			                   # close all sockets
         .get-option(name)                   # get Context option
         .set-option(name, value)	           # set Context option

          options can also be accessed through methods with the name of the option
          with/without get- and set- prefixes.
             e.g get: .get-io-threads()  .io-threads()
             set: .set-io-threads(2) .io-threads(2)
          Net::ZMQ::ContextOptions holds the dispatch table

```

##### Socket

```
Attributes
  context   - the zmq-context; must be supplied to new()
  type      - the ZMQ Socket Type constant: One of
    :pair :publisher :subscriber :client :server :dealer :router :pull :push :xpub :xsub :stream
    must be supplied to new()
  last-error - the last zmq error reported
  throw-everything  - when true, all non-fatal errors except EAGAIN (async) throw
  async-fail-throw  - when true, EAGAIN (async) throws; when false EAGAIN returns Any
  max-send-bytes    - largest single part send in bytes
  max-recv-number   - longest charcter string representing an integer number
                      in a single, integer message part
  max-recv-bytes    - bytes threshhold for truncating receive methods

Methods
Methods that do not return a useful value return self on success and Any on failure.
Send methods return the number of bytes sent or Any.

Socket Wrapper Methods
    close()
    bind( endpoint --> self )         ;endpoint must be a string with a valid zmq endpoint
    unbind( endpoint = last-endpoint  --> self )
    connect( endpoint  --> self )
    disconnect( endpoint = last-endpoint --> self )

Send Methods
      -part sends with SNDMORE flag (incomplete)
      -split causes input to be split and sent in message parts
      -async duh!
      all methods return the number of bytes sent or Any
    send( Str , :async, :part, :enc --> Int)
    send( Int, :async, :part -->Int )
    send( buf8, :async, :part, :max-send-bytes -->Int )
    send(Str, Int split-at :split! :async, :part. :enc  -->Int )
    send(buf8, Int split-at :split! :async, :part -->Int )
    send(buf8, Array splits, :part, :async, :callback, :max-send-bytes -->Int )
    send(:empty!, :async, :part -->Int )

Receive Methods
      -bin causes return type to be a byte buffer (buf8) instead of a string
      -int retrieves a single integer message
      -slurp causes all waiting parts of a message to be aseembled and returned as single object
      -truncate truncates at a maximum byte length
      -async duh!
    receive(:truncate!, :async, :bin, :enc )
    receive(:int!, :async, :max-recv-number --> Int)
    receive(:slurp!, :async, :bin, :enc)
    receive(:async, :bin, :enc)

Options Methods
    there are option getters and setter for every socket option
    the list of options is in SocketOptions.pm
    every option name creates four legal invocations
      -setters
        option-name(new-value)
        set-option:$name(new-value)
      -getters
        option-name()
        get-option-name()
        e.g.
        * .get-identity()  .identity()
        * .set-identity(id) .identity(id)
    options can also be accessed explicitly with the ZMQ option Constant.
        valid Type Objects are Str, buf8 and Int
        get-option(Int opt-contant, Type-Object return-type, Int size )

Misc Methods
    doc(-->Str) ;this

```

The Message classes is an OO interface to the zero-copy mechanism.
It uses a builder to build an immutable message that can be sent (and re-sent)
zero-copied. See example above for useage.

##### MsgBuilder

builds a Message object that can be used to send complex messages.
uses zero-copy internally.

```
  USAGE example

      my MsgBuilder $builder  .= new;
      my Message $msg =
        $builder.add($envelope)\
                .add(:empty)\
                .add($content-1, :max-part-size(1024) :newline)\
                .add($content-2, :max-part-size(1024) :newline)\
                .finalize;

      $msg.send($socket);

Methods
    new()
    add( Str, :max-part-size :divide-into, :newline, :enc --> self)
    add( :empty --> self)
    add( :newline --> self)
    finalize( --> Message)

```

##### Message

Immutable message

```
Methods
    send(Socket, :part, :async, Callable:($,$ --> Int:D) :callback  --> Int)
    send-all(@sockets, :part, :async, Callable:($,$ --> Int:D) :callback  --> Int)
    bytes( --> Int)
    segments( --> Int)
    copy(:enc --> Str)

```

##### MsgRecv

MsgRecv accumulates message parts received on one or more sockets with minimal copying.
parts can be examined, slectevely sent over sockets. and transforming functions can be
queued on each part.

```
methods:
    slurp(Socket, :async)
              accumulate waiting message parts from a socket
    push-transform(UInt, &func)
              queue a transfrm function ( for example, encoding). The function should
              conform to :(Str:D --> Str:D|Any ) or (Blob:D --> Str:D|Any
            . Any effectively delete the part.
    push-transform(&func)
              queue a global transfrm function

    set-encoding( 'ENCODING' )
              a wrapper of push-transform

    send(Socket, $from = 0, $n = elems, :async ) sends all or ome of the parts

    [ UInt ] returns message part, transformed by all the transformers

    at-raw( UInt )  returns message part as raw bunary data

```

##### PollBuilder

PollBuilder builds a polled set of receiving sockets

```
(Silly) Usage
my $poll = PollBuilder.new\
  .add( StrPollHandler.new( $socket-1, sub ($m) { say "got --$m-- on  socket 1";} ))\
  .add( StrPollHandler.new( $socket-2, sub ($m) { say "got --$m-- on  socket 2";} ))\
  .add( $socket-3, { False })\
  .delay( 500 )\
  .finalize;

1 while $poll.poll(:serial);
say "Done!";

 Methods
  add( PollHandler --> self)
  add( Socket, Callable:(Socket) --> self)
  delay( Int msecs --> self)                #   -1 => blocks, 0 => no delay
  finalize( --> Poll)

```

##### PollHandler

PollHandler is an an abstract class that represents an action to do on a socket when
it polls positive. It has four readymade subclasses that feed the action a different

```
argument:
    * StrPollHandler
    * MessagePollHandler
    * SocketPollHandler
    * MsgRecvPollHandler

Methods
  new( Socket, Callable:(T) )
  do( Socket )  --  this method is called by the Poll object and can be subclassed
                    to create new types of responses

```

##### Poll

Poll holds and polls an immutable collection of receiving sockets

```
Methods
poll()
  poll returns a sequence of the results of the callback functions associated with the succesfully
  polled sockets or an empty sequence. It throws on error.
poll(:serial)
  primarily fo testing: returns a single result, from the callback of the first succesfully polled
  socket, or Any. The order is defined by the building invocation.

```

##### Proxy

runs a steerable proxy

```
new( :frontend!($socket.as-ptr), :backend!($socket.as-ptr)
        :capture($socket.as-ptr) , :control($socket.as-ptr))
run()

```

##### EchoServer

runs an echo server (connect with :client )

```
methods
  new( :uri )
  run                           blocks on the invoking thread
  detach( --> Promise)          runs in a promise
  shutdown                      stops the server  (no restart possible)

```

## LICENSE

All files (unless noted otherwise) can be used, modified and redistributed
under the terms of the Artistic License Version 2. Examples (in the
documentation, in tests or distributed as separate files) can be considered
public domain.

ⓒ 2017 Gabriel Ash


## dist_github-scmorrison-Web-Cache.md
# Web::Cache [Build Status](https://travis-ci.org/scmorrison/perl6-Web-Cache)

Web::Cache is a Perl 6 web framework independant LRU caching module.

The goal of this module is to provide a variety of cache backend wrappers and utilities that simplify caching tasks within the context of a web application.

**note:** this is very much a work in progress. Ideas, issues, and pull-requests welcome.

# Usage

```
# Bailador example
use v6;
use Bailador;
use Web::Cache;

Bailador::import; # for the template to work

# Create a new cache store
my &memory-cache = cache-create-store( size    => 2048,
                                       backend => 'memory' );

# TODO: Create multiple cache stores using different
#       backends. This will enable caching certain
#       content to different stores.

# Cached templates!
get / ^ '/template/' (.+) $ / => sub ($x) {
    my $template        = 'tmpl.tt';
    my %params          = %{ name => $x };
    my $fancy_cache_key = [$template, $x].join('-');

    # Any callback passed will be run on initial
    # cache insert only. Once cache expiration is
    # supported, this code will re-run again when
    # the key expires.
    memory-cache(key => $fancy_cache_key, {
        template($template, %params)
    });
}

#
# Remove a key
#    memory-cache( key => $fancy_cache_key, :remove );
#
# Empty / clear cache
#    memory-cache( :clear );
#

baile;

```

# Config

Currently only memory caching is supported.

```
# Create cache store
my &memory-cache = create-cache-store( size    => 2048,
                                       backend => 'memory' );

```

## Todo:

```
my &memory-cache = create-cache-store( size    => 2048,
                                       expires => 3600, # add expires parameter
                                       backend => 'memory' );

my &disk-cache   = create-cache-store( path    => '/tmp/webcache/',
                                       expires => 3600,
                                       backend => 'disk' );

my &memcached    = create-cache-store( servers => ["127.0.0.1:11211"],
                                       expires => 3600,
                                       backend => 'memcached' );

my &redis        = create-cache-store( host    => "127.0.0.1",
                                       port    => 6379,
                                       expires => 3600,
                                       backend => 'redis' );

```

# Installation

## zef

```
zef install Web::Cache

```

## Manual

```
git clone https://github.com/scmorrison/perl6-Web-Cache.git
cd perl6-Web-Cache/
zef install .

```

# Todo

* Support additional backends (disk, Memcached, Redis)
* Cache key generator
* Partial / fragment support
* Tests

# Requirements

* [Perl 6](http://perl6.org/)

# AUTHORS

* Sam Morrison

# Copyright and license

Copyright 2017 Sam Morrison

This library is free software; you can redistribute it and/or modify it under the Artistic License 2.0.