text:
# Item-Pricing Marketplace Clone

Get the detailed marketplace info of an item

**URL** : `/marketplace-clone/item-pricing/:mainKey/subKey?region=YOURREGION`

**URL Parameters** : `mainKey=[integer]` where `mainKey` is the itemId

**URL Parameters** : `subKey=[integer]` where `subKey` is the enhacement level (0 for base and up to 20 for PEN)

**URL Queries** : `region` where `region` is either na or eu (case sensitive, must be lowercase). This is required.

**Method** : `GET`

## Success Response

**Code** : `200 OK`

**Content examples**

Returns json in the following format

```json
{
  "priceList": [
<PHONE_NUMBER>0,
<PHONE_NUMBER>0,
<PHONE_NUMBER>0,
<PHONE_NUMBER>0,
<PHONE_NUMBER>0,
<PHONE_NUMBER>0,
<PHONE_NUMBER>0,
<PHONE_NUMBER>0,
<PHONE_NUMBER>0,
<PHONE_NUMBER>0,
<PHONE_NUMBER>0,
<PHONE_NUMBER>0
  ],
  "marketConditionList": [
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 1,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 1,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 1,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    },
    {
      "sellCount": 0,
      "buyCount": 0,
      "pricePerOne":<PHONE_NUMBER>0
    }
  ],
  "basePrice":<PHONE_NUMBER>0,
  "enchantGroup": 20,
  "enchantMaxGroup": 20,
  "enchantMaterialKey": 0,
  "enchantMaterialPrice": 0,
  "enchantNeedCount": 0,
  "maxRegisterForWorldMarket": 5,
  "countValue": 0,
  "sellMaxCount": 0,
  "buyMaxCount": 0,
  "resultCode": 0,
  "resultMsg": "Data will be here. I removed it from this example."
}
```

## Notes

- **priceList -** is the current range of prices.

- **marketConditionList -** array of price values and buy/sell orders.

  - **sellCount -** current ammount up for sale.
  - **buyCount -** current ammount of buy orders up.
  - **pricePerOne -** price to buy/sell at.

- **basePrice -** average price.

- **enchantGroup -** min enhantment level for the group (ex. when you go to base Kzarka the enchantment group will be 0-7 thus min will be 0).

- **enchantMaxGroup -** max enhantment level for the group (ex. when you go to base Kzarka the enchantment group will be 0-7 thus max will be 7).

- **enchantMaterialKey -** the itemId of the material used to enhance the current item (if there is none it will be 0).

- **enchantMaterialPrice -** the average marketplace price of the material used to enhance the current item (if there is none it will be 0).

- **enchantNeedCount -** unsure what this is for.

- **maxRegisterForWorldMarket -** is the max ammount you can register on the market of that item.

- **countValue -** unsure what this is for.

- **sellMaxCount -** unsure what this is for.

- **buyMaxCount -** unsure what this is for.

- **resultCode -** unsure what this is for.

- **resultMsg -** I'm assuming this is the data they use for the graph.

repository: PatrickSantoZZ/BDO-Api-Helper

repo_name: PatrickSantoZZ/BDO-Api-Helper


text:
## Custom R Runtime Layers

### Dependencies

* Install Docker Desktop on Mac or use an EC2 VM with the docker service installed.

### HowTo

1. Clone bakdata's 'aws-lambda-r-runtime' repo onto your machine.
```
git clone git@github.com:bakdata/aws-lambda-r-runtime.git
```

2. Copy the 'awspack' folder into a brand new layer folder and give it a descriptive name.
```
cd aws-lambda-r-runtime
cp -R awspack/ custom/
```

3. Open 'build.sh' and add copy the 'cd' and './build.sh' lines related to 'awspack', and paste into new lines.  Rename to match your new layer.

4. Go into your new custom folder, open up each file and ensure you rename "awspack" to your new layer name.

5. Change all 'package.install' values to match the new packages you want included in your custom runtime layer.

6. Go back to the root folder of the repo, and run './build.sh'.

7. After all the docker containers are pulled and code finishes executing, you should be able to publish your new Lambda Layer inside your AWS account by going into your custom folder and running './deploy.sh'

repository: adconk/ServeRmore

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: adconk/ServeRmore


text:
Starter
==========

A simple, git-clone friendly starting point for personal projects.

## Includes

* HTML Boilerplate
* Bootstrap (CSS)
* Minimal layout
* Gulp build process (Concat, Minify, Optimize Images, LiveReload, Remove unused CSS, Wire Deps, Autoprefixer)

