text:
---
hrs_structure:
  division: '1'
  volume: '4'
  title: '14'
  chapter: 244D
  section: 244D-11
type: hrs_section
tags:
  - Government
menu:
  hrs:
    identifier: HRS_0244D-0011
    parent: HRS0244D
    name: 244D-11 Tax in addition to other taxes
weight: 77065
title: Tax in addition to other taxes
full_title: 244D-11 Tax in addition to other taxes
---
**[§244D-11] Tax in addition to other taxes.** The tax imposed by this chapter shall be in addition to any other tax imposed upon the business of selling liquor or upon any of the transactions, acts, or activities taxed by this chapter. [L Sp 1984 1st, c 1, pt of §2]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
# DynamicIPManager - Private Dynamic IP Management

This is a Python3 (3.3 & 3.4 only) package containing a server and a client app
for managing your own list of workstations and their dynamic IPs.

##Usage Scenario

I wrote this because I mainly work on my laptop which I carry around different places, but need to ssh into many different workstations that have dynamic IP addresses. Some of the workstations are located overseas and are not registered to a domain (mostly home computers), so when the local router receives a new IP from the ISP, I have no immediate access to the workstation. Rather than resorting to a dynamic DNS service, which would require obtaining additional domains, I thought it would be better to use one of my VPS (registered to a domain) as a "yellow pages" server for my remote workstations. My workstations would report to the VPS at regular interval, and the VPS will keep track of the IP addresses of the client workstations. When I need access to a new IP, I would access the VPS to read the new IP information.

```

+-----------------------------------------------------------------------------------------------------------+
|                                                                                |
|                                                                   +--------------------+                  |
|             +---+          request: my name is "workstation 1"    |                    |                  |
|   +---------+   | +---------------------------------------------> |                    |                  |
|   |        ||   |                                                 |                    |                  |
|   |        ||   | <---------------------------------------------+ | +----------------+ |                  |
|   +---------+   |   response: cool, I'm writing down your new IP  | |                | |                  |
|      +--+   +---+                                                 | +----------------+ |                  |
|   workstation 1                                                   |   my hosted VPS    |                  |
|     dynamic IP         +----------------------------------------> |    mydomain.com    |                  |
|   xxx.xxx.xxx.xxx      |   (request sent at interval N secs)      |                    |                  |
|                        |         +------------------------------> |                    |                  |
|                        |         |                                |                    |                  |
|                        |         |                                +-----------+--------+                  |
|             +---+      |         |                                            |                           |
|   +---------+   |      |         |                                         ^  |                           |
|   |        ||   | <----+         |                         request:        |  |  response:                |
|   |        ||   |                |                                 what is |  |    workstation 1's        |
|   +---------+   |                |                         workstation 1's |  |    IP is now:             |
|      +--+   +---+                v                         IP address now? |  |      xxx.xxx.xxx.xxx      |
|   workstation 2                    +---+                                   |  v      updated at hh:mm:ss  |
|     dynamic IP           +---------+   |                                   |                              |
|   xxx.xxx.xxx.xxx        |        ||   |                              +----+-------+                      |
|                          |        ||   |                              |            |                      |
|                          +---------+   |                              |            |                      |
|                             +--+   +---+                              |            |                      |
|                          workstation 3                                +------------+                      |
|                            dynamic IP                                +--------------+                     |
|                          xxx.xxx.xxx.xxx                            +----------------+                    |
|                                                                         my laptop                         |
|                                                                       IP not important                    |
+-----------------------------------------------------------------------------------------------------------+

```

## How to use

The packaged can be `git clone`d or downloaded from pypi via pip3.

```
~$ sudo pip3 install dynipman
```

### Installing on server
```
~$ sudo pip3 install dynipman
~$ dynipman_sd
```
`dynipman_sd` is the server daemon script. This will start the server daemon. The following contents will be created the very first time the server daemon is run:
```
/var/lib/dynipman
      /addressbook.json
      /conf
      /logs.txt
```

After the initial run, `/var/lib/dynipman/conf` should be edited for personal use.
The SHARED_KEY, SERVER, CLIENT, and USE_RSA settings should be edited.
`addressbook.json` is the json file containing all the IP addresses, and the name can be changed in `conf`.
The `conf` file should be copied and used in all the client workstations.

### Installing on client
```
~$ sudo pip3 install dynipman
~$ dynipman_cd
```
`dynipman_cd` is the client daemon script. The first time the client daemon is run, an error will likely be thrown (unless the server daemon was run on the same workstation before).
```
 Connection Error!
   check config at /var/lib/dynipman/conf
   if the config is correct, then the server might be down.
```
Press Ctrl + C to interrupt the daemon, and then copy the `conf` file from the server (or edit the contents so that it is the same as the conf on server)

Now running `dynipman_cd` should be successful:
```
~$ dynipman_cd
2016-mm-dd HH:MM:SS
{'result': 'success', 'data': 'Update saved successfully'}
```

The "yellow pages" can be read by opening up a browser and typing:
```
   http://mydomain.com:7883/
```
The page will display an html page (7883 is the default port number in `conf`)
where you will be able to type in the code (SHARED_KEY in `conf` file) and then press enter to see the list of IPs

If you want, after setting up and confirming connection between server and client, you can register the scripts to be run in the background on startup to make sure these services are always running.

### Using RSA keys

By default, the message that the client sends to the server is encrypted using a symmetrical encryption scheme (AES).

To use asymmetrical encryption (RSA), set the USE_RSA variable in `conf` to True. After this is set to True, RSA keypair will be generated upon executing the scripts (both server and client). Then the server's public key (file name: `server.public`) will need to be copied to `/var/lib/dynipman/` on each client. Conversely, the client's public key (file name: `{CLIENT['name']}.public`) need to be copied to `/var/lib/dynipman/client_keys/` on the server.

When using RSA, the client will fetch a random key upon initial connection. All subsequent messages will be signed with the client's private key, then the entire message is sent encrypted (AES) with the random key. The server will decrypt the message (AES) first with the random key that it issued, and then verify the message with the client's public key.

* However, the message between the browser and the server is not encrypted.

## Dependencies and Requirements

* Server workstation with a known domain
* tornado (pypi: tornado)
* Crypto (pypi: pycrypto)

## License

MIT License

license: MIT

repository: jungkumseok/dynipman

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: jungkumseok/dynipman


text:
# RPbotMINI
A minimalistic Discord bot that let's you speak in character without any prefixes. The bot catches your messages, deletes them, and post their content as your active "speak as" character in the given channel.

The characters are saved in a JSON database. The database saves characters for each guild>channel>user, so you have to have characters with unique names on the same **channel** but not necessarily on the same guild.

You can register a character with the `!register "character name" https://portrait.png #hexcolor` command. **Name** and **portrait** are mandatory fields, **hexcolor** is optional. If you don't put in a colour, the bot will assign one randomly.

The characters are indexed by their name. If you made a mistake or want to update the **portrait or colour** of your character, you can just run the command again and it will overwrite the existing one.

If you want to delete the character (to for example give it another name) you can do so with the `!unregister "character name"` command.

If you want to clear all your characters on the current channel you can use the `!clear` command. If you want to delete all your characters from the whole **guild**, you can use the `!delete` command.

**PLEASE BE AWARE THAT DELETING CHARACTERS IS FINAL! RUNNING `!unregister`, `!clear`, AND `!delete` ALSO REMOVES THE CHARACTERS FROM THE DATABASE!**

You can register multiple characters on one channel (useful for recurring NPCs). You can switch between characters with the `!as "character name"` command.

You can get a list of your characters on the channel with `!list`. You can also request a list of another person's characters with `!list @user`.

You can talk **out of character** with the `!ooc` or just the `!` prefix (for now). Alternatively, you can turn off the in-character speech with `!deactivate`. You can turn it back on with the `!activate` command.

Finally you can speak as a random NPC with this syntax: `!npc NPC_name message` (The `_` characters will be converted to spaces in the NPC's name.)

You can use uploads as well to create handouts. Comments and the file will be sent as separate messages. The file itself won't have a portrait attached but will still have the name and colour of the character.

The bot cleans up after itself, if a command is successful, you should see it disappear. There is some minimal error handling through DMs. DM messages are kept for **one minute** after which they are automatically deleted. If for some reason the messages stick, you can use the `!purge` command in the bot DMs to clear the last 100 messages sent by the bot.

## Installation
- Create a new application on the Discord developer portal https://discord.com/developers/applications
- Add the bot to your guild
- Create a `.env` file and add the following line using your bot token: `DISCORD_TOKEN="your_token"`
- Run `bot.py` :)

repository: davidmelhart/RPbotMINI

branch_name: refs/heads/main

repo_name: davidmelhart/RPbotMINI


text:
# [SourceBin](http://sourcebin.tk/)

SourceBin is an open-source pastebin alternative written in node.js, which can used in private networks.
You can share texts inside the company in very easy and secure way. SourceBin is very lightweight and easy to install
on any platform. It doesn't require too much resources and it just works. You can also share texts that encrypted with a key
and you can set an expiration time to your pastes.

## Features
1. Encryption : Encrypt your texts by using an encryption algorithm and share your sources in a secure way.
2. Expiration : Your texts will disappear and removed when expired.
3. Syntax Highlighting: (On-Development)

## CLI Tool

It's easy to share files that are located in your linux file system by using a command line utility called sourcebin-client. For example when you want to share a file you can run this command:
```
cat /path/to/file.txt | sourcebin
cat /path/to/file.txt | sourcebin --secret <my-secret-here> --expiration <year|month|day|hour|minute>
```

