text:
# [**bree**](https://github.com/breejs/bree)

[![build status](https://img.shields.io/travis/com/breejs/bree.svg)](https://travis-ci.com/breejs/bree)
[![code coverage](https://img.shields.io/codecov/c/github/breejs/bree.svg)](https://codecov.io/gh/breejs/bree)
[![code style](https://img.shields.io/badge/code_style-XO-5ed9c7.svg)](https://github.com/sindresorhus/xo)
[![styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
[![made with lass](https://img.shields.io/badge/made_with-lass-95CC28.svg)](https://lass.js.org)
[![license](https://img.shields.io/github/license/breejs/bree.svg)](LICENSE)
[![npm downloads](https://img.shields.io/npm/dt/bree.svg)](https://npm.im/bree)

> The best job scheduler for [Node.js][node] with support for [cron][], [ms][], and [human-friendly][human-interval] strings.  Uses [workers][] and spawns sandboxed processes.  Supports [async/await][async-await], [retries][p-retry], [throttling][p-throttle], [concurrency](#concurrency), and [cancelable][p-cancelable] jobs (graceful shutdown).  Simple, fast, and the most lightweight tool for the job.  Made for [Forward Email][forward-email] and [Lad][].

## Table of Contents

* [Foreword](#foreword)
* [Install](#install)
* [Usage and Examples](#usage-and-examples)
* [Cancellation, Retries, Stalled Jobs, and Graceful Reloading](#cancellation-retries-stalled-jobs-and-graceful-reloading)
* [Interval, Timeout, and Cron Validation](#interval-timeout-and-cron-validation)
* [Long-running jobs](#long-running-jobs)
* [Complex timeouts and intervals](#complex-timeouts-and-intervals)
* [Concurrency](#concurrency)
* [Real-world usage](#real-world-usage)
* [Alternatives that are not production-ready](#alternatives-that-are-not-production-ready)
* [Contributors](#contributors)
* [License](#license)

## Foreword

Before creating Bree, I was a core maintainer (and financially invested in development) of [Agenda][].  I have been with the Node.js community for a very, very long time, and have tried literally every solution out there (see [Alternatives that are not production-ready](#alternatives-that-are-not-production-ready)).  I have found that all existing solutions are subpar, as I have filed countless issues; discovered memory leaks, found functionality not working as described, unresolved core bugs have persisted over time, etc.

Previous to creating this, I was relying heavily on [bull][]; having created [@ladjs/bull][] – but due to core issues (and being Redis-backed) it was not the best tool for the job.  [Bull][] might have been okay if the core issues were fixed, however since it uses [Redis][] it should not be used for a job queue.  From my experience, [Redis][] should only be used for caching and session storage purposes (e.g. CDN or managing user log in state in your application).

Since [workers][] are now readily available in LTS versions of Node, I thought it would be a great time to implement them in a job scheduler environment.  Additionally, my research and development of a better anti-spam and anti-phishing classifier with [Spam Scanner][spam-scanner] gave me some necessary insight to using [workers][].

Bree was created to give you fine-grained control with simplicity, and has built-in support for workers, sandboxed processes, graceful reloading, cron jobs, dates, human-friendly time representations, and much more.  We recommend you to query a persistent database in your jobs, to prevent specific operations from running more than once.  Bree does not force you to use an additional database layer of [Redis][] or [MongoDB][] to manage job state.  In doing so, you should manage boolean job states yourself using queries.  For instance, if you have to send a welcome email to users, only send a welcome email to users that do not have a Date value set yet for `welcome_email_sent_at`.

## Install

[npm][]:

```sh
npm install bree
```

[yarn][]:

```sh
yarn add bree
```

## Usage and Examples

The example below assumes that you have a directory `jobs` in the root of the directory from which you run this example.  For example, if the example below is at `/path/to/script.js`, then `/path/to/jobs/` must also exist as a directory.  If you wish to disable this feature, then pass `root: false` as an option.

Inside this `jobs` directory are individual scripts which are run using [Workers][] per optional timeouts, and additionally, an optional interval or cron expression.  Examples to help clarify this are provided in the code snippet below.

The option `jobs` passed to a new instance of `Bree` (as shown below) is an Array.  It contains values which can either be a String (name of a job in the `jobs` directory, which is run on boot) OR it can be an Object with `name`, `path`, `timeout`, and `interval` properties.  If you do not supply a `path`, then the path is created using the root directory (defaults to `jobs`) in combination with the `name`.  If you do not supply values for `timeout` and/nor `interval`, then these values are defaulted to `0` (which is the default for both, see [index.js](index.js) for more insight into configurable default options).

```js
const path = require('path');

const ms = require('ms'); // optional
const dayjs = require('dayjs'); // optional
const Graceful = require('@ladjs/graceful'); // optional

const Bree = require('bree');

//
// NOTE: see index.js for full list of options and defaults
//
const bree = new Bree({
  jobs: [
    // runs `./jobs/foo.js` on start
    'foo',

    // runs `./jobs/foo-bar.js` on start
    {
      name: 'foo-bar'
    },

    // runs `./jobs/some-other-path.js` on start
    {
     name: 'beep',
     path: path.join(__dirname, 'jobs', 'some-other-path')
    },

    // runs `./jobs/worker-1.js` on the last day of the month
    {
      name: 'worker-1',
      interval: 'on the last day of the month'
    },

    // runs `./jobs/worker-2.js` every other day
    {
      name: 'worker-2',
      interval: 'every 2 days'
    },

    // runs `./jobs/worker-3.js` at 10:15am and 5:15pm every day except on Tuesday
    {
      name: 'worker-3',
      interval: 'at 10:15 am also at 5:15pm except on Tuesday'
    }

    // runs `./jobs/worker-4.js` at 10:15am every weekday
    {
      name: 'worker-4',
      cron: '15 10 ? * *'
    },

    // runs `./jobs/worker-5.js` on start after 10 minutes have elapsed
    {
      name: 'worker-5',
      timeout: '10m'
    },

    // runs `./jobs/worker-6.js` every 5 minutes after 1 minute has elapsed
    {
      name: 'worker-6',
      timeout: '1m',
      interval: '5m'
      // this is unnecessary but shows you can pass a Number (ms)
      // interval: ms('5m')
    },

    // runs `./jobs/worker-7.js` after 3 days and 4 hours
    {
      name: 'worker-7',
      // this example uses `human-interval` parsing
      timeout: '3 days and 4 hours'
    },

    // runs `./jobs/worker-8.js` at midnight (once)
    {
      name: 'worker-8',
      timeout: 'at 12:00 am'
    },

    // runs `./jobs/worker-9.js` every day at midnight
    {
      name: 'worker-9',
      interval: 'at 12:00 am'
    },

    // runs `./jobs/worker-10.js` at midnight on the 1st of every month
    {
      name: 'worker-10',
      cron: '0 0 1 * *'
    },

    // runs `./jobs/worker-11.js` at midnight on the last day of month
    {
      name: 'worker-11',
      cron: '0 0 L * *'
    },

    // runs `./jobs/worker-12.js` at a specific Date (e.g. in 3 days)
    {
      name: 'worker-12',
      // <https://github.com/iamkun/dayjs>
      date: dayjs().add(3, 'days').toDate()
      // you can also use momentjs
      // <https://momentjs.com/>
      // date: moment('1/1/20', 'M/D/YY').toDate()
      // you can pass Date instances (if it's in the past it will not get run)
      // date: new Date()
    }
  ]
});

// handle graceful reloads, pm2 support, and events like SIGHUP, SIGINT, etc.
const graceful = new Graceful({ brees: [bree] });
graceful.listen();

// start all jobs (this is the equivalent of reloading a crontab):
bree.start();

/*
// start only a specific job:
bree.start('foo');

// stop all jobs
bree.stop();

// stop only a specific job:
bree.stop('beep');

// run all jobs (this does not abide by timeout/interval/cron and spawns workers immediately)
bree.run();

// run a specific job (...)
bree.run('beep');
*/
```

## Cancellation, Retries, Stalled Jobs, and Graceful Reloading

We recommend that you listen for "cancel" event in your worker paths.  Doing so will allow you to handle graceful cancellation of jobs.  For example, you could use [p-cancelable][]

Here's a quick example of how to do that (e.g. `./jobs/some-worker.js`):

```js
// <https://nodejs.org/api/worker_threads.html>
const { parentPort } = require('worker_threads');

// ...

function cancel() {
  // do cleanup here
  // (if you're using @ladjs/graceful, the max time this can run by default is 5s)

  // send a message to the parent that we're ready to terminate
  // (you could do `process.exit(0)` or `process.exit(1)` instead if desired
  // but this is a bit of a cleaner approach for worker termination
  parentPort.postMessage('cancelled');
}

parentPort.once('message', message => {
  if (message === 'cancel') return cancel();
});
```

If you'd like jobs to retry, simply wrap your usage of promises with [p-retry][].

We leave it up to you to have as much fine-grained control as you wish.

## Interval, Timeout, and Cron Validation

If you need help writing cron expressions, you can reference [crontab.guru](https://crontab.guru/).

We support [ms][], [human-interval][], and [later][] String values for both `timeout` and `interval`.

If you pass a `cron` property, then it is validated against [cron-validate][].

You can pass a Date as the `date` property, but you cannot combine both `date` and `timeout`.

If you do pass a Date, then it is only run if it is in the future.

## Long-running jobs

If a job is already running, a new worker thread will not be spawned, instead an error will be thrown.  This is to prevent bad practices from being used.  If you need something to be run more than one time, then make the job itself run the task multiple times.  This approach gives you more fine-grained control.

By default, workers run indefinitely and are not closed until they exit (e.g. via `process.exit(0)` or `process.exit(1)`, OR send to the parent port a "close" message, which will subsequently call `worker.close()` to close the worker thread.

If you wish to specify a maximum time (in milliseconds) that a worker can run, then pass `closeWorkerAfterMs` (Number) either as a default option when creating a `new Bree()` instance (e.g. `new Bree({ closeWorkerAfterMs: ms('10s') })`) or on a per-job configuration, e.g. `{ name: 'beep', closeWorkerAfterMs: ms('5m') }`.

## Complex timeouts and intervals

Since we use [later][], you can pass an instance of `later.schedule` as the `timeout` or `interval` property values (e.g. if you need to construct something manually).

You can also use [dayjs][] to construct dates (e.g. from now or a certain date) to millisecond differences using `dayjs().diff(new Date(), 'milliseconds')`.  You would then pass that returned Number value as `timeout` or `interval` as needed.

## Concurrency

We recommend using the following packages in your workers for handling concurrency:

* <https://github.com/sindresorhus/p-all>
* <https://github.com/sindresorhus/p-limit>
* <https://github.com/sindresorhus/p-queue>
* <https://github.com/sindresorhus/p-map>

## Real-world usage

More detailed examples can be found in [Forward Email][forward-email] and [Lad][].

## Alternatives that are not production-ready

Kudos to the authors of all these packages, however they did not work well enough for myself in real-world production environments.

* [bull][] has core issues with [repeatable jobs](https://github.com/OptimalBits/bull/issues/1739), [emptying of jobs](https://github.com/OptimalBits/bull/issues/1792), and [event emitters](https://github.com/OptimalBits/bull/issues/1659)
* [@ladjs/bull][] used [bull][] internally, but was unusable due to [bull issues](https://github.com/ladjs/bull/issues/2)
* [agenda][] had memory leaks, [12 issues filed by myself alone](https://github.com/agenda/agenda/issues?q=author%3Aniftylettuce), has 100+ open issues, and its structure leads it to be hard to maintain (in my biased opinion)
* [kue][] is no longer maintained, has core bugs, and recommends [bull][] (and its Redis backed too)
* [node-cron][] does not provide enough functionality out of the box, as it only provides function invocation using cron expression intervals
* [sfn-scheduler][] did [not support](https://github.com/hyurl/sfn-scheduler/issues/1) cronjob syntax and did not have any means to spawn worker threads nor jobs in general

## Contributors

| Name           | Website                    |
| -------------- | -------------------------- |
| **Nick Baugh** | <http://niftylettuce.com/> |

## License

[MIT](LICENSE) © [Nick Baugh](http://niftylettuce.com/)

##

[ms]: https://github.com/vercel/ms

[human-interval]: https://github.com/agenda/human-interval

[npm]: https://www.npmjs.com/

[yarn]: https://yarnpkg.com/

[workers]: https://nodejs.org/api/worker_threads.html

[lad]: https://lad.js.org

[p-retry]: https://github.com/sindresorhus/p-retry

[p-cancelable]: https://github.com/sindresorhus/p-cancelable

[later]: https://bunkat.github.io/later/parsers.html

[cron-validate]: https://github.com/Airfooox/cron-validate

[forward-email]: https://github.com/forwardemail/forwardemail.net

[dayjs]: https://github.com/iamkun/dayjs

[sfn-scheduler]: https://github.com/hyurl/sfn-scheduler

[spam-scanner]: https://spamscanner.net

[agenda]: https://github.com/agenda/agenda

[node-cron]: https://github.com/node-cron/node-cron

[kue]: https://github.com/Automattic/kue

[@ladjs/bull]: https://github.com/ladjs/bull

[bull]: https://github.com/OptimalBits/bull

[redis]: https://redis.io/

[p-throttle]: https://github.com/sindresorhus/p-throttle

[cron]: https://en.wikipedia.org/wiki/Cron

[node]: https://nodejs.org

[async-await]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Statements/async_function

[mongodb]: https://www.mongodb.com/

repository: shaunwarman/bree

repo_name: shaunwarman/bree


text:
---
title: "Create an application"
description: ""
group: getting-started
sub-group: gitops-quick-start
toc: true
---

Let's start by creating a simple application, the `codefresh-guestbook` application in the Codefresh UI.
We'll create the application without resources and then define/add resources in the next step.

For detailed information, see [Create an application]({{site.baseurl}}/docs/deployments/gitops/create-application/).

**How to**

1. In the Codefresh UI, from Ops in the sidebar, select [GitOps Apps](https://g.codefresh.io/2.0/applications-dashboard?sort=desc-lastUpdated){:target="\_blank"} dashboard.
1. Select **Add Application** on the top-right.
1. In the Add Application panel, add definitions for the application:
  * **Application name**: `codefresh-guestbook` for the quick start.
  * **Runtime**: The runtime to associate with the application, `hosted-runtime` for the quick start.
  * **Name for YAML file**: The name of the application's configuration manifest, assigned on commit to Git. By default, the manifest is assigned the application name.
    You can click the Edit icon and change the name, if needed.

  >You cannot change the application definitions once you continue to the Configuration settings.

{% include
   image.html
   lightbox="true"
   file="/images/getting-started/quick-start/cdops-add-app-settings.png"
   url="/images/getting-started/quick-start/cdops-add-app-settings.png"
   alt="Add Application panel"
   caption="Add Application panel"
   max-width="50%"
   %}

{:start="4"}
1. Select **Next** to go to the Configuration tab.
  By default you are in Form mode. You can toggle between the Form and YAML modes as you define the application's configuration settings.
1. Define the **General** settings for the application:
  * **Repository URL**: The URL to the repo in Git where you created the YAML resource files for the application.
  * **Revision**: The branch in Git with the resource files.
  * **Path**: The folder in Git with the resource files.
  * **Namespace**: Optional. For the quick start, we'll create a namespace for the application, entitled `quick-start`.
  * **Sync Policy**: Change to **Automatic**, and select **Prune resources** to automatically remove unused resources.
  * **Sync Options**: If you defined a namespace, select **Auto-create namespace** to ensure that the namespace is created if it doesn't exist.

{% include
   image.html
   lightbox="true"
   file="/images/getting-started/quick-start/cdops-add-app-configuration.png"
   url="/images/getting-started/quick-start/cdops-add-app-configuration.png"
   alt="Add Application Quick Start: General settings"
   caption="Add Application Quick Start: General settings"
   max-width="70%"
   %}

{:start="6"}
1. Retain the default **Advanced Settings**.
1.
  The Commit form is displayed with the application's definitions on the left, and the read-only version of the manifest with the configuration settings you defined on the right.
1. Select the **Git Source** to which to commit.

{% include
   image.html
   lightbox="true"
   file="/images/getting-started/quick-start/cdops-add-app-commit.png"
   url="/images/getting-started/quick-start/cdops-add-app-commit.png"
   alt="Add Application Quick Start: Commit to Git"
   caption="Add Application Quick Start: Commit to Git"
   max-width="70%"
   %}

{:start="9"}
1. Add a commit message and then select **Commit** at the bottom-right of the panel.
  You are directed to the [GitOps Apps dashboard](https://g.codefresh.io/2.0/applications-dashboard?sort=desc-lastUpdated){:target="\_blank"}.
  You may have to wait for a few seconds until the application is synced to the cluster.

  {% include
   image.html
   lightbox="true"
   file="/images/getting-started/quick-start/cdops-add-app-dashboard.png"
   url="/images/getting-started/quick-start/cdops-add-app-dashboard.png"
   alt="Application dashboard with new application"
   caption="Application dashboard with new application"
   max-width="70%"
   %}

{:start="10"}
1. Select the application. The Current State tab does not display any resources as we have not created any resources for the application.

  {% include
   image.html
   lightbox="true"
   file="/images/getting-started/quick-start/cdops-app-empty-current-state.png"
   url="/images/getting-started/quick-start/cdops-app-empty-current-state.png"
   alt="Empty Current State for new application"
   caption="Empty Current State for new application"
   max-width="70%"
   %}

In the next task, you will create and commit resources for the `codefresh-guestbook` application and deploy the application.

### What to do next
[Create and commit resources for application]({{site.baseurl}}/docs/quick-start/gitops-quick-start/create-app-specs/)

license: MIT

branch_name: refs/heads/master

extension: md

gha_language: SCSS

gha_license_id: MIT

license_type: permissive


text:
## Account Service
This business service deals with ACCOUNTS and the operations that can be done in this domain.

## Endpoints and Action Identification
Now that we defined the endpoints, we want to define the actions we can do on the entities through them.

user

| HTTP Method | Endpoint  | Input  | Success Response  | Error Response  | Description |
|---|---|---|---|---|---|
| GET     | /accounts  | Body:Empty  | Status:200 Body:Account list  | Status:500  | Retrieves all available accounts  |
| POST    | /accounts  | Body:New Account Data  | Status:201 Body:id  | Status:500  | Creates a new Account  |
| PUT     | /accounts  | NA  | NA  | Status:400  | Forbidden action  |
| DELETE  | /accounts  | NA  | NA  | Status:400  | Forbidden action  |
| GET     | /accounts/{id}  | Body:Empty  | Status:200 Body:Account data  | Status:404 or 500  | Retrieves an account |
| POST    | /accounts/{id}  | NA  | NA  | Status:400  | Forbidden action  |
| PUT     | /accounts/{id}  | Body:account data with updates  | Status:200 Body:Empty  | Status:404 or 500  | Updates an account  |
| DELETE  | /accounts/{id}  | Body:Empty  | Status:200  | Status:404 or 400  | Deletes an account  |
| GET     | /accounts/findByOwner/{id}  | Body:Empty  | Status:200 Body:List of Accounts | Status:404 or 500  | Retrieves a list of account |
| POST    | /accounts/findByOwner/{id}  | NA  | NA  | Status:400  | Forbidden action  |
| PUT     | /accounts/findByOwner/{id}  | NA  | NA  | Status:400  | Forbidden action  |
| DELETE  | /accounts/findByOwner/{id}  | NA  | NA  | Status:400  | Forbidden action  |
| GET     | /accounts/transfer/  | NA | NA | Status:400  | Forbidden action |
| POST    | /accounts/transfer/  | Body: debit(id), credit(id), amount, currency  | Status:201 Body:message(id)  | Status:404 or 500  | Execites transfer  |
| PUT     | /accounts/transfer/  | NA  | NA  | Status:400  | Forbidden action  |
| DELETE  | /accounts/transfer/  | NA  | NA  | Status:400  | Forbidden action  |
|    |   |   |   |   |   ||


text:
# Question 02

Write python code to find the area of triangle using Heron's formula

### Sample Testcases

#### Input 1

```
4
3
5
```

#### Output 1

```
The area of the triangle is 6.00
```

#### Input 2

```
5
6
3
```

#### Output 2

```
The area of the triangle is 7.48
```

branch_name: refs/heads/main


text:
---
layout: default
---

# 1996-03-19 - Re: IPG - newest release of the ABC Encryption Algorithms (fwd)

## Header Data

From: Mike McNally<EMAIL_ADDRESS>To: IPG Sales<EMAIL_ADDRESS>Message Hash: 734b7613bccf7a2b0031aadabb343cbca01b2869c37a496024221533bff662b1

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1996-03-19 14:20:28 UTC

Raw Date: Tue, 19 Mar 1996 22:20:28 +0800

## Raw message

```
{% raw  %}From: Mike McNally<EMAIL_ADDRESS>Date: Tue, 19 Mar 1996 22:20:28 +0800
To: IPG Sales<EMAIL_ADDRESS>Subject: Re: IPG - newest release of the ABC Encryption Algorithms (fwd)
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

IPG Sales wrote:
> Obviously, you meet our requirements for the release of the IPG ABC
> Encryption algorithms. We need no further information from you. though we
> would appreciate your telephone num and snail mail address.

On the other hand, the "algorithm" as presented is so hopelessly
obfuscated by the strange terminology and loose descriptions used
to present it that there's no way I (or anybody else) could seriously
evaluate it.  Either publish an algorithm in some accepted format
(a real C program, or even Knuth notation) or cut back your expectations
for public analysis.

______c_____________________________________________________________________
Mike M Nally * Tiv^H^H^H IBM * Austin TX    * pain is inevitable
<EMAIL_ADDRESS>*<EMAIL_ADDRESS>        *
      <URL:http://www.io.com/~m101>         * suffering is optional

{% endraw %}
```

## Thread

+ Return to [March 1996](/archive/1996/03)

+ Return to "[Mike McNally <m5@tivoli.com>](/authors/mike_mcnally_m5_at_tivoli_com_)"

+ _Unknown thread root_
  + 1996-03-19 (Tue, 19 Mar 1996 22:20:28 +0800) - Re: IPG - newest release of the ABC Encryption Algorithms (fwd) - _Mike McNally<EMAIL_ADDRESS>


text:
APACHE-MODULE.ECLASS
Section: eclass-manpages (5)
Updated: Sep 2020
Index Return to Main Contents
NAME
apache-module.eclass - Provides a common set of functions for apache modules
DESCRIPTION
This eclass handles apache modules in a sane way.
To make use of this eclass simply call one of the need/want_apache functions described in depend.apache.eclass. Make sure you use the need/want_apache call after you have defined DEPEND and RDEPEND. Also note that you can not rely on the automatic RDEPEND=DEPEND that portage does if you use this eclass.

See Bug 107127 for more information.

EXAMPLE
Here is a simple example of an ebuild for mod_foo:

APACHE2_MOD_CONF="42_mod_foo"
APACHE2_MOD_DEFINE="FOO"
need_apache2
A more complicated example for a module with non-standard locations:

APXS2_S="${S}/apache22/src"
APACHE2_MOD_FILE="${APXS2_S}/${PN}.so"
APACHE2_MOD_CONF="42_${PN}"
APACHE2_MOD_DEFINE="FOO"
DOCFILES="docs/*.html"
need_apache2_2
A basic module configuration which just loads the module into apache:

<IfDefine FOO>
LoadModule foo_module modules/mod_foo.so
</IfDefine>
FUNCTIONS
APXS2_S
Path to temporary build directory. (Defaults to `${S}/src' if it exists, `${S}' otherwise)
APXS2_ARGS
Arguments to pass to the apxs tool. (Defaults to `-c ${PN}.c')
APACHE2_EXECFILES
List of files that will be installed into ${APACHE_MODULE_DIR} beside ${APACHE2_MOD_FILE}. In addition, this function also sets the executable permission on those files.
APACHE2_MOD_CONF
Module configuration file installed by src_install (minus the .conf suffix and relative to ${FILESDIR}).
APACHE2_MOD_DEFINE
Name of define (e.g. FOO) to use in conditional loading of the installed module/its config file, multiple defines should be space separated.
APACHE2_MOD_FILE
Name of the module that src_install installs minus the .so suffix. (Defaults to `${APXS2_S}/.libs/${PN}.so')
APACHE2_VHOST_CONF
Virtual host configuration file installed by src_install (minus the .conf suffix and relative to ${FILESDIR}).
DOCFILES
If the exported src_install() is being used, and ${DOCFILES} is non-zero, some sed-fu is applied to split out html documentation (if any) from normal documentation, and dodoc'd or dohtml'd.
apache-module_src_compile
The default action is to call ${APXS} with the value of ${APXS2_ARGS}. If a module requires a different build setup than this, use ${APXS} in your own src_compile routine.
apache-module_src_install
This installs the files into apache's directories. The module is installed from a directory chosen as above (apache_cd_dir). In addition, this function can also set the executable permission on files listed in ${APACHE2_EXECFILES}. The configuration file name is listed in ${APACHE2_MOD_CONF} without the .conf extensions, so if you configuration is 55_mod_foo.conf, APACHE2_MOD_CONF would be 55_mod_foo. ${DOCFILES} contains the list of files you want filed as documentation.
apache-module_pkg_postinst
This prints out information about the installed module and how to enable it.
MAINTAINERS
<EMAIL_ADDRESS>REPORTING BUGS
Please report bugs via https://bugs.gentoo.org/
FILES
apache-module.eclass
SEE ALSO
ebuild(5)
https://gitweb.gentoo.org/repo/gentoo.git/log/eclass/apache-module.eclass
Index
NAME
DESCRIPTION
EXAMPLE
FUNCTIONS
MAINTAINERS
REPORTING BUGS
FILES
SEE ALSO
This document was created by man2html, using the manual pages.
Time: 00:27:04 GMT, October 11, 2020

gha_language: HTML


text:
# SwaggerClient::POSTRevenueScheduleByTransactionType

## Properties
Name | Type | Description | Notes
------------ | ------------- | ------------- | -------------
**custom_field__c** | **String** | Any custom fields defined for this object.  | [optional]
**notes** | **String** | Additional information about this record.  Character Limit: 2,000  | [optional]
**revenue_distributions** | [**Array<POSTDistributionItemType>**](POSTDistributionItemType.md) | An array of revenue distributions. Represents how you want to distribute revenue for this revenue schedule. You can distribute revenue into a maximum of 250 accounting periods with one revenue schedule.  The sum of newAmounts must equal the the Charge Amount of the specified Invoice Item.  | [optional]
**revenue_event** | [**POSTRevenueScheduleByTransactionTypeRevenueEvent**](POSTRevenueScheduleByTransactionTypeRevenueEvent.md) |  | [optional]


text:
## Introduction

Welcome to the **Cloudbreak 2.8.0 TP** documentation!

Cloudbreak simplifies the provisioning, management, and monitoring of on-demand HDP and HDF clusters in virtual and cloud environments. It leverages cloud infrastructure to create host instances, and uses Apache Ambari via Ambari blueprints to provision and manage Hortonworks clusters.

Cloudbreak allows you to create clusters using the Cloudbreak web UI, Cloudbreak CLI, and Cloudbreak REST API. Clusters can be launched on public cloud infrastructure platforms **Microsoft Azure**, **Amazon Web Services (AWS)**, and **Google Cloud Platform (GCP)**, and on the private cloud infrastructure platform **OpenStack**.

### Primary use cases

Cloudbreak allows you to create, manage, and monitor your HDP and HDF clusters on your chosen cloud platform:

* Dynamically deploy, configure, and manage clusters on public and private clouds (AWS, Azure, Google Cloud, OpenStack).
* Use automated scaling to seamlessly manage elasticity requirements as cluster workloads change.
* Secure your cluster by enabling Kerberos.

### Architecture

Refer to [Architecture](architecture.md).

### Core concepts

Refer to [Core concepts](concepts.md).

### Deployment options

In general, Cloudbreak offers two deployment options: a quickstart option and a production deployment option. Refer to [Deployment options](deployment-options.md).

### Default cluster configurations

Cloudbreak includes default cluster configurations (in the form of blueprints) and supports using your own custom cluster configurations (in the form of custom blueprints).

The following default cluster configurations are available:

Platform version: **HDP 2.6**

| Cluster type  | Main services | Description |  List of all services included |
|---|---|---|---|
| Data Science |  Spark 2,
Zeppelin | Useful for data science with Spark 2 and Zeppelin. | HDFS, YARN, MapReduce2, Tez, Hive, Pig, Sqoop, ZooKeeper, Ambari Metrics, Spark 2, Zeppelin |
| EDW - Analytics |  Hive 2 LLAP,
Zeppelin | Useful for EDW analytics using Hive LLAP. | HDFS, YARN, MapReduce2, Tez, Hive 2 LLAP, Druid, Pig, ZooKeeper, Ambari Metrics, Spark 2 |
| EDW - ETL |  Hive,
 Spark 2 | Useful for ETL data processing with Hive and Spark 2. | HDFS, YARN, MapReduce2, Tez, Hive, Pig, ZooKeeper, Ambari Metrics, Spark 2 |

Platform version: **HDF 3.1**

| Cluster type  | Main services | Description |  List of all services included |
|---|---|---|---|
| Flow Management |  NiFi | Useful for flow management with NiFi. | NiFi, NiFi Registry, ZooKeeper, Ambari Metrics |
| Messaging Management |  Kafka |  Useful for messaging management with Kafka. | Kafka, ZooKeeper, Ambari Metrics |

### Get started

To quickly get started with Cloudbreak, use the quickstart deployment option, which allows you to launch Cloudbreak from a template:

* [Get started on AWS](aws-quick.md)
* [Get started on Azure](azure-quick.md)
* [Get started on GCP](gcp-quick.md)

> This option is not available for **OpenStack**; you must launch Cloudbreak manually, as described in [Launch on OpenStack](os-launch.md).

In general, the steps include meeting the prerequisites, launching Cloudbreak from a template, and creating the Cloudbreak credential. After performing these steps, you can create a cluster based on one of the default blueprints.

Note

The Cloudbreak software runs in your cloud environment. You are responsible for cloud infrastructure related charges while running Cloudbreak and the clusters being managed by Cloudbreak.


text:
# `createConfig`

```js
import createConfig from 'curi';
```

A configuration object is created using `createConfig`. It takes two arguments: a `history` instance and an array of [route objects]('./route.md).

For any given location object, the configuration object will walk over the array of routes to determine which route (based on the route's `path` property) matches best. The name of the best matched route will be one of the properties of the [`Response`](./response.md) that is built for the location.

The `createConfig` function can also be passed an `options` object as its third argument. The possible properties of the `options` argument are `addons`, `middleware`, and `cache`. Both `addons` and `middleware` (if you include them) must be arrays. `cache` is an object with `get` and `set` function properties.

## methods

### `subscribe(fn)`

The returned object provides a `subscribe` method that allows your application to be informed of navigation. It expects to be passed a function, which will be called whenever a new response is generated.

If the best-matched route has either a `preload` and/or `load` loading function, the configuration object will not call the subscribed functions until the loading functions have all resolved.

```js
const history = createBrowserHistory();
const conf = createConfig(history, routes);

conf.subscribe((response) => {
  // render the application based on the response
});
```

### `ready()`

When you create a new configuration object, an initial response will be created for the current location (`history.location`). One thing to note, though, is that route matching is an asynchronous process. This allows for behavior like code splitting for bundles and ensuring that data is loaded prior to rendering. However, this means that we can not rely on the response being fully prepared right after the configuration object is created.

The `ready` method returns a `Promise` that will not resolve until the response has been fully prepared. The returned `Promise` will resolve with the prepared response (unless there was an error occurred in preparing the response, which you will need to catch yourself).

If a response has already been generated before `ready` is called, then `ready` will resolve with that response.

```js
conf.ready().then(resp => {
  // now we know that the response is ready
});
```

### `refresh(newRoutes)`

`refresh` allows you to update your configuration object to use a new set of routes.

### `addons`

You can access all of the configuration object's addons through the `addons` property. This allows you to call an addon's `get` method.

For example, if your configuration object uses the `pathname` addon, you can do the following:

```js
const config = createConfig(history, [{ name: 'User', path: 'user/:id' }], [ pathname ]);
const userPathname = config.addons.pathname('User', { id: '12345' });
// userPathname = '/user/12345'
```

### `history`

You can access the `history` object that you passed to `createConfig` through the configuration object's `history` property. This allows you to just pass the configuration object throughout your project instead of both that and the `history` object.

repository: Sasun/curi

repo_name: Sasun/curi


text:
# Sorted lists

```agda
module lists.sorted-lists where
```

<details><summary>Imports</summary>

```agda
open import elementary-number-theory.natural-numbers

open import foundation.dependent-pair-types
open import foundation.propositions
open import foundation.unit-type
open import foundation.universe-levels

open import linear-algebra.vectors

open import lists.arrays
open import lists.lists
open import lists.sorted-vectors

open import order-theory.decidable-total-orders
```

</details>

## Idea

We define a sorted list to be a list such that for every pair of consecutive
entries `x` and `y`, the inequality `x ≤ y` holds.

## Definitions

### The proposition that a list is sorted

```agda
module _
  {l1 l2 : Level} (X : Decidable-Total-Order l1 l2)
  where

  is-sorted-list-Prop : list (type-Decidable-Total-Order X) → Prop l2
  is-sorted-list-Prop nil = raise-unit-Prop l2
  is-sorted-list-Prop (cons x nil) = raise-unit-Prop l2
  is-sorted-list-Prop (cons x (cons y l)) =
    prod-Prop
      ( leq-Decidable-Total-Order-Prop X x y)
      ( is-sorted-list-Prop (cons y l))

  is-sorted-list : list (type-Decidable-Total-Order X) → UU l2
  is-sorted-list l = type-Prop (is-sorted-list-Prop l)

  is-prop-is-sorted-list :
    (l : list (type-Decidable-Total-Order X)) → is-prop (is-sorted-list l)
  is-prop-is-sorted-list l = is-prop-type-Prop (is-sorted-list-Prop l)
```

### The proposition that an element is less or equal than every element in a list

```agda
  is-least-element-list-Prop :
    type-Decidable-Total-Order X →
    list (type-Decidable-Total-Order X) → Prop l2
  is-least-element-list-Prop x nil = raise-unit-Prop l2
  is-least-element-list-Prop x (cons y l) =
    prod-Prop
      ( leq-Decidable-Total-Order-Prop X x y)
      ( is-least-element-list-Prop x l)

  is-least-element-list :
    type-Decidable-Total-Order X →
    list (type-Decidable-Total-Order X) → UU l2
  is-least-element-list x l = type-Prop (is-least-element-list-Prop x l)
```

## Properties

### If a list is sorted, then its tail is also sorted

```agda
  is-sorted-tail-is-sorted-list :
    (l : list (type-Decidable-Total-Order X)) →
    is-sorted-list l → is-sorted-list (tail-list l)
  is-sorted-tail-is-sorted-list nil _ = raise-star
  is-sorted-tail-is-sorted-list (cons x nil) s = raise-star
  is-sorted-tail-is-sorted-list (cons x (cons y l)) s = pr2 s
```

### If a list is sorted then its head is less or equal than every element in the list

```agda
  leq-element-in-list-leq-head-is-sorted-list :
    (x y z : type-Decidable-Total-Order X)
    (l : list (type-Decidable-Total-Order X)) →
    is-sorted-list (cons y l) →
    z ∈-list (cons y l) →
    leq-Decidable-Total-Order X x y →
    leq-Decidable-Total-Order X x z
  leq-element-in-list-leq-head-is-sorted-list x .z z l s (is-head .z l) q =
    q
  leq-element-in-list-leq-head-is-sorted-list
    ( x)
    ( y)
    ( z)
    ( cons w l)
    ( s)
    ( is-in-tail .z .y .(cons w l) i)
    ( q) =
    leq-element-in-list-leq-head-is-sorted-list
      ( x)
      ( w)
      ( z)
      ( l)
      ( pr2 s)
      ( i)
      ( transitive-leq-Decidable-Total-Order X x y w (pr1 s) q)
```

### An equivalent definition of being sorted

```agda
  is-sorted-least-element-list-Prop :
    list (type-Decidable-Total-Order X) → Prop l2
  is-sorted-least-element-list-Prop nil = raise-unit-Prop l2
  is-sorted-least-element-list-Prop (cons x l) =
    prod-Prop
      ( is-least-element-list-Prop x l)
      ( is-sorted-least-element-list-Prop l)

  is-sorted-least-element-list :
    list (type-Decidable-Total-Order X) → UU l2
  is-sorted-least-element-list l =
    type-Prop (is-sorted-least-element-list-Prop l)

  is-sorted-list-is-sorted-least-element-list :
    (l : list (type-Decidable-Total-Order X)) →
    is-sorted-least-element-list l → is-sorted-list l
  is-sorted-list-is-sorted-least-element-list nil _ =
    raise-star
  is-sorted-list-is-sorted-least-element-list (cons x nil) _ =
    raise-star
  is-sorted-list-is-sorted-least-element-list
    (cons x (cons y l))
    (p , q) =
    ( pr1 p ,
      is-sorted-list-is-sorted-least-element-list (cons y l) q)
```

### If a vector `v` of length `n` is sorted, then the list `list-vec n v` is also sorted

```agda
  is-sorted-list-is-sorted-vec :
    (n : ℕ) (v : vec (type-Decidable-Total-Order X) n) →
    is-sorted-vec X v →
    is-sorted-list (list-vec n v)
  is-sorted-list-is-sorted-vec 0 v S = raise-star
  is-sorted-list-is-sorted-vec 1 (x ∷ v) S = raise-star
  is-sorted-list-is-sorted-vec (succ-ℕ (succ-ℕ n)) (x ∷ y ∷ v) S =
    pr1 S , is-sorted-list-is-sorted-vec (succ-ℕ n) (y ∷ v) (pr2 S)
```

repository: UniMath/agda-unimath

gha_language: Agda

repo_name: UniMath/agda-unimath


text:
# FizzBuzz
Solution for Stage 1 of the FizzBuzz Kata: http://codingdojo.org/cgi-bin/index.pl?KataFizzBuzz

The following instructions assume that Java 8 and Maven 3.3+ is available from the command line.

##Running Test Cases
From the project root:

1. Run the "test" Maven goal:
	```
	mvn test
	```

##Running the Program
From the project root:

1. Build the jar file by running the "package" Maven goal:
	```
	mvn package
	```
2. Run the jar
	```
	java -jar ./target/fizzbuzz-1.0.jar
	```

repository: brianscottrussell/FizzBuzz

repo_name: brianscottrussell/FizzBuzz


text:
# test retries

This plugin is compatible with Cypress [Test Retries](https://github.com/cypress-io/cypress/pull/3968). For example in [spec.js](spec.js) we fail the test on purpose until the desired UI happens

```js
const Hello = () => {
  // this is how you can get the current retry number
  // attempt 1: (first test execution) retry = 0
  // attempt 2: (second test execution) retry = 1
  // attempt 3: retry = 2,
  // etc
  const n = cy.state('test').currentRetry ? cy.state('test').currentRetry() : 0
  return <div>retry {n}</div>
}
it('retries', { retries: 3 }, () => {
  mount(<Hello />)
  // now let's fail the test - it will retry several times and pass
  cy.contains('retry 3', { timeout: 1500 })
})
```

![Retries in action](images/retries.gif)

repository: cypress-io/cypress

branch_name: refs/heads/develop

gha_language: JavaScript

repo_name: cypress-io/cypress


text:
# Network stack

Phoenix-RTOS network stack is based on LWIP. According to microkernel architecture philosophy it works as a server on the user level and provides socket interface.  Socket are implemented in libphoenix library.

## Source code

The source code of the emulation server could be obtained using the following command

>
    git clone http://git.phoenix-rtos.com/phoenix-rtos-lwip

repository: Yetam/PhoenixRTOS

repo_name: Yetam/PhoenixRTOS


text:
# userinterface.js

userinterface.js is a front-end library built around the idea that logic relating to how the visual looks and how the visual works should be distinguished.

## Getting started

### Installing

#### Scaffold

See [https://github.com/thoughtsunificator/userinterface.js-skeleton](https://github.com/thoughtsunificator/userinterface.js-skeleton).

#### Standalone

``git submodule add https://github.com/thoughtsunificator/userinterface.js.git lib/userinterface.js``

Add userinterface.js to the head section of your web page:

```html
<script src="./lib/userinterface.js/src/userinterface.js"></script>
```

### Model

A ```Model``` is an object representation of a [Node](https://developer.mozilla.org/en-US/docs/Web/API/Node).
It has three required properties depending on the [method](#methods): ```name```, ```method``` and ```properties``` or ```callback```,

The ```name``` property will be the identifier of your model it will be used whenever you need to run your model but also to associate a binding to your model.
The ```method``` property will describe how your model should be ran.
The ```properties``` and ```callback``` properties will contain the properties of your Elements.

A ```Model``` often goes along with a [Binding](#Binding) and an [Object](#Object).

#### Basic model

Here we create a model named ```simple model``` using the [method](#methods) ```appendChild``` it has a one ```LI``` [element](https://developer.mozilla.org/en-US/docs/Web/API/Element) child. `LI` has the className ```simplemodel``` and textContent ```My first simple model```.
This model uses the `textContent`, `className` and `tagName` propertie however you might use any Element properties the DOM API offers.

``src/userinterface/simplemodel.js``
```javascript
UserInterface.model({
  name: "simplemodel",
  method: UserInterface.appendChild,
  properties: {
    tagName: "li", // required
    className: "simplemodel",
    textContent: "My first simple model"
  }
});
```

```javascript
UserInterface.runModel("simplemodel", { parentNode: document.querySelector("ul") });
```
Output:
```html
<ul>
  <li class="simplemodel">My first simple model</li>
</ul>
```

#### Children

In the previous example we created a simple model, but what if we wanted to do more and add some children to it ?
The ```children``` property is here for that, it is an Array where you can specify child elements.

``src/userinterface/children.js``
```javascript
UserInterface.model({
  name: "children",
  method: UserInterface.appendChild,
  properties: {
    tagName: "div",
    className: "model",
    children: [
      {
        tagName: "div",
        className: "child",
        textContent: "My first child"
        // and so on..
      }
    ]
  }
});
```

```javascript
UserInterface.runModel("children", { parentNode: document.body });
```
Output:
```html
<body>
  <div class="model">
    <div class="child">My first child</div>
  </div>
</body>
```
#### Callback

Models are required to have either the ```properties``` property or ```callback``` property, but exactly what does the ```callback``` property do ?
It is used when you want to echo some data in your model.

For example here, we have a model called ```echomodel``` that has the ```callback``` property. This property works the same as the ```properties``` property does except that an extra step is added before your model is ran.
The ```callback``` will return a ```properties``` object accordingly to the data you passed through ```runModel```.

``src/userinterface/echomodel.js``
```javascript
UserInterface.model(
  name: "echomodel",
  method: UserInterface.appendChild,
  callback: data => ({
    tagName: "p",
    className: "echomodel",
    textContent: "My "+data.text+" model"
  })
);
```

```javascript
UserInterface.runModel("echomodel", { parentNode: document.body, data: {"text": "echo" } });
```

Output:
```html
<p class="echomodel">My echo model</p>
```

#### Processed properties

- ``children`` Add children to an element

### Binding

A ```Binding``` is a callback function that, when bound to a model, is automatically called whenever the model has ran.
```Bindings``` will make your models more alive, an example of that would be adding an event listener to your model, that is the place where you will be doing it.

You can also do much more such as using event listeners to connect all of your models together!

A Binding is way to give life to your models enabling them to do things whenever their respective method is executed.
That means if you want to add a listener to an Element that's where you will be doing it.

In this example we will change the textContent of our model root element.

``src/userinterface/button.js``
```javascript
UserInterface.model({
  name: "button",
  method: UserInterface.appendChild,
  properties: {
    tagName: "button"
  }
});

UserInterface.bind("button", function(element) {
  element.textContent = "bound";
});
```

```javascript
UserInterface.runModel("button", { parentNode: document.body });
```

Output:
```html
<button>bound</button>
```

### Methods

- ``appendChild`` Append your model to the target

- ``insertBefore`` Insert your model before the target

- ``removeElement`` Remove the target

- ``replaceElement`` Replace the target with your model

- ``updateElement`` Update the target according to your model

- ``wrapElement`` Wrap the target inside your model

- ``removeListeners`` Remove the listeners of the target

### Objects

```Objects``` are the backbone of your models they will store and manipulate data for your ```Binding```.
That's where you want to hide the complicated stuff.

### Listeners

Listeners enable intercommunication for your models.

#### Main object

You usually wants to have a ``main object`` that you will pass to most of your models so that they communicate with each other through a central.

Note that you are not forced to have one and you could have multiple observables and still be able to handle inter-model communication.

Most of the time we call it ``application``.

#### Listening to events

In this example we are creating and running a model called ```myModel``` that will listen for the event ``greeting`` on through the ``application`` context.

A Context represent a reserved area (a channel) that events will be bound to, they're often represented as an instance of an object but could pretty much be anything.

``src/userinterface/my-model.js``
```javascript
UserInterface.model({
  name: "myModel",
  method: UserInterface.appendChild,
  properties: {
    tagName: "div"
  }
});
UserInterface.bind("myModel", function(element, application) {

  UserInterface.listen(application, "greeting", async (message) => {
    console.log(message)
  })

});
```

```javascript
const application = {}

UserInterface.runModel("myModel", { parentNode: document.body, bindingArgs: [application] });
```

For the moment we are only listening to the ``greeting`` event, we haven't announced anything to it yet.

#### Announcing events

In the previous example we setup a ``greeting`` listener on ``application``.

Now, let's try to announce to the event.

``src/userinterface/another-model.js``
```javascript
UserInterface.model({
  name: "anotherModel",
  method: UserInterface.appendChild,
  properties: {
    tagName: "div"
  }
});
UserInterface.bind("anotherModel", function(element, application) {

  UserInterface.announce(application, "greeting", "Hello!");

});
```

```javascript
const application = {}

UserInterface.runModel("myModel", { parentNode: document.body, bindingArgs: [application] });
UserInterface.runModel("anotherModel", { parentNode: document.body, bindingArgs: [application] });
```

If everything went well you should be able see a ``Hello!`` log message in the console.

#### Removing event listeners

Sometimes you might want your model to be dynamically added and removed, meaning that it will be added upon an action and removed upon another action.

Usually what you want to do is to create ``_listener`` variable and push all the listeners to this array and then remove them as needed using ``forEach`` for example.

In this example, we create a listener ``message`` and remove it whenever the event ``done`` is emitted.

```javascript
UserInterface.bind("myDynamicModel", function(element, application) {

  const _listeners = []

  _listeners.push(UserInterface.listen(application, "message", async data => {
    console.log(data)
  }))

  _listeners(UserInterface.listen(application, "done", async () => {
    _listeners.forEach(listener => UserInterface.removeListener(listener))
  }))

})
```

## API

You can read the API by visiting [http://userinterface-js.unificator.me](http://userinterface-js.unificator.me).

## Common errors

### Cannot set property 'binding' of undefined

UserInterface.js could not find the model specified when calling ``UserInterface.bind``.

### Cannot destructure property 'method' of 'model' as it is undefined.

UserInterface.js could not find the model specified when calling ``UserInterface.runModel``.

Feel free to [open an issue](https://github.com/thoughtsunificator/userinterface.js/issues) if you need assistance.

## Collection

userinterface.js also provides a collection that contains a few basic models to get you started. See [https://github.com/thoughtsunificator/userinterface.js-collection](https://github.com/thoughtsunificator/userinterface.js-collection).

## Extensions

See [https://github.com/topics/userinterface-js-extension](https://github.com/topics/userinterface-js-extension).

## Demos

See [https://github.com/topics/userinterface-js-demo](https://github.com/topics/userinterface-js-demo).

## Testing

- ``npm install``
- ``npm test``


text:
# WordCount
RESTful API CAPTCHA requiring humans to count the occurances of words in a sentence, given a list of exclusion words.

[![Build Status](https://travis-ci.org/Curly-Mo/word_count_validator.svg?branch=master)](https://travis-ci.org/Curly-Mo/word_count_validator)
[![Coverage Status](https://coveralls.io/repos/github/Curly-Mo/word_count_validator/badge.svg?branch=master)](https://coveralls.io/github/Curly-Mo/word_count_validator?branch=master)
A live version is available at: https://animoto-word-count.herokuapp.com/

## Installation
```
bundle install
```

## Run Server
```
bundle exec rackup config.ru -s Puma -p $PORT
```
or simply execute
```
./run
```

## Usage
### Get text
```
curl -X GET -w '%{http_code}' "localhost:8000"
```
Example Response:
```
{
  "text": "The quick brown fox jumps over the lazy dog.",
  "exclude": ["the", "dog"]
}
200
```
### Validate count
#### Wrong Attempt
```
curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"text":"The quick brown fox jumps over the lazy dog", "exclude": ["the", "dog"], "frequency":{"the":2, "dog":1, "quick":1, "brown":1, "fox":1, "jumps":1, "over":1, "lazy":1}}' -w '%{http_code}' localhost:8000
```
Expected Response:
```
{
  "message": Nice try, space troll
}
400
```
#### Correct Attempt
```
curl -H "Accept: application/json" -H "Content-type: application/json" -X POST -d '{"text":"The quick brown fox jumps over the lazy dog", "exclude": ["the", "dog"], "frequency":{"quick":1, "brown":1, "fox":1, "jumps":1, "over":1, "lazy":1}}' -w '%{http_code}' localhost:8000
```
Expected Response:
```
{
  "message": Correct!
}
200
```

# Notes
## Choices and Assumptions
The requirements were clear with very little assumptions to be made, mostly around the format of the request and response parameters.
A GET request returns a json encoded response object containing a TEXT string and an EXCLUDE list of strings. The text string is randomly generated, since that is more interesting and scalable than hard-coded values.

A POST request accepts a json encoded object as the body containing keys for the text, exclude, and frequency_count parameters. This made more sense to me than using standard POST parameter key/value pairs, since the values needed to be list/hash objects and would need to be serialized anyway.
In addition to the response codes, the response contains a message to differentiate an invalid vs. an incorrect request. If the POST request contained an invalid JSON object, the message describes how it was invalid (e.g. missing required parameter, incorrect data type).

## Bonus
The idea of remembering the last text sent to a user goes against the fundamental concept of stateless communication that is a core aspect of a RESTful API. This could be done with user authentication and preserving the state of user interaction on the server. But if you are already authenticating users, what is the purpose of a CAPTCHA?
Perhaps there is a simple alternative I am not thinking of, but for this short challenge I decided not to implement this bonus.

## License

The gem is available as open source under the terms of the [MIT License](http://opensource.org/licenses/MIT).


text:
---
layout: default
---

# 1994-05-15 - Re: Penet Spoofing

## Header Data

From: Alan Barrett<EMAIL_ADDRESS>To<EMAIL_ADDRESS>Message Hash: 608702855c493aa1af79178f5433e07c07da6a4607b1d74ca2998400bdd1bf44

Message ID<EMAIL_ADDRESS>Reply To<EMAIL_ADDRESS>UTC Datetime: 1994-05-15 07:34:41 UTC

Raw Date: Sun, 15 May 94 00:34:41 PDT

## Raw message

```
{% raw  %}From: Alan Barrett<EMAIL_ADDRESS>Date: Sun, 15 May 94 00:34:41 PDT
To<EMAIL_ADDRESS>Subject: Re: Penet Spoofing
In-Reply-To<EMAIL_ADDRESS>Message-ID<EMAIL_ADDRESS>MIME-Version: 1.0
Content-Type: text/plain

> I would like to add that I have evidently been a victim of "penet
> spoofing" as well, since I too received the following message from
> penet:

I have another theory:  If an<EMAIL_ADDRESS>address subscribes
to the mailing list, then everybody who sends mail to the list will be
given an anon alias.  (Now to wait and see whether I get allocated an
anon id from anon.penet.fi in response to this message.)

I still say that double-blinding should not be the default action of
servers like that at anon.penet.fi.  Double blinding is sometimes
useful, but one should have to request it explicitly.

--apb (Alan Barrett)

{% endraw %}
```

## Thread

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

+ Return to "[Alan Barrett <barrett@daisy.ee.und.ac.za>](/authors/alan_barrett_barrett_at_daisy_ee_und_ac_za_)"
+ Return to "[Eli Brandt <ebrandt@jarthur.cs.hmc.edu>](/authors/eli_brandt_ebrandt_at_jarthur_cs_hmc_edu_)"
+ Return to "[Karl Lui Barrus <klbarrus@owlnet.rice.edu>](/authors/karl_lui_barrus_klbarrus_at_owlnet_rice_edu_)"

+ 1994-05-14 (Sat, 14 May 94 11:15:46 PDT) - [Re: Penet Spoofing](/archive/1994/05/7a74c6f5e0a740b55e7004d7ffa0ac43886f3b8efd241f3b81ed27dbda20d805) - _Karl Lui Barrus<EMAIL_ADDRESS>  + 1994-05-14 (Sat, 14 May 94 15:46:28 PDT) - [Re: Penet Spoofing](/archive/1994/05/6eebee834a65a76e1d63d00bc6557d341692703b207a7a9edb2c560a465629fe) - _Eli Brandt<EMAIL_ADDRESS>  + 1994-05-15 (Sun, 15 May 94 00:34:41 PDT) - Re: Penet Spoofing - _Alan Barrett<EMAIL_ADDRESS>


text:
# quippy
Discord bot for a Quiplash-like game

## Sources
* Quiplash - Jackbox Games ([source](https://steamcommunity.com/app/397460/discussions/0/451850468372557278/))
* Cards Against Humanity ([source](http://s3.amazonaws.com/cah/CAH_MainGame.pdf))
* [amdewstow](https://github.com/amdewstow)'s Cards Against Humanity repository ([source](https://github.com/amdewstow/CAHIdeas))

repository: mdease/quippy

repo_name: mdease/quippy


text:
# websockets-raw
Fiddling with the websocket protocol. Interface is an event emitter pattern for server and client passing json. No dependencies. A constant work in progress. Clustering requires redis pub/sub.

# usage
### client
browser

```js
// assuming the server is listening on port 3000
ws = new wsClient('ws://localhost:3000');
```
Add event listeners for events from server or client built-ins with a chainable `on`. Listeners will be passed server data and have the ws instance as `this`.

client built-in events
- `ready` emitted on client after connection to server is made. A `connection` event is triggered before this.
- `reconnecting` emitted before client reconnection attempt.
- `reconnectionFail` emitted after reconnection failure. The client is dead at this point. Reload.
- `userlist` a complete userlist. Emitted from server on each new user

```js
ws.on('ready', () => app.status = 'connected') // built-in
	.on('initialData', data => { // custom
		app.userlist = data.userlist;
		app.messages = data.messages;
	});
// emit arbitrary events and pass some data
ws.emit('updateUser', {user: 'user'});
```

client cli

```bash
$ ./lib/cli-ws-client.js
```

### server
```js
const httpServer = http.createServer();
const wsServer = require('./lib/ws-server');
const ws = new wsServer();
```
Like on the client - add event listeners for client events or server built-ins. Listeners will be passed client data and the client socket and have the ws instance as `this`. All sockets are stored in memory in the connections array on the instance. Each socket object also has the properties `name` and `id`. Reply one client with `replyOne` and all of them with `replyAll`.

server built-in events
- `connection` fired after client connected
- `log` emitted here and there. Listen if your curious.

```js
ws.on('connection', function(data, socket){ // built-in
	this.replyOne(socket, 'initialData', {
		userlist: getUserlist(this.connections),
		messages: messages
	});
})
// listen on the upgrade event
httpServer.on('upgrade', ws.upgrade.bind(ws));
```
note: it's entirely optional to for client or server to listen for events. They will be emitted regardless.

start server
```bash
# run standard
$ npm start
# run with appdynamics monitoring enabled. requires a license
$ npm run startmonit
```
### client reconnection
The server will send an `end` event for all connected clients on `SIGINT`. This enables client to reconnect on the end event. Default is 3 reconnection attempts.

### persistance
- `messages` are transient and not queued
- `users` are stored in redis.

# todos
- [x] ws handshake (Note: the server handshake response requires an empty line in the end. Only 4+ hours debugging. Good times!)
- [x] decode data frames from client
- [x] encode data frames to client
- [x] unified eventemitter pattern api
- [x] vueJS client
- [x] global log
- [x] remove all app parts from lib
- [x] userlist and messages on new connection
- [x] addMessage
- [x] updateUser
- [x] heartbeats via pings and pongs in opcode as opposed to payload event
- [ ] monitor `socket.bufferSize`
- [x] call end on socket on event end
- [x]	option to end connection on client
- [ ] send binary data in control frame
- [ ] check FIN for continuation frame
- [x] add client reconnect on socket end
- [ ] add new sockets by id as key in connections object
- [x] try cluster and pm2 reloads
- [ ] webpack?
- [ ] add dm

# refs
- [the websockets protocol rfc6455](https://tools.ietf.org/html/rfc6455)
- [data frames for dummies](http://lucumr.pocoo.org/2012/9/24/websockets-101/)
- js implementation of data frame encoding/decoding taken from [here](http://stackoverflow.com/questions/8125507/how-can-i-send-and-receive-websocket-messages-on-the-server-side)
- [ws client](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_client_applications)
- [ws server](https://developer.mozilla.org/en-US/docs/Web/API/WebSockets_API/Writing_WebSocket_servers)
- [npm ws tests](https://github.com/karlpokus/ws/blob/master/test/Receiver.test.js)

# license
MIT

repository: karlpokus/websockets-raw

repo_name: karlpokus/websockets-raw


text:
# Ruby Best Practices #23: SOLID Design Principles
[link](http://blog.rubybestpractices.com/posts/gregory/055-issue-23-solid-design.html)

- Single Responsibility Principle: An object should have a single responsibility.
- Open/Closed Principle: An object should be open for extension, but closed for modification.
- Liskov Substitution Principle: Objects in a program should be replaceable with instances of their subtypes without altering correctness of that program.
- Interface Segregation Principle: Many client specific interfaces are better than one general purpose interface.
- Dependency Inversion Principle: Depend upon abstractions, do not depend upon concretions.

## Single Responsibility Principle

The hard part about putting this idea into practice is figuring out just how wide to cast the "single responsibility" net.

In Prawn, what happened was that he split the different aspects of functionality into modules. `Prawn::Document` has 60+ public methods all sharing the same state and namespace.

Solution: Produce a whole layer of low level tooling that closely follows the PDF spec, creating objects for managing things like a PDF-level pages, the rendering of raw PDF strings, etc. Make as many objects necessary to do that, and then maybe provide a facade that makes interacting with them a bit easier.

Then, for the higher level features, do the same thing--have an object who's only job is to provide pretty looking methods. Dedicate whole objects or even clusters of objects to text, images, graphics, and any other cluster of functionality that was mixed into Document directly.

*Treating this as an absolute law might lead to the creation of a lot of unnecessary wrapper objects. But that doesn't mean those ideas don't have their value, in fact they provide an excellent alternative to extensive monkeypatching of third party code.*

As opposed to modifying the ordinary expected behavior of an `ActiveRecord` model, this approach creates a new entity which can have new behaviors while reusing the old functionality.

## Liskov Substitution Principle

Functions that are designed operate on a given type of objects should work without modification when they operate on objects that belong to a subtype of the original type.

When we talk about the type of an object in Ruby, we're concerned with what messages that object responds to, rather than what class that object is an instance of. *Objects that are meant to be treated as subtypes of a base type should not break the contracts of the base type. The rule of thumb is basically not to inherit from anything or mix in a module unless you're fairly certain that the behavior you're implementing will not interfere with th internal operations of your ancestors.*

Ex: Don't override `ActiveRecord` methods!

## Interface Segregation Principle

Java-style interfaces: Prevent code from specifying that an object must be a specific type when all that is required is a certain set of methods to have a meaningful implementation.

`is_a?` and `respond_to?` checks are both a form of LSP violation. To protect against those violations, the best bet is to embrace duck typing as much as possible.

## Dependency Inversion Principle

We have a `Roster` and a `RosterPrinter`:

    class Roster
      def participant names ... end

      def to_s
        RosterPrinter.new(participant_names).tos
      end
    end

    class RosterPrinter
      def initialize(participant_names)
        @participant_names = participant_names
      end

      def to_s
        * Do the printy thing *
      end
    end

We can do this:

    class Roster
      def to_s(printer = RosterPrinter)
        printer.new(participant_names).to_s
      end
    end

This is functionally the same as the old example, but we can trivially swap in any printer object we want.

    class HTMLRosterPrinter
      def to_s
        * HTML thingies *
      end
    end

*By injecting the printer object into `Roster`, we can avoid having to resort to creating a Roster subclass for the sole purpose of wiring up the `HTMLRosterPrinter`.*

*The most common place that talks about DI is when people are running tests, it's a whole lot cleaner to pass in raw mock objects that it is to set expectations on real objects.*

Dependency inversion can really come in handy, but it's important to provide sensible defaults so that you don't end up forcing consumers of your API to do a lot of tedious wiring. The trick is to make it so you can swap out implementations easily, so it's not important for your code to have no opinion about which implementation it should use.

license: Unlicense

repository: daryllxd/lifelong-learning

gha_language: Elixir

gha_license_id: Unlicense

repo_name: daryllxd/lifelong-learning


text:
# Breakfast
A tool for analysing and controlling serial devices in Unix

## Features
* Send and receive data asynchronously
* Pipe incoming data through shell command (filter)
* Macros (in Python) for custom functionality
* Optional key binding for each macro
* Multiple tabs, each with their own data, filter and macro

## Usage
```
python breakfast.py
python breakfast.py /dev/ttyUSB1
```
The device used by default is `/dev/ttyUSB0`.

To use this tool without a device, pass in `/dev/null`.

repository: jbendtsen/breakfast

repo_name: jbendtsen/breakfast


text:
# C# Neural Networks Tools
The main idea is to make tools for comfortable developing neural networks. As the idea it was a C++ library. But C# is much more comfortable for developing this kind of projects. .Net contains lots of suitable data structures.

### Project structure
* /cpp contains C++ libraries to work with neural networks
* /presentation contains materials I used to present this project
* /Neural Networks/Neural Project contains C# tools to work with nerual networks
* /Neural Networks/Neural Project/Examples contains examples of library usage
* /Neural Networks/SmartPacmans contains demo game my library

### Bonus
![Smart Pacmans](https://github.com/lionell/lionell.github.io/blob/master/images/pic03.jpg "Demo game")

A great part of project is demo game Smart Pacmans. You can enjoy neural networks + genetic algorithms. Idea is taken from [this article](http://habrahabr.ru/post/168067)

### System Requirements:
* DirectX 9.0 or higher
* .Net Framework 4.5 or higher

### Used tools
* Visual Studio 2012
* DirectX 9.0
* .Net Framework 4.5
* XNA Game Framework 4.0

### License
MIT


text:
# mastodon-ebooks.py

Simple ebooks-style bot for mastodon.py

Inspired by original work by Jess: https://github.com/Jess3Jane/mastodon-ebooks

Original ananas solution by Noëlle: https://github.com/joyeusenoelle/ananas-ebooks

## Improvements over other ebooks bots

* Scrapes only new toots, not entire list of statuses
* Separates corpus by account, making a multi-account ebooks easier to manage
* Does not require Heroku or Ruby
* "Smart" replies
* Cronjob friendly
* Ananas friendly

## Usage

1. Create a Mastodon account to be the ebooks bot
2. Follow the account(s) to be used as source material from bot
3. You can use a script [like this](https://gist.github.com/Lana-chan/b0d937968d22eca6dcd79a0524449f1d) to generate user secrets to be used by the ebooks script
4. Scrape the users by running: `./mastodon-ebooks.py -s`
5. Verify the markov works by running locally to console: `./mastodon-ebooks.py -p`
6. Toot a markovified status! `./mastodon-ebooks.py -t`

You can now set scraping and tooting to run periodically with cronjobs.

Optionally, you can also run `./mastodon-ebooks.py -r` regularly to check on notifications and reply to mentions.

### The Ananas Way

1. Create a Mastodon account to be the ebooks bot
2. Copy `config.cfg-sample` to `config.cfg`
   * Advanced users: You'll probably already have a config and secret keys for the bot. Just set it up as long as your config file can find the `ananaswrapper.ebooksBot` class.
3. Run `ananas --interactive config.cfg` and input the information for your bot account

That's it! The ananas wrapper is set to scrape daily, toot every 30 minutes and reply to mentions. You can find more info at the [ananas repo](https://github.com/chr-1x/ananas)


text:
## Task 1:
Write a program that will print out all numbers from the range 1-N (N is input from keyboard, N>2) that divide with 3.

## Task 2:
Write a program that will print out all numbers in the range 1-N (N is input from keyboard, N>5) that divide 2 and 3.

## Task 3:
Write a program, which will be calculating the product of the digits of an input number.
## Task 4:
Write a program that will find out the sum of all even numbers in the range 1-N (N is input from keyboard).
## Task 5:
Write a program that will find out the sum of all odd numbers in the range 1-N (N is input from keyboard).
## Task 6:
Write a program that will find out the sum of all numbers that divide 5 in the range 1-N (N is input from keyboard).
## Task 7:
Write a program that will reverse the array {“a”,”b”,”c”,”d”} so that the output is {“d”,“c”,“b”,“a”}.
## Task 8:
Write a program that will read two arrays from console input. Then the program has to make a comparison of the arrays and determine whether they are equal or not.
{ 1, 2, 3, 4 } == { 1, 2, 3, 4 }
{ 1, 2, 3, 4 } != { 2, 1, 3, 4 }
## Task 9:
Write a program that will find all numbers in between 1 and 1000, that divide the sum composed of their digits.
## Task 10.
Write a program that will find out all numbers in the range [1 : 1000] that divide the product composed of their digits.
## Task 11:
Write a program that will print out all two-digit numbers, which have the first digit greater than the second digit.
## Task 12:
Write a short program that prints each number from 1 to 100 on a new line.
For each number that is divided by 3 print “Fizz” instead of the number.
For each number that is divided by 5 print “Buzz” instead of the number.
For each number that is divided by 3 and 5  print “FizzBuzz” instead of the number.

## 🔥🔥 BONUS🔥🔥
Create a program(game) Guess the number.
The game should be a Console application.
Game rules are for limited tries to guess the number that is randomly generated between two end points.

When the game start it should ask the user for difficulty.
- Easy
	- In easy mode user should have 9 tries to guess the number between 0-100.
- Normal
	- In normal mode user should have 7 tries to guess the number between 0-500.
- Hard
	- In hard mode user should have 5 tries to guess the number between 0-1000.

Every guess should give the user hint if it is close and also should display the number that the user last entered.
example
* If the number that should be guessed is 10 and the user enters 18 it should print out "Your guess is far to high, number entered: 18".
* If the number that should be guessed is 10 and the user enters 2 it should print out "Your guess is far to low, number entered: 2".
* If the number that should be guessed is 10 and the user enters 7 it should print out "Your guess is a little bit lower, number entered: 7".
* If the number that should be guessed is 10 and the user enters 13 it should print out "Your guess is a little bit higher, number entered: 13".
* If the number that should be guessed is 10 and the user enters 10 it should print out "Nailed it. number entered: 10".

You can add your kind of notifications if you like.

Based on how fast the user guessed the number it should display a proper title and the number that should be guessed.
example
If user nails it on the first try it should print out "Lucky guess.".
If user did not guess the number it should print out "Try again".

Optional: Give the user a chance to restart the game(ex Press 1 to start a new game, press 2 to quit game) without starting the project from scratch.

# Good luck and happy coding

gha_language: C#


text:
# ZipPicViewWx

![Imgur](http://i.imgur.com/4DRWcjM.png)

![Imgur](http://i.imgur.com/tQ2UIEC.png)

ZipPicViewWx is an in-zip-archive image viewer. It is written in C++ and runs on Linux and Windows (OSX isn't tested yet). It has only a basic feature like image listing, view with zoom-in/out (up-to 200%), and does not aim to replace your day-to-day image viewer.

![Imgur](http://i.imgur.com/p3i5G5w.png)

![Imgur](http://i.imgur.com/Xdjv6R0.png)

ZipPicViewWx has been tested on Windows 10 and Arch Linux.

## Building

The tested method is to use UNIX toolchain. ZipPicViewWx use CMake for build system.

1. Checkout the code. For this guide the code is checked out to `~/ZipPicViewWx`
2. Create a new build directory. For this guide the build directory is `~/ZipPicViewWx-build`.
3. Change directory into the build directory. And then run `$ cmake ~/ZipPicViewWx`.
4. Then run `$ make`. The program is now built.

On Windows, [MSYS2](https://msys2.github.io/) is the preferred method. Install MSYS2 and necessary toolchain, then follow the same instruction as the UNIX toolchain. The Generator has to be specified in step 3, by running `$ cmake -G "MSYS Makefiles ~/ZipPicViewWx"`.

After the program is built, `cpack` (which is part of CMAKE distribution) can be used to created installer. `ZIP` and `WIX` generators have been tested and used. To create installer package with `cpack`, run the command `$ cpack -G WIX` or `$ cpack -G ZIP` inside the build directory.

To specify the version number into the build, pass `CPACK_PACKAGE_VERSION_MAJOR` and `CPACK_PACKAGE_VERSION_MAJOR` variable during step 3\. For example `$ cmake -G "MSYS Makefiles" -DCPACK_PACKAGE_VERSION_MAJOR=0 -DCPACK_PACKAGE_VERSION_MINOR=7 ~/ZipPicViewWx`. By default the version is `0.0.0`

ZipPicViewWX depends on [wxWidgets](https://www.wxwidgets.org/) and [libzip](http://www.nih.at/libzip/). It has been compiled on GCC and Clang.

### CImg Library

An experimental [CImg](http://cimg.eu/) libary usage has been added. This enhance the image quality in the preview panel when the scale is not 100%. As a trade-off, the performance is degraded significantly. This functionality is currently disabled by default.

To enable CImg usage, append the flag `-DUSE_CIMG=yes` as a cmake parameter.

repository: wutipong/ZipPicViewWx

repo_name: wutipong/ZipPicViewWx


text:
---
title: Building a Rust Project
layout: en
permalink: /user/languages/rust/
---
<div id="toc">
</div>

### What this guide covers

This guide covers build environment and configuration topics specific to Rust
projects. Please make sure to read our [Getting started](/user/getting-started/)
and [general build configuration](/user/build-configuration/) guides first.

### Supported Rust versions

We currently download the requested version of Rust (by default the latest
stable), and as a result we support any released version of Rust as well as the
latest nightly and beta.

We also download and install the latest version of [Cargo](http://crates.io)

### Choosing the Rust version to test against

By default, we download and install the latest Rust stable at the start of the
build, but you can also select a Rust version to test against with the `rust`
setting:

    language: rust
    rust: beta # or nightly

The chosen version is passed to the official `rustup.sh` script as the value of the
`--spec` option - and therefore supports any channel name (such as beta and nightly) in
addition to other selection criteria supported by `rustup.sh`.

The Rust version that is specified in the .travis.yml is available during the
build in the `TRAVIS_RUST_VERSION` environment variable.

## Default test script

Travis CI uses Cargo to run your build and tests by default. The exact commands
run are:

    $ cargo build --verbose
    $ cargo test --verbose

If you wish to override this, you can use the `script` setting:

    language: rust
    script: make all

repository: rtyley/docs-travis-ci-com

branch_name: refs/heads/gh-pages

repo_name: rtyley/docs-travis-ci-com


text:
# Object-Relational-Mapping-ORM-E-Commerce-Back-End
## Table of Contents:
* [Title](#E-Commerce-Back-End)
* [Description](#Description)
* [Table of Contents](#TableofContents)
* [Installation](#Installation)
* [Usage](#Usage)
* [Contribution](#Contribution)
* [Tests](#Tests)
* [Questions](#Questions)
* [License](#License)
* [Github](#Github)
* [Email](#Email)

## Installation
- Sequelize depenecy was installed for the application
- Mysql2 dependency was installed for the application

## Usage
  - The application provides a back end for an e-commerce site.
  - It uses an Express.js API to use Sequelize to interact with a MySQL database
## Deployed Application
  - [Link to video demo of application](https://drive.google.com/file/d/1hEs-C-bVUccIef2d09vWXWarzqCIAk47/view)
- ![image](https://user-images.githubusercontent.com/63420051/116928711-6ac81200-ac2b-11eb-83fd-032e147c9b2e.png)
## Contribution
  - Joseph Small
## License
  - [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)


text:
---
title: Circle
tags: visual
---

Creates a circle shape with pure CSS.

```html
<div class="circle"></div>
```

```css
.circle {
  border-radius: 50%;
  width: 2rem;
  height: 2rem;
  background: #333;
}
```

#### Explanation

- `border-radius: 50%` curves the borders of an element to create a circle.
- Since a circle has the same radius at any given point, the `width` and `height` must be the same. Differing values will create an ellipse.

#### Browser support

- https://caniuse.com/#feat=border-radius


text:
# next-js-examples
Examples based on Next.js

To install the application run in commands:

``
npm run install
``
Then to run the application run in commands:
``
npm run dev
``

repository: lasalazarr/next-js-examples

repo_name: lasalazarr/next-js-examples


text:
---
title: Try a New Thing Everyday
date: 2023-06-30 16:27:31
---

The Art of Manliness

My partner came up with a great suggestion for me to discover the world and build new experiences, the concept was simple but the results are phenomenal.  There is a great article about it already written by the folks over at The Art of Manliness, you can check the link above.

What is the activity?

  			Check out a new place in Singapore (Kallang Stadium, I've never been there before, yeah me a local, can you believe that?)
 Since I decided to go there, I thought, "you know what why not just do a run and do it shirtless?" (yay go body positivity)

			Tried Thunder Tea Rice at Laupasat

Why do you choose this activity and why haven't you done it before?

  			Kallang Stadium was always near but it was never convenient to go to (20 minute walk/or by bus) and I never had a reason to go there (the gym already has everything i need)

			Not a lot of places sell Thunder Tea Rice, and I was never into healthy food back in the day.

How does it make you feel?

  			Little bit of adrenaline, got to see the more "polished/touristy" side of Singapore. Caught the sunset which I couldn't enjoy in the moment because I wanted to spend that moment with my partner Olena.

			Definitely felt way better than eating chicken rice but I have to admit it does have a bit of a duller taste compared to the usual local food unfortunately.

Would you do it again or would you do it with someone?

  			Alone? For Sure. With my partner Olena?


text:
# TERRAFORM ECS

## Summary

Notes on using terraform with AWS ECS

## Error Decoding JSON

Task definition expects a container definition like below.
NOT a full task definition. The task definition parts are filled out
in that resource as addtl properties not a rendered json

## Disallowed Properties In Container Definitions

network_mode
volumesFrom
cpu
memory
task_role_arn
execution_role_arn

## Error targetGroupArn

Error message: Unable to assume role and validate the specified targetGroupArn

reference the targetgroup in the loadbalancer, NOT the load balancer arn

```hcl
loadbalancer { targetGroupArn: "${aws_lb_target_group.mygroup.arn}" }
```

repository: evanharmon/eph-headspace

repo_name: evanharmon/eph-headspace


text:
# [kind-of-extra][author-www-url] [![npmjs.com][npmjs-img]][npmjs-url] [![The MIT License][license-img]][license-url] [![npm downloads][downloads-img]][downloads-url]

> Additional functionality to [kind-of][] type check utility. Support promises, generators, streams, errors.

[![code climate][codeclimate-img]][codeclimate-url] [![standard code style][standard-img]][standard-url] [![travis build status][travis-img]][travis-url] [![coverage status][coveralls-img]][coveralls-url] [![dependency status][david-img]][david-url]

## Install
> Install with [npm](https://www.npmjs.com/)

```sh
$ npm i kind-of-extra --save
```

## Usage
> For more use-cases see the [tests](./test.js)

```js
const kindOfExtra = require('kind-of-extra')
```

## API

### [kindOfExtra](index.js#L42)
> Type check utility on steroids.

**Params**

* `val` **{Mixed}**: value to check what type is
* `returns` **{String}**: type of the given `val`

**Example**

```js
var kindof = require('kind-of-extra')

kindof(123) // => 'number'
kindof('foo') // => 'string'
kindof({a: 'b'}) // => 'object'
kindof(null) // => 'null'
kindof(undefined) // => 'undefined'
kindof(false) // => 'boolean'
kindof(true) // => 'boolean'
kindof(new Date()) // => 'date'

var through2 = require('through2')
kindof(through2()) // => 'stream'
kindof(new Error('foo')) // => 'error'
kindof(Promise.resolve(42)) // => 'promise'
kindof(function * () { yield 43 }) // => 'generatorfunction'
kindof((a, b) => { return a + b }) // => 'function'
```

## Related
- [always-done](https://www.npmjs.com/package/always-done): Handle completion and errors with elegance! Support for streams, callbacks, promises, child processes, async/await and sync functions. A drop-in replacement for [async-done][] - pass 100… [more](https://github.com/hybridables/always-done#readme) | [homepage](https://github.com/hybridables/always-done#readme "Handle completion and errors with elegance! Support for streams, callbacks, promises, child processes, async/await and sync functions. A drop-in replacement for [async-done][] - pass 100% of its tests plus more")
- [is-kindof](https://www.npmjs.com/package/is-kindof): Check type of given javascript value. Support promises, generators, streams, and native types. Thin wrapper around `kind-of` module. | [homepage](https://github.com/tunnckocore/is-kindof#readme "Check type of given javascript value. Support promises, generators, streams, and native types. Thin wrapper around `kind-of` module.")
- [kind-of-types](https://www.npmjs.com/package/kind-of-types): List of all javascript types. Used and useful for checking, validation, sanitizing and testing. Like isStream, isPromise, isWeakset and etc. | [homepage](https://github.com/tunnckocore/kind-of-types#readme "List of all javascript types. Used and useful for checking, validation, sanitizing and testing. Like isStream, isPromise, isWeakset and etc.")
- [minibase](https://www.npmjs.com/package/minibase): MiniBase is minimalist approach to Base - @node-base, the awesome framework. Foundation for building complex APIs with small units called plugins. Works well with most… [more](https://github.com/node-minibase/minibase#readme) | [homepage](https://github.com/node-minibase/minibase#readme "MiniBase is minimalist approach to Base - @node-base, the awesome framework. Foundation for building complex APIs with small units called plugins. Works well with most of the already existing [base][] plugins.")
- [mukla](https://www.npmjs.com/package/mukla): Small, parallel and fast test framework with suppport for async/await, promises, callbacks, streams and observables. Targets and works at node.js v0.10 and above. | [homepage](https://github.com/tunnckocore/mukla#readme "Small, parallel and fast test framework with suppport for async/await, promises, callbacks, streams and observables. Targets and works at node.js v0.10 and above.")
- [to-callback](https://www.npmjs.com/package/to-callback): Converts result-first callbacks to classic (node.js-style) error-first callbacks with 3 lines of code. Useful when you want to promisify result-first APIs (like emitter.on). Inspired by… [more](https://github.com/tunnckocore/to-callback#readme) | [homepage](https://github.com/tunnckocore/to-callback#readme "Converts result-first callbacks to classic (node.js-style) error-first callbacks with 3 lines of code. Useful when you want to promisify result-first APIs (like emitter.on). Inspired by [rfpify][] and probably used in it.")
- [try-catch-core](https://www.npmjs.com/package/try-catch-core): Low-level package to handle completion and errors of sync or asynchronous functions, using [once][] and [dezalgo][] libs. Useful for and used in higher-level libs such… [more](https://github.com/hybridables/try-catch-core#readme) | [homepage](https://github.com/hybridables/try-catch-core#readme "Low-level package to handle completion and errors of sync or asynchronous functions, using [once][] and [dezalgo][] libs. Useful for and used in higher-level libs such as [always-done][] to handle completion of anything.")

## Contributing
Pull requests and stars are always welcome. For bugs and feature requests, [please create an issue](https://github.com/tunnckoCore/kind-of-extra/issues/new).
But before doing anything, please read the [CONTRIBUTING.md](./CONTRIBUTING.md) guidelines.

repository: tunnckoCore/kind-of-extra

repo_name: tunnckoCore/kind-of-extra


text:
## Prerequisites
- java 8
- node
- npm
- gradle

## How to run the application?

`gradle` should be the only build tool for developing the application.

- `./gradlew run` - builds both front and back-end components
                        and starts the application

### Front-end devs

- in one console run `./gradlew bootRun` (to run spring app)
- and in another run `./gradlew startDev`

### Back-end devs

- run `./gradlew bootJar` to make sure that front-end components
    are up-to-date

- run `./gradlew bootRun` to recompile (if needed) and run spring application

Alternatively, you could run `./gradlew run` but it runs webpack
each time which takes a couple of seconds.

repository: hardkov/human-resources-management

gha_language: Java

repo_name: hardkov/human-resources-management


text:
Automates deployment of [carnesen.com](https://carnesen.com/) using Google Cloud Platform

[![build status badge](https://github.com/carnesen/carnesen-dot-com/workflows/test/badge.svg)](https://github.com/carnesen/carnesen-dot-com/actions?query=workflow%3Atest+branch%3Amaster)

## Related

- [@carnesen/run-and-exit](https://github.com/carnesen/run-and-exit): Run a function, `console.log` the result, and `process.exit`

- [@carnesen/coded-error](https://github.com/carnesen/coded-error): An enhanced `Error` class with additional properties "code" and "data"

- [@carnesen/eslint-config](https://github.com/carnesen/eslint-config): ESLint configurations for `@carnesen` projects

- [@carnesen/tsconfig](https://github.com/carnesen/tsconfig): TypeScript configurations for `@carnesen` projects

## License

MIT © [Chris Arnesen](https://www.carnesen.com)

repository: carnesen/carnesen-dot-com

gha_language: TypeScript

repo_name: carnesen/carnesen-dot-com


text:
Examples
========

The source code including examples can be downloaded from the
[release page at GitHub](https://github.com/jsor/jcarousel/releases).

* [Basic Carousel](basic/)
* [Connected Carousels](connected-carousels/)
* [Carousel using CSS3 Transitions](transitions/)
* [Responsive Carousel](responsive/)
* [Carousel using data-* attributes for initialization and configuration](data-attributes/)
* [Ajax Carousel](ajax/)
* [Carousel Skeleton](skeleton/)


text:
---
_id: 60048ef911856900334560f9
title: "Understanding Microsoft's Docker Images for .NET Apps"
url: 'https://blog.sixeyed.com/understanding-microsofts-docker-images-for-net-apps/'
category: articles
slug: 'understanding-microsofts-docker-images-for-net-apps'
user_id: 5a83ce59d6eb0005c4ecda2c
username: 'bill-s'
createdOn: '2021-01-16T19:24:41.664Z'
tags: [docker]
---

To run .NET apps in containers you need to have the .NET Framework or .NET Core runtime installed in the container image. That's not something you need to manage yourself, because Microsoft provide Docker images with the runtimes already installed, and you'll use those as the base image to package your own apps.

repository: dotnetweekly/dnw-gatsby

repo_name: dotnetweekly/dnw-gatsby


text:
<!--  Thanks for sending a pull request!  Here are some tips for you:

1. If this is your first time, please read our contributor guidelines: https://github.com/pixie-io/pixie/blob/main/CONTRIBUTING.md and https://github.com/pixie-io/pixie/blob/main/DEVELOPMENT.md.

Also, please delete all the comment blocks to make it easier for the maintainers to compose the final error message from this doc.

All the fields need to be filled out inline. For example:
Summary: Here is a description of this change, and
it's allowed to span multiple lines.

Leave an empty line between each block.
-->
Summary:
<!--
Please include a summary of the changes and the related issue. Please also include relevant motivation and context. List any dependencies that are required for this change.
-->

Relevant Issues:
<!--
Please list all the relevant issues (#<issue number>): eg. #1, #2. If the PR fixes an issue use `Fixes #<issue number>`
-->

Type of change:
<!--
Add one of the following kinds:
/kind bug
/kind cleanup
/kind documentation
/kind feature

Each type must include the entire "/kind {type}" text and not just the label.

Optionally add one or more of the following kinds if applicable:
/kind api-change
/kind deprecation
/kind failing-test
/kind flake
/kind regression
-->

Test Plan:
<!--
For stylistic change that don't require tests or enhancements write: N/A.
-->

Changelog Message:
<!--

Does this PR include user facing changes?

If no, just delete this entire block.
If yes, a release note is required:
Enter your extended release note in the format shown below. If the PR requires additional action from users switching to the new release, include the string "action required".

```release-note
Add your notes in this format, including the triple ticks.
```

-->

Additional documentation:
<!--
This section can be removed if this PR does not include changes to our public documentation.

When adding links which point to resources within git repositories (px-docs, etc), please reference a specific commit and avoid
linking directly to the master branch. This ensures that links reference a
specific point in time, rather than a document that may change over time.

See here for guidance on getting permanent links to files: https://help.github.com/en/articles/getting-permanent-links-to-files

Please use the following format for linking documentation:
```docs
- [px/docs]: <link>
- [px/website]: <link>
```
-->

repository: doytsujin/pixie

repo_name: doytsujin/pixie


text:
# Usage of the Smart Credentials Camera API

Smart Credentials Camera Module is used for optical character recognition and reading different type of barcodes.

### Add build.gradle dependencies
```
implementation("de.telekom.smartcredentials:core:$sc_version")
implementation("de.telekom.smartcredentials:camera:$sc_version")
````

### Modules initialization

The Smart Credentials module initialization is recommended to be made in the application class.

**Core Module**
```
SmartCredentialsConfiguration coreConfig = new SmartCredentialsConfiguration.Builder(context, userId)
                .setLogger(new Logger())
                .setAppAlias(alias)
                .build();
CoreApi coreApi = SmartCredentialsCoreFactory.initialize(coreConfig);
````

**Camera module**
```
SmartCredentialsCameraFactory.initSmartCredentialsCameraModule(coreApi);
````

### OCR reading

**Step 1:** Create a scanner callback.

```
ScannerCallback scannerCallback = new ScannerCallback() {
        @Override
        public void onDetected(List<String> detectedValues) {
            // handle the results of the scanner
        }

        @Override
        public void onScanFailed(Exception e) {
           // handle the failure case
        }
    };
```

**Step 2:** Create a SurfaceContainer by providing a PreviewView view.

```
PreviewView previewView = findViewById(R.id.preview_view);
SurfaceContainer<PreviewView> surfaceContainer = new SurfaceContainer<>(previewView);
```

**Step 3:** Call the ```getOcrScannerView()``` method from the CameraApi.

```
CameraApi<PreviewView> cameraApi = SmartCredentialsCameraFactory.getCameraApi();
SmartCredentialsApiResponse<SurfaceContainerInteractor> response = cameraApi.getOcrScannerView(context, surfaceContainer, lifecycleOwner, scannerCallback);
```
The Api response returns an interactor that can be called whenever you want to capture the image on which the OCR procedure will be performed.

**Step 4:** Trigger the image capture.

```
if (response.isSuccessful()) {
    response.getData().takePicture();
}
```
The ```takePicture()``` method will pass the captured image to a TextRecognizer, returning the OCR results to the scanner callback.

### Barcode reading

**Step 1:** Create a scanner callback.
```
ScannerCallback scannerCallback = new ScannerCallback() {
        @Override
        public void onDetected(List<String> detectedValues) {
            // handle the results of the scanner
        }

        @Override
        public void onScanFailed(Exception e) {
           // handle the failure case
        }
    };
```

**Step 2:** Create a SurfaceContainer by providing a PreviewView view.

```
PreviewView previewView = findViewById(R.id.preview_view);
SurfaceContainer<PreviewView> surfaceContainer = new SurfaceContainer<>(previewView);
```

**Step 3:** Call the ```getBarcodeScannerView()``` method from the CameraApi.
```
CameraApi<PreviewView> cameraApi = SmartCredentialsCameraFactory.getCameraApi();
cameraApi.getBarcodeScannerView(context, surfaceContainer, lifecycleOwner, scannerCallback, BarcodeType.BARCODE_2D_QR_CODE);
```
The barcode scan results will be delivered to the scanner callback.\
All supported bacrodes can be found in the ```BarcodeType``` class.

repository: telekom/SmartCredentials-SDK-android

repo_name: telekom/SmartCredentials-SDK-android