text:
casbin-oa
====

Casbin-oa is An official manuscript processing, evaluation and display system for Casbin technical writers

## Architecture

Casbin-oa contains 2 parts:

Name | Description | Language | Source code
----|------|----|----
Frontend | Web frontend UI for Casbin-oa | Javascript + React | https://github.com/casbin/casbin-oa/tree/master/web
Backend | RESTful API backend for Casbin-oa | Golang + Beego + MySQL | https://github.com/casbin/casbin-oa/

## Installation

- Get the code:

    ```shell
    go get github.com/casbin/casbin-oa
    ```
  or
    ```shell
    git clone https://github.com/casbin/casbin-oa.git
    ```

- Setup database:

  Casbin-oa will store its student, report and topics informations in a MySQL database named: `casbin_oa`, will create it if not existed. The DB connection string can be specified at: https://github.com/casbin/casbin-oa/tree/master/conf

    ```ini
    dataSourceName = root:123@tcp(localhost:3306)/
    ```

  Casbin-oa uses XORM to connect to DB, so all DBs supported by XORM can also be used.

- Run backend (in port 10000):

    ```shell
    go run main.go
    ```

- Run frontend (in the same machine's port 9000):

    ```shell
    cd web
    ## npm
    npm install
    npm run start
    ## yarn
    yarn install
    yarn run start
    ```

- Open browser:

  http://localhost:9000/

repository: MRGUOKING/casbin-oa

repo_name: MRGUOKING/casbin-oa


text:
# Vulnerability 2: XSS in editing a post allows attacker to run javascript code on other user's browsers

- Vulnerability: Stored XSS
- Where: `content` in edit post form
- Impact: Allows the attacker to run javascript code on other users' browsers everytime they load a page that shows the attacker's post.

## Steps to reproduce

1. Create a new public post
2. Edit the newly created post to `</a><script>alert(1);</script>`
2. Access the home page with any user
4. The alert pops up

[(POC)](vuln2.py)

license: MIT

branch_name: refs/heads/main

extension: md

license_type: permissive


text:
# JPG Glitch Electron

> An app for glitching images

![Windows Screenshot](build/screenshots/windows/01.png)

This is the desktop app for [jpg-glitch](https://snorpey.github.io/jpg-glitch). You can use it to transform images so that appear glitched.

## Download
The following operating systems are supported:

_Please note:_ This software hasn't been extensively tested. Please [report](../../issues) any bugs you might encounter.

* [Windows](https://github.com/snorpey/jpg-glitch-electron/releases/download/v0.0.2/JPG.Glitch.Setup.0.0.2.exe)
* [macOS](https://github.com/snorpey/jpg-glitch-electron/releases/download/v0.0.2/JPG.Glitch-0.0.2.dmg)
* Linux: [AppImage](https://github.com/snorpey/jpg-glitch-electron/releases/download/v0.0.2/jpg-glitch-electron-0.0.2-x86_64.AppImage) / [deb](https://github.com/snorpey/jpg-glitch-electron/releases/download/v0.0.2/jpg-glitch-electron_0.0.2_amd64.deb) / [snap](https://github.com/snorpey/jpg-glitch-electron/releases/download/v0.0.2/jpg-glitch-desktop_0.0.2_amd64.snap) / [tar.gz](https://github.com/snorpey/jpg-glitch-electron/releases/download/v0.0.2/jpg-glitch-electron-0.0.2.tar.gz)

### Development

The app is built using [electron-vue](https://github.com/SimulatedGREG/electron-vue)@[1c165f7](https://github.com/SimulatedGREG/electron-vue/tree/1c165f7c5e56edaf48be0fbb70838a1af26bb015) Documentation about the original structure can be found [here](https://simulatedgreg.gitbooks.io/electron-vue/content/index.html).

#### Build Setup

This project has `node-canvas` as a dependency, which requires additional software to be installed.

``` bash
# install dependencies
npm install

# serve with hot reload at localhost:9080
npm run dev

# build electron application for production
npm run build

```

You can find installation instructions for building `node-canvas` are [here](https://github.com/Automattic/node-canvas), and special ones for windows [here](https://github.com/Automattic/node-canvas/wiki/Installation---Windows#install-with-chocolatey).

These instructions may or may not work for you on the first try. If in doubt, delete the `node_modules` directory start a fresh install with `npm install`, and google any error messages. With persistance, you'll get there eventually.

When building on Linux, ensure that `snapcraft` and `snap core` are available and installed (or comment out the `snap` entry in `package.json`).

repository: LeetCodes/jpg-glitch-electron

branch_name: refs/heads/master

repo_name: LeetCodes/jpg-glitch-electron


text:
# js-game-of-life
Usage
```javascript
var gof = require('./gof.js');
var game1 = new gof(20, [[10,11], [11,11], [12,11], [5,6]], [5,6]);
```
gof(worldSize, cells alive in 0 generation, generations to return)

made for a programming contest

repository: cymruu/js-game-of-life

repo_name: cymruu/js-game-of-life


text:
---
layout: leetcode
title: "Sliding window"
categories: [template]
---

# Template

[Explaination Details](./sliding_window_summary) | [Template Index](/template/template_list)

```python
# for LC Problem 76
# window is [left, right) [close and open)
def sliding_window(s, t):
    """ s, t are iterable """
    need, window = {}, {}  # counters
    need = collections.Counter(t)
    # need = {A: 1, B: 1, C: 1}
    left = right = 0
    valid = 0
    while right < len(s):
        c = s[right]
        right += 1  # move right window
        # ... update window
        # e.g. window[c] += 1

        print(f"left={left}, right={right}")
        # check left window
        while window needs shrink:
            d = s[left]
            left += 1
            # ... update window
            # e.g. window[d] -= 1
```

LC: 76, 567, 438, 3

gha_language: HTML

gha_license_id: MIT


text:
# [Gravy Boat](http://alexa.amazon.com/#skills/amzn1.ask.skill.77ea7810-16f7-46b8-b815-724dc1513f3b)
![1 stars](../../images/ic_star_black_18dp_1x.png)![1 stars](../../images/ic_star_border_black_18dp_1x.png)![1 stars](../../images/ic_star_border_black_18dp_1x.png)![1 stars](../../images/ic_star_border_black_18dp_1x.png)![1 stars](../../images/ic_star_border_black_18dp_1x.png) 1

To use the Gravy Boat skill, try saying...

* *Alexa ask gravy boat for our pancakes recipe*

* *Alexa ask gravy boat how many eggs are in pancakes*

* *Alexa ask gravy boat to list all my recipes*

Gravy Boat can read you a recipe or just the ingredients or method. You can also ask for a list of all the available recipes. Or ask how much of an individual ingredient a recipe requires. More recipes will be added soon.

***

### Skill Details

* **Invocation Name:** gravy boat
* **Category:** null
* **ID:** amzn1.ask.skill.77ea7810-16f7-46b8-b815-724dc1513f3b
* **ASIN:** B01LWQM6V6
* **Author:** wakegreen
* **Release Date:** October 11, 2016 @ 03:11:39
* **In-App Purchasing:** No


text:
`<Cloud>` is a cloud-shaped customizable wrapper. This story shows the default appearance of an `<Cloud>`. You can use the position and style knobs to adjust its appearance.

The appearance of a `<Balloon>` is governed by:

- Its `style` CSS property or CSS `class`. It uses the standard CSS box-model properties, namely:
  - [margin](https://developer.mozilla.org/en-US/docs/Web/CSS/margin)
  - [padding](https://developer.mozilla.org/en-US/docs/Web/CSS/padding)
  - [border-width](https://developer.mozilla.org/en-US/docs/Web/CSS/border-width)
  - [border-color](https://developer.mozilla.org/en-US/docs/Web/CSS/border-color)
  - [border-style](https://developer.mozilla.org/en-US/docs/Web/CSS/border-style)
  - [background-color](https://developer.mozilla.org/en-US/docs/Web/CSS/background-color)
  - [box-shadow](https://developer.mozilla.org/en-US/docs/Web/CSS/box-shadow)
- Its `my` property, which specifies where the cloud tail stems from.
- Its `tail.width` and `tail.height` properties which specify the dimensions of the tail.
- Its `folds` property defines the number of folds of the cloud

repository: ulgaal/react-infotip

gha_language: JavaScript

repo_name: ulgaal/react-infotip


text:
[@nori-dot-com/project](../README.md) / [v4-specification](../modules/v4_specification.md) / HarvestEvent

# Interface: HarvestEvent

[v4-specification](../modules/v4_specification.md).HarvestEvent

An annual crop's harvest event details.

**`Example`**

An annual harvest event that yielded 100 bu/ac that took place on October 1st of 2000:

```js
{
 "date": "2000-10-01",
 "yield": 100,
 "yieldUnit": "bu/ac",
 "grainFruitTuber": "n/a",
 "residueRemoved": 0,
}
```

## Hierarchy

- [`CropEvent`](v4_specification.CropEvent.md)

  ↳ **`HarvestEvent`**

## Table of contents

### Properties

- [date](v4_specification.HarvestEvent.md#date)
- [externalId](v4_specification.HarvestEvent.md#externalid)
- [grainFruitTuber](v4_specification.HarvestEvent.md#grainfruittuber)
- [id](v4_specification.HarvestEvent.md#id)
- [residueRemoved](v4_specification.HarvestEvent.md#residueremoved)
- [source](v4_specification.HarvestEvent.md#source)
- [yield](v4_specification.HarvestEvent.md#yield)
- [yieldUnit](v4_specification.HarvestEvent.md#yieldunit)

## Properties

### date

• **date**: `string`

The date the crop event happened (formatted as ISO8061 date: YYYY-MM-DD and YYYY > 2000 and YYYY < 2100).

Dates for liming and burning can be approximate or the first day of the crop year.

**`Example`**

When the crop event occurred on January 1st of 2000:

```js
"date": "2000-01-01"
```

**`Validation Rules`**

["cropEventDateIsOnOrAfterContainingCropYear"]

**`Format`**

date

**`Error Message`**

#### Inherited from

[CropEvent](v4_specification.CropEvent.md).[date](v4_specification.CropEvent.md#date)

#### Defined in

[v4-specification.ts:1709](https://github.com/nori-dot-eco/nori-dot-com/blob/475ed1b/packages/project/src/v4-specification.ts#L1709)

___

### externalId

• `Optional` **externalId**: `string`

External crop event identifier.

Used to correlate data back to the originating system and to synchronize repeated imports.

**`Nullable`**

**`Example`**

```js
"externalId": "4dbbddd2-84c5-4f2b-a58f-e1198b531fba"
```

#### Inherited from

[CropEvent](v4_specification.CropEvent.md).[externalId](v4_specification.CropEvent.md#externalid)

#### Defined in

[v4-specification.ts:1724](https://github.com/nori-dot-eco/nori-dot-com/blob/475ed1b/packages/project/src/v4-specification.ts#L1724)

___

### grainFruitTuber

• `Optional` **grainFruitTuber**: `boolean`

Whether the crop was harvest for grain, fruit or tuber.

**`Nullable`**

during import (specify null if you are unsure)

**`Default`**

no

**`Example`**

Select true if the crop was harvested for grain, fruit, or tuber:

```js
"grainFruitTuber": true
```

**`Example`**

Select false if the crop was harvested before maturity for silage or haylage:

```js
"grainFruitTuber": false
```

#### Defined in

[v4-specification.ts:1846](https://github.com/nori-dot-eco/nori-dot-com/blob/475ed1b/packages/project/src/v4-specification.ts#L1846)

___

### id

• `Optional` **id**: `string`

Nori's internal crop event identifier.

Used to synchronize repeated imports.

**`Nullable`**

External systems pass null or omit the property for new projects.

**`Example`**

```js
"id": "20e75f5e-05e6-4a4d-92a7-9987de55c586"
```

#### Inherited from

[CropEvent](v4_specification.CropEvent.md).[id](v4_specification.CropEvent.md#id)

#### Defined in

[v4-specification.ts:1739](https://github.com/nori-dot-eco/nori-dot-com/blob/475ed1b/packages/project/src/v4-specification.ts#L1739)

___

### residueRemoved

• `Optional` **residueRemoved**: `number`

Crop residue removed.

**`Default`**

0

**`Minimum`**

0

**`Maximum`**

100

**`Example`**

Enter 0% if the crop was only harvested for grain / fruit / tuber or if it otherwise does not apply:

```js
"residueRemoved": 0
```

**`Example`**

Enter the % of the remaining crop removed if the hay or stover was removed separately after grain / fruit / tuber harvest:

```js
"residueRemoved": 5
```

**`Example`**

Enter the total % biomass removed at harvest if the crop was harvested before maturity for silage or haylage:

```js
"residueRemoved": 10
```

#### Defined in

[v4-specification.ts:1874](https://github.com/nori-dot-eco/nori-dot-com/blob/475ed1b/packages/project/src/v4-specification.ts#L1874)

___

### source

• `Optional` **source**: `string`

Source of the event

Optional field to indicate what system this data point originated from.

**`Nullable`**

**`Example`**

```js
"source": "CDL"
```

**`Example`**

```js
"source": "FMS name"
```

#### Inherited from

[CropEvent](v4_specification.CropEvent.md).[source](v4_specification.CropEvent.md#source)

#### Defined in

[v4-specification.ts:1760](https://github.com/nori-dot-eco/nori-dot-com/blob/475ed1b/packages/project/src/v4-specification.ts#L1760)

___

### yield

• `Optional` **yield**: `number`

The crop yield.

The current version of quantification does not consider yield when producing estimates. As such, we will default to 0 when left out.

**`Default`**

0

**`Example`**

When 100 lbs of the crop specified was harvested (using the herein specified `yieldUnit`:

```js
"yield": 100
```

#### Defined in

[v4-specification.ts:1810](https://github.com/nori-dot-eco/nori-dot-com/blob/475ed1b/packages/project/src/v4-specification.ts#L1810)

___

### yieldUnit

• `Optional` **yieldUnit**: ``"bu/ac"`` \| ``"cwt/ac"`` \| ``"tons/ac"`` \| ``"lbs/ac"``

The crop yield units.

The current version of quantification does not consider yield when producing estimates.

**`Default`**

"lbs/ac"

**`Example`**

When the unit of the yield is submitted in lbs per acre:

```js
"yieldUnit": "lbs/ac"
```

#### Defined in

[v4-specification.ts:1825](https://github.com/nori-dot-eco/nori-dot-com/blob/475ed1b/packages/project/src/v4-specification.ts#L1825)

repository: nori-dot-eco/nori-dot-com

gha_language: TypeScript

repo_name: nori-dot-eco/nori-dot-com


text:
# Rabbit QPS Exchange [![CircleCI](https://circleci.com/gh/freethenation/rabbit-qps-exchange.svg?style=svg)](https://circleci.com/gh/freethenation/rabbit-qps-exchange)

Rabbit has no built in mechanism to limit the number of messages consumed per second. If a burst of messages are published, workers can quickly overload other internal or external services. This project is a simple node.js script which adds a way to limit consumption to rabbit.

Some example use cases:

* Limit calls to an external service which limits QPS (queries per second)
* Rate limit individual users without having to manage a queue per user. *Rabbit QPS Exchange will manage these queues for you.*
* Easier rate limiting for 3rd party APIs which are often rate limit on a per user basis.
* Batch together messages for database performance or APIs which provide batch operations.
* Easily add rate limiting to an existing project. Simply publish to a different exchange and add a few rabbit message headers.

## Basic Usage

1. Run `./rabbit_qps_shovel.js --management http://guest:guest@localhost:15672/ --connection RABBIT_CONNECTION_STRING start`
2. Publish your message to the `qps_exchange` with `qps-key` and `qps-delay` rabbit message headers
3. A queue is automatically created for the provided `qps-key` to serialize messages and respect `qps-delay`
4. Messages are routed to the [default exchange using their routing key](https://www.rabbitmq.com/tutorials/tutorial-four-javascript.html).
5. Your worker handles the message

## Installing
* The rabbit server version must be > 3.5.0
* The rabbit server must have the management plugin installed (its http interface is used)
* Install a modern version of node (async support is required)
* Run `npm install`

## Reference

Usage: `./rabbit_qps_shovel.js [OPTIONS] COMMAND`

commands:

* `help`   show help
* `init`   create exchange and required queues then exit
* `clean`  clean up idle queues then exit
* `start`  ensure exchange and required queues, clean idle queues, and then start processing messages

options:

* `--management` Rabbit management connection string. Example http://guest:guest@localhost:15672/ (REQUIRED)
* `--connection` Rabbit connection string. See https://www.rabbitmq.com/uri-spec.html (REQUIRED)

### Configuration headers

| Header              | Description                                                                                | Type      | Default         |
|---------------------|----------------------------------------------------------------------------------------------------------------------------|-----------|-----------------|
| qps-key             | Used to serialize all messages sent to the `qps_exchange`                                                                  | string    | (required)      |
| qps-delay           | Delay (in milliseconds) to wait after routing the message to the default exchange. Use to approximate messages per second. | int/float | 1000 ms         |
| qps-max-priority    | Can be set along with normal Rabbit priority headers to allow prioritization                                               | integer   | no priority     |
| qps-durable         | If set, queues created and managed by rabbit qps exchange will be durable                                                  | boolean   | false           |
| qps-batch-size      | If set, will group this many messages together into a batch, all of which will be sent as separate messages simultaneously | integer   | 1 (no batching) |
| qps-batch-timeout   | Maximum time (in millisecond) to wait for a full batch                                                                     | int/float | 1000 ms         |
| qps-batch-combine   | If set, will combine batch messages together into a single message separated with ASCII newlines (`\n`, `0x0A`)            | boolean   | false           |
| qps-delay-lock-key  | Can be set to share the delay lock between multiple QPS keys. Defaults to `qps-key` if not set. (leaving as default recommended) | string    | `qps-key`       |

### Internal Queues

Rabbit QPS Exchange automatically creates and deletes queues as required and the diagram below exemplifies their organization
![Rabbit QPS Exchange internal organization](https://raw.githubusercontent.com/thingless/rabbit-qps-exchange/master/internal_queue_diagram.jpg)

## Running Tests
* Run a rabbitmq server
* The rabbit server must have the management plugin installed
* Run tests with `npm test`
* The environment variables `RABBIT_CONN_STRING` and `MANAGEMENT_CONN_STRING` can be used to provide connection information

repository: freethenation/rabbit-qps-exchange

repo_name: freethenation/rabbit-qps-exchange


text:
---
layout: post
title: "Lean Analytics - Key Takeaways from the book"
date: 2017-09-22
comments: true
---

Hi there, I hope you have a great day. Are you open for some toughts on how effectivly measure KPIs in a business, which KPIs are relevant and why you should at all bother?

These topics are crucial for leaders, business analysts as well as data scientists. Metrics that drive change and incorporate the firm's strategy are vital to put in place by the leaders. A business analyst help out with this and give supplementing measures to tell a more nuanced view. Data Scientists often try to improve key metrics aligned with the firm's strategy and formulate new predictive questions for different business problems. But they also and need to show with hard numbers, metrics, if their contribution succeeded. If any of this roles and topics seems familiar, this book summary would hopefully be interesting..

After the successful book "Lean Startup" by Eric Rice, the concept “Lean” has somewhat been reincarnated from the well known Lean Manifacturing put forward by Toyota and others. Lean Analytics is a spin-off from Rice's first book, written by Alistair Croll and Benjamin Yoskovitz. In brief, the Lean Startup approach aims for iterative development cycles, through a build-measure-learn process. It is key to keep the iterations short, in order to launch several “minimal viable products” (MVPs) and
learn how the users respond into a new iteration. This way of working is now popular also among consultants and incumbents.

Lean Analytics however, is focused on the “measure”-step in the Lean Startup framework. With analytics,
we try to answer “where you are” and “where you should be going”, by gathering and analyzing data.
As a consultant, it is essential to measure in order to show results. With no measurements, we can’t prove any change to the client.

 > *"If you can’t measure it, you can’t manage it"* – Peter Druckert

## What makes a good metric?

In the end of the day, analytics is about tracking the metrics that are critical to your project or business. Following this, a good metric changes the way you behave. For many, this seems obvious, but people are continuously avoiding this, confusing reporting metrics with actionable metrics.
It is crucial to define metrics before running into experiments. For example, decide that if your MVP doesn’t increase order size by 30 %, try something else. A good metric changes the way you behave precisely because it is aligned to your goals of keeping users, encouraging word of mouth, acquiring customers efficiently, etc.
In addition to use a metric that reflects your goal, it is incentivizing your team and partners to align. Whenever you look at a metric, ask yourself, “What will I do differently based on this information?” If you can’t answer it, you probably shouldn’t care about the metric too much. Examples of a poor and a good metric can be,
* “Total signups”. This is a number that is only increasing over time. There is not much relevant information to be extracted here, when you think about it.
* “Percent of users who are active”. This is a far better one. When you change something about the product, this metric should change. That means you can experiment, learn, and iterate with it.

Croll & Yoskoviz are mentioning several rules of thumb for choosing good metrics,

* **A good metric is comparable.** Being able to compare a metric to other time periods. Groups of users, or competitors helps you understand which way things are moving. “Increased conversion from last week” is more meaningful than “2% conversion.”
* **A good metric is understandable.** If people can’t remember it and discuss it, it’s much harder to turn a change in the data into a change in the culture.
* **A good metric is a ratio or a rate.** Financial analysts have several ratios they look at to understand, at a glance, the fundamental health of a company (e.g. PE-ratio). You need some, too. This because
  * **Ratios are easier to act on.** Think of driving a car; it is easier to act on the car’s speed than the total distance travelled, in the short term.
  * **Ratios are inherently comparative.** Following the car driving analogy, the car’s average speed today can be compared to the average speed yesterday, last month, etc. By narrowing and expanding the time average you can see if there are long term trends, sudden spikes and so on.
  * **Ratios are also good for comparing factors that are somehow opposed or for which there’s an inherent tension.** This can be handy for optimization; e.g. speed / traffic tickets. Then you see the trade-off clearly
* **A good metric changes the way you behave.** As mentioned above.

## The One Metric That Matters

Now we have some hints of how to choose good metrics. However, how many should we highlight as important? We should at least have One Metric That Matters. This metric should fulfill the following

* It answers the most important question you have.
* It forces you to draw a line in the sand and have clear goals.
* It focuses the entire company.
* It inspires a culture of experimentation.

This does not imply that you only have one metric, it is useful to keep an eye on dozens of metrics, but they are then subordered. The idea of having this “übermetric” is quite powerful, especially due to aligning the team, aiming for a common and tangible goal. This being said, this metric can and will change in time, when the focus needs to be shifted in the project or business as a whole. It should reflect your most important goal today. For most businesses, it is not trivial to define such metric. Just to find this most important goal is a very valuable exercise in it self. **If you aim at nothing, you will hit it every time.**

## Wrapup

Lean Analytics is much more about **what** and **why** you should measure, not that much about how. That’s completely ok, since this book is not trying to target Advanced Analytics such as predictive modelling in any great extent, but rather focus on simple “BI” measurements. In both cases, it is just as important to discuss the what and why before diving into technicalities and modelling, in order to produce value.

The book contains several case studies, which can be good for practical understanding. There are six broad business models that’s investigated; E-commerce, SaaS, Free Mobile App, Media Site, User-Generated Content and Two-Sided Marketplace. Even though none of these are directly of your interest, there should be some overlap with the particular business model you are concerned of.

Croll & Yoskoviz are giving a reflected story of why some metrics are appropriate, whereas many are not. The idea that metrics should always drive action is specially interesting, this is the only way a company truly can be data-driven, compared to just have a bunch of data.

> *«Make data great again!»* - Unknown

Cheers!


text:
---
id: 1t0tIH6KWIyWAAk6iS2Se2
title: Understanding HITRUST
slug: hitrust
discovery_topic: topics/hitrust
summary: >-
  Datica walks you through the basics of HITRUST, how much it costs, why it's
  important, and why it should be on your radar in the future.
subhead: Leading experts answer the question What is HITRUST?
tags:
  - hitrust
authors:
  - 1gpUmvd6yuOKUIUIY620i0
related_form: 7nxnAgpCko8WAAwCCIaSiw
bg_image: /assets/general/guides/guide-hitrust-bg.jpg
image_thumb: /assets/general/guides/guide-hitrust-thumb.png
share_image: /assets/general/guides/guide-hitrust-share.jpg
---
This guide is your condensed course on the What, the Why and the How of HITRUST.

<img alt="logo-hitrust" src="/assets/general/guides/logo-hitrust.png"
class="float-right" width="150">

What is HITRUST? Leaders of healthcare providers, payers and third party
vendors formed the HITRUST alliance to regulate the interpretation of
inconsistent views on data security standards. HITRUST, in partner with other
industry leaders, created the Common Security Framework (CSF) to be the
premier model for the future of healthcare compliance validation. [We know
this to be
fact.](https://datica.com/blog/industry-shaking-news-at-the-hitrust-3rd-party-assurance-conference/)

When you're finished, you'll know more about HITRUST and their Common Security
Framework than most of the industry. Included in the guide:

- What is HITRUST?

- Why does HITRUST matter?

- Structure of the HITRUST CSF

- The HITRUST CSF Assessment

- Cost of a HITRUST CSF Assessment and Certification

- What do the experts say?

- Our HITRUST Journey

gha_language: PHP


text:
# Map

One of the most useful data structure in computer science is the hash table. Many hash table implementations exist with varying properties, but in general they offer fast lookups, adds, and deletes.

|   Operations  |                       |
|---------------|-----------------------|
| Construct     | m := map[key]value{}  |
| Insert        | m[k] = v              |
| Lookup        | v = m[k]              |
| Delete        | delete(m, k)          |
| Iterate       | for k, v := range m   |
| Size          | len(m)                |

Key may be any type that is comparable and value may be any type at all, including another map!

## Hash function

Choose a bucket for each key so that entries are distributed as evenly as possible.

## How Maps are Structured

Maps in Go are implemented as a hash table. The hash table for a Go map is structured as an array of buckets. The number of buckets is always equal to a power of 2. When a map operation is performed, such as (colors["Black"] = "#000000"), a hash key is generated against the key that is specified. In this case the string "Black" is used to generate the hash key. The low order bits (LOB) of the generated hash key is used to select a bucket.

repository: gkjoyes/go-code

repo_name: gkjoyes/go-code


text:
# Traffic-Sign-Alert-
Under Developmental stage

Link to download the actual dataset : https://www.kaggle.com/meowmeowmeowmeowmeow/gtsrb-german-traffic-sign

The Training set was ideal to use, it had subfolders 0 - 42 (which means a total of 43 classes) containing images for its respective class.

The Test set had 12,000 images(approx) randomly arranged with a "test.csv" file attached which had 8 columns among which there was a column conatining the imagePath and its corresponding classId.

I found the original test data set uncomfortable to use, thus I wrote the "Support for Traffic (Initial Test set file Handling).ipynb" file which created a Testset folder and subsequently created 43 subfolders(named from 0 - 42) inside it.
Then the following lines of code picked up images from the original Test Set and put those images in the various subfolders in the newly created Test Set as per their classId mentioned in the test.csv file.

Therefore the original training set and the newly created test set were used to train and evaluate the Model which is present in the TrafficMain.ipynb file.
The train and test set used now resembled the same format.

   Train/Test set ---> 43 subfolders (named from 0 - 42 ; referring to the 43 classes) ---> containing their respective images.

repository: SamarpanDas/Traffic-Sign-Alert

repo_name: SamarpanDas/Traffic-Sign-Alert


text:
# NCDC

**I don't maintain this anymore and don't recommend using it. There are other libraries that can let you create a server based on an open API (swagger) spec. Use one of those instead.**

![Build Status](https://github.com/tamj0rd2/ncdc/workflows/CI/badge.svg)
[![npm version](https://badge.fury.io/js/ncdc.svg)](https://badge.fury.io/js/ncdc)
[![codecov](https://codecov.io/gh/tamj0rd2/ncdc/branch/master/graph/badge.svg)](https://codecov.io/gh/tamj0rd2/ncdc)
[![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
[![Dependabot Status](https://api.dependabot.com/badges/status?host=github&repo=tamj0rd2/ncdc)](https://dependabot.com)

NCDC (or node cdc) is a tool that takes a consumer contract (written in yaml)
and tests the specified endpoints against a producer. You can also run a single
command to mock those endpoints.

The point of using this tool is to ensure that each endpoint you use in
development is called in the same way and responds in the same way as the
endpoints in your live environment. There's not much point in testing against
mock APIs that don't strongly resemble your live APIs.

This tool can easily integrate with typescript to prevent you from having to
write JSON schemas for your already defined Typescript interfaces, types and
enums. With this, you're guaranteed that your code, mock API endpoints and
real endpoints are all consistent with eachother.

## Contents

- [Getting Started](#getting-started)
  - [Installation](#installation)
  - [Example config](#example-config.yml)
  - [Serving mocks](#serving-mocks-using-the-config-file)
  - [Running tests](#testing-real-endpoints-against-the-config)
  - [Generating JSON schemas](#generating-json-schemas)
- [CLI Usage](#cli-usage)
  - [Serve mode](#serve)
    - [Local development recipes](#local-development-recipes)
  - [Test mode](#test)
  - [Generate](#generate)
- [Response content negotiation](#response-content-negotiation)
- [Docker use case](#docker-use-case)
- [How to contribute](./docs/CONTRIBUTING.md)

## Getting started

### Installation

`npm install ncdc --save-dev` or `yarn add ncdc -D`

### Example config.yml

The below `config.yml` file contains 2 configurations

```yaml
- name: Book not found
  serveOnly: true
  request:
    method: GET
    endpoints: /api/books/a-bad-id
  response:
    code: 404

- name: Book
  request:
    method: GET
    endpoints:
      - /api/books/123
      - /api/books/456
    serveEndpoint: /api/books/*
  response:
    code: 200
    headers:
      content-type: application/json
    type: Book
    serveBody:
      {
        ISBN: "9780141187761",
        ISBN_13:<PHONE_NUMBER>761,
        author: George Orwell,
        title: 1984 Nineteen Eighty-Four,
        inventoryId: item-87623
      }
```

config.yml references the type `Book` which is exported from `mySourceFile.ts`:

```typescript
export interface Book {
  ISBN: string
  ISBN_13: string
  author: string
  title: string
  // You can set extra json schema properties via JSDoc comments
  /** @pattern ^item- */
  inventoryId: string
}
```

====> **You can find more information about writing your config file
[HERE](./docs/CONFIG.md#config), as well how all of the options behave** <====

### Serving mocks using the config file

`npx ncdc serve ./config.yml 3000`

This will serve each configuration on `http://localhost:3000`.

When GET requests are sent to `/api/books/a-bad-id`, ncdc will respond with a
404 status code.

When GET requests are sent to `/api/books/123` or `/api/books/456`, ncdc will
respond with the following:

- Status code as 200
- content-type header as application/json
- a JSON body with the value of `serveBody`

You can find more information about serve mode [here](#serve)

### Testing real endpoints against the config

`npx ncdc test ./config.yml https://example.com`

This will run tests for each configuration except those with `serveOnly` set to
true. For this reason, the `Book not found` configuration will not be tested
against the real API.

For the `Book` configuration, ncdc will make GET requests to
https://example.com/api/books/123 and https://example.com/api/books/456 and
verify that both responses meet these requirements:

- It responds with a 200 status code
- It responds with the content-type header set to application/json
- The response body is JSON containing at least:
  - property `ISBN` with a string value
  - property `ISBN_13` with a string value
  - property `author` with a string value
  - property `title` with a string value
  - property `inventoryId` with a string value starting with `item-`

You can find more information about test mode [here](#test)

### Generating JSON schemas

`npx ncdc generate ./config.yml --output ./schemas`

This will write JSON schemas to disk for each of the types you reference in your
config.yml, such as `Book` in the above example. This can be useful for caching
purposes.

You can find more information about generating schemas and why you might want to
do that [here](#generate)

## Typescript Compatability

- Typescript 3 - Everything below ncdc version 1.0.0
- Typescript 4 - Everything above ncdc version 1.0.0

## CLI usage

```
$ npx ncdc --help
ncdc <command>

Commands:
  ncdc generate <configPath>        Generates a json schema for each type
                                    specified in the config file
  ncdc serve <configPath> [port]    Serves configured endpoints
  ncdc test <configPath> <baseURL>  Tests configured endpoints

Options:
  --version  Show version number                                       [boolean]
  --help     Show help                                                 [boolean]

Examples:
  ncdc generate ./config.yml                Generates json schemas for any type
                                            specified in config.yml.
  ncdc serve ./config.yml 4000              Serves the mock API endpoints
                                            defined in config.yml on port 4000.
  ncdc test ./config.yml                    Tests that the responses for the API
  https://example.com                       endpoints defined in config.yml
                                            match the configured parameters.
```

You can use the `-f` or `--force` flag to skip typechecking your source files.
This speeds up the generate command, however, you should still use another tool
e.g `tsc` to typecheck your project. If you try to use broken types with ncdc,
ncdc will probably behave unexpectedly.

### Serve

Serves mock API endpoints defined in config.yml

#### CLI Usage

Run `npx ncdc serve --help` to get contextual usage information and examples for
this command.

#### How it works

When ncdc receives a request, it will go through each configuration in your
config.yml (from top to bottom) and serve the first one that meets all of your
request constraints. If the request does not match any of your configurations,
ncdc will response with a 404.

#### Local development recipes

How to run your fake APIs locally:

`package.json`

```jsonc
  "scripts": {
    // dev script before adding ncdc
    "dev": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts",
    // scripts after adding ncdc
    "devServer": "nodemon --watch 'src/**/*.ts' --exec 'ts-node' src/index.ts",
    "bookService": "ncdc serve ./book-service.yml 4000",
    "filmService": "ncdc serve ./film-service.yml 4001",
    // concurrently is optional, you could just run each npm script in separate shells
    "dev": "concurrently --kill-others-on-fail 'npm:bookService' 'npm:filmService' 'npm:devServer'",
  }
```

### Test

Tests that responses from a real API match the configured parameters in config.yml

#### CLI Usage

Run `npx ncdc test --help` to get contextual usage information and examples for
this command.

### Generate

Generates json schemas for any type specified in config.yml

#### CLI Usage

Run `npx ncdc generate --help` to get contextual usage information and examples
for this command.

#### How it works

This will create JSON schemas for your types and save them to disk. They can
later be used with the serve and test commands, rather than re-generating them
on the fly.

The reasons why you might want to do this are described in the
[Docker use case](#docker-use-case)

## Response content negotiation

![alt text](./docs/content-negotiation.png "Title")

## Docker use case

### A potential timing issue

Behind the scenes, ncdc makes use of the typescript compiler to create json
schemas for each of the types referenced in your config.yml. Those schemas are
then used for validation during serve mode and test mode.

Due to the use of the typescript compiler, the `serve` and `test` commands
can often take a few seconds to start. The exact amount of time it takes depends
on the size and configuration of your typescript project.

So, when can this become an issue? Here's a real use case. Let's say I have 2
docker-compose services:

```yaml
services:
  # serves some API endpoints using ncdc
  fake-book-service:
    build: .
    command: npx ncdc serve path-to-config.yml 4000

  # runs some integration tests that need a book service to be available
  integration-tests:
    build: .
    command: npx jest
    depends_on:
      - fake-book-service
    environment:
      - BOOK_SERVICE_URL=http://fake-book-service:4000
```

The docker-compose `depends_on` property is only responsible for starting a
docker service. It doesn't do any health checks that guarantee fake-book-service
is up and serving requests. That means it's possbile for the integration
tests to run before the API is ready, which would result in some (if not all)
of the integration tests failing. That's where caching and the generate command
become useful.

### How to fix it

#### Solution 1

Adding the below line to the `Dockerfile` will generate the json scheams during
the docker build.

```Dockerfile
RUN npx ncdc generate path-to-config.yml --output ./json-schema
```

Then the command for the `fake-book-service` can be changed to the following,
which will skip schema generation and instead use the schemas that were produced
during the docker build.

```yaml
fake-book-service:
  build: .
  command: npx ncdc serve path-to-config.yml --schemaPath ./json-schema
```

This should speed up the start of the `fake-book-service` enough that the fake
endpoints will be ready to use in the integration tests.

#### Solution 2

You can also use a [wait-for](https://github.com/eficode/wait-for) script as an
extra measure, which can be used in addition to Solution 1. This would be used
like so:

```yaml
integration-tests:
    build: .
    command: ./wait-for.sh fake-book-service:4000 -- npx jest
    depends_on:
      - fake-book-service
    environment:
      - BOOK_SERVICE_URL=http://fake-book-service:4000
    volumes:
      # the mapping of this volume depends on your own file structure
      - ./wait-for.sh:/usr/src/wait-for.sh
```


text:
---
layout: post
title: Unit Steps
---

> "*You could not step twice into the same river.*"
                                       Heraclitus of Ephesus

>![_config.yml]({{ site.baseurl}}/images/steps.png)

> [Unit Steps Q1 # 1](http://nbviewer.ipython.org/gist/melvincabatuan/67e1e1841d4acd566245 "Unit Steps Q1 # 1")

> [Unit Steps Q1 Answers](http://nbviewer.ipython.org/gist/melvincabatuan/cf6f4ab325599a1fad9b "Unit Steps Q1 Answers (Complete)")


text:
# Practice problem 8

For this task, you will need to restructure your bot code into a format where the discord bot will be able to save the current response it got, and the next response it needs to prompt for.

You will need to implement this first off using a dictionary to get the state, responses, and any other information you may need as soon as you receive a command from the user. Within this, you need to create a key to store the id of the next question to ask or information to display. This will also be easier if you store the initial option the user picked as another key/value pair in the user dictionary. Every piece of information you collect from the 'top level menu' to the final output should be stored in the user dictionary so that in the final stage the information is available to do the required steps with.

There should only be one or two `input` statements, as your bot will not have a way on discord to get a reply, but will only be able to get the text of the reply, and the user id. Below is a sample dictionary holding the information of a user at different states. You may use this or create your own method for storing user data.

At the initial Menu. This would be the value for the key of the users id.

```{'level': 0}```

After selecting option 1, add a course

```{'level': 1}```

After entering a course name

```{'level': 1.1, 'coursename': 'Test Course'}```

After entering a course note

```{'level': 1.2, 'coursename': 'Test Course', 'coursenote': 'Test Course Note'}```

After processing the above data

```{'level': 0, 'courses': [{'name': 'Test Course', 'notes': 'Test Course Note', 'grades': []}]}```

This is easiest achieved if you define a function, and provide it the user data, and the incoming message. Have a bunch of if statements for each different menu level. Store the message/modify the user data if need be, then print what is required, (will be changed to sending later), and then exit the function. The next time the user provides input, you can use the value of the level key to go to the right code, and run it with the message data you now have. An easy way to do this flow is to infinitely loop through the collection of if statements and break every time a user is prompted for input. Otherwise, just set set the level value, and in the next loop, the appropriate message will be printed, until eventually it prompts for input and exits the loop, Below is so pseduo code that resembles the structure
```
function menu (userid, userdic, msg)
    while true
        if userdic['level'] == 0
            print menu
            print message prompting for input
            userdic['level'] = 1
            break
        if userdic['level'] == 1
            if msg does not make sense
                print message bad
                userdic['level'] = 0
            if msg good
                print selected item #
                print enter text
                userdic['level'] = 2
                break
        ... And so on
```

license: Unlicense


text:
# Diet preference FGWAS DEPICT
## Data preparation
Drop-seq and single-cell expression data of mouse arcuate nucleus and median eminence (GSE93374) was averaged using the Seurat AverageExpression function. Two different levels of clustering were used: a coarser clustering across all identified cell types shown and a finer-grained clustering limited to neuronal cell types as described in Campbell et al1. We then log-normalized the averaged counts using the default Seurat “logNormalize” method. This divides  each observed expression value by the sum for that gene, multiplies by a scaling factor (here the default, 10000), adds 1, and takes the natural log.

These files are too big for GitHub and would be found in
```
depict_prep/projects/jonatan/tmp-holst-hsl/data/
```

They have been added to the `.gitignore`
```
aClust_meanExprLogN.RDS.gz                           nClustSub_meanExprLogN.log.hsapiens_orthologs.tab.gz
aClust_meanExprLogN.log.hsapiens_orthologs.tab.gz    nClust_meanExprLogN.RDS.gz
nClustSub_meanExprLogN.RDS.gz                        nClust_meanExprLogN.log.hsapiens_orthologs.tab.gz
```

## DEPICT methods
DEPICT version 1, release 194 (https://github.com/perslab/depict/) was used to prioritize hypothalamus cell clusters on the basis of fGWAS summary statistics for carbohydrate, protein, fat, and multi-trait diet preference (GWAS association P value cutoff  <10-5).
Drop-seq and single-cell expression data of mouse arcuate nucleus and median eminence (GSE93374) was averaged using the Seurat AverageExpression function. Two different levels of clustering were used: a coarser clustering across all identified cell types shown and a finer-grained clustering limited to neuronal cell types as described in Campbell et al1. We then log-normalized the averaged counts using the default Seurat “logNormalize” method. This divides  each observed expression value by the sum for that gene, multiplies by a scaling factor (here the default, 10000), adds 1, and takes the natural log.
Genes were mapped from mouse gene symbols to mouse Ensembl gene identifiers (using Ensembl version 83) and to the human Ensembl gene identifiers (using Ensembl version 82). Mouse gene identifiers mapping to several mouse Ensembl identifiers were discarded and the human gene with the highest degree of mouse homology was retained in instances where a mouse gene mapped to several human genes. Expression levels of mouse genes mapped to the same human gene were averaged. A two-step z-score procedure was applied such that the expression levels for each gene were transformed to standard normal distributions and the expression levels for each cell cluster were transformed to standard normal distributions. The resulting matrices were used to run DEPICT as previously described in Campbell et al1.
This step is is performed using the script
```
depict_prep/depict_prep.R
```

The resulting matrices were used to run DEPICT as previously described in Campbell et al1. This is performed by the scripts
```
src/call_run_depict_from_template_cfg_latest.sh

src/call_run_depict_from_template_cfg_BMI_locke_campbell_latest.sh
```

**References:**

1. Campbell, John N., Evan Z. Macosko, Henning Fenselau, Tune H. Pers, Anna Lyubetskaya, Danielle Tenen, Melissa Goldman, et al. “A Molecular Census of Arcuate Hypothalamus and Median Eminence Cell Types.” Nature Neuroscience 20, no. 3 (March 2017): 484–96. https://doi.org/10.1038/nn.4495.


text:
# camel-openhtmltopdf
#### A Camel component to generate nice looking PDF files from HTML, CSS, images, etc.

This project is a Component for the [Apache Camel](https://camel.apache.org) open-source integration
framework. Its PDF generation capabilities are based on the
[openhtmltopdf](https://github.com/danfickle/openhtmltopdf) project. Future enhancements may include
image and SVG generation.

## Usage

Maven users will need to add the following dependency to their pom.xml for this component.

    <dependency>
        <groupId>solutions.elevation.camel</groupId>
        <artifactId>camel-openhtmltopdf</artifactId>
        <version>1.0.1</version>
    </dependency>

The latest release uses camel-core version 3.11.0 as dependency.

## URI format

    openhtmltopdf:operation[?options]

Only Producer is suppored.

## Options

| Option | Description | Default |
| ------ | ----------- | ------- |
| defaultPageWidth | Default page width to use if not specified in CSS | 8.5 |
| defaultPageHeight | Default page height to use if not specified in CSS | 11 |
| pageSizeUnits | Default page units to use if not specified in CSS. INCHES, MM | INCHES |
| defaultTextDirection| Default text direction to use if not specified in CSS | LTR |
| testMode | Whether to use test mode and output the PDF uncompressed | false |
| lenientParsing | Use leniant parsing for documents that don't comply with strict XHTML syntax. | true |

## Operations

### pdf

Generate a PDF file from HTML.

| Parameter | Type | Description |
| --------- | ---- | ----------- |
| Body | String, org.w3c.dom.Document | If a string, must be either a URI or (X)HTML content. For URIs, `file`, `http` and `https` are supported.|
| OpenHtmlToPdfBaseUri | String | Base URI to use for resolving references (images, etc.). If not supplied and a URI was supplied in body, the component will attempt to determine the base URI. |

repository: elevation-solutions/camel-openhtmltopdf

repo_name: elevation-solutions/camel-openhtmltopdf


text:
# TrueTime for Android

![TrueTime](truetime.png "TrueTime for Android")

*Make sure to check out our counterpart too: [TrueTime](https://github.com/instacart/TrueTime.swift), an NTP library for Swift.*

NTP client for Android. Calculate the date and time "now" impervious to manual changes to device clock time.

In certain applications it becomes important to get the real or "true" date and time. On most devices, if the clock has been changed manually, then a `new Date()` instance gives you a time impacted by local settings.

Users may do this for a variety of reasons, like being in different timezones, trying to be punctual by setting their clocks 5 – 10 minutes early, etc. Your application or service may want a date that is unaffected by these changes and reliable as a source of truth. TrueTime gives you that.

You can read more about the use case in our [blog post](https://tech.instacart.com/truetime/).

In a [recent conference talk](https://vimeo.com/190922794), we explained how the full NTP implementation works with Rx. Check the [video](https://vimeo.com/190922794) and [slides](https://speakerdeck.com/kaushikgopal/learning-rx-by-example-2?slide=31) out for implementation details.

# How is TrueTime calculated?

It's pretty simple actually. We make a request to an NTP server that gives us the actual time. We then establish the delta between device uptime and uptime at the time of the network response. Each time "now" is requested subsequently, we account for that offset and return a corrected `Date` object.

Also, once we have this information it's valid until the next time you boot your device. This means if you enable the disk caching feature, after a single successful NTP request you can use the information on disk directly without ever making another network request. This applies even across application kills which can happen frequently if your users have a memory starved device.

# Installation

We use [Jitpack](https://jitpack.io) to host the library.

Add this to your application's `build.gradle` file:

```groovy
repositories {
    maven {
        url "https://jitpack.io"
    }
}

dependencies {
    // ...
    compile 'com.github.instacart.truetime-android:library-extension-rx:<release-version>'

    // or if you want the vanilla version of Truetime:
    compile 'com.github.instacart.truetime-android:library:<release-version>'
}
```

# Usage

## Vanilla version

Importing `'com.github.instacart.truetime-android:library:<release-version>'` should be sufficient for this.

```java
TrueTime.build().initialize();
```

`initialize` must be run on a background thread. If you run it on the main thread, you will get a [`NetworkOnMainThreadException`](https://developer.android.com/reference/android/os/NetworkOnMainThreadException.html)

You can then use:

```java
Date noReallyThisIsTheTrueDateAndTime = TrueTime.now();
```

... #winning

## Rx-ified Version

If you're down to using [RxJava](https://github.com/ReactiveX/RxJava) then we go all the way and implement the full NTP. Use the nifty `initializeRx()` api which takes in an NTP pool server host.

```java
TrueTimeRx.build()
        .initializeRx("time.google.com")
        .subscribeOn(Schedulers.io())
        .subscribe(date -> {
            Log.v(TAG, "TrueTime was initialized and we have a time: " + date);
        }, throwable -> {
            throwable.printStackTrace();
        });
```

Now, as before:

```java
TrueTimeRx.now(); // return a Date object with the "true" time.
```

### What is nifty about the Rx version?

* as against just SNTP, you get full NTP (read: far more accurate time)
* the NTP pool address you provide is resolved into multiple IP addresses
* we query each IP multiple times, guarding against checks, and taking the best response
* if any one of the requests fail, we retry that failed request (alone) for a specified number of times
* we collect all the responses and again filter for the best result as per the NTP spec

## Notes/tips:

* Each `initialize` call makes an SNTP network request. TrueTime needs to be `initialize`d only once ever, per device boot. Use TrueTime's `withSharedPreferences` option to make use of this feature and avoid repeated network request calls.
* Preferable use dependency injection (like [Dagger](http://square.github.io/dagger/)) and create a TrueTime @Singleton object
* You can read up on Wikipedia the differences between [SNTP](https://en.wikipedia.org/wiki/Network_Time_Protocol#SNTP) and [NTP](https://www.meinbergglobal.com/english/faq/faq_37.htm).
* TrueTime is also [available for iOS/Swift](https://github.com/instacart/truetime.swift)

## Troubleshooting/Exception handling:

When you execute the TrueTime initialization, you are very highly likely to get an `InvalidNtpServerResponseException` because of root delay violation or  root dispersion violation the first time. This is an expected occurrence as per the [NTP Spec](https://tools.ietf.org/html/rfc5905) and needs to be handled.

### Why does this happen?

The NTP protocol works on [UDP](https://en.wikipedia.org/wiki/User_Datagram_Protocol):

> It has no handshaking dialogues, and thus exposes the user's program to any unreliability of the underlying network and so there is no guarantee of delivery, ordering, or duplicate protection
>
> UDP is suitable for purposes where error checking and correction is either not necessary or is *performed in the application*, avoiding the overhead of such processing at the network interface level. Time-sensitive applications often use UDP because dropping packets is preferable to waiting for delayed packets, which may not be an option in a real-time system

([Wikipedia's page](https://en.wikipedia.org/wiki/User_Datagram_Protocol), emphasis our own)

This means it is highly plausible that we get faulty data packets. These are caught by the library and surfaced to the api consumer as an `InvalidNtpServerResponseException`. See this [portion of the code](https://github.com/instacart/truetime-android/blob/master/library/src/main/java/com/instacart/library/truetime/SntpClient.java#L137) for the various checks that we guard against.

These guards are *extremely* important to guarantee accurate time and cannot be avoided.

### How do I handle or protect against this in my application?

It's pretty simple:

* keep retrying the request, until you get a successful one. Yes it does happen eventually :)
* Try picking a better NTP pool server. In our experience `time.apple.com` has worked best

Or if you want the library to just handle that, use the Rx-ified version of the library (note the -rx suffix):

```
    compile 'com.github.instacart.truetime-android:library-extension-rx:<release-version>'
```

With TrueTimeRx, we go the whole nine yards and implement the complete NTP Spec (we resolve the DNS for the provided NTP host to single IP addresses, shoot multiple requests to that single IP, guard against the above mentioned checks, retry every single failed request, filter the best response and persist that to disk). If you don't use TrueTimeRx, you don't get these benefits.

We welcome PRs for folks who wish to replicate the functionality in the vanilla TrueTime version. _We don't have plans of re-implementing that functionality atm_ in the vanilla/simple version of TrueTime.

Do also note, if TrueTime fails to initialize (because of the above exception being thrown), then an `IllegalStateException` is thrown if you try to request an actual date via `TrueTime.now()`.

# License

```
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

   http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
```


text:
# Breeze

Create Breeze tasks from Zendesk tickets.

## Description
Breeze is a simple visual tool for project management . It shows you what's being worked on, who's working on what, where things are in the workflow and how much time it took. Breeze is simple on the surface, but has everything you need to get work done - tasks, to-dos, time tracking, estimates, budgets, files, calendars, reports and more. If you don’t already have an account, sign up  at https://www.breeze.pm

Now it's easier to share tasks between Breeze and Zendesk. Once the Breeze App is enabled through the Zendesk App Marketplace, simply open a ticket and the Breeze widget will appear to the right. From there, you can add the ticket to an existing task, or create a new one. You can choose the project, list and the task where the ticket will be added.

## How to install

### Private App

To upload and install your private app in your instance of Zendesk Support

1. Click the Admin icon (   ) in the sidebar, then select Apps > Manage .
2. Click Upload App .
3. Enter a Name for the app.
   This is the name your agents will see.
4. Click Choose file and select the zip file for your private app.
   You can find the zip file on the releases page on Github https://github.com/breezepm/zendesk/releases
5. Click Save .
6. In the pop-up box that appears, click Agree and upload this App .
7. When prompted, click Install .
  When the process is complete, your private app appears in the list of installed apps on the Manage Apps page.

### Public App

Installation of the Breeze App is simple. Go to the Apps Marketplace under the Admin panel in Zendesk. Find the Breeze App and click the Install button.

Once you’ve installed the App, navigate to a ticket, click Apps on the top-right, and you should see the Breeze App. If you are not logged in to the Breeze web app, you are asked to log in.

Zendesk agents must be logged in to Breeze with their own accounts to use the App.

repository: breezepm/zendesk

repo_name: breezepm/zendesk


text:
# Quality control

## Getting product status from Quality Control

It's possible to retrieve the approval status of a product using the method `getAllQcStatus` with the following parameters:

- `$limit`: The maximum number of Qc Statuses that could be returned. The default value is 100. `Optional`
- `$offset`: Number of Qc Statuses to skip. The default is 0. `Optional`

**Note: If none of those parameters is passed, the entire QC status list will be returned.**

```php
// Get ten quality control status skipping onex1
$qcStatuses = $sdk->qualityControl()->getAllQcStatus(10, 1);
```
----------------

If it's necessary, there is the possibility of specifying the seller's SKU whose quality control status is needed.
The `getQcStatusBySkuSellerList` method adds one extra parameter which is the SKU array:

- `$skuSellerList`: A list of strings representing product's SKU. `Required`
- `$limit`: The maximum number of Qc Statuses that could be returned. The default value is 100. `Optional`
- `$offset`: Number of Qc Statuses to skip. The default is 0. `Optional`

```php
$sellerSkus = ['Sku1', 'Sku2', 'Sku3'];

// Get quality control status of specified products
$qcStatuses = $sdk->qualityControl()->getQcStatusBySkuSellerList($sellerSkus);
```

repository: LinioIT/seller-center-sdk

repo_name: LinioIT/seller-center-sdk


text:
# Nested Edge Configuration

[Kevin Hilcher's documentation](https://github.com/Azure/CertsForIoT-B)

Use this command to test.  Look for SANS
```
echo | \
    openssl s_client -connect <IP_ADDRESS>:8883 2>/dev/null | \
    openssl x509 -text
```
Make sure this is pointing to the parent's IP:
```
X509v3 Subject Alternative Name:
DNS:iotedgeapiproxy, IP Address:<IP_ADDRESS>
```

This documentation sets things up for you: [Tutorial: Create a hierarchy of IoT Edge devices](https://docs.microsoft.com/en-us/azure/iot-edge/tutorial-nested-iot-edge?view=iotedge-2020-11)

## Parent TOML
```
hostname = "<IPOfDevice>"
trust_bundle_cert = "file:///IoTEdgeCerts/azure-iot-test-only.root.ca.cert.pem"

[provisioning]
source = "manual"
connection_string = "HostName=<IoTHubName>.azure-devices.net;DeviceId=<DeviceName>;SharedAccessKey=<key>"

[edge_ca]
cert = "file:///IoTEdgeCerts/iot-edge-device-ca-<CA cert name>-full-chain.cert.pem"
pk = "file:///IoTEdgeCerts/iot-edge-device-ca-<CA cert name>.key.pem"
```

## Child TOML
```
parent_hostname = "<ParentIPAddress>"
trust_bundle_cert = "file:///IoTEdgeCerts/azure-iot-test-only.root.ca.cert.pem"

[agent.config]
image = "<ParentIPAddress>:8000/azureiotedge-agent:1.2.0-rc4"

[provisioning]
source = "manual"
connection_string = "HostName=<IoTHubName>.azure-devices.net;DeviceId=<DeviceName>;SharedAccessKey=<key>"

[edge_ca]
cert = "file:///IoTEdgeCerts/iot-edge-device-ca-<CA cert name>-full-chain.cert.pem"
pk = "file:///IoTEdgeCerts/iot-edge-device-ca-<CA cert name>.key.pem"
```

repository: terrymandin/QuickReference

repo_name: terrymandin/QuickReference


text:
SCOUT LOG 1.0
[License for ScoutLog](LICENSE)
### Inital Phase
Log in its inital phase is to help the scout master keep track of scouts and their badges. It allows an interactive
use of an app between the scout master, the scout and the badges. Badges are easy to identify and collect by their look as well as their name. Scouts and their ranking are avaiable to review as well as addinig new scouts.

### Application 1.1 and beyond
Future implimentation includes adding requirements to each badge. As it expands, the app would allow scouts insight into their development. It will also allow parents access to the scout's progress. The app would also allow communication between scouts as well as within the troup orginization. additional features would include lat/long mapping features and trip planning.

### Why Scout Log
Inspiration for designing the app began more than 10 years ago when my newphew started scouts. The journey was exciting for him and cumbersome for my sister. She had to remember what he was exploring and making sure he completed the requirements. There are web-based app that require interaction with the web app. This app is mobile with ultimate conectivity to the offical Scout website. It will provide paperless documentation needed by Boy Scouts of America.

### Stories

Scout

This app is great. I can track how many badges I have earned and see which one I want to earn. I don’t have to carry by book all the time.  It lets me notify my scout master as well as my parents. I like being able to show my accomplishments.

Scout Master

As a scout master, this app will help me keep track of the scouts in my group. It will also allow me to keep track of each scout and their goals. There are reminders for reviews and it allows me to leave then stack of paperwork at home. I now have my scout information in my phone.

Parent

I love the convince of having the information about my scout on my phone. It is easy to maintain their goals without nagging them to find out what’s next.

### Instructions
The app is userfriendly and a simple layout. Secure sign-in with Google Sign-in. Once signed in, the scout master has a list of scouts, an "Add a scout" button to add new scouts to the data-base.The badge button provides the name of the badge and, the ability to add a badge to a scout.

### Instructions for build
* Clone/download the repository From github by coping the URL.
* Import the project into an Integrated development environment(IDE) - Intellij IDEA.
* Checkout from version control selecting "git".
* Paste the URL and select a directory to save the project and clone the project.
* Using Intellij, open project, build and the app should be reqady to continue.
### WireFrames

[wireFrame](https://xd.adobe.com/view/f3522612-c826-4301-671a-217fb8debcc1-8563/)

[ERD](ScoutLog ERD.pdf)

### ScoutLog/licenses

implementation 'org.apache.commons:commons-csv:1.6'
implementation 'com.android.support:recyclerview-v7:27.1.1
implementation 'com.facebook.stetho:stetho:1.5.0'
implementation 'com.squareup.picasso:picasso:2.71828'
annotationProcessor 'android.arch.persistence.room:compiler:1.1.1'
implementation 'android.arch.persistence.room:runtime:1.1.1'
implementation 'de.hdodenhof:circleimageview:2.2.0'
implementation 'com.google.android.gms:play-services-auth:16.0.1'

Circleimage view
https://github.com/hdodenhof/CircleImageView/blob/master/LICENSE.txt

Picasso
http://square.github.io/picasso/

Stetho
https://github.com/facebook/stetho/blob/master/LICENSE

Wikipedia

Boy Scouts of America (BSA)

### Java Docs
[Java docs](docs)

repository: Dinarabanal/ScoutLog

gha_language: Java

repo_name: Dinarabanal/ScoutLog


text:
# Begonia maxwelliana King SPECIES

#### Status
ACCEPTED

#### According to
International Plant Names Index

#### Published in
J. Asiat. Soc. Bengal, Pt. 2, Nat. Hist. 71(2):66. 1902

#### Original name
null

### Remarks
null

repository: mdoering/backbone

repo_name: mdoering/backbone


text:
# 98. Validate Binary Search Tree

```
Given a binary tree, determine if it is a valid binary search tree (BST).

Assume a BST is defined as follows:

The left subtree of a node contains only nodes with keys less than the node's key.
The right subtree of a node contains only nodes with keys greater than the node's key.
Both the left and right subtrees must also be binary search trees.

Example 1:

    2
   / \
  1   3

Input: [2,1,3]
Output: true
Example 2:

    5
   / \
  1   4
     / \
    3   6

Input: [5,1,4,null,null,3,6]
Output: false
Explanation: The root node's value is 5 but its right child's value is 4.
```

## Idea

Remember not only compare with upper level, there is a min_val and max_val.

## Solution

```python
class Solution:
    def isValidBST(self, root: TreeNode) -> bool:
        return self.valid_helper(root, float('inf'), float('-inf'))

    def valid_helper(self, root, max_val, min_val):
        if not root:
            return True
        if root.val >= max_val or root.val <= min_val:
            return False
        return self.valid_helper(root.left, root.val, min_val) and self.valid_helper(root.right, max_val, root.val)

```

url: https://raw.githubusercontent.com/Mellcap/LeetCode_Python/bb25a3ed113357a2e41aec2c66d4f106f133b392/w3_nonlinear_datastructure/98. Validate Binary Search Tree.md

filename: 98. Validate Binary Search Tree.md


text:
# Use Lazy type in Microsoft Dependency Injection

This example shows how to register types encapsulated using [Lazy Type](https://docs.microsoft.com/en-us/dotnet/api/system.lazy-1?view=net-5.0). This is very useful if you are registering large or resource-intensive object.

repository: dodyg/practical-aspnetcore

gha_language: C#

repo_name: dodyg/practical-aspnetcore


text:
---
title: 'Quick Note: A New Python IDE for Data Work (& RStudio Lovers)'
date: 2016-01-25 00:00:00 Z
layout: post
type: post
author: Nathaniel
---

Just a quick heads-up: I've been using __[Yhat's new Python IDE, Rodeo](https://www.yhat.com/products/rodeo)__, which is pretty awesome for data-centric work.

I've been looking for a Python-based environment that feels like __[good ol' RStudio](https://www.rstudio.com)__, an IDE for R that I keep returning to even over advanced text editors. Like RStudio, Rodeo crucially lets you preview active objects in your environment and view plots while editing away:

repository: nathanlane/ubuild-jekyll

repo_name: nathanlane/ubuild-jekyll


text:
# Refactoring Check List
## Composing Method
[x] Inline Temp
[x] Remove Assignments to Parameters
[x] Replace Temp with Query
[x] Split Temporay Variable
[x] Substitute Algorithm

## Simplifying Conditional Expressions
[x] Consolidate Conditional Expression
[x] Consolidate Duplicated Conditional Fragments
[x] Decompose Conditional
[x] Remove Control Flag
[x] Replace Conditional with Guard Clauses

## Simplifying Method Calls
[x] Add Parameter

repository: sheltonsuen/refactoring

repo_name: sheltonsuen/refactoring


text:
# swipe_to

SwipeTo is a wrapper for a chat view widget which can be used initiate callback when user horizontally swipe on it.

## Getting Started
To use this packages, you just simply need to wrap your child component in `SwipeTo` widget and pass a `VoidCallback` that you can carry forward with your task.

In the `pubspec.yaml` of your flutter project, add the following dependency:

```yaml
dependencies:
  ...
  swipe_to: 0.0.1+3
```

In your library add the following import:

```dart
import 'package:swipe_to/swipe_to.dart';
```
# Parameter Info
* **child** : (@required) `StateLess` or `StateFull` flutter widget.
* **callBack** : (@required) callback which will be initiated at the end of swipe animation
* **swipeDirection** : Enum value from [``swipeToLeft``, ``swipeToRight``] only. Make sure to pass relative Offset value according to passed ``swipeDirection`` value. If not specified ``swipeToRight`` will be taken as default
* **animationDuration** : Duration value to define animation duration. if not specidifed default is **150 milliseconds**
* **iconData** : IconData that will be displayed beneath child widget. if not specified default is `Icons.reply`
* **iconSize** : double value defining size of displayed icon beneath child widget. if not specified default it will take **26**
* **iconColor** : color value defining color of displayed icon beneath child widget. if not specified `primaryColor` from theme will be taken
* **endOffset** : Offset value till which position of child widget will get animated. if not specified **Offset(0.3, 0.0)** default will be taken

Wrap your desired widget with `SwipeTo`.
**Example** : **SwipeToRight**
```dart
SwipeTo(
    swipeDirection: SwipeDirection.swipeToRight,
    endOffset: Offset(0.3, 0.0),
    child: Container(
        padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0),
        child: Text('Hey You! Swipe me right 👉🏿'),
    ),
    callBack: () {
        print('Callback from Swipe To Right');
    },
),
```
**Example** : **SwipeToLeft**
```dart
SwipeTo(
    swipeDirection: SwipeDirection.swipeToLeft,
    endOffset: Offset(-0.3, 0.0),
    child: Container(
        padding: const EdgeInsets.symmetric(vertical: 10.0, horizontal: 8.0),
        child: Text('👈🏿 Hey You! Swipe me Left'),
    ),
    callBack: () {
        print('Callback from Swipe To Left');
    },
),
```
## Sample Outputs

This project is a starting point for a Dart
[package](https://flutter.dev/developing-packages/),
a library module containing code that can be shared easily across
multiple Flutter or Dart projects.

For help getting started with Flutter, view our
[online documentation](https://flutter.dev/docs), which offers tutorials,
samples, guidance on mobile development, and a full API reference.

repository: mjserrato/SwipeTo

repo_name: mjserrato/SwipeTo


text:
# Vipps: Getting Started

These are the steps after you have received in the onboarding email from Vipps.
You should have received proper credentials with username on email and password on the admin-phonenumber.
Use those credentials to log into Vipps Developer Portal in either Test or Production.

For in-depth information about the Vipps Developer Portal, see the PDF manual: https://github.com/vippsas/vipps-developers

# Step 0

Make sure you have an active subscription to the relevant Vipps product(s): https://www.vipps.no/bedrift

We have sign-up pages for those who know what they want (https://vippsbedrift.no/signup/)
and also a "Find your Vipps" product selector: https://www.vipps.no/bedrift/vippshjelper.

For general questions about products, please use the contact form: https://www.vipps.no/bedrift/kontakt-oss

# Step 1

We start with the main page for the Test portal (https://apitest-portal.vipps.no/) and the sign-in screen (please note that WooCommerce customers do not get access to the test environment, just production):

![Frontpage](images/devportal-test-home.png)

![Sign in](images/devportal-test-signin.png)

You type in your username and password here:

![Sign in](images/devportal-test-login-username.png)

On first sign-in to the test-developer portal, you will be asked for verification. You can skip this process by clicking the "Cancel" button. (This only works for test)

![Verification](images/devportal-test-verification.png)

Please note the difference between the Test and Production environments,
both in appearance and login credentials:

## Test environment: Purple

The test environment has a purple header:

![Vipps Developer Portal: Test](images/devportal-test-home.png)

* Vipps Developer Portal URL: https://apitest-portal.vipps.no/
* A username that looks like this<EMAIL_ADDRESS>* A default password.

Please note that WooCommerce customers do not get access to the test environment, just production.

## Production environment: Orange

The production environment has an orange header:

![Vipps Developer Portal: Production](images/devportal-prod-home.png)

* Vipps Developer Portal URL: https://api-portal.vipps.no/
* A username that looks like this<EMAIL_ADDRESS>* A default password.

For password changes in either test or production, please [contact us](contact.md).

## Remember to log out of other Microsoft accounts

![Azure Error](images/devportal-test-login-azure-error.png)

If you get an error page similar to the one above:

1. Make sure that you are logged out of any Microsoft accounts, such as Office 365 accounts, _**or**_ make sure you are in "incognito mode" or "private window" in your browser.
2. Make sure you are using the correct URL and credentials for the Vipps Developer Portal: Test or Production.

# Step 2

After an successful log in you will see the account name in the top right corner of the screen ("FIRSTNAME LASTNAME" in this example). On the left you have several tabs.
The **"MANAGE USERS"** tab allows you to add users:

When adding a new developer, note that we don't support non-Latin characters such as
_**æ**_,_**ø**_,_**å**_. Adding a name like "_**Bjørn**_" will result in error.
This can be solved by using "_**Bjorn**_" instead.

![Users](images/devportal-test-users.png)

![Users: Add](images/devportal-test-users-add.png)

# Step 3

## Your first Access Token
This guide will use Postman as the guiding tool, but the reader may use other RESTful request solutions to follow this guide. The API documentation for each product is accessible from that products API github page found on the [Vipps organization](https://github.com/vippsas/) page. The documentation for a Access Token request may be acquired from the [Access Token documentation](https://vippsas.github.io/vipps-ecom-api/#/Authorization_Service/fetchAuthorizationTokenUsingPost), or as a part of other API documentations.

## Where are my credentials?
To get your two first API keys, open the **"APPLICATIONS"** tab (in a new browser tab)
and click on the correct sale unit number (`merchantSerialNumber`).
You will find both `client_id` and `client_secret`.

![Applications](images/devportal-test-applications.png)

![keys applications](images/devportal-test-applications-viewsecrets.png)

Under the tab **"REGISTER APPLICATION"** it should say, marked in red: 'All existing products have been subscribed':

![registerapplication](images/devportal-test-registerapplication.png)

If you need more Vipps test products, please [contact us](contact.md).

To get the last API key needed for a Access Token request you will need to access the profile tab. This tab is accessed by selecting your account name in the top right(FIRSTNAME LASTNAME in the image bellow), and then selecting PROFILE. On this tab you will find your `Ocp-Apim-Subscription-Key` under DEFAULT_ACCESSTOKEN.

**Note:** For new eCommerce merchants you may only have one key for the product `Vipps-eCommerce-Services-API` that should be used for both Access Token requests and product requests.

![Profile](images/devportal-test-profile.png)

### Overview for keys needed for a Access Token request
| Keys              |  Value                                       |
|-------------------|----------------------------------------------|
| `Ocp-Apim-Subscription-Key` | Go to Developer Portal -> Click on your name on top right -> select profile -> find subscription named `DEFAULT_ACCESSTOKEN` and copy the value from Primary key here. **Note:** For new eCommerce merchants you may only have one key for the product `Vipps-eCommerce-Services-API` that should be used for both Access Token requests and product requests. |
| `client_id`  | Go to Developer Portal -> Select the Applications tab -> Select View secret for your application -> `Client Id`|
| `client_secret` | Go to Developer Portal -> Select the Applications tab -> Select View secret for your application -> `Client secret`|

## Using Postman to fetch Access Tokens

[Postman](https://www.getpostman.com/)
is a common tool for working with REST APIs. We offer a
[Postman Collection](https://www.getpostman.com/collection)
for most of our products, to make development easier.
See the
[Postman documentation](https://www.getpostman.com/docs/)
for more information about using Postman.

By following the steps below, you can make calls to the Access Token
endpoint, and see the full `request` and `response` for the calls. While in [Step 4](#step-4) we show how to proceed with a full order using the eCommerce API.

### Setting up Postman
We will only provide a quick guide to setting up Postman here, for a more complete guide with pictures please see the [Postman Guide](https://github.com/vippsas/vipps-developers/blob/master/postman-guide.md).

As all transaction with our API's require a Access Token we include a Access Token request in some of our Postman collections and environments. We will use the Access Token request from the eCommerce Postman collection and environment in this guide, as it will be used as example in [Step 4](#step-4).

#### Step 1: Import the Postman Collection

1. Click `Import` in the upper left corner.
2. Import the [vipps-ecom-api-postman-collection.json](https://raw.githubusercontent.com/vippsas/vipps-ecom-api/master/tools/vipps-ecom-api-postman-collection.json) file

#### Step 2: Import the Postman Environment

1. Click `Import` in the upper left corner.
2. Import the [vipps-ecom-api-postman-enviroment.json](https://raw.githubusercontent.com/vippsas/vipps-ecom-api/master/tools/vipps-ecom-api-postman-enviroment.json) file

#### Step 3: Setup Postman Environment

1. Click the "eye" icon in the top right corner.
2. In the dropdown window, click `Edit` in the top right corner.
3. Fill in the `Current Value` for the following fields to get started.
   - `Ocp-Apim-Subscription-Key-Access-Token`
   - `client_id`
   - `client_secret`

#### Obtaining an Access Token with Postman

Make a `Get Access Token` call by selecting the `Get Access Token` call, and click send.
The test script in the Postman request will then add the Access Token from the response to the `Authorization` environment variable.

# Step 4

## Our mobile test apps
The test apps for iOS and Android are identical to the production apps, but connects to the Vipps the [Vipps test environment (MT)](https://github.com/vippsas/vipps-developers#the-vipps-test-environment-mt) instead of the production environment.

The test apps does not need any activation codes and all PIN codes including verifying your number is `1236`. See the [Vipps test apps information](https://github.com/vippsas/vipps-developers#vipps-test-apps) for more information and detailed instructions.

The android app is available at this app center link: https://install.appcenter.ms/orgs/vipps/apps/vipps-android/distribution_groups/mt%20testers

The iOS test app is available at Testflight: https://testflight.apple.com/join/hTAYrwea
## Your first product call
We will in this step show how to make a transaction using the eCommerce API, but using the API's for our other products should be similar.

### Resources and guides for products
| Product | Resource             |
|---------|----------------------|
| Vipps Invoice         | [Github Page](https://github.com/vippsas/vipps-invoice-api), [Guide](https://github.com/vippsas/vipps-invoice-api/blob/master/vipps-invoice-api.md), [Swagger IPP](https://vippsas.github.io/vipps-invoice-api/ipp.html), [Swagger ISP](https://vippsas.github.io/vipps-invoice-api/isp.html)   |
| Vipps PSP             | [Github Page](https://github.com/vippsas/vipps-psp-api), [Guide](https://github.com/vippsas/vipps-psp-api/blob/master/vipps-psp-api.md), [Swagger](https://vippsas.github.io/vipps-psp-api/)       |
| Vipps Recurring       | [Github Page](https://github.com/vippsas/vipps-recurring-api), [Guide](https://github.com/vippsas/vipps-recurring-api/blob/master/vipps-recurring-api.md), [Swagger](https://github.com/vippsas/vipps-recurring-api) |
| Vipps eCommerce v2    | [Github Page](https://github.com/vippsas/vipps-ecom-api), [Guide](https://github.com/vippsas/vipps-ecom-api/blob/master/vipps-ecom-api.md), [Swagger](https://vippsas.github.io/vipps-ecom-api/) |

### Values required for eCommerce transactions
| Keys              |  Value                                       |
|-------------------|----------------------------------------------|
| `orderId`                                 | Max length 30 characters string created by the merchant. |
| `Authorization`                           | "Bearer" followed by the Access Token obtained from the Get Access Token call (example: `"Bearer Im5iQ3dXMTF3M1hrQi14VWFYd0t <snip>"`)|
| `merchantSerialNumber`                    | Go to Developer Portal -> Select the Applications tab -> Copy the Saleunit Serial Number from your application |
| `Ocp-Apim-Subscription-Key` For eCommerce | Go to Developer Portal -> Click on your name on top right -> Select profile -> find subscription relevant to your product and copy the Primary key across |
| `amount`                                  | The amount in øre that the customer should pay. |
| `fallBack`                                | The URL that the landing page will redirect after |
| `callbackPrefix`                          | The URL that Vipps will send callback requests to |

### From initiate to capture using Postman
#### Product request -  Step 1 - access token
Acquire a `access_token`as shown in [Step 3](#Step-3).

#### Product request -  Step 2 - additional values
Fill in the `Current Value` for the values provided in the [values table](#values-required-for-ecommerce-transactions), where `Ocp-Apim-Subscription-Key` is `Ocp-Apim-Subscription-Key-Ecom` in the Postman environment.

#### Product request -  Step 3 - initiate payment
Select Initiate Payment and send. This will return a `url` that will take the user to the Vipps landing page. To proceed to the next step the user will have to accept on this landing page and in the app. See the [Vipps Developers README page](https://github.com/vippsas/vipps-developers#the-vipps-test-environment-mt) for information about acquiring the test apps.

#### Product request -  Step 4 - reserved
##### Product request - Step 4.1 - callback
When the customer has accepted the payment, or the payment failed, Vipps will send a callback to `callbackPrefix`/v2/payments/`orderId`. As Postman does not support callbacks, we will not use it in this example. Please read the corresponding section about callbacks for the relevant product (for eCommerce see [this link](https://github.com/vippsas/vipps-ecom-api/blob/master/vipps-ecom-api.md#callback)).

##### Product request - Step 4.1 - details request
The details request endpoint provided by the eCommerce API allows you to get the history and current status of a order. If you have initiated a order in Postman all variables should have been set, so to send the request select the request and send.

###### Example response from Get Details request
```json
{
    "orderId": "2103894920912387234",
    "transactionSummary": {
        "capturedAmount": 0,
        "remainingAmountToCapture": 200,
        "refundedAmount": 0,
        "remainingAmountToRefund": 0
    },
    "transactionLogHistory": [
        {
            "amount": 200,
            "transactionText": "Transaction initiated through Postman",
            "transactionId": "5002662892",
            "timeStamp": "2019-01-23T10:02:14.513Z",
            "operation": "RESERVE",
            "requestId": "",
            "operationSuccess": true
        },
        {
            "amount": 200,
            "transactionText": "Transaction initiated through Postman",
            "transactionId": "5002662892",
            "timeStamp": "2019-01-23T10:01:14.123Z",
            "operation": "INITIATE",
            "requestId": "",
            "operationSuccess": true
        }
    ]
}
```
#### Product request -  Step 5 - capture payment
When a order has been identified as reserved, the merchant will need to capture the amount. The captured amount is as default set int the Postman environment to 0, as this corresponds to capturing the entire amount.

##### Example response from Capture request
```json
{
    "orderId": "2107251548843709260",
    "transactionInfo": {
        "amount": 200,
        "timeStamp": "2019-01-30T10:24:01.562Z",
        "transactionText": "Transaction captured through Postman",
        "status": "Captured",
        "transactionId": "5001448147"
    },
    "transactionSummary": {
        "capturedAmount": 200,
        "remainingAmountToCapture": 0,
        "refundedAmount": 0,
        "remainingAmountToRefund": 200
    }
}
```

## Summary

Now you should have `Client_id`, `Client_secret`, `Access Token Subscription Key`, `Product Subscription Key` and `merchantSerialNumber`.

**Important**: While doing payments you will use the `Product Subscription Key` and when getting the access token you will use the `Access Token Subscription Key`.

repository: ljliburd/vipps-developers

repo_name: ljliburd/vipps-developers


text:
kaplot
======

kaplot is a plotting tool built around matplotlib. It combines the flexibilty and fantastic plot
generation potention of matplotlib with an easier to use, object oriented, interface. The interface
is simple enough to quickly prototype plots, or fine tune for publication quality results.

Detailed documentation is hosted on [GitHub](http://kamilm.github.io/kaplot). The package contains 2 modules:

- kaplot is the main module, which contains the kaplot class for plotting.
    - kaplot.defaults is a submodule which contains a couple of pre-made plot settings, which
      are passed as an argument to the kaplot object. More information (including making your
      own settings file) is available in the documentation
- kaplot_backend is a module which allows for selecting a custom `matplotlib` [backend](http://matplotlib.org/faq/usage_faq.html#what-is-a-backend).

repository: kamilm/kaplot

gha_language: Python

repo_name: kamilm/kaplot


text:
# Backup Script

[![Software License](https://img.shields.io/badge/license-MIT-brightgreen.svg?style=flat-square)](LICENSE.md)
[![Latest Version](https://img.shields.io/github/release/jtyost2/S3_Backup.svg?style=flat-square)](https://github.com/jtyost2/S3_Backup/releases)

This script runs and creates daily (stored for 7 days), weekly (stored for 28 days) and monthly (stored for 365 days) of a local webroot and complete database backup of [MySQL](http://www.mysql.com/), [PostgreSQL](http://www.postgresql.org/), [MongoDB](http://www.mongodb.org/) and [SQLite](https://www.sqlite.org/). Each is tared and gzipped and placed in a directory of your choosing and then optionally synched with an [Amazon S3 Bucket](http://aws.amazon.com/s3/) for off-site storage.

## Installation

- Manual
	- In your local directory type: `wget http://github.com/jtyost2/S3_Backup/zipball/master`
	- Unzip that download.

- Git Clone
	- In your local directory type: `git clone git://github.com/jtyost2/S3_Backup.git S3_Backup`

## Usage

### Prerequisite Tools

1. Command Line S3 Client: [http://s3tools.org/s3cmd](http://s3tools.org/s3cmd)
2. Optional AmazonS3 Bucket: [http://aws.amazon.com/s3/](http://aws.amazon.com/s3/)

### Setup

There is a batch of configuration settings needed to get this running. These are in the `config.sh.default` shell script and none of the them need to be in quotes (as far as I have tested). Copy and rename the `config.sh.default` to `config.sh` and set the values to your particular setup. Copy and rename the `tar_exclude.txt.default` to `tar_exclude.txt` and add any paths/files to be excluded from the tar backup to this file.

## Possible Issues When Using

1. S3Cmd needs to be configured first before use
2. Recommend use case for running this is via a cron job, ensure the user the cron is running under has access to run the script and the correct permissions for access.

## Contributing

### Reporting Issues

Please use GitHub Issues for listing any known defects or issues

### Development

When working on this script, please fork and issue a PR for any new development.

### Reporting Issues

Please use [GitHub Isuses](https://github.com/jtyost2/S3_Backup/issues) for listing any known defects or issues.

## License ##

[MIT](https://github.com/jtyost2/S3_Backup/blob/master/LICENSE.md)

## Copyright ##

[Justin Yost](https://www.yostivanich.com/) 2015


text:
**THIS PROJECT IS NO LONGER MAINTAINED by clebert.**

# mocha-cov-reporter

> [Deprecated] A code coverage reporter for [Mocha](http://visionmedia.github.io/mocha/)/[Blanket.js](http://blanketjs.org).

## Getting Started

### Installation

```sh
npm install mocha-cov-reporter --save-dev
```

### Integration

Please add the following fields to your project's `package.json` file:

```json
{
    "config": {
        "mocha-cov-reporter": {
            "failOnError": true,
            "threshold": 100,
            "useColors": true
        }
    }
}
```

## Sample Output

```
Coverage succeeded: 100% >= 100% (SLOC 85)
```

```
Coverage below threshold: 75% < 100% (SLOC 85)
```

## Running Tests

To run the test suite first install the development dependencies:

```sh
npm install
```

then run the tests:

```sh
npm test
```

repository: clebert/mocha-cov-reporter

repo_name: clebert/mocha-cov-reporter


text:
# Angular2 Component Generation Extension for Atom

## Description
Extension automatically creates folder for angular2 component containing :
- `component.ts`
- `module.ts`
- `component.html`
- `component.css`

## Usage

- Right click on on the file or folder in the explorer
- Select "New Angular2 Component"
- Enter component name in the pop up in camelCase

![Use Extension](https://media.giphy.com/media/l3vR4BrhHp3DzihQA/source.gif)

## Configuration
- create true / false - (controls weather to generate this file or not)
- extension - extension of generated file (e.g. you might want to change "scss" to just plain "css")
- template - path to the custom template for the generated file
    - {selector}    -> replaced with `lower case, dash separated string`
    - {templateUrl} -> replaced with `${selector}.component.html`
    - {styleUrls}   -> replaced with `${selector}.component.css`
    - {className}   -> replaced with `componentName in PascalCase`

Use the "template" key to override default templates for the extension

```javascript
ng2ComponentGenerator:
  files:
    component:
      create: true
      extension: "ts"
      template: "${workspaceRoot}/my.template"
    css:
      create: true
      extension: "scss"
    html:
      create: true
      extension: "html"
    module:
      create: true
      extension: "ts"
```
![Config Extension](https://media.giphy.com/media/3oz8xyuAbBHOWJP2Ba/source.gif)

## Bugs

Please report [here](https://github.com/dbaikov/vscode-angular2-component-generator/issues)


text:
# REACT EASY SWIPE
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fleandrowd%2Freact-easy-swipe.svg?type=shield)](https://app.fossa.io/projects/git%2Bgithub.com%2Fleandrowd%2Freact-easy-swipe?ref=badge_shield)

Add swipe interactions to your react component.
* Generated using [react-init](https://www.npmjs.com/package/react-init)

## Demo
[http://leandrowd.github.io/react-easy-swipe/](http://leandrowd.github.io/react-easy-swipe/)
- Open your console;
- Swipe over the content and check your console;
- This is a touch component so make sure your browser is emulating touch.

## Tips:

1) To prevent scroll during swipe, return true from the handler passed to onSwipeMove

2) To allow mouse events to behave like touch, pass a prop allowMouseEvents

3) To prevent accidental swipes on scroll, pass a prop tolerance with the tolerance pixel as number.

## Instalation
`npm install react-easy-swipe --save`

## Usage
```javascript
import React, {Component} from 'react';
import ReactDOM from 'react-dom';
import Swipe from 'react-easy-swipe';

class MyComponent extends Component {
  onSwipeStart(event) {
    console.log('Start swiping...', event);
  }

  onSwipeMove(position, event) {
    console.log(`Moved ${position.x} pixels horizontally`, event);
    console.log(`Moved ${position.y} pixels vertically`, event);
  }

  onSwipeEnd(event) {
    console.log('End swiping...', event);
  }

  render() {
    const boxStyle = {
      width: '100%',
      height: '300px',
      border: '1px solid black',
      background: '#ccc',
      padding: '20px',
      fontSize: '3em'
    };

    return (
      <Swipe
        onSwipeStart={this.onSwipeStart}
        onSwipeMove={this.onSwipeMove}
        onSwipeEnd={this.onSwipeEnd}>
          <div style={boxStyle}>Open the console and swipe me</div>
      </Swipe>
    );
  }
}

ReactDOM.render(<MyComponent/>, document.getElementById('root'));

```

## Properties

```javascript
{
  tagName: PropTypes.string,
  className: PropTypes.string,
  style: PropTypes.object,
  children: PropTypes.node,
  allowMouseEvents: PropTypes.bool,
  onSwipeUp: PropTypes.func,
  onSwipeDown: PropTypes.func,
  onSwipeLeft: PropTypes.func,
  onSwipeRight: PropTypes.func,
  onSwipeStart: PropTypes.func,
  onSwipeMove: PropTypes.func,
  onSwipeEnd: PropTypes.func,
  tolerance: PropTypes.number.isRequired
}
```

## Contributing

Please, feel free to contribute. You may open a bug, request a feature, submit a pull request or whatever you want!

## License
[![FOSSA Status](https://app.fossa.io/api/projects/git%2Bgithub.com%2Fleandrowd%2Freact-easy-swipe.svg?type=large)](https://app.fossa.io/projects/git%2Bgithub.com%2Fleandrowd%2Freact-easy-swipe?ref=badge_large)

repository: leandrowd/react-easy-swipe

repo_name: leandrowd/react-easy-swipe