You can download and install this cli tool in [this repo](https://github.com/tahtaciburak/sourcebin-client).

## Installation

This application created with basically nodejs and mysql so you can run this codebase which platform do you want. All development and deployment stages tested on Ubuntu 18.04 and MacOS X. We provide a shellscript that makes your installation process easier. You can run following command to install sourcebin on your local machine.

```
chmod +x install_sourcebin.sh
sudo ./install_sourcebin.sh
```

All tests done under Linux and MacOS environment but you can also install on a Windows system.

repository: tahtaciburak/sourcebin

gha_language: JavaScript

gha_license_id: MIT

repo_name: tahtaciburak/sourcebin


text:
Borderlands 3 Hotfixes: September 9, 2021
=========================================

Original URL: https://borderlands.com/en-US/news/2021-09-09-borderlands-3-hotfixes-sept-9/

Posted: Sep 9 2021

Today’s changes to Borderlands 3 continue the Borderlands 3 Second Anniversary Celebration with Mayhem Made Mild and Show Me the Eridium.

Maurice’s Black Market Vending Machine will be moving to a new location on Thursdays at 9:00 AM PT / 12:00 PM ET and is activated with a hotfix.

These changes will be live on all platforms by 12:00 PM PT. To apply hotfixes, wait at the main menu until you see a sign that reads, “Hotfixes Applied!” If you are experiencing any issues or want to provide feedback, please submit a ticket to support.2k.com.

- Activating Mayhem Made Mild, where players will only encounter Easy modifiers in Mayhem Mode until 8:59 AM PT on September 16
- Activating Show Me the Eridium, which will grant increased Eridium drops and Eridium item discounts until 8:59 AM PT on September 16


text:
# Usage
## Container instantiation
```js
var container = new Container()
```
## Services
### Set
```js
var serviceInstance = {
  doSomething: function () {
    /* some logic */
  }
}
container.set('app.foo', serviceInstance)
```
### Get
```js
container.get('app.foo').then(function (services) {
  //Then do something with the retrieved service
  services[0].doSomething()
})
```
#### Get multiple services
```js
container.get('app.foo', 'app.bar').then(function (services) {
  //Then do something with the retrieved services
  services[0].doSomething()
  services[1].doSomethingElse()
})
```
### Check if container has service instance
```js
var hasInstance = container.hasInstance('app.bar')
```
hasInstance is set to true if container has service instance, false otherwise
### Check if container has service
That is either if container has service instance or it is able to instantiate it via a [definition](service-definitions.md):
```js
var has = container.has('app.bar')
```
has is set to:
* true if container either has service definition or has service instance
* false otherwise
## Parameters
### Set
```js
container.setParameter('foo_parameter', 42)
```
### Get
```js
var parameter = container.getParameter('foo_parameter')
```
parameter is set to 42
### Check if container has parameter
```js
var hasParameter = container.hasParameter('foo_parameter')
```
hasParameter is set to true if parameter has been defined, false otherwise

Next: [Load configuration](load-configuration.md)

[README.md](../README.md)

repository: bmichalski-archive/disl

repo_name: bmichalski-archive/disl


text:
This package provides [Auto], [AutoParent] and [AutoChildren] attributes. \n
\n
They allow to automatically get/fetch references of components at the very start of the application. \n
\n
Using auto, getting your components is as simple as preprending the appropriate [Auto*] attribute to your variable declarations. \n
\n
Auto can be used with all access modifiers (private, protected, public), and all types (Unity components and custom monobehaviours). \n
\n
[AutoParent] and [AutoChildren] can be used either to get a single component, or get all the components as an array. \n
\n
Here are a couple of examples: \n
\n
\t[Auto] public Rigidbody myRb; \n
\n
\t[AutoParent] protected Collider[] myParentsColliders; \n
\n
\t[AutoChildren] private CustomScript scriptInOneOfChildren;\n


text:
---
layout: post
title: '백팩 사고싶어요'
comments: true
tags: [backpack]
category: living
excerpt_separator: <!--more-->
---

### TOGO DAYPACK

![Travel]({{ "/images/backpack1.png" | relative_url}})

[상품 링크](https://topodesigns.com/collections/backpacks/products/daypack?variant=729740001&avad=223489_a1f251ef9)

- $169
- well designed
- organizer in main room
- 21.6L
- bottle tab, just huge one pocket outside
- bright yellow color inside

### TOGO STANDARD PACK

![Travel]({{ "/images/backpack7.png" | relative_url}})
![Travel]({{ "/images/backpack2.png" | relative_url}})

[상품 링크](https://topodesigns.com/collections/work-bags/products/standard-pack-1?variant=33192137883701)

- $59
- 22L
- well designed
- organizer in front tab
- no organizer in main room
- additional room for laptop
- bright yellow color inside

### Prizefighter

![Travel]({{ "/images/backpack3.png" | relative_url}})

[상품 링크](https://store.musinsa.com/app/goods/1096764)

- $125, 13만원
- 20.8L, 1kg
- sternum strap
- well organize inside
- not prefered design

### Fjallraven Raven 20L Backpack

![Travel]({{ "/images/backpack4.png" | relative_url}})

[상품 링크](https://www.backcountry.com/fjallraven-raven-20-backpack?skid=FJR009S-DEEFOR-ONESIZ&ti=U2VhcmNoIFJlc3VsdHM6ZmphbGxyYXZlbiBiYWNrcGFjazoxOjQ6ZmphbGxyYXZlbiBiYWNrcGFjaw==)

- $90
- Simple and quite nice design
- Organizer in front pocket

### Burton Shackford 24L Backpack

![Travel]({{ "/images/backpack5.png" | relative_url}})

[상품 링크](https://www.backcountry.com/burton-shackford-24l-backpack?skid=BUR024D-HYTRRICO-ONESIZ&ti=UExQIENhdDpFdmVyeWRheSBQYWNrczo3OjM4OmJjLWV2ZXJ5ZGF5LXBhY2tz)

- $52.46
- bright beige color inside
- origanizer in front
- 24L, 0.73kg

### TIMBUK2 오서리티 노트북 백팩 Twilight

![Travel]({{ "/images/backpack6.png" | relative_url}})

[상품 링크](http://www.attopangea.com/shop/goods/goods_view.php?goodsno=10320&category=016002)

- 6만원
- 3 tabs: organizer, main room, laptop room
- 28L, 1.1kg
- Perfect in organization, design is not my type...


text:
# aws-auto-tag
Auto tagging AWS resources with `python` and `saltstack`.
Based on the idea of http://blog.gorillastack.com/wp-content/uploads/2015/09/Multi-account-auto-tag-diagram-1002x1024.png

-[![Circle CI](https://circleci.com/gh/bonclay7/aws-auto-tag/tree/master.svg?style=svg)](https://circleci.com/gh/bonclay7/aws-auto-tag/tree/master)
-[![codecov.io](https://codecov.io/github/bonclay7/aws-auto-tag/coverage.svg?branch=master)](https://codecov.io/github/bonclay7/aws-auto-tag?branch=master)

## Cloudtrail supported services (for taggable resources)

- Elastic Block Store (Amazon EBS)
- ElastiCache (ElastiCache)
- Elastic Compute Cloud (Amazon EC2)
- Elastic Load Balancing
- EMR
- Glacier
- Kinesis
- Redshift
- Amazon Relational Database Service (Amazon RDS)
- Amazon Route 53
- Amazon S3 bucket level event
- Amazon Virtual Private Cloud (Amazon VPC)
- Auto Scaling
- AWS CloudFormation
- AWS Elastic Beanstalk

## Auto-tag supported services

- EC2 Instances

## TO-DO List

- Automatic Deployment
  - Activate cloudtrail with proper configuration
  - Configure s3 buckets
  - Deploy lambda and configure firing events
  - Extend services Support

repository: agiza/aws-auto-tag

repo_name: agiza/aws-auto-tag


text:
1. Exclude fields per model
In each model have a:
__exclude__ = [ 'field1' ]
2. Generate API Docs
3. Include relationships:
__eager__ => [ for the serialisation decorator it loads the relationship ]
+ serializer

Classy:

GET /users/<user_id>/<entity > [ Books ] >

class UserBookView(..):
  model = Books

  def index(self, user_id):
    pass

/buy/books
/buy/lives

Lives:
  route_prefix = '/colors'

GET /users/3/books/5/pages
GET /books

eager loading child resources
GET /users/5
=> books

ENDPOINTS = [
]

repository: hurrycane/finny

gha_language: Python

repo_name: hurrycane/finny


text:
---
title: 'Data Handling'
sidebar_order: 3
---

## Sensitive Data

SDKs should provide some mechanism for scrubbing data. Ideally through an extensible interface that the user can customize the behavior of.

This is generally done as part of the SDK configuration:

```php
client = Client(..., {
    'processors': ['processor.className'],
})
```

Each processor listed would be some sort of extensible class or a function callback. It would have a single designated method that is passed the data (after it’s been populated), and would then return the data fully intact, or modified with various bits filtered out.

For example, if you simply supported callbacks for processors, it might look like this:

```php
function my_processor($data) {
    foreach ($data['extra'] as $key => $value) {
        if (strpos($value, 'password')) {
            $data[$key] = '********';
        }
    }
}
```

We recommend scrubbing the following values:

-   Values where the keyname matches ‘password’, ‘passwd’, or ‘secret’.
-   Values that match the regular expression of `r'^(?:\d[ -]*?){13,16}$'` (credit card-like).
-   Session cookies.
-   The Authentication header (HTTP).

Keep in mind that if your SDK is passing extra interface data (e.g. HTTP POST variables) you will also want to scrub those interfaces. Given that, it is a good idea to simply recursively scrub most variables other than predefined things (like HTTP headers).

## Variable Size

Most arbitrary values in Sentry have their size restricted. This means any values that are sent as metadata (such as variables in a stacktrace) as well as things like extra data, or tags.

-   Mappings of values (such as HTTP data, extra data, etc) are limited to 50 item pairs.
-   Event IDs are limited to 32 characters.
-   Tag keys are limited to 32 characters.
-   Tag values are limited to 200 characters.
-   Culprits are limited to 200 characters.
-   Most contextual variables are limited to 512 characters.
-   Extra contextual data is limited to 4096 characters.
-   Messages are limited to ~10kb.
-   HTTP data (the body) is limited to 2048 characters.
-   Stacktraces are limited to 50 frames. If more are sent, data will be removed from the middle of the stack.

repository: jhoncacru/sentry-docs

repo_name: jhoncacru/sentry-docs


text:
🎳 Bowling ScoreCard

A single page web app that records a players turns & caluculates their score.
[Visit live Webpage](https://joshdavies.github.io/bowling-challenge/)

## Tech
- JavaScript (ES5, Constructor design pattern)
- JQuery
- chart.js
- Jasmine.

## Bowling Rules
A bowling game consists of 10 frames in which the player tries to knock down the 10 pins. In every frame the player can roll one or two times. The actual number depends on strikes and spares. The score of a frame is the number of knocked down pins plus bonuses for strikes and spares. After every frame the 10 pins are reset.

### Strikes
The player has a strike if he knocks down all 10 pins with the first roll in a frame. The frame ends immediately (since there are no pins left for a second roll). The bonus for that frame is the number of pins knocked down by the next two rolls. That would be the next frame, unless the player rolls another strike.

### Spares
The player has a spare if the knocks down all 10 pins with the two rolls of a frame. The bonus for that frame is the number of pins knocked down by the next roll (first roll of next frame).

### 10th frame
If the player rolls a strike or spare in the 10th frame they can roll the additional balls for the bonus. But they can never roll more than 3 balls in the 10th frame. The additional rolls only count for the bonus not for the regular frame count.

    10, 10, 10 in the 10th frame gives 30 points (10 points for the regular first strike and 20 points for the bonus).
    1, 9, 10 in the 10th frame gives 20 points (10 points for the regular spare and 10 points for the bonus).

### Gutter Game
A Gutter Game is when the player never hits a pin (20 zero scores).

### Perfect Game
A Perfect Game is when the player rolls 12 strikes (10 regular strikes and 2 strikes for the bonus in the 10th frame). The Perfect Game scores 300 points.

---
## Quickstart
Clone this repo to your local drive and open in your editor of choice.

To Launch the app locally:
- right click 'index.html' and select 'copy full path'
- paste the file location into chrome.

To run tests:
- right click 'SpecRunner.html' and select 'copy full path'
- paste the  file location into chrome.

repository: JoshDavies/bowling-challenge

repo_name: JoshDavies/bowling-challenge


text:
# Frequently Asked Questions

<!-- markdownlint-disable header-increment -->
### Why aren't the charts updated with each image release?

k8s@home feels that it is the responsibility of the person deploying the chart
to ensure that the most up to date image is being deployed as well as keeping
the deployed images up to date. Keeping images would be a full time job due
to the frequent code changes and so the the k8s@home community would rather
spend their time implementing new features and charts for everyone to use.

repository: yurifrl/docs

repo_name: yurifrl/docs


text:
jenkins-graphql
===============

GraphQL server for Jenkins API

-	https://github.com/graphql/graphql-js
-	https://github.com/rmosolgo/graphql-ruby
-	https://blog.risingstack.com/graphql-overview-getting-started-with-graphql-and-nodejs/
-	https://github.com/RisingStack/graphql-server
-	https://github.com/RisingStack/graffiti
-	https://github.com/RisingStack/graffiti-example

Use [Octokat.js](https://github.com/philschatz/octokat.js) API wrapper for a nice DSL.

This project will integrate with [Github-graphQL]() project

Perhaps use Mongoose to store github data with project data. Can we then simply use graffiti to expose entire data model as GraphQL?

```js
var koa = require('koa');
var graffiti = require('@risingstack/graffiti');
var graffitiMongoose = require('@risingstack/graffiti-mongoose');

var app = koa();
app.use(graffiti.koa({
  prefix: '/graphql',
  adapter: graffitiMongoose,
  models: []
}));

app.listen(3000);
```

repository: kristianmandrup/jenkins-graphql

repo_name: kristianmandrup/jenkins-graphql


text:
# Zonemaster Web GUI Installation

The documentation covers the following operating systems:

 * [1] Ubuntu 14.04 (LTS)
 * [2] Debian Wheezy (version 7)
 * [3] FreeBSD 10
 * [4] CentOS 7.1

## Pre-Requisites

   * Zonemaster-engine should be installed before. Follow the instructions
[here](https://github.com/dotse/zonemaster-engine/blob/master/docs/installation.md)
   * Zonemaster-backend should be installed before. Follow the instructions
[here](https://github.com/dotse/zonemaster-backend/blob/master/docs/installation.md)

## Preambule

Since it is a web application, the Zonemaster Web GUI is a bit more complicated to install than, for example, the test engine. The exact details also depend on the operating system and environment in which it is installed, so it's not really possible to provide general point-by-point instructions.

Basically, the GUI has two major parts. One part is the Perl modules that hold most of the application logic, and the other part is the HTML template files, CSS files, Javascript files and so on that the application logic needs. The Perl module part can be installed as any other Perl module, and is not at all problematic. For the second part, there is no widely accepted place or way to install it, and different operating systems want it in different places. For this reason, we have put all that stuff in a subdirectory of its own in the source code, so you can easily copy it to wherever suits your environment best.

So, in essence, the installation consists of the following steps:

1) Fetch the source code to the Web GUI.

2) Install all the various prerequisite software. This includes the Zonemaster Web Backend, which in turn requires the Zonemaster test engine. The backend also needs access to a database server.

3) Install the Perl module part of the GUI using the usual `perl Makefile.PL && make && make test && make install` sequence.

4) Copy the entire subdirectory `zm_app` from the source code to somewhere suitable. This may be, for example, `/usr/local/webapps/` or `/usr/share/doc/`.

5) Start the server. How to do this can also vary a lot, depending on what else is running on the same server, how much traffic you're expecting to get and such. In any case, you need a server that understands the `PSGI` interface, and it should be pointed at the file `zm_app/bin/app.pl` in the subdirectory you just copied things to (leaving it in the source code also works, of course).

##  Example installation for Ubuntu Server 14.04LTS

1) Install added prerequisite packages:

    sudo apt-get install libdancer-perl libtext-markdown-perl libtemplate-perl libjson-any-perl

2) Get the source code.

    git clone https://github.com/dotse/zonemaster-gui.git

3) Change to the source code directory.

    cd zonemaster-gui

4) Install the Perl modules.

    perl Makefile.PL
    make
    make test
    sudo make install

5) Create a directory for the webapp parts, and copy them there.

    sudo mkdir -p /usr/share/doc/zonemaster
    sudo cp -a zm_app /usr/share/doc/zonemaster

6) Start the server:

    sudo starman --listen=:80 /usr/share/doc/zonemaster/zm_app/bin/app.pl

The Doc directory in the source code also has an example Upstart file for the Web GUI starman server.

##  Example installation for FreeBSD 10 & 10.1

1) Become root

    su -

2) Install additional prerequisite packages.

    pkg install p5-Dancer p5-Text-Markdown p5-Template-Toolkit

3) Get the source code.

    git clone https://github.com/dotse/zonemaster-gui.git

4) Change to the source code directory.

    cd zonemaster-gui

