text:
## [5.0.2](https://github.com/thenativeweb/buntstift/compare/5.0.1...5.0.2) (2022-05-03)

### Bug Fixes

* bump inquirer from 8.2.2 to 8.2.4 ([#480](https://github.com/thenativeweb/buntstift/issues/480)) ([e637bde](https://github.com/thenativeweb/buntstift/commit/e637bdeec04fbfc659e1b5b677ce840fd1dee8ce))

## [5.0.1](https://github.com/thenativeweb/buntstift/compare/5.0.0...5.0.1) (2021-12-05)

### Bug Fixes

* Trigger an update to have a new version with updated dependencies. ([e4e3406](https://github.com/thenativeweb/buntstift/commit/e4e3406eda1f66f45c6bc8c442ef019a96d46529))

# [5.0.0](https://github.com/thenativeweb/buntstift/compare/4.0.34...5.0.0) (2021-08-16)

### Bug Fixes

* bump path-parse from 1.0.6 to 1.0.7 ([#428](https://github.com/thenativeweb/buntstift/issues/428)) ([3097384](https://github.com/thenativeweb/buntstift/commit/30973841b66e25b4c98255db168c2598efd28ef6))

### Features

* Allow setting color level. ([#429](https://github.com/thenativeweb/buntstift/issues/429)) ([0517b5a](https://github.com/thenativeweb/buntstift/commit/0517b5a21b30b6a13cc7161f0e2e251f9cd1da2b))

### BREAKING CHANGES

* This removes the previous boolean configuration value isColorEnabled in
favor of a more flexible colorLevel. Disabling colored output is still
possible by setting the colorLevel to ColorLevel.Disabled. In addition,
the color level can now be controlled in detail.

* feat: Export ColorLevel in the entrypoint.

* chore: Update github actions to use node v16.

* chore: Add missing configuration files.

## [4.0.34](https://github.com/thenativeweb/buntstift/compare/4.0.33...4.0.34) (2021-08-02)

### Bug Fixes

* bump chalk from 4.1.1 to 4.1.2 ([#425](https://github.com/thenativeweb/buntstift/issues/425)) ([d0ec357](https://github.com/thenativeweb/buntstift/commit/d0ec3579e03de8fedd446b673f4faa76fa05f5d5))

## [4.0.33](https://github.com/thenativeweb/buntstift/compare/4.0.32...4.0.33) (2021-07-21)

### Bug Fixes

* bump inquirer from 8.1.1 to 8.1.2 ([#418](https://github.com/thenativeweb/buntstift/issues/418)) ([112dc31](https://github.com/thenativeweb/buntstift/commit/112dc31ed9ba73c23fe25a82b32550c9f4477c1f))

## [4.0.32](https://github.com/thenativeweb/buntstift/compare/4.0.31...4.0.32) (2021-07-12)

### Bug Fixes

* bump @types/inquirer from 7.3.2 to 7.3.3 ([#417](https://github.com/thenativeweb/buntstift/issues/417)) ([7ab30d6](https://github.com/thenativeweb/buntstift/commit/7ab30d64617ea69dc4d6af7f6efcbff7af2e1b5b))

## [4.0.31](https://github.com/thenativeweb/buntstift/compare/4.0.30...4.0.31) (2021-06-28)

### Bug Fixes

* bump @types/inquirer from 7.3.1 to 7.3.2 ([#410](https://github.com/thenativeweb/buntstift/issues/410)) ([1b9f9be](https://github.com/thenativeweb/buntstift/commit/1b9f9be7f7ebeb6d72ceb10d62d81d6506190968))

## [4.0.30](https://github.com/thenativeweb/buntstift/compare/4.0.29...4.0.30) (2021-06-28)

### Bug Fixes

* bump inquirer from 8.1.0 to 8.1.1 ([#411](https://github.com/thenativeweb/buntstift/issues/411)) ([8b48dbf](https://github.com/thenativeweb/buntstift/commit/8b48dbf9e3266c9d5ddef1129d04693facb34447))

## [4.0.29](https://github.com/thenativeweb/buntstift/compare/4.0.28...4.0.29) (2021-06-16)

### Bug Fixes

* bump ora from 5.4.0 to 5.4.1 ([#406](https://github.com/thenativeweb/buntstift/issues/406)) ([7080add](https://github.com/thenativeweb/buntstift/commit/7080add9f8ec47a401186918bd1e12ccdcbe1f5c))

## [4.0.28](https://github.com/thenativeweb/buntstift/compare/4.0.27...4.0.28) (2021-06-10)

### Bug Fixes

* bump normalize-url from 6.0.0 to 6.0.1 ([#402](https://github.com/thenativeweb/buntstift/issues/402)) ([6c5b6a4](https://github.com/thenativeweb/buntstift/commit/6c5b6a4f8f02219f8eff87f4a875192e656de0f4))

## [4.0.27](https://github.com/thenativeweb/buntstift/compare/4.0.26...4.0.27) (2021-06-08)

### Bug Fixes

* bump trim-newlines from 3.0.0 to 3.0.1 ([#400](https://github.com/thenativeweb/buntstift/issues/400)) ([e8d172b](https://github.com/thenativeweb/buntstift/commit/e8d172bacb5a052b2bc98c537f8d3b8dd6bba846))

## [4.0.26](https://github.com/thenativeweb/buntstift/compare/4.0.25...4.0.26) (2021-06-08)

### Bug Fixes

* bump glob-parent from 5.1.1 to 5.1.2 ([#401](https://github.com/thenativeweb/buntstift/issues/401)) ([6be8b76](https://github.com/thenativeweb/buntstift/commit/6be8b762d83b6daba9e9ff28cf292c4ee335efab))

## [4.0.25](https://github.com/thenativeweb/buntstift/compare/4.0.24...4.0.25) (2021-05-24)

### Bug Fixes

* bump inquirer from 8.0.0 to 8.1.0 ([#392](https://github.com/thenativeweb/buntstift/issues/392)) ([cd806a6](https://github.com/thenativeweb/buntstift/commit/cd806a62a6cdf0953d2fb82a0b451f5cca579ebf))

## [4.0.24](https://github.com/thenativeweb/buntstift/compare/4.0.23...4.0.24) (2021-05-10)

### Bug Fixes

* bump hosted-git-info from 2.8.8 to 2.8.9 ([#382](https://github.com/thenativeweb/buntstift/issues/382)) ([9aebb9a](https://github.com/thenativeweb/buntstift/commit/9aebb9a61184b3e52df0ba9cc6818032dbca5e6f))

## [4.0.23](https://github.com/thenativeweb/buntstift/compare/4.0.22...4.0.23) (2021-04-23)

### Bug Fixes

* bump chalk from 4.1.0 to 4.1.1 ([#371](https://github.com/thenativeweb/buntstift/issues/371)) ([6e4a1f6](https://github.com/thenativeweb/buntstift/commit/6e4a1f69a473f95b216b6793af594930bde845d6))

## [4.0.22](https://github.com/thenativeweb/buntstift/compare/4.0.21...4.0.22) (2021-03-25)

### Bug Fixes

* Migrate from master to main. ([#357](https://github.com/thenativeweb/buntstift/issues/357)) ([e5b3040](https://github.com/thenativeweb/buntstift/commit/e5b30407ab81e7d779e9cc5122c0eefb541372c7))

## [4.0.21](https://github.com/thenativeweb/buntstift/compare/4.0.20...4.0.21) (2021-03-19)

### Bug Fixes

* bump ora from 5.3.0 to 5.4.0 ([#346](https://github.com/thenativeweb/buntstift/issues/346)) ([cf36518](https://github.com/thenativeweb/buntstift/commit/cf3651877a6c6f68485f7a1304fb64391359427c))

## [4.0.20](https://github.com/thenativeweb/buntstift/compare/4.0.19...4.0.20) (2021-03-02)

### Bug Fixes

* bump inquirer from 7.3.3 to 8.0.0 ([#337](https://github.com/thenativeweb/buntstift/issues/337)) ([4128e64](https://github.com/thenativeweb/buntstift/commit/4128e6430957a00a62e960048773b9e3aadfd0f8))

## [4.0.19](https://github.com/thenativeweb/buntstift/compare/4.0.18...4.0.19) (2021-01-22)

### Bug Fixes

* bump ora from 5.2.0 to 5.3.0 ([#310](https://github.com/thenativeweb/buntstift/issues/310)) ([e8993bd](https://github.com/thenativeweb/buntstift/commit/e8993bd0c75f8d43f84b13feb2a012358b1a4376))

## [4.0.18](https://github.com/thenativeweb/buntstift/compare/4.0.17...4.0.18) (2021-01-04)

### Bug Fixes

* bump ora from 5.1.0 to 5.2.0 ([#297](https://github.com/thenativeweb/buntstift/issues/297)) ([026fce5](https://github.com/thenativeweb/buntstift/commit/026fce50c929787182321037eab3be0010b2773c))

## [4.0.17](https://github.com/thenativeweb/buntstift/compare/4.0.16...4.0.17) (2020-11-03)

### Bug Fixes

* Fix headline for robot section in readme. ([#245](https://github.com/thenativeweb/buntstift/issues/245)) ([07bcfd9](https://github.com/thenativeweb/buntstift/commit/07bcfd978c1d24bd911ee7737285528b7f3db2b5))

## [4.0.16](https://github.com/thenativeweb/buntstift/compare/4.0.15...4.0.16) (2020-09-07)

### Bug Fixes

* bump ora from 5.0.0 to 5.1.0 ([#207](https://github.com/thenativeweb/buntstift/issues/207)) ([dbcf4d9](https://github.com/thenativeweb/buntstift/commit/dbcf4d93ddf183af96b8a42901ce512285e8e216))

## [4.0.15](https://github.com/thenativeweb/buntstift/compare/4.0.14...4.0.15) (2020-08-23)

### Bug Fixes

* bump @types/inquirer from 7.3.0 to 7.3.1 ([#197](https://github.com/thenativeweb/buntstift/issues/197)) ([07fc013](https://github.com/thenativeweb/buntstift/commit/07fc013cbc192fe9667473b816d78272b8ebd0d8))

## [4.0.14](https://github.com/thenativeweb/buntstift/compare/4.0.13...4.0.14) (2020-08-10)

### Bug Fixes

* bump ora from 4.1.0 to 5.0.0 ([#190](https://github.com/thenativeweb/buntstift/issues/190)) ([12cdbe8](https://github.com/thenativeweb/buntstift/commit/12cdbe8cf03a644e332a28f5db254c4e9edb20b9))

## [4.0.13](https://github.com/thenativeweb/buntstift/compare/4.0.12...4.0.13) (2020-08-06)

### Bug Fixes

* bump ora from 4.0.5 to 4.1.0 ([#188](https://github.com/thenativeweb/buntstift/issues/188)) ([1bed0f9](https://github.com/thenativeweb/buntstift/commit/1bed0f9ef1208460be17fa361d6f9a47c0fd7143))

## [4.0.12](https://github.com/thenativeweb/buntstift/compare/4.0.11...4.0.12) (2020-07-24)

### Bug Fixes

* bump ora from 4.0.3 to 4.0.5 ([#174](https://github.com/thenativeweb/buntstift/issues/174)) ([ea1e4a8](https://github.com/thenativeweb/buntstift/commit/ea1e4a8d7873a5eac8a739c9616d9a2b7fbb7426))

## [4.0.11](https://github.com/thenativeweb/buntstift/compare/4.0.10...4.0.11) (2020-07-23)

### Bug Fixes

* bump inquirer from 7.3.2 to 7.3.3 ([#178](https://github.com/thenativeweb/buntstift/issues/178)) ([d6149dd](https://github.com/thenativeweb/buntstift/commit/d6149ddd68f7436c3f4ab8d49f1ae7cdfec7525f))

## [4.0.10](https://github.com/thenativeweb/buntstift/compare/4.0.9...4.0.10) (2020-07-21)

### Bug Fixes

* bump @types/inquirer from 6.5.0 to 7.3.0 ([#177](https://github.com/thenativeweb/buntstift/issues/177)) ([5a9286f](https://github.com/thenativeweb/buntstift/commit/5a9286f1a3244a3f5eced32006361de61d3a4ebf))

## [4.0.9](https://github.com/thenativeweb/buntstift/compare/4.0.8...4.0.9) (2020-07-14)

### Bug Fixes

* bump inquirer from 7.3.1 to 7.3.2 ([#171](https://github.com/thenativeweb/buntstift/issues/171)) ([8b29970](https://github.com/thenativeweb/buntstift/commit/8b299701f2e34432d1a934738ebbe20a37135981))

## [4.0.8](https://github.com/thenativeweb/buntstift/compare/4.0.7...4.0.8) (2020-07-10)

### Bug Fixes

* bump inquirer from 7.3.0 to 7.3.1 ([#166](https://github.com/thenativeweb/buntstift/issues/166)) ([697464b](https://github.com/thenativeweb/buntstift/commit/697464b2de37de3abb684f7c89e6cd5af16eb429))

## [4.0.7](https://github.com/thenativeweb/buntstift/compare/4.0.6...4.0.7) (2020-07-02)

### Bug Fixes

* bump inquirer from 7.2.0 to 7.3.0 ([#160](https://github.com/thenativeweb/buntstift/issues/160)) ([7a7edab](https://github.com/thenativeweb/buntstift/commit/7a7edabcfa3b218c0ab674d4e5281ac71a7df5dc))

## [4.0.6](https://github.com/thenativeweb/buntstift/compare/4.0.5...4.0.6) (2020-06-15)

### Bug Fixes

* bump inquirer from 7.1.0 to 7.2.0 ([#157](https://github.com/thenativeweb/buntstift/issues/157)) ([a6666d2](https://github.com/thenativeweb/buntstift/commit/a6666d2c7a7b4e0b5fcadc365dcf8da23bfabc3d))

## [4.0.5](https://github.com/thenativeweb/buntstift/compare/4.0.4...4.0.5) (2020-06-10)

### Bug Fixes

* bump chalk from 4.0.0 to 4.1.0 ([#155](https://github.com/thenativeweb/buntstift/issues/155)) ([0ad7789](https://github.com/thenativeweb/buntstift/commit/0ad778935f8054f0794e50de2c84c9c168e3af31))

## [4.0.4](https://github.com/thenativeweb/buntstift/compare/4.0.3...4.0.4) (2020-04-03)

### Bug Fixes

* bump chalk from 3.0.0 to 4.0.0 ([#144](https://github.com/thenativeweb/buntstift/issues/144)) ([2133587](https://github.com/thenativeweb/buntstift/commit/2133587e94743294b36bed2a38f9da165e731d06))

## [4.0.3](https://github.com/thenativeweb/buntstift/compare/4.0.2...4.0.3) (2020-03-10)

### Bug Fixes

* bump inquirer from 7.0.6 to 7.1.0 ([#131](https://github.com/thenativeweb/buntstift/issues/131)) ([0a47363](https://github.com/thenativeweb/buntstift/commit/0a473634b20046ed28cdac3aa85aaf4ef464aa30))

## [4.0.2](https://github.com/thenativeweb/buntstift/compare/4.0.1...4.0.2) (2020-03-04)

### Bug Fixes

* bump inquirer from 7.0.5 to 7.0.6 ([#127](https://github.com/thenativeweb/buntstift/issues/127)) ([6f4f195](https://github.com/thenativeweb/buntstift/commit/6f4f195affe70ea3501ee3e5079ae8128d599220))

## [4.0.1](https://github.com/thenativeweb/buntstift/compare/4.0.0...4.0.1) (2020-02-29)

### Bug Fixes

* bump inquirer from 7.0.4 to 7.0.5 ([#122](https://github.com/thenativeweb/buntstift/issues/122)) ([1493642](https://github.com/thenativeweb/buntstift/commit/1493642fee1b5c8dc48ca7df5db69951f9c4be01))

# [4.0.0](https://github.com/thenativeweb/buntstift/compare/3.1.0...4.0.0) (2020-02-10)

### Features

* Rewrite from scratch. ([#107](https://github.com/thenativeweb/buntstift/issues/107)) ([a1103e6](https://github.com/thenativeweb/buntstift/commit/a1103e6db89e8cecbddd50229083829578112903))
* Trigger release. ([#108](https://github.com/thenativeweb/buntstift/issues/108)) ([cf95e20](https://github.com/thenativeweb/buntstift/commit/cf95e20a75016a9e8917881a20160063cabd5817))

### BREAKING CHANGES

* Buntstift was rewritten from scratch, and most of its APIs have more or less changed.

# [3.1.0](https://github.com/thenativeweb/buntstift/compare/3.0.4...3.1.0) (2020-01-27)

### Features

* Introduce echo option to hide input when asking for passwords. ([#92](https://github.com/thenativeweb/buntstift/issues/92)) ([e6a6f56](https://github.com/thenativeweb/buntstift/commit/e6a6f5625f68d9dc36d07ef17d6c76e0d2b3d0ae))

## [3.0.4](https://github.com/thenativeweb/buntstift/compare/3.0.3...3.0.4) (2020-01-25)

### Bug Fixes

* bump inquirer from 7.0.3 to 7.0.4 ([#89](https://github.com/thenativeweb/buntstift/issues/89)) ([9642ea8](https://github.com/thenativeweb/buntstift/commit/9642ea8ede5a1677d6b5bedbb7e74432f1104cdc))

## [3.0.3](https://github.com/thenativeweb/buntstift/compare/3.0.2...3.0.3) (2020-01-07)

### Bug Fixes

* bump inquirer from 7.0.2 to 7.0.3 ([#70](https://github.com/thenativeweb/buntstift/issues/70)) ([0ac078a](https://github.com/thenativeweb/buntstift/commit/0ac078a51b2f89cbe1a567025f776b6497e6cf49))

## [3.0.2](https://github.com/thenativeweb/buntstift/compare/3.0.1...3.0.2) (2020-01-05)

### Bug Fixes

* bump inquirer from 7.0.1 to 7.0.2 ([#68](https://github.com/thenativeweb/buntstift/issues/68)) ([9d13b79](https://github.com/thenativeweb/buntstift/commit/9d13b79c9aba9b09ca8e9ac1d46eb00988dfd41f))

## [3.0.1](https://github.com/thenativeweb/buntstift/compare/3.0.0...3.0.1) (2019-12-15)

### Bug Fixes

* bump inquirer from 7.0.0 to 7.0.1 ([#52](https://github.com/thenativeweb/buntstift/issues/52)) ([66045e3](https://github.com/thenativeweb/buntstift/commit/66045e361b2a71db43fad5243fbd82fde7484a8c))

repository: thenativeweb/buntstift

gha_language: TypeScript

repo_name: thenativeweb/buntstift


text:
# SyslogKinesis
Receive Syslog Events and send to a Kinesis Stream or Firehose.

## Configuration
Settings can be applied using appsettings.json or environment variables. The stream name and stream type need to be set based on the stream to be published to in AWS Kinesis. The listening port is the TCP port that the syslog server listens on for syslog messages.

{
  "STREAMNAME": "example-kinesis-stream",
  "STREAMTYPE": "firehose",
  "LISTENINGPORT": 514
}

## Example Messages
The Json below is an example of the data which will arrive in Kinesis when processing a syslog message.

{
    "Timestamp": "2020-06-29T09:20:09.6176152Z",
    "Level": "Information",
    "MessageTemplate": "{@SourceIp}: {@SyslogMessage}",
    "RenderedMessage": "\"<IP_ADDRESS>\": SyslogMessage { Facility: User, Severity: Notice, Datestamp: 06/29/2020 09:20:05, Content: \"ec2-user: sample message\", Host: \"ip-172-12-0-1\" }",
    "Properties": {
        "SourceIp": "<IP_ADDRESS>",
        "SyslogMessage": {
            "_typeTag": "SyslogMessage",
            "Facility": "User",
            "Severity": "Notice",
            "Datestamp": "2020-06-29T09:20:05.0000000",
            "Content": "ec2-user: sample message",
            "Host": "ip-172-12-0-1"
        }
    }
}

license: MIT

repository: OnKey/SyslogKinesis

branch_name: refs/heads/master

extension: md

license_type: permissive

repo_name: OnKey/SyslogKinesis


text:
# NEWS-APP

## AUTHOR
[Andrew John](https://github.com/andyjohn23)

## DESCRIPTION
This is a news web application made using flask python framework
to display news and article content through the use of the news-api.

## LIVE SITE
(https://news-andy.herokuapp.com/)

## DEVELOPMENT INSTALLATION
To clone the project:
1. Create and Open a folder in Visual Studio Code then initialize git,
   ```
   git clone https://github.com/andyjohn23/new-api-flask.git

   ```

1. cd to the folder then install requirements.txt
   ```
   cd new-api-flask
   pip install -r requirements.txt

   ```

1. API Configuration
   ```
   export API_KEY="<enter your api key>"

   ```
1. Run the application
   ```
   ./start.sh

   ```

1. Open Browser
   ```
   The application will run on server <IP_ADDRESS>:5000

   ```

## BEHAVIOUR DRIVEN DEVELOPMENT
1. User searches the news site online
1. User views the top news headlines in different category
1. User can view different news articles by clicking on any news headlines

## TECHNOLOGY USED
1. Flask Framework
1. HTML
1. CSS
1. Heroku
1. News API
1. Python3.6

## CONTACT INFROMATION
For any concern about the application you can contact me through<EMAIL_ADDRESS>
## LICENSE
* [MIT License](https://github.com/andyjohn23/new-api-flask/blob/main/LICENSE)
* Copyright (c) 2020 Andrew John

branch_name: refs/heads/main


text:
# Jest: Coverage per file

## Table of Contents

- [Installation](#installation)
- [Introduction](#introduction)
- [Philosophy behind the project](#philosophy-behind-the-project)
- [Commands](#commands)

## Installation

```bash
# locale
npm install -D jest-cpf

# glboale
npm install -g jest-cpf
```

## Introduction

`jest-cpf` generates one coverage per file, so that the value is not corrupted by dependencies.

```bash
jest-cpf --config <path-to-jest-config>
```

All arguments from the call are passed 1-to-1 to Jest.

The following options are read from the jest config file:

- `testMatch`
- `collectCoverageFrom`
- `coverageDirectory` _(optional)_
- `coveragePathIgnorePatterns` _(optional)_
- `coverageThreshold.global` _(optional, default value 95%)_

### Example

![Preview](./images/example.png)

## Philosophy behind the project

The best and fastest way to test is to use Unit Tests.
All dependencies of a function or class are mocked, so very simple tests can be written.
A disadvantage of my opinion is that the interface/interaction with the dependency is not tested.

During Integration Tests, a large part of the application or library is tested and only external dependencies (e.g. database) are mocked.
This makes it very difficult to test all code paths and it is time intensive.

In my opinion, the combination of both types is the best way.
So we write "unit tests", but with the enhancement that the direct dependencies of the function/class are not mocked (external dependencies (e.g. database) are always mocked here).

When creating coverage with unit tests, it is clear which code blocks or paths have not yet been tested.
With the combination it is no longer clear which function/class has been tested directly or indirectly (i.e. as a dependency).

For this reason I wrote this tool that generates the coverage per test file and creates an overview.
Due to the flexibility of JavaScript it is very easy to achieve a coverage of 100%.
This should also be used as a minimum guideline.
Of course, regardless of the coverage value, logical and meaningful tests must be written.
The 100% coverage value only guarantees that each code path has been tested at least once.
How meaningful the test is is the programmer's responsibility.

The tool does not evaluate whether a test is successful or not.

## Commands

| Command              | Type  | Description                             |
| -------------------- | ----- | --------------------------------------- |
| `npm run build`      | Build | Build the library                       |
| `npm run test`       | Test  | Run all tests                           |
| `npm run test:watch` | Test  | Watching mode from test                 |
| `npm run coverage`   | Test  | Create the coverage table (this tool)   |
| `npm run lint`       | Lint  | Checks if the eslint rules are followed |

repository: kettil/jest-cpf

gha_license_id: MIT

repo_name: kettil/jest-cpf


text:
# node-logware
## Request Logger
Request logging middleware for node web services. Use this library to log the requests hitting the web service. It is advised to use **Request-Id** in request headers to trace the spread of requests in microservice environment.

**Package library:** [logware](https://www.npmjs.com/package/node-logware)
**Stable Version:** 1.0.2

## How to install?
run `npm i node-logware`

## How to use?
```
const express = require('express')
const RequestLogger = require('node-logware')
const app = express()
const port = 3000

const logger = new RequestLogger('ERROR','Test')
app.use(logger.log)

app.get('/', (req, res) => res.send('Hello World!'))
app.get('/400', (req, res) => res.status(400).send('Bad request'))

app.listen(port, () => console.log(`Example app listening on port ${port}!`))
```

### Log example:
The log prints in json string format.
```{"level":"error","service":"test","uri":"/bad?a=1","responseCode":400,"requestId":"23545"}```


text:
# Packaging App

`Note: In order to packaging app make sure you already have androidjs-builder`

```sh
cd myfirstapp
androidjs b
```
It will generate apk file inside `dist` folder

If this `build` command generates any error, try to `build` with `force command`

```sh
androidjs b -f
```

repository: android-js/androidjs

gha_language: JavaScript

repo_name: android-js/androidjs


text:
---
layout: page
title: About
permalink: /about/
---

Welcome. This is where I share my musings on how to create and live with intention. I hope you find them useful.

### Influences

Everything from my writing style to the layout of this blog is influenced by great bloggers such as [Derek Sivers,](https://sivers.org/) [Cal Newport,](http://calnewport.com/blog/) [The Minimalists,](https://www.theminimalists.com/) and [Seth Godin.](https://seths.blog/) If you know of any other great bloggers, especially women and memebers of minorites, I'd love to hear your recommendations in the comments (coming soon).

gha_language: CSS


text:
# speedment-aggregator-example
Example on how to use the Speedment Enterprise aggregator.

## Installation
These examples are intended to be used together with the [MySQL Employees](https://dev.mysql.com/doc/employee/en/) database. Make sure the database exists accessible with username `root` and password `password` on `localhost:3306` before running the application. Alternatively you can configure a different data source by modifying the [application.yml](application.yml)-file.

## Usage
Three controllers are defined.

| HTTP Method | Endpoint            | Description                                              |
| ----------- | ------------------- | -------------------------------------------------------- |
| GET         | /salary/mean        | Compute the mean salary of men and women                 |
| GET         | /salary/variance    | Compute the mean and variance in salary of men and women |
| GET         | /salary/correlation | Compute Pearson's Correlation Coefficient                |

repository: speedment/speedment-code-samples

gha_language: Java

repo_name: speedment/speedment-code-samples


text:
# TableTop.JS

## A Demo game of Checkers using TableTop.JS

This project is intended to show a working game built with TableTop.JS however it does not show the steps used to create it. To get a better idea of how to create your own TableTop.JS game from scratch, check out our tutorials [here](https://github.com/andrewjmeier/TableTop.JS)

### How To Run

1. Clone the Repo using: `git clone https://github.com/qstearns/TableTopCheckersDemo.git`

2. cd into the directory `cd TableTopCheckersDemo`

3. Follow steps 9-12 [here] (https://github.com/andrewjmeier/TableTop.JS/blob/master/tutorials/markdown/setup.md)

4. `npm install webpack`

5. `npm run webpack`

6. Then in a new terminal window, `node server.js`

7. Navigate to `localhost:3000` to start playing checkers. If you open multiple tabs you can test out multiplayer.

8. You can make modifications to the files in the `checkers` directory to play around with a TableTop.JS game.

Happy Coding!

repository: qstearns/TableTopCheckersDemo

repo_name: qstearns/TableTopCheckersDemo


text:
----------------------------
title : ROUNDSD (Intel x86/64 assembly instruction)
cat_title : ROUNDSD
ref_title : ROUNDSD
published : 2020-09-01
path : /X86-64 명령어 레퍼런스/R
publish_date: 2020-09-01
----------------------------

#@ ROUNDSD

** Round Scalar Double Precision Floating-Point Values**

```lec-info
아래 표를 해석하는 방법은 [x86-64 명령어 레퍼런스 읽는 법](/316) 글을 참조하시기 바랍니다.
```

|**Opcode\htmlonly{*}/**\newline{}**Instruction**|**Op/ **\newline{}**En**|**64/32 bit **\newline{}**Mode **\newline{}**Support**|**CPUID **\newline{}**Feature **\newline{}**Flag**|**Description**|
|------------------------------------------------|------------------------|------------------------------------------------------|--------------------------------------------------|---------------|
|66 0F 3A 0B /r ibROUNDSD xmm1, xmm2/m64, imm8|RMI|V/V|SSE4_1|Round the low packed double precision floating-point value in xmm2/m64 and place the result in xmm1. The rounding mode is determined by imm8.|
|VEX.NDS.LIG.66.0F3A.WIG 0B /r ibVROUNDSD xmm1, xmm2, xmm3/m64, imm8|RVMI|V/V|AVX|Round the low packed double precision floating-point value in xmm3/m64 and place the result in xmm1. The rounding mode is determined by imm8. Upper packed double precision floating-point value (bits[127:64]) from xmm2 is copied to xmm1[127:64].|
### Instruction Operand Encoding

|Op/En|Operand 1|Operand 2|Operand 3|Operand 4|
|-----|---------|---------|---------|---------|
|RMI|ModRM:reg (w)|ModRM:r/m (r)|imm8|NA|
|RVMI|ModRM:reg (w)|VEX.vvvv (r)|ModRM:r/m (r)|imm8|
### Description

Round the DP FP value in the lower qword of the source operand (second operand) using the rounding mode spec-ified in the immediate operand (third operand) and place the result in the destination operand (first operand). The rounding process rounds a double-precision floating-point input to an integer value and returns the integer result as a double precision floating-point value in the lowest position. The upper double precision floating-point value in the destination is retained.

The immediate operand specifies control fields for the rounding operation, three bit fields are defined and shown in Figure 4-24. Bit 3 of the immediate byte controls processor behavior for a precision exception, bit 2 selects the source of rounding mode control. Bits 1:0 specify a non-sticky rounding-mode value (Table 4-18 lists the encoded values for rounding-mode field).

The Precision Floating-Point Exception is signaled according to the immediate operand. If any source operand is an SNaN then it will be converted to a QNaN. If DAZ is set to '1 then denormals will be converted to zero before rounding.

128-bit Legacy SSE version: The first source operand and the destination operand are the same. Bits (VLMAX-1:64) of the corresponding YMM destination register remain unchanged.

VEX.128 encoded version: Bits (VLMAX-1:128) of the destination YMM register are zeroed.

### Operation
#### ROUNDSD (128-bit Legacy SSE version)
```info-verb
DEST[63:0] <-  RoundToInteger(SRC[63:0], ROUND_CONTROL)
DEST[VLMAX-1:64] (Unmodified)
```
#### VROUNDSD (VEX.128 encoded version)
```info-verb
DEST[63:0] <-  RoundToInteger(SRC2[63:0], ROUND_CONTROL)
DEST[127:64] <-  SRC1[127:64]
DEST[VLMAX-1:128] <-  0
```

### Intel C/C++ Compiler Intrinsic Equivalent

```cpp
ROUNDSD: __m128d mm_round_sd(__m128d dst, __m128d s1, int iRoundMode);__m128d mm_floor_sd(__m128d dst, __m128d s1);__m128d mm_ceil_sd(__m128d dst, __m128d s1);
```
### SIMD Floating-Point Exceptions

Invalid (signaled only if SRC = SNaN)

Precision (signaled only if imm[3] = '0; if imm[3] = '1, then the Precision Mask in the MXSCSR is ignored and preci-sion exception is not signaled.)

Note that Denormal is not signaled by ROUNDSD.

### Other Exceptions

See Exceptions Type 3.


text:
# Changelog

## 2.0 (2017-09-24)
- Ported NumberKit to Swift 4. This is a major change that might break existing clients.
- Added support for `toPower(of:)` for all integer types
- Added new operators to `BigInt`: `<<`, `>>`, `<<=`, `>>=`, `%`, `%=`
- Introduced new integer protocol: `IntegerNumber`
- Renamed `FloatNumber` into `FloatingPointNumber`

## 1.6 (2017-05-01)
- Refactored directory structure
- Support for Swift Package Manager

## 1.5 (2016-09-03)
- Migrated library to Xcode 8.0, Swift 3.0
- Renamed protocols to match the Swift 3 style guidelines
- Simplified a few implementations, making use of new Swift 3 APIs

## 1.4 (2016-03-28)
- Code now compatible with Xcode 7.3, Swift 2.2
- Turned `BigInt` into a struct to avoid garbage collection overhead

## 1.3 (2016-02-09)
- Significant performance improvements to speed up the BigInt/String conversion method
- Minor feature additions to rational numbers
- Playground (created by Dan Kogai)

## 1.2 (2016-01-17)
- Added arithmetic operations to `Rational<T>` which keep track of overflows
- Simplified implementation of `BigInt`
- Included new `BigInt` operations, e.g. a computed property for coercions to `Double`

## 1.1 (2015-10-19)
- Completed implementation of `Complex<T>`

## 1.0 (2015-08-24)
- Completed implementation of `BigInt`
- Completed implementation of `Rational<T>`
- `Complex<T>` still missing a large range of functions and tests

repository: zoecarver/swift-numberkit

repo_name: zoecarver/swift-numberkit


text:
# Chelsea: Workbench Installation

FarCry workbench for Chelsea project development.

## Setting up the Daemonite Vagrant Workbench

This only needs to be the once per workstation. If you already have a working Vagrant environment you can skip this part.

1.  Install VirtualBox: https://www.virtualbox.org/wiki/Downloads
2.  Install Vagrant http://www.vagrantup.com/downloads.html
3.  Install vagrant-hostmanager plugin: `vagrant plugin install vagrant-hostmanager`

## Setting Up Project Environment

Requires an existing installation of the standard Daemonite Vagrant Workbench.

    git clone https://github.com/modius/farcry-env-chelsea.git
    cd farcry-env-chelsea
    git submodule update --init
    vagrant up

_note: you may be asked for a password the first time you run vagrant up. this is the host manager plugin asking for permission to modify your hosts file._

# Running the Workbench

## Starting the App

Change directory to the root of the project and `vagrant up`.

Site access:

- http://chelsea.local (or http://IPADDRESS)
- http://chelsea.local/webtop (farcry/farcry)
- http://chelsea.local/lucee/admin/server.cfm (pwd: farcry)

To restart Lucee server `vagrant ssh` onto the virtual:

```
sudo /etc/init.d/lucee_ctl restart
```

The website listens for `*.vagrant.com` host headers so `vagrant share` should work :)

## Refreshing Database

This VM installs the project database from the install files in the project.
Therefore re-exporting and committing the installation files is equivilent to
updating the development environment.

To refresh the database in the Vagrant VM it's easiest to DROP and CREATE the database.

```
vagrant ssh
mysql -u root
...
mysql> DROP DATABASE projectdatabase;
Query OK, 82 rows affected (0.08 sec)
mysql> CREATE DATABASE projectdatabase;
Query OK, 1 row affected (0.00 sec)
quit
```

Then <http://localhost:8080/webtop/install> to reinstall FarCry app.

# Simple Deployment Pipeline

Assuming you have an existing installation on a production Ubuntu box you can update the environment to the exact tags and/or branches nominated in the project `./install/deploy.txt` file by running the `update.yml` playbook.

1.  check code into repo
2.  Logon to production server:
    `ssh -i ~/.ssh/projectname.pem<EMAIL_ADDRESS>3.  Run update playbook
    `sudo ansible-playbook -c local /opt/provision/provisioning/update.yml`

repository: modius/farcry-env-chelsea

repo_name: modius/farcry-env-chelsea


text:
---
layout: default
---

# 1996-05-14 - Re: Free demo disk of "distorted number" crypto

## Header Data

From: "Mark O. Aldrich"<EMAIL_ADDRESS>To: William Ono<EMAIL_ADDRESS>Message Hash: 9e5dbe984048fe494350f95db42f0971e0dc5812bd995b049140c358a6e7784d

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-05-14 00:32:03 UTC

Raw Date: Tue, 14 May 1996 08:32:03 +0800

## Raw message

```
{% raw  %}From: "Mark O. Aldrich"<EMAIL_ADDRESS>Date: Tue, 14 May 1996 08:32:03 +0800
To: William Ono<EMAIL_ADDRESS>Subject: Re: Free demo disk of "distorted number" crypto
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

On Fri, 10 May 1996, William Ono wrote:

> On Fri, 10 May 1996, Mark O. Aldrich wrote:
>
> > technical.  They are also offering a technical write-up via fax-back at
> ><PHONE_NUMBER>.
>
> I just called that number, but got no answer after ten rings.  Could you
> please verify it?

I just checked it.  It's working.  It answered with the "menu" after two
rings.

Anyone else try using this thing?

-------------------------------------------------------------------------
|      Liberty is truly dead              |Mark Aldrich                 |
|    when the slaves are willing          |GRCI INFOSEC Engineering     |
|     to forge their own chains<EMAIL_ADDRESS>          |
|        STOP THE CDA NOW<EMAIL_ADDRESS>|
|_______________________________________________________________________|
|The author is PGP Empowered.  Public key at:  finger<EMAIL_ADDRESS>|
|    The opinions expressed herein are strictly those of the author     |
|         and my employer gets no credit for them whatsoever.           |
-------------------------------------------------------------------------

{% endraw %}
```

## Thread

+ Return to [May 1996](/archive/1996/05)

+ Return to "["Mark O. Aldrich" <maldrich@grci.com>](/authors/mark_o_aldrich_maldrich_at_grci_com_)"

+ _Unknown thread root_
  + 1996-05-14 (Tue, 14 May 1996 08:32:03 +0800) - Re: Free demo disk of "distorted number" crypto - _"Mark O. Aldrich"<EMAIL_ADDRESS>


text:
---
title: "Beginner's Guide to Creating Discourse Plugins Part 5: Admin Interfaces"
weight: 320
---

Previous tutorials in this series:

Part 1: [Creating a basic plugin](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins/30515)
Part 2: [Plugin outlets](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-2-plugin-outlets/31001)
Part 3: [Custom Settings](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-3-custom-settings/31115)
Part 4: [git setup](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-4-git-setup/31272)

---

Sometimes [site settings](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-3-custom-settings/31115) aren't enough of an admin interface for your plugin to work the way you want. For example, if you install the [discourse-akismet](https://github.com/discourse/discourse-akismet) plugin, you might have noticed that it adds a navigation item to the admin plugins section in of your Discourse:

In this tutorial we'll show you how to add an admin interface for your plugin. I'm going to call my plugin purple-tentacle, in honor of [one of my favorite computer games](https://en.wikipedia.org/wiki/Day_of_the_Tentacle). Seriously, **[I really love that game](https://twitter.com/eviltrout/status/627119973773746176)**!

### Setting up the Admin Route

Let's start by adding a `plugin.rb` like we've done in previous parts of the tutorial.

**plugin.rb**
```ruby
# name: purple-tentacle
# about: A sample plugin showing how to add a plugin route
# version: 0.1
# authors: Robin Ward
# url: https://github.com/discourse/purple-tentacle

add_admin_route 'purple_tentacle.title', 'purple-tentacle'

Discourse::Application.routes.append do
  get '/admin/plugins/purple-tentacle' => 'admin/plugins#index', constraints: StaffConstraint.new
end
```

The `add_admin_route` line tells Discourse that this plugin will need a link on the `/admin/plugins` page. Its title will be `purple_tentacle.title` from our i18n translations file and it will link to the `purple-tentacle` route.

The lines below that set up the server side mapping of routes for our plugin. One assumption Discourse makes is that almost every route on the front end has a server side route that provides data. For this example plugin we actually don't need any data from the back end, but we need to tell Discourse to serve up something in case the user visits `/admin/plugins/purple-tentacle` directly. This line just tells it: 'hey if the user visits that URL directly on the server side, serve the default plugins content!'

(If this is confusing don't worry too much, we'll come back to it in a future tutorial when we handle server side actions.)

Next, we'll add a template that will be displayed when the user visits the `/admin/plugins/purple-tentacle` path. It will just be a button that shows an animated gif of purple tentacle when the user clicks a button:

**assets/javascripts/discourse/templates/admin/plugins-purple-tentacle.hbs**
```handlebars
{{#if tentacleVisible}}
  <div class='tentacle'>
    <img src="http://eviltrout.com/images/tentacle.gif">
  </div>
{{/if}}

<div class='buttons'>
  {{d-button label="purple_tentacle.show" action="showTentacle" icon="eye"}}
</div>
```

If you've learned the basics of handlebars the template should be pretty simple to understand. The `d-button` is a component in discourse we use for showing a button with a label and icon.

To wire up our new template we need to create a route map:

**assets/javascripts/discourse/purple-tentacle-route-map.js.es6**
```javascript
export default {
  resource: 'admin.adminPlugins',
  path: '/plugins',
  map() {
    this.route('purple-tentacle');
  }
};
```

A route map is something we added to discourse to make it so that plugins could add routes to the ember application. The syntax within `map()` is very similar to [Ember's router](http://guides.emberjs.com/v1.10.0/routing/defining-your-routes/). In this case our route map is very simple, it just declares one route called `purple-tentacle` under `/admin/plugins`.

Finally, let's add our translation strings:

**config/locales/en.yml**
```yaml
en:
  js:
    purple_tentacle:
      title: "Purple Tentacle"
      show: "Show Purple Tentacle"

```
If you restart your development server, you should be able to visit `/admin/plugins` and you'll see our link! If you click it, you'll see the button to show our purple tentacle:

Unfortunately, when you click the button, nothing happens :(

If you look at your developer console, you should see an error that provides a clue to why this is: `Uncaught Error: Nothing handled the action 'showTentacle'`

Ah yes, the reason is in our handlebars template we are depending on a couple of things:

1. That when the user clicks the button, `showTentacle` will be called.
2. `showTentacle` should set the property `tentacleVisible` to true so that the image shows up.

If you haven't read the [Ember Guides on Controllers](http://guides.emberjs.com/v1.13.0/controllers/) now is a good time to do so, because we'll implement a controller for our `purple-tentacle` template that will handle this logic.

Create the following file:

**assets/javascripts/discourse/controllers/admin-plugins-purple-tentacle.js.es6**
```javascript
export default Ember.Controller.extend({
  tentacleVisible: false,

  actions: {
    showTentacle() {
      this.set('tentacleVisible', true);
    }
  }
});
```

And now when we refresh our page, clicking the button shows our animated character!

I'll leave it as an extra exercise to the reader to add a button that hides the tentacle when clicked :smile:

If you are having trouble getting your version of this plugin working, I've pushed it to [github](https://github.com/eviltrout/purple-tentacle).

---
### More in the series

Part 6: [Acceptance Tests](https://meta.discourse.org/t/beginner-s-guide-to-creating-discourse-plugins-part-6-acceptance-tests/32619)

Source: [https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-5-admin-interfaces/31761](https://meta.discourse.org/t/beginners-guide-to-creating-discourse-plugins-part-5-admin-interfaces/31761)

repository: erlend-sh/learndiscourse

branch_name: refs/heads/gh-pages

repo_name: erlend-sh/learndiscourse


text:
# Welcome to JPL
## About
![](https://i.imgur.com/lPuSHq5.png)
>
> JPL is a own little fun project. Here I code a own Programming Language with an Interpreter.
>

### What can you do with it?
- variables (Strings, Numbers(Int/Float) and Lists)
- if statements (comparisons and locical operations)
- for/while loops (with break and continue)
- functions (with and without return)
- run code files(.jpl)
### How do you start?
First, download the repository with git:`git clone https://github.com/Ampferl/jpl.git`
You also need to download [Python 3](https://www.python.org/downloads/release/python-380/)!

If everything is installed, you can go to the downloaded folder and enter `python3 shell.py` into the console.
Or execute a program immediately: `python3 shell.py example/functions.jpl`

Now you can use the programming language!

For Example enter: `print("Hello World")`

### Explanations:
#### Variables
`var :identifier = :expr`

#### If statements
You can use only if:
```
if(:expr){
    :statements
}
```
or with elif:
```
if(:expr){
    :statements
}elif(:expr){
    :statements
}
```
or also a else at the end:
```
if(:expr){
    :statements
}else{
    :statements
}
```
#### For/While Loops
##### For-Loops:
```
for(:start_value;:end_value[;:step]){
    :statements
}
```
For Example:
```
for(i=1;10){
    print(i)
}
```
##### While-Loops:
```
while(:expr){
    :statements
}
```
For Example:
```
var i = 0
while(i<=10){
    print(i)
    var i = i + 1
}
```
Also you can use a `break` or a `continue`!
#### Functions
```
function :func_name(:args){
    :statements
}
```
Also you can use a `return`!
#### Run Code Files
```
run(:path_to_file)
```
### Some Extra Functions
#### I/O Functions
- `print(expr)`
- `input()`
#### Check expr Type
- `is_number(expr)`
- `is_string(expr)`
- `is_list(expr)`
- `is_function(expr)`
#### Lists
- `append_l(list, value)`
- `pop_l(list, index)`
- `extend_l(listA, listB)`
- `len_l(list)`
- `get_l(list, index)`
- `set_l(list, index, string)`
- `split(string, separator)`
- `join(list, separator)`
- `search_l(list, search_string)`
#### Math
- `pow(base, exponent)`
- `mod(num, divisor)`
- `rand(start_value, end_value)`
- `pi()`
- `round(:number, :digits)`
- `cos(:number)`
- `sin(:number)`
- `tan(:number)`
#### Formats
- `int(:string)`
- `str(:number)`
- `float(:string/:number)`
- `hash(:string, :type)` `(Types: md5, sha1, sha256, sha512)`
#### Date
- `datetime()`
- `date()`
- `date_year()`
- `date_month()`
- `date_month_name()`
- `date_day()`
- `time()`
#### String
- `replace(string, replace_this, replacer)`
#### File I/O
- `read_file(:path)` `(output -> list)`
- `write_file(:path, :list, :append)` `(:append: true/false)`

## Resources
- [The super tiny interpreter Tutorial](https://github.com/keyz/the-super-tiny-interpreter)
- [Lets build a simple Interpreter](https://ruslanspivak.com/lsbasi-part1/)
- [Learn Programming by Morpheus Tutorial](https://www.youtube.com/watch?v=nVMlDghNcHg&list=PLNmsVeXQZj7onyAB57T0xqV2ZVSZOo79a)

repository: Ampferl/jpl

gha_language: Python

repo_name: Ampferl/jpl


text:
---
title: 'Bio'
slug: 'bio'
template: 'page'
---

## Hi there, my name is Bin Kim (Youngbin Kim).
I'm 23 and I'm from South Korea. I like computer science. Always interested to learn new tech, framework, language, or anything in general.

###Food I like
  * Steak
  * Asparagus
  * Cheesecake
  * Sushi
  * Pho, .... maybe just any food in general

###Online games I play
  * League of Legends
  * Counter Strike : Global Offensive

###Favourite singleplayers (in order of favour)
  * God of War
  * Red Dead Redemption 2
  * Uncharted 4
  * Horizon Zero Dawn

###Education
####Highschool
  * Governor Simcoe Secondary School, Grade 11 - 12
  * Canadian International School Vietnam (HCMC), Grade 9 - 10

####University
  * B.ASc, Mechatronics Engieering Honours, Coop, University of Waterloo
      * Engineering International Student Award, 2014
      * _Expected graduation 2023_

***
###Technical Skills
####Languages
  - Javascript (ES6, Coffeescript), Ruby, Objective-c, Java, C++

####Frameworks
  - Ruby on Rails, Ember, React, iOS, tvOS, WPF

####Databases
  - MySQL, MongoDB

####Others
  - Google Cloud Build

***


text:
# Terraform DigitalOcean Docker Swarm mode

Terraform module to provision a Docker Swarm mode cluster in a single availability zone on DigitalOcean.

- [Requirements](#requirements)
- [Usage](#usage)
- [Examples](#examples)
- [Swarm set-up](#swarm-set-up)

## Requirements

- Terraform >= 0.11.7
- Digitalocean account / API token with write access
- SSH Keys added to your DigitalOcean account
- [jq](https://github.com/stedolan/jq)

## Usage

```hcl
module "swarm_mode_cluster" {
  source           = "github.com/a-feld/terraform-digitalocean-docker-swarm-mode"
  domain           = "do.example.com"
  total_managers   = 3
  total_workers    = 2
  ssh_keys         = [1234, 1235, ...]

  remote_api_ca          = "${var.ca_cert}"
  remote_api_certificate = "${var.server_cert}"
  remote_api_key         = "${var.server_key}"

  manager_size = "s-2vcpu-4gb"
  worker_size  = "s-1vcpu-1gb"
  manager_tags = ["${digitalocean_tag.cluster.id}", "${digitalocean_tag.manager.id}"]
  worker_tags  = ["${digitalocean_tag.cluster.id}", "${digitalocean_tag.worker.id}"]
  providers = {}
}
```

### SSH Key

Terraform uses an SSH key to connect to the created droplets in order to issue `docker swarm join` commands. By default this uses `~/.ssh/id_rsa`.You also need to ensure the public key is added to your DigitalOcean account and it's listed in the `ssh_keys` list.

### Exposing the Docker API

You can expose the Docker API to interact with the cluster remotely. This is done by providing a certificate and private key. Creating these keys can be done using the [tls provider](https://www.terraform.io/docs/providers/tls/index.html). Instructions on creating the required certificates are available [here](https://coreos.com/os/docs/latest/generate-self-signed-certificates.html).

> Note that for this to work, you need to open the Docker remote API port in both iptables (not necessary with default images) and the DigitalOcean cloud firewall.

### Supported OS

This module will only work on CoreOS distributions provided by DigitalOcean.

### Ports & Firewall

Ensure the following ports are open on the local firewall;

Port       | Description                       | Note
---------- | --------------------------------- | -------
`2377/TCP` | cluster management communications | Cluster
`7946/TCP` | Container network discovery       | Cluster
`7946/UDP` | Container network discovery       | Cluster
`4789/UDP` | Container overlay network         | Cluster
`2376/TCP` | Docker Remote API | Optionally, when exposing the Docker Remote API

For example, when using the Docker images provided by DigitalOcean, run the following command:

```bash
ufw allow 2377
ufw allow 7946
ufw allow 7946/udp
ufw allow 4789/udp
```

#### Cloud Firewall

Also set up firewall rules on DigitalOcean for the cluster, to ensure only cluster members can access the internal Swarm ports. You can use the [digitalocean-docker-swarm-firewall](https://github.com/thojkooi/terraform-digitalocean-docker-swarm-firewall) module for this. Look in the [firewall examples directory](https://github.com/a-feld/terraform-digitalocean-docker-swarm-mode/tree/master/examples/firewall) for inspiration on how to do this.

## Examples

For examples, see the [examples directory](https://github.com/a-feld/terraform-digitalocean-docker-swarm-mode/tree/master/examples).

## Swarm mode set-up

### Manager nodes

First a single Swarm mode manager is provisioned. This is the initial leader node. If you have additional manager nodes, these will be provisioned after this step. Once the manager nodes have been provisioned, Terraform will initialize the Swarm on the first manager node and retrieve the join tokens. It will then have all the managers join the cluster.

If the cluster is already up and running, Terraform will check with the first leader node to refresh the join tokens. It will join any additional manager nodes that are provisioned to the Swarm mode cluster.

#### Access the API

To expose the Swarm mode API in HA, create a load balancer and forward tcp traffic to port `2376`. Ensure you expose the docker remote API using certificates when doing this. Alternatively you can do DNS round-robin load balancing.

When you do not wish to expose your Docker API, you can use SSH to connect to one of the manager nodes and access the Docker API through this.

### Worker nodes

Worker nodes should be used to run the Docker Swarm mode Services. By default, 2 worker nodes are provisioned. Set the number of desired worker nodes using the following variable: `total_workers`.

## License

This repository is forked from [thojkooi/terraform-digitalocean-docker-swarm-mode](https://github.com/thojkooi/terraform-digitalocean-docker-swarm-mode)

[MIT © Thomas Kooi](LICENSE)


text:
# Path Planning Project

This project consists of a C++ implementation of a Path Planner to control the car using Udacity's self-driving simulator. The main goal of this project is to develop a C++ path planner that successfully navigates the vehicle around the virtual highway (Udacity simulator) without colliding with any other vehicle, repecting the speed limit of 50mph and with maximum acceleration and jerk of 10m/s^2 and 50m/s^2, respectively.

## Files

The following files are part of this project:
* main.cpp: main file that integrates the controller with the simulator;
* vehicle.cpp: vehicle class which defines the Finite State Machine;
* cost_function.cpp: cost_function class to compute the optimal path;

## Dependencies

* cmake >= 3.5
  * All OSes: [click here for installation instructions](https://cmake.org/install/)
* make >= 4.1
  * Linux: make is installed by default on most Linux distros
  * Mac: [install Xcode command line tools to get make](https://developer.apple.com/xcode/features/)
  * Windows: [Click here for installation instructions](http://gnuwin32.sourceforge.net/packages/make.htm)
* gcc/g++ >= 5.4
  * Linux: gcc / g++ is installed by default on most Linux distros
  * Mac: same deal as make - [install Xcode command line tools]((https://developer.apple.com/xcode/features/)
  * Windows: recommend using [MinGW](http://www.mingw.org/)
* [uWebSockets](https://github.com/uWebSockets/uWebSockets)
  * Run either `install-mac.sh` or `install-ubuntu.sh`.
  * If you install from source, checkout to commit `e94b6e1`, i.e.
    ```
    git clone https://github.com/uWebSockets/uWebSockets
    cd uWebSockets
    git checkout e94b6e1
    ```

## Compiling and running

The main program can be built and run by doing the following from the project top directory

1. mkdir build && cd build
2. cmake .. && make
3. ./path_planning
4. Run the Udacity Simulator (./udacity_term3_simulator)
5. Press "Select" in the simulator
6. Enjoy!

## Behaviour Planning

The behaviour planner is responsible to generate the path and the speed to be followed by the car. From a high-level perspective, the planner has to decide if the car should stay or change lane.
From a low level, the planner has to generate the map's coordinates (path) to be followed and decide at which speed the car should run. In order to achieve such a behaviour, our self-driving car implements a Finite State Machine (FSM) with 5 states, which the transition is realized through the minimization of a cost function.
Finally, the path is generated using the spline math tool.

#### Accronyms

* KL - Keep Lane
* PLCL - Prepare Lane Change Left
* PLCR - Prepare Lane Change Right
* LCL - Lane Change Left
* LCR - Lane Change Right

### Finite State Machine

The FSM starts with a KL state. Depending on the system context (highway), the FSM may stay at KL state or change to PLCL or PLCR. At each state, all possible states are evaluated using a cot function and the state with the minimum cost is selected. The FSM machine works as follows:

* At initial state (KL) and according to the cost function, the FSM can stay at the same lane or prepare  to change lanes (PLCL or PLCR). However, only the possible lane is available if the car is in one of the lateral lanes (lanes 0 or 2); The car will stay in the same (KL) if there is no other vehicle that prevents it from reaching the maximum legal speed limit of the road.
* If the PLCL or PLCR are selected, the car prepares to change lane. The preparation checks if the car speed and the buffer space are safe to change lanes. The car may stay in the PLCL or PLCR state until the buffer is safe enough to change lane or even decide to return to state KL if the cost to change the lane is no longer relevant.
* When there is enough buffer space to change lane, the FSM will transition to LCL/LCR states. The FSM returns to state KL as soon the lane change is over (car is between the lane lines).

### Cost Function

The cost function evaluates the cost for the FSM to change state. It evaluates different metrics trying to identify the next optimal state. Below, the metrics and how they are evaluated are presented in detail:

1. Change Lane:
The change lane cost function adds a "confort" constant penalty if the vehicle decides to change lane.

```cpp
if (start_lane != end_lane) {
    cost += COMFORT;
}
```

2. Buffer:
The buffer cost function computes how long it has to the vehicle in front. It is computed by dividing the distance from the vehicle in front by the current speed of the ego car. Note that the cost is smaller if the vehicle in question is behind. It helps the ego car to choose a lane with no traffic in the front.

```cpp
double time_steps = abs (vehicle->collider.closest_approach)/(abs(vehicle->speed) * MPH_TO_MS);

if (time_steps > DESIRED_BUFFER) {
    return 0;
}

double multiplier = 1.0 - pow((time_steps / DESIRED_BUFFER), 2);
cost = multiplier * DANGER;
if (vehicle->collider.closest_approach < 0) {
    // car in the back
    cost /= 10;
}
```

3. Inefficiency:
This function evaluates the vehicle speed defined in this state in relation to the maximum speed alloed. States with speeds closer to the maximum speed are more efficient (lower cost), in contrast, states with lower speeds are less efficient (higher cost).

```cpp
double diff = (49.5 - vehicle->update.target_v) / 49.5;
cost = pow(diff, 2) * EFFICIENCY;
```

4. Target:
The target cost evaluates the speed comparison between the ego car and the vehicle in front (possible collision). If all lanes are blocked (possible collision), this function helps the car to choose a lane which the speed of the vehicle in question matches closer to the ego car.

```cpp
if (!vehicle->collider.collision) {
    // no possible collision, no cost
    return 0;
}

double diff = (vehicle->collider.target_speed - vehicle->speed) / vehicle->collider.target_speed;
cost = pow(diff, 2) * EFFICIENCY;
```

5. Collision:
The collision cost is the most important function. If strongly penalizes the states which the risk of collision is more imminent. However, in order to force the car to escape from heavy traffic, the collision cost is smaller whenever is safe to change lane. It was found that it helps the car to find a more appropriate situation, instead of just following the car ahead until it opens a passageway.

```cpp
double time_to_collide = abs (vehicle->collider.distance) / (abs(vehicle->speed) * MPH_TO_MS);
cost = exp(-pow(time_to_collide, 2)) * COLLISION;
if (vehicle->trajectory.lane_end != vehicle->trajectory.lane_start) {
    if(time_to_collide > DESIRED_BUFFER) {
        // safe to change lane
        cost /= 10;
    }
}
```

### Path Generation and Speed Control
The FSM defines, from a high-level point of view, the lane and the speed to be followed for every state. For instance, if the car is changing lane, the FSM will return a different one from the current lane. The same is for speed, the FSM will return for every state the target speed the ego car should follow.

```cpp
vehicle.Update(car_x, car_y, car_s, car_d, car_yaw, car_speed, lane, ref_velocity, prev_size*.02);
vehicle.NextState(sensor_fusion);
// new lane
lane = vehicle.update.lane;
// target speed
ref_velocity = vehicle.update.ref_v;
```

After the FSM returns the lane and speed to follow, the controller generates up to 50 map coordinates back to the simulator. These points define the path to be followed by the car.

#### Acceleration and Jerk control
The requirements of this project state that the acceleration and jerk should not exceed 10m/s^2 and 50m/s^2, respectively. In order to meet this requirement, the car acceleration is increased or decreased by steps of steps 0.224m/s^2. The limit of 0.224 is computed as follows:
max acceleration of 10 m/s², with delta time of 0.02 seconds in miles per hour:  ![equation](http://latex.codecogs.com/gif.latex?%5Cfrac%7B2.24%7D%7B10%7D)

```cpp
if (!collider.collision && ref_speed < update.target_v && ref_speed < 49.5) {
    update.ref_velocity += 0.224;
} else if (ref_speed > update.target_v && ref_speed > 0) {
    update.ref_velocity -= 0.224;
}
```

#### Path: Spline
Spline is a piecewise polynomial parametric curve. They are popular for their simplicity use and accuracy. Our path planner uses the Spline methematical function for curve fitting the generated map coordinates. The spline helps to define a smooth path for the car.
The path generation is an elaborate st of tasks. First, our planner has to generate equally spaced map coordinates. We use the helper function "getXY" to generate points from Frenet to Cartesian coordinates.

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

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

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

After, we shift the orientation to the ego for simplicity and feed the points to the spline generator. We used the [Cubic Spline library ](http://kluge.in-chemnitz.de/opensource/spline/) to generate the spline curve.

```cpp
for (int i = 0; i < pysx.size(); i++) {
    // shift car reference angle to 0 degrees
    double shift_x = ptsx[i] - ref_x;
    double shift_y = ptsy[i] - ref_y;

    ptsx[i] = (shift_x * cos(0-ref_yaw) - shift_y * sin(0 - ref_yaw);
    ptsy[i] = (shift_x * sin(0-ref_yaw) - shift_y * cos(0 - ref_yaw);
}

// Create a spline
tk::spline s;

// set (x,y) points to the spline
s.set_points(ptsx, ptsy);
```

After, with the spline function already done, we have to recompute the map points back from the curve. This task is accomplished by breaking up the spline into equidistant points that respect the desired speed.

![Spline](images/spline.png)

Considering the time interval of 20ms, the travel distance of 30 meters on x-axis with the speed "ref_speed", we have:

```cpp
// calculate how to break up spline points so that we travel at our desired reference velocity
double target_x = 30.0;
double target_y = s(target_x);
double target_dist = sqrt(target_x * target_x + target_y * target_y);

// N distance
double N = target_dist / (.02 * ref_velocity);
```

Finally, the final part is to compute the coordinates from spline and shift its orientation back.
```cpp
x_add_on = x_point;
for(int i = 0; i < 50-previous_path_x.size(); i++){
  //map X coordinate distance for every spline point
  double x_point = x_add_on + (target_x)/N;
  double y_point = s(x_point);
  //increment for next spline point
  x_add_on = x_point;

  double x_ref = x_point;
  double y_ref = y_point;

  //rotate back to normal after rotation it earlier
  x_point = (x_ref * cos(ref_yaw)-y_ref*sin(ref_yaw));
  y_point = (x_ref * sin(ref_yaw)+y_ref*cos(ref_yaw));

  x_point += ref_x;
  y_point += ref_y;

  //return to simulator
  next_x_vals.push_back(x_point);
  next_y_vals.push_back(y_point);
}
```


text:
# BareMetal-newlib

Introduction
------------

This repository contains the files, script, and instructions necessary to build the [newlib](http://sourceware.org/newlib/) C library for BareMetal OS. The latest version of Newlib as of this writing is 3.3.0

newlib gives BareMetal OS access to the standard set of C library calls like `printf()`, `scanf()`, `memcpy()`, etc.

These instructions are for executing on a 64-bit Linux host. Building on a 64-bit host saves us from the steps of building a cross compiler. The latest distribution of Ubuntu was used while writing this document.

Building Details
----------------

You will need the following Linux packages. Use your prefered packange manager to install them:

	autoconf libtool sed gawk bison flex m4 texinfo texi2html unzip make automake1.11

Run the build script:

	./build-newlib.sh

After a lengthy compile you should have a libc.a and crt0.o in your directory

libc.a is the compiled C library that is ready for linking. crt0.o is the starting binary stub for your program.

By default libc.a will be about 6.8 MiB. You can `strip` it to make it a little more compact. `strip` can decrease it to about 1.4 MiB.

	strip --strip-debug libc.a

Compiling Your Application
--------------------------

By default GCC will look in predefined system paths for the C headers. This will not work correctly as we need to use the Newlib C headers. Using the `-I` argument we can point GCC where to find the correct headers. Adjust the path as necessary.

	gcc -I newlib-2.5.0/newlib/libc/include/ -c test.c -o test.o
	ld -T app.ld -o test.app crt0.o test.o libc.a

repository: SIGAN/BareMetal-newlib

repo_name: SIGAN/BareMetal-newlib


text:
![](man/figures/logo.png)

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

Open-source PR monitoring platform, complete with a built-in crawler to for data collection. See the [website](https://auritus.io/) for more information.

**This is a beta**

## Installation

``` r
# install.packages("remotes")
remotes::install_github("JohnCoene/auritus", dependencies = TRUE)
```

## Setup

__Read the [documentation](https://auritus.io/#/) before doing any of this__

1. Run `ìnit_auritus`
2. Configure your dashboard in `_auritus.yml`
3. Run `setup_auritus` and follow the steps printed in the console.
4. Launch the dashboard with `launch_auritus`


text:
<!--
  Title: Loadavg-windows
  Description: Node.js module that enables os.loadavg() on Windows OS
  Author: fider
  -->

# About
Use `require('loadavg-windows')` to enjoy `os.loadavg()` on Windows OS  (or force using custom implementation on any other OS).

# Motivation

Currently Node.js on Windows platform do not implements `os.loadavg()` functionality - it returns `[0,0,0]`

# Important details
- os.loadavg\(\) returns [**A**, **B**, **C**]
  - A - expect value different than 0 **after few seconds**.
  - B - expect value different than 0 after first **5 minutes**.
  - C - expect value different than 0 after first **15 minutes**.
- **Requiring it on other operating systems have NO influence,**
  unless `require('loadavg-windows').enableCustomLoadavg()` called manually.

# Usage
Just one line required to enjoy `os.loadavg()` on Windows OS:
```js
require('loadavg-windows');

setInterval( () => {
  console.log( os.loadavg() );
}, 3000);
```

Can be activated on any other OS in case native version not working
(on Windows OS it is enabled by default)
```js
const { useCustomLoadavg } = require('loadavg-windows');
useCustomLoadavg();
```

# Installation
Requires [Node.js](https://nodejs.org/) v4.8.7

`npm install loadavg-windows`

# Not important details:

This is pure JavaScript, platform-independent implementation of `os.loadavg()` that can be used on Windows system
(or any other system that for some reasons do not supports loadavg)

It uses only `os.cpus()` for proper calculations.

# Test of version<EMAIL_ADDRESS>
- First chart demonstrates results during 4h runtime with sample every 21 seconds.
- Second chart is to check for memory leaks. Memory consumption includes also http server (no memory leaks).

![image](https://raw.githubusercontent.com/fider/loadavg-windows/master/test/runtime-test-v.1.1.1.png)

repository: fider/loadavg-windows

repo_name: fider/loadavg-windows


text:
---
layout: "unit"
title: "Guide Entry 92.01.01"
path: "/curriculum/guides/1992/1/92.01.01.x.html"
unitTitle: "Mathematics in Relation to the Social and Economic History of the Public School System"
unitAuthor: "Joyce Bryant"
keywords: "History Economics Mathematics"
recommendedFor: "Recommended for History and Math, grades 7-8"
---

Guide Entry to 92.01.01:

The purpose of this unit is twofold. First, it will explore education on a national, state, and local level, and second, it will help students develop and enhance their problem skills in mathematics, pre-algebra and Algebra I.

(Recommended for History and Math, grades 7-8)

Key Words

History Economics Mathematics

gha_language: HTML


text:
---
title: "Facebook Research"
date: 2019-08-05T10:24:25-04:00
draft: false
---
Facebook AI Systems Hardware/Software Co-Design research award on Scalable Graph Learning Algorithms
---
https://research.fb.com/blog/2019/05/announcing-the-winners-of-the-ai-system-hardware-software-co-design-research-awards/
---
Deep learning has boosted the machine learning field at large and created significant increases in the performance of
tasks including speech recognition, image classification, object detection, and recommendation. It has opened the door
to complex tasks, such as self-driving and super-human image recognition. However, the important techniques used in
deep learning, e.g. convolutional neural networks, are designed for Euclidean data type and do not directly apply on
graphs. This problem is solved by embedding graphs into a lower dimensional Euclidean space, generating a regular
structure. There is also prior work on applying convolutions directly on graphs and using sampling to choose
neighbor elements. Systems that use this technique are called graph convolution networks (GCNs). GCNs have proven
to be successful at graph learning tasks like link prediction and graph classification. Recent work has pushed the
scale of GCNs to billions of edges but significant work remains to extend learned graph systems beyond
recommendation systems with specific structure and to support big data models such as streaming graphs.

This project will focus on developing scalable graph learning algorithms and implementations that open the door for
learned graph models on massive graphs. We plan to approach this problem in two ways. First, developing a scalable
high performance graph learning system based on existing GCNs algorithms, like GraphSage, by improving the
workflow on shared-memory NUMA machines, balancing computation between threads, optimizing data movement,
and improving memory locality. Second, we will investigate graph learning algorithm-specific decompositions and
develop new strategies for graph learning that can inherently scale well while maintaining high accuracy. This includes
traditional partitioning, however in general we consider breaking the problem into smaller pieces, which, when solved
will result in a solution to the bigger problem. We will explore decomposition results from graph theory, for example,
forbidden graphs and the Embedding Lemma, and determine how to apply such results into the field of graph learning.
We will investigate whether these decompositions could assist in a dynamic graph setting.

gha_language: Shell


text:
# Day Planner
## Description
With this app you can add an event in a specific time frame. You will notice the blocks are color coded. Red is present time, green is future, and grey is past time. When refreshing the page, your event stays saved.

*https://amandaln.github.io/day_planner/

## Technologies
HTML

CSS/Bootstrap

JavaScript/JQuery

## Usage
![Work day planer](./assets/Screenshotplanner.png)

## Maintainer
Amanda Nelson

## License
[MIT](https://choosealicense.com/licenses/mit/)


text:
# EventSource Services

Some of the EventSources (`webhook`, `github`, `gitlab`, `sns`, `slack`,
`Storage GRID` and `stripe`) start an HTTP service to receive the events, for
your convenience, there is a field named `service` within EventSource spec can
help you create a `ClusterIP` service for testing.

For example:

```yaml
apiVersion: argoproj.io/v1alpha1
kind: EventSource
metadata:
  name: webhook
spec:
  service:
    ports:
      - port: 12000
        targetPort: 12000
  webhook:
    example:
      port: "12000"
      endpoint: /example
      method: POST
```

However, the generated service is **ONLY** for testing purpose, if you want to
expose the endpoint for external access, please manage it by using native K8s
objects (i.e. a Load Balancer type Service, or an Ingress), and remove `service`
field from the EventSource object.

For example, you can create a K8s service with the selector `eventsource-name: webhook`
to select pods created for the "webhook" event source, like the following:

```yaml
apiVersion: v1
kind: Service
metadata:
  name: webhook-eventsource
spec:
  ports:
  - port: 12000
    protocol: TCP
    targetPort: 12000
  selector:
    eventsource-name: webhook
  type: NodePort
```

Then you can expose the service for external access using native K8s objects as mentioned above.

You can refer to [webhook heath check](webhook-health-check.md) if you need a
health check endpoint for LB Service or Ingress configuration.

repository: argoproj/argo-events

gha_language: Go

repo_name: argoproj/argo-events


text:
# Petri net model using AlgebraicPetri.jl
Micah Halter (@mehalter), 2020-07-13

## Introduction

One representation of the SIR model is to think of it as the combination of two
interactions, transmission and recovery.
[AlgebraicPetri.jl](https://github.com/AlgebraicJulia/AlgebraicPetri.jl) allows
you to define a theory of modeling (e.g. Epidemiology), and then provides a DSL
for defining models in that theory as open dynamical systems where the
underlying theory is preserved. This implementation defines the SIR model as the
composition of two interactions defined at domain-level semantics, transmission
and recovery, and then generates an appropriate
[Petri.jl](https://github.com/mehalter/Petri.jl) model that can generate ODE,
SDE, and jump process solvers.

## Libraries

````julia
using AlgebraicPetri.Epidemiology
using Petri
using Catlab.Theories
using Catlab.CategoricalAlgebra.ShapeDiagrams
using Catlab.Graphics
using OrdinaryDiffEq
using StochasticDiffEq
using DiffEqJump
using Random
using Plots

# helper function to visualize categorical representation
display_wd(ex) = to_graphviz(ex, orientation=LeftToRight, labels=true);
````

````
display_wd (generic function with 1 method)
````

## Define a Theory

AlgebraicPetri comes packaged with an `Epidemiology` module with a basic,
predefined theory of epidemiology models. The source starts by defining a theory
in a specified category.  Here we have 4 types ($S$: susceptible, $E$: exposed,
$I$: infected, $R$: recovered, $D$: dead) and 5 domain processes
($transmission: S \otimes I \rightarrow I$,
$exposure: S \otimes I \rightarrow E \otimes I$,
$illness: E \rightarrow I$, $recovery: I \rightarrow R$,
$death: I \rightarrow D$).  This defines a theory thata can be use to describe
epidemiology models at domain-level semantics.

````julia

@present InfectiousDiseases(FreeBiproductCategory) begin
    S::Ob
    E::Ob
    I::Ob
    R::Ob
    D::Ob
    transmission::Hom(S⊗I, I)
    exposure::Hom(S⊗I, E⊗I)
    illness::Hom(E,I)
    recovery::Hom(I,R)
    death::Hom(I,D)
end
````

To be able to build up large Petri nets using these terms, we must define the
building block Petri nets that describe each of the interactions. For this we
have the following code that defines 3 petri nets: `spontaneous_petri` defines a
petri net with 2 states, and a transition from $S_1$ to $S_2$ to represent a
spontaneous change; `transmission_petri` defines a petri net where $S_1$ and
$S_2$ interact and produce 2 $S_2$; and lastly `exposure_petri` where there are
3 states and a transition where $S_1$ and $S_2$ interact and produce an $S_2$
and $S_3$ to represent an infected population causing the susceptible population
to become exposed.  Lastly, we need to define a dictionary that connects the
objects from the theory to the petri net objects that define the interactions.

````julia

ob = PetriCospanOb(1)
spontaneous_petri = PetriCospan([1], Petri.Model(1:2, [(Dict(1=>1), Dict(2=>1))]), [2])
transmission_petri = PetriCospan([1], Petri.Model(1:2, [(Dict(1=>1, 2=>1), Dict(2=>2))]), [2])
exposure_petri = PetriCospan([1, 2], Petri.Model(1:3, [(Dict(1=>1, 2=>1), Dict(3=>1, 2=>1))]), [3, 2])

const FunctorGenerators = Dict(S=>ob, E=>ob, I=>ob, R=>ob, D=>ob,
        transmission=>transmission_petri, exposure=>exposure_petri,
        illness=>spontaneous_petri, recovery=>spontaneous_petri, death=>spontaneous_petri)
````

## Transitions

Using the categorical framework provided by the AlgebraicJulia environment, we
can think of building models as the combination of known building block open
models.  For example we have $transmission: S \otimes I \rightarrow I$ and
$recovery: I \rightarrow R$ interactions defined in the Epidemiology module of
AlgebraicPetri which can be visualized as the following Petri nets.

Transmission (where $S_1 = S$ and $S_2 = I$):

````julia
Graph(decoration(F_epi(transmission)))
````

![](figures/pn_algebraicpetri_4_1.svg)

Recovery (where $S_1 = I$ and $S_2 = R$):

````julia
Graph(decoration(F_epi(recovery)))
````

![](figures/pn_algebraicpetri_5_1.svg)

In this approach we can think of an sir model as the composition of transmission
and recovery. This allows us to define the relationship that the infected
population coming out of the transmission interaction is the same as population
of infected in the recovery interaction.

````julia
sir_wiring_diagram = transmission ⋅ recovery
display_wd(sir_wiring_diagram)
````

![](figures/pn_algebraicpetri_6_1.svg)

using the function `F_epi` provided by `AlgebraicPetri.Epidemiology`, we can
convert this categorical definition of SIR to the Petri net representation and
visualize the newly created model (where $S_1 = S$, $S_2 = I$, and $S_3 = R$).

````julia
sir_model = decoration(F_epi(sir_wiring_diagram));
Graph(sir_model)
````

![](figures/pn_algebraicpetri_7_1.svg)

## Time domain

````julia
tmax = 40.0
tspan = (0.0,tmax);
````

````
(0.0, 40.0)
````

## Initial conditions

````julia
u0 = [990,10,0]; # S,I,R
````

````
3-element Array{Int64,1}:
 990
  10
   0
````

## Parameter values

````julia
p = [0.05*10.0/sum(u0),0.25]; # β*c/N,γ
````

````
2-element Array{Float64,1}:
 0.0005
 0.25
````

## Random number seed

We set a random number seed for reproducibility.

````julia
Random.seed!(1234);
````

````
Random.MersenneTwister(UInt32[0x000004d2], Random.DSFMT.DSFMT_state(Int32[-
1393240018,<PHONE_NUMBER>, 45497681,<PHONE_NUMBER>, 436273599,<PHONE_NUMBER>, -20437
16458,<PHONE_NUMBER>, -254908435,<PHONE_NUMBER>  …  -599655111,<PHONE_NUMBER>, 36765
5457,<PHONE_NUMBER>, -1278750689,<PHONE_NUMBER>, -597141475, 249849711, 382, 0]),
 [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0  …  0.0, 0.0, 0.0, 0.0,
0.0, 0.0, 0.0, 0.0, 0.0, 0.0], UInt128[0x00000000000000000000000000000000,
0x00000000000000000000000000000000, 0x00000000000000000000000000000000, 0x0
0000000000000000000000000000000, 0x00000000000000000000000000000000, 0x0000
0000000000000000000000000000, 0x00000000000000000000000000000000, 0x0000000
0000000000000000000000000, 0x00000000000000000000000000000000, 0x0000000000
0000000000000000000000  …  0x00000000000000000000000000000000, 0x0000000000
0000000000000000000000, 0x00000000000000000000000000000000, 0x0000000000000
0000000000000000000, 0x00000000000000000000000000000000, 0x0000000000000000
0000000000000000, 0x00000000000000000000000000000000, 0x0000000000000000000
0000000000000, 0x00000000000000000000000000000000, 0x0000000000000000000000
0000000000], 1002, 0)
````

## Generating and running models

### As ODEs

````julia
prob_ode = ODEProblem(sir_model,u0,tspan,p)
sol_ode = solve(prob_ode, Tsit5());
plot(sol_ode)
````

![](figures/pn_algebraicpetri_12_1.png)

### As SDEs

````julia
prob_sde,cb = SDEProblem(sir_model,u0,tspan,p)
sol_sde = solve(prob_sde,LambaEM(),callback=cb);
plot(sol_sde)
````

![](figures/pn_algebraicpetri_13_1.png)

### As jump process

````julia
prob_jump = JumpProblem(sir_model, u0, tspan, p)
sol_jump = solve(prob_jump,SSAStepper());
plot(sol_jump)
````

![](figures/pn_algebraicpetri_14_1.png)

## Appendix
### Computer Information
```
Julia Version 1.4.2
Commit 44fa15b150* (2020-05-23 18:35 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Core(TM) i7-8850H CPU @ 2.60GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-8.0.1 (ORCJIT, skylake)
Environment:
  JULIA_HOME = /home/micah/.local/share/julia
  JULIA_LOAD_PATH = :
  JULIA_DEPOT_PATH = /home/micah/Documents/git/sir-julia/env/.julia
  SPACESHIP_JULIA_SYMBOL = ∴

```

### Package Information

```
Status `~/Documents/git/sir-julia/Project.toml`
[46ada45e-f475-11e8-01d0-f70cc89e6671] Agents 3.2.1
[4f99eebe-17bf-4e98-b6a1-2c4f205a959b] AlgebraicPetri 0.3.1
[b19378d9-d87a-599a-927f-45f220a2c452] ArrayFire 1.0.6
[c52e3926-4ff0-5f6e-af25-54175e0327b1] Atom 0.12.16
[6e4b80f9-dd63-53aa-95a3-0cdb28fa8baf] BenchmarkTools 0.5.0
[be33ccc6-a3ff-5ff2-a52e-74243cff1e17] CUDAnative 3.2.0
[134e5e36-593f-5add-ad60-77f754baafbe] Catlab 0.7.1
[3a865a2d-5b23-5a0f-bc46-62713ec82fae] CuArrays 2.2.2
[717857b8-e6f2-59f4-9121-6e50c889abd2] DSP 0.6.7
[2445eb08-9709-466a-b3fc-47e12bd697a2] DataDrivenDiffEq 0.2.0
[a93c6f00-e57d-5684-b7b6-d8193f3e46c0] DataFrames 0.21.4
[459566f4-90b8-5000-8ac3-15dfb0a30def] DiffEqCallbacks 2.13.3
[aae7a2af-3d4f-5e19-a356-7da93b79d9d0] DiffEqFlux 1.17.0
[c894b116-72e5-5b58-be3c-e6d8d4ac2b12] DiffEqJump 6.9.3
[41bf760c-e81c-5289-8e54-58b1f1f8abe2] DiffEqSensitivity 6.23.0
[6d1b261a-3be8-11e9-3f2f-0b112a9a8436] DiffEqTutorials 0.1.0
[0c46a032-eb83-5123-abaf-570d42b7fbaa] DifferentialEquations 6.15.0
[31c24e10-a181-5473-b8eb-7969acd0382f] Distributions 0.23.4
[634d3b9d-ee7a-5ddf-bec9-22491ea816e1] DrWatson 1.14.3
[587475ba-b771-5e3f-ad9e-33799f191a9c] Flux 0.10.4
[0c68f7d7-f131-5f86-a1c3-88cf8149b2d7] GPUArrays 3.4.1
[28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71] GR 0.50.1
[523d8e89-b243-5607-941c-87d699ea6713] Gillespie 0.1.0
[7073ff75-c697-5162-941a-fcdaad2a7d2a] IJulia 1.21.2
[e5e0dc1b-0480-54bc-9374-aad01c23163d] Juno 0.8.2
[2ee39098-c373-598a-b85f-a56591580800] LabelledArrays 1.3.0
[961ee093-0014-501f-94e3-6117800e7a78] ModelingToolkit 3.13.0
[429524aa-4258-5aef-a3af-852621145aeb] Optim 0.22.0
[1dea7af3-3e70-54e6-95c3-0bf5283fa5ed] OrdinaryDiffEq 5.41.0
[4259d249-1051-49fa-8328-3f8ab9391c33] Petri 1.1.0
[91a5bcdd-55d7-5caf-9e0b-520d859cae80] Plots 1.5.4
[e6cf234a-135c-5ec9-84dd-332b85af5143] RandomNumbers 1.4.0
[c5292f4c-5179-55e1-98c5-05642aab7184] ResumableFunctions 0.5.1
[428bdadb-6287-5aa5-874b-9969638295fd] SimJulia 0.8.0
[05bca326-078c-5bf0-a5bf-ce7c7982d7fd] SimpleDiffEq 1.1.0
[2913bbd2-ae8a-5f71-8c99-4fb6c76f3a91] StatsBase 0.33.0
[f3b207a7-027a-5e70-b257-86293d7955fd] StatsPlots 0.14.6
[789caeaf-c7a9-5a7d-9973-96adeb23e2a0] StochasticDiffEq 6.24.0
[44d3d7a6-8a23-5bf8-98c5-b353f8df5ec9] Weave 0.10.2
[37e2e46d-f89d-539d-b4ee-838fcccc9c8e] LinearAlgebra
[cf7118a7-6976-5b1a-9a39-7adc72f591a4] UUIDs
```

repository: snowdj/sir-julia

repo_name: snowdj/sir-julia


text:
# [Lightweight remote procedure calls](http://www.cs.virginia.edu/~zaher/classes/CS656/bershad.pdf)

## Main ideas
* Reducing overhead of RPC calls in the same host (cross-domain)
* Assumption that most calls are cross-domain and not cross-machine

## 4 key techniques
* Client thread runs procedure in server's domain
* Client and server share access to the A-stack (argument stack)
* Simpler stubs (mechanisms to make server believe arguments are on its address space)
* Avoidance of shared data structures to improve multiprocessor performance

## Overview of regular RPC for comparison
* RPC of a null procedure consists of at least 3 context switches:
    1. Procedure call
    2. Kernel trap and change of processor's virtual memory
    3. Trap again to send procedure to server
    4. Return value from server requires another context switch
* Stubs in RPC are general (usable in cross-machine RPC) and therefore expensive to create
* Overhead of copying arguments 4 times:
    1. client to kernel
    2. kernel to server
    3. server to kernel
    4. kernel to client
* Validation of message sender - the kernel cannot just trust any RPC trap
* Two context switches

## Implementation of LRPC
* Execution-stack creation is delayed until needed
* E-stack <-> A-Stack association delayed until needed
* This makes the call faster

### Binding
* Same as RPC, servers export interfaces, clients bind to them
* Implementation:
  * Clerk registers the interface with the server
  * Client bind to said interface by making import call via kernel
  * **Kernel allocation begins**
  * Clerk replies to kernel with a Procedure Descriptor List which contains:
    * a descriptor for every procedure in the interface
    * the size of the A-stack for arguments
  * Kernel allocates an A-Stack for each Procedure Descriptor
  * Kernel allocates a "linkage record" for each A-Stack which links caller return address with A-Stack
  * **Kernel allocation ends**
  * Client receives a Binding Object (BO) and A-Stack list.

### Calling
* Procedures are represented by a stub in the client and server
* Stub is responsible for pushing client arguments into A-Stack and trapping to kernel
* Kernel validates trap -> finds available E-Stack (more on it later) in server domain
* Kernel uploads client's thread stack pointera to run off the E-Stack
* Kernel performs upcall into server stuff at Procedure Descriptor found in the BO
* Kernel procedure returns value through its own stub

## Multiprocessors
* Cache domain context on idle processors
* On every procedure, the kernel can look for processors with warm cache
* If a warm cache is found it:
  * avoids context switching
  * preserves locality between RPC calls!

## Argument copying
* In traditional RPC - 4 copies
  * Stub stack to RPC message
  * Message in client domain to kernel
  * Kernel to server domain
  * Server domain to server stack
* In LRPC - 1 copy:
  * Client stub stack to shared A-stack
* Much lighter and w/o context switching

license: Unlicense

repository: dLobatog/paper-notes

path: /Lightweight RPC.md

filename: Lightweight RPC.md

repo_name: dLobatog/paper-notes


text:
# Module 3: X-Ray

## Collect invocation traces in X-Ray

Integrating with X-Ray

1. In the `serverless.yml` under the `provider` section, add the following:

```yml
tracing:
  apiGateway: true
  lambda: true
```

2. Add the following back to the `provider` section:

```yml
iamRoleStatements:
  - Effect: Allow
    Action:
      - xray:PutTraceSegments
      - xray:PutTelemetryRecords
    Resource: "*"
```

This enables X-Ray tracing for all the functions in this project. However, we still need to give each function the IAM permission for `xray:PutTraceSegments` and `xray:PutTelemetryRecords`.

Notice that in the `custom` section, we have the following:

```yml
serverless-iam-roles-per-function:
  defaultInherit: true
```

This tells the `serverless-iam-roles-per-function` plugin that all the functions' IAM roles should inherit from the permissions specified in `provider.iamRoleStatements`, so now every function would have the necessary permissions to talk to X-Ray.

The `provider` section should now look like this

```yml
provider:
  name: aws
  runtime: nodejs12.x
  stage: dev
  region: eu-west-1
  environment:
    LOG_LEVEL: ${self:custom.logLevel.${self:custom.stage}, self:custom.logLevel.default}
    SAMPLE_DEBUG_LOG_RATE: 0.1
  tracing:
    apiGateway: true
    lambda: true
  iamRoleStatements:
    - Effect: Allow
      Action:
        - xray:PutTraceSegments
        - xray:PutTelemetryRecords
      Resource: "*"
```

3. Deploy the project

`npm run sls -- deploy`

4. Load up the landing page, and place an order. Then head to the X-Ray console and see what you get.

![](/images/mod03-001.png)

![](/images/mod03-002.png)

![](/images/mod03-003.png)

Instrumenting AWSSDK

At the moment we're not getting a lot of value out of X-Ray. We can get much more information about what's happening in our code if we instrument the various steps.

To begin with, we can instrument the AWS SDK so we track how long calls to DynamoDB and SNS takes in the traces.

1. Install `aws-xray-sdk-core` as dependency. Go to the project root and run

`npm i --save aws-xray-sdk-core`

2. Modify `functions/get-restaurants.js` and replace `const AWS = require('aws-sdk')` on ln3 with the following

```javascript
const AWSXRay = require('aws-xray-sdk-core')
const AWS = AWSXRay.captureAWS(require('aws-sdk'))
```

3. Repeat step 2 for

* `functions/place-order.js`

* `functions/search-restaurants.js`

* `functions/notify-restaurant.js`

4. Deploy the project

`npm run sls -- deploy`

5. Load up the landing page, and place an order. Then head to the X-Ray console and see what you get now.

![](/images/mod03-004.png)

![](/images/mod03-005.png)

![](/images/mod03-006.png)

![](/images/mod03-007.png)

Instrumenting HTTP calls

We can get a lot value if we could see the traces for `get-index` function and the corresponding trace for the `get-restaurants` function in one screen.

![](/images/mod03-008.png)

Then it's proper distributed tracing! It's not very helpful if you're restricted to only what happens inside one function.

Fortunately, you can instrument the built-in `https` module with the X-Ray SDK.

1. Modify `functions/get-index.js` and just before ln5

`const http = require('axios')`

insert the following

```javascript
const AWSXRay = require('aws-xray-sdk-core')
AWSXRay.captureHTTPsGlobal(require('https'))
```

After this change, you should have something like this:

```javascript
const wrap = require('@dazn/lambda-powertools-pattern-basic')
const Log = require('@dazn/lambda-powertools-logger')
const fs = require("fs")
const Mustache = require('mustache')
const AWSXRay = require('aws-xray-sdk-core')
AWSXRay.captureHTTPsGlobal(require('https'))
const http = require('axios')

// the rest of the file...
```

2. Deploy the project

`npm run sls -- deploy`

3. Load up the landing page, and place an order. Then head to the X-Ray console and now you can see the traces for `get-index` and `get-restaurants` function in one place.


text:
---
title: TiDB Cloud Support
summary: Learn how to contact the support team of TiDB Cloud.
---

# TiDB Cloud Support

TiDB Cloud offers a free basic support plan for each user and you can upgrade to a paid plan for extended services.

The information of each support plan is available on the support page of the TiDB Cloud console. To access the page, see [Check or upgrade your support plan](#check-or-upgrade-your-support-plan).

> **Tip:**
>
> If you want to apply for a PoC, see [Perform a Proof of Concept (PoC) with TiDB Cloud](/tidb-cloud/tidb-cloud-poc.md).

## Request support

You can request support for your clusters, projects, and organizations. After receiving your request, the support team will contact you via email.

> **Tip:**
>
> If you want to apply for a beta feature that is available upon request, fill in your application information in the **Description** field of the request. For example, "apply for the xxx feature".

### Request support for a cluster

You can request support for a cluster in either of the following ways:

- On the [**Clusters**](https://tidbcloud.com/console/clusters) page of your project, click **...** in the row of your cluster and select **Get Support**.

- On your cluster overview page, click **...** in the upper-right corner and select **Get Support**.

### Request support for a project or organization

You can request support for a project or organization in either of the following ways:

- In the lower-right corner of the [TiDB Cloud console](https://tidbcloud.com/), click **Help**.

- In the upper-right corner of the [TiDB Cloud console](https://tidbcloud.com/), click <MDSvgIcon name="icon-top-support" /> **Support** > **Create New Case**.

    You need to provide your organization ID in the request. To find the ID, click <MDSvgIcon name="icon-top-organization" /> **Organization** in the upper-right corner and click **Organization Settings**.

 On your TiDB Cloud console, click <MDSvgIcon name="icon-top-support" /> **Support** in the upper-right corner of the top navigation bar, and click **View Support Plan**. The support page is displayed.
2. In the **Request Support** area, click **View Support Portal**. The **My request** page is displayed.

    On the **My request** page, you can view the status of your request.

Alternatively, you can also access the [Customer Support](https://support.pingcap.com/hc/en-us) page, log in to the support portal, and then click **View my requests**.

## Check or upgrade your support plan

To check or upgrade your support plan, perform the following steps:

1. On your TiDB Cloud console, click <MDSvgIcon name="icon-top-support" /> **Support** in the upper-right corner of the top navigation bar, and click **View Support Plan**.

    The support page is displayed. On this page, you can see your **Current Plan**. By default, the **Basic** free plan is selected.

2. Choose your desired support plan.

    <SimpleTab>

    To upgrade to **Standard**:

    1. Click **Select Plan** in the **Standard** pane. A **Finish and Start Using Support** page is displayed.
    2. Check the billing information in the lower-left corner of the page.
    3. Add your payment information in the **Billing Profile** and **Credit Card** areas.

        For more information about billing, see [TiDB Cloud Payment Method](/tidb-cloud/tidb-cloud-billing.md#payment-method).

    4. Click **Confirm and Start Using Support** in the lower-right corner of the page.

    After the payment is finished, you have upgraded your plan to **Standard**.

    To upgrade your plan to **Enterprise** or **Premium**:

    1. Click **Contact Sales** in the **Enterprise** or **Premium** pane. A **Contact Us** page is displayed.
    2. Fill in and submit your contact information on the page. Then, the support team will contact you and help you with your subscription.

    </SimpleTab>

## Downgrade your support plan

To downgrade your support plan to **Basic**, perform the following steps:

1. On your TiDB Cloud console, click <MDSvgIcon name="icon-top-support" /> **Support** in the upper-right corner of the top navigation bar, and click **View Support Plan**.
2. At the bottom of the **Support** page, click **Downgrade to basic plan**.


text:
---
path: "/blog/tweet-from-github-actions"
date: "2021-03-05"
title: "Tweet From GitHub Actions"
description: "Develop a Twitter Bot that runs in GitHub Actions."
tags: "#javascript #showdev #webdev #tutorial"
image: "https://cdn-images-1.medium.com/max/1600/1*GGBgZEgWp8_bR5S2fVhybg.jpeg"
canonical: "https://daviddalbusco.medium.com/tweet-from-github-actions-e289de58988a"
---

![](https://cdn-images-1.medium.com/max/1600/1*GGBgZEgWp8_bR5S2fVhybg.jpeg)

*Photo by [Ravi Sharma](https://unsplash.com/@ravinepz?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText) on [Unsplash](https://unsplash.com/?utm_source=unsplash&utm_medium=referral&utm_content=creditCopyText)*

I launched recently [DiscoverWeekly.dev](https://discoverweekly.dev/) a website that shares each Wednesday the new music playlists made by the developers.

To spread the information and let people subscribe, in addition to a RSS feed, I opened a [Twitter](https://twitter.com/discoverweekly_) account and developed a Bot which tweets once a week about the news playlists as well.

Here is how you can also create a Twitter Bot that runs periodically in GitHub Actions.

*****

### Twitter API

Tweets are posted with the help of the Twitter API. To get access to such a feature, you need to create a developer account and request access. You can start your application [here](https://developer.twitter.com/en/apply-for-access).

The process takes several steps but, overall, can be solved in a couple of minutes.

Once you get access to your [Dashboard](https://developer.twitter.com/en/portal/dashboard), create a new project.

![](https://cdn-images-1.medium.com/max/1600/1*d7T5ulDZCk5AbJD5Qrwz-A.png)

In your “App permissions”, request the “Read and Write” permissions.

![](https://cdn-images-1.medium.com/max/1600/1*NWATz8Zlxx3CgNZMmBvRVQ.png)

Finally, under “Keys and Tokens”, generate all “Access token & secret”.

![](https://cdn-images-1.medium.com/max/1600/1*axwweoz1kGPPaZW-I5h6Lg.png)

Note that if you have generated your secrets before requesting the "read & write" permission, you have to regenerate your secrets.

*****

### Library

Even though consuming the Twitter API does not look like rocket science, using an already well made Node.js library ease the process. In addition, Twitter is currently developing a new API (v2) but, the one we are looking to use, [statuses/update](https://developer.twitter.com/en/docs/tweets/post-and-engage/api-reference/post-statuses-update), is not yet migrated (v1). Therefore, using a library as an extra layout might help us in that case not to have to rewrite everything in the future.

That is why we are adding the [twitter-api-client](https://github.com/FeedHive/twitter-api-client) library to our project.

```bash
npm i twitter-api-client --save-dev
```

*****

### Twitter Bot

To develop the Twitter Bot, we create a new file `twitter.js` at the root of our project. It contains a function which takes care of the `tweet` itself, using the `twitter-api-client` , and a top level `async` block which triggers it when the script is run.

In order to not expose publicly the tokens we have created previously, we are accessing these through environments variables (see next chapter).

Finally, in following example, the tweet is a constant message. As any tweet, should be maximal 280 characters long, can tag usernames and point to Url.

```javascript
const {TwitterClient} = require('twitter-api-client');

const tweet = async (status) => {
  const twitterClient = new TwitterClient({
    apiKey: process.env.TWITTER_API_KEY,
    apiSecret: process.env.TWITTER_API_SECRET,
    accessToken: process.env.TWITTER_API_ACCESS_TOKEN,
    accessTokenSecret: process.env.TWITTER_ACCESS_TOKEN_SECRET,
  });

  await twitterClient.tweets.statusesUpdate({status});
};

(async () => {
  try {
    const myTweet =
          `Checkout @discoverweekly_ https://discoverweekly.dev`;

    await tweet(myTweet);
  } catch (err) {
    console.error(err);
  }
})();
```

To run the Bot, we add a related `scripts` target in our `package.json` .

```json
"scripts": {
  "twitter": "node ./twitter.js"
},
```

*****

### Environment Variables

To make our tokens and secrets, we are handling through environment variables, available to our GitHub Actions, go to your `GitHub repo > Settings > Secrets` and add these with their respective values.

![](https://cdn-images-1.medium.com/max/1600/1*p_SW7X4ifZ0tiONf0PsEDA.png)

*****

### GitHub Actions

Finally, add a GitHub Actions such as `.github/workflows/twitter.yml` to your project which run the Node.js script we created before periodically.

In my case, as I publish once a week new playlists and tweet about these only once too, the workflow is [scheduled](https://docs.github.com/en/actions/reference/events-that-trigger-workflows#schedule) to run at specific UTC times.

```yaml
name: Twitter bot

on:
  schedule:
    - cron: "0 15 * * 3"

jobs:
  build:
    name: Tweet about the new playlists
    runs-on: ubuntu-latest
    steps:
      - name: Checkout Repo
        uses: actions/checkout@master
      - name: Use Node.js
        uses: actions/setup-node@v1
        with:
          node-version: '14.x'
      - name: Install Dependencies
        run: npm ci
      - name: Run Twitter bot
        run: npm run twitter
        env:
          TWITTER_API_KEY: ${{ secrets.TWITTER_API_KEY }}
          TWITTER_API_SECRET: ${{ secrets.TWITTER_API_SECRET }}
          TWITTER_API_ACCESS_TOKEN: ${{ secrets.TWITTER_API_ACCESS_TOKEN }}
          TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }}
```

*****

### Summary

![](https://cdn-images-1.medium.com/max/1600/1*N4H7Sfn1DEt9XJWQ3PnnEA.gif)

I was surprised to notice how straight forward it was to develop such a Twitter Bot and it was actually kind of fun. I hope this article will help you too.

To infinity and beyond!

David

gha_language: Svelte


text:
% Hacktoberfest
% Ian Shipman
% October 2020

# Open Source Chicago

## Vist our repository

[https://github.com/OpenSourceChi/hacktoberfest](https://github.com/OpenSourceChi/hacktoberfest)

# Working on OSS

---

![](images/hard_worker.png)

## Git

::: incremental

* You need to know how to use `git` for automatic version management
* Resources at [https://try.github.io](https://try.github.io)
* Ask your new friends here for help!

:::

## Contributing patches

## Before you start

> Find the project community on IRC or Gitter or wherever, and say hi!

## On your own system ...

![](images/the_spread.png)

---

## Workflow

::: incremental

* `git clone` -- create a local copy
* Make some changes
* `git commit` -- commit the changes with a descriptive message

:::

## On Github ...

![](images/hive.jpg)

## Workflow

::: incremental

* Use Github's fork tool to fork the repository
* `git remote add` -- add the fork to your local repository
* `git push` -- push your commits to your fork
* Open a pull request

:::

## Contributing review

> Just make comments on issues and pull requests! Thoughtful review is valuable and dramatically undersupplied.

## Other ways to contribute

::: incremental

* Promote projects that you think are cool
* If you have disposable income, support project developers
* Use OSS and report bugs

:::

## Maintaining a project

![](images/ibms.jpg)

## Things maintainers do

::: incremental

* Organize issues and manage their state
* Evaluate pull requests and help get them in good shape to merge
* Keep the project developing according to a coherent vision

:::

## How to find work

![](images/toilet_computer.jpg)

## Write down bugs

Investigate bugs in the software you use every day and fix them.

## Software crush

Look at software you think is cool and want to understand.  Study it, issues will come up.

## Ask the maintainer

If the project is small, check with the maintainer if they want help on any particular issue

# Etiquette

## Be polite

You can build a reputation as being easy to work with

## Defer to maintainers

We submit individual changes but maintainers have to integrate work across the project

## Avoid spamming

* Fine most of the time: Whitespace + deeply buried spelling mistakes
* Avoid during Hacktoberfest

## Rebase your work as needed
## Your opinions?

Use the chat

---

Image credit: `@CompAesthetics`

repository: OpenSourceChi/hacktoberfest

gha_language: Makefile

repo_name: OpenSourceChi/hacktoberfest