text:
---
title: "Vulkan progress report #7"
excerpt: "It's been three months since a Vulkan progress report! I know you guys missed them, so I made sure to work extra hard to have something nice to make up. It feels great to be back to doing graphics programming after two months refactoring the core engine."
categories: ["progress-report"]
author: Juan Linietsky
image: /storage/app/uploads/public/5ea/ca9/b28/5eaca9b28e21f592433351.jpeg
date: 2020-05-01 00:00:00
---

It's been three months since a Vulkan progress report! I know you guys missed them, so I made sure to work extra hard to have something nice to make up. It feels great to be back to doing graphics programming after two months refactoring the core engine.

So, here are the things that were worked on during April 2020!

*See other articles in this Godot 4.0 Vulkan series:*

1. [Vulkan progress report #1](https://godotengine.org/article/vulkan-progress-report-1)
2. [Vulkan progress report #2](https://godotengine.org/article/vulkan-progress-report-2)
3. [Vulkan progress report #3](https://godotengine.org/article/vulkan-progress-report-3)
4. [Vulkan progress report #4](https://godotengine.org/article/vulkan-progress-report-4)
5. [Vulkan progress report #5](https://godotengine.org/article/vulkan-progress-report-5)
6. [Vulkan progress report #6](https://godotengine.org/article/vulkan-progress-report-6)
7. (you are here) [Vulkan progress report #7](https://godotengine.org/article/vulkan-progress-report-7)

## Node renames

While not entirely rendering specific, a lot of nodes are being renamed. Users often complain that it's confusing that 2D nodes have the "2D" suffix, while 3D ones do not. This will change in Godot 4.0. A lot of nodes will also be renamed to have clearer naming. A compatibility option will be added on load so older scenes still open properly.

![node_renames.png](/storage/app/uploads/public/5ea/c9d/3db/5eac9d3dbbe51072383889.png)

## New screen-space reflection

Screen space reflection in Godot 3.x was rather limited. It supported roughness, but it did so in a way where the texture reads appeared rough, but not the reflected image (the edges of the reflected objects remained intact). This is changing in 4.0, using a special screen-space filter to correctly simulate roughness.

![ssr_roughness.jpeg](/storage/app/uploads/public/5ea/c9d/daa/5eac9ddaaa75f607495001.jpeg)

## New Subsurface Scattering

This effect worked to some extent in Godot 3.x, but the quality was limited by several factors. In Godot 4.0, Subsurface Scattering has been redone with a completely new state-of-the-art scattering model. In the example below, you can see that transitions from light to shadow now use the right skin sub-surface colors (red in this case), and that the ear is semi-translucent thanks to scattering.

![sss.jpeg](/storage/app/uploads/public/5ea/c9e/d77/5eac9ed77de4f353003428.jpeg)

Additionally to being able to simulate skin more correctly, it also supports transmittance, so light that comes from behind will spread towards the front by scattering below the surface.

![sss2.jpeg](/storage/app/uploads/public/5ea/c9f/569/5eac9f5698271747075184.jpeg)

Besides using the pre-existing tuned skin model, you can customize scattering so it works in a wider amount of material types.

## Reworked shadow bias settings

A very common complaint when using shadowmaps in Godot is that tweaking shadow bias is extremely difficult compared to other game engines. Godot uses many different shadow techniques, which require different bias settings. Additionally, some situations like screen aspect ratio, draw distance or objects behind the camera frustum may also affect the biasing effect in ways it escapes user control.

In Godot 4.0, biasing has been entirely redone. Instead of reflecting the actual offset in shadow coordinates, bias is now a a reference value that adjusts itself to different shadow settings and types. It all happens automagically so, once set, the setting is adjusted to all possible internal conditions and light types.

This way, when you add a new light, a default value that works out of the box (or almost does) is always present and,  even if you need to adjust the bias for some reason, the effort is minimal.

Additionally, slope-scale was replaced by normal-bias, allowing a very significant increase in shadowmap quality. Shadows look so good now that the old "contact" approximator no longer makes sense and it was removed. For directional shadows, pancaking was added (and is enabled by default). This makes shadows extremely stable, but has the downside that triangles too large may break the shadow a bit. If this happens, you need to adjust the pancake size, or subdivide the geometry.

![newbias.png](/storage/app/uploads/public/5ea/ca1/762/5eaca17628e6f319355812.png)

As you can see in the image below, shadows "just work", with no visible gaps or peter panning.

## Soft Shadows

Godot 4.0 will support soft shadows in all its light types. For Omni and Spot shadows, a "size" parameter was added to the settings.

![softshadow1.png](/storage/app/uploads/public/5ea/ca2/9c9/5eaca29c9c577395303319.png)

Soft shadows can become expensive quickly, so make sure to use them with relatively small softness values, or in controlled environments. For Directional lights, an "angular distance" parameter was added instead (0.5 is the Sun's size). Setting this value results in more realistic shadows from the Sun.

![softshadow2.jpeg](/storage/app/uploads/public/5ea/ca2/f3d/5eaca2f3d580f007549925.jpeg)

## Accurate frame render time

In Godot 3.2, you can only see the frames per second that takes rendering the whole editor. This is very misleading and not representative of rendering performance.

For 4.0, you can see the exact time it takes to render each 3D viewport, for both the CPU and GPU, and a correct estimation of what the "frames per second" will be when running your actual game.

![frametime.png](/storage/app/uploads/public/5ea/ca3/992/5eaca3992abf2483827201.png)

## MSAA and Screen-Space antialiasing

MSAA is back in master branch. Additionally, you can choose screen space antialiasing method such as FXAA.

Together with specular aliasing improvements for Godot 4.0, image quality is starting to be extremely high for this upcoming version, without having to resort to techniques such as TAA.

![msaa.jpeg](/storage/app/uploads/public/5ea/ca4/184/5eaca41843bd7059021546.jpeg)

## Decals

A very long-since requested feature has finally made it to Godot. Decals are now supported in the engine. They are very easy to use, just select the right texture channels and blending options and they work without much hassle.

![decals.png](/storage/app/uploads/public/5ea/ca4/7fa/5eaca47fa3b0f867779520.png)

Godot uses clustered decals, so the cost is very low (the pixel is shaded only once and there are no extra draw calls for each decal). Still, it is possible to set a maximum (including fadeout) distance for the decals. Make sure to abuse them as much as you want!

## Light projectors

Both the Omni and Spot lights are now able to project textures. For Omni lights, in order to throw light in all directions, a panorama is required so make sure to look for a proper tool to generate them.

![projectors.jpeg](/storage/app/uploads/public/5ea/ca5/6a8/5eaca56a8beaa637264799.jpeg)

## Low level access to RenderingDevice

Godot 4.0 will allow you to have low level access to the rendering APIs, allowing you to do all the same things Godot does during rendering, or calling your custom code in the middle of render passes.

Additionally, GLSL shaders (not Godot shaders, real GLSL 4.50+Vulkan extensions) can now be imported. It can't be edited in-engine, but it supports shader variants using a custom syntax. They will be automatically imported and converted to SPIR-V when found, giving you proper reports on import errors.

![glsl.jpeg](/storage/app/uploads/public/5ea/ca6/6b7/5eaca66b74041506577562.jpeg)

It is also possible to create local rendering devices, which run in the game thread (or any other thread). This is very useful for games that may want their logic accelerated by the GPU (such as sandbox or simulation games).

## Future

As you can see, a lot of cool new features were added this month! A 4.0 Alpha is still some months away, but it's getting closer every day! So, stay tuned for next month's progress report, which will include a lot of great new features including the new GPU accelerated lightmapper.

As always, please remember that Godot is made out of love for you and everybody else making games. We want to create the ultimate game engine and give it to you and the rest of the world for free, so you can own your games down to the last line of code. If you are not yet, please consider [becoming our patron](https://www.patreon.com/godotengine), and help us make this dream become reality.

repository: godotengine/godot-website

repo_name: godotengine/godot-website


text:
---
path: /team/elizabeth-raley
type: team
published: 1
name: Elizabeth Raley
personal_pronouns: she/her
audio: 'audio/elizabeth-raley.mp3'
pronunciation: 'e-liz-a-beth ray-lee'
image: 'images/elizabeth-raley.jpg'
manager: 1
role: Management & Operations
location: Austin, Texas
quote: I choose the bright side.
social:
  - {
  name: LinkedIn,
  url: https://www.linkedin.com/in/elizabethraley
  }
  - {
    name: GitHub,
    url: https://github.com/elizabethraley
   }
  - {
  name: Twitter,
  url: http://twitter.com/elizabethraley
  }
specialties: [ "Agile",
Empathy,
Servant Leadership,
Managing Energy
]

---

Elizabeth connects people to each other and to things that matter.

She knows that work is always more than a means to an end, and encourages folks to keep sight of their higher purpose in a supportive culture of open authenticity and wholeness. Elizabeth worked for years as a project manager, helping agencies understand and adopt agile practices. These days her project is the entire company, which she facilitates with curiosity and empathetic attention, helping CivicActioners become the happiest and most productive versions of themselves.

Elizabeth has a B.F.A. from Wayne State University and is a certified ScrumMaster. She brings laughter to every Slack channel, from #parenting to #namaste, and really appreciates a good spreadsheet. At home, she enjoys life with her trio of family members: husband, kid, and dog.

### Things Elizabeth has been doing
* Guiding the [culture of CivicActions](http://handbook.civicactions.com/en/latest/02-about-us/culture/) to keep our workplace safe, open, and fun
* Masterminding a [yearly in-person gathering](https://medium.com/civicactions/mountain-time-civicactions-synchronizes-at-the-2018-retreat-dcdcc15a2771) for our growing remote team
* Helping CivicActions grow with a focus on [diversity and equity](https://medium.com/civicactions/were-hiring-at-civicactions-aa8ac8486923)
* Facilitating [open discussions](https://www.agilegovleaders.org/conference/) in a community of government agile practitioners
* Promoting [agile culture](https://www.fedscoop.com/video/civicactions-elizabeth-raley-on-agile-in-government/) to support California’s digital transformation
* Staying balanced with a daily [yoga](https://www.youtube.com/user/yogawithadriene) and [meditation](https://www.headspace.com/) practice

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

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: JavaScript

gha_license_id: NOASSERTION

license_type: permissive


text:
# Test Cluster

This directory is here to provide a test cluster for e2e-tests.

It is a direct copy of the `tools` directory from the project root and should
stay around and in sync until we have another way of spinning up a test cluster
alongside a determined dev cluster.

The only changes introduced here are:

- Updated, unique ports: 8081 for master, and 5433 for database

repository: sanmudaxia/determined

repo_name: sanmudaxia/determined


text:
# Flipkart Product Category Prediction
Comparitive analysis of multiple Deep Learning and Machine Learning architectures for predicting the primary category of a given product based on its description and other features.

# Models Used:

1. LSTM
2. CNN
3. BERT
4. Hybrid CNN and LSTM model
5. Random Forest
6. SVM
7. KNN
8. Naive Bayes

# Index
1.	Project Description
2.	Data Extraction
3.	Data Pre-processing and Modification
4.	Model development and Testing
5.	Model Summary
6. References

# Project Description
 The project aims to develop a pipeline for predicting the primary category of products found on flipkart by using their description and images.
 The Colab notebooks and their description are as follows:

### Colab Notebooks:
*	Data Cleaning and EDA :Extracting relevant data from the given dataset, cleaning it up and visualizing insights about the data.
*	Approach 1: Creating a LSTM based deep learning model and training it on preprocessed data
*	Approach 2: Setting up a BERT model and training it on preprocessed data
*	Approach 3: Creating a hybrid deep learning model taking both images and descriptions as input and then training it on preprocessed data
*	Approach 4: Creating 4 different machine learning models and training them on preprocessed data
*	Approach 5: Creating a CNN based deep learning model and training it on preprocessed data
*   Results Analysis: Detailed results of various models

### Libraries Used:
The following libraries were used for data exploration and model development –
* Numpy, Pandas: Data loading and Manipulation
* Sklearn: For Data preprocessing, machine learning models and evaluation metrics
* Seaborn, Matplotlib: Data Visualization
* Requests, BeautifulSoup: Scraping data from flipkart
* Tensorflow: Deep Learning models
* CV2, PIL: Image loading and processing
* TQDM: Timeline View
* Gensim: NLP Preprocessing

# Approach

## Data Cleaning

It was observed that some products do not have a primary category. For such products, flipkart webste was scraped and category was obtained. If a category was still not found, the products were removed.
The duplicate categories were merged.
A total of 22 unique categories were identified.
Null occurences were removed for descriptions (only 3 were present) and final dataframe was saved.
Note - Alternate approach would have been to manually classify these categories under major categories but, according to flipkart category tree, all these products belonged to the "Home" category.

#### For the descriptions, the following process was followed:
1. Convert text to lower case
2. Remove punctuations and numbers
3. Remove stopwords
4. Remove contractions
5. Remove stray characters

## Data Visualization

The cleaned data was visualized to gain meaningful insights.
Wordcloud visualization is as follows:

For all categories, most appearing words were plotted. For example, for the clothing category, [women,online,shirt] were most occuring words.

Overall word length distribution stated that the average description had 47 words. For individual categories also, boxplot was plotted for the word distribution.

### Overall Word Length Distribution

### Individual Word Length Plot

## Model Training and Evaluation

The 8 different models mentioned above were created and trained on the preprocessed data.
For the ML models, TFIDF Vectorizer was used to convert input sentences to vectors.
For the DL models, Tensorflow Tokenizer was used to vectorize the input sentences and the sequences were padding to a max length of 100.

### Best DL Model

Among the deep learning models, BERT performed the best with an f1-score of 97% and macro average of 88%.

### Best ML Model

Among the machine learning models, Random Forest performed the best with an f1-score of 97% and macro average of 94% but, the model overfit on training set.

### Weights of models:
https://drive.google.com/drive/folders/1DGD2DjOO0-ptIzbtM-DW_hb3LW0Q3vWD?usp=sharing

## Conclusion

The dataset provided has limited datapoints and many urls are outdated. Hence, our models have restriced performance.
Among the deep learning models, BERT performed the best and the loss decayed in just 1 epoch.
Among the machine learning models, random forest yielded higher accuracy than even BERT but, overfitted on training data, which would be an issue as the dataset size grows.

## Future Scope
1. Scrape more data
2. Use Lemmatization or stemming
3. Use Boosted models, like xgboost
4. Use word embeddings like GLoVe
5. Experiment with more complex transformers
6. Optimize the hybrid model with more images per product

## References
1. F1 metrics in keras: https://datascience.stackexchange.com/questions/45165/how-to-get-accuracy-f1-precision-and-recall-for-a-keras-model
2. Plotting ROC Curve: analyticsvidhya.com/blog/2020/06/auc-roc-curve-machine-learning/
3. BERT Tutorial: https://www.tensorflow.org/tutorials/text/classify_text_with_bert
4. https://scikit-learn.org/stable/modules/model_evaluation.html
5. https://machinelearningmastery.com/save-load-machine-learning-models-python-scikit-learn/

branch_name: refs/heads/main


text:
# PHP-Foundation

**Writing modern PHP applications efficiently**

Build *better* applications *faster*, while still using “plain old PHP” only.

There are no DSLs or pseudo-languages that you need to learn (except [Twig](views/welcome.html)!), nor any “magical” command-line utilities.

## Requirements

 * Apache HTTP Server 2.2.0+
   * `mod_rewrite`
   * `mod_headers`
 * PHP 5.6.0+
   * Multibyte String extension (`mbstring`)
   * PDO (PHP Data Objects) extension (`pdo`)
   * OpenSSL extension (`openssl`)
   * GMP (GNU Multiple Precision) extension (`gmp`)
 * MySQL 5.5.3+ **or** MariaDB 5.5.23+ **or** PostgreSQL 9.5.10+ **or** SQLite 3.14.1+

## Installation

 1. Copy all files from this repository to your development path or web server.

    **Note:** This framework does currently work in the web root (at `/` under your domain) only.

 1. Copy the configuration template `config/.env.example` to `config/.env`. This new file is where your private configuration will be stored. Fill in the correct settings for your environment. The most important setting is `APP_PUBLIC_URL`, which is required for your application to work correctly in the first place.
 1. If you want to use the built-in authentication component, create the database tables for [MariaDB](https://github.com/delight-im/PHP-Auth/blob/master/Database/MySQL.sql), [MySQL](https://github.com/delight-im/PHP-Auth/blob/master/Database/MySQL.sql), [PostgreSQL](https://github.com/delight-im/PHP-Auth/blob/master/Database/PostgreSQL.sql) or [SQLite](https://github.com/delight-im/PHP-Auth/blob/master/Database/SQLite.sql) in the database that you specified in `config/.env`.
 1. Get Composer [[?]](https://github.com/delight-im/Knowledge/blob/master/Composer%20(PHP).md) and run

    ```
    # composer check-platform-reqs
    $ composer install
    ```

    in this directory (containing the `README.md`) to set up the framework and its dependencies.
 1. Make sure that the content of the `storage/` directory is writable by the web server, e.g. using

    ```
    $ sudo chown -R www-data:www-data /var/www/html/storage/*
    ```

    on Linux if this directory (containing the `README.md`) is in `/var/www/html/` on the server.
 1. Ensure that the configuration in the `config/` directory – which usually contains sensitive information such as database credentials, SMTP passwords or API tokens – can be read only by the web server. For example, execute

    ```
    $ sudo chown -R www-data:www-data /var/www/html/config
    $ sudo chmod 0555 /var/www/html/config
    $ sudo chmod 0400 /var/www/html/config/.env
    ```

    on Linux if this directory (containing the `README.md`) is in `/var/www/html/` on the server.
 1. If you want to enable automatic backups in compressed and encrypted form, please refer to the [“Backups” section](#backups) further below.

## Usage

 * [Application structure](#application-structure)
 * [Routing](#routing)
 * [Charsets and encodings](#charsets-and-encodings)
 * [Storage](#storage)
 * [Database access](#database-access)
 * [String handling](#string-handling)
 * [Input validation](#input-validation)
 * [HTML escaping](#html-escaping)
 * [Templates](#templates)
 * [Authentication](#authentication)
 * [Sessions and cookies](#sessions-and-cookies)
 * [Flash messages](#flash-messages)
 * [Mail](#mail)
 * [Obfuscation of IDs](#obfuscation-of-ids)
 * [Uploading files](#uploading-files)
 * [Serving files](#serving-files)
 * [File downloads](#file-downloads)
 * [Internationalization (I18N) and localization (L10N)](#internationalization-i18n-and-localization-l10n)
 * [Helpers and utilities](#helpers-and-utilities)

### Application structure

 * `app/`: This is the most important directory: It’s where you’ll write all your PHP code. It’s entirely up to you how you structure your application in this directory. Create as many files and subdirectories here as you wish. The `index.php` file is the main entry point to your application. The complete folder is exclusively for you.
 * `backups/`: If you make use of the convenient `backup.sh` script, this is where the compressed and encrypted backups will be stored. See the [“Backups” section](#backups) further down.
 * `config/`: Store your local configuration, which should include all confidential information, keys and secrets, here. Put everything in `config/.env` while keeping an up-to-date copy of that file in `config/.env.example` which should have exactly the same keys but all the confidential values removed. The first file will be your private configuration, the second file can be checked in to version control for others to see what configuration keys they need. Always remember to securely back up the private configuration file (`config/.env`) somewhere outside of your VCS. Do *not* store it in version control.
 * `public/`: This is where you can store your static assets, such as CSS files, JavaScript files, images, your `robots.txt` and so on. The files will be available at the root URL of your application, i.e. `public/favicon.ico` can simply be accessed at `favicon.ico`. The complete folder is exclusively for you.
 * `storage/app/`: Storage that you can use in your app to store files temporarily or permanently. This space is private to your application. Feel free to add any number of subfolders and files here.
 * `storage/framework/`: Storage used by the framework, e.g. for caching. Do *not* add, modify or delete anything here.
 * `vendor/`: This directory is where Composer will install all dependencies. Do *not* add, modify or delete anything here.
 * `views/`: If you use templates for HTML, XML, CSV or LaTeX (or anything else) that should be rendered by the built-in template engine, this is where you should store them.
 * `.htaccess`: Rules and optimizations for Apache HTTP Server. You may add your own rules here, but only in the `CUSTOM` section at the bottom.
 * `backup.sh`: Script that can create compressed and encrypted backups in the `backups/` directory for you. See the [“Backups” section](#backups) further below.
 * `composer.json`: The dependencies of your application. This framework must *always* be included in the `require` section as `delight-im/framework`, so please don’t remove that entry. But otherwise, feel free to add or modify any of your own entries.
 * `index.php`: This is the main controller of this framework. It sets everything up correctly and passes on control to your application code. Do *not* change or delete this.

### Routing

Your application will be available at the URL where this root folder is accessible on your web server.

**Note:** You should have added this URL to the configuration in `config/.env` as `APP_PUBLIC_URL` already. This is required for your application to work correctly.

Sometimes a single application is expected to respond to *multiple* hostnames with *different* content. Examples include the use of language-specific subdomains (such as `fr.example.com` and `id.example.com`), country-specific TLDs (such as `example.com` and `example.org`), separate storefronts (such as `seller-a.example.com` and `seller-b.example.com`), or user-specific content (such as `jane.example.org` and `john.example.org`). For those cases, you can define multiple supported URLs in `APP_PUBLIC_URL` by separating the individual URLs using the vertical bar or pipe character (`U+007C VERTICAL LINE`). In your application code, you should then decide which content to show based on the value of `$app->getCanonicalHost()`.

However, if you just want to serve the *same* content at *multiple* hostnames or schemes, you should consider using redirects instead, which can forward from different hostnames or schemes to one canonical form. In most of these cases, you’ll want to send HTTP status `301` for *permanent* redirects.

The single pages or endpoints of your application will be served at the routes that you define in the `app/` directory. A few sample routes have already been added.

For more detailed information on routes, please refer to the [documentation of the router](https://github.com/delight-im/PHP-Router).

### Charsets and encodings

Everything is UTF-8 all the way through! Just remember to save your own source files as UTF-8, too.

### Storage

You may store files private to your application in `storage/app/`. Feel free to store the files either in the root directory or in any number of subfolders that you create.

The storage path can be retrieved in your application code via `$app->getStoragePath('/path/to/subfolder/file.txt')`, for example.

Files inside `storage/app/` are private to your application. You may use PHP’s file handling utilities to work with the files or offer them to the user as a download (see "File downloads" below).

### Database access

Did you set your database credentials in `config/.env`? If the configuration is valid, getting a database connection is as simple as this:

```php
$app->db();
```

For information on how to read and write data using this instance, please refer to the [documentation of the database library](https://github.com/delight-im/PHP-DB).

**Note:** You don’t have to construct the database instance or establish the connection yourself. This will be done for you automatically. Just call the methods to read and write data on the instance provided.

### String handling

Convenient string handling in an object-oriented way with full Unicode support is available on any string after wrapping it in the `s(...)` helper function.

For information on all the methods available with strings wrapped in `s(...)`, please refer to the [documentation of the string library](https://github.com/delight-im/PHP-Str).

**Note:** There is no need for you to set up the `s(...)` shorthand anymore. This has been done already.

### Input validation

This framework comes with easy and safe input validation for `GET`, `POST` and cookie data as well as for any existing variable.

Both validation and filtering are performed automatically and *correctly typecast* values are returned for you.

If a value does not exist or if it’s invalid, you’re guaranteed to receive `null` as the result. This way, you don’t have to check for empty strings, `null`, `false` or invalid formats separately.

```php
$app->input()->get('username'); // equivalent to TYPE_STRING
$app->input()->get('profileId', TYPE_INT);
$app->input()->get('disabled', TYPE_BOOL);
$app->input()->get('weight', TYPE_FLOAT);
$app->input()->get('message', TYPE_TEXT);
$app->input()->get('recipientEmail', TYPE_EMAIL);
$app->input()->get('linkTo', TYPE_URL);
$app->input()->get('whoisIp', TYPE_IP);
$app->input()->get('transmission', TYPE_RAW);

$app->input()->post('country'); // equivalent to TYPE_STRING
$app->input()->post('zipCode', TYPE_INT);
$app->input()->post('subscribe', TYPE_BOOL);
$app->input()->post('price', TYPE_FLOAT);
$app->input()->post('csv', TYPE_TEXT);
$app->input()->post('newsletterEmail', TYPE_EMAIL);
$app->input()->post('referringSite', TYPE_URL);
$app->input()->post('signUpIp', TYPE_IP);
$app->input()->post('print', TYPE_RAW);

$app->input()->cookie('realName'); // equivalent to TYPE_STRING
$app->input()->cookie('lastLoginTimestamp', TYPE_INT);
$app->input()->cookie('hideAds', TYPE_BOOL);
$app->input()->cookie('cartTotalAmount', TYPE_FLOAT);
$app->input()->cookie('draft', TYPE_TEXT);
$app->input()->cookie('friend', TYPE_EMAIL);
$app->input()->cookie('social', TYPE_URL);
$app->input()->cookie('antiFraud', TYPE_IP);
$app->input()->cookie('display', TYPE_RAW);

$app->input()->value($username); // equivalent to TYPE_STRING
$app->input()->value($profileId, TYPE_INT);
$app->input()->value($disabled, TYPE_BOOL);
$app->input()->value($weight, TYPE_FLOAT);
$app->input()->value($message, TYPE_TEXT);
$app->input()->value($recipientEmail, TYPE_EMAIL);
$app->input()->value($linkTo, TYPE_URL);
$app->input()->value($whoisIp, TYPE_IP);
$app->input()->value($transmission, TYPE_RAW);
```

### HTML escaping

In order to escape any string for safe use in HTML, just wrap the string in the `e(...)` helper function:

```php
echo e('Bob <b>says</b> "Hello world"');
// => Bob <b>says</b> "Hello world"

// or

echo '<img src="'.e($profilePictureUrl).'" alt="Bob" width="96" height="96">';
```

```html
<!-- or -->

<img src="<?= e($profilePictureUrl) ?>" alt="Bob" width="96" height="96">
```

If you use templates stored in the `views/` directory (see below), you don’t need this, as templates come with automatic escaping by default.

### Templates

Place your HTML, XML, CSV or LaTeX (or anything else) templates in the `views/` folder. Make them powerful and re-usable with the [Twig language](http://twig.sensiolabs.org/doc/templates.html). A few examples for such templates have already been added.

In order to render a template, just load it in your PHP code:

```php
echo $app->view('welcome.html.twig');
```

Usually, you’ll want to pass data to the templates as well:

```php
echo $app->view('welcome.html.twig', [
    'userId' => $id
    'name' => $name
    'messages' => $messages
]);
```

The data that you passed in the second parameter of the `$app->view(...)` method will be available in your template:

```html
<h1>Hello, {{ name }}!</h1>
```

All output is escaped (and thus safe) by default! If you need to disable escaping for a variable, you can do so using the `raw` filter:

```html
<span>Goodbye, {{ name | raw }}!</span>
```

Conditional expressions and loops are available as control structures:

```html
{% if messages|length > 0 %}
    <p>You have <strong>{{ messages|length }}</strong> new messages!</p>
{% endif %}
```

```html
<div>
    {% for picture in pictures %}
        <img src="{{ picture.url }}" alt="{{ picture.description }}" width="100" height="100">
    {% endfor %}
</div>
```

For less code and more markup re-use, templates can be embedded inside each other:

```html
{% include 'includes/header.html.twig' %}
```

Embedding can even be combined with loops:

```html
<ul>
    {% for user in users %}
        <li>{{ user.username }}</li>
        {% for picture in user.pictures %}
            {% include 'picture_box.html.twig' %}
            <!-- `picture_box` has access to `picture` -->
        {% endfor %}
    {% endfor %}
</ul>
```

You can add custom filters in your PHP code which can then be used to modify data in the templates:

```php
$app->getTemplateManager()->addFilter('repeatAndReverse', function ($str) {
    return strrev($str.' '.$str);
});
```

```html
<p>We will repeat {{ myVariable | repeatAndReverse }} and reverse this!</p>
```

Moreover, you can add variables as globals in your PHP code which can then be accessed in the templates:

```php
$app->getTemplateManager()->addGlobal('googleAnalytics', $ga);
```

```html
{{ googleAnalytics.trackingCode | raw }}
</body>
```

The main application object is available as a global variable named `app` by default. This means that you can access all methods from the application object in your templates:

```html
<link rel="icon" type="image/png" href="{{ app.url('/favicon.ico') }}">
```

Finally, you can add functions from your PHP code which then become available for use in the templates:

```php
$app->getTemplateManager()->addFunction('translate', function ($value) {
    return gettext($value);
});
```

```html
<p>{{ translate('Thanks for joining our community!') }}</p>
```

Please refer to the [documentation of the template engine](http://twig.sensiolabs.org/doc/templates.html) for more information on how to write templates.

### Authentication

Convenient and secure authentication is always available via the `$app->auth()` helper method.

For information on how to register or log in users with a few lines of code, please refer to the [documentation of the authentication library](https://github.com/delight-im/PHP-Auth).

### Sessions and cookies

Convenient management of session data and cookies is available via the two classes `\Delight\Cookie\Cookie` and `\Delight\Cookie\Session`.

For information on how to use these two classes, please refer to [the documentation of the session and cookie library](https://github.com/delight-im/PHP-Cookie).

**Note:** You don’t have to include these two classes yourself anymore. They are included and loaded automatically.

### Flash messages

If you want to store short messages to be displayed right upon the next request, you can use the built-in flash message helpers:

```php
$app->flash()->success('Congratulations!');
// or
$app->flash()->info('Please note!');
// or
$app->flash()->warning('Watch out!');
// or
$app->flash()->danger('Oh snap!');
```

In order to *display* the messages, which you’ll probably want to do in your templates, use the methods available on the `$app->flash()` instance for retrieving the data. Alternatively, use one of the built-in partial templates for popular front-end solutions:

 * [Bootstrap 3](http://getbootstrap.com/)

   ```
   {% include 'includes/flash/bootstrap-v3.html.twig' %}
   ```

### Mail

The pre-configured mailing component is always available via the `$app->mail()` helper:

```php
$message = $app->mail()->createMessage();

$message->setSubject('This is the subject');
$message->setFrom([<EMAIL_ADDRESS>=> 'John Doe' ]);
$message->setTo([<EMAIL_ADDRESS>=> 'Jane Doe' ]);
$message->setBody('Here is the message');

if ($app->mail()->send($message)) {
    // Success
}
else {
    // Failure
}
```

Please refer to the [documentation of the mailing component](http://swiftmailer.org/docs/messages.html) for more information on how to build message instances.

### Obfuscation of IDs

Do you want to prevent your internal IDs from leaking to competitors or attackers when using them in URLs or forms?

Just use the following two methods to encode or decode your IDs, respectively:

```php
$app->ids()->encode(6); // => e.g. "43Vht7"
// and
$app->ids()->decode('43Vht7'); // => e.g. 6
```

If you want to configure the underlying transformation, you simply have to change the following configuration values in your `config/.env` file:

 * `SECURITY_IDS_ALPHABET`
 * `SECURITY_IDS_PRIME`
 * `SECURITY_IDS_INVERSE`
 * `SECURITY_IDS_RANDOM`

Please refer to the [documentation of the ID obfuscation library](https://github.com/delight-im/PHP-IDs) for information on what constitutes proper values and how to generate them.

### Uploading files

Whenever you want to let users upload files to your application, there’s a built-in component that does this in a convenient and safe way:

```php
$upload = $app->upload('/uploads/users/' . $userId . '/avatars');
$upload->from('my-input-name');
$upload->save();
```

For more information on how to use the upload handler, including more advanced controls, please refer to the [documentation of the file upload library](https://github.com/delight-im/PHP-FileUpload#usage).

If you want to check for the presence of (optional) file uploads before actually processing them, you can use the following two helpers:

```php
$app->hasUploads();
// and/or
$app->hasUpload('my-input-name');
```

### Serving files

You can serve (static) files to the client from your PHP code, e.g. after performing access control:

```php
$app->serveFile($app->getStoragePath('/photos/314.png'), 'image/png');
```

Most commonly, this will be used to serve images. If certain files aren’t public or cannot be accessed directly for other reasons, thus requiring more dynamic behavior, the helper above will be useful.

If you want to offer files for download, however, e.g. documents or videos, there is another helper that is more suitable (see "File downloads").

### File downloads

In order to send strings or files to the client and prompt a download, use one of the following methods:

```php
$app->downloadContent('<html>...</html>', 'Bookmarks-Export.html', 'text/html');
// or
$app->downloadFile($app->getStoragePath('/photos/42.jpg'), 'My Photo.jpg', 'image/jpeg');
```

### Internationalization (I18N) and localization (L10N)

If you want to localize your application and translate strings in your application code and in your templates, the built-in internationalization component offers everything you need.

First, in order to enable the component, go to your configuration in `config/.env` and set `I18N_SUPPORTED_LOCALES` to a comma-separated list of languages or locales that you want to support. You can use the codes [listed here](https://github.com/delight-im/PHP-I18N/blob/master/src/Codes.php):

```
I18N_SUPPORTED_LOCALES=en-US,da-DK,es,es-AR,ko
```

Some of the locales you want to use may not be installed on your local machine or on the server that you deploy your application to. In that case, you will have to [install](https://github.com/delight-im/PHP-I18N#decide-on-your-initial-set-of-supported-locales) the locales first.

The best language for the client is usually detected and applied automatically (from the HTTP header `Accept-Language` that is sent by the client), but you may select a language manually by supplying it in a subdomain (e.g. `da-DK.example.com`), in a path prefix (e.g. `http://www.example.com/pt-BR/welcome.html`), or as a parameter in the query string (as `locale`, `language`, `lang` or `lc`).

Optionally, if you want to store the currently selected language in the session or in a cookie, you can define the key or name to use in your configuration in `config/.env`:

```bash
I18N_SESSION_FIELD=language
# and / or
I18N_COOKIE_NAME=lang
```

You can always check the currently active locale for a client using `$app->i18n()->getLocale()` in your application code or using `app.i18n().getLocale()` in your templates. Apart from that, there are many other [helpers and utilities](https://github.com/delight-im/PHP-I18N#information-about-locales) available that let you access names and other information for your set of locales.

Next, you need to identify and mark all strings in your code that can be translated. For an existing application, this might require some more effort, but you can start with only a few strings, of course.

This allows for the marked strings to be extracted automatically, so that they can be translated outside of the actual code, before being inserted again automatically during runtime.

 * [Basic strings](https://github.com/delight-im/PHP-I18N#basic-strings)

   * In your application code

     ```
     _('Welcome to our online store!');
     ```

   * In your templates

     ```
     {{ _('Welcome to our online store!') }}
     ```

 * [Strings with formatting](https://github.com/delight-im/PHP-I18N#strings-with-formatting)

   * In your application code

     ```
     _f('Hello %s!', 'Jane');
     ```

   * In your templates

     ```
     {{ _f('Hello %s!', 'Jane') }}
     ```

 * [Strings with extended formatting](https://github.com/delight-im/PHP-I18N#strings-with-extended-formatting)

   * In your application code

     ```
     _fe('{0} was born on {1, date}', 'John', -14182916);
     ```

   * In your templates

     ```
     {{ _fe('{0} was born on {1, date}', 'John', -14182916) }}
     ```

 * [Singular and plural forms](https://github.com/delight-im/PHP-I18N#singular-and-plural-forms)

   * In your application code

     ```
     _p('The file has been saved.', 'The files have been saved.', 3);
     ```

   * In your templates

     ```
     {{ _p('The file has been saved.', 'The files have been saved.', 3) }}
     ```

 * [Singular and plural forms with formatting](https://github.com/delight-im/PHP-I18N#singular-and-plural-forms-with-formatting)

   * In your application code

     ```
     _pf('You have %d new message', 'You have %d new messages', 32);
     ```

   * In your templates

     ```
     {{ _pf('You have %d new message', 'You have %d new messages', 32) }}
     ```

 * [Singular and plural forms with extended formatting](https://github.com/delight-im/PHP-I18N#singular-and-plural-forms-with-extended-formatting)

   * In your application code

     ```
     _pfe('There is {0, number} monkey in {1}.', 'There are {0, number} monkeys in {1}.', 5, 'Anytown');
     ```

   * In your templates

     ```
     {{ _pfe('There is {0, number} monkey in {1}.', 'There are {0, number} monkeys in {1}.', 5, 'Anytown') }}
     ```

 * [Strings with context](https://github.com/delight-im/PHP-I18N#strings-with-context)

   * In your application code

     ```
     _c('Select order:', 'sorting');
     ```

   * In your templates

     ```
     {{ _c('Select order:', 'sorting') }}
     ```

 * [Strings marked for later translation](https://github.com/delight-im/PHP-I18N#strings-marked-for-later-translation)

   * In your application code

     ```
     $title = _m('Profile picture');
     ```

Finally, after having identified and marked some (or all) strings for translation in your application code and in your templates, you can use the built-in tools to extract the strings automatically.

To allow for the extraction of the strings from your templates, refresh and replace the cached versions of your template files by running the following two commands in the root directory of your project:

```bash
$ sudo -u www-data php ./index.php clear-template-cache
$ sudo -u www-data php ./index.php precompile-templates
```

Then, if you want to create or update a PO (Portable Object) file for a specific language, along with its MO (Machine Object) version, which is usually what you want, you need to run the following command in the root directory of the project (using the locale `mr-IN` as an example):

```bash
$ bash ./i18n.sh mr-IN
```

**Note:** On Windows 10+, this command can be used by enabling the [Windows Subsystem for Linux](https://docs.microsoft.com/en-us/windows/wsl/install-win10). Then, inside WSL, run `sudo apt-get install gettext`, `sudo apt-get install dos2unix` and `dos2unix i18n.sh` before being able to use the command.

If you want a generic POT (Portable Object Template) file instead, just drop the locale code from the end:

```bash
$ bash ./i18n.sh
```

Now you can [translate](https://github.com/delight-im/PHP-I18N#translating-the-extracted-strings) the exported PO or POT files, either manually or using any tool or service you want. By running the commands listed above again, you can [compile](https://github.com/delight-im/PHP-I18N#exporting-translations-to-binary-format) the translated files to an updated binary version, after which you only need to restart your web server for the translations to appear in your application.

### Helpers and utilities

The following helpers and utilities are available throughout your application code and in all templates:

 * `$app->url($toPath)` (`app.url(toPath)` in templates)
 * `$app->urlWithLang($toPath)` (`app.urlWithLang(toPath)` in templates)
 * `$app->urlWithParams($toPath, $params)` (`app.urlWithParams(toPath, params)` in templates)
 * `$app->redirect($toPath)`
 * `$app->redirectToUrl($toUrl)`
 * `$app->setStatus($code)`
 * `$app->setContentType($type)`
 * `$app->flash()` (`app.flash()` in templates)
 * `$app->isDebug()` (`app.isDebug()` in templates)
 * `$app->currentRoute()` (`app.currentRoute()` in templates)
 * `$app->currentUrl()` (`app.currentUrl()` in templates)
 * `$app->currentUrlWithLang()` (`app.currentUrlWithLang()` in templates)
 * `$app->currentUrlWithParams($params)` (`app.currentUrlWithParams(params)` in templates)
 * `$app->currentUrlWithQuery()` (`app.currentUrlWithQuery()` in templates)
 * `$app->currentUrlWithQueryAndLang()` (`app.currentUrlWithQueryAndLang()` in templates)
 * `$app->currentUrlWithQueryAndParams($params)` (`app.currentUrlWithQueryAndParams(params)` in templates)
 * `$app->getCanonicalHost()` (`app.getCanonicalHost()` in templates)
 * `$app->getHost()` (`app.getHost()` in templates)
 * `$app->getReferrer()` (`app.getReferrer()` in templates)
 * `$app->getClientIp()` (`app.getClientIp()` in templates)
 * `$app->getUa()` (`app.getUa()` in templates)
 * `$app->isBotAgent()` (`app.isBotAgent()` in templates)
 * `$app->isClientLoopback()` (`app.isClientLoopback()` in templates)
 * `$app->isClientCli()`
 * `$app->hasCliArgument()`
 * `$app->hasCliArgument($position)`
 * `$app->getCliArgument()`
 * `$app->getCliArgument($position)`
 * `$app->isSameSiteRequest()` (`app.isSameSiteRequest()` in templates)
 * `$app->isHttp()`
 * `$app->isHttps()`
 * `$app->getProtocol()`
 * `$app->getPort()`
 * `$app->getQueryString()`
 * `$app->getRequestMethod()`
 * `$app->getUtmSource()` (`app.getUtmSource()` in templates)
 * `$app->getUtmMedium()` (`app.getUtmMedium()` in templates)
 * `$app->getUtmCampaign()` (`app.getUtmCampaign()` in templates)
 * `$app->getUtmTerm()` (`app.getUtmTerm()` in templates)
 * `$app->getUtmContent()` (`app.getUtmContent()` in templates)

## Backups

This package includes support for automatic backups of your database, app storage and log files in compressed and encrypted form. These backups are not enabled by default. For information on how to enable them and make good use of them, please see below.

### Enabling backups

 1. Execute the following commands on Linux if this directory (containing the `README.md`) is in `/var/www/html/` on the server:

    ```
    # Make the backup script executable while preventing modifications to its content
    $ sudo chmod 0500 /var/www/html/backup.sh
    # Assign ownership of the backup script to the superuser
    $ sudo chown root:root /var/www/html/backup.sh
    # Generate a public/private keypair and store the private key in the `backups` directory
    $ openssl genpkey -algorithm RSA -out /var/www/html/backups/asymmetric-key.private.pem -pkeyopt rsa_keygen_bits:4096
    # Extract the public key from the new private key in the `backups` directory
    $ openssl rsa -in /var/www/html/backups/asymmetric-key.private.pem -outform PEM -out /var/www/html/backups/asymmetric-key.public.pem -pubout
    # Allow only read access by its owner for the private key
    $ sudo chmod 0400 /var/www/html/backups/asymmetric-key.private.pem
    # Grant everybody read access to the public key but no other rights
    $ sudo chmod 0444 /var/www/html/backups/asymmetric-key.public.pem
    # Make the `backups` directory writable only by its owner
    $ sudo chmod 0755 /var/www/html/backups
    # Assign ownership of the `backups` directory and its contents to the superuser
    $ sudo chown -R root:root /var/www/html/backups
    ```

 1. Copy – or perhaps *move* – the private key that has been generated above (`backups/asymmetric-key.private.pem`) to a *secure* location on *another machine*. It is important that you choose a location where *you won’t lose* the key and *nobody else will be able to view* the key. Without the private key, you won’t be able to restore your backups later.

 1. In order to set up the periodic execution of the backup script, run

    ```
    $ sudo crontab -e
    ```

    and add a new line with the following content:

    ```
    30 4 * * * /bin/bash /var/www/html/backup.sh > /var/www/html/backups/last.log 2>&1
    ```

    This will create a new backup every night at 04:30. While daily backups should usually be the minimum, you *may* create backups more frequently, if required, e.g. by separating multiple hours with a comma in the crontab entry, as in `4,10,16,22`.

    If you don’t want your backups to be encrypted, pass `unencrypted` as the only argument to `backup.sh`. Otherwise, you may pass `encrypted`, which is also the default.

### Moving backups offsite

For a truly effective backup strategy, of course, you should move the archives created in the `backups/` directory *offsite*, i.e. to a remote location such as another server that you maintain specifically for backups.

Thus, you should either set up a periodic task on a remote machine to *pull* the contents of the `backups/` directory regularly, or set up a periodic task on the local machine to *push* the backups to a remote location with *append-only* privileges (so that a compromised server could not destroy all your backups).

## Security

 * **SQL injections** are prevented if you write to the database using prepared statements only. That is, just follow the examples from the "Database access" section above.
 * **Cross-site scripting (XSS)** protection is available via the convenient escaping and templating features (see sections "HTML escaping" and "Templates" above).
 * **Clickjacking** prevention is built-in and applied automatically.
 * **Content sniffing (MIME sniffing)** protection is built-in and applied automatically.
 * **Cross-site request forgery (CSRF)** mitigation is built-in as well using [same-site cookies](https://github.com/delight-im/PHP-Cookie). For this automatic protection to be sufficient, however, you must prevent XSS attacks and you must not use the HTTP method `GET` for "dangerous" operations.
 * Safe and convenient input validation is built-in as a solid basis for handling untrusted input.

## Contributing

All contributions are welcome! If you wish to contribute, please create an issue first so that your feature, problem or question can be discussed.

## License

This project is licensed under the terms of the [MIT License](https://opensource.org/licenses/MIT).

repository: JerichoST/PHP-Foundation

repo_name: JerichoST/PHP-Foundation


text:
# Milvaneth

Project Milvaneth, named after [Milvaneth Sacrarium in Ul'dah](https://ffxiv.gamerescape.com/wiki/Milvaneth_Sacrarium), is the Chinese version of cross-world market infomation sharing platform (just like mogboard.com). Which, since there is currently no Companion App available for Chinese players (though Live Letter CN said it's WIP months ago), Milvaneth will develop a separate market data fetching technology, and will support Companion App CN API as soon as possible once it is released.

# Languages

您可以在[这里](https://github.com/menphina/Milvaneth/blob/master/README-zh-cn.md)查阅中文版本的 README 文件。

If there is a content difference, the Chinese version of README shall prevail.

如存在内容差异，以中文版本的 README 为准。

# Open source policy

Due to the possibility of abuse of related technologies, Milvaneth will adopt a semi-open source strategy:

1. Dual-use components with no currently open sourced alternatives, such as memory analyzers and some other components, will have access restrictions on source code and may apply anti-reverse engineering measures on object code. (\*)

2. Implementations of predictive or statistical algorithms, if any, will be open source if the algorithm itself has been made public.

3. Components that do not meet the above criteria, such as packet analyzers and user interface parts, will be open source.

(\*) Once an open source alternative appears, the corresponding component will be made public.

Milvaneth's source code is expected to be released under the MIT/X11 license.

# About the service

Milvaneth service will be public available and free-to-use. It may accept donations after formal operation.

Since players in CN region do not need to pay for the base game and expansion packs, and per-account cost is $0.09/hr playtime. The estimated operating cost of Milvaneth will be lower than similar services in JP/US/EU regions.

# Time frame

Test has started.

Will release on 10/15/2019

# TODOs

Goals listed here will be implemented step by step after first release:

- [ ] Website interface

- [ ] ~~ACT plugin version~~ (Most Chinese players use a custom build of ACT which has different codebase)

- [ ] ~~Companion App CN API~~ (Currently not available)

- [ ] Monitoring and alerting

- [ ] Account/retainer based listing

- [ ] ~~Support for PM and buyer/seller chat~~ (after account listing is implemented)

- [ ] "Best for company seal" and "Best for reconstruction" calculator

- [ ] Ingredient price calculator

- [ ] and so on ...

repository: ShadyWhite/Milvaneth

gha_license_id: MIT

repo_name: ShadyWhite/Milvaneth


text:
# Plan My Trip (.NET Core)
> The "Plan my trip" example asks the user questions about an upcoming trip they'd like to take. As a part of this Alexa will gather information about when the trip will start as well as where they'd like to leave from and go to.

[![Build Status](https://haseebahmed7.visualstudio.com/PlanMyTripExample/_apis/build/status/haseebahmed7.dotnetcore-alexa-plan-my-trip)](https://haseebahmed7.visualstudio.com/PlanMyTripExample/_build/latest?definitionId=3)

This example was actually published by Amazon ([here](https://github.com/alexa/alexa-cookbook/tree/master/feature-demos/skill-demo-dialog-delegate)) but has been ported to .NET Core by me.

## Development setup

### Setup ASK CLI
1. Install LTS version of NodeJS from their [website](https://nodejs.org/).
2. Setup Alexa Skill Kit CLI by following steps [here](https://developer.amazon.com/docs/smapi/quick-start-alexa-skills-kit-command-line-interface.html#step-3-install-and-initialize-ask-cli).

### Setup .NET Core
1. Download and install .NET Core SDK from their [website](https://www.microsoft.com/net/download).
2. If latest version is any other than 2.1.x than follow these steps otherwise move onto "Building solution".
3. Navigate [here](https://www.microsoft.com/net/download/dotnet-core/2.1) and download binaries for .NET Core SDK v2.1.5.
4. Extract binaries into "C:\Program Files\dotnet\sdk" or wherever you installed your .NET Core SDK.

### Building solution
1. Open the PlanMyTrip.sln file in Visual Studio 2017.
2. Build and enjoy!

## Release History

* 1.0.0
    * Initial Release

## Meta

Haseeb Ahmed – [@theawkwardguyyy](https://twitter.com/theawkwardguyyy)

Distributed under the MIT license. See ``LICENSE`` for more information.

[https://github.com/haseebahmed7/dotnetcore-alexa-plan-my-trip](https://github.com/haseebahmed7/dotnetcore-alexa-plan-my-trip)

## Contributing

1. Fork it (<https://github.com/haseebahmed7/dotnetcore-alexa-plan-my-trip/fork>)
2. Create your feature branch (`git checkout -b feature/fooBar`)
3. Commit your changes (`git commit -am 'Add some fooBar'`)
4. Push to the branch (`git push origin feature/fooBar`)
5. Create a new Pull Request

<!-- Markdown link & img dfn's -->
[npm-image]: https://img.shields.io/npm/v/datadog-metrics.svg?style=flat-square
[npm-url]: https://npmjs.org/package/datadog-metrics
[npm-downloads]: https://img.shields.io/npm/dm/datadog-metrics.svg?style=flat-square
[travis-image]: https://img.shields.io/travis/dbader/node-datadog-metrics/master.svg?style=flat-square
[travis-url]: https://travis-ci.org/dbader/node-datadog-metrics
[wiki]: https://github.com/yourname/yourproject/wiki


text:
## Tests

This directory contains a simple test suite for the `elm-jsmaze` module. To run it, you'll need [Node.js](https://nodejs.org/en/). To install `elm-test`:

```
npm install -g elm-test
```

To run the tests:

```
cd .../elm-jsmaze    # NOT the tests sub-directory
elm-test
```

To see results of individual tests:

```
elm-test --report json
```

repository: billstclair/elm-jsmaze

repo_name: billstclair/elm-jsmaze


text:
**Quick links:** [PDF form](https://simap.ted.europa.eu/documents/10184/99173/EN_F15.pdf) | [sample XML](https://github.com/open-contracting/european-union-support/blob/main/output/samples/F15_2014.xml)

## Release model

[Create an OCDS release](../operations.md#create-a-release) and:

1. Add 'award' and 'contract' to `tag`.
1. Set `tender.status` to 'complete'.

## What's new

If you have already implemented all *other* forms, this notice adds no new concepts, but inserts one of `DIRECTIVE_2014_23_EU`, `DIRECTIVE_2014_24_EU`, `DIRECTIVE_2014_25_EU` or `DIRECTIVE_2009_81_EC` into some of the XML paths.

## Other notes

The PDF form has radio buttons for the legal basis, which correspond to a single unlabeled XML element (`/LEGAL_BASIS`).

repository: open-contracting/european-union-support

gha_language: Python

repo_name: open-contracting/european-union-support


text:
# hpp_lang
HPPLANG is a high performance platform language to system. It have clean and modern syntax

Source code of the project has moved to gitlab :https://gitlab.com/HPPTECH/hpp_lang.git


text:
# Keyword Blocker
## Block Youtube Videos based on specified keywords

This Chrome extension can block YouTube videos or channels from view based on keywords you can specify.
It features a very basic password protection and the block message is user-customizable.

Originally this was developed for a person who is easily scared and needed to be protected from certain YouTube searches. Because there was no easy way to do this I developed this extension.

Get it in the [Chrome Webstore](https://chrome.google.com/webstore/detail/keyword-blocker/pbgacppomjfpheddhifkdkklddnolnpg)

**Changelog:**
   - **1.8.1 and 1.8.2**
        * Bug fixes of new features
   - **1.8**
        * Added support for trending & subscription page
        * Added support for blocking channels by name or keyword
        * Added support for partial match of keywords
        * Changed export/import of keywords to export/import of all the settings
        * Added right click menu action on selected text for adding to keyword, channel, wildcard keyword or channel keyword list
   - **1.7.1**
        * Bug fix for blocking video
   - **1.7**
        * Fix for new layout of YouTube
        * Added regex support for keyword matching
        * Cleaned up code
   - **1.6**
        * Added csv export
        * Fixed some small bugs
   - **1.5**
        * Added option to also search the description for blocked keywords
   - **1.4**
        * Redesign for a more robust extension (hopefully this will break less often now)
        * Added an option to remove unwanted video's from search results/frontpage instead of always showing the block pop-over

repository: HamedMP/keywordblocker

repo_name: HamedMP/keywordblocker


text:
# Flask Template

[![made-with-python](https://img.shields.io/badge/Made%20with-Python-1f425f.svg)](https://www.python.org/) [![MIT license](https://img.shields.io/badge/License-MIT-blue.svg)](https://github.com/rednafi/protomate/blob/master/LICENSE) [![Code style: black](https://img.shields.io/badge/code%20style-black-000000.svg)](https://github.com/python/black)
[![twitter](https://img.shields.io/twitter/url/https/home?style=social)](https://twitter.com)

## Directory Tree
Directory tree for serving multiple packages as Flask API with multiple endpoints

```
.
├──app/
|   ├── api_1
|   │   ├── __init__.py
|   │   ├── module_1.py
|   │   ├── module_main.py
|   │   └── views.py
|   ├── api_2
|   │   ├── __init__.py
|   │   ├── module_1.py
|   │   ├── module_main.py
|   │   └── views.py
|   └── __init__.py
├── .dockerignore
├── .env
├── .gitignore
├── deploy.sh
├── Dockerfile
├── requirements.txt
└── run.py
```

## Instructions

### Run the API Directly
To run the app, go to the root directory and run:

```
$ python3 -m venv venv
$ source activate venv/bin/activate
$ pip install -r requirements.txt
$ python run.py
```
The app will run locally in port `5000`.

### Run As a Docker Container

* Build the docker container:

    ```bash
    $ sudo docker build . --tag=flask_template
    ```

* Run the docker container in attached terminal

    ```bash
    $ sudo docker run -p 5000:5000 flask_template
    ```

    or, run the container in detached mode

    ```bash
    $ sudo docker run -d -p 5000:5000 flask_template
    ```

### Hit the API

While the above container is running, the API can be accessed via any API development client like [Postman](https://www.getpostman.com/).

```
x-api-key : ABCD1234

# add your desired integer/float, replacing the <number>

base-link : localhoast:5000/api_1/<number>
```
Once you hit the api, you should see something like this (you numbers may be different since we are returning random numbers each time):

 ```bash
 {
    "random_first": 111,
    "random_second": 82,
    "seed": 123
}
 ```

### Stop and Delete the Container After Experimentation

* Check the docker process:

    ```bash
    $ sudo docker ps
    ```
    This should show all the running containers.

    ![Imgur](https://imgur.com/SUHI5pb.png)

* Stop the docker container:

    ```bash
    $ sudo docker stop <CONTAINER_ID>
    ```
* Delete the docker container

    ```bash
    $ sudo docker rm <CONTAINER_ID>
    ```
* Check the docker image:

  ```bash
  $ sudo docker images
  ```
  This should show all the docker images.

  ![Imgur](https://imgur.com/oP4pZpL.png)

* Delete the image:

  ```bash
  $ sudo docker rmi <IMAGE_ID>
  ```

### Deploy in a Server
For deploying the container in a server, make sure you have
    * Setup and configured the server properly
    * Have nginx installed
    * Have gunicorn installed
    * Configured a server block in proper way
To deploy the app in a server, first test the app in the server:

```bash
$ chmod +x deploy.sh
$ ./deploy.sh
```

If it runs without errors, run the following command to deploy the app in daemon mode.

```bash
$ ./deploy.sh -d
```
Check the [Dockerfile](https://github.com/rednafi/flask-tmplt/blob/master/Dockerfile) and [deploy.sh](https://github.com/rednafi/flask-tmplt/blob/master/deploy.sh) to follow how the deployment works.

repository: manashmandal/flask-template

repo_name: manashmandal/flask-template


text:
# LethalHTA
Repo for our Lateral Movement technique using DCOM and HTA.

For details see our blog post https://codewhitesec.blogspot.com/2018/07/lethalhta.html.

# Repo structure

* CobaltStrike - The CobaltStrike integration of LethalHTADotNet
* DotNet - VisualStudio project for LethalHTADotNet
* Native - VisualStudio project for LethalHTA

repository: codewhitesec/LethalHTA

repo_name: codewhitesec/LethalHTA


text:
Resource Detector

==============
[![Build Status](https://travis-ci.org/settinghead/resource-detector.png)](https://travis-ci.org/settinghead/resource-detector)
[![Gem Version](https://badge.fury.io/rb/resource-detector.png)](http://badge.fury.io/rb/url-identifier)
[![Coverage Status](https://coveralls.io/repos/settinghead/resource-detector/badge.png)](https://coveralls.io/r/settinghead/resource-detector)
[![Dependencies](https://gemnasium.com/settinghead/resource-detector.png?travis)](https://gemnasium.com/settinghead/resource-detector)
[![Code Climate](https://codeclimate.com/github/settinghead/resource-detector.png)](https://codeclimate.com/github/settinghead/resource-detector)

Extract unique resource identifier from commonly-used websites such as YouTube, Blogspot, etc.

Mainly used for duplication prevention.

repository: settinghead/resource-detector

repo_name: settinghead/resource-detector


text:
## ReWeb - a type-safe ergonomic ReasonML and OCaml web framework (WIP)

[![npm](https://img.shields.io/npm/v/@yawaramin/re-web.svg)](https://npmjs.org/package/@yawaramin/re-web)
[![Build Status](https://dev.azure.com/yawaramin/re-web/_apis/build/status/yawaramin.re-web?branchName=main)](https://dev.azure.com/yawaramin/re-web/_build/latest?definitionId=1&branchName=main)
[![Test Status](https://img.shields.io/azure-devops/tests/yawaramin/re-web/4?compact_message)](https://dev.azure.com/yawaramin/re-web/_test/analytics?definitionId=4&contextType=build)

ReWeb is a web framework based on several foundations:

- The amazing work of the people behind
  [Httpaf](https://github.com/inhabitedtype/httpaf),
  [H2](https://github.com/anmonteiro/ocaml-h2), [Esy](https://esy.sh/),
  and others
- The core idea of
  ['Your server as a function'](https://monkey.org/~marius/funsrv.pdf)
  by Marius Eriksen which was also the idea behind Twitter's Finagle web
  stack
- Jasim Basheer's essay
  ['Rails on OCaml'](https://protoship.io/blog/rails-on-ocaml/) which
  identifies the need for an ergonomic, Rails-like web framework that
  still preserves the type safety benefits of OCaml.

ReWeb's main concepts are:

- Services: a service is a function from a request to a promise of
  response (i.e. an asynchronous function).
- Filters: a filter is a function that takes a service as input and
  returns a service as output. It can be inserted into the 'request
  pipeline' and manipulate the request before the service finally
  handles it.
- Server: a server is a function that takes a route (pair of HTTP method
  and path list) as input and returns a service as output.
- Type-safe request pipeline: requests have a type parameter that
  reveals their 'context' i.e. some data that's stored inside them.
  Filters and services must change requests correctly and in the right
  order, or the compiler will present type errors.

Notice that all the main concepts here are just functions. They are all
composeable using just function composition. Services can call other
services. Filters can slot together by calling each other. Servers can
delegate smaller scopes to other servers. See `bin/Main.re` for examples
of all of these.

## Documentation

- [API Reference](https://yawaramin.github.io/re-web/re-web/ReWeb/index.html)
- [User's Manual](https://yawaramin.github.io/re-web/re-web/ReWeb__Manual/index.html)

## Examples

### Fullstack Reason

Check out the demo repo which shows a fullstack Reason setup with ReWeb
and ReasonReact, with code sharing:
https://github.com/yawaramin/fullstack-reason/

This repo can be cloned and used right away for a new project.

### Bin directory

Finally, check out the example server in the `bin/` directory. The
`Main.re` file there has extensive examples of almost everything ReWeb
currently supports.

Run the example server:

    $ esy bin

Send some requests to it:

    $ curl localhost:8080/hello
    $ curl localhost:8080/auth/hello
    $ curl --user 'bob:secret' localhost:8080/auth/hello

Go to http://localhost:8080/login in your browser, etc.

## Try

You need Esy, you can install the beta using [npm](https://npmjs.com):

    $ npm install --global esy@latest

Then run the `esy` command from this project root to install and build dependencies.

    $ esy

Now you can run your editor within the environment (which also includes merlin):

    $ esy $EDITOR
    $ esy vim

Alternatively you can try [vim-reasonml](https://github.com/jordwalke/vim-reasonml)
which loads esy project environments automatically.

After you make some changes to source code, you can re-run project's build
again with the same simple `esy` command.

    $ esy

Generate documentation:

    $ esy doc
    $ esy open '#{self.target_dir}/default/_doc/_html/index.html'

Shell into environment:

    $ esy shell

Run the test suite with:

    $ esy test

## Warning

ReWeb is experimental and not for production use! I am still ironing out
the API. But (imho) it looks promising for real-world usage.

repository: yawaramin/re-web

gha_language: OCaml

repo_name: yawaramin/re-web


text:
# IMGThelper

IMGThelper is a naive R6 R package that interacts with a IMGT results folder.
The package is split into two logical parts, one population based that tries to enlighten the user about the features
of the given VDJ analysis (focusing on mouse heavy chain segments) and a more general usage single cell part.

The population based approach can (hopefully) be used to reproduce the figures in Stijn's paper.

The single cell approach should later on help to integrate IMGT data into a single cell analysis using my BioData::SingleCells R class.

# Install

The package is under heavy development and I strongly discurrage a usage of the package.

To install the package I recommend the devtools R package:

```{R}
  #install.packages(c('devtools'))
  library(devtools)
  install_github( 'stela2502/IMGThelper', ref='master')
```


text:
# Set up direct data transfer for mobile apps {#concept_kxc_brw_5db .concept}

## Background {#section_udp_qrw_5db .section}

In the era of mobile Internet, mobile apps upload more and more data every day. By handing off their data storage issues to OSS, developers can focus more on their app logic.

This article describes how to set up an OSS-based direct data transfer service for a mobile app in 30 minutes. Direct data transfer is a service that allows a mobile app to directly connect to OSS for data upload and download, while only sending the control traffic to the app server.

## Advantages {#section_gl2_srw_5db .section}

Setting up an OSS-based direct data transfer service for a mobile app offers the following advantages:

-   More secure upload/download method \(temporary and flexible permission assignment and authentication\).
-   Low cost. Fewer app servers. The mobile app is directly connected to the cloud storage and only the control traffic is sent to the app server.
-   High concurrency and support for a massive amount of users \(OSS has massive bandwidth for uploading and downloading use\).
-   Elasticity \(OSS’s storage space can be expanded unlimitedly\).
-   Convenience. You can easily connect to the MTS -video multiport adapter, Image Service, CDN download acceleration, and other services.

The architecture diagram is as follows:

![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/4399/6269_en-US.png)

Details:

-   Android/iOS mobile app, which is the app installed on the end user's mobile phone.
-   OSS, short for Alibaba Cloud Object Storage Service, which stores app-uploaded data. For more information, see [OSS description on Alibaba Cloud website](http://www.aliyun.com/product/oss).
-   RAM/STS, which generates temporary access credentials.
-   App server, which is the background service developed for the Android/iOS mobile app and used to manage the tokens used for data uploading/downloading by the app and the metadata of the app-uploaded data.

## Steps: {#section_cyl_rsw_5db .section}

1.  Request for a temporary upload credential from the app server.

    The Android/iOS app cannot store AccessKeyID/AccessKeySecret directly, which may cause the risk of information leakage. Therefore, the app must request a temporary upload credential \(a token\) from the app server. The token is only valid for a certain period. For example, if a token is set to be valid for 30 minutes \(editable by the app server\), then the Android/iOS app can use this token to upload/download data to/from the OSS within the next 30 minutes. 30 minutes later, the app must request a new token to upload/download data.

2.  The app server checks the validity of the preceding request and then returns a token to the app.
3.  After the cell phone receives this token, it can upload or download data from the OSS.

This article mainly describes the content in the red circle and blue circle of the following figure.

![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/4399/6270_en-US.png)

-   The blue circle shows how the app server generates a token.
-   The red circle shows how the Android/iOS app receives the token.

## Prerequisites for setting up direct data transfer service {#section_x15_j5w_5db .section}

Preparations for setting up direct data transfer service:

1.  [Activate the OSS service](../../../../intl.en-US/Quick Start/Sign up for OSS.md#) and [create a bucket](../../../../intl.en-US/Developer Guide/Manage buckets/Create a bucket.md#).
2.  Activate the STS service.
    1.  Log on to the [OSS console](https://oss.console.aliyun.com/).
    2.  On the OSS **Overview** page, find the Basic Settings area, and click **Security Token**, as shown in the following figure.

        ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/4399/6271_en-US.png)

    3.  Enter the Quick Security Token Configuration page.

        **Note:** If RAM has not yet been activated, a prompt box to activate RAM appears. Click **Activate** and perform real-name verification. After the verification is finished, the following page appears. Click **Start Authorization**.

        ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/4399/6272_en-US.png)

    4.  The system performs authorization automatically. Be sure to save the parameters in the three red boxesoxes in the following figures. Click **Save Access Key Information** to close the dialog box and complete STS activation.

        ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/4399/6273_en-US.png)

        ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/4399/6274_en-US.png)

    5.  If you have already created an AccessKeyId/AccessKessKeySecret, the following prompt window appears:

        ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/4399/6275_en-US.png)

        -   Click **View**, as shown in the following figure.

            ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/4399/6276_en-US.png)

        -   Click **Create Access Key**, as shown in the following figure.

            ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/4399/6277_en-US.png)

        -   Record parameters 1, 2, and 3, as shown in the following figure.

            ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/4399/6278_en-US.png)

            ![](http://static-aliyun-doc.oss-cn-hangzhou.aliyuncs.com/assets/img/4399/6279_en-US.png)

        -   Once you have saved the three parameters, STS activation is complete.

## Set up an app server {#section_otj_v1x_5db .section}

Configuration of sample app server

**Note:** The app in this example is written in PHP. You may write your app in your preferred language, e.g. Java, Python,  Go, Ruby, Node.js, or C\#.

This tutorial provides development sample programs available for download in multiple languages. The download addresses are shown at the end of this article.

The downloaded package in each language contains a configuration file named config.json.

```
{
"AccessKeyID" : "",
"AccessKeySecret" : "",
"RoleArn" : "",
"TokenExpireTime" : "900",
"PolicyFile": "policy/all_policy.txt"
}
```

**Note:**

-   1.  AccessKeyID: Set it to parameter 1 marked with a red box in the preceding figure.
2.  AccessKeySecret: Set it to parameter 2 marked with a red box in the preceding figure.
3.  RoleArn: Set it to parameter 3 marked with a red box in the preceding figure.
4.  TokenExpireTime: indicates the expiration time of the token obtained by the Android/iOS app. The minimum value is 900s. The default value can be retained.
5.  PolicyFile: indicates the file that lists the permissions the token grants. The default value can be retained.

This document has provided three token files defining the most common permissions in the policy directory. They are:

-   all\_policy.txt: specifying a token that grants permissions to create or delete a bucket, or upload, download, or delete a file for this account .
-   bucket\_read\_policy.txt: specifying a token that grants permission to read the specified bucket for this account.
-   bucket\_read\_write\_policy.txt: specifying a token that grants permission to read and write the specified bucket for this account.

If you want to create a token to grant read and write permissions for the specified bucket, replace $BUCKET\_NAME in the bucket\_read\_policy.txt and  bucket\_read\_write\_policy.txt files with the name of the specified bucket.

-   Explanation of the formats of returned data:

    ```
    //Correct result returned
    {
        "StatusCode":200,
        "AccessKeyId":"STS. 3p***dgagdasdg",
        "AccessKeySecret":"rpnwO9***tGdrddgsR2YrTtI",
       "SecurityToken":"CAES+wMIARKAAZhjH0EUOIhJMQBMjRywXq7MQ/cjLYg80Aho1ek0Jm63XMhr9Oc5s˙∂˙∂3qaPer8p1YaX1NTDiCFZWFkvlHf1pQhuxfKBc+mRR9KAbHUefqH+rdjZqjTF7p2m1wJXP8S6k+G2MpHrUe6TYBkJ43GhhTVFMuM3BZajY3VjZWOXBIODRIR1FKZjIiEjMzMzE0MjY0NzM5MTE4NjkxMSoLY2xpZGSSDgSDGAGESGTETqOio6c2RrLWRlbW8vKgoUYWNzOm9zczoqOio6c2RrLWRlbW9KEDExNDg5MzAxMDcyNDY4MThSBTI2ODQyWg9Bc3N1bWVkUm9sZVVzZXJgAGoSMzMzMTQyNjQ3MzkxMTg2OTExcglzZGstZGVtbzI=",
       "Expiration":"2015-12-12T07:49:09Z",
    }
    //Wrong result returned
    {
        "StatusCode":500,
        "ErrorCode":"InvalidAccessKeyId.NotFound",
        "ErrorMessage":"Specified access key is not found."
    }
    ```

    Explanation of correct result returned: \(The following five variables comprise a token\)

    -   StatusCode: The status indicates the result that the app retrieves the token. The app returns 200 for successful retrieval of the token.
    -   AccessKeyId: indicates the AccessKeyId the Android/iOS app obtains when initializing the OSS client.
    -   AccessKeySecret: indicates the AccessKeySecret the Android/iOS app obtains when initializing the OSS client.
    -   SecurityToken: indicates the token the Android/iOS app initializes.
    -   Expiration: indicates the time when the token expires. The Android SDK automatically determines the validity of the token and then retrieves a new one as needed.
    Explanation of wrong result returned:

    -   StatusCode: The status indicates the result that the app retrieves the token. The app returns 500 for unsuccessful retrieval of the token.
    -   ErrorCode: indicates the error causes.
    -   ErrorMessage: indicates the detailed information about the error.

-   Method for running sample code:
    -   For PHP, download and unzip a pack, modify the config.json file, run php sts.php to  generate a token, and deploy the program to the specified address.

    -   For Java \(based on Java 1.7\), after downloading and unzipping a pack,

        Run this commandjava -jar oss-token-server.jar \(port\). If you run java  –jar oss-token-server.jar without specifying a port, the program listens to Port 7080. To change the listening port to 9000, run java –jar  app-token-server.jar 9000. Specify the port number as needed.

## How to upload files from your app to oss {#section_ttc_33x_5db .section}

1.  After setting up the app server, write down the server address, which is `http://abc.com:8080`. Then, replace the app server address in the sample project with this address.
2.  Specify the bucket and region for the upload in the sample apps.
3.  Click **Set** to load the configuration.
4.  Select an image file, set the object name to upload to OSS, and select Upload. Now you can experience the OSS service on Android. Data from the Android app can be uploaded directly to OSS.
5.  After the upload is complete, check that the data is on OSS.

## Explanation of core code {#section_lsy_k3x_5db .section}

OSS initialization

The following explains how to use the Android/iOS SDK to request a token from your app server.

-   Android versions

    ```
    //Initialize an OssService for upload and download.
    public OssService initOSS(String endpoint, String bucket, UIDisplayer displayer) {
        OSSCredentialProvider credentialProvider;
        //Use your own class to retrieve an STSToken.
    //Read the server address from app server controls.
        String stsServer = ((EditText) findViewById(R.id.stsserver)).getText().toString();
        //STSGetter class, encapsulating the way of retrieving data from the app server, must be inherited from the class OSSFederationCredentialProvider. The way that your app retrieves tokens depends on the protocol between the app and the app server.
        if (stsServer .equals("")) {
            credentialProvider = new STSGetter();
        }else {
            credentialProvider = new STSGetter(stsServer);
        }
    //Retrieve the bucket name from the controls.
        bucket = ((EditText) findViewById(R.id.bucketname)).getText().toString();
    //Initialize an OSSClient.
        ClientConfiguration conf = new ClientConfiguration();
        conf.setConnectionTimeout(15 * 1000); // Connection time-out. The default value is 15 seconds.
        conf.setSocketTimeout(15 * 1000); // Socket time-out. The default value is 15 seconds.
        conf.setMaxConcurrentRequest(5); // The maximum number of concurrent requests. The default value is 5.
        conf.setMaxErrorRetry(2); // The maximum number of retry attempts after each failed attempt. The default value is 2.
        OSS oss = new OSSClient(getApplicationContext(), endpoint, credentialProvider, conf);
        return new OssService(oss, bucket, displayer);
    }
    ```

-   iOS version

    ```
    //Initialize an OSSClient instance.
    - (void)ossInit {
        //Construct a credential provider for retrieving STSTokens.
        id<OSSCredentialProvider> credential = [[OSSFederationCredentialProvider alloc] initWithFederationTokenGetter:^OSSFederationToken * {
            //Implement a function to synchronize the STSToken retrieved from the server.
            return [self getFederationToken];
        }];
        //Use endpoint and the credential provider to initialize an OSSClient.
        client = [[OSSClient alloc] initWithEndpoint:endPoint credentialProvider:credential];
    }
    ```

## Retrieve tokens from app server for mobile app {#section_lk1_vbq_g2b .section}

The specific method by which the app gets tokens from the app server must be written into the function `public OSSFederationToken getFederationToken() { }`.

**Note:** you can define the logic for this function; however, the return message must contain this variable: return new OSSFederationToken\(ak, sk, token, expiration\).Here, ak, sk, token, and expiration must be taken from the body of the message returned by the server.

In this example, you can specify the protocol linking the app and app server.

-   Android version

    ```
    public OSSFederationToken getFederationToken() {
        String stsJson;
        OkHttpClient client = new OkHttpClient();
        Request request = new Request.Builder().url(stsServer).build();
        try {
            Response response = client.newCall(request).execute();
            if (response.isSuccessful()) {
                stsJson = response.body().string();
            } else {
                throw new IOException("Unexpected code " + response);
            }
        }
        catch (IOException e) {
            e.printStackTrace();
            Log.e("GetSTSTokenFail", e.toString());
            return null;
        }
        try {
            JSONObject jsonObjs = new JSONObject(stsJson);
            String ak = jsonObjs.getString("AccessKeyId");
            String sk = jsonObjs.getString("AccessKeySecret");
            String token = jsonObjs.getString("SecurityToken");
            String expiration = jsonObjs.getString("Expiration");
            return new OSSFederationToken(ak, sk, token, expiration);
        }
        catch (JSONException e) {
            Log.e("GetSTSTokenFail", e.toString());
            e.printStackTrace();
            return null;
        }}
    ```

-   iOS version

    ```
    NSURL * url = [NSURL URLWithString:STSServer];
    NSURLRequest * request = [NSURLRequest requestWithURL:url];
    OSSTaskCompletionSource * tcs = [OSSTaskCompletionSource taskCompletionSource];
    NSURLSession * session = [NSURLSession sharedSession];
    NSURLSessionTask * sessionTask = [session dataTaskWithRequest:request
                                                completionHandler:^(NSData *data, NSURLResponse *response, NSError *error) {
                                                    if (error) {
                                                        [tcs setError:error];
                                                        return;
                                                    }
                                                    [tcs setResult:data];
                                                }];
    [sessionTask resume];
    // Implementation of this callback must be synchronized with the returned token, so the task waitUntilFinished is necessary.
    [tcs.task waitUntilFinished];
    if (tcs.task.error) {
        // If the network request fails, the return of nil indicates the token cannot be retrieved. In this case, this OSS request fails.
        return nil;
    } else {
        // Parse the JSON string returned to the network request to get each token field and return an STSToken.
        NSDictionary * object = [NSJSONSerialization JSONObjectWithData:tcs.task.result
                                                                options:kNilOptions
                                                                  error:nil];
        OSSFederationToken * token = [OSSFederationToken new];ni
        token.tAccessKey = [object objectForKey:@"AccessKeyId"];
        token.tSecretKey = [object objectForKey:@"AccessKeySecret"];
        token.tToken = [object objectForKey:@"SecurityToken"];
        token.expirationTimeInGMTFormat = [object objectForKey:@"Expiration"];
        return token;
    }
    ```

## Download source code {#section_evy_x3x_5db .section}

Example program

-   Sample app source code for Android: [download address](https://github.com/aliyun/aliyun-oss-android-sdk?spm=a2c4g.11186623.2.9.FXb5vt)
-   Sample app source code for iOS: [download address](https://github.com/aliyun/aliyun-oss-ios-sdk?spm=a2c4g.11186623.2.10.FXb5vt)

Download sample code of app server

-   PHP: [download address](http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/31920/cn_zh/1510638617750/sts-server.zip?spm=a2c4g.11186623.2.11.FXb5vt&file=sts-server.zip)
-   Java: [download address](http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/31920/cn_zh/1510638794201/AppTokenServerDemo.zip?spm=a2c4g.11186623.2.12.FXb5vt&file=AppTokenServerDemo.zip)
-   Ruby: [download address](http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/31920/cn_zh/1510645887259/sts-app-server-master.zip?spm=a2c4g.11186623.2.13.FXb5vt&file=sts-app-server-master.zip)
-   node.js: [download address](http://docs-aliyun.cn-hangzhou.oss.aliyun-inc.com/assets/attach/31920/cn_zh/1510647848681/sts-app-server-node.zip?spm=a2c4g.11186623.2.14.FXb5vt&file=sts-app-server-node.zip)

url: https://raw.githubusercontent.com/Hello-hao/oss/8fd9ccf33e80e8a0ff3db0dfdfff0613097cc9bd/intl.en-US/Best Practices/Application server/Set up direct data transfer for mobile apps.md

repository: Hello-hao/oss

repo_name: Hello-hao/oss


text:
# mp4-transcribe-watson

## Purpose
Command–line utility to create an IBM Watson Speech to Text transcript from a video file.

## Compatibility
This script has been tested on Mac OS 10.13 (High Sierra) with the following utilities installed. Here are the high-level system configuration steps:

1. Install the [Homebrew package manager](https://brew.sh).
2. Run `brew install ffmpeg`.

## How to install this script
The script requires a subscription to the IBM Watson Speech to Text service.  The Watson API issues you a second set of credentials (username, password) that is *different* from your IBM ID.

1. Sign up for the [IBM Watson speech-to-text](https://www.ibm.com/watson/services/speech-to-text/) API service.
2. Write down the generated `username` and `password` credentials for the Watson service.
3. Create a local clone of this repository.

## How to use this script
1. Copy an MP4 video file into the same directory as this script.
2. Run `./mp4-transcribe-watson.sh -i <video_file_name>`, where `video_file_name` is your source video file.
3. Review the `response.json` file to see the transcription results.

## License
Review the [license](LICENSE) before you clone this repository.


text:
# Financial Planner

This application estimates a person's first social security benefits check given a birthdate, current income, and projected claim date.

## Getting Started

These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.

### Prerequisites

```
ruby 2.3.1
bundler 1.14.6
rails 5.0.2
```

### Installing
From the command terminal, clone the repository to your local directory...
```
$ git clone https://github.com/izzydoesit/financial_planner.git
$ cd financial_planner
```

Then run bundle command to install all dependencies and run the server.

```
$ bundle install
$ rails server
```
then visit 'localhost:3000' in your browser

## Deployment

You must have Heroku CLI installed and be logged in to Heroku in order to deploy live via Heroku servers (Please see the documentation to get set up with Heroku)

Then, after installation and login, via the command line...
```
$ heroku create
$ git push heroku master
$ heroku open
```

## Built With

* [Ruby on Rails](http://api.rubyonrails.org/) - Primary framework used
* [PostgreSQL](https://www.postgresql.org/docs/) - Database used
* [Bootstrap 4](https://getbootstrap.com) - Library used for styling & layout

## Authors

* **Israel Matos** - [Github](https://github.com/izzydoesit)

## License

This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details


text:
<!-- Please fill in the **bold** fields, submit the pull request and tick the checkboxes. DO NOT SUBMIT ANYTHING IF YOU FAIL ANY OF THIS RULES -->

**[Insert URL to the resource here.]**

**[Explain what this resource is about and why it should be included here.]**

# By submitting this pull request I confirm I've read and complied with the below requirements.

Failure to properly do so will just result in the pull request being closed and everyone's time wasted. Please read it twice. Most people miss many things.

- [ ] I have read the [Contribution guidelines](https://github.com/mr-karan/awesome-investing/blob/master/contributing.md) and I am confident that my PR is suitable.
- [ ] This pull request has a descriptive title. To add a new resource use the title: `Add [resource_name]`
- [ ] The resource link I added is not a duplicate.

repository: vbfelix/awesome-investing

repo_name: vbfelix/awesome-investing


text:
# Sobasquare

##### Simple and beautiful Soba restaurant exploring app

Not sure where to have great soba experience in Tokyo? Well... not anymore!!

## Visit [SOBASQUARE](https://soba.madmak.me)

<img src="https://raw.githubusercontent.com/makotodejima/sobasquare/master/src/images/sbsq01.gif">

### Features

- Simple usage
- Instant search
- Beautiful animation
- Fully responsive
- Locate soba places on Google Maps
- Friendly reviews

### Built with

- [Google Maps API](https://developers.google.com/maps/documentation/)
- [Foursquare API](https://developer.foursquare.com/docs)
- [React](https://github.com/facebook/react)
- [Redux](https://redux.js.org)
- [react-flip-toolkit](https://github.com/aholachek/react-flip-toolkit)
- [react-router](https://github.com/ReactTraining/react-router)
- [scrollreveal](https://github.com/scrollreveal/scrollreveal)
- [styled-components](https://github.com/styled-components/styled-components)
- [Now](https://zeit.co/now)

### What is soba?

- https://en.wikipedia.org/wiki/Soba
- https://www.japan-guide.com/e/e2341.html

### Suggestion for soba place

https://makotodejima.typeform.com/to/nQ0S6u

#### Upcoming features

- Share soba place
- Sorting

repository: makotodejima/sobasquare

gha_language: TypeScript

repo_name: makotodejima/sobasquare


text:
---
published: true
title: '[Floating-point] math is hard'
tags: math float collision
---
> This one gives solid advice and some surprising observations about the tricky subject of comparing floating-point numbers. - [Comparing Floating Point Numbers, 2012 Edition](https://randomascii.wordpress.com/2012/02/25/comparing-floating-point-numbers-2012-edition/) / [HN](https://news.ycombinator.com/item?id=24735824)

-  [Do Developers Understand IEEE Floating Point?](http://pdinda.org/Papers/ipdps18.pdf) / [\[HN\]](https://news.ycombinator.com/item?id=18761944)


text:
# Dejapaw #

![Logo](/images/icon.png)

Dejapaw is a chrome extension, setup a target fields list first, go to web page, and then scrap data one by one.

## install ##

### Deveoper Mode ###

1. Download or fetch this repo.
2. Open `chrome://extensions` page in chrome.
3. Turn `Deveoper Mode` on.
4. Use `Load Unpacked` button (select whole folder).

### Web Store ###

Todo

## Usage ##

Right click extension icon, go to options page.

Setup your fields list.

4 types field means 4 different way do scrap data.

1. string: Select Text By Mouse
2. image: Right Click Image
3. number: Select Number By Mouse
4. clipboard: Press Ctrl/Cmd + v"

set a Webhook you will use it to collecte scraped data.

you can use [PostBin](https://postb.in/) for testing.

Left Click extension icon, a popup will apear.
Red border input show the current scrap field, do scrap action follow the prompt in placeholder.
Fill all filed, you can send a POST request to Webhook url you saved before.

## Tech List ##

1. [Chrome Extensions](https://developer.chrome.com/extensions)
2. [Preact](https://preactjs.com/)
3. [HTM](https://github.com/developit/htm)

repository: loddit/dejapaw

repo_name: loddit/dejapaw


text:
## Project Name <!-- Add your project name here with format "Project Name"-->
Athena Explorer

## Category
<!--developer tooling, application, wallet, infrastructure, etc-->
Application

## Project Description
<!--Describe your project in a few sentences. -->
Athena explorer is a professional storage provider data service tool.

Based on technical algorithms and driven by data, the product provides industry participants with in-depth industry analysis, storage providers analysis, output computing, leading-edge information, and operator screening services with exclusive capabilities that fill gaps in the industry.

## Project Status
<!--brainstorming, fundraising, under development, beta, shipped, etc-->
Athena Explorer has been launched for over one year,  with three major releases and more than 30 minor releases. At present, the product provides a complete, real-time and accurate on-chain data query ability, visual data analysis,  and a number of industry exclusive data plate and node management functions. The core functions of Athena Explorer are described as follows:

1. On-chain data query, which includes node, block, message, deal and so on.

2. Visualization of statistical data, which includes gas, power, output efficiency, pledge.

3. Ecosystem prediction

4. DataCap statistics, including data of DataCap, Notary, client and deals.

5.  The core audiences include industry developers, storage providers, industry researchers and other users. Meanwhile, Filecoin Plus participants are also our target audience, as the Athena explorer now offers DataCap data modules.

## Rough estimated user base (if applicable)
<!--How many users do you have right now?-->

## Github repo
<!--Attach a link to your GitHub repo if it's OSS-->
https://github.com/AthenaExplorer/Profile-and-Update-Points

## Website
<!--Link your website if available-->
https://www.atpool.com/en/

## Docs
<!--Including a link to your project docs!-->

## Team Info
<!-- Introduce your amazing team - how many team members are working on this project and who are they?-->

### Team Size
5

### Team members
1. EXC, product director, responsible for Athena Explorer.

2. Saiya, product manager, responsible for product planning and implementation.

3. July, product operation, work for the operation of Athena Explorer products and users.

4. Zhou, front-end developer, proficient in front-end developing.

5. Gt Tao, back-end developer, familiar with Java, Python and other programming languages.

## How the community can engage

Email<EMAIL_ADDRESS>
Slack: AthenaExplorer

Twitter: AthenaExplorer

WeChat: AthenaExplorer

## How to Contribute
<!--How can the community contribute to your project?-->
Send us email via<EMAIL_ADDRESS>

repository: filecoin-project/community

filename: Athena Explorer.md

repo_name: filecoin-project/community


text:
---
title: Who is at higher risk for serious illness from COVID-19?
category: protect-yourself
layout: post
date: March 23, 2020
source: CDC
promoted: true
source_url: https://www.cdc.gov/coronavirus/2019-ncov/faq.html#anchor_1584386949645
excerpt: How to protect yourself
---

**Older adults and people of any age who have serious underlying medical conditions** may be at higher risk for more serious complications from COVID-19. These people who may be at higher risk of getting very sick from this illness, includes:

* **Older adults**
* People who have serious underlying medical conditions like:
	* Heart disease
	* Diabetes
	* Lung disease

repository: mayonissen/coronavirus-answers

repo_name: mayonissen/coronavirus-answers


text:
# bst
[![Build Status](https://travis-ci.org/rgilbert1/bst.svg?branch=master)](https://travis-ci.org/rgilbert1/bst)

In school, I struggled with how binary search trees (and related data structures & algorithms) work, but now with a little more programming experience under my belt I decided to work through implementing one. It currently has insert, search, and traversal functionality.

## Install

```
pip install bst
```

## Usage

```python
from bst import BST

bst = BST()
bst.insert(5)
node = bst.search(5)  # <bst.Node object at 0x1060964e0>
node.value  # 5
```

## Development

The only dependency is `nose`, it's used to automatically run all of the unit tests in `tests/`. Install dependencies with `pip install -r requirements.txt`, and run the tests with `nosetests -v`.

gha_language: Jupyter Notebook


text:
CDVVideo
===========

Video Player Plugin for Cordova iOS

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

For Cordova CLI -
`cordova plugin add https://github.com/emesonsantana/CDVVideo.git`


text:
sfc
===

Somewhat Flexible Canvas library, hardware-independent, in C++0x/C++11

Introduction
-

Writing a driver for a new display often requires writing a lot of managing code, which is time-consuming and tedious.
This library aims at providing a flexible framework from the canvas level down to the point where you would say
"Hey Display, here is an array of bytes for your graphics RAM".

Current State
-

- Currently only the color class files in /color and a few examples in /color/examples are included

repository: sumotoy/sfc

repo_name: sumotoy/sfc