text:
# Space War

![space_war.gif](https://github.com/gauravano/space-war/blob/master/images/space_war.gif)

Space War is a arcade style browser game where player has to destroy all the falling enemies in order to survive and gain score.

Player has 3 lives at start of the game, it decreases each time a enemy's ship pass through the player's ship. The player's lives will become 0 if any of the enemy ship collides with it.
When there are no lives left with the player, game is over.

### Scoring:
Player will get the score for killing every enemy ship. Destroying a Enemy1 ship will add 10 points and destroying Enemy2 ship will add 20 points to the player's score.

### Enemy
There are two types of enemy ships in the game:

#### Enemy 1
 - Destroying it, will add 10 points to the player score.
 - Initial velocity is 2 frames/sec
 - With each new level, the enemy velocity will increase by 1

#### Enemy 2
 - Destroying it, will add 20 points to the player score.
 - Initial velocity is 3 frames/sec
 - With each new level, the enemy velocity will increase by 1

### Levels
There are infinite level in this game. Player will start with Level 1 and level count will increase, each time player score become greater than multiple of 300.
With each new level, enemy's ship velocity will increase by 1, making it difficult for player to kill it and survive.

## Implementation Approach

I started the project using the provided demo code. I gone through all the instructions and implemented all the steps. After that, I had a running game with me but that looked very basic.

I completed the addition implementations section after that, score count addition, gameover function implementation, new enemy created and levels created. So, at this point, I have all functionality ready but still game looks very basic(and bore).

So, I did some more work on styling, images, sounds, etc which can be seen here - https://github.com/gauravano/space-war/commits/master

The final game can be played at https://gauravano.github.io/space-war/ .

Below are the details of some important functions(from index.js) involved in the gameplay:

**1. Start function**

```js
function start() {
    canvas.font = "800 80px Verdana";
    var gradient = canvas.createLinearGradient(0, 0, canvasElement.width, 0);
    gradient.addColorStop("0", " red");
    gradient.addColorStop("0.5", "yellow");
    gradient.addColorStop("1.0", "red");
    canvas.fillStyle = gradient;
    canvas.fillText("SPACE WAR", 60, 100);

    var playButton = `<button id="playButton" onclick="reset()"></button> `
    $("#maindiv").append(playButton);

    var image = new Image();
    image.src = "./images/space_bar.png";
    image.onload = function () {
        canvas.drawImage(image, 40, 378, 220, 48);
    }

    var image2 = new Image();
    image2.src = "./images/arrow_keys.png";
    image2.onload = function () {
        canvas.drawImage(image2, 320, 330, 200, 100);
    }

    canvas.font = "800 25px Verdana";
    canvas.fillStyle = "yellow";
    canvas.fillText("Press SPACE to shoot", 30, 458);
    canvas.fillText("Press LEFT & RIGHT", 300, 458);
    canvas.fillText("arrow keys to move", 320, 480);

}
```

It is called after the resource loading is done. This function shows the welcome screen of the game, showing name of the game, playing instructions with images, and Start game button using which player can start the game.

**2. Reset Game**

```js

function reset() {
    Sound.reset();
    Sound.play("kick_shock");
    if (document.getElementById("restartButton") != undefined) {
        var elem = document.getElementById("restartButton");
        elem.parentNode.removeChild(elem);
    }

    if (document.getElementById("playButton") != undefined) {
        var elem = document.getElementById("playButton");
        elem.parentNode.removeChild(elem);
    }
    level = 1;
    playerBullets = [];
    enemies = [];
    explosions = [];
    enemy2counter = 5;
    player.lives = 3;
    player.score = 0;
    partition = 300;
    enemyVelocity = 2;
    player.x = 300;
    player.y = 440;

    interval = setInterval(function () {
        draw();
        update();
    }, 1000 / FPS);
}
```
  Reset function re-initializes the value of the variables and start the game i.e., falling of enemies, shooting, etc will begin after this function is called. The background song is also played after entering in this function. It also contains the infinite loop which updates and renders the canvas everytime. This function is called when user presses start button on entry page or when user presses reset button after game over.

**3. Game Over function**

```js
function gameOver() {
    var image = new Image();
    image.src = "./images/gameover.png";
    image.onload = function () {
        canvas.drawImage(image, 100, 100, 400, 140);
    }
    Sound.play("GameOver");

    canvas.font = "800 34px Verdana";
    canvas.fillStyle = "yellow";
    canvas.fillText("YOUR SCORE: " + player.score, 145, 300);

    var restartButton = `<button id="restartButton" onclick="reset()"></button> `
    $("#maindiv").append(restartButton);
    clearInterval(interval);
}
```

This function is called when player lose all its lives. This function stops the game, shows the reset button and final score of the player. By pressing reset button, player can start a new game.

**4. Render entities**

```js
function renderEntities(list) {
    for (var i = 0; i < list.length; i++) {
        renderEntity(list[i]);
    }
}

function renderEntity(entity) {
    canvas.save();
    canvas.translate(entity.pos[0], entity.pos[1]);
    entity.sprite.render(canvas);
    canvas.restore();
}
```

Render entities function receives explosions array as parameter and calls render entity on each object(explosion) present in the array. A explosion is shown by running a sprite image so render entity function is called for each explosion which then shows the explosion as a animation on the canvas using functions of sprites.js

## Code Organization

```
  ├─ css
     └─ style.css
  ├─ images
     ├─ arrow_keys.png
     ├─ background.png
     ├─ bullet_enemy.png
     ├─ enemy1.png
     ├─ enemy2.png
     ├─ favicon-96x96.png
     ├─ gameover.png
     ├─ player.png
     ├─ restartButton.png
     ├─ space_bar.png
     ├─ sprites.png
     └─ startButton.png
  ├─ scripts
     ├─ index.js
     ├─ jquery.hotkeys.js
     ├─ jquery.min.js
     ├─ key_status.js
     ├─ resources.js
     ├─ sound.js
     ├─ sprite.js
     ├─ sprite2.js
     └─ util.js
  ├─ sounds
     └─ explosion.mp3
     ├─ GameOver.mp3
     ├─ kick_shock.mp3
     ├─ main.mp3
     └─ shoot.mp3
  ├─ index.html
  └─ README.md

```

### CSS
css directory contains all the stylesheets used in the application

**style.css** is the stylesheet containing all the styling used in the application. It is imported in index.html file.

### Images

images directory contains all the images used in the application at all the places.

**arrow_keys.png** is the image of arrow keys which appear at start of the game and direct user to use "left" and "right" arrow key for moving the player left and right

**background.png** is the image of the background which is used in application. Background remain same throughout the application.

**bullet_enemy.png** is the image of the bullet fired by the player's ship.

**enemy1.png** is the image of the Enemy1 ship

**enemy2.png** is the image of the Enemy2 ship

**favicon-96x96.png** is the image used as favicon for the HTML page.

**gameover.png** is the image that appear on canvas when game is over for player.

**player.png** is the image of the player's ship.

**restartButton.png** is the image of the reset button which appear on canvas after the game is over, placed there for restarting the new game.

**space_bar.png** is the image showing spacebar key. It appears at the start of the game, instructing player to press "space" for firing bullet.

**sprites.png** is the image sprite containing different images of the game. I am using collision images from this image sprite.

**startButton.png** is the image of Start button which appears at the start of the game, placed for starting the game.

### Scripts
scripts directory contains all the JS scripts used in the application. All the scripts contained in this folder are imported in index.html

**index.js** is the main JS file which contains all the the main gameplay functions

**jquery.hotkeys.js** contains jQuery Hotkeys plugin which makes key handling in the game much easier

**jquery.min.js** is the minified version of the JQuery

**key_status.js** contains a 16-line JS wrapper that makes event querying available. Using it, one can query the status of a key at any time by checking keydown.left, keydown.right, etc.

**resources.js** contains various JS functions which perform image loading prior to game start. It is used for specifically loading the sprites.png

**sound.js** contains functions which are used for playing sound, pausing sound and for performing various functions with the sound in the game.

**sprite.js** is a simple utility class using which loading and drawing images on canvas is done. Except collision animation, all the other images use this file.

**sprite2.js** is a utility class which perform loading and drawing of the image sprite on the canvas. It is used for sprites.png which is used for showing explosion animation.

**util.js** contains clamp function which keeps the player in the bound of canvas.

#### Sounds

**explosion.mp3** is the explosion sound played when player or enemy ship is destroyed.

**GameOver.mp3** is the sound played when game is over

**kick_shock.mp3** is the background sound played when player start playing game.

**main.mp3** is the alternative song for the game

**shoot.mp3** is the sound of the bullet

#### index.html
Contains the HTML of the game. It contains the canvas object.

#### README.md
Contains documentation of the game in the markdown format

## Screenshots

![Entry page](https://github.com/gauravano/space-war/blob/master/images/entry_page.png)

![screenshot from 2019-02-28 19-23-40](https://user-images.githubusercontent.com/20878070/53584101-e724bd80-3ba8-11e9-8d53-99b6b98a8190.png)

![Game over](https://github.com/gauravano/space-war/blob/master/images/game_over_space_war.png)

# Declaration

I have taken images and sounds from https://github.com/bohdan0/SpaceWar and https://github.com/jlongster/canvas-game-bootstrap

repository: grvsachdeva/space-war

repo_name: grvsachdeva/space-war


text:
# Cotoneaster ambiguus Rehder & E.H.Wilson SPECIES

#### Status
ACCEPTED

#### According to
The Catalogue of Life, 3rd January 2011

#### Published in
C. S. Sargent, Pl. wilson. 1:159. 1912 "<I>ambigua</I>"

#### Original name
null

### Remarks
null

repository: mdoering/backbone

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: mdoering/backbone


text:
---
layout: post
title: "FireEye Agent Stopped"
date: 2020-09-14
tags: [FireEye, Error 65548, Error1738]
---

FireEye Agent Stopped and will not restart.

# Index

* TOC
{:toc}

# Issue

Configuration File invalid when trying the upgrade/reinstall, agent stpped and will not start and

PS C:\Program Files (x86)\FireEye\xagt> .\xagt.exe --cfg-export 'C:\Install\export.cfg'
Error: 65548

# Resolution

Need to rename C:\ProgramData\FireEye\xagt

```powershell
Move-Item "C:\ProgramData\FireEye\xagt" "xagt.old"
```

Then run  (This will error with Error 1738) but it will re-create the xagt folder

```powershell
& "C:\Program Files (x86)\FireEye\xagt\xagt.exe" --cfg-export 'C:\Install\Export.cfg'
```

Then import the config from the installation media or from an exported working configuration from another server.
```powershell
& "C:\Program Files (x86)\FireEye\xagt\xagt.exe" --cfg-import 'C:\Install\GoodConfig.cfg'
```
OR
```powershell
& "C:\Program Files (x86)\FireEye\xagt\xagt.exe" --cfg-import 'C:\Install\agent_config.json'
```

license: MIT


text:
# Laser Cost Per Sheet
A sheet metal process that assumes blanking is performed with a laser.

Laser times are calculated based on number of pierces, cut length, and a look-up table for pierce times and cut rates based on material and thickness.

Material price is calculated by determining an estimate for parts per sheet and querying for a sheet cost from a table.

Forming times are calculated based on material type, thickness, and bend characteristics.

Material thickness and flat size is confirmed in the initial material operation and passed through the workpiece to downstream operations.

**Process Type**: Generic

gha_license_id: MIT


text:
---
layout: post
title: "05: 열 방정식의 해"
category: "DS/Calculus"
comments: true
tags: [Math, "Differential Equation"]
feature-img: "assets/img/13.jpg"
feature-title: ""
use_math: true
series: "Partial Differential Equations"
summary: "열 방정식을 풀어보자."
---

![image](https://user-images.githubusercontent.com/37871541/94908216-5167b780-04dc-11eb-863a-01b653a9217f.png){: .center}
![image](https://user-images.githubusercontent.com/37871541/94908229-5593d500-04dc-11eb-8405-4a6a6d700f06.png){: .center}
![image](https://user-images.githubusercontent.com/37871541/94908250-5c224c80-04dc-11eb-961b-730a8c5aa114.png){: .center}
![image](https://user-images.githubusercontent.com/37871541/94908263-617f9700-04dc-11eb-9be8-0b6d1d569c1c.png){: .center}

gha_language: Jupyter Notebook


text:
# General Data Protection Regulation

#### About GDPR compliance

The General Data Protection Regulation (GDPR) is a legal framework
formalized by the European Union (EU) in 2016. This regulation came into
effect from 25, May 2018, and affects any organization that processes
Personally Identifiable Information (PII) of individuals who live in
Europe. Organizations that fail to demonstrate GDPR compliance are
subjected to financial penalties.

WSO2 Identity Server (WSO2 IS) is designed based on privacy best
practices, and is fully compliant with GDPR. GDPR compliance in your IAM
and API security spaces can be completely fulfilled with WSO2 Identity
Server. This section outlines the major GDPR related features that WSO2
Identity Server supports, and also provides necessary references to
specific concepts within the section.

!!! Info

	  Do you want to learn more about GDPR?

	  If you are new to GDPR, we recommend that you take a look at our
	  tutorial series on *Creating a Winning GDPR Strategy*.

	  -   Part 1 - [Introduction to
    	  GDPR](https://wso2.com/library/article/2017/12/introduction-to-gdpr/)

	  -   Part 2 - [7 Steps for GDPR
  	  Compliance](https://wso2.com/library/article/2017/12/7-steps-for-gdpr-compliance/)

	  -   Part 3 - [Identity and Access Management to the
    	  Rescue](https://wso2.com/library/article/2018/2/identity-and-access-management-to-the-rescue/)

	  -   Part 4 - [GDPR Compliant Consent
    	  Design](https://wso2.com/library/articles/2018/03/creating-a-winning-gdpr-strategypart-4-gdpr-compliant-consent-design/)

	  For more resources on GDPR, see the white papers, case studies, solution
	  briefs, webinars, and talks published on our [WSO2 GDPR
	  homepage](https://wso2.com/solutions/regulatory-compliance/gdpr/). You
	  can also find the original GDPR legal text
	  [here](http://eur-lex.europa.eu/legal-content/en/TXT/?uri=CELEX%3A32016R0679).

#### Privacy by design and privacy by default

As a leading open source Identity and Access Management (IAM) product,
WSO2 Identity Server has been designed and architectured based on well
known *Secure by Design* and *Privacy by Design* principles.  With the
formalization of GDPR in 2016, the product architecture of WSO2 Identity
Server has been reviewed and fine-tuned to accordingly to support
privacy principles in an efficient manner, with less overhead to product
performance and user experience. WSO2 IS provides all privacy features
enabled in the product as default options, and uses up-to-date
algorithms and frameworks for all cryptographic operations such as data
encryption, signing, and hashing etc.

#### Consent identity management

Generally, identity data are scattered over several systems within an
organization. In order to reach GDPR compliance, it is required to
review, redesign, and modify each of these systems. This is a
maintenance overhead and consumes a significant portion of annual IT
budget and requires a specialized set of skills for continuous review
and modification process.

Moving to a GDPR compliant IAM solution, so that all identity profiles
are managed centrally and share only required data with other systems in
an on-demand manner through well-known security standards such as SAML,
OpenIDConnect greatly reduces maintenance overhead discussed above and
ensures the overall system architecture more secure and
privacy-friendly. Additionally, having a centralized identity system
simplifies implementations of some of the GDPR features such as the
*right to be forgotten*, *right for data portability* etc.

#### Consent life cycle management

According to GDPR, the consent is defined as “ *Any freely given,
specific, informed and unambiguous indication of the data subject’s
wishes by which he or she, by a statement or by a clear affirmative
action, signifies agreement to the processing of personal data relating
to him or her* ”. WSO2 IS fully supports for consent management in the
context of IS activities and can be used to manage consents from 3rd
party applications via secure RESTful consent management API.

It also supports the following features:

1.  When IS is acting as the Identity Provider(IdP), all the user
    attributes sharing (usually as security tokens such as SAML,
    IDToken, JWT etc.) with service providers (SP) are based on user
    consent.

2.  Gets user consent when IS is storing user attribute profiles based
    on self-sign up portal or security token received from a federated
    identity provider.
3.  IS user portal facilitates users to review the already given
    consents and revoke them, if necessary.

4.  Secure RESTful consent management API can be used to integrate read,
    modify, and delete consents managed by IS.

5.  Secure RESTful consent management API facilitates using of IS as the
    consent lifecycle management solution for 3rd party applications
    such as web and mobile applications.

#### Consent receipt specification (draft)

WSO2 IS also support for Consent Receipt Specification draft from
Kantara Initiative.

#### Right to be forgotten

This is one of the most important individual rights defined in GDPR. In
simple terms, an individual can request to complete removal his/her
personal data from the processing organizations. According to GDPR,
unless there is a clear and valid legal background, processing
organizations should fulfill such *forget me* requests.

WSO2 IS provides out of a box privacy toolkit to remove all identify
data from related databases and log files. This toolkit can be run
manually by organization administrators or can be automated so that
whenever a user profile gets deleted from the system, all the related
PII data gets removed from the system.

By considering performance overhead and automation flexibility, this
privacy toolkit is run separately from IS runtime. The privacy toolkit
is not just limited to the current version of IS rather, it can be used
with any new or old WSO2 platform product. Please note that, for older
versions of WSO2 products, it is required to download WSO2 Privacy
Toolkit from
**[here](https://github.com/wso2/identity-anonymization-tool)**
separately.

When it comes to Right to be forgotten, IS supports the following
features:

-   Delete the user by “Identity Admin” of the tenant. This will remove
    the user from any underlying “Read/Write” user store (JDBC/LDAP/AD).
-   Anonymize any retained traces of the user activity.
    -   Log Files
    -   Analytics data, related to Login, Session, Key Validation, etc.
    -   Key/Token data held at the Database layer.
-   Delete any unwanted data retained in the Database(due to performance
    reasons)
    -   Token(s) issued,
    -   Password History information.

Additionally, WSO2 Privacy Toolkit can be extended to clear privacy data
in any relational database or any textual log file, but that is out of
the scope of this document.

For more information on the topic, see [Removing References to Deleted
User
Identities](../../setup/removing-references-to-deleted-user-identities/).

####  Exercising individual rights

GDPR defines a set of strong individual rights that every data
processing organization should facilitate for their users. The Self-care
User Portal available with the WSO2 Identity Server is equipped to
exercise these individual rights by users themselves. Any organization
that deploys WSO2 IS, will have Self-care User Portal by default.

Following features are supported as part of Self-care User Portal:

-   **The right of transparency and modalities -** Personal data
    processing activities carried out by the organization, their
    purposes, and time-limits and what data are stored can be made
    transparent to users via the IS Self-care User Portal.

-   **The right of access -** Via the IS Self-care User Portal, users
    can access and review what personal data are stored in the
    processing organization.

-   **The right to rectification -** Individuals can rectify incorrect
    data on their user profiles by themselves by logging in to the Self-care
    User Portal.

-   **The right to restrict processing -** Individuals can make
    restrictions on their user profiles by themselves by logging into
    Self-care User Portal. Generally, this is done through by revoking
    an already given consent but can be extended to other usages as
    well.

-   **The right to be forgotten -** Individuals can remove their profile
    data or can be extended to send *forget-me* requests via the
    Self-care User portal.

-   **The right for notification obligation -** The Self-care User
    Portal can be extended to act as the notification center for
    individuals.

-   **The right to data portability -** Individuals can download their
    user profile in a structured, commonly used and machine-readable
    JSON document format through the Self-care User Portal.

-   **The right to object -** The Self-care User Portal can be extended
    to act as a communication channel to make objections on
    processing.

-   **Rights in relation to automated decision making and profiling -**
    The Self-care User Portal can be extended to act as a communication
    channel to make objections on automated decision making and
    profiling.

Following additional features are also supported in IS Self-care User
portal.

-   Revoking consent for all or specific attributes
-   Giving an expiry date for a consent

#### Personal data portability

Ability to download individual’s user profile as a structured, commonly
used and a machine-readable format is a requirement of GDPR. In WSO2 IS,
it is possible to use one of the following options to download user
profile as a structured JSON document.

1.  By logging into Self-care User Portal

2.  Invoking personal data export API(secure RESTful API)

Additionally, GDPR encourages to facilitate user profile provisioning
from the data processing organization to another organization based on
individuals requests automatically. SCIM 2 API supported in WSO2 IS can
be used to fulfill this requirement.

#### Personal data protection

WSO2 IS is subjected to regular reviews and updates for latest versions
of the crypto algorithm and latest versions of crypto frameworks. These
security updates are provided as WSO2 WUM service. Additionally, a
number of data encryption and protection features are supported by WSO2
IS.

Supported encryption features for personal data:

-   OAuth2 Access token

-   OAuth2 Refresh token

-   OAuth2 Authorization

-   ID Tokens

-   SAML Responses

Supported hashing features for personal data:

-   User credentials

GDPR also mandates processing organizations to make sure only authorized
people from the stuff based on “need to know” basic can access to user
profile data from individuals. Access control features supported in WSO2
IS  such as role-based access control (RBAC), attribute-based access
control can be used to cater this requirement.

!!! Info
	  For more information on Role-based Access control, Attribute-based
	  Access Control, and XACML, see [Access Control and Entitlement](../../get-started/access-control-and-entitlement-management) page.

repository: NipuniBhagya/docs-is

repo_name: NipuniBhagya/docs-is


text:
## Configure terraform

1. Export environment variables for credentials
```
export AWS_PROFILE=lbernail
export AWS_DEFAULT_REGION=eu-west-1
```
1. Create bucket to store states (you must choose a unique name)
```
aws s3 mb s3://tfstates
```

repository: lbernail/demotiad

repo_name: lbernail/demotiad


text:
# Firmware Refactor Design Document

*Author:* Dallas Downing

## Motivation

The firmware for IGVC has largely been neglected for the past few years, being an afterthought once more pressing problems have been addressed. However, we have reached a point where the basic code running on the mbed can no longer support the needs of the team. The goal of this firmware redesign is to tackle some of the main challenges with the firmware at last competition and make it easier to maintain and alter in the future. This will also (hopefully) motivate a new incentive to apply actual design decisions in making changes to the code later.

Here is a short list of the problems that have been identified with the firmware and the mbed. Note that this is not a comprehensive list as many issues depend on the electrical system and the main computer. Most of the issues are explained later in the design section.

- All mbed code is contained in one `main.cpp` file, which makes understanding and editing the code difficult
- Asynchronous networking code (for communicating with the computer) runs in the same thread as “real-time” code (PID control)
- There are no errors messages sent from the mbed to the computer, making it difficult to see what the mbed is doing when it fails or encounters a problem
- Messages sent between the computer and the mbed follow the same format with many optional fields instead of using dedicated message formats for different commands
- The E-stop signal is treated as a normal digital input but should be an interrupt input to stop the mbed and computer quickly
        - Note that the motors are disconnected electrically when the e-stop is triggered

There are also a number of new features being added to the electrical system that the mbed now must support. Part of the redesign was made keeping these features in mind. The specifics of their implementation has been left out of this document, but it should be clear how one might implement such features using the new firmware.

- A “virtual bumper” system using lidar lites that can warn and stop the robot preemptively before it hits an obstacle
- A diagnostics system with various sensors for detecting hardware issues with the robot

## Background

The mbed is one of the most important components of the robot.  The mbed is the bridge that connects the computer with the rest of the electrical system. This section will briefly go over what the mbed does to provide context for the upcoming design changes.

Here are the main tasks that it performs:

- Connects to the computer to receive PID values and motor commands (in the form of speeds for the left and right motor)
- Performs PID calculations for bringing the motors to the right speeds
- Receives signals from the encoders and keeps track of motor speeds and direction
- Sends serial commands to the motor controller to properly drive the motors
- Checks for when the e-stop is triggered and disables the motors when it is
- Enables the flashing safety light when the robot is operating
- Sends feedback to the computer about the state of the robot (current motor speed, e-stop status, battery voltage)

The mbed and the computer communicate via Ethernet. The mbed basically acts as a server and sets up a TCP socket. The motor controller node on the computer connects to the socket and sends messages to the mbed. Here are the basic tasks that the ROS node performs:

- Sends the PID values that the mbed should use
- Subscribes to the `/motor` ROS topic and receives motor speeds to send to the mbed
- Advertises the encoder speeds, robot enable status, and battery voltages to the ROS topics `/encoders`, `/robot_enabled`, and `/battery`, respectively
- Keeps track of battery voltages over time and warns when it gets too low

Since much of the code on the mbed is changing, the motor controller node will also need to be updated to communicate properly. However, it’s overall structure will largely stay the same. Currently the mbed doesn’t do a lot of error reporting to the computer but the revisions to the electrical system will allow that. The mbed will monitor the robot more and thus will send more error information to the computer. The mbed will also support two more status lights for easier user debugging.

## Design

The new design of the firmware breaks down into 3 main categories: multi-threading, code structure, and message formats. There are some other miscellaneous design features described at the end of this section.

### Multi-Threading

The main problem plaguing the firmware is the fact that all code run by the mbed is contained in the same main while loop. All networking and motor control code occurs sequentially, which is not ideal for the system. The main change I propose is to create three new threads: the networking thread, the motor control thread, and the diagnostics thread.

The threading changes will require using RTOS in Mbed OS 5.

#### Networking

The networking thread will contain all the code for communicating with the computer. It will set up the TCP socket for the computer to connect to and will send and receive messages. The code for parsing requests should be contained in this thread. With the improved message formats proposed later in this document, the logic for parsing and forming the messages should be greatly simplified.

This will also be the starting point for the other threads. Ideally, the other threads will be started before establishing the TCP socket. The other threads would run idly in the background until necessary since the TCP socket could be reset if connection is lost.

#### Motor Control

The motor control thread will contain the code for the PID control loop. It will use a `MotorController` class (described below) to send commands to the motor controller. It will also keep track of the encoder ticks. This thread is fairly simple, as it will likely reuse a lot of existing code.

#### Diagnostics

The diagnostics thread will contain the code for communicating with the CAN devices and diagnostics board. It will be in charge of monitoring those devices and taking appropriate actions when necessary. The main function of the thread is constructing messages to send back to the computer for bagging and debugging. The first step in implementing this will be defining what the devices are and how they work. In the future, wrapper classes for the devices and diagnostics board may be useful. This code will change the most frequently in the coming year.

---

### Code Structure

Currently, the firmware follows no specific structure. All code is kept in one `main.cpp` file and follows no overall design pattern. The overall code structure will be fixed with the changes described in the threading section, but this section will propose some changes that will help justify those changes and will make implementing the threads easier. Most of these changes will remove code from the `main.cpp` file into additional header/cpp files.

#### `MotorController`

A `MotorController` wrapper class will be created to handle communicating with the motor controller and will abstract its functionality. This change will accomplish 2 things: declutter the code for sending commands to the motor and achieve the overall software goal of writing self-documenting code. Here is how the motor controller is currently called in the code:

``` Serial g_serial(p13, NC, 9600); ```

This does nothing to explain what it is or how it works. A similar issue can be found in the PID control loop. The latter half of the `pid()` method is dedicated to converting the speed into motor values. This code should be taken out of that method and moved to the MotorController class. Here are the base functions that the `MotorController` class should provide:

- Set the speeds of left and right motors independently
- Get the speeds sent to the motors
- Stop the motors
- Advanced control of the motors (slowly stop the motors, turn around, etc.)

#### `EncoderPair`

An `EncoderPair` wrapper class will accomplish the same objective as the `MotorController`. It will handle the interrupt input and the digital input for the encoders. It will keep track of and return the tick counts for each encoder. The main advantage for using this is that is removes some global variables and some functions from the `main.cpp` file. While this change is not super involved or critical, it will allow future modification to improve encoder performance.

#### E-Stop Status Interrupt

Currently the e-stop status is read in the middle of the main while loop. For safety, the e-stop signal should be treated like a real-time signal, and changes to that pin should be read from an interrupt function. This will allow the mbed to stop the motors as soon as possible upon receiving an e-stop signal.

#### Miscellaneous Functions and Constants

To further reduce clutter in the `main.cpp` file, a separate header/cpp file should be made for the various functions and constants that do not belong to any classes. For clarity, all constants should be made variables with the `const` keyword instead of macros. Variables and structs that serve little purpose (such as the pwm variables and the `SpeedPair` struct) should be removed entirely.

When the CAN devices and diagnostics boards are complete, new classes should be defined to help abstract their tasks. The details of these components are not included in this document as testing these boards still needs to take place. This also includes the functionality of the “virtual bumper” implemented with Lidar Lites.

---

### Network Messages

The current way that the mbed communicates with the server is with Protobuf messages. The big issue here is that each device (ROS node and the mbed) use their own message with several optional fields (a generic message being used as a multitool). This makes the logic for parsing the messages unnecessarily complex and makes understanding what the message does harder. This section will propose some new message types that a singular purpose, making parsing and constructing messages easier.

#### `PIDValues`

This message is sent by ROS to the mbed. It will contain the PID values that the mbed should use. This includes the P, I, and D constants for the left and right motor and the KV value for feed-forwarding for both motors. This message should only be sent once when the Motor Controller ROS node is started. This will be the largest message sent by ROS to the mbed. When the mbed sets the PID constants, it should return a new message to the ROS node, confirming that the values were set correctly. Again, the mbed should only send this message once, when it receives the message from ROS.

There should be an additional field in the message for indicating whether the message is setting the constants (i.e. setPID = true, from ROS to mbed) or confirming the constants are correct (i.e. setPID = false, from mbed to ROS). This will be the only message that both sides send.

#### `SetMotorSpeeds`

This message is sent by ROS to the mbed. It will contain the speeds for each motor that the mbed should try to set. This will be the most sent message from ROS and should be the highest priority message for the mbed. The convention for the values is defined in the software stack.

Note that these are the only messages sent by ROS. Should more complex motor control be required, additional messages should be created and additional functions written in the `MotorController` class.

#### `MbedStatus`

This message is sent by the mbed to ROS. It will contain information concerning the motor control status for bagging and debugging purposes. It will also contain the e-stop status and battery voltage. This message will be sent fairly frequently, so it’s overall size should be restricted. It will only be sending the motor speeds, the output sent to motor controller, the time difference for this step, e-stop status, and battery voltage. Battery voltage may be removed from this message due to the addition of the diagnostics board if it is not needed frequently.

#### Diagnostics Messages

Since the diagnostics devices have not been well defined, it is impossible to determine what kind of monitoring information should be sent to the computer. Ideally, a singular summary message should be sent infrequently to the computer to make sure everything is working appropriately (i.e. one every 2 seconds). If certain information is needed more frequently, separate messages containing only the required data should be created.

It will be useful to create a generic string message for sending error messages to the computer. This would only be necessary if there are complex errors with the mbed code that cannot be detected with the various status lights. While its use case may not be easy to see at the moment, having the ability to send a text error message to the computer is a great advantage for debugging.

---

### Other Features

#### Watchdog Timer for Networking

The mbed should have a watchdog timer monitoring the TCP connection with the computer. Should the connection time-out, the mbed should stop the motors and attempt to send the computer a message. The timeout duration will require some testing with actual runs with the robot. The Watchdog class from mbed OS 5 can be used to implement it.

A watchdog can also be implemented in the motor controller node with a longer timeout than the mbed. This can be used to automatically reconnect with the mbed if the connection is dropped. This should be disabled during testing if it’s implemented, but can be enabled when running the course to prevent run-stopping errors.

#### ROS Node Changes

Most of the changes occur in the firmware on the mbed but changes will also be required in the ROS node. Mainly, the new message formats need to be defined and the functions for parsing and constructing the messages will need to be updated. Additionally, the node will need to support the new diagnostics data sent from the CAN devices and diagnostics board. This may require a new ROS topic for data like this. Further details on this should be discussed after the diagnostics devices have been well-defined.

#### Status Lights

The latest revision of the logic board includes pins for external status LEDs (besides the on-board LEDs). These and the existing LEDs were excluded from this document because the new functionality of the firmware can be defined before deciding what

---

## Required Work

The section will break down the implementation of this design document into 5 major groups. This is intended to help create a timeline for the order of work and help assign people to different tasks.

1. **Define diagnostics devices**
    1. Determine what CAN devices are available
    2. Determine what data those devices collect and send
    3. Determine what data the diagnostics board will send
    4. Determine the priority for the data
    5. Determine what behavior is desired for the diagnostics thread on the mbed
    6. Create messages for the diagnostics data
    * (This will likely require more electrical documentation)
2. **Clean up the code**
    1. Implement the `MotorController` class
    2. Implement the `EncoderPair` class
    3. Implement any classes needed for the diagnostics devices
    4. Move constants and miscellaneous functions to a new header/cpp file
    5. Update e-stop detection with interrupt function
3. **Implement multithreading**
    1. Move PID control loop to its own thread
    2. Create a diagnostics thread (even if it is empty)
    3. Add data protection to global variables
    4. Implement watchdog timer for networking thread
4. **Add new message formats**
    1. Update messages definitions with protobuf in firmware and software
5. **Update ROS node**
    1. Add parsing support for new messages
    2. Add functions for creating new messages
    3. Add watchdog for network connection

## Future Work

The new design of the firmware provides a usable platform for some interesting features. These are some ideas that can be implemented once the design changes have been implemented.

### Slip Detection

Wheel slippage is a major issue with motor control, especially on grass, wet surfaces, or wet grass. With an encoder class and dedicated PID thread, implementing an algorithm for slipping detection should be easier. While the changes do not explicitly support wheel slip detection, it does make the code easier to modify.

### Joystick Control with Mbed

Currently the mbed does not use it’s additional USB pins. In a future iteration of the logic board, a USB port can be added for connecting a controller. A class can be added in the PID loop to connect to a controller with a joystick to allow controlling the robot without having to boot up the computer. This will make moving the robot long distances easier, given the robot has batteries.

repository: RoboJackets/igvc-software

repo_name: RoboJackets/igvc-software


text:
---
title: Contributing
lang: en-US
sidebarDepth: 0
meta:
  - name: keywords
    content: pomerium community contributing pr code

description: >-
  This document describes how you can find issues to work on, fix/add
  documentation, and how setup Pomerium for local development.
---

# Contributing

First of all, thank you for considering contributing to Pomerium! You can have a direct impact on Pomerium by helping with its code or documentation. To contribute to Pomerium, open a [pull request](https://github.com/pomerium/pomerium/pulls) (PR). If you're new to our community, that's okay: **we gladly welcome pull requests from anyone, regardless of your native language or coding experience.**

## General

We try to hold contributions to a high standard for quality, so don't be surprised if we ask for revisions--even if it seems small or insignificant. Please don't take it personally. If your change is on the right track, we can guide you to make it mergeable.

Here are some of the expectations we have of contributors:

- If your change is more than just a minor alteration, **open an issue to propose your change first.** This way we can avoid confusion, coordinate what everyone is working on, and ensure that changes are in-line with the project's goals and the best interests of its users. If there's already an issue about it, comment on the existing issue to claim it.

- **Keep pull requests small.** Smaller PRs are more likely to be merged because they are easier to review! We might ask you to break up large PRs into smaller ones. [An example of what we DON'T do.](https://twitter.com/iamdevloper/status/397664295875805184)

- **Keep related commits together in a PR.** We do want pull requests to be small, but you should also keep multiple related commits in the same PR if they rely on each other.

- **Write tests.** Tests are essential! Written properly, they ensure your change works, and that other changes in the future won't break your change. CI checks should pass.

- **Benchmarks should be included for optimizations.** Optimizations sometimes make code harder to read or have changes that are less than obvious. They should be proven with benchmarks or profiling.

- **[Squash](http://gitready.com/advanced/2009/02/10/squashing-commits-with-rebase.html) insignificant commits.** Every commit should be significant. Commits which merely rewrite a comment or fix a typo can be combined into another commit that has more substance. Interactive rebase can do this, or a simpler way is `git reset --soft <diverging-commit>` then `git commit -s`.

- **Own your contributions.** Pomerium is a growing project, and it's much better when individual contributors help maintain their change after it is merged.

- **Use comments properly.** We expect good godoc comments for package-level functions, types, and values. Comments are also useful whenever the purpose for a line of code is not obvious.

- **Recommended reading**

  - [CodeReviewComments](https://github.com/golang/go/wiki/CodeReviewComments) for an idea of what we look for in good, clean Go code
  - [Linus Torvalds describes a good commit message](https://gist.github.com/matthewhudson/1475276)
  - [Best Practices for Maintainers](https://opensource.guide/best-practices/)
  - [Shrinking Code Review](https://alexgaynor.net/2015/dec/29/shrinking-code-review/)

## Code

### Build From Source

The following quick-start guide covers how to retrieve and build Pomerium from its source-code as well as how to run Pomerium using a minimal but complete configuration. One of the benefits of compiling from source is that Go supports building static binaries for a [wide array of architectures and operating systems](https://gist.github.com/asukakenji/f15ba7e588ac42795f421b48b8aede63) -- some of which may not yet be supported by Pomerium's official images or binaries.

#### Prerequisites

- [git](https://git-scm.com/)
- [go](https://golang.org/doc/install) programming language
- A configured [identity provider]
- A [wild-card TLS certificate]

#### Download

Retrieve the latest copy of pomerium's source code by cloning the repository.

```bash
git clone https://github.com/pomerium/pomerium.git $HOME/pomerium
```

#### Make

Build Pomerium from source in a single step using make.

```bash
cd $HOME/pomerium
make
```

[Make] will run all the tests, some code linters, then build the binary. If all is good, you should now have a freshly builtPpomerium binary for your architecture and operating system in the `pomerium/bin` directory.

#### Configure

Pomerium supports setting [configuration variables] using both environmental variables and using a configuration file.

#### Configuration file

Create a config file (`config.yaml`). This file will be use to determine Pomerium's configuration settings, routes, and access-policies. Consider the following example:

<<< @/docs/configuration/examples/config/config.minimal.yaml

#### Environmental Variables

As mentioned above, Pomerium supports mixing and matching where configuration details are set. For example, we can specify our secret values and domains certificates as [environmental configuration variables].

<<< @/docs/configuration/examples/config/config.minimal.env

#### Run

Finally, source the the configuration `env` file and run Pomerium specifying the configuration file `config.yaml`.

```bash
source ./env
./bin/pomerium -config config.yaml
```

#### Navigate

Browse to `external-httpbin.your.domain.example`. Connections between you and [httpbin] will now be proxied and managed by Pomerium.

### Offline Domains (OPTIONAL)

Publicly resolvable domains are central in how Pomerium works. For local offline development, we'll have to do some additional configuration to mock that public workflow on our local machine.

The following guide assumes you do _not_ want to expose your development server to the public internet and instead want to do everything, with the exception of identity provider callbacks, locally.

If you are comfortable with a public development configuration, see the Synology quick-start which covers how to set up your network, domain, and retrieve wild-card certificates from LetsEncrypt, the only difference being you would route traffic to your local development machine instead of the docker image.

#### Pick an identity provider friendly domain name

Though typically you would want to use one of the TLDs specified by [RFC-2606](http://tools.ietf.org/html/rfc2606) for testing, unfortunately, google explicitly does not support oauth calls to test domains. As such, it's recommended to use a domain you control using a wildcard-subdomain that you know will not be used.

If you do not control a domain, you can use `*.localhost.pomerium.io` which I've established for this use and has a [public A record](https://en.wikipedia.org/wiki/List_of_DNS_record_types) pointing to localhost.

#### Wildcard domain resolution with `dnsmasq`

If you are on a plane (for example), you may not be able to access public DNS. Unfortunately, `/etc/hosts` does not support wildcard domains and would require you specifying a new entry for each Pomerium managed route. The workaround is to use [dnsmasq](https://en.wikipedia.org/wiki/Dnsmasq) locally which _does_ support local resolution of wildcard domains.

#### OSX

1. Install `brew update && brew install dnsmasq`
2. Edit `/usr/local/etc/dnsmasq.conf` to tell dnsmasq to resolve your test domains.

```bash
echo 'address=/.localhost.pomerium.io/<IP_ADDRESS>' > $(brew --prefix)/etc/dnsmasq.conf
```

```bash
sudo mkdir -pv /etc/resolver
sudo bash -c 'echo "nameserver <IP_ADDRESS>" > /etc/resolver/localhost.pomerium.io'
```

1. Restart `dnsmasq`

```bash
sudo brew services restart dnsmasq
```

1. Tell OSX to use `<IP_ADDRESS>` as a the primary DNS resolver (followed by whatever public DNS you are using). ![osx dns resolution](./img/local-development-osx-dns.png)

#### Locally trusted wildcard certificates

In production, we'd use a public certificate authority such as LetsEncrypt. For local development, enter [mkcert](https://mkcert.dev/) which is a "simple zero-config tool to make locally trusted development certificates with any names you'd like."

1. Install `mkcert`.

```bash
go get -u github.com/FiloSottile/mkcert
```

1. Bootstrap `mkcert`'s root certificate into your operating system's trust store.

```bash
mkcert -install
```

1. Create your wildcard domain.

```bash
mkcert "*.localhost.pomerium.io"
```

1. Viola! Now you can use locally trusted certificates with pomerium!

| Setting                      | Certificate file location                   |
| ---------------------------- | ------------------------------------------- |
| `certificate_file`           | `./_wildcard.localhost.pomerium.io-key.pem` |
| `certificate_key_file`       | `./_wildcard.localhost.pomerium.io.pem`     |
| `certificate_authority_file` | `$(mkcert -CAROOT)/rootCA.pem`              |

See also:

- [Set up a local test domain with dnsmasq](https://github.com/aviddiviner/til/blob/master/devops/set-up-a-local-test-domain-with-dnsmasq.md)
- [USE DNSMASQ INSTEAD OF /ETC/HOSTS](https://www.stevenrombauts.be/2018/01/use-dnsmasq-instead-of-etc-hosts/)
- [How to setup wildcard dev domains with dnsmasq on a mac](https://hedichaibi.com/how-to-setup-wildcard-dev-domains-with-dnsmasq-on-a-mac/)
- [mkcert](https://github.com/FiloSottile/mkcert) is a simple tool for making locally-trusted development certificates

## Docs

Pomerium's documentation is available at <https://www.pomerium.io/docs>. If you find a typo, feel a section could be better described, or have an idea for a totally new application or section, don't hesitate to make a pull request change. There are few ways you can do this.

### Simple edits

The easiest way to fix minor documentation issues in Pomerium is to click on "Edit this page in Github" on any page.

![edit this page link](./img/contributing-edit-this-page.png)

Doing so will create a [fork](https://help.github.com/en/articles/fork-a-repo) of the project, allow you to [update the page](https://guides.github.com/features/mastering-markdown/), and create a [pull request](https://help.github.com/en/articles/about-pull-requests).

![edit this page link using github](./img/contributing-edit-this-page-github.png)

### Bigger changes

If you need to add a new page, or would like greater control over the editing process you can edit the docs similar to how you would make changes to the source code.

#### Pre-reqs

We use [VuePress](https://vuepress.vuejs.org) to generate our docs. Vuepress is a simple, [markdown](https://v1.vuepress.vuejs.org/config/#markdown) and [Vue.js](https://v1.vuepress.vuejs.org/config/#markdown) based static site generator. Before building the docs, you'll need to install the following pre-requisites.

1. [Node.js](https://nodejs.org/en/download/).
2. [Yarn](https://yarnpkg.com/lang/en/docs).

#### Make changes

Once you have Nodejs and Yarn installed, simply run `make docs` in a terminal which will install any required node packages as well as start up a development server. You should see something like the below, with a link to the local doc server.

```bash
success [19:02:54] Build f9f5f7 finished in 246 ms! ( http://localhost:8081/ )
```

Once you have the development server up and running, any changes you make will automatically be reloaded and accessible in your browser.

To add a new document, simply add a new file with the `.md` markdown extension. For example, this document would be `docs/community/contributing.md`.

To add a new document to the side or top-bar navigation, see `docs/.vuepress/config.js` and add that document to the desired section.

### PR Previews

We use [Netlify](https://www.netlify.com) to build and host our docs. One of nice features of Netlify, is that a preview of the docs are automatically created for each new pull request that is made, which lets you be sure that the version of your docs that you see locally match what will ultimately be deployed in production.

[configuration variables]: ../reference/readme.md
[download]: https://github.com/pomerium/pomerium/releases
[environmental configuration variables]: https://12factor.net/config
[httpbin]: https://httpbin.org/
[identity provider]: ../identity-providers/readme.md
[make]: https://en.wikipedia.org/wiki/Make_(software)
[wild-card tls certificate]: ../reference/certificates.md

repository: apibest/pomerium

repo_name: apibest/pomerium


text:
Title: NumberField

NumberField widget enables the creation of input fields that should contain a numeric value. It also provides formatting facilities to handle numeric and currency patterns.

<script src='http://snippets.ariatemplates.com/snippets/github.com/ariatemplates/documentation-code/%VERSION%/snippets/widgets/numberfield/Snippet.tpl?tag=wgtNumberField&lang=at&outdent=true' defer></script>

The whole list of configuration parameters is available in [NumberFieldCfg bean](http://ariatemplates.com/api/#aria.widgets.CfgBeans:NumberFieldCfg).

## Formatting patterns

You can use formatting patterns to specify how a number should be conventionally displayed, even as a currency. It can be defined as a combination of the following:

{| style="width:100%"
|-
! align="left" style="border-bottom: 1px solid black" | Symbol
! align="left" style="border-bottom: 1px solid black" | Location
! align="left" style="border-bottom: 1px solid black" | Meaning
|-
| 0
| Number
| Digit
|-
| #
| Number
| Digit, zero shows as absent
|-
| .
| Number
| Decimal separator
|-
| ,
| Integer
| Grouping separator
|-
| ¤ (\u00A4)
| Prefix or suffix
| Currency sign, replaced by currency symbol.
|}

The supported patterns are a subset of the [java.text.DecimalFormat](http://download.oracle.com/javase/1.4.2/docs/api/java/text/DecimalFormat.html) specs. More information are available at [localization and resources](localization_and_resources).

## Sample usage

The following sample shows how to create and use a NumberField widget, with a mandatory attribute for error checking and number format patterns. In order to fetch the entered value, variable binding is to be considered as the preferred solution. Please refer to the [textfield](textfield) widget for more informations.

<iframe class='samples' src='http://snippets.ariatemplates.com/samples/github.com/ariatemplates/documentation-code/%VERSION%/samples/widgets/numberfield/?skip=1' ></iframe>

In this sample, the first 3 NumberFields are the same except for the state, which is respectively mandatory, normal and disabled.
The fourth NumberField has a pattern, that is used both to interpret and display the number.

More information about the pattern are available at [localization and resources](localization_and_resources).


text:
# mm-framework-dotnet
Framework for dotnet core.

## Packages

| Package Name									| Purpose			|
| ----------------------------------------------| ----------------- |
| `MMFramework`									| MMFramework related stuff. |
| `MMFramework.Abstractions`					| Containing abstractions for MMFramework |
| `MMFramework.AspNetCore`						| ASP.NET Core instrumentation for MMFramework integration. |
| `MMFramework.AspNetCore.Abstractions`			| Containing abstractions for MMFramework.AspNetCore |
| `MMFramework.DependencyInjection`				| Microsoft.Extensions.DependencyInjection extensions for MMFramework services integreation. |
| `MMFramework.DependencyInjection.Abstractions`| Containing abstractions for MMFramework.DependencyInjection |
| `MMFramework.Swashbuckle`						| Swashbuckle.AspNetCore integration for ASP.NET Core auto swagger instrumentation. |
| `MMFramework.Swashbuckle.Abstractions`		| Containing abstractions for MMFramework.Swashbuckle |

repository: mathis-m/mm-framework-dotnet

gha_language: C#

repo_name: mathis-m/mm-framework-dotnet


text:
# Library for the Fraud Identification API

[![GoDoc](https://godoc.org/github.com/TengLun/kapiLib/fraudClient?status.svg)](https://godoc.org/github.com/TengLun/kapiLib/fraudClient) [![Go Report Card](https://goreportcard.com/badge/github.com/tenglun/kapilib)](https://goreportcard.com/report/github.com/tenglun/kapilib)

This is a privately created library to aid in using the Fraud Identification API, described here:

https://support.kochava.com/analytics-reports-api/fraud-api

## Import

Here is the import code:

```golang
import "github.com/tenglun/kfapi/fraudclient"
```

# Usage

Effort has been made to make this library simple and readable.

First, initiaze the client using your API key, and account id. The system will automatically detect if you are using the library
as a marketer or network (which changes the calls).

```golang
client, err := fraudclient.GetAccount("my_api_key", "my_accound_id")
```

### Client Options
Client Options can be passed in as functional options when the client is created. Stock functions are:
```golang
// SetDebugTrue turns debug logic on; client returns spoof data instead of real data for testing
SetDebugTrue()

// SetHttpClient allows a custom http client to be utilized
SetHTTPClient(httpClient *http.Client)

// SetBaseURL allows a custom domain to be hit instead of the proper domain
SetBaseURL(baseURL string)
```

## Retrieve Data

Once the account has been initialized, data can be returned using the "List" endpoint, or the "GatherDataFrom" endpoint.

```golang
response, err := client.List.Apps("fraud type",start time, end time)
```

Example for List Endpoint:
```golang
response, err := client.List.Apps(kfapi.AnonymousInstall, time.Unix(1510000000,0), time.Now())
```

Example for Gather Endpoint:
```golang
response, err := client.GatherDataFrom.Networks(kfapi.AdStacking, time.Unix(1510000000,0), time.Now())
```

### Filters

Filters can be added to modify the data returned. Filters can be passed using the Filter() function
as follows:
```golang
response, err := client.Data.Networks(kfapi.Adstacking, time.Unix(1510000000,0), time.Now(),Filter(NetworkId,In,"1344","2522","133","6352"),Filter(AppId,In,"5667"))
```

## Response

All of the responses will be in an exported struct format called KFResponse. This format is being used to both unify the response
structure from the various calls, as well as to allow an easier "turnaround", sending data back to the API to add or remove from the blacklist.

# Constants

When gathering information,
it must be accessed for one particular fraud type at a time. For convenience, constants have been added and exported from the library.

The constants are directly accessible from the library:
```golang
kfapi.AdStacking
kfapi.AnonymousInstall
kfapi.DeviceHighClickVolume
...
etc.
```

# Improvements Coming Soon

Currently, functionality is being worked on that will allow the return to be ported directly back to the API to add suspicious actors to the
blacklist, after some threshold has been applied.

Stay tuned for more developments.

repository: TengLun/kapiLib

gha_language: Go

repo_name: TengLun/kapiLib


text:
# LEO-DB - A Python based database software(NoSQL DB)

-> Hello, I am Malay Bhavsar. I have developed a database software entirely written in pure Python.

-> It all started back on 7th September 2020, when I started learning about database. I didn't quiet undestood it. So I came up with a solution that why don't I make a database software of my own! Which can help me understand and learn together.

-> It's previous versions had only basic functionalities and was not at all efficient.

# TRUNK - The support to application

-> We all know that if you have strong roots, then you stand strong! But along with that we also need a strong TRUNK to perform & Grow well.

-> LEO-DB-TRUNK is a database Module in which the tasks will be performed by importing and some coding!

-> All the code is listed in code_TRUNK.txt file.

-> Features:

            :> Export your database to CSV file.

            :> All basic function are present using which complex opertio can be performed.

            :> It is Fast and Reliable.

            :> It is Portable i.e. Just need to import(Latest Python requred to be installed)

            :> It is Consumes less space!

-> Drawbacks:

            :> Not safe yet to be used commercially.

repository: Leo-Malay/LEO-DB-TRUNK

repo_name: Leo-Malay/LEO-DB-TRUNK


text:
---
title: DART Field Validation and Prototype Refinement
author: Chetana Rao, Matthew Bandyk
published: true
date: 2017-12-01
date_added_kb: 2018-06-10
source: TRB
source-url: http://onlinepubs.trb.org/onlinepubs/IDEA/FinalReports/Highway/NCHRP193.pdf
tags: [asphalt, asphalt binder, DART, field test, QC, QA, verification]
type: research
image:
image_source:
image_caption:
title_color:
video_id:
sidebar:
order-number:
subtitle:
lead:
---
This report summarizes findings from a National Cooperative Highway Research Program (NCHRP) Innovations Deserving Exploratory Analysis (IDEA) Type 2 study to validate a field-ready prototype of the Duomorph Asphalt Rheology Tester (DART) as a low-cost and easy-to-use asphalt binder testing device. The DART is a piezoelectric sensor-based portable testing system that addresses the need of the paving industry to cost effectively monitor the uniformity or specification compliance of asphalt binder samples at various points along its supply chain.
<!--more-->

In this study, the research team performed validation tests to determine the effectiveness of the DART in production environments such as a paving job site, a field laboratory, and a binder production facility.

gha_language: HTML


text:
# CMA
Cumulative moving average on sparse data: implementation and tests (work in progress)

## Sparse data
By sparse data we mean time series, where events are rare enough, e.g. there is gaps (or empty values) between events.
![sparse data](img/sparse.png?raw=true "sparse data")

There is a lot of methods for analyzing such time series. We will describe cummulative moving window for calculating average data for the last events in the sample window.

![moving window](img/mw.png?raw=true "moving window")

## Number of events
To calculate number of events in window `W` we will use the following iterative formula:

![cma](http://latex.codecogs.com/gif.latex?N_%7Bn+1%7D%20%3D%20N_%7Bn%7D%20-%20N_%7Bn%7D%5Ccdot%20%5Cfrac%7Bdt%7D%7BW%7D%20+%201)

where `dt` is the time between last event and current, `N` - previous number of events, `Nn+1` - new approximate number after the last event

## Velocity

To calculate average velocity (V) in the sample window we should divide the number of events(`N`) on window size(`W`)

![velocity](http://latex.codecogs.com/gif.latex?V%3D%5Cfrac%7BN%7D%7BW%7D)

## Acceleration and higher order derivatives

It's also possible to calculate "average acceleration" (and higher order derivatives) using two (or more) moving windows

![acceleration](img/acc.png?raw=true "acceleration")

## Tests

There is two test comparing precise and cumulative moving average in sample window. Tests are generated by `cma_tests.c` program.

![constant acceleration](vconstacc.png?raw=true "test with constant acceleration")

![sine-alike](vsin.png?raw=true "test with sine alike events speed")

license: ISC

repository: vmxdev/cma

repo_name: vmxdev/cma


text:
## KrameWork\Storage\File

***Table of Contents***
* **Overview** - Information about the class.
* **Examples** - Usage examples.
* **Functions** - Comprehensive list of all functions in the class.

___
### Overview
The `File` class is designed to allow easy handling and management of files. There are various extensions of the class which allow more specific use-cases; check out the directory for other implementations.
___
### Examples
Basic usage:
```php
$file = new File("myFile.txt");
var_dump($file->getData());
```
Ideally, unless we're sure the file exists, we'll want to check that it does before we read the data from it. This can be achieved by passing `autoLoad` as `false` and checking `exists()` ourselves.
```php
$file = new File("myFile.txt");
if ($file->exists())
	// Fondle data.
```
Another way to achieve this using exceptions would be to catch the exceptions that are thrown from the instance construction if the file does not exist.
```php
try {
	$file = new File("myFile.txt");
	// Fondle data.
} catch (FileNotFoundException $e) {
	// File does not exist, or could not be accessed.
} catch (FileReadException $e) {
	// File could not be read, permission error?
}
```
Something to note, `exists()` will return `true` if something exists at the given path, even if that something is not a file. It's ideal to be more strict with this check, and use `isValid()`, which confirms existence as well as checking the file is indeed a file, followed by a call to `read()`.
```php
$file = new File("myFile.txt");
if ($file->isValid()) {
	$file->read();
	// Fondle data.
}
```
##### Writing/Saving
Writing our own data to the file wrapper is as simply as calling `setData()` on the wrapper. This function takes any kind of object, but will attempt to cast it to a `string` later on, so make sure it's stringable! Once we've set the data, we can persist it to file using `save()`.
```php
$file = new File("myNewFile.txt", false, true);
$file->setData("Hello, world!");
$file->save();
```
Note the the third parameter, `touch`, is passed as true in the above example. As outlined in the first paragraph of this document, this will cause the file to be created if it does not yet exist.

It's possible that we might want to save the data to another file, rather than the one we read from. This can easily be achieved by using the first parameter for `save()`, which expects a string; a file location to write to.
```php
$file = new File("sourceData.txt", true);
$file->save("targetData.txt");
```
If the place we're trying to write to already exists, you'll end up with a `FileWriteException` being thrown, this helps prevent writing over files we didn't expect to. In the case that you do want to overwrite a file, simply provide `true` to the second parameter of `save()`.
```php
$file = new File("existingData.txt", true);
$file->setData("New data!");
$file->save("existingData.txt", true); // Overwrite!
```
##### Deleting
Deleting a file is as simple as telling it to be deleted! No error will be thrown if the file does not exist; you can check before-hand with `exists()` or `isValid()` if needed.
```php
$file = new File("someFile.txt", false);
$file->delete();
```
___
### Functions
##### > __construct() : `void`
File constructor. If an instance of File is provided as $source, the state of the provided instance will be cloned to this one. Both $autoLoad and $touch will be ignored in that scenario.

parameter | type | description
--- | --- | ---
`$source` | `string||File` | Path to the file, or another File instance to clone.
`$autoLoad` | `bool` | Attempt to load the file contents on instantiation.
`$touch` | `bool` | Touch the file, creating it if missing.

exception | reason
--- | ---
`FileNotFoundException` | Specified file could not be found.
`FileReadException` | Specified file could not be read (permission error?).
##### > isValid() : `bool`
Check if the file exists and is valid.
##### > delete() : `bool`
Attempt to delete the file.
##### > getSize() : `int`
Get the size of this file in bytes.
##### > getExtension() : `string`
Get the extension of this file (without leading period).
##### > getFileType() : `string`
Attempts to get the MIME type of a file. Requires php_fileinfo extension to be enabled. Returns 'unknown' on failure.
##### > read() : `void`
Attempt to read the data from a file. Read data is not returned, but available through the wrapper.

exception | reason
--- | ---
`FileNotFoundException` | Specified file could not be found.
`FileReadException` | Specified file could not be read (permission error?).
##### > save() : `void`
Attempt to save the data in the wrapper to a file. Using an alternative path to save will not change the original path stored by the wrapper.

parameter | type | description
--- | --- | ---
`$file` | `string|null` | Path to save the file. If omitted, will use wrapper path.
`$overwrite` | `bool` | Overwrite the file if it exists.

exception | reason
--- | ---
`FileWriteException` | File already exists and overwrite not specified.

##### > getData() : `null|string`
Get the data contained by the wrapper after a read() or manual set.

parameter | type | description
--- | --- | ---
`$forceRead` | `bool` | Call read() if data is missing.
##### > getBase64Data() : `string`
Retrieve the raw data of this file encoded as base64.

parameter | type | description
--- | --- | ---
`$forceRead` | `bool` | Call read() if data is missing.
##### > setData() : `void`
Set the data for this file wrapper. Overwrites existing.

parameter | type | description
--- | --- | ---
`$data` | `mixed` | Data to store in the wrapper.

##### > marshalFrom() : `void`
Copy the state of another File instance to this instance.

parameter | type | description
--- | --- | ---
`$file` | `File` | `File` instance to copy from.

gha_language: PHP

gha_license_id: NOASSERTION


text:
# Base SASS Project

This is my go-to file structure for my front-end projects.

The code is separated in 3 directories, each one containing an `index` file that imports all partials.

## 1. Base
Where I define the project variables, mixins, typography rules, etc.

## 2. Components
Where I style all the site components individually.

## 3. Layout
Where I set margins between the components of a specific page.

repository: byvasco/base-sass-project

repo_name: byvasco/base-sass-project


text:
## Mad Migration

[![MIT licensed](https://img.shields.io/github/license/MadMigrationTeam/mad-migration)](https://raw.githubusercontent.com/MadeByMads/mad-migration/master/LICENSE)
[![GitHub stars](https://img.shields.io/github/stars/MadMigrationTeam/mad-migration.svg)](https://github.com/MadeByMads/mad-migration/stargazers)
[![GitHub forks](https://img.shields.io/github/forks/MadMigrationTeam/mad-migration.svg)](https://github.com/MadeByMads/mad-migration/network/members)
[![GitHub issues](https://img.shields.io/github/issues-raw/MadMigrationTeam/mad-migration)](https://github.com/MadeByMads/mad-migration/issues)
[![Downloads](https://pepy.tech/project/madmigration)](https://pepy.tech/project/madmigration)
CLI tool and Packgae provide easy and fast migration from one database to another database by specifiying its fields and types.

Tool has been made by Mad Team for other tools check our [Organization](https://github.com/MadMigrationTeam).

Full code can be found on [GitHub Repo](https://github.com/MadMigrationTeam/mad-migration).

Please see the [License](license.md) for further details.

## Development

Currently under the development. Soon documentation will be updated.

repository: anilktechie/mad-migration

repo_name: anilktechie/mad-migration


text:
# Exercise-1

I am so unoriginal - TITLE

In this exercise, you'll practice working with branches, including **merging** changes between them.

For this exercise, complete the following steps:

1. Clone _this_ module repository.

2. Open up _this_ `README.md` file in Atom. Be sure to open the one in the `exercise-1` folder!

3. Create and `checkout` a new branch called `experiment`

git checkout -b "experiment"

4. Add a sentence at the bottom of the `README.md` file. What you had for breakfast is fine. Remember to save your changes to disk!

5.

6. `checkout` the `master` branch. You shuld see your previous sentence disappear!

7. Add yet another sentence **at the top of the file** --- for example, a title or subtitle.

8. Commit your change

9. Switch between the experiment and master branches (clicking on your editor in-between). Do you see the file contents changing? Note: In some editors you may need to close and re-open the file to see the changes.

10. Now `merge` the contents from `experiment` ___into___ `master`. Remember you'll want to switch to the `master` branch first (the one you are merging ___into___).

I know what I had for breakfast. I had two slices of peanut butter toast with a banana and a cup of hot coffee.


text:
##### Duplicate token names

```
Missing registration for token "TOKEN_NAME". Other tokens with this name have been registered
```

This error is a special case of [missing
registration](https://github.com/fusionjs/fusionjs/tree/master/errors/missing-registration.md).

During the plugin resolution phase of Fusion.js startup, the dependency graph
could not be resolved because a dependency token was not found.

This is a special case because the missing token has the same name as one or
more other registered tokens. Since it is unusual for multiple tokens to share
the same name, it is likely that your package manager failed to de-duplicate
a dependency.

You can mitigate this issue by using your package manager to see if the package
that provides this token is installed more than once.

```
yarn why my-fusion-plugin
npm ls my-fusion-plugin
```

Use a yarn resolution or upgrade the package to a compatible version to
consolidate versions.

repository: gutenye/fusionjs

repo_name: gutenye/fusionjs


text:
#Getting And Cleaning Data
Repository connected with the __Course Project__ of __"Getting And Cleaning Data"__ course on Coursera, January 2015.

##Course Project Information

The purpose of this project is to demonstrate the ability to collect, work with, and clean a data set.

### The Goal

Prepare a tidy dataset that can be used for later analysis and required supporting materials for sharing data with a statistician.

### Expected Deliveries

1. the tidy data set,
2. a link to a __Github repository__ containing the required supporting material
	* the __script__ (__run_analisys.R__), the exact recipe used to go from the raw dataset to tidy dataset  , and
	* the __code book__ that describes the variables, the data, and any transformations or work that you performed to clean up the data (__codebook.md__)
	* __README.md__ file explaining how all of the scripts work and how they are connected.

###Description of Assignment
*One of the most exciting areas in all of data science right now is wearable computing - see for example this article . Companies like Fitbit, Nike, and Jawbone Up are racing to develop the most advanced algorithms to attract new users. The data linked to from the course website represent data collected from the accelerometers from the Samsung Galaxy S smartphone.*

*A full description is available at the site where the data was obtained:*

[Human Activity Recognition Using Smartphones](http://archive.ics.uci.edu/ml/datasets/Human+Activity+Recognition+Using+Smartphones)[1]

*Here are the data for the project:*

[Dataset.zip](https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip)

*You should create one R script called __run_analysis.R__ that does the following.*

1. *Merges the training and the test sets to create one data set.*
2. *Extracts only the measurements on the mean and standard deviation for each measurement.*
3. *Uses descriptive activity names to name the activities in the data set*
4. *Appropriately labels the data set with descriptive variable names.*
5. *From the data set in step 4, creates a second, independent tidy data set with the average of each variable for each activity and each subject.*

##What's available in the repository
* __README.md__ (this file)
* __codebook.md__, describing the variables, the data, and any transformations or work performed to clean up the data
* __run_analysis.R__, the script used to generate the tidy data (from the raw data)
* __rawData.zip__, the raw data (as reference - downloaded on 20.01.2015)
* __tidy\_data\_set.txt__, the tidy data set as generated by run_analysis.R script (as reference)

##How to generate the tidy dataset
* Clone the repository `git clone https://github.com/pparacch/GettingAndCleaningData.git`
* Open a R console (R or RStudio)
* __Important!__ Remember to set the __working directory__ to the folder of the cloned repository created in the previous step
* run `run_analisys.R` using `source("run_analisys.R")` in the R console to create the tidy_dataset (___tidy\_data\_set.txt__) in teh working directory
	* __Note!__ If the file __tidy\_data\_set.txt__ is not present in the working directory, it will be created; otherwise, if present, it will be overwritten.

##The Recipe: run_analisys.R
__run_analisys.R__ script uses the local copy of the raw data (__rawData.zip__) for the generation of the tidy dataset (__tidy\_data\_set.txt__).

The script performs the following steps:

* unzip the raw data into a __"data"__ folder in the working directory
	* __rawData.zip__ must be in the working directory
	* If the __"data"__ folder does not exist in the working directory, it is created
* merges the training and test sets to create one dataset
* extracts only measurements on mean & standar deviation features/ variables from the dataset
* use descriptive activity names to name the activities in the relevant feature/ variable
* appropiately labels the data set with descriptive variable names
* from the dataset created in the previous step, generate an independent tidy dataset (__tidy\_data\_set.txt__) in the working directory

If you want to have more information  please read the comments available in __run_analisys.R__.

__Note!__ If you want to dowload a more recent version of the raw data please use the following code in a R console

	fileUrl <- "https://d396qusza40orc.cloudfront.net/getdata%2Fprojectfiles%2FUCI%20HAR%20Dataset.zip"
	download.file(fileUrl, destfile = "./rawData.zip", method = "curl")

__References__

[1] Davide Anguita, Alessandro Ghio, Luca Oneto, Xavier Parra and Jorge L. Reyes-Ortiz. Human Activity Recognition on Smartphones using a Multiclass Hardware-Friendly Support Vector Machine. International Workshop of Ambient Assisted Living (IWAAL 2012). Vitoria-Gasteiz, Spain. Dec 2012

repository: pparacch/GettingAndCleaningData

repo_name: pparacch/GettingAndCleaningData


text:
# OpenThread Border Router

## Introduction

A Thread Border Router serves as a gateway between the Internet and the Thread network. OpenThread's implementation of a Border Router is called OpenThread Border Router (OTBR). OTBR is a Thread Certified Component on the Raspberry Pi 3B with a Nordic nRF52840 NCP.

![](assets/images/otbr-arch-borderagent_2x.png)

A Thread Border Router minimally supports the following functions:

* End-to-end IP connectivity via routing between Thread devices and other external IP networks
* External Thread Commissioning (for example, a mobile phone) to authenticate and join a Thread device to a Thread network

For more technical details, [openthread.io](https://openthread.io/guides/border_router) is the best place for you.

In the following documentation sections, you'll build an OpenThread Border Router with Raspberry Pi 3B and Grove Mesh Kit.

## Hardware Requirements

* Raspberry Pi 3B
* A Grove Mesh Kit for nRF52840-MDK
* 4 GB (or larger) microSD card and microSD card reader
* microUSB power supply for Raspberry Pi 3B

![](assets/images/pi_n_grove_mesh_kit.jpg)

## Set Up Raspberry Pi 3B

### Download and install Raspbian

Download the [RASPBIAN STRETCH LITE](https://www.raspberrypi.org/downloads/raspbian/) image to your host and follow the [installation guide](https://www.raspberrypi.org/documentation/installation/installing-images/README.md) to install the image on an microSD card.

### Flash the NCP firmware

OTBR runs on an NCP design. The pre-built firmware is located in `grove-mesh-kit/firmware/openthread/ncp`. Follow these steps to flash the pre-built NCP firmware:

1. Connect one nRF52840-MDK board to your PC using the USB-C cable.

2. Open a file explorer. Confirm that the board has appeared as a removable drive named **DAPLINK**. This allows you to program the nRF52840 chip.

3. Drag and drop the pre-built NCP firmware `thread_ncp_ftd_uart_nrf52840_mdk.hex` into **DAPLINK**.

!!! tip
	You can also program the board using [pyOCD](https://github.com/mbedmicro/pyOCD). Just follow this [tutorial](https://wiki.makerdiary.com/nrf52840-mdk/getting-started/#using-pyocd) to set up the pyOCD tool.

### Set up the Border Router

!!! Warning
	Before you continue, make sure your Raspberry Pi 3B is connected to the internet using Ethernet. The **bootstrap** script disables the platform's Wi-Fi interface and the **setup** script requires internet connectivity to download and install **wpantund**.

OTBR communicates with the nRF52840-MDK(serves as NCP) via `wpantund`. On Raspberry Pi 3B:

1. Clone the OTBR repository:
	``` sh
	git clone https://github.com/openthread/ot-br-posix
	```

2. Install dependencies:
	``` sh
	cd ot-br-posix
	```
	``` sh
	./script/bootstrap
	```

3. Compile and install OTBR and `wpantund`. Note that this setup script uses Network Manager to automatically set up the Wi-Fi access point (AP):
	``` sh
	./script/setup
	```

4. Attach the NCP device to the Raspberry Pi 3B via USB.

5. Configure the NCP device's serial port in `wpantund`:

	* Determine the serial port name for the NCP device by checking /dev:
	``` sh
	ls /dev/tty*
	```

	* Add the serial port name to `/etc/wpantund.conf`. For example, for a serial port name of `ttyACM0`:
	``` sh
	Config:NCP:SocketPath "/dev/ttyACM0"
	```

6. Restart the Border Router. The OTBR service should start on boot.

### Verify services

Verify that all required services are enabled:

``` sh
sudo systemctl status
```

If the `setup` script above was successful, the RPI3B is in `running` state and the following services appear in the output:

* `wpantund.service`
* `avahi-daemon.service`
* `otbr-web.service`
* `otbr-agent.service`

If the RPI3B is in **degraded** state, some other service has failed to start. Check to see which:

``` sh
sudo systemctl --failed
```

If the failed service is **tayga** or **dnsmasq**, it is normal. These services are completely configured as part of the [Wi-Fi Access Point Setup](https://openthread.io/guides/border-router/access-point).

### Verify NCP

Verify that the NCP is in the correct state:

``` sh
sudo wpanctl status
```

`wpanctl` is a command line utility provided with `wpantund`. It is used to communicate with the wireless PAN interface (default is `wpan0`) that `wpantund` is bound to in the NCP design.

If the NCP is successfully running OpenThread and is not a member of a Thread network, the output should be similar to the below:

``` sh
wpan0 => [
        "NCP:State" => "offline"
        "Daemon:Enabled" => true
        "NCP:Version" => "OPENTHREAD/0.01.00; NRF52840; May  6 2019 15:24:43"
        "Daemon:Version" => "0.08.00d (/f19f0b8; May  6 2019 08:15:03)"
        "Config:NCP:DriverName" => "spinel"
        "NCP:HardwareAddress" => [3FC1C13939142925]
```

If the `NCP:State` is `uninitialized`, troubleshoot with the following:

1. Verify the RPI3B has sufficient power (use the proper external AC adapter).
2. Disconnect and reconnect the NCP device to the RPI3B.
3. Verify that the NCP serial device is present. For example, if the device should be attached to `/dev/ttyACM0`:

	``` sh
	ls /dev/ttyACM*
	/dev/ttyACM0
	```

4. Reset the NCP with `sudo wpanctl reset`.
5. Check the NCP status again with `sudo wpanctl status`.

## Use the Web GUI

Now, you can use the OpenThread Border Router (OTBR) Web GUI to configure and form, join, or check the status of a Thread network.

The Border Router enables Access Point mode and advertises the **BorderRouter-AP** network default.

Connect to the **BorderRouter-AP** Wi-Fi network and access the Web GUI by visiting the OTBR's local IPv4 address(`<IP_ADDRESS>` default) in a mobile browser:

[![](assets/images/otbr-web-gui.png)](assets/images/otbr-web-gui.png)

### Form a Thread network

Use the **Form** menu option to create a new Thread network.

After the network forms, confirm by checking the **Status** menu option or running `sudo wpanctl status` on the command line of the OTBR:

[![](assets/images/form_n_check_thread_network.png)](assets/images/form_n_check_thread_network.png)

![](assets/images/checking-wpanctl-status.png)

## External Thread Commissioning

OpenThread Border Router (OTBR) features a Thread Border Agent, which supports external Thread Commissioning. In external Thread Commissioning, a device outside of the Thread network (for example, a mobile phone) commissions new devices onto the network.

### Prepare the Joiner device

You should prepare another nRF52840 board. Flash the board with the OpenThread CLI firmware. The pre-built CLI firmware is located in `grove-mesh-kit/firmware/openthread/cli`:

1. Connect the nRF52840-MDK board to your PC using the USB-C cable. A removable drive named **DAPLINK** will appear.

2. Drag and drop the pre-built cli firmware `thread_cli_ftd_uart_nrf52840_mdk.hex` into **DAPLINK**. After flashed, label the board **Joiner** so that later you don't confuse the boards.

3. Open a terminal window and run:
	``` sh
	screen /dev/cu.usbmodem141102 115200
	```
	where `/dev/cu.usbmodem141102` is the serial port name of the Joiner.

4. Once the Joiner device is ready, obtain its factory-assigned IEEE EUI-64. Use the `eui64` command in the OpenThread CLI:
	``` sh
	> eui64
	9019ec5d617d7aab
	Done
	```

### Use the Thread Commissioning App

External commissioning is supported by the Thread Commissioning App, available for download on the Google Play Store for Android devices.

<button data-md-color-primary="marsala" style="width: auto;">Thread Commissioning App</button>

Connect your phone to the Wi-Fi access point **BorderRouter-AP**, and start the Thread Commissioning App.

Select the target Border Router from the available list. The name is the same as the Thread network created by the OTBR Web GUI. If the same Border Router shows up multiple times with different IPv4 and IPv6 addresses, select the one with the static IPv4 address used for the Wi-Fi access point setup (`<IP_ADDRESS>` here).

When prompted for a password, enter the passphrase (Commissioner Credential) set by the OTBR Web GUI.

[![](assets/images/connect-to-border-router.png)](assets/images/connect-to-border-router.png)

### Commission the Joiner

After connected to the Border Router, the app provides the option to scan a Connect QR Code or enter a Join Passphrase manually.

Thread Connect QR Codes are created with the following text string format:

``` sh
v=1&&eui=9019ec5d617d7aab&&cc=J01NU5
```
Where `eui` is the Joiner device's EUI64 value and `cc` is the Joiner Credential.

Use the following tool to generator your QR Code:

<input type="text" id="text_usr" style="width: 50%; font-size: 85%" placeholder="Input your text here..." autocapitalize="off" autocorrect="off" autocomplete="off" spellcheck="false">

<button id="btn_generate" data-md-color-primary="marsala">Generate</button>

In the Thread Commissioning App, scan the Connect QR Code generated above. While the app is waiting, enter the OpenThread CLI on the Joiner device and start the Joiner role with that same Joiner Credential:

``` sh
> ifconfig up
Done
> joiner start J01NU5
Done
```

Wait for the DTLS handshake to complete between the Commissioner and Joiner:
``` sh
> Join success
```

[![](assets/images/adding-device-via-qrcode.png)](assets/images/adding-device-via-qrcode.png)

### Join the network

On the Joiner device, start the Thread protocol to automatically join the network.

``` sh
> thread start
Done
```

Check the state after a few moments to confirm. It may initially start as a Child, but within two minutes, it will upgrade to a Router.

``` sh
> state
router
Done
```

Obtain the addresses of the joiner by typing ipaddr:

``` sh
> ipaddr
fd11:1111:1122:0:0:ff:fe00:cc00
fd11:22:0:0:b37e:fb2f:899a:fe3b
fd11:1111:1122:0:54ae:6bc4:6dbf:f0a6
fe80:0:0:0:b0ba:25f2:a1f:d1b1
Done
```

## Check the Internet connectivity

Test the connectivity between the Joiner device in the Thread network and the Internet by pinging a public IPv4 address. To reach the IPv4 address from the Thread device, a Well-Known Prefix of `64:ff9b::/96` and an IPv4 address of the destination are used.

To ping Google’s DNS `<IP_ADDRESS>` from the IPv6 address, append a hexadecimal form of the IPv6 to the Well-Known Prefix resulting in: `64:ff9b::808:808`.

``` sh
> ping 64:ff9b::808:808
> 16 bytes from 64:ff9b:0:0:0:0:808:808: icmp_seq=1 hlim=112 time=245ms

> ping 64:ff9b::808:808
> 16 bytes from 64:ff9b:0:0:0:0:808:808: icmp_seq=2 hlim=111 time=230ms

> ping 64:ff9b::808:808
> 16 bytes from 64:ff9b:0:0:0:0:808:808: icmp_seq=3 hlim=110 time=225ms

```

## Congratulations!

You've successfully created an OpenThread Border Router, while allowing the Joiner device in the Thread network communicating with the Internet.

## License

Portions of this page are reproduced from work created and [shared by Google](https://developers.google.com/readme/policies/) and used according to terms described in the [Creative Commons 3.0 Attribution License](https://creativecommons.org/licenses/by/3.0/).

Thread is a registered trademark of the Thread Group, Inc.

## Create an Issue

Interested in contributing to this project? Want to report a bug? Feel free to click here:

<button data-md-color-primary="marsala"> Create an Issue</button>

repository: nitz/grove-mesh-kit

repo_name: nitz/grove-mesh-kit


text:
# Roadmap
* Ability for users to sign-in, i.e. take to a landing page
* Ability to change a users role: writer/publisher/admin
* Ability to write & save articles
* Ability to view articles
* Ability to manage articles (delete, publish, etc.)

---
# Version 0.0.1

## Added
* Ability to create / delete accounts.

## Changed functionality
* N/A

## Deprecated features
* N/A

## Removed features
* N/A

## Bug Fixes
* N/A

## Security Fixes
* N/A

## Other
* N/A

---

repository: leslie-alldridge/CoffeeTable

gha_language: JavaScript

repo_name: leslie-alldridge/CoffeeTable


text:
# GitHub Pages auto deployment

This project includes a GitHub Actions configuration that can automatically
deploy your specimen site to GitHub Pages.

Follow the following steps to enable it:

1. Generate an SSH deploy key on the command line:
   ```sh
   ssh-keygen -t ed25519 -f deploy-key -N ''
   ```
2. In GitHub navigate to the repository settings and create a secret named `DEPLOY_KEY`.
   As value, use the contents of the `deploy-key` file generated in step 1.
   ![repo-settings](../.github/screenshots/deploy-setup-repo-settings.png)
3. In GitHub add a deploy key (make sure to `Allow write access`!):
   ![deploy-key](../.github/screenshots/deploy-setup-deploy-keys.png)
   As value, use the contents of the `deploy-key.pub` file created in step 1.
   Make sure `Allow write access` is checked.
4. Edit `.github/workflows/ci.yml` to enable the deploy step for commits on the `master` branch:
   ```diff
      deploy:
   -    if: false && github.ref == 'refs/heads/master'
   +    if: github.ref == 'refs/heads/master'
        runs-on: ubuntu-latest
        needs: build
   ```
5.

repository: RoelN/pangea-demo

branch_name: refs/heads/main

repo_name: RoelN/pangea-demo


text:
# Netshoes challenge
--------------------

## Prerequisites

Make sure you have installed all of the following prerequisites on your development machine:

* Node.js - [Download and install Node.js](https://nodejs.org/en/download/);
* MongoDb - [Download and install mongo](https://docs.mongodb.com/manual/installation/) and the npm package manager, if you don't have it yet.

## Quick install

The first thing you should do is install the Node.js dependencies. To install Node.js dependencies you're going to use npm again. In your application folder run this in the command-line:

```bash
$ npm install
```

You'll need to insert all data of products.json into mongodb

```bash
$ npm run seeder
```

Starting application

```bash
$ npm start
```

Listening port on 3001

```bash
http://localhost:3001/
```

Endpoints Documentation
-------------
### Add Cart endpoint

  > Add new item to cart, using cookie to indentify user cart

Endpoint: /cart/add/{idProduct}

method: GET

response :

Set-Cookie:cart={cartId}

body:
```
{
"items": [
    {
      "id": 13,
      "title": "Tênis Nike Biscuit Canvas",
      "image": "camisetagrandecorinthians_9.png",
      "availableSizes": [
      "41"
    ],
      "quantity": 1,
      "price": 129.9
    }
  ],
  "_id": "5823a30b58b63d418ff80922"
}
```

### Remove Cart endpoint

  > Remove item from cart, return cart after removed

Endpoint: /cart/remove/{idProduct}

method: GET

response :

body:
```
{
  "_id": "5823a966a8c2d24580c9495c",
  "items": [
    {
      "id": 13,
      "title": "Tênis Nike Biscuit Canvas",
      "image": "camisetagrandecorinthians_9.png",
      "availableSizes": [
      "41"
    ],
    "quantity": 1,
    "price": 129.9
    },
    {
      "id": 11,
      "title": "Jaqueta Corinthians Elite",
      "image": "camisetagrandecorinthians_9.png",
      "availableSizes": [
      "S",
      "G"
    ],
    "quantity": 1,
    "price": 99.9
    }
  ]
}
```

### Products endpoint

  > Find all product items

Endpoint: /products

method: GET

response :

body:
```
[
  {
    "_id": "582233fdc48401e122ad3bb7",
    "id": 0,
    "sku":<PHONE_NUMBER>438644,
    "title": "Camisa Nike Corinthians I",
    "description": "14/15 s/nº",
    "image": "camisetagrandecorinthians_1.png",
    "availableSizes": [
    "S",
    "G",
    "GG",
    "GGG"
    ],
    "style": "Branco com listras pretas",
    "price": 229.9,
    "installments": 9,
    "currencyId": "BRL",
    "currencyFormat": "R$",
    "isFreeShipping": true
  },
  {...}
]
```

### Cart endpoint

  > Find all cart items

Endpoint: /cart

method: GET

response :

body:
```
{
  "_id": "5823a966a8c2d24580c9495c",
  "items": [
    {
      "id": 13,
      "title": "Tênis Nike Biscuit Canvas",
      "image": "camisetagrandecorinthians_9.png",
      "availableSizes": [
      "41"
      ],
      "quantity": 1,
      "price": 129.9
    },
    {...}
  ]
}
```

## Structure

The basic structure of this challenge is given in the following way:

* `netshoes-challenge/`Contains the source code of the front-end challenge.
* `data/`Contains sample json file.
* `node_modules/` Contains all dependencies fetched via [NPM](https://www.npmjs.org/). However, this directory is unnecessary for versioning, so it is ignored.
* `public/` Contains all the static files you use in your application, this is where you store your front-end files.
* `.gitignore` The .gitignore file specifies intentionally untracked files that Git should ignore.
* `LICENSE` A software license tells others what they can and can't do with your source code.
* `package.json` Lists all [Node.js](http://nodejs.org/) dependencies.
* `README.md` Explains how your application works.

repository: dsantosbfs/node-chart

repo_name: dsantosbfs/node-chart


text:
# VueBuildABot
This repository is for my Vue tutorial exercise

## To check for outdated packages

`npm outdated`

## To Update Packages

`npm install [packagename] --save-dev`

`npm update [packagename]`

repository: dmalcaba/VueBuildABot

gha_language: Vue

repo_name: dmalcaba/VueBuildABot