text:
---
layout: engineering-education
status: publish
published: true
url: /engineering-education/introduction-to-scrum/
title: Introduction to Scrum
description: In this article we will speak about the Scrum agile framework used for software development purposes.
author: benson-kariuki
date: 2020-10-05T00:00:00-11:00
topics: []
excerpt_separator: <!--more-->
images:

  - url: /engineering-education/introduction-to-scrum/hero.jpg
    alt: Introduction to scrum
---
### Introduction
Scrum is an agile framework for developing products. The framework is mostly used for software development. Scrum has been in use since the early 1990s. It is a flexible and holistic approach to project management. Scrum focuses on continuous improvement, learning, and adjusting to the changing market, user requirements, and technology.
<!--more-->

Typically, a scrum team is a small team made of highly adaptive and flexible individuals. The agile framework is an iterative approach to project management. An agile framework helps a team deliver a product to the customer faster, in different iterations. Customer feedback is critical in every iteration. There are several agile frameworks, such as Kanban and Scrum. The article will cover:

- [Introduction to Scrum](#Scrum-Overview)
- [Scrum Roles](#Scrum-Team)
- [Scrum Events](#Scrum-Events)
- [Scrum Artifacts](#Scrum-Artifacts)
- [Why Use Scrum?](#Why-Use-Scrum?)

### Scrum Overview
Scrum has a few rules which are simple to understand. Yet, scrum is challenging to master because it requires a culture change, which is not easy for most organizations. Scrum involves a set of events, tools, and roles that work together to help teams structure and manage a project.

It is used in different fields, including marketing, manufacturing, and software development. In this article, we will focus on examples used in software development. Within software development, requirements, market, technology, and other external factors change quite often. Scrum embraces the changes as the product is built in a series of iterations called sprints.

Big projects are broken into smaller pieces that are delivered in several sprints, making the project easier to manage. Risk and cost are also reduced, as it is easier to identify risks in the early development stages. Every sprint is released to users, and feedback is collected. Speed to market is also increased. Scrum is all about continuous learning and adapting to changes. The team does not know everything about the project. Therefore, adaptation to changes is critical.

The image below is a graphical summary of the Scrum framework. If your organization would use Scrum, where would your input be? After going through this article, I bet you will be able to answer the question.

![Scrum Framework](/engineering-education/introduction-to-scrum/scrum_framework.jpg)

### Scrum Team
According to the [Scrum Guide](https://www.scrumguides.org/scrum-guide.html#team), the roles in Scrum are:
- Product Owner
- Scrum Master
- The Development Team

The team is cross-functional and self-organizing in the sense that it does not require a manager. The team works without outside interference. The team decides how best to accomplish the work and has all the necessary expertise to do it.

#### The Product Owner
The product owner plays in the part of a client or stakeholder. He/She is one person and not a group of people. He or she is responsible for managing the product backlog by clearly expressing items that need to be addressed. The product owner ensures that the product backlog items are clear for the development team.

#### The Development Team
It is a team with the necessary skills to create a product increment by itself. That is why it is said to be cross-functional and self-organizing. Members lay multiple roles such as design, business analysis, operations, programming, and testing. Thus, the team recognizes no title for any of its members. Team members may have some particular competencies and areas of specialization, but they are accountable as one. The team size can consist from three to nine members.

### The Scrum Master
The scrum master is a ["servant leader"](https://www.investopedia.com/terms/s/servant-leadership.asp) responsible for protecting the team and the process. The scrum master helps everyone understands the scrum framework as defined in the [scrum guide](https://www.scrumguides.org/scrum-guide.html). Other responsibilities include:

- Ensuring a good working bond between the development team and the product owner
- Protecting the team from outside interactions and disruptions
- Facilitating scrum events
- Providing optimal techniques for optimal product backlog management
- Removing any obstacle that may affect the development team progress

### Scrum Events
There are five different formal meetings or events in the scrum. Each event is time-bound to a maximum duration. Strict scrum events reduces the need of meetings that are not defined in the scrum framework. The events are created to foster transparency and inspection within the scrum team.

#### The Sprint
The sprint is the backbone of scrum. A sprint takes 1 to 4 weeks. During this period, a potentially shippable product increment is created. A list of product backlog items, selected during sprint planning, are worked on during each sprint. A new sprint starts immediately after the end of the previous one. If a sprint took more than a month, the definition or market of what is being developed might change, increasing complexity and risk.

Each successful sprint constitutes an increment in the final product. Can a sprint be revoked? Yes, but a sprint can only be canceled by the product owner. In such a scenario, completed and "done" product backlog items are revaluated. Partially done items are re-estimated and rescheduled to the product backlog. Cancellation of a sprint is rare and should be avoided.

#### Sprint Planning
The scrum team discuss the items to be worked on during the sprint and creates a sprint goal. Top priority product backlog items to be worked on during the sprint are selected. The primary purpose of Sprint Planning is to address "What can be done during the next sprint?" and "How to do the work required to provide the increment?" Sprint planning takes at most eight hours for a four weeks Sprint.

#### Daily Scrum
It is a fifteen-minute Stand-up event for the development team held daily. Preferably, it should be held at the same venue and time. The team discusses what they have completed in the last 24 hours and plan for the next 24 hours' work. A check on the progress towards the sprint goals is also done in the stand-up meeting.

#### Sprint Review
Sprint Review is held towards the end of the Sprint. This is an opportunity for the team to showcase the completed work to the product owner and partners. This review process is meant to encourage collaboration and to get feedback. It takes at most four hours for a one-month sprint. The development team discuss what worked out during the sprint, the challenges encountered, and how they were addressed. They also discuss how they will improve the process in the future. Sprint review provides important input to the upcoming sprint planning. The deliverable of a Sprint Review is an updated product backlog items for the coming sprint.

#### Sprint Retrospective
The event happens before the next sprint planning. It takes at most three hours for a one-month Sprint. The scrum team discusses the following:

- What worked well?
- What could be improved?
- What will the team commit in the next sprint?

Scrum Team members make actionable commitments. The deliverables of this meeting are improvements to be implemented in the next sprint by the Scrum Team.

### Scrum Artifacts
In Scrum, artifacts are there to ensure and maximize the transparency of information. Every team member must have the same interpretation of an artifact.

#### Product Backlog
The product backlog consists of a list of features, functions, enhancements, and fixes needed. It is the only source of requirements for the Scrum Team. The [product owner is responsible](https://www.slideshare.net/IngoMatzner/scrum-in-30min-88049147) for its content, availability, and ordering. Since the requirement never stops changing, so does the product backlog. All the requirements are broken down, with the most prioritized at the top.

#### Sprint Backlog
The current sprint backlog items are selected from high priority features in the product backlog. It is the output of the sprint planning event. The sprint backlog is modified throughout the sprint. Burndown charts are used to monitor sprint progress. A burndown chart shows the relationship between work left to do and time. See the diagram below.

![Burn Down Chart](/engineering-education/introduction-to-scrum/burndown-chart-example.jpg)
[Image Source](https://www.visual-paradigm.com/scrum/scrum-burndown-chart/)

#### Increment
The sum of all product backlog completed and "done" during a sprint is referred to as an increment. Each Scrum Team has a definition of "done." "Done" means in a usable condition as per the Scrum Team definition.

### Why Use Scrum?
There are many reasons why we should use Scrum:

- Faster release of usable products to the users and customers. After every increment, the customer can have an early release of the product. This is contrary to the traditional [waterfall approach](https://en.wikipedia.org/wiki/Waterfall_model). In the Waterfall approach the product is shipped to the customer after the last stage of development.
- Scrum saves time and cost: With reduced meetings and small manageable teams, scrum reduces cost and time.
- Scrum encourages teamwork: There is a sense of responsibility in the self-organizing team. Collaboration and daily stand up meetings give every member a chance to have their ideas addressed.
- It is easy to learn and use: As discussed, there are only three roles in the framework, thus easy to learn and implement.

### Conclusion
Scrum framework rules, artifacts, roles, and events are easy to understand. Each successful Sprint makes the team motivated and keeps the user happy as the progress is seen in short durations. Scrum is indeed an excellent agile project management framework for any organization. However, it takes time to master Scrum, but the long-term benefits are well worth getting through the learning curve. Online collaboration tools to help you master scrum faster are also available. Some of them include [ScrumDo](https://www.scrumdo.com/), [Quickscrum](https://www.quickscrum.com/), [Scrumwise](https://www.scrumwise.com/), [Tuleap](https://www.tuleap.org/), [Targetprocess](https://www.targetprocess.com/), and [Vivifyscrum](https://www.vivifyscrum.com/).

---
Peer Review Contributions by: [Linus Muema](/engineering-education/authors/linus-muema/)

repository: mwanikialex/engineering-education

repo_name: mwanikialex/engineering-education


text:
# RxScheduler

[![CI Status](https://img.shields.io/travis/retval/RxScheduler.svg?style=flat)](https://travis-ci.org/retval/RxScheduler)
[![Version](https://img.shields.io/cocoapods/v/RxScheduler.svg?style=flat)](https://cocoapods.org/pods/RxScheduler)
[![License](https://img.shields.io/cocoapods/l/RxScheduler.svg?style=flat)](https://cocoapods.org/pods/RxScheduler)
[![Platform](https://img.shields.io/cocoapods/p/RxScheduler.svg?style=flat)](https://cocoapods.org/pods/RxScheduler)

## Example

To run the example project, clone the repo, and run `pod install` from the Example directory first.

## Requirements

## Installation

RxScheduler is available through [CocoaPods](https://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'RxScheduler'
```

## Author

retval<EMAIL_ADDRESS>
## License

RxScheduler is available under the MIT license. See the LICENSE file for more info.

license: MIT

branch_name: refs/heads/master

extension: md

license_type: permissive


text:
## sensu-plugins-lvm

[![Build Status](https://travis-ci.org/sensu-plugins/sensu-plugins-lvm.svg?branch=master)](https://travis-ci.org/sensu-plugins/sensu-plugins-lvm)
[![Gem Version](https://badge.fury.io/rb/sensu-plugins-lvm.svg)](http://badge.fury.io/rb/sensu-plugins-lvm)
[![Code Climate](https://codeclimate.com/github/sensu-plugins/sensu-plugins-lvm/badges/gpa.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-lvm)
[![Test Coverage](https://codeclimate.com/github/sensu-plugins/sensu-plugins-lvm/badges/coverage.svg)](https://codeclimate.com/github/sensu-plugins/sensu-plugins-lvm)
[![Community Slack](https://slack.sensu.io/badge.svg)](https://slack.sensu.io/badge)

## Functionality

**check-lv-usage**

Checks the usage on the logical volume.  Checks both data and metadata volumes associated with Physical Volume

**check-vg-usage**

Check volume group capacity based upon the gem chef-ruby-lvm.

**metrics-vg-usage**

Output graphite metrics for volume group capacity and usage based upon the gem chef-ruby-lvm.

## Files
 * bin/check-lv-usage.rb
 * bin/check-vg-usage.rb
 * bin/metrics-vg-usage.rb

## Installation

[Installation and Setup](http://sensu-plugins.io/docs/installation_instructions.html)

repository: sensu-plugins/sensu-plugins-lvm

gha_language: Ruby

gha_license_id: MIT

repo_name: sensu-plugins/sensu-plugins-lvm


text:
## README

Name : Abhilash Kundoor

Application Name : Hardware Selling Chatbot

Description : This application enables users to order hardware via a online chatbot. It also shows a list of products the company is selling. User can easily select the product he/she wants to buy by choosing the corresponding number. Once the user completes purchase, he/she has an option to do the checkout. A receipt that contains the products he/she bought is shown along with the price including tax.

Instructions : 1. Open the chatbot application via https://hardware-selling-chatbot.herokuapp.com/
			   2. Select "Start" to start the chatbot.
			   3. A link is displayed which has the product list with price.
			   4. Select the product number to buy the product.
			   5. Select CHECKOUT option to complete the purchase.

Steps to install, build and use this blogging site project.

1. Install github in your machine.
2. Use git clone command to clone the repository to local.
3. Install node.js in your machine.
4. Open the project in Visual Studio Code.
5. Open terminal window.
6. Migrate to project folder.
7. Run npm install to download missing libraries.
8. Run node index.js to run the application.
9. Open browser and enter the address https://localhost:8080

This projected is licensed under MIT.
I opted to license my project under MIT since its short and very easy to understand. Also it gives maximum freedom to the user as it has very less constraints. It gives the user the luxury to do whatever changes he wants as long as it doesn't affect the publisher. Also the concept of open sourcing and making your work available for the community was really appealing.

branch_name: refs/heads/main


text:
# beanstalkd-consumer

[![Build Status](https://travis-ci.com/silviucpp/beanstalkd-consumer.svg?branch=master)](https://travis-ci.com/github/silviucpp/beanstalkd-consumer)
[![GitHub](https://img.shields.io/github/license/silviucpp/beanstalkd-consumer)](https://github.com/silviucpp/beanstalkd-consumer/blob/master/LICENSE)
[![Hex.pm](https://img.shields.io/hexpm/v/beanstalkd_consumer)](https://hex.pm/packages/beanstalkd_consumer)

Erlang consumer framework for beanstalkd work queue.

### Idea behind the project

- An easy and configurable app that it's starting a pool of consumers which executes jobs from a beanstalkd server.
- You can limit the number of concurrent jobs.
- In case the consumer is stopped will wait for all jobs in progress to complete.
- Make sure a job is not executed twice.

### What's the lifetime of a job

- Once a job is reserved before being sent to be processed is buried first.
- In case the execution completed fine (no exception triggered) then the job is deleted.
- In case job execution failed, the job is left in the buried state for manual review.
- All delete operations are taking place on another processes where are queued so in case connection to the server goes down the operations are not lost.

### Quick start

All consumers need to implement the `beanstalkd_consumer` behaviour.

```erlang
-callback init(TubeName::binary()) ->
    {ok, State::any()}.

-callback process(JobId::non_neg_integer(), JobPayload::binary(), State::any()) ->
    any().
```

Example:

```erlang
-module(dummy_consumer).

-export([
    init/1,
    process/3
]).

init(TubeName) ->
    io:format(<<"~p:init: ~p ~n">>, [?MODULE, TubeName]),
    {ok, #{}}.

process(JobId, JobPayload, State)  ->
    io:format(<<"~p:process: ~p ~n">>, [?MODULE, {JobId, JobPayload, State}]).
```

You can define the consumer pools into `sys.config` as fallow:

```erlang
[
    {beanstalkd_consumer, [
        {servers, [
            {default_server, [
                {start_at_startup, true},
                {connection_info, [{host, {127,0,0,1}}, {port, 11300}, {timeout, 5000}]},
                {queues_number, 1},
                {consumers, [
                    {consumer_silviu, [
                        {instances, 1},
                        {callbacks, [
                            {<<"tube_name">>, dummy_consumer}
                        ]},
                        {concurrent_jobs, 1000}
                    ]}
                ]}
            ]}
        ]}
    ]
}].
```

Where

- `start_at_startup` - specify if the consuming of messages should start right away when the application is started. In case you have the `beanstalkd_consumer` as dependency and you need to load more other stuffs into your current app before starting consuming events, you can put this property on `false` and use `beanstalkd_consumer_app:start_consumers/0` to start the consumers.
- `connection_info` - connection details. See [ebeanstalkd][1] for details.
- `queues_number` - number of processes that will handle the `delete` operations. Those are queued in case the connection to the server is not up and are sent again once connection is established.

For each consumer:

- `instances` - number of consumer instances.
- `callbacks` - `[{Tube, Module}]`. Each item in list is formed from the tub name and the module that will handle the jobs for that tube.
- `concurrent_jobs` - how many concurrent jobs can run in parallel.

[1]:https://github.com/silviucpp/ebeanstalkd

repository: silviucpp/beanstalkd-consumer

repo_name: silviucpp/beanstalkd-consumer


text:
# Commands

Like the famous `git` and `apt-get` programs, `mlproj` is one single program,
providing several commands, by giving a different command name as the first
parameter on the command line.

For instance, "`mlproj new`" invokes the command `new` with no option, to create
a new project interactively.

The available comamnds are:

- [`help`](help) - display help about another command
- [`new`](new) - create a new project in an empty dir
- [`show`](show) - display the environment
- [`setup`](setup) - setup the environment on MarkLogic
- [`load`](load) - load documents to the content database
- [`deploy`](deploy) - deploy modules to the modules database
- [`watch`](watch) - deploy modules as soon as modified

Each command can get parameters and options, after its name.  Before its name,
there can also be some *global options*.  In the following invocation, `-e` is a
global option, with value `dev`, `load` is the name of the command, and `-d` and
`data` are options of the command itself:

    mlproj -e dev load -d content data

repository: fgeorges/mlproj-web

repo_name: fgeorges/mlproj-web


text:
# framer-ease

This module adds a Utils.ease function, which allows for non-linear modulation / "Easing" of values. Based on [Jim Jeffers' coffeescript port](https://github.com/jimjeffers/Easie) of [Robert Penner's easing functions](http://robertpenner.com/easing/).

### [Example project on framer.cloud](https://framer.cloud/tmLXp/)

## Getting started

    <img alt='Install with Framer Modules'
<EMAIL_ADDRESS>width='160' height='40' />

OR

| Step  | Instruction                                                                                |
| :---: | :---                                                                                |
| **1** | Download the [ease module](https://github.com/marckrenn/framer-ease/archive/master.zip) and unzip the downloaded archive |
| **2** | Put `ease.coffee` into your prototype's `modules`-folder or *drag'n'drop* it onto the Framer window   |
| **3** | Change the autogenerated `require`-line on the top of the code to `require 'ease'`                    |
| **4** | Save (*CMD+S*) your project to get Framer to load the module                                          |

## Documentation

```coffee
# Available Easings:

# Linear:      linearIn,  linearOut,  linearInOut, linearNone
# Sine:        sineIn,    sineOut,    sineInOut
# Quad:        quadIn,    quadOut,    quadInOut
# Circ:        circIn,    circOut,    circInOut
# Cubic:       cubicIn,   cubicOut,   cubicInOut
# Quart:       quartIn,   quartOut,   quartInOut
# Quint:       quintIn,   quintOut,   quintInOut
# Exponential: expoIn,    expoOut,    expoInOut
# Back:        backIn,    backOut,    backInOut
# Bounce:      bounceIn,  bounceOut,  bounceInOut
# Elastic:     elasticIn, elasticOut, elasticInOut

# Syntax:
Utils.ease(value, [rangeFrom], [rangeTo], curve, options*)

# *Options:
# limit     (default = false)
# overshoot (default = 1.70158), Back-Easings only
# amplitude (default = null),    Elastic-Easings only
# period    (default = null),    Elastic-Easings only

# Example:
layer.y = Utils.ease(slider.value, [0,1], [0,100], "expoIn")

# Example with options:
layer.y = Utils.ease(slider.value, [0,1], [0,100], "elasticInOut", {limit: true, amplitude: 2, period: 0})

# Bonus: Utils.randomNumberBiased
# Example project 1 – instant: https://framer.cloud/dUHzn/
# Example project 2 – animated: https://framer.cloud/rMoti/

# Syntax:
Utils.randomNumberBiased(from, to, curve, options*)

# Example:
print Utils.randomNumberBiased(0, 100, "expoIn")
```

repository: marckrenn/framer-ease

repo_name: marckrenn/framer-ease


text:
# deep-sensor

A [PyTorch](http://pytorch.org/) framework for sensory signals in machinery fault diagnostics.

[![](https://img.shields.io/badge/build-passing-brightgreen.svg)](https://github.com/redone17/conv-rotor) [![](https://img.shields.io/badge/python-3.7-blue.svg)](https://www.python.org/)  [![](https://img.shields.io/badge/license-BSD3-ff69b4.svg)](https://github.com/redone17/conv-rotor/blob/master/LICENSE)

## requirements:
* numpy (>= 1.13.1)
* pytorch (>= 0.1.12.post2)

## usage
1. data:
    * .txt file for data: \# signal_samples x \# signal_length
    * .txt file for label: \# signal_samples x 1
    * An example of fake dataset with 100 samples and labels are in [toydata](./toydata).
2. ``` $ python run.py ```

## models
### 1D
* [WDCNN](https://github.com/redone17/conv-rotor/blob/master/models/wdcnn.py) from paper: [A New Deep Learning Model for Fault Diagnosis with Good Anti-Noise and Domain Adaptation Ability on Raw Vibration Signals](http://dx.doi.org/10.3390/s17020425)
* [Ince's](https://github.com/redone17/deep-sensor/blob/master/models/ince.py) from paper: [Real-Time Motor Fault Detection by 1-D Convolutional Neural Networks](https://doi.org/10.1109/TIE.2016.2582729)
* [1DCNN](https://github.com/redone17/deep-sensor/blob/master/models/dcnn.py) from paper: [Convolutional Neural Networks for Fault Diagnosis Using Rotating Speed Normalized Vibration](https://doi.org/10.1007/978-3-030-11220-2_8) (cite as)
~~~~
@InProceedings{wei_conv_2019,
author="Wei, Dongdong
and Wang, KeSheng
and Heyns, Stephan
and Zuo, Ming J.",
title="Convolutional Neural Networks for Fault Diagnosis Using Rotating Speed Normalized Vibration",
booktitle="Advances in Condition Monitoring of Machinery in Non-Stationary Operations",
year="2019",
publisher="Springer International Publishing",
pages="67--76",
isbn="978-3-030-11220-2"
}
~~~~

### 2D
* [LeNet5](https://github.com/redone17/deep-sensor/blob/master/models/lenet.py) for spectrogram of signals
* [VGG](https://github.com/redone17/deep-sensor/blob/master/models/vgg.py) forked from https://github.com/kuangliu/pytorch-cifar/blob/master/models/vgg.py

repository: waitalone/deep-sensor

repo_name: waitalone/deep-sensor


text:
# Component Geocoding

We need the ability to geocode an input by its constituent parts when supplied by a user.  That is, instead of geocoding `30 West 26th Street, New York, NY`, we can additionally support geocoding using pre-parsed inputs from a client:

```
{
  address: '30 West 26th Street',
  locality: 'New York',
  region: 'NY'
}
```

## Advantages

Currently we only support geocoding a single text input even for users that have addresses separated into components.  Users get around this limitation by concatenating the components together.  This is problematic because it forces us to needlessly parse an error-prone input.

## Use Cases

The product owner or UI engineer for a project looking to use a geocoder may have determined that a componentized address input may be in the best interest of an application, for example when prompting for a shipping address where there is little room for error.

Another example would be when a user is attempting to geocode a spreadsheet of collected componentized addresses.

More generally, it may be beyond the technical abilities of a geocoding customer to concatenate the address components together or to even do it correctly.

Regardless of specific use cases, it behooves us to implement a geocoding solution that can consider the components of an address.

## Endpoint

Since componentized geocoding can be considered a subclass of single-input geocoding, we can probably just extend `/v1/search` into `/v1/search/component` or `/v1/nbox`.  The actual endpoint name is open to debate.

## Parameters

The components we should support are:

* address
* neighbourhood
* borough
* locality
* county
* region
* country
* postalcode

A single parameter should be considered sufficient to geocode.

### Querying Elasticsearch

Forcing clients to understand the intricacies our the administrative structure of WOF or our internal schema is not a good idea, so the parameters should map to our internal fields in this fashion:

| Parameter | Index Fields | Notes |
| --- | --- | --- |
| address | address | |
| borough | borough, borough_a | only applies to New York City |
| locality | locality, locality_a, localadmin, localadmin_a | Equivalent to city |
| county | county, county_a, macrocounty, macrocounty_a | |
| region | region, region_a, macroregion, macroregion_a | Equivalent to state |
| country | dependency, dependency_a, country, country_a | |
| postalcode | postalcode | |

Component geocoding should adopt the fallback behavior introduced in the libpostal integration.  That is, if the input `locality=Seattle&region=Pennsylvania` is supplied, then the state match for Pennsylvania should be returned since there is no city in Pennsylvania named Seattle.

#### Edge Cases

We should steer clear of trying to impose additional interpretation upon the values supplied in the request.  One notable exception may be how `locality` is interpreted with respect to New York City boroughs.  Special consideration should be made for inputs that may have Manhattan supplied in the `locality` parameter.  If `borough` parameter is not supplied but `locality` is, then the `locality` value should be treated as if it could be a borough.

Alternately, we could opt to simply not support a `borough` parameter, moving that decision into the client logic which means that we would just always consider `borough` values when querying for the `locality` value.  Since boroughs only affects a very smaller portion of the world (localized entirely to New York City), this may be the best option.

### Valid Values

Only non-blank string parameters should be considered valid, otherwise values are discarded.  That is, if the request contains `locality= \t `, then the request should be treated as though no `locality` parameter was passed.

Innocuous corrections such as space-trimming and -normalizing should be applied to inputs.  These corrections aren't a concern of single-input geocoding since libpostal already does this.

### Error conditions

An error should be returned to the client if no parameters have valid values.

## Other Geocoders

The question has been asked whether to support house number and street as separate fields or should we only support a single `address` field with those two values combined.  The other geocoders.

### Carto

Carto's geocoder only exposes an `address` parameter, with no ability to supply separate house number and street parameters.

### MapQuest

MapQuest does not support separate house number and street parameters, only a single `address` parameter.  To the best of my recollection, there were occasional requests to support separated fields but it was never a big enough concern to dedicate resources to it.

### Geocod.io

Geocod.io only exposes a `street` parameter, no consideration is given to separated fields.

### Enigma

Enigma’s tiger geocoder appears to only expose a single input field for the entire address with all fields concatenated.

## Future Work

### Spelling Correction

While it's a wise idea to support spelling correction anyway, this is an easier place to introduce it since there's no parsing service to misidentify tokens, i.e. - the client has already identified a particular input as a locality so we can more easily constrain spelling correction logic.

repository: pelias/pelias

gha_language: Twig

repo_name: pelias/pelias


text:
# (!) UNDER CONSTRUCTION

# CUMES - C Unrestricted Mail Exchange Server

CUMES is (or will be) a free and secure MTA, partially inspired by qmail.

* Under construction
* Unrestricted: CUMES is not *Free, but with restrictions, Software*, but MIT-Licensed. You can do (almost) everything with the code.

## Motivation

Every few months, or even days, another security hole shows up in sendmail, postfix, exim and other mailers. There are many more holes waiting to be discovered. Sendmail for example had and has many security vulnerabilities, see [Sendmail Disaster](https://cr.yp.to/maildisasters/sendmail.html) and the actual table of [CVE-Details](https://www.cvedetails.com/vulnerability-list/vendor_id-31/Sendmail.html).

A list of my favorite CVEs so far:
* [CVE-2002-1337](https://www.cvedetails.com/cve/CVE-2002-1337/): A flaw in headers.c f#cks up sendmail
* [CVE-2003-0161](https://www.cvedetails.com/cve/CVE-2003-0161/): A flaw in prescan() in parseaddr.c f#cks up sendmail
* [CVE-2003-0694](https://www.cvedetails.com/cve/CVE-2003-0694/): A flaw in prescan() in parseaddr.c f#cks up sendmail on more time
* [CVE-2010-4344](https://www.cvedetails.com/cve/CVE-2010-4344/): A flaw in string_vformat in string.c f#cks up exim

repository: byte-mug/cumes

repo_name: byte-mug/cumes


text:
### Fixes #_issue_

## Description

_A summary of the change including motivation and context._

## Screenshots

_Demonstrate any UI / behavioral changes with screenshots or animations._

## Checklist

- [ ] I have labeled my PR with: bug, feature, engineering, security fix or testing
- [ ] I have performed a self-review of my own code
- [ ] I have reviewed the title & description of this PR which I will use as the squashed PR commit message
- [ ] I have commented my code, particularly in hard-to-understand areas
- [ ] I have added tests that prove my fix is effective or that my feature works
- [ ] I have enabled auto-merge (optional)

## Testing

Testers, use the following instructions against our staging environment. Post your findings as a comment and include any meaningful screenshots, etc.

_Describe how to verify your changes and provide any necessary test data._

- Test A

repository: sillsdev/web-languageforge

branch_name: refs/heads/develop

gha_language: JavaScript

repo_name: sillsdev/web-languageforge


text:
# CS Basics in Python

The Python pendant of
[Basics.jl](https://github.com/agravier/Basics.jl)

## TODO

[Trello board](https://trello.com/b/yR05sxc8/basicsjl-development)

- [x] Implement Linked list
- [ ] Implement Skip list
- [ ] Implement Hash table
- [ ] Implement Heap
- [ ] Implement Binary search tree
- [ ] Implement Radix tree (trie)
- [ ] Implement Rope
- [ ] Implement B* tree
- [ ] Implement Split Hashtables

repository: agravier/CSBasics

repo_name: agravier/CSBasics


text:
# Limitations

- [ ] No paging or ordering of records
- [ ] No custom scalars, only Int, Float, String, ID, Boolean, and Date are available
- [ ] Filtering is limited to the top level selection set
- [ ] Limited to a single canister ~4GB of storage
- [ ] Very inneficient querying, be careful once you get into the 100,000s or 1,000,000s of records
- [ ] No automatic migrations, once you deploy the schema is final unless you implement your own migrations
- [ ] No authorization at the schema level, deal with it through your own custom authorization at the canister function level
- [ ] No automated tests
- [ ] No subscriptions
- [ ] No transactions

repository: MioQuispe/sudograph

repo_name: MioQuispe/sudograph


text:
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://github.com/cheefoong-toku/toku-caas-sdk/blob/main/LICENSE)

![Toku](https://caasuser.tokuworld.com/images/logo-inverse.png)

## Documentation
You can find the online document [here](https://apidocs.toku.co/).

## Installation
You can install the SDK using composer:

    composer require toku/caas_sdk
Use command below to regenerate the classes installed:

	composer dump-autoload

## Quick Start - Call Handle
#### Autoloading
Require/include autoloading if your PHP framework does not handle autoloading.

```php
require __DIR__ . '/vendor/autoload.php';
```

#### Class
Use the call controller class to form call handle command
```php
use \Toku\CaaS\V1\CallHandle\CallController;
```

#### Instance
Create a new call controller instance
```php
$ctrl = new CallController();
```

#### Call Handle Command
Use the call controller to send call handle command such as PlayTTS command.
```php
$ctrl->PlayTTS("This is a test message", "en", "f")->Response();
```
You can also send multiple command.
```php
$ctrl->PlayTTS("This is a test message one", "en", "f")->
       PlayTTS("This is a test message two", "en", "f")->
       Response();
```

#### Sample Code

```php
<?php

	//Require autoloading file if your framework does not handle autoloading
	require __DIR__ . '/vendor/autoload.php';

	//Use the call controller class to form call handle command
	use \Toku\CaaS\V1\CallHandle\CallController;

	//Create a new call controller instance
	$ctrl = new CallController();

	//Optional
	header('Content-Type: application/json');

	//Use the call controller to send call handle command such as PlayTTS command
	$ctrl->PlayTTS("This is a test message", "en", "f")->
	  Response();

?>
```

repository: cheefoong-toku/toku-caas-sdk

repo_name: cheefoong-toku/toku-caas-sdk


text:
## How does Peril work?

<img src="https://github.com/danger/peril/raw/master/docs/images/peril-setup.png">

There are some key files where the magic happens:

- [source/routing/router.ts](source/routing/router.ts) - Decide what work to with GitHub events
- [source/github/events/github_runner.ts](source/github/events/github_runner.ts) - Figuring out what Dangerfiles to run
- [source/danger/danger_runner.ts](source/danger/danger_runner.ts) - Coordinating running the Dangerfiles
- [source/runner/run.ts](source/runner/run.ts) - Run the Dangerfile in a sandbox

This is a _reasonably tested_ project, there's a lot in places where the code isn't going to change much now so they're
slowly getting covered.

Peril's main API is split into two components with three parts:

- ## The API

  The two main responsibilities of the API are to take webhooks from GitHub and convert those into Dangerfile runs, and
  to provide a GraphQL API for the dashboard. It is an express app, it doesn't try to be too fancy because the domain is
  reasonably complex WRT security.

  - Deploy: `yarn deploy:staging:api`
  - Logs: `yarn logs:staging`

- ## The Runner

  The runner is an AWS lambda, it has two parts. An
  [AWS Layer](https://docs.aws.amazon.com/lambda/latest/dg/configuration-layers.html) which is the Peril "runtime". Then
  a function per-org which sets up environment for the shared runtime layer.

  ### Layer

  The shared Peril infrastructure that grabs the Dangerfile and evaluates it. It's effectively a subset of the Peril
  server, and it's opening module is `source/runner/index.ts`.

  To understand how it is created, see: `source/scripts/generate-runner-deps.ts`. It will generate a subset of Peril's
  dependencies for the layer because there is a 250MB size limit for the layer and Perils is _450MB_ (!!).

  - Deploy: `yarn deploy:staging:layer`
  - [Layers on AWS](https://us-east-1.console.aws.amazon.com/lambda/home?region=us-east-1#/layers)

  ### Function

  A really basic set of files which are the CWD for the function. Enough to transpile JS/TS correctly and to handle
  evaluation for

  Then you can test evaluation:

  - Deploy: `yarn deploy:staging:runner`
  - [Functions on AWS](https://us-east-1.console.aws.amazon.com/lambda/home?region=us-east-1#/functions)

## Links

[Staging Infra + Links](../docs/using_peril_staging.md)

repository: danger/peril

gha_language: TypeScript

repo_name: danger/peril


text:
Packaging Jenkins Instance for byondlabs.io
===========================================
This repository contains the deployment files and documentation relating to the Jenkins instance we use to automate non-Windows packaging for [BYOND](https://www.byond.com/). The general concept here is to deploy Jenkins as a [kubernetes](https://kubernetes.io/) service that is able to package [BYOND](https://www.byond.com/) into distribution specific packages, verify them, and publish them.

Deployment
----------
To deploy the service or update it, you need to have `kubectl` available configured for your cluster, with a new enough version to support [kustomize](https://github.com/kubernetes-sigs/kustomize). The deployment assumes the following:
-   The cluster has a default [StorageClass](https://kubernetes.io/docs/concepts/storage/storage-classes/) available.
-   The cluster has an [IngressController](https://kubernetes.io/docs/concepts/services-networking/ingress-controllers/).
-   The hostname routes to the the node(s) the IngressController is running on.

Assuming these prerequisites are met, then you can create/update the Jenkins instance by running `kubectl apply -k .` from the `jenkins.byondlabs.io` folder, or your kustomized overlay folder. For this overlay, it assumes the following:
-   The cluster has [cert-manager](https://github.com/jetstack/cert-manager) with configuration for `letsencrypt-prod`.
-   The hostname `jenkins.byondlabs.io` routes to the the node(s) the IngressController is running on.
-   A secret `jenkins-admin-account` has been created in the `jenkins` namespace, containing the key-value pair `password=somePass` to set the admin password.

Building Jenkins Customisations
-------------------------------
Customisations can be placed into the `docker` folder, which can be built with something like `docker build -t packaging-jenkins-config:latest docker/`.

repository: BYOND/packaging-jenkins

gha_language: Groovy

repo_name: BYOND/packaging-jenkins


text:
# passnet

#yolov5 model trained for MRZ detection in Passports

Dataset : http://www.edisontd.net/175D434D12D32B18/

1. Downloaded 300 Images of different countries
2. Augmentation using augmentation.py
3. Annotation using roboflow

Model is trained for 1000 epoch's.
# Result's
![annotation](https://user-images.githubusercontent.com/28568025/123594047-d7672380-d80c-11eb-8a00-7dbf6e11cb9a.jpg)
![result](https://user-images.githubusercontent.com/28568025/123594058-dc2bd780-d80c-11eb-8da6-671d294cb45e.jpg)

# Thank You


text:
website
===
[![Netlify Status](https://api.netlify.com/api/v1/badges/b1ad05fe-7e0e-433e-a7d2-516ef31844df/deploy-status)](https://app.netlify.com/sites/elastic-johnson-b22bde/deploys)

Personal website running on Gatsby, React, and Node.js. Fork from [taniarascia.com](https://github.com/taniarascia/taniarascia.com).

## Installation

````bash
$: git clone https://github.com/gitdigg/website
$: website
$: yarn && yarn run dev
````
Navigate to `localhost:8000`.

## Features

- Posts and pages in Markdown
- Tags and categories
- Night mode
- DOS mode (404)
- Code theme (starring [New Moon](https://taniarascia.github.io/new-moon))
- Sass (starring [Primitive](https://taniarascia.github.io/primitive))

## Content Author

- [JayL](https://github.com/liujianping)

## License

This project is open source and available under the [MIT License](LICENSE).

repository: pubweb/website

repo_name: pubweb/website


text:
# paullessing.com
Personal Home Page

Statically hosted on AWS S3.

## Deploy
```
yarn deploy
```

## Setup
Three buckets; `paullessing.com`, `www.paullessing.com`, and `files.paullessing.com`.

## Redirect rules
Go to the main bucket -> Properties -> Static Website Hosting -> Redirect Rules.

Copy in the contents of `notes/bucket-redirect-rules.xml` which redirects `/files` to the `files` bucket.


text:
# React Pattern

I have played around with React a fair amount now, so time to start over and do some more.  Still using Create React App

## Goals This Time Around

* Use useReducer hook more often than useState
* Build more components, do more testing
* Testing Snapshots, what benefit do they give?
* Mocking data for tests
* Deal with dates consistently

## Things To Do

* Internationalization
  * Two options it seems [react-intl](https://github.com/formatjs/react-intl) and [i18next](https://react.i18next.com/)
* Testing (Mocking)
* Add a title to the web app.  [React Helmet](https://github.com/nfl/react-helmet) or [React Titled](https://github.com/tajo/react-titled)
* Toasts [React-Toastify](https://fkhadra.github.io/react-toastify/) or [Bootstrap Toasts](https://getbootstrap.com/docs/4.3/components/toasts/)
* Okta [Okta-React](https://github.com/okta/okta-oidc-js/tree/master/packages/okta-react)
* API Files
* Error Boundary
* User Session
* Check out Victory Charts by Formidable.

## Later

* Font Awesome
* Lodash
* Storybook
* React Helmet for <head> management
* Change the FAV icon

## Done
* Added Bootstrap using CSS only so far
* Created basic navigation.
* React Router (5.1.1+)
* Built some charts using D3 manually
* Built some charts using Rechart
* Built some charts using Nivo


text:
# AfterShipKit

[![Build Status](https://travis-ci.org/darkcl/ZHyL0bdqoEa-OGnevHYlwg.svg?branch=master)](https://travis-ci.org/darkcl/ZHyL0bdqoEa-OGnevHYlwg)

## Usage

Before you started with using our AfterShipKit, you will need to obtain your API key under your own user account.

* Login to your AfterShip account ([Sign up free](https://www.aftership.com/signup))
* Visit [Apps > API](https://www.aftership.com/apps/api) and click `add`
* Click `Generate API Key`

Setting up AfterShipKit with your api key:

```objc
[AfterShipKit setAPIKey:@"YOUR_API_KEY"];
```

Then use it!

```objc
[AfterShipKit fetchTrackingInfoWithSlug:@"dhl"
                                trackNumber:@"1234567893"
                                     fields:nil
                                    success:^(AfterShipTrackingInfo* trackingInfo) {
                                        //Handle Result
                                    }
                                    failure:^(NSError *err) {
                                        //Handle Error
                                    }];
```

For more information, view [Documentation](http://darkcl.github.io/ZHyL0bdqoEa-OGnevHYlwg/)

## Requirements
XCode 7.0+

## Installation

AfterShipKit is available through [CocoaPods](http://cocoapods.org). To install
it, simply add the following line to your Podfile:

```ruby
pod 'AfterShipKit', :git => 'https://github.com/darkcl/ZHyL0bdqoEa-OGnevHYlwg.git'
```

## Author

Yeung Yiu Hung<EMAIL_ADDRESS>
## License

AfterShipKit is available under the MIT license. See the LICENSE file for more info.

gha_language: Objective-C


text:
# screeps

Screeps is a massive multiplayer online real-time strategy game. Each player can create his or her own colony in a single persistent world shared by all the players. Such a colony can mine resources, build units, conquer territory.

### Documentation

https://docs.screeps.com/

repository: harishkamathuk/screeps

repo_name: harishkamathuk/screeps


text:
- [x] Read/Get config from client side ?
- [ ] Add settings `rules` (rules setting that can be used accross project) (overrided by local config)
- [ ] Display better error messages
- [ ] read config file only once ?
- [ ] React to config changes
- [x] React to config files change (.htmllint)
- [ ] load/use htmllint plugins
- [ ] Provide auto completion in `.htmllintrc` ( dislay htmllint rules + possible values)

repository: KamiKillertO/vscode-htmllint

repo_name: KamiKillertO/vscode-htmllint


text:
# Analysis of lifecycle methods (RFC-001)

![](https://img.shields.io/badge/rfc-001-blue.svg)
![](https://img.shields.io/badge/status-accepted-brightgreen.svg)

In Nock v10/v11, the lifecycle methods are confusingly named, difficult to
understand, and at times inconvenient. Unless they are studied carefully, it
is easy to inadvertently leave unwanted state in Nock.

Nock doesn't automatically provide a way to assert that mocks have been
satisfied; it's the caller's responsibility to do this for each mock.

This RFC analyzes the most common use cases and the function calls
currently needed for each one. Subsequent RFCs will propose changes to the
lifecycle APIs which better afford these use cases.

See
https://github.com/paulmelnikow/icedfrisby-nock/blob/8bdb5cbc9f6ec38bcdd8d1ec6f8979b05ab6a905/icedfrisby-nock.js
for an attempt at getting the lifecycle right.

## Typical use cases

1. Assert that all mocks have been satisfied.
2. Completely reset Nock after a test.
3. Allow unmocked requests only to certain hosts.
4. Prevent unmocked requests entirely.
5. Simulate network connection failures.
6. Temporarily disable http call interception while preserving registered mocks.
7. Turn Nock all the way off and clean up its state. (I haven't experienced
   a need for this, but wanted to include it in the analysis.)

## Analysis

| Use case                                                                | Code                                                                                | Assessment                                                                                |
| ----------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------ | -------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| Assert that all mocks have been satisfied                               | `scopes.forEach(scope => scope.done())`. When using `nockBack`, `assert.deepEqual(scope.pendingMocks(), [])` | `done()` could have a more explicit name, though otherwise this is fairly clear. However it requires the caller to keep track of all the scopes, which is not ideal. |
| Reset Nock after a test to its initial post-`require()` state           | `nock.restore(); nock.cleanAll(); nock.enableNetConnect(); nock.activate()`                                  | This is a lot of typing. Some developers may wish to abort response playback that is in flight. ([#1118][])                                                          |
| Forbid unmocked requests                                                | `nock.disableNetConnect()`                                                                                | This _looks_ okay, but it doesn't have the desired effect. Errors are received by the client code and often swallowed up by the application ([#884][]).              |
| Allow unmocked requests, but only to certain hosts                      | `nock.disableNetConnect(); nock.enableNetConnect('example.com')`                                             | This is a common use case, and should be possible to do more succintly, with a single call.                                                                          |
| Simulate network connection failure                                     | N/A                                                                                | This is what `disableNetConnect()` does today. However from the function name, it's not really clear this is the intention.                                          |
| Temporarily disable http interception while preserving registered mocks | `nock.restore()`                                                                                | This is a confusing name, as it only cleans _part_ of nock's state.                                                                                |
| Turn Nock all the way off and clean up its state                        | `nock.restore(); nock.cleanAll()`                                                                            | `restore()` is a confusing name. This isn't the most common use case, so it is probably okay that it requires two function calls.                                    |

## References

- [#1441][]
- [#1474][]

[#884]: https://github.com/nock/nock/issues/884
[#1118]: https://github.com/nock/nock/issues/1118
[#1441]: https://github.com/nock/nock/issues/1441
[#1474]: https://github.com/nock/nock/issues/1474

repository: nock/nock

repo_name: nock/nock


text:
# Test Scripts
These scripts are for _dev tests_ only, and should not replace the unit tests. Feel free to modify these as necessary while developing.

**NOTE:** These files are not guaranteed to be kept up-to-date with koi, as they are only used for dev tests. Do not rely on them or use them for educational purposes. For complete documentation, visit https://willcarhart.dev/docs/koi.

repository: wcarhart/koi

gha_language: Shell

repo_name: wcarhart/koi


text:
Vagrant CentOS 6.5 (x86_64) LAMP+
====================================

This is my base dev setup.  Includes PHP, MySQL, Ruby, Python and phpMyAdmin

## Install VirtualBox
https://www.virtualbox.org/

## Install Vagrant (Requires 1.5+ for Vagrant Cloud)
http://www.vagrantup.com/

## Setup a New Vagrant VM
We'll be using my shared box on Vagrant Cloud. Vagrant will download the box and initialize your vagrant directory, including a shiny new Vagrantfile

```
mkdir your-project-dir && cd your-project-dir
vagrant init kevindeleon/centos65-x86_64-LAMP
vagrant up
vagrant ssh
```

## Starting Apache and MySQL

While SSH'd into your Vagrant VM:

```
sudo service httpd start
sudo service mysqld start
```

## A Few Vagrantfile Tweaks I Prefer

If you would like to be able to view content in your host machine's browser, I recommend setting your 'forwarded_port' in your Vagrantfile:

```ruby
config.vm.network "forwarded_port", guest: 80, host: 8080
```

I also create a sub-folder on my host machine (in the initialized vagrant directory) called 'html' and use the 'synced_folder' config in my Vagrantfile to sync it with '/var/www/html' on the guest machine.

```ruby
config.vm.synced_folder "html", "/var/www/html"
```

So, my folder structure on my host machine looks something like:
```
initialized-vagrant-folder/
--.vagrant/
--html/
--Vagrantfile
```

Remember, if you make changes to your Vagrantfile while your VM is running, you will need to issue the following command:

```
vagrant reload
```

After reloading your Vagrant box, start your services (Apache and MySQL) on your Vagrant box and you should be able to go to http://localhost:8080 and see your html/php in your web root. PhpMyAdmin is located at http://localhost:8080/phpMyAdmin/ (if you followed the port forwarding instructions above...if you set it to something other than 8080, you would obviously substitute that).

## A few things:
 * Your web root is /var/www/html (where your html/php files go)
 * I made changes to the phpMyAdmin config so that IPs other than <IP_ADDRESS> could connect. If you would like that security measure turned back on, simply replace /etc/httpd/conf.d/phpMyAdmin.conf with /etc/httpd/conf.d/phpMyAdmin.conf.OrigBak
 * Currently MySQL is using 'root' as the root password. You may want to change that.

That's it!  Enjoy your new dev environment.


text:
# PowerSneks
> Snake game written in PowerShell which uses any windows console (`cmd.exe`, `powershell.exe`, even VSCode!) and draws out a custom native code based game. Useful and fun game for aspiring programmers and techies. Features:
- Robust Game engine:
    - Capable of handling multiple snakes / objects
    - Mod capabilities by extending engine and providing your own Game Hook / Classes (as long as you implement the appropriate interfaces)
    - Saving / Restoring complete state (Snakes, directions, objects, Game Grid, Tick Speed, etc)
- Level Mechanics:
    - Obstruction creation
    - Laser beams
    - Moving snitches (with random point values)
- Customization Segment:
    - Allows you to Customize `$Script:GameKnobs` to adjust everything from Sleep Times, Obstruction sizes, Render sizes, Colors, Symbols, SaveMaps, Laser Logic, etc

## Screenshots
Standard Single Player | Multiplayer (w/ Debug Console) | Scoreboard during gameplay
--- | --- | ---
![Standard Single Player](https://user-images.githubusercontent.com/5303018/67819656-4fe37300-fa73-11e9-9539-bd7cf05c1f5a.png) | ![Multiplayer (w/ Debug Console)](https://user-images.githubusercontent.com/5303018/67819723-9d5fe000-fa73-11e9-8ade-a39dd99e91b4.png) | ![PowerSneks Scoreboard](https://user-images.githubusercontent.com/5303018/69590755-59de9000-0fa5-11ea-8393-259a8b1d06fb.png)

Gameplay Gif |
--- |
![PowerSneks Gameplay](./docs/PowerSneks.gif)

## Usage
```PowerShell
.\PowerSneks.ps1 [[-Snakes] <int:1>] [[-Bots] <int:0>] [[-MapFile] <string>] [-LoadDefaultSave] [-ShowPlayerLabels] [-Debug]
```
- Will draw a game to match the dimensions of the console window
- `Snake` is the number of human players (controls cut off after 2 players), `Bots` is the number of bots in the game
- `Debug` mode is for debugging to see snake positions, object distances, active render, current block, tick
- `LoadDefaultSave` loads game from a previous save [File: `%appdata%\AP-PowerSneks.Map.Save`]
- `MapFile` is the save-file path you want to load the game from
- *__Note__: If you've never run PowerShell Scripts before refer to __Setup PowerShell Section__ Below*

## Features
- In house Game Engine, and View overlay + Grid System
- Color Scheming
- Level Making
- MAP Saving and Loading
- Obstruction Creation
- Laser Beams To cut through walls
- Warping of Obstructions and Snake
- Game-Console with Laser and Score count
- Debug console like Minecraft for the game Engine
- CPU cycle and sleep time adjustment as game progresses

## Commands
Key Code         | Usage
---------------- | -----
`q`,`x`,`ESC`    | Quit Game
`←`   , `→`   , `↑`   , `↓`    | Move Snake (left/right/up/down) (Player 1)
`A`   , `D`   , `W`   , `S`    | Move Snake (left/right/up/down) (Player 2)
`num4`, `num6`, `num8`, `num5` | Move Snake (left/right/up/down) (Player 3)
`ctrl`,`l`       | Laser Beam (Player 1)
`space`,`z`      | Laser Beam (Player 2)
`+`              | Speed Up Game [*Increases Tick speed*]
`-`              | Slow Down Game [*Increases Tick speed*]
`p`              | Pause Game
`f12`            | Full Screen
`Tab`            | Save Current Game State
`f5`             | Refresh view [*fast*]
`~`              | Enable dev console on game (also enable-able via the `-debug` cmdline flag)
`0`              | Add more food to the game [**Cheat Code**]

## Files
#### Game Launchers
File | Description
--- | ---
`PowerSneks.ps1` | Main Game launcher, use this to start the game
`ToBots.ps1` | Use a saved game and convert all players to bots (*best use for this file, use `-LoadDefaultSave`*)

#### Base Files
File | Description
--- | ---
`PowerSneks_BaseObjects.ps1` | Contains enums and base object definitions that the game engine relies on
`PowerSneks_GameSettings.ps1` | Contains all the tinkerable variables that can be modified before launching the game engine
`PowerSneks_Engine.ps1` | Class definition for `Game`, `Snake`, `Player`, `LiveObject`, `Snitch`, etc
`BotClass.ps1` | Contains the class definition for `SnakeBot` (a really dump CPU bot that can kinda play this game)
`Sockets.ps1` | ***TODO**: Add LAN based multiplayer support for the game*

## Set Up PowerShell [If you've never run a script in PowerShell]
- Open PowerShell with Admin Access
- Run `Set-ExecutionPolicy Bypass`
- This allows scripts to be run in PowerShell
- cd to the *Folder* where you downloaded/cloned [PowerSneks.ps1](PowerSneks.ps1)
- `./PowerSneks.ps1`*`<arguments>`*

repository: avdaredevil/PowerSneks

repo_name: avdaredevil/PowerSneks


text:
---
slug: natday-songs-wordcloud
date: "2015-08-08T00:00:00Z"
description: National Day Songs WordCloud
tags:
- national day
- songs
- wordcloud
- singapore
title: National Day Songs WordCloud!
---
I wanted to find out which words appear most often in our National Day songs, so here's a WordCloud!

![natday-songs-wordcloud](/images/natday-songs-wordcloud.png)

Here's what I did:

1. I got the list of songs from [here](http://www.straitstimes.com/singapore/dick-lee-unveils-2015-ndp-song-our-singapore-revisit-past-national-day-parade-theme-songs)
2. I googled the song titles for the lyrics, and then I checked the lyrics that I copied by listening to all the songs
3. I put all the lyrics into one text file, I duplicated songs as necessary (e.g. Home was used as the national day song in two years, 1998 and 2004). I also expanded the lyrics by copying and pasting choruses as necessary, so that the lyrics are written out as sung
4. I manually removed the contractions (I'll was replaced with I will etc). I think is fairer because then 'll and will won't be considered two different words
5. Used this [script](/downloads/natday-songs-wordcloud/parse-natday-songs.py) to generate the WordCloud

repository: ackerleytng/website

repo_name: ackerleytng/website


text:
---
layout: post
title: The Wolf Report - November 21st, 2019
---

- [Successfully Merging the Work of 1000+ Developers                  – Shopify Engineering](https://engineering.shopify.com/blogs/engineering/successfully-merging-work-1000-developers)
- [Build an ASP.NET Core Update Panel with Vanilla JavaScript in Four Easy Steps - You’ve Been Haacked](https://haacked.com/archive/2019/11/20/aspnetcore-update-panel/)
- [We built our own framework at ag-Grid. Here’s why and how.](https://blog.angularindepth.com/we-built-our-own-framework-at-ag-grid-heres-why-and-how-a9ab220f6e13)
- [How Much Cohesion Is Enough?](https://www.yegor256.com/2019/11/19/how-much-cohesion-is-enough.html)
- [Azure Functions on Docker - Harshit Anand - Medium](https://medium.com/@wizzard_harshit/azure-functions-on-docker-e5c30e138b95)
- [The State of AWS Lambda Supported Languages & Runtimes (Updated November 2019)](https://serverless.com/blog/aws-lambda-supported-languages-and-runtimes/)
- [Moving from Controllers and Actions to Endpoints with MediatR - ardalis](https://ardalis.com/moving-from-controllers-and-actions-to-endpoints-with-mediatr)
- [ASP.NET Community Standup - Nov 19th, 2019 - David Fowler's Sandbox - YouTube](https://www.youtube.com/watch?v=bBc_NTUVtbE)

gha_language: SCSS

gha_license_id: NOASSERTION


text:
# mbean-reporter
Lightweight JVM MBean metrics reporter that can be easily extended to support any database.

## dependencies
Only `org.slf4j:slf4j-api` must be available on classpath.

## modules

### mbean-reporter-agent
Java Agent based application that connects to JVM and loads `mbean-reporter-api` implementations using Service Provider
mechanism. This makes it very portable, as it can be attached to your already compiled and packaged app **without source
code modifications**.

As soon as agent is loaded (which is before `main()` method), it starts to periodically query local **MBean Server** for
metrics and sends them to database of your choice (each 10 seconds by default).

### mbean-reporter-api
Separated API package that provides necessary interface `MetricsDatabase` for databases implementations, `Measurement`
definition, configuration reader and simple HTTP client.

Configuration is created from environment variables and Java execution properties (override supported). Variable name
must start with `reporter` prefix followed by dot/underscore and configuration key name (all case insensitive), for
example:
* environment variable `REPORTER_NAME=test` will result in `name=test` configuration
* execution property `-Dreporter.dataBase=test` will result in `database=test` configuration

Configuration keys available by default in `mbean-reporter-agent`:
* `interval` - reporting period in seconds, default: 10
* `dbImpl` - fully qualified class name of `MetricsDatabase` implementation, default:
`com.github.b0ch3nski.reporter.persistence.InfluxDB`

### mbean-reporter-influxdb
Example implementation of `mbean-reporter-api` for InfluxDB. Following configuration is supported:
* `dbUrl` - URL of InfluxDB instance, default: `http://localhost:8086`
* `dbName` - Database name where metrics will be sent, default: `jvm-metrics`

**WARNING**: HTTPS and user authentication is not yet supported!

## building
Development builds:
```bash
gradle clean build
```

Release builds:
```bash
gradle clean build -Pbuild.type=release
```

## usage
```bash
java \
-javaagent:mbean-reporter-agent-0.2.jar \
-cp <<YOUR_CLASSPATH>>:mbean-reporter-api-0.2.jar:mbean-reporter-influxdb-0.2.jar \
your.package.your.main.class
```

### example
For testing purposes, one might try running `mbean-reporter-testapp` which is producing meaningless
`metrics.com.github.b0ch3nski.reporter.testapp.Main.test_test.more_tests` metric using `io.dropwizard.metrics`:
```bash
docker run -d -p 8086:8086 --name=influxdb influxdb:alpine; \
java \
-javaagent:agent/build/libs/mbean-reporter-agent-0.2.jar \
-cp testapp/build/libs/mbean-reporter-testapp-0.2.jar:api/build/libs/mbean-reporter-api-0.2.jar:impl/influxdb/build/libs/mbean-reporter-influxdb-0.2.jar \
-DrootLogLevel=DEBUG \
com.github.b0ch3nski.reporter.testapp.Main
```

After a while, dummy metric should be visible in **InfluxDB** alongside other standard JVM metrics, like
`java.lang.Memory.HeapMemoryUsage.used`:
```bash
curl -Gi "http://localhost:8086/query?pretty=true" --data-urlencode "db=jvm-metrics" --data-urlencode "q=SHOW MEASUREMENTS"
curl -Gi "http://localhost:8086/query?pretty=true" --data-urlencode "db=jvm-metrics" --data-urlencode "q=SELECT * FROM \"metrics.com.github.b0ch3nski.reporter.testapp.Main.test_test.more_tests.Count\""
```

Simple data visualization is possible using **Grafana**:
```bash
docker run -d -p 3000:3000 --link=influxdb -e INFLUXDB_HOST=influxdb --name=grafana appcelerator/grafana
```

For additional verification, one can enable remote JMX interface to compare results with live view using `JConsole` or
`VisualVM`:
```bash
-Dcom.sun.management.jmxremote \
-Dcom.sun.management.jmxremote.authenticate=false \
-Dcom.sun.management.jmxremote.ssl=false \
-Djava.rmi.server.hostname=<IP_ADDRESS> \
-Dcom.sun.management.jmxremote.port=9999 \
-Dcom.sun.management.jmxremote.rmi.port=9999
```


text:
Reflection

# 1. Jerk, acceleration and speed control mechanisms. #
To control the speed, I use a speed control. First define the maximum speed is 49.5 miles/hour, and define a speed diff is 0.224 mile/hour, because 0.224 mile/hour = 0.5 m/s. The start-up velocity is 0 miles/hour.

When the car first start up, the reference velocity = 0, then velocity accumulated in the loop to maximum speed.

      ref_vel += speed_diff;
    if ( ref_vel > MAX_SPEED ) {
       ref_vel = MAX_SPEED;
    } else if ( ref_vel < MAX_ACC ) {
       ref_vel = MAX_ACC;
    }
When detected in front it is a car and the distance is very close, the car will check if it is possible to change lane or not, if it is not possible, the speed will slow down.

    else
    {
      speed_diff -= MAX_ACC;
    }

If it is no car in front of ego car, it will speed up until 49.5 mile/hour.

    if ( ref_vel < MAX_SPEED )
    {
      speed_diff += MAX_ACC;
    }

![Alt text](/IMG/safe5.11.png)
# 2. Collision avoidance mechanism. #
The sensor fusion vectors have contained useful information of other cars in the road. Loop the sensor fusion and calculate the lane of the cars and check if it is in the same lane as the ego car.

    int car_lane = -1;
    // is it on the same lane we are
    if ( d 0 && d < 4 )
    {
      car_lane = 0;
    }
    else if ( d 4 && d < 8 )
    {
      car_lane = 1;
    }
    else if ( d 8 && d < 12 )
    {
      car_lane = 2;
    }
    if (car_lane < 0)
    {
      continue;
    }

If other car is in the same lane of ego car front, check the distance and if the distance is too close, then prepare to change lane. Because the start state of ego car is in the center lane = 1, so it has two options either to change to left lane or change to right lane, before change lane there's also a distance check about cars in the left/right lane.
If both lane is not able to change, then slow down the car speed.

    if ( car_ahead )
			{ // Car ahead
              if ( !car_left && lane > 0 )
			  {
                // if there is no car left and there is a left lane.
                lane--; // Change lane left.
              }
			  else if ( !car_righ && lane != 2 )
			  {
                // if there is no car right and there is a right lane.
                lane++; // Change lane right.
              }
			  else
			  {
                speed_diff -= MAX_ACC;
              }
            }

If the ego car is not in center lane, check the center lane is any car in front, if no, then change to center lane.

    if ( lane != 1 )
			  { // if we are not on the center lane.
                if ( ( lane == 0 && !car_righ ) || ( lane == 2 && !car_left ) )
				{
                  lane = 1; // Back to center.
                }
              }

# 3. Path generator #
This code does the calculation of the trajectory based on the speed and lane output from the behavior, car coordinates and past path points.

First, the last two points of the previous trajectory are used.

    ref_x = previous_path_x[previous_path_x.size() - 1];
			  ref_y = previous_path_y[previous_path_y.size() - 1];

			  double ref_x_prev = previous_path_x[previous_path_x.size() - 2];
			  double ref_y_prev = previous_path_y[previous_path_y.size() - 2];
			  ref_yaw = atan2(ref_y - ref_y_prev, ref_x - ref_x_prev);

			  ptsx.push_back(ref_x_prev);
			  ptsx.push_back(ref_x);

			  ptsy.push_back(ref_y_prev);
			  ptsy.push_back(ref_y);

in conjunction three points at a far distance (30, 60, 90) to initialize the spline calculation.

    vector<double> next_wp0 = getXY(car_s + 30, 2 + (4 * lane), map_waypoints_s, map_waypoints_x, map_waypoints_y);
		  vector<double> next_wp1 = getXY(car_s + 60, 2 + (4 * lane), map_waypoints_s, map_waypoints_x, map_waypoints_y);
		  vector<double> next_wp2 = getXY(car_s + 90, 2 + (4 * lane), map_waypoints_s, map_waypoints_x, map_waypoints_y);

		  ptsx.push_back(next_wp0[0]);
		  ptsx.push_back(next_wp1[0]);
		  ptsx.push_back(next_wp2[0]);

		  ptsy.push_back(next_wp0[1]);
		  ptsy.push_back(next_wp1[1]);
		  ptsy.push_back(next_wp2[1]);

To make the work less complicated to the spline calculation based on those points, the coordinates are transformed (shift and rotation) to local car coordinates.
To achieve the spline calculation, I use a free spline library that recommended in the course.

		  for (int i = 0; i < ptsx.size(); i++)
		  {
			  double dx = ptsx[i] - ref_x;
			  double dy = ptsy[i] - ref_y;
			  ptsx[i] = (dx * cos(0 - ref_yaw) - dy * sin(0 - ref_yaw));
			  ptsy[i] = (dx * sin(0 - ref_yaw) + dy * cos(0 - ref_yaw));
		  }
		  tk::spline s;
		  s.set_points(ptsx, ptsy);

In order to ensure more continuity on the trajectory, the pass trajectory points are copied to the new trajectory.

    for (int i = 0; i < previous_path_x.size(); i++)
		  {
			  next_x_vals.push_back(previous_path_x[i]);
			  next_y_vals.push_back(previous_path_y[i]);
		  }

The rest of the points are calculated by evaluating the spline and transforming the output coordinates to not local coordinates.

    for (int i = 1; i <= 50 - previous_path_x.size(); i++)
		  {
			  ref_vel += speed_diff;
              if ( ref_vel > MAX_SPEED ) {
                ref_vel = MAX_SPEED;
              } else if ( ref_vel < MAX_ACC ) {
                ref_vel = MAX_ACC;
              }
			  double N = target_dist / (0.02 * ref_vel / 2.24);
			  double x_point = x_addon + target_x / N;
			  double y_point = s(x_point);

			  x_addon = x_point;
			  double x_ref = x_point;
			  double y_ref = y_point;
			  x_point = (x_ref * cos(ref_yaw) - y_ref * sin(ref_yaw));
			  y_point = (x_ref * sin(ref_yaw) + y_ref * cos(ref_yaw));
			  x_point += ref_x;
			  y_point += ref_y;

			  next_x_vals.push_back(x_point);
			  next_y_vals.push_back(y_point);
		  }


text:
---
layout: component-detail
group: utilities
permalink: /utilities/display
section: Documentation

title: Display
description: The display states

usage:
- title: When to Use
  description: Use these classes to adjust the display settings of an element as well as shift and hide elements.

classes:
- className: u-display--inline-block
  description: Applies `display inline-block` to an element.
- className: u-display--block
  description: Applies `display block` to an element.

- className: u-shift--right--1-col--at-medium
  description: Shifts the element 1 column to the `right` at `medium` and higher.
- className: u-shift--left--1-col--at-medium
  description: Shifts the element 1 column to the `left` from medium to `large` and `xxlarge` and higher.
- className: u-shift--left--1-col--at-large
  description: Shifts the element 1 column to the `left` at `large` and higher.
- className: u-shift--left--1-col--at-xxlarge
  description: Shifts the element 1 column to the `left` at `xxlarge` and higher.

- className: u-hide-until--s
  description: Hides elements below `small` viewport size.
- className: u-hide-until--m
  description: Hides elements below `medium` viewport size.
- className: u-hide-until--l
  description: Hides elements below `large` viewport size.
- className: u-hide-until--xl
  description: Hides elements below `xlarge` viewport size.

- className: u-hide-after--s
  description: Hides elements above `small` viewport size.
- className: u-hide-after--m
  description: Hides elements above `medium` viewport size.
- className: u-hide-after--l
  description: Hides elements above `large` viewport size.
- className: u-hide-after--xl
  description: Hides elements above `xlarge` viewport size.

---

repository: adventistchurch/igs-guidelines

gha_language: HTML

repo_name: adventistchurch/igs-guidelines


text:
Knet Payment Via Yii 2.0 framework
==================================
this is Knet payment type via yii 2.0

Installation
------------

unzip all files and insert int to Path
```
frontend/components/
```
create folder components under folder frontend if is not existe

Usage
-----

Once the extension is installed, simply use it in your code by  :

```
1- add your resource.cgn file in to Path knet\resource
```
How you can use this class

2-  in your controller paste this code
```
use frontend\components\KnetPayment;
    /**
     * Do knet paymet action .
     *
     * @return mixed
     */
    public function actionPayment()
    {
        $knet = new KnetPayment();
        $knet->response_url = Url::to(['site/knetresponce'],'https'); // back response
        $knet->error_url = Url::to(['site/kneterror'],'https'); // back error
        $knet->ammount = 10; // your ammount or cost you can use decimal 10.33
        $knet->udf1 = "";
        $knet->udf2 = "";
        $knet->udf3 = "";
        $knet->udf4 = "";
        $knet->udf5 = "";
        $knet->action = 1;/leav it
        $knet->currency = 414;//Kw dinar
        $knet->lang = "ARA"; //default arabic lang
        $knet->alias = "your knet alias";
        $result = $knet->run(); // return json data
        $result = json_decode($result);

        if($result->status == 'success'){
            // redirect to knet url $result->url;
            $this->redirect($result->url);
        }else{
          // Display error here
        }
    }
```
in SiteController.php or other controller you choose you must add to actions
```
    /**
     *knet Responce result .
     *
     * @return mixed
     */
    public function actionKnetResponce()
    {
        // Do your action here

        $PaymentID = $_POST['PaymentID']; // Reads the value of the Payment ID passed by GET request by the user.
        $result = $_POST['Result']; // Reads the value of the Result passed by GET request by the user.
        $postdate = $_POST['PostDate']; // Reads the value of the PostDate passed by GET request by the user.
        $tranid = $_POST['TranID']; // Reads the value of the TranID passed by GET request by the user.
        $auth = $_POST['Auth']; // Reads the value of the Auth passed by GET request by the user.
        $ref = $_POST['Ref']; // Reads the value of the Ref passed by GET request by the user.
        $trackid = $_POST['TrackID'];  // Reads the value of the TrackID passed by GET request by the user.
        $udf1 = $_POST['UDF1'];  // Reads the value of the UDF1 passed by GET request by the user.
        $udf2 = $_POST['UDF2'];  // Reads the value of the UDF1 passed by GET request by the user.
        $udf3 = $_POST['UDF3'];  // Reads the value of the UDF1 passed by GET request by the user.
        $udf4 = $_POST['UDF4'];  // Reads the value of the UDF1 passed by GET request by the user.
        $udf5 = $_POST['UDF5'];  // Reads the value of the UDF1 passed by GET request by the user.

        echo "REDIRECT= Url::to(['site/knetresult',$_POST],'https');
    }
     /**
     *knet result Page .
     *
     * @return mixed
     */
    public function actionKnetResult()
    {
      // display result page
    }

    /**
     *knet Error result .
     *
     * @return mixed
     */
    public function actionknetError()
    {
      $PaymentID = $_GET['PaymentID'];
      //Display error page
    }
        /**
     * @inheritdoc
     */
    public function behaviors()
    {
        return [
            'access' => [
                'class' => AccessControl::className(),
                //'only' => ['knetresponce'],
                'rules' => [
                    [
                        'actions' => ['knetresponce'],
                        'allow' => true,
                        'roles' => ['?'],
                    ],
                ],
            ],
        ];
    }
```

if Payment operation success return json code
```
{"status":"success","payment_id":"xxxxxxxxx650","url":"https:\/\/www.knetpay.com.kw:443\/CGW\/hppaction?formAction=com.aciworldwide.commerce.gateway.payment.action.HostedPaymentPageAction&?PaymentID=xxxxxxxxx650"}
```
else if Payment operation fail return json code
```
{"status":"error","payment_id":"","url":"","msg":"RROR - CGW000186-Tran Amount Invalid"}
---------------------------
msg is knet responce error
```


text:
# We, the members of Recipe Rocket, agree to the following:

# General Principles
Practice the golden rule and remember that this is a team effort.

Consider scope carefully.

Stick to familiar techniques where possible.

The functionality of our project should be immediately obvious to fresh eyes.

Keep it simple.

Maintain humor.

# Expectations

Members will be present each day and give their best effort.

Members will seek help when encountering issues they can't quickly resolve (within 10-15 minutes) on their own.

Members have the option to work outside of class hours, but aren't expected to unless the group revises these expectations at the end of day meeting.

At the end of each day members will meet to discuss their progress and any necessary revisions to our expected work hours. These decisions will be made by group vote where the simple majority wins. Exceptions made be made in case of exceptional circumstances.

Members will meet as a group approximately every 90 minutes to maintain coordination and focus as a team.

# Conflict Plan

When conflict is encountered, we vow to:
* discuss the difference of ideas and try to settle the issue as individuals;
* take some time and space to reflect and consider the issue if necessary;
* bring in the whole group to the discussion if a resolution cannot be reached;
* escalate to instructors as an absolute last resort;

# Communication Plan
How will you communicate after hours and on the weekend?
- Using slack private message for group Use phone numbers as a backup or in case of emergency.

What is your strategy for ensuring everyone's voices are heard?
- Ask questions: this benefits the individual and the group. Keep an eye out on each other.

How will you ensure that you are creating a safe environment where everyone feels comfortable speaking up?
- Empathetically consider each other. Give gentle feedback. Welcome the feedback.

repository: recipe-rocket/recipe-repo

branch_name: refs/heads/development

repo_name: recipe-rocket/recipe-repo


text:
# User Directory

  ## Table of Contents
  1. [ Application Description. ](#application)
  2. [ Installation. ](#installation)
  2. [ Usage. ](#usage)
  3. [ Contributing. ](#contribution)
  4. [ Test. ](#test)
  5. [ Questions. ](#questions)
  6. [ The other stuff: License & Badges. ](#license)

  ## Application Description.

  An employee/user directory web application to track non-sensitive data. The web app is capable of sorting first and last name alphabetically, and users/managers can search specific employees by name in the search bar. Please see the deployed app at https://secure-crag-21869.herokuapp.com/

  ## Installation.

  run npm install or check the package.json to install all dependencies .

  ## Usage

  This is a react application. Please run npm start. .

  ## Contributing

  To contribute, please contact me at<EMAIL_ADDRESS>

  ## Test

  No test .

  ## Questions

  If you have any questions, feel free to contact at<EMAIL_ADDRESS>Don't forget to check my GitHub profile: guie01.

  (https://github.com/guie01/User Directory )

  ## Licenses & Badges
  [![License: ISC](https://img.shields.io/badge/License-ISC-blue.svg)](https://opensource.org/licenses/ISC)
  ..

license: ISC


text:
# FastAPI + MongoDB

A simple starter for building RESTful APIs with FastAPI and MongoDB.

## Features

+ Python FastAPI backend.
+ MongoDB database.
+ Authentication
+ Deployment

## How To Use

Clone this repository and make a virtual environment in it. Install the modules listed in the `requirements.txt` file:

```console
pip3 install -r requirements.txt
```

To run the starter:

First, set your `PYTHONPATH`:

```console
export PYTHONPATH=$PWD
```

Next:

```console
python app/main.py
```

You also need to start your mongodb instance.

The starter listens on port 8000 on address [<IP_ADDRESS>](<IP_ADDRESS>).

![FastAPI-MongoDB starter](https://res.cloudinary.com/adeshina/image/upload/v1600180509/fopab9idhrjqeqds4izk.png)

## Deploying to Vercel

> Currently, the vercel build fails when running requests to MongoDB through the async driver. The next section shows how to deploy to Heroku.

To deploy to [vercel](https://vercel.com), make sure the `vercel` CLI tool is installed and run the command in the base directory:

```console
vercel
```

The above deploys to development, to deploy it into production, run:

```console
vercel --prod
```

Ensure you add the environment variable `MONGO_DETAILS` in vercel.

## Deploying to Heroku

To deploy to Heroku, connect your repository to the Heroku application and deploy the branch master. This template has been deployed to Heroku and you can view it here: [FastAPI Mongo](https://fastapi-mongo.herokuapp.com/)

Ensure you add the environment variable `MONGO_DETAILS` in your application's settings.

## Dockerising

To build a docker image for this boilerplate, create a duplicate `.env` file but with name `env`. Next, build an image:

```console
docker build -t fastapi-mongo .
```

The command above builds an image that can be deployed. To run the image in a container:

```console
docker run --env-file env -d --name fastapi-mongo -p 80:80 fastapi-mongo:latest
```

## Contributing ?

Fork the repo, make changes and send a PR. We'll review it together!

## TODOS

- [ ] Add a simple bash script file that runs the installation process.

- [x] Fix the `UPDATE` part of the CRUD operation

- [x] Add Authentication

- [x] Add Dockerfile

- [x] Vercel configuration file

- [x] Deploying to Heroku

- [ ] Write a concise README

- [x] Format code. I'm new to FastAPI so I'll be working towards best practices.

## License

This project is licensed under the terms of MIT license.

repository: luisdiegov/fastapi-mongo

repo_name: luisdiegov/fastapi-mongo


text:
# External AWS Cloud Provider and AWS CSI Driver

## Overview
The support for in-tree cloud providers and the CSI drivers is coming to an end and CAPA supports various upgrade paths
to use [external cloud provider (Cloud Controller Manager - CCM) ](https://github.com/kubernetes/cloud-provider-aws) and external CSI drivers.
This document explains how to create a CAPA cluster with external CSI/CCM plugins and how to upgrade existing clusters that rely on in-tree providers.

## Creating clusters with external CSI/CCM and validating
For clusters that will use external CCM, `cloud-provider: external` flag needs to be set in KubeadmConfig resources in both `KubeadmControlPlane` and `MachineDeployment` resources.

    clusterConfiguration:
      apiServer:
        extraArgs:
          cloud-provider: external
      controllerManager:
        extraArgs:
          cloud-provider: external
    initConfiguration:
      nodeRegistration:
        kubeletExtraArgs:
          cloud-provider: external
    joinConfiguration:
      nodeRegistration:
        kubeletExtraArgs:
          cloud-provider: external

External CCM and EBS CSI driver can be installed manually or using ClusterResourceSets (CRS) onto the CAPA workload cluster.
To install them with CRS, create a CRS resource on the management cluster with labels, for example `csi: external` and `ccm: external` labels.
Then, when creating `Cluster` objects for workload clusters that should have this CSR applied, create them with matching labels `csi: external` and `ccm: external` for CSI and CCM, respectively.

Manifests for installing the AWS CCM and the AWS EBS CSI driver are available from their respective
GitHub repositories (see [here for the AWS CCM](https://github.com/kubernetes/cloud-provider-aws) and
[here for the AWS EBS CSI driver](https://github.com/kubernetes-sigs/aws-ebs-csi-driver)).

An example of a workload cluster manifest with labels assigned for matching to a CRS can be found
[here](https://github.com/kubernetes-sigs/cluster-api-provider-aws/tree/main/templates/cluster-template-external-cloud-provider.yaml).

### Verifying dynamically provisioned volumes with CSI driver
Once you have the cluster with external CCM and CSI controller running successfully, you can test the CSI driver functioning with following steps after switching to workload cluster:
1. Create a service (say,`nginx`)
```yaml
apiVersion: v1
kind: Service
metadata:
  name: nginx-svc
  namespace: default
spec:
  clusterIP: None
  ports:
    - name: nginx-web
      port: 80
  selector:
    app: nginx
```
2. Create a storageclass and statefulset for the service created above with the persistent volume assigned to the storageclass:
```yaml
kind: StorageClass
apiVersion: storage.k8s.io/v1
metadata:
  name: aws-ebs-volumes
provisioner: ebs.csi.aws.com
volumeBindingMode: WaitForFirstConsumer
parameters:
  csi.storage.k8s.io/fstype: xfs
  type: io1
  iopsPerGB: "100"
allowedTopologies:
  - matchLabelExpressions:
      - key: topology.ebs.csi.aws.com/zone
        values:
          - us-east-1a
---
apiVersion: apps/v1
kind: StatefulSet
metadata:
  name: nginx-statefulset
spec:
  serviceName: "nginx-svc"
  replicas: 2
  selector:
    matchLabels:
      app: nginx
  template:
    metadata:
      labels:
        app: nginx
    spec:
      containers:
        - name: nginx
          image: registry.k8s.io/nginx-slim:0.8
          ports:
            - name: nginx-web
              containerPort: 80
          volumeMounts:
            - name: nginx-volumes
              mountPath: /usr/share/nginx/html
      volumes:
        - name: nginx-volumes
          persistentVolumeClaim:
            claimName: nginx-volumes
  volumeClaimTemplates:
    - metadata:
        name: nginx-volumes
      spec:
        storageClassName: "aws-ebs-volumes"
        accessModes: [ "ReadWriteOnce" ]
        resources:
          requests:
            storage: 4Gi
 ```
3. Once you apply the above manifest, the EBS volumes will be created and attached to the worker nodes.

>**IMPORTANT WARNING:** The CRDs from the AWS EBS CSI driver and AWS external cloud provider gives issue while installing the respective controllers on the AWS Cluster, it doesn't allow statefulsets to create the volume on existing EC2 instance.
> We need the CSI controller deployment and CCM pinned to the control plane which has right permissions to create, attach
> and mount the volumes to EC2 instances. To achieve this, you should add the node affinity rules to the CSI driver controller deployment and CCM DaemonSet manifests.
> ```yaml
> tolerations:
> - key: node-role.kubernetes.io/master
>   effect: NoSchedule
> - effect: NoSchedule
>   key: node-role.kubernetes.io/control-plane
> affinity:
>   nodeAffinity:
>   requiredDuringSchedulingIgnoredDuringExecution:
>     nodeSelectorTerms:
>       - matchExpressions:
>           - key: node-role.kubernetes.io/control-plane
>             operator: Exists
>       - matchExpressions:
>           - key: node-role.kubernetes.io/master
>             operator: Exists
>```

## Validated upgrade paths for existing clusters

From Kubernetes 1.23 onwards, `CSIMigrationAWS` flag is enabled by default, which requires the installation of [external CSI driver](https://github.com/kubernetes-sigs/aws-ebs-csi-driver), unless `CSIMigrationAWS` is disabled by the user.
For installing external CSI/CCM in the upgraded cluster, CRS can be used, see the section above for details.

CCM and CSI do not need to be migrated to use external plugins at the same time,
external CSI drivers works with in-tree CCM (Warning: using in-tree CSI with external CCM does not work).

**Following 3 upgrade paths are validated:**
- Scenario 1: During upgrade to v1.23.x, disabling `CSIMigrationAWS` flag and keep using in-tree CCM and CSI.
- Scenario 2: During upgrade to v1.23.x, enabling `CSIMigrationAWS` flag and using in-tree CCM with external CSI.
- Scenario 3: During upgrade to v1.23.x, enabling `CSIMigrationAWS` flag and using external CCM and CSI.

|                             | CSI      | CCM      | feature-gate CSIMigrationAWS | external-cloud-volume-plugin |
|-----------------------------|----------|----------|------------------------------|------------------------------|
| **Scenario 1**              |          |          |                              |                              |
| From Kubernetes  < v1.23    | in-tree  | in-tree  | off                          | NA                           |
| To Kubernetes    >= v1.23   | in-tree  | in-tree  | off                          | NA                           |
| **Scenario 2**              |          |          |                              |                              |
| From Kubernetes  < v1.23    | in-tree  | in-tree  | off                          | NA                           |
| To Kubernetes    >= v1.23   | external | in-tree  | on                           | NA                           |
| **Scenario 3**              |          |          |                              |                              |
| From Kubernetes  < v1.23    | in-tree  | in-tree  | off                          | NA                           |
| To Kubernetes    >= v1.23   | external | external | on                           | aws                          |

**KubeadmConfig in the upgraded cluster for scenario 1:**

    clusterConfiguration:
      apiServer:
        extraArgs:
          cloud-provider: aws
      controllerManager:
        extraArgs:
          cloud-provider: aws
          feature-gates: CSIMigrationAWS=false
    initConfiguration:
      nodeRegistration:
        kubeletExtraArgs:
          cloud-provider: aws
          feature-gates: CSIMigrationAWS=false
        name: '{{ ds.meta_data.local_hostname }}'
    joinConfiguration:
      nodeRegistration:
        kubeletExtraArgs:
          cloud-provider: aws
          feature-gates: CSIMigrationAWS=false

**KubeadmConfig in the upgraded cluster for scenario 2:**

When `CSIMigrationAWS=true`, installed external CSI driver will be used while relying on in-tree CCM.

    clusterConfiguration:
      apiServer:
        extraArgs:
          cloud-provider: aws
          feature-gates: CSIMigrationAWS=true   // Set only if Kubernetes version < 1.23.x, otherwise this flag is enabled by default.
      controllerManager:
        extraArgs:
          cloud-provider: aws
          feature-gates: CSIMigrationAWS=true   // Set only if Kubernetes version < 1.23.x, otherwise this flag is enabled by default.
    initConfiguration:
      nodeRegistration:
        kubeletExtraArgs:
          cloud-provider: aws
          feature-gates: CSIMigrationAWS=true   // Set only if Kubernetes version < 1.23.x, otherwise this flag is enabled by default.
    joinConfiguration:
      nodeRegistration:
        kubeletExtraArgs:
          cloud-provider: aws
          feature-gates: CSIMigrationAWS=true   // Set only if Kubernetes version < 1.23.x, otherwise this flag is enabled by default.

**KubeadmConfig in the upgraded cluster for scenario 3:**

`external-cloud-volume-plugin` flag needs to be set for old Kubelets to keep talking to in-tree CCM and upgrade fails without this is set.

    clusterConfiguration:
      apiServer:
        extraArgs:
          cloud-provider: external
      controllerManager:
        extraArgs:
          cloud-provider: external
          external-cloud-volume-plugin: aws
    initConfiguration:
      nodeRegistration:
        kubeletExtraArgs:
          cloud-provider: external
    joinConfiguration:
      nodeRegistration:
        kubeletExtraArgs:
          cloud-provider: external

gha_language: Go


text:
![No Maintenance Intended](https://img.shields.io/badge/No%20Maintenance%20Intended-%E2%9C%95-red.svg)
![TensorFlow Requirement: 1.x](https://img.shields.io/badge/TensorFlow%20Requirement-1.x-brightgreen)
![TensorFlow 2 Not Supported](https://img.shields.io/badge/TensorFlow%202%20Not%20Supported-%E2%9C%95-red.svg)

# Filtering Variational Objectives

This folder contains a TensorFlow implementation of the algorithms from

Chris J. Maddison\*, Dieterich Lawson\*, George Tucker\*, Nicolas Heess, Mohammad Norouzi, Andriy Mnih, Arnaud Doucet, and Yee Whye Teh. "Filtering Variational Objectives." NIPS 2017.

[https://arxiv.org/abs/1705.09279](https://arxiv.org/abs/1705.09279)

This code implements 3 different bounds for training sequential latent variable models: the evidence lower bound (ELBO), the importance weighted auto-encoder bound (IWAE), and our bound, the filtering variational objective (FIVO).

Additionally it contains several sequential latent variable model implementations:

* Variational recurrent neural network (VRNN)
* Stochastic recurrent neural network (SRNN)
* Gaussian hidden Markov model with linear conditionals (GHMM)

The VRNN and SRNN can be trained for sequence modeling of pianoroll and speech data. The GHMM is trainable on a synthetic dataset, useful as a simple example of an analytically tractable model.

#### Directory Structure
The important parts of the code are organized as follows.

```
run_fivo.py         # main script, contains flag definitions
fivo
├─smc.py            # a sequential Monte Carlo implementation
├─bounds.py         # code for computing each bound, uses smc.py
├─runners.py        # code for VRNN and SRNN training and evaluation
├─ghmm_runners.py   # code for GHMM training and evaluation
├─data
| ├─datasets.py     # readers for pianoroll and speech datasets
| ├─calculate_pianoroll_mean.py  # preprocesses the pianoroll datasets
| └─create_timit_dataset.py      # preprocesses the TIMIT dataset
└─models
  ├─base.py   # base classes used in other models
  ├─vrnn.py   # VRNN implementation
  ├─srnn.py   # SRNN implementation
  └─ghmm.py   # Gaussian hidden Markov model (GHMM) implementation
bin
├─run_train.sh            # an example script that runs training
├─run_eval.sh             # an example script that runs evaluation
├─run_sample.sh           # an example script that runs sampling
├─run_tests.sh            # a script that runs all tests
└─download_pianorolls.sh  # a script that downloads pianoroll files
```

### Pianorolls

Requirements before we start:

* TensorFlow (see [tensorflow.org](http://tensorflow.org) for how to install)
* [scipy](https://www.scipy.org/)
* [sonnet](https://github.com/deepmind/sonnet)

#### Download the Data

The pianoroll datasets are encoded as pickled sparse arrays and are available at [http://www-etud.iro.umontreal.ca/~boulanni/icml2012](http://www-etud.iro.umontreal.ca/~boulanni/icml2012). You can use the script `bin/download_pianorolls.sh` to download the files into a directory of your choosing.
```
export PIANOROLL_DIR=~/pianorolls
mkdir $PIANOROLL_DIR
sh bin/download_pianorolls.sh $PIANOROLL_DIR
```

#### Preprocess the Data

The script `calculate_pianoroll_mean.py` loads a pianoroll pickle file, calculates the mean, updates the pickle file to include the mean under the key `train_mean`, and writes the file back to disk in-place. You should do this for all pianoroll datasets you wish to train on.

```
python data/calculate_pianoroll_mean.py --in_file=$PIANOROLL_DIR/piano-midi.de.pkl
python data/calculate_pianoroll_mean.py --in_file=$PIANOROLL_DIR/nottingham.de.pkl
python data/calculate_pianoroll_mean.py --in_file=$PIANOROLL_DIR/musedata.pkl
python data/calculate_pianoroll_mean.py --in_file=$PIANOROLL_DIR/jsb.pkl
```

#### Training

Now we can train a model. Here is the command for a standard training run, taken from `bin/run_train.sh`:
```
python run_fivo.py \
  --mode=train \
  --logdir=/tmp/fivo \
  --model=vrnn \
  --bound=fivo \
  --summarize_every=100 \
  --batch_size=4 \
  --num_samples=4 \
  --learning_rate=0.0001 \
  --dataset_path="$PIANOROLL_DIR/jsb.pkl" \
  --dataset_type="pianoroll"
```

You should see output that looks something like this (with extra logging cruft):

```
Saving checkpoints for 0 into /tmp/fivo/model.ckpt.
Step 1, fivo bound per timestep: -11.322491
global_step/sec: 7.49971
Step 101, fivo bound per timestep: -11.399275
global_step/sec: 8.04498
Step 201, fivo bound per timestep: -11.174991
global_step/sec: 8.03989
Step 301, fivo bound per timestep: -11.073008
```
#### Evaluation

You can also evaluate saved checkpoints. The `eval` mode loads a model checkpoint, tests its performance on all items in a dataset, and reports the log-likelihood averaged over the dataset. For example here is a command, taken from `bin/run_eval.sh`, that will evaluate a JSB model on the test set:

```
python run_fivo.py \
  --mode=eval \
  --split=test \
  --alsologtostderr \
  --logdir=/tmp/fivo \
  --model=vrnn \
  --batch_size=4 \
  --num_samples=4 \
  --dataset_path="$PIANOROLL_DIR/jsb.pkl" \
  --dataset_type="pianoroll"
```

You should see output like this:
```
Restoring parameters from /tmp/fivo/model.ckpt-0
Model restored from step 0, evaluating.
test elbo ll/t: -12.198834, iwae ll/t: -11.981187 fivo ll/t: -11.579776
test elbo ll/seq: -748.564789, iwae ll/seq: -735.209206 fivo ll/seq: -710.577141
```
The evaluation script prints log-likelihood in both nats per timestep (ll/t) and nats per sequence (ll/seq) for all three bounds.

#### Sampling

You can also sample from trained models. The `sample` mode loads a model checkpoint, conditions the model on a prefix of a randomly chosen datapoint, samples a sequence of outputs from the conditioned model, and writes out the samples and prefix to a `.npz` file in `logdir`. For example here is a command that samples from a model trained on JSB, taken from `bin/run_sample.sh`:
```
python run_fivo.py \
  --mode=sample \
  --alsologtostderr \
  --logdir="/tmp/fivo" \
  --model=vrnn \
  --bound=fivo \
  --batch_size=4 \
  --num_samples=4 \
  --split=test \
  --dataset_path="$PIANOROLL_DIR/jsb.pkl" \
  --dataset_type="pianoroll" \
  --prefix_length=25 \
  --sample_length=50
```

Here `num_samples` denotes the number of samples used when conditioning the model as well as the number of trajectories to sample for each prefix.

You should see very little output.
```
Restoring parameters from /tmp/fivo/model.ckpt-0
Running local_init_op.
Done running local_init_op.
```

Loading the samples with `np.load` confirms that we conditioned the model on 4
prefixes of length 25 and sampled 4 sequences of length 50 for each prefix.
```
>>> import numpy as np
>>> x = np.load("/tmp/fivo/samples.npz")
>>> x[()]['prefixes'].shape
(25, 4, 88)
>>> x[()]['samples'].shape
(50, 4, 4, 88)
```

### Training on TIMIT

The TIMIT speech dataset is available at the [Linguistic Data Consortium website](https://catalog.ldc.upenn.edu/LDC93S1), but is unfortunately not free. These instructions will proceed assuming you have downloaded the TIMIT archive and extracted it into the directory `$RAW_TIMIT_DIR`.

#### Preprocess TIMIT

We preprocess TIMIT (as described in our paper) and write it out to a series of TFRecord files. To prepare the TIMIT dataset use the script `create_timit_dataset.py`
```
export $TIMIT_DIR=~/timit_dataset
mkdir $TIMIT_DIR
python data/create_timit_dataset.py \
  --raw_timit_dir=$RAW_TIMIT_DIR \
  --out_dir=$TIMIT_DIR
```
You should see this exact output:
```
4389 train / 231 valid / 1680 test
train mean: 0.006060  train std: 548.136169
```

#### Training on TIMIT
This is very similar to training on pianoroll datasets, with just a few flags switched.
```
python run_fivo.py \
  --mode=train \
  --logdir=/tmp/fivo \
  --model=vrnn \
  --bound=fivo \
  --summarize_every=100 \
  --batch_size=4 \
  --num_samples=4 \
  --learning_rate=0.0001 \
  --dataset_path="$TIMIT_DIR/train" \
  --dataset_type="speech"
```
Evaluation and sampling are similar.

### Tests
This codebase comes with a number of tests to verify correctness, runnable via `bin/run_tests.sh`. The tests are also useful to look at for examples of how to use the code.

### Contact

This codebase is maintained by Dieterich Lawson. For questions and issues please open an issue on the tensorflow/models issues tracker and assign it to @dieterichlawson.