text:
#USHCN Data Visualizer

A tool that creates images out of USHCN station data.

**Example:** Daily Mean Temperature in Burlington, VT Since 1940

![Daily Mean Temperature in BTV]
(http://i.imgur.com/G7Whq9W.png)

This image shows the daily mean temperature in Burlington Vermont over the last 73 years. The top left of the image is January 1, 1940 and the bottom right is December 31, 2013. The days of the year progress from left to right and the years progress from top to bottom.

For this particular image, the data has been smoothed and the color palette is a qualitative colorbrewer palette.

##Demo

http://mattparrilla.webfactional.com

##To Do

See project [issues](https://github.com/mattparrilla/csv2png/issues)

##`make_image()` Parameters

DISCLAIMER: These are no longer completely accurate. In the process of updating.

`make_image()` takes USHCN station data and turns it into an image.

- `f_n` - the name of the file containing the data (no extension)
- `fill_null` - *a boolean*, should null values be populated by averaging their neighbors?
- `unit` - 'day' or 'month'
- `smooth_horizontal` - *a boolean*, should each value be an average of it and its neighbors (from two days prior to two days after)?
- `smooth_vertical` - *a boolean*, should each value be an average of it and its neighbors (the same day from two years prior to two years after)?
- `palette` - a colorbrewer palette to use
- `bins` - the number of colors to use
- `x_d` - the x-dimension that each individual value will be represented in pixels
- `y_d` - the y-dimension that each individual value will be represented in pixels
- `continuity` - a float between 0 and 1.
This number determines just how continuous the palette looks. If `1`, the palette is perfectly continuous and a data point 50% between bin thresholds will get a color 50% between them. If the factor is `0`, the palette is perfectly discrete and a point 50% between bin thresholds will be set to the lower threshold. If the factor is `0.4` a point 50% between bin thresholds will only be scaled continuously, but on only 40% (0.4) of the difference between the two colors, therefor it would be only 20% of the way from the lower threshold.
- `start_idx` - the day in the year that the image should begin at.
i.e. if `0`, start at Jan 1. If `182` start at July 1, etc.

## Creators

- Matt Parrilla
    - [https://github.com/mattparrilla](https://github.com/mattparrilla)
    - [https://twitter.com/mattparrilla](https://twitter.com/mattparrilla)

- Joe di Stefano
    - [https://github.com/joeydi](https://github.com/joeydi)
    - [https://twitter.com/joeydi](https://twitter.com/joeydi)

## License

The MIT License (MIT)

Copyright (c) 2014 Matt Parrilla, Joe di Stefano

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

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

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

repository: mattparrilla/USHCN-dashboard

repo_name: mattparrilla/USHCN-dashboard


text:
# Givers, Takers, and Matchers.

## Summary

- Notes [Links](Notes.md)
- Documents [Link](./documents)

## Resources

**VIDEOS / PODCAST**

- Are you a giver or a taker? | Adam Grant Source: https://www.youtube.com/watch?v=YyXRYgjQXX0
- Givers, takers, matchers and fakers. https://psychologypodcast.libsyn.com/adam-grant-on-givers-takers-matchers-and-fakers

**DOCUMENTATION**

- Team Lemonade, *" The Surprising Psychology of Givers, Takers, and Matchers"* https://www.lemonade.com/blog/psychology-givers-takers-matchers-2/
- FRANCIS J. FLYNN, "HOW MUCH SHOULD I GIVE AND HOW OFTEN? THE EFFECTS OF GENEROSITY AND FREQUENCY OF FAVOR EXCHANGE ON SOCIAL STATUS AND PRODUCTIVITY". Source: https://pdfs.semanticscholar.org/e8a4/a25cbc7eb591cd16d5c340bd52c8e266cee7.pdf?_ga=2.60995311.211520876.1611610402-580412494.1611610402
-  Eveline Mäthner & Ralf Lanwehr ,  *"Givers, takers and matchers – Reciprocity styles and their contribution to organizational behaviour.*" Source: https://link.springer.com/article/10.1007/s11612-017-0358-6
- Luke treglown, *"The Bright and Dark Side of Altruism: Demographic, Personality Traits, and Disorders Associated with Altruism"*, source: https://www.researchgate.net/publication/274389947_The_Bright_and_Dark_Side_of_Altruism_Demographic_Personality_Traits_and_Disorders_Associated_with_Altruism
-   Giver, taker o matcher: Altruismo, egoísmo o compañerismo, source: https://blog.agirregabiria.net/2019/09/giver-taker-o-matcher-altruismo-egoismo.html
- Raf Weverbergh, "*The network always wins: scientific proof that your PR strategy should focus more on giving and less on taking"*, source: https://www.finn.agency/adam-grant-give-take-reputation-PR-strategy
-  What Can You Say About Your Team? Giver, Taker Or Matcher? https://www.weq.io/post/what-can-you-say-about-your-team-giver-taker-or-matcher
- Adam Grant, *"Givers take all: The hidden dimension of corporate culture"*. Source: https://www.mckinsey.com/business-functions/organization/our-insights/givers-take-all-the-hidden-dimension-of-corporate-culture#
- Adam Grant, "*In the Company of Givers and Takers*". Source: https://hbr.org/2013/04/in-the-company-of-givers-and-takers
- "Beat Generosity Burnout". Source: https://hbr.org/2017/01/beat-generosity-burnout
- "GIVE AND TAKE: A REVOLUTIONARY APPROACH TO SUCCESS BY ADAM GRANT". Source: http://v.fastcdn.co/u/3a1b1cdf/28216922-0-Give-and-Take-by-Ada.pdf
- Sara Katarina Trané, "Give and Take: Validity, Personality Profiling, and Individual Success". Source: https://repository.lib.fit.edu/bitstream/handle/11141/1594/TRANE-DISSERTATION-2017.pdf?sequence=1&isAllowed=y
-  MARIA POPOVA, "Givers, Takers, and Matchers: The Surprising Psychology of Success". Source: https://www.brainpickings.org/2013/04/10/adam-grant-give-and-take/
- "Givers vs. Takers: The Surprising Truth about Who Gets Ahead", source: https://knowledge.wharton.upenn.edu/article/givers-vs-takers-the-surprising-truth-about-who-gets-ahead/

license: MIT

branch_name: refs/heads/main

extension: md

license_type: permissive


text:
# Rust modules explained
![Confusion](woah.jpg)

As I was learning Rust, I was created a project that used multiple libraries and I kept running into exceptions that I could not explain and I had a lot of confusion. I wanted to write something to document my misunderstandings and provide a solution that can be copied for your benefit and maybe increase your understanding.

## References
The documentation on modules and various stack overflow questions and answers led me to believe that adding submodules and re-exporting them should be possible and easy.
* [Rust Book](https://doc.rust-lang.org/book/ch07-00-managing-growing-projects-with-packages-crates-and-modules.html)
* [Rust by Example - Modules](https://doc.rust-lang.org/stable/rust-by-example/mod.html)

# Setup
Create a scenario to demonstrate where misunderstandings of modules and errors are manifesting. The scenario is creating a library that called calls another local library.
* Initialize the modules
  ```bash
  cargo init geometry --lib      # geometry provides common structs, enums, and traits
  cargo init triangles --lib     # triangles implements traits from geometry
  ```
* Added implementations. In this case, the triangles library is trying to use the geometry library so that it can implement traits and use enumerations.
  ```
  ./triangles/src/lib.rs
  ./geometry/src/lib.rs
  ./geometry/src/dims.rs
  ```
## Referencing a local library from another local library
One of the challenges was getting a local library reference in another local library. To solve this I needed to use a path in the Cargo.toml
`triangles/Cargo.toml`
```toml
[package]
name = "triangles"
version = "0.1.0"
edition = "2018"

[dependencies]
geometry = { path = "../geometry" }
```

# Failures
A common failure when developing a library is the `not found in` or `cannont find` errors. I was able to run `cargo build` and `cargo test` without any compilation errors for the geometry library. I then tried to use the geometry module in the triangles library, but I was unable to `use` the traits and enumerations. This resulted in errors like the following:
  ```
  ./triangles$ cargo clean
  ./triangles$ cargo build
     Compiling geometry v0.1.0 (/geometry)
     Compiling triangles v0.1.0 (/triangles)
      Finished dev [unoptimized + debuginfo] target(s) in 0.64s
  ./triangles$ cargo test
     Compiling triangles v0.1.0 (/triangles)

  error[E0405]: cannot find trait `Dimensional` in crate `geometry`
    --> src/lib.rs:14:20
     |
  14 |     impl geometry::Dimensional for Triangle {
     |                    ^^^^^^^^^^^ not found in `geometry`

  error[E0412]: cannot find type `Type` in crate `geometry`
    --> src/lib.rs:15:43
     |
  15 |         fn dimensions(&self) -> geometry::Type {
     |                                           ^^^^ not found in `geometry`
     |
  help: consider importing one of these items
     |
  4  |     use crate::triangles::geometry::dims::dims::Type;
     |
  4  |     use geometry::dims::dims::Type;
     |

  Some errors have detailed explanations: E0405, E0412, E0425.
  For more information about an error, try `rustc --explain E0405`.
  error: could not compile `triangles` due to 4 previous errors
  ```
## Investigating errors with documentation
The errors caused me a lot of confusion in the triangles library. I tried using many 'solutions' which didn't work as I was flailing around trying to fix it by modifying the `use` to prefix with `self::` or `crate::`. This was not the path to take. The correct path was to verify the the geometry module was defined correctly before trying to use it in another library. Fortunately, I discovered an easy way to check if things are exporting as expected is to view the documentation of the library.

```
cd ./geometry
cargo doc --open
```

# Smells and Solutions
## Smell: Empty Documentation
**Smell**: The documentation is completely empty. In this scenario the `src\lib.js` was empty. My misunderstanding was that you can have an empty `lib.js` and another module `./geometry/src/dims.rs` would work.

![Empty lib.js](missing_module.gif)

### Solution 1a: Move the contents to `lib.rs`
The easiest path forward, is to copy the contents of `geometry/src/dims.rs` to `geometry/src/lib.rs` and then delete `geometry/src/dims.rs`.

### Solution 1b: Add [lib] to `Cargo.toml`
If you like things named explicitly, add a `[lib]` section to the `Cargo.toml` to override the default `lib.rs` name. [Configuring [lib]](https://doc.rust-lang.org/cargo/reference/cargo-targets.html#configuring-a-target)
```
[lib]
name = "geometry"
path = "src/dims.rs"
```
![Updated Cargo.toml to use an alternative to lib.rs](docs02.png)

Now the submodule `geometry::dims` can be used in `triangles` library, e.g. `use geometry::dims::{Type,Dimensional};`

## Smell: Module defined in a module
**Smell** I have a module defined in my module and that is not the behavior I wanted. When you look at the documentation modules are defined but I expected my structs, enums, and traits at the root level.

![Unintentional submodule](docs03.png)

![yo dawg](yodawg.jpg)

### Solution 2: Delete `pub mod`
A library project uses `[package] name` in the `Cargo.toml` to be the name of the crate in the documentation and publishes the contents of `src\lib.rs`. Remove the `pub mod` structure inside of the `src\lib.rs` to remove the extra module definition.

![pub mod removed](docs04.png)

Now the submodule `geometry` can be used in `triangles` library, e.g. `use geometry::{Type,Dimensional};`

## Smell: Organization is hard
**Smell**: I want to keep my code separated into files so that it is manageable, but when I export my library I want the API to be flat for the end users.

![order](order.jpg)

### Solution 3: Re-export
Re-exporting allows you to organize your code into multiple files but have it exposed as a single unified API.
* The files are separated and there are separate modules.
```
drwxr-xr-x 2 4096 Sep 25 12:36 ./
drwxr-xr-x 4 4096 Sep 25 09:08 ../
-rw-r--r-- 1  356 Sep 25 12:58 dims.rs
-rw-r--r-- 1   31 Sep 25 12:51 lib.rs
```
* The `geometry/src/lib.rs` is only reexporting the API it wants for the geometry library
```rust
pub mod dims;
pub use dims::{Type,Dimensional};
```

![reexported modules](docs05.png)

The display doesn't look as nice as when you re-export, but the behavior works the same. The submodule `geometry` can be used in `triangles` library, e.g. `use geometry::{Type,Dimensional};` even though `Type` and `Definition` are in the dims module

repository: jaystile/rust-modules-explained

repo_name: jaystile/rust-modules-explained


text:
---
hrs_structure:
  division: '1'
  volume: '4'
  title: '14'
  chapter: '235'
  section: 235-102
type: hrs_section
tags:
  - Government
menu:
  hrs:
    identifier: HRS_0235-0102
    parent: HRS0235
    name: 235-102 Records and special returns
weight: 62545
title: Records and special returns
full_title: 235-102 Records and special returns
---
**§235-102 Records and special returns.** (a) Records. Every person liable to any tax imposed by this chapter or for the collection or deduction thereof at source, shall keep full, complete, regular, and accurate books of account in which all the person's transactions shall be entered in regular order; provided that the director of taxation may, by regulation, provide for the keeping of simpler accounts in cases where, by reason of the smallness of the income or otherwise, undue hardship or expense will be caused by the keeping of full books of account. All books of account required to be kept by this chapter shall be preserved for a period of three years, except that the director may, in writing, consent to their destruction within such period or may require that they be kept longer.

(b) Special returns and statements. Whenever it is necessary, in the judgment of the director, the director may require any taxpayer, or person liable for the collection or deduction of tax at source, by notice served upon the taxpayer or other person, to make such returns or render such signed statements as the director deems sufficient to show whether or not the taxpayer or other person is liable under this chapter. [L Sp 1957, c 1, pt of §2; am L Sp 1959 2d, c 1, §16; am L 1963, c 45, §4(a); Supp, §121-36; [HRS §235-102](/title-14/chapter-235/section-235-102/); am L 1969, c 274, §1; gen ch 1985]

Case Notes

Cited: 33 H. 766.

repository: SamMade/BlueAndKrabby

branch_name: refs/heads/master

repo_name: SamMade/BlueAndKrabby


text:
# Hand Cycle Web

## Getting Started

This is a website developed for project name "[Development of low cost upper and lower extremities rehabilitation system with interactive feedback for children with movement disorders](https://ieeexplore.ieee.org/document/7843556/)", which capable of displaying patient data stored in [Firebase](https://firebase.google.com/) host on the website. This project is developed altogether with a mobile app (Repository: [HandCycleApp](https://github.com/jerrychong25/HandCycleApp)).

## Deployment

Hosted previously on [Byet Internet Services](http://mysight4rehab.byethost9.com/) and presently hosted on https://mysight4rehab.netlify.com/.

## Built With

* [WebStorm](https://www.jetbrains.com/webstorm/)

## Versioning

[Semantic Versioning (SemVer) 2.0.0](http://semver.org/)

## Authors

**Jerry Chong** - [jerrychong25](https://github.com/jerrychong25)

## License

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

gha_language: Vue

gha_license_id: MIT


text:
**This project has been archived in favor of https://github.com/SammyIsra/SammyPortfoliov2.**

Read details [here](https://github.com/SammyIsra/SammyPortfolio/issues/13#issuecomment-472271318).

----
# Sammy's Portfolio
### Stuff to remember:
Production website is deployed to
[sammyis.me](https://sammyis.me)

Website is rebuilt and redeployed every time there's a commit to `master` using Netlify (I <3 Netlify)

Demo is deployed to [sammyis-gdemo.surge.sh](https://sammyis-gdemo.surge.sh) manually, via the NPM script `npm run demploy:demo`. Demo website is hosted in Surge (without any forced HTTPS, btw)

Website is built on GatsbyJS

repository: SammyIsra/SammyPortfolio

gha_language: JavaScript

repo_name: SammyIsra/SammyPortfolio


text:
### Files Structure

```
src/
    assets/
    components/
        CustomComponent.jsx
    helpers/
        utilities.js
    service/
        callServices.js
    views/
        SectionName/
            Home.jsx
            _home.scss
```

**Note:** The name of the Root Component section should be equals as folderName e.x SectionName = Home and component = Home.jsx

### Practices to adopt

-   Split into folders outside the src according to responsibility

#### React Hooks

-   https://reactjs.org/docs/hooks-intro.html

#### css-bliss

-   https://github.com/gilbox/css-bliss

-   http://gilbox.github.io/css-bliss/walkthrough/release/

#### Single Responsibility Principle - One reason to change

-   https://blog.bitsrc.io/tiny-components-what-can-go-wrong-d6aa42d71370

-   https://blog.usejournal.com/how-to-apply-solid-principles-in-react-applications-6c964091a982

repository: angelbrunn/pokedex-ui

repo_name: angelbrunn/pokedex-ui


text:
# Audio Core

This is the core of the audio system. It implements the core FIDL APIs
fuchsia.media.AudioCapturer and fuchsia.media.AudioRenderer. At a high level,
audio core is organized as follows:

```plain
+---------------------+        +---------------------+
|   AudioRenderers    |        |    AudioCapturers   |
| r1   r2   ...   rN  |        | c1   c2   ...   cN  |
+---\---|----------|--+        +--Λ---ΛΛ-------------+
     \  |          |      +-------+  / |
      \ |          |   loopback     /  |
+------VV----------V--+   |    +---/---|-------------+
| o1   o2   ...   oN--+---+    | i1   i2   ...   iN  |
|    AudioOutputs     |        |     AudioInputs     |
+---------------------+        +---------------------+
```

The relevant types are:

*   AudioRenderers represent channels from applications that want to play audio.
*   AudioCapturers represent channels to applications that want to record audio.
*   AudioOutputs represent hardware outputs (speakers).
*   AudioInputs represent hardware inputs (microphones).

To control output routing, we use an enum called an AudioRenderUsage, which has
values like BACKGROUND, MEDIA, COMMUNICATION, etc. We maintain a many-to-one
mapping from AudioRenderUsage to AudioOutput, then map AudioRenderers to
AudioOutputs based on this type. For example, if two AudioRenderers `r1` and
`r2` are created with AudioRenderUsage MEDIA, they are both routed to the
AudioOutput assigned to MEDIA (`o2` in the above graph).

Input routing works similarly, using a type called AudioCaptureUsage.
Additionally, special "loopback" inputs are routed from AudioOutputs.

## Output Pipelines

At each AudioOutput, an OutputPipeline controls the mixing of input streams into
a single output stream. This mixing happens in a graph structure that combines
MixStage nodes (which mix multiple input streams into a single output) and
EffectsStage nodes (which apply a sequence of transformations to an input
stream). MixStage nodes also perform basic transformations: source format
conversion, rechannelization, sample rate conversion, gain scaling, and
accumulation. Gain scaling can be configured at both a per-stream level
(per-AudioRenderer) and a per-AudioRenderUsage level (usually corresponding to
volume controls on the device).

For example, the following graph illustrates an OutputPipeline created for four
renderers, three of which (r1, r2, r3) are mixed first because they share the
same AudioRenderUsage.

```plain
     r1  r2  r3
     |   |   |
  +--V---V---V---+
  |  m1  m2  m3  |
  |   MixStage   |
  +------|-------+
         |
  +------V-------+
  | EffectsStage |
  | 1. high pass |
  | 2. compress  |
  +---------\----+   r4
             \       |
           +--V------V---+
           |   m1    m2  |
           |   MixStage  |
           +------|------+
                  V
                device
```

If loopback capability is enabled for the given device, then a specific pipeline
stage can be designated as the loopback stage. For example, if certain
hardware-specific effects should not be included in the loopback stream, the
loopback stream can be injected at an early stage before the final output is
sent to the device.

## Input Pipelines

There is no complex processing in AudioCapturers other than a simple mixer to
merge multiple inputs.

repository: china-liweihong/fuchsia

repo_name: china-liweihong/fuchsia


text:
# traffic-sign-recognition
Traffic Sign Classifier - Udacity Self-Driving Car Engineer Nanodegree.

The purpose of this project is to classify images of German traffic signs using convolutional neural network.

### Environment setup ###
Tensorflow 0.12 and above for neural network training and evaluation. Detailed instructions are [here](https://github.com/udacity/CarND-Term1-Starter-Kit.git).

[Tensorflow](https://www.tensorflow.org/install/) 1.3 and above for dataset preprocessing and training data augmentation.

### How to use ###
* Download training data. Open *raw_data* folder for instructions.
* Run *datasetProcessor.ipynb* in order to create augmented dataset for neural network training.
* There is an option to download already processed dataset and skip steps 1 and 2. Please open *train_data* folder for instructions.
* There is an additional evaluation stage based on images from the Internet. Make sure that the folder *test_data* is populated with *pickle* files.
* Execute *signClassifier.ipynb* and load data, train neural network, and evaluate its accuracy.
* Additional analisys of neural network internals may be performed via *tensorboard*. Please, open *support* folder for instructions.

Folder *report* contains a report describing convolutional neural network architecture used in this project.

The accuracy:
* validation dataset - 0.96
* test dataset - 0.94
* images from internet - 0.6

Tipical Accuracy:

![](https://github.com/antonpavlov/traffic-sign-recognition/blob/master/support/readme_images/accuracy.png)

Cross entropy:

![](https://github.com/antonpavlov/traffic-sign-recognition/blob/master/support/readme_images/xent.png)

### License ###
All Jupyter notebooks and tensorboard data are distribuited with MIT license. Tensorflow is a framework developed by Google and open-source community. Please, refer to tensorflow.org web site for license terms.

### References ###
This work is hevaly based on the floowing article:
Pierre Sermanet and Yann LeCun: **"Traffic Sign Recognition with Multi-Scale Convolutional Networks,"** Proceedings of International Joint Conference on Neural Networks (IJCNN'11), 2011. http://yann.lecun.com/exdb/publis/index.html

repository: antonpavlov/traffic-sign-recognition

repo_name: antonpavlov/traffic-sign-recognition


text:
### [CVE-2009-0476](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-0476)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

Stack-based buffer overflow in MultiMedia Soft AdjMmsEng.dll <IP_ADDRESS> and <IP_ADDRESS>, as distributed in multiple MultiMedia Soft audio components for .NET, allows remote attackers to execute arbitrary code via a long string in a playlist (.pls) file, as originally reported for Euphonics Audio Player 1.0.  NOTE: some of these details are obtained from third party information.

### POC

#### Reference
- https://www.exploit-db.com/exploits/7958
- https://www.exploit-db.com/exploits/7973
- https://www.exploit-db.com/exploits/7974

#### Github
No PoCs found on GitHub currently.

repository: trickest/cve

gha_language: HTML

repo_name: trickest/cve


text:
# midicat

[![Gem Version](https://badge.fury.io/rb/midicat.svg)](http://badge.fury.io/rb/midicat)

cat/tailf for MIDI input events, built upon UniMIDI

![demo screen](./demo.gif)

## Installation

Install it yourself as:

    $ gem install midicat

## Usage

Just execute

```
$ midicat
```

after installing it

note: you should have gem executables directory in `$PATH` (`gem env gempath` shows the path to append your `$PATH`)

## Contributing

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

repository: polamjag/midicat

repo_name: polamjag/midicat


text:
# Install from the source code
```
  sudo apt-get -y install build-essential libssl-dev libpcre3-dev
  wget http://nginx.org/download/nginx-1.12.0.tar.gz
  tar xf nginx-1.12.0.tar.gz
  cd nginx-1.12.0
  sudo ./configure
  sudo make -j
  sudo make install
```

# Understand the source code
Here are two useful Chinese blogs (sorry it's in Chinese):
* [blog1](https://www.cnblogs.com/muhy/p/10528543.html)
* [blog2](https://blog.csdn.net/weixin_43844810/article/details/90639433)

# Configure NGINX to its max performance

  * Here is a useful [link](http://nginx.org/en/docs/beginners_guide.html)
  * Configure CPU affinity: `worker_cpu_affinity` in *nginx.conf*
  * Configure [thread pool](http://nginx.org/en/docs/ngx_core_module.html?&_ga=1.68296344.843168382.1477489692%23accept_mutex) to make syscalls non blocking
  * [Open file cache](https://serverfault.com/questions/460275/how-to-choose-a-correct-value-for-open-file-cache-in-nginx-configuration) to cache file descriptors (This seems outdated. It may not be necessary for newer versions of NGINX).
  * Too many open files? Add `worker_rlimit_nofile number` in *nginx.conf*. See this [link](https://gist.github.com/joewiz/4c39c9d061cf608cb62b).
  * Change `ulimit -n` to allow more concurrent open files.
  * Another useful [link](https://www.slashroot.in/nginx-web-server-performance-tuning-how-to-do-it)

# NGINX dataset
We configure NGINX to a static web engine. To generate random html files as NGINX's dataset, run the following command in bash (the example generates 800 160B files):
`for n in 160; do mkdir -p $n && for i in {0..800}; do perl gen_html.pl $n > $n/$i.html; done; done`

repository: minlno/PARTIES

repo_name: minlno/PARTIES


text:
Test: empty region

<?code-excerpt "basic.dart (greeting)" title?>
```dart
var greeting = 'hello';
var scope = 'world';
```

The full file, because an empty region overrides the parenthetical remark in the path/title:
<?code-excerpt "basic.dart (greeting)" region="" title?>
```dart
var greeting = 'hello';
var scope = 'world';

void main() => print('$greeting $scope');
```

repository: dart-lang/site-shared

gha_language: Dart

repo_name: dart-lang/site-shared


text:
# Ansible Role: Backup MySQL databases to AWS S3 via Docker container

An Ansible role to backup MySQL databases to AWS S3 via a Docker container. This role uses the [iainmckay/mysql-backup](https://hub.docker.com/r/iainmckay/mysql-backup/) docker image.

See also [opichon.docker-mysql](https://galaxy.ansible.com/opichon/docker-mysql/)

## Requirements

This role requires Ansible 1.2 or higher.

It also requires the Docker engine to run on the target host.

## Role variables

Ansible variables are listed below with their default values.

```
mysql_backup_command: backup
mysql_backup_aws_access_key_id
mysql_backup_aws_secret_access_key
mysql_backup_aws_region
mysql_backup_host
mysql_backup_user
mysql_backup_password
mysql_backup_s3_bucket
mysql_backup_s3_path
```

For the meaning of these variables, see the documentation of the [iainmckay/mysql-backup](https://hub.docker.com/r/iainmckay/mysql-backup/) docker image.

## Example playbooks

```
---
- 	hosts: mysql_server
	roles:
		- name: Backup db1 and db2 databases
		  role: opichon.mysql-backup
		  mysql_backup_command: backup db1 db2
```

```
---
- 	hosts: mysql_server
	roles:
		- name: Restore db1 and db2 databases
		  role: opichon.mysql-backup
		  mysql_backup_command: restore db1 db2
```

## License

MIT

repository: opichon/ansible-mysql-backup

repo_name: opichon/ansible-mysql-backup


text:
# Beta calibration - R package

This package provides a beta_calibration function which allows the user to fit any of our three proposed beta calibration models.

## Usage

* The package is available from CRAN, so it can be installed by typing _install.packages("betacal")_.
* Once it's installed, import it by calling _library("betacal")_.

## License

MIT

repository: REFRAME/betacal

repo_name: REFRAME/betacal


text:
# Example data set
This folder contains an example toy data set (dataset-row.tsv). Each row of the data set contains interactions of a single user:

    user_a interaction_1 interaction_2 interaction_3...
    user_b interaction_1 interaction_2 interaction_3...
    ...

An alternative input format consists of three columns (dataset-column.tsv):

    item_a item_b score
    item_a item_c score

where score might denote the times two items have been interacted with together.

In this toy data set items with a single digit id, are interacted with together more often than items with two digits. In other words items with a single digit id are more similar to each other than those with two digits.

# Preprocess
Let's randomly shuffle and split our data set into a train and test set

    > make preprocess OPTIONS=example/options.txt

This step will generate three new files.
- dataset-row.tsv-shuffled: the data set where the rows have been randomly shuffled
- trainset.tsv: ~70% of the data set for training
- testset.tsv: ~30% of the data set for testing

# Train
Let's train the model using the newly created train and test splits.

    > make train OPTIONS=example/options.txt

This step will read in the train set and additional features per item (features.txt) and produce embeddings (XXX_embeddings.tsv) for each item.

# Predict

Finally we'll predict the test set using the trained embeddings

    > make predict OPTIONS=example/options.txt

This will display the most similar items for a given list of example items:

    > Similar items for 1: 1,4,6,3,5,2,10,50,40,60

Have a look at the [options.txt](options.txt) file which contains all relevant options for the above tasks.

repository: ozgurdemir/item-item-factorization

repo_name: ozgurdemir/item-item-factorization


text:
### [CVE-2010-4670](https://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-4670)
![](https://img.shields.io/static/v1?label=Product&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Version&message=n%2Fa&color=blue)
![](https://img.shields.io/static/v1?label=Vulnerability&message=n%2Fa&color=brighgreen)

### Description

The Neighbor Discovery (ND) protocol implementation in the IPv6 stack on Cisco Adaptive Security Appliances (ASA) 5500 series devices with software 8.2(3) and earlier, and Cisco PIX Security Appliances devices, allows remote attackers to cause a denial of service (CPU consumption and device hang) by sending many Router Advertisement (RA) messages with different source addresses, as demonstrated by the flood_router6 program in the thc-ipv6 package, aka Bug ID CSCti24526.

### POC

#### Reference
- http://www.youtube.com/watch?v=00yjWB6gGy8

#### Github
No PoCs found on GitHub currently.


text:
Welcome to the elm-lang.org README!
-----------------------------------

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

See INSTALL for installation instructions

How do I run user experiments?
==============================

After installing elm, elm-server, and building the executable, and
running ./run-elm-server, navigate to one of the following URLs to
see the user experiment interface in action:

* Elm task: http://<IP_ADDRESS>:8000/edit/task/MovingBox.elm
* JS task : http://<IP_ADDRESS>:8000/_edit/task/MovingBox.js

By default, clicks that occur in the code pane are saved to this
json file:

`https://sweltering-fire-9141.firebaseio.com/dissertation.json`

*See the section 'How do I save to my own Firebase?' for
customisation*

If you  write your own tasks, visiting `/edit/<path/to/task>` will
populate the click database elm directory with click data as you use
it, for your task.

Furthermore, appending `?p=<participant-id>` allows you to annotate
the data with the particular participant performing those clicks.

If you host the elm environment on a server on the Internet, you can
send the link to your tasks to participants with a separate participant ID.

Example:

`http://my.server.com:8000/edit/task/MyTask.elm?p=42`

Send that to participant 42 and the firebase database will save to

`https://sweltering-fire-9141-firebaseio.com/dissertation/elm/42.json`

How do I visualise the click data?
==================================

Navigate to the root directory where the elm-lang.org was installed

`$ cd elm-lang.org/`

then open `EmbedMe.elm` with your favourite text editor, and
uncomment the line:

`-- main = lift2 scene Window.dimensions Mouse.position`

by removing the `-- ` (`--` is a comment in Elm)

How do I save to my own Firebase (or other Database)
====================================================

Currently, EmbedElm only supports databases with a
RESTful API.

If you have a databse with a RESTful API, do as follows:

As in the section "How do I visualise the click data?", open
`EmbedMe.elm` and change
`https://sweltering-fire-9141-firebaseio.com/` to your own
personal database.

You must also modify the same URL in
`elm-lang.org/server/Server.hs`. Go to the function `embedee`
and where the variable `visualiser` is defined:

	visualiser =
	  concat [ "var firebaseData = new Firebase('"
	         , "http://sweltering-fire-9141.firebaseio.com/"
		 , "dissertation/
		 , langStr
        ...

and change the URL to your own.

How do I add support for my own languages?
==========================================

Currently, the IDE only supports Elm and Javascript, but if you are
feeling adventurous, and would like to add support for more, you will
need to modify at least the following code:

* The `data Lang` type constructor

* All functions with Lang in the type signature, e.g.

   `embedee :: Lang -> String -> String -> H.Html`

* The URL routing in `elm-lang.org/server/Server.hs`, e.g.

   ~~~~~~~~~~{.haskell}
   main = do
      ...
      <|> route [ ("try", serveHtml Editor.empty)
                , ("edit", edit Elm)
   	     , ("_edit", edit Javascript)
   	     , ("__edit", edit MyLanguage)
   	     , ("code", code Elm)
   	     , ("_code", code Javascript)
   	     , ("__code", code MyLanguage)
   	     , ("compile", compile Elm)
   	     , ("_compile", compile Javascript)
   	     , ("__compile", compile MyLanguage)
   ...
   ~~~~~~~~~~~~~~~~~~~~

repository: spanners/dissertation

repo_name: spanners/dissertation


text:
# Chimyra

A tool for managing JavaScript projects with bundled internal dependencies.

## About

Similar to [Lerna](https://github.com/lerna/lerna), Chimyra helps manage a
[monorepo](https://github.com/babel/babel/blob/master/doc/design/monorepo.md)
based project. However, it's geared towards being independent of a registry
without resorting to git subtree branching. It does this by generating local
tarballs with `npm package` on the fly when installing dependencies for
production deployment. This way, the package can be distributed without needing
to copy the entire monorepo.

### What a monorepo using Chimyra will look like:

```
my-project-repo/
  package.json
  apps/
    app-1/
      package.json
    app-2/
      package.json
  packages/
    library-1/
      package.json
    library-2/
      package.jon
```

The apps can depend on packages and use them as bundled dependencies.

There are 4 major chimyra commands:

_Note: `chi` and `chimyra` are interchangeable_

`chi dev` - bootstrap local packages by linking them together, and install
foreign packages, for development.

`chi prepare` - when run inside of an app folder, prepare an app for deployment,
by packaging the dependencies at the defined version. Can be used as `prepare`
in `package.json` `scripts`.
  * TODO: also update the `package-lock.json` or `npm-shrinkwrap.json` to
    manually dedupe our local packages, and then run `npm i` again which will
    remove the duplicate once it's been removed from the shrinkwrap or lock. Or
    just manually remove the folder, as once the lock/shrinkwrap has been
    updated, it won't try to add it back until deps change in some other way.

`chi update` - Interactively update dependency versions. Automatically runs `chi
prepare` after dependencies are up to date.

`chi version` - bump the version of an application or library, and tags the
release. If the dependency versions defined in the package.json aren't at the
current version as the packages in the repo, fails, and requires `chi update` or
re-run using a flag to continue.

## Details

In the `package.json`, instead of defining the version of the package in
`dependencies` / `devDependencies`, chimyra introduces a `localDependencies`
field. `d(evD)?ependencies` will use a path to a tarball, and localDependencies
specifies the version identifier according to semver.

repository: forivall/chimyra

branch_name: refs/heads/latest

gha_language: TypeScript

repo_name: forivall/chimyra


text:
# version 1.0	initial version

Copyright (c) 2017 Paul van Haastrecht<EMAIL_ADDRESS>

## Background
The MLX90615 is like an Infra_Red ( I.R.) temperature sensor. Having seen a commercial IR temperature meter, I wanted to better understand how it works.

The MLX90615 is available at low cost as part of the GROOVE family from Seed-Studio.
There is a great, detailed, data-sheet available on-line that provide a lot of insights.
I was, and I am, impressed by the possibilities and flexibility of the sensor.

I saw a number of libraries and programs available for the Arduino, but I did not find a good programs for the Raspberry Pi.
Hence I to created a program that makes use of the complete capabilities.

My focus of interest is the area ”where hardware meets software” and the program developed is focused on exactly that.
The learnings have been documented in the MLX90615.odt and provides good reading on some the errors in de data-sheet.

It does not have a fancy interface, but it does work and is able to explore the complete capabilities of the MLX90615.
A next step could be the expansion with a graphical interface.

## Software installation

Make yourself superuser : sudo bash

BCM2835 library
Install latest from BCM2835 from : http://www.airspayce.com/mikem/bcm2835/

1. cd /home/pi
2. wget http://www.airspayce.com/mikem/bcm2835/bcm2835-1.50.tar.gz
3. tar -zxf bcm2835-1.50.tar.gz		// 1.50 was version number at the time of writing
4. cd bcm2835-1.50
5. ./configure
6. sudo make check
7. sudo make install

Install the MLX utility
1. cd /home/pi
2. tar -xzvf mlx90615.1.tar.gz
3. cd  mlx
4. ./mmlx.sh

To run the software you MUST be root/super user given the Linux permission: sudo ./mlx


text:
# Local Artwork Assets

## Supported Artwork Image Formats

There are a number of supported custom media items that need to be named correctly to be detected. The supported image file formats are:
- jpg
- jpeg
- png
- tbn

## Poster Artwork

Posters are typically displayed for books, series and collections on dashboards, library views, and when looking at details for the element. Poster art is typically of 21:29.7 aspect ratio. Custom Poster artwork will be detected and used if named and stored as follows.

#### Books <Badge text="0.53.0+" />

Custom poster must have the same name as the book file:
- `Exact book name.ext`

`ext` is the file extension.

```
/Series
  Book 10.cbz
  Book 10.jpg
```

More than one poster image can be included. For multiple items to be scanned, they should be named as follows:
- `Exact book name-X.ext`

Where `-X` is a number.

```
/Series
  Book 12.cbz
  Book 12-1.jpg
  Book 12-2.png
```

#### Series <Badge text="0.54.0+" />

Custom poster must be located in the Series directory and named as follows:
- `cover.ext`
- `default.ext`
- `folder.ext`
- `series.ext`
- `poster.ext`

`ext` is the file extension.

```
/Series
  poster.jpg
```


text:
# handle double backslash (073)

Edge case from clean css:

https://github.com/jakubpawlowicz/clean-css/issues/359

repository: ben-eb/css-minifier-tests

gha_language: CSS

repo_name: ben-eb/css-minifier-tests


text:
# Lookout::Rack::Utils

Assorted Rack utils.

## Installation

Add this line to your application's Gemfile:

    gem 'lookout-rack-utils'

And then execute:

    $ bundle

Or install it yourself as:

    $ gem install lookout-rack-utils

## Usage
  Require pieces of this in your project as needed; details below.

### Lookout::Rack::Utils::Graphite
  You'll need configatron set up:

  ```ruby
  configatron.statsd do |s|
    s.prefix = 'app'
    s.host = 'localhost'
    s.port = 8125
  end
  ```
### Lookout::Rack::Utils::I18n
  You'll need configatron set up:

 ```ruby
    configatron.default_locale = :en
    configatron.locales = [:en]
 ```

  You'll also need to set the load path somewhere in your
app:
  ```ruby
  I18n.load_path = Dir["./config/locales/**/*.yml"]
  ```

  Note that we expect `t(*args)` to be called in the context of a request.

### Lookout::Rack::Utils::Log
  You'll need configatron set up.  If `Lookout::Rack::Utils::Graphite` is
present, it will increment those stats whenever a log is written.

  ```ruby
  configatron.project_name = 'My project name'
  configatron.logging do |l|
    l.enabled = true
    l.level = 'WARN'
    l.file = 'log/some_file.log'
  end
  ```

### Lookout::Rack::Utils::Request
  `Lookout::Rack::Utils::Request` will log errors using
`Lookout::Rack::Utils::Log` if it has been required elsewhere.

### Lookout::Rack::Utils::Subroute
  `subroute!(relative_path)` will fire off a request to the specified relative
path; the result can then be used, or just returned immediately to the browser.

  Examples (Used in a Sinatra application):
  ```ruby
  require 'lookout/rack/utils/subroute'
  include Lookout::Rack::Utils::Subroute

  # Return the status of a request to /api/public/v1/original_route and throw
  # away the response body
  get '/status' do
    sub_status, sub_data = subroute!('/api/public/v1/original_route')

    halt sub_status
  end

  # Assuming we have a method 'current_user', make /api/public/v1/user route
  # to the current user
  get '/api/public/v1/user' do
    subroute!("/api/public/v1/user/#{current_user.id}")
  end

  # Same as above, but a POST request - the verb and all other parts of the
  # request's env will be preserved
  post '/api/public/v1/user' do
    subroute!("/api/public/v1/user/#{current_user.id}")
  end
  ```

## Contributing

1. Fork it
2. Create your feature branch (`git checkout -b my-new-feature`)
3. Commit your changes (`git commit -am 'Add some feature'`)
4. Push to the branch (`git push origin my-new-feature`)
5. Create new Pull Request

repository: mchung/lookout-rack-utils

repo_name: mchung/lookout-rack-utils


text:
# awss3-deploy

[![Build Status][travis-image]][travis-url]
[![npm version][npm-image]][npm-url]
[![License][license-image]][license-url]

[travis-url]: https://travis-ci.org/tlvince/awss3-deploy
[travis-image]: https://img.shields.io/travis/tlvince/awss3-deploy.svg
[npm-url]: https://www.npmjs.com/package/awss3-deploy
[npm-image]: https://img.shields.io/npm/v/awss3-deploy.svg
[license-url]: https://opensource.org/licenses/MIT
[license-image]: https://img.shields.io/npm/l/awss3-deploy.svg

> Deploy artefacts with aws-cli to S3

Deploys a `local` directory to a `dest` directory of an S3 bucket. Sets a `cache-control` header to a far-future expiry (one year) for everything *except* `index.html`, which is set to `no-cache, no-store`. Archives existing `dest` under a datetime directory scheme. Intended to be used as a [TravisCI deploy script][travis-dpl].

[travis-dpl]: https://docs.travis-ci.com/user/deployment/script

## Installation

```shell
# pip install awscli
npm install --save awss3-deploy
```

[awscli]: https://aws.amazon.com/cli/

## Usage

```shell
BUCKET="mybucket" LOCAL_DIR="dist" UPLOAD_DIR="dev" ./node_modules/.bin/awss3-deploy
```

### TravisCI

`.travis.yml`:

```yml
before_deploy:
  - export BUCKET=mybucket LOCAL_DIR=dist UPLOAD_DIR=dev
deploy:
  provider: script
  script: awss3-deploy
  skip_cleanup: true
```

### S3 Permissions

Your S3 bucket needs the `s3:ListBucket` permission on the bucket itself and
`s3:{Delete,Get,Put}Object` on the bucket's contents. An example bucket policy
might look like the following:

```json
{
  "Version": "2016-05-03",
  "Id": "awss3-deploy",
  "Statement": [
    {
      "Sid": "1",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::[account]:user/[user]"
      },
      "Action": [
        "s3:ListBucket"
      ],
      "Resource": "arn:aws:s3:::[bucket]"
    },
    {
      "Sid": "2",
      "Effect": "Allow",
      "Principal": {
        "AWS": "arn:aws:iam::[account]:user/[user]"
      },
      "Action": [
        "s3:DeleteObject",
        "s3:GetObject",
        "s3:PutObject"
      ],
      "Resource": "arn:aws:s3:::[bucket]/*"
    }
  ]
}
```

## ITYMFAQLT

> I think you might frequently ask questions like these

### Why not Travis' default S3 deployment provider?

* It does not support per-object cache-control headers (*yet*; see: [#170][])
* We needed additional life-cycle/archival rules (alternatively, AWS Lambda could be used)

[#170]: https://github.com/travis-ci/dpl/pull/170

## Author

© 2016 Tom Vincent<EMAIL_ADDRESS>(https://tlvince.com)

## License

Released under the [MIT license](http://tlvince.mit-license.org).


text:
---
title: "Running The Things Stack"
description: ""
weight: 4
---

Now that all configuration is done, you are ready to initialize {{% tts %}} and start it!

Begin by opening a terminal prompt in the same directory as your `docker-compose.yml` file.

## Initialization

The first time {{% tts %}} is started, it requires some initialization. Start by pulling the Docker images:

```bash
$ docker-compose pull
```

Next, you need to initialize the database of the Identity Server:

```bash
$ docker-compose run --rm stack is-db init
```

{{< note >}} If you receive an error running {{% tts %}}, make sure a {{% tts %}} container isn't already running. Use `docker ps` to see running containers. {{</ note >}}

For the Storage Integration available in {{% tts %}} Enterprise, the database of the Application Server needs to be initialized as well:

```bash
$ docker-compose run --rm stack storage-db init
```

{{% tts %}} Enterprise requires a tenant to be present, even if multi-tenancy is not included in the license. You create a tenant with:

```bash
$ docker-compose run --rm stack is-db create-tenant
```

{{< note >}} This will take the `tenancy.default-id` Tenant ID from the [configuration]({{< relref "configuration" >}}) in `ttn-lw-stack-docker.yml`. To specify another Tenant ID, use the `--id` parameter. {{</ note >}}

Next, an initial `admin` user has to be created. Make sure to give it a good password.

```bash
$ docker-compose run --rm stack is-db create-admin-user \
  --id admin \
  --email<EMAIL_ADDRESS>```

Then the command-line interface needs to be registered as an OAuth client:

```bash
$ docker-compose run --rm stack is-db create-oauth-client \
  --id cli \
  --name "Command Line Interface" \
  --owner admin \
  --no-secret \
  --redirect-uri "local-callback" \
  --redirect-uri "code"
```

Afterwards, the same needs to be done for the Console.

```bash
$ CONSOLE_SECRET="your-console-secret"
$ SERVER_ADDRESS="your-server-address"
$ docker-compose run --rm stack is-db create-oauth-client \
  --id console \
  --name "Console" \
  --owner admin \
  --secret "${CONSOLE_SECRET}" \
  --redirect-uri "${SERVER_ADDRESS}/console/oauth/callback" \
  --redirect-uri "/console/oauth/callback" \
  --logout-redirect-uri "${SERVER_ADDRESS}/console" \
  --logout-redirect-uri "/console"
```

{{< note >}} If running a multi-tenant environment, use option `--tenant-id NULL` to register the OAuth client for all tenants. {{</ note >}}

{{< note >}} For `--secret`, make sure to enter the same value as you set for `console.oauth.client-secret` in the `ttn-lw-stack-docker.yml` file in the [Configuration]({{< relref "configuration" >}}) step. {{</ note >}}

## Running {{% tts %}}

Start {{% tts %}} with:

```bash
$ docker-compose up
```

This starts the stack, so you will see the stack logs being printed to your terminal. You can also start the stack in detached mode by adding `-d` to the command above. In that case you can get logs with [`docker-compose logs`](https://docs.docker.com/compose/reference/logs/).

With {{% tts %}} up and running, follow [Console]({{< ref "getting-started/console" >}}) or [Command-line Interface]({{< ref "getting-started/cli" >}}) to proceed with the login, then continue with connecting gateways, creating devices and working with streaming data.

repository: CyberEyeResearchLabs/lorawan-stack-docs

gha_language: Go

repo_name: CyberEyeResearchLabs/lorawan-stack-docs


text:
# Honey [![License](https://img.shields.io/github/license/CleverSource/Honey.svg)](https://github.com/CleverSource/Honey/blob/master/LICENSE)

Honey is primarily an early-stage interactive application and rendering engine for Windows. Currently not much is implemented.

***

## Getting Started
Visual Studio 2017 or 2019 is recommended, Honey is officially untested on other development environments whilst we focus on a Windows build.

**1. Downloading the repository:**

Start by cloning the repository with `git clone --recursive https://github.com/CleverSource/Honey`.

If the repository was cloned non-recursively previously, use `git submodule update --init` to clone the necessary submodules.

**2. Configuring the dependencies:**

1. Run the [Setup.bat](https://github.com/CleverSource/Honey/blob/master/scripts/Setup.bat) file found in `scripts` folder. This will download the required prerequisites for the project if they are not present yet.
2. One prerequisite is the Vulkan SDK. If it is not installed, the script will execute the `VulkanSDK.exe` file, and will prompt the user to install the SDK.
3. After installation, run the [Setup.bat](https://github.com/CleverSource/Honey/blob/master/scripts/Setup.bat) file again. If the Vulkan SDK is installed properly, it will then download the Vulkan SDK Debug libraries. (This may take a longer amount of time)
4. After downloading and unzipping the files, the [Win-GenProjects.bat](https://github.com/CleverSource/Honey/blob/master/scripts/Win-GenProjects.bat) script file will get executed automatically, which will then generate a Visual Studio solution file for user's usage.

If changes are made, or if you want to regenerate project files, rerun the [Win-GenProjects.bat](https://github.com/CleverSource/Honey/blob/master/scripts/Win-GenProjects.bat) script file found in `scripts` folder.

***

## The Plan
The plan for Honey is two-fold: to create a powerful 3D engine, but also to serve as an education tool for people that wish to learn the design and architecture of a game engine.

### Main features to come:
- Fast 2D rendering (UI, particles, sprites, etc.)
- High-fidelity Physically-Based 3D rendering (this will be expanded later, 2D to come first)
- Support for Mac, Linux, Android and iOS
	- Native rendering API support (DirectX, Vulkan, Metal)
- Fully featured viewer and editor applications
- Fully scripted interaction and behavior
- Integrated 3rd party 2D and 3D physics engine
- Procedural terrain and world generation
- Artificial Intelligence
- Audio system

repository: CleverSource/Honey

repo_name: CleverSource/Honey


text:
## to run nginx serving files from current working directory

```
docker run --name my-nginx -p 8080:80 -v `pwd`:/usr/share/nginx/html:ro -d nginx
```

## attach to an already running container

```
sudo docker exec -i -t container-has-or-name-part /bin/bash
```

license: Unlicense

repository: PeterPerhac/cheat-sheets

repo_name: PeterPerhac/cheat-sheets


text:
# PynthUtil

### Description

**Source:** [contracts/PynthUtil.sol](https://github.com/perifinance/peri-finance/blob/master/contracts/PynthUtil.sol/)

repository: getkritesh/Peri

repo_name: getkritesh/Peri


text:
# Installing Knative-GCP

1. Create a
   [Google Cloud project](https://cloud.google.com/resource-manager/docs/creating-managing-projects)
   and install the `gcloud` CLI and run `gcloud auth login`. This guide will use
   a mix of `gcloud` and `kubectl` commands. The rest of the guide assumes that
   you've set the `PROJECT_ID` environment variable to your Google Cloud project
   id, and also set your project ID as default using
   `gcloud config set project $PROJECT_ID`.

1. Install [Knative](https://knative.dev/docs/install/). Preferably, set up both
   [Serving](https://knative.dev/docs/serving/) and
   [Eventing](https://knative.dev/docs/eventing/). The latter is only required
   if you want to use the Pub/Sub `Channel` or a `Broker` backed by a Pub/Sub
   `Channel`.

1. Create the `cloud-run-events` namespace. This is the namespace where our
   control plane pods run.

   ```shell
   kubectl create namespace cloud-run-events
   ```

1. Create a
   [Google Cloud Service Account](https://console.cloud.google.com/iam-admin/serviceaccounts/project)
   with the appropriate permissions needed for the control plane to manage
   native GCP resources.

   1. Create a new Service Account named `cloud-run-events` with the following
      command:

      ```shell
      gcloud iam service-accounts create cloud-run-events
      ```

   1. Give that Service Account permissions on your project. The actual
      permissions needed will depend on the resources you are planning to use.
      The Table below enumerates such permissions:

      |       Resource       |                                     Roles                                      |
      | :------------------: | :----------------------------------------------------------------------------: |
      |  CloudPubSubSource   |                              roles/pubsub.editor                               |
      |  CloudStorageSource  |                              roles/storage.admin                               |
      | CloudSchedulerSource |                           roles/cloudscheduler.admin                           |
      | CloudAuditLogsSource | roles/pubsub.admin, roles/logging.configWriter, roles/logging.privateLogViewer |
      |       Channel        |                              roles/pubsub.editor                               |
      |   PullSubscription   |                              roles/pubsub.editor                               |
      |        Topic         |                              roles/pubsub.editor                               |

      In this guide, and for the sake of simplicity, we will just grant
      `roles/owner` privileges to the Service Account, which encompasses all of
      the above plus some other permissions. Note that if you prefer
      finer-grained privileges, you can just grant the ones described in the
      Table. Also, you can refer to
      [managing multiple projects](../install/managing-multiple-projects.md) in
      case you want your Service Account to manage multiple projects.

      ```shell
      gcloud projects add-iam-policy-binding $PROJECT_ID \
<EMAIL_ADDRESS>\
        --role roles/owner
      ```

   1. Download a new JSON private key for that Service Account. **Be sure not to
      check this key into source control!**

      ```shell
      gcloud iam service-accounts keys create cloud-run-events.json \
<EMAIL_ADDRESS>      ```

   1. Create a Secret on the Kubernetes cluster in the `cloud-run-events`
      namespace with the downloaded key:

      ```shell
      kubectl --namespace cloud-run-events create secret generic google-cloud-key --from-file=key.json=cloud-run-events.json
      ```

      Note that `google-cloud-key` and `key.json` are default values expected by
      our control plane.

1. Finally, install the Knative-GCP constructs. You can either:

   - Install from master using [ko](http://github.com/google/ko)
      `shell ko apply -f ./config` OR
   - Install a [release](https://github.com/google/knative-gcp/releases).
     Remember to update `{{< version >}}` in the commands below with the
     appropriate release version.

     1. First install the CRDs by running the `kubectl apply` command with the
        `--selector` flag. This prevents race conditions during the install,
        which cause intermittent errors:

        ```shell
        kubectl apply --selector pubsub.cloud.google.com/crd-install=true \
        --filename https://github.com/google/knative-gcp/releases/download/{{< version >}}/cloud-run-events.yaml
        kubectl apply --selector messaging.cloud.google.com/crd-install=true \
        --filename https://github.com/google/knative-gcp/releases/download/{{< version >}}/cloud-run-events.yaml
        kubectl apply --selector events.cloud.google.com/crd-install=true \
        --filename https://github.com/google/knative-gcp/releases/download/{{< version >}}/cloud-run-events.yaml
        ```

     1. To complete the install run the `kubectl apply` command again, this time
        without the `--selector` flags:

        ```shell
        kubectl apply --filename https://github.com/google/knative-gcp/releases/download/{{< version >}}/cloud-run-events.yaml
        ```

repository: liu-cong/knative-gcp

repo_name: liu-cong/knative-gcp


text:
---
layout: post
title: LLVM
comments: true
shortinfo: Getting to grips with code generation using LLVM
categories: [Compilers]
tags: [LLVM, Tutorial, Code Generation]
---

[LLVM](http://llvm.org/) is an ongoing project at the University of Illinois that provides a modular compiler infrastructure. Anybody familiar with compilers would know that most compilers transform source code into native code through a series of steps. These steps can be broadly broken down into three major chunks -

1. The front-end - This part of the toolchain takes source code and converts it into an intermediate representation or an abstract syntax tree with symbol tables and various metadata about the program.

2. The middle part - This does general optimizations in a series of optimization passes, each pass dealing with a specific kind of inefficiency. During each pass the compiler finds patterns and fixes it.

3. The back-end - The compiler does hardware specific optimizations and produces the final machine code.

The front-end is language-specific.
The back-end is platform-specific.

By designing compilers in a modular fashion, you can reuse much of the toolchain for exsiting languages and platforms to support new languages or platforms, by just writing a new front or back end as the case may be.

The unique thing about the LLVM project however, is that the intermediate representation that it uses is the same for all stages of the process. And it is human readable too. This makes the job of writing new optimization passes much easier.

You can do many, many things with LLVM, as explained in this [blog](http://adriansampson.net/blog/llvm.html) post by Adrian Sampson. LLVM provides you with the middle and back end portions of the compiler. Hence it is pretty easy to write a compiler for any new language using the LLVM infrastructure. You just have to write a front-end that takes source code and produces LLVM IR, which is basically strongly-typed portable assembly. This involves writing a lexer that parses source code to find tokens, and then generate appropriate LLVM IR for each token. If you follow the Kaleidoscope tutorial on the LLVM website, this is exactly what they do.

### LLVM with C/C++

Most LLVM tutorials start off with a traditional hello world, so I'm not going to reinvent that particular wheel. This particular [article](http://www.ibm.com/developerworks/library/os-createcompilerllvm1/) does a remarkably good job of explaining the baiscs. Please review it before reading on. There is a dearth of more advanced tutorials though so I'm going to do my best to document my own experiences with LLVM. We're going to start somewhere more interesting.

I am currently working with a few students at UB on a project that compiles SQL to native code. The motivation is the [HyperDB](http://hyper-db.com/) system. By moving from a pull-based iterator model, to a push-based producer-consumer model, and removing functional boundaries between operators, HyperDB achieves better data and code cache locality. For in-memory databases, where the data is already in memory, the I/O costs stop dominating. Better cache management makes the data processing pipeline faster[(VLDB 2011)](http://www.vldb.org/pvldb/vol4/p539-neumann.pdf). The upshot of it all is that HyperDB is seriously fast in both OLTP and OLAP workloads.

In HyperDB, code written in C/C++ is combined with code in LLVM IR. This is because writing complex logic in pure LLVM is going to be cumbersome.

Let's start out by replicating that. This is what we are going to do -

1. We will define an array of integer elements globally in a C file
2. Then we are going to write a function called ```print()``` in LLVM IR which can print out this array.

To actually write LLVM IR, we can follow two approaches -

1. Output raw llvm instructions to a text file
2. Use the IRBuilder class of the LLVM API which provides a more concise way to generate IR

We are going to use the second approach, because this will let us be more productive.

### LLVM IR

Before we get to generating LLVM IR, we need to understand a few things about it. The best way to learn IR and how constructs in C map to LLVM code is to write a C program, compile it to IR using clang, the C front-end shipped by the LLVM project, with the ```-O0 -S -emit-llvm``` flags, and checking the resulting IR dump.

You can run this dump using the LLVM bitcode interpreter tool lli.

Note: The code in this article is relevant as of version 3.5 of llvm, with the pre-built ubuntu llvm packages. Since the LLVM APIs, and IR representation changes, often significantly with each release, subsequent versions of llvm might not work exactly this way.

LLVM has a concept of modules.

-> A module is a single compilation unit, or roughly akin to one C file
-> Each module has a few global functions and variables defined within it
-> Each function is composed of one or more blocks of instructions, called basic blocks
-> Each block is composed of one or more elementary instructions

### Code it up

Let's first define a header file declaring the array and a corresponding C file that initializes it and calls the llvm ```print``` function.

```array.h```
{% highlight c linenos %}
#define SIZE 5
int array[SIZE];
{% endhighlight %}

```array.c```
{% highlight c linenos %}
#include "array.h"

// Prototype for the LLVM IR function
int print();

void initializeArray() {
    for(int i=0; i<SIZE; i++) {
        array[i]=i*i;
    }
}

int main() {
    initializeArray();
    print();
}
{% endhighlight %}

Then we write the code to actually generate IR.

```generate.cpp```
{% highlight c++ linenos %}
#include "llvm/IR/LLVMContext.h"
#include "llvm/IR/Module.h"
#include "llvm/IR/IRBuilder.h"

#include "array.h"

using namespace llvm;
using namespace std;

int main(){

    // Declaring some variables to make our job easier
    LLVMContext &context = getGlobalContext();
    Module *module = new Module("looper", context);
    IRBuilder<> builder(context);
    Type *intType = Type::getInt32Ty(context);

    // The print function
    FunctionType *printFunctionType = FunctionType::get(intType, false);
    Function *printFunction = Function::Create(printFunctionType, Function::ExternalLinkage, "print", module);

    // Declare C standard library printf so that we can call it
    vector<Type *> printfArgsTypes({Type::getInt8PtrTy(context)});
    FunctionType *printfType = FunctionType::get(intType, printfArgsTypes, true);
    Constant *printfFunc = module->getOrInsertFunction("printf", printfType);

    // Declare array as an external global variable
    Constant *conArray = module->getOrInsertGlobal("array", ArrayType::get(intType, SIZE));

    // entry block - The starting basic block of the print function
    BasicBlock *entry = BasicBlock::Create(context, "entry", printFunction);
    builder.SetInsertPoint(entry);

    // The format string for the printf function, declared as a global literal
    Value *str = builder.CreateGlobalStringPtr("%d\n", "str");

    // loopVar is our counter variable
    Value *loopVar = builder.CreateAlloca(intType);
    builder.CreateStore(ConstantInt::get(intType, 0), loopVar);

    BasicBlock *LoopBB = BasicBlock::Create(getGlobalContext(), "loop", printFunction);
    builder.CreateBr(LoopBB);
    builder.SetInsertPoint(LoopBB);

    // loop block
    Value *i = builder.CreateLoad(loopVar);

    Value* indices[2];
    indices[0] = ConstantInt::get(intType, 0);
    indices[1] = i;
    ArrayRef<Value *> indicesRef(indices);

    Value *v = builder.CreateLoad(builder.CreateGEP(conArray, indicesRef, "arr"));

    vector<Value *> argsV({str, v});
    Value* call = builder.CreateCall(printfFunc, argsV, "calltmp");

    Value *iplusplus = builder.CreateAdd(builder.CreateLoad(loopVar), ConstantInt::get(intType, 1));
    builder.CreateStore(iplusplus, loopVar);
    Value *SltE = builder.CreateICmpULT(builder.CreateLoad(loopVar), ConstantInt::get(intType, SIZE));
    BasicBlock *AfterBB =
         BasicBlock::Create(getGlobalContext(), "afterloop", printFunction);

    builder.CreateCondBr(SltE, LoopBB, AfterBB);

    // after block
    builder.SetInsertPoint(AfterBB);
    builder.CreateRet(ConstantInt::get(intType, 0));

    module->dump();
    return 0;
}
{% endhighlight %}

### Run it!

Before walking through the code, let's first run it to confirm it works. First of all you need to make sure you have llvm, specifically version 3.5 installed. Ubuntu has pre-packaged binaries so you can just ```sudo apt-get install llvm-3.5```.

We will use clang to compile ```generate.cpp```

```
clang++-3.5 -g -O3 generate.cpp `llvm-config-3.5 --cxxflags --ldflags --system-libs --libs core` -o generate
```

Quick notes:
1. The ```-O``` flag, like in gcc is used to indicate the level of optimizations you want the compiler to run on your source.
2. ```-g``` enables debugging symbols for GDB
3. ```llvm-config``` is a tool that generates a lot of the necessary flags so that we do not have to type out a long list of them each time we want to compile our program against the LLVM sources

Next, we run the program. This will generate IR and dump it to the console. Since we need the output for our next steps, we will redirect the output to a dump file.

```
./generate > dump.ll 2>&1
```

Now, ```dump.ll``` has the generate IR. We can us the ```llc``` tool to compile the IR to native assembly.

```
llc-3.5 dump.ll -o dump.s
```

```dump.s``` is now an assembly file.

Finally, we need to compile the assembly file together with ```array.c``` to get the final executable.

```
gcc -std=c99 dump.s array.c -o finalprog
```

Now run ```finalprog```. We will get the following output -

```
$> ./finalprog
0
1
4
9
16
```

### Great success!

So, what did we do? If you inspect ```dump.ll``` you will get a rough idea of how the code generation works.

```dump.ll```

```
; ModuleID = 'looper'

@array = external global [5 x i32]
@str = private unnamed_addr constant [4 x i8] c"%d\0A\00"

define i32 @print() {
entry:
  %0 = alloca i32
  store i32 0, i32* %0
  br label %loop

loop:                                             ; preds = %loop, %entry
  %1 = load i32* %0
  %arr = getelementptr [5 x i32]* @array, i32 0, i32 %1
  %2 = load i32* %arr
  %calltmp = call i32 (i8*, ...)* @printf(i8* getelementptr inbounds ([4 x i8]* @str, i32 0, i32 0), i32 %2)
  %3 = load i32* %0
  %4 = add i32 %3, 1
  store i32 %4, i32* %0
  %5 = load i32* %0
  %6 = icmp ult i32 %5, 5
  br i1 %6, label %loop, label %afterloop

afterloop:                                        ; preds = %loop
  ret i32 0
}

declare i32 @printf(i8*, ...)
```

### SSA

Looping is a fundamental construct in imperative languages. But its not trivial to implement in IR, at least for a new comer. This is because LLVM uses Single Static Assignment (SSA). This means that once you assign a value to a register, you cannot change it. The register is immutable. LLVM gives you an infinite number of registers, and this formulation makes it easy for the code analyzer to reason about how best to allocate registers to physically available registers. But this also causes a problem with conditional statements like ```if then else``` or loops. Why?

Consider an if statement -

```if x < 5 then y = 0 else y = 1; z = y;```

You'd expect this to translate to something like -

```
entry:
	%0 = icmp ult i32 %x, 5
	br i1 %6, label %then, label %else

then:
	%y = i32 0
	br %after

else:
	%y = i32 1
	br %after

after:
	%z = i32 %y
```

But this is invalid. %y cannot be assigned twice. The way SSA addresses this is through a construct called a PHI node -

```
entry:
	%0 = icmp ult i32 %x, 5
	br i1 %6, label %then, label %else

then:
	%y1 = i32 0
	br %after

else:
	%y2 = i32 1
	br %after

after:
	%z = phi [%then, i32 %y1] [%else, i32 %y2]
```

You can give multiple inputs to the phi node, each input is a combination of a branch and a value. What value phi resolves to is dependent on which branch was executed before the current branch.

You can see why this kind of restriction can also cause a problem for loops. A ```for``` loop very often depends on an increment or decrement to a counter variable. Since every register value is immutable, we cannot just do ```%i = add i32 %i, i32 0```. Thus we need to allocate a memory space instead where we store the variable's value. This is the reason we do

```
Value *loopVar = builder.CreateAlloca(intType);			| %0 = alloca i32
builder.CreateStore(ConstantInt::get(intType, 0), loopVar);	| store i32 0, i32* %0
```

Note that ```%0``` is a pointer, not a value. Since the pointer is immutable, we no longer have a problem. We can use store and load instructions to manipulate the counter.

### Value

An important entity in LLVM is the [Value](http://llvm.org/docs/doxygen/html/classllvm_1_1Value.html) class. If you look at the class diagram, you will notice that the Value class is a superclass of a lot of different entities like constants, constant arrays, instructions, arguments, operators, and even basic blocks. Many instructions expect values as input parameters, and are themselves values. So you could potentially chain a lot of values together to generate IR in a concise and readable manner, like here
```
Value *iplusplus = builder.CreateAdd(builder.CreateLoad(loopVar), ConstantInt::get(intType, 1));
```
or
```
Value *SltE = builder.CreateICmpULT(builder.CreateLoad(loopVar), ConstantInt::get(intType, SIZE));
```

### GEP

The [getElementPtr](http://llvm.org/docs/GetElementPtr.html) instruction is important. It is used to dereference memory locations. The LLVM documentation page does a pretty good job of explaining it and its important to know when working with LLVM.

An interesting observation with the code is that we have to declare the external array as an array type. We tried using an integer pointer and the GEP instruction to walk through the memory location, but this causes a segmentation fault <i>while generating LLVM IR itself</i>. This is because with this approach, we are trying to dereference memory which has not been allocated, even though it would be after linking with ```array.c```. Maybe this is something that can be fixed, but as of this moment, we don't know how.

### Possibilities!

In this post, we basically built a toy program that let us grasp two very important concepts

1. SSA, immutability, and the subtleties of expressing conditionals and loops within the SSA rules
2. How to generate LLVM IR code and link it to C

We could also have made the LLVM function ```main``` and called C functions. The possibilities now are endless. We march on, brandishing the mighty power of IRBuilder.


text:
# shipit-shared

A set of tasks for [Shipit](https://github.com/shipitjs/shipit) used for symlinking persistent (un-sourced) files and directories on deploy.

Based on the concept of `linked_files`/`linked_dirs` from [Capistrano](http://capistranorb.com/documentation/getting-started/configuration/)

**Features:**

- Triggered on the `published` event from [shipit-deploy](https://github.com/shipitjs/shipit-deploy)
- All neccesary directories are always created for you, whether you are linking a file or a directory.
- Works via [shipit-cli](https://github.com/shipitjs/shipit) and [grunt-shipit](https://github.com/shipitjs/grunt-shipit)
- Optionally ignore specified tables

**Roadmap**

- Optionally copy example files, such as example config files

## Install

```
npm install shipit-shared
```

## Usage

### Example `shipitfile.js`

```js
module.exports = function (shipit) {
  require('shipit-deploy')(shipit);
  require('shipit-shared')(shipit);

  shipit.initConfig({
    default: {
      shared: {
        dirs: [
          'public/storage',
          'db',
        ],
        files: [
          'config/environment.yml',
          'config/database.yml',
        ],
      }
    }
  });
};
```

To trigger on the deploy `published` event, you can simply deploy:

```
shipit staging deploy
```

Or you can run the tasks separatly :

```
shipit staging shared
    shipit staging shared:create-dirs
    shipit staging shared:link
        shipit staging shared:link:dirs
        shipit staging shared:link:files
```

## Options `shipit.config.shared`

### `shared.dirs`

Type: `Array`

An array of directories to symlink to `current`.

### `shared.files`

Type: `Array`

An array of files to symlink to `current`.

### `shared.path`

Type: `String`
Default: `path.join(shipit.config.deployTo, 'shared')`

The path where your shared files reside.

### `shared.symlinkPath`

Type: `String`
Default: `shared.path`

The path that will serve as the source for your symlink. This is usually the same as `shared.path`, however it can [necessary to set this in a `chroot` environment](https://github.com/timkelty/shipit-shared/issues/7).

## License

MIT

repository: zygis/shipit-shared

repo_name: zygis/shipit-shared


text:
# Numerical Solution for 1-D Schrödinger’s Wave Equation
Quantum Physics, unlike the Classical Physics, describes the behavior of the matter and light (photons) on the atomic and subatomic level. It is heavily based on the mathematical models which attempt to describe and account for the properties of atoms and their constituents. Schrödinger Equation, also known as Schrödinger’s Wave Equation, is a partial differential equation that describes the dynamics of a quantum mechanics system using the wave function.

In this project, a numerical solution has been proposed to solve the 1-D Schrödinger’s Wave Equation for a user defined Energy Function using python. Further the idea has been extended to 2-D Wave Functions as well.

**Below shows some reuslts for 1-D Schrödinger Equation solutions for 1-D Potential Energy Curves**

**Below shows some reuslts for 2-D Schrödinger Equation solutions for 2-D Potential Energy Curves**


text:
# [Esports Ticker](http://alexa.amazon.com/#skills/amzn1.echo-sdk-ams.app.79ff594b-2115-4193-bd22-58cf38638605)
![4.1 stars](../../images/ic_star_black_18dp_1x.png)![4.1 stars](../../images/ic_star_black_18dp_1x.png)![4.1 stars](../../images/ic_star_black_18dp_1x.png)![4.1 stars](../../images/ic_star_black_18dp_1x.png)![4.1 stars](../../images/ic_star_half_black_18dp_1x.png) 4

To use the Esports Ticker skill, try saying...

* *Alexa, ask Esports Ticker for live matches*

* *Alexa, ask Esports Ticker for recent results in dota 2*

* *Alexa, ask Esports Ticker for upcoming matches in league of legends*

EsportsTicker in an app in which you can get live, current, and upcoming matches results for esports games.
Current games supported are DOTA 2, League of Legends, StarCraft 2, Heroes of Newerth, Counter Strike, Hearthstone, World of Warcraft, SMITE, Heroes of the Storm, Super Smash Bros, Call of Duty

***

### Skill Details

* **Invocation Name:** esports ticker
* **Category:** null
* **ID:** amzn1.echo-sdk-ams.app.79ff594b-2115-4193-bd22-58cf38638605
* **ASIN:** B01BCIXI1Q
* **Author:** abiosgaming.com
* **Release Date:** February 1, 2016 @ 11:38:07
* **In-App Purchasing:** No


text:
---
description: The serverless git deploy you know and love
---

# Deploy to Netlify

## Netlify tl;dr Deploy

If you simply want to experience the Netlify deployment process without a database and/or adding custom code, you can do the following:

1. create a new redwood project: `yarn create redwood-app ./netlify-deploy`
2. after your "netlify-deploy" project installation is complete, init git, commit, and add it as a new repo to GitHub, BitBucket, or GitLab
3. run the command `yarn rw setup deploy netlify` and commit and push changes
4. use the Netlify [Quick Start](https://app.netlify.com/signup) to deploy

:::caution
While you may be tempted to use the [Netlify CLI](https://cli.netlify.com) commands to [build](https://cli.netlify.com/commands/build) and [deploy](https://cli.netlify.com/commands/deploy) your project directly from you local project directory, doing so **will lead to errors when deploying and/or when running functions**. I.e. errors in the function needed for the GraphQL server, but also other serverless functions.

The main reason for this is that these Netlify CLI commands simply build and deploy -- they build your project locally and then push the dist folder. That means that when building a RedwoodJS project, the [Prisma client is generated with binaries matching the operating system at build time](https://cli.netlify.com/commands/link) -- and not the [OS compatible](https://www.prisma.io/docs/reference/api-reference/prisma-schema-reference#binarytargets-options) with running functions on Netlify. Your Prisma client engine may be `darwin` for OSX or `windows` for Windows, but it needs to be `debian-openssl-1.1.x` or `rhel-openssl-1.1.x`. If the client is incompatible, your functions will fail.

Therefore, **please follow the [Tutorial Deployment section](tutorial/chapter4/deployment.md)** to sync your GitHub (or other compatible source control service) repository with Netlify andalllow their build and deploy system to manage deployments.
:::

## Netlify Complete Deploy Walkthrough

For the complete deployment process on Netlify, see the [Tutorial Deployment section](tutorial/chapter4/deployment.md).

repository: redwoodjs/redwood

repo_name: redwoodjs/redwood


text:
# SysML-SpecIF-Bridge
A bridge between SysML and SpecIF.

## Purpose
An investigation of the [Lehrstuhl für Virtuelle Produktentwicklung (VPE)](https://vpe.mv.uni-kl.de/startseite/) at the TU Kaiserslautern has shown, that an exchange of SysML data between any of the widely known modeling tools is practically impossible because of compatibility issues. Correctly transferred model-elements and properties are a minor share, even though the XMI standard is being used by all tools.

The SpecIF Initiative is pursuing two goals:
- provide a working model interchange format for SysML modeling tools of a different kind.
- provide a mapping, so that SysML models can be integrated with results from other methods, such as process modelling (BPMN) or requirements engineering. A common context shall allow to search, navigate and audit the integrated model data.

So far, it is unclear whether both goals can be achieved with a single SysML-SpecIF mapping or whether specialized mappings with different design goals will be necessary.

repository: GfSE/SysML-SpecIF-Bridge

repo_name: GfSE/SysML-SpecIF-Bridge


text:
# Page Tracker Worker

A simple Rust Cloudflare KV worker to store incremental counters per
blog path for [fnlog.dev](https://fnlog.dev).

This is runned with [wrangler](https://github.com/cloudflare/wrangler)
CLI:

```shell
cargo install wrangler

# Login with Cloudflare credentials
wrangler login

# To run a local dev server
wrangler dev

# Test server with `/my-blog-path/article-name += 1`
curl -XGET http://<IP_ADDRESS>:8787/my-blog-path/article-name

# To build or publish afterwards
# Make sure to check if the KV binding is correct
wrangler build
wrangler publish
```

repository: FrancisMurillo/page-tracker-worker

repo_name: FrancisMurillo/page-tracker-worker


text:
# Radar chart {#concept_xkk_b42_vdb .concept}

This section describes how to create a radar chart. For more information, see [Dashboard overview](intl.en-US/Quick Start/Create a report/Dashboard overview.md#) and [Basic dashboard operations](intl.en-US/Quick Start/Create a report/Dashboard basic operations/Basic dashboard operations.md#). If you need to edit or create datasets, see [Create a dataset](intl.en-US/User Guide/Data modeling/Dataset management/Create a dataset.md#).

Radar charts can be used to compare multiple variables under different metrics. You can easily understand the distribution of metrics across different variables. For example, you can use a radar chart to compare sales across multiple areas.

A radar chart consists of a sequence of radius labels with varying radius. Radius labels are determined by data dimensions, such as product type. Radius are determined by data measures, such as transportation cost.

## Note {#section_xbs_d42_vdb .section}

For each radar chart, one or two dimensions can be specified to determine radius labels. The specified dimensions must contain 3 to 12 variables. At least one measure must be specified to determine Radius.

The following scenario uses the company\_sales\_record dataset as an example.

**Scenario: Compare the order quantities and order amounts across areas**

1.  Log on to the Quick BI console.
2.  Click **Datasets** to open the dataset management page.
3.  Select the company\_sales\_record dataset and click **Create Dashboard**.
4.  Click the Radar icon and the corresponding legend is displayed.
5.  Click the Data tab to select data dimensions and data measures.

    In the Dimensions list, select **area** and add it to radius label. In the Measures list, select **order\_number** and **order\_amt**, and add them sequentially to radius, as shown in the following figure:

    **Note:** Make sure you have changed the data type of Area from String to Location.

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

6.  Click **Update** to generate the chart.
7.  In the **Style** tab, you can change the title, layout, and legend of the chart as follows:
8.  Click the **Save** icon to save the dashboard.

To delete the chart, move the mouse to the upper-right corner and click **Delete** in the toolbar that appears.

url: https://raw.githubusercontent.com/xiao15934831580/bi/a266cc43c3e9f5eb88bab9c630cf28e52a364687/intl.en-US/Quick Start/Create a report/Create charts/Radar chart.md

filename: Radar chart.md


text:
# DayZ-Console-Killfeed
Basic DayZ Killfeed for PS4/Xbox Nitrado Servers

![](https://i.ibb.co/s3pCwPK/image.png)

# Requirements
- Server for hosting
- Python 3.8
- A brain

# Installation
Install requirements:
`pip3 install -r requirements.txt`

Edit configuration:
`nano config.py` or open in notepad

Run the bot:
`python3 main.py`

# Premium Killfeed
Want a killfeed bot with a more detailed UI and more features? Check out [Killfeed.me](https://killfeed.me)
- Admin Tools
- Killfeed Bot
- Base Protection
- Safezone Kill Autoban
- Permissions
- Player Management
- Whitelist/Ban/Priority Queue/other admin tools...

https://killfeed.me

repository: SixthElvis/DayZ-Console-Killfeed

repo_name: SixthElvis/DayZ-Console-Killfeed


text:
## Overview [![Build Status](https://travis-ci.org/wavezhang/k8s-csi-lvm.svg?branch=master)](https://travis-ci.org/wavezhang/k8s-csi-lvm)

Kubernetes LVM CSI plugin is developed to manage local storage dynamically on kubernetes.

## Deploy

1. kube-apiserver must be launched with ```--feature-gates=CSIPersistentVolume=true,MountPropagation=true``` and ```--runtime-config=storage.k8s.io/v1alpha1=true```
2. Exec ```deploy/node.sh``` on all nodes of kubernetes.
3. On master node, exec
```bash
kubectl create -f deploy/kubernetes
```
4. If you need aware node lvm capacity when schedule, on master node, exec ```deploy/capacity.sh``` and when using lvm in pod add  requests like following:
```yaml
    resources:
      limits:
        paas.com/lvm: 1Gi
```

## Usage

See ```deploy/example```

## Troubleshooting

Please submit an issue at: [Issues](https://github.com/wavezhang/k8s-csi-lvm/issues)


text:
---
title: "Deploy static content to AWS CDN for WaveMaker Apps"
id: "app-integration-with-aws-cdn"
sidebar_label: "App Integration with AWS CDN"
---
---

The frontend code of any WaveMaker application can be configured to deploy onto a CDN. This improves the end-user experience of the WaveMaker application because of dramatic gains made in the page load times. In this document, you will learn how to setup the deployment of WaveMaker frontend artifacts to CDN. While the instructions here deal with AWS, similar steps can be followed to deploy onto CDNs provided by any other cloud infrastructure providers.

- [Create an Amazon S3 bucket](#create-an-amazon-s3-bucket)
- [Configure Origin Access Identity](#configure-origin-access-identity)
- [Create an Amazon CloudFront distribution](#create-an-amazon-cloudfront-distribution)
- [Build and Deploy static Content to S3](#build-and-deploy-static-content-to-s3)

## Create an Amazon S3 bucket

- Sign in to the AWS Management Console and open the [Amazon S3 console](https://console.aws.amazon.com/s3/.) .
- Choose Create bucket, Next Enter Bucket Name, and Select the region for the bucket.
- In Bucket settings for Block Public Access, choose the Block Public Access settings that you want to apply to the bucket.
- Go to bucket properties, enable static website hosting.
[![static website enable](/learn/assets/wme-setup/s3-static-website-enable.png)](/learn/assets/wme-setup/s3-static-website-enable.png)

- If the web application loaded in one domain and the frontend code in s3 loaded with a different CDN domain, then the end-user will receive error No 'Access-Control-Allow-Origin' header which is present on the requested resource. So, to selectively allow cross-origin access to your Amazon S3 resources, add CORS rules in the bucket permission section. If website content requires CORS, then add rules in the bucket permission section. For more details, visit [aws s3 cors](https://docs.aws.amazon.com/AmazonS3/latest/dev/cors.html).

```json
CORS example
[
    {
        "AllowedHeaders": [
            "*"
        ],
        "AllowedMethods": [
            "GET",
            "POST",
            "HEAD"
        ],
        "AllowedOrigins": [
            "http://example.mydomain.com"
        ],
        "ExposeHeaders": [],
        "MaxAgeSeconds": 300000
    }
]
```

## Configure Origin Access Identity

- An Origin Access Identity (OAI) is used for sharing private content via CloudFront. The OAI is a special CloudFront user and OAI has read permissions to the bucket. CloudFront will use the OAI to access the files in your bucket and serve them to end-users.
- When end-users access your Amazon S3 files through CloudFront, the CloudFront origin access identity gets the files on behalf of end-users. If end users request files directly by using Amazon S3 URLs, they're denied access. The origin access identity has permission to access files in your Amazon S3 bucket, but users don't. For more details visit [private content restriction in s3](https://docs.aws.amazon.com/AmazonCloudFront/latest/DeveloperGuide/private-content-restricting-access-to-s3.html)
- Sign in to the AWS Management Console and open the [CloudFront console](https://console.aws.amazon.com/cloudfront/.), at security section select origin access identity and create Origin Access Identity by providing comment.

## Create an Amazon CloudFront distribution

- Sign in to the AWS Management Console and open the [CloudFront console](https://console.aws.amazon.com/cloudfront/.), select Create Distribution
- On the first page of the Create Distribution Wizard, in the `Web` section, choose Get Started.
- At Origin Domain Name select previously created S3 Bucket, if you want to store content in any specific directory provide an origin path.
- select restrict buckets access as `yes` and select previously created existing Identity.
- At Grant Read Permissions on Bucket select `yes` for update bucket policy ,it will provide read permission to the origin access identity when you create the distribution.
[![CDN origin settings](/learn/assets/wme-setup/cdn-origin-setting.png)](/learn/assets/wme-setup/cdn-origin-setting.png)

- Provide Cache behavior configuration details
[![CDN cache behaviour](/learn/assets/wme-setup/cdn-cache-behaviour-settings.png)](/learn/assets/wme-setup/cdn-cache-behaviour-settings.png)

- At distribution settings select Default CloudFront certificate or import custom SSL certificate , then click on create distribution by providing required values for creation.
[![CDN distribution settings](/learn/assets/wme-setup/cdn-distribution-setting.png)](/learn/assets/wme-setup/cdn-distribution-setting.png)

- Wait for few minutes to create distribution and after creating distribution note down the domain name of CloudFront distribution.

## Build and Deploy static Content to S3

- Check Build Process  [Maven Build Process to Support CDN Deploy](/learn/app-development/deployment/building-with-maven#build-war-file-and-static-content-to-deploy-them-separately)

```shell
mvn clean install -Pdeployment -Dcdn-url=https://mydomain.cloudfront.net/my_app>/1234/
```

- The above command generates two deployable artifacts: `ui-artifacts.zip`, `project.war`. Both these files can be found in the `target` folder.

- Use the following commands to unzip and upload to S3.

- To unzip the file and store contents in a specific folder

```shell
unzip ui-artifacts.zip -d <my-static-content-folder>
```

- Upload files to AWS S3 bucket

```shell
aws s3 sync <my-static-content-folder>/ S3_BUCKET
```

repository: wavemaker/docs

repo_name: wavemaker/docs


text:
---
layout: post
title:  "Odoo List"
date:   2018-06-05 12:31:01 +0700
categories: [postgresql]
published: true
---

### List primary keys for all tables
Get the idea from this [link](https://dba.stackexchange.com/questions/11032/list-primary-keys-for-all-tables-postgresql)
```
select
  tc.table_schema,
  tc.table_name,
  kc.column_name
from information_schema.table_constraints tc
  join information_schema.key_column_usage kc
    on kc.table_name = tc.table_name
    and kc.table_schema = tc.table_schema
    and kc.constraint_name = tc.constraint_name
where tc.constraint_type = 'PRIMARY KEY';
```

### Analyze a Postgres database
*  `-Z`  Only calculate statistics for use by the optimizer (no vacuum).
*  `-v`  Print detailed information during processing.
*  `-a`  Vacuum all databases.
*  `-j 6`Execute the vacuum or analyze commands in parallel by running njobs (6) commands simultaneously.
```
vacuumdb -Zv -a -j 6
```


text:
[![](https://images.microbadger.com/badges/image/keinos/explode_version.svg)](https://microbadger.com/images/keinos/explode_version "View detailed image info on microbadger.com") [![Build Status](https://travis-ci.org/KEINOS/Explode_version.svg?branch=master)](https://travis-ci.org/KEINOS/Explode_version) [![Docker Cloud Build Status](https://img.shields.io/docker/cloud/build/keinos/explode_version.svg)](https://hub.docker.com/r/keinos/explode_version)

# Explode Version Number to JSON

The `explode_version` command (or the script) explodes a given version info in to JSON object string.

Useful to get version info into tokens for versioning. Mostly aimed to use for DockerHub's tag list.

For example, the string "`php:7.3.4-cli-alpine3.9`" becomes as below:

```json
{
    "php": {
        "name": "php",
        "version": "7.3.4"
    },
    "cli": {
        "name": "cli"
    },
    "alpine": {
        "name": "alpine",
        "version": "3.9"
    }
}
```

## Usage

### For **NON Docker Users**:

  - Requirements: PHP >= `5.6.40` ([PHP versions tested](https://travis-ci.org/KEINOS/Explode_version))
  - Source Code:
    - View: https://github.com/KEINOS/Explode_version/blob/master/explode_version
    - Download: https://KEINOS.github.io/Explode_version/explode_version
      - Note: Don't forget to `chmod +x` the downloaded script.

  - Sample Usage:

    ```shellsession
    $ # With --pretty option
    $ ./explode_version --pretty 'php 7.3.4-cli-alpine3.9'
    {
        "php": {
            "name": "php",
            "version": "7.3.4"
        },
        "cli": {
            "name": "cli"
        },
        "alpine": {
            "name": "alpine",
            "version": "3.9"
        }
    }
    $
    $ # With no option
    $ ./explode_version php7.0.1-cli-alpine3.0
    {"php":{"name":"php","version":"7.0.1"},"cli":{"name":"cli"},"alpine":{"name":"alpine","version":"3.0"}}
    ```

### For **Docker Users**:

  - Docker Image: `keinos/explode_version` @ Docker Hub
  - Repositories:
    - Image : https://hub.docker.com/r/keinos/explode_version @ DockerHub
    - Source: https://github.com/KEINOS/Explode_version/blob/master/Dockerfile @ GitHub
  - Sample usage:

    ```shellsession
    $ # With --pretty option
    $ docker run --rm keinos/explode_version --pretty "php:7.3.4-cli-alpine3.9"
    {
        "php": {
            "name": "php",
            "version": "7.3.4"
        },
        "cli": {
            "name": "cli"
        },
        "alpine": {
            "name": "alpine",
            "version": "3.9"
        }
    }
    $
    $ # With no option
    $ docker run --rm keinos/explode_version php7.0.1-cli-alpine3.0
    {"php":{"name":"php","version":"7.0.1"},"cli":{"name":"cli"},"alpine":{"name":"alpine","version":"3.0"}}
    ```

  - See: [README_DOCKER.md](https://github.com/KEINOS/Explode_version/blob/master/README_DOCKER.md) for more

## Help

```shellsession
$ ./explode_version --help
Usage: explode_version [OPTION] VERSION

OPTION:
  -h, --help    This help.
      --pretty  Outputs with indentation.

VERSION: A string to be alanlized.

```