text:
# Advanced-sheet-handler

Advanced-sheet is a web-component that was developped using Stencil (v0.6.1), a web-component compiler developped by the ionic team.
You can find a link to know how to do some [here](https://stenciljs.com/)

## Getting Started

To install this web-component just run

```bash

npm install advanced-sheet-handler

```

## Example of use

In your HTML file, place the script reference inside your header in order to be able to use this package. NB: The font-awesome link is currently necessary if you want to see the spinner during your search.

```html

<head>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/font-awesome/4.7.0/css/font-awesome.min.css">
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.7/css/bootstrap.min.css" crossorigin="anonymous">
  <script src='modules/advanced-sheet-handler/dist/advanced-sheet-handler.js'></script>
</head>

```

Then you can paste this anywhere in your code where a HTML element can be placed:

```html

<advanced-sheet-handler nglview max_window = 3 max_char=30></advanced-sheet-handler>

```

## Accessible events and properties

Some properties and methods are provided. More will probably be added in the future

### Properties

#### .data

The data property is the main entry point to the component. The component include another component named "advanced-sheet" that has this data property. Your data must be provided in this particular format:

```javascript

{"data":[{"_id":"something","key2": "example", "key3": "example2"}]}

```

"data" and "\_id" are mandatory parameters
The data format will be improved in a next release

#### .pdbFile

By modifying the advanced-sheet pdbFile property you can see your molecule thanks to ngl. This property must be a string (representing the url to your pdb file)

#### nglview

When adding this property inside the html element, allow the component to make a ngl representation of the .pdbFile that was passed to the component

#### max_window

With this property you can define the number of tab you want to see at the same time. If the number of tab is larger than the total number of tab, arrows will appear allowing to navigate inside the tab that are shown and the tab that are hidden. By defalut, this property equals 3.

#### max_char

This property allows to choose a maximum number of characters inside a row of the data's table. If this value is exceeded, the row will be shortened with the max_char first characters and "..." after them. If you then hover your mouse on the shortened row, a tooltip with the complete row will appear.

### Events

Once the advanced-sheet is loaded, the event sheetLoaded is emitted. Once it is emited, you can pass data to the advanced-sheet component earlier.
During developpement we used it like this:

```html

<script>

	document.addEventListener('sheetLoaded',function(){
		let sheet = document.getElementsByTagName('advanced-sheet')[0];
    	sheet.data = {"data":[{"_id":"little_bird", "name": "titi", "color":"yellow"}]};
	})

</script>

```

## Release notes

v0.0.1 -> v0.0.2

Prototype of the advanced-sheet-handler component

v0.0.3 -> v0.0.4

Component compatible with bootstrap version 3.3.7

v0.1.0

ngl dependency added, we can see view pdb files by modifying the .pdbFile property.

v0.1.1

try to allow to have multiple ngl view

v0.2.0

nglview property added
Now there is only one ngl view that is updated when switching sheet.

v0.2.1

better rendering with bootstrap

v0.3.0

A message is now appearing when a pdbfile is not available. The rendering should be better than in previous version.

v0.4.0

New functionnality : it is now possible to delete a sheet we don't want to have anymore

v0.5.0

New functionnality : it is now possible to choose a number of window that must be shown at the same time. You can do it with the parameter max_window.
When the number of windows go over this limit, old windows are hidden and arrows are displayed in order to navigate into all the windows.

v0.6.0

Addition of max_char property and the tooltip appearing when needed

repository: SebDelSab/advanced-sheet

repo_name: SebDelSab/advanced-sheet


text:
## Overview

[![Build Status][travis-ci-badge]][travis-ci-page]
[![Coverage Status][coveralls-badge]][coveralls-page]

[travis-ci-badge]: https://travis-ci.org/tarantool/graphql.svg?branch=master
[travis-ci-page]: https://travis-ci.org/tarantool/graphql
[coveralls-badge]: https://coveralls.io/repos/github/tarantool/graphql/badge.svg?branch=master
[coveralls-page]: https://coveralls.io/github/tarantool/graphql?branch=master

Set of adapters for GraphQL query language to the Tarantool data model. Based
on [graphql-lua](https://github.com/bjornbytes/graphql-lua).

The library split to the two parts: GraphQL parser/executor and data accessors.
The GraphQL part defines possible shapes of queries and implements abstract
query executor, but data accessors implement fetching of objects.

[API documentation][apidoc].

[apidoc]: https://tarantool.github.io/graphql/

### GraphQL part

The GraphQL part operates on *collections* of *objects*. Each collection stored
set of object of specific type. Collections are linked between using
*connections* in order to implement JOINs (looks like nesting one object to
another in a GraphQL query result).

Object types abstracted away from how it stored in database and described using
avro-schema format. Each collection is described using avro schema name and set
of connections, which holds names of source and destination fields must be
equal in linked objects.

A shape of a query is following. Top-level fields are named as collections.
Nested fields named by a connection name.

GraphQL provides facility to filter objects using arguments. Top-level objects
have set of arguments that match fields set (except nested ones derived from
connections). Nested fields (which derived from connections) have arguments set
defined by a data accessor, typically they are support filtering and
pagination.

Nested fields have object type or list of objects type depending of
corresponding connection type: 1:1 or 1:N.

### Data accessor part

Data accessor defines how objects are stored and how connections are
implemented, also it defines set of arguments for connections. So, data
accessors operates on avro schemas, collections and service fields to fetch
objects and connections and indexes to implement JOINing (nesting).

Note: service fields is metadata of an object that is stored, but is not part
of the object.

Currently only *space* data accessor is implemented. It allows to execute
GraphQL queries on data from the local Tarantool's storage called spaces.

It is planned to implement another data accessor that allows to fetch objects
sharded using tarantool/shard module.

### Notes on types

User should distinguish between Object and Map types. Both of them consists of
keys and values but there are some important differences.

While Object is a GraphQL built-in type, Map is a scalar-based type. In case of
Object-based type all key-value pairs are set during type definition and values
may have different types (as defined in the schema).

In contrast, set of valid Map keys is not defined in the schema, any key-value
pair is valid despite name of the key while value has schema-determined type
(which is the same among all values in the map).

Map-based types should be queried as a scalar type, not as an object type
(because map's keys are not part of the schema).

The following example works:

```
{
    …
    map_based_type
    …
}
```

The following example doesn't work:

```
{
    …
    map_based_type {
        key_1
    }
    …
}
```

## Usage

There are two ways to use the lib.
1) Create an instance and use it (detailed examples may be found in /test):
```
local graphql = require('graphql').new({
    schemas = schemas,
    collections = collections,
    accessor = accessor,
    service_fields = service_fields,
    indexes = indexes
})

local query = [[
    query user($user_id: String) {
        user_collection(user_id: $user_id) {
            user_id
            name
        }
    }
]]

local compiled_query = graphql:compile(query)
local variables = {user_id = 'user_id_1'}
local result = compiled_query:execute(variables)
```
2) Use the lib itself (it will create a default instance underhood. As no
avro-schema is given, GraphQL schemas will be generated from results
box.space.some_space:format()):
```
local graphql_lib = require('graphql')
-- considering the same query and variables

local compiled_query = graphql_lib.compile(query)
local result = compiled_query:execute(variables)
```

### Shard

One need to call `require('graphql.storage').init()` on each storage server to
use graphql with shard and BFS executor. Alternatively one can use
`graphql.new({..., use_bfs_executor = 'never'})` on a frontend server.

### Multi-head connections
A parent object is matching against a multi-head connection variants in the
order of the variants. The parent object should match with a determinant of
at least one variant except the following case. When source fields of all
variants are null the multi-head connection obligated to give null object as
the result. In this case the parent object is allowed to don’t match any variant.
One can use this feature to avoid to set any specific determinant value when a
multi-head connection is known to have no connected object.

### Mutations

#### Mutations with space accessor

TBD: Describe which changes are transactional and which views are guaranteed to
be consistent.

#### Mutations with shard accessor

Mutations are disabled in the resharding state of a shard cluster.

There are three types of modifications: insert, update and delete. Several
modifications are allowed in one GraphQL request, but they will be processed in
non-transactional way.

In the case of shard accessor the following constraints can guarantee that data
will be changed in atomic way or, in other words, in one shard request (but
foregoing and upcoming selects can see other data):

* One insert / update / delete argument over the entire GraphQL request.
* For update / delete: either the argument is for 1:1 connection or `limit: 1`
  is used for a collection (a upmost field) or 1:N connection (a nested
  field).
* No update of a first field of a **tuple** (shard key is calculated by it). It
  is the first field of upmost record in the schema for a collection in case
  when there are no service fields. If there are service fields, the first
  field of a tuple cannot be changed by a mutation GraphQL request.

Data can be changed between shard requests which are part of one GraphQL
request, so the result can observe inconsistent state. We'll don't show all
possible cases, but give an idea what going on in the following paragraph.

Filters are applied for an object(s) (several requests in case of filters by
connections, one request otherwise), then each object updated/deleted by its
primary key (one request per object), then all connected objects are resolved
in the same way.

#### Insert

Example with an object passed from a variable:

```
mutation insert_user_and_order($user: user_collection_insert,
        $order: order_collection_insert) {
    user_collection(insert: $user) {
        user_id
        first_name
        last_name
    }
    order_collection(insert: $order) {
        order_id
        description
        in_stock
    }
}
```

Example with immediate argument for an object:

```
mutation insert_user_and_order {
    user_collection(insert: {
        user_id: "user_id_new_1"
        first_name: "Peter"
        last_name: "Petrov"
    }) {
        user_id
        first_name
        last_name
    }
    order_collection(insert: {
        order_id: "order_id_new_1"
        user_id: "user_id_new_1"
        description: "Peter's order"
        price: 0.0
        discount: 0.0
        # in_stock: true should be set as default value
    }) {
        order_id
        description
        in_stock
    }
}
```

Consider the following details:

* `${collection_name}_insert` is the name of the type whose value intended to
  pass to the `insert` argument. This type / argument requires a user to set
  all fields of an inserting object.
* Inserting cannot be used on connection fields, it is allowed only for
  top-level fields (named as well as collections).
* It is forbidden to use `insert` argument with any other argument.
* A mutation with an `insert` argument always return the object that was just
  inserted.
* Of course `insert` argument is forbidden in `query` requests.

#### Update

Example with an update statement passed from a variable. Note that here we
update an object given by a connection (inside one of nested fields of a
request):

```
mutation update_user_and_order(
    $user_id: String
    $order_id: String
    $xuser: user_collection_update
    $xorder: order_collection_update
) {
    # update nested user
    order_collection(order_id: $order_id) {
        order_id
        description
        user_connection(update: $xuser) {
            user_id
            first_name
            last_name
        }
    }
    # update nested order (only the first, because of limit)
    user_collection(user_id: $user_id) {
        user_id
        first_name
        last_name
        order_connection(limit: 1, update: $xorder) {
            order_id
            description
            in_stock
        }
    }
}
```

Example with immediate argument for an update statement:

```
mutation update_user_and_order {
    user_collection(user_id: "user_id_1", update: {
        first_name: "Peter"
        last_name: "Petrov"
    }) {
        user_id
        first_name
        last_name
    }
    order_collection(order_id: "order_id_1", update: {
        description: "Peter's order"
        price: 0.0
        discount: 0.0
        in_stock: false
    }) {
        order_id
        description
        in_stock
    }
}
```

Consider the following details:

* `${collection_name}_update` is the name of the type whose value intended to
  pass to the `update` argument. This type / argument requires a user to set
  subset of fields of an updating object except primary key parts.
* A mutation with an `update` argument always return the updated object.
* The `update` argument is forbidden with `insert` or `delete` arguments.
* The `update` argument is forbidden in `query` requests.
* Objects are selected by filters first, then updated using a statement in the
  `update` argument, then connected objects are selected.
* The `limit` and `offset` arguments applied before update, so a user can use
  `limit: 1` to update only first match.
* Objects are traversed in pre-order depth-first way, object's fields are
  traversed in an order as they are written in a mutation request. So an
  `update` argument potentially changes those fields that are follows the
  updated object in this order.
* Filters by connected objects are performed before update. Resulting connected
  objects given after the update (it is matter when a field(s) of the parent
  objects by whose the connection is made is subject to change).

#### Delete

Example:

```
mutation delete_user_and_order(
    $user_id: String,
    $order_id: String,
) {
    user_collection(user_id: $user_id, delete: true) {
        user_id
        first_name
        last_name
    }
    order_collection(order_id: $order_id, delete: true) {
        order_id
        description
        in_stock
    }
}
```

Consider the following details:

* There are no special type name for a `delete` argument, it is just Boolean.
* A mutation with a `delete: true` argument always return the deleted object.
* The `delete` argument is forbidden with `insert` or `update` arguments.
* The `delete` argument is forbidden in `query` requests.
* The same fields traversal order and 'select -> change -> select connected'
  order of operations for one field are applied likewise for the `update`
  argument.
* The `limit` argument can be used to define how many objects are subject to
  deletion and `offset` can help with adjusting start point of multi-object
  delete operation.

## GraphiQL
```
local graphql = require('graphql').new({
    schemas = schemas,
    collections = collections,
    accessor = accessor,
    service_fields = service_fields,
    indexes = indexes
})

graphql:start_server()
-- now you can use GraphiQL interface at http://<IP_ADDRESS>:8080
graphql:stop_server()

-- as well you may do (with creating default instance underhood)
require('graphql').start_server()
```

## Run tests

```
git clone https://github.com/tarantool/graphql.git
git submodule update --recursive --init
make test
```
To run specific test:
```
TEST_RUN_TESTS=common/mutation make test
```

## Requirements

* For use:
  * tarantool,
  * lulpeg,
  * \>=tarantool/avro-schema-3.0.1,
  * \>=tarantool/shard-1.1-91-gfa88bf8 (but < 2.0) or
    \>=tarantool/shard-2.1-0-g0a7d98f (optional),
  * lrexlib-pcre2 or lrexlib-pcre (optional),
  * tarantool/http (optional, for GraphiQL).
* For test (additionally to 'for use'):
  * python 2.7,
  * virtualenv,
  * luacheck,
  * \>=tarantool/avro-schema-3.0.1,
  * \>=tarantool/shard-1.1-92-gec1a27e (but < 2.0) or
    \>=tarantool/shard-2.1-0-g0a7d98f,
  * lrexlib-pcre2 or lrexlib-pcre,
  * tarantool/http.
* For building apidoc (additionally to 'for use'):
  * ldoc.

## Hacking

Enable debug log:

```sh
export TARANTOOL_GRAPHQL_DEBUG=1
```

## License

Consider LICENSE file for details. In brief:

* graphql/core: MIT (c) 2015 Bjorn Swenson
* graphql/server/graphiql: Facebook dev tools & examples license (allows use,
  copy and distribute) (c) 2015, Facebook, Inc (more: [1])
* all other content: BSD 2-clause (c) 2018 Tarantool AUTHORS

[1]: https://github.com/graphql/graphiql/issues/10

repository: Kasen/graphql

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: Kasen/graphql


text:
# git-diff

Attempt to display a better diff than github!

- Moved sections of code are shown in yellow/blue instead of red/green
- Changed sections of code show word-by-word diffs
- Detect unrelated sections of code and don't try to diff them!
- Additions above a change diff nicer due to reverse diffing™

Requires node 14

Run with:
```js
yarn install
node diff.js
```

license: MIT

repository: peterjwest/git-diff

repo_name: peterjwest/git-diff


text:
# DomainPasswordSpray
DomainPasswordSpray is a tool written in PowerShell to perform a password spray attack against users of a domain. By default it will automatically generate the userlist from the domain. BE VERY CAREFUL NOT TO LOCKOUT ACCOUNTS!

##Quick Start Guide
Open a PowerShell terminal from the Windows command line with 'powershell.exe -exec bypass'.

Type 'Import-Module Invoke-DomainPasswordSpray.ps1'.

The only option necessary to perform a password spray is either -Password for a single password or -PasswordList to attempt multiple sprays. When using the -PasswordList option Invoke-DomainPasswordSpray will attempt to gather the account lockout observation window from the domain and limit sprays to one per observation window to avoid locking out accounts.

The following command will automatically generate a list of users from the current user's domain and attempt to authenticate using each username and a password of Winter2016.
```PowerShell
Invoke-DomainPasswordSpray -Password Winter2016
```

The following command will use the userlist at users.txt and try to authenticate to the domain "domain-name" using each password in the passlist.txt file one at a time. It will automatically attempt to detect the domain's lockout observation window and restrict sprays to one attempt during each window. The results of the spray will be output to a file called sprayed-creds.txt
```PowerShell
Invoke-DomainPasswordSpray -UserList users.txt -Domain domain-name -PasswordList passlist.txt -OutFile sprayed-creds.txt
```

###Invoke-DomainPasswordSpray Options
```
UserList          - Optional UserList parameter. This will be generated automatically if not specified.
Password          - A single password that will be used to perform the password spray.
PasswordList      - A list of passwords one per line to use for the password spray (Be very careful not to lockout accounts).
OutFile           - A file to output the results to.
Domain            - A domain to spray against.

```


text:
# All further development has been moved to [git.furry.cool](https://git.furry.cool/MCFurryPacks/FoxThighHighs)

# Fox Thigh Highs
This isn't a pack I made, but I felt like including it. Supports 1.14+

Requires optifine to use alternative textures.

### Sources
- I'm unable to find a reliable/original source for this.

repository: MCFurryPacks/FoxThighHighs

gha_license_id: MIT

repo_name: MCFurryPacks/FoxThighHighs


text:
# PowerShell 7 Continuous Integration build

Container based on PowerShell 7 for Continuous Integration.

## Tags

``` latest ```

## Notes

This PowerShell 7 container has extra modules installed that I use to test my PowerShell scripts and modules.

- [psake]
- [Pester]
- [PSScriptAnalyzer]

## Build

### Docker

``` docker build -t  . powershell-ci ```

### Ansible

Ansible can be used to build the container from the Dockerfile. Inspired by the great book [Ansible For DevOps]

``` ansible-playbook main.yml ```

[psake]: https://github.com/psake/psake
[Pester]: https://github.com/Pester/Pester
[PSScriptAnalyzer]: https://github.com/PowerShell/Psscriptanalyzer
[Ansible For DevOps]: https://www.ansiblefordevops.com/

repository: MatthewJDavis/docker-powershell-ci

repo_name: MatthewJDavis/docker-powershell-ci


text:
So, you want to write some batching rules? This is the guide to get started :)

