## dist_zef-massa-Net-NetRC.md
[![Actions Status](https://github.com/massa/Net-NetRC/actions/workflows/test.yml/badge.svg)](https://github.com/massa/Net-NetRC/actions)

# NAME

Net::NetRC - parse `.netrc` files

# SYNOPSIS

```
use Net::NetRC;

my $x = netrc;

say $x<google.com><login>;

my $y = netrc 'machine azul.example.com login massa password j4k3';

say $y<azul.com><password>;

my $z = netrc '/home/myname/.netrc.alternate';

```

# DESCRIPTION

Net::NetRC is a basic parser for the `.netrc` file format.

I made it as a simple way of obtaining logins and passwords for many other projects.

# AUTHOR

Humberto Massa [humbertomassa@gmail.com](mailto:humbertomassa@gmail.com)

# COPYRIGHT AND LICENSE

Copyright © 2022 - 2024 Humberto Massa

This library is free software; you can redistribute it and/or modify it under either the Artistic License 2.0 or the LGPL v3.0, at your convenience.


## dist_zef-raku-land-URI-Query-FromHash.md
# NAME

URI::Query::FromHash - Construct a query string from a hash

# SYNOPSIS

```
use URI::Query::FromHash;

say hash2query {
   foo  => 'bar',
   baz  => < qux quux >,
   utf8 => '🦋',
}
# OUTPUT:
# baz=qux&baz=quux&foo=bar&utf8=%F0%9F%A6%8B

```

# DESCRIPTION

URI::Query::FromHash aims to be a fast and lightweight query string
constructor, that does the smallest amount of escaping as possible.

Inspired by [the Perl module of the same name](https://metacpan.org/pod/URI::Query::FromHash) and Ruby on Rails'
[to\_query](http://api.rubyonrails.org/classes/Hash.html#method-i-to_query) hash method.

# SUBROUTINES

## hash2query

```
sub hash2query ( Hash() $hash --> Str )

```

Accepts anything that can be coerced to a Hash of query parameters and
returns a Str suitable to be used as the query parameters of a URI.

Pairs in the input Hash will be processed alphabetically by key.

Values in the coerced Hash should be either objects that can be coerced
to Str; objects that do the Blob role; Bool objects; or List objects whose
elements are any of the ones specified before.

Every value (or element in a List) will appear in the generated query string
once, preceded by the corresponding URL-encoded key and an equal sign (C<=>).

If it is a Blob, it will be URL-encoded per byte, with any byte that does not
map to an ASCII period (`.`), underscore (`_`), hyphen (`-`), tilde (`~`),
or alphanumeric character being percent-encoded (that is, represented by a
percent sign (`%`) followed by the hexadecimal representation of the byte in
uppercase).

Bool objects will be rendered as `1` if true or `0` if false.

Otherwise, it will be coerced to Str, encoded as UTF-8 and URL-encoded like
above.

When this function encounters input it cannot handle, it returns the empty
string, meaning it should always be safe to use.

This function is exported by default, but it can be used as a package
subroutine if desired.

# COPYRIGHT AND LICENSE

Copyright © 2022 by Raku Land authors

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


## uni.md
class Uni

A string of Unicode codepoints

```raku
class Uni does Positional[uint32] does Stringy { }
```

Unlike [`Str`](/type/Str), which is made of Grapheme clusters, Uni is string strictly made of Unicode codepoints. That is, base characters and combining characters are separate elements of a `Uni` instance.

`Uni` presents itself with a list-like interface of integer Codepoints.

Typical usage of `Uni` is through one of its subclasses, [`NFC`](/type/NFC), [`NFD`](/type/NFD), [`NFKD`](/type/NFKD) and [`NFKC`](/type/NFKC), which represent strings in one of the [Unicode Normalization Forms](https://www.unicode.org/reports/tr15/) of the same name.

# [Methods](#class_Uni "go to top of document")[§](#Methods "direct link")

## [method new](#class_Uni "go to top of document")[§](#method_new "direct link")

```raku
method new(*@codes --> Uni:D)
```

Creates a new `Uni` instance from the given codepoint numbers.

## [method list](#class_Uni "go to top of document")[§](#method_list "direct link")

```raku
method list(Uni:D:)
```

Returns a [`Seq`](/type/Seq) of integer codepoints.

## [method NFC](#class_Uni "go to top of document")[§](#method_NFC "direct link")

```raku
method NFC(Uni:D: --> NFC:D)
```

Returns an [`NFC`](/type/NFC) (Normal Form Composed)-converted version of the invocant.

## [method NFD](#class_Uni "go to top of document")[§](#method_NFD "direct link")

```raku
method NFD(Uni:D: --> NFD:D)
```

Returns an [`NFD`](/type/NFD) (Normal Form Decomposed)-converted version of the invocant.

## [method NFKC](#class_Uni "go to top of document")[§](#method_NFKC "direct link")

```raku
method NFKC(Uni:D: --> NFKC:D)
```

Returns an [`NFKC`](/type/NFKC) (Normal Form Compatibility Composed)-converted version of the invocant.

## [method NFKD](#class_Uni "go to top of document")[§](#method_NFKD "direct link")

```raku
method NFKD(Uni:D: --> NFKD:D)
```

Returns an [`NFKD`](/type/NFKD) (Normal Form Compatibility Decomposed)-converted version of the invocant.

## [method codes](#class_Uni "go to top of document")[§](#method_codes "direct link")

```raku
method codes(Uni:D: --> Int:D)
```

Returns the number of codepoints in the invocant.

## [method elems](#class_Uni "go to top of document")[§](#method_elems "direct link")

```raku
method elems(Uni:D: --> Int:D)
```

Returns the number of codepoints in the invocant.

# [Typegraph](# "go to top of document")[§](#typegraphrelations "direct link")

Type relations for `Uni`

raku-type-graph

Uni
Uni

Any
Any

Uni->Any

Positional
Positional

Uni->Positional

Stringy
Stringy

Uni->Stringy

Mu
Mu

Any->Mu

NFKC
NFKC

NFKC->Uni

NFD
NFD

NFD->Uni

NFC
NFC

NFC->Uni

NFKD
NFKD

NFKD->Uni

[Expand chart above](/assets/typegraphs/Uni.svg)


## dist_cpan-HANENKAMP-DateTime-DST.md
# NAME

DateTime::DST - make localtime[8] available as is-dst()

# SYNOPSIS

```
use DateTime::DST;

my $non-dst = DateTime.new(:2016year, :1month, :15day, :0hour, :0minute, :0second);
my $dst     = DateTime.new(:2016year, :6month, :15day, :0hour, :0minute, :0second);

say is-dst($non-dst);         # False
say is-dst($non-dst.Instant); # False
say is-dst($non-dst.posix);   # False

say is-dst($dst);             # True
say is-dst($dst.Instant);     # True
say is-dst($dst.posix);       # True

```

# DESCRIPTION

This is nothing too fancy, just exports a function named `is-dst` which can be used to test for Daylight Savings Time from a DateTime object, an Int (expecting seconds since the start of the POSIX time\_t epoch), or an Instant.

# FUNCTIONS

## is-dst

```
multi is-dst(Instant $time) returns Bool
multi is-dst(DateTime $time) returns Bool
multi is-dst(Int $time) returns Bool

```

Returns `True` if the C-standard library `localtime` function returns a true value for the DST flag or `False` otherwise. This is basically the same as `localtime($time)[8]` in Perl 5.

# AUTHOR

Sterling Hanenkamp `<hanenkamp@cpan.org>`

# COPYRIGHT AND LICENSE

Copyright 2016 Andrew Sterling Hanenkamp.

This software is made available under the same terms as Perl 6 itself.


## dist_zef-jaguart-Grok.md
[![Actions Status](https://github.com/jaguart/Grok/actions/workflows/test.yml/badge.svg)](https://github.com/jaguart/Grok/actions)

![Version](https://raku.land/zef:jaguart/Grok/badges/version)

# NAME

grok, wisp - introspection helpers.

# SYNOPSIS

From the command line:

```
raku -MGrok -e 'grok( my $a = 42, :deeply :core)'

raku -MGrok -e 'say wisp( Endian )'

```

Within Raku code:

```
use Grok :wisp;

# print the Endian enumerations...
say wisp( Endian );
# Endian - Enum is: Int Cool Any Mu enums: NativeEndian LittleEndian BigEndian

# print Allomorth attributes, methods and recurse into parents, roles including ::CORE types
grok( Allomorph, :deeply, :core )
# lots of output ...

```

# DESCRIPTION

Grok contains introspection helpers that display information about Raku things.

For example: You want to know how many times a sub is wrapped - grok a golf to see what methods are available.

```
>raku -MGrok -e 'sub s { say "s" }; &s.wrap({ say "w"; next }); grok( &s );'
#s - () Sub+{Routine::Wrapped}
#  Sub - Class is: Routine Block Code Any Mu does: Callable
#  Routine - Class is: Block Code Any Mu does: Callable
#  Block - Class is: Code Any Mu does: Callable
#  Code - Class is: Any Mu does: Callable
#  Any - Class is: Mu
#  Mu - Class
#  Routine::Wrapped - Role
#  Callable - Role
#  $!dispatcher - Mu private read-only in Routine
#  $!do - Code private read-only in Code
#  $!flags - int private read-only in Routine
#  $!inline_info - Mu private read-only in Routine
#  $!package - Mu private read-only in Routine
#  $!phasers - Mu private read-only in Block
#  $!signature - Signature private read-only in Code
#  $!why - Mu private read-only in Block
#  $!wrapper-type - Routine private read-only in Sub+{Routine::Wrapped}
#  $!wrappers - Mu private read-only in Sub+{Routine::Wrapped}
#  @!compstuff - List private read-only in Code
#  @!dispatch_order - List private read-only in Routine
#  @!dispatchees - List private read-only in Routine
#  ADD-WRAPPER - (Sub+{Routine::Wrapped}: &wrapper, *%_ --> Nil) Method in Routine::Wrapped
#  REMOVE-WRAPPER - (Sub+{Routine::Wrapped}: &wrapper, *%_ --> Bool) Method in Routine::Wrapped
#  WRAPPER-TYPE - (Sub+{Routine::Wrapped}: *%_) Method in Routine::Wrapped
#  WRAPPERS - (Sub+{Routine::Wrapped}: *%_) Method in Routine::Wrapped
#  is-wrapped - (Sub+{Routine::Wrapped}: *%_ --> Bool) Method in Routine::Wrapped

```

... and you conclude it's worth checking out `.WRAPPERS.elems`.

### sub grok

```
sub grok(
    Mu $thing is raw,
    :$deeply = Bool::False,
    :$core = Bool::False,
    :$local = Bool::False,
    :$detail = Bool::False,
    :$where = Nil
) returns Mu

```

Introspect a thing. `grok( Allomorph, :deeply, :core );`

* **:deeply** - recurse into parents, roles etc.
* **:core** - include core classes.
* **:local** - skip composed / imported methods.
* **:detail** - include extra detail.
* **:where** - True - show in-package, False - hide in-package, Default - show imported package names.

### sub wisp

```
sub wisp(
    Mu $thing is raw
) returns Wisp

```

An introspection helper - e.g. `say wisp( Endian )`
Provides:

* **.gist**
* **.detail**

# AUTHOR

Jeff Armstrong [jeff@jaguart.tech](mailto:jeff@jaguart.tech)

Source can be found at: <https://github.com/jaguart/Grok>

This is my first Raku module - comments and Pull Requests are welcome.

# COPYRIGHT AND LICENSE

Copyright 2022 Jeff Armstrong

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


## dist_github-azawawi-Graphics-PLplot.md
# Graphics::PLplot

[![Build Status](https://travis-ci.org/azawawi/perl6-graphics-plplot.svg?branch=master)](https://travis-ci.org/azawawi/perl6-graphics-plplot) [![Build status](https://ci.appveyor.com/api/projects/status/github/azawawi/perl6-graphics-plplot?svg=true)](https://ci.appveyor.com/project/azawawi/perl6-graphics-plplot/branch/master)

This module provides Perl 6 low and high-level native bindings for
[PLplot](http://plplot.sourceforge.net/).

Note: Currently work in progress and the API is being implemented one brick at
a time. Help and feedback is appreciated.

PLplot is a library of subroutines that are often used to make scientific plots
in various compiled languages. PLplot can also be used interactively by
interpreted languages such as Octave, Python, Perl and Tcl. The current version
was written primarily by Maurice J. LeBrun and Geoffrey Furnish and is licensed
under LGPL.

## Example

```
use v6;
use Graphics::PLplot;

if Graphics::PLplot.new(
    device    => "png",
    file-name => "output.png"
) -> $plot  {

    # Begin plotting
    $plot.begin;

    # Create a labeled box to hold the plot.
    my $y-max = 100;
    $plot.environment(
        x-range => [0.0, 1.0],
        y-range => [0.0, $y-max],
        just    => 0,
        axis    => 0,
   );
    $plot.label(
        x-axis => "x",
        y-axis => "y=100 x#u2#d",
        title  => "Simple PLplot demo of a 2D line plot",
   );

    # Prepare data to be plotted.
    constant NSIZE = 101;
    my @points = gather {
        for 0..^NSIZE -> $i {
            my $x = Num($i) / (NSIZE - 1);
            my $y = Num($y-max * $x * $x);
            take ($x, $y);
        }
    };

    # Plot the data that was prepared above.
    $plot.line(@points);

    LEAVE {
        $plot.end;
    }
}

```

For more examples, please see the <examples> folder.

## Installation

* On Debian-based linux distributions, please use the following command:

```
$ sudo apt install libplplot-dev

```

* On Mac OS X, please use the following command:

```
$ brew update
$ brew install plplot

```

* Using zef (a module management tool bundled with Rakudo Star):

```
$ zef install Graphics::PLplot

```

## Testing

* To run tests:

```
$ prove -ve "perl6 -Ilib"

```

* To run all tests including author tests (Please make sure
  [Test::Meta](https://github.com/jonathanstowe/Test-META) is installed):

```
$ zef install Test::META
$ AUTHOR_TESTING=1 prove -e "perl6 -Ilib"

```

## Author

Ahmad M. Zawawi, azawawi on #perl6, <https://github.com/azawawi/>

## License

MIT


## dist_cpan-MARTIMM-Gnome-Glib.md
![gtk logo](https://martimm.github.io/gnome-gtk3/content-docs/images/gtk-raku.png)

# Gnome Glib - C-based object and type system

![L](http://martimm.github.io/label/License-label.svg)

Note that all modules are now in `:api<1>`. This is done to prevent clashes with future distributions having the same class names only differing in this api string. So, add this string to your import statements and dependency modules of these classes in META6.json. Furthermore add this api string also when installing with zef.

Example;

```
use Gnome::Gtk3::Main:api<1>;
use Gnome::Gtk3::Window:api<1>;
use Gnome::Gtk3::Grid:api<1>;
use Gnome::Gtk3::Button:api<1>;

my Gnome::Gtk3::Main $m .= new;
… etcetera …

```

## Documentation

* [🔗 License document](http://www.perlfoundation.org/artistic_license_2_0)
* [🔗 Release notes](https://github.com/MARTIMM/gnome-glib/blob/master/CHANGES.md)
* [🔗 Issues](https://github.com/MARTIMM/gnome-gtk3/issues)

# Installation

Do not install this package on its own. Instead install `Gnome::Gtk3<1>`.

`zef install 'Gnome::Gtk3:api<1>'`

# Author

Name: **Marcel Timmerman**
Github account name: **MARTIMM**

# Issues

There are always some problems! If you find one, please help by filing an issue at [my Gnome::Gtk3 github project](https://github.com/MARTIMM/gnome-gtk3/issues).

# Attribution

* The developers of Raku of course and the writers of the documentation which helped me out every time again and again.
* The builders of all the Gnome libraries and its documentation.
* Other helpful modules for their insight and use.


## dist_github-GildedHonour-TelegramBot.md
# Telegram Bot [Build Status](https://travis-ci.org/GildedHonour/TelegramBot)

A genuine Perl 6 client for the [Telegram's Bot API](https://core.telegram.org/bots).

## Does anyone want to become the maintainer?

Shoot me a text

## Example

```
use Telegram;

my $token = "xxx:yyy"; # replace with your token
my $bot = Telegram::Bot.new($token);
my $res = $bot.get-me();
say $res;

```

## Installation

```
$ zef install TelegramBot

```

## Tests

```
PERL6LIB=lib prove -e perl6 t

```

## Author

[Alex Maslakov](http://gildedhonour.com)

## Contributors

Martin Barth (ufobat)

David Warring (dwarring)

## License

Apache 2.0


## dist_github-Skarsnik-NativeCall-TypeDiag.md
# Name NativeCall::TypeDiag

# Synopsis

```
use v6;
use Gumbo::Binding;
use NativeCall::TypeDiag;
my @headers = <gumbo.h>;
my @libs = <-lgumbo>;

my %typ;
# Construct the type from the exported stuff
for Gumbo::Binding::EXPORT::DEFAULT::.keys -> $export {
  if ::($export).REPR eq 'CStruct' {
    #convert foo_bar_s to FooBar
    my $cname = $export.subst(/_s$/, '');
    my @t = $cname.split('_').map: {.tc};
    %typ{@t.join('')} = ::($export);
  }
}
diag-cstructs(:cheaders(@headers), :types(%typ), :clibs(@libs));

```

# Description

A module that provide functions to look at your native types. Comparing with the their C equivalent.

## diag-struct ($ctypename, $nctype, :@cheaders, :@clibs = ())

Analyse the size of the fields of a CStruct and compare them to their C counterpart. It also show potential mistakes

return true if there is no error.

@cheaders is what you need to include to compile a C file using the lib. @clibs is extra options to the compiler.

## diag-cstructs(:@cheaders, :@clibs = (), :%types)

Analyse a given list of structures

%types pairs must look like this :
`"C name of the struct" => ::("name of NC type")`

return true if there is no error.

## diag-functions(:@functions)

REMOVED. It's now part of NativeCall

## @nctd-extracompileroptions

An array that is passed as option to the compiler `cc`

## Example

From one example in the examples folder.

```
use v6;

use NativeCall;
use NativeCall::TypeDiag;

class wrong_rgba_color_s is repr('CStruct'){
	has	int32 $.red;
	has	int32 $.blue;
	has 	int32 $.green;
}

class rgba_color_s is repr('CStruct'){
	has	int32 $.red;
	has	int32 $.blue;
	has 	int32 $.green;
	has 	int32 $.alpha;
}

#struct s_toyunda_sub {
#        usigned int     start;
#        usigned int     stop;
#        char*   text;
#        rgba_color_t    color1;
#        rgba_color_t    color2;
#        rgba_color_t    tmpcolor;
#        float   positionx;
#        float   positiony;
#        float   position2x;
#        float   position2y;
#        float   fadingpositionx;
#        float   fadingpositiony;
#        int     size;
#        int     size2;
#        int fadingsize;
#        char*   image;
#};

class toyunda_subtitle_s is repr('CStruct') {
	has	int32 	$.start;
	has	int32	$.stop;

	has	Str	$.text;
	HAS	rgba_color_s	$.color1;
	HAS	rgba_color_s	$.color2;
	has	rgba_color_s	$.tmpcolor;

	has	num32		$.positionx;
	has	num32		$.positiony;
	has	num32		$.position2x;
	has	num32		$.position2y;
	has	num32		$.fadingpositionx;
	has	num32		$.fadingpositiony;

	has	int32		$.size;
	has	int32		$.size2;
	has	int32		$.fadingsize;

	has	str		$.image;
}

my @h = <toyundatype.h>;
my @l;
@nctd-extracompileroptions = "-I", "./";
diag-struct("rgba_color_t", wrong_rgba_color_s, :cheaders(@h));
say "----";
diag-struct("toyunda_sub_t", toyunda_subtitle_s, :cheaders(@h));
say "\n Some function \n";

sub foo1(Str $a, Int $b) is native('whatever') { * };

sub foo2(Num $a, Int $b) is native('whatever') { * };

sub foo3(Str $a, int32 $b) is native('whatever') returns Int { * };

diag-functions(:functions([&foo1, &foo2, &foo3]));

```

Its output

```
Compiling a test file, this assume field names are the same
-Perl6 name : wrong_rgba_color_s, C Name : rgba_color_t
__has int32  $red : c-size=4 | nc-size=4 -- :
__has int32  $blue : c-size=4 | nc-size=4 -- :
__has int32  $green : c-size=4 | nc-size=4 -- :
-Size given by sizeof and nativesizeof : C:16/NC:12
-Calculated total sizes : C:12/NC:12
Your representation is smaller than the cstruct, but total size of fields match. Did you forget a field?
----
Compiling a test file, this assume field names are the same
-Perl6 name : toyunda_subtitle_s, C Name : toyunda_sub_t
__has int32  $start : c-size=4 | nc-size=4 -- :
__has int32  $stop : c-size=4 | nc-size=4 -- :
__has Str  $text : c-size=4 | nc-size=4 -- :
__HAS rgba_color_s  $color1 : c-size=16 | nc-size=16 -- :
__HAS rgba_color_s  $color2 : c-size=16 | nc-size=16 -- :
__has rgba_color_s  $tmpcolor : c-size=16 | nc-size=4 -- DONT MATCH: C size match nativesizeof(rgba_color_s). put HAS instead of has
__has num32  $positionx : c-size=4 | nc-size=4 -- :
__has num32  $positiony : c-size=4 | nc-size=4 -- :
__has num32  $position2x : c-size=4 | nc-size=4 -- :
__has num32  $position2y : c-size=4 | nc-size=4 -- :
__has num32  $fadingpositionx : c-size=4 | nc-size=4 -- :
__has num32  $fadingpositiony : c-size=4 | nc-size=4 -- :
__has int32  $size : c-size=4 | nc-size=4 -- :
__has int32  $size2 : c-size=4 | nc-size=4 -- :
__has int32  $fadingsize : c-size=4 | nc-size=4 -- :
__has str  $image : c-size=4 | nc-size=4 -- : You should replace your 'str' type with 'Str'
-Size given by sizeof and nativesizeof : C:100/NC:88
-Calculated total sizes : C:100/NC:88

 Some function

foo1 - Not a valid parameter type for parameter [2] $b : Int
-->For Numerical type, use the appropriate int32/int64/num64...
foo2 - Not a valid parameter type for parameter [1] $a : Num
-->For Numerical type, use the appropriate int32/int64/num64...
foo2 - Not a valid parameter type for parameter [2] $b : Int
-->For Numerical type, use the appropriate int32/int64/num64...
Int foo3 - You should not return a non NC type (like Int inplace of int32), truncating errors can appear with different architectures

```


## dist_zef-antononcube-WWW-YouTube.md
# WWW::YouTube

Raku package for getting metadata and transcripts of YouTube videos.

The Raku implementation closely follows the Wolfram Language function `YouTubeTranscript`, [AAf1].

---

## Installation

From [Zef ecosystem](https://raku.land):

```
zef install WWW::YouTube

```

From GitHub:

```
zef install https://github.com/antononcube/Raku-WWW-YouTube.git

```

---

## Usage

`youtube-metadata($id)`

* Get the metadata of the YouTube video with identifier `$id`.

`youtube-playlist($id)`

* Get the video identifiers of the YouTube playlist with identifier `$id`.

`youtube-transcript($id)`

* Get the transcript of the YouTube video with identifier `$id`.

---

## Details

* All three subs, `youtube-metadata`, `youtube-playlist`, and `youtube-transript`,
  work with strings that are identifiers or (full) URLs.
* `youtube-metdata` extracts the metadata associated with a YouTube video identifier.

  * Returns a record (hashmap) with keys `<channel-title description publish-date title view-count>`.
* `youtube-playlist` extracts the video identifiers of a given YouTube playlist identifier.

  * *Currently, gives only the first 100 videos.*
* `youtube-transcript` extracts the captions of the video, if they exist.

  * The transcript can be returned as plain text, array of hashmaps, JSON string.
  * The YouTube Data API has usage quotas.
  * Not all YouTube videos have automatic or manual captions. If no captions are available, the function returns a message indicating this.
* `youtube-transcript` processes "captionTracks" of the YouTube Data API, which is a field of YouTube's video metadata.

  * The field "captionTracks" is an array of objects, where each object represents a single caption track (e.g., for a specific language or type).
  * From "captionTracks" the "baseURL" string is extracted, which is the URL to fetch the caption content.

---

## Examples

### Metadata

Get the metadata associated with a YouTube video identifier:

```
use WWW::YouTube;
use Data::Translators;

youtube-metadata('S_3e7liz4KM')
==> to-html(align => 'left')

```

|  |  |
| --- | --- |
| description | Computationally neat examples with Raku packages featuring graphs and graph plots. (3rd set.)\n\nHere is the presentation Jupyter notebook: https://github.com/antononcube/RakuForPrediction-blog/blob/main/Presentations/Notebooks/Graph-neat-examples-set-3.ipynb\n\n------------------\n\nPlease, consider buying me a coffee: https://buymeacoffee.com/antonov70 |
| publish-date | 2024-11-28T11:24:44-08:00 |
| title | Graph neat examples in Raku (Set 3) |
| view-count | 139 views |
| channel-title | N/A |

### Transcripts

```
my $transcript = youtube-transcript('ewU83vHwN8Y');

say $transcript.chars;

say $transcript.substr(^300);

```

```
# 36700
# Hi everyone, welcome to a wolf from
# language design review for version 14.3.
# We are talking about LLM
# graph. So,
# okay. So this is for the purpose of of
# knitting together LLM calls like LLM
# function type calls.
# Exactly.
# To support more complex workflows
# um and and to have asynchronous calls to
# LLMs.

```

Summarize using a Large Language Model (LLM):

```
use LLM::Functions;
use LLM::Prompts;

llm-synthesize(llm-prompt('Summarize')($transcript), e => 'Gemini')

```

```
# This language design review introduces LLM graphs, which orchestrate calls to LLMs for complex workflows, including asynchronous execution.  LLM graphs use nodes containing prompts or code (node functions) that can depend on each other, with inputs and outputs managed through associations.  The design includes features like listable templates and conditional execution, and it aims to provide a powerful, yet simple, way to build agentic workflows.

```

Get the transcript as a dataset:

```
my @t = youtube-transcript('S_3e7liz4KM', format => 'dataset');

@t.head(10) ==> to-html(field-names => <time duration content>, align => 'left')

```

| time | duration | content |
| --- | --- | --- |
| 0.52 | 4.64 | this presentation is titled graph neat |
| 2.8 | 5.2 | examples in Raku set |
| 5.16 | 4.84 | three my name is Anton Antonov today's |
| 8 | 5 | November 28th |
| 10 | 6 | 2024 I have prepared two sets of |
| 13 | 6.68 | examples nested graphs and file system |
| 16 | 5.72 | graphs the neat examples in general are |
| 19.68 | 3.96 | defined as concise or straightforward |
| 21.72 | 3.76 | code that produce compelling visual |
| 23.64 | 4.399 | textual outputs I'm going to be |

### Playlists

```
youtube-playlist('PLke9UbqjOSOiMnn8kNg6pb3TFWDsqjNTN')

```

```
# [fwQrQyWC7R0 S_3e7liz4KM E7qhutQcWCY kQo3wpiUu6w JHO2Wk1b-Og 5qXgqqRZHow 0uJl9q7jIf8]

```

---

## CLI

The package provides Command Line Interface (CLI) scripts. Here are their usage messages:

```
youtube-metadata --help

```

```
# Usage:
#   youtube-metadata <id> [--format=<Str>] -- Get YouTube video metadata.
#
#     <id>              Video identifier
#     --format=<Str>    Format of the result, one of 'json', 'raku', 'asis'. [default: 'json']

```

```
youtube-playlist --help

```

```
# Usage:
#   youtube-playlist <id> -- Get video identifiers of a YouTube playlist.
#
#     <id>    Video playlist identifier

```

```
youtube-transcript --help

```

```
# Usage:
#   youtube-transcript <id> [--format=<Str>] -- Get YouTube transcripts.
#
#     <id>              Video identifier
#     --format=<Str>    Format of the result, one of 'text', 'dataset', or 'json'. [default: 'text']

```

---

## TODO

* TODO Implementation
  * DONE Get transcript for a video identifier
  * DONE Video metadata retrieval
  * TODO Video identifiers for a playlist
    * DONE For playlists with ≤ 100 videos
    * TODO Large playlists
  * TODO Different transcript output formats
    * DONE Text
    * DONE Dataset (array of hashmap records)
    * DONE JSON
    * TODO WebVTT
    * TODO SRT
  * Implement versions of the subs using a YouTube API key
* TODO Documentation
  * DONE Basic usage
  * TODO Transcripts retrieval for a playlist

---

## References

[AAf1] Anton Antonov,
[YouTubeTranscript](https://resources.wolframcloud.com/FunctionRepository/resources/YouTubeTranscript/),
(2025),
[Wolfram Function Repository](https://resources.wolframcloud.com/FunctionRepository/).


## dist_zef-finanalyst-L10N-CY.md
# NAME

L10N::CY - Welsh localization of Raku

# SYNOPSIS

```
use L10N::CY;
dywedyd "Hello World";

```

# DESCRIPTION

L10N::CY contains the logic to provide a Welsh localization of the Raku Programming Language.

It's based on the Klingon localization by Elizabeth Mattisjen.

# AUTHOR

Richard Hainsworth [rnhainsworth@gmail.com](mailto:rnhainsworth@gmail.com)
Elizabeth Mattijsen [liz@raku.rocks](mailto:liz@raku.rocks)

Source can be located at: <https://github.com/finanalyst/rakuast-L10N-CY>. Comments and Pull Requests are welcome.
Klingon source can be located at: <https://github.com/lizmat/L10N-TLH> .

# COPYRIGHT AND LICENSE

Copyright 2023 Richard Hainsworth

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


## receiveonclosed.md
class X::Channel::ReceiveOnClosed

Error due to calling receive on a closed channel

```raku
class X::Channel::ReceiveOnClosed {}
```

This exception is thrown when a calling `receive` on a [`Channel`](/type/Channel) that has been closed:

```raku
my $s = Channel.new;
$s.close;
$s.receive;     # Cannot receive a message on a closed channel
CATCH { default { put .^name, ': ', .Str } };
# OUTPUT: «X::Channel::ReceiveOnClosed: Cannot receive a message on a closed channel␤»
```

# [Methods](#class_X::Channel::ReceiveOnClosed "go to top of document")[§](#Methods "direct link")

## [method channel](#class_X::Channel::ReceiveOnClosed "go to top of document")[§](#method_channel "direct link")

```raku
method Channel(X::Channel::ReceiveOnClosed:D: --> Channel:D)
```

Returns the Channel object on which the `receive` method was called.


## nosuchtype.md
class X::Augment::NoSuchType

Compilation error due to augmenting a non-existing type

```raku
class X::Augment::NoSuchType does X::Comp { }
```

Thrown when trying to augment a type which doesn't exist.

For example

```raku
use MONKEY-TYPING;
augment class NoSuch { }

```

dies with

｢text｣ without highlighting

```

```

You tried to augment class NoSuch, but it does not exist

```

```

# [Methods](#class_X::Augment::NoSuchType "go to top of document")[§](#Methods "direct link")

## [method package-kind](#class_X::Augment::NoSuchType "go to top of document")[§](#method_package-kind "direct link")

```raku
method package-kind(--> Str:D)
```

Returns the kind of package (class, grammar) that is being tried to augment

## [method package](#class_X::Augment::NoSuchType "go to top of document")[§](#method_package "direct link")

Returns the name that was tried to augment, but which doesn't exist.


## dist_zef-jonathanstowe-RPi-Device-PiGlow.md
# RPi::Device::PiGlow

Interface for the [PiGlow](https://shop.pimoroni.com/products/piglow) device on the Raspberry Pi

## Synopsis

```

    use RPi::Device::PiGlow;
    my $pg = RPi::Device::PiGlow.new();

    my $values = [0x01,0x02,0x04,0x08,0x10,0x18,0x20,0x30,0x40,0x50,0x60,0x70,0x80,0x90,0xA0,0xC0,0xE0,0xFF];
    $pg.enable-output;
    $pg.enable-all-leds;
    $pg.write-all-leds($values);
    sleep 10;
    $pg.reset;

```

See the <examples> directory for more ways of using this.

## Description

The [PiGlow from Pimoroni](http://shop.pimoroni.com/products/piglow)
is a small board that plugs in to the Raspberry PI's GPIO header with
18 LEDs on that can be addressed individually via i²c. This module
uses [RPi::Device::SMBus](https://github.com/jonathanstowe/RPi-Device-SMBus)
to abstract the interface to the device so
that it can be controlled from a Raku programme. It is assumed that
you have installed the OS packages required to make i2c work and have
configured and tested the i²c appropriately. The only difference that
seems to affect the PiGlow device is that it only seems to be reported
by i2cdetect if you use the "quick write" probe flag:

sudo i2cdetect -y -q 1

(assuming you have a Rev B. or version 2 Pi - if not you should supply
0 instead of 1.) I have no way of knowing the compatibility of the
"quick write" with any other devices you may have plugged in to the Pi,
so I wouldn't recommend doing this with any other devices unless you know
that they won't be adversely affected by "quick write". The PiGlow has
a fixed address anyway so the information isn't that useful.

A useful quick guide to setting up for the Raspberry Pi 2 can be found
at <https://blog.robseder.com/2015/04/12/getting-a-piglow-to-work-with-a-raspberry-pi-2/> though
most of that will work for other versions.

With a more recent Raspbian install you may just be able to switch on
the `raspi-config` program, via `5. Interfacing Options`

## Installation

Assuming you have a working Rakudo installation you should be able to install this with *zef* :

```
# From the source directory

zef install .

# Remote installation

zef install RPi::Device::PiGlow

```

The tests will fail if run on other than a Raspberry Pi with i²c configured.

## Support

Suggestions/patches are welcomed via [github](https://github.com/jonathanstowe/RPi-Device-PiGlow/issues).

Because there are limited ways to test this automatically without
physically observing the device, there may be untested bugs.

I've tested this on three different versions of Raspberry Pi, if you find problems please report the Pi version
as well as the OS, Raku version etc.

## Licence

This is free software.

Please see the <LICENCE> file in the distribution

© Jonathan Stowe 2016 - 2021


## dist_github-soundart-Crypt-TweetNacl.md
[![Build Status](https://travis-ci.org/soundart/perl6-tweetnacl.svg?branch=master)](https://travis-ci.org/soundart/perl6-tweetnacl)

# NAME

TweetNacl - pulic key crypto lib

# SYNOPSIS

```
# ----------------------------------------------------------------------
# public key encryption
# ----------------------------------------------------------------------

use Crypt::TweetNacl::PublicKey;

# create keys
my $alice = KeyPair.new;
my $bob = KeyPair.new;

# create Buf to encrypt
my $msg = 'Hello World'.encode('UTF-8');

# encrypt
my $cb = CryptoBox.new(pk => $alice.public , sk => $bob.secret);
my $data = $cb.encrypt($msg);

# decrypt
my $cbo = CryptoBoxOpen.new(pk => $bob.public , sk => $alice.secret);
my $rmsg = $cbo.decrypt($data);
say $rmsg.decode('UTF-8')

# ----------------------------------------------------------------------
# public key signatures
# ----------------------------------------------------------------------

use Crypt::TweetNacl::Sign;

# create key
my $keypair = KeyPair.new;
my $msg = 'Hello World'.encode('UTF-8');

# sign
my $cs = CryptoSign.new(buf => $msg, sk => $keypair.secret);
say $cs.signature

# verify, throws if message was corrupted
my $cso = CryptoSignOpen.new(buf => $cs.signature, pk => $keypair.public);
say $cso.message.decode('UTF-8') # 'Hello World'

# ----------------------------------------------------------------------
# secret key encryption
# ----------------------------------------------------------------------

use Crypt::TweetNacl::SecretKey;

# create key
my $alice = Key.new;

# create Buf to encrypt
my $msg = 'Hello World'.encode('UTF-8');

# encrypt
my $csb = CryptoSecretBox.new(sk => $alice.secret);
my $data = $csb.encrypt($msg);

# decrypt
my $csbo = CryptoSecretBoxOpen.new(sk => $alice.secret);
my $rmsg = $csbo.decrypt($data);
say $rmsg.decode('UTF-8') # 'Hello World'

```

# INSTALL

```
# on debian like systems:

apt install rakudo moarvm-dev
git clone https://github.com/soundart/perl6-tweetnacl
cd perl6-tweetnacl
zef install .

```

# DESCRIPTION

For details see

* <https://nacl.cr.yp.to/box.html>
* <http://tweetnacl.cr.yp.to/tweetnacl-20131229.pdf>

This is my first perl6 attempt. Feedback very much appreciated.

open questions:

* class Ciphertext: attributes $!data and $!nonce have to be
  transported(e.g. send via network) from encryption to
  decryption host. Should there be a serialize() method?

# COPYRIGHT AND LICENSE

see LICENSE


## dist_zef-guifa-Intl-Format-List.md
# IntlFormatList

A module for formatting lists in a localized manner

To format lists using this module, use the provided sub C:

```
format-list @list

```

There are three named options available:

* **`:language`** (may be abbreviated to **`:lang`**)
  The language to use for formatting.
  Should be a valid BCP-47 language code.
  Defaults to whatever value `Intl::UserLanguage`'s `user-language` returns (which defaults to 'en' if undetectable).
* **`:type`**
  There are three types possible: *and*, *or*, *unit*.
  The *and* type indicates a list of collective values (e.g. 'apples, oranges, and peaches').
  The *or* type indicates a list of alternate values (e.g. 'apples, oranges, or peaches').
  The *unit* type indicates a list of values, without specifying any relation between them (e.g. 'apples, oranges, peaches').
  Defaults to *and*.
* **`:length`**
  There are three lengths possible: *standard*, *short*, *narrow*.
  Many languages do not distinguish *standard* and *short*, perhaps only omitting spaces if they do.
  In contrast, *narrow* is designed for minimal contexts, but may be ambiguous between the forms and should have additional context provided if used.
  Defaults to *standard*.

## Examples

If your language is set to English…

```
my @list = <apples oranges bananas>;
say format-list @list;              # 'apples, oranges, and bananas'
say format-list @list, :type<or>;   # 'apples, oranges, or bananas'
say format-list @list, :type<unit>; # 'apples, oranges, bananas'

```

But if your language is set to Spanish…

```
my $a = 'manzanas';
my $o = 'naranjas';
my $b = 'plátanos';
say format-list $a, $o, $b;            # 'manzanas, naranjas y plátanos'
say format-list $a, $o, $b, :type<or>; # 'manzanas, naranjas o plátanos'
say format-list $a, $o, $b, :type<unit; # 'manzanas, naranjas y plátanos'

```

As you can tell, the `format-list` sub follows the single-argument rule, allowing either a list proper *or* an inline list of items.
All items passed in are stringified.

### For developers

If you want to integrate the list formatter via `RakuAST`, you can obtain a `Callable` (currently a `RakuAST::PointyBlock`) by the following:

```
use Intl::Format::List :rakuast;
my $formatter-ast = format-list-rakuast('en', 'and', 'standard')

```

Presently, all three parameters (language, type, length) must be specified.

## Version history

* **v0.6.0**
  * Added an improved caching mechanism
  * RakuAST support (autodetects based on compiler version)
* **v0.5.0**
  * First release as its own module
  * Much cleaner / more maintainable codebase
* **v0.1** – **v0.4.3**
  * Initial release as a part of the `Intl::CLDR` module
  * No changes made after initial release

## License and Copyright

© 2020–2022 Matthew Stephen Stuckwisch. Licensed under Artistic License 2.0


## dist_zef-ssotka-JSON-CSV.md
**JSON-CSV**

This repository is for a collection of scripts that convert between JSON and CSV.
Written in Raku as a small project to help me learn the language.

* bin/json2csv
* bin/csv2json
* bin/jsonStream2csv

The scripts depend on Text::CSV, JSON::Fast, and JSON::Stream. NOTE: Please feel free to contact me or suggest changes via the github project.

**COPYRIGHT and LICENSE**

© 2022 Scott Sotka. Licensed under the Artistic License 2.0.


## dist_zef-l10n-L10N-HU.md
# NAME

L10N::HU - Hungarian localization of Raku

# SYNOPSIS

```
use L10N::HU;
mond "Hello World";

```

# DESCRIPTION

L10N::HU contains the logic to provide a Hungarian localization of the Raku Programming Language.

# AUTHORS

Polgár Márton (Martin Burger)

# COPYRIGHT AND LICENSE

Copyright 2023 Raku Localization Team

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


## dist_cpan-FRITH-Archive-Libarchive-Raw.md
## Archive::Libarchive::Raw

Archive::Libarchive::Raw - Raw interface to libarchive using NativeCall.

## Build Status

[![Actions Status](https://github.com/frithnanth/perl6-Archive-Libarchive-Raw/workflows/test/badge.svg)](https://github.com/frithnanth/perl6-Archive-Libarchive-Raw/actions)

## Example

```
use v6;

use Archive::Libarchive::Raw;
use Archive::Libarchive::Constants;

sub MAIN(:$file! where { .IO.f // die "file '$file' not found" })
{
  my archive $a = archive_read_new();
  archive_read_support_filter_all($a);
  archive_read_support_format_all($a);
  archive_read_open_filename($a, $file, 10240) == ARCHIVE_OK or die 'Unable to open archive';
  my archive_entry $entry .= new;
  while archive_read_next_header($a, $entry) == ARCHIVE_OK {
    my $name = archive_entry_pathname($entry);
    say $name;
    archive_read_data_skip($a);
  }
  archive_read_free($a) == ARCHIVE_OK or die 'Unable to free internal data structure';
}

```

For more examples see the `example` directory.

## Description

Archive::Libarchive::Raw is a set of simple bindings to libarchive using NativeCall.

As the Libarchive site (<http://www.libarchive.org/>) states, its implementation is able to:

* Read a variety of formats, including tar, pax, cpio, zip, xar, lha, ar, cab, mtree, rar, and ISO images.
* Write tar, pax, cpio, zip, xar, ar, ISO, mtree, and shar archives.
* Handle automatically archives compressed with gzip, bzip2, lzip, xz, lzma, or compress.

For more details on libarchive see <https://github.com/libarchive/libarchive/wiki/ManualPages> .

## Prerequisites

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

### Debian Linux

```
sudo apt-get install libarchive13

```

## Installation

```
$ zef install Archive::Libarchive::Raw

```

## Testing

To run the tests:

```
$ prove -e "raku -Ilib"

```

## Note

This module relies on a C library which might not be present in one's installation, so it's not a substitute
for a pure Raku module.

This is a raw interface to the functions provided by the C library; any program that uses this module might
need to use NativeCall. If you wish to use a higher level interface, please take a look at Archive::Libarchive.

## Author

Fernando Santagata

## Contributions

Many thanks to Jonathan Worthington for the Windows installer code.
Many thanks to Curt Tilmes for implementing a bunch of calls to libarchive, and providing tests.

## Copyright and license

The Artistic License 2.0


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

# NAME

Algorithm::XGBoost - A Raku bindings for XGBoost ( <https://github.com/dmlc/xgboost> ).

# SYNOPSIS

```
use Algorithm::XGBoost;
use Algorithm::XGBoost::Booster;
use Algorithm::XGBoost::DMatrix;
use Algorithm::XGBoost::Model;

# agaricus.txt.test is here: https://github.com/dmlc/xgboost/tree/master/demo/data
my $dmat = Algorithm::XGBoost::DMatrix.from-file("agaricus.txt.train");
say $dmat.num-row; # 6513
say $dmat.num-col; # 127
my $model = Algorithm::XGBoost.train($dmat, 10);
$model.num-feature.say; # 127

my @test[2;2] = [[0e0,0e0],[0e0,1e0]];
my $test = Algorithm::XGBoost::DMatrix.from-matrix(@test);
say $model.predict($test); # (0.9858561754226685 0.9858561754226685)

```

# DESCRIPTION

Algorithm::XGBoost is a Raku bindings for XGBoost ( <https://github.com/dmlc/xgboost> ).

## METHODS

### train

Defined as:

```
method train(Algorithm::XGBoost::DMatrix $dmat, Int $num-iteration, %param --> Algorithm::XGBoost::Model)

```

Trains a XGBoost model.

* `$dmat` The instance of Algorithm::XGBoost::DMatrix.
* `$num-iteration` The number of iterations for training.
* `%param` The parameter for training.

### version

Defined as:

```
method version(--> Version)

```

Returns the libxgboost version.

### global-config

Defined as:

```
multi method global-config(Str $json-str)
multi method global-config(--> Str)

```

Sets/Gets the global parameters: verbosity and use\_rmm.

* `verbosity` The verbosity of printing messages. Valid values of 0 (silent), 1 (warning), 2 (info), and 3 (debug).
* `use_rmm` Whether to use RAPIDS Memory Manager (RMM) to allocate GPU memory. This option is only applicable when XGBoost is built (compiled) with the RMM plugin enabled. Valid values are true and false.

# AUTHOR

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

# COPYRIGHT AND LICENSE

Copyright 2021 Itsuki Toyota

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


## dist_cpan-HANENKAMP-Hash-MultiValue.md
# NAME

Hash::MultiValue - Store multiple values per key, but act like a regular hash too

# SYNOPSIS

```
my %mv := Hash::MultiValue.from-pairs: (a => 1, b => 2, c => 3, a => 4);

say %mv<a>; # 4
say %mv<b>; # 2

say %mv('a').join(', '); # 1, 4
say %mv('b').join(', '); # 2

%mv<a>   = 5;
%mv<d>   = 6;
%mv('e') = 7, 8, 9;

say %mv.all-pairs».fmt("%s: %s").join("\n");
# a: 5
# b: 2
# c: 3
# d: 6
# e: 7
# e: 8
# e: 9

```

# DESCRIPTION

This class is useful in cases where a program needs to have a hash that may or may not have multiple values per key, but frequently assumes only one value per key. This is commonly the case when dealing with URI query strings. This class also generally preserves the order the keys are encountered, which can also be a useful characteristic when working with query strings.

If some code is handed this object where a common <Associative> object (like a <Hash>) is expected, it will work as expected. Each value will only have a single value available. However, when one of these objects is used as function or using the various `.all-*` alternative methods, the full multi-valued contents of the keys can be fetched, modified, and iterated.

This class makes no guarantees to preserve the order of keys. However, the order of the multiple values stored within a key is guaranteed to be preserved. If you require key order to be preserved, you may want to look into <ArrayHash> instead.

# Methods

## method new

```
multi method new(Hash::MultiValue:U:) returns Hash::MultiValue:D
multi method new(Hash::MultiValue:U: :@pairs!) returns Hash::MultiValue:D
multi method new(Hash::MultiValue:U: :@kv!) returns Hash::MultiValue:D
multi method new(Hash::MultiValue:U: :%mixed-hash!, :$iterate = Iterable, :&iterator) returns Hash::MultiValue:D

```

This method constructs a multi-value hash. If called with no arguments, an empty hash will be constructed.

```
my %empty := Hash::MultiValue.new;

```

If called with the named `pairs` argument, then the given pairs will be used to instantiate the list. This is similar to calling `from-pairs` with the given list..

```
my %from-pairs := Hash::MultiValue.new(
    pairs => (a => 1, b => 2, a => 3),
);

```

If called with the named `kv` argument, then the given list must have an even number of elements. The even-indexed items will be treated as keys, and the following odd-indexed items will be treated as the value for the preceding key. This is similar to calling `from-kv`.

```
my %from-kv = Hash::MultiValue.new(
    kv => ('a', 1, 'b', 2, 'a', 3),
);

```

If called with the named `mixed-hash` argument, then the given hash will be treated as a mixed value hash. A mixed value hash is complicated, so using it to initialize this data structure is not ideal.

In order to initialize from such a structure, every value in the given hash must be evaluted by type. If the type of the value matches the one found in `$iterator` (<Iterable> by default), then the key will be inserted multiple times, one for each item iterated. The iteration will be handled by just looping over the values using a `map` operation. You can provide your own `&iterator` as well, which will be called for each value matching `$iterator`. The first argument will be key to return and the second will be the value that needs to be iterated. The `&terator` should return a `Seq` of `Pair`s.

```
my %from-mixed := Hash::MultiValue.new(
    mixed-hash => {
        a => [ 1, 3 ],
        b => 2,
    },
);

```

## method from-pairs

```
method from-pairs(Hash::MultiValue:U: *@pairs) returns Hash::MultiValue:D

```

This takes a list of pairs and constructs a Hash::MultiValue object from it. Multiple pairs with the same key may be included in this list and all values will be associated with that key.

It should be noted that you may need to be a little careful with how you pass your pairs into this method. Perl 6 treats anything that looks like a named argument as a named argument. Here's a quick example of what works and what doesn't:

```
# THIS
my %h := Hash::MultiValue.from-pairs: (a => 1, b => 2, a => 3);
# OR THIS
my %h := Hash::MultiValue.from-pairs((a => 1, b => 2, a => 3));
# OR THIS
my %h := Hash::MultiValue.from-pairs('a' => 1, 'b' => 2, 'a' => 3);
# OR THIS
my @a := (a => 1, b => 2, a => 3);
my %h := Hash::MultiValue.from-pairs(@a);

# BUT NOT
my %h := Hash::MultiValue.from-pairs(a => 1, b => 2, a => 3);
# ALSO NOT
my %h := Hash::MultiValue.from-pairs(|@a);

```

To protect from accidentally passing these as named arguments, the method will fail if any named arguments are detected.

### method from-pairs

```
method from-pairs(
    *@pairs,
    *%badness
) returns Hash::MultiValue:D

```

Construct a Hash::MultiValue object from a list of pairs

## method from-kv

```
method from-kv(Hash::MultiValue:U: +@kv) returns Hash::MultiValue:D

```

This takes a list of keys and values in a single list and turns them into pairs. The given list of items must have an even number of elements or the method will fail.

The even-indexed items will be treated as keys, and the following odd-indexed items will be treated as the value for the preceding key. This is similar to calling `from-kv`.

## method from-mixed-hash

```
multi method from-mixed-hash(Hash::MultiValue:U: %hash, :$iterate = Iterable, :&iterate) returns Hash::MultiValue:D
multi method from-mixed-hash(Hash::MultiValue:U: *%hash) returns Hash::MultiValue:D

```

This takes a hash and constructs a new Hash::MultiValue from it as a mixed-value hash. A mixed value hash is complicated, so using it to initialize this data structure is not ideal.

In order to initialize from such a structure, every value in the given hash must be evaluted by type. If the type of the value matches the one found in `$iterator` (<Iterable> by default), then the key will be inserted multiple times, one for each item iterated. The iteration will be handled by just looping over the values using a `map` operation. You can provide your own `&iterator` as well, which will be called for each value matching `$iterator`. The first argument will be key to return and the second will be the value that needs to be iterated. The `&terator` should return a `Seq` of `Pair`s.

```
my %from-mixed := Hash::MultiValue.from-mixed-hash(
    a => [ 1, 3 ],
    b => 2,
);

# The above is basically identical to:
# Hash::MultiValue.from-pairs: (a => 1, a => 3, b => 2);

```

**Caution:** If you use the slurpy version of this method, you have no additional named options. Passing `iterate` or `iterator` will just result in those being put into the data structure.

### multi method from-mixed-hash

```
multi method from-mixed-hash(
    %mixed-hash,
    :$iterate = Iterable,
    :&iterator = { ... }
) returns Hash::MultiValue:D

```

Construct a Hash::MultiValue object from a mixed value hash

### multi method from-mixed-hash

```
multi method from-mixed-hash(
    *%mixed-hash
) returns Hash::MultiValue:D

```

Construct a Hash::MultiValue object from a mixed value hash

## method postcircumfix:<{ }>

```
method postcircumfix:<{ }> (Hash::MultiValue:D: %key) is rw

```

Whenever reading or writing keys using the `{ }` operator, the hash will behave as a regular built-in <Hash>. Any write will overwrite all values that have been set on the multi-value hash with a single value.

```
my %mv := Hash::MultiValue.from-pairs(a => 1, b => 2, a => 3);
%mv<a> = 4;
say %mv('a').join(', '); # 4

```

Any read will only read a single value, even if multiple values are stored for that key.

```
my %mv := Hash::MultiValue.from-pairs(a => 1, b => 2, a => 3);
say %mv<a>; # 3

```

Of those values the last value will always be used. This is in keeping with the usual semantics of what happens when you add two pairs with the same key twice in Perl 6.

You may also use the `:delete` and `:exists` adverbs with these objects.

```
my %mv := Hash::MultiValue.from-pairs(a => 1, b => 2, a => 3);
say %mv<a> :delete; # 3 (both 1 and 3 are gone)
say %mv<b> :exists; # True

```

Binding is also supported. For example,

```
my $a = 4;
%mv<a> := $a;
$a = 5;
say %mv<a>; # 4

```

## method postcircumfix:<( )>

```
method postcircumfix:<( )> (Hash::MultiValue:D: $key) is rw

```

The `( )` operator may be used in a fashion very similar to `{ }`, but in that it always works with multiple values. You may use it to read multiple values from the object:

```
my %mv := Hash::MultiValue.from-pairs(a => 1, b => 2, a => 3);
say %mv('a').join(', '); # 1, 3

```

You may also use it to write multiple values, which will replace all values currently set for that key:

```
my %mv := Hash::MultiValue.from-pairs(a => 1, b => 2, a => 3);
%mv('a') = 4, 5;
%mv('b') = 6, 7;
%mv('c') = 8;
say %mv('a').join(', '); # 4, 5
say %mv('b').join(', '); # 6, 7
say %mv('c').join(', '); # 8

```

At this time, this operator does not support slices (i.e., using a <Range> or <List> of keys to get values for more than one key at once). This might be supported in the future.

## method kv

Returns a list alternating between key and value. Each key will only be listed once with a singular value. See [/method all-kv](/method all-kv) for a multi-value version.

## method pairs

Returns a list of <Pair> objects. Each key is returned just once pointing to the last (or only) value in the multi-value hash. See [/method all-pairs](/method all-pairs) for the multi-value version.

## method antipairs

This is identical to [/method pairs](/method pairs), but with the value and keys swapped.

## method invert

This is a synonym for [/method antipairs](/method antipairs).

## method keys

Returns a list of keys. Each key is returned exactly once. See [/method all-keys](/method all-keys) for the multi-value version.

## method values

Returns a list of values. Only the last value of a multi-value key is returned. See [/method all-values](/method all-values) for the multi-value version.

## method all-kv

Returns a list alternating between key and value. Multi-value key will be listed more than once.

## method all-pairs

Returns a list of <Pair> objects. Multi-value keys will be returned multiple times, once for each value associated with the key.

## method all-antipairs

This is identical to [/method all-pairs](/method all-pairs), but with key and value reversed.

## method all-invert

This is a synonym for [/method all-antipairs](/method all-antipairs).

## method keys

This returns a list of keys. Multi-valued keys will be returned more than once. If you want the unique key list, you want to see [/method keys](/method keys).

## method values

This returns a list of all values, including the multiple values on a single key.

## method push

```
method push(*@values)

```

This adds new pairs to the list. Any pairs given with a key matching an existing key will cause the single value version of that key to be replaced with the new value. This never overwrites existing values.

## method perl

Returns code as a string that can be evaluated with `EVAL` to recreate the object.

## method gist

Like [/method perl](/method perl), but only includes up to the first 100 keys.


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

# NAME

Email::Notmuch - Raku binding for NotmuchMail email database

# SYNOPSIS

```
use Email::Notmuch;

my $database = Database.new('/home/goneri/Maildir');
my $query = Query.new($database, 'tag:todo');
my $messages = $query.search_messages();
for $messages.all() -> $message {
    say $message.get_header('from');
    $message.add_tag('seen');
    say $message.get_tags().all();
}

```

# DESCRIPTION

Notmuchmail ( <https://notmuchmail.org/> ) is a mail indexation tool. This Raku module provides binding for a limited subset of its API.

The library has been tested with Notmuch 0.25 and greater, it does not work anymore with the older versions.

# AUTHOR

Gonéri Le Bouder

# COPYRIGHT AND LICENSE

Copyright 2015 - 2018 Gonéri Le Bouder

Copyright 2024 Raku Community

The project uses the GPLv3 or greater.


## dist_cpan-MELEZHIK-Sparrowdo-Rvm.md
# Sparrowdo::Rvm

[![Build Status](https://travis-ci.org/melezhik/perl6-sparrowdo-rvm.svg?branch=master)](https://travis-ci.org/melezhik/perl6-sparrowdo-rvm)

## SYNOPSIS

[Sparrowdo](https://github.com/melezhik/sparrowdo) module to install RVM and Ruby.

# Usage

cli:

```
s6 --module-run Rvm

```

Sparrow6 DSL:

```
# install default RVM and default Ruby version
module-run 'Rvm';

# install specific Ruby version
module_run 'Rvm', %( version => '2.2.0' );

```

## Tested on

* CentOS
* Ubuntu

## 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 'Alexey Melezhik'


## dist_zef-bduggan-Geo-Basic.md
[![Actions Status](https://github.com/bduggan/raku-geo-basic/actions/workflows/linux.yml/badge.svg)](https://github.com/bduggan/raku-geo-basic/actions/workflows/linux.yml)
[![Actions Status](https://github.com/bduggan/raku-geo-basic/actions/workflows/macos.yml/badge.svg)](https://github.com/bduggan/raku-geo-basic/actions/workflows/macos.yml)

# NAME

Geo::Basic - Basic geospatial functions

# SYNOPSIS

```
use Geo::Basic;
my $hash = geohash-encode lat => 51.435, lon => -0.215, precision => 5;
# "gcpue5"

my $decoded = geohash-decode $hash;
# %( lat-max => 51.416016, lat-min => 51.459961,
#    lon-max => -0.219727, lon-min => -0.175781 )

my $neighbors = geohash-neighbors $hash;
# [gcpuek gcpueh gcpudu gcpue7 gcpudg gcpue6 gcpue4 gcpudf]

my $distance-km = haversine-km :lat1(51.435), :lon1(-0.215), :lat2(51.435), :lon2(-0.214);
# 0.06931914818231608

my $distance-mi = haversine-miles :lat1(51.435), :lon1(-0.215), :lat2(51.435), :lon2(-0.214);
# 0.04307292175092216

my $quadkey = latlon-to-quadkey 51.435, -0.215, 8;
my $bounds = quadkey-bounds $quadkey;

```

# DESCRIPTION

These are a few simple utilities for doing geospatial calculations. The following functions are provided:

```
* `geohash-encode` -- encode a latitude and longitude into a geohash
* `geohash-decode` -- decode a geohash into a latitude and longitude
* `geohash-neighbors` -- find the neighbors of a geohash
* `quadkey-encode` -- convert a latitude and longitude to a quadkey
* `quadkey-decode` -- convert a quadkey to lat/lon bounds
* `haversine-km` -- calculate the distance between two points on the earth in kilometers
* `haversine-miles` -- calculate the distance between two points on the earth in miles

```

# FUNCTIONS

### sub geohash-encode

```
sub geohash-encode(
    Rat(Real) :$lat,
    Rat(Real) :$lon,
    Int :$precision = 9
) returns Mu

```

Encode a latitude and longitude into a geohash

### sub geohash-decode

```
sub geohash-decode(
    Str $geo
) returns Hash

```

Decode a geohash into a latitude and longitude

### sub radians

```
sub radians(
    Real $deg
) returns Mu

```

Convert degrees to radians

### sub km-to-miles

```
sub km-to-miles(
    Real $km
) returns Mu

```

Convert kilometers to miles

### sub haversine-miles

```
sub haversine-miles(
    Real :$lat1,
    Real :$lon1,
    Real :$lat2,
    Real :$lon2
) returns Mu

```

Calculate the great circle distance in miles, using the havarsine formula

### sub haversine-km

```
sub haversine-km(
    Real :$lat1,
    Real :$lon1,
    Real :$lat2,
    Real :$lon2
) returns Mu

```

Calculate the great circle distance in kilometers using the havarsine formula

### sub quadkey-decode

```
sub quadkey-decode(
    Str $quadkey
) returns Mu

```

Convert a quadkey to lat/lon bounds

### sub quadkey-encode

```
sub quadkey-encode(
    Numeric :$lat,
    Numeric :$lon,
    Int :$zoom
) returns Mu

```

Convert lat/lon to quadkey

# AUTHOR

Brian Duggan

Original geohash code by Thundergnat on Rosetta Code


## cleanup.md
cleanup

Combined from primary sources listed below.

# [In IO::Path](#___top "go to top of document")[§](#(IO::Path)_method_cleanup "direct link")

See primary documentation
[in context](/type/IO/Path#method_cleanup)
for **method cleanup**.

```raku
method cleanup(IO::Path:D: --> IO::Path:D)
```

Returns a new path that is a canonical representation of the invocant path, cleaning up any extraneous path parts:

```raku
"foo/./././..////bar".IO.cleanup.say;      # OUTPUT: «"foo/../bar".IO␤»
IO::Path::Win32.new("foo/./././..////bar")
    .cleanup.say; "foo\..\bar".IO;         # OUTPUT: «"foo\..\bar".IO␤»
```

Note that no filesystem access is made. See also [`resolve`](/routine/resolve).


## join.md
join

Combined from primary sources listed below.

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

See primary documentation
[in context](/type/Thread#method_join)
for **method join**.

```raku
method join(Thread:D:)
```

Waits for the thread to finish.

# [In IO::Spec::Cygwin](#___top "go to top of document")[§](#(IO::Spec::Cygwin)_method_join "direct link")

See primary documentation
[in context](/type/IO/Spec/Cygwin#method_join)
for **method join**.

```raku
method join(|c)
```

Same as [`IO::Spec::Win32.join`](/type/IO/Spec/Win32#method_join), except replaces backslashes with slashes in the final result.

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

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

```raku
method join($separator = '') is nodal
```

Converts the object to a list by calling [`self.list`](/type/Any#method_list), and calls [`.join`](/type/List#routine_join) on the list. Can take a separator, which is an empty string by default.

```raku
(1..3).join.say;       # OUTPUT: «123␤»
<a b c>.join("❧").put; # OUTPUT: «a❧b❧c␤»
```

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

See primary documentation
[in context](/type/List#routine_join)
for **routine join**.

```raku
sub    join($separator, *@list)
method join(List:D: $separator = "")
```

Treats the elements of the list as strings by calling [`.Str`](/type/Mu#method_Str) on each of them, interleaves them with `$separator` and concatenates everything into a single string.

Example:

```raku
say join ', ', <a b c>;             # OUTPUT: «a, b, c␤»
```

The method form also allows you to omit the separator:

```raku
say <a b c>.join;               # OUTPUT: «abc␤»
```

Note that the method form does not flatten sublists:

```raku
say (1, <a b c>).join('|');     # OUTPUT: «1|a b c␤»
```

The subroutine form behaves slurpily, flattening all arguments after the first into a single list:

```raku
say join '|', 1, <a b c>;       # OUTPUT: «1|a|b|c␤»
```

In this case, the list `<a b c>` is *slurped* and flattened, unlike what happens when `join` is invoked as a method.

If one of the elements of the list happens to be a [`Junction`](/type/Junction), then `join` will also return a [`Junction`](/type/Junction) with concatenation done as much as possible:

```raku
say ("a"|"b","c","d").join;     # OUTPUT: «any(acd,bcd)␤»
```

# [In IO::Spec::Unix](#___top "go to top of document")[§](#(IO::Spec::Unix)_method_join "direct link")

See primary documentation
[in context](/type/IO/Spec/Unix#method_join)
for **method join**.

```raku
method join ($, Str:D $dir, Str:D $file --> Str:D)
```

Similar to [`catpath`](/routine/catpath), takes two path fragments and concatenates them, adding or removing a path separator, if necessary, except it will return just `$file` if both `$dir` and `$file` are string `'/'` or if `$dir` is the string `'.'`. The first argument is ignored (it exists to maintain consistent interface with other [`IO::Spec`](/type/IO/Spec) types for systems that have volumes).

```raku
IO::Spec::Unix.join($, 'foo', 'bar').say; # OUTPUT: «foo/bar␤»
IO::Spec::Unix.join($, '/', '/').say;     # OUTPUT: «/␤»
IO::Spec::Unix.join($, '.', 'foo').say;   # OUTPUT: «foo␤»
say $*SPEC.join(True,".","/foo");         # OUTPUT: «/foo␤»
```

# [In IO::Spec::Win32](#___top "go to top of document")[§](#(IO::Spec::Win32)_method_join "direct link")

See primary documentation
[in context](/type/IO/Spec/Win32#method_join)
for **method join**.

```raku
method join (Str:D $volume, Str:D $dir, Str:D $file --> Str:D)
```

Similar to [`catpath`](/routine/catpath), takes two path fragments and concatenates them, adding or removing a path separator, if necessary, except it will return just `$file` if both `$dir` and `$file` are string `'/'` or if `$dir` is the string `'.'`. The first argument is ignored (it exists to maintain consistent interface with other [`IO::Spec`](/type/IO/Spec) types for systems that have volumes).

```raku
IO::Spec::Win32.join('C:', '/some/dir', 'foo.txt').say;
# OUTPUT: «C:/some/dir\and/more␤»

IO::Spec::Win32.join('C:', '.', 'foo.txt').say;
# OUTPUT: «C:foo.txt␤»

IO::Spec::Win32.join('C:', ｢\｣, '/').say;
# OUTPUT: «C:\␤»

IO::Spec::Win32.join('//server/share', ｢\｣, '/').say;
# OUTPUT: «//server/share␤»

IO::Spec::Win32.join('E:', '', 'foo.txt').say;
# OUTPUT: «E:foo.txt␤»
```


## dist_cpan-TADZIK-Acme-Meow.md
```
This is a Perl 6 port of Perl 5's Acme::Meow [1]

It's not a verbatim port. Some things have changed,
and there is more to come. Stay tuned for more fun :)

[1] http://metacpan.org/pod/Acme::Meow

```


## dist_github-tokuhirom-Cookie-Baker.md
[![Build Status](https://travis-ci.org/tokuhirom/p6-Cookie-Baker.svg?branch=master)](https://travis-ci.org/tokuhirom/p6-Cookie-Baker)

# NAME

Cookie::Baker - Cookie string generator / parser

# SYNOPSIS

```
use Cookie::Baker;

$headers.push_header('Set-Cookie' => bake-cookie($key, $val));

my $cookies_hashref = crush-cookie($headers.header('Cookie'));

```

# DESCRIPTION

Cookie::Baker provides simple cookie string generator and parser.

# FUNCTIONS

* bake-cookie

  my $cookie = bake-cookie('foo','val');
  my $cookie = bake-cookie(
  'foo', 'val',
  path => "test",
  domain => '.example.com',
  expires => '+24h'
  );

Generates a cookie string for an HTTP response header. The first argument is the cookie's name and the second argument is a plain string or hash reference that can contain keys such as `value`, `domain`, `expires`, `path`, `httponly`, `secure`, `max-age`.

* value

Cookie's value

* domain

Cookie's domain.

* expires

Cookie's expires date time. Several formats are supported

```
expires => time + 24 * 60 * 60 # epoch time
expires => 'Wed, 03-Nov-2010 20:54:16 GMT'
expires => '+30s' # 30 seconds from now
expires => '+10m' # ten minutes from now
expires => '+1h'  # one hour from now
expires => '-1d'  # yesterday (i.e. "ASAP!")
expires => '+3M'  # in three months
expires => '+10y' # in ten years time
expires => 'now'  #immediately

```

* path

Cookie's path.

* httponly

If true, sets HttpOnly flag. false by default.

* secure

If true, sets secure flag. false by default.

* crush-cookie

Parses cookie string and returns a hashref.

```
my %cookies_hashref = crush-cookie($headers.header('Cookie'));
my $cookie_value = %cookies_hashref<cookie_name>;

```

# AUTHOR

Tokuhiro Matsuno [lttokuhirom@gmail.comgt](mailto:lttokuhirom@gmail.comgt).

And original perl5 code is written by:

Masahiro Nagano [ltkazeburo@gmail.comgt](mailto:ltkazeburo@gmail.comgt)

# COPYRIGHT AND LICENSE

Perl6 port is:

```
Copyright 2015 Tokuhiro Matsuno <tokuhirom@gmail.com>

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

```

Original Perl5 code is:

```
Copyright (C) Masahiro Nagano.

This library is free software; you can redistribute it and/or modify
it under the same terms as Perl itself.

```


## dist_github-FCO-Punnable.md
[![Build Status](https://travis-ci.org/FCO/Punnable.svg?branch=master)](https://travis-ci.org/FCO/Punnable)

## Usage

```
$ perl6 -Ilib -MPunnable -e 'role R {method r {...}}; make-punnable(R); my $or = R.new; say $or; $or.r'
R.new
Stub code executed
  in block <unit> at -e line 1

Actually thrown at:
  in block <unit> at -e line 1

```


## dist_zef-thundergnat-SDL2-ttf.md
[![Actions Status](https://github.com/thundergnat/SDL2-ttf/actions/workflows/test.yml/badge.svg)](https://github.com/thundergnat/SDL2-ttf/actions)

# NAME

SDL2-ttf - FreeType interface to render text in SDL2

# SYNOPSIS

```
use SDL2::Raw;
use SDL2-ttf;

# initialize
TTF_Init();

# set a render color
my $color = TTF_Color(255, 28, 174); # Pink

# select a font file
my $font-file = '/path/to/font/my_Font.ttf';

# open it at a certain point size (May be scaled later by SDL2)
my $font = TTF_OpenFont($font-file, 64);

# render text using the selected font and color as a SDL2 texture
my $raku = SDL_CreateTextureFromSurface(
    SDL_CreateRenderer(), TTF_Render_Blended($font, ' Raku ', $color)
);

# Clean up afterwords
TTF_CloseFont($font);
TTF_Quit();

```

The `$raku` variable now contains a rendered texture that may be used in SDL2.

# DESCRIPTION

Provides a convenient interface to FreeType to assist in loading and using TrueType fonts as rendering textures in SDL2.

Needs to have the libsdl2-dev and libsdl2-ttf-dev development libraries installed.

On Debian derived distributions:

```
sudo apt-get install libsdl2-dev libsdl2-ttf-dev

```

Similar for others.

Documentation for the SDL2\_ttf library, which works very similar to, but not exactly the same as these bindings: <https://www.libsdl.org/projects/SDL_ttf/docs/index.html>

Several routines are called slightly differently, and many are not exposed at due to the different requirements and capabilities of the Raku runtime and the C library.

Try out the `ttftest.p6` script in the examples folder to get a feel for how it can be used.

### Enumerations

There are a few enumerations provided.

###

**TTF\_STYLE** - The various font styles that may be available and/or specified:

TTF\_STYLE

| Name | value |
| --- | --- |
| STYLE\_NORMAL | 0 |
| STYLE\_BOLD | 1 |
| STYLE\_ITALIC | 2 |
| STYLE\_UNDERLINE | 4 |
| STYLE\_STRIKETHROUGH | 8 |

###

**TTF\_HINTING** - The various font hints that may be available and/or specified:

TTF\_HINTING

| Name | value |
| --- | --- |
| HINT\_NORMAL | 0 |
| HINT\_LIGHT | 1 |
| HINT\_MONO | 2 |
| HINT\_NONE | 3 |

## Subroutines:

#### General

* [TTF\_Init](#TTF_Init)
* [TTF\_WasInit](#TTF_WasInit)
* [TTF\_Quit](#TTF_Quit)
* [TTF\_GetError](#TTF_GetError)
* [TTF\_OpenFont](#TTF_OpenFont)
* [TTF\_OpenFontIndex](#TTF_OpenFontIndex)
* [TTF\_CloseFont](#TTF_CloseFont)

#### Attributes

* [TTF\_GetFontStyle](#TTF_GetFontStyle)
* [TTF\_GetFontStyles](#TTF_GetFontStyles)
* [TTF\_SetFontStyle](#TTF_SetFontStyle)
* [TTF\_GetFontOutline](#TTF_GetFontOutline)
* [TTF\_SetFontOutline](#TTF_SetFontOutline)
* [TTF\_GetFontHinting](#TTF_GetFontHinting)
* [TTF\_SetFontHinting](#TTF_SetFontHinting)
* [TTF\_GetFontKerning](#TTF_GetFontKerning)
* [TTF\_SetFontKerning](#TTF_SetFontKerning)
* [TTF\_FontHeight](#TTF_FontHeight)
* [TTF\_FontAscent](#TTF_FontAscent)
* [TTF\_FontDescent](#TTF_FontDescent)
* [TTF\_FontLineSkip](#TTF_FontLineSkip)
* [TTF\_FontFaces](#TTF_FontFaces)
* [TTF\_FontFaceIsFixedWidth](#TTF_FontFaceIsFixedWidth)
* [TTF\_FontFaceFamilyName](#TTF_FontFaceFamilyName)
* [TTF\_FontFaceStyleName](#TTF_FontFaceStyleName)
* [TTF\_GlyphIsProvided](#TTF_GlyphIsProvided)
* [TTF\_GlyphMetrics](#TTF_GlyphMetrics)
* [TTF\_GetTextSize](#TTF_GetTextSize)

#### Rendering

* [TTF\_Color](#TTF_Color)
* [TTF\_Render\_Solid](#TTF_Render_Solid)
* [TTF\_Render\_Shaded](#TTF_Render_Shaded)
* [TTF\_Render\_Blended](#TTF_Render_Blended)
* [TTF\_Render\_Blended\_Wrapped](#TTF_Render_Blended_Wrapped)

### Rendering modes

* Solid - Quick and Dirty

  * Create an 8-bit palettized surface and render the given text at fast quality with the given font and color. The pixel value of 0 is the colorkey, giving a transparent background when blitted. Pixel and colormap value 1 is set to the text foreground color. This results in no box around the text, but the text is not as smooth.
* Shaded - Slow and Nice, but with a Solid Box

  * Create an 8-bit palettized surface and render the given text at high quality with the given font and colors. The 0 pixel value is background, while other pixels have varying degrees of the foreground color from the background color. This results in a box of the background color around the text in the foreground color. The text is antialiased. This will render slower than Solid, but in about the same time as Blended mode.
* Blended - Slow Slow Slow, but Ultra Nice over another image

  * Create a 32-bit ARGB surface and render the given text at high quality, using alpha blending to dither the font with the given color. This results in a surface with alpha transparency, so you don’t have a solid colored box around the text. The text is antialiased. This will render slower than Solid, but in about the same time as Shaded mode. Use this when you want high quality, and the text isn’t changing too fast.

  ---

### `TTF_Init()`

* Initialize the truetype font API.
* Must be called before using other functions in this library, except TTF\_WasInit or TTF\_Color.
* SDL does not have to be initialized before this call.
* Takes: Nothing.
* Returns: 0 on success, -1 on any error

### `TTF_WasInit`

* Query the initilization status of the truetype font API.
* Takes: Nothing.
* Returns: 1 if already initialized, 0 if not initialized.

### `TTF_Quit`

* Shutdown and cleanup the truetype font API.
* Takes: Nothing.
* Returns: Nothing.

### `TTF_GetError`

* Returns the last error set as a string.
* Takes: Nothing
* Returns: String.

### `TTF_OpenFont($file, $ptsize)`

* Load file for use as a font, at ptsize size.
* Takes:

  * $file - File name to load font from.
  * $ptsize - Point size (based on 72DPI) to load font as. Basically pixel height.
* Returns: Pointer to the font as a TTF\_Font. NULL is returned on error.

### `TTF_OpenFontIndex($file, $ptsize, $index)`

* Load file for use as a font, at ptsize size, selecting $index face.
* Takes:

  * $file - File name to load font from.
  * $ptsize - Point size (based on 72DPI) to load font as. Basically pixel height.
  * $index - Choose a font face from a file containing multiple font faces. The first face is always index 0.
* Returns: Pointer to the font as a TTF\_Font. NULL is returned on error.

### `TTF_CloseFont($font)`

* Free the memory used by font, and free font itself as well.
* Takes: $font - Pointer to loaded font.
* Returns: Nothing.

### `TTF_GetFontStyle($font)`

* Get the rendering style of the loaded font.
* Takes: $font - Pointer to loaded font.
* Returns: The bitwise or of the set styles codes. See [the TTF\_STYLE ENUM](#TTF_STYLE)

### `TTF_GetFontStyles($font)`

* Get the rendering style of the loaded font, enumerated list.
* Takes: $font - Pointer to loaded font.
* Returns: An enumerated list of the set styles. See [the TTF\_STYLE ENUM](#TTF_STYLE)

### `TTF_SetFontStyle($font, $style)`

* Set the rendering style of the loaded font.
* Takes:

  * $font - Pointer to loaded font.
  * $style - The bitwise or of the desired styles codes. See [the TTF\_STYLE ENUM](#TTF_STYLE)
* Returns: Nothing

### `TTF_GetFontOutline($font)`

* Get the current outline size of the loaded font.
* Takes: $font - Pointer to loaded font.
* Returns: The size of the outline currently set on the font, in pixels.

### `TTF_SetFontOutline($font, $outline)`

* Set the current outline size of the loaded font.
* Takes:

  * $font - Pointer to loaded font.
  * $outline - The size of outline desired, in pixels.
* Returns: Nothing.

### `TTF_GetFontHinting($font)`

* Get the current hinting setting of the loaded font.
* Takes: $font - Pointer to loaded font.
* Returns: The hinting type matching one of the enumerated values. See [the TTF\_HINTING ENUM](#TTF_HINTING)

### `TTF_SetFontHinting($font, $hint)`

* Set the current hinting setting of the loaded font.
* Takes:

  * $font - Pointer to loaded font.
  * $hint - One of the enumerated Hint values. See [the TTF\_HINTING ENUM](#TTF_HINTING)
* Returns: Nothing.

### `TTF_GetFontKerning($font)`

* Get the current kerning setting of the loaded font.
* Takes: $font - Pointer to loaded font.
* Returns: Returns: 0(zero) if kerning is disabled; a non-zero value when enabled.

### `TTF_SetFontKerning($font, $allowed)`

* Set the current hinting setting of the loaded font.
* Takes:

  * $font - Pointer to loaded font.
  * $allowed - 0 to disable kerning; non-zero to enable kerning. The default is 1, enabled.
* Returns: Nothing.

### `TTF_FontHeight($font)`

* Get the maximum pixel height of all glyphs of the loaded font. Minimum size for adjacent rows of text to not overlap.
* Takes: $font - Pointer to loaded font.
* Returns: The maximum pixel height of all glyphs in the font.

### `TTF_FontAscent($font)`

* Get the maximum pixel ascent of all glyphs of the loaded font. - The maximum distance from the baseline to the top.
* Takes: $font - Pointer to loaded font.
* Returns: The maximum pixel ascent of all glyphs in the font.

### `TTF_FontDescent($font)`

* Get the maximum pixel descent of all glyphs of the loaded font. - The maximum distance from the baseline to the bottom.
* Takes: $font - Pointer to loaded font.
* Returns: The maximum pixel descent of all glyphs in the font.

### `TTF_FontLineSkip($font)`

* Get the recommended pixel height of a rendered line of text of the loaded font. - Usually larger than the TTF\_FontHeight of the font.
* Takes: $font - Pointer to loaded font.
* Returns: The maximum pixel height of all glyphs in the font.

### `TTF_FontFaces($font)`

* Get the number of faces ("sub-fonts") available in the loaded font.
* Takes: $font - Pointer to loaded font.
* Returns: The number of faces in the font.

### `TTF_FontFaceIsFixedWidth($font)`

* Test if the current font face of the loaded font is a fixed width font.
* Takes: $font - Pointer to loaded font.
* Returns: >0 if $font is a fixed width font. 0 if not a fixed width font.

### `TTF_FontFaceFamilyName($font)`

* Get the current font face family name from the loaded font.
* Takes: $font - Pointer to loaded font.
* Returns: The current family name of the face of the font, or NULL if not available.

### `TTF_FontFaceStyleName($font)`

* Get the current font face style name from the loaded font.
* Takes: $font - Pointer to loaded font.
* Returns: The current style name of the face of the font, or NULL if not available.

### `TTF_GlyphIsProvided($font, $character or $ordinal)`

* Get the status of the availability of the glyph for $character from the loaded font.
* Takes:

  * $font - Pointer to loaded font.
  * Either: $character - String containing the $character to check for.
  * Or: $ordinal - Integer $ordinal of character.
* Returns: The index of the glyph location in the font for $character, or 0 for an undefined character code. (Note: returns the font file index, NOT the character ordinal.)

### `TTF_GlyphMetrics($font, $character)`

* Get the metrics of the char given in $character from the loaded font.
* Takes:

  * $font - Pointer to loaded font.
  * $character - String containing the character to get metrics for.
* Returns: A hash containing the following information:

  * :font(TTF\_FontFaceFamilyName($font)) - The Family Face name
  * :style(TTF\_FontFaceStyleName($font)) - The style
  * :char($character) - The character checked
  * :$min-x - The minimum X offset into the character.
  * :$max-x - The maximum X offset into the character.
  * :$min-y - The minimum Y offset into the character.
  * :$max-y - The maximum Y offset into the character.
  * :$advance - The distance from the end of the previous glyph to the start of the next.

Glyph Metrics explained: (image copyright libsdl.org)

![Font Metrics](https://www.libsdl.org/projects/SDL_ttf/docs/metrics.png "Glyph metrics")

### `TTF_GetTextSize($font, $text)`

* Get the width and height in pixels of the given text in the currently loaded font.
* Takes:

  * $font - Pointer to loaded font.
  * $text - Text string to get the dimensions.
* Returns: A list of Pairs

  * :width(width)
  * :height(height)

### `TTF_Color($red, $green, $blue, $alpha = 255)`

* Generate a packed ARGB TTF\_color suitable to pass to the rendering routines.
* Takes:

  * $red - 0-255 integer value for red.
  * $green - 0-255 integer value for green.
  * $blue - 0-255 integer value for blue.
  * $alpha - 0-255 integer value for alpha. Optional, default 255
* Returns: The packed TTF\_Color.

### `TTF_Render_Solid($font, $text, $fg)`

* Render the passed $text using $font with $fg color onto a new surface, using Solid mode.
* Takes:

  * $font - Pointer to loaded font.
  * $text - Text string to render.
  * $fg - TTF\_Color to use as the foreground color.
* Returns: A pointer to a new SDL Surface.

### `TTF_Render_Shaded($font, $text, $fg, $bg)`

* Render the passed $text using $font with $fg color onto a new $bg colored surface, using Shaded mode.
* Takes:

  * $font - Pointer to loaded font.
  * $text - Text string to render.
  * $fg - TTF\_Color to use as the foreground color.
  * $bg - TTF\_Color to use as the background color.
* Returns: A pointer to a new SDL Surface.

### `TTF_Render_Blended($font, $text, $fg)`

* Render the passed $text using $font with $fg color onto a new surface, using Blended mode.
* Takes:

  * $font - Pointer to loaded font.
  * $text - Text string to render.
  * $fg - TTF\_Color to use as the foreground color.
* Returns: A pointer to a new SDL Surface.

### `TTF_Render_Blended_Wrapped($font, $text, $fg, $length)`

* A convenience routine to render wrapped text, in Blended mode.
* Takes:

  * $font - Pointer to loaded font.
  * $text - Text string to render.
  * $fg - TTF\_Color to use as the foreground color.
  * $length - Length in pixels to use as a wrap threshold.
* Returns: A pointer to a new SDL Surface.

# AUTHOR

SDL2\_ttf library: Sam Lantinga

Raku bindings: Steve Schulze (thundergnat)

# COPYRIGHT AND LICENSE

Copyright 2020 Steve Schulze (thundergnat)

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


## dist_github-sirrobert-Semantic-Versioning.md
# Semantic Versioning

## Overview

Allows an object to take on versioning attributes in accordance with [the
Semantic Versioning specification (2.0.0)](http://semver.org/). The module
provides a class and a role.

## Role: does Semantic::Versioning

The `Semantic::Versioning` role enables any object to be versioned. Four
properties are added: `.version`, `.major-version`, `.minor-version`, and
`.patch-version`.

### Example use

```

class Document does Semantic::Versioning { }

my $doc = Document.new;
$doc.version = '1.6.23';
say $doc.major-version; #  1
say $doc.minor-version; #  6
say $doc.patch-version; # 23

$doc.minor-version = 7;
say $doc.version; # '1.7.23';

```

## Class: has Semantic::Version

The class version allows for multiple versioning attributes in an object.

### Example use

```
class Document {
  has Semantic::Version $.described-in;
  has Semantic::Version $.planned-for;
  has Semantic::Version $.implemented-in;
}

my $doc = Document.new;
$doc.described-in.version = '1.6.23';
say $doc.described-in.major-version; #  1
say $doc.described-in.minor-version; #  6
say $doc.described-in.patch-version; # 23

$doc.planned-for.version = '2.0.0';
$doc.implemented-in.version = '2.0.0';

# Woops, made a mistake-- got implemented in the next minor version;
$doc.implemented-in.minor-version++;
say $doc.implemented-in; # '2.1.0';

```


## dist_cpan-JNTHN-Cro-Core.md
# Cro::Core Build Status

This is part of the Cro libraries for implementing services and distributed
systems in Raku. See the [Cro website](http://cro.services/) for further
information and documentation.


## dist_cpan-TYIL-Log-Simple.md
## class Log::Simple

A simple implementation of Log.

### has Positional @!outputs

An array of hashes. Each has must have a handle key, with an IO::Handle to print messages to. A level key with an integer to signify a Log::Level is also required.

### has Supplier $!messages

A supplier to emit messages to.

### has Bool $.hostname

When enabled, include hostname in the log message. This can be useful when running the application redundantly in a cluster with centralized logging.

### multi method emergency

```
multi method emergency(
    Str:D $message
) returns Mu

```

Send an emergency message.

## class Str:D $message

The message to print.

### multi method emergency

```
multi method emergency(
    Str:D $format,
    *@args
) returns Mu

```

Send a formatted emergency message.

## class Str:D $format

A printf-style format string.

## class \*@args

Arguments to substitute into the format string placeholders.

### multi method alert

```
multi method alert(
    Str:D $message
) returns Mu

```

Send an alert message.

## class Str:D $message

The message to print.

### multi method alert

```
multi method alert(
    Str:D $format,
    *@args
) returns Mu

```

Send a formatted alert message.

## class Str:D $format

A printf-style format string.

## class \*@args

Arguments to substitute into the format string placeholders.

### multi method critical

```
multi method critical(
    Str:D $message
) returns Mu

```

Send a critical message.

## class Str:D $message

The message to print.

### multi method critical

```
multi method critical(
    Str:D $format,
    *@args
) returns Mu

```

Send a formatted critical message.

## class Str:D $format

A printf-style format string.

## class \*@args

Arguments to substitute into the format string placeholders.

### multi method error

```
multi method error(
    Str:D $message
) returns Mu

```

Send an error message.

## class Str:D $message

The message to print.

### multi method error

```
multi method error(
    Str:D $format,
    *@args
) returns Mu

```

Send a formatted error message.

## class Str:D $format

A printf-style format string.

## class \*@args

Arguments to substitute into the format string placeholders.

### multi method warning

```
multi method warning(
    Str:D $message
) returns Mu

```

Send a warning message.

## class Str:D $message

The message to print.

### multi method warning

```
multi method warning(
    Str:D $format,
    *@args
) returns Mu

```

Send a formatted warning message.

## class Str:D $format

A printf-style format string.

## class \*@args

Arguments to substitute into the format string placeholders.

### multi method notice

```
multi method notice(
    Str:D $message
) returns Mu

```

Send a notice message. This is the "normal" level to publish log entries on.

## class Str:D $message

The message to print.

### multi method notice

```
multi method notice(
    Str:D $format,
    *@args
) returns Mu

```

Send a formatted notice message. This is the "normal" level to publish log entries on.

## class Str:D $format

A printf-style format string.

## class \*@args

Arguments to substitute into the format string placeholders.

### multi method info

```
multi method info(
    Str:D $message
) returns Mu

```

Send an informational message.

## class Str:D $message

The message to print.

### multi method info

```
multi method info(
    Str:D $format,
    *@args
) returns Mu

```

Send a formatted informational message.

## class Str:D $format

The printf-style format string.

## class \*@args

Arguments to substitute into the format string placeholders.

### multi method debug

```
multi method debug(
    Str:D $message
) returns Mu

```

Send a debug message.

## class Str:D $message

The message to print.

### multi method debug

```
multi method debug(
    Str:D $format,
    *@args
) returns Mu

```

Send a formatted debug message.

## class Str:D $format

A printf-style format string.

## class \*@args

Arguments to substitute into the format string placeholders.

### multi method add-output

```
multi method add-output(
    IO::Handle:D $handle,
    $level where { ... },
    Callable :$filter
) returns Mu

```

Add an output to the logger.

## class IO::Handle:D $handle

The IO::Handle to write log messages to.

## class $level where { ... }

The log level for this particular stream.

## class Callable :$filter

A filter function to apply to any messages sent to the output.

### method callee

```
method callee(
    Int:D $depth = 3
) returns Str

```

Convenience method to get the callee name. This is the package name if one exists, or the source file name.

## class Int:D $depth = 3

The depth of which to get the callframe.

### method message

```
method message(
    Str:D $level,
    Str:D $message
) returns Str

```

Convenience method for formatting the message as desired.

## class Str:D $level

A human readable identifier for the level.

## class Str:D $message

The original message to be logged.

# NAME

Log::Simple

# VERSION

0.1.1

# AUTHOR

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

# LICENSE

Copyright © 2020

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

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

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


## dist_zef-tbrowder-PDF-Combiner.md
[![Actions Status](https://github.com/tbrowder/PDF-Combiner/actions/workflows/linux.yml/badge.svg)](https://github.com/tbrowder/PDF-Combiner/actions) [![Actions Status](https://github.com/tbrowder/PDF-Combiner/actions/workflows/macos.yml/badge.svg)](https://github.com/tbrowder/PDF-Combiner/actions) [![Actions Status](https://github.com/tbrowder/PDF-Combiner/actions/workflows/windows.yml/badge.svg)](https://github.com/tbrowder/PDF-Combiner/actions)

# NAME

**PDF::Combiner** - Provides routines and a program to combine and title PDF documents

# SYNOPSIS

```
use PDF::Combiner;
combine-pdfs config=our-israel-tour.txt

```

# Installation requirements

**PDF::Combiner** requires the system binary program, `ps2pdf`, in order to compress PDF files. To install it on a Debian system, execute:

```
sudo apt-get install ps2pdf

```

To compress any PDF execute:

```
ps2pdf -dPDFSETTINGS=/ebook large.pdf smaller.pdf # 150 dpi

ps2pdf -dPDFSETTINGS=/printer large.pdf smaller.pdf # 300 dpi

```

A 78 Mb combined PDF compressed to the following sizes:

* with '-dPDFSETTINGS=/ebook': 2.9 Mb
* with '-dPDFSETTINGS=/printer': 15 Mb

I could not see any differences in one printed page, but your results may vary. Choose output file compresion on the command line. You may also set it in your project configuration file.

# DESCRIPTION

**PDF::Combiner** is a simple but useful tool to combine PDF documents into a single PDF document.

In the example above, **our-israel-tour.txt** is a simple formatted text file containing several types of lines. See the example project `config` files in directory `/example-project` for usable examples of the input file.

Note the PDF files are expected to be in the same directory as the project file. If that is a problem for your use case, please file an issue.

# `config` file

The configuration (or project) file is a typical text file with data in single-line format for most options or in blocks of text. Its suffix is not specified, but the example files have extensions of `.txt` (the author's preference). Options are entered in a format taken from Rakudoc: `=option-name value....` or `=begin option-name`...`=end option-name`..

Blank lines are ignored (except in text blocks) and comments on a line begin at the first `#` character and continue to the end of the line.

Note comments in a text block resulting in a blank line will result in that blank line being retained in the block.

## Options

* `=begin title`...`=end title`

  The lines between the begin/end options are used to populate a cover with the first line being the title and the following lines shown below it after some blank lines.

  Note no cover is produced without this text block, nor is any cover produced if **all** lines are blank.
* `=numbers` value?

  The 'value' is optional. Without it, the result is `True` if the option alone is present. If the option is **not** present, the result is `False`. If the 'value' is present, it is evaluated for truthiness.

  A true value currently produces page numbers on each page (except any cover which is number one but not shown); format: 'Page N of M'.
* `=two-sided` value?

  The 'value' is optional. Without it, the result is `True` if the option alone is present. If the option is **not** present, the result is `False`. If the 'value' is present, it is evaluated for truthiness.
* `=back` value?

  The 'value' is optional. Without it, the result is `True` if the option alone is present. If the option is **not** present, the result is `False`. If the 'value' is present, it is evaluated for truthiness.
* `=outfile` value!

  The option and 'value' are required.

  'value' is the file name of the new document which should have no spaces and have a suffix of `.pdf`.
* `=paper` value!

  The option is **not** required. But if it is used, then 'value' is required.

  'value' defines the paper size. Current choices are 'Letter' or 'A4'. If the option is not used, the default size is 'Letter'.
* `=zip` value!

  The option is **not** required. But if it is used, then 'value' is required.

  'value' defines the compression level for the output file. It **must** be either '150' or '300' (dots per inch). It is very useful for PDFs generated from scans. The '150' DPI approximates the density of an ebook while '300' DPI approximates the output from a printer.

# Possible additional options

* `=begin introduction`...`=end introduction`

# CREDITS

Thanks to prolific Raku module distribution author David Warring for his wonderful PDF project (<https://github.com/pdf-raku>) and especially for his example of how to combine PDF files into one.

# AUTHOR

Tom Browder [tbrowder@acm.org](mailto:tbrowder@acm.org)

# COPYRIGHT AND LICENSE

© 2022-2023 Tom Browder

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