![preview](https://cloud.githubusercontent.com/assets/110953/2562563/edbc5e4e-b851-11e3-9342-d45d77eedeb9.jpg)

## Uses

* Bower. Deps are checked-in for ease of cloning.

## Build tasks

* `gulp watch`
* `gulp build`
* `gulp bundle`
* `gulp clean`

## Credits

Based in part on Yeoman's [generator-gulp-webapp](https://github.com/yeoman/generator-gulp-webapp).

## License

(C) Addy Osmani 2014, released under the MIT license

license: MIT

repository: torifat/starter

repo_name: torifat/starter


text:
# github-concierge
Practical UI to navigate at your repositories organized in folders

## Contribute
You can contribute to improve the project by [opening issues](https://github.com/luizdesign/github-concierge/issues/new), and submitting [pull requests](https://github.com/luizdesign/github-concierge/pulls). However check the [issue list](https://github.com/luizdesign/github-concierge/issues) before to avoid duplicate issues.

Remember always on to check the [contribution guide](https://github.com/luizdesign/github-concierge/blob/master/CONTRIBUTING.md).

repository: luizdesign/github-concierge

gha_language: TypeScript

gha_license_id: MIT

repo_name: luizdesign/github-concierge


text:
# Security Policy

We consider security as a top priority.

If you find any vulnerability in our functionality, code or dependency then please contact us.

If you found a problem then please open new
Issue [here](https://github.com/NRCHKB/node-red-contrib-homekit-bridged/issues).

If vulnerability is a serious risk then please consider contacting us directly aswell for faster response.

## Supported Versions

| Version | Supported          |
| ------- | ------------------ |
| > = 1.2.0  | :white_check_mark: |
| < 1.2.0   | :x: limited               |

## Reporting a Vulnerability

Contact Shaq#6198 at Discord

or find us on

[![Discord](https://img.shields.io/discord/586065987267330068.svg?label=Discord)](https://discord.gg/uvYac5u)

## Security concerns regarding usage of NRCHKB

NRCHKB is a node (plugin/library) for node-red. NRCHKB allow user to simulate HomeKit devices.

### node-red

To use node-red safely you should secure it properly with encryption and password protection
- [here is how in official node-red docs](https://nodered.org/docs/security).

### Invalid Setup Codes

The following Setup Codes must not be used due to their trivial, insecure nature. In future release (possibly 1.X.Y)
they will be forbidden programmatically.

- 000-00-000
- 111-11-111
- 222-22-222
- 333-33-333
- 444-44-444
- 555-55-555
- 666-66-666
- 777-77-777
- 888-88-888
- 999-99-999
- 123-45-678
- 876-54-321

Since 1.3 random Setup Code will be generated for new Bridge nodes (instead of default 111-11-111)

repository: NRCHKB/node-red-contrib-homekit-bridged

repo_name: NRCHKB/node-red-contrib-homekit-bridged


text:
# Linux Server Configuration

Baseline installation of a Linux distribution on a virtual machine and prepare it to host web applications, to include installing updates, securing it from a number of attack vectors and installing/configuring web and database server

- Public IP: <IP_ADDRESS>
- SSH port: 2200
- URL: http://<IP_ADDRESS>/

# Configuration Steps

## Create an instance with Amazon Lightsail

1. Sign in to Amazon Lightsail using an Amazon Web Services account
2. Follow the Create an instance link
3. Choose the OS Only and Ubuntu 16.04 LTS options
4. Choose a payment plan - the lowest one should be enough
5. Name the instance (wap-lightsail) and click 'Create'
6. Wait for the instance to start up
7. Connect to the instance on a local machine

Note: While Amazon Lightsail provides a broswer-based connection method, this will no longer work once the SSH port is changed (see below). The following steps outline how to connect to the instance via the Terminal program on Mac OS machines.

8. Download the instance's private key from Amazon Lightsail 'Account page'

9. Click on SSH keys -> Download default key

10. A file called LightsailDefaultPrivateKey-eu-central-1.pem will be downloaded; open this in a text editor

11. Create a file named lightrail_key touch ~/lightrail_key.rsa

12. Copy the text from LightsailDefaultPrivateKey-eu-central-1.pem and put it in lightrail_key.rsa

13. Move the file to ~/.ssh/ directory using mv ~/lightrail_key.rsa ~/.ssh

14. Run chmod 600 ~/.ssh/lightrail_key.rsa

15. Log in with the following command: ssh -i ~/.ssh/lightrail_key.rsa<EMAIL_ADDRESS>, after @ is the public IP address of the instance (note that Lightsail will not allow someone to log in as root; ubuntu is the default user for Lightsail instances)

## Create a new user named grader

in server ubuntu directory

1. Run `sudo adduser grader`
2. Enter in a new UNIX password (twice) when prompted
3. Fill out information for the new grader user. ( name: grader)
4. To switch to the grader user, run su - grader, and enter the password

## Give grader user sudo permissions

In ubuntu directory

1. Run sudo visudo

2. Search for a line that looks like this: `root ALL=(ALL:ALL) ALL`

3. Add the following line below this one: `grader ALL=(ALL:ALL) ALL`

4. Save and close the visudo file

5. To verify that grader has sudo permissions, su as grader (run su - grader), enter the password, and run sudo -l; after entering in the password (again), a line like the following should appear, meaning grader has sudo permissions:

```
Matching Defaults entries for grader on
    ip-XX-XX-XX-XX.ec2.internal:
    env_reset, mail_badpass,
    secure_path=/usr/local/sbin\:/usr/local/bin\:/usr/sbin\:/usr/bin\:/sbin\:/bin\:/snap/bin

User grader may run the following commands on
	ip-XX-XX-XX-XX.ec2.internal:
    (ALL : ALL) ALL'
Allow grader to log in to the virtual machine
```

## Run ssh-keygen on the local terminal machine

1. Choose a file name for the key pair (such as grader_key)

2. Enter in a passphrase twice (two files will be generated; the second one will end in .pub) -mv grader_key.pub ~/.ssh -mv grader_key ~/.ssh

3. Log in to the virtual machine (logged in into the server - ubuntu@ip)
```
su - grader
mkdir .ssh
touch .ssh/authorized_keys
```

4. On the local machine, run cat ~/.ssh/grader_key.pub, make sure the text match in local machine and authorized_keys, otherwise you can not log in as grader.

5. Copy the contents of the file, and paste them in the `.ssh/authorized_keys` file on the virtual machine

```
vim .ssh/authorized_keys
copy paste
chmod 700 .ssh
chmod 644 .ssh/authorized_keys
sudo service ssh restart
```

6. Exit grader to ubuntu user

7. `chmod 600 ~/.ssh/grader_key` in local machine

8. Log in as the grader using the following command:

`ssh -i ~/.ssh/grader_key<EMAIL_ADDRESS>
Note that a pop-up window will ask for grader's password.

9. generate private key by: `cat ~/.ssh/grader_key` to give to the reviewer

## Configure SSH Daemon

Now that we have our new account, we can secure our server a little bit by modifying its SSH daemon configuration (the program that allows us to log in remotely) to disallow remote SSH access to the root account.

1. Begin by opening the configuration file with your text editor as root:

`sudo nano /etc/ssh/sshd_config` Next, we need to find the line that looks like this:
/etc/ssh/sshd_config (before) PermitRootLogin yes Here, we have the option to disable root login through SSH. This is generally a more secure setting since we can now access our server through our normal user account and escalate privileges when necessary.

2. Modify this line to "no" like this to disable root login:
```
/etc/ssh/sshd_config (after)
PermitRootLogin no
```

## Upgrade currently installed packages

1. After log in to the server (ubuntu@ip) from the terminal in your computer,

2. Notify the system of what package updates are available by running sudo apt-get update

3. Download available package updates by running `sudo apt-get upgrade`

4. Install package maintainer

5. Changing the SSH port from 22 to 2200 (open up the sudo vim/etc/ssh/sshd_config file, change the port number on line 5 to 2200, then restart SSH by running sudo service ssh restart)

## Configure the Uncomplicated Firewall (UFW)

1. Check to see if the ufw (the preinstalled ubuntu firewall) is active by running sudo ufw status - it is inactive at this point

2. Run sudo ufw allow 2200/tcp to allow all tcp connections for port 2200 so that SSH will work

3. Run sudo ufw allow 80/tcp to set the ufw firewall to allow a basic HTTP server

4. Run sudo ufw allow 123/udp to set the ufw firewall to allow NTP

5. Run sudo ufw enable to enable the ufw firewall

6. Run sudo ufw status to check which ports are open and to see if the ufw is active; if done correctly, it should look like this:

```
To                         Action      From
--                         ------      ----

2200/tcp                   ALLOW       Anywhere
80/tcp                     ALLOW       Anywhere
123/udp                    ALLOW       Anywhere

2200/tcp (v6)              ALLOW       Anywhere (v6)
80/tcp (v6)                ALLOW       Anywhere (v6)
123/udp (v6)               ALLOW       Anywhere (v6)

```

7. Update the external (Amazon Lightsail) firewall on the browser by clicking on the 'Manage' option, then the 'Networking' tab, and then changing the firewall configuration to match the internal firewall settings above (only ports 80(TCP), 123(UDP), and 2200(TCP) should be allowed; make sure to deny the default port 22)

## Configure the local timezone to UTC

1. Configure the time zone `sudo dpkg-reconfigure tzdata`

2. It is already set to UTC.

## Install and configure Apache to serve a Python mod_wsgi application

1. Install Apache `sudo apt-get install apache2` Check to make sure it worked by using the public IP of the Amazon Lightsail instance as as a URL in a browser; if Apache is working correctly, a page with the title 'Apache2 Ubuntu Default Page' should load

2. Mod_wsgi is an Apache HTTP server mod that enables Apache to serve Flask applications. Install mod_wsgi with the following command: `Install mod_wsgi sudo apt-get install libapache2-mod-wsgi python-dev `

3. Enable mod_wsgi: `sudo a2enmod wsgi`

```

perl: warning: Setting locale failed.
perl: warning: Please check that your locale settings:
	LANGUAGE = (unset),
	LC_ALL = (unset),
	LC_CTYPE = "UTF-8",
	LANG = "en_US.UTF-8"
    are supported and installed on your system.
perl: warning: Falling back to a fallback locale ("en_US.UTF-8").
Module wsgi already enabled
```

- run this to fix error:
```
$ sudo locale-gen "en_US.UTF-8"
Generating locales...
  en_US.UTF-8... done
Generation complete.

$ sudo dpkg-reconfigure locales
Generating locales...
  en_US.UTF-8... up-to-date
Generation complete.
```

- and run this:
```
export LC_ALL=en_US.UTF-8
export LANGUAGE=en_US.UTF-8
export LC_TYPE=en_US.UTF-8
```

-- result:
```
LANG=en_US.UTF-8
LANGUAGE=en_US.UTF-8
LC_CTYPE="en_US.UTF-8"
LC_NUMERIC="en_US.UTF-8"
LC_TIME="en_US.UTF-8"
LC_COLLATE="en_US.UTF-8"
LC_MONETARY="en_US.UTF-8"
LC_MESSAGES="en_US.UTF-8"
LC_PAPER="en_US.UTF-8"
LC_NAME="en_US.UTF-8"
LC_ADDRESS="en_US.UTF-8"
LC_TELEPHONE="en_US.UTF-8"
LC_MEASUREMENT="en_US.UTF-8"
LC_IDENTIFICATION="en_US.UTF-8"
LC_ALL=en_US.UTF-8
```

4. Restart Apache `sudo service apache2 restart`

## Install and configure PostgreSQL

1. Install PostgreSQL `sudo apt-get install postgresql`

2. Check if no remote connections are allowed `sudo vim /etc/postgresql/9.5/main/pg_hba.conf` Make sure it looks like this:

```
local   all             postgres                                peer
local   all             all                                     peer
host    all             all             <IP_ADDRESS>/32            md5
host    all             all             ::1/128                 md5
```

## Make sure Python is installed

Python should already be installed on a machine running Ubuntu 16.04. To verify, simply run `python`. Something like the following should appear:

```
Python 2.7.12 (default, Nov 19 2016, 06:48:10)
[GCC 5.4.0 20160609] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>>
```

## Create a new PostgreSQL user named catalog with limited permissions

1. PostgreSQL creates a Linux user with the name postgres during installation; switch to this user by running `sudo su - postgres` (for security reasons, it is important to only use the postgres user for accessing the PostgreSQL software)

2. Login as user "postgres" `sudo su - postgres`

3. Connect to psql (the terminal for interacting with PostgreSQL) by running `psql`

4. Create the catalog user by running `CREATE USER catalog WITH PASSWORD 'sillypassword'`;

5. Next, give the catalog user the ability to create databases: `ALTER USER catalog CREATEDB`;

6. Create the 'catalog' database owned by catalog user: `CREATE DATABASE catalog WITH OWNER catalog`;.

7. Connect to the database: # \c catalog

8. Check to make sure the catalog user was created by running \du; a table of sorts will be returned, and it should look like this:

```
				   List of roles
 Role name |                         Attributes                         | Member of
-----------+------------------------------------------------------------+-----------
 catalog   | Create DB                                                  | {}
 postgres  | Superuser, Create role, Create DB, Replication, Bypass RLS | {}
 ```

9. Exit psql by running \q

10. Switch back to the ubuntu user by running exit

## Install git and clone the catalog project

1. Run `sudo apt-get install git`

2. Use `cd /var/www` to move to the /var/www directory

3. Create the application directory `sudo mkdir CatalogApp`

4. Cd inside this directory using `cd CatalogApp`

5. Clone the Catalog App to the virtual machine `sudo git clone https://github.com/WidyaPuspitaloka/Catalog.git CatalogApp`

6. Move to the inner CatalogApp directory using cd CatalogApp

7. Rename application.py to init.py using `sudo mv finalproject.py __init__.py`

8. Edit
- database_setup.py
- init.py
- coldplaydiscography.py

and change engine = create_engine('sqlite:///toyshop.db') to engine = create_engine('postgresql://catalog:sillypassword@localhost/catalog')

## Set up a vitual environment and install dependencies

Install Flask

Setting up a virtual environment will keep the application and its dependencies isolated from the main system. Changes to it will not affect the cloud server's system configurations.

In this step, we will create a virtual environment for our flask application.

We will use pip to install virtualenv and Flask. If pip is not installed, install it on Ubuntu through apt-get.

1. Start by installing pip (if it isn't installed already) with the following command:
`sudo apt-get install python-pip`

2. Install virtualenv with apt-get by running `sudo apt-get install python-virtualenv`

3. Change to the /var/www/CatalogApp/CatalogApp directory; choose a name for a temporary environment ('venv' is used in this example), and create this environment by running virtualenv venv (make sure to not use sudo here as it can cause problems later on)

`sudo virtualenv venv`

4. Activate the virtual environment: `$ source venv/bin/activate`.

5. Change permissions to the virtual environment folder: `$ sudo chmod -R 777 venv`.

6. Install:

```
pip install Flask
pip install httplib2
pip install --upgrade oauth2client
pip install sqlalchemy
pip install psycopg2
pip install requests
```

7. In order to make sure everything was installed correctly, run `python __init__.py`; the following (among other things) should be returned:
```
Running on http://<IP_ADDRESS>:5000/ (Press CTRL+C to quit)
```

8. Create database schema python database_setup.py

## Configure and enable a new virtual host

1. Create a virtual host conifg file: `sudo nano /etc/apache2/sites-available/CatalogApp.conf`

2. Paste in the following lines of code:

```
<VirtualHost *:80>
        ServerName mywebsite.com
        ServerAdmin<EMAIL_ADDRESS>        WSGIDaemonProcess CatalogApp user=www-data group=www-data threads=5
        WSGIScriptAlias / /var/www/CatalogApp/catalogapp.wsgi
        <Directory /var/www/CatalogApp/CatalogApp/>
                WSGIProcessGroup CatalogApp
                WSGIApplicationGroup %{GLOBAL}
                Order allow,deny
                Allow from all
        </Directory>
        Alias /static /var/www/CatalogApp/CatalogApp/static
        <Directory /var/www/CatalogApp/CatalogApp/static/>
                Order allow,deny
                Allow from all
        </Directory>
        ErrorLog ${APACHE_LOG_DIR}/error.log
        LogLevel warn
        CustomLog ${APACHE_LOG_DIR}/access.log combined
</VirtualHost>
```

3. Run `sudo a2ensite CatalogApp` and get this message
```
Enabling site CatalogApp.
To activate the new configuration, you need to run:
  service apache2 reload
 ```

4. Then `sudo service apache2 reload`

## Disable the default Apache site

1. At some point during the configuration, the default Apache site will likely need to be disabled; to do this, run sudo `a2dissite 000-default.conf`

2. The following prompt will be returned:
```
Site 000-default disabled.
To activate the new configuration, you need to run:
  service apache2 reload
  ```

3. Run `sudo service apache2 reload`

## Write a .wsgi file

1. Apache serves Flask applications by using a .wsgi file; create a file called catalogapp.wsgi in /var/www/CatalogApp

2. Add the following to the file:

```
#!/usr/bin/python
import os
import sys
import logging
logging.basicConfig(stream=sys.stderr)
sys.path.insert(0,"/var/www/CatalogApp/")

activate_this = '/var/www/CatalogApp/CatalogApp/venv/bin/activate_this.py'
execfile(activate_this, dict(__file__=activate_this))

from CatalogApp import app as application
application.secret_key = 'super_secret_key'
```

3. Run `sudo service apache2 restart`

4. Check if there's error using `sudo tail /var/log/apache2/error.log`

## Add client_secrets.json files

1. On the Google API Console: make sure to add http://<IP_ADDRESS>
 and http://ec2-<IP_ADDRESS>
.compute-1.amazonaws.com as authorized JavaScript origins

2. Add http://ec2-<IP_ADDRESS>
.compute-1.amazonaws.com/login, http://ec2-<IP_ADDRESS>
.compute-1.amazonaws.com/gconnect, and http://ec2-<IP_ADDRESS>
.compute-1.amazonaws.com/oauth2callback as authorized redirect URIs

4. Google will provide a client ID and client secret for the project; download the JSON file, and copy and paste the contents into the client_secrets.json file

5. Add the client ID to templates/login.html file in the project directory

6. Add the complete file path for the client_secrets.json file in the __init__.py file; change it from client_secrets.json to /var/www/CatalogApp/CatalogApp/client_secrets.json

## Update packages to the latest versions

1. Sudo apt install unattended-upgrades

2. Sudo apt autoremove

3. Sudo apt-get update && sudo apt-get upgrade

## Resources

1. [How To Deploy a Flask Application on an Ubuntu VPS](https://www.digitalocean.com/community/tutorials/how-to-deploy-a-flask-application-on-an-ubuntu-vps)

2. [How To Serve Flask Applications with uWSGI and Nginx on Ubuntu 16.04](https://www.digitalocean.com/community/tutorials/how-to-serve-flask-applications-with-uwsgi-and-nginx-on-ubuntu-16-04)

3. [Initial Server Setup with Ubuntu 14.04](https://www.digitalocean.com/community/tutorials/initial-server-setup-with-ubuntu-14-04)

4.[Starting web projects using Flask, virtualenv, pip](http://modwsgi.readthedocs.io/en/develop/user-guides/virtual-environments.html)

5.[Connecting to Your Linux Instance Using SSH](http://docs.aws.amazon.com/AWSEC2/latest/UserGuide/AccessingInstancesLinux.html)

6. [How do I fix my locale issue?](https://askubuntu.com/questions/162391/how-do-i-fix-my-locale-issue)

7. 1-1 Appointment with Udacity's Mentor

## License

MIT License

repository: WidyaPuspitaloka/Linux-Configuration

repo_name: WidyaPuspitaloka/Linux-Configuration


text:
vault-token-helper
==================

![main](https://github.com/joemiller/vault-token-helper/workflows/main/badge.svg)

A @hashicorp Vault [token helper](https://www.vaultproject.io/docs/commands/token-helper.html) with
support for native secret storage on macOS, Linux, and Windows.

Features
--------

Store and retrieve tokens for multiple Vault (`$VAULT_ADDR`) instances, simplifying operators'
workflows when working with multiple Vaults.

Supported backends:

* macOS Keychain
* Linux (DBus Secret Service compatible backends, eg: Gnome Keyring)
* Windows (WinCred)
* [pass](https://www.passwordstore.org/) (GPG)

Quickstart (macOS)
------------------

Install:

    brew install joemiller/taps/vault-token-helper

Configure Vault to use the token helper. This will create the `~/.vault` config file:

    vault-token-helper enable

Authenticate to a Vault instance to encrypt and store a new token locally, for example
with the Okta auth backend:

    export VAULT_ADDR=https://vault:8200
    vault login -method=okta<EMAIL_ADDRESS>
Or to store an existing token:

    export VAULT_ADDR=https://vault:8200
    vault login

    Token (will be hidden): <paste token>

List saved tokens with extended status output:

    vault-token-helper list -e

Keep reading for further details and installation methods.

Install
-------

### One-line install

| OS                              | Command                                          |
|---------------------------------|--------------------------------------------------|
| macOS                           | `brew install joemiller/taps/vault-token-helper` |
| Linux<br>(LinuxBrew) *untested* | `brew install joemiller/taps/vault-token-helper` |

### Linux packages

| Format | Arch  |
|--------|-------|
| [rpm]  | amd64 |
| [deb]  | amd64 |

### Pre-built binaries

| OS      | Arch  | binary                                |
|---------|-------|---------------------------------------|
| macOS   | amd64 | [vault-token-helper][latest-binaries] |
| Linux   | amd64 | [vault-token-helper][latest-binaries] |
| Windows | amd64 | [vault-token-helper][latest-binaries] |

[latest-binaries]: https://github.com/joemiller/vault-token-helper/releases/latest
[rpm]: https://github.com/joemiller/vault-token-helper/releases/latest
[deb]: https://github.com/joemiller/vault-token-helper/releases/latest

### From source

Clone this repo and compile for the current architecture:

    make build

### Verifying releases

macOS binaries are CodeSign'd with a certificate from Apple.

Additionally all releases are signed using this project's GPG key:

* Subject: `vault-token-helper (github.com/joemiller/vault-token-helper project key<EMAIL_ADDRESS>* key-ID `37F9D1272278CD32`
* fingerprint `5EF2 2550 7053 ACC2 728A  A51C 37F9 D127 2278 CD32`.

The key can be fetched from most keyservers:

    gpg --recv-keys 37F9D1272278CD32

[Download](https://github.com/joemiller/vault-token-helper/releases/latest) and verify the signature
on the checksum file:

    gpg --verify vault-token-helper_0.2.0_checksums.txt.sig vault-token-helper_0.2.0_checksums.txt

After verifying the checksum file's signature use `shasum` to verify the checksums of the
release artifacts:

    shasum --check vault-token-helper_0.2.0_checksums.txt

Usage
-----

### Pre-Reqs

`vault-token-helper` will attempt to detect the best available token storage backend.
On macOS this will be the Keychain app, on Windows the native credential store, and
on most Linux distros the DBus Secret-Service API (common packages implementing this are
Gnome Keyring and Seahorse).

You may need to install a compatible credential storage service on Linux. For example,
on Arch Linux with a vanilla desktop you may need to install `gnome-keyring`.

Alternatively, the cross-platform, GPG-based [pass](https://www.passwordstore.org/)
utility can also be used. You must initialize `pass` (`pass init`) with a GPG key before
using `vault-token-helper`.

### Configure Vault

Install `vault-token-helper` then run:

    vault-token-helper enable

This creates (overwrites) the `$HOME/.vault` config file used by the `vault` CLI.

Alternatively, edit the file and specify the full path to the `vault-token-helper` binary:

    token_helper = "/install/path/to/vault-token-helper"

### Configure vault-token-helper

For most installations the defaults should be sufficient.

An optional configuration file located at `$HOME/.vault-token-helper.yaml` can be used to
override the defaults.

A fully annotated example config file is available in [./vault-token-helper.annotated.yaml](./vault-token-helper.annotated.yaml)

### Login to Vault

Set `VAULT_ADDR` to the URL of your Vault instance and run `vault` commands like normal. For example,
to login and store a token on a Vault instance with the Okta auth plugin enabled:

    VAULT_ADDR=https://vault:8200 vault login -method=okta<EMAIL_ADDRESS>
Or to store an existing token:

    $ VAULT_ADDR=https://vault:8200 vault login
    Token (will be hidden): <paste token>

Upon successful authentication the Vault token will be stored securely in the platform's
secrets store.

Support for storing tokens from multiple Vault instances is implemented. Change the `VAULT_ADDR`
environment variable to switch between Vault instances.

The `VAULT_NAMESPACE` environment variable is also supported.

### Additional commands

The standard `store`, `get`, and `erase` commands are implemented according to the vault token
helper [spec](https://www.vaultproject.io/docs/commands/token-helper.html).

There are a few additional commands:

* `enable`: Enable the vault-token-helper by (over)writing the ~/.vault config file.
* `backends`: List the available secret storage backends on the current platform.
* `list`: List tokens. Add `--extended/-e` flag to lookup additional details about the stored
    token by quering the Vault instance's token lookup API.

```console
$ vault-token-helper list --extended

VAULT_ADDR                       display_name      ttl         renewable  policies
----------                       ------------      ---         ---------  --------
https://vault-prod.dom.tld:8200<EMAIL_ADDRESS>527h46m18s  true       [admin default]
https://vault-dev.dom.tld:8200<EMAIL_ADDRESS>275h13m17s  true       [admin default]
https://localhost                ** ERROR **       Get https://localhost/v1/auth/token/lookup-self: dial tcp <IP_ADDRESS>:443: connect: connection refused
```

Support
-------

Please open a GitHub [issue](https://github.com/joemiller/vault-token-helper/issues).

Setting the `KEYRING_DEBUG` environment variable to any value will produce additional output
that may be useful for debugging common issues. Please set this variable and then
run a command such as `vault-token-helper list`. Include the debug output in your issue.

Development
-----------

### Tests

Run tests: `make test`.

There is test coverage in `pkg/store` covering all of the supported backends. Additionally, there
is an integration test in the `cmd` package.

Some tests are platform specific and difficult to test outside of a full desktop environment
due to interactive elements such as password prompts. To aid in development there are Vagrant
VMs with GUIs enabled in the `./vagrant/` directory. See the
[./vagrant/README.md](./vagrant/README.md) for further details.

The most complete way to run all tests would be to run `make test` under each platform (macOS, Linux, Windows).

### CI/CD

[Github Actions](https://github.com/joemiller/vault-token-helper/actions) is used for CI/CD.

Tests are run on pull requests and versioned releases are generated on all successful main branch
builds.

Some tests are not run in CI/CD due to requiring an interactive desktop such as the Linux
DBus Secret Service backend.

### Release Management

Releases are cut automatically on all successful main branch builds. This project uses
[autotag](https://github.com/pantheon-systems/autotag) and [goreleaser](https://goreleaser.com/) to
automate this process.

Semver (`vMajor.Minor.Patch`) is used for versioning and releases. By default, autotag will bump the
patch version on a successful main build, eg: `v1.0.0` -> `v1.0.1`.

To bump the major or minor release instead, include `[major]` or `[minor]` in the commit message.
Refer to the autotag [docs](https://github.com/pantheon-systems/autotag#incrementing-major-and-minor-versions)
for more details.

Include `[skip ci]` in the commit message to prevent a new version from being released. Only use this
for things like documentation updates.

A local release can be built and signed with a copy of the project GPG key's signing subkey:

```console
$ GPG_KEY="$(cat vault-token-helper.signing-key.gpg | base64)" make release

# or a snapshot build:

$ GPG_KEY="$(cat vault-token-helper.signing-key.gpg | base64)" make snapshot
```

#### Apple codesign

In order to avoid macOS keychain from always prompting for passwords the macOS binaries
are codesigned with a cert issued by Apple.

TODO
----

*after v0.1.0:*

* [x] The wincred lib used by 99designs/keyring has more configuration options available. Make these available in 99designs/keyring and vault-token-helper.
* [x] add a flag like `--extended` to `list` that will query vault for additional token info, eg: valid/invalid, ttl, policies
* ci/cd:
  * [x] `sign` checksum.txt and assets in goreleaser.yaml GPG key
  * [x] apple `codesign` the macos binaries
  * [ ] linux tests, figure out how to test dbus secret-service in headless CI. probably need a stub to connect to Dbus and provide the 'prompt' service

repository: joemiller/vault-token-helper

branch_name: refs/heads/main

gha_language: Go

repo_name: joemiller/vault-token-helper


text:
# test-dags-for-k8-airflow

## creating required environment

```bash
conda config --add channels conda-forge
conda create -n testdag python=3.7.3 anaconda pytest pytest-cov sphinx

conda activate testdag
python setup.py develop
pip install -r requirements.txt
```

## Getting Started

### Setting the conda environment

From the project root folder execute the following commands.

```bash
conda activate testdag

mkdir zip_dag_contents
cd zip_dag_contents

git clone https://github.com/apache/incubator-airflow /tmp/airflow-temp
pip3 install --install-option="--install-lib=$PWD" kubernetes
rm -rf *-info
rm *.pth
mkdir airflow
cp -r /tmp/airflow-temp/airflow/contrib ./airflow/
cp -r /tmp/airflow-temp/airflow/operators ./airflow/
cp -r /tmp/airflow-temp/airflow/models ./airflow/

cp ../src/test_dags_for_k8_airflow/helloworlddag.py .

zip -rm zip_dag.zip *
mv zip_dag.zip ..

```

### Setting up Pycharm

Follow the basic instructions[here](https://github.com/shellagilehub/pretzel-brainstorm/blob/master/development-workflow/using-git-with-pycharm.md)
then [Setup The Extra Depedencies](#Setup The Extra Depedencies).

### Setup The Extra Dependencies

In Pycharm select Preferences -> Project -> ProjectInterpreter
hit the cog button to the right of Project Interepreter and select "Show All"

Now select the filetree button , hit + to add a new folder.
Select you zip folder from you filesystem, it should be zip_dag.zip if you are following
this guide.

![adding zip to python path](./docs/_static/images/addziptopythonpath.png)

### .airflowignore

A .airflowignore file specifies the directories or files in DAG_FOLDER that Airflow
should intentionally ignore. Each line in .airflowignore specifies a regular expression
pattern, and directories or files whose names (not DAG id) match any of the patterns
would be ignored (under the hood, re.findall() is used to match the pattern). Overall
it works like a .gitignore file.

.airflowignore file should be put in your DAG_FOLDER. For example,
you can prepare a .airflowignore file with contents

```apacheconf
project_a
tenant_[\d]
```


text:
# Tonemap and Bloom
Tonemap and Bloom is an algorithm created for the research project of the Computer Science and Engineering bachelor of Delft University of Technology.

The technique extends on existing tone mapping algorithms by making the brightest areas emit a glow. To do this, the bloom shader effect is used. We take the image with the lowest exposure value, and perform convolution on it with a given kernel. For a realistic effect, this kernel should be similar to a camera’s response to a single point of light.

There are also several parameters. The smoothing factor changes how bright a pixel needs to be to emit a significant glow. The bloom intensity changes the intensity of the glow when it's merged with the tone mapped image. Finally, the kernel size determines the spread of the glow.

A full overview of the technique can be seen below:
![Overview image of the process](overview.png)
*Original images by Kevin McCoy, kernel by Unreal Engine*

## Code Structure
The code consists of four parts. `tonemap_and_bloom.py` is the general algorithm, along with some helpful tools such as image saving and loading. `main.py` runs the algorithm and saves it in the img folder. `application.py` is a Kivy user interface to run the algorithm more easily. The last image created is stored in img/app_output. Finally, `time.py` output the average runtime for an image.

## Requirements
- Python 3
- OpenCV2
- NumPy
- SciPy
- Kivy (for running the application only)

repository: JaeDukSeo/tonemap-and-bloom

repo_name: JaeDukSeo/tonemap-and-bloom


text:
# Ruby port of Nyancat CLI

A Ruby port of the original nyancat CLI by [Kevin Lange](https://github.com/klange/nyancat). Currently only supports xterm 256-color compatible terminals, likely doesn't work on Windows and lacks any finese or optimisation.

    $ gem install nyancat
    $ nyancat

For options, see --help

    $ nyancat --help
    Usage: nyancat [options]
    -s, --silent                     Don't play audio
    -f, --flavour FLAVOUR            Available flavours: original
    -n, --notime                     Don't show the time nyaned
    -l, --listen [PORT]              Run telnet server on PORT (default 21)
    -t, --timeout SECONDS            Timeout after SECONDS

## Audio

Very basic audio support is provided by using [mpg123](http://www.mpg123.de/). You'll need mpg123 installed and in your $PATH for audio to work.

## Telnet server

If run with `-l` or `--listen` and an optional port argument, a simple socket server will be started. The server will render a loop of the 'original' animation to connected clients using ANSI escaped text until any input from the client is received, upon which the connection is closed. The server does not currently implement the telnet protocol and simply spews ANSI text to the client. A proper telnet implementation is planned for the future.

Clients can connect to the server with a telnet client, though only xterm 256-color compatible terminals are supported.

	$ telnet nyan.andatche.com 23

## Licenses, References, etc.

The original source of the Nyancat animation is [prguitarman](http://www.prguitarman.com/index.php?id=348).

Original video: http://www.youtube.com/watch?v=QH2-TGUlwu4
Original Song: http://momolabo.lolipop.jp/nyancatsong/Nyan/

The code provided here is provided under the terms of the [NCSA license](http://en.wikipedia.org/wiki/University_of_Illinois/NCSA_Open_Source_License).

license: NCSA

gha_language: Ruby


text:
## Prompts AI

[Prompts AI](https://prompts.ai/) is an advanced [GPT-3](https://en.wikipedia.org/wiki/GPT-3) playground.

It has two main goals:
1) Help first-time GPT-3 users to discover capabilities, strengths
and weaknesses of the technology.
2) Help developers to experiment with prompt engineering by optimizing
the product for concrete use cases such as creative writing, classification,
chat bots and others.

### Install

```shell script
yarn install
yarn start
```

Note that each app user has to provide their own API key from the [OpenAI console](https://beta.openai.com/).
"Bring your own key" is an important concept enforced to prevent API misuse.

### Features

By use case:
* Examples: run the same prompt on multiple examples of data. Designed for
classification and transformation tasks.
* Variations: generate multiple completions for a prompt and store them in one list,
compare variations by parameters and initial prompts.
Designed for creative writing tasks.
* Conversations: chat-like interface to experiment with conversational bots.
It also allows to maintain multiple conversations at the same time.

Common:
* Workspaces to quickly change between and experiment with multiple prompts.
State in the local storage. Download/upload prompt with parameters and examples
as file.
* Code generators for Python, Node.js, Javascript, shell.
* Undo/redo for parameters and prompts.
* Shortcuts.
* Templates.

```
Shortcuts
===

Export the workspace to a file: Ctrl+S, Cmd+S
Run: Ctrl+Enter, Cmd+Enter

Switch between modes: Ctrl+1-4
(1 - simple, 2 - examples, 3 - variations, 4 - conversations)
```

### Roadmap

- Minor UX changes (line break symbols instead of "\n", log probs etc)
- Authorization and collaborative features
- Community features to share and discover prompts

### Contributing

The project is in a very early stage and still shaping its form.
It also has some amount of technical debt (for example, `editorSlice.ts`).
However, contributions are welcome.

Until we have a formed contribution process, if you need any help
 to find something to work on and/or make sure your contribution will be merged to the product,
 reach out to me at<EMAIL_ADDRESS>
### Contributors

Sorted by the date of a first contribution. Feel free to add yourselves while making
 your first contribution!

- [Seva Zhidkov](https://github.com/sevazhidkov)
- [Ilya Penyaev](http://github.com/penyaev)
- [Eugene Chung](https://github.com/ycechungAI)

repository: ycechungAI/prompts-ai

repo_name: ycechungAI/prompts-ai


text:
# Errors

Pasarpolis SDK uses the following error codes:

Error Code | Meaning
---------- | -------
400 | Bad Request -- Your request sucks
403 | Forbidden -- Forbidden
404 | Not Found -- The specified policy could not be found
409 | Duplicate Request
500 | Internal Server Error -- We had a problem with our server. Try again later.


text:
---
jupytext:
  formats: ipynb,md:myst
  text_representation:
    extension: .md
    format_name: myst
    format_version: 0.13
    jupytext_version: 1.14.1
kernelspec:
  display_name: Python 3 (ipykernel)
  language: python
  name: python3
---

(getting-started:tutorial-sensitivity)=
# Tutorial: Test a Sensitivity Analysis Method

UQTestFuns includes a wide range of test functions from the literature
employed in a sensitivity analysis exercise.
In this tutorial, you'll implement a sensitivity analysis method and test
the implemented method using a test function available in UQTestFuns
(the popular Ishigami function).
Afterward, you'll compare the results against analytical results.

By the end of this tutorial, you'll get an idea how a function from UQTestFuns
is used to test a sensitivity analysis method.

```{code-cell} ipython3
import numpy as np
import matplotlib.pyplot as plt
import uqtestfuns as uqtf
```

## Global sensitivity analysis

Sensitivity analysis is a model inference technique whose overarching goal is
to understand the inputs/outputs relationship of a complex
(potentially, black box) model. Specific goals include:

- _identification of inputs that drive output variability_ that leads to
  _factor prioritization_, that is, identifying which inputs that result in
  the largest reduction in the output variability.
- _identification of non-influential inputs_ that leads to _factor fixing_,
  that is, identifying which inputs that can be fixed at any value without
  affecting the output.

A _global_ sensitivity analysis is often distinguished from a _local_ analysis.
A local analysis is concerned with the effects
of perturbation around a particular instance of the inputs
(e.g., their nominal values) on the output.
A global analysis, on the other hand, is concerned with the effects of
variations over all possible instances of inputs
within their respective uncertainty range on the output.

### Variance decomposition

Consider an $M$-dimensional mathematical function
$\mathcal{M}: \mathcal{D}_{\boldsymbol{X}} \in [0, 1]^M \mapsto \mathbb{R}$ that represents
a computational model of interest.

Due to uncertain inputs, represented as an $M$-dimensional random vector $\boldsymbol{X}$,
the output of the model becomes a random variable $Y = \mathcal{M}(\boldsymbol{X})$.
It is further assumed that the components $X_m$'s of the random vector $\boldsymbol{X}$
are mutually independent such that the joint probability density function $f_{\boldsymbol{X}}$
reads:

$$
f_{\boldsymbol{X}}(\boldsymbol{x}) = \prod_{m = 1}^M f_{X_m}(x_m),
$$

where $f_{X_m}$ is the marginal probability density function of $X_m$.

The Hoeffding-Sobol' variance decomposition of random variable $Y$ reads as follows:

$$
\mathbb{V}[Y] = \sum_{m = 1}^M V_i + \sum_{1 \leq i < j \leq M} V_{m, n} + \ldots + V_{1, \ldots, M},
$$

where the terms are partial variances defined below:

- $V_m = \mathbb{V}_{X_m} \left[ \mathbb{E}_{X_{\sim m}}\left[ Y | X_m \right]\right]$
- $V_{m, n} = \mathbb{V}_{X_{\{m, n\}}} \left[ \mathbb{E}_{X_{\sim \{m, n\}}}\left[ Y | X_m, X_n \right]\right]$
- etc.

### Sobol' sensitivity indices

By normalizing the above equation with the total variance $\mathbb{V}[Y]$, we obtain the following expression:

$$
1 = \sum_{m = 1}^M S_m + \sum_{1 \leq m < n \leq M} S_{m, n} + \ldots + S_{1, \ldots, M},
$$

where now each term is a normalized partial variance.
These normalized terms are called Sobol' sensitivity indices and there are $2^M - 1$ (where $M$ is the number of dimension)
indices.

Of particular importance is the _first-order_ (or _main-effect_) Sobol' index $S_m$ defined as follows {cite}`Sobol1993`:

$$
S_m = \frac{\mathbb{V}_{X_m} \left[ \mathbb{E}_{X_{\sim m}}\left[ Y | \boldsymbol{X}_m \right]\right]}{\mathbb{V}[Y]}.
$$

This index indicates the importance of a particular input variable on the output variance. These indices are aligned
with the aforementioned _factor prioritization_ goal of sensitivity analysis.

Another sensitivity index of particular importance is the _total-effect_ Sobol' index defined for input variable $m$
below {cite}`Homma1996`:

$$
ST_m = 1 - \frac{\mathbb{V}_{\boldsymbol{X}_{\sim m}}[\mathbb{E}_{X_m}[Y | \boldsymbol{X}_{\sim m}]]}{\mathbb{V}[Y]}.
$$

### Monte-Carlo estimation

```{warning}
A method to estimate the main-effect and total-effect indices via
a Monte-Carlo simulation is implemented here following the most
naive and straightforward approach.
It is only to serve as an illustration.
This implementation is, however, not the state-of-the-art approach to estimate
the indices (see, for instance, {cite}`Saltelli2002, Saltelli2010`).
Please refer to a dedicated sensitivity analysis and uncertainty
quantification package for a proper analysis.
```

The estimation of the Sobol' sensitivity indices as defined
in the above equations can be directly carried out using
a Monte-Carlo simulation.
The most straightforward, though rather naive and computationally expensive,
method is to use a nested loop for the
computation of the conditional variances and expectations appearing
in both indices.

For instance, in the estimation of the first-order index of, say,
input variable $x_m$, the outer loop samples values of $X_m$
while the inner loop samples values of $\boldsymbol{X}_{\sim m}$
(i.e., all input variables except $x_m$).
The cost of the analysis in terms of the model evaluations for estimating
the first-order index for _each input variable_ is $N^2$ where $N$
is the Monte-Carlo sample size.
It is expected that size of $N$ is between $10^3$ and $10^6$.

{prf:ref}`Brute Force MC First-Order` below illustrates
the procedure to compute main-effect Sobol' indices.

```{prf:algorithm} Brute force MC for estimating all $S_m$
:label: Brute Force MC First-Order

**Inputs** A computational model $\mathcal{M}$, random input variables $\boldsymbol{X} = \{ X_1, \ldots, X_M \}$, number of MC sample points $N$

**Output** First-order Sobol' sensitivity indices $S_m$ for $m = 1, \ldots, M$

For $m = 1$ to $M$:

1. $\Sigma_i \leftarrow 0$
2. $\Sigma_i^2 \leftarrow 0$
3. For $i = 1$ to $N$:

   1. Sample $x_m^{(i)}$ from $X_m$
   2. $\Sigma_j \leftarrow 0$
   3. For $j = 1$ to $N$:

      1. Sample $\boldsymbol{x}_{\sim m}^{(j)}$ from $\boldsymbol{X}_{\sim m}$
      2. $\Sigma_j \leftarrow \Sigma_j + \mathcal{M}(x_m^{(j)}, \boldsymbol{x}_{\sim m}^{(j)})$

   4. $\mathbb{E}_{\boldsymbol{X}_{\sim m}}\left[ Y | X_m \right]^{(i)} \leftarrow \frac{1}{N} \Sigma_j$
   5. $\Sigma_i \leftarrow \Sigma_i + \mathbb{E}_{\boldsymbol{X}_{\sim m}}\left[ Y | X_m \right]^{(i)}$
   6. $\Sigma_{i^2} \leftarrow \Sigma_{i^2} + \left( \mathbb{E}_{\boldsymbol{X}_{\sim m}}\left[ Y | X_m \right]^{(i)} \right)^2$
4. $\mathbb{V}_{X_m} \left[ \mathbb{E}_{\boldsymbol{X}_{\sim m}}\left[ Y | X_m \right]\right] \leftarrow \frac{1}{N} \Sigma_{i^2} -
\left( \frac{1}{N} \Sigma_{i} \right)^2$
5. $S_m \leftarrow \frac{\mathbb{V}_{X_m} \left[ \mathbb{E}_{\boldsymbol{X}_{\sim m}}\left[ Y | X_m \right]\right]}{\mathbb{V}[Y]}$
```

The output variance $\mathbb{V}[Y]$ used in the above algorithm can be computed following {prf:ref}`Brute Force Output Variance`.

```{prf:algorithm} Brute force MC for estimating output variance $\mathbb{V}[Y]$
:label: Brute Force Output Variance

**Inputs** A computational model $\mathcal{M}$, random input variables $\boldsymbol{X}$, number of MC sample points $N$

**Output** Output variance $\mathbb{V}[Y]$

1. $\Sigma_i \leftarrow 0$
2. $\Sigma_i^2 \leftarrow 0$
3. For $i = 1$ to $N$:

   1. Sample $\boldsymbol{x}^{(i)}$ from $\boldsymbol{X}$
   2. $\Sigma_i \leftarrow \Sigma_i + \mathcal{M}(\boldsymbol{x}^{(i)})$
   3. $\Sigma_{i^2} \leftarrow \Sigma_{i^2} + \left( \mathcal{M}(\boldsymbol{x}^{(i)} \right)^2$

4. $\mathbb{V}[Y] \leftarrow \frac{1}{N} \Sigma_{i^2} - \left( \frac{1}{N} \Sigma_i \right)^2$
```

Similar Monte-Carlo algorithm can be devised to compute
the total-effect Sobol' indices
as shown in {prf:ref}`Brute Force MC Total-Effect`.

```{prf:algorithm} Brute force MC for estimating all $ST_m$
:label: Brute Force MC Total-Effect

**Inputs** A computational model $\mathcal{M}$, random input variables $\boldsymbol{X} = \{ X_1, \ldots, X_M \}$, number of MC sample points $N$

**Output** First-order Sobol' sensitivity indices $S_m$ for $m = 1, \ldots, M$

For $m = 1$ to $M$:

1. $\Sigma_i \leftarrow 0$
2. $\Sigma_i^2 \leftarrow 0$
3. For $i = 1$ to $N$:

   1. Sample $\boldsymbol{x}_{\sim m}^{(i)}$ from $\boldsymbol{X}_{\sim m}$
   2. $\Sigma_j \leftarrow 0$
   3. For $j = 1$ to $N$:

      1. Sample $x_{m}^{(j)}$ from $X_m$
      2. $\Sigma_j \leftarrow \Sigma_j + \mathcal{M}(x_m^{(j)}, \boldsymbol{x}_{\sim m}^{(j)})$

   4. $\mathbb{E}_{X_m}\left[ Y | \boldsymbol{X}_{\sim m} \right]^{(i)} \leftarrow \frac{1}{N} \Sigma_j$
   5. $\Sigma_i \leftarrow \Sigma_i + \mathbb{E}_{X_m}\left[ Y | \boldsymbol{X}_{\sim m} \right]^{(i)}$
   6. $\Sigma_{i^2} \leftarrow \Sigma_{i^2} + \left( \mathbb{E}_{X_m}\left[ Y | \boldsymbol{X}_{\sim m} \right]^{(i)} \right)^2$
4. $\mathbb{V}_{\boldsymbol{X}_{\sim m}} \left[ \mathbb{E}_{X_m}\left[ Y | \boldsymbol{X}_{\sim m} \right]\right] \leftarrow \frac{1}{N} \Sigma_{i^2} -
\left( \frac{1}{N} \Sigma_{i} \right)^2$
5. $ST_m \leftarrow 1 - \frac{\mathbb{V}_{\boldsymbol{X}_{\sim m}} \left[ \mathbb{E}_{X_m}\left[ Y | \boldsymbol{X}_{\sim m} \right]\right]}{\mathbb{V}[Y]}$
```

These algorithms are implemented in a Python function that returns
the main-effect and total-effect Sobol' indices
of all the input variables of a computational model.
The function assumes that a probabilistic input model of the computational
model has been defined such that sample points may be generated from them.

```{note}
And indeed, test functions included in UQTestFuns are all given with the
corresponding probabilistic input model according to the literature.
```

```{code-cell} ipython3
:tags: [hide-input]

def estimate_sobol_indices(my_func, prob_input, num_sample):
    """Estimate the first-order and total-effect Sobol' indices via MC.

    Parameters
    ----------
    my_func
        The function (or computational model) to analyze.
    prob_input
        The probabilistic input model of the function.
    num_sample
        The Monte-Carlo sample size.

    Returns
    -------
    A tuple of NumPy array: first-order and total-effect Sobol' indices each
    has a length of the number of input variables.
    """

    # --- Compute output variance
    xx = prob_input.get_sample(num_sample)
    yy = my_func(xx)
    var_yy = np.var(yy)

    num_dim = prob_input.spatial_dimension

    # --- Compute first-order Sobol' indices
    first_order = np.zeros(num_dim)
    for m in range(num_dim):
        xx_m = prob_input.marginals[m].get_sample(num_sample)
        exp_nm = np.zeros(num_sample)
        for i in range(num_sample):
            xx = prob_input.get_sample(num_sample)
            # Replace the m-th column
            xx[:, m] = xx_m[i]
            yy = my_func(xx)
            exp_nm[i] = np.mean(yy)
        var_m = np.var(exp_nm)
        first_order[m] = var_m / var_yy

    # --- Compute total-effect Sobol' indices
    total_effect = np.zeros(num_dim)
    for m in range(num_dim):
        xx = prob_input.get_sample(num_sample)
        exp_m = np.zeros(num_sample)
        for i in range(num_sample):
            xx_m = np.repeat(xx[i:i+1], num_sample, axis=0)
            xx_m[:, m] = prob_input.marginals[m].get_sample(num_sample)
            yy = my_func(xx_m)
            exp_m[i] = np.mean(yy)
        var_nm = np.var(exp_m)
        total_effect[m] = 1 - var_nm / var_yy

    return first_order, total_effect
```

## Ishigami function

To test the implemented algorithm above,
we choose the popular Ishigami function {cite}`Ishigami1991` whose
analytical values for the sensitivity indices are known.
The function is highly non-linear and non-monotonous and given as follows:

$$
\mathcal{M}(\boldsymbol{x}) = \sin(x_1) + a \sin^2(x_2) + b \, x_3^4 \sin(x_1)
$$
where $\boldsymbol{x} = \{ x_1, x_2, x_3 \}$ is the three-dimensional vector of
input variables further defined in the table below,
and $a$ and $b$ are parameters of the function.

To create an instance of the Ishigami function:

```{code-cell} ipython3
ishigami = uqtf.Ishigami()
```

The input variables of the function are probabilistically defined according
to the table below.

```{code-cell} ipython3
ishigami.prob_input
```

Finally, the default values for the parameters $a$ and $b$ are:

```{code-cell} ipython3
ishigami.parameters
```

For reproducibility of this tutorial, set the seed number for the pseudo-random
generator attached to the probabilistic input model:

```{code-cell} ipython3
ishigami.prob_input.reset_rng(452397)
```

The variance of the Ishigami function can be analytically derived
and it is a function of the parameters:

$$
\mathbb{V}[Y] = \frac{a^2}{8} + \frac{b \pi^4}{5} + \frac{b^2 \pi^8}{18} + \frac{1}{2}.
$$

The analytical sensitivity indices are also available as shown in the table
below also as functions of the parameters.

| Input variable  |                              $S_m$                              |                                                   $ST_m$                                                    |
|:---------------:|:---------------------------------------------------------------:|:-----------------------------------------------------------------------------------------------------------:|
|       $1$       | $\frac{1}{\mathbb{V}[Y]} \frac{1}{2} (1 + \frac{b \pi^4}{5})^2$ | $\frac{1}{\mathbb{V}[Y]} \left( \frac{1}{2} \, (1 + \frac{b \pi^4}{5})^2 + \frac{8 b^2 \pi^8}{225} \right)$ |
|       $2$       |             $\frac{1}{\mathbb{V}[Y]} \frac{a^2}{8}$             |                                        $\frac{a^2}{8 \mathbb{V}[Y]}$                                        |
|       $3$       |                              $0.0$                              |                                   $\frac{8 b^2 \pi^8}{225 \mathbb{V}[Y]}$                                   |

Notice that while $X_3$ does not directly influence the output variance
by itself (it's main-effect index is zero),
it does influence the output variance via interaction with $X_1$.
Furthermore, $X_2$ has no interaction effect whatsoever
as its main-effect and total-effect indices are the same.

For later comparison, we define a Python function that returns
the analytical values of the Sobol' indices of the Ishigami function.

```{code-cell} ipython3
:tags: [hide-input]

def compute_sobol_indices(a, b):
    """Compute the analytical Sobol' indices for the Ishigami function."""

    # --- Compute the variance
    var_y = a**2 / 8 + b * np.pi**4 / 5 + b**2 * np.pi**8 / 18 + 1 / 2

    # --- Compute the first-order Sobol' indices
    first_order = np.zeros(3)
    first_order[0] = (1 + b * np.pi**4 / 5)**2 / 2
    first_order[1] = a**2 / 8
    first_order[2] = 0

    # --- Compute the total-effect Sobol' indices
    total_effect = np.zeros(3)
    total_effect[2] = 8 * b**2 * np.pi**8 / 225
    total_effect[1] = first_order[1]
    total_effect[0] = first_order[0] + total_effect[2]

    return first_order / var_y, total_effect / var_y
```

## Sobol' indices estimation

To observe the convergence of the estimation procedure implemented above,
several Monte-Carlo sample sizes are used:

```{code-cell} ipython3
sample_sizes = np.arange(0, 3500, 500)[1:]
first_order_indices = np.zeros((len(sample_sizes), ishigami.spatial_dimension))
total_effect_indices = np.zeros((len(sample_sizes), ishigami.spatial_dimension))

for i, sample_size in enumerate(sample_sizes):
  first_order_indices[i, :], total_effect_indices[i, :] = estimate_sobol_indices(
      ishigami, ishigami.prob_input, sample_size
  )
```

Compute the analytical values for the given parameters:

```{code-cell} ipython3
first_order_ref, total_effect_ref = compute_sobol_indices(*ishigami.parameters)
```

The estimated indices as a function of sample size is plotted below;
the estimated values are in solid lines while the analytical values are in
dashed lines.

```{code-cell} ipython3
:tags: [hide-input]

fig, axs = plt.subplots(1, 2, figsize=(10, 5))

axs[0].plot(sample_sizes, first_order_indices[:, 0], color="#e41a1c")
axs[0].plot(sample_sizes, first_order_indices[:, 1], color="#377eb8")
axs[0].plot(sample_sizes, first_order_indices[:, 2], color="#4daf4a")

axs[0].axhline(first_order_ref[0], linestyle="--", color="#e41a1c")
axs[0].axhline(first_order_ref[1], linestyle="--", color="#377eb8")
axs[0].axhline(first_order_ref[2], linestyle="--", color="#4daf4a")

axs[0].set_xscale("log")
axs[0].set_ylim([-0.1, 1])
axs[0].set_title("First-order Sobol' indices")
axs[0].set_xlabel("MC sample size", fontsize=14)
axs[0].set_ylabel("Sensivity index", fontsize=14)

axs[1].plot(sample_sizes, total_effect_indices[:, 0], color="#e41a1c", label=r"$x_1$")
axs[1].plot(sample_sizes, total_effect_indices[:, 1], color="#377eb8", label=r"$x_2$")
axs[1].plot(sample_sizes, total_effect_indices[:, 2], color="#4daf4a", label=r"$x_3$")

axs[1].axhline(total_effect_ref[0], linestyle="--", color="#e41a1c")
axs[1].axhline(total_effect_ref[1], linestyle="--", color="#377eb8")
axs[1].axhline(total_effect_ref[2], linestyle="--", color="#4daf4a")

axs[1].set_xscale("log")
axs[1].set_ylim([-0.1, 1])
axs[1].set_title("Total-effect Sobol' indices")
axs[1].set_xlabel("MC sample size", fontsize=14)
axs[1].legend()

fig.tight_layout(pad=3.0)
plt.gcf().set_dpi(150);
```

The implemented method seems to estimate the indices relatively well;
increasing the Monte-Carlo sample size would improve the accuracy of
the estimates but with a high computational cost.

The challenge for a sensitivity analysis method is to ascertain the importance
(or non-importance) of input variables either qualitatively or quantitatively
with as few computational model evaluations as possible.

## References

```{bibliography}
:style: unsrtalpha
:filter: docname in docnames
```

repository: damar-wicaksono/uqtestfuns

branch_name: refs/heads/dev

gha_language: Python

repo_name: damar-wicaksono/uqtestfuns


text:
#Exercises

###Math
1. Using the Math library (where applicable), calculate the real roots to the Quadratic equation Ax^2+Bx+C=0.
(Hint: use the [quadratic formula](http://www.purplemath.com/modules/quadform.htm))

###Characters
1. Try printing "Hello World!" out to the console without using any character or string variables. (Hint: Take a look at the ascii table)

###If statement
1. Write a program to determine if a number is an even or an odd number.
2. Write a program that allows the user to enter an age and outputs whether the user is old enough to drive. Sanitize your input by displaying an error if the user enters an invalid age (such as -1).
3. Sanitizing you input is important. This means making sure that what the user enters is something that you can actually use. When we used the `Math.sqrt(double a, double b)` in the first Math exercise problem. Sometimes it returns `NaN` (Not number). Use `if` statements to prevent this from happening. Display an error if the user enters numbers that could cause this to happen. Hint `Math.sqrt(double a, double b)` returns `NaN` if the result of its calculation is negative.

path: /Module 2/ReadMe.md


text:
---
title: Confluence
aka:
  - The Water Song
source: (c) Michael Shewmaker 2010-2017
description: |
Michael Shewmaker notes: "The part of the river I’m singing about is right at the confluence of the Mississippi and Minnesota Rivers.  Everything is within walking distance of Pike Island.  If your going to read all the nonsense I write here, then I suggest pulling up a map... More annotations (including suggestions for which of these many verses to sing together) are posted [here](https://docs.google.com/document/d/1jWSeCVxlZIrGmMTL0ZfdXXdabHC6ncYgf_o9CfEswFs/edit)"
---

Some claim that we are land-locked here
**Water, boys, water**
But I don't find that quite so clear
**All around us water**
For nearly two blocks from my home
The Mississippi southward roams
**Flowing to the sea**
**Flowing to the sea**
**Flowing to the sea**

Lock Number One’s not very large
it only holds one tug, one barge
but nine miles in St. Paul’s heart
that’s where the heavy traffic starts

Along the banks by Crosby Lake
The barred owl’s caltl you can’t mistake
“who cooks for you” he’d like to know
while you watch his river go

Below the dam the waters dance
and wandering lovers seek romance
they’re searching for a love that lasts
where troubled waters roll by fast

In winter walk behind the falls
For when it cold the water stalls.
Beneath that glowing frozen sheet,
we watch as solid water keeps

The solstice rains have soaked the ground
And straight-line winds blow tall trees down
We sing from mem’ry in the dark
And watch the streets for Noah’s Ark

Now we can come to this old bar
and sing of waters near and far
But while you stand and drink your beer
Please recall there’s water here.

Now we drink in this old bar
and sing of waters near and far
but I intend to launch a craft
a boat, canoe, a well build raft {and go}

Half my or more I’ll spend
Living in this river bend
but for a season I would roam
past other places I’ve called home {while}

To Lake Itasca’s shores I go
to dream upon that rivers flow
past bridges, and farms, and city scenes
St. Louis, Memphis, New Orleans

A two-barge tow glides through the night
Its guide-light sweeps our picnic site
and for a mesmerizing beat
it comes ashore right at our feet, and keeps

Our first evening here at Mac
We walked summit to the gorge and back
Now most those friends live far away
And I see the river every day

repository: boxfoot/shanties

gha_language: JavaScript

repo_name: boxfoot/shanties


text:
# slk

Command-line power tool for [slack](https://slack.com).

## Building and Installing

```shell
npm install -g slk
```
##  Usage: slk [options] [command]

### Commands:

*listen <channel>* listen to a channel
*post <channel> <username> <message>* post to a channel

### Options:

*-h, --help*           output usage information
*-t, --token <token>*  set the authentication token

## Getting a token from [slack](https://slack.com/)

repository: roylines/slk

repo_name: roylines/slk


text:
Releases can be found on [npm](https://www.npmjs.com/package/css-layout).

#Release Process

```bash
# Ensure that the local codebase is up to date
git fetch upstream master && git checkout FETCH_HEAD

# build the latest version of the library
grunt

# increment the version number and tag the release
npm version [<newversion> | major | minor | patch | premajor | preminor | prepatch | prerelease]

# push the the commit and tag back to upstream
git push --tags upstream HEAD:master

# publish this new version to npm
npm publish
```

repository: jordwalke/css-layout

repo_name: jordwalke/css-layout


text:
# JavaScript_Basics

__Codes for learn basic concept of JavaScript language.__

- For reference use [JavaScript Reference](https://github.com/arpitkekri/JavaScript_Basics/blob/master/JavaScript%20Reference.pdf)
- You do not have to write the code just play with already written code and see output

## How to Use?
1. Just clone the repository in your local system.
2. Then open **```index.html```** file in browser.
3. Right click -> inspect Element or use command **```ctrl + shift + I```**.
4. Click on **```console```** and you are able to see all output of the codes written.
5. Feel free to play around code in **```JavaScript```** files.

## Topics covered
1. Variables

2. Datatypes

3. Variable Hoisting and Printing [[Read more]](https://scotch.io/tutorials/understanding-hoisting-in-javascript)

4. Conditional Statements & Comparison Operators
    - [Reading 1](https://www.codementor.io/@thinker3197/avoid-common-pitfalls-in-javascript-u0hzz2nfw)
    - [Reading 2](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Equality_comparisons_and_sameness)

5. switch ... case

6. Loops

7. Functions [[Arrow functions]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Functions/Arrow_functions)

8. Arrays and Array Methods [[Array]](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array)

9. Objects

10. Destructuring

## Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.

Please make sure to update tests as appropriate.

## License
[MIT](https://choosealicense.com/licenses/mit/)


text:
# SSH

## Chain

local --> host1 --> host2

```
host1:$ ssh -ND port host2
local:$ ssh -NL port:localhost:port host1
```

## Spawn & Expect

```
#!/usr/bin/expect -f
spawn ssh usr@ip
expect "*assword"
send "password\r"
interact
```

license: Unlicense

repository: taulk/tips

repo_name: taulk/tips


text:
## Test environments
* local macOS / OS X install, R 3.4.1
* ubuntu 12.04 (on travis-ci), R 3.4.2
* win-builder (devel and release)

## R CMD check results
There were 0 ERRORs.

There were 0 WARNINGs.

There were 1 NOTEs.

Note:
Maintainer: 'David Benkeser<EMAIL_ADDRESS>
Seems safe to ignore this note.

## Downstream dependencies
Nothing to report.

## Additional Notes
Submission of updated package, version 1.0.2. This version also
corrects the no long double build issue that caused the package
to be archived.


text:
# build

Spaceship build involves baking various tools into a machine image.

## How it works?

1. Using packer, a server is launched with a basic version of ubuntu
(default) machine image.
2. Using packer's puppet-masterless provisioner, the server is provisioned
with a few tools. By default, `ntp`, `git`, `unzip`, `htop`, `ncdu`,
`terraform` and `terragrunt` are installed.
3. Once provisioned, packer creates a machine image of the machine and
terminates the server. Packer returns a machine image ID.

## Setup

* __Install [Packer](https://www.packer.io/downloads.html)__

* __Specifying image details__: Copy
[variables.json.sample](variables.json.sample) to `variables.json` and
edit as per the requirements. Read [Packer Amazon AMI
Builder](https://www.packer.io/docs/builders/amazon.html) to learn how to
use environment variables and aws-cli tools.

* Edit terraform and terragrunt download links in
[manifests/hieradata/common.yaml](manifests/hieradata/common.yaml) to install
the latest version of the tools.

* __Install puppet modules__: Packer uploads puppet modules from local to
remote machine. This requires installation of puppet modules before running
packer. Spaceship uses [librarian-puppet](http://librarian-puppet.com/) to
install puppet dependencies. Install librarian puppet and then run
`librarian-puppet install` in [manifests/](manifests/) directory. This would
install the puppet dependencies in `manifests/modules/` directory.

## Running

Run packer with `packer build -var-file=variables.json basebox-aws.json`.

repository: darkowlzz/spaceship

gha_language: Shell

repo_name: darkowlzz/spaceship


text:
USER STORIES

1. As the proprietor of this website, I want it to be visually appealing
2. As the proprietor of this website, I want my products presented in a way that will excite customers into buying them.
3. As the proprietor of this website, I want to make sure that my site's scripts work perfectly every time.
3. As a user, I want the site to work seamlessly without crashing.
4. As a user, I want to understand the company's purpose in presenting me with this website.
5. As a developer, I want to make sure that each image that appears has an event listener for clicks which logs all relevant information.
6. As a developer, I need to keep my functions separate and clean for readability.
7. As a developer, I want to user object-literal notation to enter my images and their properties into my JS.
8. As a market researcher, I want to log 25 votes by the user.
9. As a market researcher, I don't want the same image shown to the user twice in a row.
10. As a market researcher, I would like the three images to all appear the same size to the user so as not to bias them.

repository: nathancmoore/bus-mall

repo_name: nathancmoore/bus-mall


text:
P_MUL - A Reliable Multicast Transfer Protocol
==============================================

P_MUL is an application protocol based on UDP/IP which implements the reliable transfer
of bulk data over a multicast capable IP network. It is based on the IETF draft specification
described in https://tools.ietf.org/html/draft-riechmann-multicast-mail-00.

Usage
-----

```python
import pmul
import asyncio

class ClientProtocol(pmul.PmulProtocol):
    def __init__(self, conf):
        self.__conf = conf

    def connection_made(self, transport):
        self.transport = transport
        print('P_MUL protocol is ready')

    def data_received(self, data, addr):
        print("Received data from {}".format(addr))

    def delivery_completed(self, msid, delivery_status, ack_status):
        print('Delivery of Message-ID {} finished with {} {}'.format(msid, delivery_status, ack_status))

    async def sendto(self, dest, msglen):
        message = 'a';
        for i in range(0,msglen):
            message += 'a'
        bulk_data = message.encode("ascii")
        await self.transport.sendto(bulk_data, [dest])
        print("Finished delivery of message of len {}".format(msglen))

loop = asyncio.get_event_loop()
conf = pmul.conf_init()
coro = pmul.create_pmul_endpoint(ClientProtocol, loop, conf);
protocol, transport = loop.run_until_complete(coro)
loop.run_until_complete(protocol.sendto("<IP_ADDRESS>", 5000))
loop.close()
```

Further examples can be found in the examples/ directory.

Feature-Set
-----------

This implementation includes the following improvements compared to the original specification:

- Window-based Congestion Control

- Dynamic Adaptation of Protocol Timers

### Window-based Congestion Control

Originally P_MUL was designed to operate in broadcast networks with static transmission rates.
In modern multhop MANET networks the available bandwidth is changing often. Thus a communication protocol must be able to adapt its sending rate to the current available bandwitdh.

To support such modern networks P_MUL was extended to support a simple method to adapt its sending rate to the available bandwidth. In detail the receiver of a message reports the air datarate to the sender
using the ACK-PDU. The sender then can change its sending rate based on the reported Air datarates of all receivers.

This method has some drawbacks. Since the sender gets the information about the air datarate not until
it had sent all fragments of the message it can react to changing channel conditions very late.
This often results packet loss due to buffer overflow. To improve this mechanism a window based
transmission method similar to TCP is implemented.

In general a message of bulk data is fragmented into a list of smaller MTU-sized fragments.
Normally P_MUL would send all fragments in a continuous transmission phase waiting for the
ACK-PDUs of all receivers. In the improved version the sender will not send all fragments
at once but only a small window of fragments allowing the receivers to respond with ACK-PDUs
more early. After sending a window of fragments the size of the window is dynamically
adjusted based on the channel quality.

### Dynamic Adapation of Protocol timers

There are two important protocol timers which influences the performance of the message transfer.
* Retransmission timer
* Last PDU Timer

The Retransmission timer is used by the sender to trigger the retransmission of un-acked Data PDUs.
If this timer is calculated too small unneccessary Data PDUs will be sent. If it is too high
the sender will wait too long to retransmit unreceived Data-PDUs. To optimize the performance
the Retransmission timer is calculated dynamically based on the transmission window size and
the current available air datarate.

The Last PDU timer triggers the sending of an ACK-PDU at the receiver of a message. This timer
is also adjusted dynamically based on the current air datarate and the remaining fragments of
the transmission window.

TODOs
-----
* Dynamic adjustment of fragment size based on channel conditions
* Expiration timer for garbage collection
* FEC to improve robustness

repository: baessler/pmul

repo_name: baessler/pmul


text:
Symfony Standard Edition
========================

Welcome to the Symfony Standard Edition - a fully-functional Symfony
application that you can use as the skeleton for your new applications.

For details on how to download and get started with Symfony, see the
[Installation][1] chapter of the Symfony Documentation.

What's inside?
--------------

The Symfony Standard Edition is configured with the following defaults:

  * An AppBundle you can use to start coding;

  * Twig as the only configured template engine;

  * Doctrine ORM/DBAL;

  * Swiftmailer;

  * Annotations enabled for everything.

It comes pre-configured with the following bundles:

  * **FrameworkBundle** - The core Symfony framework bundle

  * [**SensioFrameworkExtraBundle**][6] - Adds several enhancements, including
    template and routing annotation capability

  * [**DoctrineBundle**][7] - Adds support for the Doctrine ORM

  * [**TwigBundle**][8] - Adds support for the Twig templating engine

  * [**SecurityBundle**][9] - Adds security by integrating Symfony's security
    component

  * [**SwiftmailerBundle**][10] - Adds support for Swiftmailer, a library for
    sending emails

  * [**MonologBundle**][11] - Adds support for Monolog, a logging library

  * **WebProfilerBundle** (in dev/test env) - Adds profiling functionality and
    the web debug toolbar

  * **SensioDistributionBundle** (in dev/test env) - Adds functionality for
    configuring and working with Symfony distributions

  * [**SensioGeneratorBundle**][13] (in dev/test env) - Adds code generation
    capabilities

  * **DebugBundle** (in dev/test env) - Adds Debug and VarDumper component
    integration

All libraries and bundles included in the Symfony Standard Edition are
released under the MIT or BSD license.

Enjoy!

[1]:  https://symfony.com/doc/2.8/book/installation.html
[6]:  https://symfony.com/doc/current/bundles/SensioFrameworkExtraBundle/index.html
[7]:  https://symfony.com/doc/2.8/book/doctrine.html
[8]:  https://symfony.com/doc/2.8/book/templating.html
[9]:  https://symfony.com/doc/2.8/book/security.html
[10]: https://symfony.com/doc/2.8/cookbook/email.html
[11]: https://symfony.com/doc/2.8/cookbook/logging/monolog.html
[13]: https://symfony.com/doc/2.8/bundles/SensioGeneratorBundle/index.html

### INFORMATION TO USE
1. Page creation : http://symfony.com/doc/2.8/page_creation.html
2. Set up the application : https://symfony.com/doc/2.8/setup.html
3. Other useful settings : http://symfony.com/legacy/doc/jobeet/1_4/ru/01?orm=Doctrine

### Getting started

1. Download hello world distribution (symfony-standard) from github.
2. Installing via composer:
~~~
composer install
~~~
3. Open url, see the result.
4. Open /config.php (http://symfony-local.loc/config.php) to see recommendation from symfony configuration.
5. Press (Re-check configuration) to see the result of settings.
6. To install PHP Accelerator you should download it from http://pecl.php.net/package/APCu/4.0.8/windows
(5.6 Thread Safe (TS) x86) and then open php.ini, add following strings:
~~~
[APCu]
extension=php_apcu.dll
apc.enabled=1
apc.shm_size=32M
apc.ttl=7200
apc.enable_cli=1
apc.serializer=php
~~~
Save the result and restart apache server.

repository: SonicLighter/symfony-local

repo_name: SonicLighter/symfony-local


text:
**Before submitting a pull request,** please make sure the following is done:

1. Fork the repository and create your branch from `develop`.
2. Run `npm i` in the repository root.
3. If you've fixed a bug or added code that should be tested, would be great if you add tests!
4. Ensure the test suite passes (`npm test`). Tip: `npm test --watch TestName` is helpful in development.
5. Format your code with [prettier](https://github.com/prettier/prettier).
6. Make sure your code lints (`npm run dev:lint`).

repository: radum/webapp-boilerplate

branch_name: refs/heads/develop

gha_language: CSS

repo_name: radum/webapp-boilerplate


text:
# PwshJSONtoPList - ConvertTo-PList

Convert a PowerShell object to an XML PList.

Originally intended for the conversion of JSON based tmLanguage grammar definitions to the formal tmLanguage PLIST format.

Example based on JSON tmLanguage file.

```PowerShell
Get-Content "powershell.tmlanguage.json" | ConvertFrom-Json |
    ConvertTo-Plist -Indent "`t" -StateEncodingAs 'UTF-8' |
    Set-Content 'out\PowerShellSyntax.tmLanguage' -Encoding 'UTF8'
```

```PowerShell
$grammar_json = Get-Content "powershell.tmlanguage.json" | ConvertFrom-Json
ConvertTo-Plist $grammar_json -Indent "`t" -StateEncodingAs 'UTF-8' |
    Set-Content 'out\PowerShellSyntax.tmLanguage' -Encoding 'UTF8'
```

```PowerShell
[xml]$grammar_xml = Get-Content "powershell.tmlanguage.json" | ConvertFrom-Json |
    ConvertTo-Plist -Indent "`t" -StateEncodingAs $null
```

### Parameters

#### PropertyList

The PowerShell object which possesses the items for the PLIST.  This can be any object that can be represented as a PSCustomObject.  This parameter may be received from the pipeline.

#### Compress

Omits white space and indented formatting in the output string.  Ignores all further indenting and formatting related parameters.

#### Indent

Specifies the indentation to use when generating the XML output.  The default is ```"`t"``` (tab), but other usual options are `''` (none), `'    '` (4 spaces), but otherwise any string is accepted, and no escaping is performed.

#### StateEncodingAs

Specifies the encoding to state in the XML header.  This does not actually set the encoding as this function does not directly produce encoded output.  See the examples above.  The default is 'UTF-8'.  Specify `$null` to remove the `encoding` attribute from the header.

#### Depth

Specifies the maximum depth of recursion permitted for the input property list object.

#### IndentFirstItem

A switch that specifies that the first item level of the PLIST XML is to be indented.  Most PLIST files do not have the first item level indented, but a formal XML writer would normally do this.

#### EnumsAsStrings

A switch that specifies an alternate serialization option that converts all enumerations to their string representations.

#### FormatDataInlineMaxLength

Maximum encoded `<data>` length for keeping value inline, if unspecified, all data will be nested and wrapped, if 0, all data will be inline.

#### FormatDataWrapMaxLength

Maximum encoded `<data>` length for each nested wrapped line once exceeding FormatDataInlineMaxLength, or 0 for all data to be on a single nested line.

#### FormatDataWrappedNoIndent

A switch to prevent the indenting of `<data>` content when nested/wrapped on separate lines.

### Output

The output of this function is a single string (`[string]`).  Use Out-File or Set-Content and be sure to assign the correct encoding.  You may also use the `[xml]` accelerator when assigning the output to a variable, and then use XML cmdlets or tools on the result.

Note:
- Escapes only '<', '&' and '>'.
- The PList XML generator should be complete, with regard to item data type handling.

repository: msftrncs/PwshJSONtoPList

gha_language: PowerShell

repo_name: msftrncs/PwshJSONtoPList


text:
---
services: active-directory
platforms: java
author: brandwe
---

# Integrating Azure AD into a Java command line using username and password

This sample demonstrates a command line application calling a web API that is secured using Azure AD. The Java application uses the Active Directory Authentication Library for Java (ADAL4J) to obtain a JWT access token through the OAuth 2.0 protocol. The access token is sent to the web API to authenticate the user. This sample shows you how to use ADAL to authenticate users via raw credentials (username and password) via a text-only interface.

## Quick Start

Getting started with the sample is easy. It is configured to run out of the box with minimal setup.

### Step 1: Register an Azure AD Tenant

To use this sample you will need a Azure Active Directory Tenant. If you're not sure what a tenant is or how you would get one, read [What is an Azure AD tenant](http://technet.microsoft.com/library/jj573650.aspx)? or [Sign up for Azure as an organization](http://azure.microsoft.com/documentation/articles/sign-up-organization/). These docs should get you started on your way to using Azure AD.

### Step 2: Download Java (7 and above) for your platform

To successfully use this sample, you need a working installation of [Java](http://www.oracle.com/technetwork/java/javase/downloads/index.html) and [Maven](https://maven.apache.org).

### Step 3: Download the Sample application and modules

Next, clone the sample repo and install the project's dependencies.

From your shell or command line:

* `$ git clone https://github.com/Azure-Samples/active-directory-java-native-headless.git`
* `$ cd active-directory-java-native-headless`

### Step 4: Register the GraphClient app

* Sign in to the Azure management portal.
* Click on Active Directory in the left hand nav.
* Click the directory tenant where you wish to register the sample application.
* Click the Applications tab.
* In the drawer, click Add.
* Click "Add an application my organization is developing".
* Enter a friendly name for the application, for example "GraphAPI-Headless-Java", select "Native Client Application", and click next.
* For the Redirect URI, enter http://GraphClient. Please note that the Redirect URI will not be used in this sample, but it needs to be defined nonetheless. Click finish.
* Click the Configure tab of the application.
* Find the Client ID value and copy it aside, you will need this later when configuring your application.
* In "Permissions to Other Applications", ensure "Windows Azure Active Directory" is selected. Select "Sign in and read user profile" from the "Delegated Permissions" dropdown and ensure it is checked. This will be the permission we'll be using in the sample.

### Step 5: Configure your web app using `PublicClient.java`

Enter the client id value above at the top of the `PublicClient.java` file.

```java
public class PublicClient {

    private final static String AUTHORITY = "https://login.microsoftonline.com/common/";
    private final static String CLIENT_ID = "<your client id>";

```

### Step 6: Package and then run the `public-client-adal4j-sample-jar-with-dependencies.jar ` file.

From your shell or command line:

* `$ mvn package`

This will generate a `public-client-adal4j-sample-jar-with-dependencies.jar` file in your /targets directory.

Your command line interface should prompt you for the username and password and then access the Graph API to retreive your user information.

### Acknowledgements

We would like to acknowledge the folks who own/contribute to the following projects for their support of Azure Active Directory and their libraries that were used to build this sample. In places where we forked these libraries to add additional functionality, we ensured that the chain of forking remains intact so you can navigate back to the original package. Working with such great partners in the open source community clearly illustrates what open collaboration can accomplish. Thank you!


text:
# Monitoring Unhandled Actions

We can know if we have dispatched some actions which haven't been handled by any of the NGXS states. This is useful to monitor if we dispatch actions at the right time. For instance, dispatched actions might be coming from the WebSocket, but the action handler is located within the feature state that has not been registered yet. This will let us know that we should either register the state earlier or do anything else from the code perspective because actions are not being handled.

This may be enabled by importing the `NgxsDevelopmentModule`:

```ts
import { NgxsDevelopmentModule } from '@ngxs/store';

@NgModule({
  imports: [
    NgxsDevelopmentModule.forRoot({
      warnOnUnhandledActions: true
    })
  ]
})
export class AppModule {}
```

Setting `warnOnUnhandledActions` to a truthy value will tell the logger to warn on any unhandled action.

## Ignoring Certain Actions

We can ignore specific actions that should not be logged if they have never been handled. For instance, if we're using the `@ngxs/router-plugin` and don't care about router actions like `RouterNavigation`, then we may add it to the `ignore` array:

```ts
import { NgxsDevelopmentModule } from '@ngxs/store';
import { RouterNavigation, RouterCancel } from '@ngxs/router-plugin';

@NgModule({
  imports: [
    NgxsDevelopmentModule.forRoot({
      warnOnUnhandledActions: {
        ignore: [RouterNavigation, RouterCancel]
      }
    })
  ]
})
export class AppModule {}
```

> 💡 It's best to import this module only in development mode. This may be achieved using environment imports. See [dynamic plugins](../recipes/dynamic-plugins.md).

Ignored actions can be also expanded in lazy modules. The `@ngxs/store` exposes the `NgxsUnhandledActionsLogger` for these purposes:

```ts
import { Injector } from '@angular/core';
import { NgxsUnhandledActionsLogger } from '@ngxs/store';

declare const ngDevMode: boolean;

@NgModule({
  imports: [NgxsModule.forFeature([LazyState])]
})
export class LazyModule {
  constructor(injector: Injector) {
    if (ngDevMode) {
      const unhandledActionsLogger = injector.get(NgxsUnhandledActionsLogger);
      unhandledActionsLogger.ignoreActions(LazyAction);
    }
  }
}
```

The `ngDevMode` is a specific variable provided by Angular in development mode and by Angular CLI (to Terser) in production mode. This allows tree-shaking `NgxsUnhandledActionsLogger` stuff since the `NgxsDevelopmentModule` is imported only in development mode. It's never functional in production mode.

repository: ngxs/store

repo_name: ngxs/store


text:
# A brief explanation of branches, through change propagation.
Copyright 2022,2023 Nvidia Corporation.  All rights reserved.

# master
 This is the upstream - changes are introduced here, and it has some ability to install DUE using the Makefile.
 It has no Debian specific packaging files.
 It also creates the 'upstream tarball' via `make orig.tar`

# debian/master
  This is the top level for Debian packaging, and it does have Debian specific packaging files.
  It is not release specific, but can be used to build DUE as an installable Debian package.
  See GettingStarted.md for directions for generating a tarfile from the `master` branch, and building
  on `debian/master`

  This holds the debian/changelog, and gets updated via 'git merge master'

repository: CumulusNetworks/DUE

repo_name: CumulusNetworks/DUE


text:
# ζημόω, ῶ.

<!-- Status: S3=Needs2ndReview -->
<!-- Lexica used for edits: BDAG, LN, BN, AS  -->

## Word data

* Strongs: G22100.

* Alternate spellings:

* Principle Parts:

* Part of speech:

[Verb](http://ugg.readthedocs.io/en/latest/verb.html).

* Instances in the New Testament: 6.

* All Scriptures cited: Yes.

## Etymology:

[ζημία]

* LXX/Hebrew glosses:

* Time Period/Ancient Authors:

* Related words:

* Antonyms for all senses:

* Synonyms for all senses:

## Senses:

### Sense  1.0:

#### Definition:

Refers to experiencing the loss of something which has previously been in the possession of the owner

#### Glosses:

to suffer loss, forfeit, to lose, to experience loss, experience harm, suffer injury

#### Explanation:

#### Citations:

[Matt 16:26](Mat 16:26), [Mark 8:36](mrk 8:36), [Luke 9:25](luk 9:25), [1Cor 3:15](1Co 3:15), [2Cor 7:9](2co 7:9),[Phil 3:8](php 3:8).

repository: mandolyte/uw-obsidian

repo_name: mandolyte/uw-obsidian


text:
# Classifying Phishing Websties (Tutorial)

The following python script uses a simple 3 layer densely connected neural net in
order to determine if a given url sample is most probably for a phishing site.

The example here is merely just a cool example of how to use a neural net for cool
infosec stuff. As well as a little Neural net "hello world" for keras.

# Training Neural Net

In order to train the neural net all you need to do is run
```
$>./fit_train.py
Using TensorFlow backend.
Epoch 1/800
1353/1353 [==============================] - 0s - loss: 0.4188 - acc: 0.0761
Epoch 2/800
1353/1353 [==============================] - 0s - loss: 0.3700 - acc: 0.0761
Epoch 3/800
1353/1353 [==============================] - 0s - loss: 0.3294 - acc: 0.0761
Epoch 4/800
1353/1353 [==============================] - 0s - loss: 0.3001 - acc: 0.0761
Epoch 5/800
1353/1353 [==============================] - 0s - loss: 0.2792 - acc: 0.0761

```

if done correctly it should produce a set of weights files that look like this:

```
-rw-rw-r-- 1 k3170makan k3170makan 22976 Jul 28 16:42 9-5-1_weights-improvement-119-0.1050.hdf5
-rw-rw-r-- 1 k3170makan k3170makan 22976 Jul 28 16:42 9-5-1_weights-improvement-239-0.0913.hdf5
-rw-rw-r-- 1 k3170makan k3170makan 22976 Jul 28 16:42 9-5-1_weights-improvement-359-0.0860.hdf5
-rw-rw-r-- 1 k3170makan k3170makan 22976 Jul 28 16:42 9-5-1_weights-improvement-479-0.0835.hdf5
-rw-rw-r-- 1 k3170makan k3170makan 22976 Jul 28 16:42 9-5-1_weights-improvement-599-0.0803.hdf5
-rw-rw-r-- 1 k3170makan k3170makan 22976 Jul 28 16:43 9-5-1_weights-improvement-719-0.0791.hdf5

```
# Reading and References
* https://archive.ics.uci.edu/ml/datasets/Website+Phishing


text:
![DIF Logo](https://raw.githubusercontent.com/decentralized-identity/decentralized-identity.github.io/master/images/logo-small.png)

# Universal Resolver Driver: did:btcr

This is a [Universal Resolver](https://github.com/decentralized-identity/universal-resolver/) driver for **did:btcr** identifiers.

## Specifications

* [Decentralized Identifiers](https://w3c-ccg.github.io/did-spec/)
* [BTCR DID Method 0.1](https://w3c-ccg.github.io/didm-btcr)

## Example DIDs

```
did:btcr:xz35-jzv2-qqs2-9wjt
did:btcr:x705-jzv2-qqaz-7vuz
did:btcr:xkrn-xzcr-qqlv-j6sl
```

## Build and Run (Docker)

```
docker build -f ./docker/Dockerfile . -t universalresolver/driver-did-btcr
docker run -p 8080:8080 universalresolver/driver-did-btcr
curl -X GET http://localhost:8080/1.0/identifiers/did:btcr:xz35-jzv2-qqs2-9wjt
```

## Build (native Java)

 1. First, build https://github.com/decentralized-identity/universal-resolver/tree/master/resolver/java
 1. Then, run `mvn clean install`

## Driver Environment Variables

The driver recognizes the following environment variables:

### `uniresolver_driver_did_btcr_bitcoinConnection`

 * Specifies how the driver interacts with the Bitcoin blockchain.
 * Possible values:
   * `bitcoind`: Connects to a [bitcoind](https://bitcoin.org/en/full-node) instance via JSON-RPC
   * `btcd`: Connects to a [btcd](https://github.com/btcsuite/btcd) instance via JSON-RPC
   * `bitcoinj`: Connects to Bitcoin using a local [bitcoinj](https://bitcoinj.github.io/) client
   * `blockcypherapi`: Connects to [BlockCypher's API](https://www.blockcypher.com/dev/bitcoin/)
 * Default value: `blockcypherapi`

### `uniresolver_driver_did_btcr_rpcUrlMainnet`

 * Specifies the JSON-RPC URL of a bitcoind/btcd instance running on Mainnet.
 * Default value: `http://user:pass@localhost:8332/`

### `uniresolver_driver_did_btcr_rpcUrlTestnet`

 * Specifies the JSON-RPC URL of a bitcoind/btcd instance running on Testnet.
 * Default value: `http://user:pass@localhost:18332/`

## Driver Metadata

The driver returns the following metadata in addition to a DID document:

* `fragmentUri`: ...
* `chain`: ...
* `blockHeight`: ...
* `blockIndex`: ...

repository: dr-aryone/universal-resolver

repo_name: dr-aryone/universal-resolver


text:
SpudPermalinks
==============

This project rocks and uses MIT-LICENSE.

Testing
-----------------

Spud uses RSpec for testing. Get the tests running with a few short commands:

1. Create and migrate the databases:

    rake db:create
    rake db:migrate

2. Load the schema in to the test database:

    rake app:db:test:prepare

3. Run the tests with RSpec

    rspec spec

After the tests have completed the current code coverage stats is available by opening ```/coverage/index.html``` in a browser.


text:
# gdx-backend-jglfw
LibGDX GLFW backend using LWJGL3

## Description
This is a copy of the JGLFW LibGDX backend, with changes to support LWJGL3 and other things like sound and HiDPI displays.

## Usage
You can either compile yourself to use it directly, or use something like http://jitpack.io to include this in your Maven/Gradle build

## Changes from original JGLFW LibGDX backend
* Based on LWJGL3
* Sound supported
* HiDPI displays supported
* Custom cursors supported
* Multiple displays supported (TODO)

## License
Apache 2.0 License

repository: Arcnor/gdx-backend-jglfw

repo_name: Arcnor/gdx-backend-jglfw