First off, what are batching rules and why do we need so many of them? Well, to understand that, we need to understand how vmap works.

### How does vmap work?
Vmap is a function transform (pioneered by Jax) that allows one to batch functions. That is, given a function `f(x: [N]) -> [N]`, `vmap(f)` now transforms the signature to be `f(x: [B, N]) -> [B, N]`. That is - it adds a batch dimension to both the input and the output of the function.

This guide will gloss over all the cool things you can do this (there are many!), so let's focus on how we actually implement this.

One misconception is that this is some magic compiler voodoo, or that it is inherent some function transform. It is not - and there's another framing of it that might make it more clear.

Instead of providing `vmap`, imagine that we provide a `BatchedTensor` instead. This `BatchedTensor` wraps a `Tensor[B, N, M]`. *But*, to all the users of this tensor, it looks like a `Tensor[N, M]` (that is, without the `B` dimension). Then, when operations are done on this tensor, it transforms that operation to broadcast over the additional `B` dimension as well.

For example, let's say that we wanted to sum a `BatchedTensor` with shape `[5]` - that is, `torch.sum(x)`. This would give us back a `BatchedTensor` with shape `[]` (i.e. a scalar tensor). **But**, in reality, we this is actually a `Tensor` with shape `[B]`. Instead of running `torch.sum(x: [5])`, we ran `torch.sum(x: [B, 5], dim=1)`. In other words, we transformed the sum operation so that instead of summing the whole tensor, it summed all the dimensions *except* the batch dimension.

That is how `vmap` works. For every single operator, we define how to transform that operator to broadcast over an additional batch dimension.

### Basic Batching Rule (unsqueeze)
Let's take a look at our batching rule API. For some reference, the function signature for unsqueeze is `unsqueeze(Tensor(a) self, int dim) -> Tensor(a)`. This can be found [here](functorch/csrc/BatchRulesViews.cpp).
```
std::tuple<Tensor,optional<int64_t>> unsqueeze_batch_rule(
    const Tensor& self,
    optional<int64_t> self_bdim,
    int64_t dim) {
  auto self_ = moveBatchDimToFront(self, self_bdim);
  auto rank = rankWithoutBatchDim(self, self_bdim);
  dim = maybe_wrap_dim(dim, rank + 1) + 1;
  return std::make_tuple(self_.unsqueeze(dim), 0);
}
```
Now, let's look at each part individually.
```
std::tuple<Tensor,optional<int64_t>> unsqueeze_batch_rule(
    const Tensor& self,
    optional<int64_t> self_bdim,
    int64_t dim) {
```
For the most part, the function signature for a batching rule is identical to the function signature for the operator. The only difference is that for each `Tensor` (both in the input and the output), we have an additional `optional<int64_t>`. This is the batch dimension. In the previous explanation, we implicitly assumed that the batch dimension was always at 0, but we allow for batch dimensions to be on arbitrary dimensions. The `optional` part reflects that not all tensors are batched - if a function takes multiple tensors then it's possible for only one of them to be a `BatchedTensor`. Note, however, that we guarantee that at least one tensor will always have a batch dimension.

