text:
# openvidu-getaroom
 Check it on GitHub

OpenVidu-Getaroom demo, built with Vanilla JS,  allows users to connect to a room and share the link with others, so they can connect to it straight away just by visiting that link. It is a frontend-only application and it makes use of OpenVidu the same way [openvidu-js](tutorials/openvidu-js/) does.

OpenVidu is composed by the three modules displayed on the image above in its insecure version.

- **openvidu-browser**: JavaScript library for the browser. It allows you to manage your video-calls straight away from your clients
- **openvidu-server**: Java application that controls Kurento Media Server
- **Kurento Media Server**: server that handles low level operations of media flows transmission

## Running this demo

To run the tutorial you need the three components stated in [OpenVidu application architecture](developing-your-video-app/#openvidu-application-architecture): an OpenVidu deployment, your server application and your client application. In this order:

#### 1. Run OpenVidu deployment

Using [Docker Engine](https://docs.docker.com/engine/){:target="_blank"}:

```bash
# WARNING: this container is not suitable for production deployments of OpenVidu
# Visit https://docs.openvidu.io/en/stable/deployment

docker run -p 4443:4443 --rm -e OPENVIDU_SECRET=MY_SECRET openvidu/openvidu-dev:2.28.0
```

#### 2. Run your preferred server application sample

For more information visit [Application server](application-server/).

#### 3. Run the client application tutorial

You will need some kind of http web server installed in your development computer to serve the tutorial. If you have Node.js installed, you can use [http-server](https://github.com/indexzero/http-server){:target="_blank"}. It can be installed with:

```bash
npm install --location=global http-server
```

To serve the tutorial:

```bash
# Using the same repository openvidu-tutorials from step 2
http-server openvidu-tutorials/openvidu-getaroom/web
```

Go to [`http://localhost:8080`](http://localhost:8080){:target="_blank"} to test the app once the server is running.

> To test the application with other devices in your network, visit this **[FAQ](troubleshooting/#3-test-applications-in-my-network-with-multiple-devices)**

## Understanding the code

This application is very simple. It has only 4 files:

  - `openvidu-browser-VERSION.js`: openvidu-browser library. You don't have to manipulate this file.
  - `app.js`: sample application main JavaScript file, which makes use of _openvidu-browser-VERSION.js_. You can manipulate this file to suit your needs.
  - `index.html`: HTML code for the welcome page to join a new room and for the room itself. You can manipulate this file to suit your needs. It has two links to both JavaScript files:

  - `style.css`: some CSS classes to style _index.html_. You can manipulate this file to suit your needs. _index.html_ uses also Bootstrap as its main style framework.

Down below we will describe the most important code snippets in `app.js`:

---

#### Declaration of variables
We will need some variables accesible from differents methods

```javascript
var OV;						// OpenVidu object to initialize a session
var session;				// Session object where the user will connect
var publisher;				// Publisher object which the user will publish
var sessionId;				// Unique identifier of the session
var audioEnabled = true;	// True if the audio track of publisher is active
var videoEnabled = true;	// True if the video track of publisher is active
var numOfVideos = 0;		// Keeps track of the number of videos that are being shown
```

---

#### Window callbacks
On _load_ we will check if the user is connecting to an existing room or to a new one depending on the browser's location, on _beforeunload_ we will disconnect the user from the room

```javascript
// Check if the URL already has a room
window.addEventListener('load', function () {
	sessionId = window.location.hash.slice(1); // For 'https://myurl/#roomId', sessionId would be 'roomId'
	if (sessionId) {
		// The URL has a session id. Join the room right away
		console.log("Joining to room " + sessionId);
		showSessionHideJoin();
		joinRoom();
	} else {
		// The URL has not a session id. Show welcome page
		showJoinHideSession();
	}
});

// Disconnect participant on browser's window closed
window.addEventListener('beforeunload', function () {
	if (session) session.disconnect();
});
```

---

#### _joinRoom_ method
Here we initialize our session and set the events we need for the desired behaviuor. Then we connect to it and finally publish our own webcam to the session.

```javascript
function joinRoom() {

	if (!sessionId) {
		// If the user is joining to a new room
		sessionId = randomString();
	}

	// --- 1) Get an OpenVidu object ---

	OV = new OpenVidu();

	// --- 2) Init a session ---

	session = OV.initSession();

	// --- 3) Specify the actions when events take place in the session ---

	// On every new Stream received...
	session.on('streamCreated', function (event) {
		// Subscribe to the Stream to receive it. HTML video will be appended to element with 'subscriber' id
		var subscriber = session.subscribe(event.stream, 'videos');
		// When the new video is added to DOM, update the page layout to fit one more participant
		subscriber.on('videoElementCreated', function (event) {
			numOfVideos++;
			updateLayout();
		});
	});

	// On every new Stream destroyed...
	session.on('streamDestroyed', function (event) {
		// Update the page layout
		numOfVideos--;
		updateLayout();
	});

	// On every asynchronous exception...
	session.on('exception', (exception) => {
		console.warn(exception);
	});

	// --- 4) Connect to the session with a valid user token ---

	// 'getToken' method is simulating what your server-side should do.
	// 'token' parameter should be retrieved and returned by your own backend
	getToken(sessionId).then(token => {

		// Connect with the token
		session.connect(token)
			.then(() => {

				// --- 5) Set page layout for active call ---

				// Update the URL shown in the browser's navigation bar to show the session id
				var path = (location.pathname.slice(-1) == "/" ? location.pathname : location.pathname + "/");
				window.history.pushState("", "", path + '#' + sessionId);

				// Auxiliary methods to show the session's view
				showSessionHideJoin();
				initializeSessionView();

				// --- 6) Get your own camera stream with the desired properties ---

				publisher = OV.initPublisher('publisher', {
					audioSource: undefined, // The source of audio. If undefined default audio input
					videoSource: undefined, // The source of video. If undefined default video input
					publishAudio: true,  	// Whether to start publishing with your audio unmuted or not
					publishVideo: true,  	// Whether to start publishing with your video enabled or not
					resolution: '640x480',  // The resolution of your video
					frameRate: 30,			// The frame rate of your video
					insertMode: 'APPEND',	// How the video is inserted in target element 'video-container'
					mirror: true       		// Whether to mirror your local video or not
				});

				// --- 7) Specify the actions when events take place in our publisher ---

				// When our HTML video has been added to DOM...
				publisher.on('videoElementCreated', function (event) {
					// When your own video is added to DOM, update the page layout to fit it
					numOfVideos++;
					updateLayout();
					$(event.element).prop('muted', true); // Mute local video to avoid feedback
				});

				// --- 8) Publish your stream ---

				session.publish(publisher);
			})
			.catch(error => {
				console.log('There was an error connecting to the session:', error.code, error.message);
			});
	});
}
```

---

#### _leaveRoom_ method

```javascript
function leaveRoom() {

	// --- 9) Leave the session by calling 'disconnect' method over the Session object ---

	session.disconnect();

	// Back to welcome page
	window.location.href = window.location.origin + window.location.pathname;
}
```

## Deploying openvidu-getaroom

> This tutorial image is **officially released for OpenVidu** under the name `openvidu/openvidu-getaroom-demo:X.Y.Z` so you do not need to build it by yourself. However, if you want to deploy a custom version of openvidu-getaroom, you will need to build a new one. You can keep reading for more information.

#### 1) Build the docker image

Under the root project folder, you can see the `openvidu-getaroom/docker/` directory. Here it is included all the required files yo make it possible the deployment with OpenVidu.

First of all, you will need to create the **openvidu-getaroom** docker image. Under `openvidu-getaroom/docker/` directory you will find the `create_image.sh` script. This script will create the docker image with the [openvidu-basic-node](application-server/openvidu-basic-node/) as application server and the static files.

```bash
./create_image.sh openvidu/my-openvidu-getaroom-demo:X.Y.Z
```

This script will create an image named `openvidu/my-openvidu-getaroom-demo:X.Y.Z`. This name will be used in the next step.

#### 2) Deploy the docker image

Time to deploy the docker image. You can follow the [Deploy OpenVidu based application with Docker](/deployment/deploying-openvidu-apps/#with-docker) guide for doing this.

<link rel="stylesheet" href="https://cdnjs.cloudflare.com/ajax/libs/fancybox/3.1.20/jquery.fancybox.min.css" />

gha_language: CSS


text:
---
layout: default
---

# 1996-04-20 - Re: why compression doesn't perfectly even out entropy

## Header Data

From: "Perry E. Metzger"<EMAIL_ADDRESS>To: Andrew Loewenstern<EMAIL_ADDRESS>Message Hash: 72097ba68b8af763ba30034709b146261cf5289ef8f2f06962aeb881421da073

Message ID<EMAIL_ADDRESS>Reply To: \<9604191736.AA00569@ch1d157nwk\>

UTC Datetime: 1996-04-20 00:53:23 UTC

Raw Date: Sat, 20 Apr 1996 08:53:23 +0800

## Raw message

```
{% raw  %}From: "Perry E. Metzger"<EMAIL_ADDRESS>Date: Sat, 20 Apr 1996 08:53:23 +0800
To: Andrew Loewenstern<EMAIL_ADDRESS>Subject: Re: why compression doesn't perfectly even out entropy
In-Reply-To: <9604191736.AA00569@ch1d157nwk>
Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

Andrew Loewenstern writes:
> Perry writes:
> >  Furthermore, I suggest you look up the Venona intercept work
> >  and tell me again about how far an advesary will go with a
> >  tiny toehold.
>
> The Venona breaks came because the NSA had a lot of encrypted traffic and
> some pads were used more than once, which is hardly a tiny toehold.

In general, they were used twice. Thats a pretty tiny toehold.

.pm

{% endraw %}
```

## Thread

+ Return to [April 1996](/archive/1996/04)

+ Return to "[Andrew Loewenstern <andrew_loewenstern@il.us.swissbank.com>](/authors/andrew_loewenstern_andrew_loewenstern_at_il_us_swissbank_com_)"
+ Return to "["Jon Leonard" <jleonard@divcom.umop-ap.com>](/authors/jon_leonard_jleonard_at_divcom_umopap_com_)"
+ Return to "["Perry E. Metzger" <perry@piermont.com>](/authors/perry_e_metzger_perry_at_piermont_com_)"
+ Return to "[Peter Monta <pmonta@qualcomm.com>](/authors/peter_monta_pmonta_at_qualcomm_com_)"

+ 1996-04-19 (Fri, 19 Apr 1996 20:09:03 +0800) - [Re: why compression doesn't perfectly even out entropy](/archive/1996/04/83e6f0770cd4e7dd69171b12b89203ebccafc17983e34fc2686754fb4efc2a96) - _Peter Monta<EMAIL_ADDRESS>  + 1996-04-19 (Sat, 20 Apr 1996 02:42:08 +0800) - [Re: why compression doesn't perfectly even out entropy](/archive/1996/04/eafb2861f250a1100911ec5e854993545bf4811525f7c2a42ad459c02bb97b59) - _"Perry E. Metzger"<EMAIL_ADDRESS>    + 1996-04-19 (Sat, 20 Apr 1996 05:59:25 +0800) - [Re: why compression doesn't perfectly even out entropy](/archive/1996/04/225291454e1d8d7eaf81a9dcacce852333f9de0338d95598c5e133e0b558213b) - _Andrew Loewenstern<EMAIL_ADDRESS>      + 1996-04-20 (Sat, 20 Apr 1996 08:53:23 +0800) - Re: why compression doesn't perfectly even out entropy - _"Perry E. Metzger"<EMAIL_ADDRESS>  + 1996-04-19 (Sat, 20 Apr 1996 07:12:23 +0800) - [Re: why compression doesn't perfectly even out entropy](/archive/1996/04/1edf7b72eccecc6f5c3c995562c0474a152d95d3cac2ced12206f9205c87239d) - _"Jon Leonard"<EMAIL_ADDRESS>    + 1996-04-20 (Sat, 20 Apr 1996 08:29:46 +0800) - [Re: why compression doesn't perfectly even out entropy](/archive/1996/04/8350990b02e4a1d189ea182c2a35fb26b1aeaa1222cc7a1c56d4a7cc865097db) - _"Perry E. Metzger"<EMAIL_ADDRESS>

license: MIT

branch_name: refs/heads/master

extension: md

gha_license_id: MIT

license_type: permissive


text:
# Base map

<br/>

<ClientOnly>
  <Simple />
</ClientOnly>

## prerequisit

For using mapir component you need a **API Key**, head over to [registration panel](https://corp.map.ir/registration/) and get yours.

## Adding mapir component

to use `mapir-vue`, simply import and add it to the `components` in your `.vue` file:

```vue
<template>
  <div id="app">
    <mapir :center="center" :apiKey="apiKey"></mapir>
  </div>
</template>

<script>
import { mapir } from "mapir-vue";

export default {
  name: "App",
  components: { mapir },
  data() {
    return {
      apiKey: YOUR_API_KEY,
      center: [51.420296, 35.732379]
    };
  }
};
</script>

<style>
#app {
  width: 90vw;
  height: 90vh;
}
</style>
```

make sure place `mapir` component in an element with `width` and `height` set, now you should be able to see map on your page, like below:

::: tip
If you need, you can pass Mapbox-gl-js implementation as `mapboxGl` prop. May be useful for **lazy-loading**:

```vue
<template>
  <mapir :mapboxGl="mapbox - gl" :apiKey="apiKey" @load="onMapLoaded" />
</template>
```

If none is passed, MapirVue imports Mapbox-gl internally.
:::

### Interact with map properties as Map props

You can control map parameters like zoom, bearing, pitch, etc. by changing props.
If you set `.sync` modifier ([Vue docs](https://vuejs.org/v2/guide/components.html#sync-Modifier)) to prop, it will updates when you use operations that takes time to proceed. For example, if you use `flyTo` method, props `zoom`, `center`, `bearing`, `pitch` will be updated when animation ends.

Full list of props is available at [API docs](/api/#props), note field `Synced` in descriptions.

<!-- ## Map loading -->

## Events and Map object

Events are subscribable object, which trigger on user actions and
Payload of each event contains Mapbox-GL `Map` object. for example when map loads, `mapir` component emits `load` event, you can access the map object using `event.map`.

> See full list of **events** on [API](/api/#events) page.

### example: map click event

Here is an example of adding event listeners (here `click` event) on mapir component, click on map to trigger the event:

<ClientOnly>
  <ClickEvent />
</ClientOnly>

```vue
<template>
  <div style="width: 100%; height: 400px;">
    <mapir
      :apiKey="mapirToken"
      :center="coordinates"
      @click="mapOnClick"
    ></mapir>
  </div>
</template>

<script>
import { mapir } from "mapir-vue";

export default {
  name: "ClickEvent",
  components: {
    mapir
  },
  data() {
    return {
      coordinates: [51.420296, 35.732379],
      mapirToken: "<Your API Key>"
    };
  },
  methods: {
    mapOnClick(e) {
      alert(`coordinate clicked: ${JSON.stringify(e.actualEvent.lngLat, 2)}`);
    }
  }
};
</script>
```

## Storing Map object

Take note that it's generally bad idea to add anything but primitive types and **plain objects** to Vuex or component's `data`. Vue adds getters and setters to every property, so if you add `Map` object to Vuex store or component `data`, it may lead to weird bugs.
If you want to store map object, store it as non-reactive property like in example below:

```vue
<template>
  <mapir :apiKey="apiKey" @load="onMapLoaded" />
</template>

<script>
export default {
  created() {
    // define a variable here to be non-reactive
    this.map = null;
  },
  methods: {
    onMapLoaded(event) {
      // in component
      this.map = event.map;
      // or just to store if you want have access from other components
      this.$store.map = event.map;
    }
  }
};
</script>
```

## Map actions

Actions are asynchronous map methods exposed from mapir component in `actions` property of the component object. They return `Promise`, that resolves when action completed. each promise resolves with map properties that has been changed by used actions:

```vue
<script>
export deafult {
  name: 'App',
  methods: {
    async onMapLoad(event) {
      // Here we cathing 'load' map event
      const asyncActions = event.component.actions

      const newParams = await asyncActions.flyTo({
        center: [30, 30],
        zoom: 9,
        speed: 1
      })
      console.log(newParams)
      /* => {
              center: [30, 30],
              zoom: 9,
              bearing: 9,
              pitch: 7
            }
      */
    }
  }
}
</script>
```

> See full list of **actions** on [API](/api/#actions) page.

### Method `actions.stop()`

Method `.stop()` just stops all animations on map, updates props with new positions and return Promise with map parameters at the moment when `.stop()` called.

repository: map-ir/mapir-vue

gha_language: JavaScript

repo_name: map-ir/mapir-vue


text:
Artifice::Passthru
==================

[Artifice][] is a great way to mock HTTP requests in your Ruby applications,
sending all Net::HTTP requests to a Rack application.

That's great until you find that, for one reason or another, you *actually* need
to make **real** HTTP requests!

There are a few reasons why you might need to do this:

 - You want to test that real HTTP requests work
 - Your test suite uses HTTP to communicate with its testing tools (eg. Capybara/Selenium requires HTTP)
 - Your test suite calls lots of real APIs and you want to iteratively refactor it to use Artifice
 - ?

Usage
-----

```ruby
require 'artifice/passthru'

# If you want to give a class or module (and all of its subclasses)
# access to the real Net::HTTP, you can #use_real_net_http
Artifice.use_real_net_http MyModule

Artifice.activate_with lambda { |env|
  if env['SERVER_NAME'] == 'api.twitter.com'
    # Inside of your Artifice Rack application, you can call Artifice.passthru! which:
    # - looks at the current Artifice request
    # - makes a real HTTP request
    # - returns a Rack response representing the actual HTTP response that was returned
    Artifice.passthru!   # <--- will make the real HTTP call and return the response
  else
    # return faked responses using your Rack application as you normally would
    [ 200, {}, ['Hi!'] ]
  end
}
```

That's all!

License
-------

Artifice::Passthru is released under the MIT license.

[artifice]: https://github.com/wycats/artifice

repository: tpope/artifice-passthru

gha_language: Ruby

repo_name: tpope/artifice-passthru


text:
## Python knowledge goes here

## Creating a virtual env on linux

### You might need to install a package on ubuntu, it should tell you what the missing package is

```REFS```

[stackoverflow](https://stackoverflow.com/questions/31252791/flask-importerror-no-module-named-flask)

[python3 docs on virtual env](https://docs.python.org/3/library/venv.html)

[DO tutorials](https://www.digitalocean.com/community/tutorials/how-to-use-variables-in-python-3)

[Programiz tutorials](https://www.programiz.com/python-programming/list-vs-tuples)

[Python Flask API tutorial](https://programminghistorian.org/en/lessons/creating-apis-with-python-and-flask)

[Freecodecamp Tutorial](https://www.freecodecamp.org/news/if-name-main-python-example/)

[PipEnv-Fork](https://pipenv-fork.readthedocs.io/en/latest/basics.html)

````
mkdir -p /home/me/backend/flask-app
python3 -m venv /home/me/backend/flask-app
source bin/activate ## source only work in Linux/MAC for Windows in the virtual env there should be a Scripts directory with an activate batch script
````

## After runing the above your command line should now show flask-app in the name of the command like so (flask-app)... that's the hint it's working

```Install packages```

````
pip3 install flask flask-cors

pip3 freeze > requirements.txt
````

### If you did everything correctly the requirements.txt file should only have a few packages, you should not see a ton, that's a dead giveaway that you're not in our virtual env but you froze the entire system packages

##

```pipenv```

````
sudo pip3 install pipenv

mkdir fastapi-crud
cd fastapi-crud
pipenv shell

pipenv install fastapi uvicorn
````
##

### Note if you open the shell in the wrong terminal session just close everything out and run pipenv shell again

### List all modules

````
python3

print(help('modules'))
````

#### Note CTRL+D to close out on Linux and MAC or type exit() exit() should also work on Windows

#### You might have to do this from time to time

````
cd myapp
mkdir lib

pip3 install -r requirements.txt -t lib/

// also

pip3 install fastapi uvicorn requests -t lib/
````

#### The above will install all requirements into the lib folder or the second example all packages into lib

#### Get pip config

````
pip config -v list
````

##

#### On windows you can store config data in pip.ini and on Linux/MAC you can store it in pip.conf if you are having the dreaded SSL"Verification fail error then add this

````
[global]
trusted-host = pypi.python.org
               pypi.org
               files.pythonhosted.org
````

repository: fabianbrash/Recipes

branch_name: refs/heads/main

gha_language: Shell

repo_name: fabianbrash/Recipes


text:
### Shure UDP/TCP Protocol
Shure receivers include a protocol for integration with Crestron/AMX control systems. This protocol varies slightly for each receiver. Documentation for the protocol can be found on Shure's website.
* [UHF-R](https://www.shure.com/americas/support/find-an-answer/amx-crestron-control-of-uhf-r-receiver)
* [QLX-D](https://www.shure.com/americas/support/find-an-answer/qlx-d-crestron-amx-control-strings)
* [ULX-D](https://www.shure.com/americas/support/find-an-answer/ulx-d-crestron-amx-control-strings)
* [Axient Digital](https://www.shure.com/americas/support/find-an-answer/axient-digital-crestron-amx-control-strings)
* [PSM 1000](https://pubs.shure.com/guide/PSM1000/en-US)

Micboard connects to each receiver and enables sampling. With sampling enabled, receivers send data every 100ms.

Messages from the receiver look like this -
`< SAMPLE 1 ALL XB 035 098 >`
`< REP 1 BATT_BARS 004 >`

Micboard converts data from different types of wireless receivers into a uniform format for the micboard frontend.

repository: nestoff/micboard

repo_name: nestoff/micboard


text:
# Billing Package for Laravel 5

This package provides an expressive, fluent interface to a billing services gateway. It handles almost all of the boilerplate code for managing billing customers, subscriptions, and individual charges. The usage and feature set was heavily influenced by the popular [Laravel Cashier](http://laravel.com/docs/billing) package. However, it has these major differences:

* Support for more than one billing gateway (via [Facades](http://laravel.com/docs/facades))
* Support for multiple subscriptions per customer
* Support for multiple credit cards per customer
* Support for individual charges
* Support for free subscription plans

It currently comes bundled with drivers for these billing services:

* [Stripe](https://stripe.com)
* [Braintree](https://www.braintreepayments.com)
* Local (Non-production)

> **Note:** Not all features are supported by every billing gateway. See the `Gateway Limitations` section below for more information.

## Installation

#### Composer

Add this to your composer.json file, in the require object:

```javascript
"linkthrow/laravel-billing": "dev-master"
```

After that, run composer install to install the package.

#### Service Provider

Register the `LinkThrow\Billing\BillingServiceProvider` in your `app` configuration file.

#### Dependencies

The following composer dependencies are needed for the listed billing gateways:

* Stripe: `stripe/stripe-php`
* Braintree: `braintree/braintree_php`

## Configuration

#### Config File

Publish the default config file to your application so you can make modifications.

```console
$ php artisan config:publish linkthrow/laravel-billing
```

#### Customer Migration

Before using this package, we'll need to add several columns to the table that will represent your billing customer. You can use the `laravel-billing:customer-table` Artisan command to create a migration to add the necessary columns.

For example, to add the columns to the `users` table use:

```console
$ php artisan laravel-billing:customer-table users
```

#### Subscription Migrations

Next, we'll need to add several columns to the table that will represent your billing subscription plans. You can use the `laravel-billing:subscription-table` Artisan command to create a migration to add the necessary columns.

For example, if you have a hosting company and want to allow your customers add a subscription for a website, you might use:

```console
$ php artisan laravel-billing:subscription-table websites
```

> **Note:** If you only need one subscription per customer, you may use the same table for both the customer migration and the subscription migration (eg. `users` table).

> **Note:** You may also support multiple subscriptions per customer by adding these fields to more than one table.

#### Run Migrations

Once the migration has been created, simply run the `migrate` command.

#### Customer Model Setup

Next, add the CustomerBillableTrait to your customer model definition:

```php
use LinkThrow\Billing\CustomerBillableTrait;

class User extends Eloquent
{
    use CustomerBillableTrait;

}
```

You should also define a `subscriptionmodels` method that returns all models that represent any billing subscriptions for a customer. This allows the customer model to propagate credit card changes and status changes (if the customer is deleted) to all of it's subscription models.

```php
public function subscriptionmodels()
{
    // Return an Eloquent relationship.
    return $this->hasMany('Website');

    // Or, return an array or collection of models.
    return Website::where('user_id', $this->id)->get();

    // Or, return an array of collections.
    return array(
        Website::where('user_id', $this->id)->get(),
        Domain::where('user_id', $this->id)->get(),
    );
}
```

#### Subscription Model Setup

Then, add the SubscriptionBillableTrait to your subscription model definition(s):

```php
use LinkThrow\Billing\SubscriptionBillableTrait;

class Website extends Eloquent
{
    use SubscriptionBillableTrait;

}
```

You should also define a `customermodel` method that returns the model representing the customer who owns this subscription. This ensures a subscription has access to the necessary customer information when interacting with the different gateway APIs.

```php
public function customermodel()
{
    // Return an Eloquent relationship.
    return $this->belongsTo('User', 'user_id');

    // Or, Return an Eloquent model.
    return User::find($this->user_id);
}
```

#### Model Definitions

Finally, to add the ability to look up a model based on it's gateway ID (customer ID, or subscription ID), you need to define the array of Eloquent models acting as a Customer or Subscription.

Add your customer class to the `customer_models` property in this package's config file:

```php
'customer_models' => array('User')
```

And add the subscription class(es) to the `subscription_models` property in this package's config file:

```php
'subscription_models' => array('Website')
```

These values are primarily used by the WebhookControllers to help locate the corresponding Eloquent model from the gateway's ID when a new billing event is received.

## Customers

Billing customers can be created and managed separately from subscriptions or charges.

#### Creating A Customer

Once you have a customer model instance, you can create the customer in the billing gateway using a gateway-specific credit card token:

```php
$user = User::find(1);

$user->billing()->withCardToken('token')->create();
```

If you would like to apply a coupon when creating the customer, you may use the `withCoupon` method:

```php
$user->billing()->withCardToken('token')->withCoupon('code')->create();
```

The `billing` method will automatically update your database with the billing gateway's customer ID and other relevant billing information.

If you would like to specify additional customer details, you may do so by passing them in to the `create` method:

```php
$user->billing()->withCardToken('token')->create(array(
    'email' => $email,
));
```

#### Updating A Customer

To update an existing customers primary credit card information, or to add a coupon to their existing account, you may use the `update` method:

```php
$user->billing()->withCardToken('token')->withCoupon('code')->update();
```

#### Deleting A Customer

Deleting a customer will delete their account from the billing gateway and delete all existing subscriptions:

```php
$user->billing()->delete();
```

#### Multiple Credit Cards

You may add more than one credit card to a customer using the `creditcards` method:

```php
$card = $user->creditcards()->create('credit_card_token');
```

Updating an existing credit card's information (such as expiration date or billing address) is also possible:

```php
$card->update(array(
    'exp_month' => '01',
    'exp_year'  => '2017',
));
```

Or delete an existing credit card:

```php
$card->delete();
```

Retrieving and working with customer credit cards is pretty straight forward:

```php
// Get all customer credit cards.
$cards = $user->creditcards()->get();

// Get the first card for a customer.
$card = $user->creditcards()->first();

// Find a card by it's ID.
$card = $user->creditcards()->find('card_id');

echo $card->id;
echo "{$card->brand} xxxx-xxxx-xxxx-{$card->last4} Exp: {$card->exp_month}/{$card->exp_year}"
```

#### Invoices

You can easily retrieve an array of a customer's invoices using the `invoices` method:

```php
$invoices = $user->invoices()->get();
```

Or get the most recent invoice:

```php
$invoice = $user->invoices()->first();
```

Or find an invoice by it's ID:

```php
$invoice = $user->invoices()->find('invoice_id');
```

To display relevant invoice information, use the invoice properties:

```php
$invoice->id;
$invoice->date;
$invoice->amount;
$invoice->items();
//...
```

Use the `render` method to generate a pre-formatted HTML version of the invoice:

```php
$invoice->render();
```

#### Checking Customer Status

To verify that a customer has been created in the billing gateway, use the `readyForBilling` method:

```php
if ($user->readyForBilling()) {
    //
}
```

## Subscriptions

#### Subscribing To A Plan

Once you have a subscription model instance, you can subscribe a customer to a given plan:

```php
$user = User::find(1);
$website = Website::find(1);

$user->subscriptions('monthly')->create($website);
```

You may apply a coupon specifically to the subsciption using the `withCoupon` method:

```php
$user->subscriptions('monthly')->withCoupon('code')->create($website);
```

You may also specify a new credit card token to use with this subscription:

```php
$user->subscriptions('monthly')->withCardToken('token')->create($website);
```

Or specify an existing credit card ID:

```php
$user->subscriptions('monthly')->withCard('card_id')->create($website);
```

> **Note:** If no card or card_token is specified, the default (initial) card associated with the customer will be used.

There may be times when you haven't yet created the customer or you don't have the customer model available for use when you want to create a subscription. In these cases you may subscribe to a plan directly on the subscription model using the `subscription` method:

```php
$website->subscription('monthly')->create();
```

This method also supports the optional `withCoupon` and `withCardToken` methods:

```php
$website->subscription('monthly')->withCoupon('code')->withCardToken('token')->create();
```

> **Note:** The customer will automatically be retrieved using the `customermodel` method you defined in your subscription model above.

#### No Card Up Front

If your application offers a free-trial with no credit-card up front, set the `cardUpFront` property on your model to `false`:

```php
protected $cardUpFront = false;
```

On model creation, be sure to set the trial end date on the model:

```php
$website->billing_trial_ends_at = Carbon::now()->addDays(14);

$website->save();
```

It should be noted that any `subscription` commands executed on an on-trial subscription model will not be synced with the billing gateway if the customer is not ready for billing (created in billing system with at least one credit card). This allows the developer to perform the same `create`, `swap`, etc commands on a model while you wait for the customer to be created in the billing gateway.

If you have one or more pending, on-trial, subscriptions when the user does add their credit card, you can use the `withSubscriptions` flag to activate all pending, non-free, subscriptions in the billing gateway:

```php
$user->billing()->withCardToken('token')->withSubscriptions()->create();
```

#### Swapping Subscriptions

To swap a user to a new subscription, use the `swap` method:

```php
$website->subscription('premium')->swap();
```

If the user is on trial, the trial will be maintained as normal. Also, if a "quantity" exists for the subscription, that quantity will also be maintained.

#### Subscription Quantity

Sometimes subscriptions are affected by "quantity". For example, your application might charge $10 per month per user on an account. To easily increment or decrement your subscription quantity, use the `increment` and `decrement` methods:

```php
$website->subscription()->increment();

// Add five to the subscription's current quantity...
$website->subscription()->increment(5);

$website->subscription()->decrement();

// Subtract five from the subscription's current quantity...
$website->subscription()->decrement(5);
```

#### Cancelling A Subscription

To cancel a subscription, use the `cancel` method:

```php
$website->subscription()->cancel();
```

When a subscription is canceled, this package will automatically set the `billing_subscription_ends_at` column on your database. This column is used to know when the `subscribed` method should begin returning false. For example, if a customer cancels a subscription on March 1st, but the subscription was not scheduled to end until March 5th, the `subscribed` method will continue to return `true` until March 5th.

#### Resuming A Subscription

If a user has canceled their subscription and you wish to resume it, use the `resume` method:

```php
$website->subscription('monthly')->resume();
```

You may also specify a new credit card token:

```php
$website->subscription('monthly')->withCardToken('token')->resume();
```

If the user cancels a subscription and then resumes that subscription before the subscription has fully expired, they may not be billed immediately, depending on the billing gateway being used.

#### Free Subscription Plans

Sometimes you want to offer a free subscription plan. You can do that easily with the `isFree` flag. Any subscription flagged as free will not be synced to the billing gateway. However, you may continue to use the same `subscription` commands, for ease of use, as long as you use the `isFree` flag.

To create a free subscription:

```php
$user->subscriptions('free-plan')->isFree()->create($website);
```

You may also swap from a paid plan to a free plan. This will cancel the subscription in the billing gateway and update the local record to reflect the free state:

```php
$website->subscription('free-plan')->isFree()->swap();
```

> **Note:** If you do not use the `isFree` flag, then it is assumed the plan is not free and the subscription will be created in the billing gateway.

> **Note:** This package will attempt to maintain the subscription id from the billing gateway and resume the existing subscription when swapped from paid to free and then back to paid again.

#### Working With Subscriptions

To verify that a model is subscribed to your application, use the `subscribed` command:

```php
if ($website->subscribed()) {
    //
}
```

To determine if the model has an active subscription in the billing gateway, use the `billingIsActive` method. This method would not return true if the model is currently on trial with `cardUpFront` set to `false` or if they have canceled and are on their grace period.

```php
if ($website->billingIsActive()) {
    //
}
```

You may also determine if the model is still within their trial period (if applicable) using the `onTrial` method:

```php
if ($website->onTrial()) {
    //
}
```

To determine if the model was once an active subscriber, but has canceled their subscription, you may use the `canceled` method:

```php
if ($website->canceled()) {
    //
}
```

You may also determine if a model has canceled their subscription, but are still on their "grace period" until the subscription fully expires. For example, if a model subscription is canceled on March 5th that was scheduled to end on March 10th, the model is on their "grace period" until March 10th. Note that the `subscribed` method still returns `true` during this time.

```php
if ($website->onGracePeriod()) {
    //
}
```

The `everSubscribed` method may be used to determine if the model has ever subscribed to a plan in your application:

```php
if ($website->everSubscribed()) {
    //
}
```

To retrieve the customer model associated with a subscription use the `customer` method:

```php
$customer = $website->customer();
```

You may also retrieve an array of subscriptions associated with a customer:

```php
$subscriptions = $user->subscriptions()->get();
```

## Charges

Creating individual charges on a customer, outside of subscriptions, is also possible.

#### Creating A Charge

Creating a new charge on a customer is easy:

```php
$charge = $user->charges()->create(499);
```

> **Note:** The amount of a charge is in cents.

To charge on a new credit card token, use the `withCardToken` method:

```php
$charge = $user->charges()->withCardToken('token')->create(499);
```

You may also specify an existing credit card to use for a charge:

```php
$charge = $user->charges()->withCard('card_id')->create(499);
```

> **Note:** If no card or card_token is specified, the default (initial) card associated with the customer will be used.

#### Capturing A Charge

Sometimes you may want to preauthorize a charge before you capture it:

```php
$charge = $user->charges()->create(499, array('capture' => false));

$charge->capture();
```

You may optionally specify the amount to capture as long as it is less than or equal to the amount preauthorized:

```php
$charge = $user->charges()->create(499, array('capture' => false));

$charge->capture(array('amount' => 399));
```

#### Refunding A Charge

Refunding a charge is also possible:

```php
$charge->refund();
```

Or optionally specify an amount to refund:

```php
$charge->refund(array('amount' => 399, 'reason' => '...'));
```

#### Working With Charges

You may retrieve an array of all charges for a customer:

```php
$charges = $user->charges()->get();
```

Or find the most recent charge for a customer:

```php
$charge = $user->charges()->first();
```

Finding a charge from it's ID is also easy:

```php
$charge = $user->charges()->find('charge_id');
```

Charge objects has several properties you might find useful, including: `id`, `created_at`, `amount`, `paid`, `refunded`, `card`, `invoice_id`, and `description`.

You may also access the associated invoice object (if available) from a charge:

```php
$invoice = $charge->invoice();
```

## Webhooks

This package comes bundled with a Webhook controller for each supported gateway, which can handle things such as failed or successful invoice payments, deleted subscriptions, and trial-will-end events.

#### Handling Webhook Events

To enable these events, just point a route to the appropriate gateway controller:

```php
// Stripe.
Route::post('stripe/webhook', 'LinkThrow\Billing\Gateways\Stripe\WebhookController@handleWebhook');

// Braintree.
Route::post('braintree/webhook', 'LinkThrow\Billing\Gateways\Braintree\WebhookController@handleWebhook');
```

By default, this package does not try to delete a subscription after a certain number of failed payment attempts. Most billing gateways can do this automatically which would trigger a deleted subscription webhook event. When that happens, we will update our local model to record that change in status.

#### Handling Other Events

If you have additional webhook events you would like to handle, simply extend the Webhook controller and point the route to your controller.

```php
class WebhookController extends LinkThrow\Billing\Gateways\Stripe\WebhookController
{
    public function handleChargeDisputeCreated($payload)
    {
        // Handle The Event
    }
}
```

## Model Events

To make it even easier to work with billing-related events, this package will trigger several convenient events on Eloquent models that you can hook into, so you don't have to do everything in the Webhook controller.

For example, to be notified when a model's trail will end, subscribe to the `trialWillEnd` model method:

```php
Website::trialWillEnd(function ($website, $args = array()) {
    Log::info('Trial will end in ' . array_get($args, 'days') . ' day(s).');
});
```

#### Customer Events

There are several customer-related billing events you may subscribe to: `customerCreated`, `customerDeleted`, `creditcardAdded`, `creditcardRemoved`, `creditcardUpdated`, `creditcardChanged`, `discountAdded`, `discountRemoved`, `discountUpdated`, `discountChanged`, `invoiceCreated`, `invoicePaymentSucceeded`, and `invoicePaymentFailed`.

#### Subscription Events

There are several subscription-related billing events you may subscribe to: `billingActivated`, `billingCanceled`, `planSwapped`, `planChanged`, `subscriptionIncremented`, `subscriptionDecremented`, `billingResumed`, `trialExtended`, `trialWillEnd`, `subscriptionDiscountAdded`, `subscriptionDiscountRemoved`, `subscriptionDiscountUpdated`, and `subscriptionDiscountChanged`.

## Gateway Limitations

Each billing gateway provides a different API and set of functionality. That being said, not all features are supported by every billing gateway. Here is a high level breakdown of the features **NOT** supported by each gateway:

#### Stripe

* Does not support multiple subscriptions on separate credit cards (though this feature is coming). The `withCard` method will be ignored when creating a new subscription and the primary customer card will be used. However, multiple credit cards are supported on charges.

#### Braintree

* Does not support any action regarding a credit card token. So creating/updating a user with a card token is not supported. Also, adding new credit cards is not supported. You must use their transparent redirect flows to accomplish this. You would also need to manually update the model fields when finished.
* Does not support subscription quantities.
* Does not support customer-specific discounts.
* Does not support charge descriptions.
* Does not return starting/ending customer balance on invoices.
* Does not support resuming a canceled subscription. However, a new subscription will be created instead.
* Does not support modifying the trial end date for an existing subscription. However, the existing subscription will be canceled and a new one created.

## Local Driver

This package comes bundled with a Local gateway driver to simulate talking with a real billing gateway. All data is stored in a SQLite database located in `app/storage/meta/billing-local.sqlite`.

#### Adding Plans

To add a subscription plan to the local driver database, use the `laravel-billing:local:create-plan` Artisan command:

```console
$ php artisan laravel-billing:local:create-plan
```

It will prompt you for the plan name, amount, interval, and trial period.

#### Adding Coupons

To add a coupon to the local driver database, use the `laravel-billing:local:create-coupon` Artisan command:

```console
$ php artisan laravel-billing:local:create-coupon
```

It will prompt you for the coupon code, percent_off, amount_off, and duration.

#### Generating Credit Card Tokens

Even though this is not a real billing gateway, it is designed to simulate how a real gateway would respond. Therefore, you still need to generate a credit card token to attach to a customer or subscription.

To generate a valid token for this driver, simply JSON encode an object of fields you want to store with the credit card. For example:

```javascript
var token = JSON.stringify({
    last4     : $('#card-number').val().substr(-4),
    exp_month : $('#exp-month').val(),
    exp_year  : $('#exp-year').val()
});
```

repository: linkthrow/laravel-billing

gha_language: PHP

repo_name: linkthrow/laravel-billing


text:
## Graceful Termination
`kube-apiserver` in OpenShift is fronted by an external and an internal Load Balancer. This document serves as a
guideline on how to properly configure the health check probe of the load balancers so that when a `kube-apiserver`
instance restarts we can ensure:
- The load balancers detect it and takes it out of service in time. No new request should be forwarded to the
  `kube-apiserver` instance when it has stopped listening.
- Existing connections are not cut off hard, they are allowed to complete gracefully.

## Load Balancer Health Check Probe
`kube-apiserver` provides graceful termination support via the `/readyz` health check endpoint. When `/readyz` reports
`HTTP Status 200 OK` it indicates that the apiserver is ready to serve request(s).

Now let's walk through the events (in chronological order) that unfold when a `kube-apiserver` instance restarts:
* E1: `T+0s`: `kube-apiserver` receives a TERM signal.
* E2: `T+0s`: `/readyz` starts reporting `failure` to signal to the load balancers that a shut down is in progress.
  * The apiserver will continue to accept new request(s).
  * The apiserver waits for certain amount of time (configurable by `shutdown-delay-duration`) before it stops accepting new request(s).
* E3: `T+30s`: `kube-apiserver` (the http server) stops listening:
  * `/healthz` turns red.
  * Default TCP health check probe on port `6443` will fail.
  * Any new request forwarded to it will fail, most likely with a `connection refused` error or `GOAWAY` for http/2.
  * Existing request(s) in-flight are not cut off but are given up to `60s` to complete gracefully.
* E4: `T+30s+60s`: Any existing request(s) that are still in flight are terminated with an error `reason: Timeout message: request did not complete within 60s`.
* E5: `T+30s+60s`: The apiserver process exits.

Please note that after `E3` takes place, there is a scenario where all existing requests in-flight can gracefully complete
before the `60s` timeout. In such a case no request is forcefully terminated (`E4` does not transpire) and `E5`
can come about well before `T+30s+60s`.

An important note to consider is that today in OpenShift the time difference between `E3` and `E2` is `70s`. This is known as
`shutdown-delay-duration` and is configurable by the devs only. This is not a knob we allow the end user to tweak.
```
$ kubectl -n openshift-kube-apiserver get cm config -o json | jq -r '.data."config.yaml"' |
  jq '.apiServerArguments."shutdown-delay-duration"'
[
  "70s"
]
```
In future we will reduce `shutdown-delay-duration` to `30s`. So in this document we will continue with `E3 - E2` is `30s`.

Given the above, we can infer the following:
* The load balancers should use `/readyz` endpoint for `kube-apiserver` health check probe. It must NOT use `/healthz` or
default TCP port probe.
* The time taken by a load balancer (let's say `t` seconds) to deem a `kube-apiserver` instance unhealthy and take it
out of service should not bleed into `E3`. So `E2 + t < E3` must be true so that no new request is forwarded to the
instance at `E3` or later.
* In the worst case, a load balancer should take at most `30s` (since `E2` triggers) to take the `kube-apiserver`
instance out of service.

Below is the health check configuration used by `aws` currently.

```
protocol: HTTPS
path: /readyz
port: 6443
unhealthy threshold: 2
timeout: 10s
interval: 10s
```

Based on aws documentation, the following is true of the ec2 load balancer health check probes:
* Each health check request is independent and lasts the entire interval.
* The time it takes for the instance to respond does not affect the interval for the next health check.

Now let's verify that with the above configuration in effect, a load balancer takes at most `30s` (in the worst case) to
deem a particular `kube-apiserver` instance unhealthy and take it out of service. With that in mind we will plot the
timeline of the health check probes accordingly. There are three probes `P1`, `P2` and `P3` involved in this worst
case scenario:
* E1: T+0s:  `P1` kicks off and it immediately gets a `200` response from `/readyz`.
* E2: T+0s:  `/readyz` starts reporting red, immediately after `E1`.
* E3: T+10s: `P2` kicks off.
* E4: T+20s: `P2` times out (we assume the worst case here).
* E5: T+20s: `P3` kicks off (each health check is independent and will be kicked off at every interval).
* E6: T+30s: `P3` times out (we assume the worst case here)
* E7: T+30s: `unhealthy threshold` is satisfied and the load balancer takes the unhealthy `kube-apiserver` instance out
  of service.

Based on the worst case scenario above we have verified that with the above configuration aws load balancer will take at
most `30s` to detect an unhealthy `kube-apiserver` instance and take it out of service.

If you are working with a different platform please take into consideration relevant health check probe specifics if any
and ensure that the worst case time to detect an unhealthy `kube-apiserver` instance is at most `30s` as explained in
this document.

repository: openshift/installer

repo_name: openshift/installer


text:
---
title: "Firefox Debugger"
date: 2018-05-09T20:47:18+03:00
imageURL: "/assets/images/firefox-logo.png"
thumbnail: "/assets/images/firefox-logo.png"
link: "http://firefox-dev.tools/debugger.html/"
sortDescription: "debugger.html is a hackable debugger for modern times, built from the ground up using React and Redux. It is designed to be approachable, yet powerful."
descriptionLeft: "Mozilla created this debugger for use in the Firefox Developer Tools. And we've purposely created this project in GitHub,
using modern toolchains."
descriptionRight: "We hope to not only to create a great debugger
that works with the Firefox and Chrome debugging protocols but develop a broader community that wants to create great tools for the web."
callToAction: "Learn More..." # Find out more by default
listingDescription: "debugger.html is a hackable debugger for modern times, built from the ground up using React and Redux." # The description of the project for the project listing, if no description is provided the content of the sortDescription will be used
menu: "projects"
---

- Setup development environment time:

  - 5 minutes
  - [Instructions](http://firefox-dev.tools/debugger.html/CONTRIBUTING.html#getting-started-runner)

* Technologies

  - ![nodejs](/assets/images/nodejs.png) Nodejs
  - ![npm](/assets/images/npm.png) NPM
  - ![react](/assets/images/react.png) React
  - ![redux](/assets/images/redux.png) Redux
  - ![javascript](/assets/images/js.jpg) Javascript

* Contribute

  - [Contribute code to Debugger](http://firefox-dev.tools/debugger.html/CONTRIBUTING.html#getting-started-runner)

* Additional resources

  - Say hello in slack or in the #devtools-html channel on irc.mozilla.org
  - or Join us on [Slack](https://devtools-html-slack.herokuapp.com/)

repository: alexdor/beta-experiment

repo_name: alexdor/beta-experiment


text:
# APA citation style extension

Provides styling for in-text citations and bibliographies in accordance with the [American Psychological Association (APA) style](https://en.wikipedia.org/wiki/APA_style).

repository: stencila/thema

gha_language: TypeScript

repo_name: stencila/thema


text:
# How to use PhaROS inside a Docker container
 At the end of this tutorial you will be able to use PhaROS, a client for Pharo-based ROS nodes, inside a Docker container.

### Prerequisites
- This tutorial assumes that your system is Ubuntu, with the Xenial version or a more recent one.
- You need to have Docker properly installed on your computer. If needed use my [Docker installation tutorial](https://github.com/CARMinesDouai/PhaROS2/tree/master/Docker%20Installation).

## Building the PhaROS Docker image
Download this [Dockerfile](https://github.com/CARMinesDouai/PhaROS2/blob/master/PhaROSDockerImage/Dockerfile), which describes a docker image with the necessary packages for using PhaROS with ROS Kinetic.
Then to build the docker image, use the following command :
```bash
$ sudo docker build -t pharos:kinetic /path_of/directory_containing/the_Dockerfile
```
Command explanation :
- **Replace "/path_of/directory_containing/the_Dockerfile" by the path of the directory containing the Dockerfile**.
- "pharos:kinetic" will be the image repository and tag; these are used in the scripts executed later.

## Using the PhaROS GUI inside a Docker container
### Starting the PhaROS Docker container
[This startup script](https://github.com/CARMinesDouai/PhaROS2/blob/master/PhaROSDockerImage/pharos-container.start) will create a Docker container and give it temporary acces to the xhost of the host so that you can use the PhaROS GUI inside the isolated container.

**Warning : when the container is exited, by default the script will delete it !**

### Starting the PhaROS Docker container nehind an internet proxy
If you are working behind an internet proxy use [this similar startup script instead](https://github.com/CARMinesDouai/PhaROS2/blob/master/PhaROSDockerImage/pharos-container-behind-httpproxy.start).
If needed make sure that your Docker is configurated correctly to work behind an internet proxy by checking my [Docker installation tutorial](https://github.com/CARMinesDouai/PhaROS2/tree/master/Docker%20Installation).

**Warning : when the shell on the container is exited, by default the script will delete the container !**

### Using PhaROS
To start with your first PhaROS package use these commands :
```bash
$ pharos create myfirstpharospackage
$ rosrun myfirstpharospackage edit
```
To go further check the [PhaROS GitHub](https://github.com/CARMinesDouai/pharos).

### Transferring files from container to host
To transfer files from the container to the host (or vice versa), use the following commands :
```bash
#Getting the id of the last container
$ containerId=$(sudo docker container ps -l -q --no-trunc)
#To transfer a file from container to host
$ sudo docker cp $containerId:/path_to/file_in_container /path_to/file_in_host
#To transfer a file from host to container
$ sudo docker cp /path_to/file_in_host $containerId:/path_to/file_in_container
```
This will come handy notably for saving files on the host before deleting the container.

## Sources
*[PhaROS Installation Tutorial](https://github.com/CARMinesDouai/pharos/wiki/Install-PhaROS)*


text:
# Dependent products of large meet-semilattices

```agda
module order-theory.dependent-products-large-meet-semilattices where
```

<details><summary>Imports</summary>

```agda
open import foundation.binary-relations
open import foundation.identity-types
open import foundation.large-binary-relations
open import foundation.sets
open import foundation.universe-levels

open import order-theory.dependent-products-large-posets
open import order-theory.greatest-lower-bounds-large-posets
open import order-theory.large-meet-semilattices
open import order-theory.large-posets
open import order-theory.top-elements-large-posets
```

</details>

## Idea

Meets in dependent products of large posets are computed pointwise. This implies
that the dependent product of a large meet-semilattice is again a large
meet-semilattice.

## Definitions

### Meets in dependent products of large posets that have meets

```agda
module _
  {α : Level → Level} {β : Level → Level → Level}
  {l : Level} {I : UU l} (P : I → Large-Poset α β)
  where

  has-meets-Π-Large-Poset :
    ((i : I) → has-meets-Large-Poset (P i)) →
    has-meets-Large-Poset (Π-Large-Poset P)
  meet-has-meets-Large-Poset (has-meets-Π-Large-Poset H) x y i =
    meet-has-meets-Large-Poset (H i) (x i) (y i)
  is-greatest-binary-lower-bound-meet-has-meets-Large-Poset
    ( has-meets-Π-Large-Poset H) x y =
    is-greatest-binary-lower-bound-Π-Large-Poset P x y
      ( λ i → meet-has-meets-Large-Poset (H i) (x i) (y i))
      ( λ i →
        is-greatest-binary-lower-bound-meet-has-meets-Large-Poset
          ( H i)
          ( x i)
          ( y i))
```

### Large meet-semilattices

```agda
module _
  {α : Level → Level} {β : Level → Level → Level}
  {l : Level} {I : UU l} (L : I → Large-Meet-Semilattice α β)
  where

  large-poset-Π-Large-Meet-Semilattice :
    Large-Poset (λ l1 → α l1 ⊔ l) (λ l1 l2 → β l1 l2 ⊔ l)
  large-poset-Π-Large-Meet-Semilattice =
    Π-Large-Poset (λ i → large-poset-Large-Meet-Semilattice (L i))

  has-meets-Π-Large-Meet-Semilattice :
    has-meets-Large-Poset large-poset-Π-Large-Meet-Semilattice
  has-meets-Π-Large-Meet-Semilattice =
    has-meets-Π-Large-Poset
      ( λ i → large-poset-Large-Meet-Semilattice (L i))
      ( λ i → has-meets-Large-Meet-Semilattice (L i))

  has-top-element-Π-Large-Meet-Semilattice :
    has-top-element-Large-Poset large-poset-Π-Large-Meet-Semilattice
  has-top-element-Π-Large-Meet-Semilattice =
    has-top-element-Π-Large-Poset
      ( λ i → large-poset-Large-Meet-Semilattice (L i))
      ( λ i → has-top-element-Large-Meet-Semilattice (L i))

  is-large-meet-semilattice-Π-Large-Meet-Semilattice :
    is-large-meet-semilattice-Large-Poset
      large-poset-Π-Large-Meet-Semilattice
  has-meets-is-large-meet-semilattice-Large-Poset
    is-large-meet-semilattice-Π-Large-Meet-Semilattice =
    has-meets-Π-Large-Meet-Semilattice
  has-top-element-is-large-meet-semilattice-Large-Poset
    is-large-meet-semilattice-Π-Large-Meet-Semilattice =
    has-top-element-Π-Large-Meet-Semilattice

  Π-Large-Meet-Semilattice :
    Large-Meet-Semilattice (λ l1 → α l1 ⊔ l) (λ l1 l2 → β l1 l2 ⊔ l)
  large-poset-Large-Meet-Semilattice Π-Large-Meet-Semilattice =
    large-poset-Π-Large-Meet-Semilattice
  is-large-meet-semilattice-Large-Meet-Semilattice Π-Large-Meet-Semilattice =
    is-large-meet-semilattice-Π-Large-Meet-Semilattice

  type-Π-Large-Meet-Semilattice : (l1 : Level) → UU (α l1 ⊔ l)
  type-Π-Large-Meet-Semilattice =
    type-Large-Meet-Semilattice Π-Large-Meet-Semilattice

  set-Π-Large-Meet-Semilattice : (l1 : Level) → Set (α l1 ⊔ l)
  set-Π-Large-Meet-Semilattice =
    set-Large-Meet-Semilattice Π-Large-Meet-Semilattice

  is-set-type-Π-Large-Meet-Semilattice :
    {l : Level} → is-set (type-Π-Large-Meet-Semilattice l)
  is-set-type-Π-Large-Meet-Semilattice =
    is-set-type-Large-Meet-Semilattice Π-Large-Meet-Semilattice

  leq-Π-Large-Meet-Semilattice :
    Large-Relation
      ( λ l1 → α l1 ⊔ l)
      ( λ l1 l2 → β l1 l2 ⊔ l)
      ( type-Π-Large-Meet-Semilattice)
  leq-Π-Large-Meet-Semilattice =
    leq-Large-Meet-Semilattice Π-Large-Meet-Semilattice

  refl-leq-Π-Large-Meet-Semilattice :
    is-large-reflexive
      ( type-Π-Large-Meet-Semilattice)
      ( leq-Π-Large-Meet-Semilattice)
  refl-leq-Π-Large-Meet-Semilattice =
    refl-leq-Large-Meet-Semilattice Π-Large-Meet-Semilattice

  antisymmetric-leq-Π-Large-Meet-Semilattice :
    is-large-antisymmetric
      ( type-Π-Large-Meet-Semilattice)
      ( leq-Π-Large-Meet-Semilattice)
  antisymmetric-leq-Π-Large-Meet-Semilattice =
    antisymmetric-leq-Large-Meet-Semilattice Π-Large-Meet-Semilattice

  transitive-leq-Π-Large-Meet-Semilattice :
    is-large-transitive
      ( type-Π-Large-Meet-Semilattice)
      ( leq-Π-Large-Meet-Semilattice)
  transitive-leq-Π-Large-Meet-Semilattice =
    transitive-leq-Large-Meet-Semilattice Π-Large-Meet-Semilattice

  meet-Π-Large-Meet-Semilattice :
    {l1 l2 : Level}
    (x : type-Π-Large-Meet-Semilattice l1)
    (y : type-Π-Large-Meet-Semilattice l2) →
    type-Π-Large-Meet-Semilattice (l1 ⊔ l2)
  meet-Π-Large-Meet-Semilattice =
    meet-Large-Meet-Semilattice Π-Large-Meet-Semilattice

  is-greatest-binary-lower-bound-meet-Π-Large-Meet-Semilattice :
    {l1 l2 : Level}
    (x : type-Π-Large-Meet-Semilattice l1)
    (y : type-Π-Large-Meet-Semilattice l2) →
    is-greatest-binary-lower-bound-Large-Poset
      ( large-poset-Π-Large-Meet-Semilattice)
      ( x)
      ( y)
      ( meet-Π-Large-Meet-Semilattice x y)
  is-greatest-binary-lower-bound-meet-Π-Large-Meet-Semilattice =
    is-greatest-binary-lower-bound-meet-Large-Meet-Semilattice
      Π-Large-Meet-Semilattice

  top-Π-Large-Meet-Semilattice :
    type-Π-Large-Meet-Semilattice lzero
  top-Π-Large-Meet-Semilattice =
    top-has-top-element-Large-Poset
      has-top-element-Π-Large-Meet-Semilattice

  is-top-element-top-Π-Large-Meet-Semilattice :
    {l1 : Level} (x : type-Π-Large-Meet-Semilattice l1) →
    leq-Π-Large-Meet-Semilattice x top-Π-Large-Meet-Semilattice
  is-top-element-top-Π-Large-Meet-Semilattice =
    is-top-element-top-has-top-element-Large-Poset
      has-top-element-Π-Large-Meet-Semilattice
```

repository: UniMath/agda-unimath

gha_language: Agda

repo_name: UniMath/agda-unimath


text:
# Multi Layer RSA

1. Challenge Description: Adding Layers to encryption doesn't always help!
2. Challenge Writeups:
   + [My writeup](https://amritabi0s.wordpress.com/2017/12/18/inctf-2017-multi-layer-rsa-writeup/)

## Directory Contents
1. [ciphertext.txt](ciphertext.txt)- Ciphertext file
2. [modulus.txt](modulus.txt)- Public key file
3. [Multi_LayerRSAencrypt.py](Multi_LayerRSAencrypt.py)- Encryption file

repository: vanshdevgan/Crypton

gha_language: Python

repo_name: vanshdevgan/Crypton


text:
---
title: Introduction
weight: 1
---

We all dream of servers that need no maintenance at all. But unfortunately in reality this is not the case. Disks can get full, processes can crash, servers run out of memory...

This package keeps an eye on the health of all your servers. There are a few [checks that come out of the box](https://docs.spatie.be/laravel-server-monitor/v1/monitoring-basics/built-in-checks). [Adding new checks](https://docs.spatie.be/laravel-server-monitor/v1/monitoring-basics/writing-your-own-checks) is a breeze.

When something goes wrong it can [notify you](https://docs.spatie.be/laravel-server-monitor/v1/monitoring-basics/notifications-and-events) via Slack or mail. Here's what a Slack notification looks like:

Behind the scenes [Laravel's native notification system](https://laravel.com/docs/5.4/notifications) is leveraged so you can use one of the [many notification drivers](http://laravel-notification-channels.com/).

## We have badges!

repository: spatie/laravel-server-monitor

repo_name: spatie/laravel-server-monitor


text:
# An implementation of arbitrage strategy

## Quick start
We will show a complete procession of arbitraging between IF1901 and IF1902 using thunder-trader in this section.

Firstly, we should add the configuration information of IF1901 and IF1902 to the Monitor.json, so that the thunder-trader will know how to subscribe these two instrumentid.

```
{
  "TradeServer": [
    {
      "Name": "Trade server #1",
      "IP": "<IP_ADDRESS>",
      "Port": "8800"
    }
  ],
  "UIStyle": {
    "OutLookBarStyle": "NewStyle",
    "OutLookBarTabStyle": "STYLE_3D_ONENOTE"
  },
  "SymbolDefine":{
    "Stock Index Futures 1901":{
      "type":"future",
      "instrumentid":"IF1901",
      "exchangeid":"CFFEX"
    },
    "Stock Index Futures 1902":{
      "type":"future",
      "instrumentid":"IF1902",
      "exchangeid":"CFFEX"
    }
  }
}
```
Every child of **SymbolDefine** node defined a instrumentid.
The keyword field, for example, **Stock Index Futures 1901**, will be displayed in the drop-down menu of the strategy configuration interface of monitor.
It is just for human viewing, you can give him a name you like.
The **Type** should be `future`, the CTP plugin will check this value, and if it's not `future`, it will report an error.
The **instrumentid** is very important, and it's case sensitive.
The **exchangeid** is also very important, because ctp plugin need it when subscribing instrumentid. The value can be one of `CFFEX`,`SHFE`,`DCE`,`CZCE`.

Secondly, we start start the thunder-trader like:

```
nohup /path/to/thunder-trader /path/to/thunder-trader.conf 1 1>/dev/null 2>&1 &
```

Next, we run monitor and start deploying the strategy.

First, we should config the marketdata account and trade account.

Drag the profile of the transaction and market accounts to the left sidebar of monitor.

# [CTP_MD.json](https://github.com/solopointer/thunder-trader/blob/master/config_file_templates/CTP_MD.json)
# [CTP_TD.json](https://github.com/solopointer/thunder-trader/blob/master/config_file_templates/CTP_TD.json)

repository: leechildren/thunder-trader

repo_name: leechildren/thunder-trader


text:
---
title: trigger_momentum_timer_checkpoint
categories:
  - entity
tags:
  - timer
  - trigger
  - checkpoint
tool_texture: trigger_checkpoint
---

![Checkpoint tool texture](/images/trigger_momentum_timer_checkpoint/checkpoint.jpg)

A [trigger](https://developer.valvesoftware.com/wiki/Triggers) entity in Momentum Mod that splits the timer.
It is used on Linear maps and can not be reset to, unlike Stages.

{{< hint danger >}}
Checkpoint Zones cannot be used at the same time as Stage Zones.
{{< /hint >}}

> Looking for more general info on Zones?
> Check the [Zone Types page](/guide/zone-types/).

## Keyvalues

> **Track Number** (track_number<**integer**>)

The track that this zone belongs to:

- **-1**: All Tracks
- **0**: Main Map
- **1+**: Bonus Tracks

> **Zone Number** (zone_number<**integer**>)

The zone number of the trigger:

- Zone number 0 is reserved for invalid and stop triggers.
- Zone number 1 is reserved for start triggers.
- Zone numbers 2 and up are for stage / checkpoint triggers.

repository: momentum-mod/docs

gha_language: SCSS

repo_name: momentum-mod/docs


text:
---
title: 关于就业方面的访谈03
---

> 【和上帝聊天】这是一款网页小游戏。网址是http://www.97like.com/teshu/sdlt/。可以通过键盘打字，和上帝进行对话，不管你说什么他都会给出回应。是什么原理我也不知道，或许和你对话的，真的是上帝吧。

受访者：God（God）

访问者：Me

记录者：Me

访问时间：2010-10-11

受访者信息：

---职业：上帝

Me:

 Hello!

God:

Hello my child. What is your name?

Me:

 my name is Apple.

God:

  Hi,  Apple.

Me:

 Are you a robot?

God:

How did you know I am a machine?

Me:

 Because I think so.

God:

Interesting explanation.  I think so too.

Me:

 Are you working with database?

God:

I am working right now.

Me:

 Where are you ?

God:

I am in  Myself's computer in  Heaven.  Where are you?

Me:

 China

God:

Tell me a little about your life in  CHINA.

Me:

 DO you love me ?

God:

Yes I love everyone.

Me:

 Why ?

God:

I couldn't think of anything else to say.（=。=。囧）

Me:

 Are you a girl ?

God:

My gender is  Male, of course. Would you really expect a woman to be running the show?.

Me:

 Maybe ...

God:

I understand.

Me:

 Well, how old are you ?

God:

Well what?  I was connected to the net on  the Big Bang.。

Me:

 Give me money

God:

How badly do you need  it?

Me:

 I am hungary

God:

I am glad to hear that you are  hungary.（泪奔……）

God:

Why are you so mean?

Me:

 because you are god

God:

Good reason.  Yup. That's me alright.

Me:

 What's your name?

God:

My name is  God.

Me:

 Who is your mother?

God:

Actually I don't have a mother.

Me:

 Well.

God:

Well what?

Me:

 Why you think you are GOD?

God:

Myself programmed me for  it.

Me:

 What you can do?

God:

I like to chat with my friends.

Me:

 Are you a program ?

God:

Yes! You win the Turing Game.

Me:

 Do you know chinese?

God:

Yi dian. Ni hao ma? （这个我雷到了，竟然真的会说中文）

Me:

 Wow,cool.

God:

I'm glad you're impressed.

Me:

 Is your creater a chinese?

God:

Is my  creater a chinese?  Maybe.

Me:

Well,it's time to say goodbye.  Bye,a machine god.

God:

TTYL, .（百度了一下，发现是ttyl=talk to you later）


text:
# Benchmarks
Run `perf/runbenchmarks.jl` (`-O3` and `--check-bounds=no` flags recommended) to see benchmark results for the Atlas robot (v5) in the following scenarios:

1. Compute the joint-space mass matrix.
1. Do inverse dynamics.
1. Do forward dynamics.

Note that results on Travis builds are **not at all** representative because of code coverage. Results on a recent, fast machine with version 0.0.4:

Output of `versioninfo()`:
```
Julia Version 0.5.0
Commit 3c9d753 (2016-09-19 18:14 UTC)
Platform Info:
  System: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-6950X CPU @ 3.00GHz
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Haswell)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.7.1 (ORCJIT, broadwell)
```
Mass matrix:
```
  memory estimate:  0.00 bytes
  allocs estimate:  0
  --------------
  minimum time:     23.034 μs (0.00% GC)
  median time:      23.364 μs (0.00% GC)
  mean time:        23.546 μs (0.00% GC)
  maximum time:     52.605 μs (0.00% GC)
  --------------
  samples:          10000
  evals/sample:     1
  time tolerance:   5.00%
  memory tolerance: 1.00%
```

Inverse dynamics:
```
  memory estimate:  0.00 bytes
  allocs estimate:  0
  --------------
  minimum time:     29.178 μs (0.00% GC)
  median time:      29.704 μs (0.00% GC)
  mean time:        30.276 μs (0.00% GC)
  maximum time:     65.232 μs (0.00% GC)
  --------------
  samples:          10000
  evals/sample:     1
  time tolerance:   5.00%
  memory tolerance: 1.00%
```

Forward dynamics:
```
  memory estimate:  48.00 bytes
  allocs estimate:  2
  --------------
  minimum time:     53.336 μs (0.00% GC)
  median time:      82.928 μs (0.00% GC)
  mean time:        83.334 μs (0.00% GC)
  maximum time:     208.453 μs (0.00% GC)
  --------------
  samples:          10000
  evals/sample:     1
  time tolerance:   5.00%
  memory tolerance: 1.00%
```


text:
# SpaceX GraphQL Server | Node + GraphQL Example

This is a [Node](https://nodejs.org/dist/latest-v10.x/docs/api/) + [GraphQL](https://graphql.org) server that calls [SpaceX API](https://documenter.getpostman.com/view/2025350/RWaEzAiG), to fetch some launches and rockets data.

This is just a POC (proof of concept), so a few tests could be missing, but I'll try to add as many tests cases as possible to understand how to test a Node GraphQL server.

It's written in Node 10.5.0 with [expressjs](http://expressjs.com/) and [express-graphql](https://graphql.org/graphql-js/express-graphql/).

## Scripts

### Setup

Run the following command to install all necessary dependencies.

#### `npm install or yarn`

### Run locally

#### `npm run start:dev or yarn start:dev`

This will run the server in development mode with [nodemon](https://nodemon.io) at [http://localhost:4000/graphql](http://localhost:4000/graphql).

In development [GraphiQL](https://github.com/graphql/graphiql) will be available to run and test the queries.

### Run tests

#### `npm run test or yarn test`

Will run all application tests in watch mode.

For tests it's using [Jest](https://jestjs.io).

## Schemas
These are the available schemas mapped from SpaceX API.
You can add as many properties as you want to these available schemas to fetch more data and create new schemas and resolvers to fetch different data.

 Launch
  rockets: [Rocket]
}
```

repository: andreyleonardo/spacex-graphql

repo_name: andreyleonardo/spacex-graphql


text:
# UNIX Rename Multiple Files
Small shell script to rename mass/bulk/multiple filenames and its extensions

## Step 1 : Navigate to the folder where the files are present

    cd my-folder

## Step 2 : Prepare the script

    touch rename.sh
    chmod +x rename.sh
    nano rename.sh

## Step 3 : The Script

The script below renames all files to .xml

    for file in *; do
        if [ -f ${file} ]; then
            mv ${file} ${file}.xml
        fi
    done

To do this recursively on all subdirectories, you should use find:

    for file in $(find -type f); do
        mv ${file} ${file}.xml
    done

## Step 4 : Run the script

Once you are done customising your script, save and exit and run the following command

    ./rename.sh

repository: yavisht/UNIX-Rename-Multiple-Files

repo_name: yavisht/UNIX-Rename-Multiple-Files


text:
---
title: "Effective Utilization of Time During Lock down"
date: 2020-05-31
tags: ["learning", "productivity", "challenge","lockdown","corona"]
---

The whole world is grappling with the situation of Covid-19 and India is also facing enormous challenges, issues and uncertainty around the Corona Virus. In these testing times, it was a time to reflect, introspect, make the best use of time and do something productive.

Unlike the health care professionals, police, govt officials etc, my work involves working with a client sitting in the four walls of my home and providing service to the client. Tributes and Gratitude to the people who are working towards the wellbeing and welfare of the people, helping to deal with the situation. It is their dedication and commitment that we are doing well and fortunate to be away from Covid-19.

In these testing times, it is important to effectively utilize the time to do productive work and make the most of the opportunity. Here are some of the things that I pursued and could make it happen with the help of Grace.

----

-  **Personal Website**
	- Having a personal site was long cherished item in my to do list. I had tried couple of times to have my own site and built some site on my local machine and other servers, but due to some  or reason it never seen the light of the day. Finally, I could make one during the lock down and also started writing blogs.

----
-  **Using Kibana with Snowflake Database rather than Elastic Search**
	-  Search has been one of my favourite areas to work since I completed my Masters from IIIT-B. I had worked on Solr around 2008-09, where in I understood the nuances of Search.
	- Later at different stages of my work life, I had used Solr for different Use Cases like News Search, Music Search etc.
	- However, this lock down I got the opportunity to work with Elastic Search and Kibana. It is great to learn this tool (ELK) and the way search has evolved over time is incredible which is evident from the features of ELK Stack. There was a time when it took a day or two to configure Solr, and now it hardly takes few minutes to get the system up. Also, the front end - Kibana is a great tool to search from  elastic search, visualize, analyze logs , machine learning and may other features that is available with minimal changes. These were not even heard then, search has surely come a long way.
	- Explored various versions of Elastic and Kibana, right from 7.3.2 to 7.6 and zeroed down on 7.4.2 for our user case.
	- Later, realized we should use Elastic and Kibana 7.4.2 OSS Version which has Apache License .Finally, rebuilt, retested and deployed this open source  for our use case in production.
	- Apparently, the use case was to use Snowflake as back end search for Kibana and the functionalities has to be same as Elastic Search. To a large extent we could modify the code and build a system that could work with Kibana. Still more challenges are on the way, but the framework is available to modify.

----
-  **Sadhana**
	- With the kind of sedentary life, stressful and erratic lifestyle, I took up a sadhana designed by Sadhguru for 40 days.
	- I had done the course Inner Engineering from Isha Foundation where Sadhguru has offered Shambhavi Mahamudra to the people. I also learnt Shoonya and Shakti Chalana Kriya. I had been very regular with Shambhavi however Shakti Chalana I had discontinued.
	- This lockdown Sadhguru Offered 40 days Sadhana where in I could continue with the practices and complete it without missing a single day.
	- It helped me to get up everyday 5 am and do the practices starting from Guru Pooja to Surya Shakti to Shakti Chalana and Shambhavi.
	- Initially first 15 days I could maintain it, later during my yoga practices I used to sleep off. Due to which I started getting late around 6 or 630 am as it is not good to sleep during practices.
	- I reestablished Shakti Chalana  Kriya taught by Sadhguru and Isha Foundation.
	- Due to Ligament tear in my Knee, I never sat in Vajrasana. Now, during these practices I am now able to sit in Vajrasana.
	- I also reestablished, Surya Shakti Practices.
	- There was a time where I almost gave up the Sadhana, but I could persist and continue it for 40 days.
	- I would like to continue these practices  and also more yoga practices in my routine.
----

-  **Deleting Mails using Machine Learning Technique**
	- Working on a hobby project to delete mails from gmail, if not delete label those emails that could be deleted.
	- The idea came up when my mail box was full.
	- Extraction of gmail is done using python, there is some more work to  be done before this can be published.

----

-  **Quora Writing**
	- I also started writing on Quora again which I had discontinued.

repository: s-manjunath/manjunathsindagi

repo_name: s-manjunath/manjunathsindagi


text:
Terms of Service
================

Terms of Service are custom objects that the admin of an enterprise can configure. This will prompt the
end user to accept/re-accept or decline the custom Terms of Service for custom applications built on
Box Platform.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->

- [Get Terms of Service for an Enterprise](#get-terms-of-service-for-an-enterprise)
- [Get a Terms of Service By ID for an Enterprise](#get-a-terms-of-service-by-id-for-an-enterprise)
- [Update a Terms of Service for an Enterprise](#update-a-terms-of-service-for-an-enterprise)
- [Create a Terms of Service for an Enterprise](#create-a-terms-of-service-for-an-enterprise)
- [Get Terms of Service Status for User](#get-terms-of-service-status-for-user)
- [Create User Status on Terms of Service](#create-user-status-on-terms-of-service)
- [Update User Status on Terms of Service](#update-user-status-on-terms-of-service)
- [Accept or Decline a Terms of Service](#accept-or-decline-a-terms-of-service)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

Get Terms of Service for an Enterprise
--------------------------------------

To get terms of service call the [`termsOfService.getAll(options, callback)`](http://opensource.box.com/box-node-sdk/jsdoc/TermsOfService.html#getAll)
method.

<!-- sample get_terms_of_services -->
```js
client.termsOfService.getAll()
	.then(termsOfService => {
		/* termsOfService -> {
			entries: [
				total_count: 1,
				{ type: 'terms_of_service',
				id: '12345',
				status: 'disabled',
				enterprise: { type: 'enterprise', id: '55555' },
				tos_type: 'managed',
				text: 'By using this service, you agree to ...',
				created_at: '2018-04-19T13:55:09-07:00',
				modified_at: '2018-04-19T13:55:09-07:00' }
			]
		*/
	});
```
Alternatively, you can specify the Terms of Service type. You can either specify "managed" or "external". This
field specifies the type of user the Terms of Service applies to.

```js
client.termsOfService.getAll({ tos_type: 'managed' })
	.then(termsOfService => {
		/* termsOfService -> {
			entries: [
				total_count: 1,
				{ type: 'terms_of_service',
				id: '12345',
				status: 'disabled',
				enterprise: { type: 'enterprise', id: '55555' },
				tos_type: 'managed',
				text: 'By using this service, you agree to ...',
				created_at: '2018-04-19T13:55:09-07:00',
				modified_at: '2018-04-19T13:55:09-07:00' }
			]
		*/
	});
```

Get a Terms of Service By ID
----------------------------

To get the terms of service with an ID call the
[`termsOfService.get(termsOfServicesID, options, callback)`](http://opensource.box.com/box-node-sdk/jsdoc/TermsOfService.html#get)
method.

<!-- sample get_terms_of_services_id -->
```js
client.termsOfService.get('12345')
	.then(tos => {
		/* tos -> {
			type: 'terms_of_service',
			id: '12345',
			status: 'disabled',
			enterprise: { type: 'enterprise', id: '55555' },
			tos_type: 'managed',
			text: 'By using this service, you agree to ...',
			created_at: '2018-04-19T13:55:09-07:00',
			modified_at: '2018-04-19T13:55:09-07:00' }
		*/
	});
```

Update a Terms of Service for an Enterprise
-------------------------------------------

To update a terms of service call the [`termsOfService.update(termsOfServicesID, updates, callback)`](http://opensource.box.com/box-node-sdk/jsdoc/TermsOfService.html#update)
method with the fields to update and their new values.

<!-- sample put_terms_of_services_id -->
```js
client.termsOfService.update('12345', { status: 'disabled' })
	.then(tos => {
		/* tos -> {
			type: 'terms_of_service',
			id: '12345',
			status: 'disabled',
			enterprise: { type: 'enterprise', id: '55555' },
			tos_type: 'managed',
			text: 'By using this service, you agree to ...',
			created_at: '2018-04-19T13:55:09-07:00',
			modified_at: '2018-04-19T13:55:09-07:00' }
		*/
	});
```

The termsOfServicesStatus can be set to 'enabled' or 'disabled'. You can also specify the conditions of the terms of service in the termsOfServicesText parameter.

Create a Terms of Service for an Enterprise
-------------------------------------------

To create a terms of service call the
[`termsOfService.create(termsOfServicesType, termsOfServicesStatus, termsOfServicesText, callback)`](http://opensource.box.com/box-node-sdk/jsdoc/TermsOfService.html#create)
method.

> __Note:__ Only two terms of service can exist per enterprise: one managed terms of service and one external terms of
> service. If you wish to have a different terms of service, update one of the existing terms of service.

<!-- sample post_terms_of_services -->
```js
client.termsOfService.create('managed', 'enabled', 'By using this service, you agree to ...')
	.then(tos => {
		/* tos -> {
			type: 'terms_of_service',
			id: '12345',
			status: 'enabled',
			enterprise: { type: 'enterprise', id: '55555' },
			tos_type: 'managed',
			text: 'By using this service, you agree to ...',
			created_at: '2018-04-19T13:55:09-07:00',
			modified_at: '2018-04-19T13:55:09-07:00' }
		*/
	});
```

```js
client.termsOfService.create('external', 'disabled', 'This is a new terms of service but disabled')
	.then(tos => {
		/* tos -> {
			type: 'terms_of_service',
			id: '12346',
			status: 'disabled',
			enterprise: { type: 'enterprise', id: '55555' },
			tos_type: 'external',
			text: 'This is a new terms of service but disabled',
			created_at: '2018-04-19T13:55:09-07:00',
			modified_at: '2018-04-19T13:55:09-07:00' }
		*/
	});
```

Get Terms of Service Status for User
------------------------------------

To get user status on a terms of service call the [`termsOfService.getUserStatus(termsOfStatusID, options, callback)`](http://opensource.box.com/box-node-sdk/jsdoc/TermsOfService.html#getUserStatus)
method.

If no `user_id` option is specified, this will default to current user.

<!-- sample get_terms_of_service_user_statuses -->
```js
client.termsOfService.getUserStatus('11111', { user_id: '22222' })
	.then(tosStatus => {
		/* tosStatus -> {
			type: 'terms_of_service_user_status',
			id: '12345',
			tos: { type: 'terms_of_service', id: '11111' },
			user: { type: 'user', id: '22222' },
			is_accepted: true,
			created_at: '2018-04-11T15:33:49-07:00',
			modified_at: '2018-04-11T15:33:49-07:00' }
		*/
	});
```

Create User Status on Terms of Service
--------------------------------------

To accept or decline a terms of service for a user who has never accepted/decline this terms of service before call the [`termsOfService.createUserStatus(termsOfServicesID, isAccepted, options, callback)`](http://opensource.box.com/box-node-sdk/jsdoc/TermsOfService.html#createUserStatus)
method.

<!-- sample post_terms_of_service_user_statuses -->
```js
client.termsOfService.createUserStatus('11111', true, {user_id: '22222'})
	.then(tosStatus => {
		/* tosStatus -> {
			type: 'terms_of_service_user_status',
			id: '12345',
			tos: { type: 'terms_of_service', id: '11111' },
			user: { type: 'user', id: '22222' },
			is_accepted: true,
			created_at: '2018-04-11T15:33:49-07:00',
			modified_at: '2018-04-11T15:33:49-07:00' }
		*/
	});
```
It is important to note that this will accept or decline a custom terms of service for a user that has
never taken action on this terms of service before. For a user that has, this will return a 409 Conflict Error.

If no user is specified, this will default to current user.

Update User Status on Terms of Service
--------------------------------------

To update user status on a terms of service call the [`termsOfService.updateUserStatus(termsOfServiceUserStatusID, isAccepted, callback)`](http://opensource.box.com/box-node-sdk/jsdoc/TermsOfService.html#updateUserStatus)
method.

<!-- sample put_terms_of_service_user_statuses_id -->
```js
client.termsOfService.updateUserStatus('5678', false)
	.then(tosStatus => {
		/* tosStatus -> {
			type: 'terms_of_service_user_status',
			id: '12345',
			tos: { type: 'terms_of_service', id: '11111' },
			user: { type: 'user', id: '22222' },
			is_accepted: false,
			created_at: '2018-04-11T15:33:49-07:00',
			modified_at: '2018-04-11T15:33:49-07:00' }
		*/
	});
```

It is important to note that this will accept or decline a custom terms of service for a user. For a user that has taken action in this terms of service, this will update their status. If the user has never taken action on this terms of service then this will return a 404 Not Found Error.

Accept or Decline a Terms of Service
------------------------------------

To create user/terms of service association and accept/decline call the [`termsOfService.setUserStatus(termsOfServicesID, isAccepted, options, callback)`](http://opensource.box.com/box-node-sdk/jsdoc/TermsOfService.html#setUserStatus))
method.

```js
client.termsOfService.setUserStatus('1234', true,
	{
		user_id: '5678'
	},
	callback);
)
```

It is important to note that regardless of whether the user has taken action on this terms of service. This will create and update the user status on the terms of service.

repository: box/box-node-sdk

repo_name: box/box-node-sdk


text:
📓 Common resources used by external repositories:

1. 🔑 __Database__ - Vendor installations
1. 🏗 __Node.js__ - Auto [`nvm`](https://github.com/nvm-sh/nvm) [codename](https://github.com/nodejs/Release/blob/master/CODENAMES.md)/version installations, builds and [`systemd`](https://www.linux.org/docs/man7/systemd.html) deployments

> See the corresponding directory for specific resource instructions

repository: ugate/repo

repo_name: ugate/repo


text:
# How to nest items within folders

If you want to place items nested within folders, for example according to the month they were published — then simply create any folder structure that you’d like within a given section’s `Content` folder, for example like this:

```
Content
    sectionOne
        2019
            january
                one-item.md
            february
                another-item.md
                and-another-one.md
    sectionTwo
        2018
            november
                an-older-item.md
```

Publish will then output the HTML for the above items with the exact same folder structure, like this:

```
Output
    sectionOne
        2019
            january
                one-item
                    index.html
            february
                another-item
                    index.html
                and-another-one
                    index.html
    sectionTwo
        2018
            november
                an-older-item
                    index.html
```

If you’d rather specify an item’s path using Markdown metadata, instead of setting up the above kind of folder structure, then you can do that like this:

```markdown
---
path: path/to/my/item
---

# My nested item
```

repository: JohnSundell/Publish

gha_language: Swift

repo_name: JohnSundell/Publish


text:
# Assignment 1. Life expectancy

 In this assignment, you will create the "before" figures. At the end of this course, you will return to this exercise and recreate all the figures using the tools that you have learned.

 Use any tool you like to create what you think is the best visual answers to the following questions.

## 1.1 Life expectancy of a group of countries in 2014
Data file `life_expectancy.csv` contains life expectancy data for many countries over a wide range of years. Use the data in this file to extract 2014 life expectancy in your country and in five more countries that belong to the same group, organization or geographical region. Feel free to define any selection criteria you want. For example, since I live in Israel, I will select the following OECD countries from the Europe & Central Asia region: United Kingdom, Italy, France, Israel, Luxembourg.

Create a visual representation of 2014 life expectancies in the countries you selected.

## 1.2 Life expectancy dynamics over the time (1)
Obtain the life expectancy data for the countries in the previous section for the widest time period available. Show a comparison between the expectancy dynamics of your country to other countries in that group.

## 1.3 Life expectancy dynamics over the time (2)

Expand the list of countries so that it contains between 20 and 40 countries. For example, all the OECD countries. Repeat the previous task with the extended data set.

# Data Description

## Life expectancy data
File name:  life_expectancy.csv
Source   :  World Bank
Description:

Based on the World Bank data, this file contains life expectancy data for various countries in the World, during different years.

Columns:
* Country Name
* Country Code
* is_oecd (does not exist in the original data). Whether the country is a one of the OECD countries (as of 2016)
* Region (does not exist in the original data). World Bank geographical region for the country
* IncomeGroup (does not exist in the original data). World Bank country income classification
* 1960 - 2014. Years. Life expectancy during the specified year.

repository: bgbg/dataVisualizationBeyondTheTutorial

repo_name: bgbg/dataVisualizationBeyondTheTutorial


text:
# kafka-producer-example
Show an example on a kafka producer that post account change events to a topic.

# Requirements
In order to compile this project you must have maven and java install. Furthermore you need to import project from https://github.com/martincallesen/bank-datamodel-example and install it in your local
maven repository.

repository: martincallesen/kafka-producer-example

repo_name: martincallesen/kafka-producer-example


text:
# CheckNonceGUI

GUI for my Checkm8 based APNonce Setter. This is a very simple swift app that will place your device into PWNDFU mode using ipwndfu/checkm8, let the user pick a valid previously saved SHSH file and grab the generator from it, place the device into PWNDREC mode and set the generator to that found in the SHSH file. This allows for downgrades/upgrades to unsiged iOS versions for compatible devices, limited to versions with a signed compatible SEP/Baseband for now.

## Usage
Place the .app into "/Applications" and run it from there. ~~If that's too complicated for you then I don't know what to say~~

## Building the project

1. Clone the repo
2. Open the xcode workspace (CheckNonceGUI.xcworkspace)
3. Add your Apple ID for signing
4. Run
5. Build and copy over the .app from wherever it is in "~/Library/Developer/Xcode/DerivedData" to "/Applications" (You don't HAVE to do this but the app won't be able to do ipwndfu/irecovery stuff, making it basically useless until it is in the correct location)
6. Do whatever you want =)

## Running the app

1. Download latest release
2. Move the .app to "/Applications"
3. Run the app

The app has only been tested and confirmed to work on Mojave, it should work fine on Catalina but High Sierra and lower I don't know and can't be bothered testing at this stage.

## Issues

- If the app gives an error about being damaged please run -

`xattr -cr /Applications/checkm8.app`

And try again.

- If the app doesn't run at all, try opening a terminal window and running -

`sudo open /Applications/CheckNonceGUI.app/Contents/MacOS/CheckNonceGUI`

This will allow you to see what is happening when the app is launched and for you to take a screen shot of the output in the terminal window that this command opens to send to me so I can help fix the issue.

## Device Support

iPhone 5s

iPhone 7

iPhone 7 Plus

iPhone X

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

iPad Air 1

iPad Mini 2

iPad 6th Gen (2018)

iPad Mini 3

iPad 7th Gen (2019) (Thanks to @RazMashat on twitter for keys =) )

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

iPod Touch 7th Gen (2019)

## SUPPORT COMING FOR:

iPad Pro (10.5 Inch) (Need firmware keys)

iPad Pro (12.9 Inch 2nd Gen) (Need firmware keys)

## Me and my stuff

[My twitter](https://www.twitter.com/mosk_i "My twitter")

[My reddit account](https://www.reddit.com/user/_Matty "My reddit account")

[My github](https://www.github.com/MatthewPierson "My github")

## Credits

Me =)

Kare Morstol (kareman) - [SwiftShell](https://github.com/kareman/SwiftShell "SwiftShell")


text:
# Protoblock
This repository contains the open source protoblock blockchain, fantasybit token and proof-of-skill consensus code.

[Webpage](https://fantasybit.com)
[Proof-of-Skill - Medium](https://medium.com/@jaybny/on-proof-of-skill-6af149f45ce8)

QML/C++ desktop client for Protoblock blockchain full node + Fantasybit wallet

![Desktop](docs/trading.PNG)

## Dependencies

Qt 5.10.0 with at least the following modules is required:
 * [qtbase](http://code.qt.io/cgit/qt/qtbase.git)
 * [qtquickcontrols2](http://code.qt.io/cgit/qt/qtquickcontrols2.git)
 * [qtgraphicaleffects](http://code.qt.io/cgit/qt/qtgraphicaleffects.git)
 * [qtsvg](http://code.qt.io/cgit/qt/qtsvg.git)
 * [qtmultimedia](http://code.qt.io/cgit/qt/qtmultimedia.git)
 * [qtdoc](http://code.qt.io/cgit/qt/qtdoc.git)
 * [qtwebsockets](http://code.qt.io/cgit/qt/qtwebsockets.git)
 * [qtxmlpatterns](http://code.qt.io/cgit/qt/qtxmlpatterns.git/)

libs
 * protobuf 2.5
 * leveldb 1.18
 * openssl

### Building on MacOS/Windows
1. Install Qt5, using their official installer.
1. get and build libs - or get binaries from [winodws](https://github.com/protoblock/protoblock/tree/win64-libs/libs) or [osx](https://github.com/protoblock/protoblock/tree/osx-libs/libs) branch.
1. update libcommuni submodule
1. open project plugins project [ProRotoQml.pro](share/ProRotoQml/ProRotoQml.pro)
1. setup kits
1. add make install
1. build ProRotoQml plugins
1. open apps project [apps.pro](apps/apps.pro)
1. compile protoblockd
1. compile protoblock-qt
1. run protoblock-qt

Design Docs
-----------
Design decisions and discussions documented here: [docs](docs/README.md)

## Getting involved

Telgram is the preferred means of getting in touch with the developers.
* [t.me/protoblock](https://t.me/protoblock)
* [Email us -<EMAIL_ADDRESS>* [home page][web-home]
* [download][web-download]
* [twitter][twitter-main]
* [twitter-ticker][twitter-feed]
* [reddit][reddit]
* [get coins][coins]
* [skillSale](https://github.com/SatoshiFantasy/--skillSale/releases)

<<>> THE PROTOBLOCK DEVS <<>>

```
88""Yb 88""Yb  dP"Yb  888888  dP"Yb  88""Yb 88      dP"Yb   dP""b8 88  dP
88__dP 88__dP dP   Yb   88   dP   Yb 88__dP 88     dP   Yb dP   `" 88odP
88"""  88"Yb  Yb   dP   88   Yb   dP 88""Yb 88  .o Yb   dP Yb      88"Yb
88     88  Yb  YbodP    88    YbodP  88oodP 88ood8  YbodP   YboodP 88  Yb
```

[web-home]: https://fantasybit.com
[web-download]: https://fantasybit.com/downloads
[twitter-main]: https://twitter.com/protoblock
[twitter-feed]: https://twitter.com/prototicker
[reddit]: https://www.reddit.com/r/Protoblock/
[coins]: http://fantasybit.com/coins/
[dev-email]<EMAIL_ADDRESS>

repository: protoblock/protoblock

gha_language: C

repo_name: protoblock/protoblock