text:
---
date: 2019-10-09
linktitle: "Creating Entitlements"
title: Using and Creating Entitlements
description: "All applications created in Replicated Vendor require a valid license file to install. This license file contains some standard, pre-built entitlements, but can also include any custom entitlement fields required by the application. Kots will securely deliver these entitlement values and make them available when building the Kubernetes manifests or at runtime using the titled API"
weight: 20020
aliases:
  - /vendor/entitlements/entitlements
  - /vendor/entitlements/custom-entitlements
  - /vendor/entitlements/custom-entitlments
---

KOTS applications that are packaged and delivered through the Replicated [Vendor Portal](https://vendor.replicated.com) use per-customer licenses to install.
Each of these licenses uniquely identifies the customer, defines their release channel, and defines _entitlement information_ about the customer.

KOTS securely delivers these entitlement values to the application, and makes them available in the Kubernetes manifests or at runtime using the Admin Console license API.

## Built-In Entitlement Fields
See [Built-In Entitlements](/vendor/entitlements/built-in-entitlements), for a list of the entitlement fields that are included by default for every license.

## Creating Entitlement Fields
To create new entitlement fields, first click the "License Fields" section in the Vendor UI with your application selected.

![License Fields](/images/license-fields.png)

On this page, you can see a list of the existing custom entitlement fields, edit existing fields, or create new fields.

![License Fields](/images/license-fields-create.png)

To create a new field, click the "Create custom field" link and provide the following information:

* **Field** The name of the field.
This is the name used to reference the field, and as such, is generally not changeable.
* **Title** The display name of the field.
This is how the field will appear in the Vendor UI and the Admin Console (if visible). Easily changed through Vendor UI.
* **Type** The type of the field.
We presently support integer, string, text (multi-line string), and boolean values.
* **Default** The default value to set for the field on existing customers, or when a new customer is created.
It is generally considered good practice to provide a default, where possible.
* **Required** If set, this will prevent the creation of customers unless this field is explicitly set with a value.
* **Hidden** If set, this hide the field from being visible in the Admin Console.
It will remain visible in Vendor UI.
Useful for fields like internal IDs, that are not meaningful to the end-user.

After the license field has been created, it will be shown for all customers created in the Vendor UI.
If the field is not hidden, it will additionally shown under the "Licenses" tab for customers within the Admin Console.
 ![License Fields](/images/license-fields-customer.png)

### Writing Entitlements to Manifests
The [LicenseFieldValue](/reference/template-functions/license-context) template function exists to access entitlements when installing or updating the application.
To illustrate how to use this, let's create a custom entitlement to limit the number of users that a license is permitted to use.

This entitlement will look like:

| Name | Key | Type | Description | Default Value |
|------|-----|------|-------------|---------------|
| Seat Count | seat_count | Integer | The maximum number of users permitted | 50 |

For this example, we will write this value to an environment variable in a pod that is part of an API deployment:

```yaml
apiVersion: apps/v1
kind: Deployment
metadata:
  name: api
spec:
  selector:
    matchLabels:
      app: api
  template:
    spec:
      containers:
      - image: myapp/api:v1.0.1
        name: api
        env:
          - name: SEAT_COUNT
            value: '{{repl LicenseFieldValue "seat_count" }}
```

### Querying Entitlements at Runtime
The Admin Console runs on the customer's cluster, and provides real-time entitlement information through the through the `/license/v1/license` endpoint.
To query entitlements at runtime, simply execute an http response to the following location: `http://kotsadm:3000/license/v1/license`

The response will be returned in YAML format.
For example:
```javascript
{"license_id":"WicPRaoCv1pJ57ZMf-iYRxTj25eZalw3",
"installation_id":"a4r1s31mj48qw03b5vwbxvm5x0fqtdl6",
"assignee":"FirstCustomer",
"release_channel":"Unstable",
"license_type":"trial",
"expiration_time":"2026-01-23T00:00:00Z",
"fields":[
  {"field":"Customer ID","title":"Customer ID (Internal)","type":"Integer","value":121,"hide_from_customer":true},
  {"field":"Modules","title":"Enabled Modules","type":"String","value":"Analytics, Integration"}]}
```

To return the entitlement value of interest, parse the above response using the name of the built-in or custom entitlement.
The following is an example in Javascript to demonstrate:

```javascript
import * as rp from "request-promise";

rp({
  uri: "http://kotsadm:3000/license/v1/license",
  json: true
}).then(license => {
  const seatCount = license.fields.find((field) => {
    return field.field === "seat_count";
  });
  console.log(seatCount.value);
}).catch(err => {
  // Handle error response from `kotsadm`
});
```

gha_language: SCSS


text:
# react-channel-event

React Component decorator and context provider to expose a `channel-event` `IHub` to children components.

![Bundlephobia gzip + minified](https://badgen.net/bundlephobia/minzip/react-channel-event)

### Installation

`yarn add react-channel-event`

`npn install react-channel-event`

### Use

First, wrap your app with the `<ChannelEventProvider>` context element.

``` tsx

			<ChannelEventProvider>
				<App />
			</ChannelEventProvider>

```

Alternatively, you can wrap individial pages/sections with `<ChannelEventProvider>` to 'jail' events to those pages/sections only. An event will only be sent to components that exist under the same `<ChannelEventProvider>` context.

``` tsx

import { ChannelEvent, ChannelProps } from "react-channel-event";
import { take, fork } from "channel-event";

@ChannelEvent()
export default class MyComponent extends React.PureComponent<Props, State> {
    constructor(props: Props) {
        super(props);

        this.state = {
            count: 0
        };

        const instance = this;

        function* forked(num: number) {
            console.log(`fork num: ${num}`);
            while (true) {
                let data = yield take("test");
                console.log(data);
                instance.setState(prev => ({
                    count: prev.count + 1
                }))
            }
        }

        this.props.channel.runGenerator(function*() {
            let forks = 0;
            while (true) {
                yield take("test");
                forks++;
                yield fork(forked, forks);
            }
        });

    }

    render() {
        return (
            <div>
                <button onClick={() => this.props.channel.send("test", 22)}>send event</button>
                {this.state.count}
            </div>
        );
    }
}

interface Props extends ChannelProps {}

interface State {
    count: number
}

```

license: MIT

repository: zpxp/react-channel-event

extension: md

gha_language: JavaScript

gha_license_id: MIT

license_type: permissive

repo_name: zpxp/react-channel-event


text:
# TeleForm Connect Agent for FileBound
## About
Configure TeleForm to export forms an images into your FileBound hosted site.

## Install
Place the FileBound Hosted.vbe file in the scripts folder on your TeleForm system.
* For a desktop install the path would be C:\programdata\Cardiff\TeleForm\scripts
* For a Workgroup/Enterprise system it would be \\\yourshare\TeleForm\scripts

### Usage
Open your form in TeleForm Designer and select Form -> Auto Export Setup. From the drop-down, select FileBound Hosted. If this entry does not exist, make sure the vbe is in the scripts folder and restart the Designer application. Once the export is selected, click the fields tab and click automap. Click the "Main" tab again and click the "Save as" button. Enter your FileBound Hosted site URL and your user/password. If correct, the projects dropdown will populate. Select the project you want your form to go into. Map the fields to TeleForm fields. Once done, click OK. Click the "File Export" tab and enable "Export files". Select a folder to output the images and the image format you need.

## Support
This connect agent only works with hosted FileBound sites. If you need an On-Premise Connect Agent, [please let us know](https://github.com/BinaryOffice/TeleFormFileBound/issues)

This software is provided as is. If you would like to purchase a support contract, please email<EMAIL_ADDRESS>or call us at<PHONE_NUMBER>

repository: BinaryOffice/TeleFormFileBound

branch_name: refs/heads/master

repo_name: BinaryOffice/TeleFormFileBound


text:
# AWS RoboMaker - Beginner's Guide to Robot Simulation

At first glance AWS RoboMaker might appear to be smoke and mirrors. That's certainly how I felt before I had given the service a good look this week.

AWS RoboMaker is a development, deployment and simulation platform for ROS (Robot Operating System). ROS has been around for a long time and is widely used throughout the Robotics industry. Because of its niche, and the fact that its usefulness isn't as apparent outside of industry; it's no surprise RoboMaker hasn't really caught many peoples attention in my Twitter circles.

## Introduction

The purpose of this post is to ultimately walk you through simulating ROS packages on AWS RoboMaker. While this isn't a new topic, I don't believe anyone has done it justice for the ultra beginners. We won't be writing any ROS modules, however I'll try to make you feel comfortable packaging up existing ones.

There is a huge collection of fantastic examples of RoboMaker configured ROS projects on the [AWS Robotics](https://github.com/aws-robotics) github. The project we work on in this post is interchangeable with the ones there.

## Just Like the Simulations

At the heart of RoboMaker is the manager services for a couple pieces of software:

* [roscore](http://wiki.ros.org/roscore) - Collection of nodes and programs that are the pre-requisite for ROS-based systems. Nodes communicate with each other on an instance of roscore.
* [rviz](http://wiki.ros.org/rviz) - 3D visualisation tool for ROS. During simulations we can use rviz to visualise what the robot is doing. RViz can also be used to communicate back to the robot, however this isn't something we'll be covering.
* [Gazebo](http://gazebosim.org/) - Robot simulation with a proper physics engine.

RoboMaker will automatically setup all these pieces for you, which doesn't sound like a big deal; however if you've tried managing this stack of software yourself you'll be aware of how many moving parts there are.

## Dockerized Environment

For the project I've created a Dockerized environment that can be used to fully simulate everything locally (Gazebo is the exception due to graphic passthrough limitations over VNC). Pull down the repository to start with

```bash
git clone https://github.com/t04glovern/aws-robomaker-docker
cd aws-robomaker-docker
```

To run the build and setup of an environment is as easy as running the following:

```bash
docker-compose up -d
```

Now go get a cup of coffee, because this will take some time. Once completed, running `docker ps -a` will reveal the following is running

```bash
$ docker ps -a
# CONTAINER ID        IMAGE                      COMMAND             CREATED             STATUS                            PORTS                                          NAMES
# f5c3408b0c27        aws-robomaker-docker_ros   "/startup.sh"       10 seconds ago      Up 9 seconds (health: starting)   <IP_ADDRESS>:5900->5900/tcp, <IP_ADDRESS>:6080->80/tcp   catkin
```

Open up [http://localhost:6080](http://localhost:6080) in a browser and you should be presented with a VNC'd session of the environment

![ROS over VNC 1](img/docker-ros-vnc-example-01.png)

## Simulating Locally

To begin with lets simulate the ROS deployment locally. Fire up a terminal and run the following commands

```bash
# High level Project Workspace
cd /home/ubuntu/catkin_ws/src

# Simulation Workspace
cd simulation_ws

# Update Workspace & install dependencies
rosws update
rosdep install --from-paths src --ignore-src -r -y
```

Updating the workspace will pull down any external dependencies that aren't in the repo that might be needed. You can inspect what these are by opening the `.rosinstall` file in the `simulation_ws` Workspace. In this case you can see below what are required.

```bash
- git: {local-name: src/deps/aws-robomaker-bookstore-world, uri: "https://github.com/aws-robotics/aws-robomaker-bookstore-world", version: v0.0.1}
- git: {local-name: src/deps/turtlebot3, uri: "https://github.com/ROBOTIS-GIT/turtlebot3", version: d3cdcc6647812ae9a83f05e626cdae322923ac84}
- git: {local-name: src/deps/turtlebot3_simulations, uri: "https://github.com/ROBOTIS-GIT/turtlebot3_simulations", version: 1.2.0}
```

The final step is to build the local packages. For this we use colcon which will orchastrate all the necessary steps to build all the modules.

```bash
colcon build
```

If everything goes correctly, you should see the following

![ROS over VNC 2](img/docker-ros-vnc-example-02.png)

### Execute Simulation Locally

We're now ready to run the simulation locally. For this example we have the option to set what type of robot we'd like to use. This is done by setting an environment variable like so:

```bash
# Options are burger, waffle & waffle_pi
export TURTLEBOT3_MODEL=waffle_pi
```

Next setup your shell environment with all the necessary ROS workspace config

```bash
# Make sure you're in the workspace above `simulation_ws`
cd ../

# set environment configuration
source simulation_ws/install/local_setup.sh
```

There are two options for the simulation environment:

* `empty_world.launch` - Empty world with some balls surrounding the turtlebot at (0,0)
* `bookstore_turtlebot_navigation.launch` - A retail space where the robot navigates to random goals

Pick one of the above and run the following to launch the simulation

```bash
# Command
roslaunch cloudwatch_simulation [command]

# Example
roslaunch cloudwatch_simulation bookstore_turtlebot_navigation.launch
```

If all goes well you should see the following that indicates that the robot is simulating

![ROS over VNC 3](img/docker-ros-vnc-example-03.png)

### Viewing Simulation Locally

A terminal isn't very interesting, and the fun stuff is actually viewing the robot. This can be done using RViz. Open up a new terminal and run the following

```bash
rviz
```

You'll be greeted with a UI. From here you need to add the `Map` from the `topic`

![ROS over VNC 4](img/docker-ros-vnc-example-04.png)

And the RobotState from the basic display type

![ROS over VNC 5](img/docker-ros-vnc-example-05.png)

Have a play around, add in some other optional displays. Below is an example of `Camera` and `LaserScan` data.

![ROS over VNC 6](img/docker-ros-vnc-example-06.png)

When you're done, close down RViz and lets move onto the next step.

## Simulating on RoboMaker

To deploy to RoboMaker we'll need to bundle up everything that makes our robot special. This is done using colcon.

```bash
cd /home/ubuntu/catkin_ws/src/simulation_ws
source install/local_setup.sh
colcon bundle
```

This step takes a very long time (30+ minutes in some cases) as the bundler needs to pull down literally everything needed to run your robot from scratch.

Once completed it will spit out an output.tar file in `simulation_ws/bundle/output.tar`. We should pull this tar down to our local computer. This is done using the following docker command from your actual computer (not in the container)

```bash
docker cp catkin:/home/ubuntu/catkin_ws/src/simulation_ws/bundle/output.tar .
```

We will then need to upload this `.tar` to an S3 bucket to be used in the next steps.  This is done by running the following command

```bash
aws s3 mb s3://your-bucket-name
```

**NOTE**: *For the remainder of this tutorial I'll be using the following bucket and path for my files. Replace these references with your own*

* **bucket**: devopstar
* **key_path**: resources/aws-robomaker-kickstart

Upload the `tar` to S3 in a folder called `input`. The naming doesn't really matter, however it makes it easier to distinguish.

```bash
aws s3 cp output.tar s3://devopstar/resources/aws-robomaker-kickstart/input/simulation_ws.tar
```

### CDK Deploy

I've written a deployment of the RoboMakerSimulation and custom roles required using CDK, however this isn't necessary for the tutorial. If you want to know how to create the CloudFormation template used in this tutorial, you run run the following

```bash
# Install CDK
npm install -g aws-cdk

cd cdk/
npm install
npm run build

# Export a synthisized template
cdk synth --no-staging > template.yaml
```

If you want to deploy using CloudFormation, deploy the `cdk/template.yaml` file from either the CLI or Web interface. Your parameters will be different based on the bucket name and `.tar` location.

Take note of the outputs from the creation of the resources. You should recieve the following:

* **RoboMaker Role**: arn:aws:iam::123456789010:role/robomaker-simulator-simroleXXXXXXXXXXXXXXXXXX
* **RoboMaker Application ARN**: arn:aws:robomaker:us-east-1:123456789010:simulation-application/aws-robomaker-kickstart/1568206875172

### RoboMaker Simulation Job

The final step now is to run the Simulation job from the [RoboMaker console](https://console.aws.amazon.com/robomaker/home?region=us-east-1#simulationJobs). Unfortunately there's no simple way to deploy this piece with CloudFormation. Use the information from the previous step to create a version of the following json (available in `RoboMakerJob.json`)

```json
{
    "outputLocation": {
        "s3Bucket": "devopstar",
        "s3Prefix": "resources/aws-robomaker-kickstart/output/"
    },
    "maxJobDurationInSeconds": 3600,
    "iamRole": "arn:aws:iam::123456789010:role/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx",
    "failureBehavior": "Continue",
    "simulationApplications": [
        {
            "application": "arn:aws:robomaker:us-east-1:123456789010:simulation-application/aws-robomaker-kickstart/1568120923973",
            "applicationVersion": "$LATEST",
            "launchConfig": {
                "packageName": "cloudwatch_simulation",
                "launchFile": "bookstore_turtlebot_navigation.launch",
                "environmentVariables": {
                    "TURTLEBOT3_MODEL": "waffle_pi"
                }
            }
        }
    ],
    "tags": {
        "Project": "aws-robomaker-kickstart"
    }
}
```

Deploy the job using the CLI

```bash
aws robomaker create-simulation-job --cli-input-json file://RoboMakerJob.json
```

Head over to the [Web interface](https://console.aws.amazon.com/robomaker/home?region=us-east-1#simulationJobs) and check out the Simulation Job you just created

Once loaded up, open an instance of Gazebo

![ROS over RoboMaker 1](img/robomaker-simulation-example-01.png)

You should now be able to interact with the Simulation in a 3D space.

![ROS over RoboMaker 2](img/robomaker-simulation-example-02.png)

## Summary

AWS RoboMaker is a service that probably has gone mostly unnoticed to general users. However I can definitely see its value after giving it some time. ROS can be a major pain to work with, mostly due to different versions requiring distinctly different versions of roscore.

gha_language: Python

gha_license_id: NOASSERTION


text:
# Chart_Components

## Animated bar chart for Flutter ##

Customizable bar chart for Flutter.
The component calculates min and max of data and resizes bars as needed.

![bar chart](https://github.com/fgcan10/chart_components/raw/master/bar_chart.gif)

* Add a data collection with the values to generate the bars.
* Add a string collection with the labels to display below the items (optional)
* Change bar size, margins and top corners as needed.
* Change bar's color based on value. Callback, optional.
* Enable/disable value on top of bar
* Add an icon to the top of the bar based on item's value. Callback, optiona.
* Enable/disable animation.
* Change animation duration and curve through the properties

## Animated calendar grid for Flutter ##

![calendar grid](https://github.com/fgcan10/chart_components/raw/master/calendar_grid.gif)

* Generates a grid for the selected month.
* Changes day color through callback.
* Animates changes. Animation curve and duration can be modified with the properties.

## Demo
![Demo: ](https://github.com/fgcan10/chart_components/raw/master/barchart_calendargrid.gif)

## Usage
To use plugin, just import package `import 'package:chart_components/chart_components.dart';`

## Example
Check de example directory to access the project that implements the image shown above.

````dart
        ........
                    CalendarGrid(
                            year: 2020,
                            month: 1,
                            getColorOfDay: DataRepository.getDayColor,
                            animationDuration: Duration(milliseconds: 1500),
                    ),

        ...........
                    child: BarChart(
                    data: data,
                    labels: labels,
                    dislplayValue: true,
                    reverse: true,
                    getColor: DataRepository.getColor,
                    getIcon: DataRepository.getIcon,
                    barWidth: 42,
                    barSeparation: 12,
                    animationDuration: Duration(milliseconds: 1800),
                    animationCurve: Curves.easeInOutSine,
                    itemRadius: 30,
                    iconHeight: 24,
                    footerHeight: 24,
                    headerValueHeight: 16,
                    roundValuesOnText: false,
                    lineGridColor: Colors.lightBlue,
                    ),
````


text:
# Quick Sort

## [Link to Blog Post](BLOG.md)

## Other Links
- [Link to PR](https://github.com/LydiaMT/data-structures-and-algorithms/pull/38)
- [Link to code](https://github.com/LydiaMT/data-structures-and-algorithms/blob/main/javascript/code-challenges/quickSort/quickSort.js)
- [Link to tests](https://github.com/LydiaMT/data-structures-and-algorithms/blob/main/javascript/code-challenges/quickSort/__test__/quickSort.test.js)

## Challenge

Review the pseudocode below, then trace the algorithm by stepping through the process with the provided sample array. Document your explanation by creating a blog article that shows the step-by-step output after each iteration through some sort of visual.

`[8,4,23,42,16,15]`

### Pseudocode
```js
ALGORITHM QuickSort(arr, left, right)
    if left < right
        // Partition the array by setting the position of the pivot value
        DEFINE position <-- Partition(arr, left, right)
        // Sort the left
        QuickSort(arr, left, position - 1)
        // Sort the right
        QuickSort(arr, position + 1, right)

ALGORITHM Partition(arr, left, right)
    // set a pivot value as a point of reference
    DEFINE pivot <-- arr[right]
    // create a variable to track the largest index of numbers lower than the defined pivot
    DEFINE low <-- left - 1
    for i <- left to right do
        if arr[i] <= pivot
            low++
            Swap(arr, i, low)

     // place the value of the pivot location in the middle.
     // all numbers smaller than the pivot are on the left, larger on the right.
     Swap(arr, right, low + 1)
    // return the pivot index point
     return low + 1

ALGORITHM Swap(arr, i, low)
    DEFINE temp;
    temp <-- arr[i]
    arr[i] <-- arr[low]
    arr[low] <-- temp
```

## Approach & Efficiency

See => [Blog Post](BLOG.md)

## Testing & Edge cases

```git
npm run test quickSort.test.js
```

## API

- [Code Fellows Example Blog](https://codefellows.github.io/common_curriculum/data_structures_and_algorithms/Code_401/class-26/solutions/BLOG)

repository: LydiaMT/data-structures-and-algorithms

branch_name: refs/heads/main

repo_name: LydiaMT/data-structures-and-algorithms


text:
# Pulfalight
[![CircleCI](https://circleci.com/gh/pulibrary/pulfalight.svg?style=svg)](https://circleci.com/gh/pulibrary/pulfalight)
[![Apache 2.0 License](https://img.shields.io/badge/license-Apache%202.0-blue.svg?style=plastic)](./LICENSE)

This is an implementation of ArcLight being implemented as a replacement for the
 Princeton University Finding Aids (PULFA) service. Accessible at https://findingaids.princeton.edu/.

### Development

#### Setup
* Install Lando from https://github.com/lando/lando/releases (at least 3.0.0-rrc.2)
* See .tool-versions for language version requirements (ruby, nodejs)

```sh
bundle install
yarn install
```
(Remember you'll need to run the above commands on an ongoing basis as dependencies are updated.)

#### Starting / stopping services
We use lando to run services required for both test and development
environments.

Start and initialize solr and database services with `rake servers:start`

To stop solr and database services: `rake servers:stop` or `lando stop`

#### Run tests
`bundle exec rspec`
To watch feature tests run in a browser, make sure chrome is installed and run: `RUN_IN_BROWSER=true rspec spec`

#### Start development server
- `rails s`
- Access Pulfalight at http://localhost:3000/

### Configuration
Please see [the ArcLight
documentation](https://github.com/projectblacklight/arclight/wiki/Indexing-EAD-in-ArcLight#repository-configuration)
for information regarding the configuration of repositories in ArcLight.

### Indexing documents into Pulfalight

#### Configuring ASpace

1. `brew install lastpass-cli`
2. `lpass login emailhere`
3. `bundle exec rake setup_keys`

#### Index "Interesting" EADs
A sub-section of all our collections have been identified and can be queued up
  for ingest via:

  `bundle exec rake pulfalight:aspace:index_test_eads`

#### Index a specific EAD

In a rails console run the index job with a specific EAD, e.g.:
```
AspaceIndexJob.perform_later(resource_descriptions_uri: "repositories/4/resource_descriptions/2203", repository_id: "univarchives")
```

Note the uri must use a collection-level resource id (you may need to look this up in Aspace), and have the correct corresponding repository_id (check against config/repositories.yml)

#### Full/Partial Reindex

The rake task `pulfalight:indexing:incremental` will either perform a
full reindex, or if that's happened before, index any changes.

Sidekiq must be running in a separate window to process the resulting jobs (see below.)

Make sure Redis is running (`redis-server`), and then run:

`$ bundle exec sidekiq`

Once the jobs are finished processing by sidekiq you'll need to either wait 5 minutes for the soft commit to occur or manually issue a solr commit:

`$ bin/rails c`

`> Blacklight.default_index.connection.commit`

#### Indexing into a Development environment

A subset of collections (the same that are run in specs) can be indexed into
  development via `bundle exec rake pulfalight:seed`

#### Adding new EADs to test suite.

1. Open up `app/services/aspace_fixture_generator.rb`
1. Add EAD ID to the `AspaceFixtureGenerator::EAD_IDS` constant.
   1. comment out the other entries unless you want to regenerate them. it takes
      a while to run all of them.
1. If you're only interested in a subset of components, add them to the `AspaceFixtureGenerator::COMPONENT_MAP` constant.
1. Ensure you're on VPN
1. `bundle exec rake pulfalight:fixtures:refresh_aspace_fixtures`

##### Troubleshooting Aspace API Connections

If you get an error that the login failed, the most likely explanation is that one or more VPN machines changed IPs and we need to regenerate the list of allowed IPs and send it to Lyrasis support.

You can validate this by running `Aspace::Client.new` on a staging box rails console. If that doesn't error then it's not an issue with the credentials (i.e. it's likely an IP missing from the allow list).

[Instructions](https://github.com/pulibrary/pul-it-handbook/blob/main/services/vpn.md) and [a ruby script for generating the list of ips](https://github.com/pulibrary/pul-it-handbook/tree/main/services/vpn) for generating the full allow list are in the pul-it-handbook repo. Once you have the list of IPs, send it in an email to<EMAIL_ADDRESS>You can say something like, "I’m having trouble accessing the archivesspace API and I suspect it’s because our VPN changed their backend endpoint IPs again. Below is our complete list of IPs that need to access the API endpoint for aspace.princeton.edu. Could you please swap out our previous list?"

### Citation Formatting

Citations are generated for collections and components, and rendered on the
show page for either of these resources. The default formatted repository
sources may be found and updated within the appropriate [configuration
file](./config/citations.yml).

repository: pulibrary/pulfalight

gha_language: Ruby

repo_name: pulibrary/pulfalight


text:
PlayIN-JS

PlayIN ADs -The Next Generation Playable ADs Solution

README: [English](https://github.com/playinads/playin-js) | [中文](https://github.com/playinads/playin-js/blob/master/README_中文.md)

## Usage:

### 1. Import PlayIN-JS SDK

PlayIN-JS SDK can be imported by an html script tag

```html
<script src="https://playin.tech/static/js/playin.js"></script>
```

Or by using npm

```
npm install playin-js --save
```

```javascript
import playin from "playin";
```

### 2. Use PlayIN-JS SDK

If you import sdk by script tag, then you get a global playin instance, or imported playin by npm.

It needs a div element to mount video output. For example:

```html
<div id="playinbox"></div>
```

Then call playin.init to initiate, it supports following methods and properties:

- `target_id` video output mounting point
- `ad_id` playin advertising identifier
- `options` playin sdk options， see more info as below

`options` supports following methods and properties:

- `playReady()` playin ready callback
- `playError(err: String)` playin error callback
- `playEnd()` playin end callback
- `install()` user click to install callback
- `minDuration: Number` user minimum playing time, in seconds, default `30`
- `closebtn: bool` show internal close timer, default `false`
- `download_modal: bool` show internal app modal, default `false`

---

## Example:

index.html:

```html
<html>
<head>
</head>
<body>
    <div id="playinbox"></div>
    <script src="dist/main.js"></script>
</body>
</html>
```

src/main.js:

```javascript
import playin from "playin";

function playReady() {
  console.log('ready')
}
function playError(error) {
  console.log("error: " + error)
}
function playEnd() {
  console.log("end.")
}
function install() {
  console.log("install")
}

playin.init(
  "#playinbox",
  "ad_id",
  {
    playReady, playError, playEnd, install, minDuration: 25, closebtn:false, download_modal: false
  }
)
```

---

## License

```
The MIT License (MIT)

Copyright (c) 2019 playin

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

 IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
```

repository: playinads/playin-js

repo_name: playinads/playin-js


text:
Refresh Model
=============

What is this?
-------------

This is a Gearman worker that, when given a user, looks through the `vote` collection in the database for all votes made by that user, and creates a new classification model for them, putting it in their document in the `user` collection.

Usage
-----

The worker is called `refresh-model`, and takes the following Gearman input data:

```js
{
    "key": "secret_key_abc",
    "username": "sully"
}
```

The `username` field is optional. If it is not supplied, the worker will operate upon all users.

It outputs either:

```js
{
    "status": "success"
}
```

or

```js
{
    "status": "error",
    "description": "error description"
}
```

How to do tests
---------------

To run the tests, move to this repository, and run:

`$ python testing.py`

To add a test, modify the `testing.py` file.

repository: waffle-iron/feedlark

repo_name: waffle-iron/feedlark


text:
# Adventure Time Cards 	:star2:
>Select Characters and get inspired by their quotes!  Made with Vue3 and Vitejs as Frontend tools
>

## Objectives

:zap: Consume external API with Axios

:zap: Include skeleton loader

:zap: Filter by character

:zap: Responsive

:zap: Apply CSS Variables

:zap: Timeout on page reload

***

***

## Installation

Clone the repo and run it with Npm or Yarn

```javascript
npm run dev
```

```javascript
yarn run dev
```
## Credits

API from Young Ju Park sally/adventure-time-api
[https://adventure-time-api.herokuapp.com](https://adventure-time-api.herokuapp.com/)

repository: sugarViri/adventure-time-cards

gha_language: Vue

repo_name: sugarViri/adventure-time-cards


text:
# Reporters

toc

## Supported Diff Tools

The DiffReporter class goes through a chain of possible reporters to find the first option installed on your system.
Currently the search goes in this order:

### Mac

snippet: mac_diff_reporters

### Linux

snippet: linux_diff_reporters

### Windows

snippet: windows_diff_reporters

## Registering a default reporter

At present, the default Reporter is the DiffReporter. Whenever you call Approvals, you have the chance to pass in your own Reporter. However, if you would like to change what the default reporter is when you don't pass in a specific Reporter, you can do this at a global or per-test level, by adding the line:

snippet: use_as_default_reporter_in_main

The return value is ["Disposable"](/doc/DisposableObjects.md#top), meaning it will restore the original reporter when the object destructs. Because of this, if you do not store the result in a variable, it will immediately undo itself by the end of the line.

## Front Loaded Reporters

By default, Approval tests will not launch any reporters on supported CI machines. To do this, we use front loaded reporters...

Front loaded reporters allow you to block all normal reporting behaviour. This is useful in situations like running on a CI Machine, where you wouldn't want a reporter to open.

For more information, see [Build Machines and Continuous Integration servers](/doc/BuildMachinesAndCI.md#top).

Here is an example of not launching any reporters if you are on a machine with a particular name, by using [BlockingReporter](https://github.com/approvals/ApprovalTests.cpp/blob/master/ApprovalTests/reporters/BlockingReporter.h).

snippet: do_not_report_on_named_machine

Once you have added that, even calling approvals with a specific Reporter will not launch it on the CI system (but will for all other systems). For example:

snippet: basic_approval_with_reporter

### Blocking Reporters

Blocking reporters are a simple class, designed for use with FrontLoadedReporters, to prevent launching of reporters in certain environments.

snippet: do_not_report_on_named_machine

## Miscellaneous Helper Reporters

While most reporters open some sort of external program, for the purpose of understanding how the tests went wrong, and verifying the correct answer, there are some reporters that are helpful for specific situations.

### Auto-approving

There are three reporters that can help with the approving of single or multiple tests.

* `AutoApproveIfMissingReporter`: if there is no approved file already, the received file will automatically be copied over the approved one. Otherwise, it does nothing. One possible cause for confusion here is if you ran the test previously with a standard reporter, that will have created an almost-empty approved file, which will then block this from working.
* `ClipboardReporter`: this puts the command-line to moved the approve file on to your computer's clipboard. You then review this, and paste it in to a terminal window. This only works with one test at a time.
* `AutoApproveReporter`: be careful, this will overwrite every existing ".approved" file, with no confirmation. This is best used when you are expecting large numbers of files that are already version-controlled to be updated, and you would rather review the changes in your version control system.

## Related Pages

* [How to Use A Custom Reporter](/doc/how_tos/UseACustomReporter.md#top)
* [How to Submit a New Reporter to ApprovalTests](/doc/how_tos/SubmitANewReporterToApprovalTests.md#top)

---

[Back to User Guide](/doc/README.md#top)


text:
zmats
==============================
[//]: # (Badges)
[![Travis Build Status](https://travis-ci.com/ReactionMechanismGenerator/zmats.svg?branch=master)](https://travis-ci.com/ReactionMechanismGenerator/zmats)
[![codecov](https://codecov.io/gh/ReactionMechanismGenerator/zmats/branch/master/graph/badge.svg)](https://codecov.io/gh/ReactionMechanismGenerator/zmats/branch/master)
![Release](https://img.shields.io/badge/version-0.1.0-blue.svg)
[![MIT license](http://img.shields.io/badge/license-MIT-brightgreen.svg)](http://opensource.org/licenses/MIT)

A Z-matrix module written in Python

### Copyright

Copyright (c) 2020, Alon Grinberg Dana

#### Acknowledgements

Project based on the
[Computational Molecular Science Python Cookiecutter](https://github.com/molssi/cookiecutter-cms) version 1.1.

repository: ReactionMechanismGenerator/zmats

repo_name: ReactionMechanismGenerator/zmats


text:
[![Build Status](https://github.com/chinhodado/persona5_calculator/workflows/build/badge.svg)](https://github.com/chinhodado/persona5_calculator/actions?workflow=build)

### Persona 5 fusion calculator

A tool to help calculate fusions in Persona 5.

Link: https://chinhodado.github.io/persona5_calculator/

Also included are information about a persona's stats, elementals and skills.

Note: the cost is estimated and is not accurate.

### How fusion in Persona 5 works

In general, fusion in Persona 5 is still mostly the same as in Persona 3 and 4, with a few additional rules:

 - There are rare persona (aka Treasure Demon) that when fused with a normal persona X will result in another persona either one or two ranks above or below X's current level. Whether to move up or down rank and whether to move one or two steps depends on the rare persona and X's arcana.
   - In other word, given a rare persona and another non-rare persona X, when fusing them you will **not** always get a fixed result, but the result will vary depending on the non-rare persona X's current level. Please keep this in mind when using the fusion calculator.
   - The rare persona are Regent, Queen's Necklace, Stone of Scone, Koh-i-Noor, Orlov, Emperor's Amulet, Hope Diamond and Crystal Skull

 - When two rare persona are fused, the normal fusion formula is used.

 - Rare persona cannot be the result of a fusion.

 - When doing a fusion, either a normal one, a same-arcana-downrank one or a rare one, if the result is a rare persona, it will be skipped.

 - There is no longer 3-way fusion.

 - There are DLC persona. If you don't own a DLC persona, it will be skipped during fusion.

This calculator assumes that you own **no** DLC persona by default (you can change which DLC persona you own [here](https://chinhodado.github.io/persona5_calculator/#/setting)). It also assumes that when you do a rare fusion your persona is at the **base level**, so please keep that in mind if you don't get the same result as shown.

### Note on fusion with Judgement arcana

According to the [official guide](http://atlus.com/persona5/manual/ps4/?pid=50) a fusion between a persona of the Judgement arcana and another persona of the Justice/Strength/Chariot/Death arcana is possible, but this is actually not the case in game.

Backup [link](img/atlus_fusion_table.jpg) if above link is broken.

### Credits

Ideas, logics, data, etc. have been gathered from:

 - https://github.com/arantius/persona-fusion-calculator
 - https://github.com/Heimdall409/persona4-fusion-calculator
 - https://github.com/aqiu384/aqiu384.github.io/tree/master/p5-tool

gha_language: TypeScript


text:
SimpleTheme
===========

A simple Zikula theme.

## Notes ##
### Blockpositions ###
#### topnav ####
Please only use the extmenu tree block at the topnav blockposition.
#### center ####
This is not displayed when being in admin area.
#### left ####
If you use the News block here, make sure to choose `block_storiesext_main.tpl` as custom block template and `block_storiesext_row.tpl` as custom row template.

## License ##
MIT — Please see the [LICENSE file](http://www.github.com/cmfcmf/SimpleTheme/blob/master/LICENSE) distributed with this source code for further information regarding copyright and licensing.

repository: cmfcmf/SimpleTheme

repo_name: cmfcmf/SimpleTheme


text:
# Laravel Settings

[![Latest Version on Packagist](https://img.shields.io/packagist/v/leeovery/laravel-settings.svg?style=flat-square)](https://packagist.org/packages/leeovery/laravel-settings)
[![Build Status](https://img.shields.io/travis/leeovery/laravel-settings/master.svg?style=flat-square)](https://travis-ci.org/leeovery/laravel-settings)
[![Quality Score](https://img.shields.io/scrutinizer/g/leeovery/laravel-settings.svg?style=flat-square)](https://scrutinizer-ci.com/g/leeovery/laravel-settings)
[![Total Downloads](https://img.shields.io/packagist/dt/leeovery/laravel-settings.svg?style=flat-square)](https://packagist.org/packages/leeovery/laravel-settings)

This package allows you to create one or many setting files which store default settings, but also expose an API to edit the settings, and store those edits in the DB. When the settings are fetched the custom values are merged into the defaults.

Most useful for user-based settings, but can be used for a multitude of other reasons.

Best to give a quick example...

## Installation

You can install the package via composer:

```bash
composer require leeovery/laravel-settings
```

``` bash
php artisan vendor:publish --provider="Leeovery\LaravelSettings\LaravelSettingsServiceProvider" --tag="config"
```

## Usage

Given a settings file called `/config/settings-user-notifications.php`
and with the following contents...

``` php
return [
    'orders' => [
        'general' => [
            'email'  => true,
            'alerts' => true,
        ],
        'status_change' => [
            'email'  => true,
            'alerts' => true,
        ],
    ],
    ...
];
```

You can do this to fetch the settings:

``` php
$userId = 100;

settings('user-notifications', $userId)->get();

// will return...
'orders' => [
    'general' => [
        'email'  => true,
        'alerts' => true,
    ],
    'status_change' => [
        'email'  => true,
        'alerts' => true,
    ],
],
...
```

As you can see, this will return all the above settings for user with the ID of 100.

Note that those settings won't be different from the defaults as at this point the user has not made any changes.

Lets change that now...

``` php
settings('user-notifications', $userId)->set(['orders.general.email' => false]);
```

The line above calls set() and passes the key and value. That value is persisted in the DB for that user. So that we can do the following...

``` php
settings('user-notifications', $userId)->get();

// will return...
'orders' => [
    'general' => [
        'email'  => false, // NOTE this is different!
        'alerts' => true,
    ],
    'status_change' => [
        'email'  => true,
        'alerts' => true,
    ],
],
...
```

Returned data now equals all the default values EXCEPT for the nested key `orders.general.email` where that will equal FALSE, as per the custom change above.

That's the most basic use-case...

But, you can do more...

## Multiple Setting Files

You can setup multiple setting files in the config directory, just prepend the filename with `settings-` (or whatever you configure in the package config file.

Eg:

`/config/settings-user-privacy.php`
`/config/settings-social.php`
`/config/settings-user-account-access.php`

Now you can `get()` and `set()` the settings from those files...

``` php
$settings = settings('user-privacy', $userId)->get();
$settings = settings('social', $userId)->get();
```

## Value Object Based Values

You can use objects as the values in the settings file, like this:

``` php
return [
    'orders' => [
        'general' => [
            'email'  => SettingStore::make(true, 'You can set a label here'), // option one
            'alerts' => LaravelSettings::setting(true, 'You can set a label here'), // option two
        ],
    ],
    ...
];
```

## Access Subsets Rather Than All Settings

Sometimes you only need a subset of settings. You can do that by specifiying the key with dot notation. Note the package will still fully key the results so that you can use the keys for setting.

Eg:

Given a setting file `/config/settings-email-notifications.php`:

``` php
return [
    'orders' => [
        'general' => [
            'email'  => SettingStore::make(true),
            'alerts' => SettingStore::make(true),
        ],
        'digital' => [
            'status_change' => [
                'email'  => SettingStore::make(true),
                'alerts' => SettingStore::make(true),
            ],
        ],
    ],
    ...
];
```

You can store a user edit like this:

``` php
settings('user-notifications', $userId)->set([
    'orders.digital.status_change.email' => false // just store primitive value here not VO
]);
```

And... you can access the deep `status_change` subset like follows:

``` php
settings('email-notifications', $userId)->get('orders.digital.status_change');

// will return...
'orders' => [
    'digital' => [
        'status_change' => [
            'email'  => false, // note non-default value
            'alerts' => true,
        ],
    ],
],
```

As you can see we fully key the results but only return the requested subset.

### TODO

- [x] Can access subsets
- [ ] Caching to cut down on DB queries and general optimise
- [ ] Driver based approach to allow user to change default system and caching layer.
- [ ] `SettingStore` value validation

### Testing

``` bash
composer test
```

### Changelog

Please see [CHANGELOG](CHANGELOG.md) for more information what has changed recently.

## Contributing

Please see [CONTRIBUTING](CONTRIBUTING.md) for details.

## Credits

- [Lee Overy](https://github.com/leeovery)
- [All Contributors](../../contributors)

## License

The MIT License (MIT). Please see [License File](LICENSE.md) for more information.

## Laravel Package Boilerplate

This package was generated using the [Laravel Package Boilerplate](https://laravelpackageboilerplate.com).

repository: leeovery/laravel-settings

gha_language: PHP

repo_name: leeovery/laravel-settings


text:
##Marvellous Ultimate Appliances
*It's not Rocket Appliance!*

###Phases
The game has 3 phases which represent a year of heavy appliance usage.
The phases are as follows:

1. The Purchase
2. The Battle
3. The Update

####The Purchase Phase
The Purchase Phase is the time to buy new Appliances and Extend your House. Both Players can buy any number of Appliances or House Extensions from the Store, assuming the can pay for them.

####The Battle Phase
The Battle Phase represents a year of hard back and forth whitegood combat and consists of two stages of attacings, defending and unflooping in the order shown below:

1. Player 1 Attacks
2. Player 2 Defends
3. Player 2 Attacks
4. Player 1 Defends
5. Unfloop
6. Player 2 Attacks
7. Player 1 Defends
8. Player 1 Attacks
9. Player 2 Defends
10. Unfloop

#####Attack
In an Attack the Attacking Player chooses any number (including zero) unflooped Appliances and floops them. The total number of Energy Stas on the flooped Appliances is the attack value being dealt to the Defending Player.
#####Defend
In a Defense the Defending Player chooses any number (including zero) unflooped Appliances and floops them. The total Capacity of the flooped Appliances is the defense value to stop the Attack. If the difference between the Attack and Defense is greater than zero, the Defending Player looses Money.
#####Unfloop
In the unfloop stage, both players unfloop up to two flooped Appliances, showing their readiness to the continue the battle!
#####Winning
When a Player is reduced to zero Money they have gone broke, and the other Player is declared the Winner!

####Update Phase
The Update Phase is when both Players regroup and prepare for another year of Appliance combat. In the Update Phase both Players decrease all Appliance Durability by one, any Appliance reduced to zero Durability has broken under wear and tear and is recycled and discarded. The Update Phase is when both Players recieve their income.

###Appliances
An Appliance is your primary tool in the war against your neighbour and has a Cost, Energy Star Rating, Capacity, Durability, Type and Name.
####Cost
Cost is how much an appliance costs to purchase and is based upon the real world running costs of the Appliance. Any time an Appliance
####Energy Star Rating
The Energy Star Rating is the Attack value of the Appliance, and is based upon the real world energy rating of the Appliance.
####Capacity
The Capacity of the Appliance is the Defense value of the Appliance and is based upon the real world capacity of the Appliance.
####Durability
Durability is how reliable the Appliance is, all Appliances break over time, should an Appliance be reduced to zero Durability it is recycled and thrown away.
####Type
The Type shows what kind of Appliance it is. An Appliance can only go into your House if there is space to support it. The different types are:

* Air Conditioners
* Washing Machine
* Clothes Drier
* Dishwasher
* Television
* Refrigerator

####Name
The Name tells you what your lovely Appliance is called and is based on the real world name of the Appliance.

###House
*It's not a house, it's a home!*
Your House is your fortress and base of operations in the war against your neighbour! Your House has a number of Application Slots and an Income.
####Appliance Slots
Appliance Slots show how big your House is and how many Appliances you can hold. Each slot has a Type which corresponds to the Appliance Type, so a TV can only go into a TV slot, a Dishwasher into a Dishwasher slot and so on.
####Upgarding your House
Sometimes your House just isn't big enough, from the Store you are able to buy an Extension to your House. The cost of the Extension is removed from your Money.
####Income
Income is how much extra Money you get at the end of each year in the Update Phase. Your Income is based on your starting location, with more affluent areas having a higher Income.

###Store
The Store is where you go to buy new Appliances or Extenstions to your House. The Store has a random selection of Appliances everytime you visit. The Store can only be visited during the Purchase Phase.

###Flooping
Flooping and Unflooping is how you show which Appliances are engaged. To Floop and Appliance rotate it 90 degrees and to Unfloop, rotate it back 90 degrees. A flooped Appliance can not be used until it is Unflooped.


text:
# pythonlyx

A demo for literate Python programming using [reticulate](https://rstudio.github.io/reticulate/) and [knitr](https://yihui.org/knitr/) on [LyX](https://www.lyx.org/).

I have confirmed that it works in the following environment

### R

- R version 4.0.0 (2020-04-24)
- Platform: x86_64-apple-darwin19.4.0 (64-bit)
- Running under: macOS Catalina 10.15.4
- reticulate 1.15
- knitr (1.28)

### texlive

- pdfTeX 3.14159265-2.6-1.40.21 (TeX Live 2020)

### Python

I use Anaconda3 2019.10. Since reticulate requires CPython built with shared library, you may need to

	PYTHON_CONFIGURE_OPTS="--enable-shared"

before installing Anaconda. With the standard GUI installation, you don't have to be worried about this, I suppose.

## Important notice about the license

I include in this repository a slightly modified version of py_inject_r function of
{reticulate} R package, which RStudio has copyright for. (Since I am not sure about how to properly tell that that is not my work, I here declare the usage.)

You can freely use the content of the demo package.

repository: kenjisato/pythonlyx

repo_name: kenjisato/pythonlyx


text:
benchxml
========

**DISCLAIMER:** Benchmarks are not always reliable, the numbers vary, and many factors must be taken into account. I am new to benchmarking. If you are the maintainer of one of these projects and you disagree with my conclusions, please tell me why and I will gladly correct this documentation. I know developers often put a lot into testing and optimizing their code. I put these benchmarks together for my own education. If you are trying to decide which library to use, don't just take these numbers at face value, run your own tests. Each system is different.

    WARNING: Nokogiri was built against LibXML version 2.8.0, but has dynamically loaded 2.9.1
           user     system      total        real
    ox  1.030000   0.000000   1.030000 (  1.146722)
    libxml  1.010000   0.000000   1.010000 (  1.107478)
    nokogiri  1.030000   0.000000   1.030000 (  1.111019)
    rexml  0.990000   0.000000   0.990000 (  1.092973)

**SUBJECTIVE INTERPRETATION:** All were run with multi_xml. Curiously, on my system Peter Ohler's [ox](http://www.ohler.com/dev/xml_with_ruby/xml_with_ruby.html) gem came in dead last. I was not expecting that. Even stranger, the pure ruby STDLIB REXML XML parsing was the fastest. YMMV.

repository: weirdpercent/benchxml

repo_name: weirdpercent/benchxml


text:
# How to Contribute

## Information first

Before starting on a feature or a bug, please tell the community about it. Simply create an issue on the github Issue Tracker.
Describe the issue in a few words, for example what the error is or what feature you have in mind.
So everybody knows about the problem/feature and that someone is working on it.

## Creating a pull request

* Create a github account if you don't have one already.
* Fork our master branch into your github account.
* Make a feature branch for your change.
* Do your thing.
* Don't forget the tests!
* Open a pull request on the github site.
* If the automatic test are fine, we will merge
* If they are failing, please fix them!

If you plan to do a complex change, it may be good to create a pull request before you are done. So the others can see what
you are planning and maybe correct the trajectory if needed.

## Coding conventions

TDB

## Testing

If you add new features, add new tests for them. If you change something, adapt the tests to the fix, if needed.

### rspec-puppet

To run the rspec-puppet tests for this module install the needed gems with [bundler](http://bundler.io):

     bundle install --path=vendor

And run the tests and puppet-lint:

     bundle exec rake

### Acceptance Tests

Please note: Acceptance tests require vagrant & virtualbox to be installed.

To run acceptance tests on the default centos 6 vm:

     bundle exec rake beaker

### Vagrant

To deploy a Opennebula instance locally run:

     vagrant up <boxname>

where "boxname" is currently centos.

### Docker

To deploy a OpenNebula instance locally in a docker container run these commands:

First build an image with puppet and the sources in it (Depending on centos:6):

    cd docker
    docker build --rm -t epost-dev/one .
    cd ..

Run puppet in the container, choose one:

Only build a container which acts as a OpenNebula head, gui, but not the kvm things:

    docker run --rm -v $(pwd):/etc/puppet/modules/one epost-dev/one puppet apply /etc/puppet/modules/one/spec/docker-int/one-head.pp

Only build a container which acts like an OpenNebula node:

    # here is a common error i wasn't able to fix. centos 6 in docker has some issues with ksm
    docker run --rm -v $(pwd):/etc/puppet/modules/one epost-dev/one puppet apply /etc/puppet/modules/one/spec/docker-int/one-node.pp

Build a container which acts as head and node

    docker run --rm -v $(pwd):/etc/puppet/modules/one epost-dev/one puppet apply /etc/puppet/modules/one/spec/docker-int/one-head-node.pp

Build a container which has an apache for the OpenNebula Sunstone configured:

    docker run --rm -v $(pwd):/etc/puppet/modules/one epost-dev/one puppet apply /etc/puppet/modules/one/spec/docker-int/one-head-httpd.pp

This Docker command will add the current directory as ```ect/puppet/modules/one```. So one can test each new change without committing or rebuilding the image.

The "spec" files can be found in the spec/docker-int directory of this project. One will build a one head,
one will build a node and one a head which also can be a node.

repository: endocode/opennebula-puppet-module

repo_name: endocode/opennebula-puppet-module


text:
# RSA Encryption and Signing from the command line

### Signing Scheme

1. Hash the contents of the document using SHA256.

2. Encrypt the hash with a private RSA key.

3. Append to the end of the file, including the newlines:

```

------------------------------------------
< ciphertext >

```
This payload is 558 bytes total (512 for the ciphertext).

### Encryption Scheme

1. Generate symmetric key

2. Encrypt payload (including signature) using AES, with symmetric key

3. Encyrpt symmetic key with public key of recipient

4. Append to payload, including newlines:
```

------------------------------------------
< cipher of key >

```
This payload is 558 bytes total (512 for the ciphertext).

5. Write to top of file, including newlines:
```

------------------------------------------

```
This write is 45 bytes.

6. Write encrypted payload (now with key cipher) to file.

### Address book structure

By default, the address book is ~/.keys
This directory contains me/ which contains public.key and private.key.

The -genkey flag writes to me/

#### Contact's keys

Keys should be stored in the addressBook with the name: `<contact name>.key`

### Bash setup

Add `source /path/to/bashscript.sh` to your .bash_profile

### Usage

`sign -genkey` : Generates RSA key pair and writes to /path/to/addrBook/me/(private || public).key

`sign -key <key file> <infile> <outfile>` : Sign infile with temporary key. Write to outfile.

`sign -setAddrBook` : Set the address book.

`sign -getBook` : Prints address of current address book

`sign -c <file to check> < public key>` : Check signature of file with the specified pulbic key.
	--Note: `<public key>` can be a filepath or a name from the address book.

`sign -d <in> <out>` : Decrypt the in file and write to the out file.

`sign -E <public key> <in> <out>` : Sign the in file, encrypt it with the public key, write it to the out file.

`sign <in> <out>` : Sign the in file, write to the out file.


text:
Changelog
=========

Releases for CakePHP 3
-------------

* 6.0.1
  * Fix deprecation messages

* 1.0.0-beta.2
  * Implements api middleware with PSR-7 support

* 1.0.0-beta.1
  * Initial release

repository: darkclaw/cakephp-api

repo_name: darkclaw/cakephp-api


text:
## Darren's Disney API

Written by Darren Popham
License: ISC

### What is this?

A sample project I was playing with that wraps the existing themeparks plugin written by Cubehouse that provides a simple API interface to query for the data in an online service.

It's not exactly a hypermedia style API but it is close.  Part of the reason for building it in this fashion was for consistency and to be able to use the API responses as a learning tool and provide a clue as to what to do next.   As well it looks cool.

## What do I use it for?

If you wanted to use the above mentioned themeparks plugin but did not want to build its functionality directly into your code but instead access the data through a restful API then this type of project may be a solution for you.  Heck if something like this were included in the themeparks plugin (not this code though, it's not pretty, I just hammered it out in a short time to git 'r done, not win awards) then quite possibly the adoption of using the themeparks plugin could increase, IMHO of course.

That said though this could prove useful to someone, so Enjoy!

## How do I use it?

It runs as a node service.  I included a supervisor config file if you want to launch it that way as merely an example.

As well to use this you will likely need a front end web server that does all the SSL temrination, filtering, ensuring the URL requested is valid and then proxying the remaining safe URL to the API service.  Don't expose something like this directly on a network, use existing tools (like nginx) to sit in front and protect it.

## What is this swagger thing?

Swagger (swagger.io) is a tool that allows you to build and interact with RESTful APIs.  It can integrate into your code and/or rely upon a json file to define its functions and data types.  In this case I provided a swagger.json file to define what happens and then use the swagger module to interface into the service.   Think of it as a developer's test tool.  Plus it's fun to play with.

## Why is there no client application?

I got bored.

license: ISC


text:
Materialize Meteor
=============

A modern responsive front-end framework based on Material Design.

[Materialize alpha release v0.96.1](http://materializecss.com/) packaged for [Meteor](http://meteor.com).

[materialize-meteor on atmospherejs.com](https://atmospherejs.com/d0minikk/materialize-meteor)

### Installation

With Meteor 0.9 and above, install using:

```sh
$ meteor add rymate1234:materialize-meteor
```


text:
# Data format \(Pro Edition\) {#concept_ap3_lql_b2b .concept}

If you want to use rules engine to forward data, you need to write a SQL statement to process data using message topics. Therefore, the format in which data is stored in these topics must be able to be parsed by SQL statements. For IoT Platform Basic edition topics, the data format is defined manually. For IoT Platform Pro edition topics, the data format of custom topics is defined manually, and the data format of system topics is pre-defined by the system. For scenarios where the data format is pre-defined, data is strictly processed according to the format. This topic explains the pre-defined data format of system defined topics.

## Messages about device properties reported by devices {#section_jrb_lrl_b2b .section}

By using the following topic, you can obtain the device properties reported by devices.

Topic：`/sys/{productKey}/{deviceName}/thing/event/property/post`

Data format:

```
{
    "iotId":"4z819VQHk6VSLmmBJfrf00107ee200",
    "productKey":"1234556554",
    "deviceName":"deviceName1234",
    "gmtCreate":1510799670074,
    "deviceType":"Ammeter",
    "items":{
        "Power":{
            "value":"on",
            "time":1510799670074
        },
        "Position":{
            "time":1510292697470,
            "value":{
                "latitude":39.9,
                "longitude":116.38
            }
        }
    }
}
```

Parameter descriptions:

|Parameter|Type |Description|
|---------|-----|-----------|
|iotId|String|The unique identifier of the device.|
|productKey|String|The unique identifier of the product to which the device belongs.|
|deviceName|String|The name of the device.|
|deviceType|String|The node type of the device.|
|items|Object|Device data.|
|Power|String|The property name. See the TSL description of the product for all the property names.|
|Position|String|The property name. See the TSL description of the product for all the property names.|
|value|Defined in TSL|Property values|
|time|Long|The time when the property is created. If the device does not report the time, the time when the property is generated on the cloud will be used.|
|gmtCreate|Long|The time when the message is generated.|

## Messages about events reported by devices {#section_rlf_fsl_b2b .section}

By using the following topic, you can obtain event information reported by devices.

Topic: `/sys/{productKey}/{deviceName}/thing/event/{tsl.event.identifier}/post`

Data format:

```
{
    "identifier":"BrokenInfo",
    "Name": "Damage rate report ",
    "type":"info",
    "iotId":"4z819VQHk6VSLmmBJfrf00107ee200",
    "productKey":"X5eCzh6fEH7",
    "deviceName":"5gJtxDVeGAkaEztpisjX",
    "gmtCreate":1510799670074,
    "value":{
        "Power": "on",
        "Position":{
            "latitude":39.9,
            "longitude":116.38
        }
    },
    "time":1510799670074
}
```

Parameter descriptions:

|Parameter|Type |Description|
|---------|-----|-----------|
|iotId|String|The unique identifier of the device.|
|productKey|String|The unique identifier of the device product.|
|deviceName|String|The name of the device.|
|type|String|Event type. See the TSL of the product for details.|
|value|Object|Parameters of the event.|
|Power|String|The parameter name of the event.|
|Position|String|The parameter name of the event|
|time|Long|The time when the event is generated. If the device does not report the time, the time recorded on the cloud will be used.|
|gmtCreate|Long|The time when the message is generated.|

## Device lifecycle change messages {#section_ijz_y2n_qfb .section}

By using the following topic, you can obtain messages about device creation and deletion, and about devices being enabled and disabled.

Topic: `/sys/{productKey}/{deviceName}/thing/lifecycle`

Data format:

```
{
"action" : "create|delete|enable|disable",
"iotId" : "4z819VQHk6VSLmmBJfrf00107ee200",
"productKey" : "X5eCzh6fEH7",
"deviceName" : "5gJtxDVeGAkaEztpisjX",
"deviceSecret" : "",
"messageCreateTime":<PHONE_NUMBER>881
}
```

Parameter descriptions:

|Parameter|Type |Description|
|---------|-----|-----------|
|action|String| -   create: Create devices.
-   delete: Delete devices.
-   enable: Enable devices.
-   disable: Disable devices.

 |
|iotId|String|The unique identifier of the device.|
|productKey|String|The unique identifier of the product.|
|deviceName|String|The name of the device.|
|deviceSecret|String|The device secret. This parameter is only included when the value of action is create.|
|messageCreateTime|Integer|The timestamp when the message is generated, in milliseconds.|

## Device topological relationship update messages {#section_khs_ffn_qfb .section}

By using the following topic, you can obtain messages about topological relationship creation and removal between sub-devices and gateways.

Topic: `/sys/{productKey}/{deviceName}/thing/topo/lifecycle`

Data format:

```
{
"action" : "add|remove|enable|disable",
"gwIotId": "4z819VQHk6VSLmmBJfrf00107ee200",
"gwProductKey": "1234556554",
"gwDeviceName": "deviceName1234",
"devices": [
        {
"iotId": "4z819VQHk6VSLmmBJfrf00107ee201",
"productKey": "12345565569",
"deviceName": "deviceName1234"
       }
    ],

"messageCreateTime":<PHONE_NUMBER>881
}
```

Parameter descriptions:

|Parameter|Type |Description|
|---------|-----|-----------|
|action|String| -   add: Add topological relationships.
-   remove: Delete topological relationships.
-   enable: Enable topological relationships.
-   disable: Disable topological relationships.

 |
|gwIotId|String|The unique identifier of the gateway device.|
|gwProductKey|String|The unique identifier of the gateway product.|
|gwDeviceName|String|The name of the gateway device.|
|devices|Object|The sub-devices whose topological relationship with the gateway will be updated.|
|iotId|String|The unique identifier of the sub-device.|
|productKey|String|The unique identifier of the sub-device product.|
|deviceName|String|The name of the sub-device.|
|messageCreateTime|Integer|The timestamp when the message is generated, in milliseconds.|

## Messages about detected sub-devices reported by gateways {#section_d5t_qsl_b2b .section}

In some cases, gateways can detect sub-devices and report their information. By using the following topic, you can obtain the sub-device information reported by gateways.

Topic: `/sys/{productKey}/{deviceName}/thing/list/found`

Data format:

```
{
    "gwIotId":"4z819VQHk6VSLmmBJfrf00107ee200",
    "gwProductKey":"1234556554",
    "gwDeviceName":"deviceName1234",
    "devices":[
        {
            "iotId":"4z819VQHk6VSLmmBJfrf00107ee201",
            "productKey":"12345565569",
            "deviceName":"deviceName1234"
        }
    ]
}
```

Parameter descriptions:

|Parameter|Type |Description|
|---------|-----|-----------|
|gwIotId|String|The unique identifier of the gateway device.|
|gwProductKey|String|The unique identifier of the gateway product.|
|gwDeviceName|String|The name of the gateway device.|
|devices|Object|The sub-devices that are detected by the gateway.|
|iotId|String|The unique identifier of the sub-device.|
|productKey|String|The unique identifier of the sub-device product.|
|deviceName|String|The name of the sub-device.|

## Devices return result data to the cloud {#section_mgr_2tl_b2b .section}

By using the following topic, you can obtain request execution results from devices when you send operation requests to devices using an asynchronous method. If an error occurs when sending the request, you will receive an error message from this topic.

Topic: `/sys/{productKey}/{deviceName}/thing/downlink/reply/message`

Data format:

```
{
    "gmtCreate":1510292739881,
    "iotId":"4z819VQHk6VSLmmBJfrf00107ee200",
    "productKey":"1234556554",
    "deviceName":"deviceName1234",
    "requestId":1234,
    "code":200,
    "message":"success",
    "topic":"/sys/1234556554/deviceName1234/thing/service/property/set",
    "data":{

    }
}
```

Parameter descriptions

|Parameter|Type |Description|
|---------|-----|-----------|
|gmtCreate|Long|The timestamp when the message is generated.|
|iotId|String|The unique identifier of the device.|
|productKey|String|The unique identifier of the product.|
|deviceName|String|The name of the device.|
|requestId|Long|The request message ID.|
|code|Integer|The code for the result message.|
|message|String|The description of the result.|
|data|Object|The result data reported by the device. For pass-through communication, the result data will be converted by the parsing script.|

Response information:

|Parameter|Message|Description|
|---------|-------|-----------|
|200 |success |The request is successful.|
|400|request error|Internal service error.|
|460|request parameter error |The request parameters are invalid. The device has failed input parameter verification.|
|429|too many requests |Too many requests in a short time.|
|9200|device not activated|The device is not activated yet.|
|9201|device offline|The device is offline now.|
|403|request forbidden|The request is prohibited because of an overdue bill.|

## Messages about device status {#section_fyq_xsl_b2b .section}

By using the following topic, you can obtain the online and offline status of devices.

Topic: `{productKey}/{deviceName}/mqtt/status`

Data format:

```
{
    "productKey":"1234556554",
    "deviceName":"deviceName1234",
    "gmtCreate":1510799670074,
    "deviceType":"Ammeter",
    "iotId":"4z819VQHk6VSLmmBJfrf00107ee200",
    "action":"online|offline",
    "status":{
        "value":"1",
        "time":1510292697471
    }
}
```

Parameter descriptions:

|Parameter|Type |Description|
|---------|-----|-----------|
|iotId|String|The unique identifier of the device.|
|productKey|String|The unique identifier of the device product.|
|deviceName|String|The name of the device.|
|status|Object|The status of the device.|
|Value|String|1: online; 0: offline.|
|time|Long|The time when the device got online or offline.|
|gmtCreate|Long|The time when the message is generated.|
|action|String|The action of device status change: go online or go offline.|

url: https://raw.githubusercontent.com/WangJieJason/iot/a5e90d632a92eeff8d7791c3d95e287dc3b966ab/intl.en-US/User Guide/Rules engine/Data format (Pro Edition).md

repository: WangJieJason/iot

filename: Data format (Pro Edition).md

repo_name: WangJieJason/iot


text:
---
layout:     post
title:      "I want to be replaced"
subtitle:   "By a better future self"
date:       2022-03-08 20:28:00
author:     "Marius Hobbhahn"
header-img: "img/header-imgs/replace.png"
category:   opinion
tags:       [Improve, Effective Altruism]
---

## **What is this post about?**

People often cling to their current identity as if the status quo was the best possible version of themselves. For example, they think they are “a person that is just bad at math” but don’t intend to change that since they have formed an identity around it. This even goes even further. When people are offered the hypothetical to gain 50 IQ with no strings attached some reject it because “they wouldn’t be the same”.
Whenever I realize something like that in myself, I feel caught red-handed and ashamed. Rationally, I don’t want to be a person that forms an identity around a suboptimal version of myself but realistically I often do.

I think this tendency is suboptimal for future versions of ourselves, our surroundings and society at large. Thus, I want to create a strong mantra and emotional commitment against it. I don’t want to cling to my current identity.

*I want to be replaced!*

**Epistemic status:** Motivational (inspired by [John Wentworth](https://www.lesswrong.com/posts/BseaxjsiDPKvGtDrm/we-choose-to-align-ai))

I previously posted this article on the EA forum.

## By a better future self

I don’t want to be a person that forms an identity around their current flaws and laughs them off like “I’m just the person who is bad at writing” like it was some inherent feature of mine. I want to be replaced by a future better version of myself, somebody that is similar to me in most aspects but a better writer.

I think this intuition works especially well with a [Ship of Theseus](https://en.wikipedia.org/wiki/Ship_of_Theseus)-like, continuous flowy version of identity. The cells our bodies consist of are replaced multiple times within our lifetime, our bodies and brain change pretty drastically throughout childhood, puberty and adulthood, and yet, we always build an identity around the current version of ourselves. Why not accept the fact that we change and form an identity that welcomes better versions of the status quo rather than rejects them?

*I want to be replaced by my future better self!*

## By a better partner

Some relationship decisions are driven by the fear of losing our partners, independent of the consequences for others. For example, if Bob is in a relationship with Alice but Alice realizes that she likes Chakresh better, Bob will traditionally fight for her and try to prevent her from being with Chakresh. After a while, the dust settles and everyone is unhappy. Bob is unhappy because he can’t make Alice as happy as she could be, and Alice+Chakresh are unhappy because they are not with each other.

The entire situation could be so much better if Bob just allowed Alice to be with Chakresh. Clearly, this goes against most social norms and instincts and yet it seems better in the long term to accept when you are a suboptimal fit. Furthermore, the easier it is for you to accept the situation, the less damage is done to everyone involved. I don’t want to be Bob.

*I want to be replaced by a better partner!*

## By a better employee

People cling to their jobs as if it’s the only thing they can ever do.  For the economy at large, it is good when inefficient jobs are cut, bad employees are demoted and good ones promoted. Even for ourselves, it’s usually not as bad as we assume. If a better person gets promoted, that will likely benefit the company at large and thus us. If we get fired for bad work, we might not have been a perfect fit to begin with*. In the long run, it often means finding a better-fitting position or is better for society.

*I want to be replaced by a better employee.*

*I know that there are people in less privileged positions for whom this mantra doesn’t make any sense.

## By a machine

Historically people have really disliked losing their job to automation. The weavers rioted against the introduction of the power loom and the coach industry lobbied against the car. And yet, from most other perspectives, automation has been a wild success. People have to do less risky and less monotonous jobs and are more productive.

So rather than being sad about the short-term loss, I should look forward to humanities’ gain and possibly more exciting opportunities when I’ll be replaced.

*I want my job to be replaced by a machine.*

## By better humans

When I talk to people about future generations that could be vastly healthier, happier and more intelligent than we are, I often get responses along the lines of “Hmmm not sure, they are so … different”. And if I asked a person in the middle ages about a person in 2020 who lives for 80 years, is healthier and can communicate with someone in Australia in real-time, they would probably respond “Hmmm not sure, they are so … different”. Also, they wouldn’t know what Australia is.
It is as if people believe that the current state of progress was the optimum for some peculiar coincidence.

I look forward to future generations having better lives than we do and I’m happy if we get there faster.

*I want to be replaced by better humans!*

## By a simulation

The physical world has limits that simulations can ignore. While there is limited space, food, water, metals, etc. on earth, we can basically have as much as we want in a simulation. Furthermore, our bodies have limits. We can’t fly, we can’t breathe underwater and our happiness is limited to a small part of the possible spectrum by our biology.

When people think of simulations, they often think of rats on heroin or matrix-like brain-in-a-vat scenarios. I prefer to think of a [San Junipero](https://en.wikipedia.org/wiki/San_Junipero) where people have fun, nobody has to fight for resources, diseases don’t exist and no one needs to work if they don’t want to. A good simulation isn’t cold, it should feel like the best imaginable holiday forever.

*I want to be replaced by a simulation!*

  It is also sad to realize that future sentient beings, whether on a carbon or silicon basis, might lead much better lives.
And yet, I don’t want to be bitter about these things. I want to accept that they are better for my future self, people I care about and society at large.

*I want to be replaced!*

#### ***One last note***

If you want to get informed about new posts you can follow me on Twitter.

If you have any feedback regarding anything (i.e. layout or opinions) please tell me in a constructive manner via your preferred means of communication.

gha_language: Jupyter Notebook


text:
Go to the [https://github.com/keepitcool/prettyoutput/graphs/contributors](GitHub contributors graph page)
to see the list of contributors.

repository: keepitcool/prettyoutput

repo_name: keepitcool/prettyoutput


text:
# Subarray Sum Equals K

LeetCode #: [560](https://leetcode.com/problems/subarray-sum-equals-k/)

Difficulty: Medium

Topic: Array, Hash Table.

## Problem

Given an array of integers and an integer `k`, you need to find the total number of continuous subarrays whose sum equals to `k`.

Example 1:

```text
Input:nums = [1,1,1], k = 2
Output: 2
```

Note:

- The length of the array is in range [1, 20,000].
- The range of numbers in the array is [-1000, 1000] and the range of the integer `k` is [-1e7, 1e7].

## Complexity Analysis

Time complexity: O(n). We loop through the array only once.

Space complexity: O(n). Hash map can contain up to n entries.

repository: SandeepKapalawai/leetcode

repo_name: SandeepKapalawai/leetcode


text:
# Cubos Widgets

Flutter package containing the most used Widgets in Cubos Tecnologia's projects.

## Features
- HorizontalSpacing
- VerticalSpacing
- AlwaysDisabledFocusNode
- HtmlWidget

### HtmlWidget
It uses the `flutter_html` library to allow us to use HTML tags to customize text styles without using the RichText widget. It also allows us to customize texts from the backend. Example:

```
HtmlWidget(
    data: """
      Hello <strong>World</strong>!
      <br>
      <br>
      <strong>Uma lista qualquer:</strong>
      <ul>
        <li>2x Cadeiras</li>
        <li>1x Cobertor</li>
        <li>1x Folha de papel</li>
        <li>1x caixa de lápis de cor</li>
        <li>1x caixa de tinta guache</li>
      </ul>
      """,
    textStyle: TextStyle(color: Colors.blue, fontSize: 20),
);
```
### ResponsiveTextScaleFactor
Responsive text scale factor should be used to create a range of text scale factor for a specific widget or all your screen, and ensures better usability without layout overflow when users with vision problems use the app with TextScaleFactor increased on your devices.

```
ResponsiveTextScaleFactor(
  minScaleFactor: 0.5,
  maxScaleFactor: 2.0,
  child: Text('Hello world'),
),
```

## Let's grow together!

You can support us making your own contributions! Report bugs or unexpected behaviors and suggest new features on the issues page from the [Github repository](https://github.com/daniloapr/cubos_widgets). Widget tests are very appreciated and recommended in the Pull Requests.

## Get to know us

Find out more about Cubos Tecnologia on [cubos.io](https://cubos.io)


text:
---
layout: post
title: passing csv to sql is bad mm'kay
---

passing csv to a stored proc is bad m'kay. it leaves you open to sql injection attacks and in general isn't the best practice anyway. i'm going to avoid entire code samples just because it's too much typing, but let's take a sample proc and assume you are passing in a varchar(1000) (@csv) comma delimited string. you could do something like this:

``` SQL
declare sql varchar(2000)
set sql = 'select * from table where id in (' + @csv + ')'
sp_executesql @sql
```

obviously this will work fine if you pass in 1,2,3,4 into your list. but what if some bad person sends you 1,2,3,4,null);select * from users; or something more fun. yep, bad. so what can we do? xml my friend. let's change our input parameter to a type of xml and name it @xml. let's say our xml must be in the format and you can have as many r records as you want. in fact, they can be any kind of record for this following query as long as they have an id attribute.

``` SQL
select * from table t join @xml.nodes('/root/*') x(n) on n.value('@id','int') = t.id
```

yep, same thing. you can do this a little differently using openxml, but that's old news and you can look that up. (via don't feed the penguins)

*edit*
also, don't forget that you can use more basic xml structures like just using value records and no root or wrapper. you can also validate the xml using xml schema collections in sql so you can have strongly typed values passed in.

the *point* is that you shouldn't be using csv values to pass to a proc. it's actually way easier in the sql code to use xml, and it's not tough in your calling code to send in <v id="1" /><v id="2" /><v id="3" /> instead of 1,2,3. yes, much longer which i'm normally against, but your sql isn't much longer and it performs much better too.

__Edit from the future!__

> Here in the year 2018, I have a new gist to add to this entry 😀

{% gist a26f23c6364670205b48d5f98e113456 %}


text:
haproxy-discover is a service discovery system for haproxy. It reads
the configuration for the backends from etcd and generates a new
haproxy.cfg from this.

### Usage

To run it:

    $ docker run -d --name haproxy-discover -e ETCD_HOST=<IP_ADDRESS>:4001 -p <IP_ADDRESS>:1936:1936 -p 80:80 -t am0s/haproxy-discover

Then for each host run the appropriate software for registering docker
services or custom services.

### Stats Interface

The haproxy stats interface is exposed on port 1936.  Open your browser to `http://localhost:1936` to view it.

### Acknowledgements

This code is based on [jwilder/docker-discover](https://github.com/jwilder/docker-discover) but heavily modified.

### License

MIT


text:
# Laravel Yandex Geocodig
Simply service laravel Yandex Geocoding

## Installation

Run composer require command.

```sh
composer require jack/laravel-yandex-geocode
```

### Laravel install

After updating composer, register the service provider in bootstrap\app.php
```php
Yandex\Geo\YandexServiceProvider::class
```

Add then alias YaGeo adding its facade to the aliases array in the same file:

```php
'YaGeo' => Yandex\Geo\YandexServiceProvider::class
```

## Configuration

## Usage

repository: martinjack/laravel-yandex-geocoding

repo_name: martinjack/laravel-yandex-geocoding


text:
# am-role-assignment-batch-service

Role Assignment Batch Service

## Purpose

Scheduled batch job for removing the expired assignment records from role-assignment-service database.
This is spring batch application scheduled with Kubernetes and runs once in a day per cluster.

### Prerequisites

To run the project you will need to have the following installed:

* Java 11
* Docker

please ensure the following application components are already running:
* am-role-assignment-service
* am-role-assignment-database

### Running the application

To run the applicaiton quickly use the docker helper script as follows:

```
./bin/run-in-docker.sh install
```
or

```
docker-compose up
```

Alternatively, you can start the application from the current source files using Gradle as follows:

```
./gradlew clean bootRun
```

If required, to run with a low memory consumption, the following can be used:

```
./gradlew --no-daemon assemble && java -Xmx384m -jar build/libs/rd-case-worker-api.jar
```

### Running unit tests tests:

If you have some time to spare, you can run the *unit tests* as follows:

```
./gradlew test
```

### Running mutation tests tests:

If you have some time to spare, you can run the *mutation tests* as follows:

```
./gradlew pitest
```

As the project grows, these tests will take longer and longer to execute but are useful indicators of the quality of the test suite.

More information about mutation testing can be found here:
http://pitest.org/

### Contract testing with pact

Please refer to the confluence on how to run and publish PACT tests.
https://tools.hmcts.net/confluence/display/RTRD/PACT+testing


text:
# 04 Publish

In this example we are going to publish the library.

We will start from `03-component-lib`.

Summary steps:

- Create an account in npm.
- Login in npm.
- Publish the library.

# Steps to build it

- `npm install` to install previous sample packages:

```bash
npm install
```

Let's create an account in [npm](https://www.npmjs.com/signup).

> If you already have an account, you can skip this step.

Login in npm:

```bash
npm login
```

Publish the library:

```bash
cd common-library
npm publish --access public
```

Why is it failing? We need to change the scope of the package from `@lemoncode` to `@your-npm-user-name` or `@your-npm-org-name`.

_./common-library/package.json_

```diff
{
- "name": "@lemoncode/common-library",
+ "name": "@<user-name>/common-library",
  "version": "1.0.0",
  "description": "Lemoncode common library",
  "author": "Lemoncode",
  ...
}
```

Publish again:

```bash
cd common-library
npm publish --access public
```

Visit your published packages in `https://www.npmjs.com/settings/<user-name>/packages`.

Let's try to install it in another project:

```bash
cd new-project
npm install @<user-name>/common-library
```

Nice, we have our library working. But we want to publish only some files to reduce the files to publish, for example we don't want to publish the `src` folder or the `tsconfig.json` file.

Let's add the `files` property:

_./common-library/package.json_

```diff
{
  ...
  "keywords": [
    "lemoncode",
    "common",
    "library"
  ],
+ "files": [
+   "dist"
+ ],
  "type": "module",
  "main": "dist/common-library.umd.cjs",
  ...
}
```

> Some files are always included like `package.json`, `README.md` and `LICENSE`.
>
> More info about [files](https://docs.npmjs.com/cli/v7/configuring-npm/package-json#files)

Update the `package.json` version:

```diff
{
  "name": "@<user-name>/common-library",
- "version": "1.0.0",
+ "version": "1.0.1",
  "description": "Lemoncode common library",
  "author": "Lemoncode",
}
```

Publish again:

```bash
cd common-library
npm publish --access public
```

Install the new version:

```bash
cd new-project
npm install @<user-name>/common-library@latest
```

# About Basefactor + Lemoncode

We are an innovating team of Javascript experts, passionate about turning your ideas into robust products.

[Basefactor, consultancy by Lemoncode](http://www.basefactor.com) provides consultancy and coaching services.

[Lemoncode](http://lemoncode.net/services/en/#en-home) provides training services.

For the LATAM/Spanish audience we are running an Online Front End Master degree, more info: http://lemoncode.net/master-frontend

repository: Lemoncode/master-frontend-lemoncode

repo_name: Lemoncode/master-frontend-lemoncode


text:
---
layout: "unit"
title: "Guide Entry 95.02.05"
path: "/curriculum/guides/1995/2/95.02.05.x.html"
unitTitle: "Using Film and Literature in the Elementary Classroom: The Jungle Book"
unitAuthor: "Gretchen L. Gallagher"
keywords: ""
recommendedFor: "Recommended for Science, Social Studies, Language, grades 1-3"
---

Guide Entry to 95.02.05:

This unit was designed for use with a class of third grade boys who exhibit problematic behavior and social and emotional difficulties. The Jungle Book by Rudyard Kipling was chosen for the following reasons:

-its status as an example of “classic” children’s literature

-the availability of both animated and live-action versions of the novel on videotape

-the interesting and exciting nature of the story itself

-the possibility of studying rain forests, Rudyard Kipling and India at the same time or before studying the novel and films

Included in the unit are:

-activities to complete while learning about the rain forest

-information about and references for studying India and Rudyard Kipling -guidelines and sample questions for reading The Jungle Book with the class

-a storyboard activity to complete before viewing the films

-a movie review to complete after viewing the films

(Recommended for Science, Social Studies, Language, grades 1-3)

gha_language: HTML


text:
cosmosdb-graph-builder
======

This product is developed in Unity 3D engine.
It is supposed to be used to create relationships between objects fast using relevant keywords.
The product will help with documentation as well as make it easier to be consistent with relations, keywords etc.

## Features
* **Build graphs** fast and easy
	* Preexisting node and edge types
* **Import graphs** from Azure Cosmos DB
* **Upload graphs** to Azure Cosmos DB
* **Export graphs** to Gremlin (query language) code

## Getting started
### Run application
If you would like to run the application as an exe, download it from the following link:
https://drive.google.com/file/d/1ZzmRF--9dbcwYM2Rlku_aBjYEkbSiequ/view?usp=sharing

However, if you would like to run it directly on the browser, navigate to the following link:
https://www.eframtid.se/kna/arrow/

Be aware, the browser version of this application is only for demo, it is not stable nor performant.
The browser version also lacks some functionality.

### Get the project up and running on your local machine for development and testing purposes.

#### Requirements
* Unity >= 2019.4.10

### How to use the software
#### Camera movement:
	WASD or Up, left-, down- & right-arrows
	Move faster by holding left-shift

#### Pan camera:
	Press and hold left ALT while dragging

#### Zoom in and out:
	Click plus or minus to zoom in/out
	Also works with comma and period
	Also works with scrolling or pinching

#### Zoom and snap to object:
	Press F when mouse on object

##### Hide graphical user interface
	You can hide all GUI by pressing H. (this function is locked when user is in menus)

#### Hide dialog bubbles
	You can hide all dialog bubbles by pressing B. (this function is locked when user is in menus)

#### Add node:
	Double click on empty space on screen

#### Delete node:
	You can delete the node in edit mode or by
	left-clicking and holding a node while pressing the delete button

#### Change node types:
	You can "scroll" through node types by middle clicking on a node

#### Delete edge:
	You can delete the edge in edit mode or by
	left-clicking and holding an edge while pressing the delete button

#### Reverse edge:
	You can reverse the edge in edit mode or by
	left-clicking and holding an edge while pressing R on the keyboard

#### Change edge types:
	You can "scroll" through edge types by middle-clicking on an edge

#### Create relationship between 2 nodes:
	left-click and hold from the edge of a node to another node
	Also works with rightclick (on the node, not the edge) and hold before "drawing"

#### Create node and relationship from one node to new node:
	Left-click on nodes edge and hold, draw to empty space
	Also works with rightclick and hold before "drawing" to empty space

#### Edit node:
    Here you can:
      Double-click on node
      Edit label (type)
      Edit properties
      Edit node color
      Delete node

#### Move node (and all of its relations):
	Left-click and hold node, move mouse to move node

#### Edit line by double clicking on it
	Here you can:
		Reverse line
		Delete line
		Edit label
		Edit properties
		See the "to" and "from" node connections

#### You can set default node and edge properties for specific types in edit mode
    You can save and load scenes (json-format)
    You can export to Gremlin
    You can load graphs from cosmos db (json) and also convert them to Gremlin code
    You can upload data to cosmos database with one click! (note: it does not drop any existing data, if not explicitly doing so)

## Contributors
#### [Mostafa Hassan](https://github.com/MostafaHassan)
cosmosdb-graph-builder is an open-source project administered by **e-framtid**. We appreciate your interest and efforts to contribute.

## License
This project is licensed under the MIT License - see the LICENSE.md file for details

repository: MostafaHassan/cosmosdb-graph-builder

branch_name: refs/heads/dev

gha_language: C#

repo_name: MostafaHassan/cosmosdb-graph-builder


text:
Python Examples
==================

These examples are scripts that can be run independently to demonstrate the Rosette API functionality.

Prerequisite: Either run `pip install rosette_api` or run `python setup.py install` in the python top level folder.

Alternatively, you can run all the examples with the command line:
`find -maxdepth 1 -name "*.py" -exec tox -- {} --key api-key --url alternate_url \;`

You can now run your desired _endpoint_.py file to see it in action.
For example, run `python/examples/categories.py` if you want to see the categories
functionality demonstrated.

All files require you to input your Rosette API User Key after --key to run.
For example: `python ping.py --key<PHONE_NUMBER>`
All also allow you to input your own service URL if desired.
For example: `python ping.py --key<PHONE_NUMBER> --service_url http://www.myurl.com`
Some (specified below) allow an additional input of either a file (.html or .txt) or a URL with `--file` or `--url`

Each example, when run, prints its output to the console.

| File Name                     | What it does                                          |
| -------------                 |-------------                                        |
| categories.py                    | Gets the category of a document at a URL              |
| entities.py                      | Gets the entities from a piece of text                |
| info.py                          | Gets information about Rosette API                    |
| language.py                      | Gets the language of a piece of text                  |
| matched-name.py                  | Gets the similarity score of two names                |
| morphology_complete.py               | Gets the complete morphological analysis of a piece of text|
| morphology_compound-components.py    | Gets the de-compounded words from a piece of text     |
| morphology_han-readings.py           | Gets the Chinese words from a piece of text           |
| morphology_lemmas.py                 | Gets the lemmas of words from a piece of text         |
| morphology_parts-of-speech.py        | Gets the part-of-speech tags for words in a piece of text |
| name_deduplication.py                | De-duplicates a list of names |
| ping.py                          | Pings the Rosette API to check for reachability       |
| relationships.py                      | Gets the relationships between entities from a piece of text                |
| sentences.py                     | Gets the sentences from a piece of text               |
| sentiment.py                     | Gets the sentiment of a local file                    |
| tokens.py                        | Gets the tokens (words) from a piece of text          |
| translated-name.py               | Translates a name from one language to another        |
| transliteration.py               | Transliterates the given text |

repository: lathakris/python

repo_name: lathakris/python


text:
[Home](./index.md) > [@firebase/database](./database.md) > [remove](./database.remove.md)

## remove() function

Removes the data at this Database location.

Any data at child locations will also be deleted.

The effect of the remove will be visible immediately and the corresponding event 'value' will be triggered. Synchronization of the remove to the Firebase servers will also be started, and the returned Promise will resolve when complete. If provided, the onComplete callback will be called asynchronously after synchronization has finished.

Signature:

```typescript
export declare function remove(ref: Reference): Promise<void>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  ref | [Reference](./database.reference.md) | The location to remove. |

Returns:

Promise<void>

Resolves when remove on server is complete.

repository: ChaseKnowlden/firebase-js-sdk

repo_name: ChaseKnowlden/firebase-js-sdk