5) Install the Perl modules.

    perl Makefile.PL
    make
    make test
    make install

6) Create a directory for the webapp parts, and copy them there.

    mkdir -p /usr/local/share/zonemaster
    cp -a zm_app /usr/local/share/zonemaster

7) Start the server:

    starman --listen=:80 --daemonize /usr/local/share/zonemaster/zm_app/bin/app.pl

##  Example installation for CentOS 7.1

1) Install additional prerequisite packages.

    sudo cpan -i Dancer Text::Markdown Template JSON

2) Get the source code.

    git clone https://github.com/dotse/zonemaster-gui.git

3) Change to the source code directory.

    cd zonemaster-gui

4) Install the Perl modules.

    perl Makefile.PL
    make
    make test
    make install

5) Create a directory for the webapp parts, and copy them there.

    mkdir -p /usr/local/share/zonemaster
    cp -a zm_app /usr/local/share/zonemaster

6) Start the server:

    starman --listen=:80 --daemonize /usr/local/share/zonemaster/zm_app/bin/app.pl


text:
---
#
# Use the widgets beneath and the content will be
# inserted automagically in the webpage. To make
# this work, you have to use › layout: frontpage
#
layout: frontpage
title: "Eleanor Frajka-Williams – oceanographer"
widget-1:
    title: "Research"
    url: projects/
    text: 'I am a physical oceanographer at the University of Southamton, England. I study ocean circulation and physics from small scales (centimeter) to large (thousands of kilometers). I primarily use real-world measurements - from ships, satellites, seagliders and moorings - and occasionally numerical simulations, to investigate the oceans.'
    image: fig3_rapid_3d1-thumb.png
widget-2:
    title: "Teaching"
    url: teaching/
    text: 'I teach courses for undergraduate and masters level students, including on ocean circulation and on data analysis methods for oceanographers. Sometimes we use a rotating tank to simulate the effect of the Earths rotation on the oceans.'
    video: ''
widget-3:
    title: "Resources"
    url: 'resources/'
    text: 'Tools & resources for oceanographers
1. Observationaloceanography.com.
2. Mentoring groups
3. Teaching resources
4. Opportunities for students,...'
    image: ctd_jc103-thumb.jpg
header: no
---

Eleanor Frajka-Williams

Lecturer in Physical Oceanography

Ocean and Earth Sciences, University of Southampton

National Oceanography Centre Southampton,

University of Southampton Waterfront Campus

Empress Dock, Southampton SO14 3ZH

United Kingdom

Office: 564/10

Phone: +44<PHONE_NUMBER>

<a href="mailto:e.frajka-williams<EMAIL_ADDRESS>

  ×

repository: eleanorfrajka/website-edits

repo_name: eleanorfrajka/website-edits