```
  auto self_ = moveBatchDimToFront(self, self_bdim);
  auto rank = rankWithoutBatchDim(self, self_bdim);
  dim = maybe_wrap_dim(dim, rank + 1) + 1;
```
For `unsqueeze(x, dim)`, the strategy for the batching rule is pretty simple. We first move the batching dimension to the front. Then, instead of doing `unsqueeze(x, dim)`, we do `unsqueeze(x, dim + 1)` (since there's now an extra bdim).

```
return std::make_tuple(self_.unsqueeze(dim), 0);
```
Now, we return a tuple of the tensor along with its batch dimension (which is now 0 since we moved it to the front).

```
VMAP_SUPPORT("unsqueeze", unsqueeze_batch_rule);
```
Finally, we add support for it by using the `VMAP_SUPPORT` macro.

### Implementing multiple batching rules with boxed fallbacks or templates
Often, we find that large classes of operators have similar patterns of batching rules. For example, every single pointwise op has a similar pattern. In that case, it's a bit ridiculous to separately write a batching rule for those situations.

In those cases, we have 2 primary tools - templates and boxed fallbacks. For example, we've written a boxed fallback that covers many reductions (see the [reduction batching rules](functorch/csrc/BatchRulesReduceOps.cpp)).

There are 3 primary boxed fallbacks that we've used (I'll refer to the macros here). If you feel that there's any pattern that we could/should abstract away, feel free to post an issue.

1. `POINTWISE_BOXED`: Handles pointwise ops. Takes all tensors in the arguments, moves batch dimensions to the front, and unsqueezes all tensors so that they broadcast.
1. `REDUCTION_BOXED`: Handles reduction ops. Moves batch dimension to the front, and then modifies the dim argument so that it works with the extra batch dimension. For example, if the dim is an integer, then we add one. If it's a dimarray, then we add one to all entries (unless it's empty!, in which case we fill in all the entries except 0).
1. `VARIADIC_BDIMS_BOXED`: Handles ops that already natively support arbitrary batch dimensions. For example, if it supports `[B1,B2,..., N]`. In this case, we can simply move the batch dimension to the front and we're done!

### Sidestepping batching rules by decomposing operators
Sometimes, it's difficult to implement a batching rule by transforming it into another operator. For example, `trace`. In that case, instead of transforming the operator, we can simply decompose it.

```
Tensor trace_decomp(const Tensor& self) {
  return at::sum(at::diagonal(self));
}
...
m.impl("trace", trace_decomp);
```
In general, this reduces the performance, since instead of launching one kernel we're launching multiple. So, we generally try to avoid this option :)

PS: There's a special class of operators in PyTorch called CompositeImplicitAutograd operators that can be decomposed without losing performance. We actually decompose those by default! (although we stop the decompositions that aren't tested in [BatchRulesStopDecomposition](functorch/csrc/BatchRulesStopDecomposition.cpp) for debuggability reasons).

### Testing your batching rule
We generally use OpInfos to test our batching rules. OpInfos are great since they let us test the same operator in many different ways.

In general, if the operator you've added a batching rule for has an OpInfo test, that's good enough!

Generally, you can try running `pytest -k op_name` to use `pytest` to find all tests that test your operator. Sometimes, if your operator doesn't match the public API, you need to figure out the public API that corresponds to the operator you've implemented a batching rule for. For example, `torch.where` actually often executes `aten::_s_where` underneath.

Todo: Add more relevant details @zou

## Cool, I'm convinced! And I want to write batching rules! Where do I find some?
There's a couple different resources for finding batching rules to write.

