text:
# 1. Introduction

-   This document describes the proposed changes in TF TripleO Heat Templates to
    introduce deployments’ support for Intel PAC N3000 boards with full hardware
    flow offload mode.

-   Blueprint/Feature Lead:  Salvatore Morsa<EMAIL_ADDRESS>)
-   Core team:
    -   Pattela Jayaragini<EMAIL_ADDRESS>)
    -   Roberto Pennati<EMAIL_ADDRESS>)
-    Jira Story : <https://jira.tungsten.io/browse/TFF-32>

# 2. Problem statement

TF vRouter-DPDK integration with Intel PAC N3000 board ([https://jira.tungsten.io/browse/TFF-22](https://jira.tungsten.io/browse/TFF-22))
allows to offload flows processing into hardware (network card). Enabling that
integration means configuring the host system to support Intel PAC N3000 and
launching TF vRouter-DPDK with required command line arguments.

To automate the installation process supporting such options requires changes in
deployment templates/scripts. Initial support will be added to TF TripleO Heat
Templates.

# 3. Proposed solution

The proposed solution defines a set of new parameters as a deployment option for
TF TripleO Heat Templates. Those parameters allow enabling support for configuring
and running platform in full hardware flow offload mode for Intel PAC N3000 card.

The goal is to automate the deployment process as much as possible so that
templates/scripts generate low level inputs for TF vRouter-DPDK agent arguments
(provided as a vRouter command line argument)

Modified templates allow configuring Intel PAC N3000 card and host operating system,
including: booting card BMC image, binding card’s PF (physical function) to required
drivers, creating VFs (virtual functions) and binding them to driver (vfio-pci).

## 3.1 Alternatives considered

TF vRouter command line arguments specific to the N3000 based offload mode can be
provided by the user explicitly while setting configuration for deployments by
adding them to the `ContrailDpdkOptions` parameter for `ContrailDpdk` role.
Disadvantage of this approach is that it requires knowledge of PCI addresses assigned
to Intel PAC N3000 board and depending on chosen option may require generation of
complex vRouter command line arguments which would be error prone.

TF TripleO Templates support VFs creation (intended for ContrailSriov Role), however,
they do not provide an option to set a different driver for VF than default. In case
of TF vRouter with integrated support for Intel PAC N3000 full hardware flow offload
`vfio-pci` driver for VF should be set (instead of default `virtio-pci` binding).
Additionally specific drivers are required for physical function (other than default
ones) which also currently is not supported.

## 3.2 API schema changes

No expected changes to APIs.

## 3.3 User workflow impact

The user (admin deploying platform) can explicitly enable deployment support for Intel
PAC N3000 boards in full hardware flow offload mode (by default disabled).

This behaviour is controlled by new parameters for ContrailDpdk Role:

______________________________________________________________________________________
|                                        |                                           |
|  Tripleo Heat Parameters name          |  Parameter Attributes                     |
|  (ContrailDpdk Role)                   |                                           |
|________________________________________|___________________________________________|
|                                        |                                           |
| ContrailSmartNicN3000HwOffloadEnabled  | type: boolean                             |
|                                        | description: main parameter determining   |
|                                        |              if hardware offload for Intel|
|                                        |              PAC N3000 will be enabled.   |
|                                        |              It requires                  |
|                                        |                                           |
|                                        |      ContrailSettings.NIC_OFFLOAD_ENABLE  |
|                                        |                                           |
|                                        |              to set to true (otherwise    |
|                                        |              only slowpath is supported)  |
|                                        | default: false                            |
|----------------------------------------|-------------------------------------------|
|                                        |                                           |
| ContrailSmartNicN3000HwOffloadSettings | type: json (map)                          |
|                                        | description: json formatted map containing|
|                                        |              additional configuration     |
|                                        |              variables. Valid (used) only |
|                                        |              when                         |
|                                        |                                           |
|                                        |   ContrailSmartNicN3000HwOffloadEnabled   |
|                                        |              is set to true               |
|                                        |                                           |
|                                        |  default: {} (empty map, note: “keys”     |
|                                        |           can have their own default      |
|                                        |           values which in such case are   |
|                                        |           used)                           |
--------------------------------------------------------------------------------------

`ContrailSmartNicN3000HwOffloadSettings` contains keys allowing user to specify values
for optional parameters:
______________________________________________________________________________________
|                                        |                                           |
| ContrailSmartNicN3000HwOffloadSettings |                Description                |
| key name                               |                                           |
|________________________________________|___________________________________________|
|                                        |                                           |
| N3000SriovNumVFs                       | type: number                              |
|                                        | description: number of VFs to be created  |
|                                        |              on Intel PAC N3000 card.     |
|                                        |              Accepted values from 1 to 28 |
|                                        | default: 16                               |
|----------------------------------------|-------------------------------------------|
|                                        |                                           |
| N3000InsertType                        | type: string                              |
|                                        | description: defines how flows are being  |
|                                        |              inserted. Valid values:      |
|                                        |                                           |
|                                        | csr - using synchronous hardware register |
|                                        |       writing through management interface|
|                                        | flr - using implementation specific       |
|                                        |       packets, containing flow details,   |
|                                        |       sent through VF0 slow-path interface|
|                                        |                                           |
|                                        | default value: None (not set, uses vRouter|
|                                        |                default)                   |
|----------------------------------------|-------------------------------------------|
|                                        |                                           |
| N3000PhysQueuesNum                     | type: number                              |
|                                        | description: defines number of queues for |
|                                        |              Intel PAC N3000 card physical|
|                                        |              ports                        |
|                                        | default value: None (not set, uses vRouter|
|                                        |                default)                   |
|----------------------------------------|-------------------------------------------|
|                                        |                                           |
| N3000VFsQueuesNum                      | type: number                              |
|                                        | description: defines number of queues for |
|                                        |              N3000 VFs                    |
|                                        | default value: None (not set, uses vRouter|
|                                        |                default)                   |
|----------------------------------------|-------------------------------------------|
|                                        |                                           |
| N3000StaticLagEnabled                  | type: boolean                             |
|                                        | description: when set to true enables     |
|                                        |              static LAG on physical ports |
|                                        |              of Intel PAC N3000 card      |
|                                        | default value: None (not set, uses vRouter|
|                                        |                default)                   |
--------------------------------------------------------------------------------------

## 3.4 UI changes

None (no expected changes to UI)

## 3.5 Notification impact

None (no expected changes to notification)

# 4. Implementation

Additional parameters are added into the ContrailDpdk role (described in User workflow
impact). Parameter values are processed and consumed by templates/scripts for
ContrailDpdk role run in the pre-network phase ContrailDpdk role is extended with
optional code allowing to deploy nodes with Intel PAC N3000 support enabled.

## 4.1 Intel PAC N3000 card and host configuration

Added template responsible for Intel PAC N3000 card configuration - booting card image
and host operating system configuration - binding card’s PF (physical function) to required
driver, creating VFs (virtual functions) and binding them to driver (vfio-pci).

To keep desired settings persistent above configuration steps have to be done on each power
on of node. This is managed by a new systemd service launched when the operating system
starts.

## 4.2 TF vRouter command line arguments

Template responsible for handling contrail init container is enhanced with code generating
command line arguments specific to TF vRouter integrated with Intel PAC N3000 card in full
hardware flow offload mode. This code is only invoked when Intel PAC N3000 support is
enabled and based on user provided inputs. All required arguments are generated and passed
to be used by vRouter.

# 5. Performance and scaling impact

None (no expected changes to performance nor to scaling as all new functionality is optional
and concerns deployment stage)

# 6. Upgrade

N/A

# 7. Deprecations

None

# 8. Dependencies

Customized operating system image for nodes with enabled support for Intel PAC N3000 with
full hardware flow offload - installed: Intel OPAE drivers and tools + igb_uio driver

# 9. Security Considerations

None

# 10. Testing

Testing of deployment RHOSP 16.1 + TF with added modifications for both cases: disabled
(default) and enabled (explicitly set by user) support for Intel PAC N3000 card in full
offload mode.

# 11. Documentation Impact

Documentation describing new parameters and steps required to enable platform (RHOSP16 +
TF) deployment with support for PAC N3000 board which utilizes full hardware flow offload
mode.

# 12. References

N/A

repository: tungstenfabric/tf-specs

repo_name: tungstenfabric/tf-specs


text:
Tiling Landcover Rasters for Scenarios
======================================

This repo contains a script ``wallpaper_raster.py`` that can be used to tile one part of a raster into another given vectors that specify the areas. It can be used at the command line as follows:

```
python wallpaper_raster.py --raster_path_list .\Test_Data\lulc --scenarios_vector_path .\Test_Data\Scenarios.shp --parcels_vector_path .\Test_Data\Test_Parcels.shp
```

Command line arguments
----------------------

 * ``--raster_path_list`` -- a list of at least one path to single band rasters on disk that will be used to wallpaper.
 * ``--scenarios_vector_path`` -- a path to a single layer vector containing any number of polygon features. These features are uniquely identified by a field name of ``"Scenario"`` which can be overridden with the command line argument of ``--scenario_id_field [alternatve field name]``. The features in this vector indicate a single region in each of the rasters given in ``raster_path_list`` which should be used to tile into parcels.
 * ``parcels_vector_path`` -- a path to a single layer vector containing polygon features that indicate where tiling should occur in a given raster. The values written into these regions are copied from the polygons indicated in the Scenarios vector.

Output
------

Output will be generated in a folder in the current working directory called ``"wallpaper_workspace"`` this value can be overriden with the ``--workspace_dir`` command line argument. After a successful run, the directory will contain a set of GeoTiff files named ``{raster_base}_{scenario}.tif`` where ``raster_base`` is the base name of the raster processsed from the ``--raster_path_list`` argument and ``scenario`` is the value of the feature field in the vector given by ``--scenarios_vector_path``. These files will have the coverages indicated by the vector defined at ``parcels_vector_path_list``.

Installation/Requirments
------------------------

Dependancies are specified in `requirements.txt`. Additionally you can use the `therealspring/inspring:latest` docker container to run this script as follows:

```
docker run --rm -it -v %CD%:/usr/local/workspace therealspring/inspring:latest .\wallpaper_raster.py --raster_path_list .\Test_Data\lulc --scenarios_vector_path .\Test_Data\Scenarios.shp --parcels_vector_path .\Test_Data\Test_Parcels.shp
```

If using a Docker container, note that file paths must be below and relative to the current working directory (``%CD%`` on windows and ```pwd``` on Linux).

repository: natcap/wallpaper-scenarios

branch_name: refs/heads/main

extension: md

license_type: permissive

repo_name: natcap/wallpaper-scenarios


text:
---
layout: post
title: "Setting Up OpenVPN on Debian Wheezy"
date: 2015-03-29 21:32:41 EDT
excerpt: |
  Set it up!  I really thought it'd be easy to
just set up and go. Setting up a static key VPN using **[OpenVPN][]** [is really
straightforward][1] but we don't use static keys out here. It's a good start
though, in terms of familiarizing yourself with how OpenVPN works and all but
holy balls, lol. I remember seeing a tool that created a VPN automatically for
you using your own DigitalOcean[^1] account to handle making the VPS. For
$5/month, your own controlled VPN sounds really good. But as always, I was
curious how I could incorporate this VPN building into [oa][]. OpenVPN can use
TLS for its encryption since I figured since I managed to get the blog using
TLS, why not have the VPN do the same?[^2].

Before we continue, I should remind you that this is a reflection post of me
setting up OpenVPN on Debian. If you're looking to do so yourself, check out
[Debian's][2] and [OpenVPN's][3] official documentation before continuing here.

## Installing OpenVPN {#installing-openvpn}

A bit of background here, I initially assumed the version of OpenVPN installed
on Debian Wheezy to be really freaking old. It wasn't _incredibly_ old, but the
packages I needed to make this easy for use weren't available via OpenVPN's
sources so I stuck with the version in Debian for now[^3]. Getting those
packages installed are as simple as running the following:

{% highlight bash %}
$ sudo apt-get install openvpn
$ sudo apt-get install openvpn-blacklist
{% endhighlight %}

The second package `openvpn-blacklist` gives you `openvpn-vulnkey` to check for
bad 2048-bit keys when used pre-shared keys. Useful if you're using that
approach but we won't do that here.

## Configuring OpenVPN {#configuring-openvpn}

From here, we'd copy over the directory that Debian's version of OpenVPN
provides for quick-and-easy setting up of SSL certificates and keys.

{% highlight bash %}
$ sudo cp /usr/share/doc/openvpn/examples/easy-rsa/2.0 /etc/openvpn/rsa -Rv
{% endhighlight %}

After that, you're going to want to update the variables files that'd be used
for the generation of the certificates and the likes. That file would be located
at `/etc/openvpn/rsa/vars`.[^4]

{% highlight bash %}
export EASY_RSA=/etc/openvpn/easyrsa

export CA_EXPIRE=100
export KEY_CONFIG=`$EASY_RSA/whichopensslcnf $EASY_RSA`
export KEY_COUNTRY="US"
export KEY_PROVINCE="NY"
export KEY_CITY="NewYork"
export KEY_ORG="stark.industries" # This can be anything.
export<EMAIL_ADDRESS>export<EMAIL_ADDRESS>export KEY_NAME=vpn.stark
export KEY_OU=vpn.stark
export KEY_SIZE=2048
export KEY_EXPIRE=100
export KEY_DIR="$EASY_RSA/keys"

# Issue rm -rf warning
echo "NOTE: If you run ./clean-all, I will be doing a rm -rf on $KEY_DIR"

export PKCS11_MODULE_PATH="dummy"
export PKCS11_PIN="dummy"

export PKCS11_MODULE_PATH=/etc/openvpn/pkcs11
export PKCS11_PIN=3919

export OPENSSL="openssl"
export PKCS11TOOL="pkcs11-tool"
export GREP="grep"
{% endhighlight %}

With the variables down, you can go ahead and set up the configuration of your
VPN server now. Here's a sample configuration. Encryption and the likes are
disabled so that you can slowly upgrade the ciphers and authentication for other
devices you might want to support.

{% highlight bash %}
port 1194
proto udp
dev tun
server <IP_ADDRESS> <IP_ADDRESS>
tls-server
ca /etc/openvpn/easyrsa/keys/ca.crt
cert /etc/openvpn/easyrsa/keys/server.crt
key /etc/openvpn/easyrsa/keys/server.key
dh /etc/openvpn/easyrsa/keys/dh2048.pem
log-append /var/log/openvpn.log
status /var/log/openvpn-status.log
ifconfig-pool-persist ipp.txt
verb 3
mute 10
user nobody
persist-key
persist-tun
comp-lzo
keepalive 10 120
cipher none
auth none
push "dhcp-option DNS <IP_ADDRESS>"
push "redirect-gateway def1 bypass-dhcp local"
{% endhighlight %}

The setup of the configuration above is really compressed, I apologize. But I
didn't want to litter it with potentially wrong documentation. I haven't found a
hub of information about the configuration options available in OpenVPN either
so that made things a bit more difficult. I'll update this post with information
when I can.

## Building Certificates {#build-certificates}

Now here comes the relatively fun part. Only because it's mostly automated. The
`easy-rsa` folder has a few scripts to handle the generation of the SSL
certificates and keys. The following commands help you walk through that
process. First things first, prime the environment to work with the scripts
provided.

{% highlight bash %}
$ cd /etc/openvpn/rsa
$ source vars
{% endhighlight %}

Then sterilize the environment.
{% highlight bash %}
$ ./clean-all
{% endhighlight %}

Now build the server-side SSL requirements (your CA and VPN key).

{% highlight bash %}
$ ./build-dh
$ ./build-ca --batch
$ ./build-key-server --batch server
{% endhighlight %}

And now you'd generate keys for the devices you'd want to connect to VPN.

{% highlight bash %}
$ ./build-key --batch client_laptop_personal
$ ./build-key --batch client_laptop_work
$ ./build-key --batch client_phone
$ ./build-key --batch client_tablet
{% endhighlight %}

> Keep in mind, the only files you'd want are the `server.ca` and the keys and
> certificates from `keys/client_*` for sharing amongst your devices. Do *not*
> share anything else. If you're familiar with PGP, I recommend generating a
> temporary key for the server to encrypt and then share said keys over a
> trusted medium like SSH. If someone got a handle of these keys, then they
> could masquerade as one of the provided devices on your private network;
> a big no-no.

## Spinning Things Up

You got your configuration in place, your keys and certificates on the
appropriate devices and now the only thing left is to _start_ the server. Long
live `sysvinit`!

{% highlight bash %}
$ sudo service openvpn restart
{% endhighlight %}

On the server side, that's all that's needed for OpenVPN. You'd want to open up
port *1194* over UDP (or TCP, if you changed it to that) for connectivity
purposes if you're using a firewall on your server. You'd also want to allow for
NAT forwarding, in the event you got this hooked up to your router which is in
turn hooked up to your console (XBox, Ouya, Playstation, etc).

{% highlight bash %}
$ export VPN_SUBNET="<IP_ADDRESS>" # Change this to the subnet you've specified.
$ export IF_DEVICE="eth0"      # Change this to the device that gets you the Internetz.
$ iptables -t nat -A POSTROUTING -s $VPN_SUBNET/24 -o $IF_DEVICE -j MASQUERADE
$ unset VPN_SUBNET
{% endhighlight %}

## Next Steps

From here, you can do a few things:

  1. Experiment with different ciphers and authorizations!
     Try out `AES-256-CBC`, the one commonly used for higher grade encryption.

  1. Enable **client-to-client** in your server so you can chat with other devices
     on the network. Useful for making private Web services avaiable on only VPN
     users.

[openvpn]: http://openvpn.net/
[oa]: http://git.jacky.wtf/oa
[1]: https://wiki.debian.org/OpenVPN#Static-Key_VPN
[2]: https://wiki.debian.org/OpenVPN#Installation
[3]: https://www.openvpn.net/index.php/open-source/documentation/howto.html
[^1]: I think this was extended to Linode as well.
[^2]: Next time I get this cynical, punch me in the jaw and tell Batman to run me over.
[^3]: I'm working on making the newer versions a bit more fun to use for Debian.
[^4]: Stark Industries is just the more popular subsidiary of Tony's :grin:.
[^5]: This is light work compared to building a replacement for GnuPG!

license: MIT

repository: jalcine/website

branch_name: refs/heads/develop

extension: markdown

gha_language: HTML

repo_name: jalcine/website


text:
# Conway's game of life

### Description

Conway's game of life

### Screencast

![demo.gif](./demo-0.3.1.gif)

### Context

The `server/Game.js` is based from `https://github.com/denistsoi/game-of-life` which has been ported over to this repository. The code itself is based from codingtrain's

### instructions

> Create a multiplayer Web app version of Game of Life, with the following functions.

1. Implement the Game of Life in browser. You can use any representation such as `<canvas>`, simple DOM manipulation or even `<table>` cells.

2. The game should tick automatically at a predefined interval, at say, 1 step per second.

3. The browser connects to an HTTP server, written in Ruby or Node.js (can be any frameworks, e.g. Ruby on Rails, Sinatra, EventMachine, Hapi or just plain listening on a socket). This server allows multiple browser to share the same, synchronized world view.

4. Each client is assigned a random color on initialization. From the browser, clicking on any grid will create a live cell on that grid with the client's color. This change should be synchronized across all connected clients. (You can use any mechanism to achieve this, such as polling, comet or WebSocket)

5. When a dead cell revives by rule #4 "Any dead cell with exactly three live neighbours becomes a live cell, as if by reproduction.", it will be given a color that is the average of its neighbours (that revive it).

6. To make the evolution more interesting, include a toolbar that places some predefined patterns at random places with the player's color, such as those found at [here](https://en.wikipedia.org/wiki/Conway's_Game_of_Life#Examples_of_patterns) (not necessary to implement all, just 3 - 4 is fine).

### todos
- [x] fix syncing issue with server/client
- [x] move configuration to server side
- [x] refactor onMessage to apiHandler
- [x] add color/ random color to server game state (to generate average color)

#### outstanding todos
- [ ] add patterns

- [ ] life cycle indicator
  - [ ] add timer to next cycle
  - [ ] add current life cycle (max-cycles)
- [ ] disable selection of cell if not current player

### How to use

```
npm i
npm run dev:server
npm run start
```

### Author
Denis Tsoi<EMAIL_ADDRESS>
### Licence
MIT

repository: denistsoi/multiplayer-game-of-life

branch_name: refs/heads/master

gha_language: JavaScript

repo_name: denistsoi/multiplayer-game-of-life


text:
## mirage-kv — MirageOS signatures for key/value devices

mirage-kv provides the [Mirage_kv.RO][ro] and [Mirage_kv_lwt.RO][ro-lwt]
signatures the MirageOS key/value devices should implement.

mirage-kv is distributed under the ISC license.

[ro]: https://mirage.github.io/mirage-kv/Mirage_kv.html
[ro-lwt]: https://mirage.github.io/mirage-kv/Mirage_kv_lwt.html

## Installation

mirage-kv can be installed with `opam`:

    opam install mirage-kv

If you don't use `opam` consult the [`opam`](opam) file for build
instructions.

## Documentation

The documentation and API reference is generated from the source
interfaces. It can be consulted [online][doc] or via `odig doc
mirage-kv`.

[doc]: https://mirage.github.io/mirage-kv/

license: ISC

repository: avsm/mirage-duniverse

repo_name: avsm/mirage-duniverse


text:
# Escape from the Glacial Catacombs - A Python-based RPG

An ASCII dungeon-crawler written in Python, based entirely in the command prompt.

The basic gameplay is as follows:
>Choose a name and class for your character, and explore a variety of caves through the use of portals.
>
>Inside these caves are monsters that will randomly appear (think Pokémon-style battles).
>
>Defeating these monsters provides you with XP, eventually levelling you up, increasing HP and MP.
>
>The caves contain different types of chests, and they all contain items that are randomly generated.
>
>As you progress through some caves, you will encounter chests guarded by mini-bosses, these contain a key.
>
>Obtain 2 keys, and you may progress to the final boss via a secret door located in the main room.
>
>Become powerful enough to defeat him through the use of items, spells, and stats acquired on your journey.

This is a final project for a CSI111 class, and allowed me to practice a variety of introductory concepts, including but not limited to:
* Data structure navigation
* List comprehensions
* Saving/Loading Objects as files
* Cleaning input buffer
* Parsing data from files
* Basic animation and game design

Highlights of some game features:
* Level system with both player and enemy scaling
* Random item generation with options for more specific rolls
* Varied spells for each class, each with unique passive bonus
* Transition screen between adventuring and battles
* Two-handed weapons or 1-handed/shield combos

## Getting Started

Check [here](https://github.com/mdverity/TextRPG/releases/tag/v1.0.0) for the most recent executable. Download the `.zip`, extract it, and run `TextRPG.exe`.
Continue reading for instructions on running the scripts locally and additional documentation.

### Prerequisites

This project only utilizes one external Python library:

```
Pygame
```

### Installing

This set of scripts utilizes Pygame's Mixer to load and play music files.

To install Pygame, use pip to install it via CMD/Terminal:

```
pip install pygame
```

Check Pygame's installation [documentation](https://www.pygame.org/wiki/GettingStarted) for additional assitance if necessary.

## To-Do:

* Dual wielding of some sort, maybe:
  * totalDamage = weaponDamageOne + (weaponDamageTwo / 2)
  * Reduced durability for both weapons
* Increased monster variety
* Improved transition performance
* Add additional comments

## Authors

* **Matt Verity** - [mdverity](https://github.com/mdverity)
* **Luc Poirier**

## Acknowledgments

All credit for music goes to [**lespaulcustom311**](https://www.youtube.com/user/lespaulcustom311).
Thank you for allowing me to use your awesome content.

## License

This project is licensed under the MIT License - see the [LICENSE](LICENSE) file for details.

repository: mdverity/TextRPG

repo_name: mdverity/TextRPG


text:
# Components Reference

- [Algorithm](#Algorithm)
- [Calculator](#Calculator)
- [CellData](#CellData)
- [DataArray](#DataArray)
- [FieldData](#FieldData)
- [GeometryRepresentation](#GeometryRepresentation)
- [ImageData](#ImageData)
- [Mesh](#Mesh)
- [PointCloudRepresentation](#PointCloudRepresentation)
- [PointData](#PointData)
- [PolyData](#PolyData)
- [Reader](#Reader)
- [ShareDataSet](#ShareDataSet)
- [SliceRepresentation](#SliceRepresentation)
- [View](#View)
- [Volume](#Volume)
- [VolumeController](#VolumeController)
- [VolumeDataRepresentation](#VolumeDataRepresentation)
- [VolumeRepresentation](#VolumeRepresentation)

## Algorithm

```python
dash_vtk.Algorithm(children, id, port, vtkClass, state, **kwargs)
```

An Algorithm component.
Algorithm is exposing a source or filter to a downstream filter
It takes the following set of properties:
  - vtkClass: vtkClassName
  - state: {}

Keyword arguments:

- children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional)

- id (string; optional):
    The ID used to identify this component.

- port (number; default 0):
    downstream connection port.

- state (dict; optional):
    set of property values for vtkClass.

- vtkClass (string; default 'vtkConeSource'):
    vtkClass name.

[Back to menu](#components-reference)

## Calculator

```python
dash_vtk.Calculator(children, id, port, name, location, arrays, formula, **kwargs)
```

A Calculator component.
Calculator is exposing a source or filter to a downstream filter
It takes the following set of properties:
  - name: 'scalars'    // name of the generated field
  - location: 'POINT'  // POINT/CELL
  - arrays: []         // Name of array to have access in formula
  - formula: fn

Keyword arguments:

- children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional)

- id (string; optional):
    The ID used to identify this component.

- arrays (list of strings; optional):
    List of fields you want available for your formula.

- location (string; default 'POINT'):
    Field location [POINT, CELL, COORDINATE, SCALARS, ].

- name (string; default 'scalars'):
    Field name.

- port (number; default 0):
    downstream connection port.

[Back to menu](#components-reference)

## CellData

```python
dash_vtk.CellData(children, **kwargs)
```

A CellData component.
CellData is exposing a vtkCellData to a downstream element

Keyword arguments:

- children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional)

[Back to menu](#components-reference)

## DataArray

```python
dash_vtk.DataArray(id, type, name, values, numberOfComponents, registration, **kwargs)
```

A DataArray component.
DataArray is creating a vtkDataArray for the container fields
It takes the following set of properties:
  - type: 'Float32Array', 'Float64Array', 'Uint16Array', ...
  - values: [number, number, ...]
  - numberOfComponents: 1,
  - registration: 'addArray', 'setScalars', ...

Keyword arguments:

- id (string; optional):
    The ID used to identify this component.

- name (string; default 'scalars'):
    Field name.

- numberOfComponents (number; default 1):
    Number of components / Tuple size.

- registration (string; default 'addArray'):
    Name of the method to call on the fieldData (addArray, setScalars,
    setVectors...).

- type (string; default 'Float32Array'):
    Typed array name.

- values (list of numbers; optional):
    Actual values to use inside our array.

[Back to menu](#components-reference)

## FieldData

```python
dash_vtk.FieldData(children, **kwargs)
```

A FieldData component.
FieldData is exposing a FieldData to a downstream element

Keyword arguments:

- children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional)

[Back to menu](#components-reference)

## GeometryRepresentation

```python
dash_vtk.GeometryRepresentation(children, id, actor, mapper, property, colorMapPreset, colorDataRange, showCubeAxes, cubeAxesStyle, **kwargs)
```

A GeometryRepresentation component.
GeometryRepresentation is responsible to convert a vtkPolyData into rendering
It takes the following set of properties:
  - actor: Properties to assign to the vtkActor
  - mapper: Properties to assign to the vtkMapper
  - property: Properties to assign to the vtkProperty (actor.getProperty())
  - colorMapPreset: Name of the preset to use for controlling the color mapping
  - colorDataRange: Range to use for the color scale

Keyword arguments:

- children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional)

- id (string; optional):
    The ID used to identify this component.

- actor (dict; optional):
    Properties to set to the actor.

- colorDataRange (list of numbers; default [0, 1]):
    Data range use for the colorMap.

- colorMapPreset (string; default 'erdc_rainbow_bright'):
    Preset name for the lookup table color map.

- cubeAxesStyle (dict; optional):
    Configure cube Axes style by overriding the set of properties
    defined
    https://github.com/Kitware/vtk-js/blob/HEAD/Sources/Rendering/Core/CubeAxesActor/index.js#L703-L719.

- mapper (dict; optional):
    Properties to set to the actor.

- property (dict; optional):
    Properties to set to the actor.property.

- showCubeAxes (boolean; optional):
    Show/Hide Cube Axes for the given representation.

[Back to menu](#components-reference)

## ImageData

```python
dash_vtk.ImageData(children, id, port, dimensions, spacing, origin, direction, **kwargs)
```

An ImageData component.
ImageData is exposing a vtkImageData to a downstream filter
It takes the following set of properties:
  - dimensions: [nx, ny, nz],
  - origin: [0, 0, 0]
  - spacing: [1, 1, 1]
  - direction: [
      1, 0, 0,
      0, 1, 0,
      0, 0, 1
    ]

Keyword arguments:

- children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional)

- id (string; optional):
    The ID used to identify this component.

- dimensions (list of numbers; default [1, 1, 1]):
    Number of points along x, y, z.

- direction (list of numbers; default [  1, 0, 0,  0, 1, 0,  0, 0, 1,]):
    3x3 matrix use to orient the image data.

- origin (list of numbers; default [0, 0, 0]):
    World coordinate of the lower left corner of your vtkImageData
    (i=0, j=0, k=0).

- port (number; default 0):
    downstream connection port.

- spacing (list of numbers; default [1, 1, 1]):
    Spacing along x, y, z between points in world coordinates.

[Back to menu](#components-reference)

## Mesh

```python
dash_vtk.Mesh(id, port, state, **kwargs)
```

A Mesh component.
Mesh is exposing a vtkPolyData to a downstream filter
It takes the following set of properties:
  - state: { mesh: { ...polydata-props }, field: { ...dataArray } }

Keyword arguments:

- id (string; optional):
    The ID used to identify this component.

- port (number; default 0):
    downstream connection port.

- state (dict; default {  mesh: { points: [] },}):
    State of the mesh.

[Back to menu](#components-reference)

## PointCloudRepresentation

```python
dash_vtk.PointCloudRepresentation(xyz, rgb, rgba, scalars, colorMapPreset, colorDataRange, property, **kwargs)
```

A PointCloudRepresentation component.
PointCloudRepresentation expect the following set of properties
  - xyz: [x0, y0, z0, x1, ..., zn]
  - rgb: [...]
  - rgba: [...]
  - scalars: [...]

Keyword arguments:

- colorDataRange (list of numbers; default [0, 1]):
    Data range use for the colorMap.

- colorMapPreset (string; default 'erdc_rainbow_bright'):
    Preset name for the lookup table color map.

- property (dict; optional):
    Properties to set to the actor.property.

- rgb (list of numbers; optional):
    Use RGB values to attach to the points/vertex.

- rgba (list of numbers; optional):
    Use RGBA values to attach to the points/vertex.

- scalars (list of numbers; optional):
    Field values to attach to the points.

- xyz (list of numbers; default [0, 0, 0]):
    Points coordinates.

[Back to menu](#components-reference)

## PointData

```python
dash_vtk.PointData(children, **kwargs)
```

A PointData component.
PointData is exposing a vtkPointData to a downstream element

Keyword arguments:

- children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional)

[Back to menu](#components-reference)

## PolyData

```python
dash_vtk.PolyData(children, id, port, points, verts, lines, polys, strips, connectivity, **kwargs)
```

A PolyData component.
PolyData is exposing a vtkPolyData to a downstream filter
It takes the following set of properties:
  - points: [x, y, z, x, y, z, ...],
  - verts: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...]
  - lines: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...]
  - polys: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...]
  - strips: [cellSize, pointId0, pointId1, ..., cellSize, pointId0, ...]
Cell connectivity helper property:
  - connectivity: 'manual', // [manual, points, triangles, strips]

Keyword arguments:

- children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional)

- id (string; optional):
    The ID used to identify this component.

- connectivity (string; default 'manual'):
    Type of connectivity `manual` or implicit such as `points`,
    `triangles`, `strips`.

- lines (list of numbers; optional):
    lines cells.

- points (list of numbers; optional):
    xyz coordinates.

- polys (list of numbers; optional):
    polys cells.

- port (number; default 0):
    downstream connection port.

- strips (list of numbers; optional):
    strips cells.

- verts (list of numbers; optional):
    verts cells.

[Back to menu](#components-reference)

## Reader

```python
dash_vtk.Reader(children, id, port, vtkClass, url, parseAsText, parseAsArrayBuffer, renderOnUpdate, resetCameraOnUpdate, **kwargs)
```

A Reader component.
Reader is exposing a reader to a downstream filter
It takes the following set of properties:
  - vtkClass: vtk.js reader class name
  - url: string
  - parseAsText: string
  - parseAsArrayBuffer: base64String

Keyword arguments:

- children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional)

- id (string; optional):
    The ID used to identify this component.

- parseAsArrayBuffer (string; optional):
    set binary data to process from base64 string.

- parseAsText (string; optional):
    set text data to process.

- port (number; default 0):
    downstream connection port.

- renderOnUpdate (boolean; default True):
    Automatically render on data loaded.

- resetCameraOnUpdate (boolean; default True):
    Automatically reset camera on data loaded.

- url (string; optional):
    set of url to fetch data from.

- vtkClass (string; default ''):
    vtkClass name.

[Back to menu](#components-reference)

## ShareDataSet

```python
dash_vtk.ShareDataSet(children, id, port, name, **kwargs)
```

A ShareDataSet component.
ShareDataSet capture a dataset or a source and allow it to use it in another
pipeline or representation.

Keyword arguments:

- children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional)

- id (string; optional):
    The ID used to identify this component.

- name (string; default 'shared'):
    Unique dataset name to cross reference.

- port (number; default 0):
    downstream connection port.

[Back to menu](#components-reference)

## SliceRepresentation

```python
dash_vtk.SliceRepresentation(children, id, mapper, actor, property, colorMapPreset, colorDataRange, iSlice, jSlice, kSlice, xSlice, ySlice, zSlice, **kwargs)
```

A SliceRepresentation component.
SliceRepresentation is responsible to convert a vtkPolyData into rendering
It takes the following set of properties:
  - colorBy: ['POINTS', ''],
  - pointSize: 1,
  - color: [1,1,1],

Keyword arguments:

- children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional)

- id (string; optional):
    The ID used to identify this component.

- actor (dict; optional):
    Properties to set to the slice/actor.

- colorDataRange (list of numbers | string; default 'auto'):
    Data range use for the colorMap.

- colorMapPreset (string; default 'erdc_rainbow_bright'):
    Preset name for the lookup table color map.

- iSlice (number; optional):
    index of the slice along i.

- jSlice (number; optional):
    index of the slice along j.

- kSlice (number; optional):
    index of the slice along k.

- mapper (dict; optional):
    Properties to set to the mapper.

- property (dict; optional):
    Properties to set to the volume.property.

- xSlice (number; optional):
    index of the slice along x.

- ySlice (number; optional):
    index of the slice along y.

- zSlice (number; optional):
    index of the slice along z.

[Back to menu](#components-reference)

## View

```python
dash_vtk.View(children, id, style, className, background, interactorSettings, cameraPosition, cameraViewUp, cameraParallelProjection, triggerRender, triggerResetCamera, pickingModes, clickInfo, hoverInfo, **kwargs)
```

A View component.
View is responsible to render vtk.js data.
It takes the following set of properties:
  - `background`: [0.2, 0.3, 0.4]
  - `cameraPosition`: [0, 0, 1]
  - `cameraViewUp`: [0, 1, 0]
  - `cameraParallelProjection`: false

Keyword arguments:

- children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional):
    List of representation to show.

- id (string; optional):
    The ID used to identify this component.

- background (list; default [0.2, 0.3, 0.4]):
    The color of the view background using 3 floating numbers between
    0-1 of Red, Green, Blue component.

- cameraParallelProjection (boolean; default False):
    Use parallel projection (default: False).

- cameraPosition (list; default [0, 0, 1]):
    Initial camera position from an object in [0,0,0].

- cameraViewUp (list; default [0, 1, 0]):
    Initial camera position from an object in [0,0,0].

- className (string; optional):
    Allow user to provide custom className associated to root element.

- clickInfo (dict; optional):
    Read-only prop. To use this, make sure that `pickingModes`
    contains `click`. This prop is updated when an element in the map
    is clicked. This contains the picking info describing the object
    being clicked on.

- hoverInfo (dict; optional):
    Read-only prop. To use this, make sure that `pickingModes`
    contains `hover`. This prop is updated when an element in the map
    is hovered. This contains the picking info describing the object
    being hovered.

- interactorSettings (list; default [  {    button: 1,    action: 'Rotate',  },  {    button: 2,    action: 'Pan',  },  {    button: 3,    action: 'Zoom',    scrollEnabled: True,  },  {    button: 1,    action: 'Pan',    shift: True,  },  {    button: 1,    action: 'Zoom',    alt: True,  },  {    button: 1,    action: 'ZoomToMouse',    control: True,  },  {    button: 1,    action: 'Roll',    alt: True,    shift: True,  },]):
    Configure the interactions.

- pickingModes (list of strings; optional):
    List of picking listeners to bind. The supported values are
    `click` and `hover`. By default it is disabled (empty array).

- style (dict; default {  width: '100%',  height: '100%',}):
    Allow user to override the default View style { width: '100%',
    height: '100%' }.

- triggerRender (number; default 0):
    Property use to trigger a render when changing.

- triggerResetCamera (number; default 0):
    Property use to trigger a resetCamera when changing.

[Back to menu](#components-reference)

## Volume

```python
dash_vtk.Volume(id, port, state, **kwargs)
```

A Volume component.
Volume is exposing a vtkImageData to a downstream filter
It takes the following set of properties:
  - state: { image: { ...imagedata-props }, field: { ...dataArray } }

Keyword arguments:

- id (string; optional):
    The ID used to identify this component.

- port (number; default 0):
    downstream connection port.

- state (dict; default {  image: { dimension: [10, 10, 10] },}):
    State of the volume.

[Back to menu](#components-reference)

## VolumeController

```python
dash_vtk.VolumeController(id, size, rescaleColorMap, **kwargs)
```

A VolumeController component.
VolumeController is a GUI to control the piecewise function

Keyword arguments:

- id (string; optional):
    The ID used to identify this component.

- rescaleColorMap (boolean; default True):
    Use opacity range to rescale color map.

- size (list of numbers; default [400, 150]):
    Controller size in pixels.

[Back to menu](#components-reference)

## VolumeDataRepresentation

```python
dash_vtk.VolumeDataRepresentation(id, dimensions, spacing, origin, rgb, rgba, scalars, scalarsType, mapper, volume, property, colorMapPreset, volumeController, controllerSize, rescaleColorMap, colorDataRange, **kwargs)
```

A VolumeDataRepresentation component.
VolumeDataRepresentation expect the following set of properties
  - dimensions: [10, 20, 5]
  - spacing: [1, 1, 1]
  - origin: [0, 0, 0]
  - rgb: [...]
  - rgba: [...]
  - scalars: [...]
  - scalarsType: Float32Array

Keyword arguments:

- id (string; optional):
    The ID used to identify this component.

- colorDataRange (list of numbers | string; default 'auto'):
    Data range use for the colorMap.

- colorMapPreset (string; default 'erdc_rainbow_bright'):
    Preset name for the lookup table color map.

- controllerSize (list of numbers; default [400, 150]):
    Controller size in pixels.

- dimensions (list of numbers; optional):
    Number of points along x, y, z.

- mapper (dict; optional):
    Properties to set to the mapper.

- origin (list of numbers; optional):
    World coordinate of the lower left corner of your vtkImageData
    (i=0, j=0, k=0).

- property (dict; optional):
    Properties to set to the volume.property.

- rescaleColorMap (boolean; default True):
    Use opacity range to rescale color map.

- rgb (list of numbers; optional):
    Use RGB values to attach to the points/vertex.

- rgba (list of numbers; optional):
    Use RGBA values to attach to the points/vertex.

- scalars (list of numbers; optional):
    Field values to attach to the points.

- scalarsType (string; default 'Float32Array'):
    Types of numbers provided in scalars.

- spacing (list of numbers; optional):
    Spacing along x, y, z between points in world coordinates.

- volume (dict; optional):
    Properties to set to the volume.

- volumeController (boolean; default True):
    Show volumeController.

[Back to menu](#components-reference)

## VolumeRepresentation

```python
dash_vtk.VolumeRepresentation(children, id, mapper, volume, property, colorMapPreset, colorDataRange, **kwargs)
```

A VolumeRepresentation component.
VolumeRepresentation is responsible to convert a vtkPolyData into rendering
It takes the following set of properties:
  - colorBy: ['POINTS', ''],
  - pointSize: 1,
  - color: [1,1,1],

Keyword arguments:

- children (list of a list of or a singular dash component, string or numbers | a list of or a singular dash component, string or number; optional)

- id (string; optional):
    The ID used to identify this component.

- colorDataRange (list of numbers | string; default 'auto'):
    Data range use for the colorMap.

- colorMapPreset (string; default 'erdc_rainbow_bright'):
    Preset name for the lookup table color map.

- mapper (dict; optional):
    Properties to set to the mapper.

- property (dict; optional):
    Properties to set to the volume.property.

- volume (dict; optional):
    Properties to set to the volume.

[Back to menu](#components-reference)

repository: Doc-ding/dash-vtk

repo_name: Doc-ding/dash-vtk


text:
# Strategic 1.2.0
## Painless Strategy Pattern in Ruby and Rails
[![Gem Version](https://badge.fury.io/rb/strategic.svg)](http://badge.fury.io/rb/strategic)
[![rspec](https://github.com/AndyObtiva/strategic/actions/workflows/ruby.yml/badge.svg)](https://github.com/AndyObtiva/strategic/actions/workflows/ruby.yml)
[![Coverage Status](https://coveralls.io/repos/github/AndyObtiva/strategic/badge.svg?branch=master)](https://coveralls.io/github/AndyObtiva/strategic?branch=master)
[![Maintainability](https://api.codeclimate.com/v1/badges/0e638e392c21500c4fbe/maintainability)](https://codeclimate.com/github/AndyObtiva/strategic/maintainability)

`if`/`case` conditionals can get really hairy in highly sophisticated business domains.
Object-oriented inheritance helps remedy the problem, but dumping all
logic variations in domain model subclasses can cause a maintenance nightmare.
Thankfully, the Strategy Pattern as per the [Gang of Four book](https://www.amazon.com/Design-Patterns-Elements-Reusable-Object-Oriented/dp/0201633612) solves the problem by externalizing logic via composition to separate classes outside the domain models.

Still, there are a number of challenges with "repeated implementation" of the Strategy Pattern:
- Making domain models aware of newly added strategies without touching their
code (Open/Closed Principle).
- Fetching the right strategy without the use of conditionals.
- Avoiding duplication of strategy dispatch code for multiple domain models
- Have strategies mirror an existing domain model inheritance hierarchy

`strategic` solves these problems by offering:
- Strategy Pattern support through a Ruby mixin and strategy path/name convention
- Automatic discovery of strategies based on path/name convention
- Ability to fetch needed strategy without use of conditionals
- Ability to fetch a strategy by name or by object type to mirror
- Plain Ruby and Ruby on Rails support

`Strategic` enables you to make any existing domain model "strategic",
externalizing all logic concerning algorithmic variations into separate strategy
classes that are easy to find, maintain and extend while honoring the Open/Closed Principle and avoiding conditionals.

In summary, if you make a class called `TaxCalculator` strategic by including the `Strategic` mixin module, now you are able to drop strategies under the `tax_calculator` directory sitting next to the class (e.g. `tax_calculator/us_strategy.rb`, `tax_calculator/canada_strategy.rb`) while gaining extra [API](#api) methods to grab strategy names to present in a user interface (`.strategy_names`), set a strategy (`#strategy=(strategy_name)` or `#strategy_name=(strategy_name)`), and/or instantiate `TaxCalculator` directly (`.new(*initialize_args)`), with default strategy (`.new_with_default_strategy(*initialize_args)`), or with a strategy from the get-go (`.new_with_strategy(strategy_name, *initialize_args)`). Finally, you can simply invoke strategy methods on the main strategic model (e.g. `tax_calculator.tax_for(39.78)`).

### Example

<img src="strategic-example.png"
alt="Strategic Example" />

1. Include `Strategic` module in the Class to strategize: `TaxCalculator`

```ruby
class TaxCalculator
  include Strategic

  # strategies implement tax_for(amount) method that can be invoked indirectly on strategic model
end
```

2. Now, you can add strategies under this directory without having to modify the original class: `tax_calculator`

3. Add strategy classes having names ending with `Strategy` by convention (e.g. `UsStrategy`) under the namespace matching the original class name (`TaxCalculator::` as in `tax_calculator/us_strategy.rb` representing `TaxCalculator::UsStrategy`) and including the module (`Strategic::Strategy`):

All strategies get access to their context (strategic model instance), which they can use in their logic.

```ruby
class TaxCalculator::UsStrategy
  include Strategic::Strategy

  def tax_for(amount)
    amount * state_rate(context.state)
  end
  # ... other strategy methods follow
end

class TaxCalculator::CanadaStrategy
  include Strategic::Strategy

  def tax_for(amount)
    amount * (gst(context.province) + qst(context.province))
  end
  # ... other strategy methods follow
end
```

(note: if you use strategy inheritance hierarchies, make sure to have strategy base classes end with `StrategyBase` to avoid getting picked up as strategies)

4. In client code, set the strategy by underscored string reference minus the word strategy (e.g. UsStrategy becomes simply 'us'):

```ruby
tax_calculator = TaxCalculator.new(args)
tax_calculator.strategy = 'us'
```

4a. Alternatively, instantiate the strategic model with a strategy to begin with:

```ruby
tax_calculator = TaxCalculator.new_with_strategy('us', args)
```

4b. Alternatively in Rails, instantiate or create an ActiveRecord model with `strategy_name` column attribute included in args (you may generate migration for `strategy_name` column via `rails g migration add_strategy_name_to_resources strategy_name:string`):

```ruby
tax_calculator = TaxCalculator.create(args) # args include strategy_name
```

5. Invoke the strategy implemented method:

```ruby
tax = tax_calculator.tax_for(39.78)
```

Default strategy for a strategy name that has no strategy class is `nil` unless the `DefaultStrategy` class exists under the model class namespace or the `default_strategy` class attribute is set.

This is how to set a default strategy on a strategic model via class method `default_strategy`:

```ruby
class TaxCalculator
  include Strategic

  default_strategy 'canada'
  # ... initialize and other methods
end

tax_calculator = TaxCalculator.new(args)
tax = tax_calculator.tax_for(39.78)
```

If no strategy is selected and you try to invoke a method that belongs to strategies, Ruby raises an amended method missing error informing you that no strategy is set to handle the method (in case it was a strategy method).

## Setup

### Option 1: Bundler

Add the following to bundler's `Gemfile`.

```ruby
gem 'strategic', '~> 1.2.0'
```

### Option 2: Manual

Or manually install and require library.

```bash
gem install strategic -v1.2.0
```

```ruby
require 'strategic'
```

### Usage

Steps:
1. Have the original class you'd like to strategize include `Strategic` (e.g. `def TaxCalculator; include Strategic; end`
2. Create a directory matching the class underscored file name minus the '.rb' extension (e.g. `tax_calculator/`)
3. Create a strategy class under that directory (e.g. `tax_calculator/us_strategy.rb`) (default is assumed as `tax_calculator/default_strategy.rb` unless customized with `default_strategy` class method):
 - Lives under the original class namespace
 - Includes the `Strategic::Strategy` module
 - Has a class name that ends with `Strategy` suffix (e.g. `NewCustomerStrategy`)
4. Set strategy on strategic model using `strategy=` attribute writer method or instantiate with `new_with_strategy` class method, which takes a strategy name string (any case), strategy class, or mirror object (having a class matching strategy name minus the word `Strategy`) (note: you can call `::strategy_names` class method to obtain available strategy names or `::stratgies` to obtain available strategy classes)
5. Alternatively in Rails, create migration `rails g migration add_strategy_name_to_resources strategy_name:string` and set strategy via `strategy_name` column, storing in database. On load of the model, the right strategy is automatically loaded based on `strategy_name` column.
6. Invoke strategy method needed

## API

### Strategic model

#### Class Body Methods

These methods can be delcared in a strategic model class body.

- `::default_strategy(strategy_name)`: sets default strategy as a strategy name string (e.g. 'us' selects UsStrategy) or alternatively a class/object if you have a mirror hierarchy for the strategy hierarchy
- `::default_strategy`: returns default strategy (default: `'default'` as in `DefaultStrategy`)
- `::strategy_matcher`: custom matcher for all strategies (e.g. `strategy_matcher {|string| string.start_with?('C') && string.end_with?('o')}`)

#### Class Methods

- `::strategy_names`: returns list of strategy names (strings) discovered by convention (nested under a namespace matching the superclass name)
- `::strategies`: returns list of strategies discovered by convention (nested under a namespace matching the superclass name)
- `::new_with_strategy(string_or_class_or_object, *args, &block)`: instantiates a strategy based on a string/class/object and strategy constructor args
- `::new_with_default_strategy(*args, &block)`: instantiates with default strategy
- `::strategy_class_for(string_or_class_or_object)`: selects a strategy class based on a string (e.g. 'us' selects UsStrategy) or alternatively a class/object if you have a mirror hierarchy for the strategy hierarchy

#### Instance Methods

- `#strategy=`: sets strategy
- `#strategy`: returns current strategy

### Strategy

#### Class Body Methods

- `::strategy_matcher`: custom matcher for a specific strategy (e.g. `strategy_matcher {|string| string.start_with?('C') && string.end_with?('o')}`)
- `::strategy_exclusion`: exclusion from custom matcher (e.g. `strategy_exclusion 'Cio'`)
- `::strategy_alias`: alias for strategy in addition to strategy's name derived from class name by convention (e.g. `strategy_alias 'USA'` for `UsStrategy`)

#### Class Methods

- `::strategy_name`: returns parsed strategy name of current strategy class

#### Instance Methods

- `#context`: returns strategy context (the strategic model instance)

### Example with Customizations via Class Body Methods

```ruby
class TaxCalculator
  default_strategy 'us'

  # fuzz matcher
  strategy_matcher do |string_or_class_or_object|
    class_name = self.name # current strategy class name being tested for matching
    strategy_name = class_name.split('::').last.sub(/Strategy$/, '').gsub(/([A-Z])/) {|letter| "_#{letter.downcase}"}[1..-1]
    strategy_name_length = strategy_name.length
    possible_keywords = strategy_name_length.times.map {|n| strategy_name.chars.combination(strategy_name_length - n).to_a}.reduce(:+).map(&:join)
    possible_keywords.include?(string_or_class_or_object)
  end
  # ... more code follows
end

class TaxCalculator::UsStrategy
  include Strategic::Strategy

  strategy_alias 'USA'
  strategy_exclusion 'U'

  # ... strategy methods follow
end

class TaxCalculator::CanadaStrategy
  include Strategic::Strategy

  # ... strategy methods follow
end
```

## TODO

[TODO.md](TODO.md)

## Change Log

[CHANGELOG.md](CHANGELOG.md)

## Contributing

* Check out the latest master to make sure the feature hasn't been implemented or the bug hasn't been fixed yet.
* Check out the issue tracker to make sure someone already hasn't requested it and/or contributed it.
* Fork the project.
* Change directory into project
* Run `gem install bundler && bundle && rake` and make sure RSpec tests are passing
* Start a feature/bugfix branch.
* Write RSpec tests, Code, Commit and push until you are happy with your contribution.
* Make sure to add tests for it. This is important so I don't break it in a future version unintentionally.
* Please try not to mess with the Rakefile, version, or history. If you want to have your own version, or is otherwise necessary, that is fine, but please isolate to its own commit so I can cherry-pick around it.

## License

[MIT](LICENSE.txt)

Copyright (c) 2020-2021 Andy Maleh.

repository: AndyObtiva/strategic

gha_language: Ruby

gha_license_id: MIT

repo_name: AndyObtiva/strategic


text:
# Behaviour.Reflection

[![Travis](https://img.shields.io/travis/marcelotto/behaviour_reflection.svg?style=flat-square)](https://travis-ci.org/marcelotto/behaviour_reflection)
[![Hex.pm](https://img.shields.io/hexpm/v/behaviour_reflection.svg?style=flat-square)](https://hex.pm/packages/behaviour_reflection)

Get all modules implementing an Elixir behaviour.

See [this article](https://medium.com/@MarcelOttoDE/the-walled-gardens-within-elixir-d0507a568015) for an analysis of the problem, the circumstances for when to use this library, how it works and its caveats.

## Installation

The Hex package can be installed as usual, by adding `behaviour_reflection` to your list of dependencies in `mix.exs`:

```elixir
def deps do
  [
    {:behaviour_reflection, "~> 0.1"}
  ]
end
```

## Usage

Let's say you have a behaviour and a number of modules implementing it:

```elixir
defmodule MyBehaviour do
  @callback fun :: String.t
end

defmodule Foo do
  @behaviour MyBehaviour
  def fun(), do: "foo"
end

defmodule Bar do
  @behaviour MyBehaviour
  def fun(), do: "bar"
end
```

At runtime you can retrieve all modules implementing the behaviour like this:

```elixir
iex> Behaviour.Reflection.impls(MyBehaviour)
[Foo, Bar]
```

Documentation can be found at [https://hexdocs.pm/behaviour_reflection](https://hexdocs.pm/behaviour_reflection).


text:
@defgroup PlotUtilsArgument PlotUtilsArgument
@ingroup  PlotUtils
@brief    A list of classes based on RooCmdArg that servers as container to
augment plotting behaviour.

@details Below is a list of custom RooCmdArg classes that is used to augment the
plotting behavior of the PlotUtils library. Also see functions such as
Pad1D::PlotGraph(), Pad1D::PlotHist(), Pad2D::PlotHist()... etc  to see how the
these options defined the plotting behavior the respective classes.

repository: yihui-lai/HGCalTileSim

repo_name: yihui-lai/HGCalTileSim


text:
# Lab 01 Report - Introduction to Open Source Software
## Reading Assignments
### Open Source Definition
It seems that with these guidelines, open source softwares are ensured to be able to **evolve**, and that the development, distribution and use were not restricted.
Understanding to this dcument came with help from the [annotated version](https://opensource.org/osd-annotated).
### Smart Questions
This article is a gem. I experience physical comfort just by reading it. My takeaway is: while asking, make effort and show your effort into the question (, not including wild guesses).
#### Suggestion for helpful answers
 - When you are unable to assist but know someone who might help, pointing the way can be helpful
 - Be respectable to your peers even they give different solutions than yours
### Free Culture (Chapter 3)
I am personally shocked by how shameless those copyright holders are in accusing a few college students and scrape every penny out of their pockets. (Also surprised by that one would not be able to recover the fees even when winning a lawsuit.)
I do realize that there's not too much one can do when "one of those industries" points its fingers at an individual, considering their having essentially nothing to lose, plenty of time, dedicated legal team and PR campaign. No one shall be expected to stand in court for such lawsuits; in the case someone does, this person does not deserve the daunting legal process, that is, no obligation to be the hero.
*Still, there's lessons to be learned here*, among which is the importance of **awareness** and **self-protection** of those who engage in technology and may handle any kind of information from beyond oneself. Last semester in a course by Prof. Kimbal that I participated, students were taught about (user-interface) usability tests, in which we were required to present *disclaimers* to product testers about use-of-information, institute-relation, storage-of-information, contact information for concerns, etc, before actually starting. I find that detail particularly related. Maybe a disclaimer would hel
Comment:
### Beautiful code

## Regular Expressions
### Practice problems
 - [Exercise 1](15-1.png)
 - [Exercise 2](15-2.png)
 - [Exercise 3](15-3.png)
 - [Exercise 4](15-4.png)
 - [Exercise 5](15-5.png)
 - [Exercise 6](15-6.png)
 - [Exercise 7](15-7.png)
### Puzzles
4 puzzles out of 5 completed.
 - [Puzzle 1](16-1.png)
 - [Puzzle 3](16-3.png)
 - [Puzzle 4](16-4.png)
 - [Puzzle 5](16-5.png)

## Blocky Maze \# 10
 - [Solution](18.png)

## Reflection
I am planning to study the [MIPS Assembler and Runtime Simulator (MARS)](https://github.com/gon1332/mars.git). This written-in-Java software is unique that it's designed with the needs of education in mind, with capabilities of instruction timing, processor control signal simulation, etc.

repository: XrayBravoGolf/oss-repo-template

repo_name: XrayBravoGolf/oss-repo-template


text:
### Hola there 👋

Here is a short summary about me:

- 🔭 I’m currently building Maftown Online Media web system in Python using Django Framework
- 🌱 I’m currently learning DevOps-[Docker, Kubernetes, CI/CD], Flutter, React, AWS.
- 👯 I’m looking to collaborate on Java and Python project, and any project using tech stack i am familiar with
- 🤔 I’m looking for help with getting up to speed with building large scale microservices
- 💬 Ask me about anything
- 📫 How to reach me<EMAIL_ADDRESS>- ⚡ Fun fact: I think Apple products eco-system is the best 😫.

repository: maranza/maranza

repo_name: maranza/maranza


text:
# Basic TCP Forwarding Rule Example
The example creates a managed instance group with 2 instances in the same region and a network TCP Load Balancer.

![Load Balancer Diagram](./docs/diagram.png "Load Balancer Diagram")

To provision this example, run the following from this directory or using Cloud Shell.

[![button](http://gstatic.com/cloudssh/images/open-btn.png)](https://console.cloud.google.com/cloudshell/open?git_repo=https://github.com/terraform-google-modules/terraform-google-lb&working_dir=examples/basic&page=shell&tutorial=README.md)

## Change to the example directory
```
[[ `basename $PWD` != basic ]] && cd examples/basic
```

## Setup Environment
* Set the project, replacing `YOUR_PROJECT` with your project ID
```
PROJECT=YOUR_PROJECT
```
```
gcloud config set project ${PROJECT}
```
* Configure the environment for Terraform
```
[[ $CLOUD_SHELL ]] || gcloud auth application-default login
export GOOGLE_PROJECT=$(gcloud config get-value project)
```

## Setup Terraform
* Install Terraform if it is not already installed
* `terraform init` to download plugins and set up Terraform state

## Apply Configuration
* `terraform plan` to see the infrastructure plan
* `terraform apply` to apply the infrastructure build Once complete, the load balancer IP address will display as an output

## Test Load Balancer
* Open the URL of the load balancer in your browser
```
echo http://$(terraform output load_balancer_default_ip)
```

## Cleanup Resources
* `terraform destroy` to remove all resources created by terraform

<!-- BEGINNING OF PRE-COMMIT-TERRAFORM DOCS HOOK -->
## Inputs

| Name | Description | Type | Default | Required |
|------|-------------|------|---------|:--------:|
| image\_family | Image used for compute VMs. | `string` | `"debian-9"` | no |
| image\_project | GCP Project where source image comes from. | `string` | `"debian-cloud"` | no |
| project\_id | GCP Project used to create resources. | `any` | n/a | yes |
| region | n/a | `string` | `"us-central1"` | no |

## Outputs

| Name | Description |
|------|-------------|
| load\_balancer\_default\_ip | The external ip address of the forwarding rule for default lb. |

<!-- END OF PRE-COMMIT-TERRAFORM DOCS HOOK -->

repository: kumar-dhanagopal/terraform-google-lb

repo_name: kumar-dhanagopal/terraform-google-lb


text:
# Getting Started

Welcome and really thankful you are interesting in contributing to this project!
As you can imagine, all the contributions are done via GitHub.

### Create a patch

1. Submit an issue by describing your proposed change to the repo in question.
2. The repo owners will respond to your issue rapidly.
3. Fork the repo make your changes and test it.
4. Submit a pull request.

### Get through review process

All submissions, including submissions by project members, require review. We use GitHub pull requests for this purpose.


text:
<<<<<<< HEAD
Yelp Bot.
=======
<b>Yelp Bot for Facebook Messenger. </b>
>>>>>>> 49df4abe0cfab9d5dc7c5e90fe684da5628bc7b6

A bot to parse english text in order to generate queries using Yelp API.

Talk to the Bot at https://www.facebook.com/Yelp-Bot-1750022258569181/

Here is a step by step guide.

It uses Amazon AWS EC2 Ubuntu (free tier) instance

Step 1.

follow all the steps from the following. Which will help you set up a basic bot which will echo your responses.

https://github.com/guillaumeteillet/create-your-own-facebook-messenger-bot-platform-ec2-aws

guillaumeteillet has done a great job and it will help you set up your EC2 instance and Messenger Webhook.

Step 2.

make a developer account on Yelp to receive your credentials.

{
    "consumer_key": "",
    "consumer_secret": "",
    "token": "",
    "token_secret": ""
}

Add your credentials into ./config-secret.json

CODE:

There is a fair bit of Python code that goes into understanding natural language. As you will go through the code, you will realize it is more of a smart hack than actually "understanding" the english langauge. But you know what? That hack is exactly what natural laguage processing is all about. There are more rigorous ways to do it, but none more faster.

We have used a JSON file as database. It is pretty awesome eeh.


text:
# Laravel breadcrumb generator

Easily generate breadcrumbs from a model or view.

## Installation

Add the following to the `composer.json` file in your project:

    "jasonstainton/breadcrumbs": "1.*"

or you can run the below on the command line in the root of your project:

    composer require jasonstainton/breadcrumbs "1.*"

Add the service provider to the providers array in `config/app.php`.

	'providers' => [
	    // ...
	    JasonStainton\Breadcrumbs\Providers\BreadcrumbsServiceProvider::class,
	],

## The breadcrumbs directive

	@breadcrumbs()

Usually you would add this to a partial that is included wherever you would like your breadcrumbs to display.

## Implementation

You can add breadcrumbs dynamically to a model or manually on a view. Each method expects an array to be returned with the crumbs you would like to add. The key should be a fully qualified url *(`http://www.`)* with a string value containing the text you would like to be displayed.

### Via a Model

Implement the breadcrumb contract on your model.

	use JasonStainton\Breadcrumbs\Contracts\BreadcrumbContract;

	class Model implements BreadcrumbContract
	{
		...

This will require you to add a `getCrumbs()` method to your model and expects an array to be returned.

	public function getCrumbs()
	{
		return [
			'http://www.example.com/page' => 'Example Crumb',
			route('blog') => 'Blog',
			$this->url => $this->title
		];
	}

Now all you need to do is pass your model into the breadcrumbs directive.

	@breadcrumbs($model)

### Via a View

You can manually set breadcrumbs in the directive if you are not using a model. Again an array is all you need to pass in.

	@breadcrumbs([
		'http://www.example.com/page' => 'Example Crumb',
		route('blog') => 'Blog'
	])

## Configuration

To use a custom template or alter any prepended crumbs run this command line in the root of your project:

	$ php artisan vendor:publish --provider="JasonStainton\Breadcrumbs\Providers\BreadcrumbsServiceProvider"

To publish just the views or config files you can add the following tags to the command

	$ php artisan vendor:publish --provider="JasonStainton\Breadcrumbs\Providers\BreadcrumbsServiceProvider" --tag="config"

	$ php artisan vendor:publish --provider="JasonStainton\Breadcrumbs\Providers\BreadcrumbsServiceProvider" --tag="views"

### Custom template

You can easilly edit the breadcrumbs appearance however you like. After publishing the views assets you will find a breadcrumb view that is returned when the breadcrumbs directive is called.

	/resources/views/vendor/breadcrumbs/breadcrumbs.blade.php

	@if(isset($breadcrumbs))

		@foreach($breadcrumbs as $url => $name)

			@if($url == url()->current())

				{{ $name }}

			@else

				{{ $name }} »

			@endif

		@endforeach

	@endif

### Prepended crumbs

By default the breadcrumbs are always returned with a home link crumb. You can remove this to give you the most felxibility when calling breadcrumbs or add to. After publishing the packages config file you can remove the home link or add more to it.

	/config/breadcrumbs.php

	'prepended_breadcrumbs' => [
		'/' => 'Home'
	],

An array is expected to be returned. So if you want to remove the home crumb just return an empty array.

repository: JasonStainton/Breadcrumbs

repo_name: JasonStainton/Breadcrumbs


text:
## Introduction
All files are saved as .xml files and as such need to follow the XML Syntax (just look at a file and you'll figure it out).
First step is to copy this into an empty file:
```xml
<?xml version="1.0" encoding="UTF-8"?>
<timetrial version="1.2.0">

</timetrial>
```
Then start writing inside the `<timetrial>` element. All elements required are explained below. If you don't understand something, look at a [finished file](https://github.com/blueYOSHI9000/TimeTrialTracker/tree/master/xml) or contact [blueYOSHI](https://twitter.com/yoshisrc).

In this documentation all optional elements or attributes are inside [square brackets] to indicate they are not required.

Changes to the file format is documented [here](https://github.com/blueYOSHI9000/TimeTrialTracker/wiki/XML-Version-changes). But unless new features are used, updating is not required as TTT will always support older versions as well.

### Done
If the file is finished and you want to submit it, create a [Pull Request](https://github.com/blueYOSHI9000/TimeTrialTracker/pulls) and submit the files with it and wait until it's approved.

Another way is to just contact [blueYOSHI](https://twitter.com/yoshisrc) with a link to the file.

## Metadata
`<metadata>` includes information about the game, how the times should be displayed and other related stuff.
Following elements can be included:

### Title & Logo
```xml
<title short="MK8D">Mario Kart 8 Deluxe</title>
<logo src="logo.png" />
<empty>Not avaible.</empty>
```
- `<title>` includes the full title of the game. Attributes:
	- "short": A shortened version of the title without any special characters or whitespaces. Should also be the name of the XML file and of the folder that contains all images.
- `<logo />` specifies the location of the games logo.
	- "src": The location of the games logo.
- [`<empty>`] specifies what should be displayed when there's no value for a time. Default is "N/A".

### Columns
```xml
<columnlist>
	<column content="track">Level</column>
	<column content="time" type="sapphire">Sapphire</column>
	<column content="time" type="gold">Gold</column>
	<column content="time" type="platin">Platinum</column>
	<column content="time" type="dev" empty="No time avaible">Dev Time</column>
	<column content="name" type="dev" hidden="true">Dev Name</column>
</columnlist>
```
`<columnlist>` specifies the various columns in which times are displayed.

- `<column>` includes the name of one column. Attributes:
	- "content": What type of content should be shown. Can only be one of these strings:
		- "trackname": Column displays the tracks name.
		- "time": Column displays the time of the specified type.
		- "name": Column displays the drivers name of the specified type.
	- "type": The type of time that should be used. Can be a custom name, needs to be the same name as used on the times themselved.
	- ["empty"]: What should be displayed when there's no value for a time. Overwrites the `<empty>` element from earlier. Default is "N/A".
	- ["hidden"]: Hides the column if true. Can be shown with presets.

### Presets [Optional]
```xml
<presetlist>
	<preset name="Relict Difficulty">
		<option name="Easy">
			<toggle content="time" type="easy" force="show" />
			<toggle content="time" type="hard" force="hide" />
		</option>
		<option name="Hard">
			<toggle content="time" type="easy" force="hide" />
			<toggle content="time" type="hard" force="show" />
		</option>
	</preset>
	<preset name="Toggle ghosts" pstype="button" notitle="true" hidden="true">
		<option name="Toggle ghosts">
			<toggle content="time" type="ntropy" />
			<toggle content="time" type="oxide" />
		</option>
	</preset>
</presetlist>
```
`<presetlist>` includes various presets which can be selected. They hide or show various columns, best used when games have different times based on difficulty so only one is shown at a time.

- `<preset>` includes one preset.
	- "name": The name of the preset.
	- ["pstype"]: Preset type, defines what type the preset should be. Can only be one of these strings:
		- "radio": Each option is a seperate radio button, only one can be active at a time. Gets used if pstype isn't avaible.
		- "button": Uses a button instead, the first option gets executed when pressed.
	- ["notitle"]: If present the title is invisible.
	- ["hidden"]: If present the preset is hidden.
- `<option>` stores one option.
	- "name": The name of the option.
	- `<toggle>` specifies which column should be shown/hidden.
		- "content": Which content type should be targeted.
		- "type": Which type should be targeted.
		- ["force"]: If the column should be shown or hidden. If not avaible it toggles the visibility.

### Styles [Optional]
```xml
<styles>
	<favicon src="wumpafruit.png" />
	<background img="bg.jpg" />
	<frontbg style="linear-gradient(#d46100, #d43e00)" />
	<textcolor game="" cup="" title="#f9e52c" track="" link="#f9e52c" linkhover="#f9aa2c" />
	<font src="../../font.ttf" />
	<fontsize game="" cup="" title="" track="" />
	<custom>
	</custom>
</styles>
```
`<styles>` includes a variety of options to change how the site is displayed.

- `<favicon />` stores the favicon. The normal site favicon gets used if no favicon is specified.
	- "src": The location of the favicon.
- `<background />` specifies what the background should look like. Use either "style", "img" or "color". If multiple are present a random one is used.
	- "style": Custom CSS style (only enter a single value, will be applied to "background").
	- "img": The location of the image that should be used.
	- "color": The plain color that should be used (can be any CSS valid color type like Hex (#FFFFFF) or RGB (rgb(255, 255, 255) )).
	- ["repeat"]: If present it repeats the background instead of fixing it (same as using "background-repeat: repeat;").
- `<frontbg />` specified what the front background (inside the border) should look like. Uses same attributes as `<background />`.
- `<textcolor />` specifies what the text color should be. Needs to be a valid CSS color type like Hex (#FFFFFF) or RGB (rgb(255, 255, 255)).
	- ["game"]: Changes the color for the games name.
	- ["cup"]: Changes the color for the cups name.
	- ["title"]: Changes the color for the title (the one specified in `<column>`).
	- ["track"]: Changes the color for the tracks name & it's times.
	- ["link"]: Changes the color for links.
	- ["linkhover"]: Changes the color for links when hovered.
- `<font />` specifies what fonts should be used. Uses the same attributes as `<textcolor />`, if one is present the font will be used for that.
	- "src": The location of the font file, supports same file formats as all browsers do (.ttf and .woff being the best).
- `<fontsize />` specifies the text size, only really needed when using different fonts. Uses same attributes as `<textcolor />`. Size should be given in px, em or rem.
- `<custom>` stores custom CSS not specific to any element.

### Credits [Technically optional but should be used]
```xml
<credits>
	<times name="CrashRatchet008" url="https://twitter.com/CrashRatchet008" source="https://docs.google.com/spreadsheets/d/1qXiCwTyVdOsB8yBs-T9lZBTsx9iY8R_GurFtYAOjeLE/edit#gid=0" />
	<creator name="blueYOSHI9000" />
	<background official="true" />
</credits>
```
`<credits>` stores various credits about who created the leaderboard, who gathered the times etc.
All elements can exist multiple times in case multiple people worked on it.
Use "Anonymous" in case someone doesn't want to be credited.

- `<times />` credits the person that gathered all the times.
	- "name": Name of the person.
	- ["url"]: Link to the persons website/social media.
	- ["source"]: Link to the place they originally stored their times on.
	- ["custom"]: Custom HTML code that replaces the normal one (symbols like < > " & need to be replaced with [symbol codes](https://www.rapidtables.com/web/html/html-codes.html))
- `<creator />` credits the person that created the leaderboard. Uses same attributes as `<times />` with the exception of "source" which should not be used here.
- `<background />` credits the person that created the background, should only be used in case an image is used.
	- ["official"]: If this exists it's official artwork and all other attributes won't be used ("name" is also not needed in this case).
	- "name": Name of the person.
	- ["url"]: Link to the persons website/social media.
	- ["custom"]: Custom HTML code that replaces the normal one (symbols like < > " & need to be replaced with [symbol codes](https://www.rapidtables.com/web/html/html-codes.html))
- `<frontbg />` credits the person that created the front background, should only be used in case an image is used. Uses same attributes as `<background />`.
- `<font />` credits and links to the custom font used. Uses same attributes as `<times />`.
- `<other>` allows to create custom credits that are placed below all others. No attributes.

**=== METADATA ENDS HERE ===**

## Times
```xml
<game name="Mario Kart 8 Deluxe" src="logo.png">
	<cup name="Mushroom Cup">
		<track name="Mario Kart Stadium">
			<ghost type="150" name="Nin★Chris">1:53.191</ghost>
			<ghost type="200" name="Nin★Sophia">1:21.984</ghost>
		</track>
		<track name="Water Park">
			<ghost type="150" name="Nin★Massim">2:02.186</ghost>
			<ghost type="200" name="Nin★Yuya">1:22.799</ghost>
		</track>
		<track name="Sweet Sweet Canyon">
			<ghost type="150" name="Nin★Fausti">2:07.205</ghost>
			<ghost type="200" name="Nin★Alice">1:40.972</ghost>
		</track>
		<track name="Thwomp Ruins">
			<ghost type="150" name="Nin★Sophia">2:12.125</ghost>
			<ghost type="200" name="Nin★Skip">1:31.436</ghost>
		</track>
	</cup>
</game>
```
- `<game>` contains all data for a single game, intended for collections with multiple games.
	- "name": The full name of the game.
	- ["src"]: Location for the games logo, will be displayed next to the games title.
	- ["replace"]: If present, the logo completely replaces the games title.
- `<cup>` contains all data for a single cup or a world.
	- "name": The full name of the cup/world.
- `<track>` contains all data of a single track or level.
	- "name": The full name of the track/level.
- `<ghost>` contains data for a single ghost. The time can be in whatever format. If empty it will display the text specified in `<empty>`.
	- "type": The type of the ghost, used in `<column>`.
	- ["name"]: The name of the driver/player.


text:
---
related_endpoints:
  - post_metadata_queries_execute_read
---

# Indexes

Due to scale considerations a metadata query might return a `HTTP 403` error
when the metadata template has been applied to more than 10,000 files or folders.
A search index can be created to resolve this error for a specific search query.

If the number of metadata instances exceeds 10,000 then a metadata query request
which does not include a suitable **index** in the `use_index` parameter will
result in an error. The error will inform the caller to specify a suitable index
as the argument to the `use_index` parameter.

<Message notice>
  We expect this limit to be raised but not to be eliminated in the future.
</Message>

## Request an index

<Message info>

At this time you will need to contact the
[Box Metadata Query<EMAIL_ADDRESS>to create an search index.

</Message>

To create an index, we will need to be informed of the intended query will be
run including the exact values for the `from`, `query`, and `order_by`
parameters of the request.

An index will then be created and you will be provided with the the name of this
index which then needs be used in the `use_index` parameter of a query
request.

If you prefer to specify a name for the index please provide that name upon
requesting the index.

<Message warning>

The `LIKE`, `ILIKE`, `NOT LIKE`, and `NOT ILIKE` operators can not
be used in the query for an index.

</Message>

### Example index request

The following is an example request for an index. It is essential to include all
the information for the `from`, `query`, and `order_by` parameters.

<!-- markdownlint-disable line-length -->

|                   |                                                                                |
|-------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Query description | Returns files of the type Customer Submission which are associated with a specific Account Number and for which the Status is Pending. Orders the response by the Submission Date. |
| `from`            | `enterprise_123456.customerInfo`                                                                                |
| `query`           | `accountNumber = :argAccountNum AND status = :argStatus`                                                                                |
| `order_by`        | `[{ "field_key": "submissionDate","direction": "desc" }]`                                                                                |

<!-- markdownlint-enable line-length -->

## Query with an index

To query with an index, use the name of the index we provided when performing
your query as the value for the [`use_index`][use_index] parameter.

```curl
curl -X POST https://api.box.com/2.0/metadata_queries/execute_read \
     -H 'Authorization: Bearer <ACCESS_TOKEN>" '
     -H 'Content-Type: application/json'
     -d '{
       "from": "enterprise_123456.customerInfo",
       "fields": ["name"],
       "query": "accountNumber = :argAccountNum AND status = :argStatus",
       "query_params": {
         "argAccountNum": 12345,
         "argStatus": "active"
       },
       "ancestor_folder_id": "5555",
       "use_index": "yourIndexName",
       "order_by": [
         {
           "field_key": "submissionDate",
           "direction": "desc"
         }
       ]
     }'
```

<Message warning>
  The parameters used in a query must match exactly what was provided
  for the creation of the index.
</Message>

[support]: https://community.box.com/t5/custom/page/page-id/BoxSearchLithiumTKB
[use_index]: e://post-metadata-queries-execute-read/#param-use_index


text:
# Application Overview

This Vue Application is built using LaravelMicro.js to facilitate
auto-loaded dependency injected javascript class objects. View LaravelMicro.js
documentation to understand the base libraries this code is extending.

### LaravelMicro.js Framework Docs
> https://bayareawebpro.github.io/laravel-micro.js

![Home](../img/MicroApp.svg)


text:
## aframe-environment-map-component

[![Version](http://img.shields.io/npm/v/aframe-environment-map-component.svg?style=flat-square)](https://npmjs.org/package/aframe-environment-map-component)
[![License](http://img.shields.io/npm/l/aframe-environment-map-component.svg?style=flat-square)](https://npmjs.org/package/aframe-environment-map-component)

Generate environment maps from aframe-environment-component for proper PBR reflections on metallic materials

Depends on [aframe-environment-component](https://github.com/feiss/aframe-environment-component) version >= 1.0.1

For [A-Frame](https://aframe.io).

 Before

 After

### API

| Property | Description | Default Value |
| -------- | ----------- | ------------- |
| position | Position of the CubeCamera to capture the environment.  Useful in case you need to get above an environments ground plane. | {x: 0, y: 1, z: 0}
| target | querySelector string representing any environment elements.  Anything matching this will be rendered in the environment map image | .environment (this is what is used in aframe-environment-component)

### Installation

#### Browser

See the example

#### npm

Install via npm:

```bash
npm install aframe-environment-map-component
```

Then require and use.

```js
require('aframe');
require('aframe-environment-map-component');
```