text:
# Teamspeak 3 Bot
[![Build Status](https://img.shields.io/travis/blombler008/Teamspeak-3-Bot.svg?style=for-the-badge)](https://travis-ci.org/blombler008/Teamspeak-3-Bot) [![Top Language](https://img.shields.io/github/languages/top/blombler008/Teamspeak-3-Bot.svg?style=for-the-badge)](https://github.com/blombler008/Teamspeak-3-Bot/) [![GitHub repo size](https://img.shields.io/github/repo-size/blombler008/Teamspeak-3-Bot.svg?style=for-the-badge)](https://github.com/blombler008/Teamspeak-3-Bot/) [![GitHub](https://img.shields.io/github/license/blombler008/Teamspeak-3-Bot.svg?style=for-the-badge)](https://github.com/blombler008/Teamspeak-3-Bot/)

> This bot is 'Plugin Based', Which means Admins/Users are able to Create their own plugins for their server. Which uses the [TeamSpeak-3-Java-API](https://github.com/TheHolyWaffle/TeamSpeak-3-Java-API) by [TheHolyWaffle](https://github.com/TheHolyWaffle) as engine.

### Features
> - Plugins can be loaded while running the query client.
> - MySQL driver, ready to connect.
> - Command and Event manager.

### Usage
> To use the bot you can simply create a folder (eg. ```mkdir /home/example/bot```) and download put the ```Teamspeak-sq-bot.jar``` in that folder. As soon as you execute the jar, a folder called ```Teamspeak3Bot``` is created in that same directory where the bot jar lays.
> You can specify the work dir by using the start parameter *```workDir```*. The Default work directory is ```./Teamspeak3Bot```.
>
> **Maven (Coming soon)**
> >
>
> **Standalone(jar)**
> > If you are not able to use maven you can download the standalone jar with dependencies and implement that into your project.

### Parameters
> Parameters are used like the following (```--Key=Value```). A start parameter always starts with two dashes.

| Option | Value | Required | Example | Description |
| --- | --- | --- | --- | --- |
| debug |  | No | ```--debug``` | Enables the Debugger. **NOTE:** Complete information about the server query is shown (Password, Username, Server address, Port, etc)|
| workDir | bot's work directory | No | ```--workDir=/etc/bot/``` | Changes the work directory to the given path if valid. **DEFAULT:** ```./Teamspeak3Bot``` |
| auth-key |  |  | ```--auth-key=abcdefgh``` | Only uses while developing |

### Config
> The config is a simple properties file called ```config.ini```, which is located and generated in the work directory. The first two lines of the config file is a comment, comment always starts with ```#```. **NOTE:** Everything has a key, a value and is required.

| Option  | Default | Example | Description |
| --- | --- | --- | --- |
| ```nickname``` | ```serverquerybot``` | ```nickname=Example Bot``` | Gives the bot a nickname when connecting to the server. Users who gets a message from the bot will see this name. |
| ```port``` | ```10011``` | ```port=12345``` | Server Query port to connect |
| ```host``` | ```<IP_ADDRESS>``` | ```host=ts.example.com``` | The hostname/Ip-address of the server |
| ```username``` | ```username``` | ```username=example``` | Username to login as server query |
| ```password``` | ```password``` | ```password=12345678``` | Password to login as server query |
| ```prefix``` | ```\!``` | ```prefix=\!``` | The command prefix for the com.github.theholywaffle.teamspeak3.commands entered by user in Teamspeak. **NOTE:** Special characters need a backslash like the `!` to be recognized! |
| ```lang``` | ```english``` | ```lang=english``` | Let you change the language for plugins |
| ```owner``` | ```1234567890abdef``` | ```owner=zbv5DDqRa3jy4LuM1cfUeyurud8\\=``` | Sets the owner of the bot, so the owner kan execute admin commands first before any of the other users. **NOTE:** Put the UID from your own client in this property |
| ```channel``` | ```0``` | ```channel=0``` | Sets the channel where the bot ist going to connect to. **NOTE:** invalid channel id causes errors |

### Commands
> A list of Commands

| Command | Aliases | Parameters | Examples | Description |
| --- | --- | --- | --- | --- |
| ```uploadErrorLog``` |  |  | ```uploadErrorLog``` | Uploads the log file to pastebin. **NOTE:** Make sure that the debugging mode is used (with the ```debug``` parameter on start). |
| ```help``` | ```[help, ?]``` | [command] | ```help```, ```help example``` | Shows the help of the given parameter, and list of commands if no parameter is present. |
| ```reload``` | ```[reload, rl]``` | [plugin] | ```reload```, ```reload ExamplePlugin-v1``` | Reloads the given plugin, and reloads all plugins if no parameter is given |
| ```plugins``` | ```[plugins, pl]``` |  | ```plugins``` | Shows a list of plugins. |
| ```stop``` | ```[stop, quit, exit]``` | | ```stop``` | Logs out of the teamspeak server query and exit the program. |

### Examples

**Adding an event listening**
> To add an event listener you have to add the event class to the event manager. Like Shown in the Example class.
> ```java
> public class Example extends JavaPlugin {
>     public void onEnable() {
>         getInstance().getEventManager().addEventToProcessList(new ExampleEvent());
>     }
> }
> ```
> Now we have to register an event in the ```ExampleEvent``` class, it have to implement the ```Listener``` interface. The annotation ```@EventListener``` lets the manager know the following method is a event listener. The name of the method does not matter, what matter does is the parameter, make sure it is only one and extends the ```Event``` class.
> ```java
> public class ExampleEvent implements Listener {
>     @EventListener
>     public void onTextMessage(EventTextMessage e) {
>         // do stuff
>    }
> }
> ```
**List of Events**
> Events always starts with ```Event``` in the beginning.
> - ```EventChannelCreate```
> - ```EventChannelDeleted```
> - ```EventChannelDescriptionChanged```
> - ```EventChannelEdit```
> - ```EventChannelMoved```
> - ```EventChannelPasswordChanged```
> - ```EventClientJoin```
> - ```EventClientLeave```
> - ```EventClientMoved```
> - ```EventCommandPreProcess```
> - ```EventPrivilegeKeyUsed```
> - ```EventServerEdit```
> - ```EventTextMessage```

**Adding an command**
> To create a command we have to put in our ```plugin.ini``` the command.
> ```yaml
> # Main, Version, Plugin Descruption, Plugin Name ....
> commands:
>   example:
>      description: A example command
>      usage: [optional] <required>
>      aliases: [example,ex]
> ```
> Now we have to get the command template from the list of commands and add an executor to the command.
> ```java
> public class Example extends JavaPlugin {
>     public void onEnable() {
>         getInstance().getCommandManager().getCommand("example").setExecutor(new ExampleCommand());
>     }
> }
> ```
> In the ```ExampleCommand``` class we have let it extend ```CommandExecutor``` and implement the ```run``` method. The ```run``` method is executed when a user enters the command or alias.
> ```java
> public class ExampleCommand extends CommandExecutor {
>
>     @Override
>     public void run(CommandSender source, Command cmd, String commandLabel, String[] args) {
>         // do stuff
>     }
> }
> ```

**Examples** can be found [here](https://github.com/blombler008/Teamspeak-3-Bot/tree/master/Examples) are 2 files of the examples on top ...

gha_language: Java


text:
# javascript labs

## description

My JavaScript and TypeScript Practice

## note

computer vision, graphics and image processing on the canvas

* Fast Fourier Transform (1D-FFT/IFFT, 2D-FFT/IFFT)
* Stereo Matching
* Poisson Image Editing
* Corner Detection
* Fish-Eye Transform
* Image Processing Filters (convolution, symmetric nearest neighbor, jitter)
* Image Histogram Calculation
* Decision Tree Learning
* K-Means++ Clustering
* 3D Shape Drawing (Mobius Strip, Klein Bottle, Heart Surface)
* etc..
* Deep Learning (in TypeScript)

## license

The MIT License

Copyright (c) 2014 wellflat

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

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

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

repository: exebetche/javascript-labs

repo_name: exebetche/javascript-labs


text:
# April 7, 2020
- Etcd and Kafka can be installed independently of VOLTHA, with `WITH_ETCD` and/or `WITH_KAFKA` set to their endpoints:
  - `WITH_ETCD=y WITH_KAFKA=y` installs Etcd and Kafka in the `voltha` namespace
  - `WITH_ETCD=external WITH_KAFKA=external` installs Etcd and Kafka in the `default` namespace
  - `WITH_ETCD=<etcd-endpoint> WITH_KAFKA=<kafka-endpoint>` connects the deployment to pre-deployed instance of Etcd and Kafka
- `WITH_ETCD`, `WITH_KAFKA`, and `WITH_ONOS` when used to specify external services (i.e. services that are not nessisarily deployed as part of `kind-voltha`) require the format for each of these is `service-name`[`:port`]. Port is optional and will default to the standard port for the given service.
- Separate namespaces can be specified for various components
  - `VOLTHA_NS`  (default: `voltha`)  for cores, ofagent, Etcd (yes), Kafka (yes)
  - `ADAPTER_NS` (default: `voltha`)  for device adapters
  - `INFRA_NS`   (default: `default`) for RADIUS, ONOS, Etcd (external), Kafka (external)
  - `BBSIM_NS`   (default: `voltha`)  for BBSIM instances

The changes in this release enable the ability to shorten the development cycle by allowing developers only to cycle (restart) the components required.

For example, if VOLTHA is started with the following command:
```
WITH_BBSIM=y WITH_RADIUS=y CONFIG_SADIS=y WITH_ONOS=y WITH_ETCD=external WITH_KAFKA=external INFRA_NS=infra BBSIM_NS=devices ADAPTER_NS=adapters ./voltha up
```
And then brought down with the following command:
```
DEPLOY_K8S=n WITH_BBSIM=y WITH_RADIUS=no CONFIG_SADIS=no  WITH_ONOS=no WITH_ETCD=no WITH_KAFKA=no INFRA_NS=infra BBSIM_NS=devices ADAPTER_NS=adapters ./voltha down
```
Then it can be restarted with the following command and only the VOLTHA core components, adapters, and BBSIM are required to be restarted:
```
DEPLOY_K8S=n WITH_BBSIM=y WITH_RADIUS=no CONFIG_SADIS=no  WITH_ONOS=onos-openflow.infra.svc.cluster.local  WITH_ETCD=etcd-cluster-client.infra.svc.cluster.local WITH_KAFKA=kafka.infra.svc.cluster.local  INFRA_NS=infra BBSIM_NS=devices ADAPTER_NS=adapters ./voltha up
```
In the above examples namespaces are specified, but this is not required.


text:
---
title: Application environment
uid: app_envir
description: About application environments
author: {github-id}
keywords: sod,stage
so.topic: concept
so.envir: cloud
so.client: online
---

# Application environments

SuperOffice CRM Online is a cloud platform serving thousands of customers. Like any serious distributed and federated platform service, it requires several phases for development, testing, and production.

SuperOffice provides 3 environments: development, stage, and production.

![x -screenshot][img1]

All [standard applications][1] must be prepared to operate in at least 2 environments before being [listed in the public App Store][2].

## SuperOffice Online Development (SOD)

SOD is where research and development happens. It is our **sandbox environment** that allows you to explore, experiment with, and play with our APIs. This is where all SuperOffice applications are born and evolve until they are ready for either [validation][3] or [certification][4].

## Stage

In stage, an application must prove it can withstand a high degree of traffic without impacting the server, the main website, and other applications that are running on the same server. This is where all SuperOffice applications go through certification and security evaluation.

## Production

This is the public space where SuperOffice CRM Online and all [deployed applications][5] reside. That means both standard applications published to the App Store and custom applications activated on a customer's [tenant][10].

## Why different environments?

It's quite simple: **security**. SuperOffice takes security very seriously, while at the same time makes it easy for applications to transition from one environment to the next when ready.

The separation also prevents applications still in development from accidentally being used in stage and production environments.

## What's in each environment?

The development and stage environments are essentially isolated copies of production. Each environment has its own distinct components:

* Operation Center (OC)
* [App Store][7]
* Partner [applications][8]
* [SuperID][9] (URL to the SuperOffice federated authentication provider)
* SuperOffice Certificate ID (certificate thumbprint identifier)
* Customer tenants

You will most likely be connecting to the free test tenant in SOD when you develop your application.

In the SOD tenant, you get a new blank database. However, if you plan to create customizations based on a customer's settings such as list items and user-defined fields, you probably need access to [production data][12].

> [!NOTE]
> For security reasons, we don't want production data in the SOD environment.

## Environment dependencies

For each application and within each environment, you must define the following 5 environment-specific dependencies:

* [client ID][10]
* client secret (token)
* [certificates][11]
* SoFederation Gateway (SuperId)
* SuperOffice Certificate ID

![x -screenshot][img2]

Click to download the SuperOffice certificates (ZIP file).

## Base URL

The base URL for any tenant is different in each environment. Given a tenant context identifier of Cust12345, the base URL is as follows:

* Development `https://sod.superoffice.com/Cust12345`
* Stage `https://qaonline.superoffice.com/Cust12345`
* Production `https://online.superoffice.com/Cust12345`

Use of the REST web services to get the company where id is equal to 3 in the development environment, assuming accessing version v1, would appear as:

`https://sod.superoffice.com/Cust12345/api/v1/contact/3/`

Use of the SOAP web services to get the company where id is equal to 3 in the development environment, assuming accessing version 87, would appear as:

`https://sod.superoffice.com/Cust12345/remote/services87/contact.svc (SOAP Action: GetContactEntity)`

Both the REST and SOAP `base URL` endpoints are included as **claims** in the OpenID Connect `id_token`.

[1]: ../standard.md
[2]: ../publish/get-listed.md
[3]: ../activate/index.md
[4]: ../certification/index.md
[5]: index.md
[7]: ../app-store.md
[8]: ../overview.md
[9]: ../../identity-management/federated-auth.md
[10]: ../terminology.md
[11]: ../../../../data-access/docs/authentication/online/certificates/index.md
[12]: ../../online/test-environment/index.md

[img1]: media/online-environments-sidebyside-650.png
[img2]: media/online-environments-settings-sidebyside2-650.png

repository: ArildEik/superoffice-docs

repo_name: ArildEik/superoffice-docs


text:
---
date: 2019-03-16
title: "seed"

draft: false
type: "page"
---

#### hof db seed

```Reseeds the DB, dropping all current data and refilling with your seed data. Note, this will also run any pending migrations.

Usage:
  hof db seed [flags]

Flags:
  -h, --help   help for seed

Global Flags:
  -c, --context string   the context to use for the hof tool and commands
```

repository: hofstadter-io/studios-docs

repo_name: hofstadter-io/studios-docs


text:
---
published: true
layout: post
title: Youtube Downloader
category: Linux Application
---

Youtube-dl is an open source program written in Python for the command line but it does more than just download audio and video from youtube.

The official site of youtube-dl is at https://yt-dl.org/download.html

### Installing Youtube-dl

Using Curl

$ sudo curl -L https://yt-dl.org/downloads/latest/youtube-dl -o /usr/local/bin/youtube-dl

Using wget

$ sudo wget https://yt-dl.org/downloads/latest/youtube-dl -O /usr/local/bin/youtube-dl

$ sudo chmod a+rx /usr/local/bin/youtube-dl

After installing it remember to update it

$ sudo youtube-dl -U

### Using Youtube-dl

#### 1. To download a video

$ youtube-dl https://www.youtube.com/watch?v=yJg-Y5byMMw

#### 2. To download a video and save with a specific name

$ youtube-dl -o 'Warriyo - Mortals (feat. Laura Brehm)[NCS]' https://www.youtube.com/watch?v=yJg-Y5byMMw

#### 3. To download a video and save in a specific location

$ youtube-dl -o '~/Downloads/Warriyo - Mortals (feat. Laura Brehm)[NCS]' https://www.youtube.com/watch?v=yJg-Y5byMMw

#### 4. To download multiple videos

$ youtube-dl <url1> <url2>

#### 5. To download multiple videos by passing a text file with multiple links

$ youtube-dl -a url.txt

#### 6. To list all available formats of video

$ youtube-dl --list-formats https://www.youtube.com/watch?v=yJg-Y5byMMw

$ youtube-dl -F https://www.youtube.com/watch?v=yJg-Y5byMMw

#### 7. To download videos in specific quality and format.

Note that the following options may be available but not always.

|**Option**|**Remarks**|
|:---:|:---:|
|best|select the best quality format for the given file with video and audio|
|worst|select the worst quality format of the given file with video and audio|
|bestvideo|select the best quality video-only format|
|worstvideo|select the worst quality video-only format|
|bestaudio|select the best quality audio only-format|
|worstaudio|select the worst quality audio only-format|

Example:

$ youtube-dl -f bestaudio https://www.youtube.com/watch?v=yJg-Y5byMMw

You can also combine formats and merge them with ffmpeg (remember to have ffmpeg installed).

$ youtube-dl -f bestvideo+bestaudio https://www.youtube.com/watch?v=yJg-Y5byMMw

You may also specify multiple format codes in any preferred order from the listed format you have listed in 6 above.

$ youtube-dl -f 22/17/18 <playlist_url>

#### 8. To download videos by specific format

$ youtube-dl --format mp4 https://www.youtube.com/watch?v=yJg-Y5byMMw

#### 9. To set size limit for videos

$ youtube-dl --min-filesize 100M <playlist_url>

$ youtube-dl --max-filesize 100M <playlist_url>

$ youtube-dl -f 'best[filesize<100M]' <playlist_url>

#### 10. To download the 10th file from a playlist

$ youtube-dl --playlist-items 10 <playlist_url>

#### 11. To download multiple random files

$ youtube-dl --playlist-items 2,3,7,10 <playlist_url>

#### 12. To download a video playlist starting from a certain video

$ youtube-dl --playlist-start 10 <playlist_url>

#### 13. To download only the files starting from 2nd to 5th in a playlist

$ youtube-dl --playlist-start 2 --playlist-end 5 <playlist_url>

#### 14. To download audio only from a video (note that the default is in ogg format)

$ youtube-dl -x https://www.youtube.com/watch?v=yJg-Y5byMMw

#### 15. To download audio only in mp3 format

$ youtube-dl -x --audio-format mp3 https://www.youtube.com/watch?v=yJg-Y5byMMw


text:
# Doodle Classifier
A neural network classifier. *See test/ for images*
## Specifications: ##
* Interactive GUI in Tkinter, allows to the user choose various settings
* Neural network can run up to 4 layers (without changing the source code)
* Supports L2, Dropout regularizations and Adam, momentum, mini batch optimizers and various loss function
* Plots cost and accuracy of train and test data and saves.
* Resets paramenters according to new layers or old one.
* Predicts doodles with Google Quick, Draw Dataset
* Shows selected images from data
* Saves biases and weights of the neural network or loads
* If predict false, train itself with drawn doodle
* If no data present, only options is load a saved neural network
## Dependencies: ##
* Pillow
* Numpy
* Matplotlib
* Tensorflow (If not installed, just remove it from code)
* Tested on Python 3.7.6 x64
## Run: ##
`$ python DoodleClassifier.py`

             demo

## Benchmarks: ##
1. `tf.keras.datasets.mnist`:
   - Neural Net: [28 \* 28, 64, 32, 10], _batch_size_=256, _lr_=0.01, _adam_, _relu->relu->softmax_: **%95.19**
2. `tf.keras.datasets.fashion_mnist`:
   - Neural Net: [28 \* 28, 64, 32, 10], _batch_size_=256, _lr_=0.01, _adam_, _relu->relu->softmax_: **%86.82**
3. Google Quick, Draw Dataset (3 images, 5000 examples per):
   - Neural Net: [28 \* 28, 64, 32, 3], _batch_size_=256, _lr_=0.01, _adam_, _relu->relu->softmax_: **%90.00**
4. Google Quick, Draw Dataset (5 images, 5000 examples per):
   - Neural Net: [28 \* 28, 64, 32, 5], _batch_size_=256, _lr_=0.01, _adam_, _relu->relu->softmax_: **%81.44**
4. Google Quick, Draw Dataset (10 images, 5000 examples per):
   - Neural Net: [28 \* 28, 64, 32, 10], _batch_size_=256, _lr_=0.01, _adam_, _relu->relu->softmax_: **%77.34**
## Usage: ##
- **Create the neural net:**
```python
NeuralNetwork(layers)
```
- **Train:**
```python
# defaults, change or delete any of them
config = {
   "l_rate" : 0.01,
   "epoch" : 5,
   "batch_size" : 256,
   "loss" : "multi_label",     # "cross_entropy", "multi_label", "mean_square"
   "optimization" : "adam",    # "adam", "momentum"
   "regularization" : "none"   # "dropout", "L2"
}

NeuralNetwork.train(x_train, y_train, x_test, y_test, config)
```
- **Get MNIST:**
```python
x_train, y_train, x_test, y_test = DoodleClassifier.test_mnist("mnist") # "mnist", "fashion_mnist"
```
- **Calculate accuracy:**
```python
NeuralNetwork.accuracy(x_test, y_test)
```
- **Reset parameters:**
```python
NeuralNetwork.reset_parameters(new_layer)
```
### Bugs: ###
* Calling plt.close() also closes Tkinter. If Matplotlib is not closed, program runs at background. (see [#13470](https://github.com/matplotlib/matplotlib/issues/13470))
* When program predicts false, if you hit false button and do not select true image, that segment does not go away.
* PILL.ImageGrab support OS X and Windows only.

_Please let me know if there is something wrong. CNN is under construction._

repository: ssduman/doodle-classifier

repo_name: ssduman/doodle-classifier


text:
# Create All The Docs with allthedocs

Need a simple documentation solution that works with both markdown files and
markdown-formatted comments in your source code? Then look no further, because that's
exactly what allthedocs is all about.

/---- info
**Info:** this project is very young (< v1.0.0) and the API will probably change and
evolve rapidly.
----/

## Features

* Turns markdown files and source code comments into beautiful HTML documentation
* Requires almost no setup
* Keeps the original directory layout so that you always know how to link between files
* Generates a site navigation from your config
* Easily add more languages to be parsed
* Allows to specify files and directories to be ignored

## Table of Contents

* [Documentation](docs/index.md)
 * [README: Quickstart Guide](README.md)
 * [User Manual](docs/user/index.md)
 * [Developer Manual](docs/dev/index.md)

repository: allthedocs/allthedocs

repo_name: allthedocs/allthedocs


text:
# casey-compile
Compile the best vlog material from Casey Neistat's videos

- Try it out on Twitter!

Tweet the youtube link of the vlog you want to compile! Along with the hashtag #CaseyBot

Example Tweet - `https://www.youtube.com/watch?v=6FvjUQQOoL0 #CaseyBot`

You'll receive a notification from CaseyBot, with the link to the brand new video on YouTube!


text:
dmenu-user
==========

A small launcher menu based on dmenu

License
=======

dmenu-user is released under the MIT public license.

Description
===========

dmenu-user is small configurable launcher menu based on dmenu from suckless. It's a simple shell script
inspired by the dmenu_run script that comes with dmenu.

Dependancies
============

* [dmenu](http://tools.suckless.org/dmenu/) (no shit!)

Installation
============

To install dmenu-user

```
make install
```

How to configure
================

Short version
-------------

Just run dmenu-user and follow the instructions.

Long version
------------

Create a dmenu-user configuration file in the configuration directory (default: ~/.config/dmenu-user)
and add one program by line (program must be in $PATH):

```
pcmanfm
urxvt
chromium
surf
VirtualBox
```
Tips:
-----

Use it with a keyboard shortcut (I like "alt + m" personnaly, easy to remember and quite accessible).

[![Bitdeli Badge](https://d2weczhvl823v0.cloudfront.net/kakwa/dmenu-user/trend.png)](https://bitdeli.com/free "Bitdeli Badge")

repository: kakwa/dmenu-user

gha_language: Shell

repo_name: kakwa/dmenu-user


text:
PERMISSIONS

__Different permissions__

    r read - you may view the contents of the file
    w write - you may change the contents of the file
    x execute - you may execute or run the file if it is a program or script

    ### Specific permissions

        owner - a single person who owns the file (typically the person who created the file but ownership
        may be granted to some one else by certain users)

        group - every file belongs to a single group

        others - everyone else who is not in the group or the owner

        1. * To view permissions (ls -l [path]) *
        2. * To change permissions (chmod [permissions] [path]) *
            2a. made up of 3 components

    ### Directory permissions

        r - you have the ability to read the contents of the directory (ie do an ls)
        w - you have the ability to write into the directory (ie create files and directories)
        x - you have the ability to enter that directory (ie cd)

__Concepts__

    Security
        Correct permissions are important for the security of a system.
    Usage
        Setting the right permissions is important in the smooth running of certain tasks on Linux. (we will
        see an example of this in Section 13 on scripting)


text:
---
date: 2023-06-24T09:14:53.000+00:00
title: Accessibility audits, three different ways
description: Foo
tags:
- web
- a11y
- howto
noteWithTitle: false
linkTarget: ''
mainImage.url: ''
mainImage.alt: ''
mainImage.aspectRatioWidth: ''
mainImage.aspectRatioHeight: ''
mainImage.srcsetWidths: ''
mainImage.sizes: ''
mainImage.isAnchor: false
draft: true
---
When it comes to checking the accessibility of web pages and interfaces, there are varying approaches.

At the serious, professional end of the spectrum you enlist professional accessibility testers and they’ll conduct a proper audit with feedback closely linked to WCAG criteria and issue severities graded from low to critical. I’ve commissioned this kind of review before, and the results are always fantastic.
---

Low-hanging fruit audit
  [JK prev](https://fuzzylogic.me/posts/accessibility-testing-on-adactio.com/)
  I summarised as [if you only had 5 minutes](https://fuzzylogic.me/posts/collected-web-accessibility-guidelines-tips-and-tests/)
  [JK recently on CL blog about an audit of CL](https://clearleft.com/thinking/accessibility-audits-for-all)

GDS audit
  Add links and resources

External audit
  Mention Tetra testing big tables, big forms, date pickers and WYSIWYG editors

repository: fuzzylogicxx/fuzzylogic

gha_language: SCSS

repo_name: fuzzylogicxx/fuzzylogic


text:
# Antora Build for Apicurio Registry Documentation

This folder contains the configuration and scripts used when building the Apicurio Registry
documentation for publishing to the Apicurio project web site.  We are using a tool called
Antora to build the asciidoc based documentation into a publishable site.  However, due to
some issues with building on various platforms (I'm looking at you, Windows) and also some
conflicts between what Antora builds and what our GitHub Pages (jekyll) project site expects,
we have created a non-trivial (but automated) process for building the docs.

## Docker Image

In order to avoid platform inconsistencies with the build, we have created a Docker image to
perform it.  The `Dockerfile` is located in this directory, along with a `build.sh` script
that becomes the main entrypoint/cmd for the docker image.

## Build the Docker Image

To build the docker image, do this:

```docker build -t="apicurio/apicurio-docs-builder" --rm .```

Then you can push the new image like this (maintainers only):

```docker push apicurio/apicurio-docs-builder:latest```

Only do this if you need to change the build script or some other aspect of the Antora build
process.  See the `build.sh` file for details about how Antora is used to build the docs.

## Building the Documentation

The Docker image should be used to build the documentation.  It simply has one required
volume-mount to read the playbook and store the output.  You can run the build something
like this:

```
docker pull apicurio/apicurio-docs-builder:latest
docker run -v $(pwd):/apicurio-docs-playbook apicurio/apicurio-docs-builder:latest
```

This will run the build and output the result in the provided local directory (in the above
example it would write the result to the appropriate Apicurio project site directory).

The following ENV variables can be set when running the docker image:

* **ENV PLAYBOOK** registry-docs-playbook.yml

repository: pwright/apicurio-docs-playbook

repo_name: pwright/apicurio-docs-playbook


text:
#Demographics Section

Data model description - [Demographics](../demographics.md)

##JSON Model Sample

```javascript
{
    "name": {
        "first": "JOHN",
        "last": "DOE"
    },
    "dob": [
        {
            "date": "1910-01-01T00:00:00Z",
            "precision": "day"
        }
    ],
    "email": [
        {
            "email"<EMAIL_ADDRESS>            "type": "primary"
        }
    ],
    "phone": [
        {
            "number": "123-456-7890",
            "type": "primary"
        }
    ],
    "addresses": [
        {
            "use": "primary",
            "streetLines": [
                "123 ANY ROAD"
            ],
            "city": "ANYTOWN",
            "state": "VA",
            "zip": "00001",
            "country": "United States"
        }
    ]
}
```

##Original CMS Snippet

```text

--------------------------------
Demographic

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

Source: MyMedicare.gov

Name: JOHN DOE

Date of Birth: 01/01/1910

Address Line 1: 123 ANY ROAD

Address Line 2:

City: ANYTOWN

State: VA

Zip: 00001

Phone Number:<PHONE_NUMBER>

Email<EMAIL_ADDRESS>
Part A Effective Date: 01/01/2012

Part B Effective Date: 01/01/2012

```

repository: mariaro/blue-button

repo_name: mariaro/blue-button


text:
# Keynote Demo
These are two very simple demos used during the keynote to show some of the technology that will be covered during the workshop.

## 1 - How Happy
Show the http://HowHappy.co.uk website which uses the emotion API and LUIS to sort faces in a photo by their emotion

Take a photo of the audience and upload to website

Use the Luis prompt to ask for other emotions
* Who is the happiest one here
* Show me all the angry people
* Who is the 3rd most surprised person
* Show me the least happy person

## 2 - SkyScanner Bot
A quick demo of the Sky Scanner

Open Skype

Go to the bots tab and search for 'SkyScanner'

Use these responses in order:
* "Rome"
* "Birmingham"
* "Next Week"
* "After 1 week"
* Flick through the 3 cards for Cheapest, Shortest, Best
* Click Show 5 Cheapest
* Click Show details which opens the browser

Optionally repeat in Facebook messenger


text:
# Template directory README
Copyright 2022,2023 Nvidia Corporation.  All rights reserved.

This directory holds specific container configurations.
Note that each sub directory also contains a README.md with
specific information about the contents of that directory.

# Current configurations:

|                                                  |   |
|------------------------------------------------- |---|
|[common-templates](./common-templates)            |- Files common to all DUE images|
|[example](./example)                              |- The bare minimum of DUE build infrastructure. A good starting point for new templates.|
|[debian-package](./debian-package)                |- Tools for Debian package build|
|[ONIE](./onie)                                    |- Build the Open Network Install Environment|
|[frr](./frr)                                      |- Build the Free Range Routing package|
|[sles-package](./suse/sub-type/sles-package)      |- SUSE Enterprise Linux Server build environment base image|
|[opensuse-package](suse/sub-type/opensuse-package)|- OpenSUSE build environment base image|
|[rhel-package](redhat/sub-type/rhel-package)      |- Red Hat Enterprise Linux base image |
|[fedora-package](redhat/sub-type/fedora-package)  |- Fedora build environment base image|

# Create a Docker image from these templates
The easiest was to do this is to:
  1. Run `./due --create --help`
  2. Cut and paste an example command to create an image.

**NOTE** Using the leading `./` has DUE parse all the README.md files in the local templates directory to get examples.
Without the `./` the version of DUE installed in your system will be used instead (if it has been installed.)

## Example:  Create a Debian package build container
**Run:**
`./due --create --from debian:10    --description "Package Build for Debian 10" --name package-debian-10 --prompt PKGD10 --tag package-debian-10 --use-template debian-package`

**This:**
1. Uses the `debian:10` Docker image file from DockerHub as a starting point.
2. Implicitly adds in the contents of the **common-templates** directory to the image to provide features like the script that creates a user account in the container on login.
3. Uses the contents of the **debian-package** template directory to configure the image.
4. Sets the image name, tag and description.
5. Sets the default shell prompt in the container to be `PKGD10` as a hint at run time to let the user know they are in a package build container for Debian 10.

### To look at those steps from a different perspective:

### Start with:
A **base image** of Debian 10, downloaded from Dockerhub

### Then add:
The contents of the **common** templates directory:

├── Dockerfile.config    *<-- Docker Labels to provide hints for running the container*
├── Dockerfile.template  *<--framework of steps in image creation*
├── filesystem
│   ├── etc
│   │   ├── DockerLoginMessage.template  *<--container log in message to provide the user some context*
│   │   └── due-bashrc.template          *<-- set container prompt for another context hint*
│   └── usr
│...... └── local
│.........└── bin
│............└── container-create-user.sh  *<-- create user account in container that matches host. Also used for running commands without login.*
├── install-config-common-lib.template     *<-- DUE image assembly utilities*
├── post-install-config.sh.template        *<-- run after file copy to image *
└── pre-install-config.sh.template         *<-- run before any files have been copied to the image*

### Then add:
The contents of the **debian-package** template directory:

├── Dockerfile.config  *<-- runtime hints (mount parent directory when running container)*
├── filesystem
│.. └── usr
│...... └── local
│........ └── bin
│........... └── duebuild  *<-- script DUE runs to build by default *
├── post-install-config.sh.template  *<-- install Debian build specific packages *
└── README.md  *<-- describe container and its duebuild script*

### Which creates:
A Debian 10 package **build image** for Docker.

# Create your own templates

 1. Copy the **example** template directory, or a related template directory and rename it.
 2. Edit the `README.md` to reflect what your new image will do.
 3. Make sure to edit the lines starting with `Create` to provide default examples
     that will be listed when 'due --create help' is run
 4. And, of course, edit and add files as necessary.

**TIP** You can use relative pathed soft links to reference other files under the `templates` directory. The frr build has a somewhat arbitrary example of this for the debian-package `duebuild` script. This can be useful if you have templates that share common code.

# Advanced - Template sub types

If you find you are creating many templates with minor differences, you can use **`sub-type`** directories to implement
a kind of class inheritance to reduce file repetition. Each `sub-type` directory supplies additional files to be
added to the merge directory the container is created out of.

**Note:** it is still possible to reduce file duplication by having relative soft links between template directories. The files the links reference will get copied in just fine.

## Practical Example
See the [redhat](./redhat) and [suse](./suse) directories for sub-types.

## Abstract Example
Given a directory path:
  `due/templates/foo/sub-type/bar/sub-type/baz`
  Where:
  *    **foo:** has files A and B
  *    **sub-type:** only contains types of images
  *    **bar:** has files B and C
  *    **sub-type** only contains types of images
  *    **baz:** has files B and D

	When specifying `--use-template baz`
	...the build code will go searching for it, and copy files from every directory that is **not** `sub-type` in the path to the target template. Those files will be copied in to the merge directory from top to bottom, so that the merge directory will have:
  * 	A - supplied by foo, as nothing overwrote it
  * C - supplied by bar
  * B - supplied by baz. Bar overwrote the copy supplied by foo, but baz was processed last, and its copy overwrote the others.
  * D - supplied by baz.

This is a bit much for a small number of containers, but if you have a proliferation case, where different releases may be accessing release specific components in a local repository. Here is a less abstract configuration:

## Less Abstract Example
  Two directories:
  * /templates/alpha-release/sub-type/package-build/sub-type/developer-env
  * /templates/alpha-release/sub-type/package-build/sub-type/release-env
  * /templates/alpha-release/sub-type/firmware-build/sub-type/developer-env
  * /templates/alpha-release/sub-type/firmware-build/sub-type/release-env
Where:
  * alpha-release has repository keys for alpha release.
  * package-build has additional tools for building packages.
  * firmware-build builds firmware binaries using packages from the alpha-release repository.
  * ...and developer/release-env hold sources.list files to release and developer package repositories.

repository: CumulusNetworks/DUE

repo_name: CumulusNetworks/DUE


text:
# StackStorm job monitor

With [StackStorm timers](https://docs.stackstorm.com/rules.html#timers) it's possible to execute batch jobs
periodically. With a dashboard it's easy to see which jobs are running and if their last status was success or failed.

Each batch job can be a workflow or action. Let's say we have a StackStorm my_job pack. The StackStorm job monitor
can show all the workflows/actions of the my_job pack. The complete frontend is derived from the awesome
[https://github.com/jan-molak/jenkins-build-monitor-plugin.git](https://github.com/jan-molak/jenkins-build-monitor-plugin.git).
All the data is retrieved with one JSON AJAX request to a Flask python application. The python application retrieves
and combines information from the StackStorm API into the proper dashboard format. View the *.py files in this
repository for more info.

![StackStorm job monitor](docs/stackstorm-job-monitor.png)

## Steps to update this software

### 1) Get asset files
    git clone https://github.com/jan-molak/jenkins-build-monitor-plugin.git
    mv jenkins-build-monitor-plugin/build-monitor-plugin/src/main/webapp/* .

### 2) Verify if the HTML source code is still valid or needs updates

It's easiest to display the HTML source code of a Build Monitor View in an active Jenkins installation. Otherwise
you can look at [https://github.com/jan-molak/jenkins-build-monitor-plugin/blob/master/build-monitor-plugin/src/main/resources/com/smartcodeltd/jenkinsci/plugins/buildmonitor/BuildMonitorView/index.jelly](https://github.com/jan-molak/jenkins-build-monitor-plugin/blob/master/build-monitor-plugin/src/main/resources/com/smartcodeltd/jenkinsci/plugins/buildmonitor/BuildMonitorView/index.jelly)

repository: pietervogelaar/stackstorm-job-monitor

repo_name: pietervogelaar/stackstorm-job-monitor


text:
---
layout: post
title:      "What I know about JavaScript Closure - part I"
date:       2020-03-22 21:27:40 -0400
permalink:  what_i_know_about_javascript_closure
---

Recently, I am trying to work on the google map, to have google map display in my project. I used react-google-maps package. By reading the [spec](https://www.npmjs.com/package/react-google-maps) of react-google-maps, there is a term "**HOC**". It stands for **Higher-Order Component**. and the concept of it is derived from "**HOF**", it stands for **Higher-Order Function**.   I have heard this term before, and I would like to know what is it.

### First class function
In JavaScript,  functions are first class functions, they can be treated like any oth er variables.
A first class function can be:
* passed as an argument to other functions => we call this function is a callback funtion.
* returned by another functions
* assgined as a value to a variable.

### Higher Order Function
**It is a function that takes a function as an argument, or returns a function.**
We already encoutered a lot of functions that take a function/functions as arguments to other functions.

**Here, I would like to focus on returning a function. **
The reason is that when I saw this statement, there was another word came up from my mind, closure. I did not know if this kind of connection is relevant or not. You are welcome to comment on this.

### Closure
> What is a Closure?
> A **closure** is the combination of a function bundled together (enclosed) with references to its surrounding state (the **lexical environment**).
> In other words, a **closure** gives you access to an outer functions' scope from a inner function.
>

Closure defines how a function can maintain a record of the environment in which it was called. It means that a function can keep track of the arguments and variables it was initally called with, even when it's called outside fo that scope.

#### Why closure matters
Closures are one of the most powerful features of JavaScript. JavaScript allows for the nesting of functions and grands the inner function full access to all the variables and functions defined inside the outer function, and all other variables and functions that the outer function has access to.

```
function clickMe(msg) {
    let count = 0;
    return function(){
        count += 1;
        console.log(`${msg} has been click ${count}`);
    }
}

let click = clickMe(`clickMe button`);
click();
click();
click();
```

when clickMe(msg) is called, it return anonymous function, which is assigned to click. so clck is presented as function name. click() to evoke the function delclared insdie function clickMe.

Output:

```
clickMe button has been click 1
clickMe button has been click 2
clickMe button has been click 3
```
From  the output, 1, 2, 3 are the value of count, and clicMe button is the parameter that I passed in when I call ClicMe.
Even click is called outside of clickMe function, but it still can access count, and msg from it outer environment enclosed inside of its parent function (i.e. clickMe).

Next post will discuss the use-cases for Closure.

extension: markdown


text:
# openvidu-webcomponent
 Check it on GitHub

OpenVidu Web Component is the simplest and quickest way to add videoconference capabilities to your existing web application. It brings many of the features of OpenVidu platform, making it very powerful.
With just a few lines of code you will have your first video call working!

## Running this tutorial

1) Clone the repo:

```bash
git clone https://github.com/OpenVidu/openvidu-tutorials.git
```

2) You will need an http web server installed in your development computer to execute the tutorial. If you have _node.js_ installed, you can use [http-server](https://github.com/indexzero/http-server) to serve application files. It can be installed with:

```bash
npm install -g http-server
```

3) Run the tutorial:

```bash
http-server openvidu-tutorials/openvidu-webcomponent/web
```

4) _openvidu-server_ and _Kurento Media Server_ must be up and running in your development machine. The easiest way is running this Docker container which wraps both of them (you will need [Docker CE](https://store.docker.com/search?type=edition&offering=community)):

```bash
docker run -p 4443:4443 --rm -e openvidu.secret=MY_SECRET openvidu/openvidu-server-kms:2.6.0
```

5) Go to [`localhost:8080`](http://localhost:8080) to test the app once the server is running. The first time you use the docker container, an alert message will suggest you accept the self-signed certificate of _openvidu-server_ when you first try to join a video-call.

> If you are using **Windows**, read this **[FAQ](/troubleshooting/#3-i-am-using-windows-to-run-the-tutorials-develop-my-app-anything-i-should-know)** to properly run the tutorial

> To learn **some tips** to develop with OpenVidu, check this **[FAQ](/troubleshooting#2-any-tips-to-make-easier-the-development-of-my-app-with-openvidu)**

## Understanding the code

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

-   `openvidu-webcomponent-{VERSION}.js`: JavaScript file of OpenVidu Web Component. You don't have to manipulate this file.
-   `openvidu-webcomponent-{VERSION}.css`: styles for OpenVidu Web Component. You don't have to manipulate this file.
-   `app.js`: sample application main JavaScript file.
-   `index.html`: HTML code of the application.

Let's see how OpenVidu Web Component works:

---

#### index.html

Inside of the `head` section of `index.html`, we reference our `app.js` script and `openvidu-webcomponent` files:

```html
<head>

    <!--... other imports ...-->

    <script src="app.js"></script>
    <script src='openvidu-webcomponent-{VERSION}.js'></script>
    <link rel="stylesheet" href="openvidu-webcomponent-{VERSION}.css">
</head>
```

As you can see, the `index.html` body has the form to connect to a video-session and the **OpenVidu Web Component**, which starts hidden:

```html
<body>

    <!-- Form to connect to a video-session -->
    <div id="main" style="text-align: center;">
        <h1>Join a video session</h1>
        <form onsubmit="joinSession(); return false" style="padding: 80px; margin: auto">
            <p>
                <label>Session:</label>
                <input type="text" id="sessionName" value="SessionA" required>
            </p>
            <p>
                <label>User:</label>
                <input type="text" id="user" value="User1" required>
            </p>
            <p>
                <input type="submit" value="JOIN">
            </p>
        </form>
    </div>

    <!-- OpenVidu Web Component -->
    <openvidu-webcomponent style="display: none;"></openvidu-webcomponent>

</body>
```

---

#### app.js (I): OpenVidu Web Component events

OpenVidu Web Component emits events _`joinSession`_, _`leaveSession`_ or _`error`_, so we can handle them in our JavaScript code.
We just need to get the element once the document is ready and add all the listeners we want:

```javascript
$(document).ready(() => {
    var webComponent = document.querySelector('openvidu-webcomponent');

    webComponent.addEventListener('joinSession', (event) => {
        // Do something
    });
    webComponent.addEventListener('leaveSession', (event) => {
        // Do something
    });
    webComponent.addEventListener('error', (event) => {
        // Do something
    });
});
```

In this tutorial, we just alternate the view between the form and the web component, hiding or showing them when receiving `joinSession` or `leaveSession` events.

---

#### app.js (II): Configuring OpenVidu Web Component

Method `joinSession()` gets:

 - The form input values, with the video-call to connect and the nickname the user will have in it.
 - The `token` from OpenVidu Server. Check out [next point](#get-a-token-from-openvidu-server) to see how this is done.

When we have our token available, the only thing left to do is to give the desired configuration to openvidu-webcomponent. To do so we use an object with three parameters: `sessionName`, `user` and `token`.

- `sessionName`: the session name that will be displayed inside the component
- `user`: the nickname that the user will have in the session
- `token`: the retrieved token from OpenVidu Server

```javascript
function joinSession() {
    var sessionName = document.getElementById('sessionName').value;
    var user = document.getElementById('user').value;

    getToken(sessionName).then((token) => {
        var webComponent = document.querySelector('openvidu-webcomponent');
        webComponent.sessionConfig = { sessionName, user, token };
    });
}
```

That's it. Once you configure the token into the webcomponent, it will automatically join the proper session (`joinSession` event will be dispatched so you can update your web). The user will see in the webcomponent all other users joined to the same session and will publish the webcam. You have a video-call working!

---

#### Get a _token_ from OpenVidu Server

	WARNING: This makes this tutorial an insecure application. We need to ask OpenVidu Server for a user token in order to connect to our session. This process should entirely take place in our server-side, not in our client-side. But due to the lack of an application backend in this tutorial, the JavaScript code itself will perform the POST operations to OpenVidu Server

```javascript
getToken(sessionName).then((token) => {
    // Send the 'token' to OpenVidu web component
});
```

In a production environment we would perform this operations in our application backend, by making use of the [API REST](/reference-docs/REST-API/), [OpenVidu Java Client](/reference-docs/openvidu-java-client/) or [OpenVidu Node Client](/reference-docs/openvidu-node-client/). Here we have implemented the POST requests to OpenVidu Server in a method `getToken()` that returns a Promise with the token. Without going into too much detail, this method performs two _ajax_ requests to OpenVidu Server, passing OpenVidu Server secret to authenticate them:

-   First ajax request performs a POST to `/api/sessions` (we send a `customSessionId` field to name the session with our `sessionName` value retrieved from HTML input)
-   Second ajax request performs a POST to `/api/tokens` (we send a `session` field to assign the token to this same session)

You can inspect this method in detail in the [GitHub repo](https://github.com/OpenVidu/openvidu-tutorials/blob/master/openvidu-webcomponent/web/app.js#L43).

## Extra features of OpenVidu Web Component

#### Alternatives to connect to OpenVidu session

In the example above, **OpenVidu Web Component** receives the `sessionConfig` parameter dynamically like this:

```javascript
webComponent.sessionConfig = { sessionId, user, token };
```

But you can also set them statically, for example if you are building your template in the backend:

```html
<openvidu-webcomponent session-config='{"sessionName":"SessionA", "user":"User1", "token": "TOKEN_RETRIEVED_FROM_OPENVIDU_SERVER"}'></openvidu-webcomponent>
```

And if you want to let the webcomponent get the token for you, you can just dispense with the token and provide two more attributes to it. This is only meant for developing purposes, as you need to hardcode the secret of your OpenVidu Server in the JavaScript code:

```html
<openvidu-webcomponent session-config='{"sessionName":"SessionA", "user":"User1"}'
openvidu-server-url="https://localhost:4443" openvidu-secret="MY_SECRET"></openvidu-webcomponent>
```

	WARNING: As you can see, when you add parameters to OpenVidu web component statically, you have to replace the camelCase with a hyphen between words.

#### Close the session dynamically

You can also disconnect the user from the session assigning dynamically `undefined` to the **sessionConfig** property :

```javascript
ov.sessionConfig = undefined;
```

#### Choose a theme

OpenVidu  allows you to choose between two themes. By default, the theme selected is **dark theme** but if you prefer change it for a **light them**, you can add `theme="light"`

```html
<openvidu-webcomponent theme="light"></openvidu-webcomponent>
```


text:
| Q             | A
| ------------- | ---
| Branch?       | master
| Minor version?      | (x.y) <!-- check composer.json file -->
| Hotfix?       | yes  <!-- don't forget to update src/**/CHANGELOG.md file -->
| Hotfix?       | no  <!-- don't update src/**/CHANGELOG.md file -->
| Refactoring?  | yes <!-- explain -->
| New feature?  | yes <!-- don't forget to update src/**/CHANGELOG.md file -->
| New feature?  | no <!-- don't update src/**/CHANGELOG.md file -->
| BC breaks?    | yes/no
| Deprecations? | yes <!-- don't forget to update UPGRADE-*.md file -->
| Deprecations? | no <!-- don't update UPGRADE-*.md file -->
| Tests pass?   | yes/no

<!-- Bug fixes must be submitted against the minor branch affected         -->
<!-- features and deprecations must be submitted against the master branch -->
<!-- Replace this comment by a description of what your PR is solving      -->

repository: studiomado/query-bundle

gha_language: PHP

repo_name: studiomado/query-bundle