1. [BatchingRegistrations.cpp](functorch/csrc/BatchingRegistrations.cpp): This is probably the easiest place to start. These were batching rules that were written with an old API, and thus have a lot of cruft in them that are no longer necessary. Porting these batching rules to using one of the above options is an easy way to get started and help us reduce tech debt :) Once you've gotten your footing with writing batching rules, you can start helping with writing new batching rules.
2. Popular operators. See [1](https://github.com/facebookresearch/functorch/issues/112), [2](https://github.com/facebookresearch/functorch/issues/101), [3](https://github.com/facebookresearch/functorch/issues/102), and [4](https://github.com/facebookresearch/functorch/issues/102). These contain lists of (user-facing) PyTorch operators sorted by usages, along with whether they have a batching rule implemented or not.
3. [Master List](https://docs.google.com/spreadsheets/d/1Sp4HUjxwMifS5oDQg0yvjqk7hKOpCfKO4jWH4MTGP-k/edit#gid=0). This is the master list of vmap operator support :). It's generated by [this script](op_analysis/gen_data.py). Theoretically, we want to support most of the operators in that list (that aren't composite or out variants).

repository: Padarn/functorch

branch_name: refs/heads/main

repo_name: Padarn/functorch


text:
# GLAbstraction
A simple library, which makes the use of OpenGL a little bit more convenient and Julian.
If you have any questions, please open an issue.

There are some [tutorials](tutorials/README.md) and [examples](https://github.com/JuliaGL/GLAbstraction.jl/tree/master/example).

### Features

* All the different glUniform functions are wrapped and the right function is determined via multiple dispatch (works for [FixedSizeArrays](https://github.com/SimonDanisch/FixedSizeArrays.jl), [Colors](https://github.com/JuliaGraphics/Colors.jl) and Real numbers)
* `Buffers` and `Texture` objects are wrapped, with best support for arrays of FixedSizeArrays, Colors and Reals.
* An Array interface for `Buffers` and `Textures`, offering functions like `push!`, `getindex`, `setindex!`, etc for GPU arrays, just like you're used to from Julia Arrays.
* Shader loading is simplified and offers templated shaders and interactive editing of shaders and type/error checks.
* Some wrappers for often used functions, with embedded error handling and more Julian syntax

### Example:

```julia
using ModernGL, GeometryTypes, GLAbstraction, GLFW

const GLA = GLAbstraction

window = GLFW.Window(name="Drawing polygons 5", resolution=(800,600))
GLA.set_context!(window)

vertex_shader = GLA.vert"""
#version 150

in vec2 position;
in vec3 color;

out vec3 Color;

void main()
{
    Color = color;
    gl_Position = vec4(position, 0.0, 1.0);
}
"""

fragment_shader = GLA.frag"""
# version 150

in vec3 Color;

out vec4 outColor;

void main()
{
    outColor = vec4(Color, 1.0);
}
"""

prog = GLA.Program(vertex_shader, fragment_shader)

vertex_positions = Point{2,Float32}[(-0.5,  0.5),
                                    ( 0.5,  0.5),
                                    ( 0.5, -0.5),
                                    (-0.5, -0.5)]

vertex_colors = Vec3f0[(1, 0, 0),
                       (0, 1, 0),
                       (0, 0, 1),
                       (1, 1, 1)]
elements = Face{3,UInt32}[(0,1,2),
                          (2,3,0)]
buffers = GLA.generate_buffers(prog, position = vertex_positions, color = vertex_colors)
vao = GLA.VertexArray(buffers, elements)
glClearColor(0, 0, 0, 1)

while !GLFW.WindowShouldClose(window)
    glClear(GL_COLOR_BUFFER_BIT)
    GLA.bind(prog)
    GLA.bind(vao)
    GLA.draw(vao)
    GLA.unbind(vao) #optional in this case
    GLA.unbind(prog) #optional in this case
    GLFW.SwapBuffers(window)
    GLFW.PollEvents()
    if GLFW.GetKey(window, GLFW.KEY_ESCAPE) == GLFW.PRESS
        GLFW.SetWindowShouldClose(window, true)
    end
end
GLFW.DestroyWindow(window)  # needed if you're running this from the REPL
```

# Credits

Thanks for all the great [contributions](https://github.com/JuliaGL/GLAbstraction.jl/graphs/contributors)

gha_language: Julia

gha_license_id: NOASSERTION


text:
---
title: "Session"
description: "Session Configuration"
lead: "Configuring the Session / Cookie settings."
date: 2022-06-15T17:51:47+10:00
draft: false
images: []
menu:
  configuration:
    parent: "session"
weight: 105100
toc: true
aliases:
  - /c/session
  - /docs/configuration/session/
---

__Authelia__ relies on session cookies to authorize user access to various protected websites. This section configures
the session cookie behaviour and the domains which Authelia can service authorization requests for.

## Configuration

{{< config-alert-example >}}

```yaml
session:
  secret: 'insecure_session_secret'
  name: 'authelia_session'
  same_site: 'lax'
  inactivity: '5m'
  expiration: '1h'
  remember_me: '1M'
  cookies:
    - domain: 'example.com'
      authelia_url: 'https://auth.example.com'
      name: 'authelia_session'
      same_site: 'lax'
      inactivity: '5m'
      expiration: '1h'
      remember_me: '1d'
```

## Providers

There are currently two providers for session storage (three if you count Redis Sentinel as a separate provider):

* Memory (default, stateful, no additional configuration)
* [Redis](redis.md) (stateless).
* [Redis Sentinel](redis.md#highavailability) (stateless, highly available).

### Kubernetes or High Availability

It's important to note when picking a provider, the stateful providers are not recommended in High Availability
scenarios like Kubernetes. Each provider has a note beside it indicating it is *stateful* or *stateless* the stateless
providers are recommended.

## Options

This section describes the individual configuration options.

### secret

{{< confkey type="string" required="yes" >}}

*__Important Note:__ This can also be defined using a [secret](../methods/secrets.md) which is __strongly recommended__
especially for containerized deployments.*

The secret key used to encrypt session data in Redis.

It's __strongly recommended__ this is a
[Random Alphanumeric String](../../reference/guides/generating-secure-values.md#generating-a-random-alphanumeric-string) with 64 or more
characters.

### domain

{{< confkey type="string" required="no" >}}

_**Deprecation Notice:** This option is deprecated. See the [cookies](#cookies) section and specifically the
[cookies domain](#domain-1) option instead._

This value automatically maps to a single cookies configuration using the default values. It cannot be assigned at the
same time as a `cookies` configuration.

### name

{{< confkey type="string" default="authelia_session" required="no" >}}

The default `name` value for all [cookies](#cookies) configurations.

### same_site

{{< confkey type="string" default="lax" required="no" >}}

The default `same_site` value for all `cookies` configurations.

### inactivity

{{< confkey type="duration" default="5m" required="no" >}}
{{< ref-common ref="duration" description="Common Syntax: Duration" text="This option uses a common syntax. " >}}

The default `inactivity` value for all [cookies](#cookies) configurations.

### expiration

{{< confkey type="duration" default="1h" required="no" >}}
{{< ref-common ref="duration" description="Common Syntax: Duration" text="This option uses a common syntax. " >}}

The default `expiration` value for all [cookies](#cookies) configurations.

### remember_me

{{< confkey type="duration" default="1M" required="no" >}}
{{< ref-common ref="duration" description="Common Syntax: Duration" text="This option uses a common syntax. " >}}

The default `remember_me` value for all [cookies](#cookies) configurations.

### cookies

The list of specific cookie domains that Authelia is configured to handle. Domains not properly configured will
automatically be denied by Authelia. The list allows administrators to define multiple session cookie domain
configurations with individual settings.

#### domain

{{< confkey type="string" required="yes" >}}

*__Important Note:__ Browsers have rules regarding which cookie domains a website can write. In particular this.*

The domain the session cookie is assigned to protect. This must be the same as the domain Authelia is served on or the
root of the domain, and consequently if the [authelia_url](#authelia_url) is configured must be able to read and write
cookies for this domain.

For example if Authelia is accessible via the URL `https://auth.example.com` the domain should be either
`auth.example.com` or `example.com`.

The value must not match a domain on the [Public Suffix List](https://publicsuffix.org/list/) as browsers do not allow
websites to write cookies for these domains. This includes most Dynamic DNS services such as `duckdns.org`. You should
use your domain instead of `duckdns.org` for this value, for example `example.duckdns.org`.

Consequently, if you have `example.duckdns.org` and `example-auth.duckdns.org` you cannot share cookies between these
domains.

#### authelia_url

{{< confkey type="string" required="no" >}}

*__Note:__ The AuthRequest implementation does not support redirection control on the authorization server. This means
that the `authelia_url` option is ineffectual for both NGINX and HAProxy, or any other proxy which uses the AuthRequest
implementation.*

This is a completely optional URL which is the root URL of your Authelia installation for this cookie domain which can
be used to generate the appropriate redirection for proxies which support this. This URL must:

1. Be able to read and write cookies for the configured [domain](#domain-1).
2. Use the `https://` scheme.
3. Include the path if relevant (i.e. `https://example.com/authelia` rather than `https://example.com` if you're using the
   [server path option](../miscellaneous/server.md#path) of `authelia` and if the Authelia portal is inaccessible from
   `https://example.com`).

If this option is absent you must use the appropriate query parameter or header for your relevant proxy.

#### name

{{< confkey type="string" required="no" >}}

*__Default Value:__ This option takes its default value from the [name](#name) setting above.*

The name of the session cookie. By default this is set to the `name` value in the main session configuration section.

#### same_site

{{< confkey type="string" required="no" >}}

*__Default Value:__ This option takes its default value from the [same_site](#samesite) setting above.*

Sets the cookies SameSite value. Prior to offering the configuration choice this defaulted to None. The new default is
Lax. This option is defined in lower-case. So for example if you want to set it to `Strict`, the value in configuration
needs to be `strict`.

You can read about the SameSite cookie in detail on the
[MDN](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Set-Cookie/SameSite). In short setting SameSite to Lax
is generally the most desirable option for Authelia. None is not recommended unless you absolutely know what you're
doing and trust all the protected apps. Strict is not going to work in many use cases and we have not tested it in this
state but it's available as an option anyway.

#### inactivity

{{< confkey type="duration" required="no" >}}
{{< ref-common ref="duration" description="Common Syntax: Duration" text="This option uses a common syntax. " >}}

*__Default Value:__ This option takes its default value from the [inactivity](#inactivity) setting above.*

The period of time the user can be inactive for until the session is destroyed. Useful if you want long session timers
but don't want unused devices to be vulnerable.

#### expiration

{{< confkey type="duration" required="no" >}}
{{< ref-common ref="duration" description="Common Syntax: Duration" text="This option uses a common syntax. " >}}

*__Default Value:__ This option takes its default value from the [expiration](#expiration) setting above.*

The period of time before the cookie expires and the session is destroyed. This is overriden by
[remember_me](#rememberme) when the remember me box is checked.

#### remember_me

{{< confkey type="duration" required="no" >}}
{{< ref-common ref="duration" description="Common Syntax: Duration" text="This option uses a common syntax. " >}}

*__Default Value:__ This option takes its default value from the [remember_me](#rememberme) setting above.*

The period of time before the cookie expires and the session is destroyed when the remember me box is checked. Setting
this to `-1` disables this feature entirely for this session cookie domain.

## Security

Configuration of this section has an impact on security. You should read notes in
[security measures](../../overview/security/measures.md#session-security) for more information.

repository: authelia/authelia

gha_language: Go

repo_name: authelia/authelia


text:
🔢 H5N8 Data 🦠

    Updated repository data with confirmed cases of **H5N8** in humans

## 🚀 Use
For now the data is available in `JSON` and `CSV` format:
- [`CSV`](./data.csv)
- [`JSON`](./data.json)

## 🤲 Contributing
Do you would like to contribute with new data? Awesome! please fork the repository and make changes as you like. [Pull requests](https://github.com/360macky/h5n8-data/pulls) are warmly welcome.

## 📃 License
Distributed under the MIT License.
See [`LICENSE`](./LICENSE) for more information.


text:
# angular-socket-io
Bower Component for using AngularJS with [Socket.IO](http://socket.io/), based on [this](http://briantford.com/blog/angular-socket-io.html).

## Install

1. `bower install angular-socket-io` or [download the zip](https://github.com/btford/angular-socket-io/archive/master.zip).
2. Made sure the Socket.IO client lib is loaded. It's often served at `/socket.io/socket.io.js`.
3. Include the `socket.js` script provided by this component into your app.
4. Add `btford.socket-io` as a module dependency to your app.

## Usage

For the most part, this component works exactly like you would expect it to.
The only API addition is `socket.forward`, which makes it easier to add/remove listeners in a way that works with [AngularJS's scope](http://docs.angularjs.org/api/ng.$rootScope.Scope).

### `socket.on` / `socket.addListener`
Takes an event name and callback.
Works just like the method of the same name from Socket.IO.

### `socket.removeListener`
Takes an event name and callback.
Works just like the method of the same name from Socket.IO.

### `socket.emit`
Sends a message to the server.
Optionally takes a callback.

Works just like the method of the same name from Socket.IO.

### `socket.forward`

`socket.forward` allows you to forward the events recieved by Socket.IO's socket to AngularJS's event system.
You can then listen to the event with `$scope.$on`.
By default, socket-forwarded events are namespaced with `socket:`.

The first argument is a string or array of strings listing the event names to be forwarded.
The second argument is optional, and is the scope on which the events are to be broadcast.
If an argument is not provided, it defaults to `$rootScope`.
As a reminder, broadcasted events are propegated down to descendant scopes.

#### Examples

An easy way to make socket error events available across your app:

```javascript

// in the top-level module of the app
angular.module('myApp', [
  'btford.socket-io',
  'myApp.MyCtrl'
]).
run(function () {
  socket.forward('error');
});

// in one of your controllers
angular.module('myApp.MyCtrl', []).
  controller('MyCtrl', function ($scope) {
    $scope.on('socket:error', function (ev, data) {

    });
  });
```

Avoid dublicating event handlers when a user navigates back and forth between routes:

```javascript
angular.module('myMod', ['btford.socket-io']).
  controller('MyCtrl', function ($scope, socket) {
    socket.forward('someEvent', $scope);
    scope.$on('socket:someEvent', function (ev, data) {
      $scope.theData = data;
    });
  });
```

### `socketProvider.prefix`

This method changes the prefix for forwarded events.
The default prefix is `socket:`.

#### Example

To remove the prefix:

```javascript
angular.module('myApp', [
  'btford.socket-io'
]).
config(function (socketProvider) {
  socketProvider.prefix('');
});
```

### `socketProvider.ioSocket`

This method allows you to provide the `socket` service with a `Socket.IO socket` object to be used internally.
This is useful if you want to connect on a different path, or need to hold a reference to the `Socket.IO socket` object for use elsewhere.

```javascript
angular.module('myApp', [
  'btford.socket-io'
]).
config(function (socketProvider) {
  var mySocket = io.connect('/some/other/path');
  // do stuff with mySocket
  socketProvider.ioSocket(mySocket);
});
```

## License
MIT

repository: johntom/crm-MEANSMixup

repo_name: johntom/crm-MEANSMixup


text:
## Strings

Strings are generated with the help of *StringRandom* class. As usual, you should interact with it via its global instance *rnds*.

### Generators (*rnds* static methods)
#### std::string random(int len, const std::string& alphabet = "a-z")
* Returns: random string of length *len* made of characters from *alphabet*.
* Note: *alphabet* can contain single chars and groups of form *A-Z*. For example, *"0-9abcdefA-F"* includes all hexadecimal characters.

#### std::string random(const std::string& pattern, ...)
* Returns: a random string generated by *pattern*.
* Equivalent to *rnd.next(pattern, ...)*; see [docs on Random](random.md) for detailed description.

#### std::string thueMorse(int len, char first = 'a', char second = 'b')
* Returns: a prefix of length *n* of the Thue-Morse string made of *first* and *second* characters.
* Description: Thue-Morse string is a string of kind<PHONE_NUMBER>010110.... That is, start from 0 and on each step concatenate the string to itself exchanging zeroes and ones.
* Note: this string is useful for breaking hashes modulo 264. Strings *thueMorse(n, x, y)* and *thueMorse(n, y, x)* will have identical polynomial hash for any base for *n* ≥ 2048.

#### std::string abacaba(int len, char first = 'a')
* Returns: a prefix of length *n* of the string of form *abacabadabacaba...* starting with character *first*.

#### std::pair<std::string, std::string> antiHash(
  const std::vector<std::pair<long long, long long>>& bases,
  const std::string& alphabet = "a-z",
  int length = -1)
* Returns: a pair of different strings of length *length* (or minimal found if *length* is -1) with the same polynomial hash for specified bases.
* Parameters:
    * *bases*: vector of pairs (mod, base);
    * *alphabet*: the same as in *random(len, alphabet)*;
    * *length*: length of resulting strings, or *-1* if the shortest found result is needed.
* Note: mod must not exceed 2\*109. Also, you cannot specify more than two pairs (mod, base).
* Complexity and result size: for two mods around 2\*109 generation runs for about 3 seconds and produces strings of length approximately 100-200. A faster version of the algorithm will be presented later.
* Example:
```cpp
int mod1 = rndm.randomPrime(1999000000,<PHONE_NUMBER>);
int mod2 = rndm.randomPrime(1999000000,<PHONE_NUMBER>);
int base1 = rnd.next(2000, 10000) * 2 + 1;
int base2 = rnd.next(2000, 10000) * 2 + 1;

auto res = rnds.antiHash( {{mod1, base1}, {mod2, base2}}, "a-z", -1);
cout << res.first << "\n" << res.second << "\n";

// or simply
cout << rnds.antiHash({{1000000007, 107}, {1000000009, 109}}) << "\n";
```

repository: ifsmirnov/jngen

repo_name: ifsmirnov/jngen


text:
# Readings: Identity

## Submission Requirements

Below you will find some reading material, code samples, and some additional resources that support today's topic and the upcoming lecture.

Review the Submission Instructions for guidance on completing and submitting this assignment.

## Readings

1. [Intro to Identity](https://docs.microsoft.com/en-us/aspnet/core/security/authentication/identity?view=aspnetcore-2.1&tabs=visual-studio%2Caspnetcore2x){:target="_blank"}
1. [Identity Demystified](https://digitalmccullough.com/posts/aspnetcore-auth-system-demystified.html){:target="_blank"}

gha_language: C#


text:
---
title: VMware vSphere Integration
tags: [integrations list]
permalink: vsphere.html
summary: Learn about the VMware vSphere Integration.
---

This page provides an overview of what you can do with the VMware vSphere integration. The documentation pages only for a limited number of integrations contain the setup steps and instructions. If you do not see the setup steps here, navigate to the Operations for Applications GUI. The detailed instructions for setting up and configuring all integrations, including the VMware vSphere integration are on the **Setup** tab of the integration.

1. Log in to your Operations for Applications instance.
2. Click **Integrations** on the toolbar, search for and click the **VMware vSphere** tile.
3. Click the **Setup** tab and you will see the most recent and up-to-date instructions.

## vSphere Integration

The vSphere integration offers pre-defined dashboards and pre-defined alert conditions. This integration uses [vSphere Telegraf plugin](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/vsphere) to gather metrics for Clusters, Hosts, VMs and Datastores.

### Dashboards

Operations for Applications provides the following dashboards for vSphere:

- Summary
- Cluster
- Datastore
- ESXi Host Summary
- ESXi Host Detail
- VM Summary
- VM Details
- VMware vSAN

#### Summary Dashboard

From the Summary dashboard you can easily navigate to all other vSphere dashboards.

{% include image.md src="images/vsphere_summary.png" width="80" %}

#### Host and VM System Metrics

The integration includes system metrics for all ESXi Hosts and VMs that are part of your environment.

{% include image.md src="images/vsphere_vm_summary.png" width="80" %}

### Metrics Configuration

Operations for Applications ingests vSphere metrics using the vSphere input plugin for Telegraf. For details on the metrics and on how to configure ingestion, see the [vSphere plugin](https://github.com/influxdata/telegraf/tree/master/plugins/inputs/vsphere) details on GitHub.

## Metrics for vSphere

The following table lists metrics that the integration collected from a specific environment, and gives a good overview of what to expect. Your environment might include fewer metrics or additional metrics, depending on setup.

|Metric Name|Description|
| :--- | :--- |
|vsphere.cluster.mem.overhead.average|Host physical memory consumed by the virtualization infrastructure for running the virtual machine.|
|vsphere.cluster.mem.usage.average|Memory usage as percent of total configured or available memory for a cluster.|
|vsphere.cluster.vmop.numChangeDS.latest|Number of datastore change operations for powered-off and suspended virtual machines for a cluster.|
|vsphere.cluster.vmop.numChangeHost.latest|Number of host change operations for powered-off and suspended virtual machines for a cluster.|
|vsphere.cluster.vmop.numChangeHostDS.latest|Number of host and datastore change operations for powered-off and suspended virtual machines for a cluster.|
|vsphere.cluster.vmop.numClone.latest|Number of virtual machine clone operations for a cluster.|
|vsphere.cluster.vmop.numCreate.latest|Number of virtual machine create operations for a cluster.|
|vsphere.cluster.vmop.numDeploy.latest|Number of virtual machine template deploy operations for a cluster.|
|vsphere.cluster.vmop.numDestroy.latest|Number of virtual machine delete operations for a cluster.|
|vsphere.cluster.vmop.numPoweroff.latest|Number of virtual machine power off operations for a cluster.|
|vsphere.cluster.vmop.numPoweron.latest|Number of virtual machine power on operations for a cluster.|
|vsphere.cluster.vmop.numRebootGuest.latest|Number of virtual machine guest reboot operations for a cluster.|
|vsphere.cluster.vmop.numReconfigure.latest|Number of virtual machine guest reconfigure operations for a cluster.|
|vsphere.cluster.vmop.numRegister.latest|Number of virtual machine register operations for a cluster.|
|vsphere.cluster.vmop.numReset.latest|Number of virtual machine reset operations for a cluster.|
|vsphere.cluster.vmop.numSVMotion.latest|Number of migrations with Storage vMotion (datastore change operations for powered-on VMs) for a cluster.|
|vsphere.cluster.vmop.numShutdownGuest.latest|Number of virtual machine guest shutdown operations for a cluster.|
|vsphere.cluster.vmop.numStandbyGuest.latest|Number of virtual machine standby guest operations for a cluster.|
|vsphere.cluster.vmop.numSuspend.latest|Number of virtual machine suspend operations for a cluster.|
|vsphere.cluster.vmop.numUnregister.latest|Number of virtual machine unregister operations for a cluster.|
|vsphere.cluster.vmop.numVMotion.latest|Number of migrations with vMotion (host change operations for powered-on VMs) for a cluster.|
|vsphere.cluster.vmop.numXVMotion.latest|Number of host and datastore change operations for powered-on and suspended virtual machines for a cluster.|
|vsphere.datacenter.vmop.numChangeDS.latest|Number of datastore change operations for powered-off and suspended virtual machines for a data center.|
|vsphere.datacenter.vmop.numChangeHost.latest|Number of host change operations for powered-off and suspended virtual machines for a data center.|
|vsphere.datacenter.vmop.numChangeHostDS.latest|Number of host and datastore change operations for powered-off and suspended virtual machines for a data center.|
|vsphere.datacenter.vmop.numClone.latest|Number of virtual machine clone operations for a data center.|
|vsphere.datacenter.vmop.numCreate.latest|Number of virtual machine create operations for a data center.|
|vsphere.datacenter.vmop.numDeploy.latest|Number of virtual machine template deploy operations for a data center.|
|vsphere.datacenter.vmop.numDestroy.latest|Number of virtual machine delete operations for a data center.|
|vsphere.datacenter.vmop.numPoweroff.latest|Number of virtual machine power off operations for a data center.|
|vsphere.datacenter.vmop.numPoweron.latest|Number of virtual machine power on operations for a data center.|
|vsphere.datacenter.vmop.numRebootGuest.latest|Number of virtual machine guest reboot operations for a data center.|
|vsphere.datacenter.vmop.numReconfigure.latest|Number of virtual machine guest reconfigure operations for a data center.|
|vsphere.datacenter.vmop.numRegister.latest|Number of virtual machine register operations for a data center.|
|vsphere.datacenter.vmop.numReset.latest|Number of virtual machine reset operations for a data center.|
|vsphere.datacenter.vmop.numSVMotion.latest|Number of migrations with Storage vMotion (datastore change operations for powered-on VMs) for a data center.|
|vsphere.datacenter.vmop.numShutdownGuest.latest|Number of virtual machine guest shutdown operations for a data center.|
|vsphere.datacenter.vmop.numStandbyGuest.latest|Number of virtual machine standby guest operations for a data center.|
|vsphere.datacenter.vmop.numSuspend.latest|Number of virtual machine suspend operations for a data center.|
|vsphere.datacenter.vmop.numUnregister.latest|Number of virtual machine unregister operations for a data center.|
|vsphere.datacenter.vmop.numVMotion.latest|Number of migrations with vMotion (host change operations for powered-on VMs) for a data center.|
|vsphere.datacenter.vmop.numXVMotion.latest|Number of host and datastore change operations for powered-on and suspended virtual machines for a data center.|
|vsphere.datastore.datastore.numberReadAveraged.average|Average number of read commands issued per second to the datastore.|
|vsphere.datastore.datastore.numberWriteAveraged.average|Average number of write commands issued per second to the datastore during the collection.|
|vsphere.datastore.disk.capacity.latest|Configured size of the datastore.|
|vsphere.datastore.disk.provisioned.latest|Amount of storage set aside for use by a datastore or a virtual machine. Files on the datastore and the virtual machine can expand to this size but not beyond it.|
|vsphere.datastore.disk.used.latest|Amount of space actually used by the virtual machine or the datastore. Can be less than the amount provisioned at any given time, depending on whether the virtual machine is powered-off, whether snapshots have been created or not, and other factors.|
|vsphere.host.cpu.coreUtilization.average|CPU utilization of the corresponding core (if hyper-threading is enabled) as a percentage for a host.|
|vsphere.host.cpu.costop.summation|Time the virtual machine is ready to run, but is unable to run due to co-scheduling constraints for a host.|
|vsphere.host.cpu.demand.average|The amount of CPU resources a virtual machine would use if there were no CPU contention or CPU limit for a host.|
|vsphere.host.cpu.idle.summation|Total time that the CPU spent in an idle state for a host.|
|vsphere.host.cpu.latency.average|Percent of time the virtual machine is unable to run because it is contending for access to the physical CPUs for a host.|
|vsphere.host.cpu.readiness.average|Percentage of time that the virtual machine was ready, but could not get scheduled to run on the physical CPU for a host.|
|vsphere.host.cpu.ready.summation|Milliseconds of CPU time spent in ready state for a host.|
|vsphere.host.cpu.swapwait.summation|CPU time spent waiting for swap-in for a host.|
|vsphere.host.cpu.usage.average|Percentage of CPU capacity being used for a host.|
|vsphere.host.cpu.usagemhz.average|Total megehertz of CPU being used for a host.|
|vsphere.host.cpu.used.summation|Time accounted to the virtual machine for a host. If a system service runs on behalf of this virtual machine, the time spent by that service (represented by cpu.system) should be charged to this virtual machine. If not, the time spent (represented by cpu.overlap) should not be charged against this virtual machine.|
|vsphere.host.cpu.utilization.average|CPU utilization as a percentage during the interval (CPU usage and CPU utilization might be different due to power management technologies or hyper-threading) for a host.|
|vsphere.host.cpu.wait.summation|Total CPU time spent in wait state for a host.The wait total includes time spent the CPU Idle, CPU Swap Wait, and CPU I/O Wait states.|
|vsphere.host.disk.deviceReadLatency.average|Average amount of time it takes to read from a physical device for a host.|
|vsphere.host.disk.deviceWriteLatency.average|Average amount of time it takes to write to a physical device for a host.|
|vsphere.host.disk.kernelReadLatency.average|Average amount of time spent by the VMkernel to process each SCSI read command for a host.|
|vsphere.host.disk.kernelWriteLatency.average|Average amount of time spent by the VMkernel to process each SCSI write command for a host.|
|vsphere.host.disk.numberReadAveraged.average|Average number of read commands issued per second to the datastore for a host.|
|vsphere.host.disk.numberWriteAveraged.average|Average number of write commands issued per second to the datastore for a host.|
|vsphere.host.disk.read.average|Average number of kilobytes read from the disk each second for a host.|
|vsphere.host.disk.totalReadLatency.average|Average amount of time taken to process a SCSI read command issued from the guest OS to the virtual machine for a host.|
|vsphere.host.disk.totalWriteLatency.average|Average amount of time taken to process a SCSI write command issued by the guest OS to the virtual machine for a host.|
|vsphere.host.disk.write.average|Average number of kilobytes written to the disk each second for a host.|
|vsphere.host.mem.active.average|Amount of memory that is actively used, as estimated by the VMkernel based on recently touched memory pages for a host.|
|vsphere.host.mem.latency.average|Percentage of time the virtual machine is waiting to access swapped or compressed memory for a host.|
|vsphere.host.mem.state.latest|One of four threshold levels representing the percentage of free memory on the host. The counter value determines swapping and ballooning behavior for memory reclamation.|
|vsphere.host.mem.swapin.average|Amount of memory swapped-in from disk for a host.|
|vsphere.host.mem.swapinRate.average|Rate at which memory is swapped from disk into active memory for a host.|
|vsphere.host.mem.swapout.average|Amount of memory swapped-out to disk for a host.|
|vsphere.host.mem.swapoutRate.average|Rate at which memory is being swapped from active memory to disk for a host.|
|vsphere.host.mem.totalCapacity.average|Total amount of memory reservation used by and available for powered-on virtual machines and vSphere services on the host.|
|vsphere.host.mem.usage.average|Memory usage as percent of total configured or available memory for a host.|
|vsphere.host.mem.vmmemctl.average|Amount of memory allocated by the virtual machine memory control driver (vmmemctl) for a host.|
|vsphere.host.net.bytesRx.average|Average amount of data received per second for a host.|
|vsphere.host.net.bytesTx.average|Average amount of data transmitted per second for a host.|
|vsphere.host.net.droppedRx.summation|Number of received packets dropped for a host.|
|vsphere.host.net.droppedTx.summation|Number of transmitted packets dropped for a host.|
|vsphere.host.net.errorsRx.summation|Number of packets with errors received for a host.|
|vsphere.host.net.errorsTx.summation|Number of packets with errors transmitted for a host.|
|vsphere.host.net.usage.average|Network utilization (combined transmit- and receive-rates) for a host.|
|vsphere.host.power.power.average|Current power usage for a host.|
|vsphere.host.storageAdapter.numberReadAveraged.average|Average number of read commands issued per second by the storage adapter for a host.|
|vsphere.host.storageAdapter.numberWriteAveraged.average|Average number of write commands issued per second by the storage adapter for a host.|
|vsphere.host.storageAdapter.read.average|Rate of reading data by the storage adapter for a host.|
|vsphere.host.storageAdapter.write.average|Rate of writing data by the storage adapter for a host.|
|vsphere.host.sys.uptime.latest|ESXi host uptime.|
|vsphere.vm.cpu.demand.average|The amount of CPU resources a virtual machine would use if there were no CPU contention or CPU limit.|
|vsphere.vm.cpu.idle.summation|Total time that the CPU spent in an idle state for a vitual machine.|
|vsphere.vm.cpu.latency.average|Percent of time the virtual machine is unable to run because it is contending for access to the physical CPUs.|
|vsphere.vm.cpu.readiness.average|Percentage of time that the virtual machine was ready, but could not get scheduled to run on the physical CPU.|
|vsphere.vm.cpu.ready.summation|Milliseconds of CPU time spent in ready state for a virtual machine.|
|vsphere.vm.cpu.run.summation|Time the virtual machine is scheduled to run.|
|vsphere.vm.cpu.usagemhz.average|Total megehertz of CPU being used for a virtual machine.|
|vsphere.vm.cpu.used.summation|Time accounted to the virtual machine. If a system service runs on behalf of this virtual machine, the time spent by that service (represented by cpu.system) should be charged to this virtual machine. If not, the time spent (represented by cpu.overlap) should not be charged against this virtual machine.|
|vsphere.vm.cpu.wait.summation|Total CPU time spent in wait state for a virtual machine.The wait total includes time spent the CPU Idle, CPU Swap Wait, and CPU I/O Wait states.|
|vsphere.vm.mem.active.average|Amount of memory that is actively used, as estimated by the VMkernel based on recently touched memory pages for a virtual machine.|
|vsphere.vm.mem.granted.average|Amount of host physical memory or physical memory that is mapped for a virtual machine or a host.|
|vsphere.vm.mem.latency.average|Percentage of time the virtual machine is waiting to access swapped or compressed memory.|
|vsphere.vm.mem.swapin.average|Amount of memory swapped-in from host cache for a virtual machine.|
|vsphere.vm.mem.swapinRate.average|Rate at which memory is being swapped from host cache into active memory for a virtual machine.|
|vsphere.vm.mem.swapout.average|Amount of memory swapped-out to host cache for a virtual machine.|
|vsphere.vm.mem.swapoutRate.average|Rate at which memory is being swapped from active memory to host cache for a virtual machine.|
|vsphere.vm.mem.usage.average|Memory usage as percent of total configured or available memory for a virtual machine.|
|vsphere.vm.mem.vmmemctl.average|Amount of memory allocated by the virtual machine memory control driver (vmmemctl).|
|vsphere.vm.net.bytesRx.average|Average amount of data received per second for a virtual machine.|
|vsphere.vm.net.bytesTx.average|Average amount of data transmitted per second for a virtual machine.|
|vsphere.vm.net.droppedRx.summation|Number of received packets dropped for a virtual machine.|
|vsphere.vm.net.droppedTx.summation|Number of transmitted packets dropped for a virtual machine.|
|vsphere.vm.net.usage.average|Network utilization (combined transmit- and receive-rates) for a virtual machine.|
|vsphere.vm.power.power.average|Current power usage for a virtual machine.|
|vsphere.vm.sys.uptime.latest|ESXi host uptime.|
|vsphere.vm.virtualDisk.numberReadAveraged.average|Average number of read commands issued per second to the virtual disk for a virtual machine.|
|vsphere.vm.virtualDisk.numberWriteAveraged.average|Average number of write commands issued per second to the virtual disk for a virtual machine.|
|vsphere.vm.virtualDisk.read.average|Average number of kilobytes read from the virtual disk each second for a virtual machine.|
|vsphere.vm.virtualDisk.readOIO.latest|VM virtual disk reads.|
|vsphere.vm.virtualDisk.totalReadLatency.average|Average amount of time for a read operation from the virtual disk.|
|vsphere.vm.virtualDisk.totalWriteLatency.average|Average amount of time for a write operation from the virtual disk.|
|vsphere.vm.virtualDisk.write.average|Average number of kilobytes written to the virtual disk each second.|
|vsphere.vm.virtualDisk.writeOIO.latest|VM virtual disk writes.|

repository: wavefrontHQ/docs

gha_language: CSS

repo_name: wavefrontHQ/docs


text:
[![PyPI version](https://badge.fury.io/py/jupyter_dashboards.svg)](https://badge.fury.io/py/jupyter_dashboards) [![Build Status](https://travis-ci.org/jupyter-incubator/dashboards.svg?branch=master)](https://travis-ci.org/jupyter-incubator/dashboards) [![Google Group](https://img.shields.io/badge/-Google%20Group-lightgrey.svg)](https://groups.google.com/forum/#!forum/jupyter)

# Jupyter Dynamic Dashboards from Notebooks

Extension for Jupyter Notebook that enables the layout and presentation of grid-based dashboards from notebooks.

![Dashboard layout screenshot](etc/dashboards_intro.png)

This repository is a portion of the `jupyter-incubator/dashboards` effort which covers:

* [Arranging](https://github.com/jupyter-incubator/dashboards) notebook outputs in a grid-layout (**this repo**)
* [Bundling](https://github.com/jupyter-incubator/dashboards_bundlers) notebooks and associated assets for deployment as dashboards
* [Serving](https://github.com/jupyter-incubator/dashboards_server) notebook-defined dashboards as standalone web apps

It is also has close ties to [jupyter-incubator/declarativewidgets](https://github.com/jupyter-incubator/declarativewidgets) which provides one way (but not the only way) of enabling rich interactivity in notebook-defined dashboards.

## What It Gives You

* Dashboard layout mode for arranging notebook cell outputs in a grid-like fashion
* Dashboard view mode for interacting with an assembled dashboard within the Jupyter Notebook
* Ability to share notebooks that have dashboard layout metadata in them with other Jupyter Notebook users for layout and viewing
* Ability to deploy dashboards as standalone web applications when used in conjunction with the [dashboards_bundlers](https://github.com/jupyter-incubator/dashboards_bundlers) and [dashboards_server](https://github.com/jupyter-incubator/dashboards_server) projects

## Try It

If you want to try the dashboard extension and demos without installing it yourself, visit the [jupyter-incubator/showcase binder](http://mybinder.org/repo/jupyter-incubator/showcase). If the binder site is full, try the tmpnb instance at [http://jupyter.cloudet.xyz](http://jupyter.cloudet.xyz).

Note that both of these deployments tend to lag the latest stable release.

## Install It

### Prerequisites

* Jupyter Notebook 4.2.x, 4.1.x, or 4.0.x running on Python 3.x or Python 2.7.x
* Edge, Chrome, Firefox, or Safari

Note: If you're running IPython Notebook 3.2.x, you can install the older 0.1.x version of the extension.

### Dashboard Layout and Preview

In Jupyter Notebook 4.2, you install and activate the dashboard layout and preview features in two commands like so:

```bash
# install the python package
pip install jupyter_dashboards

# Install all parts of the extension to the active conda / venv / python env
# and enable all parts of it in the jupyter profile in that environment
# See jupyter dashboards quick-setup --help for other options (e.g., --user)
jupyter dashboards quick-setup --sys-prefix
# The above command is equivalent to this sequence of commands:
# jupyter nbextension install --py jupyter_dashboards --sys-prefix
# jupyter nbextension enable --py jupyter_dashboards --sys-prefix
```

In Jupyter Notebook 4.1 and 4.0, you install and activate the extension like so:

```bash
# Install the python package
pip install jupyter_dashboards
# Register the notebook frontend extensions into ~/.local/jupyter
# See jupyter dashboards install --help for other options (e.g., --sys-prefix)
jupyter dashboards install --user --symlink --overwrite
# Enable the JS and server extensions in your ~/.jupyter
jupyter dashboards activate
```

If you also want to download or deploy your dashboards as web applications, read the next section about *Deploying Dashboards*.

### Dashboard Deployment

It's within the scope of the dashboard incubator projects to allow users to both:

1. Create dashboard layouts within notebooks, persist the layout metadata within the notebook JSON, and share those dashboard-notebooks with other Jupyter users (this project).
2. Convert and deploy dashboard-notebooks as standalone web applications (the [jupyter-incubator/dashboard_bundlers](https://github.com/jupyter-incubator/dashboards_bundlers) and [jupyter-incubator/dashboards_server](https://github.com/jupyter-incubator/dashboards_server) projects).

We consider the code which addresses the first use case stable for the time being. On the other hand, we are actively maturing support for the latter use case by following our [dashboard deployment roadmap](https://github.com/jupyter-incubator/dashboards/wiki/Deployment-Roadmap) which largely seeks to address the [threats identified](https://github.com/jupyter-incubator/dashboards/wiki/Deployed-Dashboard-Threat-Analysis) in our initial proof-of-concept deployment mechanisms.

If you'd like to try the **experimental** support for deploying dashboards as standalone web apps today, see the [jupyter-incubator/dashboards_bundlers](https://github.com/jupyter-incubator/dashboards_bundlers) README for details.

## Uninstall It

In Jupyter Notebook 4.2:

```bash
# Remove all parts of the extension from the active conda / venv / python env
# See jupyter dashboards quick-remove --help for other options (e.g., --user)
jupyter dashboards quick-remove --sys-prefix
# The above command is equivalent to this sequence of commands:
# jupyter nbextension disable --py jupyter_dashboards --sys-prefix
# jupyter nbextension uninstall --py jupyter_dashboards --sys-prefix

# Remove the python package
pip uninstall jupyter_dashboards
```

In Jupyter Notebook 4.0 and 4.1:

```bash
# Disable extensions, but no way to remove frontend assets in this version
jupyter dashboards deactivate

# Remove the python package
pip uninstall jupyter_dashboards
```

## Develop It

This repository is setup for a Dockerized development environment. On a Mac, do this one-time setup if you don't have a local Docker environment yet.

```bash
brew update

# make sure you're on Docker >= 1.7
brew install docker-machine docker
docker-machine create -d virtualbox dev
eval "$(docker-machine env dev)"
```

Clone this repository in a local directory that docker can volume mount:

```bash
# make a directory under ~ to put source
mkdir -p ~/projects
cd !$

# clone this repo
git clone https://github.com/jupyter-incubator/dashboards.git
```

Pull a base Docker image and build a subimage from it that includes `bower`, `nodejs`, and `npm` both as a dashboard dev dependency and as a prereq for example notebooks that use declarative widgets.

```bash
cd dashboards
make build
```

Install the necessary JS dependencies. Re-run this command any time your `bower.json` or `package.json` changes.

```bash
make js
```

Run the notebook server in a docker container.

```bash
# run notebook server in container
make dev
```

The final `make` command starts a local Docker container with the critical pieces of the source tree mounted where they need to be to get picked up by the notebook server in the container. Most code changes on your Mac will have immediate effect within the container.

To see the Jupyter instance with extensions working:

1. Run `docker-machine ls` and note the IP of the dev machine.
2. Visit http://THAT_IP:9500 in your browser

See the Makefile for other dev, test, build commands as well as options for each command.

### Develop with Declarative Widgets

If you want [declarative widgets](https://github.com/jupyter-incubator/declarativewidgets) available in you development environment, do the following:

```bash
# On your host, clone the widgets project as a peer of the dashboards folder
git clone https://github.com/jupyter-incubator/declarativewidgets.git

# Build the widgets into a source tarballs
cd declarativewidgets
make sdist

# Run a container that has both
cd ../dashboards
make dev-with-widgets
```

To see the Jupyter instance with both extensions working:

1. Run `docker-machine ls` and note the IP of the dev machine.
2. Visit http://THAT_IP:9500 in your browser

### Develop Against Python 2.7

You can run a development environment against python 2.7 by adding an environment variable to your make calls.

```bash
# Run a development environment against 2.7
make dev-python2
# Run a development environment, with declarative widgets, against 2.7
make dev-with-widgets-python2
# Run unit tests against 2.7
make test-python2
```

## Package It

The dashboard features are implemented as a Jupyter Notebook extension against the stock 4.x version of the notebook project, not a fork.  You should be able to install that tarball using `pip` anywhere you please.

repository: alvarobrac/dashboards

repo_name: alvarobrac/dashboards


text:
# Frame

<img src="screenshots/Frame-animated-demo.gif" height="350" alt="Frame - Demo (Animated)"/>

Test online here: [https://framed.fwd.wf/](https://framed.fwd.wf/) (Currently having trouble with my AWS account)

The first release of Frame was completed and released December 25th, 2018.

Frame is a notetaking / journaling web and desktop application with natural language processing features, that allows users to retrieve informed answers in context to questions they can ask in the UI. Frame also automatically generates summaries (both extractive and abstractive) of the text. This analysis is done in real-time (on save), and can navigated intuitively while still editing the content. Frame is designed for introspective and analytical users (researchers and academics might be most interested in this).

Frame is fully functional without running the Python backend (no online API is available at this time). Most of the analysis is done within the app itself (with no external server calls). The data storage uses localForage (IndexedDB), which allows easy mass distribution for Frame (your data self-contained and never sent anywhere outside the local app or browser). Data can be exported and imported as JSON.

Eventually, a donation-supported / subscription-based edition could be serviced for online users through a server on the cloud, with extended features and protected data storage, and automated data extraction / ingestion.

Note: Frame is currently heavily unoptimized with some UI quirks. The project was created as a proof-of-concept but designed to work as a MVP as well. But it is fully functional!

Download Windows build: [https://www.mediafire.com/folder/n151mdmi7je72/](https://www.mediafire.com/folder/n151mdmi7je72/)

## Web UI

A public-serving site is accessible at [https://framed.fwd.wf/](https://framed.fwd.wf/).

I would deploy on AWS but I'm having trouble with my account right now, as my student email's been deactivated :(

Because Frame's data storage uses the local browser of the user, no user management is needed, as the entries you write are stored in your local browser cache.

## Desktop UI

Download the Windows release of version 0.1.0 here: [https://www.mediafire.com/folder/n151mdmi7je72/](https://www.mediafire.com/folder/n151mdmi7je72/)

There is no MacOS build, but it should be able to be built with no modifications. If you have a Mac and are willing to create and upload a build, reach out! Thanks. Linux will hopefully come soon too (not tested yet).

# Future

???

# Acknowledgements

Additional libraries and references used:

- AllenNLP [https://allennlp.org/](https://allennlp.org/)
- Ant Design [https://ant.design/](https://ant.design/)
- compromise [https://github.com/spencermountain/compromise](https://github.com/spencermountain/compromise)
- Draft.js [https://draftjs.org/](https://draftjs.org/)
- franc [https://github.com/wooorm/franc](https://github.com/wooorm/franc)
- electron-builder [https://www.electron.build/](https://www.electron.build/)
- LocalForage [https://localforage.github.io/localForage/](https://localforage.github.io/localForage/)
- medium-draft [https://github.com/brijeshb42/medium-draft](https://github.com/brijeshb42/medium-draft)
- node-sumbasic [https://github.com/MSVCode/node-sumbasic](https://github.com/MSVCode/node-sumbasic)
- pysummarization [https://pypi.org/project/pysummarization/](https://pypi.org/project/pysummarization/)
- React Draft WYSIWYG [https://jpuri.github.io/react-draft-wysiwyg/#/](https://jpuri.github.io/react-draft-wysiwyg/#/)
- react-aria-tabpanel [https://github.com/davidtheclark/react-aria-tabpanel](https://github.com/davidtheclark/react-aria-tabpanel)
- react-electron-web-boilerplate [https://github.com/MikeyFriedChicken/react-electron-web-boilerplate](https://github.com/MikeyFriedChicken/react-electron-web-boilerplate)
- react-json-view [https://github.com/mac-s-g/react-json-view](https://github.com/mac-s-g/react-json-view)
- react-sortable-tree [https://github.com/frontend-collective/react-sortable-tree](https://github.com/frontend-collective/react-sortable-tree)
- Recharts [https://github.com/recharts/recharts](https://github.com/recharts/recharts)
- uwsgi-nginx-flask-docker [uwsgi-nginx-flask-docker](uwsgi-nginx-flask-docker)

repository: parametrix/frame

repo_name: parametrix/frame


text:
# Parserlib

A c++17 recursive-descent parser library that can parse left-recursive grammars.

## Table Of Contents
[Introduction](#introduction)

[Using the Library](#using-the-library)

[Writing a Grammar](#writing-a-grammar)

[Invoking a Parser](#invoking-a-parser)

[Non-Left Recursion](#non-left-recursion)

[Left Recursion](#left-recursion)

[Customizing a Parser](#customizing-a-parser)

[Simple Matches](#simple-matches)

[Tree Matches](#tree-matches)

[Resuming From Errors](#resuming-from-errors)

## Introduction

Parserlib allows writing of recursive-descent parsers in c++ using the language's operators in order to imitate Extended Backus-Naur Form (EBNF) syntax.

The library can handle left recursion.

Here is a Calculator grammar example:

```cpp
extern Rule<> add;

const auto val = +terminalRange('0', '9');

const auto num = val
               | '(' >> add >> ')';

Rule<> mul = mul >> '*' >> num
           | mul >> '/' >> num
           | num;

Rule<> add = add >> '+' >> mul
           | add >> '-' >> mul
           | mul;
```

The above grammar is a direct translation of the following left-recursive EBNF grammar:

```
add = add + mul
    | add - mul
    | mul

mul = mul * num
    | mul / num
    | num

num = val
    | ( add )

val = (0..9)+
```

## Using the Library

The library is available as headers only, since every class is templated.

In order to use it, you have to have the path to its root include folder in your project's include folder list.

Then, you have to either include the root header, like this:

```cpp
#include "parserlib.hpp"
```

Or use the various headers in the subfolder 'parserlib'.

All the code is included in the namespace `parserlib`:

```cpp
using namespace parserlib;
```

## Writing a Grammar

A grammar can be written as a series of parsing expressions, formed by operators and by functions that create parser objects.

### Terminals

The most basic parser is the `TerminalParser`, which is used to parse a terminal. In order to write a terminal expression, the following code must be written:

```cpp
terminal('x')
terminal("abc")
```

*The terminals in this library are by default of type `char`, but they can be customized to be anything.*

Other types of terminal parsers are:

```cpp
terminalRange('a', 'z') //parses all values between 'a' and 'z'.
terminalSet('+', '-') //parses '+' or '-'.
```

### Sequences

Terminals can be combined in sequences using the `operator >>`:

```cpp
const auto ab = terminal('a') >> terminal('b');
const auto abc = ab >> terminal('c');
```

In order to parse a sequence successfully, all members of that sequence shall parse successfully.

### Branches

Expressions can have branches:

```cpp
const auto this_or_that = terminal("this")
                        | terminal("that");
```

Branches are followed in top-to-bottom fashion.
If a branch fails to parse, then the next branch is selected, until a branch is found or no more branches exist to follow.

### Loops

- The `operator *` parses an expression 0 or more times.
- The `operator +' parses an expression 1 or more times.

```cpp
+(terminalRange('0', '9')) //parse a digit 1 or more times.
```

### Optionals

A parser can be made optional by using the `operator -`:

```cpp
-terminalSet('+', '-') >> terminalRange('0', '9') //parse a number; the sign is optional.
```

### Conditionals

- The `operator &` allows parsing an expression without consuming any tokens; it returns true if the parsing succeeds, false if it fails. It can be used to test a specific series of tokens before parsing.
- The `operator !` inverts the result of a parsing expression; it returns true if the expression returns false and vice versa.

```cpp
!terminalSet('=', '-') >> terminalRange('0', '9') //parse an integer without a sign.
```

### Matches

- The `operator ==` allows the assignment of a match id to a production; [the created match does not have any children](#simple-matches).
- The `operator >=` allows the assignment of a match id to a production; [the created match has children matches](#tree-matches).

```cpp
(-terminalSet('+', '-') >> terminalRange('0', '9')) == std::string("int")
```

## Invoking a Parser

In order to invoke a parser, the appropriate `ParseContext` instance must be created.

```cpp
//declare a grammar
const auto grammar = (-terminalSet('+', '-') >> terminalRange('0', '9')) == std::string("int");

//declare an input
std::string input = "123";

//declare a parse context over the input
ParseContext<> pc(input);

//parse
const bool ok = grammar(pc);

//iterate over recognized matches
for(const auto& match : pc.matches()) {
    if (match.id() == "int") {
        const auto parsedString = match.content();
        //process int
    }
}
```

## Non-left Recursion

Rules allow the writing of recursive grammars.

```cpp
//whitespace
const auto whitespace = terminal(' ');

//integer
const auto integer = terminalRange('0', '9');

//forward declaration of recursive rule
extern Rule<> values;

//value; it is recursive
const auto value = integer
                 | terminal('(') >> values >> terminal(')');

//rule
Rule<> values = value >> whitespace >> values;
```

## Left Recursion

The library can parse left recursive grammars.

```cpp
//the recursive rule
extern Rule<> expression;

//and integer is a series of digits
const auto integer = +terminalRange('0', '9');

//a value is either an integer or a parenthesized expression
Rule<> value = integer
             | '(' >> expression >> ')';

//multiplication
Rule<> mul = mul >> '*' >> value
           | mul >> '/' >> value
           | value;

//addition
Rule<> add = add >> '+' >> mul
           | add >> '-' >> mul
           | mul;

//the root rule
Rule<> expression = add;
```

## Customizing a Parser

The class ParseContext is a template and has the following signature:

```cpp
template <class SourceType, class MatchIdType, class SourcePositionType> class ParseContext;
```

It allows customizing the source type, the match id type and the source position type.

### Customizing the source type

By default, a ParseContext instance will use an `std::string` as an input source. But this can be changed to accomodate any STL like container.

For example, the source can be a static array of integers:

```cpp
ParseContext<std::array<int, 1000>> pc(input);
```

### Customizing the match id type

The default match id type is `std::string`, but usually it shall be an integer or an enumeration. It's also good for performance reasons to replace `std::string` with a numeric value, since match ids are created and destroyed as parsing is performed.

Example:

```cpp
ParseContext<std::string, int> pc(input);
```

### Customizing character processing

The parse context's parameter named '`SourcePositionType' allows the customization of character processing:
- customizing comparison of elements, for example in order to implement case insensitive parsing.
- providing extra information regarding the source, for example line and oclumn numbers.
- customizing the newline character sequence.

The library already provides two classes for the above:
- class `SourcePosition<class SourceType, bool CaseSensitive>` is the most basic class that just contains an iterator for the current position; it allows for statically using either case sensitive or case insensitive parsing.
- class `LineCountingSourcePosition<class SourceType, bool CaseSensitive, class NewlineTraits>` extends the class `SourcePosition` with line and column information, and it also allows the specification of newline sequence, which, by default, is implemented by class `DefaultNewlineTraits` that recognizes the character `\n` as the newline separator.

Examples:

```cpp
//case insensitive parsing
ParseContext<std::string, int, SourcePosition<std::string, false>> pc(input);

//case sensitive parsing with line counting
ParseContext<std::string, int, LineCountingSourcePosition<std::string>> pc(input);

//case insensitive parsing with line counting and custom newline traits
ParseContext<std::string, int, LineCountingSourcePosition<std::string, false, CustomNewlineTraits>> pc(input);
```

## Simple Matches

The `operator ==` allows the creation of a match, when an expression parses successfully. The right hand side should be an expression which evaluates to the match id expected by the parse context. Example:

```cpp
enum TYPE {
    A, B, C
};

const auto a = terminal('A') == A;
const auto b = terminal('B') == B;
const auto c = terminal('B') == C;
const auto grammar = a >> b >> c;

std::string input = "ABC";
ParseContext<std::string, Type> pc(input);

const bool ok = grammar(pc);
for(const auto& match : pc.matches()) {
    std::cout << match.content() << " = " << match.id() << std::endl;
}
```

The above produces the output:

```
A = 0
B = 1
C = 2
```

## Tree Matches

The `operator >=` allows the creation of a match, like the `operator ==`, with a difference: all matches created within the context of the expression are placed as children matches.

This allows matches to also be trees, instead of a flat list.

In the following example, an IP4 address is returned as a tree match, with the following structure:

```
IP4_ADDRESS
    HEX_BYTE
        HEX_DIGIT
        HEX_DIGIT
    HEX_BYTE
        HEX_DIGIT
        HEX_DIGIT
    HEX_BYTE
        HEX_DIGIT
        HEX_DIGIT
    HEX_BYTE
        HEX_DIGIT
        HEX_DIGIT
```

Here is the code:

```cpp
enum TYPE {
    ZERO,
    ONE,
    TWO,
    THREE,
    FOUR,
    FIVE,
    SIX,
    SEVEN,
    EIGHT,
    NINE,
    A,
    B,
    C,
    D,
    E,
    F,
    HEX_DIGIT,
    HEX_BYTE,
    IP4_ADDRESS
};

const auto zero  = terminal('0') == ZERO ;
const auto one   = terminal('1') == ONE  ;
const auto two   = terminal('2') == TWO  ;
const auto three = terminal('3') == THREE;
const auto four  = terminal('4') == FOUR ;
const auto five  = terminal('5') == FIVE ;
const auto six   = terminal('6') == SIX  ;
const auto seven = terminal('7') == SEVEN;
const auto eight = terminal('8') == EIGHT;
const auto nine  = terminal('9') == NINE ;

const auto a = terminal('A') == A;
const auto b = terminal('B') == B;
const auto c = terminal('C') == C;
const auto d = terminal('D') == D;
const auto e = terminal('E') == E;
const auto f = terminal('F') == F;

const auto hexDigit = (zero | one | two | three | four | five | six | seven | eight | nine | a | b | c | d | f) >= HEX_DIGIT;

const auto hexByte = (hexDigit >> hexDigit) >= HEX_BYTE;

const auto ip4Address = (hexByte >> terminal('.') >> hexByte >> terminal('.') >> hexByte >> terminal('.') >> hexByte) >= IP4_ADDRESS;

const std::string input = "FF.12.DC.A0";

ParseContext<std::string, TYPE> pc(input);
using Match = typename ParseContext<std::string, TYPE>::Match;

const bool ok = ip4Address(pc);

assert(ok);
assert(pc.matches().size() == 1);

const Match& match = pc.matches()[0];

std::stringstream stream;
stream << match.children()[0].children()[0].content();
stream << match.children()[0].children()[1].content();
stream << '.';
stream << match.children()[1].children()[0].content();
stream << match.children()[1].children()[1].content();
stream << '.';
stream << match.children()[2].children()[0].content();
stream << match.children()[2].children()[1].content();
stream << '.';
stream << match.children()[3].children()[0].content();
stream << match.children()[3].children()[1].content();
const std::string output = stream.str();
std::cout << output;
```

The above prints the input, which is the value `FF.12.DC.A0`.

## Resuming From Errors

In order to resume from errors, the special `operator ~()` can be used to create an `error resume point`.

An `error resume point` shall be combined with `operator >>()` to create a sequence of parsers, in which the parsers before the `error resume point` may create an error, and then the `error parser` will try to resume parsing from the `error resume point`.

Here is an example of parsing a terminal enclosed in single quotes:

```cpp
const auto ws = *terminal(' ');
const auto letter = terminalRange('a', 'z') | terminalRange('A', 'Z');
const auto digit = terminalRange('0', '9');
const auto character = letter | digit;
const auto terminal_ = ('\'' >> *(character - '\'') >> ~terminal('\'')) == "terminal";
const auto grammar = ws >> *(terminal_ >> ws);
```

If an error happens when parsing a terminal, then the parser will look for the single quote symbol `\'` in order to continue parsing.

repository: axilmar/parserlib

repo_name: axilmar/parserlib


text:
This module implements the [Server
Optimization](https://xmpp.org/extensions/xep-0410.html#serveroptimization)
part of [XEP-0410: MUC Self-Ping]

# Usage

The module is loaded on MUC components:

```lua
Component "muc.example.com" "muc"
modules_enabled = {
    "muc_ping";
}
```

# Configuration

No options.

# Compatibility

It should work with Prosody up until 0.10.x.

Prosody 0.11.x and trunk natively supports XEP-0410 so this module is **not** needed.

repository: kcybulski/prosody-modules

extension: markdown

repo_name: kcybulski/prosody-modules


text:
# Data

## Header

* the appropriate header information for the data is located here: [header-row.csv](header-row.csv)

## Filtering
* Data are filtered out if:
    - speed is less than 5km/hr
    - values fall within unrealistic conditions (manual)

repository: ubc-micromet/TIHMMI

repo_name: ubc-micromet/TIHMMI