text:
### CS2DarkSky ###
==================

C# Wrapper Library For [Dark Sky](https://darksky.net/)

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

###Usage###

```c#
    using CS2DarkSky;

    var service = new DarkSkyService("YOUR API KEY");
    var response = service.Download(37.8267, -122.423);
```

Returns the complete object :

![Response Example](assets/response-example.png)

####Get the observed (in the past) or forecasted (in the future) hour-by-hour and daily weather conditions for a particular date####

```c#
    using CS2DarkSky;

    var service = new DarkSkyService("YOUR API KEY");
    var response = service.Download(37.8267, -122.423, DateTime.Now, Unit.SI, Language.English);
```

####Extends the hourly period from 48 hours to 168 hours####

```c#
    using CS2DarkSky;

    var service = new DarkSkyService("YOUR API KEY");
    var response = service.Download(37.8267, -122.423, null, Units.SI, Language.English, extend: true);
```

####Exclude certain objects (returned as null)####

```c#
    using CS2DarkSky;

    var excludeBlocks = new [] { Exclude.alerts, Exclude.currently };
    var service = new DarkSkyService("YOUR API KEY");
    var response = service.Download(37.8267, -122.423, DateTime.Now, Unit.SI, Language.English, null, excludeBlocks);
```

####Please note:####

 - You will require your own Dark Sky [API Key](https://darksky.net/dev/)
 - Not all regions return forecasts by all periods (Daily, Minutely etc.)
 - Not all regions return all flags.

####Terms of service####

Please remember to follow the [Terms of Service of Dark Sky](https://darksky.net/dev/docs/terms) when it comes to use this library.

>You agree that any application or service which incorporates data obtained from the Service shall prominently display the message “Powered by Dark Sky” in a legible manner near the data or any information derived from any data from the Service. This message must, if possible, open a link to [https://darksky.net/poweredby/](https://darksky.net/poweredby/) when clicked or touched.


text:
# PWN PHONE - DREAM DEVICE FOR HACKERS

The Pwn Phone is a real-life product made by a Boston-based startup called Pwnie Express. The "dream device for hackers" allows users to check if there are any vulnerabilities in wired, wireless, or Bluetooth networks, and it looks like a regular cell phone. If you have a spare $1,095 sitting around, you can buy one here.

Pwn Phone 2014 Demo : [YouTube](https://www.youtube.com/watch?v=He_bxvcvFGE)

but if you have few things then you can also build your own Pwn Phone.

## Things You Need :

● Nexus 5 : [Search Online](https://www.google.com/search?q=BUY+GOOGLE+NEXUS+5)

● A Linux-based system (i'm using Kali Linux)

● Pwn Phone's Rom : [Nexus 5](https://drive.google.com/open?id=1FH7QOZwE6H9lgyUAKixtPvd9WKqImE9w)

● WiFi and Bluetooth Adaptor that support packet injection (for wireless pentesting)

● OTG Cable

## How To Flash Rom :

Note : this process will erase your all data from your phone so create backup before flashing the rom.

● Here I'm using Linux system, so open your terminal as root user

● Update : `apt-get update`

● Install ADB & Fastboot : `apt-get install android-tools-adb android-tools-fastboot`

● Unzip the Pwn Phone's Rom

● make flash.sh file executable : `chmod +x flash.sh`

● Turn off your Nexus 5 and reboot it into fastboot mode Holding Power + Vol. Down Key and Connect it with you PC using USB cable

● then Unlock Bootloader of Your Nexus 5 : `fastboot oem unlock`

● Open Terminal and flash rom : `./flash.sh`

● Choose your device and the installation process will begin.

● Once the installation process completed your device will automatically rebooted and ready to use.

## My Opinion :

I know because of Mr.Robot's popularity many people would like to try it.. but currently i think the developers of Pwn Phone stoped working on this project because there is no update or latest version available of the previous pwn phone rom, even the old rom is now not available in their official website.. In past few months many people requested me to upload the pwn phone's rom that's why i'm updating this repository now..

i recommend you guys to try [Kali Nethunter](https://www.kali.org/kali-linux-nethunter/). it is also free and much better than pwn phone and most important thing, you will receive the regular updates..

Watch This : [Kali Nethunter - Everything You Need To Know + Installation](https://www.youtube.com/watch?v=7QKqHWosCsU) (Language : Hindi)

## Download Links :

Download PwnPhone ROM for Nexus 5 : [Google Drive](https://drive.google.com/open?id=1FH7QOZwE6H9lgyUAKixtPvd9WKqImE9w)

## Video

YouTube : [How to turn your phone into a "Pwn Phone"](https://www.youtube.com/watch?v=x-TLSKqg6CI) (Language : Hindi)

That's It... If You Like This Repo. Please Share This With Your Friends..

& Don't Forget To Follow Me At [Twitter](https://www.twitter.com/thehackingsage), [Instagram](https://www.instagram.com/thehackingsage), [Github](https://www.github.com/thehackingsage) & SUBSCRIBE My [YouTube](https://www.youtube.com/channel/UCYK1n9A4TUq1CvGc6F3DzoA) Channel..!!!

***Happy Hacking!!!***

license: MIT

repository: UnLyy/pwnphone

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: UnLyy/pwnphone


text:
---
title: "Build a Custom Evaluator"
linkTitle: "Build a Custom Evaluator"
weight: 4
description: >
  A tutorial on how to build a custom Evaluator and configure Open Match to use it.
---

## Objectives

The tutorial aims to explain how to :

- Build your Custom Evaluator
- Deploy, Run your custom Evaluator and configure Open Match core to use it

## Prerequisites

### Default Evaluator tutorial

It is highly recommended that you run the [default Evaluator tutorial]({{< relref "../DefaultEvaluator/_index.md" >}}) as it introduces the core concepts that this tutorial builds upon. After completion, please remember to [cleanup the default Evaluator tutorial]({{< relref "../DefaultEvaluator/_index.md#cleanup" >}}) before proceeding.

{{% alert title="Note" color="info" %}}
Given that all the other tutorials so far use the default Evaluator, the chances are, you already have the default Evaluator deployed in the open-match namespace. That is OK as at a later point, you will simply configure Open Match to point to your custom Evaluator in this tutorial's namespace.

However, given that the default Evaluator in the open-match namespace will not be used for this tutorial, you may choose to delete it. Alternatively, you may delete the open-match namespace and [Install Open Match Core]({{< relref "../../Installation/yaml.md#install-core-open-match" >}}) **without** installing the default Evaluator.
{{% /alert %}}

### Set up Image Registry

Please setup an Image registry(such as [Docker Hub](https://hub.docker.com/) or [GC Container Registry](https://cloud.google.com/container-registry/)) to store the Docker Images used in this tutorial. Once you have set this up, here are the instructions to set up a shell variable that points to your registry:

```cmd
REGISTRY=[YOUR_REGISTRY_URL]
```

If using GKE, you can populate the image registry using the command below:

```cmd
REGISTRY=gcr.io/$(gcloud config list --format 'value(core.project)')
```

### Get the tutorial template

Make a local copy of the [tutorials Folder](https://github.com/googleforgames/open-match/blob/{{< param release_branch >}}/tutorials/custom_evaluator). Checkout `release-x.y` branch（e.g. release-1.3, release-1.4） of the Open Match Git repository. Use `tutorials/custom_evaluator` of `release-x.y` branch as a working copy for all the instructions in this tutorial.

For convenience, set the following variable:

```cmd
TUTORIALROOT=[SRCROOT]/tutorials/custom_evaluator
```

{{% alert title="Note" color="info" %}}
This tutorial only focuses on building the custom Evaluator and so the working copy of Matchmaker components already has the changes to Frontend, Director that were made to work with the default Evaluator.
{{% /alert %}}

### Create the tutorial namespace

Run this command to create a namespace custom-eval-tutorial in which all the components for this tutorial will be deployed.

```bash
kubectl create namespace custom-eval-tutorial
```

## References

It is highly recommended that you read the [Evaluator Guide]({{< relref "../../Guides/Evaluator/_index.md" >}}) to familiarize yourself with the lifecycle of a Match proposal through the synchronization and evaluation phases. Also, keep the [API Reference]({{< relref "../../reference/api.md" >}}) handy to look up Open Match specific terminology used in this document. The tutorial also customizes the Open Match installation with the configuration of the custom Evaluator. The [Customization Guide]({{< relref "../../Guides/Custom/_index.md" >}}) is a good reference for those changes.

A complete [solution](https://github.com/googleforgames/open-match/blob/{{< param release_branch >}}/tutorials/custom_evaluator/solution) for this tutorial is in the folder `tutorials/custom_evaluator/solution`.

## Custom Evaluator

### Scenario Overview

For this tutorial, we will use the matchmaking scenario where a Player selects more than one game-mode to be considered for finding a Match. This will result in concurrent MatchFunction executions to generate overlapping results and hence require evaluation. We will build a custom Evaluator and configure Open Match to resolve conflicts using this Evaluator. We will also add the property on the Ticket indicating the time at which the Ticket entered matchmaking queue.
{{% alert title="Note" color="info" %}}
Comparing to the default Evaluator, the Matchmaking function **need** not precompute any score to hint on Match quality. You will have full control over what Tickets decide a better Match with a custom evaluator.
{{% /alert %}}

Thus, the only change to the Matchmaker components from the default Evaluator tutorial is that we will not compute the score or the DefaultEvaluationCriteria in the Match Function. The core of the tutorial thus will focus on authoring the Evaluator and customizing Open Match with it.

### Building the Evaluator

Please revisit the Evaluator overview section in the [default Evaluator tutorial]({{< relref "../DefaultEvaluator/_index.md#evaluation" >}}) as it specifically calls out the scenario in which a custom Evaluator is needed.

This tutorial provides an Evaluator scaffold (`$TUTORIALROOT/evaluator`) as a starting point. The basis [Evaluator server](https://github.com/googleforgames/open-match/blob/{{< param release_branch >}}/tutorials/custom_evaluator/evaluator/evaluate/server.go) implementation in `$TUTORIALROOT/evaluator/evaluate/server.go` provides the following functionality:

- Creates a gRPC service that listens on the configured port
- Implements the `Evaluate()` interface that Open Match prescribes
- Accepts a stream of proposals in its implementation for this interface and then calls into a simplified helper method.
- Streams back results from the helper method to Open Match.

Below is the `evaluate()` helper method in `$TUTORIALROOT/evaluator/evaluate/evaluator.go` where the core evaluation logic should be implemented. At runtime, Open Match calls the `Evaluate()` method and streams the proposals for evaluation. This triggers the `evaluate()` method with a list of proposals. The `evaluate()` method should de-collide the proposals and return a list of results that Open Match will then return back to the Director.

```golang
func evaluate(proposals []*pb.Match) ([]string, error) {
  // Core evaluation logic
  return []string{}, nil
}
```

Please add your evaluation logic to this method. Here are some strategies for evaluation you may use when you detect Matches with overlapping Tickets:

1. Aggregate the wait time of the Tickets on the Match. The Match with higher aggregate wait time is selected and the rest are discarded.
2. Match with the Ticket with the longest wait time gets selected and others discarded.

These are just suggestions. You can also experiment with your own evaluation criteria for this scenario.

As a reference, you may check the implementation of the [tutorial solution Evaluator](https://github.com/googleforgames/open-match/blob/{{< param release_branch >}}/tutorials/custom_evaluator/solution/evaluator/evaluate/evaluator.go) that uses strategy 2.

### Build and Push

Now that we have a custom Evaluator, please run the below commands in the `$TUTORIALROOT` to build and push the Evaluator to your configured image registry.

```cmd
docker build -t $REGISTRY/custom-eval-tutorial-evaluator evaluator/
docker push $REGISTRY/custom-eval-tutorial-evaluator
```

### Deploy and Customize

Run the below command in the `$TUTORIALROOT` path to deploy the custom Evaluator to the `custom-eval-tutorial` namespace:

```cmd
sed "s|REGISTRY_PLACEHOLDER|$REGISTRY|g" evaluator/evaluator.yaml | kubectl apply -f -
```

We need to update the Open Match ConfigMap with details of the custom Evaluator. The [Customization Guide]({{< relref "../../Guides/Custom/_index.md" >}}) provides some details on customizing your Open Match installation. The updated ConfigMap for the custom Evaluator is present in the `customization.yaml`. Run the below command in the `$TUTORIALROOT` path to customize Open Match installation:

```bash
kubectl apply -f customization.yaml --namespace open-match
```

## Build, Deploy, Run Matchmaker

### Build and Push Container images

Now that you have customized these components, please run the below commands from `$TUTORIALROOT` to build new images and push them to your configured image registry.

```cmd
docker build -t $REGISTRY/custom-eval-tutorial-frontend frontend/
docker push $REGISTRY/custom-eval-tutorial-frontend
docker build -t $REGISTRY/custom-eval-tutorial-director director/
docker push $REGISTRY/custom-eval-tutorial-director
docker build -t $REGISTRY/custom-eval-tutorial-matchfunction matchfunction/
docker push $REGISTRY/custom-eval-tutorial-matchfunction
```

### Deploy and Run

Run the below command in the `$TUTORIALROOT` path to deploy the MatchFunction, Game Frontend. the Director to the `custom-eval-tutorial` namespace:

```cmd
sed "s|REGISTRY_PLACEHOLDER|$REGISTRY|g" matchmaker.yaml | kubectl apply -f -
```

### Output

All the components in this tutorial simply log their progress to stdout. To see the progress, run the below commands:

```bash
kubectl logs -n custom-eval-tutorial pod/custom-eval-tutorial-frontend
kubectl logs -n custom-eval-tutorial pod/custom-eval-tutorial-director
kubectl logs -n custom-eval-tutorial pod/custom-eval-tutorial-matchfunction
```

To check the logs from the custom Evaluator, run the following commands:

```bash
kubectl logs -n custom-eval-tutorial pod/custom-eval-tutorial-evaluator
```

## Cleanup

Run the below command to remove all the components of this tutorial:

```bash
kubectl delete namespace custom-eval-tutorial
```

This will delete all the components deployed in this tutorial. Open Match core in open-match namespace can then be reused for other exercises but you will need to re-customize it.

repository: googleforgames/open-match-docs

branch_name: refs/heads/main

gha_language: CSS

repo_name: googleforgames/open-match-docs


text:
## Who Owns the One Ring?

Sauron forged the One Ring for himself,
but there were multiple owners through the times. Isildur took
the ring after defeating Sauron, but then lost it. Déagol found it,
but Gollum killed him and took the ring from him.
See the rest of the story in the code.

We want to check the ownership at three checkpoints. Comment out the
lines with `println!` to make the ownership check results correct
(and the code compiled!).

Remember, there should be only one owner at a time.

Rust won't let you make a mistake anyway because ownership is checked
by the compiler. Try to cheat on it!

url: https://raw.githubusercontent.com/jetbrains-academy/rustlings-course/240b83b4f514714d9fb1112b1e6a7173d1147237/Understanding Ownership/What is ownership/Who Owns the One Ring/task.md

repository: jetbrains-academy/rustlings-course

gha_language: Rust

gha_license_id: MIT

repo_name: jetbrains-academy/rustlings-course


text:
Code Challenge
Find the first repeated word in a book.

Specifications
Read all of the following instructions carefully. Name things exactly as described, or you will get a ZERO without comment
Do all your work in a public repository (matching the example provided by your instructor) called data-structures-and-algorithms, with a well-formatted, detailed top-level README.md
Create a branch in your repository called repeated_word
On your branch, create…
C#: Create a method named RepeatedWord() outside of Main() in your Program.cs file. Call Your newly created method in Main() once complete.
JavaScript: a folder named repeatedWord which contains a file called repeated-word.js
Python: a folder named repeated_word which contains a file called repeated_word.py
Java: a folder named RepeatedWord which contains a file called RepeatedWord.java
Include any language-specific configuration files required for this challenge to become an individual component, module, library, etc.
NOTE: You can find an example of this configuration for your course in your class lecture repository.
Feature Tasks
Write a function that accepts a lengthy string parameter.
Without utilizing any of the built-in library methods available to your language, return the first word to occur more than once in that provided string.
Structure and Testing
Utilize the Single-responsibility principle: any methods you write should be clean, reusable, abstract component parts to the whole challenge. You will be given feedback and marked down if you attempt to define a large, complex algorithm in one function definition.

Write at least three test assertions for each method that you define.

Example
Input	Output
"Once upon a time, there was a brave princess who..."	"a"
"It was the best of times, it was the worst of times, it was the age of wisdom, it was the age of foolishness, it was the epoch of belief, it was the epoch of incredulity, it was the season of Light, it was the season of Darkness, it was the spring of hope, it was the winter of despair, we had everything before us, we had nothing before us, we were all going direct to Heaven, we were all going direct the other way – in short, the period was so far like the present period, that some of its noisiest authorities insisted on its being received, for good or for evil, in the superlative degree of comparison only..."	"it"
"It was a queer, sultry summer, the summer they electrocuted the Rosenbergs, and I didn’t know what I was doing in New York..."	"summer"
Stretch Goals
Modify your function to return a count of each of the words in the provided string
Modify your function to return a list of the words most frequently used in the provided string
Documentation: Your README.md
# First repeated word
<!-- Short summary or background information -->

## Challenge
<!-- Description of the challenge -->

## Approach & Efficiency
<!-- What approach did you take? Why?  Embedded whiteboard image -->

Submission Instructions
Take a photo of your completed whiteboard, matching the example whiteboard layout
Copy your photo into an /assets directory in your repo
Give the image file the same name as the branch you are working on
Embed the image in your README.md documentation
Create a pull request from your branch to your master branch
In your open pull request, leave as a comment a checklist of the specifications and tasks above, with the actual steps that you completed checked off
Submitting your completed work to Canvas:
Copy the link to your open pull request and paste it into the corresponding Canvas assignment
Leave a description of how long this assignment took you in the comments box
Add any additional comments you like about your process or any difficulties you may have had with the assignment
Merge your branch into master, and delete your branch (don’t worry, the PR link will still work)
© Code Fellows 2019

gha_language: JavaScript


text:
# ShapefileReader
__A shapefile reader in Swift__

__Description__

Reads data from files in [Shapefile](https://en.wikipedia.org/wiki/Shapefile) format.

__API Overview__

ShapefileReader is the only object you instantiate.

Internally, it builds the three following objects, depending on the available auxiliary files:
- `SHPReader` to read the shapes, ie the list of points
- `DBFReader` to read the data records associated with the shapes
- `SHXReader` to read the indices of the shapes, thus allowing direct access
- `PRJReader` to read the coordinate system and projection information

Most usages of `ShapefileReader` will remain like:

```swift
guard let sr = ShapefileReader(path: "g1g15.shp") else { assertionFailure() }

// iterate over both shapes and records
for (shape, record) in zip(sr.shp, sr.dbf!) {
    // record is [AnyObject]

    for points in shape {
        // draw polygon with [CGPoint]
        // or map to [CLLocationCoordinate2D] using sr.coordinateConverter()
    }
}
```

DBF API

```swift
// if dbf file exists
if let dbf = sr.dbf {
    // number of records
    let n = dbf.numberOfRecords

    // fields description
    print(dbf.fields)

    // iterate over records
    for r in dbf {
        // ...
    }

    // access a record by index
    print(dbf[1847])
}
```

    [[DeletionFlag, C, 1, 0], [GMDNR, N, 9, 0], [GMDNAME, C, 50, 0], [BZNR, N, 9, 0], [KTNR, N, 9, 0], [GRNR, N, 9, 0], [AREA_HA, N, 9, 0], [X_MIN, N, 9, 0], [X_MAX, N, 9, 0], [Y_MIN, N, 9, 0], [Y_MAX, N, 9, 0], [X_CNTR, N, 9, 0], [Y_CNTR, N, 9, 0], [Z_MIN, N, 9, 0], [Z_MAX, N, 9, 0], [Z_AVG, N, 9, 0], [Z_MED, N, 9, 0], [Z_CNTR, N, 9, 0]]
    [5586, Lausanne, 2225, 22, 1, 4138, 534438, 544978, 150655, 161554, 538200, 152400, 371, 930, 670, 666, 585]

SHX API

```swift
// if index file exists
if let shx = sr.shx {
    // access a shape by index
    if let offset = shx.shapeOffsetAtIndex(2) {
    	if let (nextIndex, shape) = shp.shapeAtOffset(offset) {
	        // use shape
    	}
    }
}
```

or more simply

```swift
let shape = sr[2]
```

PRJ API

```swift
if let cs = sr.prj?.cs {
    // use CoordinateSystem information to convert CGPoint to CLLocationCoordinate2D
}
```
You can override sr.coordinateConverter() to support coordinate systems other than WGS84

__Implementation Details__

- shape points are CGPoint arrays
- record are arrays of Int, Double, Bool or String (no NSDate, no optionals)
- random access in files and enumerators are used each time it is possible
- most of time, code will ignore when files do not match the specs, feel free to open an issue and join the offending files in case of crash

__Tests and Drawing__

The package comes with a unit test target.

Also, it comes with a project that contains `BitmapCanvas` and its subclass `BitmapCanvasShapefile` which will generate the following PNG files.


text:
---
layout: post
title: P000. Short Communication Distance with nRF24L01
---
According to my plan, nRF24L01 will be the solution for the control data and sensor data transmission. And today, I've received my nRF24L01 chips with antenna. After some test, I've found that the communication distance is quite worrisome.

![post-image]({{ "/assets/img/2020-05-12-nrf24l01-and-arduino.png" | absolute_url }})

The wiring is quite simple and straight forward. Within several minutes, I was able to wire up the chip with Arduino Uno and Arduino Nano. I couldn't wait longer for testing them. So I just copied and pasted the program from the example and run them immediately after that without even looking into a single line of the source code. And in several seconds, I saw the message sent by the Arduino Uno received by the Arduino Nano.

Nice! That's a good beginning. But it is just a beginning. After supper, I decided to do a range test, to see if the transmission range is really reaching the claimed 1100 meters or not. So I left one nRF24L01 at home, and bring the other one with me. After I've walked out around 50 meter, the link is broken. That's very disappointing. It is not even something close to 1100 meters.

I asked google for the answer after that. According to some other examples and the documentation of nRF24L01, I have to set the transmission power to max, and set the data rate to the lowest. Done! And with hope, I've tested once again. This time it is a little bit longer, but still 70 meter, that's it.

To me the worst thing is not that there is a problem, but there is a problem, and you don't know what has caused the problem. Is it because of the buildings in between? Or my configuration? Or the chip is broken? Or some other problems that I've never thought before? I have no chance to know.

But the project must go on. I've taken the adivce from one of my friend. I'll keep the chips for the first iteration, and use them for the communication. In this way the project won't be blocked by the problem that I'm currently facing. It is a possibility that the short communication distance is because of the buildings between the transmitter and the receiver. Later I'll bring it to the open area. If I can get longer communication distance from it, then I'm lucky. Otherwise, I'll try to find another more reliable solution, so that the nRF24L01 can be replaced.

Another thing which bugs me a lot before was how many antennas do I need to implement the duplex communication channel.  The client will send the message to the server, and after the server has received the message, it will send something back as an acknowledgement. Later the server will be the drone, and the client will be the controller. The goal is to get as much ping-pongs as possible between the client and the server within 1 second. And the following part was the best result:

```text
21:49:48.987 -> data received: Pong 758
21:49:49.055 -> data sent: Ping 759
21:49:49.055 -> data received: Pong 759
21:49:49.123 -> data sent: Ping 760
21:49:49.123 -> data received: Pong 760
21:49:49.190 -> data sent: Ping 761
21:49:49.190 -> data received: Pong 761
21:49:49.224 -> data sent: Ping 762
21:49:49.224 -> data received: Pong 762
21:49:49.291 -> data sent: Ping 763
21:49:49.291 -> data received: Pong 763
21:49:49.357 -> data sent: Ping 764
21:49:49.357 -> data received: Pong 764
21:49:49.425 -> data sent: Ping 765
21:49:49.425 -> data received: Pong 765
21:49:49.495 -> data sent: Ping 766
21:49:49.495 -> data received: Pong 766
21:49:49.529 -> data sent: Ping 767
21:49:49.529 -> data received: Pong 767
21:49:49.598 -> data sent: Ping 768
21:49:49.598 -> data received: Pong 768
21:49:49.666 -> data sent: Ping 769
21:49:49.666 -> data received: Pong 769
21:49:49.736 -> data sent: Ping 770
21:49:49.736 -> data received: Pong 770
21:49:49.770 -> data sent: Ping 771
21:49:49.770 -> data received: Pong 771
21:49:49.837 -> data sent: Ping 772
21:49:49.837 -> data received: Pong 772
21:49:49.904 -> data sent: Ping 773
21:49:49.904 -> data received: Pong 773
21:49:49.970 -> data sent: Ping 774
21:49:49.970 -> data received: Pong 774
21:49:50.038 -> data sent: Ping 775
```

In one second, the client and the server has managed to do the ping-pong for 16 times. I guess for flying the FPV, this data rate will probably kill the experience. And I guess this rate will becomes even lower once I'm starting to add more and more codes for the sensors and for the flight control. Because each operations to read the sensor and do the math calculation will take time.

Now I'm starting to worry about using Arduino as the main control chip. I probably should try some more powerful solutions out for the brain of the drone. After having watched some great videos from [Joop Brokking](https://www.youtube.com/channel/UCpJ5uKSLxP84TXQtwiRNm1g), I've decided to use a more powerful board directly, instead of staying with Arduino.

repository: flying-watermelon/blog

repo_name: flying-watermelon/blog


text:
# Deploy and Manage Models with SAS Viya

![Ari still](https://img.youtube.com/vi/TxL3lQgnuRE/0.jpg)

These files support the concepts in [Ari Z.'s video tutorial](https://www.youtube.com/watch?v=TxL3lQgnuRE) for deploying open source models in SAS Viya.

* dmcas_fitstat.json – this is the JSON with the R fit statistics
* dmcas_fitstat_sas.json – this is the JSON template from SAS with fit statistics from a SAS model, this is the template we use, replacing the SAS fit stats with values from the R model
* dmcas_roc.json – this is the JSON with the R model ROC information
* dmcas_roc_sas.json – this is the JSON template from SAS with model ROC information from a SAS model, this is the template we use, replacing the SAS ROC information with values from the R model.
* R_Logistic_Regression_Code.R – this is the code used to build the R logistic regression model and output an XML file in PMML format, and to populate the JSON templates with the appropriate fit statistics.
* R_Logistic_Regression_Model.xml – this is the output XML file in PMML format generated by the code R_Logistic_Regression_Code.R.

repository: sascommunities/sas-howto-tutorials

repo_name: sascommunities/sas-howto-tutorials


text:
---
$category@: social login
formats:
  - websites
teaser:
  text: Displays Google One Tap.
---

# amp-onetap

## Overview

You can use the `amp-onetap-google` component to embed a Google One Tap on the page, to allow users to sign into your websites with Google accounts.

#### Example

```html
<amp-onetap-google
  layout="nodisplay"
  data-src="https://rp.com/intermediate"
></amp-onetap-google>
```

## Attributes

    data-src (required)
    The URL of the intermediate iframe.

    common attributes
    This element includes common attributes extended to AMP components.

repository: zhouyx/amphtml

repo_name: zhouyx/amphtml


text:
---
hrs_structure:
  division: '2'
  volume: '11'
  title: '26'
  chapter: 481R
  section: 481R-11
type: hrs_section
tags:
  - Business
menu:
  hrs:
    identifier: HRS_0481R-0011
    parent: HRS0481R
    name: 481R-11 Limitations on use of warrantor's name
weight: 37055
title: Limitations on use of warrantor's name
full_title: 481R-11 Limitations on use of warrantor's name
---
**[§481R-11] Limitations on use of warrantor's name.** (a) A warrantor shall not use:

(1) In its name, the word "casualty", "surety", "insurance", or "mutual" or any other word descriptive of the casualty, insurance, or surety business; or

(2) A name deceptively similar to the name or description of any insurance company, surety corporation, or other warrantor.

(b) A warrantor may use the word "guaranty" or a similar word in the warrantor's name. [L 2002, c 237, pt of §1]

repository: SamMade/BlueAndKrabby

repo_name: SamMade/BlueAndKrabby


text:
---
id: 1343
title: Creating Personalization Options
date: 2018-11-14
guid: https://www.peoplesoftmods.com/?p=1343
permalink: /ux/creating-personalization-options/
tags:
  - User Personalizations
  - Branding Framework
categories:
  - User Experience
---

In my previous post, I described how we can edit existing Personalization Options to allow
for [User Preference-Based Homepage Types](/ux/user-preference-based-homepage-types/).  I am going to expand on this same topic and demonstrate how to create a
custom Personalization Option that will allow end users to select a Portal Branding Theme on their My Preferences page.  The end goal here is to allow end users
to select their Homepage type (Classic or Fluid) as well as allow them to select their Theme so that they can have the most optimal user experience.

### Define Personalization Option

Navigate to `Main Menu > PeopleTools > Personalization > Personalization Options`.  Open the _CSTM_ Option Category Level.  Add a new row to the grid and
populate the fields under the _Definition_ tab as follows:

**User Option**: PSM_THEME
**Description**: Portal Branding Theme
**Option Category Group**: Custom Personalizations
**Option Category**: Genral Options
**User Option Type**: System

[1]: /assets/images/2018/11/Option_Definition.png
[![Option Definition][1]][1]

Then populate the fields under the _Format_ tab as follows:

**Record (Table) Name**: PTBR_THEME
**Field Name**: DESCR

[2]: /assets/images/2018/11/Option_Format.png
[![Option Format][2]][2]

### Provision User Personalization Security

Navigate to `Main Menu > PeopleTools > Security > Permissions & Roles > Permission Lists`.  Open a Permission List of your choosing and select the
Personalizations tab.  Add a new row to the Personalizartion Options grid and populate the fields as follows:

**Option Category Level**: Custom
**Option Category Group**: Custom Personalizations

[3]: /assets/images/2018/11/Permission_List.png
[![Permission List][3]][3]

Click the _Edit Options_ link to be taken to the Personalization Permissions page.  Check the _Allow User Option_ checkbox for the row with the _PSM_THEME_ User
Option.

[4]: /assets/images/2018/11/Personalization_Permissions.png
[![Personalization Permissions][4]][4]

### Results

Now when a privileged user goes to the My Preferences page, they will have the ability to select a Portal Branding Theme from the list of configured Themes.

[5]: /assets/images/2018/11/My_Preferences2.png
[![My Preferences][5]][5]

* * *

The configuration done in this post will allow for developers to make use of the _GetUserOption_ function for the newly defined _PSM_THEME_ User Option.
The PeopleCode would look like:

```java
Local String &sDescr = GetUserOption("CSTM", "PSM_THEME");
```

And the function will return the description of the Portal Branding Theme that the user has selected.

In my next post, I will demonstrate how we can leverage the _GetUserOption_ function in a custom User Attribute so that we can conditionally apply the
user’s selected Portal Branding Theme at runtime.

repository: coltonfischer/peoplesoft-mods

repo_name: coltonfischer/peoplesoft-mods


text:
# Cordova - Angular - Foundation starter project

This is a starter project for Cordova mobile apps utilizing Angular and Zurb Foundation

### Version
1.0.0

### Technologies used

* AngularJS
* Zurb Foundation Framework
* Bower
* Grunt
* node.js

### Installation

Clone this repo.

```sh
$ git clone https://github.com/gholme4/cordova_angular_foundation_starter.git
$ cd PATH_TO_REPO
```

Install dependencies:
```sh
$ npm install
$ bower install
```
Build JS and CSS:
```sh
$ grunt
```
Start Node server to test in browser:
```sh
$ grunt server
```
### Development

All development files are located in /client

License
----

MIT


text:
# GraphiQL Monorepo

_/ˈɡrafək(ə)l/_ A graphical interactive in-browser GraphQL IDE. [Try the live demo](http://graphql.org/swapi-graphql).

[![Build Status](https://travis-ci.org/graphql/graphiql.svg?branch=master)](https://travis-ci.org/graphql/graphiql)
[![CDNJS](https://img.shields.io/cdnjs/v/graphiql.svg)](https://cdnjs.com/libraries/graphiql)
[![npm](https://img.shields.io/npm/v/graphiql.svg)](https://www.npmjs.com/package/graphiql)

[![](packages/graphiql/resources/graphiql.png)](http://graphql.org/swapi-graphql)

## Intro

GraphiQL is the reference implementation of GraphQL IDE, an official project under the GraphQL Foundation.

This repository contains much of the code that powers GraphiQL, split into modules that can be used to build custom/alternative editors. The code uses the permissive MIT license.

The main components in this monorepo are:

- __[GraphiQL](packages/graphiql#readme)__ - the GraphiQL IDE, implemented in React, currently using [GraphQL mode for CodeMirror](packages/codemirror-graphql#readme) & [GraphQL Language Service](packages/graphql-language-service#readme).
- __[GraphQL mode for CodeMirror](packages/codemirror-graphql#readme)__ - provides CodeMirror with a parser mode for GraphQL along with a live linter and typeahead hinter powered by your GraphQL Schema
- __[GraphQL Language Service](packages/graphql-language-service#readme)__ - provides an interface for building GraphQL language services for IDEs.

Additionally, these components are dependents of the above packages, and are themselves used throughout the GraphQL Ecosystem:
- __[GraphQL Language Service Server](packages/graphql-language-service-server#readme)__ - server process backing the [GraphQL Language Service](packages/graphql-language-service#readme).
- __[GraphQL Language Service Interface](packages/graphql-language-service-interface#readme)__ - interface to the [GraphQL Language Service](packages/graphql-language-service#readme)
- __[GraphQL Language Service Parser](packages/graphql-language-service-parser#readme)__ - an online immutable parser for [GraphQL](http://graphql.org/), designed to be used as part of syntax-highlighting and code intelligence tools such as for the [GraphQL Language Service](packages/graphql-language-service#readme) and [codemirror-graphql](packages/codemirror-graphql#readme).
- __[GraphQL Language Service Types](packages/graphql-language-service-types#readme)__ - [Flow](https://flowtype.org/) type definitions for the [GraphQL Language Service](packages/graphql-language-service#readme).
- __[GraphQL Language Service Utilities](packages/graphql-language-service-utils#readme)__ - utilities to support the [GraphQL Language Service](packages/graphql-language-service#readme).

## Contributing

This is an open source project, and we welcome contributions. Please see
[CONTRIBUTING.md](CONTRIBUTING.md) for details on how to contribute.

repository: AlecAivazis/graphiql

repo_name: AlecAivazis/graphiql


text:
# Natural Language Libs

This repository provides some libraries for parsing natural language documents and queries.

* `nlsd`: Parse structured English into a Machine format
* `nloq`: Parse English as a list of object queries
* `object-query`: An abstraction of a query on an object
* `nl-parser`: Parse strings, numbers and tokens from English

repository: RiddleAndCode/nlsd

repo_name: RiddleAndCode/nlsd


text:
[![Netlify Status](https://api.netlify.com/api/v1/badges/25a99fc3-8423-499d-a300-c0a2c7be8efa/deploy-status)](https://app.netlify.com/sites/hedera-fee-tool-master/deploys)
[![GitHub](https://img.shields.io/github/license/hashgraph/hedera-fee-tool-js)](LICENSE)
[![Discord](https://img.shields.io/badge/discord-join%20chat-blue.svg)](https://hedera.com/discord)
# Hedera Fee Tool

Tool to calculate price of transactions on Hedera network. A version of this tool is live at
[hedera.com/fees](https://www.hedera.com/fees#estimator).

### Getting started

Set up your .env file with the following schema.

```
REACT_APP_PRICING_API_ENDPOINT=your-pricing-api-url # Empty will default hbar price to ~$0.12
REACT_APP_SHOW_FEE_SCHEDULE=true # Default is false
```

Install dependencies.

```
npm install
```

Run the tool locally

```
npm start
```

### Contributors

We would love your help to improve this tool.

Feel free to file an [issue](/issues) or submit a [pull request](/pulls).

repository: apeksharma/hedera-fee-tool-js

repo_name: apeksharma/hedera-fee-tool-js


text:
## what
...is taking up my bandwidth?!

![demo](demo.gif)

This is a CLI utility for displaying current network utilization by process, connection and remote IP/hostname

This is my first attempt at Rust. :)

### How does it work?
`what` sniffs a given network interface and records IP packet size, cross referencing it with the `/proc` filesystem. It is responsive to the terminal window size, displaying less info if there is no room for it. It will also attempt to resolve ips to their host name in the background using reverse DNS on a best effort basis.

### Installation
At the moment, `what` is available through Cargo as a binary crate.

```
cargo install what
```

Important note: There is only support for linux at the moment, mostly because I don't have access to anything else. I'd very much welcome contributions, and would be happy to provide guidance. Open up an issue/pr if interested.

### Usage
`what -i <interface-name>` eg. `what -i eth0`

Note that since `what` sniffs network packets, it requires root privileges - so you might want to use it with (for example) `sudo`.

### Contributing
Contributions of any kind are very welcome. If you'd like a new feature (or found a bug), please open an issue or a PR.

### License
MIT

repository: wezm/what

repo_name: wezm/what


text:
---
title: 'Javascript ******'
cover: /upload/windy-road.jpg
description: A ****** collection of resources for learning Javascript
date: 2019-01-08T06:00:00.000Z
route: /javascript/guide
slug: javascript_guide
category: javacript
tags:
  - guide
  - '******'
---

## Learn in a Sandbox

### [CodeSandbox](https://codesandbox.io/)

## Learn Javascript

### [You Don't Know JS (book series)](https://github.com/getify/You-Dont-Know-JS/blob/master/README.md)

1. [Up and Going](https://github.com/getify/You-Dont-Know-JS/blob/master/up%20&%20going/README.md#you-dont-know-js-up--going)
2. [Scope and Closures](https://github.com/getify/You-Dont-Know-JS/blob/master/scope%20&%20closures/README.md#you-dont-know-js-scope--closures)
3. [_this_ & Object Prototypes](https://github.com/getify/You-Dont-Know-JS/blob/master/this%20&%20object%20prototypes/README.md#you-dont-know-js-this--object-prototypes)
4. [ES6 & Beyond](https://github.com/getify/You-Dont-Know-JS/tree/master/es6%20%26%20beyond)
5. [Benchmarking & Tuning](https://github.com/getify/You-Dont-Know-JS/blob/master/async%20%26%20performance/ch6.md)
6. [Bulletproof javascript benchmarks](https://calendar.perfplanet.com/2010/bulletproof-javascript-benchmarks/)

### [Javascript Cheatsheet](https://github.com/DrkSephy/es6-cheatsheet)


text:
---
tipindex: "010"
tiptitle: "Transform Global Data using an `eleventyComputed.js` Global Data File"
date: 2020-11-01
tags: ["related-pagination"]
relatedTitle: "Quick Tip #010—Transform Global Data using an `eleventyComputed.js` Global Data File"
---
You can generate multiple data cascade elements in one `eleventyComputed.js` file.  Following is a working example.

This example generates data cascade elements from multiple `.json` files in the global data directory.

Assume you have data files named `links.json` and `copyrights.json`, and you only want to extract a portion of the json object.  In this case, the `entry` element contains the useful data in the json object, and is a child of the `feed` element in this case.

The corresponding `eleventyComputed.js` file contents can look like the following:

{% codetitle "_data/eleventyComputed.js" %}

```js
module.exports = {
  myCopyrights: data => {
    return data.copyrights.feed.entry;
  },
  myLinks: data => {
    return data.links.feed.entry;
  }
};
```


text:
# Hoiio SMS Notification for Jenkins

This is Jenkins plugin that sends SMS notification whenever there's a failed build. The plugin is powered by [Hoiio API][homepage]

Hoiio API is set of telephony API that integrate telephony services - phone calls, conference, IVR (Interactive Voice Responses), Fax and SMS - into your services and website easily.

Read the documentation at http://hoiio.readthedocs.org/

## Installation

You can find the plugin in Jenkins' plugin site. Plugin's name is "sms-notification" (pending approval from Jenkins team)

### Get Hoiio Developer Account

Visit [Hoiio Developer][homepage] site to get a Hoiio Developer account.

### Get AppID and Access Token

Login to Hoiio Developer's portal, create an app. Then, click on "View Keys" to retrieve the appID and accessToken

### Setup

Go to Manage Jenkins -> Configure System, navigate to "Hoiio Credentials" and fill in the appId and accessToken of your Hoiio Developer account

## Usage

To setup SMS notification for a specific Jenkins job, go to Configuration of the job.
Then add a Post-build task named "SMS Notification", fill in the mobile numbers you want to retrieve the SMS with the following format:+6591234567
Multiple numbers are supported by adding a comma "," between the numbers.

## Hoiio API

Visit [our API site][documentation] to learn more about our powerful communication API.

[homepage]:http://developer.hoiio.com/
[documentation]:http://developer.hoiio.com/docs/index.html
[sms_query_status]:http://developer.hoiio.com/docs/sms_status.html


text:
# Install Docker on Mac OS

# Docker install
To run Docker on Mac OS, we will use Docker Desktop for Mac. Follow the link below and complete steps up to the "Uninstall Docker Desktop" section.
* [Docker Desktop installation Mac](https://docs.docker.com/docker-for-mac/install/)

# Verify install
After completing the installation, verify it by opening the Terminal application (located at Applications/Utilities/Terminal.app) and running `docker version`.
The output should be similar to this:
```
❯ docker version
Client: Docker Engine - Community
 Version:           19.03.8
 API version:       1.40
 Go version:        go1.12.17
 Git commit:        afacb8b
 Built:             Wed Mar 11 01:21:11 2020
 OS/Arch:           darwin/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          19.03.8
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.17
  Git commit:       afacb8b
  Built:            Wed Mar 11 01:29:16 2020
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.13
  GitCommit:        7ad184331fa3e55e52b890ea95e65ba581ae3429
 runc:
  Version:          1.0.0-rc10
  GitCommit:        dc9208a3303feef5b3839f4323d9beb36df0a9dd
 docker-init:
  Version:          0.18.0
  GitCommit:        fec3683
~
❯
```

# All done!
Woohoo! You can now use Docker on your machine.

repository: polfliet/demo-deployer

repo_name: polfliet/demo-deployer


text:
# NaoWhistleDetection

This repository contains the whistledetection of the team Bembelbots.
Additionally to the library for whistledetection, a small debugger
is included to test and run it on Wav-files.

The whistledetection requires the libraries Fftw3 and Alsa to run.
Install these dependencies on Debian/Ubuntu with

    $ apt install libfftw3-dev libasound2-dev

Build the whistle-detection:

    $ cmake src
    $ make

Run the whistledebugger (for more documentation, see src/whistledebug.cpp):

    $ ./whistledebug analyze <filename>.wav

For a minimal example on how to use the whistle detection, see src/example.cpp.
To test it, run

    $ ./minimal-example

repository: Bembelbots/NaoWhistleDetection

repo_name: Bembelbots/NaoWhistleDetection


text:
# Point-Transformer-Cls
My own (unofficial) implementation of the Point Transformer Network, currently for classification tasks.

Since the authors did not release the detailed network architectures, I set the feature dimensions of the hidden layer at will and keep the #points as 1024. Hope for more details!

# Acknowledgements
Thank the code-base of Pointnet_Pointnet2_pytorch and Pointnet2_PyTorch.


text:
# GLOBALSACCO - MERN STACKS

>Sacco Members Management System using MERN Stack (NodeJS, ReactJS, ExpressJS and MongoDB).

1. Create and Manage Sacco members Profile
2. Apply for Shares Transfer request
3. Sacco member Loan apply (Release on next update)

More features will me coming in future... keep watch my updates

## Quick Start

```bash
# Install dependencies for server
npm install

# Install dependencies for client
npm run client-install

# Run the client & server with concurrently
npm run dev

# Run the Express server only
npm run server

# Run the React client only
npm run client

# Server runs on http://localhost:5000 and client on http://localhost:3000
```

You will need to create a keys_dev.js in the server config folder with

```
module.exports = {
  mongoURI: 'YOUR_OWN_MONGO_URI',
  secretOrKey: 'YOUR_OWN_SECRET'
};
```

## App Info

Admin Username<EMAIL_ADDRESS>Password : password

If you want to hire me in your MERN Stack Project contact me via<EMAIL_ADDRESS>
### Author

[DickensJuma](https://github.com/DickensJuma)

### Version

1.0.0

### License

This project is licensed under the MIT License

repository: DickensJuma/GlobalSaccco

repo_name: DickensJuma/GlobalSaccco


text:
# Platformer Tile Generator

This program was written by [Edward Peters](https://github.com/E-Peters-2205) to fullfil the first contract of the Tinkeing Graphics assignment from Falmouth University's COMP110 module, titled 'Platform Tile Generator'. The aim of the program was to take tile-sized textures and maniputate the pixel colours in order to generate more textures.

## Instructions

Python version 2.7 was used to write this program. Execute the code written in the file 'Generator.py' in order to use the program, making sure the .jpg files are in the same folder at the time.
Once the program is running use the buttons to cycle through the materials available and the conditions they can have applied to them.

## Licensing Information

The MIT license has been applied due to it's simplicity, which I feel is appropriate for a program of this calibre. It will enable wide use of the code while still recognising the original author. This is because a license notice must be included in any copies of the code, including commecial copies.


text:
---
templateKey: index-page
title: CatharsisFest 2019 - Presented by Torn Out Theater
description: >-
  An immersive carnival of rage, passion, and recovery. In New York City on May
  30, 8-11pm. Buy tickets now!
---
# You did it

You made it through the day. And the week. And the month. You've been through so much. Frustration, worry, anxiety, anger, and tourists blocking the sidewalk. And you've kept it all in! Holding in those feelings, trying to keep it together.

Well it's time to stop keeping it together.

## **It's time to let it all out.**

# **WELCOME TO CATHARSISFEST.**

You have arrived at a carnival of rage, passion, and recovery. Here, you'll find everything you need to achieve that beautiful bliss, that delicious release, that near-religious experience of CATHARSIS. Ask yourself: what do you need tonight to feel good? to feel at peace? to release? Do you need to hurl some sharp objects at a face that drives you insane? Head over to target practice and pick your victim. Do you need to get something deep and dark off your chest?  Do you need to feel beautiful? A skilled face and body painter is waiting for you, rainbow palette at the ready.

  You'll dance, you'll drink, you'll party. This phone in your hand can show you what awaits you. Just click **FEATURING** above to see what's coming next, or **BROUGHT TO YOU BY** to learn more about your friendly neighborhood catharsis experts.

You've earned this. You deserve this. Let it all out.

**From Us to You,**\
**Torn Out Theater**

repository: zacksheppardllc/tot-catharsis-program

repo_name: zacksheppardllc/tot-catharsis-program


text:
---
title: "Gunicorn Design"
draft: false
weight: 17
katex: true
---

### Describing the Server Model
- Gunicorn is based on the pre-fork worker model
- This means that there is a central master process
- This master process manages a set of worker processes
- The master never knows anything about individual clients
- All requests and responses are handled completely by worker processes

### Details about Pre-Fork Models
- Pre-forking refers to a master creating a fork
- This fork handles each request
- A fork refers to a completely separate process
- *Pre* refers to the processes before a request comes in
- This model differs from a threading model
- In a threading model, the master creates light-weight threads to dispatch requests
- However, this master process can have repercussions if a thread causes an error in a threading model

### Describing the Master Process
- The master process is a simple loop
- This loop listens for various process signals and reacts accordingly
- It manages the list of running workers by listening for signals
- These include `TTIN`, `TTOU`, and `CHLD`
- `TTIN` and `TTOU` inform the  master to increase or decrease the number of running workers
- `CHLD` indicates that a child process has terminated

### Describing `Sync` Workers
- A Gunicorn worker is a process
- The most basic and default worker is synchronous
- Synchronous workers handle a single request at a time
- This approach is the simplest for error handling
- This is because an error will affect a single request at most
- `sync` workers do not support persistent connections
- Each connection is closed after response has been sent

### Describing `Async` Workers
- The asynchronous workers available are based on `Greenlets`
	- Via `Eventlet` and `Gevent`
- `Greenlets` are an implementation of cooperative multi-threading for Python
- Asynchronous workers can handle hundreds of requests without blocking
- This is why they're used to ease DOS attacks

### Choosing a Worker Type
- The default synchronous workers assume that your application is resource-bound in terms:
	- CPU
	- Network bandwidth
- Meaning, our applications shouldn't do anything that takes an undefined amount of time
- A server request is an example of this
- If traffic becomes heavy, then `async` workers should be used
- This resource bound assumption is why we require a buffering proxy in front of a default configuration Gunicorn
- If `sync` workers are used, a DOS attack becomes trivial
- This is because it creates a load that trickles data to the servers
- The following are examples of behavior requiring `async` workers:
	- Applications making long blocking calls
	- Serving requests directly to the internet
	- Streaming requests and responses
	- Long polling
	- Web sockets

### How Many Workers?
- The number of workers should **not** equal the number of expected clients
- Gunicorn should only need $4-12$ worker processes
- This will handle hundreds or thousands of requests per second
- Too many workers will compromise system resources
- Gunicorn relies on the operating system for load balancing when handling requests

### Defining the Number of Workers
- The number of workers should equal:

$$
\text{numbers of threads} \times \text{number of workers} + 1
$$

$$
= (2 \times numcores) + 1
$$

- The intuition behind this formula is the following:
	- `+1:` One worker should be reserved for scheduling
	- `2n:` While one thread is doing I/O and waiting, and another thread is used for CPU
- As an illustration, we can set the number of workers to be $2$:

```bash
$ gunicorn --workers=2 'test:create_app()'
```

- This is a trade-off between the following:
	- The overhead of the GIL (threads)
	- The memory overhead of starting new processes (workers)
- Meaning, we need to adjust the two: threads and workers

### How Many Threads?
- Using threads assumes use of the `gthread` worker
- Using threads instead of processes can reduce the memory footprint of Gunicorn
- Threads in Gunicorn are always real
- The GIL locks the interpreter while interpreting a CPython thread
- Consequently, CPython threads can't work simultaneously
- Therefore, the CPython threads executed in Gunicorn will suffer from this same problem
- However, this doesn't mean threading in general is useless
- Specifically, multiple threads can be used without locking
- In particular, multiple threads can be processed concurrently
- This is true for threads that don't require interpretation:
	- Threads that are I/O bound
	- Threads that use C extensions for interpretation

### References
- [Gunicorn Documentation](https://docs.gunicorn.org/en/stable/design.html)
- [Configuring the Number of Workers](https://github.com/benoitc/gunicorn/issues/1045#issuecomment-269575459)
- [Defining a Pre-Fork Web Server Model](https://stackoverflow.com/a/25894770/12777044)
- [Details about Gunicorn Threads](https://stackoverflow.com/a/48572328/12777044)
- [Details about Gunicorn Workers and Threads](https://stackoverflow.com/a/41696500/12777044)
- [Threading in Flask's Development-Only WSGI Server](https://stackoverflow.com/a/38876915/12777044)
- [Optimizing Gunicorn Configurations](https://medium.com/building-the-system/gunicorn-3-means-of-concurrency-efbb547674b7)


text:
# Analysis

## Spelling

The `hunspell` package is used by many popular text software to provide spell checking in many languages. This R package was used to spell check, and the vignette tutorial can be found at: https://cran.r-project.org/web/packages/hunspell/vignettes/intro.html

## Lemmatization

korpus and treetagger notes here

http://www.cis.uni-muenchen.de/~schmid/tools/TreeTagger/

repository: SimonDeDeyne/FLT-Primer

repo_name: SimonDeDeyne/FLT-Primer


text:
# Gaussian Belief Propagation Noisy Linear Systems Solver

The solver provides the solution of the linear system of equations with Gaussian noise using belief propagation (BP) algorithm applied over the factor graph.

## The System Model
We observe a noisy linear system of equations with real coefficients and variables:

![equation](https://latex.codecogs.com/gif.latex?%5Ctextbf%7Bb%7D%20%3D%20%5Ctextbf%7Bf%7D%28%5Ctextbf%7Bx%7D%29%20+%20%5Ctextbf%7Bu%7D)

where **x** is the vector of the state variables (i.e., unknowns), **f**(**x**) is the vector of linear functions, **b** is the vector of observation values and **u** is the vector of uncorrelated observation errors. Note that the linear system of equations represents an overdetermined system.

The solution can be obtained by solving linear weighted least-squares (WLS) problem:

![wls](https://latex.codecogs.com/gif.latex?%28%5Ctextbf%7BA%7D%5ET%5Ctextbf%7BW%7D%5Ctextbf%7BA%7D%29%5Ctextbf%7Bx%7D%3D%5Ctextbf%7BA%7D%5ET%5Ctextbf%7BW%7D%5Ctextbf%7Bb%7D)

where **A** is the Jacobian matrix of linear functions or the coefficient  matrix for our system, and **W** is a diagonal matrix containing inverses of observation variances.

Further, the solution to the problem can be found via maximization of the likelihood function which is defined via likelihoods of independent observations, and that can be efficiently solved utilizing factor graphs and the Gaussian belief propagation (BP) algorithm.

## Input Data
data.mat file with variables:
- `data.A` - coefficient matrix m x n (m>n);
- `data.b` - observation values column vector dimension of m x 1;
- `data.v` - observation variances column vector dimension of m x 1;

 ## User Options
1. Post-Processing Options:
   - `user.save` - write data to a text file;
   - `user.radius` - compute spectral radius for synchronous and randomized damping scheduling, if spectral radius is less than 1 the BP algorithm converges;
   - `user.error`  - compute mean absolute error, root mean square error and weighted residual sum of squares for solution;

2. Design of Iteration Scheme:
   - `user.stop` - the BP algorithm in the iteration loop is running until the criterion is reached, where the criterion is applied on the vector of mean-value messages from factor nodes to variable nodes in two consecutive iterations;
   - `user.maxi` - the upper limit on BP iterations;

3. Convergence Parameters:
   - `user.prob` - a Bernoulli random variable with probability "prob" independently sampled for each mean value message from indirect factor node to a variable node, with values between 0 and 1;
   - `user.alph` - the damped message is evaluated as a linear combination of the message from the previous and the current iteration,
               with weights "alph" and 1 - "alph", where "alph" is between 0 and 1;

Note: We use an improved BP algorithm that applies synchronous scheduling  with randomized damping. The randomized damping parameter pairs lead to a trade-off between the number of non-converging simulations and the rate of convergence. In general, for the selection of "prob" and "alph" for which only a small fraction of messages are combined with their values in a previous iteration, and that is a case for "prob" close to 0 or "alph" close to 1, we observe a large number of non-converging simulations.

4. Virtual Factor Nodes
   - `user.mean` - the mean value of virtual factor nodes;
   - `user.vari` - the variance value of the virtual factor nodes;

Note: The virtual factor node is a singly-connected factor node used if the variable node x is not directly observed. In a usual scenario,  without prior knowledge, the variance of virtual factor nodes tend to infinity.

## More information:
- M. Cosovic and D. Vukobratovic, "Distributed Gauss-Newton Method for State Estimation Using Belief Propagation," in IEEE Transactions on  Power Systems, vol. 34, no. 1, pp. 648-658, Jan. 2019. [arxiv.org](https://arxiv.org/pdf/1702.05781.pdf)
- M. Cosovic, "Design and Analysis of Distributed State Estimation Algorithms Based on Belief Propagation and Applications in Smart Grids." arXiv preprint arXiv:1811.08355 (2018). [arxiv.org](https://arxiv.org/pdf/1811.08355.pdf)


text:
---
layout: default
title: Standalone Elasticsearch Plugin Install
parent: Install and Configure
nav_order: 90
---

# Standalone Elasticsearch plugin install

If you don't want to use the all-in-one Open Distro for Elasticsearch installation options, you can install the Security, Alerting, and SQL plugins on a compatible Elasticsearch cluster just like any other Elasticsearch plugin.

In addition to their Elasticsearch plugins, Security and Alerting have corresponding [Kibana plugins](../../kibana/plugins) that you probably want to install, as well.
{: .tip }

Navigate to the Elasticsearch home directory (likely `/usr/share/elasticsearch`) and run the install command for each plugin.

#### Security

```bash
sudo bin/elasticsearch-plugin install https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-security/opendistro_security-<IP_ADDRESS>.zip
```

After installing the Security plugin, you can run `sudo sh /usr/share/elasticsearch/plugins/opendistro_security/tools/install_demo_configuration.sh` to quickly get started with demo certificates. Otherwise, you must configure it manually.

#### Alerting

```bash
sudo bin/elasticsearch-plugin install https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-alerting/opendistro_alerting-<IP_ADDRESS>.zip
```

#### SQL

```bash
sudo bin/elasticsearch-plugin install https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/opendistro-sql/opendistro_sql-<IP_ADDRESS>.zip
```

{% comment %}
#### Performance Analyzer

```bash
sudo bin/elasticsearch-plugin install https://d3g5vo6xdbdb9a.cloudfront.net/downloads/elasticsearch-plugins/performance-analyzer/opendistro_performance_analyzer-<IP_ADDRESS>.zip
```

Performance Analyzer requires so many additional configuration steps that we don't recommend installing it as a standalone plugin. After installing the plugin:

1. Create `/usr/lib/systemd/system/opendistro-performance-analyzer.service` based on [this file](https://github.com/opendistro-for-elasticsearch/performance-analyzer/blob/master/packaging/opendistro-performance-analyzer.service).
1. Create `/usr/share/elasticsearch/bin/performance-analyzer-agent-cli` based on [this file](https://github.com/opendistro-for-elasticsearch/performance-analyzer/blob/master/packaging/performance-analyzer-agent-cli).
1. Run the `postinit` script for [RPM-based](https://github.com/opendistro-for-elasticsearch/performance-analyzer/tree/master/packaging/rpm) or [Debian-based](https://github.com/opendistro-for-elasticsearch/performance-analyzer/tree/master/packaging/deb) distributions.
1. `sudo systemctl start elasticsearch.service`
1. `curl -XGET "localhost:9600/_opendistro/_performanceanalyzer/metrics?metrics=Latency,CPU_Utilization&agg=avg,max&dim=ShardID&nodes=all"`
{% endcomment %}

## Compatibility

See [Version history](../../../#version-history) for the versions of Elasticsearch that Open Distro for Elasticsearch supports. You must have the exact compatible OSS version installed (e.g. 6.6.2 and not 6.6.1). To get a list of available Elasticsearch versions on CentOS 7 and Amazon Linux 2:

```bash
sudo yum list elasticsearch-oss --showduplicates
```

Then you can specify the version you need:

```bash
sudo yum install elasticsearch-oss-6.7.1
```

## List installed plugins

To check your installed plugins:

```bash
sudo bin/elasticsearch-plugin list
```

## Remove plugins

```bash
sudo bin/elasticsearch-plugin remove <plugin-name>
```

Then restart Elasticsearch on the node.

## Update plugins

Elasticsearch doesn't update plugins. Instead, you have to remove and reinstall them:

```bash
sudo bin/elasticsearch-plugin remove <plugin-name>
sudo bin/elasticsearch-plugin install <plugin-name>
```


text:
OpenChat contains a few built-in smart contracts that you can utilize in your sidechain.

# Coin

Coin implements an ERC20 style coin that can be used as a currency.

# Delegated Proof of Stake

The Delegated Proof of Stake (DPOS) smart contract implements validator elections.
See [delegated-proof-of-stake](delegated-proof-of-stake.html).

filename: Go Smart Contracts.md


text:
# Specs #

The files in these folders use examples to document Rewrap's capabilities and specify expected results.

The examples also serve as tests.

#### Wrapping column ####

The wrapping column in each sample is represented by `¦` characters. This must appear on at
least one line but doesn't need to be on all lines. The column should appear on both input and output sections for clarity.

#### Selections ####

Most samples are treated as if they're wholly selected, though where selections
are explicitly needed, they're marked with `«»` characters, with `«` as
the
anchor point and `»` as the active point. These are removed from the input.

#### Whitespace ####

Tabs are represented by `-→`. Where explicitly needed, spaces are represented by
a `·` (U+00B7). All lines are assumed to have no trailing whitespace unless
these characters are used.

#### Settings ####

Settings for a test are given in a blockquote, on one line, separated by commas
and colons. They apply to all subsequent tests until a new settings block is
given. Eg:

> tabSize: 2, doubleSentenceSpacing: true

When absent, the default values are used:
- tabSize: 4
- doubleSentenceSpacing: false
- language: "plaintext"
- wrapWholeComment: true
- reformat: false

A new settings block completely replaces the previous one; any absent values are
reset back to defaults.

repository: xoob/Rewrap

repo_name: xoob/Rewrap


text:
## Pushover Notification

Send notification to your smartphone with Pushover!

![Details](images/readme-details.png)

## Usage
Add a new task, select **Pushover Notification** from the **Utility** category and configure it as needed.

Parameters include:

- **Token**: Your pushover application API token
- **User/Group Key**: The user/group key (not e-mail address) of your user (or you), viewable when logged into our dashboard (often referred to as USER_KEY in our documentation and code examples)
- **Title**: Your message's title
- **Message**: Your message content
- **Priority**: Choice `No Notification (-2)` to generate no notification/alert, `Quiet Notification (-1)` to always send as a quiet notification, `High Priority (1)` to display as high-priority and bypass the user's quiet hours, or `Requires Confirmation (2)` to also require confirmation from the user
- **Expire**: The `expire` parameter specifies how many seconds your notification will continue to be retried for (every `retry` seconds). If the notification has not been acknowledged in `expire` seconds, it will be marked as expired and will stop being sent to the user. Note that the notification is still shown to the user after it is expired, but it will not prompt the user for acknowledgement. This parameter must have a maximum value of at most `10800` seconds (3 hours)
- **Retry**: The `retry` parameter specifies how often (in seconds) the Pushover servers will send the same notification to the user. In a situation where your user might be in a noisy environment or sleeping, retrying the notification (with sound and vibration) will help get his or her attention. This parameter must have a value of at least `30` seconds between retries.
- **Device**: Your user's device name to send the message directly to that device, rather than all of the user's devices (multiple devices may be separated by a comma)
- **Link URL**: A [supplementary URL](https://pushover.net/api#urls) to show with your message
- **URL Title**: A title for your supplementary URL, otherwise just the URL is shown

## Release notes

**New in 1.0.2**
- First version with basic notification;
- Notification user, group and/or specific device;
- Priority with retry ant expire options;
- Additional url for details;

## Did you like it? Please, make a donate :)

if you liked this project, please make a contribution and help to keep this and other initiatives, send me some Satochis.

BTC Wallet: `1G535x1rYdMo9CNdTGK3eG6XJddBHdaqfX`

![1G535x1rYdMo9CNdTGK3eG6XJddBHdaqfX](https://i.imgur.com/mN7ueoE.png)

repository: ThiagoBarradas/pushover-vss-ext

repo_name: ThiagoBarradas/pushover-vss-ext


text:
# Keyboard Shortcuts and Usage

Koel takes a lot of its inspiration from Spotify, and yes, it's a shameless rip-off. Of course it wouldn't be a proper rip-off unless we had some keyboard shortcuts.

Function | Key
-------- | ---
Play/pause | Space
Next track | J
Previous track | K
Play _single_ highlighted | Enter
Add _multiple_ to bottom of queue | Enter
Add to _top_ and play immediately | Shift+Enter

You can also use the browser's **back** and **next** buttons to **navigate through the app**!

repository: BernardGoldberger/wiki

repo_name: BernardGoldberger/wiki


text:
## UI Tests

### What are User Interface tests?

UI tests render pages in different environments and verifies that they have not significantly changed.

### How do they work?

We use [BrowserStack](https://www.browserstack.com/) and [Compatriot](https://github.com/carols10cents/compatriot) for performing our UI Tests.

BrowserStack is used as our environment host and Compatriot is used for taking and comparing screentshots.

The entire suite of UI tests are triggered by running `rake ui_tests`.  This will run all our UI tests for each environment defined in [browsers.json](https://github.com/thinkthroughmath/apangea/blob/jk/compatriot/test/browsers.json).  We will pass the browser options off to browserstack and they will setup and link us to an environment to run tests against.  We configure selenium to handle driving that browserstack environment. so then we can write tests just like unit and integration tests.  The one thing that is different is that we have added a new assertion, `assert_no_ui_changes`.  We use this new assertion to compare the current page in the test, to a screenshot of the same page that we call a 'control image'.  As a result, we will get a percentage changed, and we compare that to a defined threshold to decide if it passes or fails tests.

All images are stored in `test/screenshots/<environments>/`.  We check the 'control' directory into source control as our base images to compare to.

After the tests run, we can see a `diffs` and `variable` directory.  Diffs are the result of comparing our control image with our variable image.

### How to run UI tests from jenkins

See the [ui_tests job](http://jenkins.thinkthroughmath.com:8080/job/ui_tests/)

### How to run UI tests locally

1. Download and run BrowserStackLocal

        wget https://www.browserstack.com/browserstack-local/BrowserStackLocal-darwin-x64.zip
        unzip BrowserStackLocal-darwin-x64.zip
        ./BrowserStackLocal -localIdentifier "${HOSTNAME}" -skipCheck \<token\> <IP_ADDRESS>,4000

2. Set a local environment variable `BROWSER_STACK_AUTH`. If you have a browserstack account, you can get it from the Automate section on https://www.browserstack.com/accounts/settings. This variable value should be formatted as username:token. Setting it would look like:

        export BROWSER_STACK_AUTH=jeffkoenig:abc12357401dnfsdd1.

3. run the rake task

        rake ui_tests

### Run individual tests locally

1. After going through steps 1-3 above
2. You can use `m` to run an individual test locally. It will only run it for the default environment defined in [test/ui_test.rb](https://github.com/thinkthroughmath/apangea/blob/rc/test/ui_test.rb)

  - You can override the default environment used, by setting the following environment variables in your shell, like so..

                export BS_AUTOMATE_OS='Windows'
                export BS_AUTOMATE_OS_VERSION='7'
                export SELENIUM_BROWSER='ie'
                export SELENIUM_BROWSER_VERSION='10'

  - Or you can modify [browsers.json](https://github.com/thinkthroughmath/apangea/blob/jk/compatriot/test/browsers.json), and use `rake ui_tests`

### Bypassing BrowserStack locally

* If you're creating or debugging a test and want the test to run a little quicker, you can eliminate browserstack from the equation by changing the driver in [test/ui_test.rb](https://github.com/thinkthroughmath/apangea/blob/rc/test/ui_test.rb)

                Capybara.default_driver = :webkit

  When changing the driver, it is no longer necessary to start BrowserStackLocal.

### Adding new Tests

1. Write your new tests in `test/ui/<yourtest>.rb`
2. Generate base line screenshots for your new tests

   1. Start BrowserStackLocal using the steps listed above
   2. Then, to run your test against each environment, run

            rake ui_tests TEST=test/ui/<yourtest>.rb

   3. Commit the newly added screentshots

repository: ex-ttmers/meta

repo_name: ex-ttmers/meta


text:
---
dataKey: teamInfo
contentLang: en

team:
  - nick: radvam
    name: Dmitry Radkovets
    linkToGitHub: https://github.com/radvam
    srcImg: "./radkovets.png"
    worklog:
      - spentTime: 8
        feature: "Layout implementation of components"
      - spentTime: 5
        feature: "Collecting information about authors"
      - spentTime: 4
        feature: "Create md-files about authors"
      - spentTime: 9
        feature: "Creating team page components"
      - spentTime: 11
        feature: "Creating work log page components"
      - spentTime: 3
        feature: "Code review"
  - nick: HyBeard
    name: Ilya Kaptsevich
    linkToGitHub: https://github.com/HyBeard
    srcImg: "./kaptsevich.png"
    worklog:
      - spentTime: 5
        feature: "Project structure creation"
      - spentTime: 10
        feature: "Installation and adjustment GatsbyJS"
      - spentTime: 8
        feature: "Static page autogeneration"
      - spentTime: 11
        feature: "Translation implementation"
      - spentTime: 7
        feature: "Home page component creation - author of the day"
      - spentTime: 3
        feature: "Code review"
  - nick: nextdesusu
    name: Ilya Bakanov
    linkToGitHub: https://github.com/nextdesusu
    srcImg: "./bakanov.png"
    worklog:
      - spentTime: 5
        feature: "Layout implementation of components"
      - spentTime: 10
        feature: "Implementation of components - header and footer"
      - spentTime: 9
        feature: "Creating search page components"
      - spentTime: 12
        feature: "Creating author's page components"
      - spentTime: 4
        feature: "Deployment of the project"
      - spentTime: 3
        feature: "Code review"
mainDifficulties:
  - "Branch merge conflicts."
  - "Study, install and configure GatsbyJS, CMS."
  - "Delegation of authority"
---

## Evaluation

---

### Min scope - **50**

- [x] **10** Main page + page with a list of authors + author's page (only pages with content without widgets);
- [x] **10** Page with team members + page with worklog
- [x] **10** Page with list of authors contains search widget;
- [x] **20** Portal has two languages;

### Normal scope - **140**

- [x] **20** Portal has page with styleguide;
- [x] **10** Mobile version is okey
- [x] **10** Ipad/tablet version is okey
- [x] **10** Author's page contains timeline;
- [x] **10** Author's page contains video overlay;
- [x] **20** Author's page contains photo gallery;
- [x] **10** Author's page contains map (geowidget);
- [x] **from 0 to 20** Design (typography, icons, colors, links + buttons + input are styled)
- [x] **20** Material-ui / bootstrap is used
- [x] **10** Portal has third language;

### Extra scope - **90**

- [x] **10** Confidence of the project presentation;
- [x] **10** Project is made using gatsbyjs;
- [ ] **10** Contentful / netlify cms is used for content management
- [ ] **20** Animations / special effects like paralax
- [x] **up to 20** Outstanding design;
- [ ] **20** Storybook/styleguidist/other react styleguide tool usage for the page with styles

### Fines

- **-50** if there are less than 5 commits from each active team member. Everyone should merge their own PRs.
- up to **-50** points for violations
  [stage2-tasks-requirements](https://github.com/rolling-scopes-school/docs/blob/master/docs/stage2.md)
- **-40** if there is no worklog for team
- **-20** too primitive (ugly for 2020) design / UX

---

### Total score: 230

repository: HyBeard/culture-portal

repo_name: HyBeard/culture-portal


text:
CD Organizer
Version 1.0
Authors: Diego Avalon & Justin Pacubas
Description: A CD Organizer app written in Ruby.  A user can add a CD with artist and album
 name, list the CDs they've added, and search for an artist or album name.
Requirements: Ruby, Text Editor
License: MIT


text:
# 0.3.0

* Add a rails generator for creating a new static data model.
* Update docs to demonstrate `update` rake task and new generator.

# 0.2.0

* Add support for incrementally updating tables rather than merely deleting all
data and rewriting. This should play nicer with foreign key constraints on
static data tables, which, after all, is one of the main reasons to use a static
data table in the first place. Use the new rake task `static-data:update`.

# 0.1.1

* Add rdocs for StaticData::Base
* Update homepage to github location in gemspec

repository: kindjar/static-data

repo_name: kindjar/static-data


text:
# Codename One Implementation

Visit the [Codename One article](https://www.codenameone.com/blog/property-cross-revisited.html) on the property cross demo and the [demo page in the website](https://www.codenameone.com/demos-PropertyCross.html) to learn more.

## Introduction

<img align="right" width="400px" src="https://www.codenameone.com/img/property-cross.png" alt="Property Cross">

[Codename One](https://www.codenameone.com) is an open source framework that lets Java developers build native apps for mobile devices. It's chief goal is to bring Java style WORA (Write Once Run Anywhere) into mobile development by leveraging a "Swing like" architecture.

[Codename One](https://www.codenameone.com) has ports for iOS, Android, Windows Phone (defunct), Universal Windows Platform (UWP - Windows 10/Mobile), JavaScript (with threads), Desktop (Mac/Windows) & RIM. It uses a cloud build system to convert the Java bytecode to native code and thus removes the need for a Mac machine or a Windows Machine (for UWP/Windows Phone) notice that [offline build](https://www.codenameone.com/blog/offline-build.html) is also supported.

You can read more about Codename One and its architecture in its [developer guide](https://www.codenameone.com/manual/).

## Building The application

You first need to install Codename One which is available for all 3 top Java IDE's (NetBeans, Eclipse & IntelliJ/IDEA). You can read the instructions [here](https://www.codenameone.com/download.html).

### The Really Easy Way

You can create a local version of this demo by using the new project wizard in the IDE and selecting:

`Codename One -> Demos -> Property Cross`.

### Building From Scratch

The project included is for NetBeans so you will need to install Codename One on top of NetBeans. You can open the project and update the missing jar resources from a newly created project.

## Application Structure

The application is a simple yet typical Codename One/NetBeans application, it has the following directories/files of interest:

- `build.xml` - ant build file used for the build scripts launched from the IDE.

- `src` - the full source of the application and its required resources.

- `src/theme.res` - theme and resource file containing a portable represntation of data.

- `icon.png` - a 512x512 icon that is automatically adapted to all device resolutions.

- `native` - this is unused for this demo as Property Cross doesn't require any native functionality. However, it can contain device specific native OS code if required.

- `lib` - contains basic libraries required as well as plugins/extensions. This demo doesn't need any libraries or extensions at this point so the lib directory has the default value.

## Further Reading

- [Codename One Developer Guide](https://www.codenameone.com/manual/)

- [JavaDocs](https://www.codenameone.com/javadoc/) - reference guide to Codename One methods/classes

- [Learn Mobile Programing by Examplw with Codename One](https://www.udemy.com/learn-mobile-programming-by-example-with-codename-one/) - a free Udemy course that covers an older version of this demo.

repository: Efigit/PropertyCross

repo_name: Efigit/PropertyCross


text:
![POLITICO](https://rawgithub.com/The-Politico/src/master/images/logo/badge.png)

# django-foreignform

[![PyPI version](https://badge.fury.io/py/django-foreignform.svg)](https://badge.fury.io/py/django-foreignform)

Dynamic fieldsets for your Django ModelAdmin using JSON schema and react-jsonschema-form.

Define dynamic fieldsets with [react-jsonschema-form](https://github.com/mozilla-services/react-jsonschema-form). Store the schema on a foreign-keyed model. Serialize the fieldsets' back to a native Django JSON field in the admin.

### Why this?

Let's explain by way of an example: At POLITICO, we use Django to model content.

Often we'll define a model that represents an individual _piece_ of content and relate that model via a foreign key to another one representing a _type_ of content. A common problem across those models are _types_ that require a special field to contain information about a _piece_.

Think of a story template. It will have some fields in common with all other types of stories: a title, a byline, etc. So we define a story model that has those fields.

We know we have different types of stories -- feature pieces, breaking news items, whatever -- and so define a story template model to group story instances by a foreign key.

In Django, our models now look like this:

  ```python
  class StoryTemplate(models.Model):
    name = models.CharField()

  class Story(models.Model):
    story_type = models.ForeignKey(StoryTemplate)
    headline = models.CharField()
    # etc.
  ```

But now we realize we need a template for a video story. Can do, but this template needs a new field: a video embed code. No other story type needs this field.

We now consider two options: 1) Add the embed field to our `Story` model, which will be useless for the 90% of our stories that are text-based. 2) Break out a new model, which will foreign key to `Story` and contain video-specific fields we can access via a reverse relationship.

**We don't really like _either_ of those options.**

In our mind, the video embed field belongs to our `StoryTemplate` because it applies to _all video stories_. So why can't we simply add it there? Well, because the _information contained in that field_ belongs to a `Story` instance, each with its own individual embed code.

What we really need is a way to define fields on the `StoryTemplate` model that can be filled out in the `Story` ModelAdmin.

With django-foreignform you can! We can use [JSON Schema](http://json-schema.org/) to define any fields specific to a template on our `StoryTemplate` model and then render those fields dynamically in a ModelAdmin for our `Story` model. As users fill out these dynamic fields, their values are serialized back to a JSON field on the `Story` model.

So instead our models look something like this:

  ```python
  class StoryTemplate(models.Model):
    name = models.CharField()
    json_schema = JSONField()

  class Story(models.Model):
    story_type = models.ForeignKey(StoryTemplate)
    headline = models.CharField()
    form_data = JSONField()
    # etc.
  ```

We can then define our video field via JSON schema on the `StoryTemplate` like this:

  ```json
  {
    "type": "object",
    "properties": {
      "video": {
        "type": "string",
        "title": "Video embed code"
      }
    }
  }
  ```

... which, once it's filled in by a user on a `Story` model, may then serialize to data like this:

  ```json
  {
    "video": "https://www.youtube.com/watch?v=wuK0f-Zur9A"
  }
  ```

##### Upshot

A long way to say django-foreignform lets us write more complex models while keeping the relationships in our database very simple. It helps us avoid extra models to handle edge cases or cluttering up the models we have with rarely used fields.

### Buyer beware

This library is very early days for us. It may not be ready for your own production needs.

Forms it creates definitely **should not** be used by anyone who's not a friend to your organization. While react-jsonschema-form gives us some light data validation options on the form it renders, you're trading against Django's robust model validation. It's also very easy for a bad actor to circumvent the form and insert values into the hidden JSON field.

For all those reasons, this library only renders forms in Django's admin, which should encourage you to only give access to trusted staff.

All that said, you should try it out! Pull requests welcome!

<img width=50 src="docs/images/construction.png" />

### Requirements

- PostgreSQL ≥ 9.4
- Django ≥ 2.0

### Quickstart

1. Install the app.

  ```
  $ pip install django-foreignform
  ```

2. Add the app to your Django project and configure settings.

  ```python
  INSTALLED_APPS = [
      # ...
      'foreignform',
  ]
  ```
3. Define a template model from our base class and an instance foreign-keyed to the first with a dedicated JSON field for your form data.

  ```python

  from django.contrib.postgres.fields import JSONField
  from django.db import models

  from foreignform.models import ForeignFormBaseModel

  class StoryTemplate(ForeignFormBaseModel):
      name = models.CharField(max_length=100)
      # ...

  class Story(models.Model):
      template = models.ForeignKey(StoryTemplate, on_delete=models.PROTECT)
      name = models.CharField(max_length=100)
      form_data = JSONField(blank=True, null=True)
      # ...
  ```
4. Use our mixin to create a ModelAdmin for your foreign-keyed model with properties for the foreign key field and the JSON field for your form data.

  ```python
  from django.contrib import admin
  from foreignform.mixins import ForeignFormAdminMixin
  from .models import StoryTemplate, Story

  class StoryAdmin(ForeignFormAdminMixin, admin.ModelAdmin):
      foreignform_foreign_key = 'template'
      foreignform_field = 'form_data'

  admin.site.register(StoryTemplate)
  admin.site.register(Story, StoryAdmin)
  ```

5. In the admin for a template model, define some fields on your model using [JSONSchema](http://json-schema.org/) syntax and react-jsonschema-form's [UI schema](https://github.com/mozilla-services/react-jsonschema-form#the-uischema-object).

  ![](docs/images/template-add.png)

6. In the admin for an instance, create an instance with a foreign key to the template model. Click `Save and continue editing`.

  ![](docs/images/instance-add.png)

7. With the foreign key saved, you can now fill out fields defined in the template model's JSON schema. Behind the scenes, the formset is being serialized and saved to your instance model's JSON field.

  ![](docs/images/instance-change.png)

8. Use the serialized JSON data from your form in your model's JSON field.

  ```python
  Story.objects.first().form_data
  ```

### Developing

##### Running a development server

Developing python files? Move into example directory and run the development server with pipenv.

  ```
  $ cd example
  $ pipenv run python manage.py runserver
  ```

Developing static assets? Move into the pluggable app's staticapp directory and start the node development server, which will automatically proxy Django's development server.

  ```
  $ cd foreignform/staticapp
  $ gulp
  ```

Want to not worry about it? Use the shortcut make command.

  ```
  $ make dev
  ```

##### Setting up a PostgreSQL database

1. Run the make command to setup a fresh database.

  ```
  $ make database
  ```

2. Add a connection URL to the `.env` file.

  ```
  DATABASE_URL="postgres://localhost:5432/foreignform"
  ```

3. Run migrations from the example app.

  ```
  $ cd example
  $ pipenv run python manage.py migrate
  ```

repository: The-Politico/django-foreignform

gha_language: Python

repo_name: The-Politico/django-foreignform


text:
# Introduction

Api Doc is an OpenSource application developed to help in the documentation of API Rest, the application uses ORM Knex to play with the database. In Api Doc it is possible to generate public, private documentation and even grant access in teams, it is also possible to embed some public documentation in private systems.

## Features
Here are some of the functions that the software has to offer

- [x] Dockerized? Yes!
- [x] Login and Register, Change Password
- [x] Team System
- [x] Api Documentation "private and public"
- [x] Client Electron for Windows, Mac And Linux Dist
- [x] PWA/SPA Works
- [ ] SSR Builder
- [x] Cordova Android
- [ ] Cordova iOS
- [x] Test Request
- [x] Register Responses and Codes Definitions
- [x] Methods Accept: Post, Get, Delete, Put
- [x] Accept: Headers, Params Path and Body
- [x] Accept: Query Params
- [ ] Accept: DataForm, in Dev

## The Database

In development, the database used was postgres, however, knex supports sqlite3 and mysql as well, probably mysql will work well in production, as sqlite3 is not advisable to use it in development or production, as knex's "returning" function doesn't work. it works on it and it is in this project.

## About NPM Libs

Some dependencies I would like to leave the reference and thanks :smiley: :tada:

[Express](https://github.com/expressjs/express),
[Knex](https://github.com/knex/knex),
[Knex](https://github.com/knex/knex),
[Axios](https://github.com/axios/axios),
[Quasar Framework](https://github.com/quasarframework/quasar),
[vue-json-edit](https://github.com/jinkin1995/vue-json-edit),
[vue-json-pretty](https://leezng.github.io/vue-json-pretty),

## License

  [MIT](LICENSE)

repository: joaomede/Api-Doc

gha_language: Vue

repo_name: joaomede/Api-Doc


text:
---
title: "Configuring the Cabins"
weight: 8
---

# Configuring the Cabins

Before you can hit the skies, you need to equip your aircraft with a cabin and configure its seat layout - regardless of whether you own new or used machines. Let's see how it's done!

{{< hint info >}}
**Info**
This step does not apply if you want to operate cargo aircraft. Though it's not the best, there is a default configuration already installed in all of your new aircraft.
{{< /hint >}}

## Using the Cabin Editor

Go to the Commercial tab and select Cabin Configurations. This page shows all of your existing setups. In order to create a new one, pick a name, choose which aircraft type it should apply to and click on Create New Configuration.

![Adjusting the Cabin](cabin_04.png "Adjusting the Cabin")

The cabin editor shows information regarding the plane type, its passenger capacity and the configuration status. Next to that, you'll find the Save Configuration button. Never forget to save your configuration or you will have to start all over again!

On the left side of the editor, you'll see the empty deck of your plane. First off, select a class (Economy, Business or First) and add it by clicking on Choose One. You can equip your aircraft with any class you prefer, but keep in mind that a three-class setup is usually applied to large aircraft. If an aircraft has two decks, you can configure both decks separately (main deck and upper deck).

Once the classes are set up, you can equip each one with seats and deploy additional flight attendants:

* **Seat types**: By clicking on Select next to Seat, you can decide which type of seat you want to put in each class. Better seats result in higher ratings, however they're usually pricey and take up more space, decreasing the maximum number of passengers you can transport. It's always a trade-off between quality and efficiency: If you're the only airline on a route, you can aim to offer as many seats as possible; if a route has many competitors, it's preferable to offer more comfortable seats.

* **Number of seats**: You can select the number of seats under Seats/Cabin. If you choose 0, the class won't be used in the cabin configuration. If you already added seats to other classes, you can use the Top Up button to fill up the remaining space with seats for the class that you're currently editing.

* **Extra pitch**: If you want to give your passengers more leg room, don’t remove seat rows - just increase the extra pitch value and you're good to go!

* **Additional F / As**: Here, you can add additional flight attendants for each class. You should already have a base number of staff but you can assign more employees to increase ratings. Tip: Aircraft with fewer than 20 seats don't necessarily need a flight attendant. By default, one attendant is responsible for 50 passengers per class. More flight attendants have a positive effect on the evaluation of your flights.

If you’re unsure how your current configuration affects your passengers ratings, just save it and switch to the Ratings tab. And remember: Each aircraft type requires its own cabin layout!

## Tips for Your Configuration

Here's some general advice to help you with the cabin configuration process:

* **One flight attendant per class**: Every class needs at least one flight attendant. Even if you only install two first class seats, you still have to assign a flight attendant to your first class. Keep in mind that your staff works 8 hour shifts, so if you're flying for 20 hours a day, one flight attendant equals multiple employees on your payroll.

* **Additional flight attendants**: The number of additional flight attendants is up to you, but passengers appreciate the attention. A higher rating may be worth the extra salaries.

* **Economy vs. Business**: As the business class usually has bigger seats, better service and less passengers per flight attendant, two economy passengers may be more profitable than one business class customer. Just remember to take the costs into account when setting up your cabin.

* **First Class**: If you find it difficult to fill the first class on some routes, you can try offering it only on long-haul routes of 2,000 km and above or even leaving it out entirely in some planes.

* **Check your configuration**: After creating a cabin, double check it. Once we assign it to the aircraft in the next step, you can't even add a flight attendant without completely refurbishing your plane.

* **Changing cabins**: If you change the cabin configuration of an aircraft, the new setup will be used after 3 days.

## What do passengers expect?

![Aircraft Cabin](cabin_05.jpg "Aircraft Cabin")

It all depends on your route and marketing strategy: If you want to run a low-cost airline, stuff your planes with narrow seats and sell cheaper tickets. If you're establishing more of an average airline, equip your planes with slightly better seats. Most planes have 80% economy and 20% business class seats, but of course you're free to distribute seats as you prefer.

On short-haul routes, passengers should be okay with basic seating. On medium-haul flights, you could equip some classes with more advanced seats. If passengers are scarce and competition is hard, you can try using better seats for economy passengers.

repository: simulogics/airlinesim-docs

gha_language: HTML

repo_name: simulogics/airlinesim-docs


text:
# Mikemike-22.github.io
# {MICHAEL KIPKORIR}
#### {A website that contains information about me}, {08.02.2019}
#### By **{MICHAEL KIPKORIR}**
## Description
{This is a site that gives a little information about my self. I've included my interests and a little background
information about myself like the college i went to and the course that i did.The site is only for information purposes.}
## Setup/Installation Requirements
* A functional web browser.
## Known Bugs
{The footer section is not in the correct place. It will be fixed}
## Technologies Used
{Html and css were used to create the site.}
## Support and contact details
{Reach me on my email address from the site.Your contributions are highly welcomed.}
### License
*{MIT}*
Copyright (c) {2019} **{MICHAEL KIPKORIR}**


text:
# Terraform

## Purpose

* Infrastructure as Code
* Efficient Execution Plans
* Detection of Drift in Plans vs Actual Infrastructure
* Changeset Automation

## Configuration Language

### Resources and Modules

* Resource = Single infrastructure object
* Module = Group of resources
  * Describes relationship between set of objects to create higher-level system
* Configuration begins in a root module
  * Tree of child modules created when one module calls into others

repository: ssimontis/gitbookwiki

repo_name: ssimontis/gitbookwiki


text:
Babel.js
=======

##TL;DR

Add `<script src="https://cdn.rawgit.com/speech/babel/master/babel.mini.js"></script>` to the header of a .bit website to improve compatibility with [Speech.is](http://www.speech.is) and other [Speech.js](https://github.com/speech/speech.js) websites.

**Note:** this is BETA quality software and the Speech.is website is still ALPHA quality.

##About

Babel is a translator for websites using [Speech.js](http://speech.github.io/speech.js/) for web interoperability and to circumvent censorship.  Normally, a page with an embedded iFrame cannot directly retrieve information about the content in the child iFrame, such as the title, favicon, and changes to the URL.  Babel passes this information up to a Speech.js site, alters .bit links, and generally makes for a seamless user experience.

Babel first checks to see if it is on page that is being framed.  If so, it then syncs the favicon, title, and URL of the child .bit site with parent speech.js site.
Babel also changes the target of external links so that they load directly.  It also supports rewriting anchor tags with links to .bit websites (`<a href="http://other-dot-bit-site.bit">` to `<a href="http://other-dot-bit-site.spx.is">`) but it's currently hardcoded to use .spx.is.

repository: speech/babel

repo_name: speech/babel